@cortex-agent/server 2026.9.25 → 2026.10.2

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 (863) hide show
  1. package/README.md +1 -1
  2. package/defaults/hooks/agents-md-injector.mjs +1 -25
  3. package/defaults/hooks/cortex-hook-api.mjs +1 -4
  4. package/defaults/hooks/memory-ref-tracker.mjs +0 -3
  5. package/defaults/hooks/new-session-hook.mjs +3 -9
  6. package/defaults/hooks/rules-loader.mjs +3 -12
  7. package/defaults/hooks/session-activity-tracker.mjs +1 -21
  8. package/defaults/hooks/status-md-guard.mjs +0 -11
  9. package/defaults/hooks/task-status-check.mjs +0 -4
  10. package/defaults/hooks/tasks-yaml-guard.mjs +0 -6
  11. package/defaults/plugins/cortex-system/skills/task/SKILL.md +3 -6
  12. package/dist/agent-adapter/bg-wait.d.ts +0 -5
  13. package/dist/agent-adapter/bg-wait.js +1 -16
  14. package/dist/agent-adapter/capabilities.d.ts +0 -11
  15. package/dist/agent-adapter/capabilities.js +2 -39
  16. package/dist/agent-adapter/claude/active-capture-registry.d.ts +0 -1
  17. package/dist/agent-adapter/claude/active-capture-registry.js +1 -4
  18. package/dist/agent-adapter/claude/adapter.d.ts +8 -25
  19. package/dist/agent-adapter/claude/adapter.js +18 -53
  20. package/dist/agent-adapter/claude/bg-task-tracker.d.ts +4 -4
  21. package/dist/agent-adapter/claude/bg-task-tracker.js +2 -4
  22. package/dist/agent-adapter/claude/defaults.d.ts +1 -13
  23. package/dist/agent-adapter/claude/defaults.js +1 -13
  24. package/dist/agent-adapter/claude/engine.d.ts +3 -9
  25. package/dist/agent-adapter/claude/engine.js +2 -12
  26. package/dist/agent-adapter/claude/event-parser.d.ts +1 -6
  27. package/dist/agent-adapter/claude/event-parser.js +4 -17
  28. package/dist/agent-adapter/claude/event-translator.d.ts +0 -3
  29. package/dist/agent-adapter/claude/event-translator.js +0 -7
  30. package/dist/agent-adapter/claude/tmux-control.d.ts +0 -48
  31. package/dist/agent-adapter/claude/tmux-control.js +0 -133
  32. package/dist/agent-adapter/claude/transcript-path.d.ts +10 -0
  33. package/dist/agent-adapter/claude/transcript-path.js +78 -1
  34. package/dist/agent-adapter/claude/turn-machine.d.ts +4 -3
  35. package/dist/agent-adapter/claude/turn-machine.js +11 -13
  36. package/dist/agent-adapter/pi/adapter.js +3 -5
  37. package/dist/agent-adapter/pi/agent-dir.d.ts +0 -2
  38. package/dist/agent-adapter/pi/agent-dir.js +3 -7
  39. package/dist/agent-adapter/pi/background-subagent.d.ts +9 -4
  40. package/dist/agent-adapter/pi/child-events.d.ts +1 -18
  41. package/dist/agent-adapter/pi/child-events.js +0 -23
  42. package/dist/agent-adapter/pi/child-session.js +13 -16
  43. package/dist/agent-adapter/pi/defaults.d.ts +0 -2
  44. package/dist/agent-adapter/pi/defaults.js +1 -3
  45. package/dist/agent-adapter/pi/discovery.d.ts +1 -5
  46. package/dist/agent-adapter/pi/discovery.js +0 -8
  47. package/dist/agent-adapter/pi/engine.d.ts +3 -8
  48. package/dist/agent-adapter/pi/engine.js +3 -15
  49. package/dist/agent-adapter/pi/event-parser.d.ts +1 -34
  50. package/dist/agent-adapter/pi/extensions.d.ts +2 -2
  51. package/dist/agent-adapter/pi/extensions.js +4 -2
  52. package/dist/agent-adapter/pi/hook-bridge.d.ts +5 -32
  53. package/dist/agent-adapter/pi/hook-bridge.js +14 -46
  54. package/dist/agent-adapter/pi/image-first.d.ts +3 -0
  55. package/dist/agent-adapter/pi/image-first.js +31 -0
  56. package/dist/agent-adapter/pi/mcp-bridge.js +9 -22
  57. package/dist/agent-adapter/pi/pi-session.d.ts +2 -11
  58. package/dist/agent-adapter/pi/pi-session.js +2 -15
  59. package/dist/agent-adapter/pi/providers-config.d.ts +1 -7
  60. package/dist/agent-adapter/pi/providers-config.js +1 -2
  61. package/dist/agent-adapter/pi/runtime-settings.d.ts +2 -0
  62. package/dist/agent-adapter/pi/runtime-settings.js +17 -0
  63. package/dist/agent-adapter/pi/runtime.js +20 -29
  64. package/dist/agent-adapter/pi/session-support.d.ts +1 -5
  65. package/dist/agent-adapter/pi/session-support.js +0 -9
  66. package/dist/agent-adapter/pi/subagent.d.ts +2 -8
  67. package/dist/agent-adapter/pi/subagent.js +57 -54
  68. package/dist/agent-adapter/pi/tool-shims.d.ts +1 -1
  69. package/dist/agent-adapter/pi/tool-shims.js +5 -2
  70. package/dist/agent-adapter/types.d.ts +2 -8
  71. package/dist/core/agents/subagent/attribution.d.ts +5 -1
  72. package/dist/core/agents/subagent/attribution.js +6 -0
  73. package/dist/core/agents/subagent/types.d.ts +21 -0
  74. package/dist/core/anthropic-model-discovery.d.ts +0 -6
  75. package/dist/core/anthropic-model-discovery.js +2 -11
  76. package/dist/core/anthropic-models.js +0 -4
  77. package/dist/core/atomic-write.js +4 -4
  78. package/dist/core/auth.js +1 -6
  79. package/dist/core/cached-scan.js +0 -6
  80. package/dist/core/claude-credentials.d.ts +8 -2
  81. package/dist/core/claude-credentials.js +14 -9
  82. package/dist/core/cli-utils.d.ts +7 -1
  83. package/dist/core/codex-quota.d.ts +0 -4
  84. package/dist/core/codex-quota.js +0 -37
  85. package/dist/core/config-generator.d.ts +1 -1
  86. package/dist/core/config-generator.js +6 -24
  87. package/dist/core/gateway-generator.d.ts +0 -8
  88. package/dist/core/gateway-generator.js +2 -50
  89. package/dist/core/i18n.js +2 -5
  90. package/dist/core/locales/en.d.ts +394 -17
  91. package/dist/core/locales/en.js +8 -4
  92. package/dist/core/locales/slices/commands.d.ts +1 -6
  93. package/dist/core/locales/slices/commands.js +10 -20
  94. package/dist/core/locales/slices/init.js +2 -5
  95. package/dist/core/locales/slices/interactions.d.ts +0 -5
  96. package/dist/core/locales/slices/interactions.js +6 -19
  97. package/dist/core/locales/slices/lang.js +0 -3
  98. package/dist/core/locales/slices/notices.d.ts +121 -0
  99. package/dist/core/locales/slices/notices.js +242 -0
  100. package/dist/core/locales/slices/providers.d.ts +0 -2
  101. package/dist/core/locales/slices/providers.js +0 -4
  102. package/dist/core/locales/slices/scheduling.d.ts +0 -2
  103. package/dist/core/locales/slices/scheduling.js +0 -7
  104. package/dist/core/locales/slices/startup.js +0 -3
  105. package/dist/core/locales/slices/status.d.ts +0 -2
  106. package/dist/core/locales/slices/status.js +0 -4
  107. package/dist/core/locales/slices/tui.d.ts +117 -0
  108. package/dist/core/locales/slices/tui.js +240 -0
  109. package/dist/core/locales/slices/uiextra.d.ts +65 -0
  110. package/dist/core/locales/slices/uiextra.js +134 -0
  111. package/dist/core/locales/slices/uimsg.d.ts +102 -0
  112. package/dist/core/locales/slices/uimsg.js +214 -0
  113. package/dist/core/locales/zh.js +8 -3
  114. package/dist/core/mcp-tool-gate.js +1 -4
  115. package/dist/core/paths.js +0 -4
  116. package/dist/core/pi-sdk.d.ts +0 -8
  117. package/dist/core/pi-sdk.js +0 -12
  118. package/dist/core/platform-settings-spec.js +0 -4
  119. package/dist/core/settings-spec.js +0 -4
  120. package/dist/core/settings.js +2 -8
  121. package/dist/core/status-format.js +5 -5
  122. package/dist/core/task-node.d.ts +4 -7
  123. package/dist/core/task-node.js +8 -23
  124. package/dist/core/task-parser.d.ts +1 -3
  125. package/dist/core/task-parser.js +2 -35
  126. package/dist/core/tool-names.d.ts +0 -4
  127. package/dist/core/tool-names.js +0 -9
  128. package/dist/core/types/agent-types.d.ts +17 -0
  129. package/dist/core/utils.d.ts +1 -2
  130. package/dist/core/utils.js +2 -7
  131. package/dist/domain/agents/agent-state.d.ts +0 -3
  132. package/dist/domain/agents/agent-state.js +0 -3
  133. package/dist/domain/agents/agent-switch.js +0 -11
  134. package/dist/domain/agents/config.d.ts +1 -12
  135. package/dist/domain/agents/config.js +8 -88
  136. package/dist/domain/agents/index.d.ts +0 -1
  137. package/dist/domain/agents/index.js +0 -4
  138. package/dist/domain/agents/profile-manager.d.ts +4 -4
  139. package/dist/domain/agents/profile-manager.js +4 -4
  140. package/dist/domain/agents/profile-switch.js +0 -9
  141. package/dist/domain/agents/provider-run-lifecycle.d.ts +1 -1
  142. package/dist/domain/agents/subagent/foreign.js +0 -1
  143. package/dist/domain/agents/subagent/registry.d.ts +8 -4
  144. package/dist/domain/agents/subagent/registry.js +32 -7
  145. package/dist/domain/agents/subagent/runner.d.ts +1 -2
  146. package/dist/domain/agents/subagent/runner.js +0 -4
  147. package/dist/domain/agents/subagent/service.d.ts +1 -1
  148. package/dist/domain/agents/subagent/service.js +4 -4
  149. package/dist/domain/auth/auth-format.js +3 -4
  150. package/dist/domain/auth/auth-status.js +2 -1
  151. package/dist/domain/auth/cc-auth-cli.d.ts +1 -1
  152. package/dist/domain/auth/cc-auth-cli.js +3 -3
  153. package/dist/domain/auth/cc-login.js +2 -1
  154. package/dist/domain/auth/cc-subscription.d.ts +2 -5
  155. package/dist/domain/auth/cc-subscription.js +8 -13
  156. package/dist/domain/auth/claude-user-settings.js +1 -10
  157. package/dist/domain/auth/login-flow.d.ts +1 -1
  158. package/dist/domain/auth/login-flow.js +5 -4
  159. package/dist/domain/auth/logout.d.ts +2 -4
  160. package/dist/domain/auth/logout.js +13 -16
  161. package/dist/domain/auth/pi-login.d.ts +1 -13
  162. package/dist/domain/auth/pi-login.js +7 -13
  163. package/dist/domain/auth/pi-oauth.d.ts +1 -13
  164. package/dist/domain/auth/pi-oauth.js +8 -14
  165. package/dist/domain/benchmark/atif.d.ts +3 -34
  166. package/dist/domain/benchmark/atif.js +15 -38
  167. package/dist/domain/benchmark/attempt-record.d.ts +0 -74
  168. package/dist/domain/benchmark/attempt-record.js +0 -51
  169. package/dist/domain/benchmark/composite-manifest.d.ts +2 -39
  170. package/dist/domain/benchmark/composite-manifest.js +2 -131
  171. package/dist/domain/benchmark/decimal-text.d.ts +0 -5
  172. package/dist/domain/benchmark/decimal-text.js +0 -21
  173. package/dist/domain/benchmark/identity.d.ts +0 -10
  174. package/dist/domain/benchmark/identity.js +0 -18
  175. package/dist/domain/benchmark/journal.d.ts +0 -8
  176. package/dist/domain/benchmark/journal.js +5 -13
  177. package/dist/domain/benchmark/manifest-contract.d.ts +1 -15
  178. package/dist/domain/benchmark/manifest-contract.js +1 -1
  179. package/dist/domain/benchmark/production-attempt-identity.d.ts +0 -3
  180. package/dist/domain/benchmark/production-attempt-identity.js +2 -19
  181. package/dist/domain/benchmark/production-attempt-journal.d.ts +3 -3
  182. package/dist/domain/benchmark/production-attempt-journal.js +9 -11
  183. package/dist/domain/benchmark/production-evidence-export.d.ts +1 -2
  184. package/dist/domain/benchmark/production-evidence-export.js +0 -1
  185. package/dist/domain/benchmark/production-evidence-projection.d.ts +1 -2
  186. package/dist/domain/benchmark/production-evidence-projection.js +4 -6
  187. package/dist/domain/benchmark/role-surface.js +1 -8
  188. package/dist/domain/commissions/decision-projection.d.ts +0 -3
  189. package/dist/domain/commissions/decision-projection.js +3 -3
  190. package/dist/domain/costs/cost-tracker.d.ts +2 -15
  191. package/dist/domain/costs/cost-tracker.js +47 -96
  192. package/dist/domain/costs/gateway-manager.js +1 -1
  193. package/dist/domain/costs/rate-limit-throttle.d.ts +2 -9
  194. package/dist/domain/costs/rate-limit-throttle.js +12 -26
  195. package/dist/domain/costs/resume-registry.d.ts +1 -4
  196. package/dist/domain/costs/resume-registry.js +1 -13
  197. package/dist/domain/costs/usage-service.d.ts +2 -2
  198. package/dist/domain/costs/usage-service.js +16 -20
  199. package/dist/domain/costs/usage-store.d.ts +2 -3
  200. package/dist/domain/costs/usage-store.js +2 -5
  201. package/dist/domain/executions/registry.d.ts +6 -13
  202. package/dist/domain/executions/registry.js +5 -31
  203. package/dist/domain/mcp/bundled-server.js +3 -3
  204. package/dist/domain/mcp/feishu/client.js +0 -6
  205. package/dist/domain/mcp/feishu/file.js +3 -27
  206. package/dist/domain/mcp/feishu/types.d.ts +1 -1
  207. package/dist/domain/mcp/feishu/user-auth.js +1 -8
  208. package/dist/domain/mcp/tools/agents-md.d.ts +0 -1
  209. package/dist/domain/mcp/tools/context.d.ts +1 -2
  210. package/dist/domain/mcp/tools/cost.js +11 -14
  211. package/dist/domain/mcp/tools/interaction-plan.d.ts +0 -3
  212. package/dist/domain/mcp/tools/interaction-plan.js +0 -1
  213. package/dist/domain/mcp/tools/remote-file.d.ts +4 -0
  214. package/dist/domain/mcp/tools/remote-file.js +8 -0
  215. package/dist/domain/mcp/tools/schedule.d.ts +2 -16
  216. package/dist/domain/mcp/tools/schedule.js +4 -8
  217. package/dist/domain/mcp/tools/slack.d.ts +1 -3
  218. package/dist/domain/mcp/tools/slack.js +4 -45
  219. package/dist/domain/mcp/tools/task-monitor.js +0 -7
  220. package/dist/domain/mcp/tools/task-ops.js +2 -4
  221. package/dist/domain/mcp/tools/ui-file.js +56 -30
  222. package/dist/domain/memory/agents-md-injector.d.ts +0 -1
  223. package/dist/domain/memory/agents-md-injector.js +2 -4
  224. package/dist/domain/memory/consolidate.d.ts +0 -1
  225. package/dist/domain/memory/consolidate.js +3 -9
  226. package/dist/domain/memory/index-regen.d.ts +1 -7
  227. package/dist/domain/memory/index-regen.js +3 -2
  228. package/dist/domain/memory/rules-loader.d.ts +3 -25
  229. package/dist/domain/memory/rules-loader.js +8 -49
  230. package/dist/domain/memory/skill-scanner.d.ts +1 -2
  231. package/dist/domain/memory/skill-scanner.js +2 -10
  232. package/dist/domain/memory/user-context.js +1 -1
  233. package/dist/domain/memory/watcher.d.ts +0 -1
  234. package/dist/domain/memory/watcher.js +1 -17
  235. package/dist/domain/monitor/disk-monitor.d.ts +1 -4
  236. package/dist/domain/monitor/disk-monitor.js +4 -6
  237. package/dist/domain/monitor/event-loop-monitor.d.ts +1 -5
  238. package/dist/domain/monitor/event-loop-monitor.js +1 -9
  239. package/dist/domain/pi-providers/custom-provider-model.d.ts +2 -6
  240. package/dist/domain/pi-providers/custom-provider-model.js +1 -3
  241. package/dist/domain/pi-providers/custom-provider-service.d.ts +0 -2
  242. package/dist/domain/pi-providers/custom-provider-service.js +1 -1
  243. package/dist/domain/pi-providers/index.d.ts +3 -4
  244. package/dist/domain/pi-providers/index.js +1 -2
  245. package/dist/domain/pi-providers/models-json-store.d.ts +1 -1
  246. package/dist/domain/pi-providers/models-json-store.js +1 -1
  247. package/dist/domain/plugins/agent-plugins-v1.d.ts +0 -3
  248. package/dist/domain/plugins/authoring.js +7 -7
  249. package/dist/domain/plugins/catalog-types.d.ts +3 -0
  250. package/dist/domain/plugins/catalog-types.js +11 -0
  251. package/dist/domain/plugins/catalog.d.ts +1 -2
  252. package/dist/domain/plugins/catalog.js +13 -27
  253. package/dist/domain/plugins/fs-helpers.d.ts +2 -1
  254. package/dist/domain/plugins/fs-helpers.js +2 -5
  255. package/dist/domain/plugins/mcp.js +3 -13
  256. package/dist/domain/plugins/runtime.js +4 -11
  257. package/dist/domain/plugins/skill-projection.js +0 -3
  258. package/dist/domain/remote/client-hot-reload.js +4 -3
  259. package/dist/domain/remote/client-manager.d.ts +8 -6
  260. package/dist/domain/remote/client-manager.js +21 -2
  261. package/dist/domain/remote/client-remove.d.ts +61 -0
  262. package/dist/domain/remote/client-remove.js +137 -0
  263. package/dist/domain/remote/client-ssh-tunnel.d.ts +5 -0
  264. package/dist/domain/remote/client-ssh-tunnel.js +12 -1
  265. package/dist/domain/remote/device-chrome-commands.d.ts +0 -3
  266. package/dist/domain/remote/device-chrome-commands.js +1 -10
  267. package/dist/domain/remote/device-port.d.ts +2 -8
  268. package/dist/domain/remote/device-port.js +7 -15
  269. package/dist/domain/runs/adapters.js +2 -2
  270. package/dist/domain/runs/attempt.js +1 -5
  271. package/dist/domain/runs/engine-spec.d.ts +0 -13
  272. package/dist/domain/runs/engine-spec.js +0 -42
  273. package/dist/domain/runs/engines.d.ts +3 -4
  274. package/dist/domain/runs/engines.js +2 -8
  275. package/dist/domain/runs/events.js +0 -6
  276. package/dist/domain/runs/prompt.js +1 -1
  277. package/dist/domain/runs/request.d.ts +1 -2
  278. package/dist/domain/runs/run.d.ts +0 -1
  279. package/dist/domain/runs/run.js +6 -16
  280. package/dist/domain/scheduling/job-registry.d.ts +0 -5
  281. package/dist/domain/scheduling/job-registry.js +0 -24
  282. package/dist/domain/scheduling/jobs/auth-expiry-scan.d.ts +1 -0
  283. package/dist/domain/scheduling/jobs/auth-expiry-scan.js +6 -13
  284. package/dist/domain/scheduling/jobs/memory-index-regen.js +3 -5
  285. package/dist/domain/scheduling/jobs/register-thread-session.d.ts +3 -4
  286. package/dist/domain/scheduling/jobs/register-thread-session.js +2 -7
  287. package/dist/domain/scheduling/jobs/scheduled-task.js +5 -15
  288. package/dist/domain/scheduling/jobs/sync-public.d.ts +3 -0
  289. package/dist/domain/scheduling/jobs/sync-public.js +7 -8
  290. package/dist/domain/scheduling/jobs/target-dispatch.js +0 -5
  291. package/dist/domain/scheduling/jobs/task-archive.js +4 -6
  292. package/dist/domain/scheduling/jobs/task-dispatch.js +8 -14
  293. package/dist/domain/scheduling/runner.d.ts +0 -3
  294. package/dist/domain/scheduling/runner.js +10 -11
  295. package/dist/domain/scheduling/schedule-cli.d.ts +0 -4
  296. package/dist/domain/scheduling/schedule-cli.js +7 -8
  297. package/dist/domain/scheduling/schedule-command.js +1 -39
  298. package/dist/domain/scheduling/scheduler.d.ts +4 -18
  299. package/dist/domain/scheduling/scheduler.js +8 -45
  300. package/dist/domain/sessions/session-backup.d.ts +3 -3
  301. package/dist/domain/sessions/session-backup.js +8 -73
  302. package/dist/domain/sessions/session-hooks.d.ts +5 -23
  303. package/dist/domain/sessions/session-hooks.js +20 -45
  304. package/dist/domain/sessions/session-lifecycle.d.ts +1 -8
  305. package/dist/domain/sessions/session-lifecycle.js +6 -6
  306. package/dist/domain/sessions/session-retention.d.ts +1 -1
  307. package/dist/domain/sessions/session-use.d.ts +0 -4
  308. package/dist/domain/sessions/session-use.js +0 -18
  309. package/dist/domain/sessions/session.d.ts +3 -3
  310. package/dist/domain/sessions/session.js +6 -6
  311. package/dist/domain/system/doctor.js +4 -8
  312. package/dist/domain/system/github-release.d.ts +0 -2
  313. package/dist/domain/system/github-release.js +0 -5
  314. package/dist/domain/system/install-cli.js +1 -1
  315. package/dist/domain/system/notice-history.js +0 -4
  316. package/dist/domain/system/preferences.js +1 -7
  317. package/dist/domain/system/rebuild-hold.d.ts +1 -11
  318. package/dist/domain/system/rebuild-hold.js +3 -16
  319. package/dist/domain/system/server-update-check.d.ts +3 -2
  320. package/dist/domain/system/server-update-check.js +15 -65
  321. package/dist/domain/system/server-update-coordinator.d.ts +43 -0
  322. package/dist/domain/system/server-update-coordinator.js +137 -0
  323. package/dist/domain/system/system-notice.d.ts +2 -1
  324. package/dist/domain/system/update-state.js +1 -4
  325. package/dist/domain/system/update-ui-state.js +0 -7
  326. package/dist/domain/tasks/acceptance-ledger.d.ts +1 -7
  327. package/dist/domain/tasks/acceptance-ledger.js +7 -9
  328. package/dist/domain/tasks/archiver.js +2 -2
  329. package/dist/domain/tasks/claim-recovery.d.ts +0 -1
  330. package/dist/domain/tasks/claim-recovery.js +0 -13
  331. package/dist/domain/tasks/dispatch-utils.d.ts +2 -3
  332. package/dist/domain/tasks/dispatch-utils.js +19 -22
  333. package/dist/domain/tasks/dispatcher.d.ts +5 -8
  334. package/dist/domain/tasks/dispatcher.js +9 -15
  335. package/dist/domain/tasks/lint.js +1 -1
  336. package/dist/domain/tasks/mutator.d.ts +1 -12
  337. package/dist/domain/tasks/mutator.js +8 -124
  338. package/dist/domain/tasks/system/task-cli.d.ts +1 -51
  339. package/dist/domain/tasks/system/task-cli.js +6 -22
  340. package/dist/domain/tasks/system/task-completion.js +8 -14
  341. package/dist/domain/tasks/system/task-id-utils.js +2 -1
  342. package/dist/domain/tasks/system/task-lifecycle-edit.d.ts +2 -5
  343. package/dist/domain/tasks/system/task-lifecycle-edit.js +4 -10
  344. package/dist/domain/tasks/system/task-lock.d.ts +1 -5
  345. package/dist/domain/tasks/system/task-lock.js +5 -45
  346. package/dist/domain/tasks/system/task-mutations.d.ts +1 -12
  347. package/dist/domain/tasks/system/task-mutations.js +2 -19
  348. package/dist/domain/tasks/system/task-state.d.ts +2 -6
  349. package/dist/domain/tasks/system/task-state.js +1 -6
  350. package/dist/domain/threads/artifact-io.d.ts +0 -2
  351. package/dist/domain/threads/artifact-io.js +2 -17
  352. package/dist/domain/threads/contract.js +0 -4
  353. package/dist/domain/threads/hook-runner.d.ts +0 -2
  354. package/dist/domain/threads/hook-runner.js +2 -5
  355. package/dist/domain/threads/index.js +1 -2
  356. package/dist/domain/threads/prompt-builder.d.ts +3 -4
  357. package/dist/domain/threads/prompt-builder.js +3 -3
  358. package/dist/domain/threads/runner.d.ts +2 -3
  359. package/dist/domain/threads/runner.js +40 -40
  360. package/dist/domain/threads/shell-templates.js +0 -8
  361. package/dist/domain/threads/state-machine.d.ts +1 -1
  362. package/dist/domain/threads/state-machine.js +10 -18
  363. package/dist/domain/threads/template-loader.d.ts +2 -2
  364. package/dist/domain/threads/template-loader.js +7 -11
  365. package/dist/domain/threads/template-validate.d.ts +3 -0
  366. package/dist/domain/threads/template-validate.js +49 -51
  367. package/dist/domain/threads/template-validate.parity.js +0 -7
  368. package/dist/domain/threads/template-writer.d.ts +3 -1
  369. package/dist/domain/threads/template-writer.js +16 -20
  370. package/dist/domain/threads/tree.d.ts +0 -1
  371. package/dist/domain/threads/tree.js +0 -10
  372. package/dist/domain/threads/utils.d.ts +0 -2
  373. package/dist/domain/threads/utils.js +0 -10
  374. package/dist/domain/tui-session/index.js +0 -2
  375. package/dist/domain/tui-session/tui-session-service.js +16 -26
  376. package/dist/domain/tui-session/types.d.ts +1 -36
  377. package/dist/domain/tui-session/types.js +0 -3
  378. package/dist/domain/ui-service/app-router.d.ts +30 -12
  379. package/dist/domain/ui-service/app-router.js +4 -6
  380. package/dist/domain/ui-service/assistant-snapshots.d.ts +10 -0
  381. package/dist/domain/ui-service/assistant-snapshots.js +43 -0
  382. package/dist/domain/ui-service/index.d.ts +1 -2
  383. package/dist/domain/ui-service/index.js +0 -2
  384. package/dist/domain/ui-service/input-schemas.d.ts +16 -23
  385. package/dist/domain/ui-service/input-schemas.js +22 -77
  386. package/dist/domain/ui-service/mutate/approvals.js +10 -18
  387. package/dist/domain/ui-service/mutate/auth.js +14 -12
  388. package/dist/domain/ui-service/mutate/commissions.js +4 -3
  389. package/dist/domain/ui-service/mutate/config.js +5 -14
  390. package/dist/domain/ui-service/mutate/errors.d.ts +7 -0
  391. package/dist/domain/ui-service/mutate/errors.js +14 -0
  392. package/dist/domain/ui-service/mutate/executions.js +2 -4
  393. package/dist/domain/ui-service/mutate/hooks.d.ts +0 -4
  394. package/dist/domain/ui-service/mutate/hooks.js +4 -28
  395. package/dist/domain/ui-service/mutate/issues.js +4 -15
  396. package/dist/domain/ui-service/mutate/platform-settings.js +3 -6
  397. package/dist/domain/ui-service/mutate/plugin-packages.js +10 -19
  398. package/dist/domain/ui-service/mutate/plugins.js +11 -40
  399. package/dist/domain/ui-service/mutate/profiles.d.ts +15 -0
  400. package/dist/domain/ui-service/mutate/profiles.js +10 -9
  401. package/dist/domain/ui-service/mutate/projects.js +0 -3
  402. package/dist/domain/ui-service/mutate/schedules.js +14 -34
  403. package/dist/domain/ui-service/mutate/session-metadata.d.ts +3 -0
  404. package/dist/domain/ui-service/mutate/session-metadata.js +28 -0
  405. package/dist/domain/ui-service/mutate/sessions.js +55 -45
  406. package/dist/domain/ui-service/mutate/system.d.ts +2 -1
  407. package/dist/domain/ui-service/mutate/system.js +24 -36
  408. package/dist/domain/ui-service/mutate/tasks.d.ts +5 -5
  409. package/dist/domain/ui-service/mutate/tasks.js +18 -20
  410. package/dist/domain/ui-service/mutate/thread-templates.js +4 -28
  411. package/dist/domain/ui-service/mutate/threads.js +3 -5
  412. package/dist/domain/ui-service/mutate/waitpoints.js +3 -7
  413. package/dist/domain/ui-service/platform-settings.js +3 -6
  414. package/dist/domain/ui-service/plugins-shared.d.ts +3 -0
  415. package/dist/domain/ui-service/plugins-shared.js +17 -25
  416. package/dist/domain/ui-service/query/approvals.js +0 -5
  417. package/dist/domain/ui-service/query/config.d.ts +3 -3
  418. package/dist/domain/ui-service/query/config.js +5 -23
  419. package/dist/domain/ui-service/query/cost.js +0 -3
  420. package/dist/domain/ui-service/query/executions.js +2 -4
  421. package/dist/domain/ui-service/query/issues.js +0 -7
  422. package/dist/domain/ui-service/query/machine-detail.js +3 -2
  423. package/dist/domain/ui-service/query/machines.js +0 -7
  424. package/dist/domain/ui-service/query/memory.js +0 -5
  425. package/dist/domain/ui-service/query/notes.js +2 -1
  426. package/dist/domain/ui-service/query/plugins.js +3 -23
  427. package/dist/domain/ui-service/query/projects.js +0 -3
  428. package/dist/domain/ui-service/query/schedules.d.ts +3 -0
  429. package/dist/domain/ui-service/query/schedules.js +15 -14
  430. package/dist/domain/ui-service/query/sessions.js +18 -28
  431. package/dist/domain/ui-service/query/skills.js +0 -7
  432. package/dist/domain/ui-service/query/system.d.ts +1 -0
  433. package/dist/domain/ui-service/query/system.js +5 -16
  434. package/dist/domain/ui-service/query/task-verification.js +2 -4
  435. package/dist/domain/ui-service/query/thread-template-detail.d.ts +1 -7
  436. package/dist/domain/ui-service/query/thread-template-detail.js +6 -42
  437. package/dist/domain/ui-service/query/thread-templates.d.ts +8 -3
  438. package/dist/domain/ui-service/query/thread-templates.js +6 -17
  439. package/dist/domain/ui-service/query/threads.js +2 -1
  440. package/dist/domain/ui-service/query/waitpoints.js +0 -7
  441. package/dist/domain/ui-service/query-input-schemas.d.ts +1 -1
  442. package/dist/domain/ui-service/session-metadata-schemas.d.ts +13 -0
  443. package/dist/domain/ui-service/session-metadata-schemas.js +9 -0
  444. package/dist/domain/ui-service/subscribe.d.ts +2 -1
  445. package/dist/domain/ui-service/subscribe.js +31 -50
  446. package/dist/domain/ui-service/trpc.js +2 -5
  447. package/dist/domain/ui-service/types.d.ts +37 -32
  448. package/dist/domain/ui-service/types.js +0 -4
  449. package/dist/domain/ui-service/ui-service.js +8 -6
  450. package/dist/domain/waitpoints/notices.js +0 -5
  451. package/dist/domain/waitpoints/service.d.ts +1 -1
  452. package/dist/domain/waitpoints/service.js +0 -5
  453. package/dist/entry/app.js +29 -37
  454. package/dist/entry/auth-cli.d.ts +2 -6
  455. package/dist/entry/auth-cli.js +1 -5
  456. package/dist/entry/auth-login-cli.d.ts +2 -2
  457. package/dist/entry/auth-login-cli.js +0 -4
  458. package/dist/entry/auth-login-terminal.js +0 -4
  459. package/dist/entry/cli-help.d.ts +1 -0
  460. package/dist/entry/cli-help.js +28 -0
  461. package/dist/entry/cli.d.ts +1 -6
  462. package/dist/entry/cli.js +30 -62
  463. package/dist/entry/client-cli.d.ts +4 -0
  464. package/dist/entry/client-cli.js +62 -0
  465. package/dist/entry/daemon-notice.js +3 -2
  466. package/dist/entry/daemon.d.ts +0 -10
  467. package/dist/entry/daemon.js +8 -4
  468. package/dist/entry/doctor-cli.d.ts +1 -5
  469. package/dist/entry/doctor-cli.js +0 -5
  470. package/dist/entry/fast-install.d.ts +0 -2
  471. package/dist/entry/fast-install.js +1 -1
  472. package/dist/entry/feishu-login.d.ts +1 -5
  473. package/dist/entry/feishu-login.js +1 -1
  474. package/dist/entry/hook-cli.d.ts +2 -7
  475. package/dist/entry/hook-cli.js +8 -32
  476. package/dist/entry/init-auth.js +0 -4
  477. package/dist/entry/init.d.ts +4 -7
  478. package/dist/entry/init.js +17 -32
  479. package/dist/entry/local-ui.js +4 -8
  480. package/dist/entry/provider-cli.d.ts +2 -6
  481. package/dist/entry/signal-cli.d.ts +2 -7
  482. package/dist/entry/signal-cli.js +1 -7
  483. package/dist/entry/start-ui-http.d.ts +0 -21
  484. package/dist/entry/start-ui-http.js +8 -19
  485. package/dist/entry/startup-notify.d.ts +2 -6
  486. package/dist/entry/startup-notify.js +2 -2
  487. package/dist/entry/ui-cli.d.ts +1 -5
  488. package/dist/entry/ui-http-gate.d.ts +3 -1
  489. package/dist/entry/ui-http-gate.js +5 -5
  490. package/dist/events/event-logger.d.ts +1 -1
  491. package/dist/events/event-types.d.ts +2 -9
  492. package/dist/hooks/agents-md-injector.mjs +1 -25
  493. package/dist/hooks/cortex-hook-api.mjs +1 -4
  494. package/dist/hooks/memory-ref-tracker.mjs +0 -3
  495. package/dist/hooks/new-session-hook.mjs +3 -9
  496. package/dist/hooks/rules-loader.mjs +3 -12
  497. package/dist/hooks/session-activity-tracker.mjs +1 -21
  498. package/dist/hooks/status-md-guard.mjs +0 -11
  499. package/dist/hooks/task-status-check.mjs +0 -4
  500. package/dist/hooks/tasks-yaml-guard.mjs +0 -6
  501. package/dist/orchestration/agent-file-send.d.ts +17 -8
  502. package/dist/orchestration/agent-file-send.js +30 -17
  503. package/dist/orchestration/agent-runner.d.ts +1 -4
  504. package/dist/orchestration/agent-runner.js +5 -19
  505. package/dist/orchestration/attachments-store.js +2 -30
  506. package/dist/orchestration/conversation-request.d.ts +0 -5
  507. package/dist/orchestration/conversation-request.js +5 -16
  508. package/dist/orchestration/delta-coalescer.d.ts +0 -2
  509. package/dist/orchestration/delta-coalescer.js +1 -8
  510. package/dist/orchestration/dispatch-reconciler.js +1 -3
  511. package/dist/orchestration/durable-helpers.d.ts +0 -1
  512. package/dist/orchestration/durable-helpers.js +0 -1
  513. package/dist/orchestration/edit-retry.d.ts +4 -9
  514. package/dist/orchestration/edit-retry.js +4 -11
  515. package/dist/orchestration/human-answer-backstop.js +0 -10
  516. package/dist/orchestration/interactions/ask-user-question.d.ts +1 -4
  517. package/dist/orchestration/interactions/ask-user-question.js +2 -26
  518. package/dist/orchestration/interactions/ask-user-resume.d.ts +1 -1
  519. package/dist/orchestration/interactions/ask-user-resume.js +1 -1
  520. package/dist/orchestration/interactions/command-action-router.d.ts +1 -17
  521. package/dist/orchestration/interactions/command-action-router.js +0 -42
  522. package/dist/orchestration/interactions/interaction-handlers.js +4 -6
  523. package/dist/orchestration/interactions/interaction-records.d.ts +0 -3
  524. package/dist/orchestration/interactions/interaction-records.js +8 -30
  525. package/dist/orchestration/interactions/plan-approvals.d.ts +0 -14
  526. package/dist/orchestration/interactions/plan-approvals.js +1 -13
  527. package/dist/orchestration/interactions/plan-handler.d.ts +1 -4
  528. package/dist/orchestration/interactions/plan-handler.js +6 -6
  529. package/dist/orchestration/interactions/plan-response.js +0 -10
  530. package/dist/orchestration/interactions/ui-update-prompt.js +31 -39
  531. package/dist/orchestration/interactions/update-prompt.js +0 -4
  532. package/dist/orchestration/manager-qa.d.ts +0 -6
  533. package/dist/orchestration/manager-qa.js +1 -10
  534. package/dist/orchestration/mid-turn-inject.d.ts +0 -2
  535. package/dist/orchestration/mid-turn-inject.js +0 -5
  536. package/dist/orchestration/outputs-store.d.ts +5 -0
  537. package/dist/orchestration/outputs-store.js +5 -7
  538. package/dist/orchestration/pi-background-subagent.js +4 -2
  539. package/dist/orchestration/resume-dispatcher.d.ts +1 -2
  540. package/dist/orchestration/resume-dispatcher.js +3 -6
  541. package/dist/orchestration/resume-target-sink.js +0 -4
  542. package/dist/orchestration/routing/commands/cancel.js +1 -1
  543. package/dist/orchestration/routing/commands/channel.d.ts +0 -4
  544. package/dist/orchestration/routing/commands/channel.js +0 -10
  545. package/dist/orchestration/routing/commands/command-context.d.ts +0 -15
  546. package/dist/orchestration/routing/commands/command-context.js +0 -3
  547. package/dist/orchestration/routing/commands/compact.d.ts +2 -6
  548. package/dist/orchestration/routing/commands/device.d.ts +0 -2
  549. package/dist/orchestration/routing/commands/device.js +1 -18
  550. package/dist/orchestration/routing/commands/dispatch.js +0 -3
  551. package/dist/orchestration/routing/commands/index.js +6 -9
  552. package/dist/orchestration/routing/commands/lang.js +0 -5
  553. package/dist/orchestration/routing/commands/login.d.ts +0 -3
  554. package/dist/orchestration/routing/commands/login.js +1 -1
  555. package/dist/orchestration/routing/commands/mode.d.ts +0 -4
  556. package/dist/orchestration/routing/commands/mode.js +1 -11
  557. package/dist/orchestration/routing/commands/restart.js +1 -4
  558. package/dist/orchestration/routing/commands/schedule.js +0 -2
  559. package/dist/orchestration/routing/commands/sendfile.js +1 -1
  560. package/dist/orchestration/routing/commands/session.d.ts +0 -2
  561. package/dist/orchestration/routing/commands/session.js +3 -38
  562. package/dist/orchestration/routing/commands/status.d.ts +0 -2
  563. package/dist/orchestration/routing/commands/status.js +0 -5
  564. package/dist/orchestration/routing/commands/tail.js +1 -1
  565. package/dist/orchestration/routing/commands/task.d.ts +0 -2
  566. package/dist/orchestration/routing/commands/task.js +2 -7
  567. package/dist/orchestration/routing/commands/time-ago.d.ts +2 -0
  568. package/dist/orchestration/routing/commands/time-ago.js +14 -0
  569. package/dist/orchestration/routing/edit-handler.d.ts +0 -1
  570. package/dist/orchestration/routing/edit-handler.js +6 -11
  571. package/dist/orchestration/routing/file-handler.d.ts +3 -13
  572. package/dist/orchestration/routing/file-handler.js +7 -2
  573. package/dist/orchestration/routing/hook-bridge-subscribers.js +5 -9
  574. package/dist/orchestration/routing/hook-bridge.d.ts +1 -6
  575. package/dist/orchestration/routing/hook-bridge.js +1 -13
  576. package/dist/orchestration/routing/webhook.d.ts +2 -8
  577. package/dist/orchestration/routing/webhook.js +15 -13
  578. package/dist/orchestration/session-compact.js +0 -2
  579. package/dist/orchestration/session-retention-controller.d.ts +0 -2
  580. package/dist/orchestration/session-retention-controller.js +5 -7
  581. package/dist/orchestration/session-rewind.d.ts +3 -0
  582. package/dist/orchestration/session-rewind.js +8 -6
  583. package/dist/orchestration/status-helpers.d.ts +1 -6
  584. package/dist/orchestration/status-helpers.js +3 -8
  585. package/dist/orchestration/subagent-adopt.d.ts +2 -19
  586. package/dist/orchestration/subagent-adopt.js +7 -18
  587. package/dist/orchestration/subagent-attribution.d.ts +22 -2
  588. package/dist/orchestration/subagent-attribution.js +8 -9
  589. package/dist/orchestration/subagent-delivery.js +6 -14
  590. package/dist/orchestration/subagent-rows.d.ts +1 -6
  591. package/dist/orchestration/subagent-rows.js +1 -10
  592. package/dist/orchestration/subagent-webhook.js +7 -15
  593. package/dist/orchestration/thread-callback.js +2 -2
  594. package/dist/orchestration/thread-delivery.js +0 -8
  595. package/dist/orchestration/thread-executor.d.ts +1 -1
  596. package/dist/orchestration/thread-executor.js +14 -12
  597. package/dist/orchestration/thread-input.d.ts +0 -2
  598. package/dist/orchestration/thread-input.js +4 -14
  599. package/dist/orchestration/thread-notices.d.ts +0 -2
  600. package/dist/orchestration/thread-notices.js +0 -13
  601. package/dist/orchestration/thread-run/index.d.ts +3 -3
  602. package/dist/orchestration/thread-run/index.js +2 -3
  603. package/dist/orchestration/thread-run/render-summary.js +7 -15
  604. package/dist/orchestration/thread-run/render-task.d.ts +0 -2
  605. package/dist/orchestration/thread-run/render-task.js +13 -24
  606. package/dist/orchestration/thread-run/settle.js +0 -6
  607. package/dist/orchestration/thread-run/thread-run.d.ts +0 -17
  608. package/dist/orchestration/thread-run/thread-run.js +4 -14
  609. package/dist/orchestration/thread-run/thread-surface.js +0 -6
  610. package/dist/orchestration/thread-run/verdict.js +0 -4
  611. package/dist/orchestration/transcript-sink.d.ts +2 -0
  612. package/dist/orchestration/transcript-sink.js +1 -7
  613. package/dist/orchestration/turn/active-turns.d.ts +3 -23
  614. package/dist/orchestration/turn/active-turns.js +3 -40
  615. package/dist/orchestration/turn/background-hold.d.ts +0 -15
  616. package/dist/orchestration/turn/background-hold.js +4 -23
  617. package/dist/orchestration/turn/hold-render-platform.js +0 -9
  618. package/dist/orchestration/turn/hold-render-web.d.ts +3 -3
  619. package/dist/orchestration/turn/hold-render-web.js +2 -14
  620. package/dist/orchestration/turn/terminal.js +1 -8
  621. package/dist/orchestration/turn/turn-prep.d.ts +1 -15
  622. package/dist/orchestration/turn/turn-prep.js +3 -69
  623. package/dist/orchestration/turn/turn.d.ts +1 -3
  624. package/dist/orchestration/turn/turn.js +8 -33
  625. package/dist/orchestration/waitpoint-ingress.d.ts +0 -10
  626. package/dist/orchestration/waitpoint-ingress.js +8 -24
  627. package/dist/orchestration/waitpoint-notifier.js +0 -7
  628. package/dist/orchestration/waitpoint-remote-drain.d.ts +2 -0
  629. package/dist/orchestration/waitpoint-remote-drain.js +2 -7
  630. package/dist/orchestration/waitpoint-sweep.d.ts +1 -2
  631. package/dist/orchestration/waitpoint-sweep.js +2 -9
  632. package/dist/platform/adapters/chunked-output-stream.d.ts +71 -0
  633. package/dist/platform/adapters/chunked-output-stream.js +382 -0
  634. package/dist/platform/adapters/composite-adapter.d.ts +1 -1
  635. package/dist/platform/adapters/composite-adapter.js +1 -1
  636. package/dist/platform/adapters/feishu-http.d.ts +6 -11
  637. package/dist/platform/adapters/feishu-http.js +11 -9
  638. package/dist/platform/adapters/feishu-image.js +0 -7
  639. package/dist/platform/adapters/feishu-output-stream.d.ts +4 -42
  640. package/dist/platform/adapters/feishu-output-stream.js +14 -336
  641. package/dist/platform/adapters/feishu.d.ts +10 -3
  642. package/dist/platform/adapters/feishu.js +47 -73
  643. package/dist/platform/adapters/index.d.ts +0 -21
  644. package/dist/platform/adapters/index.js +0 -28
  645. package/dist/platform/adapters/project-conduits.js +0 -5
  646. package/dist/platform/adapters/slack-output-stream.d.ts +4 -44
  647. package/dist/platform/adapters/slack-output-stream.js +14 -377
  648. package/dist/platform/adapters/slack.d.ts +2 -6
  649. package/dist/platform/adapters/slack.js +30 -48
  650. package/dist/platform/adapters/tui/index.d.ts +0 -7
  651. package/dist/platform/adapters/tui/index.js +0 -4
  652. package/dist/platform/adapters/tui/ports.d.ts +27 -0
  653. package/dist/platform/adapters/tui/ports.js +0 -3
  654. package/dist/platform/adapters/tui/tui-conduit-state.d.ts +0 -2
  655. package/dist/platform/adapters/tui/tui-conduit-state.js +0 -3
  656. package/dist/platform/adapters/tui/tui-connection.d.ts +0 -10
  657. package/dist/platform/adapters/tui/tui-connection.js +0 -5
  658. package/dist/platform/adapters/tui/tui-gateway.d.ts +4 -42
  659. package/dist/platform/adapters/tui/tui-gateway.js +12 -35
  660. package/dist/platform/adapters/tui/tui-output-stream.d.ts +0 -2
  661. package/dist/platform/adapters/tui/tui-output-stream.js +1 -3
  662. package/dist/platform/adapters/tui/tui-transcript.js +2 -5
  663. package/dist/platform/browser/display.d.ts +0 -2
  664. package/dist/platform/browser/display.js +0 -1
  665. package/dist/platform/browser/managed-browser.d.ts +4 -9
  666. package/dist/platform/browser/managed-browser.js +5 -10
  667. package/dist/platform/index.d.ts +3 -9
  668. package/dist/platform/index.js +3 -5
  669. package/dist/platform/output-stream-chunk.js +0 -3
  670. package/dist/platform/output-stream-helpers.js +0 -3
  671. package/dist/platform/testing.d.ts +0 -2
  672. package/dist/platform/testing.js +3 -11
  673. package/dist/platform/tool-trace.d.ts +0 -11
  674. package/dist/platform/tool-trace.js +0 -1
  675. package/dist/platform/ui-http/access-jwt.js +0 -13
  676. package/dist/platform/ui-http/app-update.js +3 -17
  677. package/dist/platform/ui-http/device-ports.js +3 -20
  678. package/dist/platform/ui-http/http-json.d.ts +8 -0
  679. package/dist/platform/ui-http/http-json.js +33 -0
  680. package/dist/platform/ui-http/listening-ports.js +4 -6
  681. package/dist/platform/ui-http/port-forward.d.ts +1 -2
  682. package/dist/platform/ui-http/port-forward.js +1 -2
  683. package/dist/platform/ui-http/ui-auth-routes.d.ts +3 -3
  684. package/dist/platform/ui-http/ui-auth-routes.js +2 -29
  685. package/dist/platform/ui-http/ui-http-server.d.ts +4 -12
  686. package/dist/platform/ui-http/ui-ota.js +4 -26
  687. package/dist/platform/ui-http/ui-session.js +0 -10
  688. package/dist/platform/ui-http/zip-writer.js +0 -8
  689. package/dist/platform/utils/rate-limiter.d.ts +0 -2
  690. package/dist/platform/utils/rate-limiter.js +0 -6
  691. package/dist/platform/utils/reaction-diagnostics.d.ts +1 -1
  692. package/dist/platform/utils/reaction-diagnostics.js +3 -3
  693. package/dist/platform/utils/readable-file.d.ts +9 -0
  694. package/dist/platform/utils/readable-file.js +18 -0
  695. package/dist/store/conversation-display-projection.d.ts +3 -2
  696. package/dist/store/conversation-display-projection.js +10 -23
  697. package/dist/store/conversation-history-reader.d.ts +1 -2
  698. package/dist/store/conversation-history-reader.js +1 -19
  699. package/dist/store/conversation-history-repo.d.ts +11 -29
  700. package/dist/store/conversation-history-repo.js +12 -13
  701. package/dist/store/conversation-ledger-repo.d.ts +0 -2
  702. package/dist/store/conversation-ledger-repo.js +0 -10
  703. package/dist/store/cost-repo.d.ts +1 -1
  704. package/dist/store/cost-repo.js +7 -12
  705. package/dist/store/execution-repo.d.ts +3 -25
  706. package/dist/store/execution-repo.js +4 -29
  707. package/dist/store/hook-registry.d.ts +7 -1
  708. package/dist/store/hook-registry.js +31 -6
  709. package/dist/store/hook-sync.d.ts +1 -1
  710. package/dist/store/hook-sync.js +1 -8
  711. package/dist/store/hook-writer.d.ts +1 -3
  712. package/dist/store/hook-writer.js +2 -2
  713. package/dist/store/outbound-queue.d.ts +1 -8
  714. package/dist/store/outbound-queue.js +3 -8
  715. package/dist/store/pending-injection-repo.d.ts +2 -8
  716. package/dist/store/plugin-retirement.d.ts +0 -4
  717. package/dist/store/plugin-retirement.js +3 -12
  718. package/dist/store/plugin-sync.js +0 -6
  719. package/dist/store/profile-repo.d.ts +3 -13
  720. package/dist/store/profile-repo.js +3 -36
  721. package/dist/store/project-dir-repo.js +0 -4
  722. package/dist/store/retention-candidate-repo.d.ts +0 -1
  723. package/dist/store/retention-candidate-repo.js +0 -6
  724. package/dist/store/schedule-repo.d.ts +0 -1
  725. package/dist/store/schedule-repo.js +0 -2
  726. package/dist/store/session-registry-import.js +0 -9
  727. package/dist/store/session-registry-journal.d.ts +2 -0
  728. package/dist/store/session-registry-journal.js +17 -38
  729. package/dist/store/session-registry-repo.d.ts +5 -2
  730. package/dist/store/session-registry-repo.js +12 -12
  731. package/dist/store/session-totals-repo.js +0 -4
  732. package/dist/store/task-repo.d.ts +0 -1
  733. package/dist/store/task-repo.js +1 -10
  734. package/dist/store/version-migrations.d.ts +3 -3
  735. package/dist/store/version-migrations.js +4 -8
  736. package/dist/store/waitpoint-repo.d.ts +0 -3
  737. package/dist/store/waitpoint-repo.js +0 -16
  738. package/dist/tui/App.js +22 -31
  739. package/dist/tui/components/AskUserModal.d.ts +1 -2
  740. package/dist/tui/components/AskUserModal.js +6 -8
  741. package/dist/tui/components/ConfirmModal.js +3 -5
  742. package/dist/tui/components/Dashboard.d.ts +1 -2
  743. package/dist/tui/components/Dashboard.js +16 -19
  744. package/dist/tui/components/DashboardCostTab.js +6 -5
  745. package/dist/tui/components/DashboardExecutionsTab.js +7 -9
  746. package/dist/tui/components/DashboardSchedulesTab.js +14 -11
  747. package/dist/tui/components/DashboardTasksTab.js +12 -21
  748. package/dist/tui/components/DashboardThreadsTab.js +8 -11
  749. package/dist/tui/components/InputBox.js +3 -5
  750. package/dist/tui/components/Notifications.d.ts +1 -8
  751. package/dist/tui/components/Notifications.js +6 -24
  752. package/dist/tui/components/ProjectSwitcher.d.ts +1 -2
  753. package/dist/tui/components/ProjectSwitcher.js +7 -15
  754. package/dist/tui/components/SessionPicker.js +4 -6
  755. package/dist/tui/components/SidePanel.d.ts +1 -3
  756. package/dist/tui/components/SidePanel.js +2 -4
  757. package/dist/tui/components/SlashMenu.js +3 -2
  758. package/dist/tui/components/StatusLine.js +7 -16
  759. package/dist/tui/components/Transcript.d.ts +2 -3
  760. package/dist/tui/components/Transcript.js +2 -13
  761. package/dist/tui/components/dashboard-constants.js +0 -6
  762. package/dist/tui/hooks/useDashboardData.d.ts +1 -9
  763. package/dist/tui/hooks/useDashboardData.js +8 -33
  764. package/dist/tui/hooks/useKeybindings.d.ts +0 -1
  765. package/dist/tui/hooks/useKeybindings.js +0 -7
  766. package/dist/tui/hooks/useMouseHandler.d.ts +2 -4
  767. package/dist/tui/hooks/useMouseHandler.js +1 -14
  768. package/dist/tui/hooks/useMutate.js +2 -4
  769. package/dist/tui/hooks/useNotifications.d.ts +0 -2
  770. package/dist/tui/hooks/useNotifications.js +0 -10
  771. package/dist/tui/hooks/useTranscript.d.ts +0 -2
  772. package/dist/tui/hooks/useTranscript.js +0 -7
  773. package/dist/tui/index.js +7 -5
  774. package/dist/tui/logic.d.ts +0 -15
  775. package/dist/tui/logic.js +0 -61
  776. package/dist/tui/raf-batch.d.ts +0 -2
  777. package/dist/tui/raf-batch.js +0 -14
  778. package/dist/tui/render/markdown.js +0 -3
  779. package/dist/tui/render-output.d.ts +2 -6
  780. package/dist/tui/render-output.js +0 -5
  781. package/dist/tui/slash-commands.js +33 -32
  782. package/dist/tui/turn-status.js +3 -8
  783. package/dist/tui/ws-client.d.ts +1 -6
  784. package/dist/tui/ws-client.js +0 -18
  785. package/package.json +4 -4
  786. package/web/dist/assets/index-C9sEss8T.css +1 -0
  787. package/web/dist/assets/index-fVf_wSMQ.js +447 -0
  788. package/web/dist/assets/{index-BAeLybF0.js → index-zvUjPRjt.js} +1 -1
  789. package/web/dist/index.html +2 -5
  790. package/web/dist/theme.css +3 -5
  791. package/defaults/config/AGENTS.md +0 -10
  792. package/defaults/config/hooks/AGENTS.md +0 -15
  793. package/defaults/config/mcp-config-empty.json +0 -3
  794. package/defaults/hooks/AGENTS.md +0 -15
  795. package/defaults/mcp-config-slack.json +0 -12
  796. package/defaults/mcp-config-web.json +0 -12
  797. package/dist/agent-adapter/index.d.ts +0 -5
  798. package/dist/agent-adapter/index.js +0 -5
  799. package/dist/agent-adapter/normalize/event-stream.d.ts +0 -9
  800. package/dist/agent-adapter/normalize/event-stream.js +0 -43
  801. package/dist/agent-adapter/normalize/hooks.d.ts +0 -26
  802. package/dist/agent-adapter/normalize/hooks.js +0 -1
  803. package/dist/domain/commissions/prompt-block.d.ts +0 -19
  804. package/dist/domain/commissions/prompt-block.js +0 -76
  805. package/dist/domain/mcp/core-server.d.ts +0 -1
  806. package/dist/domain/mcp/core-server.js +0 -26
  807. package/dist/domain/mcp/feishu/index.d.ts +0 -4
  808. package/dist/domain/mcp/feishu/index.js +0 -9
  809. package/dist/domain/mcp/feishu-server.d.ts +0 -1
  810. package/dist/domain/mcp/feishu-server.js +0 -34
  811. package/dist/domain/mcp/interaction-server.d.ts +0 -1
  812. package/dist/domain/mcp/interaction-server.js +0 -38
  813. package/dist/domain/mcp/manager-qa-server.d.ts +0 -1
  814. package/dist/domain/mcp/manager-qa-server.js +0 -22
  815. package/dist/domain/mcp/server.d.ts +0 -1
  816. package/dist/domain/mcp/server.js +0 -33
  817. package/dist/domain/mcp/slack-server.d.ts +0 -2
  818. package/dist/domain/mcp/slack-server.js +0 -35
  819. package/dist/domain/mcp/tasks-server.d.ts +0 -1
  820. package/dist/domain/mcp/tasks-server.js +0 -22
  821. package/dist/domain/mcp/thread-server.d.ts +0 -1
  822. package/dist/domain/mcp/thread-server.js +0 -26
  823. package/dist/domain/mcp/web-server.d.ts +0 -1
  824. package/dist/domain/mcp/web-server.js +0 -30
  825. package/dist/domain/remote/cortex-client-config.d.ts +0 -32
  826. package/dist/domain/remote/cortex-client-config.js +0 -45
  827. package/dist/domain/tasks/parser.d.ts +0 -1
  828. package/dist/domain/tasks/parser.js +0 -5
  829. package/dist/domain/tasks/pending-tracker.d.ts +0 -70
  830. package/dist/domain/tasks/pending-tracker.js +0 -165
  831. package/dist/domain/tasks/recommendation/extractor.d.ts +0 -12
  832. package/dist/domain/tasks/recommendation/extractor.js +0 -559
  833. package/dist/domain/tasks/recommendation/patterns.d.ts +0 -11
  834. package/dist/domain/tasks/recommendation/patterns.js +0 -95
  835. package/dist/domain/tasks/recommendation/types.d.ts +0 -67
  836. package/dist/domain/tasks/recommendation/types.js +0 -1
  837. package/dist/domain/tasks/store.d.ts +0 -1
  838. package/dist/domain/tasks/store.js +0 -3
  839. package/dist/domain/tasks/system/task-process.d.ts +0 -37
  840. package/dist/domain/tasks/system/task-process.js +0 -117
  841. package/dist/domain/threads/auto-thread.d.ts +0 -3
  842. package/dist/domain/threads/auto-thread.js +0 -15
  843. package/dist/events/event-replay.d.ts +0 -1
  844. package/dist/events/event-replay.js +0 -47
  845. package/dist/orchestration/interactions/update-prompt-slack.d.ts +0 -6
  846. package/dist/orchestration/interactions/update-prompt-slack.js +0 -100
  847. package/dist/orchestration/routing/commands/thread.d.ts +0 -2
  848. package/dist/orchestration/routing/commands/thread.js +0 -2
  849. package/dist/platform/adapters/slack-project-conduits.d.ts +0 -1
  850. package/dist/platform/adapters/slack-project-conduits.js +0 -5
  851. package/dist/platform/adapters/tui/tui-notifications.d.ts +0 -12
  852. package/dist/platform/adapters/tui/tui-notifications.js +0 -56
  853. package/dist/store/in-memory-repository.d.ts +0 -14
  854. package/dist/store/in-memory-repository.js +0 -27
  855. package/dist/tui/components/PlanFeedbackModal.d.ts +0 -11
  856. package/dist/tui/components/PlanFeedbackModal.js +0 -161
  857. package/dist/tui/hooks/useWsClient.d.ts +0 -29
  858. package/dist/tui/hooks/useWsClient.js +0 -69
  859. package/dist/tui/render/rich-blocks.d.ts +0 -11
  860. package/dist/tui/render/rich-blocks.js +0 -26
  861. package/web/dist/AGENTS.md +0 -10
  862. package/web/dist/assets/index-B1dBi8Za.css +0 -1
  863. package/web/dist/assets/index-BcQI8Fh5.js +0 -445
@@ -1,46 +1,10 @@
1
- // input: UiServiceDeps + ThreadTemplateDetailParams { kind, name }
2
- // output: threadTemplates.detail handler → ThreadTemplateDetail
3
- // pos: The drill-in the templates panel never had. Beyond the raw body it answers the three
4
- // questions the editor needs before it lets anyone type: is this entity currently valid,
5
- // what else depends on it, and is anything running on it right now — because transitions
6
- // are re-read on every step, so a save can reroute or stall a live thread.
7
- // For a shell-binding template it also returns the expanded graph, which is otherwise
8
- // impossible to see: `execute-review.json` is four lines that bind a shell.
9
- import { existsSync, readdirSync, readFileSync } from 'node:fs';
10
- import * as path from 'node:path';
11
- import { DEFAULTS_DIR } from '../../../core/paths.js';
12
- import { validateEntity, rawRegistryFromDir, dependentTemplates, } from '../../threads/template-validate.js';
13
- import { readEntity } from '../../threads/template-writer.js';
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { validateEntity, dependentTemplates, } from '../../threads/template-validate.js';
3
+ import { readEntity, readRawRegistry } from '../../threads/template-writer.js';
14
4
  import { loaderRefResolver, CONFIG_TEMPLATES_DIR } from '../../threads/template-loader.js';
15
5
  import { isShellBinding, expandShell } from '../../threads/shell-templates.js';
16
- const IO = {
17
- readdirSync: (p) => readdirSync(p),
18
- readFileSync: (p, enc) => readFileSync(p, enc),
19
- existsSync,
20
- join: path.join,
21
- };
22
- const SUBDIR = {
23
- template: 'templates',
24
- agent: 'agents',
25
- shell: 'shells',
26
- };
6
+ import { classifyOrigin } from './thread-templates.js';
27
7
  const TERMINAL_THREAD_STATUSES = new Set(['completed', 'failed', 'cancelled', 'aborted']);
28
- /**
29
- * Compare against the shipped defaults. `mergeThreadTemplates` is copy-if-missing and never
30
- * overwrites, so a user file that differs from its default has forked permanently — it will not
31
- * receive upstream changes. Worth knowing before editing.
32
- */
33
- export function classifyOrigin(defaultsRoot, kind, name, userContent) {
34
- const shipped = path.join(defaultsRoot, 'config', 'thread-templates', SUBDIR[kind], `${name}.json`);
35
- if (!existsSync(shipped))
36
- return 'custom';
37
- try {
38
- return readFileSync(shipped, 'utf8') === userContent ? 'stock' : 'modified';
39
- }
40
- catch {
41
- return 'custom';
42
- }
43
- }
44
8
  /** Expand a shell-binding template so the editor can show the graph it actually runs. */
45
9
  function expandBinding(name, body, registry) {
46
10
  if (!isShellBinding(body))
@@ -63,7 +27,7 @@ function expandBinding(name, body, registry) {
63
27
  export async function handleThreadTemplatesDetail(deps, params) {
64
28
  const { kind, name } = params;
65
29
  const entity = readEntity(CONFIG_TEMPLATES_DIR, kind, name);
66
- const registry = rawRegistryFromDir(CONFIG_TEMPLATES_DIR, IO);
30
+ const registry = readRawRegistry(CONFIG_TEMPLATES_DIR);
67
31
  const { errors, warnings } = validateEntity(kind, name, entity.body, registry, loaderRefResolver());
68
32
  const rawContent = existsSync(entity.filePath) ? readFileSync(entity.filePath, 'utf8') : null;
69
33
  // Transitions are re-read every step, so a live thread on this template is the thing a user most
@@ -81,7 +45,7 @@ export async function handleThreadTemplatesDetail(deps, params) {
81
45
  description,
82
46
  body: entity.body,
83
47
  filePath: entity.filePath,
84
- origin: classifyOrigin(DEFAULTS_DIR, kind, name, rawContent),
48
+ origin: await classifyOrigin(kind, name, rawContent),
85
49
  sha256: entity.sha256,
86
50
  errors,
87
51
  warnings,
@@ -1,10 +1,15 @@
1
- import type { UiServiceDeps, ThreadTemplatesGetParams, ThreadTemplateEntry } from '../types.js';
1
+ import type { UiServiceDeps, ThreadTemplatesGetParams, ThreadTemplateEntry, ThreadTemplateOrigin } from '../types.js';
2
+ /**
3
+ * Relationship to the shipped default of the same name. `mergeThreadTemplates` is copy-if-missing
4
+ * and never overwrites, so a user file that differs has forked from upstream permanently.
5
+ */
6
+ export declare function classifyOrigin(kind: ThreadTemplateEntry['kind'], name: string, content: string | null): Promise<ThreadTemplateOrigin>;
2
7
  /**
3
8
  * Read all thread-template entries from config/thread-templates/{templates,agents,shells}/*.json.
4
- * Pure over configDir + defaultsRoot (hermetically testable). Returns templates first, then agents,
9
+ * Pure over configDir (hermetically testable). Returns templates first, then agents,
5
10
  * then shells, each group sorted alphabetically by basename. body is null when the file cannot be
6
11
  * parsed. Each entry carries its validation verdict so the list can flag a broken entity without a
7
12
  * round trip per row.
8
13
  */
9
- export declare function readThreadTemplates(configDir: string, defaultsRoot?: string): Promise<ThreadTemplateEntry[]>;
14
+ export declare function readThreadTemplates(configDir: string): Promise<ThreadTemplateEntry[]>;
10
15
  export declare function handleThreadTemplatesGet(_deps: UiServiceDeps, _params: ThreadTemplatesGetParams): Promise<ThreadTemplateEntry[]>;
@@ -1,15 +1,9 @@
1
- // input: UiServiceDeps + ThreadTemplatesGetParams (empty)
2
- // output: threadTemplates.get handler → ThreadTemplateEntry[] — full body of every
3
- // thread-template JSON file under config/thread-templates/{templates,agents,shells}/
4
- // pos: query handler for 'threadTemplates.get' (plan §12 A item 3 / 9c). Pure
5
- // `readThreadTemplates(configDir)` + thin `handleThreadTemplatesGet` binding CONFIG_DIR.
6
- // No secrets in template JSON files; body is the full parsed content, null on parse error.
7
- // Kind order: templates → agents → shells. Within each kind: alphabetical by filename.
8
1
  import fs from 'node:fs/promises';
9
2
  import path from 'node:path';
10
3
  import { CONFIG_DIR, DEFAULTS_DIR } from '../../../core/paths.js';
11
4
  import { validateRegistry } from '../../threads/template-validate.js';
12
5
  import { loaderRefResolver } from '../../threads/template-loader.js';
6
+ import { entityPath } from '../../threads/template-writer.js';
13
7
  async function readJson(file) {
14
8
  try {
15
9
  const raw = JSON.parse(await fs.readFile(file, 'utf8'));
@@ -21,11 +15,6 @@ async function readJson(file) {
21
15
  return null;
22
16
  }
23
17
  }
24
- const SUBDIR = {
25
- template: 'templates',
26
- agent: 'agents',
27
- shell: 'shells',
28
- };
29
18
  async function readEntriesForKind(dir, kind) {
30
19
  try {
31
20
  const files = await fs.readdir(dir);
@@ -47,8 +36,8 @@ async function readEntriesForKind(dir, kind) {
47
36
  * Relationship to the shipped default of the same name. `mergeThreadTemplates` is copy-if-missing
48
37
  * and never overwrites, so a user file that differs has forked from upstream permanently.
49
38
  */
50
- async function classifyOrigin(defaultsRoot, kind, name, content) {
51
- const shipped = path.join(defaultsRoot, 'config', 'thread-templates', SUBDIR[kind], `${name}.json`);
39
+ export async function classifyOrigin(kind, name, content) {
40
+ const shipped = entityPath(path.join(DEFAULTS_DIR, 'config', 'thread-templates'), kind, name);
52
41
  const stock = await fs.readFile(shipped, 'utf8').catch(() => null);
53
42
  if (stock === null)
54
43
  return 'custom';
@@ -56,12 +45,12 @@ async function classifyOrigin(defaultsRoot, kind, name, content) {
56
45
  }
57
46
  /**
58
47
  * Read all thread-template entries from config/thread-templates/{templates,agents,shells}/*.json.
59
- * Pure over configDir + defaultsRoot (hermetically testable). Returns templates first, then agents,
48
+ * Pure over configDir (hermetically testable). Returns templates first, then agents,
60
49
  * then shells, each group sorted alphabetically by basename. body is null when the file cannot be
61
50
  * parsed. Each entry carries its validation verdict so the list can flag a broken entity without a
62
51
  * round trip per row.
63
52
  */
64
- export async function readThreadTemplates(configDir, defaultsRoot = DEFAULTS_DIR) {
53
+ export async function readThreadTemplates(configDir) {
65
54
  const tt = path.join(configDir, 'thread-templates');
66
55
  const [templates, agents, shells] = await Promise.all([
67
56
  readEntriesForKind(path.join(tt, 'templates'), 'template'),
@@ -81,7 +70,7 @@ export async function readThreadTemplates(configDir, defaultsRoot = DEFAULTS_DIR
81
70
  ...entry,
82
71
  valid: errorCount === 0,
83
72
  errorCount,
84
- origin: await classifyOrigin(defaultsRoot, entry.kind, entry.name, content),
73
+ origin: await classifyOrigin(entry.kind, entry.name, content),
85
74
  };
86
75
  }));
87
76
  }
@@ -1,3 +1,4 @@
1
+ import * as i18n from '../../../core/i18n.js';
1
2
  import { readFile } from 'node:fs/promises';
2
3
  import { toTaskInfo } from './tasks.js';
3
4
  function mapStatus(status) {
@@ -66,7 +67,7 @@ function buildArtifactRefs(t, content) {
66
67
  export async function handleThreadsGet(deps, params) {
67
68
  const t = deps.threadStore.get(params.threadId);
68
69
  if (!t)
69
- throw new Error(`thread not found: ${params.threadId}`);
70
+ throw new Error(i18n.t('ui.thread.notFound', { id: params.threadId }));
70
71
  const steps = buildSteps(t);
71
72
  const content = await readArtifactContent(t.artifactPath ?? null, params.includeArtifactContent);
72
73
  return {
@@ -1,10 +1,3 @@
1
- // input: UiServiceDeps + WaitpointsListParams
2
- // output: handleWaitpointsList → WaitpointInfo[]; ownsWaitpoint (the ownership rule, shared with
3
- // query/sessions.ts); toWaitpointInfo (the redacting serialiser)
4
- // pos: query handler for 'waitpoints.list' — the operator-facing view of the waitpoints a
5
- // session is still waiting on. Deliberately NOT domain/waitpoints' `publicView`: that one
6
- // is written for the agent and hides exactly the fields a human needs (delivery state, wake
7
- // budget, rate-limit latch). Records reach this file only through UiServiceDeps.
8
1
  import { getSettings } from '../../../core/settings.js';
9
2
  const HOUR_MS = 60 * 60 * 1000;
10
3
  /**
@@ -3,8 +3,8 @@ export declare const sessionsListInput: z.ZodObject<{
3
3
  projectId: z.ZodOptional<z.ZodString>;
4
4
  resumable: z.ZodOptional<z.ZodBoolean>;
5
5
  origin: z.ZodOptional<z.ZodEnum<{
6
- thread: "thread";
7
6
  direct: "direct";
7
+ thread: "thread";
8
8
  scheduled: "scheduled";
9
9
  }>>;
10
10
  }, z.core.$strip>;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const sessionsSetStarredInput: z.ZodObject<{
3
+ sessionId: z.ZodString;
4
+ starred: z.ZodBoolean;
5
+ }, z.core.$strip>;
6
+ export declare const sessionsRenameInput: z.ZodObject<{
7
+ sessionId: z.ZodString;
8
+ label: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export type SessionsSetStarredArgs = z.infer<typeof sessionsSetStarredInput>;
11
+ export type SessionsSetStarredReturn = SessionsSetStarredArgs;
12
+ export type SessionsRenameArgs = z.infer<typeof sessionsRenameInput>;
13
+ export type SessionsRenameReturn = SessionsRenameArgs;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ export const sessionsSetStarredInput = z.object({
3
+ sessionId: z.string().min(1),
4
+ starred: z.boolean(),
5
+ });
6
+ export const sessionsRenameInput = z.object({
7
+ sessionId: z.string().min(1),
8
+ label: z.string().trim().min(1).max(60),
9
+ });
@@ -1,5 +1,6 @@
1
1
  import type { EventBus } from '../../events/index.js';
2
+ import type { AssistantSnapshots } from './assistant-snapshots.js';
2
3
  import type { SubscribeFilter, UiEvent } from './types.js';
3
- export declare function createSubscription(bus: EventBus, filter: SubscribeFilter): AsyncIterable<UiEvent> & {
4
+ export declare function createSubscription(bus: EventBus, filter: SubscribeFilter, assistantSnapshots?: AssistantSnapshots): AsyncIterable<UiEvent> & {
4
5
  close(): void;
5
6
  };
@@ -1,7 +1,3 @@
1
- // input: EventBus + SubscribeFilter
2
- // output: AsyncIterable<UiEvent> & { close() } — bounded queue, overflow emits synthetic dropped event
3
- // pos: subscribe primitive for UiService. Scope filters are applied BEFORE enqueueing, and the
4
- // high-volume types in SESSION_SCOPED_ONLY require a matching sessionId to be delivered.
5
1
  const QUEUE_CAP = 256;
6
2
  /**
7
3
  * Event types that a subscription only receives when it names the session they belong to.
@@ -75,11 +71,7 @@ function createAsyncQueue(cap, onOverflow) {
75
71
  },
76
72
  };
77
73
  }
78
- export function createSubscription(bus, filter) {
79
- const eventTypes = filter.events;
80
- const projectId = filter.projectId ?? null;
81
- const executionId = filter.executionId ?? null;
82
- const sessionId = filter.sessionId ?? null;
74
+ function createUiQueue() {
83
75
  let droppedCount = 0;
84
76
  // Wire overflow handler: push a synthetic UiEvent onto the queue.
85
77
  // The queue's _inOverflow guard ensures push() from this callback does
@@ -94,51 +86,40 @@ export function createSubscription(bus, filter) {
94
86
  // push() from within the guard: no overflow shift, item always appended.
95
87
  queue.push(synthetic);
96
88
  });
97
- const subscriptions = eventTypes.map((type) => {
98
- const sub = bus.subscribe(type, (event) => {
99
- // Pre-filter the scope-required types BEFORE anything reaches the bounded queue, so one
100
- // busy session can never shed another subscriber's events (see SESSION_SCOPED_ONLY).
101
- if (SESSION_SCOPED_ONLY.has(event.type) && (!sessionId || event.sessionId !== sessionId)) {
102
- return;
103
- }
104
- // Post-filter by projectId if specified
105
- if (projectId && event.projectId && event.projectId !== projectId) {
106
- return;
107
- }
108
- if (projectId && event.payload?.projectId && event.payload.projectId !== projectId) {
109
- return;
110
- }
111
- // Post-filter by executionId — scopes execution.log to a single execution (B2-C).
112
- if (executionId && event.executionId && event.executionId !== executionId) {
113
- return;
114
- }
115
- // Post-filter by sessionId — scopes session.message to a single session (S4 chat).
116
- if (sessionId && event.sessionId && event.sessionId !== sessionId) {
117
- return;
118
- }
119
- const uiEvent = {
120
- type: event.type,
121
- ts: event.ts,
122
- payload: event,
123
- };
124
- queue.push(uiEvent);
125
- });
126
- return sub;
127
- });
89
+ return queue;
90
+ }
91
+ function matchesScope(event, { projectId, sessionId }) {
92
+ // Scope-required types must be filtered BEFORE reaching the bounded queue.
93
+ if (SESSION_SCOPED_ONLY.has(event.type) && (!sessionId || event.sessionId !== sessionId))
94
+ return false;
95
+ if (projectId && ((event.projectId && event.projectId !== projectId)
96
+ || (event.payload?.projectId && event.payload.projectId !== projectId)))
97
+ return false;
98
+ return !(sessionId && event.sessionId && event.sessionId !== sessionId);
99
+ }
100
+ export function createSubscription(bus, filter, assistantSnapshots) {
101
+ const queue = createUiQueue();
102
+ const subscriptions = filter.events.map((type) => bus.subscribe(type, (event) => {
103
+ if (matchesScope(event, filter))
104
+ queue.push({ type: event.type, ts: event.ts, payload: event });
105
+ }));
106
+ // Registration and seed enqueue are synchronous: no publish can fall between the snapshot
107
+ // and forwarding. Seeds are never published onto the bus or sent to unscoped subscribers.
108
+ if (filter.sessionId && filter.events.includes('session.message.delta') && assistantSnapshots) {
109
+ queue.push(assistantSnapshots.snapshot(filter.sessionId));
110
+ }
128
111
  let closed = false;
129
- const close = () => {
130
- if (closed)
131
- return;
132
- closed = true;
133
- for (const sub of subscriptions) {
134
- sub.unsubscribe();
135
- }
136
- queue.close();
137
- };
138
112
  return {
139
113
  [Symbol.asyncIterator]() {
140
114
  return queue[Symbol.asyncIterator]();
141
115
  },
142
- close,
116
+ close() {
117
+ if (closed)
118
+ return;
119
+ closed = true;
120
+ for (const sub of subscriptions)
121
+ sub.unsubscribe();
122
+ queue.close();
123
+ },
143
124
  };
144
125
  }
@@ -1,7 +1,4 @@
1
- // input: tRPC core and procedure error shapes
2
- // output: router, publicProcedure and createCallerFactory
3
- // pos: UI router foundation with credential-error redaction
4
- // >>> Once updated, update this header and parent AGENTS.md <<<
1
+ import * as i18n from '../../core/i18n.js';
5
2
  import { initTRPC } from '@trpc/server';
6
3
  /**
7
4
  * Keepalive for the SSE subscription that carries the whole UI's live state.
@@ -37,7 +34,7 @@ const t = initTRPC.create({
37
34
  errorFormatter({ shape, path }) {
38
35
  if (path !== 'config.setPlatform')
39
36
  return shape;
40
- return { ...shape, message: 'Platform configuration request failed',
37
+ return { ...shape, message: i18n.t('ui.platform.requestFailed'),
41
38
  data: { ...shape.data, stack: undefined } };
42
39
  },
43
40
  });
@@ -1,15 +1,19 @@
1
1
  import type { PlatformSettingsPatch, PlatformSettingsSnapshot } from '../../core/platform-settings-spec.js';
2
2
  export type { PlatformSettingsPatch, PlatformSettingsSnapshot, PlatformFieldSnapshot, PlatformFieldKey } from '../../core/platform-settings-spec.js';
3
+ import type { SessionsSetStarredArgs, SessionsSetStarredReturn, SessionsRenameArgs, SessionsRenameReturn } from './session-metadata-schemas.js';
4
+ export type { SessionsSetStarredArgs, SessionsSetStarredReturn, SessionsRenameArgs, SessionsRenameReturn, } from './session-metadata-schemas.js';
3
5
  import type { Project, CreateProjectResult } from '../projects/index.js';
4
6
  import type { CostSummary } from '../costs/cost-tracker.js';
5
7
  import type { ProviderUsage } from '../costs/usage-store.js';
6
8
  export type { ProviderUsage, UsageBilling, UsageFreshness, UsageWindow } from '../costs/usage-store.js';
7
9
  import type { ServerUpdateStatus } from '../system/update-ui-state.js';
10
+ import type { SystemUpdateCheckResult } from '../system/server-update-coordinator.js';
11
+ export type { SystemUpdateCheckResult } from '../system/server-update-coordinator.js';
8
12
  export type { ServerUpdateState, ServerUpdateStatus } from '../system/update-ui-state.js';
9
13
  import type { EventBus } from '../../events/index.js';
10
14
  import type { SessionStateReader } from '../../core/session-state.js';
11
15
  import type { Settings, SettingSnapshotEntry } from '../../core/settings-spec.js';
12
- import type { AuthNoticeAction, ChatNoticeLevel, NoticeAction, SessionContextUsage, SystemTurnOrigin, TodoSnapshot } from '../../core/types/agent-types.js';
16
+ import type { AttachmentMeta, AuthNoticeAction, ChatNoticeLevel, NoticeAction, SessionContextUsage, SystemTurnOrigin, TodoSnapshot } from '../../core/types/agent-types.js';
13
17
  export type { AuthNoticeAction, ChatNoticeLevel, NoticeAction, SessionContextUsage, SystemTurnOrigin, TodoItem, TodoSnapshot, TodoStatus, } from '../../core/types/agent-types.js';
14
18
  import type { PlatformAdapter } from '../../platform/adapter.js';
15
19
  import type { SubagentSpawnRef } from '../../agent-adapter/normalize/event-types.js';
@@ -40,13 +44,13 @@ export type Err = {
40
44
  message: string;
41
45
  };
42
46
  export type Result<T> = Ok<T> | Err;
43
- export type QueryScope = 'projects.list' | 'sessions.list' | 'sessions.transcript' | 'sessions.subagentTranscript' | 'sessions.debugDetails' | 'sessions.pendingInteraction' | 'threads.list' | 'threads.get' | 'tasks.list' | 'tasks.verification' | 'schedules.list' | 'commissions.list' | 'commissions.get' | 'commissions.decisions' | 'executions.list' | 'executions.get' | 'memory.tree' | 'memory.file' | 'approvals.list' | 'issues.list' | 'notes.list' | 'cost.summary' | 'config.get' | 'auth.status' | 'auth.flowState' | 'auth.customProviders' | 'models.catalog' | 'hooks.list' | 'machines.list' | 'machines.detail' | 'skills.list' | 'plugins.list' | 'plugins.skillFile' | 'plugins.mcpRead' | 'threadTemplates.get' | 'threadTemplates.detail' | 'system.daemonStatus' | 'system.rateLimitStatus' | 'system.usageStatus' | 'system.notices' | 'system.updateStatus' | 'waitpoints.list';
44
- export type MutateOp = 'projects.create' | 'sessions.create' | 'sessions.send' | 'sessions.cancel' | 'sessions.compact' | 'sessions.setProfile' | 'sessions.setAgent' | 'sessions.setSelection' | 'sessions.setCommission' | 'sessions.createAndSend' | 'sessions.markRead' | 'sessions.markManyRead' | 'sessions.answerQuestion' | 'sessions.respondPlan' | 'sessions.respondDecision' | 'sessions.cancelResume' | 'sessions.rewind' | 'threads.cancel' | 'executions.cancel' | 'waitpoints.cancel' | 'schedules.pause' | 'schedules.resume' | 'schedules.remove' | 'schedules.add' | 'schedules.update' | 'commissions.close' | 'tasks.claim' | 'tasks.unclaim' | 'tasks.complete' | 'tasks.block' | 'tasks.unblock' | 'approvals.approve' | 'approvals.reject' | 'approvals.request' | 'issues.handle' | 'issues.delete' | 'notes.add' | 'notes.update' | 'notes.setCompleted' | 'notes.delete' | 'notes.clearCompleted' | 'config.set' | 'config.setPlatform' | 'config.setProviderRateLimitPolicy' | 'auth.startLogin' | 'auth.respondPrompt' | 'auth.cancelFlow' | 'auth.logout' | 'auth.syncGateway' | 'auth.upsertCustomProvider' | 'auth.removeCustomProvider' | 'hooks.create' | 'hooks.update' | 'hooks.setEnabled' | 'hooks.remove' | 'hooks.test' | 'profiles.create' | 'profiles.update' | 'profiles.remove' | 'plugins.assign' | 'plugins.skillWrite' | 'plugins.skillCreate' | 'plugins.skillMove' | 'plugins.skillRemove' | 'plugins.create' | 'plugins.remove' | 'plugins.convertToPortable' | 'plugins.mcpWrite' | 'threadTemplates.validate' | 'threadTemplates.save' | 'threadTemplates.remove' | 'system.restart' | 'system.clearRateLimit' | 'system.refreshUsage' | 'system.applyUpdate' | 'system.skipUpdate';
47
+ /** Every query scope — the keys of `QueryParamMap` (mirrored by `QueryReturnMap`). */
48
+ export type QueryScope = keyof QueryParamMap;
49
+ /** Every mutate op — the keys of `MutateArgsMap` (mirrored by `MutateReturnMap`). */
50
+ export type MutateOp = keyof MutateArgsMap;
45
51
  export interface SubscribeFilter {
46
52
  events: string[];
47
53
  projectId?: string | null;
48
- /** Scope execution-carrying events (agent.*) to a single execution. */
49
- executionId?: string | null;
50
54
  /** Scope `session.message` events to a single session (S4 chat live stream). REQUIRED for
51
55
  * `session.message.delta`: token-level previews are delivered to session-scoped subscriptions
52
56
  * only, so an app-wide stream is never flooded with another session's deltas. */
@@ -250,21 +254,7 @@ export interface SessionsCreateArgs {
250
254
  commissionId: string;
251
255
  } | null;
252
256
  }
253
- export interface AttachmentMeta {
254
- name: string;
255
- path: string;
256
- size: number;
257
- mimeType: string;
258
- /**
259
- * `view` is an agent-authored HTML document meant to be RENDERED in the chat (the `send_view`
260
- * MCP tool), not merely downloaded. It is minted only by the server-side view sender — the
261
- * upload classifiers (`classifyMime`, `classifyAttachment`) can never produce it, so a file a
262
- * user uploads is never executable no matter what its extension says. Renderers must treat this
263
- * bucket as untrusted content and load it in a `sandbox="allow-scripts"` frame WITHOUT
264
- * `allow-same-origin` (see web/src/features/media/html-sandbox.ts).
265
- */
266
- type: 'image' | 'video' | 'file' | 'view';
267
- }
257
+ export type { AttachmentMeta } from '../../core/types/agent-types.js';
268
258
  export interface SessionsSendArgs {
269
259
  sessionId: string;
270
260
  text: string;
@@ -636,6 +626,10 @@ export interface SessionInfo {
636
626
  lastUsedAt: string;
637
627
  resumable: boolean;
638
628
  label: string | null;
629
+ /** Optional for older fixtures/clients; sessions.list always supplies a boolean. */
630
+ starred?: boolean;
631
+ /** Explicitly renamed labels take precedence over generated scheduled-run titles. */
632
+ labelRenamed?: boolean;
639
633
  /** The session's active agent profile (registry record). Null when never explicitly set — the
640
634
  * client falls back to the config default. Kept in sync by the shared profile-switch rule. */
641
635
  profileName: string | null;
@@ -855,6 +849,8 @@ export interface TranscriptSubagentSummary {
855
849
  toolCount: number;
856
850
  hasDetails: boolean;
857
851
  structurallyOpen: boolean;
852
+ /** Explicit per-child lifecycle authority; absent for legacy structural inference. */
853
+ status?: 'running' | 'completed' | 'failed' | 'killed';
858
854
  }
859
855
  /** Rows that changed since a client's cursor, addressed by flat position across the transcript. */
860
856
  export interface TranscriptDeltaRow {
@@ -1933,13 +1929,11 @@ export interface DaemonProcessInfo {
1933
1929
  pid: number | null;
1934
1930
  uptime: string | null;
1935
1931
  port: number | null;
1936
- extras: Record<string, string | number> | null;
1937
1932
  }
1938
1933
  export interface SystemDaemonStatus {
1939
1934
  processes: DaemonProcessInfo[];
1940
1935
  lastRestart: {
1941
1936
  at: string | null;
1942
- reason: string | null;
1943
1937
  };
1944
1938
  /** The supervisor's hot-rebuild pipeline: the run in flight, or the last one it finished. Null
1945
1939
  * when no rebuild has run (production installs never rebuild) or when the record belongs to a
@@ -1990,6 +1984,7 @@ export interface SystemRestartReturn {
1990
1984
  }
1991
1985
  export type SystemUpdateStatusParams = Record<string, never>;
1992
1986
  export type SystemUpdateStatus = ServerUpdateStatus;
1987
+ export type SystemCheckUpdateArgs = Record<string, never>;
1993
1988
  export type SystemApplyUpdateArgs = Record<string, never>;
1994
1989
  export type SystemSkipUpdateArgs = Record<string, never>;
1995
1990
  export interface SystemUpdateDecisionReturn {
@@ -2218,6 +2213,8 @@ export interface MutateArgsMap {
2218
2213
  'sessions.setSelection': SessionsSetSelectionArgs;
2219
2214
  'sessions.setCommission': SessionsSetCommissionArgs;
2220
2215
  'sessions.createAndSend': SessionsCreateAndSendArgs;
2216
+ 'sessions.setStarred': SessionsSetStarredArgs;
2217
+ 'sessions.rename': SessionsRenameArgs;
2221
2218
  'sessions.markRead': SessionsMarkReadArgs;
2222
2219
  'sessions.markManyRead': SessionsMarkManyReadArgs;
2223
2220
  'sessions.answerQuestion': SessionsAnswerQuestionArgs;
@@ -2282,6 +2279,7 @@ export interface MutateArgsMap {
2282
2279
  'system.restart': SystemRestartArgs;
2283
2280
  'system.clearRateLimit': SystemClearRateLimitArgs;
2284
2281
  'system.refreshUsage': SystemRefreshUsageArgs;
2282
+ 'system.checkUpdate': SystemCheckUpdateArgs;
2285
2283
  'system.applyUpdate': SystemApplyUpdateArgs;
2286
2284
  'system.skipUpdate': SystemSkipUpdateArgs;
2287
2285
  }
@@ -2296,6 +2294,8 @@ export interface MutateReturnMap {
2296
2294
  'sessions.setSelection': SessionsSetSelectionReturn;
2297
2295
  'sessions.setCommission': SessionsSetCommissionReturn;
2298
2296
  'sessions.createAndSend': SessionsCreateAndSendReturn;
2297
+ 'sessions.setStarred': SessionsSetStarredReturn;
2298
+ 'sessions.rename': SessionsRenameReturn;
2299
2299
  'sessions.markRead': void;
2300
2300
  'sessions.markManyRead': SessionsMarkManyReadReturn;
2301
2301
  'sessions.answerQuestion': SessionsInteractionMutateReturn;
@@ -2363,13 +2363,14 @@ export interface MutateReturnMap {
2363
2363
  'system.restart': SystemRestartReturn;
2364
2364
  'system.clearRateLimit': SystemClearRateLimitReturn;
2365
2365
  'system.refreshUsage': SystemRefreshUsageReturn;
2366
+ 'system.checkUpdate': SystemUpdateCheckResult;
2366
2367
  'system.applyUpdate': SystemUpdateDecisionReturn;
2367
2368
  'system.skipUpdate': SystemUpdateDecisionReturn;
2368
2369
  }
2369
- export type QueryParams<S extends QueryScope> = S extends keyof QueryParamMap ? QueryParamMap[S] : never;
2370
- export type QueryReturn<S extends QueryScope> = S extends keyof QueryReturnMap ? QueryReturnMap[S] : never;
2371
- export type MutateArgs<O extends MutateOp> = O extends keyof MutateArgsMap ? MutateArgsMap[O] : never;
2372
- export type MutateReturn<O extends MutateOp> = O extends keyof MutateReturnMap ? MutateReturnMap[O] : never;
2370
+ export type QueryParams<S extends QueryScope> = QueryParamMap[S];
2371
+ export type QueryReturn<S extends QueryScope> = QueryReturnMap[S];
2372
+ export type MutateArgs<O extends MutateOp> = MutateArgsMap[O];
2373
+ export type MutateReturn<O extends MutateOp> = MutateReturnMap[O];
2373
2374
  export interface UiService {
2374
2375
  query<S extends QueryScope>(scope: S, params: QueryParams<S>): Promise<Result<QueryReturn<S>>>;
2375
2376
  mutate<O extends MutateOp>(op: O, args: MutateArgs<O>): Promise<Result<MutateReturn<O>>>;
@@ -2378,6 +2379,8 @@ export interface UiService {
2378
2379
  };
2379
2380
  }
2380
2381
  export interface UiServiceDeps {
2382
+ /** Shared with background timers; bounded discovery, never waits for update consent. */
2383
+ checkServerUpdate?: () => Promise<SystemUpdateCheckResult>;
2381
2384
  /** Optional seams for deterministic authentication dispatch tests. */
2382
2385
  getAuthStatus?: () => Promise<AuthStatusSnapshot>;
2383
2386
  authLogin?: AuthLoginService;
@@ -2406,6 +2409,9 @@ export interface UiServiceDeps {
2406
2409
  /** Stamp lastReadAt=now (unread tracking; backs `sessions.markRead`). Optional so existing
2407
2410
  * facade/test fixtures need not provide it (the handler no-ops when absent). */
2408
2411
  markRead?(sessionId: string): Promise<void>;
2412
+ /** Atomic metadata-only writes. Optional for read-only/legacy fixtures, not silent no-ops. */
2413
+ setStarred?(sessionId: string, starred: boolean): Promise<Session | null>;
2414
+ rename?(sessionId: string, label: string): Promise<Session | null>;
2409
2415
  };
2410
2416
  /** Capability hint for sessions.list; execution revalidates inside orchestration. Narrowed to
2411
2417
  * the two fields the answer depends on so the list can answer it once per distinct profile
@@ -2425,19 +2431,19 @@ export interface UiServiceDeps {
2425
2431
  ok: false;
2426
2432
  reason: 'not-found' | 'unsupported' | 'running';
2427
2433
  }>;
2434
+ /** Snapshot of started Cortex-managed children only; native CLI tasks use their own tracker. */
2435
+ getSubagentChildStatuses?: (sessionId: string) => ReadonlyMap<string, NonNullable<TranscriptSubagentSummary['status']>>;
2428
2436
  /** Backend-independent conversation history — read source for `sessions.transcript` (S4 chat). */
2429
2437
  conversationHistory: {
2430
2438
  getHistory(sessionId: string, options?: {
2431
2439
  includeToolDebug?: boolean;
2432
2440
  }): Promise<SessionHistory | null>;
2433
- getCompactHistory?(sessionId: string): Promise<import('../../store/conversation-history-repo.js').CompactConversationHistory | null>;
2434
- /** Compact history plus the cursor that makes the next read a delta. Optional: a store without
2435
- * it simply never serves deltas. */
2436
- getCompactHistoryAt?(sessionId: string): Promise<{
2441
+ /** Compact history plus the cursor that makes the next read a delta. */
2442
+ getCompactHistoryAt(sessionId: string): Promise<{
2437
2443
  value: import('../../store/conversation-history-repo.js').CompactConversationHistory | null;
2438
2444
  cursor: string;
2439
2445
  }>;
2440
- getSubagentHistory?(sessionId: string, subagentId: string): Promise<import('../../store/conversation-history-repo.js').SubagentConversationHistory>;
2446
+ getSubagentHistory(sessionId: string, subagentId: string): Promise<import('../../store/conversation-history-repo.js').SubagentConversationHistory>;
2441
2447
  getToolDebugDetails?(sessionId: string, toolRef: string): Promise<TranscriptDebugDetails | null>;
2442
2448
  /** First user message text — used to title a label-less session in `sessions.list`. Optional so
2443
2449
  * facade/test fixtures need not provide it (the handler skips titling when absent). */
@@ -2468,7 +2474,6 @@ export interface UiServiceDeps {
2468
2474
  * callback so the ui-service domain never imports orchestration (layer safety / depcruise).
2469
2475
  */
2470
2476
  sendSessionMessage: (opts: {
2471
- sessionId: string;
2472
2477
  channel: string;
2473
2478
  text: string;
2474
2479
  attachments?: AttachmentMeta[];
@@ -1,5 +1 @@
1
- // input: domain, platform, auth and runtime setting types
2
- // output: canonical UI DTOs and operation signatures
3
- // pos: Transport-neutral UI service contract
4
- // >>> Once updated, update this header and parent AGENTS.md <<<
5
1
  export {};
@@ -1,8 +1,5 @@
1
- // input: UI dependencies and operation handlers
2
- // output: UI dispatcher with credential-safe mutation audit
3
- // pos: Transport-neutral UI-service dispatcher
4
- // >>> Once updated, update this header and parent AGENTS.md <<<
5
1
  import { handleProjectsList } from './query/projects.js';
2
+ import { handleSetStarred, handleRenameSession } from './mutate/session-metadata.js';
6
3
  import { handleSessionsList, handleSessionsTranscript, handleSessionsSubagentTranscript, handleSessionsDebugDetails, handleSessionsPendingInteraction, } from './query/sessions.js';
7
4
  import { handleThreadsList, handleThreadsGet } from './query/threads.js';
8
5
  import { handleTasksList } from './query/tasks.js';
@@ -47,10 +44,11 @@ import { handleClaimTask, handleUnclaimTask, handleCompleteTask, handleBlockTask
47
44
  import { handleApproveApproval, handleRejectApproval, handleRequestApproval } from './mutate/approvals.js';
48
45
  import { handleIssuesDelete, handleIssuesHandle } from './mutate/issues.js';
49
46
  import { handleNotesAdd, handleNotesClearCompleted, handleNotesDelete, handleNotesSetCompleted, handleNotesUpdate, } from './mutate/notes.js';
50
- import { handleSystemRestart, handleSystemClearRateLimit, handleSystemRefreshUsage, handleSystemApplyUpdate, handleSystemSkipUpdate, } from './mutate/system.js';
47
+ import { handleSystemRestart, handleSystemClearRateLimit, handleSystemRefreshUsage, handleSystemCheckUpdate, handleSystemApplyUpdate, handleSystemSkipUpdate, } from './mutate/system.js';
51
48
  import { handleAuthCancelFlow, handleAuthLogout, handleAuthSyncGateway, handleAuthRespondPrompt, handleAuthStartLogin, } from './mutate/auth.js';
52
49
  import { handleCustomProviderRemove, handleCustomProviderUpsert, } from './mutate/custom-providers.js';
53
50
  import { createSubscription } from './subscribe.js';
51
+ import { AssistantSnapshots } from './assistant-snapshots.js';
54
52
  const queryHandlers = {
55
53
  'projects.list': (deps) => handleProjectsList(deps),
56
54
  'sessions.list': (deps, params) => handleSessionsList(deps, params),
@@ -106,6 +104,8 @@ const mutateHandlers = {
106
104
  'sessions.setSelection': (deps, args) => handleSetSelection(deps, args),
107
105
  'sessions.setCommission': (deps, args) => handleSetCommission(deps, args),
108
106
  'sessions.createAndSend': (deps, args) => handleCreateAndSend(deps, args),
107
+ 'sessions.setStarred': (deps, args) => handleSetStarred(deps, args),
108
+ 'sessions.rename': (deps, args) => handleRenameSession(deps, args),
109
109
  'sessions.markRead': (deps, args) => handleMarkReadSession(deps, args),
110
110
  'sessions.markManyRead': (deps, args) => handleMarkManyReadSessions(deps, args),
111
111
  'sessions.answerQuestion': (deps, args) => handleAnswerQuestion(deps, args),
@@ -170,6 +170,7 @@ const mutateHandlers = {
170
170
  'system.restart': (_deps, args) => handleSystemRestart(args),
171
171
  'system.clearRateLimit': (_deps, args) => handleSystemClearRateLimit(args),
172
172
  'system.refreshUsage': (_deps, args) => handleSystemRefreshUsage(args),
173
+ 'system.checkUpdate': handleSystemCheckUpdate,
173
174
  'system.applyUpdate': (_deps, args) => handleSystemApplyUpdate(args),
174
175
  'system.skipUpdate': (_deps, args) => handleSystemSkipUpdate(args),
175
176
  };
@@ -192,6 +193,7 @@ export function redactMutationAuditArgs(op, args) {
192
193
  return safe;
193
194
  }
194
195
  export function createUiService(deps) {
196
+ const assistantSnapshots = new AssistantSnapshots(deps.bus);
195
197
  return {
196
198
  async query(scope, params) {
197
199
  const handler = queryHandlers[scope];
@@ -235,7 +237,7 @@ export function createUiService(deps) {
235
237
  }
236
238
  },
237
239
  subscribe(filter) {
238
- return createSubscription(deps.bus, filter);
240
+ return createSubscription(deps.bus, filter, assistantSnapshots);
239
241
  },
240
242
  };
241
243
  }
@@ -1,8 +1,3 @@
1
- // input: Waitpoint records
2
- // output: buildSignalNotice / buildExpiryNotice / describeWaitFor
3
- // pos: Wake-notice text for waitpoints. Pure string building — no repo, no delivery.
4
- // The notice is read by an agent whose turn ended hours ago, so it must be self-contained:
5
- // it restates the intent captured at creation, and it frames the external payload as data.
6
1
  /** Rendered payload ceiling. The per-signal values are already clipped by the service; this bounds
7
2
  * the *assembled* notice so a large quorum cannot add up to an oversized turn. */
8
3
  const NOTICE_DATA_BUDGET = 8000;
@@ -8,7 +8,7 @@ export declare const DEFAULT_COALESCE_MS = 3000;
8
8
  export declare const MESSAGE_MAX_CHARS = 2000;
9
9
  export declare const DATA_MAX_CHARS = 16000;
10
10
  export interface WaitpointServiceDeps {
11
- repo: Pick<WaitpointRepo, 'get' | 'list' | 'listArmed' | 'insert' | 'update' | 'mutate' | 'remove'>;
11
+ repo: Pick<WaitpointRepo, 'get' | 'list' | 'insert' | 'update' | 'mutate'>;
12
12
  now: () => number;
13
13
  /** Sliding-window cap on wakes per waitpoint per hour. */
14
14
  maxWakesPerHour: () => number;