Skip to content

Commit ba4d0bb

Browse files
Include server.ts in typecheck; drop unused AgentContext fields (#3)
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).
1 parent 4b455da commit ba4d0bb

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

server.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,11 +1216,6 @@ app.post('/api/agent/process', async (req, res) => {
12161216
complaintId: node.id,
12171217
complaintTitle: node.title || d.displayTitle,
12181218
rawText: d.rawText || '',
1219-
sentiment: d.sentiment || 'neutral',
1220-
sentimentScore: d.sentimentScore || 0,
1221-
entities: d.entities || { persons: [], places: [], organizations: [] },
1222-
category: d.category || '',
1223-
urgency: d.urgency || 'medium',
12241219
userName: d.userName || 'مستخدم',
12251220
userId: d.userId || '',
12261221
previousComments: d.comments || [],
@@ -1252,11 +1247,6 @@ app.post('/api/agent/process-all-new', async (req, res) => {
12521247
complaintId: comp.id,
12531248
complaintTitle: comp.title || d.displayTitle,
12541249
rawText: d.rawText || '',
1255-
sentiment: d.sentiment || 'neutral',
1256-
sentimentScore: d.sentimentScore || 0,
1257-
entities: d.entities || { persons: [], places: [], organizations: [] },
1258-
category: d.category || '',
1259-
urgency: d.urgency || 'medium',
12601250
userName: d.userName || 'مستخدم',
12611251
userId: d.userId || '',
12621252
previousComments: d.comments || [],

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"esModuleInterop": true,
77
"strict": true,
88
"outDir": "./dist",
9-
"rootDir": "./src",
9+
"rootDir": ".",
1010
"skipLibCheck": true,
1111
"resolveJsonModule": true
1212
},
13-
"include": ["src/**/*"]
13+
"include": ["src/**/*", "server.ts"]
1414
}

0 commit comments

Comments
 (0)