@nexus-cortex/server 4.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/.cortex/agents/AGENT_PROFILE_GUIDE.md +307 -0
  2. package/.cortex/agents/README.md +268 -0
  3. package/.cortex/agents/a-frontend-landing-page-designer.md +41 -0
  4. package/.cortex/agents/autoresearch-agent.md +49 -0
  5. package/.cortex/agents/code-reviewer.md +63 -0
  6. package/.cortex/agents/context-research.md +26 -0
  7. package/.cortex/agents/doc-writer.md +92 -0
  8. package/.cortex/agents/explore.md +63 -0
  9. package/.cortex/agents/new-model-api-integrator-analyst.md +41 -0
  10. package/.cortex/agents/plan.md +109 -0
  11. package/.cortex/agents/pr-architecture-reviewer.md +77 -0
  12. package/.cortex/agents/pr-code-quality.md +78 -0
  13. package/.cortex/agents/pr-implementer.md +50 -0
  14. package/.cortex/agents/pr-security-auditor.md +62 -0
  15. package/.cortex/agents/pr-test-writer.md +67 -0
  16. package/.cortex/agents/refactor.md +118 -0
  17. package/.cortex/agents/test-writer.md +72 -0
  18. package/.cortex/agents/web-researcher.md +72 -0
  19. package/.cortex/bench/tasks/sample-tasks.json +20 -0
  20. package/.cortex/commands/compare.md +14 -0
  21. package/.cortex/commands/deps.md +16 -0
  22. package/.cortex/commands/diff.md +14 -0
  23. package/.cortex/commands/explain.md +16 -0
  24. package/.cortex/commands/find-bug.md +13 -0
  25. package/.cortex/commands/profile.md +15 -0
  26. package/.cortex/commands/review.md +18 -0
  27. package/.cortex/commands/search.md +16 -0
  28. package/.cortex/commands/test.md +15 -0
  29. package/.cortex/permissions.dev.json +20 -0
  30. package/.cortex/permissions.example.json +71 -0
  31. package/.cortex/permissions.prod.json +63 -0
  32. package/.cortex/permissions.test.json +19 -0
  33. package/.cortex/skills/autoresearch/SKILL.md +77 -0
  34. package/.cortex/skills/autoresearch/personas/README.md +45 -0
  35. package/.cortex/skills/autoresearch/personas/aggressive-refactor.md +25 -0
  36. package/.cortex/skills/autoresearch/personas/creative.md +29 -0
  37. package/.cortex/skills/autoresearch/personas/perf-hunter.md +27 -0
  38. package/.cortex/skills/autoresearch/personas/precise.md +23 -0
  39. package/.cortex/skills/autoresearch/personas/root-cause.md +26 -0
  40. package/.cortex/skills/autoresearch/personas/security-auditor.md +29 -0
  41. package/.cortex/skills/autoresearch/personas/skeptic-reviewer.md +31 -0
  42. package/.cortex/skills/autoresearch/personas/test-first.md +25 -0
  43. package/.cortex/skills/best-of-n/SKILL.md +76 -0
  44. package/.cortex/skills/cortex/SKILL.md +834 -0
  45. package/.cortex/skills/cortex-bench/SKILL.md +354 -0
  46. package/.cortex/skills/docx/SKILL.md +83 -0
  47. package/.cortex/skills/pdf-documents/SKILL.md +297 -0
  48. package/.cortex/skills/pdf-documents/sections/01-image-acquisition.md +132 -0
  49. package/.cortex/skills/pdf-documents/sections/02-ai-image-generation.md +274 -0
  50. package/.cortex/skills/pdf-documents/sections/03-paper-sizes.md +89 -0
  51. package/.cortex/skills/pdf-documents/sections/04-design-system.md +549 -0
  52. package/.cortex/skills/pdf-documents/sections/05-css-print-rules.md +135 -0
  53. package/.cortex/skills/pdf-documents/sections/06-svg-charts.md +100 -0
  54. package/.cortex/skills/pdf-documents/sections/07-templates.md +224 -0
  55. package/.cortex/skills/pdf-documents/sections/08-scaled-output.md +164 -0
  56. package/.cortex/skills/pdf-documents/sections/09-preview-qa.md +66 -0
  57. package/.cortex/skills/pdf-documents/sections/10-reading-pdfs.md +499 -0
  58. package/.cortex/skills/pdf-documents/sections/11-form-filling.md +241 -0
  59. package/.cortex/skills/pptx/SKILL.md +90 -0
  60. package/.cortex/skills/resume-analyst/SKILL.md +373 -0
  61. package/.cortex/skills/verify-work/SKILL.md +74 -0
  62. package/.cortex/skills/xlsx/SKILL.md +101 -0
  63. package/.cortex/system-messages/messages/WORK_QUALITY.md +159 -0
  64. package/.cortex/system-messages/registry.json +18 -0
  65. package/LICENSE +202 -0
  66. package/NOTICE +2 -0
  67. package/README.md +13 -0
  68. package/bin/cortex-daemon.js +47 -0
  69. package/bin/cortex-server.js +15 -0
  70. package/dist/index.d.ts +30 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +513 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/middleware/cors.d.ts +10 -0
  75. package/dist/middleware/cors.d.ts.map +1 -0
  76. package/dist/middleware/cors.js +11 -0
  77. package/dist/middleware/cors.js.map +1 -0
  78. package/dist/middleware/errorHandler.d.ts +10 -0
  79. package/dist/middleware/errorHandler.d.ts.map +1 -0
  80. package/dist/middleware/errorHandler.js +15 -0
  81. package/dist/middleware/errorHandler.js.map +1 -0
  82. package/dist/routes/approval.d.ts +2 -0
  83. package/dist/routes/approval.d.ts.map +1 -0
  84. package/dist/routes/approval.js +96 -0
  85. package/dist/routes/approval.js.map +1 -0
  86. package/dist/routes/config.d.ts +2 -0
  87. package/dist/routes/config.d.ts.map +1 -0
  88. package/dist/routes/config.js +70 -0
  89. package/dist/routes/config.js.map +1 -0
  90. package/dist/routes/health.d.ts +2 -0
  91. package/dist/routes/health.d.ts.map +1 -0
  92. package/dist/routes/health.js +1031 -0
  93. package/dist/routes/health.js.map +1 -0
  94. package/dist/routes/mcp.d.ts +2 -0
  95. package/dist/routes/mcp.d.ts.map +1 -0
  96. package/dist/routes/mcp.js +251 -0
  97. package/dist/routes/mcp.js.map +1 -0
  98. package/dist/routes/messages.d.ts +5 -0
  99. package/dist/routes/messages.d.ts.map +1 -0
  100. package/dist/routes/messages.js +136 -0
  101. package/dist/routes/messages.js.map +1 -0
  102. package/dist/routes/middleware.d.ts +2 -0
  103. package/dist/routes/middleware.d.ts.map +1 -0
  104. package/dist/routes/middleware.js +146 -0
  105. package/dist/routes/middleware.js.map +1 -0
  106. package/dist/routes/models.d.ts +2 -0
  107. package/dist/routes/models.d.ts.map +1 -0
  108. package/dist/routes/models.js +29 -0
  109. package/dist/routes/models.js.map +1 -0
  110. package/dist/routes/permissions.d.ts +2 -0
  111. package/dist/routes/permissions.d.ts.map +1 -0
  112. package/dist/routes/permissions.js +253 -0
  113. package/dist/routes/permissions.js.map +1 -0
  114. package/dist/routes/pr.d.ts +2 -0
  115. package/dist/routes/pr.d.ts.map +1 -0
  116. package/dist/routes/pr.js +222 -0
  117. package/dist/routes/pr.js.map +1 -0
  118. package/dist/routes/sessions.d.ts +2 -0
  119. package/dist/routes/sessions.d.ts.map +1 -0
  120. package/dist/routes/sessions.js +628 -0
  121. package/dist/routes/sessions.js.map +1 -0
  122. package/dist/routes/system-messages.d.ts +2 -0
  123. package/dist/routes/system-messages.d.ts.map +1 -0
  124. package/dist/routes/system-messages.js +146 -0
  125. package/dist/routes/system-messages.js.map +1 -0
  126. package/dist/routes/tools.d.ts +2 -0
  127. package/dist/routes/tools.d.ts.map +1 -0
  128. package/dist/routes/tools.js +79 -0
  129. package/dist/routes/tools.js.map +1 -0
  130. package/package.json +63 -0
@@ -0,0 +1,628 @@
1
+ /**
2
+ * Session Management Routes
3
+ * Exposes session CRUD operations and checkpoint management
4
+ */
5
+ import { Router } from 'express';
6
+ import { getServerOrchestrator } from './messages.js';
7
+ export const sessionsRouter = Router();
8
+ /**
9
+ * POST /sessions/new
10
+ * Create a new session
11
+ */
12
+ sessionsRouter.post('/sessions/new', async (req, res) => {
13
+ try {
14
+ const orchestrator = getServerOrchestrator();
15
+ if (!orchestrator) {
16
+ return res.status(503).json({
17
+ error: { message: 'Server not initialized', type: 'server_error' }
18
+ });
19
+ }
20
+ const { modelId, projectPath } = req.body;
21
+ const model = modelId || process.env.DEFAULT_MODEL_ID || 'gemini-2.5-flash';
22
+ // Default to PROJECT_ROOT (monorepo root, set at server startup) for consistency
23
+ // with /v1/messages and /sessions/:id/load. Using process.cwd() here was causing
24
+ // metadata to be written to .cortex/sessions/<hash-of-packages-server>/ while
25
+ // resume read from .cortex/sessions/<hash-of-monorepo-root>/, silently dropping
26
+ // chain state + accumulated cache metrics across session restarts.
27
+ const path = projectPath || process.env.PROJECT_ROOT || process.cwd();
28
+ // Create new session (this will save the old one and start fresh)
29
+ await orchestrator.createSession(path, model);
30
+ // Get the new session info
31
+ const currentModel = orchestrator.getCurrentModel();
32
+ const sessionId = orchestrator.currentSessionId;
33
+ res.json({
34
+ success: true,
35
+ sessionId: sessionId || 'unknown',
36
+ model: {
37
+ id: currentModel.id,
38
+ name: currentModel.displayName,
39
+ provider: currentModel.provider,
40
+ contextWindow: currentModel.limits.contextWindow
41
+ },
42
+ created: new Date().toISOString()
43
+ });
44
+ }
45
+ catch (error) {
46
+ res.status(500).json({
47
+ error: { message: error.message, type: 'server_error' }
48
+ });
49
+ }
50
+ });
51
+ /**
52
+ * GET /sessions
53
+ * List all sessions
54
+ */
55
+ sessionsRouter.get('/sessions', async (req, res) => {
56
+ try {
57
+ const orchestrator = getServerOrchestrator();
58
+ if (!orchestrator) {
59
+ return res.status(503).json({
60
+ error: { message: 'Server not initialized', type: 'server_error' }
61
+ });
62
+ }
63
+ // Access JSONLHistoryStore from orchestrator
64
+ const historyStore = orchestrator.historyStore;
65
+ if (!historyStore) {
66
+ return res.status(500).json({
67
+ error: { message: 'History store not available', type: 'server_error' }
68
+ });
69
+ }
70
+ const sessions = await historyStore.listSessions();
71
+ res.json({ sessions });
72
+ }
73
+ catch (error) {
74
+ res.status(500).json({
75
+ error: { message: error.message, type: 'server_error' }
76
+ });
77
+ }
78
+ });
79
+ /**
80
+ * GET /sessions/:id
81
+ * Get session details
82
+ */
83
+ sessionsRouter.get('/sessions/:id', async (req, res) => {
84
+ try {
85
+ const { id } = req.params;
86
+ const orchestrator = getServerOrchestrator();
87
+ if (!orchestrator) {
88
+ return res.status(503).json({
89
+ error: { message: 'Server not initialized', type: 'server_error' }
90
+ });
91
+ }
92
+ const historyStore = orchestrator.historyStore;
93
+ if (!historyStore) {
94
+ return res.status(500).json({
95
+ error: { message: 'History store not available', type: 'server_error' }
96
+ });
97
+ }
98
+ const sessionInfo = await historyStore.getSessionInfo(id);
99
+ if (!sessionInfo) {
100
+ return res.status(404).json({
101
+ error: { message: `Session ${id} not found`, type: 'not_found' }
102
+ });
103
+ }
104
+ res.json(sessionInfo);
105
+ }
106
+ catch (error) {
107
+ res.status(500).json({
108
+ error: { message: error.message, type: 'server_error' }
109
+ });
110
+ }
111
+ });
112
+ /**
113
+ * GET /sessions/:id/messages
114
+ * Get all messages from a session
115
+ */
116
+ sessionsRouter.get('/sessions/:id/messages', async (req, res) => {
117
+ try {
118
+ const { id } = req.params;
119
+ const orchestrator = getServerOrchestrator();
120
+ if (!orchestrator) {
121
+ return res.status(503).json({
122
+ error: { message: 'Server not initialized', type: 'server_error' }
123
+ });
124
+ }
125
+ const historyStore = orchestrator.historyStore;
126
+ if (!historyStore) {
127
+ return res.status(500).json({
128
+ error: { message: 'History store not available', type: 'server_error' }
129
+ });
130
+ }
131
+ const messages = await historyStore.loadSession(id);
132
+ res.json({ messages });
133
+ }
134
+ catch (error) {
135
+ res.status(500).json({
136
+ error: { message: error.message, type: 'server_error' }
137
+ });
138
+ }
139
+ });
140
+ /**
141
+ * GET /sessions/:id/export
142
+ * Export session to JSON
143
+ */
144
+ sessionsRouter.get('/sessions/:id/export', async (req, res) => {
145
+ try {
146
+ const { id } = req.params;
147
+ const orchestrator = getServerOrchestrator();
148
+ if (!orchestrator) {
149
+ return res.status(503).json({
150
+ error: { message: 'Server not initialized', type: 'server_error' }
151
+ });
152
+ }
153
+ const historyStore = orchestrator.historyStore;
154
+ if (!historyStore) {
155
+ return res.status(500).json({
156
+ error: { message: 'History store not available', type: 'server_error' }
157
+ });
158
+ }
159
+ const sessionInfo = await historyStore.getSessionInfo(id);
160
+ if (!sessionInfo) {
161
+ return res.status(404).json({
162
+ error: { message: `Session ${id} not found`, type: 'not_found' }
163
+ });
164
+ }
165
+ const messages = await historyStore.loadSession(id);
166
+ res.json({
167
+ sessionId: id,
168
+ metadata: sessionInfo.metadata,
169
+ messageCount: sessionInfo.messageCount,
170
+ messages
171
+ });
172
+ }
173
+ catch (error) {
174
+ res.status(500).json({
175
+ error: { message: error.message, type: 'server_error' }
176
+ });
177
+ }
178
+ });
179
+ /**
180
+ * DELETE /sessions/:id
181
+ * Delete a session
182
+ */
183
+ sessionsRouter.delete('/sessions/:id', async (req, res) => {
184
+ try {
185
+ const { id } = req.params;
186
+ const orchestrator = getServerOrchestrator();
187
+ if (!orchestrator) {
188
+ return res.status(503).json({
189
+ error: { message: 'Server not initialized', type: 'server_error' }
190
+ });
191
+ }
192
+ const historyStore = orchestrator.historyStore;
193
+ if (!historyStore) {
194
+ return res.status(500).json({
195
+ error: { message: 'History store not available', type: 'server_error' }
196
+ });
197
+ }
198
+ const deleted = await historyStore.deleteSession(id);
199
+ if (!deleted) {
200
+ return res.status(404).json({
201
+ error: { message: `Session ${id} not found`, type: 'not_found' }
202
+ });
203
+ }
204
+ res.json({ success: true, sessionId: id });
205
+ }
206
+ catch (error) {
207
+ res.status(500).json({
208
+ error: { message: error.message, type: 'server_error' }
209
+ });
210
+ }
211
+ });
212
+ /**
213
+ * GET /sessions/:id/checkpoints
214
+ * List all checkpoints for a session
215
+ */
216
+ sessionsRouter.get('/sessions/:id/checkpoints', async (req, res) => {
217
+ try {
218
+ const { id } = req.params;
219
+ const orchestrator = getServerOrchestrator();
220
+ if (!orchestrator) {
221
+ return res.status(503).json({
222
+ error: { message: 'Server not initialized', type: 'server_error' }
223
+ });
224
+ }
225
+ const checkpointManager = orchestrator.checkpointManager;
226
+ if (!checkpointManager) {
227
+ return res.status(500).json({
228
+ error: { message: 'Checkpoint manager not available', type: 'server_error' }
229
+ });
230
+ }
231
+ const checkpoints = checkpointManager.listCheckpoints();
232
+ res.json({ checkpoints });
233
+ }
234
+ catch (error) {
235
+ res.status(500).json({
236
+ error: { message: error.message, type: 'server_error' }
237
+ });
238
+ }
239
+ });
240
+ /**
241
+ * POST /sessions/:id/load
242
+ * Switch to a different session (load its history into the orchestrator)
243
+ */
244
+ sessionsRouter.post('/sessions/:id/load', async (req, res) => {
245
+ try {
246
+ const { id } = req.params;
247
+ const orchestrator = getServerOrchestrator();
248
+ if (!orchestrator) {
249
+ return res.status(503).json({
250
+ error: { message: 'Server not initialized', type: 'server_error' }
251
+ });
252
+ }
253
+ const projectPath = process.env.PROJECT_ROOT || process.cwd();
254
+ const result = await orchestrator.resumeSession(id, projectPath);
255
+ res.json({
256
+ success: true,
257
+ sessionId: id,
258
+ messageCount: result.messageCount,
259
+ modelId: result.modelId,
260
+ conversationId: result.conversationId
261
+ });
262
+ }
263
+ catch (error) {
264
+ res.status(500).json({
265
+ error: { message: error.message, type: 'server_error' }
266
+ });
267
+ }
268
+ });
269
+ /**
270
+ * POST /sessions/:id/resume
271
+ * Resume from a checkpoint
272
+ */
273
+ sessionsRouter.post('/sessions/:id/resume', async (req, res) => {
274
+ try {
275
+ const { id } = req.params;
276
+ const { checkpointId } = req.body;
277
+ if (!checkpointId) {
278
+ return res.status(400).json({
279
+ error: { message: 'checkpointId is required', type: 'invalid_request' }
280
+ });
281
+ }
282
+ const orchestrator = getServerOrchestrator();
283
+ if (!orchestrator) {
284
+ return res.status(503).json({
285
+ error: { message: 'Server not initialized', type: 'server_error' }
286
+ });
287
+ }
288
+ const checkpointManager = orchestrator.checkpointManager;
289
+ if (!checkpointManager) {
290
+ return res.status(500).json({
291
+ error: { message: 'Checkpoint manager not available', type: 'server_error' }
292
+ });
293
+ }
294
+ const result = await checkpointManager.resumeFromCheckpoint(checkpointId, {
295
+ sessionId: id
296
+ });
297
+ res.json({
298
+ success: true,
299
+ checkpoint: result.checkpoint,
300
+ conversation: result.conversation,
301
+ messageCount: result.messages.length
302
+ });
303
+ }
304
+ catch (error) {
305
+ res.status(500).json({
306
+ error: { message: error.message, type: 'server_error' }
307
+ });
308
+ }
309
+ });
310
+ /**
311
+ * GET /sessions/:id/stats
312
+ * Get session statistics
313
+ */
314
+ sessionsRouter.get('/sessions/:id/stats', async (req, res) => {
315
+ try {
316
+ const { id } = req.params;
317
+ const orchestrator = getServerOrchestrator();
318
+ if (!orchestrator) {
319
+ return res.status(503).json({
320
+ error: { message: 'Server not initialized', type: 'server_error' }
321
+ });
322
+ }
323
+ const historyStore = orchestrator.historyStore;
324
+ if (!historyStore) {
325
+ return res.status(500).json({
326
+ error: { message: 'History store not available', type: 'server_error' }
327
+ });
328
+ }
329
+ const sessionInfo = await historyStore.getSessionInfo(id);
330
+ if (!sessionInfo) {
331
+ return res.status(404).json({
332
+ error: { message: `Session ${id} not found`, type: 'not_found' }
333
+ });
334
+ }
335
+ const messages = await historyStore.loadSession(id);
336
+ // Calculate statistics
337
+ const userMessages = messages.filter((m) => m.role === 'user').length;
338
+ const assistantMessages = messages.filter((m) => m.role === 'assistant').length;
339
+ const toolUses = messages.filter((m) => m.content && Array.isArray(m.content) &&
340
+ m.content.some((c) => c.type === 'tool_use')).length;
341
+ // Calculate token usage (if available in messages)
342
+ let totalInputTokens = 0;
343
+ let totalOutputTokens = 0;
344
+ let totalCacheReadTokens = 0;
345
+ let totalCacheWriteTokens = 0;
346
+ for (const message of messages) {
347
+ if (message.usage) {
348
+ const usage = message.usage;
349
+ totalInputTokens += usage.input_tokens || 0;
350
+ totalOutputTokens += usage.output_tokens || 0;
351
+ totalCacheReadTokens += usage.cache_read_input_tokens || 0;
352
+ totalCacheWriteTokens += usage.cache_creation_input_tokens || 0;
353
+ }
354
+ }
355
+ res.json({
356
+ sessionId: id,
357
+ metadata: sessionInfo.metadata,
358
+ messageCount: sessionInfo.messageCount,
359
+ userMessages,
360
+ assistantMessages,
361
+ turnCount: Math.min(userMessages, assistantMessages),
362
+ toolUses,
363
+ tokens: {
364
+ input: totalInputTokens,
365
+ output: totalOutputTokens,
366
+ cacheRead: totalCacheReadTokens,
367
+ cacheWrite: totalCacheWriteTokens,
368
+ total: totalInputTokens + totalOutputTokens + totalCacheReadTokens
369
+ },
370
+ fileSize: sessionInfo.fileSize,
371
+ created: sessionInfo.metadata.startTime,
372
+ lastModified: sessionInfo.lastModified
373
+ });
374
+ }
375
+ catch (error) {
376
+ res.status(500).json({
377
+ error: { message: error.message, type: 'server_error' }
378
+ });
379
+ }
380
+ });
381
+ /**
382
+ * POST /sessions/:id/model
383
+ * Switch to a different model
384
+ */
385
+ sessionsRouter.post('/sessions/:id/model', async (req, res) => {
386
+ try {
387
+ const { id } = req.params;
388
+ const { modelId, reason } = req.body;
389
+ if (!modelId) {
390
+ return res.status(400).json({
391
+ error: { message: 'modelId is required', type: 'invalid_request' }
392
+ });
393
+ }
394
+ const orchestrator = getServerOrchestrator();
395
+ if (!orchestrator) {
396
+ return res.status(503).json({
397
+ error: { message: 'Server not initialized', type: 'server_error' }
398
+ });
399
+ }
400
+ // Switch model
401
+ await orchestrator.switchModel(modelId, { reason });
402
+ // Get current model info
403
+ const currentModel = orchestrator.getCurrentModel();
404
+ res.json({
405
+ success: true,
406
+ sessionId: id,
407
+ modelId: currentModel.id,
408
+ modelName: currentModel.displayName,
409
+ provider: currentModel.provider,
410
+ contextWindow: currentModel.limits.contextWindow,
411
+ reason
412
+ });
413
+ }
414
+ catch (error) {
415
+ res.status(500).json({
416
+ error: { message: error.message, type: 'server_error' }
417
+ });
418
+ }
419
+ });
420
+ /**
421
+ * GET /sessions/:id/context
422
+ * Get context budget status
423
+ */
424
+ sessionsRouter.get('/sessions/:id/context', async (req, res) => {
425
+ try {
426
+ const { id } = req.params;
427
+ const orchestrator = getServerOrchestrator();
428
+ if (!orchestrator) {
429
+ return res.status(503).json({
430
+ error: { message: 'Server not initialized', type: 'server_error' }
431
+ });
432
+ }
433
+ const contextBudgetManager = orchestrator.contextBudgetManager;
434
+ if (!contextBudgetManager) {
435
+ return res.status(500).json({
436
+ error: { message: 'Context budget manager not available', type: 'server_error' }
437
+ });
438
+ }
439
+ const currentModel = orchestrator.getCurrentModel();
440
+ const budget = contextBudgetManager.calculateBudget(currentModel);
441
+ // Estimate current token usage
442
+ const messageHistory = orchestrator.getMessageHistory();
443
+ let estimatedTokens = 0;
444
+ try {
445
+ // Estimate total tokens from message history
446
+ estimatedTokens = contextBudgetManager['estimateTotalTokens'](messageHistory, currentModel);
447
+ }
448
+ catch (e) {
449
+ // Fallback: rough estimation
450
+ estimatedTokens = Math.floor(JSON.stringify(messageHistory).length / 4);
451
+ }
452
+ const utilization = budget.maxTokens > 0 ? (estimatedTokens / budget.maxTokens) * 100 : 0;
453
+ res.json({
454
+ sessionId: id,
455
+ model: {
456
+ id: currentModel.id,
457
+ name: currentModel.displayName,
458
+ contextWindow: currentModel.limits.contextWindow
459
+ },
460
+ budget: {
461
+ maxTokens: budget.maxTokens,
462
+ reservedForOutput: budget.reservedForOutput,
463
+ availableForInput: budget.availableForInput,
464
+ systemMessageAllocation: budget.systemMessageAllocation
465
+ },
466
+ usage: {
467
+ estimatedTokens,
468
+ utilization: Math.round(utilization * 100) / 100,
469
+ remaining: Math.max(0, budget.availableForInput - estimatedTokens)
470
+ }
471
+ });
472
+ }
473
+ catch (error) {
474
+ res.status(500).json({
475
+ error: { message: error.message, type: 'server_error' }
476
+ });
477
+ }
478
+ });
479
+ /**
480
+ * GET /sessions/:id/cache/metrics
481
+ * Get cache metrics for session
482
+ */
483
+ sessionsRouter.get('/sessions/:id/cache/metrics', async (req, res) => {
484
+ try {
485
+ const { id } = req.params;
486
+ const orchestrator = getServerOrchestrator();
487
+ if (!orchestrator) {
488
+ return res.status(503).json({
489
+ error: { message: 'Server not initialized', type: 'server_error' }
490
+ });
491
+ }
492
+ const currentSessionId = orchestrator.getSessionId();
493
+ // If requesting current session, get live metrics from orchestrator
494
+ if (id === currentSessionId) {
495
+ const metrics = orchestrator.getCacheMetrics();
496
+ const report = orchestrator.getCacheReport();
497
+ return res.json({
498
+ sessionId: id,
499
+ metrics,
500
+ report,
501
+ timestamp: new Date().toISOString()
502
+ });
503
+ }
504
+ // For historical sessions, load from session metadata file
505
+ const historyStore = orchestrator.historyStore;
506
+ if (!historyStore) {
507
+ return res.status(500).json({
508
+ error: { message: 'History store not available', type: 'server_error' }
509
+ });
510
+ }
511
+ const metadata = await historyStore.loadMetadata(id);
512
+ if (!metadata || !metadata.cacheMetrics) {
513
+ return res.json({
514
+ sessionId: id,
515
+ metrics: null,
516
+ report: 'No cache metrics available for this session',
517
+ timestamp: new Date().toISOString()
518
+ });
519
+ }
520
+ // Generate report from saved metrics
521
+ const m = metadata.cacheMetrics;
522
+ const reportLines = [
523
+ '=== Cache Performance Report ===\n',
524
+ `Total Requests: ${m.requestCount}`,
525
+ `Requests with Cache Hits: ${m.requestsWithCacheHits}\n`,
526
+ `Total Input Tokens: ${m.totalInputTokens.toLocaleString()}`,
527
+ ` - Cache Creation: ${m.totalCacheCreationTokens.toLocaleString()}`,
528
+ ` - Cache Reads: ${m.totalCacheReadTokens.toLocaleString()} (${(m.overallCacheHitRate * 100).toFixed(1)}%)`,
529
+ ` - Uncached: ${m.totalUncachedInputTokens.toLocaleString()}\n`,
530
+ `Total Output Tokens: ${m.totalOutputTokens.toLocaleString()}\n`,
531
+ `Overall Cache Hit Rate: ${(m.overallCacheHitRate * 100).toFixed(1)}%`,
532
+ `Estimated Cost Savings: ${(m.overallCostSavingsRatio * 100).toFixed(1)}%`
533
+ ];
534
+ if (Object.keys(m.byProvider || {}).length > 0) {
535
+ reportLines.push('\n=== By Provider ===');
536
+ for (const [provider, pm] of Object.entries(m.byProvider)) {
537
+ reportLines.push(`\n${provider}:`);
538
+ reportLines.push(` Requests: ${pm.requestCount}`);
539
+ reportLines.push(` Cache Reads: ${pm.cacheReadTokens.toLocaleString()}`);
540
+ if (pm.cacheCreationTokens > 0) {
541
+ reportLines.push(` Cache Creation: ${pm.cacheCreationTokens.toLocaleString()}`);
542
+ }
543
+ reportLines.push(` Hit Rate: ${(pm.cacheHitRate * 100).toFixed(1)}%`);
544
+ }
545
+ }
546
+ res.json({
547
+ sessionId: id,
548
+ metrics: metadata.cacheMetrics,
549
+ report: reportLines.join('\n'),
550
+ timestamp: new Date().toISOString()
551
+ });
552
+ }
553
+ catch (error) {
554
+ res.status(500).json({
555
+ error: { message: error.message, type: 'server_error' }
556
+ });
557
+ }
558
+ });
559
+ /**
560
+ * POST /sessions/:id/compaction
561
+ * Trigger manual compaction
562
+ */
563
+ sessionsRouter.post('/sessions/:id/compaction', async (req, res) => {
564
+ try {
565
+ const { id } = req.params;
566
+ const { strategy } = req.body; // optional: 'aggressive', 'conservative', etc.
567
+ const orchestrator = getServerOrchestrator();
568
+ if (!orchestrator) {
569
+ return res.status(503).json({
570
+ error: { message: 'Server not initialized', type: 'server_error' }
571
+ });
572
+ }
573
+ const compactionManager = orchestrator.compactionManager;
574
+ if (!compactionManager) {
575
+ return res.status(500).json({
576
+ error: { message: 'Compaction manager not available', type: 'server_error' }
577
+ });
578
+ }
579
+ // Trigger manual compaction
580
+ // Note: This is a placeholder - actual implementation depends on compactionManager API
581
+ const result = await compactionManager.performManualCompaction?.(strategy);
582
+ res.json({
583
+ success: true,
584
+ sessionId: id,
585
+ strategy: strategy || 'default',
586
+ result: result || { message: 'Compaction triggered' }
587
+ });
588
+ }
589
+ catch (error) {
590
+ res.status(500).json({
591
+ error: { message: error.message, type: 'server_error' }
592
+ });
593
+ }
594
+ });
595
+ /**
596
+ * GET /sessions/:id/compaction/boundaries
597
+ * Get compaction boundaries
598
+ */
599
+ sessionsRouter.get('/sessions/:id/compaction/boundaries', async (req, res) => {
600
+ try {
601
+ const { id } = req.params;
602
+ const orchestrator = getServerOrchestrator();
603
+ if (!orchestrator) {
604
+ return res.status(503).json({
605
+ error: { message: 'Server not initialized', type: 'server_error' }
606
+ });
607
+ }
608
+ const compactionManager = orchestrator.compactionManager;
609
+ if (!compactionManager) {
610
+ return res.status(500).json({
611
+ error: { message: 'Compaction manager not available', type: 'server_error' }
612
+ });
613
+ }
614
+ // Get compaction boundaries
615
+ const boundaries = await compactionManager.getCompactionBoundaries?.();
616
+ res.json({
617
+ sessionId: id,
618
+ boundaries: boundaries || [],
619
+ count: boundaries?.length || 0
620
+ });
621
+ }
622
+ catch (error) {
623
+ res.status(500).json({
624
+ error: { message: error.message, type: 'server_error' }
625
+ });
626
+ }
627
+ });
628
+ //# sourceMappingURL=sessions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../src/routes/sessions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,EAAE,CAAC;AAEvC;;;GAGG;AACH,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IACzE,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,qBAAqB,EAAE,CAAC;QAC7C,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBAC1B,KAAK,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,IAAI,EAAE,cAAc,EAAE;aACnE,CAAC,CAAC;QACL,CAAC;QAED,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;QAC1C,MAAM,KAAK,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,kBAAkB,CAAC;QAC5E,iFAAiF;QACjF,iFAAiF;QACjF,8EAA8E;QAC9E,gFAAgF;QAChF,mEAAmE;QACnE,MAAM,IAAI,GAAG,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAEtE,kEAAkE;QAClE,MAAM,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAE9C,2BAA2B;QAC3B,MAAM,YAAY,GAAG,YAAY,CAAC,eAAe,EAAE,CAAC;QACpD,MAAM,SAAS,GAAI,YAAoB,CAAC,gBAAgB,CAAC;QAEzD,GAAG,C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,CAAC;YACvB,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBAC1B,KAAK,EAAE,EAAE,OAAO,EAAE,kCAAkC,EAAE,IAAI,EAAE,cAAc,EAAE;aAC7E,CAAC,CAAC;QACL,CAAC;QAED,4BAA4B;QAC5B,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC,uBAAuB,EAAE,EAAE,CAAC;QAEvE,GAAG,CAAC,IAAI,CAAC;YACP,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,UAAU,IAAI,EAAE;YAC5B,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;SAC/B,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACnB,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE;SACxD,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const systemMessagesRouter: import("express-serve-static-core").Router;
2
+ //# sourceMappingURL=system-messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-messages.d.ts","sourceRoot":"","sources":["../../src/routes/system-messages.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB,4CAAW,CAAC"}