From 4332254b3694d65f95a89c0bd2a1fadebc075b39 Mon Sep 17 00:00:00 2001 From: WiderDev Date: Wed, 22 Jul 2026 20:42:53 +0300 Subject: [PATCH] Include server.ts in typecheck; drop unused AgentContext fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit server.ts built AgentContext objects with sentiment, sentimentScore, entities, category, and urgency — none of which are declared on AgentContext or ever read by SmartAgent (agent-core.ts only touches complaintId, rawText, userName, and previousComments). Rather than widen the interface with fields nothing consumes, drop them from the two call sites in server.ts. Also add server.ts to tsconfig's include so CI's tsc --noEmit actually covers the Express entrypoint, and widen rootDir to "." since server.ts lives outside src/ (rootDir only affects emit layout; nothing in the build/Docker path reads dist/, so this is safe). --- server.ts | 10 ---------- tsconfig.json | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/server.ts b/server.ts index 8f90e1e..254c6b1 100644 --- a/server.ts +++ b/server.ts @@ -1216,11 +1216,6 @@ app.post('/api/agent/process', async (req, res) => { complaintId: node.id, complaintTitle: node.title || d.displayTitle, rawText: d.rawText || '', - sentiment: d.sentiment || 'neutral', - sentimentScore: d.sentimentScore || 0, - entities: d.entities || { persons: [], places: [], organizations: [] }, - category: d.category || '', - urgency: d.urgency || 'medium', userName: d.userName || 'مستخدم', userId: d.userId || '', previousComments: d.comments || [], @@ -1252,11 +1247,6 @@ app.post('/api/agent/process-all-new', async (req, res) => { complaintId: comp.id, complaintTitle: comp.title || d.displayTitle, rawText: d.rawText || '', - sentiment: d.sentiment || 'neutral', - sentimentScore: d.sentimentScore || 0, - entities: d.entities || { persons: [], places: [], organizations: [] }, - category: d.category || '', - urgency: d.urgency || 'medium', userName: d.userName || 'مستخدم', userId: d.userId || '', previousComments: d.comments || [], diff --git a/tsconfig.json b/tsconfig.json index 73a4c11..1286394 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,9 +6,9 @@ "esModuleInterop": true, "strict": true, "outDir": "./dist", - "rootDir": "./src", + "rootDir": ".", "skipLibCheck": true, "resolveJsonModule": true }, - "include": ["src/**/*"] + "include": ["src/**/*", "server.ts"] }