@0xmaxma/claude-gateway 2.0.4 → 2.0.6

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 (276) hide show
  1. package/README.md +10 -1
  2. package/dist/agent/builtin-commands.d.ts +1 -1
  3. package/dist/agent/builtin-commands.d.ts.map +1 -1
  4. package/dist/agent/builtin-commands.js +3 -2
  5. package/dist/agent/builtin-commands.js.map +1 -1
  6. package/dist/agent/runner.d.ts +123 -9
  7. package/dist/agent/runner.d.ts.map +1 -1
  8. package/dist/agent/runner.js +215 -182
  9. package/dist/agent/runner.js.map +1 -1
  10. package/dist/agent/session-compaction-scheduler.d.ts +22 -0
  11. package/dist/agent/session-compaction-scheduler.d.ts.map +1 -0
  12. package/dist/agent/session-compaction-scheduler.js +40 -0
  13. package/dist/agent/session-compaction-scheduler.js.map +1 -0
  14. package/dist/agent/skill-learning/index.d.ts.map +1 -1
  15. package/dist/agent/skill-learning/index.js +27 -8
  16. package/dist/agent/skill-learning/index.js.map +1 -1
  17. package/dist/agent/skill-learning/reviewer.d.ts +3 -1
  18. package/dist/agent/skill-learning/reviewer.d.ts.map +1 -1
  19. package/dist/agent/skill-learning/reviewer.js +6 -2
  20. package/dist/agent/skill-learning/reviewer.js.map +1 -1
  21. package/dist/agent/turn-stream.d.ts +3 -1
  22. package/dist/agent/turn-stream.d.ts.map +1 -1
  23. package/dist/agent/turn-stream.js +8 -4
  24. package/dist/agent/turn-stream.js.map +1 -1
  25. package/dist/api/gateway-router.d.ts +2 -0
  26. package/dist/api/gateway-router.d.ts.map +1 -1
  27. package/dist/api/gateway-router.js +323 -16
  28. package/dist/api/gateway-router.js.map +1 -1
  29. package/dist/api/memory-activity.d.ts +18 -0
  30. package/dist/api/memory-activity.d.ts.map +1 -0
  31. package/dist/api/memory-activity.js +97 -0
  32. package/dist/api/memory-activity.js.map +1 -0
  33. package/dist/api/router.js +11 -11
  34. package/dist/api/router.js.map +1 -1
  35. package/dist/api/slack-webhook-router.js +1 -1
  36. package/dist/api/slack-webhook-router.js.map +1 -1
  37. package/dist/api/voice-router.d.ts +1 -0
  38. package/dist/api/voice-router.d.ts.map +1 -1
  39. package/dist/api/voice-router.js +129 -7
  40. package/dist/api/voice-router.js.map +1 -1
  41. package/dist/config/claude-settings.d.ts +14 -0
  42. package/dist/config/claude-settings.d.ts.map +1 -1
  43. package/dist/config/claude-settings.js +20 -0
  44. package/dist/config/claude-settings.js.map +1 -1
  45. package/dist/orchestration/agent-cli-session.d.ts +46 -0
  46. package/dist/orchestration/agent-cli-session.d.ts.map +1 -0
  47. package/dist/orchestration/agent-cli-session.js +121 -0
  48. package/dist/orchestration/agent-cli-session.js.map +1 -0
  49. package/dist/orchestration/agent-tool-schemas.d.ts +6 -0
  50. package/dist/orchestration/agent-tool-schemas.d.ts.map +1 -0
  51. package/dist/orchestration/agent-tool-schemas.js +23 -0
  52. package/dist/orchestration/agent-tool-schemas.js.map +1 -0
  53. package/dist/orchestration/bridge.d.ts +6 -3
  54. package/dist/orchestration/bridge.d.ts.map +1 -1
  55. package/dist/orchestration/bridge.js +31 -14
  56. package/dist/orchestration/bridge.js.map +1 -1
  57. package/dist/orchestration/browser-voice.d.ts +14 -0
  58. package/dist/orchestration/browser-voice.d.ts.map +1 -0
  59. package/dist/orchestration/browser-voice.js +30 -0
  60. package/dist/orchestration/browser-voice.js.map +1 -0
  61. package/dist/orchestration/compact-measurements.d.ts +21 -0
  62. package/dist/orchestration/compact-measurements.d.ts.map +1 -0
  63. package/dist/orchestration/compact-measurements.js +62 -0
  64. package/dist/orchestration/compact-measurements.js.map +1 -0
  65. package/dist/orchestration/config.d.ts +4 -0
  66. package/dist/orchestration/config.d.ts.map +1 -1
  67. package/dist/orchestration/config.js +1 -1
  68. package/dist/orchestration/config.js.map +1 -1
  69. package/dist/orchestration/context-delivery.d.ts +32 -0
  70. package/dist/orchestration/context-delivery.d.ts.map +1 -0
  71. package/dist/orchestration/context-delivery.js +101 -0
  72. package/dist/orchestration/context-delivery.js.map +1 -0
  73. package/dist/orchestration/context-footprint.d.ts +14 -0
  74. package/dist/orchestration/context-footprint.d.ts.map +1 -0
  75. package/dist/orchestration/context-footprint.js +57 -0
  76. package/dist/orchestration/context-footprint.js.map +1 -0
  77. package/dist/orchestration/conversation-intake.d.ts +10 -6
  78. package/dist/orchestration/conversation-intake.d.ts.map +1 -1
  79. package/dist/orchestration/conversation-intake.js +22 -8
  80. package/dist/orchestration/conversation-intake.js.map +1 -1
  81. package/dist/orchestration/dashboard-charts.d.ts +32 -0
  82. package/dist/orchestration/dashboard-charts.d.ts.map +1 -0
  83. package/dist/orchestration/dashboard-charts.js +77 -0
  84. package/dist/orchestration/dashboard-charts.js.map +1 -0
  85. package/dist/orchestration/dashboard-reader-worker.d.ts +2 -0
  86. package/dist/orchestration/dashboard-reader-worker.d.ts.map +1 -0
  87. package/dist/orchestration/dashboard-reader-worker.js +173 -0
  88. package/dist/orchestration/dashboard-reader-worker.js.map +1 -0
  89. package/dist/orchestration/dashboard-reader.d.ts +15 -0
  90. package/dist/orchestration/dashboard-reader.d.ts.map +1 -0
  91. package/dist/orchestration/dashboard-reader.js +87 -0
  92. package/dist/orchestration/dashboard-reader.js.map +1 -0
  93. package/dist/orchestration/decision-context.d.ts +15 -0
  94. package/dist/orchestration/decision-context.d.ts.map +1 -0
  95. package/dist/orchestration/decision-context.js +57 -0
  96. package/dist/orchestration/decision-context.js.map +1 -0
  97. package/dist/orchestration/display-stream.d.ts +21 -2
  98. package/dist/orchestration/display-stream.d.ts.map +1 -1
  99. package/dist/orchestration/display-stream.js +61 -8
  100. package/dist/orchestration/display-stream.js.map +1 -1
  101. package/dist/orchestration/inference-errors.d.ts.map +1 -1
  102. package/dist/orchestration/inference-errors.js +19 -21
  103. package/dist/orchestration/inference-errors.js.map +1 -1
  104. package/dist/orchestration/mutation-recovery.d.ts +13 -0
  105. package/dist/orchestration/mutation-recovery.d.ts.map +1 -0
  106. package/dist/orchestration/mutation-recovery.js +49 -0
  107. package/dist/orchestration/mutation-recovery.js.map +1 -0
  108. package/dist/orchestration/native-compact.d.ts +8 -0
  109. package/dist/orchestration/native-compact.d.ts.map +1 -0
  110. package/dist/orchestration/native-compact.js +33 -0
  111. package/dist/orchestration/native-compact.js.map +1 -0
  112. package/dist/orchestration/notification-mailbox.d.ts +3 -1
  113. package/dist/orchestration/notification-mailbox.d.ts.map +1 -1
  114. package/dist/orchestration/notification-mailbox.js +4 -2
  115. package/dist/orchestration/notification-mailbox.js.map +1 -1
  116. package/dist/orchestration/process-turn.d.ts +16 -2
  117. package/dist/orchestration/process-turn.d.ts.map +1 -1
  118. package/dist/orchestration/process-turn.js +78 -14
  119. package/dist/orchestration/process-turn.js.map +1 -1
  120. package/dist/orchestration/progress-review.d.ts +8 -18
  121. package/dist/orchestration/progress-review.d.ts.map +1 -1
  122. package/dist/orchestration/progress-review.js +12 -14
  123. package/dist/orchestration/progress-review.js.map +1 -1
  124. package/dist/orchestration/provider-message.d.ts +7 -0
  125. package/dist/orchestration/provider-message.d.ts.map +1 -0
  126. package/dist/orchestration/provider-message.js +63 -0
  127. package/dist/orchestration/provider-message.js.map +1 -0
  128. package/dist/orchestration/response-errors.d.ts +6 -0
  129. package/dist/orchestration/response-errors.d.ts.map +1 -0
  130. package/dist/orchestration/response-errors.js +88 -0
  131. package/dist/orchestration/response-errors.js.map +1 -0
  132. package/dist/orchestration/response-schema.d.ts +33 -0
  133. package/dist/orchestration/response-schema.d.ts.map +1 -0
  134. package/dist/orchestration/response-schema.js +61 -0
  135. package/dist/orchestration/response-schema.js.map +1 -0
  136. package/dist/orchestration/runtime.d.ts +79 -0
  137. package/dist/orchestration/runtime.d.ts.map +1 -1
  138. package/dist/orchestration/runtime.js +415 -68
  139. package/dist/orchestration/runtime.js.map +1 -1
  140. package/dist/orchestration/session-compaction.d.ts +59 -0
  141. package/dist/orchestration/session-compaction.d.ts.map +1 -0
  142. package/dist/orchestration/session-compaction.js +212 -0
  143. package/dist/orchestration/session-compaction.js.map +1 -0
  144. package/dist/orchestration/skills.d.ts.map +1 -1
  145. package/dist/orchestration/skills.js +3 -2
  146. package/dist/orchestration/skills.js.map +1 -1
  147. package/dist/orchestration/source-policy.d.ts +1 -1
  148. package/dist/orchestration/source-policy.d.ts.map +1 -1
  149. package/dist/orchestration/source-policy.js +1 -1
  150. package/dist/orchestration/speech.d.ts +15 -17
  151. package/dist/orchestration/speech.d.ts.map +1 -1
  152. package/dist/orchestration/speech.js +90 -30
  153. package/dist/orchestration/speech.js.map +1 -1
  154. package/dist/orchestration/store.d.ts +2 -0
  155. package/dist/orchestration/store.d.ts.map +1 -1
  156. package/dist/orchestration/store.js +16 -1
  157. package/dist/orchestration/store.js.map +1 -1
  158. package/dist/orchestration/tasks/driver.d.ts.map +1 -1
  159. package/dist/orchestration/tasks/driver.js +8 -3
  160. package/dist/orchestration/tasks/driver.js.map +1 -1
  161. package/dist/orchestration/tasks/pool.d.ts.map +1 -1
  162. package/dist/orchestration/tasks/pool.js +8 -4
  163. package/dist/orchestration/tasks/pool.js.map +1 -1
  164. package/dist/orchestration/tasks/service.d.ts +48 -1
  165. package/dist/orchestration/tasks/service.d.ts.map +1 -1
  166. package/dist/orchestration/tasks/service.js +41 -17
  167. package/dist/orchestration/tasks/service.js.map +1 -1
  168. package/dist/orchestration/token-ledger.d.ts +132 -0
  169. package/dist/orchestration/token-ledger.d.ts.map +1 -0
  170. package/dist/orchestration/token-ledger.js +233 -0
  171. package/dist/orchestration/token-ledger.js.map +1 -0
  172. package/dist/orchestration/token-usage.d.ts +46 -0
  173. package/dist/orchestration/token-usage.d.ts.map +1 -0
  174. package/dist/orchestration/token-usage.js +102 -0
  175. package/dist/orchestration/token-usage.js.map +1 -0
  176. package/dist/orchestration/tool-activity.d.ts.map +1 -1
  177. package/dist/orchestration/tool-activity.js +5 -3
  178. package/dist/orchestration/tool-activity.js.map +1 -1
  179. package/dist/orchestration/tool-name.d.ts +10 -0
  180. package/dist/orchestration/tool-name.d.ts.map +1 -0
  181. package/dist/orchestration/tool-name.js +14 -0
  182. package/dist/orchestration/tool-name.js.map +1 -0
  183. package/dist/orchestration/transcript-checkpoint.d.ts +14 -0
  184. package/dist/orchestration/transcript-checkpoint.d.ts.map +1 -0
  185. package/dist/orchestration/transcript-checkpoint.js +83 -0
  186. package/dist/orchestration/transcript-checkpoint.js.map +1 -0
  187. package/dist/orchestration/unanswered-inputs.d.ts +6 -0
  188. package/dist/orchestration/unanswered-inputs.d.ts.map +1 -0
  189. package/dist/orchestration/unanswered-inputs.js +18 -0
  190. package/dist/orchestration/unanswered-inputs.js.map +1 -0
  191. package/dist/session/process.d.ts +10 -0
  192. package/dist/session/process.d.ts.map +1 -1
  193. package/dist/session/process.js +91 -9
  194. package/dist/session/process.js.map +1 -1
  195. package/dist/session/request-tool-capture.d.ts +31 -0
  196. package/dist/session/request-tool-capture.d.ts.map +1 -0
  197. package/dist/session/request-tool-capture.js +194 -0
  198. package/dist/session/request-tool-capture.js.map +1 -0
  199. package/dist/session/runtime-profile.d.ts +7 -3
  200. package/dist/session/runtime-profile.d.ts.map +1 -1
  201. package/dist/session/runtime-profile.js +3 -1
  202. package/dist/session/runtime-profile.js.map +1 -1
  203. package/dist/session/store.d.ts +7 -0
  204. package/dist/session/store.d.ts.map +1 -1
  205. package/dist/session/store.js +27 -0
  206. package/dist/session/store.js.map +1 -1
  207. package/dist/shell/tailer.d.ts +7 -5
  208. package/dist/shell/tailer.d.ts.map +1 -1
  209. package/dist/shell/tailer.js +6 -17
  210. package/dist/shell/tailer.js.map +1 -1
  211. package/dist/types.d.ts +3 -0
  212. package/dist/types.d.ts.map +1 -1
  213. package/dist/ui/cli-viewer-ui.js +1 -1
  214. package/dist/ui/dashboard-charts.d.ts +3 -0
  215. package/dist/ui/dashboard-charts.d.ts.map +1 -0
  216. package/dist/ui/dashboard-charts.js +130 -0
  217. package/dist/ui/dashboard-charts.js.map +1 -0
  218. package/dist/ui/dashboard-client.d.ts +3 -0
  219. package/dist/ui/dashboard-client.d.ts.map +1 -0
  220. package/dist/ui/dashboard-client.js +184 -0
  221. package/dist/ui/dashboard-client.js.map +1 -0
  222. package/dist/ui/dashboard-controls.d.ts +4 -0
  223. package/dist/ui/dashboard-controls.d.ts.map +1 -0
  224. package/dist/ui/dashboard-controls.js +27 -0
  225. package/dist/ui/dashboard-controls.js.map +1 -0
  226. package/dist/ui/dashboard-presentation.d.ts +12 -0
  227. package/dist/ui/dashboard-presentation.d.ts.map +1 -0
  228. package/dist/ui/dashboard-presentation.js +62 -0
  229. package/dist/ui/dashboard-presentation.js.map +1 -0
  230. package/dist/ui/dashboard-range.d.ts +5 -0
  231. package/dist/ui/dashboard-range.d.ts.map +1 -0
  232. package/dist/ui/dashboard-range.js +36 -0
  233. package/dist/ui/dashboard-range.js.map +1 -0
  234. package/dist/ui/dashboard-theme.d.ts +6 -0
  235. package/dist/ui/dashboard-theme.d.ts.map +1 -0
  236. package/dist/ui/dashboard-theme.js +562 -0
  237. package/dist/ui/dashboard-theme.js.map +1 -0
  238. package/dist/ui/memory-activity.d.ts +4 -0
  239. package/dist/ui/memory-activity.d.ts.map +1 -0
  240. package/dist/ui/memory-activity.js +115 -0
  241. package/dist/ui/memory-activity.js.map +1 -0
  242. package/dist/ui/token-report-client.d.ts +3 -0
  243. package/dist/ui/token-report-client.d.ts.map +1 -0
  244. package/dist/ui/token-report-client.js +34 -0
  245. package/dist/ui/token-report-client.js.map +1 -0
  246. package/dist/ui/token-report.d.ts +90 -0
  247. package/dist/ui/token-report.d.ts.map +1 -0
  248. package/dist/ui/token-report.js +203 -0
  249. package/dist/ui/token-report.js.map +1 -0
  250. package/dist/ui/web-ui.d.ts +1 -1
  251. package/dist/ui/web-ui.d.ts.map +1 -1
  252. package/dist/ui/web-ui.js +129 -409
  253. package/dist/ui/web-ui.js.map +1 -1
  254. package/dist/voice/replay.d.ts +8 -0
  255. package/dist/voice/replay.d.ts.map +1 -0
  256. package/dist/voice/replay.js +48 -0
  257. package/dist/voice/replay.js.map +1 -0
  258. package/dist/voice/session.d.ts +9 -0
  259. package/dist/voice/session.d.ts.map +1 -1
  260. package/dist/voice/session.js +72 -14
  261. package/dist/voice/session.js.map +1 -1
  262. package/mcp/lazy-connector.test.ts +58 -0
  263. package/mcp/lazy-connector.ts +67 -0
  264. package/mcp/lazy-tools.test.ts +152 -0
  265. package/mcp/lazy-tools.ts +41 -0
  266. package/mcp/server.ts +53 -34
  267. package/mcp/tools/discord/commands.ts +2 -0
  268. package/mcp/tools/tasks/module.ts +1 -12
  269. package/mcp/tools/telegram/receiver-server.ts +45 -31
  270. package/mcp/tools/telegram/session-browser.ts +10 -0
  271. package/package.json +2 -1
  272. package/resource/dashboard/OFL.txt +93 -0
  273. package/resource/dashboard/poppins-300.woff2 +0 -0
  274. package/resource/dashboard/poppins-400.woff2 +0 -0
  275. package/resource/dashboard/poppins-500.woff2 +0 -0
  276. package/resource/dashboard/poppins-600.woff2 +0 -0
@@ -1,28 +1,18 @@
1
1
  import { OrchestrationStore } from './store';
2
- export declare const PROGRESS_REVIEW_SCHEMA: {
3
- type: string;
4
- additionalProperties: boolean;
5
- properties: {
6
- notify_user: {
7
- type: string;
8
- };
9
- display_text: {
10
- type: string;
11
- maxLength: number;
12
- };
13
- spoken_text: {
14
- type: string;
15
- maxLength: number;
16
- };
17
- };
18
- required: string[];
19
- };
20
2
  export declare const PROGRESS_REVIEW_OVERLAY = "This is an internal progress review, not a request to send a message on every check. Inspect the task and offer scoped advice if needed. Independently decide whether the user needs a new update: a meaningful milestone, changed plan, concrete blocker, or decision they need to make. Routine tool activity, elapsed time, unchanged work and rephrasing the previous report are not new progress. Compare with the previously communicated updates provided as data. If nothing meaningful is new, return {\"notify_user\":false,\"display_text\":\"\",\"spoken_text\":\"\"}. Otherwise return {\"notify_user\":true,\"display_text\":\"natural concise first-person update containing only new information\",\"spoken_text\":\"short spoken version in the same language\"}. This three-field schema overrides the ordinary two-field speech format for this internal review only. Never announce the review, supervision, forwarding advice, or silence decision. Do not send a reassurance that the task is not stuck. A planned next step is not a completed milestone. User questions and completion/failure/input-request notifications are handled separately and must not be suppressed by this policy.";
21
3
  export declare function isProgressReview(store: OrchestrationStore, decisionId: string): boolean;
22
4
  export declare function recentCommunicatedProgress(store: OrchestrationStore, conversationId: string): string[];
5
+ /** A review turn's decision, and WHY it is silent.
6
+ * 'reported' — a new update to publish.
7
+ * 'silent' — the model explicitly chose not to notify; nothing was lost.
8
+ * 'duplicate' — a valid update that repeats one already communicated.
9
+ * 'unparsed' — no valid decision could be read at all. The update (if any) is dropped,
10
+ * so the caller MUST surface it rather than treat it as a quiet review. */
11
+ export type ProgressReviewOutcome = 'reported' | 'silent' | 'duplicate' | 'unparsed';
23
12
  export declare function progressReviewResult(raw: string, previous: string[]): {
24
13
  display: string;
25
14
  spoken: string;
26
15
  silent: boolean;
16
+ outcome: ProgressReviewOutcome;
27
17
  };
28
18
  //# sourceMappingURL=progress-review.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-review.d.ts","sourceRoot":"","sources":["../../src/orchestration/progress-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAI7C,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;CAOlC,CAAC;AACF,eAAO,MAAM,uBAAuB,ypCAAqoC,CAAC;AAE1qC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAIvF;AACD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAItG;AACD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAe1H"}
1
+ {"version":3,"file":"progress-review.d.ts","sourceRoot":"","sources":["../../src/orchestration/progress-review.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,uBAAuB,ypCAAqoC,CAAC;AAE1qC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAIvF;AACD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAItG;AACD;;;;;yFAKyF;AACzF,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AACrF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAA;CAAE,CAkB1J"}
@@ -1,19 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PROGRESS_REVIEW_OVERLAY = exports.PROGRESS_REVIEW_SCHEMA = void 0;
3
+ exports.PROGRESS_REVIEW_OVERLAY = void 0;
4
4
  exports.isProgressReview = isProgressReview;
5
5
  exports.recentCommunicatedProgress = recentCommunicatedProgress;
6
6
  exports.progressReviewResult = progressReviewResult;
7
+ const response_schema_1 = require("./response-schema");
7
8
  // Internal reviews may choose silence. They must finish before any prose/TTS
8
- // is published, so a partial draft or a control JSON object cannot leak.
9
- exports.PROGRESS_REVIEW_SCHEMA = {
10
- type: 'object', additionalProperties: false,
11
- properties: {
12
- notify_user: { type: 'boolean' },
13
- display_text: { type: 'string', maxLength: 16000 },
14
- spoken_text: { type: 'string', maxLength: 600 },
15
- }, required: ['notify_user', 'display_text', 'spoken_text'],
16
- };
9
+ // is published, so a partial draft or a control JSON object cannot leak. The field
10
+ // contract is carried by the invariant ORCHESTRATION_RESPONSE_SCHEMA declared on every
11
+ // turn; this overlay is the per-turn text that asks for notify_user on a review turn.
17
12
  exports.PROGRESS_REVIEW_OVERLAY = `This is an internal progress review, not a request to send a message on every check. Inspect the task and offer scoped advice if needed. Independently decide whether the user needs a new update: a meaningful milestone, changed plan, concrete blocker, or decision they need to make. Routine tool activity, elapsed time, unchanged work and rephrasing the previous report are not new progress. Compare with the previously communicated updates provided as data. If nothing meaningful is new, return {"notify_user":false,"display_text":"","spoken_text":""}. Otherwise return {"notify_user":true,"display_text":"natural concise first-person update containing only new information","spoken_text":"short spoken version in the same language"}. This three-field schema overrides the ordinary two-field speech format for this internal review only. Never announce the review, supervision, forwarding advice, or silence decision. Do not send a reassurance that the task is not stuck. A planned next step is not a completed milestone. User questions and completion/failure/input-request notifications are handled separately and must not be suppressed by this policy.`;
18
13
  function isProgressReview(store, decisionId) {
19
14
  const tasks = store.all(`SELECT t.state,t.snapshot_json FROM notifications n JOIN tasks t ON t.id=n.task_id
@@ -32,17 +27,20 @@ function progressReviewResult(raw, previous) {
32
27
  try {
33
28
  const value = JSON.parse(candidate);
34
29
  if (value.notify_user === false)
35
- return { display: '', spoken: '', silent: true };
30
+ return { display: '', spoken: '', silent: true, outcome: 'silent' };
36
31
  if (value.notify_user !== true || typeof value.display_text !== 'string' || !value.display_text.trim())
37
32
  continue;
38
33
  const display = value.display_text.trim();
39
34
  const canonical = (s) => s.normalize('NFKC').replace(/\s+/g, ' ').trim();
40
35
  if (previous.some(text => canonical(text) === canonical(display)))
41
- return { display: '', spoken: '', silent: true };
42
- return { display, spoken: typeof value.spoken_text === 'string' && value.spoken_text.length <= 600 ? value.spoken_text.trim() : '', silent: false };
36
+ return { display: '', spoken: '', silent: true, outcome: 'duplicate' };
37
+ return { display, spoken: typeof value.spoken_text === 'string' && value.spoken_text.length <= response_schema_1.SPOKEN_TEXT_LIMIT ? value.spoken_text.trim() : '', silent: false, outcome: 'reported' };
43
38
  }
44
39
  catch { /* Only an explicit valid reporting decision can publish. */ }
45
40
  }
46
- return { display: '', spoken: '', silent: true };
41
+ // Still fail closed unvalidated review prose must never reach the user or TTS — but
42
+ // report it as 'unparsed' so the caller can log the dropped update. Silently treating a
43
+ // malformed review as a deliberate silence is exactly the no-silent-failures violation.
44
+ return { display: '', spoken: '', silent: true, outcome: 'unparsed' };
47
45
  }
48
46
  //# sourceMappingURL=progress-review.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-review.js","sourceRoot":"","sources":["../../src/orchestration/progress-review.ts"],"names":[],"mappings":";;;AAcA,4CAIC;AACD,gEAIC;AACD,oDAeC;AArCD,6EAA6E;AAC7E,yEAAyE;AAC5D,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK;IAC3C,UAAU,EAAE;QACV,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAChC,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE;QAClD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE;KAChD,EAAE,QAAQ,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,aAAa,CAAC;CAC5D,CAAC;AACW,QAAA,uBAAuB,GAAG,koCAAkoC,CAAC;AAE1qC,SAAgB,gBAAgB,CAAC,KAAyB,EAAE,UAAkB;IAC5E,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC;kDACwB,EAAE,UAAU,CAAC,CAAC;IAC9D,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,C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,YAAY,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE;gBAAE,SAAS;YACjH,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;YAC1C,MAAM,SAAS,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;YACjF,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,OAAO,CAAC,CAAC;gBAAE,OAAO,EAAC,OAAO,EAAC,EAAE,EAAC,MAAM,EAAC,EAAE,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,CAAC;YACjI,OAAO,EAAC,OAAO,EAAC,MAAM,EAAC,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,IAAI,mCAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAC,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,UAAU,EAAC,CAAC;QACjL,CAAC;QAAC,MAAM,CAAC,CAAC,4DAA4D,CAAC,CAAC;IAC1E,CAAC;IACD,sFAAsF;IACtF,wFAAwF;IACxF,wFAAwF;IACxF,OAAO,EAAC,OAAO,EAAC,EAAE,EAAC,MAAM,EAAC,EAAE,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,UAAU,EAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Display provider text without interpreting its language, reset syntax or wording. */
2
+ export declare function sanitizeProviderMessage(text: string): string | undefined;
3
+ /** Only typed error envelopes supply provider display text, never ordinary replies. */
4
+ export declare function structuredProviderMessage(value: unknown, depth?: number, budget?: {
5
+ nodes: number;
6
+ }, errorEnvelope?: boolean): string | undefined;
7
+ //# sourceMappingURL=provider-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-message.d.ts","sourceRoot":"","sources":["../../src/orchestration/provider-message.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoBxE;AAED,uFAAuF;AACvF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,SAAI,EAAE,MAAM;;CAAiB,EAAE,aAAa,UAAQ,GAAG,MAAM,GAAG,SAAS,CAoBvI"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sanitizeProviderMessage = sanitizeProviderMessage;
4
+ exports.structuredProviderMessage = structuredProviderMessage;
5
+ /** Display provider text without interpreting its language, reset syntax or wording. */
6
+ function sanitizeProviderMessage(text) {
7
+ const safe = text
8
+ // The authorization header carries any scheme (Bearer/Basic/Token/Digest/…)
9
+ // and may hold quoted multi-value params, so redact its whole value to the
10
+ // line end rather than matching a scheme list.
11
+ .replace(/\b((?:proxy-)?authorization\s*:\s*)[^\r\n]*/gi, '$1[redacted]')
12
+ // Bare Bearer/Basic credentials can also appear without the header name.
13
+ .replace(/\b(?:Bearer|Basic)\s+[^\s"'<>]+/gi, '[redacted]')
14
+ .replace(/\bsk-[A-Za-z0-9_-]+/g, '[redacted]')
15
+ .replace(/\b(?:set-cookie|cookie)\s*:\s*[^\r\n]+/gi, '[redacted cookie]')
16
+ .replace(/(["']?[a-z0-9_-]*(?:api[_-]?key|token|password|secret|authorization|cookie)["']?\s*[=:]\s*)(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^\s,;}]+)/gi, '$1[redacted]')
17
+ .replace(/https?:\/\/[^\s<>"']+/gi, value => {
18
+ try {
19
+ const url = new URL(value);
20
+ url.username = '';
21
+ url.password = '';
22
+ url.search = '';
23
+ url.hash = '';
24
+ return url.toString();
25
+ }
26
+ catch {
27
+ return '[redacted URL]';
28
+ }
29
+ })
30
+ .split('\n').filter(line => !/^\s*at\s+/.test(line)).join('\n')
31
+ .replace(/(^|[\s("'])(?:[A-Za-z]:\\|\/)(?:[^\s"'<>:]+[\\/])+[^\s"'<>:]*/g, '$1[redacted path]')
32
+ .replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g, '')
33
+ .trim();
34
+ return safe ? safe.slice(0, 4096) : undefined;
35
+ }
36
+ /** Only typed error envelopes supply provider display text, never ordinary replies. */
37
+ function structuredProviderMessage(value, depth = 0, budget = { nodes: 256 }, errorEnvelope = false) {
38
+ if (depth >= 8 || --budget.nodes < 0 || !value)
39
+ return undefined;
40
+ if (typeof value === 'string')
41
+ return (errorEnvelope || /^API Error:\s*\S/.test(value)) ? value : undefined;
42
+ if (typeof value !== 'object')
43
+ return undefined;
44
+ if (Array.isArray(value)) {
45
+ for (const item of value.slice(0, 32)) {
46
+ const message = structuredProviderMessage(item, depth + 1, budget, errorEnvelope);
47
+ if (message)
48
+ return message;
49
+ }
50
+ return undefined;
51
+ }
52
+ const entry = value;
53
+ if (entry.error && (typeof entry.error === 'object' || typeof entry.error === 'string')) {
54
+ const nested = structuredProviderMessage(entry.error, depth + 1, budget, true);
55
+ if (nested)
56
+ return nested;
57
+ }
58
+ if ((errorEnvelope || typeof entry.type === 'string' || typeof entry.code === 'string' || typeof entry.status === 'number') && typeof entry.message === 'string') {
59
+ return entry.message;
60
+ }
61
+ return undefined;
62
+ }
63
+ //# sourceMappingURL=provider-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-message.js","sourceRoot":"","sources":["../../src/orchestration/provider-message.ts"],"names":[],"mappings":";;AACA,0DAoBC;AAGD,8DAoBC;AA5CD,wFAAwF;AACxF,SAAgB,uBAAuB,CAAC,IAAY;IAClD,MAAM,IAAI,GAAG,IAAI;QACf,4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AK,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjK,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare class PresentedResponseError extends Error {
2
+ }
3
+ export declare function responseFailureMessage(error: unknown, legacyMessage?: boolean): string;
4
+ /** Normalize managed failures before they reach legacy stream callbacks. */
5
+ export declare function presentedResponseError(error: unknown): PresentedResponseError;
6
+ //# sourceMappingURL=response-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-errors.d.ts","sourceRoot":"","sources":["../../src/orchestration/response-errors.ts"],"names":[],"mappings":"AAKA,qBAAa,sBAAuB,SAAQ,KAAK;CAAG;AAwCpD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,UAAQ,GAAG,MAAM,CAyBpF;AAGD,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CAK7E"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PresentedResponseError = void 0;
4
+ exports.responseFailureMessage = responseFailureMessage;
5
+ exports.presentedResponseError = presentedResponseError;
6
+ const provider_message_1 = require("./provider-message");
7
+ const inference_errors_1 = require("./inference-errors");
8
+ const types_1 = require("./types");
9
+ // Used only when replaying an already-rendered terminal frame from the server buffer.
10
+ class PresentedResponseError extends Error {
11
+ }
12
+ exports.PresentedResponseError = PresentedResponseError;
13
+ /** Public explanations, independent of exception prose and transport. Never echo internal messages. */
14
+ const explanations = {
15
+ MODEL_MAX_TURNS: 'The model reached its configured turn limit before completing the request.',
16
+ MODEL_BUDGET_EXCEEDED: 'The model reached its configured spending limit before completing the request.',
17
+ MODEL_OUTPUT_INVALID: 'The model could not produce the required response format after retrying.',
18
+ INFERENCE_FAILED: 'The model request failed without a usable provider diagnostic. Check the gateway logs.',
19
+ PROCESS_EXITED: 'The agent process exited before completing the response. Check the gateway logs before retrying.',
20
+ PROCESS_START_FAILED: 'The agent process could not start. Check the Claude installation and gateway logs.',
21
+ WORKSPACE_DIRECTORY_MISSING: 'The agent workspace directory is missing. Restore the workspace before restarting the agent.',
22
+ CONTAINER_RUNTIME_NOT_FOUND: 'The container runtime executable was not found. Check the Docker installation and gateway PATH.',
23
+ CLAUDE_BINARY_NOT_FOUND: 'The Claude executable was not found. Check the Claude installation or CLAUDE_BIN setting.',
24
+ PROCESS_PERMISSION_DENIED: 'The gateway does not have permission to start the Claude executable.',
25
+ RESPONSE_PERSISTENCE_FAILED: 'The gateway could not save the response. Check storage and gateway logs before retrying.',
26
+ RESPONSE_TOO_LARGE: 'The response exceeded the gateway size limit. Try a smaller request.',
27
+ PROFILE_INVENTORY_MISMATCH: 'The agent tool configuration does not match the running gateway. Check that the gateway and MCP server use the same deployment.',
28
+ CAPACITY_EXCEEDED: 'The gateway has reached its active-session limit. Wait for current work to finish and try again.',
29
+ CONFLICT: 'This session already has a pending request.',
30
+ ORCHESTRATION_CLOSING: 'The gateway is shutting down. Try again after it restarts.',
31
+ GATEWAY_SHUTDOWN: 'The gateway shut down before the response completed.',
32
+ TASK_RESULT_TIMEOUT: 'Scheduled work did not produce a final report before its deadline. Check /tasks before retrying.',
33
+ INTERRUPTED: 'Response stopped.',
34
+ UNSUPPORTED_ORCHESTRATION_BACKEND: 'Orchestration requires the headless backend. Check the gateway configuration.',
35
+ UNSUPPORTED_PROCESS_SUPERVISOR: 'This platform does not support the configured orchestration process supervisor.',
36
+ PROFILE_FLAGS_CONFLICT: 'Custom Claude flags conflict with the orchestration runtime profile. Check the agent configuration.',
37
+ ACKNOWLEDGEMENT_DELIVERY_PENDING: 'The acknowledgement has not been delivered yet. Work has not been started; check channel delivery.',
38
+ VOICE_NOTES_DISABLED: 'Voice-note transcription is disabled for this agent.',
39
+ VOICE_NOTE_ATTACHMENT_MISSING: 'The voice-note attachment is missing. Please resend it.',
40
+ ENOSPC: 'The gateway has run out of storage space. Free disk space before retrying.',
41
+ EACCES: 'The gateway could not access a required resource because permission was denied. Check the gateway logs.',
42
+ EPERM: 'The gateway was not permitted to access a required resource. Check the gateway logs.',
43
+ ENOENT: 'A required gateway file or executable is missing. Check the gateway logs.',
44
+ SQLITE_FULL: 'The gateway database could not be written because storage is full.',
45
+ SQLITE_BUSY: 'The gateway database is busy. Try again shortly.',
46
+ ECONNREFUSED: 'The gateway could not connect to a required service. Check service availability.',
47
+ ECONNRESET: 'The connection to a required service was interrupted. Please try again.',
48
+ ETIMEDOUT: 'The connection to a required service timed out. Please try again.',
49
+ };
50
+ function responseFailureMessage(error, legacyMessage = false) {
51
+ if (error instanceof PresentedResponseError)
52
+ return (0, provider_message_1.sanitizeProviderMessage)(error.message) ?? 'The gateway response failed.';
53
+ const provider = (0, inference_errors_1.inferenceFailureMessage)(error);
54
+ if (provider)
55
+ return provider;
56
+ const failure = error;
57
+ const code = typeof failure?.code === 'string' ? failure.code : '';
58
+ if (code === 'TIMEOUT' || code === 'TIMEOUT_SOFT') {
59
+ const phase = failure?.timeout?.phase;
60
+ const message = code === 'TIMEOUT_SOFT' ? 'The request wait time elapsed; the agent may still be working.'
61
+ : phase === 'startup' ? 'The agent could not finish starting in time.'
62
+ : phase === 'first_response' ? 'The model did not begin responding in time.'
63
+ : phase === 'idle' ? 'The agent stopped making progress before completing the reply.'
64
+ : 'The agent reached its response time limit before completing the reply.';
65
+ return `${message} Please check /tasks for any pending work. (${code})`;
66
+ }
67
+ if (Object.prototype.hasOwnProperty.call(explanations, code))
68
+ return `${explanations[code]} (${code})`;
69
+ // Legacy stream/command callbacks historically carry uncoded public errors.
70
+ // Preserve that contract, with redaction; orchestration/internal callers fail closed.
71
+ if (legacyMessage && !code && error instanceof Error) {
72
+ const text = (0, provider_message_1.sanitizeProviderMessage)(error.message);
73
+ if (text)
74
+ return text;
75
+ }
76
+ // New orchestration codes remain diagnosable without exposing arbitrary exception text.
77
+ const publicCode = error instanceof types_1.OrchestrationError && /^[A-Z][A-Z0-9_]{0,79}$/.test(code) ? code : 'GATEWAY_INTERNAL_ERROR';
78
+ return `The gateway could not complete the response (${publicCode}). Check the gateway logs for details.`;
79
+ }
80
+ /** Normalize managed failures before they reach legacy stream callbacks. */
81
+ function presentedResponseError(error) {
82
+ const presented = new PresentedResponseError(responseFailureMessage(error));
83
+ const code = error?.code;
84
+ if (typeof code === 'string' && /^[A-Z][A-Z0-9_]{0,79}$/.test(code))
85
+ Object.assign(presented, { code });
86
+ return presented;
87
+ }
88
+ //# sourceMappingURL=response-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-errors.js","sourceRoot":"","sources":["../../src/orchestration/response-errors.ts"],"names":[],"mappings":";;;AA6CA,wDAyBC;AAID,wDAKC;AA/ED,yDAA6D;AAC7D,yDAA6D;AAC7D,mCAA6C;AAE7C,sFAAsF;AACtF,MAAa,sBAAuB,SAAQ,KAAK;CAAG;AAApD,wDAAoD;AAEpD,uGAAuG;AACvG,MAAM,YAAY,GAAqC;IACrD,eAAe,EAAE,4EAA4E;IAC7F,qBAAqB,EAAE,gFAAgF;IACvG,oBAAoB,EAAE,0EAA0E;IAChG,gBAAgB,EAAE,wFAAwF;IAC1G,cAAc,EAAE,kGAAkG;IAClH,oBAAoB,EAAE,oFAAoF;IAC1G,2BAA2B,EAAE,8FAA8F;IAC3H,2BAA2B,EAAE,iGAAiG;IAC9H,uBAAuB,EAAE,2FAA2F;IACpH,yBAAyB,EAAE,sEAAsE;IACjG,2BAA2B,EAAE,0FAA0F;IACvH,kBAAkB,EAAE,sEAAsE;IAC1F,0BAA0B,EAAE,iIAAiI;IAC7J,iBAAiB,EAAE,kGAAkG;IACrH,QAAQ,EAAE,6CAA6C;IACvD,qBAAqB,EAAE,4DAA4D;IACnF,gBAAgB,EAAE,sDAAsD;IACxE,mBAAmB,EAAE,kGAAkG;IACvH,WAAW,EAAE,mBAAmB;IAChC,iCAAiC,EAAE,+EAA+E;IACl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ACrF,CAAC,CAAC,wEAAwE,CAAC;QAC7E,OAAO,GAAG,OAAO,+CAA+C,IAAI,GAAG,CAAC;IAC1E,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC;QAAE,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC;IACvG,4EAA4E;IAC5E,sFAAsF;IACtF,IAAI,aAAa,IAAI,CAAC,IAAI,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,IAAA,0CAAuB,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;IACxB,CAAC;IACD,wFAAwF;IACxF,MAAM,UAAU,GAAG,KAAK,YAAY,0BAAkB,IAAI,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC;IAChI,OAAO,gDAAgD,UAAU,wCAAwC,CAAC;AAC5G,CAAC;AAGD,4EAA4E;AAC5E,SAAgB,sBAAsB,CAAC,KAAc;IACnD,MAAM,SAAS,GAAG,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5E,MAAM,IAAI,GAAI,KAAiC,EAAE,IAAI,CAAC;IACtD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;IACtG,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /** The one response contract declared on EVERY agent decision turn.
2
+ *
3
+ * Anthropic's prompt cache is a strict prefix match over [tools, system, messages].
4
+ * src/session/runtime-profile.ts turns RuntimeProfile.responseSchema into the CLI's
5
+ * --json-schema flag, and that flag appends a synthetic StructuredOutput tool to the
6
+ * tools block. Verified against the installed claude-code 2.1.274 binary: the flag only
7
+ * (a) appends the tool to the request's tool array and (b) injects one bounded turn-end
8
+ * "call the StructuredOutput tool now" nudge when the turn ended without it. It does NOT
9
+ * set tool_choice — the main query loop always sends toolChoice: undefined — so declaring
10
+ * the schema does not force an ordinary reply through a JSON tool call, and the model may
11
+ * still answer in plain text (both parsers below keep tolerating that).
12
+ *
13
+ * Because the tool renders at position 0 of the cached prefix, a schema attached on only
14
+ * SOME turns of a session invalidates tools+system+messages every time the session switches
15
+ * mode. Anthropic's prescribed remedy is an invariant tool set with the mode carried in
16
+ * message content — not removing the tool. So this schema is the union of every turn shape
17
+ * and is attached unconditionally; the per-turn overlay text (SPEECH_OVERLAY,
18
+ * PROGRESS_REVIEW_OVERLAY, INTAKE_OVERLAY — all appended to the prompt, below the cache
19
+ * breakpoint) remains the mechanism that says which optional fields this turn must fill.
20
+ *
21
+ * Only display_text is required, so an ordinary text turn satisfies the union with exactly
22
+ * the one field it already produced; nothing about a normal turn's user-facing output
23
+ * changes. Length limits are deliberately absent: structured outputs does not enforce
24
+ * minLength/maxLength server-side, so the spoken-length budget is enforced in our own code
25
+ * (splitSpeechResponse/progressReviewResult) instead of being decorative schema text.
26
+ *
27
+ * Frozen so the single canonical definition also has a single canonical serialization:
28
+ * runtimeProfileArgs JSON.stringify()s this exact object on every turn, and byte-identical
29
+ * CLI args are the whole point.
30
+ */
31
+ export declare const SPOKEN_TEXT_LIMIT = 600;
32
+ export declare const ORCHESTRATION_RESPONSE_SCHEMA: Record<string, unknown>;
33
+ //# sourceMappingURL=response-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-schema.d.ts","sourceRoot":"","sources":["../../src/orchestration/response-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAOrC,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAmBhE,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ORCHESTRATION_RESPONSE_SCHEMA = exports.SPOKEN_TEXT_LIMIT = void 0;
4
+ /** The one response contract declared on EVERY agent decision turn.
5
+ *
6
+ * Anthropic's prompt cache is a strict prefix match over [tools, system, messages].
7
+ * src/session/runtime-profile.ts turns RuntimeProfile.responseSchema into the CLI's
8
+ * --json-schema flag, and that flag appends a synthetic StructuredOutput tool to the
9
+ * tools block. Verified against the installed claude-code 2.1.274 binary: the flag only
10
+ * (a) appends the tool to the request's tool array and (b) injects one bounded turn-end
11
+ * "call the StructuredOutput tool now" nudge when the turn ended without it. It does NOT
12
+ * set tool_choice — the main query loop always sends toolChoice: undefined — so declaring
13
+ * the schema does not force an ordinary reply through a JSON tool call, and the model may
14
+ * still answer in plain text (both parsers below keep tolerating that).
15
+ *
16
+ * Because the tool renders at position 0 of the cached prefix, a schema attached on only
17
+ * SOME turns of a session invalidates tools+system+messages every time the session switches
18
+ * mode. Anthropic's prescribed remedy is an invariant tool set with the mode carried in
19
+ * message content — not removing the tool. So this schema is the union of every turn shape
20
+ * and is attached unconditionally; the per-turn overlay text (SPEECH_OVERLAY,
21
+ * PROGRESS_REVIEW_OVERLAY, INTAKE_OVERLAY — all appended to the prompt, below the cache
22
+ * breakpoint) remains the mechanism that says which optional fields this turn must fill.
23
+ *
24
+ * Only display_text is required, so an ordinary text turn satisfies the union with exactly
25
+ * the one field it already produced; nothing about a normal turn's user-facing output
26
+ * changes. Length limits are deliberately absent: structured outputs does not enforce
27
+ * minLength/maxLength server-side, so the spoken-length budget is enforced in our own code
28
+ * (splitSpeechResponse/progressReviewResult) instead of being decorative schema text.
29
+ *
30
+ * Frozen so the single canonical definition also has a single canonical serialization:
31
+ * runtimeProfileArgs JSON.stringify()s this exact object on every turn, and byte-identical
32
+ * CLI args are the whole point.
33
+ */
34
+ exports.SPOKEN_TEXT_LIMIT = 600;
35
+ function deepFreeze(value) {
36
+ if (value && typeof value === 'object')
37
+ for (const nested of Object.values(value))
38
+ deepFreeze(nested);
39
+ return Object.freeze(value);
40
+ }
41
+ exports.ORCHESTRATION_RESPONSE_SCHEMA = deepFreeze({
42
+ type: 'object',
43
+ additionalProperties: false,
44
+ description: 'Your reply for this turn. Always fill display_text. Fill the optional fields only when this turn\'s instructions explicitly ask for them.',
45
+ properties: {
46
+ display_text: {
47
+ type: 'string',
48
+ description: 'The complete reply shown to the user in chat, in the user\'s language. On an ordinary turn this is your entire answer: write exactly what you would have written as a plain reply, with the same detail, structure and formatting. Never summarise it or move content elsewhere.',
49
+ },
50
+ spoken_text: {
51
+ type: 'string',
52
+ description: `Only when this turn's instructions ask for speech: a brief natural spoken version of display_text, at most ${exports.SPOKEN_TEXT_LIMIT} characters, in the same language. Omit this field entirely on an ordinary text turn.`,
53
+ },
54
+ notify_user: {
55
+ type: 'boolean',
56
+ description: 'Only on an internal progress-review turn, where the instructions define it: whether the user should receive this update. Omit this field entirely on every other turn.',
57
+ },
58
+ },
59
+ required: ['display_text'],
60
+ });
61
+ //# sourceMappingURL=response-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-schema.js","sourceRoot":"","sources":["../../src/orchestration/response-schema.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACU,QAAA,iBAAiB,GAAG,GAAG,CAAC;AAErC,SAAS,UAAU,CAAI,KAAQ;IAC7B,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;YAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IACtG,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAEY,QAAA,6BAA6B,GAA4B,UAAU,CAAC;IAC/E,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,WAAW,EAAE,2IAA2I;IACxJ,UAAU,EAAE;QACV,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kRAAkR;SAChS;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,8GAA8G,yBAAiB,uFAAuF;SACpO;QACD,WAAW,EAAE;YACX,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,wKAAwK;SACtL;KACF;IACD,QAAQ,EAAE,CAAC,cAAc,CAAC;CAC3B,CAAC,CAAC"}
@@ -1,3 +1,6 @@
1
+ import { type CompactMeasurements } from './compact-measurements';
2
+ import { type ResolvedSessionCompaction } from './session-compaction';
3
+ import { ContextDelivery } from './context-delivery';
1
4
  import { TaskQuestions } from './task-questions';
2
5
  import { ChannelControls } from './channel-controls';
3
6
  import { TaskControls } from './task-controls';
@@ -36,6 +39,9 @@ export declare class AgentOrchestrationRuntime {
36
39
  readonly store: OrchestrationStore;
37
40
  readonly tasks: TaskService;
38
41
  readonly intake: ConversationIntake;
42
+ readonly contextDelivery: ContextDelivery;
43
+ private sessionCompaction?;
44
+ private readonly cliSessions;
39
45
  readonly stopControls: StopControls;
40
46
  readonly taskControls: TaskControls;
41
47
  readonly questionControls: TaskQuestions;
@@ -66,6 +72,12 @@ export declare class AgentOrchestrationRuntime {
66
72
  private readonly inputResponses;
67
73
  private readonly inputTools;
68
74
  private readonly voiceListeners;
75
+ setBrowserVoice(sessionId: string, principalId: string, enabled: boolean): void;
76
+ pendingVoiceSpeech(sessionId: string, principalId: string, claimed?: string[]): {
77
+ responseId: string;
78
+ text: string;
79
+ spoken: string;
80
+ }[];
69
81
  subscribeVoiceResults(sessionId: string, principalId: string, receive: (result: {
70
82
  responseId: string;
71
83
  text: string;
@@ -108,6 +120,7 @@ export declare class AgentOrchestrationRuntime {
108
120
  busy: boolean;
109
121
  };
110
122
  isBusy(sessionId: string): boolean;
123
+ isCompacting(sessionId: string): boolean;
111
124
  responseFiles(sessionId: string, requestId?: string): string[];
112
125
  notifySession(sessionId: string, text: string, deliver?: boolean): Promise<void>;
113
126
  ownsSession(sessionId: string): boolean;
@@ -117,11 +130,63 @@ export declare class AgentOrchestrationRuntime {
117
130
  private assertBackend;
118
131
  updateAgentConfig(agent: AgentConfig): void;
119
132
  configure(config: AgentConfig['orchestration'], backendAgent?: AgentConfig): void;
133
+ /** Rotate only the agent CLI context. Tasks and canonical history remain intact. */
134
+ resetSessionContext(sessionId: string): void;
135
+ /** An exclusive maintenance operation on the existing CLI transcript, not a chat summary. */
136
+ compactSession(sessionId: string, model?: string): Promise<CompactMeasurements | null>;
137
+ private compactionMaintenance;
138
+ runSessionCompaction(config: ResolvedSessionCompaction, window: (model: string) => Promise<number>): Promise<import("./session-compaction").CompactionRun>;
139
+ sessionContextWindow(sessionId: string): {
140
+ used: number;
141
+ total: number | null;
142
+ model: string | null;
143
+ } | null;
144
+ tokenReport(sessionId: string): {
145
+ sessionId: string;
146
+ turns: import("./token-ledger").TokenTurn[];
147
+ usageByRole: {
148
+ role: string;
149
+ inputTokens: number;
150
+ cacheCreationTokens: number;
151
+ cacheReadTokens: number;
152
+ outputTokens: number;
153
+ }[];
154
+ contextWindow: {
155
+ used: number;
156
+ total: number | null;
157
+ model: string | null;
158
+ } | null;
159
+ totals: {
160
+ agentTokens: number | null;
161
+ workerTokens: number | null;
162
+ totalTokens: number | null;
163
+ };
164
+ distribution: {
165
+ category: string;
166
+ tokens: number;
167
+ }[];
168
+ pagination: {
169
+ total: number;
170
+ offset: number;
171
+ limit: number;
172
+ since?: number;
173
+ newestFirst?: boolean;
174
+ } | undefined;
175
+ coverage: "recorded-turns-only";
176
+ } | undefined;
120
177
  dashboardSummary(): {
121
178
  enabled: boolean;
122
179
  backend: string;
123
180
  workspaceMode: "container" | "host" | "isolated-worktree" | "shared-lock";
124
181
  sessions: {
182
+ tokenSummary: {
183
+ agentTokens: number | null;
184
+ workerTokens: number | null;
185
+ totalTokens: number;
186
+ } | undefined;
187
+ contextTools: string[] | null;
188
+ loadedTools: string[] | null;
189
+ usedTools: string[];
125
190
  orchestration: boolean;
126
191
  sessionId: string;
127
192
  chatId: string;
@@ -134,6 +199,12 @@ export declare class AgentOrchestrationRuntime {
134
199
  spawnedAt: number;
135
200
  uptimeSec: number;
136
201
  tasks: {
202
+ tokenSummary: {
203
+ totalTokens: number | null;
204
+ };
205
+ contextTools: string[] | null;
206
+ loadedTools: string[] | null;
207
+ usedTools: string[];
137
208
  taskId: string | number | null;
138
209
  sessionId: string | number | null;
139
210
  state: string | number | null;
@@ -169,6 +240,12 @@ export declare class AgentOrchestrationRuntime {
169
240
  };
170
241
  activeAgentSessions: string[];
171
242
  tasks: {
243
+ tokenSummary: {
244
+ totalTokens: number | null;
245
+ };
246
+ contextTools: string[] | null;
247
+ loadedTools: string[] | null;
248
+ usedTools: string[];
172
249
  taskId: string | number | null;
173
250
  sessionId: string | number | null;
174
251
  state: string | number | null;
@@ -198,6 +275,8 @@ export declare class AgentOrchestrationRuntime {
198
275
  private publishText;
199
276
  saveVoiceAudio(sessionId: string, principalId: string, responseId: string, audio: Buffer): void;
200
277
  voiceAudio(sessionId: string, principalId: string, responseId?: string): string[] | Buffer<ArrayBufferLike> | undefined;
278
+ replayableVoiceResponses(sessionId: string, principalId: string): string[];
279
+ voiceReplaySpeech(sessionId: string, principalId: string, responseId: string): string | undefined;
201
280
  authorizeSession(sessionId: string, principalId: string): void;
202
281
  responseIdForInput(inputId: string): string | undefined;
203
282
  /** Includes independent acknowledgement responses without crossing input scope. */
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/orchestration/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAcjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA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