@orion-agents/orion-code 0.3.2 → 0.3.7

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 (834) hide show
  1. package/CHANGELOG.md +207 -0
  2. package/README.md +102 -18
  3. package/README.zh-CN.md +40 -16
  4. package/dist/commands/context-tool-command-handlers.js +1 -5
  5. package/dist/commands/registry.js +1 -4
  6. package/dist/harness/intent.js +69 -16
  7. package/dist/harness/turn-summary.js +3 -1
  8. package/dist/memory/embeddings.js +2 -3
  9. package/dist/memory/prompts.js +1 -1
  10. package/dist/memory/relevant-finder.js +125 -15
  11. package/dist/memory/vector-store.js +13 -8
  12. package/dist/migration/migrate.js +8 -12
  13. package/dist/runtime/agent-runtime-controller.d.ts +1 -0
  14. package/dist/runtime/agent-runtime-controller.js +92 -41
  15. package/dist/runtime/capability-receipt-journal.js +1 -1
  16. package/dist/runtime/composer/history.js +1 -3
  17. package/dist/runtime/composer/layout.js +7 -4
  18. package/dist/runtime/durable-tool-receipt-reader.js +1 -1
  19. package/dist/runtime/legacy-thread-materializer.d.ts +3 -1
  20. package/dist/runtime/legacy-thread-materializer.js +17 -5
  21. package/dist/runtime/orion-runtime-v1.d.ts +2 -1
  22. package/dist/runtime/orion-runtime-v1.js +18 -16
  23. package/dist/runtime/orion-session-runner.d.ts +2 -0
  24. package/dist/runtime/orion-session-runner.js +12 -4
  25. package/dist/runtime/product-bootstrap.d.ts +18 -0
  26. package/dist/runtime/product-bootstrap.js +402 -335
  27. package/dist/runtime/product-orion-runtime.d.ts +5 -0
  28. package/dist/runtime/product-orion-runtime.js +2 -0
  29. package/dist/runtime/release-receipts.d.ts +7 -3
  30. package/dist/runtime/release-receipts.js +79 -1
  31. package/dist/runtime/rich-text/ansi-parser.js +12 -2
  32. package/dist/runtime/rich-text/layout.js +15 -19
  33. package/dist/runtime/step-snapshot.d.ts +12 -0
  34. package/dist/runtime/step-snapshot.js +14 -1
  35. package/dist/runtime/subagent-thread-runtime.js +1 -1
  36. package/dist/runtime/subagents/budget.js +4 -1
  37. package/dist/runtime/subagents/policy.js +11 -4
  38. package/dist/runtime/subagents/provider-gate.js +6 -4
  39. package/dist/runtime/subagents/research-quality.js +3 -1
  40. package/dist/runtime/subagents/research-renderer.js +9 -2
  41. package/dist/runtime/subagents/result-parser.js +18 -7
  42. package/dist/runtime/thread-event-store.d.ts +14 -3
  43. package/dist/runtime/thread-event-store.js +77 -20
  44. package/dist/runtime/thread-projection.d.ts +36 -0
  45. package/dist/runtime/thread-projection.js +54 -1
  46. package/dist/runtime/thread-runtime.d.ts +2 -2
  47. package/dist/runtime/thread-runtime.js +2 -2
  48. package/dist/runtime/thread-session-index.d.ts +17 -1
  49. package/dist/runtime/thread-session-index.js +89 -6
  50. package/dist/runtime/thread-session-view.d.ts +4 -1
  51. package/dist/runtime/thread-session-view.js +5 -2
  52. package/dist/runtime/thread-ui-adapter.js +10 -3
  53. package/dist/runtime/tool-gateway.js +1 -0
  54. package/dist/runtime/tool-output-presentation.js +7 -7
  55. package/dist/runtime/turn-commit.js +1 -1
  56. package/dist/runtime/turn-controller.js +1 -2
  57. package/dist/runtime/ui-events.d.ts +3 -0
  58. package/dist/runtime/workspace-runtime-kernel.d.ts +67 -0
  59. package/dist/runtime/workspace-runtime-kernel.js +148 -0
  60. package/dist/services/auth/auth.js +1 -4
  61. package/dist/services/auth/aws.js +24 -14
  62. package/dist/services/auto-fix/autoFixRunner.js +1 -1
  63. package/dist/services/auto-fix/index.d.ts +1 -1
  64. package/dist/services/diagnostic-tracking/diagnosticTracking.js +4 -2
  65. package/dist/services/diagnostic-tracking/index.d.ts +1 -1
  66. package/dist/services/effort.js +1 -9
  67. package/dist/services/file-glob.js +3 -4
  68. package/dist/services/global-config.d.ts +2 -0
  69. package/dist/services/global-config.js +7 -1
  70. package/dist/services/mcp/transports.js +4 -4
  71. package/dist/services/model-catalog.js +179 -30
  72. package/dist/services/model-context.js +1 -1
  73. package/dist/services/provider-resilience/coordinator.d.ts +3 -1
  74. package/dist/services/provider-resilience/coordinator.js +23 -1
  75. package/dist/services/provider-resilience/request-gate.js +7 -2
  76. package/dist/services/provider-resilience/stream-recovery.js +1 -3
  77. package/dist/services/redaction.js +19 -2
  78. package/dist/services/session-storage.d.ts +28 -3
  79. package/dist/services/session-storage.js +70 -6
  80. package/dist/services/settings-coordinator.d.ts +3 -1
  81. package/dist/services/settings-coordinator.js +40 -8
  82. package/dist/services/settings-document-repository.d.ts +8 -1
  83. package/dist/services/settings-document-repository.js +22 -1
  84. package/dist/services/smart-routing.js +19 -11
  85. package/dist/services/verification-profile.js +17 -22
  86. package/dist/services/web-search-provider.js +21 -9
  87. package/dist/services/workspace-diff.js +10 -4
  88. package/dist/skills/builtin/code-review/SKILL.md +1 -1
  89. package/dist/skills/builtin/security-check/SKILL.md +1 -1
  90. package/dist/skills/builtin/test-gen/SKILL.md +1 -1
  91. package/dist/terminal-ui/editor.js +6 -2
  92. package/dist/terminal-ui/output-queue.js +9 -3
  93. package/dist/tools/lsp.js +12 -6
  94. package/dist/tui-core/frame.js +9 -7
  95. package/dist/tui-ui/transcript-cache.js +6 -6
  96. package/dist/tui-ui/transcript-inspector-layout.js +13 -6
  97. package/dist/tui-ui/transcript-inspector-surface.js +4 -1
  98. package/dist/tui-ui/transcript-inspector.js +3 -8
  99. package/dist/ui/box.js +14 -7
  100. package/dist/ui/markdown.js +4 -2
  101. package/dist/ui/shared/input-frame.js +12 -8
  102. package/dist/ui/stream-markdown.js +1 -1
  103. package/dist/ui/tool-preview.js +11 -3
  104. package/dist/ui/user-input.js +16 -10
  105. package/dist/web/event-hub.d.ts +2 -0
  106. package/dist/web/event-hub.js +43 -6
  107. package/dist/web/file-read-service.d.ts +2 -0
  108. package/dist/web/file-read-service.js +39 -12
  109. package/dist/web/git-read-model-service.js +7 -0
  110. package/dist/web/protocol.d.ts +53 -3
  111. package/dist/web/protocol.js +39 -2
  112. package/dist/web/review-service.d.ts +1 -0
  113. package/dist/web/review-service.js +1 -0
  114. package/dist/web/server.js +99 -6
  115. package/dist/web/session-runtime-registry.d.ts +138 -0
  116. package/dist/web/session-runtime-registry.js +471 -0
  117. package/dist/web/terminal-manager.js +23 -4
  118. package/dist/web/terminal-server.js +35 -6
  119. package/dist/web/workbench-controller.d.ts +82 -3
  120. package/dist/web/workbench-controller.js +771 -138
  121. package/dist/web/workspace-mutation-arbiter.d.ts +54 -0
  122. package/dist/web/workspace-mutation-arbiter.js +267 -0
  123. package/dist/web-client/assets/{DiffViewer-eaQNsnCh.js → DiffViewer-DqbZ02RN.js} +1 -1
  124. package/dist/web-client/assets/FilesPanel-Bu1Ab2kJ.js +2 -0
  125. package/dist/web-client/assets/{GitPanel-CnU4XVr7.js → GitPanel-BixIWb4k.js} +1 -1
  126. package/dist/web-client/assets/ReviewPanel-DsqJpku_.js +1 -0
  127. package/dist/web-client/assets/{TerminalPanel-Q5mSSsoK.js → TerminalPanel-DdjQP2mp.js} +14 -14
  128. package/dist/web-client/assets/index-30GT9Vnx.js +17 -0
  129. package/dist/web-client/assets/index-DQfpqPTD.css +1 -0
  130. package/dist/web-client/index.html +4 -4
  131. package/docs/architecture/v0.3.3-web-api.yaml +3205 -0
  132. package/docs/architecture/v0.3.4-stabilization-contract.md +32 -0
  133. package/docs/migration/v0.3.2-to-v0.3.3.md +62 -0
  134. package/docs/migration/v0.3.3-to-v0.3.4.md +36 -0
  135. package/docs/plan/v0.3.3-plan.md +1113 -0
  136. package/docs/plan/v0.3.4-stabilization-plan.md +89 -0
  137. package/docs/test/v0.3.3-web-workbench-e2e-plan.md +79 -0
  138. package/docs/test/v0.3.4-stabilization-e2e-plan.md +54 -0
  139. package/npm-shrinkwrap.json +379 -143
  140. package/package.json +12 -1
  141. package/dist/cli.d.ts.map +0 -1
  142. package/dist/cli.js.map +0 -1
  143. package/dist/commands/context-commands.d.ts.map +0 -1
  144. package/dist/commands/context-commands.js.map +0 -1
  145. package/dist/commands/context-tool-command-handlers.d.ts.map +0 -1
  146. package/dist/commands/context-tool-command-handlers.js.map +0 -1
  147. package/dist/commands/core-command-handlers.d.ts.map +0 -1
  148. package/dist/commands/core-command-handlers.js.map +0 -1
  149. package/dist/commands/diagnostic-command-handlers.d.ts.map +0 -1
  150. package/dist/commands/diagnostic-command-handlers.js.map +0 -1
  151. package/dist/commands/diagnostic-commands.d.ts.map +0 -1
  152. package/dist/commands/diagnostic-commands.js.map +0 -1
  153. package/dist/commands/index.d.ts.map +0 -1
  154. package/dist/commands/index.js.map +0 -1
  155. package/dist/commands/model-command-handlers.d.ts.map +0 -1
  156. package/dist/commands/model-command-handlers.js.map +0 -1
  157. package/dist/commands/model-commands.d.ts.map +0 -1
  158. package/dist/commands/model-commands.js.map +0 -1
  159. package/dist/commands/parser.d.ts.map +0 -1
  160. package/dist/commands/parser.js.map +0 -1
  161. package/dist/commands/registry.d.ts.map +0 -1
  162. package/dist/commands/registry.js.map +0 -1
  163. package/dist/commands/session-command-handlers.d.ts.map +0 -1
  164. package/dist/commands/session-command-handlers.js.map +0 -1
  165. package/dist/commands/session-commands.d.ts.map +0 -1
  166. package/dist/commands/session-commands.js.map +0 -1
  167. package/dist/commands/system-commands.d.ts.map +0 -1
  168. package/dist/commands/system-commands.js.map +0 -1
  169. package/dist/commands/target-command.d.ts.map +0 -1
  170. package/dist/commands/target-command.js.map +0 -1
  171. package/dist/commands/tool-commands.d.ts.map +0 -1
  172. package/dist/commands/tool-commands.js.map +0 -1
  173. package/dist/commands/types.d.ts.map +0 -1
  174. package/dist/commands/types.js.map +0 -1
  175. package/dist/commands/workflow-command-handlers.d.ts.map +0 -1
  176. package/dist/commands/workflow-command-handlers.js.map +0 -1
  177. package/dist/commands/workflow-commands.d.ts.map +0 -1
  178. package/dist/commands/workflow-commands.js.map +0 -1
  179. package/dist/core/checkpoint.d.ts.map +0 -1
  180. package/dist/core/checkpoint.js.map +0 -1
  181. package/dist/core/cost-tracker.d.ts.map +0 -1
  182. package/dist/core/cost-tracker.js.map +0 -1
  183. package/dist/core/security-warning.d.ts.map +0 -1
  184. package/dist/core/security-warning.js.map +0 -1
  185. package/dist/core/strategy-tracker.d.ts.map +0 -1
  186. package/dist/core/strategy-tracker.js.map +0 -1
  187. package/dist/core/tool-artifacts.d.ts.map +0 -1
  188. package/dist/core/tool-artifacts.js.map +0 -1
  189. package/dist/core/warn-dedup.d.ts.map +0 -1
  190. package/dist/core/warn-dedup.js.map +0 -1
  191. package/dist/framework/agent-mode.d.ts.map +0 -1
  192. package/dist/framework/agent-mode.js.map +0 -1
  193. package/dist/framework/external-assertion.d.ts.map +0 -1
  194. package/dist/framework/external-assertion.js.map +0 -1
  195. package/dist/framework/index.d.ts.map +0 -1
  196. package/dist/framework/index.js.map +0 -1
  197. package/dist/framework/loop-budget-contract.d.ts.map +0 -1
  198. package/dist/framework/loop-budget-contract.js.map +0 -1
  199. package/dist/framework/prompt.d.ts.map +0 -1
  200. package/dist/framework/prompt.js.map +0 -1
  201. package/dist/framework/query.d.ts.map +0 -1
  202. package/dist/framework/query.js.map +0 -1
  203. package/dist/framework/stop-decision.d.ts.map +0 -1
  204. package/dist/framework/stop-decision.js.map +0 -1
  205. package/dist/framework/store.d.ts.map +0 -1
  206. package/dist/framework/store.js.map +0 -1
  207. package/dist/framework/tool-call-orchestrator.d.ts.map +0 -1
  208. package/dist/framework/tool-call-orchestrator.js.map +0 -1
  209. package/dist/framework/tool-serializer.d.ts.map +0 -1
  210. package/dist/framework/tool-serializer.js.map +0 -1
  211. package/dist/framework/tool-state.d.ts.map +0 -1
  212. package/dist/framework/tool-state.js.map +0 -1
  213. package/dist/framework/tool.d.ts.map +0 -1
  214. package/dist/framework/tool.js.map +0 -1
  215. package/dist/harness/assembler.d.ts.map +0 -1
  216. package/dist/harness/assembler.js.map +0 -1
  217. package/dist/harness/capability-profile.d.ts.map +0 -1
  218. package/dist/harness/capability-profile.js.map +0 -1
  219. package/dist/harness/capsule.d.ts.map +0 -1
  220. package/dist/harness/capsule.js.map +0 -1
  221. package/dist/harness/compact-benchmark-corpus.d.ts.map +0 -1
  222. package/dist/harness/compact-benchmark-corpus.js.map +0 -1
  223. package/dist/harness/context-harness.d.ts.map +0 -1
  224. package/dist/harness/context-harness.js.map +0 -1
  225. package/dist/harness/contract.d.ts.map +0 -1
  226. package/dist/harness/contract.js.map +0 -1
  227. package/dist/harness/drift-guard.d.ts.map +0 -1
  228. package/dist/harness/drift-guard.js.map +0 -1
  229. package/dist/harness/evidence.d.ts.map +0 -1
  230. package/dist/harness/evidence.js.map +0 -1
  231. package/dist/harness/index.d.ts.map +0 -1
  232. package/dist/harness/index.js.map +0 -1
  233. package/dist/harness/intent.d.ts.map +0 -1
  234. package/dist/harness/intent.js.map +0 -1
  235. package/dist/harness/ledger.d.ts.map +0 -1
  236. package/dist/harness/ledger.js.map +0 -1
  237. package/dist/harness/progress-controller.d.ts.map +0 -1
  238. package/dist/harness/progress-controller.js.map +0 -1
  239. package/dist/harness/state.d.ts.map +0 -1
  240. package/dist/harness/state.js.map +0 -1
  241. package/dist/harness/stop-controller.d.ts.map +0 -1
  242. package/dist/harness/stop-controller.js.map +0 -1
  243. package/dist/harness/turn-summary.d.ts.map +0 -1
  244. package/dist/harness/turn-summary.js.map +0 -1
  245. package/dist/harness/types.d.ts.map +0 -1
  246. package/dist/harness/types.js.map +0 -1
  247. package/dist/harness/verification.d.ts.map +0 -1
  248. package/dist/harness/verification.js.map +0 -1
  249. package/dist/index.d.ts.map +0 -1
  250. package/dist/index.js.map +0 -1
  251. package/dist/memory/embeddings.d.ts.map +0 -1
  252. package/dist/memory/embeddings.js.map +0 -1
  253. package/dist/memory/entrypoint.d.ts.map +0 -1
  254. package/dist/memory/entrypoint.js.map +0 -1
  255. package/dist/memory/index.d.ts.map +0 -1
  256. package/dist/memory/index.js.map +0 -1
  257. package/dist/memory/prompt-context.d.ts.map +0 -1
  258. package/dist/memory/prompt-context.js.map +0 -1
  259. package/dist/memory/prompts.d.ts.map +0 -1
  260. package/dist/memory/prompts.js.map +0 -1
  261. package/dist/memory/relevant-finder.d.ts.map +0 -1
  262. package/dist/memory/relevant-finder.js.map +0 -1
  263. package/dist/memory/semantic-config.d.ts.map +0 -1
  264. package/dist/memory/semantic-config.js.map +0 -1
  265. package/dist/memory/semantic-search.d.ts.map +0 -1
  266. package/dist/memory/semantic-search.js.map +0 -1
  267. package/dist/memory/storage.d.ts.map +0 -1
  268. package/dist/memory/storage.js.map +0 -1
  269. package/dist/memory/store.d.ts.map +0 -1
  270. package/dist/memory/store.js.map +0 -1
  271. package/dist/memory/team-paths.d.ts.map +0 -1
  272. package/dist/memory/team-paths.js.map +0 -1
  273. package/dist/memory/types.d.ts.map +0 -1
  274. package/dist/memory/types.js.map +0 -1
  275. package/dist/memory/validation.d.ts.map +0 -1
  276. package/dist/memory/validation.js.map +0 -1
  277. package/dist/memory/vector-store.d.ts.map +0 -1
  278. package/dist/memory/vector-store.js.map +0 -1
  279. package/dist/migration/command.d.ts.map +0 -1
  280. package/dist/migration/command.js.map +0 -1
  281. package/dist/migration/index.d.ts.map +0 -1
  282. package/dist/migration/index.js.map +0 -1
  283. package/dist/migration/migrate.d.ts.map +0 -1
  284. package/dist/migration/migrate.js.map +0 -1
  285. package/dist/migration/types.d.ts.map +0 -1
  286. package/dist/migration/types.js.map +0 -1
  287. package/dist/print-ui/launch.d.ts.map +0 -1
  288. package/dist/print-ui/launch.js.map +0 -1
  289. package/dist/product/environment.d.ts.map +0 -1
  290. package/dist/product/environment.js.map +0 -1
  291. package/dist/product/identity.d.ts.map +0 -1
  292. package/dist/product/identity.js.map +0 -1
  293. package/dist/product/index.d.ts.map +0 -1
  294. package/dist/product/index.js.map +0 -1
  295. package/dist/product/paths.d.ts.map +0 -1
  296. package/dist/product/paths.js.map +0 -1
  297. package/dist/product/version.d.ts.map +0 -1
  298. package/dist/product/version.js.map +0 -1
  299. package/dist/runtime/agent-loop.d.ts.map +0 -1
  300. package/dist/runtime/agent-loop.js.map +0 -1
  301. package/dist/runtime/agent-runtime-controller.d.ts.map +0 -1
  302. package/dist/runtime/agent-runtime-controller.js.map +0 -1
  303. package/dist/runtime/agent-runtime-protocol.d.ts.map +0 -1
  304. package/dist/runtime/agent-runtime-protocol.js.map +0 -1
  305. package/dist/runtime/agent-runtime-runner.d.ts.map +0 -1
  306. package/dist/runtime/agent-runtime-runner.js.map +0 -1
  307. package/dist/runtime/agent-status.d.ts.map +0 -1
  308. package/dist/runtime/agent-status.js.map +0 -1
  309. package/dist/runtime/aggregate-tool-presenter.d.ts.map +0 -1
  310. package/dist/runtime/aggregate-tool-presenter.js.map +0 -1
  311. package/dist/runtime/batch-read-service.d.ts.map +0 -1
  312. package/dist/runtime/batch-read-service.js.map +0 -1
  313. package/dist/runtime/builtin-tool-provider.d.ts.map +0 -1
  314. package/dist/runtime/builtin-tool-provider.js.map +0 -1
  315. package/dist/runtime/capabilities/compiler.d.ts.map +0 -1
  316. package/dist/runtime/capabilities/compiler.js.map +0 -1
  317. package/dist/runtime/capabilities/index.d.ts.map +0 -1
  318. package/dist/runtime/capabilities/index.js.map +0 -1
  319. package/dist/runtime/capabilities/types.d.ts.map +0 -1
  320. package/dist/runtime/capabilities/types.js.map +0 -1
  321. package/dist/runtime/capability-receipt-journal.d.ts.map +0 -1
  322. package/dist/runtime/capability-receipt-journal.js.map +0 -1
  323. package/dist/runtime/capability-step-factory.d.ts.map +0 -1
  324. package/dist/runtime/capability-step-factory.js.map +0 -1
  325. package/dist/runtime/compact-transaction.d.ts.map +0 -1
  326. package/dist/runtime/compact-transaction.js.map +0 -1
  327. package/dist/runtime/composer/buffer.d.ts.map +0 -1
  328. package/dist/runtime/composer/buffer.js.map +0 -1
  329. package/dist/runtime/composer/grapheme.d.ts.map +0 -1
  330. package/dist/runtime/composer/grapheme.js.map +0 -1
  331. package/dist/runtime/composer/history.d.ts.map +0 -1
  332. package/dist/runtime/composer/history.js.map +0 -1
  333. package/dist/runtime/composer/layout.d.ts.map +0 -1
  334. package/dist/runtime/composer/layout.js.map +0 -1
  335. package/dist/runtime/core-tools/descriptors.d.ts.map +0 -1
  336. package/dist/runtime/core-tools/descriptors.js.map +0 -1
  337. package/dist/runtime/durable-tool-receipt-reader.d.ts.map +0 -1
  338. package/dist/runtime/durable-tool-receipt-reader.js.map +0 -1
  339. package/dist/runtime/first-party-core-provider.d.ts.map +0 -1
  340. package/dist/runtime/first-party-core-provider.js.map +0 -1
  341. package/dist/runtime/first-party-long-tail-provider.d.ts.map +0 -1
  342. package/dist/runtime/first-party-long-tail-provider.js.map +0 -1
  343. package/dist/runtime/first-party-tool-services.d.ts.map +0 -1
  344. package/dist/runtime/first-party-tool-services.js.map +0 -1
  345. package/dist/runtime/first-party-tool-universe.d.ts.map +0 -1
  346. package/dist/runtime/first-party-tool-universe.js.map +0 -1
  347. package/dist/runtime/goal-lifecycle-v2.d.ts.map +0 -1
  348. package/dist/runtime/goal-lifecycle-v2.js.map +0 -1
  349. package/dist/runtime/goal-runtime-coordinator.d.ts.map +0 -1
  350. package/dist/runtime/goal-runtime-coordinator.js.map +0 -1
  351. package/dist/runtime/goals/completion-audit.d.ts.map +0 -1
  352. package/dist/runtime/goals/completion-audit.js.map +0 -1
  353. package/dist/runtime/goals/evidence.d.ts.map +0 -1
  354. package/dist/runtime/goals/evidence.js.map +0 -1
  355. package/dist/runtime/goals/objective.d.ts.map +0 -1
  356. package/dist/runtime/goals/objective.js.map +0 -1
  357. package/dist/runtime/goals/presentation.d.ts.map +0 -1
  358. package/dist/runtime/goals/presentation.js.map +0 -1
  359. package/dist/runtime/goals/types.d.ts.map +0 -1
  360. package/dist/runtime/goals/types.js.map +0 -1
  361. package/dist/runtime/harness-confluence.d.ts.map +0 -1
  362. package/dist/runtime/harness-confluence.js.map +0 -1
  363. package/dist/runtime/harness-eval.d.ts.map +0 -1
  364. package/dist/runtime/harness-eval.js.map +0 -1
  365. package/dist/runtime/harness-metrics.d.ts.map +0 -1
  366. package/dist/runtime/harness-metrics.js.map +0 -1
  367. package/dist/runtime/legacy-session-importer.d.ts.map +0 -1
  368. package/dist/runtime/legacy-session-importer.js.map +0 -1
  369. package/dist/runtime/legacy-thread-materializer.d.ts.map +0 -1
  370. package/dist/runtime/legacy-thread-materializer.js.map +0 -1
  371. package/dist/runtime/long-tail-tools/descriptors.d.ts.map +0 -1
  372. package/dist/runtime/long-tail-tools/descriptors.js.map +0 -1
  373. package/dist/runtime/loop-budget.d.ts.map +0 -1
  374. package/dist/runtime/loop-budget.js.map +0 -1
  375. package/dist/runtime/mcp/first-party-mcp-adapter.d.ts.map +0 -1
  376. package/dist/runtime/mcp/first-party-mcp-adapter.js.map +0 -1
  377. package/dist/runtime/mcp/first-party-mcp-config.d.ts.map +0 -1
  378. package/dist/runtime/mcp/first-party-mcp-config.js.map +0 -1
  379. package/dist/runtime/mcp/index.d.ts.map +0 -1
  380. package/dist/runtime/mcp/index.js.map +0 -1
  381. package/dist/runtime/mcp/lazy-mcp-runtime.d.ts.map +0 -1
  382. package/dist/runtime/mcp/lazy-mcp-runtime.js.map +0 -1
  383. package/dist/runtime/mcp/types.d.ts.map +0 -1
  384. package/dist/runtime/mcp/types.js.map +0 -1
  385. package/dist/runtime/model-coordinator.d.ts.map +0 -1
  386. package/dist/runtime/model-coordinator.js.map +0 -1
  387. package/dist/runtime/orion-runtime-v1.d.ts.map +0 -1
  388. package/dist/runtime/orion-runtime-v1.js.map +0 -1
  389. package/dist/runtime/orion-session-runner.d.ts.map +0 -1
  390. package/dist/runtime/orion-session-runner.js.map +0 -1
  391. package/dist/runtime/plan-review.d.ts.map +0 -1
  392. package/dist/runtime/plan-review.js.map +0 -1
  393. package/dist/runtime/product-bootstrap.d.ts.map +0 -1
  394. package/dist/runtime/product-bootstrap.js.map +0 -1
  395. package/dist/runtime/product-orion-runtime.d.ts.map +0 -1
  396. package/dist/runtime/product-orion-runtime.js.map +0 -1
  397. package/dist/runtime/prompts/index.d.ts.map +0 -1
  398. package/dist/runtime/prompts/index.js.map +0 -1
  399. package/dist/runtime/prompts/prompt-registry.d.ts.map +0 -1
  400. package/dist/runtime/prompts/prompt-registry.js.map +0 -1
  401. package/dist/runtime/prompts/types.d.ts.map +0 -1
  402. package/dist/runtime/prompts/types.js.map +0 -1
  403. package/dist/runtime/protocol/canonical.d.ts.map +0 -1
  404. package/dist/runtime/protocol/canonical.js.map +0 -1
  405. package/dist/runtime/protocol/index.d.ts.map +0 -1
  406. package/dist/runtime/protocol/index.js.map +0 -1
  407. package/dist/runtime/protocol/runtime-protocol-v1.d.ts.map +0 -1
  408. package/dist/runtime/protocol/runtime-protocol-v1.js.map +0 -1
  409. package/dist/runtime/release-receipts.d.ts.map +0 -1
  410. package/dist/runtime/release-receipts.js.map +0 -1
  411. package/dist/runtime/resource-scope.d.ts.map +0 -1
  412. package/dist/runtime/resource-scope.js.map +0 -1
  413. package/dist/runtime/rich-text/ansi-parser.d.ts.map +0 -1
  414. package/dist/runtime/rich-text/ansi-parser.js.map +0 -1
  415. package/dist/runtime/rich-text/layout.d.ts.map +0 -1
  416. package/dist/runtime/rich-text/layout.js.map +0 -1
  417. package/dist/runtime/rich-text/markdown-parser.d.ts.map +0 -1
  418. package/dist/runtime/rich-text/markdown-parser.js.map +0 -1
  419. package/dist/runtime/rich-text/sanitizer.d.ts.map +0 -1
  420. package/dist/runtime/rich-text/sanitizer.js.map +0 -1
  421. package/dist/runtime/rich-text/types.d.ts.map +0 -1
  422. package/dist/runtime/rich-text/types.js.map +0 -1
  423. package/dist/runtime/runtime-event-buffer.d.ts.map +0 -1
  424. package/dist/runtime/runtime-event-buffer.js.map +0 -1
  425. package/dist/runtime/runtime-services.d.ts.map +0 -1
  426. package/dist/runtime/runtime-services.js.map +0 -1
  427. package/dist/runtime/session-composer-control.d.ts.map +0 -1
  428. package/dist/runtime/session-composer-control.js.map +0 -1
  429. package/dist/runtime/session-history-recovery.d.ts.map +0 -1
  430. package/dist/runtime/session-history-recovery.js.map +0 -1
  431. package/dist/runtime/skills/bounded-lru-cache.d.ts.map +0 -1
  432. package/dist/runtime/skills/bounded-lru-cache.js.map +0 -1
  433. package/dist/runtime/skills/filesystem-skill-provider.d.ts.map +0 -1
  434. package/dist/runtime/skills/filesystem-skill-provider.js.map +0 -1
  435. package/dist/runtime/skills/index.d.ts.map +0 -1
  436. package/dist/runtime/skills/index.js.map +0 -1
  437. package/dist/runtime/skills/lazy-skill-runtime.d.ts.map +0 -1
  438. package/dist/runtime/skills/lazy-skill-runtime.js.map +0 -1
  439. package/dist/runtime/skills/types.d.ts.map +0 -1
  440. package/dist/runtime/skills/types.js.map +0 -1
  441. package/dist/runtime/step-snapshot.d.ts.map +0 -1
  442. package/dist/runtime/step-snapshot.js.map +0 -1
  443. package/dist/runtime/subagent-thread-runtime.d.ts.map +0 -1
  444. package/dist/runtime/subagent-thread-runtime.js.map +0 -1
  445. package/dist/runtime/subagents/budget.d.ts.map +0 -1
  446. package/dist/runtime/subagents/budget.js.map +0 -1
  447. package/dist/runtime/subagents/child-executor-guard.d.ts.map +0 -1
  448. package/dist/runtime/subagents/child-executor-guard.js.map +0 -1
  449. package/dist/runtime/subagents/context-builder.d.ts.map +0 -1
  450. package/dist/runtime/subagents/context-builder.js.map +0 -1
  451. package/dist/runtime/subagents/index.d.ts.map +0 -1
  452. package/dist/runtime/subagents/index.js.map +0 -1
  453. package/dist/runtime/subagents/parent-step-fork.d.ts.map +0 -1
  454. package/dist/runtime/subagents/parent-step-fork.js.map +0 -1
  455. package/dist/runtime/subagents/policy.d.ts.map +0 -1
  456. package/dist/runtime/subagents/policy.js.map +0 -1
  457. package/dist/runtime/subagents/presets.d.ts.map +0 -1
  458. package/dist/runtime/subagents/presets.js.map +0 -1
  459. package/dist/runtime/subagents/production.d.ts.map +0 -1
  460. package/dist/runtime/subagents/production.js.map +0 -1
  461. package/dist/runtime/subagents/provider-gate.d.ts.map +0 -1
  462. package/dist/runtime/subagents/provider-gate.js.map +0 -1
  463. package/dist/runtime/subagents/receipt-journal.d.ts.map +0 -1
  464. package/dist/runtime/subagents/receipt-journal.js.map +0 -1
  465. package/dist/runtime/subagents/research-artifact.d.ts.map +0 -1
  466. package/dist/runtime/subagents/research-artifact.js.map +0 -1
  467. package/dist/runtime/subagents/research-citation.d.ts.map +0 -1
  468. package/dist/runtime/subagents/research-citation.js.map +0 -1
  469. package/dist/runtime/subagents/research-contract.d.ts.map +0 -1
  470. package/dist/runtime/subagents/research-contract.js.map +0 -1
  471. package/dist/runtime/subagents/research-quality.d.ts.map +0 -1
  472. package/dist/runtime/subagents/research-quality.js.map +0 -1
  473. package/dist/runtime/subagents/research-renderer.d.ts.map +0 -1
  474. package/dist/runtime/subagents/research-renderer.js.map +0 -1
  475. package/dist/runtime/subagents/research-types.d.ts.map +0 -1
  476. package/dist/runtime/subagents/research-types.js.map +0 -1
  477. package/dist/runtime/subagents/result-parser.d.ts.map +0 -1
  478. package/dist/runtime/subagents/result-parser.js.map +0 -1
  479. package/dist/runtime/subagents/runner.d.ts.map +0 -1
  480. package/dist/runtime/subagents/runner.js.map +0 -1
  481. package/dist/runtime/subagents/runtime-contract.d.ts.map +0 -1
  482. package/dist/runtime/subagents/runtime-contract.js.map +0 -1
  483. package/dist/runtime/subagents/runtime-integration.d.ts.map +0 -1
  484. package/dist/runtime/subagents/runtime-integration.js.map +0 -1
  485. package/dist/runtime/subagents/supervisor.d.ts.map +0 -1
  486. package/dist/runtime/subagents/supervisor.js.map +0 -1
  487. package/dist/runtime/subagents/tool.d.ts.map +0 -1
  488. package/dist/runtime/subagents/tool.js.map +0 -1
  489. package/dist/runtime/subagents/types.d.ts.map +0 -1
  490. package/dist/runtime/subagents/types.js.map +0 -1
  491. package/dist/runtime/subagents/web-research-adapter.d.ts.map +0 -1
  492. package/dist/runtime/subagents/web-research-adapter.js.map +0 -1
  493. package/dist/runtime/task-context-service.d.ts.map +0 -1
  494. package/dist/runtime/task-context-service.js.map +0 -1
  495. package/dist/runtime/thread-admission.d.ts.map +0 -1
  496. package/dist/runtime/thread-admission.js.map +0 -1
  497. package/dist/runtime/thread-compact-persistence.d.ts.map +0 -1
  498. package/dist/runtime/thread-compact-persistence.js.map +0 -1
  499. package/dist/runtime/thread-event-store.d.ts.map +0 -1
  500. package/dist/runtime/thread-event-store.js.map +0 -1
  501. package/dist/runtime/thread-projection.d.ts.map +0 -1
  502. package/dist/runtime/thread-projection.js.map +0 -1
  503. package/dist/runtime/thread-runtime.d.ts.map +0 -1
  504. package/dist/runtime/thread-runtime.js.map +0 -1
  505. package/dist/runtime/thread-session-index.d.ts.map +0 -1
  506. package/dist/runtime/thread-session-index.js.map +0 -1
  507. package/dist/runtime/thread-session-view.d.ts.map +0 -1
  508. package/dist/runtime/thread-session-view.js.map +0 -1
  509. package/dist/runtime/thread-tool-journal.d.ts.map +0 -1
  510. package/dist/runtime/thread-tool-journal.js.map +0 -1
  511. package/dist/runtime/thread-ui-adapter.d.ts.map +0 -1
  512. package/dist/runtime/thread-ui-adapter.js.map +0 -1
  513. package/dist/runtime/tool-detail-repository.d.ts.map +0 -1
  514. package/dist/runtime/tool-detail-repository.js.map +0 -1
  515. package/dist/runtime/tool-gateway.d.ts.map +0 -1
  516. package/dist/runtime/tool-gateway.js.map +0 -1
  517. package/dist/runtime/tool-output-presentation.d.ts.map +0 -1
  518. package/dist/runtime/tool-output-presentation.js.map +0 -1
  519. package/dist/runtime/tool-receipt-validator.d.ts.map +0 -1
  520. package/dist/runtime/tool-receipt-validator.js.map +0 -1
  521. package/dist/runtime/turn-commit.d.ts.map +0 -1
  522. package/dist/runtime/turn-commit.js.map +0 -1
  523. package/dist/runtime/turn-controller.d.ts.map +0 -1
  524. package/dist/runtime/turn-controller.js.map +0 -1
  525. package/dist/runtime/ui-events.d.ts.map +0 -1
  526. package/dist/runtime/ui-events.js.map +0 -1
  527. package/dist/runtime/ui-view-model.d.ts.map +0 -1
  528. package/dist/runtime/ui-view-model.js.map +0 -1
  529. package/dist/services/atomic-write.d.ts.map +0 -1
  530. package/dist/services/atomic-write.js.map +0 -1
  531. package/dist/services/auth/auth.d.ts.map +0 -1
  532. package/dist/services/auth/auth.js.map +0 -1
  533. package/dist/services/auth/aws.d.ts.map +0 -1
  534. package/dist/services/auth/aws.js.map +0 -1
  535. package/dist/services/auth/index.d.ts.map +0 -1
  536. package/dist/services/auth/index.js.map +0 -1
  537. package/dist/services/auto-fix/autoFixConfig.d.ts.map +0 -1
  538. package/dist/services/auto-fix/autoFixConfig.js.map +0 -1
  539. package/dist/services/auto-fix/autoFixHook.d.ts.map +0 -1
  540. package/dist/services/auto-fix/autoFixHook.js.map +0 -1
  541. package/dist/services/auto-fix/autoFixRunner.d.ts.map +0 -1
  542. package/dist/services/auto-fix/autoFixRunner.js.map +0 -1
  543. package/dist/services/auto-fix/index.d.ts.map +0 -1
  544. package/dist/services/auto-fix/index.js.map +0 -1
  545. package/dist/services/bounded-response.d.ts.map +0 -1
  546. package/dist/services/bounded-response.js.map +0 -1
  547. package/dist/services/commit-plan.d.ts.map +0 -1
  548. package/dist/services/commit-plan.js.map +0 -1
  549. package/dist/services/compact/auto-compact.d.ts.map +0 -1
  550. package/dist/services/compact/auto-compact.js.map +0 -1
  551. package/dist/services/compact/compact.d.ts.map +0 -1
  552. package/dist/services/compact/compact.js.map +0 -1
  553. package/dist/services/compact/coordinator.d.ts.map +0 -1
  554. package/dist/services/compact/coordinator.js.map +0 -1
  555. package/dist/services/compact/fingerprint.d.ts.map +0 -1
  556. package/dist/services/compact/fingerprint.js.map +0 -1
  557. package/dist/services/compact/index.d.ts.map +0 -1
  558. package/dist/services/compact/index.js.map +0 -1
  559. package/dist/services/compact/planner.d.ts.map +0 -1
  560. package/dist/services/compact/planner.js.map +0 -1
  561. package/dist/services/compact/semantic-summary.d.ts.map +0 -1
  562. package/dist/services/compact/semantic-summary.js.map +0 -1
  563. package/dist/services/compact/summary-generator.d.ts.map +0 -1
  564. package/dist/services/compact/summary-generator.js.map +0 -1
  565. package/dist/services/compact/tool-call-groups.d.ts.map +0 -1
  566. package/dist/services/compact/tool-call-groups.js.map +0 -1
  567. package/dist/services/concurrent-sessions.d.ts.map +0 -1
  568. package/dist/services/concurrent-sessions.js.map +0 -1
  569. package/dist/services/config-dir.d.ts.map +0 -1
  570. package/dist/services/config-dir.js.map +0 -1
  571. package/dist/services/config.d.ts.map +0 -1
  572. package/dist/services/config.js.map +0 -1
  573. package/dist/services/diagnostic-tracking/diagnosticTracking.d.ts.map +0 -1
  574. package/dist/services/diagnostic-tracking/diagnosticTracking.js.map +0 -1
  575. package/dist/services/diagnostic-tracking/formatter.d.ts.map +0 -1
  576. package/dist/services/diagnostic-tracking/formatter.js.map +0 -1
  577. package/dist/services/diagnostic-tracking/index.d.ts.map +0 -1
  578. package/dist/services/diagnostic-tracking/index.js.map +0 -1
  579. package/dist/services/diagnostic-tracking/types.d.ts.map +0 -1
  580. package/dist/services/diagnostic-tracking/types.js.map +0 -1
  581. package/dist/services/doctor.d.ts.map +0 -1
  582. package/dist/services/doctor.js.map +0 -1
  583. package/dist/services/effort.d.ts.map +0 -1
  584. package/dist/services/effort.js.map +0 -1
  585. package/dist/services/file-context.d.ts.map +0 -1
  586. package/dist/services/file-context.js.map +0 -1
  587. package/dist/services/file-glob.d.ts.map +0 -1
  588. package/dist/services/file-glob.js.map +0 -1
  589. package/dist/services/file-lock.d.ts.map +0 -1
  590. package/dist/services/file-lock.js.map +0 -1
  591. package/dist/services/format.d.ts.map +0 -1
  592. package/dist/services/format.js.map +0 -1
  593. package/dist/services/global-config.d.ts.map +0 -1
  594. package/dist/services/global-config.js.map +0 -1
  595. package/dist/services/goal-storage.d.ts.map +0 -1
  596. package/dist/services/goal-storage.js.map +0 -1
  597. package/dist/services/llm.d.ts.map +0 -1
  598. package/dist/services/llm.js.map +0 -1
  599. package/dist/services/mcp/index.d.ts.map +0 -1
  600. package/dist/services/mcp/index.js.map +0 -1
  601. package/dist/services/mcp/transports.d.ts.map +0 -1
  602. package/dist/services/mcp/transports.js.map +0 -1
  603. package/dist/services/memory.d.ts.map +0 -1
  604. package/dist/services/memory.js.map +0 -1
  605. package/dist/services/model-catalog.d.ts.map +0 -1
  606. package/dist/services/model-catalog.js.map +0 -1
  607. package/dist/services/model-client-pool.d.ts.map +0 -1
  608. package/dist/services/model-client-pool.js.map +0 -1
  609. package/dist/services/model-context.d.ts.map +0 -1
  610. package/dist/services/model-context.js.map +0 -1
  611. package/dist/services/model-registry.d.ts.map +0 -1
  612. package/dist/services/model-registry.js.map +0 -1
  613. package/dist/services/project-instructions.d.ts.map +0 -1
  614. package/dist/services/project-instructions.js.map +0 -1
  615. package/dist/services/prompt-context.d.ts.map +0 -1
  616. package/dist/services/prompt-context.js.map +0 -1
  617. package/dist/services/provider-diagnostics.d.ts.map +0 -1
  618. package/dist/services/provider-diagnostics.js.map +0 -1
  619. package/dist/services/provider-resilience/circuit-breaker.d.ts.map +0 -1
  620. package/dist/services/provider-resilience/circuit-breaker.js.map +0 -1
  621. package/dist/services/provider-resilience/coordinator.d.ts.map +0 -1
  622. package/dist/services/provider-resilience/coordinator.js.map +0 -1
  623. package/dist/services/provider-resilience/error-classifier.d.ts.map +0 -1
  624. package/dist/services/provider-resilience/error-classifier.js.map +0 -1
  625. package/dist/services/provider-resilience/index.d.ts.map +0 -1
  626. package/dist/services/provider-resilience/index.js.map +0 -1
  627. package/dist/services/provider-resilience/request-gate.d.ts.map +0 -1
  628. package/dist/services/provider-resilience/request-gate.js.map +0 -1
  629. package/dist/services/provider-resilience/stream-recovery.d.ts.map +0 -1
  630. package/dist/services/provider-resilience/stream-recovery.js.map +0 -1
  631. package/dist/services/provider-resilience/types.d.ts.map +0 -1
  632. package/dist/services/provider-resilience/types.js.map +0 -1
  633. package/dist/services/redaction.d.ts.map +0 -1
  634. package/dist/services/redaction.js.map +0 -1
  635. package/dist/services/safe-project-reader.d.ts.map +0 -1
  636. package/dist/services/safe-project-reader.js.map +0 -1
  637. package/dist/services/session-index.d.ts.map +0 -1
  638. package/dist/services/session-index.js.map +0 -1
  639. package/dist/services/session-memory/index.d.ts.map +0 -1
  640. package/dist/services/session-memory/index.js.map +0 -1
  641. package/dist/services/session-memory/prompts.d.ts.map +0 -1
  642. package/dist/services/session-memory/prompts.js.map +0 -1
  643. package/dist/services/session-memory/sessionMemory.d.ts.map +0 -1
  644. package/dist/services/session-memory/sessionMemory.js.map +0 -1
  645. package/dist/services/session-storage.d.ts.map +0 -1
  646. package/dist/services/session-storage.js.map +0 -1
  647. package/dist/services/settings-coordinator.d.ts.map +0 -1
  648. package/dist/services/settings-coordinator.js.map +0 -1
  649. package/dist/services/settings-document-repository.d.ts.map +0 -1
  650. package/dist/services/settings-document-repository.js.map +0 -1
  651. package/dist/services/smart-routing.d.ts.map +0 -1
  652. package/dist/services/smart-routing.js.map +0 -1
  653. package/dist/services/storage-maintenance.d.ts.map +0 -1
  654. package/dist/services/storage-maintenance.js.map +0 -1
  655. package/dist/services/tool-allowlist.d.ts.map +0 -1
  656. package/dist/services/tool-allowlist.js.map +0 -1
  657. package/dist/services/usage-state.d.ts.map +0 -1
  658. package/dist/services/usage-state.js.map +0 -1
  659. package/dist/services/verification-profile.d.ts.map +0 -1
  660. package/dist/services/verification-profile.js.map +0 -1
  661. package/dist/services/web-search-adapters.d.ts.map +0 -1
  662. package/dist/services/web-search-adapters.js.map +0 -1
  663. package/dist/services/web-search-mcp.d.ts.map +0 -1
  664. package/dist/services/web-search-mcp.js.map +0 -1
  665. package/dist/services/web-search-provider.d.ts.map +0 -1
  666. package/dist/services/web-search-provider.js.map +0 -1
  667. package/dist/services/workspace-containment.d.ts.map +0 -1
  668. package/dist/services/workspace-containment.js.map +0 -1
  669. package/dist/services/workspace-diff.d.ts.map +0 -1
  670. package/dist/services/workspace-diff.js.map +0 -1
  671. package/dist/services/workspace-registry.d.ts.map +0 -1
  672. package/dist/services/workspace-registry.js.map +0 -1
  673. package/dist/services/workspace-state.d.ts.map +0 -1
  674. package/dist/services/workspace-state.js.map +0 -1
  675. package/dist/services/yaml-config.d.ts.map +0 -1
  676. package/dist/services/yaml-config.js.map +0 -1
  677. package/dist/terminal-ui/completion.d.ts.map +0 -1
  678. package/dist/terminal-ui/completion.js.map +0 -1
  679. package/dist/terminal-ui/editor.d.ts.map +0 -1
  680. package/dist/terminal-ui/editor.js.map +0 -1
  681. package/dist/terminal-ui/launch.d.ts.map +0 -1
  682. package/dist/terminal-ui/launch.js.map +0 -1
  683. package/dist/terminal-ui/output-queue.d.ts.map +0 -1
  684. package/dist/terminal-ui/output-queue.js.map +0 -1
  685. package/dist/terminal-ui/raw-editor.d.ts.map +0 -1
  686. package/dist/terminal-ui/raw-editor.js.map +0 -1
  687. package/dist/tools/_validate.d.ts.map +0 -1
  688. package/dist/tools/_validate.js.map +0 -1
  689. package/dist/tools/bash_security.d.ts.map +0 -1
  690. package/dist/tools/bash_security.js.map +0 -1
  691. package/dist/tools/core/common.d.ts.map +0 -1
  692. package/dist/tools/core/common.js.map +0 -1
  693. package/dist/tools/core/edit-file.d.ts.map +0 -1
  694. package/dist/tools/core/edit-file.js.map +0 -1
  695. package/dist/tools/core/exec-command.d.ts.map +0 -1
  696. package/dist/tools/core/exec-command.js.map +0 -1
  697. package/dist/tools/core/glob.d.ts.map +0 -1
  698. package/dist/tools/core/glob.js.map +0 -1
  699. package/dist/tools/core/grep.d.ts.map +0 -1
  700. package/dist/tools/core/grep.js.map +0 -1
  701. package/dist/tools/core/index.d.ts.map +0 -1
  702. package/dist/tools/core/index.js.map +0 -1
  703. package/dist/tools/core/list-files.d.ts.map +0 -1
  704. package/dist/tools/core/list-files.js.map +0 -1
  705. package/dist/tools/core/read-file.d.ts.map +0 -1
  706. package/dist/tools/core/read-file.js.map +0 -1
  707. package/dist/tools/core/write-file.d.ts.map +0 -1
  708. package/dist/tools/core/write-file.js.map +0 -1
  709. package/dist/tools/git.d.ts.map +0 -1
  710. package/dist/tools/git.js.map +0 -1
  711. package/dist/tools/lsp.d.ts.map +0 -1
  712. package/dist/tools/lsp.js.map +0 -1
  713. package/dist/tools/sandbox.d.ts.map +0 -1
  714. package/dist/tools/sandbox.js.map +0 -1
  715. package/dist/tools/todo.d.ts.map +0 -1
  716. package/dist/tools/todo.js.map +0 -1
  717. package/dist/tools/web.d.ts.map +0 -1
  718. package/dist/tools/web.js.map +0 -1
  719. package/dist/tui-core/frame.d.ts.map +0 -1
  720. package/dist/tui-core/frame.js.map +0 -1
  721. package/dist/tui-core/input-parser.d.ts.map +0 -1
  722. package/dist/tui-core/input-parser.js.map +0 -1
  723. package/dist/tui-core/style.d.ts.map +0 -1
  724. package/dist/tui-core/style.js.map +0 -1
  725. package/dist/tui-core/terminal-writer.d.ts.map +0 -1
  726. package/dist/tui-core/terminal-writer.js.map +0 -1
  727. package/dist/tui-ui/chrome-view-model.d.ts.map +0 -1
  728. package/dist/tui-ui/chrome-view-model.js.map +0 -1
  729. package/dist/tui-ui/inline-surface.d.ts.map +0 -1
  730. package/dist/tui-ui/inline-surface.js.map +0 -1
  731. package/dist/tui-ui/input-ownership.d.ts.map +0 -1
  732. package/dist/tui-ui/input-ownership.js.map +0 -1
  733. package/dist/tui-ui/launch.d.ts.map +0 -1
  734. package/dist/tui-ui/launch.js.map +0 -1
  735. package/dist/tui-ui/layout.d.ts.map +0 -1
  736. package/dist/tui-ui/layout.js.map +0 -1
  737. package/dist/tui-ui/pickers.d.ts.map +0 -1
  738. package/dist/tui-ui/pickers.js.map +0 -1
  739. package/dist/tui-ui/pixel-mascot.d.ts.map +0 -1
  740. package/dist/tui-ui/pixel-mascot.js.map +0 -1
  741. package/dist/tui-ui/render-scheduler.d.ts.map +0 -1
  742. package/dist/tui-ui/render-scheduler.js.map +0 -1
  743. package/dist/tui-ui/runner.d.ts.map +0 -1
  744. package/dist/tui-ui/runner.js.map +0 -1
  745. package/dist/tui-ui/state.d.ts.map +0 -1
  746. package/dist/tui-ui/state.js.map +0 -1
  747. package/dist/tui-ui/terminal-image.d.ts.map +0 -1
  748. package/dist/tui-ui/terminal-image.js.map +0 -1
  749. package/dist/tui-ui/theme-profile.d.ts.map +0 -1
  750. package/dist/tui-ui/theme-profile.js.map +0 -1
  751. package/dist/tui-ui/theme.d.ts.map +0 -1
  752. package/dist/tui-ui/theme.js.map +0 -1
  753. package/dist/tui-ui/transcript-cache.d.ts.map +0 -1
  754. package/dist/tui-ui/transcript-cache.js.map +0 -1
  755. package/dist/tui-ui/transcript-inspector-layout.d.ts.map +0 -1
  756. package/dist/tui-ui/transcript-inspector-layout.js.map +0 -1
  757. package/dist/tui-ui/transcript-inspector-surface.d.ts.map +0 -1
  758. package/dist/tui-ui/transcript-inspector-surface.js.map +0 -1
  759. package/dist/tui-ui/transcript-inspector.d.ts.map +0 -1
  760. package/dist/tui-ui/transcript-inspector.js.map +0 -1
  761. package/dist/tui-ui/transcript-layout.d.ts.map +0 -1
  762. package/dist/tui-ui/transcript-layout.js.map +0 -1
  763. package/dist/ui/box.d.ts.map +0 -1
  764. package/dist/ui/box.js.map +0 -1
  765. package/dist/ui/command-panel.d.ts.map +0 -1
  766. package/dist/ui/command-panel.js.map +0 -1
  767. package/dist/ui/file-completion.d.ts.map +0 -1
  768. package/dist/ui/file-completion.js.map +0 -1
  769. package/dist/ui/markdown.d.ts.map +0 -1
  770. package/dist/ui/markdown.js.map +0 -1
  771. package/dist/ui/multiline-input.d.ts.map +0 -1
  772. package/dist/ui/multiline-input.js.map +0 -1
  773. package/dist/ui/progress.d.ts.map +0 -1
  774. package/dist/ui/progress.js.map +0 -1
  775. package/dist/ui/shared/command-palette.d.ts.map +0 -1
  776. package/dist/ui/shared/command-palette.js.map +0 -1
  777. package/dist/ui/shared/command-suggestions.d.ts.map +0 -1
  778. package/dist/ui/shared/command-suggestions.js.map +0 -1
  779. package/dist/ui/shared/input-frame.d.ts.map +0 -1
  780. package/dist/ui/shared/input-frame.js.map +0 -1
  781. package/dist/ui/shared/text.d.ts.map +0 -1
  782. package/dist/ui/shared/text.js.map +0 -1
  783. package/dist/ui/shared/types.d.ts.map +0 -1
  784. package/dist/ui/shared/types.js.map +0 -1
  785. package/dist/ui/status-bar.d.ts.map +0 -1
  786. package/dist/ui/status-bar.js.map +0 -1
  787. package/dist/ui/stream-markdown.d.ts.map +0 -1
  788. package/dist/ui/stream-markdown.js.map +0 -1
  789. package/dist/ui/suggestions.d.ts.map +0 -1
  790. package/dist/ui/suggestions.js.map +0 -1
  791. package/dist/ui/tool-preview.d.ts.map +0 -1
  792. package/dist/ui/tool-preview.js.map +0 -1
  793. package/dist/ui/user-input.d.ts.map +0 -1
  794. package/dist/ui/user-input.js.map +0 -1
  795. package/dist/utils/debug-log.d.ts.map +0 -1
  796. package/dist/utils/debug-log.js.map +0 -1
  797. package/dist/utils/errors.d.ts.map +0 -1
  798. package/dist/utils/errors.js.map +0 -1
  799. package/dist/utils/json.d.ts.map +0 -1
  800. package/dist/utils/json.js.map +0 -1
  801. package/dist/utils/mask.d.ts.map +0 -1
  802. package/dist/utils/mask.js.map +0 -1
  803. package/dist/utils/observability.d.ts.map +0 -1
  804. package/dist/utils/observability.js.map +0 -1
  805. package/dist/utils/token-estimate.d.ts.map +0 -1
  806. package/dist/utils/token-estimate.js.map +0 -1
  807. package/dist/web/errors.d.ts.map +0 -1
  808. package/dist/web/errors.js.map +0 -1
  809. package/dist/web/event-hub.d.ts.map +0 -1
  810. package/dist/web/event-hub.js.map +0 -1
  811. package/dist/web/file-read-service.d.ts.map +0 -1
  812. package/dist/web/file-read-service.js.map +0 -1
  813. package/dist/web/git-read-model-service.d.ts.map +0 -1
  814. package/dist/web/git-read-model-service.js.map +0 -1
  815. package/dist/web/index.d.ts.map +0 -1
  816. package/dist/web/index.js.map +0 -1
  817. package/dist/web/launch.d.ts.map +0 -1
  818. package/dist/web/launch.js.map +0 -1
  819. package/dist/web/protocol.d.ts.map +0 -1
  820. package/dist/web/protocol.js.map +0 -1
  821. package/dist/web/review-service.d.ts.map +0 -1
  822. package/dist/web/review-service.js.map +0 -1
  823. package/dist/web/server.d.ts.map +0 -1
  824. package/dist/web/server.js.map +0 -1
  825. package/dist/web/terminal-manager.d.ts.map +0 -1
  826. package/dist/web/terminal-manager.js.map +0 -1
  827. package/dist/web/terminal-server.d.ts.map +0 -1
  828. package/dist/web/terminal-server.js.map +0 -1
  829. package/dist/web/workbench-controller.d.ts.map +0 -1
  830. package/dist/web/workbench-controller.js.map +0 -1
  831. package/dist/web-client/assets/FilesPanel-DYs1MhoM.js +0 -2
  832. package/dist/web-client/assets/ReviewPanel-BDxG670T.js +0 -1
  833. package/dist/web-client/assets/index-BWV5sIvw.css +0 -1
  834. package/dist/web-client/assets/index-VVUKj6FE.js +0 -17
@@ -12,6 +12,7 @@ const mcp_1 = require("../runtime/mcp");
12
12
  const product_bootstrap_1 = require("../runtime/product-bootstrap");
13
13
  const canonical_1 = require("../runtime/protocol/canonical");
14
14
  const plan_review_1 = require("../runtime/plan-review");
15
+ const thread_event_store_1 = require("../runtime/thread-event-store");
15
16
  const thread_session_index_1 = require("../runtime/thread-session-index");
16
17
  const thread_session_view_1 = require("../runtime/thread-session-view");
17
18
  const tool_detail_repository_1 = require("../runtime/tool-detail-repository");
@@ -26,8 +27,10 @@ const errors_1 = require("./errors");
26
27
  const event_hub_1 = require("./event-hub");
27
28
  const file_read_service_1 = require("./file-read-service");
28
29
  const git_read_model_service_1 = require("./git-read-model-service");
30
+ const workspace_mutation_arbiter_1 = require("./workspace-mutation-arbiter");
29
31
  const protocol_1 = require("./protocol");
30
32
  const review_service_1 = require("./review-service");
33
+ const session_runtime_registry_1 = require("./session-runtime-registry");
31
34
  const terminal_manager_1 = require("./terminal-manager");
32
35
  var errors_2 = require("./errors");
33
36
  Object.defineProperty(exports, "WebWorkbenchError", { enumerable: true, get: function () { return errors_2.WebWorkbenchError; } });
@@ -35,23 +38,52 @@ const SESSION_VIEW_CACHE_BYTES = 16 * 1024 * 1024;
35
38
  const MAX_MUTATION_RESULTS = 4096;
36
39
  const MAX_CONTEXT_REFERENCE_BYTES = 64 * 1024;
37
40
  const MAX_CONTEXT_MANIFEST_BYTES = 256 * 1024;
38
- /** Owns the sole runtime/controller pair exposed through the local Web host. */
41
+ const CONTEXT_TRANSITION_MUTATIONS = new Set(['context.activate', 'workspace.activate']);
42
+ /** Owns the Workspace surface plus the bounded Web Session actor registry. */
39
43
  class WebWorkbenchController {
40
44
  constructor(options) {
45
+ this.activeOrionRuntimes = new Map();
46
+ /**
47
+ * Workspace-scoped shared kernels owned by this Host. Control planes and
48
+ * Session actors both borrow from this pool, so a Workspace Context switch
49
+ * never tears down kernels that resident actors still reference. The pool is
50
+ * released only during Host shutdown.
51
+ */
52
+ this.workspaceKernels = new Map();
41
53
  this.mutationResults = new Map();
42
54
  this.sessionViews = new Map();
43
55
  this.sessionViewBytes = 0;
44
56
  this.toolDetails = new tool_detail_repository_1.FileToolDetailRepository();
57
+ this.workspaceMutationOwners = new Map();
58
+ this.pendingWorkspaceMutationStates = new Map();
45
59
  this.contextRevisionValue = (0, crypto_1.randomUUID)();
46
60
  this.composerRevisionValue = (0, crypto_1.randomUUID)();
47
61
  this.suppressComposerEdges = 0;
48
62
  this.suppressContextEdges = 0;
49
63
  this.latestStatus = 'Ready';
50
- this.sessionTransition = false;
64
+ this.activeMutationCount = 0;
65
+ this.contextTransitionReserved = false;
51
66
  this.closed = false;
67
+ /**
68
+ * Host-observed Web activity counters. Exposed through diagnostics() so E2E
69
+ * and the diagnostics panel can prove that a pure Session selection issues
70
+ * no control-plane reinstall (controlPlaneInstalls delta 0) and that
71
+ * snapshots stay bounded and fast (snapshotTotalMs / snapshotLastMs).
72
+ */
73
+ this.sessionActivity = {
74
+ snapshotRequests: 0,
75
+ snapshotFailures: 0,
76
+ snapshotTotalMs: 0,
77
+ snapshotLastMs: 0,
78
+ controlPlaneInstalls: 0,
79
+ controlPlaneShutdowns: 0,
80
+ };
52
81
  this.workspaceWatchers = [];
53
82
  this.workspaceValue = canonicalDirectory(options.cwd);
54
83
  this.eventHub = options.eventHub ?? new event_hub_1.WebEventHub();
84
+ this.workspaceMutations = new workspace_mutation_arbiter_1.WorkspaceMutationArbiterV1({
85
+ onStateChanged: state => this.emitWorkspaceMutationState(state),
86
+ });
55
87
  this.workspaceRegistry = options.workspaceRegistry ?? new workspace_registry_1.WorkspaceRegistryV1();
56
88
  this.terminalManager = new terminal_manager_1.TerminalManagerV1({
57
89
  resolveWorkspace: workspaceId => this.workspaceRegistry.find(workspaceId)?.canonicalPath,
@@ -69,6 +101,11 @@ class WebWorkbenchController {
69
101
  options.createRuntime ??
70
102
  (cwd => (0, product_bootstrap_1.createProductUiRuntime)({
71
103
  cwd,
104
+ // Borrow the workspace kernel from the Host-owned pool so the
105
+ // control plane shares config/Tool/MCP/Settings services with the
106
+ // resident Session actors of the same Workspace.
107
+ workspaceRuntimeKernel: this.workspaceKernelFor(cwd),
108
+ workspaceMutationCoordinator: this.workspaceMutations,
72
109
  shutdownReason: 'Orion Web Workbench shutdown',
73
110
  onActiveSessionRuntime: (runtime, sessionId, activation) => this.observeThreadRuntime(runtime, sessionId, activation),
74
111
  onSettingsInvalidated: event => {
@@ -82,6 +119,19 @@ class WebWorkbenchController {
82
119
  }, false);
83
120
  },
84
121
  }));
122
+ this.createSessionRuntime =
123
+ options.createSessionRuntime ??
124
+ options.createRuntime ??
125
+ (cwd => (0, product_bootstrap_1.createProductUiRuntime)({
126
+ cwd,
127
+ // Session actors must keep the kernel of the Workspace they were
128
+ // created for, never the currently active control plane's kernel.
129
+ workspaceRuntimeKernel: this.workspaceKernelFor(cwd),
130
+ workspaceMutationCoordinator: this.workspaceMutations,
131
+ shutdownReason: 'Orion Web Session actor shutdown',
132
+ onActiveSessionRuntime: (runtime, sessionId, activation) => this.observeThreadRuntime(runtime, sessionId, activation),
133
+ }));
134
+ this.sessionRegistry = this.createSessionRegistry();
85
135
  }
86
136
  static async create(options) {
87
137
  const workbench = new WebWorkbenchController(options);
@@ -187,6 +237,25 @@ class WebWorkbenchController {
187
237
  this.assertContextGuard(context);
188
238
  return result;
189
239
  }
240
+ /** Archived sessions of a Workspace (v0.3.7), newest archive first. */
241
+ listArchivedWorkspaceSessions(workspaceId, context) {
242
+ if (context)
243
+ this.assertContextGuard(context);
244
+ const entry = this.workspaceRegistry.find(workspaceId);
245
+ if (!entry) {
246
+ throw new errors_1.WebWorkbenchError(404, 'Workspace was not found.', 'workspace_not_found');
247
+ }
248
+ try {
249
+ canonicalDirectory(entry.canonicalPath);
250
+ }
251
+ catch {
252
+ throw new errors_1.WebWorkbenchError(409, 'Workspace is unavailable.', 'workspace_unavailable');
253
+ }
254
+ const result = Object.freeze((0, session_storage_1.listArchivedProjectSessions)(entry.canonicalPath).map(protocol_1.projectSessionSummary));
255
+ if (context)
256
+ this.assertContextGuard(context);
257
+ return result;
258
+ }
190
259
  async workspaceProjectSummary(workspaceId, context) {
191
260
  if (context)
192
261
  this.assertContextGuard(context);
@@ -253,16 +322,30 @@ class WebWorkbenchController {
253
322
  return result;
254
323
  }
255
324
  sessionSnapshot(sessionId, cursor, pageSize = 50, tail = false, context) {
325
+ const startedAt = Date.now();
326
+ try {
327
+ const snapshot = this.snapshotSessionV1(sessionId, cursor, pageSize, tail, context);
328
+ this.recordSessionSnapshotActivity(startedAt);
329
+ return snapshot;
330
+ }
331
+ catch (error) {
332
+ this.recordSessionSnapshotActivity(startedAt, true);
333
+ throw error;
334
+ }
335
+ }
336
+ snapshotSessionV1(sessionId, cursor, pageSize = 50, tail = false, context) {
256
337
  if (context)
257
338
  this.assertContextGuard(context);
258
339
  const session = requireSession(sessionId);
259
340
  if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
260
341
  throw new errors_1.WebWorkbenchError(409, 'Session belongs to another workspace.');
261
342
  }
262
- const active = this.runtimeValue.getSession()?.id === session.id;
263
- const activeProjection = this.activeOrionRuntime?.sessionId === session.id
264
- ? this.activeOrionRuntime.runtime.thread.getProjection()
265
- : undefined;
343
+ const key = this.sessionActorKey(session);
344
+ const resident = this.sessionRegistry.residentActor(key);
345
+ const actor = resident?.actor;
346
+ const baseSessionRuntime = resident?.runtime ?? this.sessionRegistry.summary(key);
347
+ const active = actor !== undefined;
348
+ const activeProjection = this.activeOrionRuntimes.get(session.id)?.thread.getProjection();
266
349
  let indexedPage;
267
350
  if (tail) {
268
351
  try {
@@ -352,13 +435,26 @@ class WebWorkbenchController {
352
435
  : [];
353
436
  const commits = commitProjections.map(commit => (0, turn_commit_1.parseTurnCommitV1)(commit.receipt));
354
437
  const latestCommit = commits.at(-1);
438
+ const latestProjectedTurn = activeProjection
439
+ ? Object.values(activeProjection.turns)
440
+ .sort((left, right) => left.startedSeq - right.startedSeq)
441
+ .at(-1)
442
+ : undefined;
443
+ const durableTerminal = latestProjectedTurn?.status ?? indexedPage?.latestTurn?.status ?? latestCommit?.terminal;
444
+ const recoverableTerminalPhase = durableTerminal === 'interrupted' || durableTerminal === 'failed'
445
+ ? durableTerminal
446
+ : undefined;
447
+ const sessionRuntime = recoverableTerminalPhase &&
448
+ ['cold', 'idle', 'interrupted', 'failed'].includes(baseSessionRuntime.phase)
449
+ ? Object.freeze({ ...baseSessionRuntime, phase: recoverableTerminalPhase })
450
+ : baseSessionRuntime;
355
451
  const planCommit = [...commits].reverse().find(commit => commit.planReceipt);
356
452
  const plan = planCommit?.planReceipt
357
453
  ? pickPlanReceipt((0, turn_commit_1.parsePlanReceiptV1)(planCommit.planReceipt))
358
454
  : null;
359
- const state = this.runtimeValue.store.getSnapshot();
455
+ const state = (actor?.runtime ?? this.runtimeValue).store.getSnapshot();
360
456
  const pendingPermissions = active
361
- ? this.controllerValue.getPendingPermissions().map(request => ({
457
+ ? actor.controller.getPendingPermissions().map(request => ({
362
458
  id: request.id,
363
459
  toolName: request.name,
364
460
  ...(request.reason ? { reason: request.reason } : {}),
@@ -374,9 +470,16 @@ class WebWorkbenchController {
374
470
  state: JSON.parse(latestCommit.goalState),
375
471
  }
376
472
  : null;
473
+ const projectedComposer = actor
474
+ ? this.projectActorComposerState(actor, session)
475
+ : this.projectComposerStateValue(session, undefined, indexedPage?.planReview);
476
+ const composer = projectedComposer.sessionRuntime.phase === sessionRuntime.phase
477
+ ? projectedComposer
478
+ : Object.freeze({ ...projectedComposer, sessionRuntime });
377
479
  const snapshot = Object.freeze({
378
480
  apiVersion: protocol_1.WEB_API_VERSION,
379
481
  session: (0, protocol_1.projectSessionSummary)(session),
482
+ sessionRuntime,
380
483
  threadId: activeProjection?.threadId ?? indexedPage?.threadId ?? view?.threadId ?? null,
381
484
  threadCursor: activeProjection?.cursor ?? indexedPage?.cursor ?? view?.cursor ?? 0,
382
485
  eventCursor: this.eventHub.snapshot().latest,
@@ -393,8 +496,8 @@ class WebWorkbenchController {
393
496
  processing: active ? state.isProcessing : false,
394
497
  agentMode: state.agentMode,
395
498
  permissionMode: state.permissionMode,
396
- status: this.latestStatus,
397
- followups: active ? Object.freeze([...this.controllerValue.getFollowupQueue()]) : [],
499
+ status: actor?.latestStatus ?? 'Ready',
500
+ followups: active ? Object.freeze([...actor.controller.getFollowupQueue()]) : [],
398
501
  followupLimit: 16,
399
502
  contextUsage: active ? state.contextUsage : null,
400
503
  tokenUsage: active ? state.tokenUsage : null,
@@ -402,71 +505,100 @@ class WebWorkbenchController {
402
505
  pendingApprovals: Object.freeze(pendingPermissions),
403
506
  goal,
404
507
  plan,
405
- composer: this.projectComposerState(session, active),
508
+ composer,
406
509
  recoveryDiagnostics: indexedPage ? [] : (view?.diagnostics ?? []),
407
510
  });
408
511
  if (context)
409
512
  this.assertContextGuard(context);
410
513
  return snapshot;
411
514
  }
515
+ recordSessionSnapshotActivity(startedAt, failed = false) {
516
+ const elapsedMs = Date.now() - startedAt;
517
+ this.sessionActivity.snapshotRequests += 1;
518
+ if (failed)
519
+ this.sessionActivity.snapshotFailures += 1;
520
+ this.sessionActivity.snapshotTotalMs += elapsedMs;
521
+ this.sessionActivity.snapshotLastMs = elapsedMs;
522
+ }
412
523
  composerState(sessionId, context) {
413
524
  if (context)
414
525
  this.assertContextGuard(context);
415
- this.assertCommandSession(sessionId);
416
526
  const session = requireSession(sessionId);
417
- const state = this.projectComposerState(session, true);
527
+ this.assertSessionWorkspace(session);
528
+ const actor = this.sessionRegistry.residentActor(this.sessionActorKey(session))?.actor;
529
+ const state = actor
530
+ ? this.projectActorComposerState(actor, session)
531
+ : this.projectComposerStateValue(session);
418
532
  if (context)
419
533
  this.assertContextGuard(context);
420
534
  return state;
421
535
  }
422
- projectComposerState(session, active) {
423
- const state = this.projectComposerStateValue(session, active);
424
- if (!active)
425
- return state;
536
+ sessionRuntimeSummary(sessionId) {
537
+ const session = requireSession(sessionId);
538
+ this.assertSessionWorkspace(session);
539
+ return this.sessionRegistry.summary(this.sessionActorKey(session));
540
+ }
541
+ async waitForSessionIdle(sessionId) {
542
+ const session = requireSession(sessionId);
543
+ this.assertSessionWorkspace(session);
544
+ const actor = this.sessionRegistry.residentActor(this.sessionActorKey(session))?.actor;
545
+ await actor?.controller.waitForIdle();
546
+ }
547
+ projectActorComposerState(actor, session) {
548
+ const state = this.projectComposerStateValue(session, actor);
426
549
  // Durable Thread and Store authority can advance before the debounced SSE
427
550
  // observer runs. Keep every projected control state and its CAS token in
428
551
  // the same synchronous boundary so the UI never receives new controls
429
552
  // paired with an older revision.
430
553
  const authorityDigest = composerAuthorityDigest(state);
431
- if (this.composerAuthorityDigest === undefined) {
432
- this.composerAuthorityDigest = authorityDigest;
554
+ if (actor.composerAuthorityDigest === undefined) {
555
+ actor.composerAuthorityDigest = authorityDigest;
433
556
  return state;
434
557
  }
435
- if (authorityDigest === this.composerAuthorityDigest)
558
+ if (authorityDigest === actor.composerAuthorityDigest)
436
559
  return state;
437
- this.bumpComposerRevision();
438
- this.composerAuthorityDigest = authorityDigest;
439
- return Object.freeze({ ...state, controlRevision: this.composerRevisionValue });
440
- }
441
- projectComposerStateValue(session, active) {
442
- const controls = this.runtimeValue.sessionComposerControls;
560
+ actor.composerRevision = (0, crypto_1.randomUUID)();
561
+ actor.composerAuthorityDigest = authorityDigest;
562
+ return Object.freeze({ ...state, controlRevision: actor.composerRevision });
563
+ }
564
+ projectComposerStateValue(session, actor, indexedPlanReview) {
565
+ const runtimeOwner = actor?.runtime ?? this.runtimeValue;
566
+ const controller = actor?.controller;
567
+ const controls = runtimeOwner.sessionComposerControls;
443
568
  if (!controls) {
444
569
  throw new errors_1.WebWorkbenchError(503, 'Session Composer controls are unavailable.', 'composer_controls_unavailable');
445
570
  }
446
571
  const runtime = controls.describeSession(session);
447
- const queue = active
448
- ? this.controllerValue.getFollowupQueueSnapshot()
572
+ const queue = actor
573
+ ? actor.controller.getFollowupQueueSnapshot()
449
574
  : { items: [], limit: 16 };
450
- const projection = active && this.activeOrionRuntime?.sessionId === session.id
451
- ? this.activeOrionRuntime.runtime.thread.getProjection()
575
+ const projection = actor
576
+ ? this.activeOrionRuntimes.get(session.id)?.thread.getProjection()
452
577
  : undefined;
453
- const review = projection?.planReview;
454
- const workspace = this.activeWorkspaceEntry();
578
+ const review = projection?.planReview ?? indexedPlanReview;
579
+ const workspaceId = this.workspaceRegistry
580
+ .list()
581
+ .find(entry => entry.canonicalPath === canonicalDirectory(session.projectPath))?.id;
582
+ if (!workspaceId) {
583
+ throw new errors_1.WebWorkbenchError(404, 'Workspace was not found.', 'workspace_not_found');
584
+ }
585
+ const sessionRuntime = this.sessionRegistry.summary({ workspaceId, sessionId: session.id });
455
586
  return Object.freeze({
456
587
  apiVersion: protocol_1.WEB_API_VERSION,
457
- workspaceId: workspace.id,
588
+ workspaceId,
458
589
  sessionId: session.id,
459
590
  contextRevision: this.contextRevisionValue,
460
- controlRevision: this.composerRevisionValue,
461
- processing: active &&
462
- (this.runtimeValue.store.getSnapshot().isProcessing || Boolean(projection?.activeTurnId)),
463
- mode: active
464
- ? Object.freeze({ ...this.controllerValue.getAgentModeSnapshot() })
591
+ controlRevision: actor?.composerRevision ?? sessionRuntime.runtimeRevision,
592
+ sessionRuntime,
593
+ processing: Boolean(actor) &&
594
+ (runtimeOwner.store.getSnapshot().isProcessing || Boolean(projection?.activeTurnId)),
595
+ mode: controller
596
+ ? Object.freeze({ ...controller.getAgentModeSnapshot() })
465
597
  : Object.freeze({ baseMode: 'interactive', pendingBaseMode: null }),
466
598
  model: runtime.model,
467
599
  permission: runtime.permission,
468
600
  contextUsage: runtime.contextUsage,
469
- compactAvailable: active && this.controllerValue.canCompactContext(),
601
+ compactAvailable: controller?.canCompactContext() ?? false,
470
602
  pending: runtime.pending,
471
603
  lastError: runtime.lastError,
472
604
  planReview: review
@@ -489,8 +621,10 @@ class WebWorkbenchController {
489
621
  modelCatalog(sessionId, context) {
490
622
  if (context)
491
623
  this.assertContextGuard(context);
492
- this.assertCommandSession(sessionId);
493
- const controls = this.runtimeValue.sessionComposerControls;
624
+ const session = requireSession(sessionId);
625
+ this.assertSessionWorkspace(session);
626
+ const actor = this.sessionRegistry.residentActor(this.sessionActorKey(session))?.actor;
627
+ const controls = (actor?.runtime ?? this.runtimeValue).sessionComposerControls;
494
628
  if (!controls) {
495
629
  throw new errors_1.WebWorkbenchError(503, 'Session model catalog is unavailable.', 'composer_controls_unavailable');
496
630
  }
@@ -501,12 +635,29 @@ class WebWorkbenchController {
501
635
  }
502
636
  async applyComposerAction(input) {
503
637
  this.assertContextGuard(input);
504
- this.assertCommandSession(input.expectedSessionId);
505
- const admittedState = this.composerState(input.expectedSessionId);
638
+ const session = requireSession(input.expectedSessionId);
639
+ this.assertSessionWorkspace(session);
640
+ const key = this.sessionActorKey(session);
641
+ const wasResident = this.sessionRegistry.summary(key).resident;
642
+ let actor;
643
+ try {
644
+ actor = (await this.sessionRegistry.ensureResident(key, input.expectedSessionRuntimeRevision))
645
+ .actor;
646
+ }
647
+ catch (error) {
648
+ throw mapSessionRuntimeError(error);
649
+ }
650
+ const actorSession = actor.runtime.getSession();
651
+ if (!actorSession || actorSession.id !== input.expectedSessionId) {
652
+ throw new errors_1.WebWorkbenchError(503, 'Session actor is not bound to the expected Session.', 'session_unavailable');
653
+ }
654
+ if (!wasResident)
655
+ actor.composerRevision = input.expectedControlRevision;
656
+ const admittedState = this.projectActorComposerState(actor, actorSession);
506
657
  if (input.expectedControlRevision !== admittedState.controlRevision) {
507
658
  throw new errors_1.WebWorkbenchError(409, 'Composer controls changed before the action was admitted.', 'composer_control_conflict');
508
659
  }
509
- const controls = this.runtimeValue.sessionComposerControls;
660
+ const controls = actor.runtime.sessionComposerControls;
510
661
  if (!controls) {
511
662
  throw new errors_1.WebWorkbenchError(503, 'Session Composer controls are unavailable.', 'composer_controls_unavailable');
512
663
  }
@@ -515,11 +666,11 @@ class WebWorkbenchController {
515
666
  let modelReceipt;
516
667
  let permissionReceipt;
517
668
  let planReviewReceipt;
518
- this.suppressComposerEdges += 1;
669
+ actor.suppressComposerEdges += 1;
519
670
  try {
520
671
  switch (input.type) {
521
672
  case 'set_agent_mode': {
522
- const result = this.controllerValue.setAgentMode(input.mode);
673
+ const result = actor.controller.setAgentMode(input.mode);
523
674
  outcome =
524
675
  result.type === 'agent_mode_changed' && result.appliesFrom === 'next-logical-request'
525
676
  ? 'deferred'
@@ -543,7 +694,7 @@ class WebWorkbenchController {
543
694
  outcome = modelReceipt.appliesFrom === 'next-logical-request' ? 'deferred' : 'applied';
544
695
  break;
545
696
  case 'compact_context': {
546
- const result = await this.controllerValue.compactContext();
697
+ const result = await actor.controller.compactContext();
547
698
  if (result.status === 'rejected') {
548
699
  throw new errors_1.WebWorkbenchError(409, 'Context compact was rejected.', 'runtime_busy');
549
700
  }
@@ -551,24 +702,24 @@ class WebWorkbenchController {
551
702
  break;
552
703
  }
553
704
  case 'edit_queue_item':
554
- detail = JSON.stringify(this.controllerValue.editFollowupQueueItem(input.itemId, input.expectedItemRevision, input.text));
705
+ detail = JSON.stringify(actor.controller.editFollowupQueueItem(input.itemId, input.expectedItemRevision, input.text));
555
706
  break;
556
707
  case 'move_queue_item':
557
- detail = JSON.stringify(this.controllerValue.moveFollowupQueueItem(input.itemId, input.expectedItemRevision, input.targetIndex));
708
+ detail = JSON.stringify(actor.controller.moveFollowupQueueItem(input.itemId, input.expectedItemRevision, input.targetIndex));
558
709
  break;
559
710
  case 'remove_queue_item':
560
- detail = JSON.stringify(this.controllerValue.removeFollowupQueueItem(input.itemId, input.expectedItemRevision));
711
+ detail = JSON.stringify(actor.controller.removeFollowupQueueItem(input.itemId, input.expectedItemRevision));
561
712
  break;
562
713
  case 'review_plan': {
563
- planReviewReceipt = await this.controllerValue.reviewPlan({
714
+ planReviewReceipt = await actor.controller.reviewPlan({
564
715
  planDigest: input.planDigest,
565
716
  action: input.action,
566
717
  ...(input.feedback ? { feedback: input.feedback } : {}),
567
718
  });
568
719
  if (input.action === 'approve')
569
- this.controllerValue.setAgentMode('interactive');
720
+ actor.controller.setAgentMode('interactive');
570
721
  else if (input.action === 'continue')
571
- this.controllerValue.setAgentMode('plan');
722
+ actor.controller.setAgentMode('plan');
572
723
  detail = JSON.stringify(planReviewReceipt.admission);
573
724
  break;
574
725
  }
@@ -578,18 +729,18 @@ class WebWorkbenchController {
578
729
  throw mapComposerControlError(error);
579
730
  }
580
731
  finally {
581
- this.suppressComposerEdges -= 1;
732
+ actor.suppressComposerEdges -= 1;
582
733
  }
583
- this.bumpComposerRevision();
584
- const state = this.projectComposerStateValue(requireSession(input.expectedSessionId), true);
585
- this.composerAuthorityDigest = composerAuthorityDigest(state);
734
+ actor.composerRevision = (0, crypto_1.randomUUID)();
735
+ const state = this.projectComposerStateValue(actorSession, actor);
736
+ actor.composerAuthorityDigest = composerAuthorityDigest(state);
586
737
  this.eventHub.emit({ type: 'composer_state_changed', state }, true, {
587
738
  sessionId: input.expectedSessionId,
588
739
  });
589
740
  return Object.freeze({
590
741
  requestId: input.requestId,
591
742
  outcome,
592
- controlRevision: this.composerRevisionValue,
743
+ controlRevision: actor.composerRevision,
593
744
  state,
594
745
  ...(modelReceipt ? { modelReceipt } : {}),
595
746
  ...(permissionReceipt ? { permissionReceipt } : {}),
@@ -727,56 +878,28 @@ class WebWorkbenchController {
727
878
  return result;
728
879
  }
729
880
  async createSession(name, context) {
730
- this.assertReadyForTransition('create a session');
731
881
  if (context)
732
882
  this.assertContextGuard(context);
733
- this.sessionTransition = true;
734
- try {
735
- // A new Session inherits the durable default; an override on the currently
736
- // active Session must never leak into the next Session.
737
- const session = (0, session_storage_1.createSession)(this.workspaceValue, this.settings().sections.defaults.model.effectiveValue);
738
- (0, global_config_1.incrementSessionCount)();
739
- const named = name?.trim() ? ((0, session_storage_1.renameSession)(session.id, name.trim()) ?? session) : session;
740
- this.runtimeValue.setSession(named);
741
- await this.runtimeValue.rebindSessionRuntime?.();
742
- this.eventHub.emitRuntime({ type: 'transcript_clear' });
743
- this.emitState();
744
- return (0, protocol_1.projectSessionSummary)(named);
745
- }
746
- finally {
747
- this.sessionTransition = false;
748
- }
883
+ // A new Session inherits the durable default; an override on another
884
+ // Session actor must never leak into it. Creation does not activate or
885
+ // close any actor; foreground selection belongs to the browser tab.
886
+ const session = (0, session_storage_1.createSession)(this.workspaceValue, this.settings().sections.defaults.model.effectiveValue);
887
+ (0, global_config_1.incrementSessionCount)();
888
+ const named = name?.trim() ? ((0, session_storage_1.renameSession)(session.id, name.trim()) ?? session) : session;
889
+ this.sessionRegistry.summary(this.sessionActorKey(named));
890
+ return (0, protocol_1.projectSessionSummary)(named);
749
891
  }
750
892
  async activateSession(sessionId, context) {
751
- this.assertReadyForTransition('switch sessions');
752
893
  if (context)
753
894
  this.assertContextGuard(context);
754
- this.sessionTransition = true;
755
- this.suppressContextEdges += 1;
756
- let activated = false;
757
- try {
758
- const session = requireSession(sessionId);
759
- if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
760
- throw new errors_1.WebWorkbenchError(409, 'Session belongs to another workspace.');
761
- }
762
- const result = this.controllerValue.handle({
763
- type: 'select_session',
764
- sessionId: session.id,
765
- source: 'programmatic',
766
- });
767
- await this.controllerValue.waitForIdle();
768
- if (this.runtimeValue.getSession()?.id !== session.id) {
769
- throw new errors_1.WebWorkbenchError(409, 'Session activation was rejected by the runtime.');
770
- }
771
- activated = true;
772
- return { requestId: `activate:${session.id}`, result: result.type };
773
- }
774
- finally {
775
- this.suppressContextEdges -= 1;
776
- this.sessionTransition = false;
777
- if (activated)
778
- this.emitState();
779
- }
895
+ const session = requireSession(sessionId);
896
+ this.assertSessionWorkspace(session);
897
+ const sessionRuntime = this.sessionRegistry.summary(this.sessionActorKey(session));
898
+ return {
899
+ requestId: `activate:${session.id}`,
900
+ result: 'foreground_session_selected',
901
+ sessionRuntime,
902
+ };
780
903
  }
781
904
  renameSession(sessionId, name, context) {
782
905
  if (context)
@@ -785,13 +908,94 @@ class WebWorkbenchController {
785
908
  if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
786
909
  throw new errors_1.WebWorkbenchError(409, 'Session belongs to another workspace.');
787
910
  }
788
- if (name.length > 120)
911
+ const normalizedName = name.trim();
912
+ if (!normalizedName)
913
+ throw new errors_1.WebWorkbenchError(400, 'Session name is required.');
914
+ if (normalizedName.length > 120)
789
915
  throw new errors_1.WebWorkbenchError(400, 'Session name is too long.');
790
- const updated = (0, session_storage_1.renameSession)(session.id, name);
916
+ const updated = (0, session_storage_1.renameSession)(session.id, normalizedName);
917
+ if (!updated)
918
+ throw new errors_1.WebWorkbenchError(404, 'Session no longer exists.');
919
+ return (0, protocol_1.projectSessionSummary)(updated);
920
+ }
921
+ setSessionTags(sessionId, tags, context) {
922
+ if (context)
923
+ this.assertContextGuard(context);
924
+ const session = requireSession(sessionId);
925
+ this.assertSessionWorkspace(session);
926
+ if (!Array.isArray(tags)) {
927
+ throw new errors_1.WebWorkbenchError(400, 'Tags must be an array of strings.', 'invalid_tags');
928
+ }
929
+ if (tags.length > session_storage_1.SESSION_TAG_LIMIT) {
930
+ throw new errors_1.WebWorkbenchError(400, `A session can have at most ${session_storage_1.SESSION_TAG_LIMIT} tags.`, 'invalid_tags');
931
+ }
932
+ for (const raw of tags) {
933
+ if (typeof raw !== 'string' || !raw.trim()) {
934
+ throw new errors_1.WebWorkbenchError(400, 'Every tag must be a non-empty string.', 'invalid_tags');
935
+ }
936
+ if (raw.trim().length > session_storage_1.SESSION_TAG_MAX_LENGTH) {
937
+ throw new errors_1.WebWorkbenchError(400, `Each tag is limited to ${session_storage_1.SESSION_TAG_MAX_LENGTH} characters.`, 'invalid_tags');
938
+ }
939
+ }
940
+ const updated = (0, session_storage_1.setSessionTags)(session.id, (0, session_storage_1.normalizeSessionTags)(tags));
791
941
  if (!updated)
792
942
  throw new errors_1.WebWorkbenchError(404, 'Session no longer exists.');
793
943
  return (0, protocol_1.projectSessionSummary)(updated);
794
944
  }
945
+ archiveSession(sessionId, context) {
946
+ if (context)
947
+ this.assertContextGuard(context);
948
+ const session = requireSession(sessionId);
949
+ this.assertSessionWorkspace(session);
950
+ this.assertSessionNotBusy(session);
951
+ const updated = (0, session_storage_1.archiveSession)(session.id);
952
+ if (!updated)
953
+ throw new errors_1.WebWorkbenchError(404, 'Session no longer exists.');
954
+ return (0, protocol_1.projectSessionSummary)(updated);
955
+ }
956
+ restoreSession(sessionId, context) {
957
+ if (context)
958
+ this.assertContextGuard(context);
959
+ const session = requireSession(sessionId);
960
+ this.assertSessionWorkspace(session);
961
+ const updated = (0, session_storage_1.restoreSession)(session.id);
962
+ if (!updated)
963
+ throw new errors_1.WebWorkbenchError(404, 'Session no longer exists.');
964
+ return (0, protocol_1.projectSessionSummary)(updated);
965
+ }
966
+ deleteSession(sessionId, context) {
967
+ if (context)
968
+ this.assertContextGuard(context);
969
+ const session = requireSession(sessionId);
970
+ this.assertSessionWorkspace(session);
971
+ this.assertSessionHasNoActor(session);
972
+ const removed = (0, session_storage_1.deleteSession)(session.id);
973
+ if (!removed) {
974
+ throw new errors_1.WebWorkbenchError(409, 'Session files could not be fully removed; nothing was deleted.', 'session_delete_failed');
975
+ }
976
+ return { deleted: true };
977
+ }
978
+ /**
979
+ * A busy Session (starting / queued / running / waiting approval / stopping)
980
+ * must not be archived or deleted while its actor is doing work.
981
+ */
982
+ assertSessionNotBusy(session) {
983
+ const runtime = this.sessionRegistry.summary(this.sessionActorKey(session));
984
+ const busy = new Set(['starting', 'queued', 'running', 'waiting_approval', 'stopping']);
985
+ if (busy.has(runtime.phase)) {
986
+ throw new errors_1.WebWorkbenchError(409, 'Session is busy; stop it before archiving or deleting.', 'session_busy');
987
+ }
988
+ }
989
+ /**
990
+ * Deletion removes files under the Session while a resident actor may still
991
+ * hold them open — require that no actor exists at all (phase 'cold').
992
+ */
993
+ assertSessionHasNoActor(session) {
994
+ const resident = this.sessionRegistry.residentActor(this.sessionActorKey(session));
995
+ if (resident) {
996
+ throw new errors_1.WebWorkbenchError(409, 'Session has an active runtime; stop it before deleting.', 'session_busy');
997
+ }
998
+ }
795
999
  async switchWorkspace(path, context) {
796
1000
  this.assertContextGuard(context);
797
1001
  const next = canonicalDirectory(path);
@@ -823,10 +1027,13 @@ class WebWorkbenchController {
823
1027
  throw new errors_1.WebWorkbenchError(409, 'Session does not belong to the requested Workspace.', 'context_session_mismatch');
824
1028
  }
825
1029
  const currentSessionId = this.runtimeValue.getSession()?.id ?? null;
826
- if (targetWorkspace === this.workspaceValue && targetSession?.id === currentSessionId)
827
- return;
828
- if (targetWorkspace === this.workspaceValue && !targetSession && currentSessionId === null)
1030
+ if (targetWorkspace === this.workspaceValue) {
1031
+ if (targetSession)
1032
+ this.sessionRegistry.summary(this.sessionActorKey(targetSession));
1033
+ // Session foreground selection is browser-local. A same-Workspace
1034
+ // selection never mutates the Host Context or any Session actor.
829
1035
  return;
1036
+ }
830
1037
  this.assertReadyForTransition('activate a Context');
831
1038
  const previousWorkspace = this.workspaceValue;
832
1039
  const previousSessionId = currentSessionId;
@@ -838,17 +1045,28 @@ class WebWorkbenchController {
838
1045
  await previousController.stopActiveTurn();
839
1046
  await previousController.waitForIdle();
840
1047
  if (targetWorkspace !== previousWorkspace) {
841
- await previousRuntime.shutdown();
1048
+ // Detach the control-plane foreground first: releasing the previous
1049
+ // control plane must not end a Session that a resident actor of that
1050
+ // Workspace is still driving.
1051
+ await this.restoreContextSession(null);
1052
+ // P1-A runtime ownership: the Host-level Session registry and its
1053
+ // resident actors are preserved across a Workspace Context switch.
1054
+ // Only the active control plane is swapped. Both control planes
1055
+ // borrowed their Workspace kernel from the shared pool, so releasing
1056
+ // the previous one never tears down kernels that running Session
1057
+ // actors of that Workspace still reference. Install the target
1058
+ // control plane first, then release the previous one's mutable state.
842
1059
  await this.installRuntime(targetWorkspace, false);
1060
+ await previousRuntime.shutdown();
843
1061
  }
844
- await this.restoreContextSession(targetSession?.id ?? null);
845
1062
  this.workspaceRegistry.register(targetWorkspace, { activated: true });
846
1063
  }
847
1064
  catch (activationError) {
848
1065
  try {
849
- if (targetWorkspace !== previousWorkspace) {
850
- if (this.runtimeValue !== previousRuntime)
851
- await this.runtimeValue.shutdown();
1066
+ if (this.runtimeValue !== previousRuntime) {
1067
+ // The target control plane installed but a later step failed; tear
1068
+ // it down and reinstall the previous Workspace's control plane.
1069
+ await this.runtimeValue.shutdown();
852
1070
  await this.installRuntime(previousWorkspace, false);
853
1071
  }
854
1072
  await this.restoreContextSession(previousSessionId);
@@ -875,9 +1093,24 @@ class WebWorkbenchController {
875
1093
  dispatch(raw) {
876
1094
  const command = (0, protocol_1.parseWebCommand)(raw);
877
1095
  return this.executeMutation(command.requestId, 'command', command, async () => {
878
- this.assertCommandSession(command.expectedSessionId);
1096
+ this.assertContextGuard(command);
1097
+ const session = requireSession(command.expectedSessionId);
1098
+ this.assertSessionWorkspace(session);
1099
+ const key = this.sessionActorKey(session);
1100
+ if (command.type === 'cancel_queued_turn') {
1101
+ try {
1102
+ const sessionRuntime = this.sessionRegistry.cancelQueued(key, command.queueId, command.expectedSessionRuntimeRevision);
1103
+ return Object.freeze({
1104
+ requestId: command.requestId,
1105
+ result: 'session_turn_queue_cancelled',
1106
+ sessionRuntime,
1107
+ });
1108
+ }
1109
+ catch (error) {
1110
+ throw mapSessionRuntimeError(error);
1111
+ }
1112
+ }
879
1113
  const resolved = await this.resolveCommandContext(command);
880
- this.assertCommandSession(command.expectedSessionId);
881
1114
  const runtimeInput = resolved && command.type === 'queue_followup'
882
1115
  ? {
883
1116
  type: 'queue_followup',
@@ -886,13 +1119,71 @@ class WebWorkbenchController {
886
1119
  source: 'programmatic',
887
1120
  }
888
1121
  : (0, protocol_1.toAgentRuntimeInput)({ ...command, ...(resolved ? { text: resolved.text } : {}) });
889
- const runtimeResult = this.controllerValue.handle(runtimeInput);
890
- return Object.freeze({
891
- requestId: command.requestId,
892
- result: runtimeResult.type,
893
- detail: JSON.stringify(runtimeResult),
894
- ...(resolved ? { contextReceipt: resolved.receipt } : {}),
895
- });
1122
+ try {
1123
+ if (command.type === 'submit') {
1124
+ const currentRuntime = this.sessionRegistry.summary(key);
1125
+ if (['running', 'waiting_approval'].includes(currentRuntime.phase)) {
1126
+ const routed = await this.sessionRegistry.withActor(key, command.expectedSessionRuntimeRevision, actor => {
1127
+ if (!actor.controller.hasActiveTurn()) {
1128
+ throw new session_runtime_registry_1.WebSessionRuntimeRegistryError(409, 'session_runtime_revision_conflict', 'The Session turn ended before steering was admitted.');
1129
+ }
1130
+ return actor.controller.handle(runtimeInput);
1131
+ });
1132
+ return Object.freeze({
1133
+ requestId: command.requestId,
1134
+ result: routed.result.type,
1135
+ detail: JSON.stringify(routed.result),
1136
+ sessionRuntime: routed.runtime,
1137
+ ...(resolved ? { contextReceipt: resolved.receipt } : {}),
1138
+ });
1139
+ }
1140
+ const admission = await this.sessionRegistry.admitTurn({
1141
+ key,
1142
+ expectedRuntimeRevision: command.expectedSessionRuntimeRevision,
1143
+ start: async (actor) => {
1144
+ const runtimeResult = actor.controller.handle(runtimeInput);
1145
+ return {
1146
+ accepted: runtimeResult,
1147
+ settled: actor.controller.waitForIdle(),
1148
+ };
1149
+ },
1150
+ });
1151
+ if (admission.status === 'queued') {
1152
+ return Object.freeze({
1153
+ requestId: command.requestId,
1154
+ result: 'session_turn_queued',
1155
+ queueId: admission.queueId,
1156
+ queuePosition: admission.queuePosition,
1157
+ sessionRuntime: admission.runtime,
1158
+ ...(resolved ? { contextReceipt: resolved.receipt } : {}),
1159
+ });
1160
+ }
1161
+ return Object.freeze({
1162
+ requestId: command.requestId,
1163
+ result: admission.accepted.type,
1164
+ detail: JSON.stringify(admission.accepted),
1165
+ sessionRuntime: admission.runtime,
1166
+ ...(resolved ? { contextReceipt: resolved.receipt } : {}),
1167
+ });
1168
+ }
1169
+ const routed = await this.sessionRegistry.withActor(key, command.expectedSessionRuntimeRevision, actor => {
1170
+ const runtimeResult = actor.controller.handle(runtimeInput);
1171
+ if (command.type === 'permission_decision') {
1172
+ this.sessionRegistry.setPendingApprovalCount(key, actor.controller.getPendingPermissions().length);
1173
+ }
1174
+ return runtimeResult;
1175
+ });
1176
+ return Object.freeze({
1177
+ requestId: command.requestId,
1178
+ result: routed.result.type,
1179
+ detail: JSON.stringify(routed.result),
1180
+ sessionRuntime: routed.runtime,
1181
+ ...(resolved ? { contextReceipt: resolved.receipt } : {}),
1182
+ });
1183
+ }
1184
+ catch (error) {
1185
+ throw mapSessionRuntimeError(error);
1186
+ }
896
1187
  });
897
1188
  }
898
1189
  async resolveCommandContext(command) {
@@ -1048,6 +1339,7 @@ class WebWorkbenchController {
1048
1339
  return (0, redaction_1.redactTraceText)(value).split(this.workspaceValue).join('<workspace>');
1049
1340
  }
1050
1341
  async updateSettings(input) {
1342
+ this.assertContextGuard(input);
1051
1343
  this.assertSettingsAvailable();
1052
1344
  const update = this.runtimeValue.updateSettings;
1053
1345
  if (!update) {
@@ -1098,10 +1390,23 @@ class WebWorkbenchController {
1098
1390
  if (this.mutationResults.size >= MAX_MUTATION_RESULTS) {
1099
1391
  throw new errors_1.WebWorkbenchError(503, 'The mutation idempotency ledger is full; restart the local Web Host before retrying.', 'mutation_capacity_exhausted');
1100
1392
  }
1101
- const result = Promise.resolve().then(() => {
1102
- this.assertMutationAdmission();
1103
- return action();
1104
- });
1393
+ const contextTransition = CONTEXT_TRANSITION_MUTATIONS.has(operation);
1394
+ let result;
1395
+ try {
1396
+ this.reserveMutation(contextTransition);
1397
+ result = Promise.resolve()
1398
+ .then(() => {
1399
+ this.assertMutationAdmission();
1400
+ return action();
1401
+ })
1402
+ .finally(() => this.releaseMutation(contextTransition));
1403
+ }
1404
+ catch (error) {
1405
+ // Mutation admission is part of the idempotent result contract. Cache a
1406
+ // rejected Promise just like failures raised by the action so a retry of
1407
+ // the same requestId cannot observe a different outcome.
1408
+ result = Promise.reject(error);
1409
+ }
1105
1410
  this.mutationResults.set(requestId, { fingerprint, result });
1106
1411
  return result;
1107
1412
  }
@@ -1134,9 +1439,18 @@ class WebWorkbenchController {
1134
1439
  mcp: { servers: mcpServerIds(mcp) },
1135
1440
  harness,
1136
1441
  eventStream: this.eventHub.snapshot(),
1442
+ workspaceKernel: this.runtimeValue.workspaceRuntimeKernel?.diagnostics() ?? null,
1443
+ session: {
1444
+ ...this.sessionActivity,
1445
+ actors: this.sessionRegistry.stats(),
1446
+ },
1137
1447
  performance: {
1138
1448
  files: this.fileService.performanceCounters(),
1139
1449
  git: this.gitService.performanceCounters(),
1450
+ thread: {
1451
+ eventStore: (0, thread_event_store_1.threadEventStorePerformanceCountersV1)(),
1452
+ sessionIndex: (0, thread_session_index_1.threadSessionIndexPerformanceCountersV1)(),
1453
+ },
1140
1454
  },
1141
1455
  };
1142
1456
  if (context)
@@ -1144,18 +1458,273 @@ class WebWorkbenchController {
1144
1458
  return result;
1145
1459
  }
1146
1460
  async shutdown() {
1147
- if (this.closed)
1148
- return;
1461
+ if (this.shutdownResult)
1462
+ return this.shutdownResult;
1149
1463
  this.closed = true;
1150
- await this.controllerValue.stopActiveTurn();
1151
- await this.controllerValue.waitForIdle();
1152
- this.closeWorkspaceWatchers();
1153
- this.closeComposerObserver();
1154
- await this.terminalManager.shutdown();
1155
- await this.runtimeValue.shutdown();
1156
- this.eventHub.close();
1464
+ this.shutdownResult = this.shutdownOwnedResources();
1465
+ return this.shutdownResult;
1466
+ }
1467
+ async shutdownOwnedResources() {
1468
+ const failures = [];
1469
+ this.sessionActivity.controlPlaneShutdowns += 1;
1470
+ this.workspaceMutations.close('Orion Web Workbench shutdown');
1471
+ try {
1472
+ await this.sessionRegistry.shutdown('Orion Web Workbench shutdown');
1473
+ }
1474
+ catch {
1475
+ // The registry retains failed actor handles. Retry once after every
1476
+ // actor received its first close attempt; a persistent failure remains
1477
+ // an explicit Host shutdown error rather than an orphan hidden as GO.
1478
+ try {
1479
+ await this.sessionRegistry.shutdown('Orion Web Workbench shutdown retry');
1480
+ }
1481
+ catch (retryError) {
1482
+ failures.push(retryError);
1483
+ }
1484
+ }
1485
+ await captureShutdownFailure(failures, () => this.controllerValue.stopActiveTurn());
1486
+ await captureShutdownFailure(failures, () => this.controllerValue.waitForIdle());
1487
+ try {
1488
+ this.closeWorkspaceWatchers();
1489
+ this.closeComposerObserver();
1490
+ }
1491
+ catch (error) {
1492
+ failures.push(error);
1493
+ }
1494
+ await captureShutdownFailure(failures, () => this.terminalManager.shutdown());
1495
+ await captureShutdownFailure(failures, () => this.runtimeValue.shutdown());
1496
+ try {
1497
+ this.eventHub.close();
1498
+ }
1499
+ catch (error) {
1500
+ failures.push(error);
1501
+ }
1502
+ this.workspaceMutationOwners.clear();
1503
+ this.pendingWorkspaceMutationStates.clear();
1504
+ this.releaseWorkspaceKernels();
1505
+ if (failures.length > 0) {
1506
+ throw new errors_1.WebWorkbenchError(503, `${failures.length} Web Workbench resource(s) could not be closed safely.`, 'workbench_shutdown_incomplete');
1507
+ }
1508
+ }
1509
+ /**
1510
+ * Return the workspace kernel for `cwd`, creating and pooling one on first
1511
+ * use. Control planes and Session actors borrow the same kernel instance per
1512
+ * canonical Workspace; the pool is released only when the Host shuts down.
1513
+ */
1514
+ workspaceKernelFor(cwd) {
1515
+ const canonical = canonicalDirectory(cwd);
1516
+ const existing = this.workspaceKernels.get(canonical);
1517
+ if (existing && !existing.diagnostics().closed)
1518
+ return existing;
1519
+ if (existing)
1520
+ this.workspaceKernels.delete(canonical);
1521
+ const kernel = (0, product_bootstrap_1.createWorkspaceRuntimeKernelV1)({
1522
+ cwd: canonical,
1523
+ onSettingsInvalidated: event => this.onWorkspaceKernelSettingsInvalidated(canonical, event),
1524
+ });
1525
+ this.workspaceKernels.set(canonical, kernel);
1526
+ return kernel;
1527
+ }
1528
+ /**
1529
+ * Settings invalidations from pooled kernels are only forwarded while their
1530
+ * Workspace is the active Context. A background Workspace's coordinator
1531
+ * keeps watching its own durable file; its next activation publishes a fresh
1532
+ * Settings document through `emitSettingsWorkspaceChange()`.
1533
+ */
1534
+ onWorkspaceKernelSettingsInvalidated(kernelWorkspace, event) {
1535
+ if (this.suppressContextEdges > 0)
1536
+ return;
1537
+ if (kernelWorkspace !== this.workspaceValue)
1538
+ return;
1539
+ this.eventHub.emit({
1540
+ type: 'settings_invalidated',
1541
+ revision: event.revision,
1542
+ reason: event.reason,
1543
+ state: event.state,
1544
+ }, false);
1545
+ }
1546
+ /**
1547
+ * Release the Host owner seat on every pooled kernel. Runtime shutdowns have
1548
+ * already disposed their Settings participants (actors first, then the
1549
+ * active control plane), so an unowned kernel with zero participants closes
1550
+ * its Settings coordinator here. A kernel that still has a running actor
1551
+ * participant survives until that actor actually terminates.
1552
+ */
1553
+ releaseWorkspaceKernels() {
1554
+ for (const kernel of this.workspaceKernels.values()) {
1555
+ kernel.releaseOwner();
1556
+ }
1557
+ this.workspaceKernels.clear();
1558
+ }
1559
+ createSessionRegistry() {
1560
+ return new session_runtime_registry_1.WebSessionRuntimeRegistryV1({
1561
+ maxRunningSessions: 3,
1562
+ maxResidentSessionActors: 4,
1563
+ createActor: key => this.createSessionActor(key),
1564
+ initializeActor: actor => actor.runtime.rebindSessionRuntime?.() ?? Promise.resolve(),
1565
+ closeActor: (actor, reason) => this.closeSessionActor(actor, reason),
1566
+ estimateActorBytes: actor => estimateSessionActorBytes(actor),
1567
+ onSummaryChanged: runtime => {
1568
+ if (this.closed || this.suppressContextEdges > 0)
1569
+ return;
1570
+ this.eventHub.emit({ type: 'session_runtime_changed', runtime }, true, {
1571
+ sessionId: runtime.sessionId,
1572
+ });
1573
+ },
1574
+ });
1575
+ }
1576
+ async createSessionActor(key) {
1577
+ const workspace = this.workspaceRegistry.find(key.workspaceId);
1578
+ if (!workspace) {
1579
+ throw new errors_1.WebWorkbenchError(404, 'Workspace was not found.', 'workspace_not_found');
1580
+ }
1581
+ const session = requireSession(key.sessionId);
1582
+ if (canonicalDirectory(session.projectPath) !== workspace.canonicalPath) {
1583
+ throw new errors_1.WebWorkbenchError(409, 'Session belongs to another Workspace.', 'session_workspace_conflict');
1584
+ }
1585
+ const runtime = await this.createSessionRuntime(workspace.canonicalPath);
1586
+ runtime.setSession(session);
1587
+ const actorRef = {};
1588
+ const eventSink = {
1589
+ emit: (event) => this.emitSessionActorRuntimeEvent(key, runtime, actorRef.current, event),
1590
+ };
1591
+ const controller = new agent_runtime_controller_1.AgentRuntimeController({
1592
+ runtime,
1593
+ eventSink,
1594
+ uiRenderer: 'web',
1595
+ echoSubmittedInput: false,
1596
+ useRuntimeToolPermissions: true,
1597
+ uiCapabilities: {
1598
+ structuredPickers: true,
1599
+ inlineProgress: true,
1600
+ suppressLegacyTokenMeta: true,
1601
+ extraAssistantSpacing: true,
1602
+ suppressAbortNotice: true,
1603
+ },
1604
+ });
1605
+ const actor = {
1606
+ key: Object.freeze({ ...key }),
1607
+ runtime,
1608
+ controller,
1609
+ composerRevision: (0, crypto_1.randomUUID)(),
1610
+ latestStatus: 'Ready',
1611
+ suppressComposerEdges: 0,
1612
+ };
1613
+ actorRef.current = actor;
1614
+ actor.composerStoreUnsubscribe = runtime.store.subscribe(() => this.scheduleActorComposerStateChanged(actor));
1615
+ actor.composerControlsUnsubscribe = runtime.sessionComposerControls?.subscribe(() => this.scheduleActorComposerStateChanged(actor));
1616
+ return actor;
1617
+ }
1618
+ async closeSessionActor(actor, _reason) {
1619
+ if (actor.composerChangeTimer)
1620
+ clearTimeout(actor.composerChangeTimer);
1621
+ actor.composerChangeTimer = undefined;
1622
+ actor.composerStoreUnsubscribe?.();
1623
+ actor.composerControlsUnsubscribe?.();
1624
+ actor.composerStoreUnsubscribe = undefined;
1625
+ actor.composerControlsUnsubscribe = undefined;
1626
+ await actor.controller.stopActiveTurn();
1627
+ await actor.controller.waitForIdle();
1628
+ await actor.runtime.shutdown();
1629
+ this.activeOrionRuntimes.delete(actor.key.sessionId);
1630
+ for (const [invocationId, owner] of this.workspaceMutationOwners) {
1631
+ if (owner.sessionId === actor.key.sessionId && owner.workspaceId === actor.key.workspaceId) {
1632
+ this.workspaceMutationOwners.delete(invocationId);
1633
+ this.pendingWorkspaceMutationStates.delete(invocationId);
1634
+ }
1635
+ }
1636
+ }
1637
+ emitSessionActorRuntimeEvent(key, runtime, actor, event) {
1638
+ if (event.type === 'status_changed' && actor)
1639
+ actor.latestStatus = event.message;
1640
+ if (event.type === 'followup_queue_changed') {
1641
+ if (actor && actor.suppressComposerEdges === 0) {
1642
+ this.publishActorComposerState(actor);
1643
+ }
1644
+ return undefined;
1645
+ }
1646
+ if (event.type === 'tool_started') {
1647
+ this.workspaceMutationOwners.set(event.event.callId, Object.freeze({ ...key }));
1648
+ }
1649
+ const thread = this.activeOrionRuntimes.get(key.sessionId)?.thread.getProjection().threadId;
1650
+ const envelope = this.eventHub.emitRuntime(event, {
1651
+ sessionId: key.sessionId,
1652
+ ...(thread ? { threadId: thread } : {}),
1653
+ });
1654
+ if (event.type === 'tool_started') {
1655
+ const pendingMutation = this.pendingWorkspaceMutationStates.get(event.event.callId);
1656
+ if (pendingMutation) {
1657
+ this.pendingWorkspaceMutationStates.delete(event.event.callId);
1658
+ this.emitWorkspaceMutationState(pendingMutation);
1659
+ }
1660
+ }
1661
+ if (event.type === 'permission_requested' && actor) {
1662
+ this.sessionRegistry.setPendingApprovalCount(key, actor.controller.getPendingPermissions().length);
1663
+ }
1664
+ if (event.type === 'tool_finished' && key.workspaceId === this.activeWorkspaceEntry().id) {
1665
+ this.scheduleWorkspaceResourceInvalidation('tool-finished');
1666
+ }
1667
+ if (event.type === 'tool_finished') {
1668
+ this.workspaceMutationOwners.delete(event.event.callId);
1669
+ this.pendingWorkspaceMutationStates.delete(event.event.callId);
1670
+ }
1671
+ return event.type === 'transcript_append' ? `web-entry-${envelope.cursor}` : undefined;
1672
+ }
1673
+ emitWorkspaceMutationState(state) {
1674
+ if (this.closed || this.suppressContextEdges > 0)
1675
+ return;
1676
+ const owner = this.workspaceMutationOwners.get(state.invocationId);
1677
+ if (!owner) {
1678
+ if (state.phase === 'queued' || state.phase === 'running') {
1679
+ this.pendingWorkspaceMutationStates.set(state.invocationId, Object.freeze({ ...state }));
1680
+ }
1681
+ else {
1682
+ this.pendingWorkspaceMutationStates.delete(state.invocationId);
1683
+ }
1684
+ return;
1685
+ }
1686
+ this.eventHub.emit({
1687
+ type: 'workspace_mutation_changed',
1688
+ state: {
1689
+ callId: state.invocationId,
1690
+ phase: state.phase,
1691
+ ...(state.queuePosition === undefined ? {} : { queuePosition: state.queuePosition }),
1692
+ },
1693
+ }, false, { sessionId: owner.sessionId });
1694
+ if (['completed', 'failed', 'cancelled'].includes(state.phase)) {
1695
+ this.workspaceMutationOwners.delete(state.invocationId);
1696
+ this.pendingWorkspaceMutationStates.delete(state.invocationId);
1697
+ }
1698
+ }
1699
+ scheduleActorComposerStateChanged(actor) {
1700
+ if (this.closed || actor.suppressComposerEdges > 0)
1701
+ return;
1702
+ if (actor.composerChangeTimer)
1703
+ clearTimeout(actor.composerChangeTimer);
1704
+ actor.composerChangeTimer = setTimeout(() => {
1705
+ actor.composerChangeTimer = undefined;
1706
+ if (this.closed || actor.suppressComposerEdges > 0)
1707
+ return;
1708
+ this.publishActorComposerState(actor);
1709
+ }, 100);
1710
+ actor.composerChangeTimer.unref();
1711
+ }
1712
+ publishActorComposerState(actor) {
1713
+ try {
1714
+ const state = this.projectActorComposerState(actor, requireSession(actor.key.sessionId));
1715
+ this.eventHub.emit({ type: 'composer_state_changed', state }, true, {
1716
+ sessionId: actor.key.sessionId,
1717
+ });
1718
+ }
1719
+ catch {
1720
+ // A concurrent actor teardown publishes its final Runtime summary.
1721
+ }
1157
1722
  }
1158
1723
  async installRuntime(workspace, publishState = true) {
1724
+ // Every control-plane install reloads the Workspace catalog, provider
1725
+ // wiring, Skills and MCP adapters, so this counter proxies "catalog
1726
+ // reload" for the runtime-ownership diagnostics matrix.
1727
+ this.sessionActivity.controlPlaneInstalls += 1;
1159
1728
  this.closeComposerObserver();
1160
1729
  const runtime = await this.createRuntime(workspace);
1161
1730
  this.closeWorkspaceWatchers();
@@ -1240,7 +1809,7 @@ class WebWorkbenchController {
1240
1809
  const sessionId = this.runtimeValue.getSession()?.id ?? null;
1241
1810
  if (sessionId) {
1242
1811
  try {
1243
- this.composerAuthorityDigest = composerAuthorityDigest(this.projectComposerStateValue(requireSession(sessionId), true));
1812
+ this.composerAuthorityDigest = composerAuthorityDigest(this.projectComposerStateValue(requireSession(sessionId)));
1244
1813
  }
1245
1814
  catch {
1246
1815
  this.composerAuthorityDigest = undefined;
@@ -1398,6 +1967,7 @@ class WebWorkbenchController {
1398
1967
  this.rememberSessionView(sessionId, activation.view);
1399
1968
  }
1400
1969
  this.activeOrionRuntime = { runtime, sessionId };
1970
+ this.activeOrionRuntimes.set(sessionId, runtime);
1401
1971
  }
1402
1972
  catch (error) {
1403
1973
  unsubscribe();
@@ -1407,6 +1977,9 @@ class WebWorkbenchController {
1407
1977
  unsubscribe();
1408
1978
  if (this.activeOrionRuntime?.runtime === runtime)
1409
1979
  this.activeOrionRuntime = undefined;
1980
+ if (this.activeOrionRuntimes.get(sessionId) === runtime) {
1981
+ this.activeOrionRuntimes.delete(sessionId);
1982
+ }
1410
1983
  };
1411
1984
  }
1412
1985
  loadSessionView(session, activeProjection) {
@@ -1455,20 +2028,44 @@ class WebWorkbenchController {
1455
2028
  assertReadyForTransition(operation) {
1456
2029
  if (this.closed)
1457
2030
  throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.');
1458
- if (this.transition || this.sessionTransition) {
2031
+ if (this.transition || this.activeMutationCount > 0) {
1459
2032
  throw new errors_1.WebWorkbenchError(409, 'A workspace transition is running.', 'runtime_busy');
1460
2033
  }
1461
2034
  if (this.controllerValue.hasActiveTurn()) {
1462
2035
  throw new errors_1.WebWorkbenchError(409, `Cannot ${operation} while a turn is active.`, 'runtime_busy');
1463
2036
  }
2037
+ // P1-A: Session actors are scoped to their own Workspace and survive a
2038
+ // Context switch (WEB35-P0-08/09), so an active actor in a non-target
2039
+ // Workspace must not block switching the active control plane.
1464
2040
  }
1465
2041
  assertMutationAdmission() {
1466
2042
  if (this.closed)
1467
2043
  throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.');
1468
- if (this.transition || this.sessionTransition) {
2044
+ if (this.transition) {
1469
2045
  throw new errors_1.WebWorkbenchError(409, 'A Context transition is running.', 'runtime_busy');
1470
2046
  }
1471
2047
  }
2048
+ reserveMutation(contextTransition) {
2049
+ this.assertMutationAdmission();
2050
+ if (contextTransition) {
2051
+ if (this.contextTransitionReserved || this.activeMutationCount > 0) {
2052
+ throw new errors_1.WebWorkbenchError(409, 'Another mutation is still running.', 'runtime_busy');
2053
+ }
2054
+ this.contextTransitionReserved = true;
2055
+ return;
2056
+ }
2057
+ if (this.contextTransitionReserved) {
2058
+ throw new errors_1.WebWorkbenchError(409, 'A Context transition is being admitted.', 'runtime_busy');
2059
+ }
2060
+ this.activeMutationCount += 1;
2061
+ }
2062
+ releaseMutation(contextTransition) {
2063
+ if (contextTransition) {
2064
+ this.contextTransitionReserved = false;
2065
+ return;
2066
+ }
2067
+ this.activeMutationCount = Math.max(0, this.activeMutationCount - 1);
2068
+ }
1472
2069
  assertContextGuard(context) {
1473
2070
  this.assertMutationAdmission();
1474
2071
  if (context.expectedContextRevision !== this.contextRevisionValue ||
@@ -1479,13 +2076,25 @@ class WebWorkbenchController {
1479
2076
  assertCommandSession(expectedSessionId) {
1480
2077
  if (this.closed)
1481
2078
  throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.');
1482
- if (this.transition || this.sessionTransition) {
2079
+ if (this.transition) {
1483
2080
  throw new errors_1.WebWorkbenchError(409, 'A Session transition is running.', 'runtime_busy');
1484
2081
  }
1485
2082
  if (this.runtimeValue.getSession()?.id !== expectedSessionId) {
1486
2083
  throw new errors_1.WebWorkbenchError(409, 'The active Session changed before the command was admitted.', 'active_session_changed');
1487
2084
  }
1488
2085
  }
2086
+ assertSessionWorkspace(session) {
2087
+ if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
2088
+ throw new errors_1.WebWorkbenchError(409, 'Session belongs to another Workspace.', 'session_workspace_conflict');
2089
+ }
2090
+ }
2091
+ sessionActorKey(session) {
2092
+ this.assertSessionWorkspace(session);
2093
+ return Object.freeze({
2094
+ workspaceId: this.activeWorkspaceEntry().id,
2095
+ sessionId: session.id,
2096
+ });
2097
+ }
1489
2098
  assertSettingsAvailable() {
1490
2099
  if (this.closed) {
1491
2100
  throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.', 'settings_document_unavailable');
@@ -1532,6 +2141,14 @@ function mapWorkspaceRegistryError(error) {
1532
2141
  }
1533
2142
  return new errors_1.WebWorkbenchError(503, 'Workspace registry is unavailable.');
1534
2143
  }
2144
+ function mapSessionRuntimeError(error) {
2145
+ if (error instanceof errors_1.WebWorkbenchError)
2146
+ return error;
2147
+ if (error instanceof session_runtime_registry_1.WebSessionRuntimeRegistryError) {
2148
+ return new errors_1.WebWorkbenchError(error.status, error.message, error.code);
2149
+ }
2150
+ throw error;
2151
+ }
1535
2152
  function mapSettingsError(error) {
1536
2153
  if (error instanceof errors_1.WebWorkbenchError)
1537
2154
  return error;
@@ -1743,6 +2360,22 @@ function decodePageCursor(cursor) {
1743
2360
  throw new errors_1.WebWorkbenchError(400, 'Page cursor is invalid.');
1744
2361
  }
1745
2362
  }
2363
+ function estimateSessionActorBytes(actor) {
2364
+ try {
2365
+ return Math.max(256 * 1024, Buffer.byteLength(JSON.stringify(actor.runtime.store.getSnapshot()), 'utf8'));
2366
+ }
2367
+ catch {
2368
+ return 256 * 1024;
2369
+ }
2370
+ }
2371
+ async function captureShutdownFailure(failures, operation) {
2372
+ try {
2373
+ await operation();
2374
+ }
2375
+ catch (error) {
2376
+ failures.push(error);
2377
+ }
2378
+ }
1746
2379
  function canonicalDirectory(path) {
1747
2380
  const candidate = (0, path_1.resolve)(path);
1748
2381
  let canonical;