@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
@@ -0,0 +1,471 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebSessionRuntimeRegistryError = exports.WebSessionRuntimeRegistryV1 = void 0;
4
+ const crypto_1 = require("crypto");
5
+ const DEFAULT_MAX_RUNNING_SESSIONS = 3;
6
+ const DEFAULT_MAX_RESIDENT_SESSION_ACTORS = 4;
7
+ /**
8
+ * Bounded Web-only Session actor pool.
9
+ *
10
+ * It owns concurrency admission and actor lifetime, but deliberately knows
11
+ * nothing about React, HTTP, OrionRuntime, or TUI semantics. Callers provide a
12
+ * Session-scoped actor and a logical-turn terminal promise. This keeps Web
13
+ * parallelism out of the single-session CLI/TUI runner.
14
+ */
15
+ class WebSessionRuntimeRegistryV1 {
16
+ constructor(options) {
17
+ this.options = options;
18
+ this.records = new Map();
19
+ this.queue = [];
20
+ this.capacityQueue = Promise.resolve();
21
+ this.ordinal = 0;
22
+ this.runningCountValue = 0;
23
+ this.closed = false;
24
+ // Host-level actor pool counters. Allocations are the authoritative signal
25
+ // for "pure selection must not start a Session Runtime" diagnostics: an E2E
26
+ // reads these before/after a switch and asserts a zero delta.
27
+ this.actorsCreatedCount = 0;
28
+ this.actorsClosedCount = 0;
29
+ this.actorsEvictedCount = 0;
30
+ this.maxRunningSessions = boundedInteger(options.maxRunningSessions, DEFAULT_MAX_RUNNING_SESSIONS, 1, 8, 'maxRunningSessions');
31
+ this.maxResidentSessionActors = boundedInteger(options.maxResidentSessionActors, DEFAULT_MAX_RESIDENT_SESSION_ACTORS, 1, 8, 'maxResidentSessionActors');
32
+ if (this.maxResidentSessionActors < this.maxRunningSessions) {
33
+ throw new Error('maxResidentSessionActors must be greater than or equal to maxRunningSessions.');
34
+ }
35
+ this.now = options.now ?? Date.now;
36
+ this.createRevision = options.createRevision ?? crypto_1.randomUUID;
37
+ }
38
+ get runningCount() {
39
+ return this.runningCountValue;
40
+ }
41
+ get residentCount() {
42
+ let count = 0;
43
+ for (const record of this.records.values())
44
+ if (record.actor !== undefined)
45
+ count += 1;
46
+ return count;
47
+ }
48
+ /**
49
+ * Cumulative actor pool counters since the registry was created. E2E and
50
+ * diagnostics compare two reads to prove a pure Session selection allocated
51
+ * no Session actor (actorsCreated delta 0) and performed no capacity
52
+ * eviction (actorsEvicted delta 0) while the pool keeps actors alive.
53
+ */
54
+ stats() {
55
+ return {
56
+ actorsCreated: this.actorsCreatedCount,
57
+ actorsClosed: this.actorsClosedCount,
58
+ actorsEvicted: this.actorsEvictedCount,
59
+ };
60
+ }
61
+ summary(key) {
62
+ return this.snapshot(this.record(key));
63
+ }
64
+ summaries() {
65
+ return Object.freeze([...this.records.values()]
66
+ .sort((left, right) => right.lastUsedOrdinal - left.lastUsedOrdinal)
67
+ .map(record => this.snapshot(record)));
68
+ }
69
+ /**
70
+ * Return the current resident actor without starting a cold Session.
71
+ *
72
+ * Snapshot/read paths use this to project live state while preserving the
73
+ * cold-read invariant: merely selecting or inspecting a Session must not
74
+ * allocate a Runtime or consume a running slot.
75
+ */
76
+ residentActor(key) {
77
+ this.assertOpen();
78
+ const record = this.record(key);
79
+ if (!record.actor || !record.actorReady)
80
+ return undefined;
81
+ this.touch(record);
82
+ return Object.freeze({ actor: record.actor, runtime: this.snapshot(record) });
83
+ }
84
+ async ensureResident(key, expectedRuntimeRevision) {
85
+ return this.withCapacityLock(async () => {
86
+ this.assertOpen();
87
+ const record = this.record(key);
88
+ this.assertRevision(record, expectedRuntimeRevision);
89
+ const actor = await this.ensureResidentLocked(record);
90
+ return Object.freeze({ actor, runtime: this.snapshot(record) });
91
+ });
92
+ }
93
+ async withActor(key, expectedRuntimeRevision, action) {
94
+ return this.withCapacityLock(async () => {
95
+ this.assertOpen();
96
+ const record = this.record(key);
97
+ this.assertRevision(record, expectedRuntimeRevision);
98
+ const actor = await this.ensureResidentLocked(record);
99
+ const result = await action(actor);
100
+ this.touch(record);
101
+ return Object.freeze({ result, runtime: this.snapshot(record) });
102
+ });
103
+ }
104
+ async admitTurn(input) {
105
+ return this.withCapacityLock(async () => {
106
+ this.assertOpen();
107
+ const record = this.record(input.key);
108
+ this.assertRevision(record, input.expectedRuntimeRevision);
109
+ if (record.activeRun || record.queueId) {
110
+ throw new WebSessionRuntimeRegistryError(409, 'session_turn_already_active', 'The Session already has a running or queued logical turn.');
111
+ }
112
+ const actor = await this.ensureResidentLocked(record);
113
+ if (this.runningCountValue >= this.maxRunningSessions) {
114
+ const queueId = this.createRevision();
115
+ record.queueId = queueId;
116
+ this.queue.push({
117
+ queueId,
118
+ record,
119
+ start: input.start,
120
+ });
121
+ record.queuePosition = this.queue.length;
122
+ this.transition(record, 'queued');
123
+ this.publishQueuePositions();
124
+ const runtime = this.snapshot(record);
125
+ return Object.freeze({
126
+ status: 'queued',
127
+ queueId,
128
+ queuePosition: runtime.queuePosition,
129
+ runtime,
130
+ });
131
+ }
132
+ const started = await this.startTurn(record, actor, input.start);
133
+ return Object.freeze({
134
+ status: 'started',
135
+ accepted: started.accepted,
136
+ runtime: started.runtime,
137
+ });
138
+ });
139
+ }
140
+ cancelQueued(key, queueId, expectedRuntimeRevision) {
141
+ this.assertOpen();
142
+ const record = this.record(key);
143
+ this.assertRevision(record, expectedRuntimeRevision);
144
+ if (!record.queueId || record.queueId !== queueId) {
145
+ throw new WebSessionRuntimeRegistryError(409, 'session_queue_conflict', 'The queued turn no longer matches this Session.');
146
+ }
147
+ const index = this.queue.findIndex(item => item.queueId === queueId && item.record === record);
148
+ if (index < 0) {
149
+ throw new WebSessionRuntimeRegistryError(409, 'session_queue_conflict', 'The queued turn is no longer pending.');
150
+ }
151
+ this.queue.splice(index, 1);
152
+ record.queueId = undefined;
153
+ record.queuePosition = undefined;
154
+ this.transition(record, 'idle');
155
+ this.publishQueuePositions();
156
+ return this.snapshot(record);
157
+ }
158
+ setPendingApprovalCount(key, count) {
159
+ this.assertOpen();
160
+ const record = this.record(key);
161
+ if (!Number.isSafeInteger(count) || count < 0) {
162
+ throw new Error('pending approval count must be a non-negative integer.');
163
+ }
164
+ const normalized = count;
165
+ if (record.pendingApprovalCount === normalized)
166
+ return this.snapshot(record);
167
+ record.pendingApprovalCount = normalized;
168
+ if (record.activeRun)
169
+ this.transition(record, normalized > 0 ? 'waiting_approval' : 'running');
170
+ else
171
+ this.bump(record);
172
+ return this.snapshot(record);
173
+ }
174
+ async evict(key, reason = 'session actor evicted') {
175
+ this.assertOpen();
176
+ const record = this.record(key);
177
+ await this.withCapacityLock(async () => {
178
+ if (!record.actor)
179
+ return;
180
+ if (!this.isEvictable(record)) {
181
+ throw new WebSessionRuntimeRegistryError(409, 'session_actor_busy', 'Running, queued, approval-waiting, or stopping actors cannot be evicted.');
182
+ }
183
+ await this.closeResidentLocked(record, reason, 'cold');
184
+ });
185
+ }
186
+ async shutdown(reason = 'Web Session registry shutdown') {
187
+ this.closed = true;
188
+ const queued = this.queue.splice(0);
189
+ for (const item of queued) {
190
+ item.record.queueId = undefined;
191
+ item.record.queuePosition = undefined;
192
+ this.transition(item.record, 'interrupted');
193
+ }
194
+ const cleanupErrors = [];
195
+ await this.withCapacityLock(async () => {
196
+ const residents = [...this.records.values()].filter(record => record.actor !== undefined);
197
+ await Promise.all(residents.map(async (record) => {
198
+ const actor = record.actor;
199
+ if (!actor)
200
+ return;
201
+ const wasActive = record.activeRun;
202
+ if (wasActive)
203
+ this.runningCountValue = Math.max(0, this.runningCountValue - 1);
204
+ record.activeRun = false;
205
+ record.pendingApprovalCount = 0;
206
+ record.actorReady = false;
207
+ this.transition(record, 'stopping');
208
+ try {
209
+ await this.options.closeActor(actor, reason);
210
+ record.actor = undefined;
211
+ record.estimatedBytes = 0;
212
+ this.actorsClosedCount += 1;
213
+ this.transition(record, wasActive ? 'interrupted' : 'cold');
214
+ }
215
+ catch (error) {
216
+ record.failure = error;
217
+ this.transition(record, 'failed');
218
+ cleanupErrors.push(error);
219
+ }
220
+ }));
221
+ });
222
+ if (cleanupErrors.length > 0) {
223
+ throw new WebSessionRuntimeRegistryError(503, 'session_actor_cleanup_failed', `${cleanupErrors.length} Session actor(s) could not be closed safely.`);
224
+ }
225
+ }
226
+ record(key) {
227
+ const normalized = normalizeKey(key);
228
+ const id = keyId(normalized);
229
+ let record = this.records.get(id);
230
+ if (!record) {
231
+ const now = this.now();
232
+ record = {
233
+ key: normalized,
234
+ phase: 'cold',
235
+ runtimeRevision: this.createRevision(),
236
+ pendingApprovalCount: 0,
237
+ estimatedBytes: 0,
238
+ updatedAtMs: now,
239
+ lastUsedOrdinal: ++this.ordinal,
240
+ activeRun: false,
241
+ actorReady: false,
242
+ };
243
+ this.records.set(id, record);
244
+ this.publish(record);
245
+ }
246
+ return record;
247
+ }
248
+ async ensureResidentLocked(record) {
249
+ if (record.actor && record.actorReady) {
250
+ this.touch(record);
251
+ return record.actor;
252
+ }
253
+ if (record.actor) {
254
+ await this.closeResidentLocked(record, 'retry quarantined Session actor cleanup', 'cold');
255
+ }
256
+ await this.makeCapacityLocked(record);
257
+ this.transition(record, 'starting');
258
+ let actor;
259
+ try {
260
+ actor = await this.options.createActor(record.key);
261
+ await this.options.initializeActor?.(actor, record.key);
262
+ if (this.closed) {
263
+ throw new WebSessionRuntimeRegistryError(503, 'session_registry_closed', 'The Web Session registry is closed.');
264
+ }
265
+ record.estimatedBytes = normalizeBytes(this.options.estimateActorBytes?.(actor));
266
+ record.actor = actor;
267
+ record.actorReady = true;
268
+ actor = undefined;
269
+ record.failure = undefined;
270
+ this.actorsCreatedCount += 1;
271
+ this.transition(record, 'idle');
272
+ return record.actor;
273
+ }
274
+ catch (error) {
275
+ if (actor) {
276
+ try {
277
+ await this.options.closeActor(actor, 'Session actor start failed');
278
+ }
279
+ catch (cleanupError) {
280
+ // Preserve the only handle to the partially initialized actor. It is
281
+ // never returned by residentActor/ensureResident and still counts
282
+ // against the resident budget until a later eviction or shutdown
283
+ // successfully closes it.
284
+ record.actor = actor;
285
+ record.actorReady = false;
286
+ record.estimatedBytes = 0;
287
+ record.failure = cleanupError;
288
+ this.transition(record, 'failed');
289
+ throw new WebSessionRuntimeRegistryError(503, 'session_actor_cleanup_failed', 'A failed Session actor could not be closed safely.');
290
+ }
291
+ }
292
+ record.actor = undefined;
293
+ record.actorReady = false;
294
+ record.estimatedBytes = 0;
295
+ record.failure = error;
296
+ this.transition(record, 'failed');
297
+ throw error;
298
+ }
299
+ }
300
+ async makeCapacityLocked(target) {
301
+ if (this.residentCount < this.maxResidentSessionActors)
302
+ return;
303
+ const candidate = [...this.records.values()]
304
+ .filter(record => record !== target && record.actor && this.isEvictable(record))
305
+ .sort((left, right) => left.lastUsedOrdinal - right.lastUsedOrdinal)[0];
306
+ if (!candidate) {
307
+ throw new WebSessionRuntimeRegistryError(503, 'session_concurrency_limit', 'All resident Session actors are busy; the requested Session remains available read-only.');
308
+ }
309
+ await this.closeResidentLocked(candidate, 'idle Session actor evicted by LRU', 'cold');
310
+ this.actorsEvictedCount += 1;
311
+ }
312
+ isEvictable(record) {
313
+ return (Boolean(record.actor) &&
314
+ !record.activeRun &&
315
+ !record.queueId &&
316
+ record.pendingApprovalCount === 0 &&
317
+ ['idle', 'failed', 'interrupted'].includes(record.phase));
318
+ }
319
+ async closeResidentLocked(record, reason, terminalPhase) {
320
+ const actor = record.actor;
321
+ if (!actor)
322
+ return;
323
+ record.actorReady = false;
324
+ this.transition(record, 'stopping');
325
+ try {
326
+ await this.options.closeActor(actor, reason);
327
+ record.actor = undefined;
328
+ record.estimatedBytes = 0;
329
+ this.actorsClosedCount += 1;
330
+ this.transition(record, terminalPhase);
331
+ }
332
+ catch (error) {
333
+ record.failure = error;
334
+ this.transition(record, 'failed');
335
+ throw error;
336
+ }
337
+ }
338
+ async startTurn(record, actor, start) {
339
+ record.activeRun = true;
340
+ record.queueId = undefined;
341
+ record.pendingApprovalCount = 0;
342
+ this.runningCountValue += 1;
343
+ this.transition(record, 'running');
344
+ try {
345
+ const started = await start(actor);
346
+ void Promise.resolve(started.settled).then(() => this.finishTurn(record), error => this.finishTurn(record, error));
347
+ return Object.freeze({ accepted: started.accepted, runtime: this.snapshot(record) });
348
+ }
349
+ catch (error) {
350
+ this.finishTurn(record, error);
351
+ throw error;
352
+ }
353
+ }
354
+ finishTurn(record, error) {
355
+ if (!record.activeRun)
356
+ return;
357
+ record.activeRun = false;
358
+ record.pendingApprovalCount = 0;
359
+ this.runningCountValue = Math.max(0, this.runningCountValue - 1);
360
+ if (error) {
361
+ record.failure = error;
362
+ this.transition(record, 'failed');
363
+ }
364
+ else {
365
+ record.failure = undefined;
366
+ this.transition(record, 'idle');
367
+ }
368
+ this.drainQueue();
369
+ }
370
+ drainQueue() {
371
+ while (!this.closed && this.runningCountValue < this.maxRunningSessions && this.queue.length) {
372
+ const item = this.queue.shift();
373
+ item.record.queueId = undefined;
374
+ item.record.queuePosition = undefined;
375
+ const actor = item.record.actor;
376
+ if (!actor) {
377
+ item.record.failure = new Error('Queued Session actor is no longer resident.');
378
+ this.transition(item.record, 'failed');
379
+ continue;
380
+ }
381
+ void this.startTurn(item.record, actor, item.start).catch(() => undefined);
382
+ }
383
+ this.publishQueuePositions();
384
+ }
385
+ publishQueuePositions() {
386
+ for (const [index, item] of this.queue.entries()) {
387
+ const queuePosition = index + 1;
388
+ if (item.record.queuePosition === queuePosition)
389
+ continue;
390
+ item.record.queuePosition = queuePosition;
391
+ this.bump(item.record);
392
+ }
393
+ }
394
+ snapshot(record) {
395
+ return Object.freeze({
396
+ ...record.key,
397
+ runtimeRevision: record.runtimeRevision,
398
+ phase: record.phase,
399
+ ...(record.queueId ? { queueId: record.queueId } : {}),
400
+ ...(record.queueId && record.queuePosition ? { queuePosition: record.queuePosition } : {}),
401
+ pendingApprovalCount: record.pendingApprovalCount,
402
+ resident: record.actor !== undefined,
403
+ estimatedBytes: record.estimatedBytes,
404
+ updatedAt: new Date(record.updatedAtMs).toISOString(),
405
+ });
406
+ }
407
+ assertRevision(record, expectedRuntimeRevision) {
408
+ if (expectedRuntimeRevision === undefined)
409
+ return;
410
+ if (expectedRuntimeRevision !== record.runtimeRevision) {
411
+ throw new WebSessionRuntimeRegistryError(409, 'session_runtime_revision_conflict', 'The Session Runtime changed before the operation was admitted.');
412
+ }
413
+ }
414
+ transition(record, phase) {
415
+ record.phase = phase;
416
+ this.bump(record);
417
+ }
418
+ touch(record) {
419
+ record.lastUsedOrdinal = ++this.ordinal;
420
+ record.updatedAtMs = this.now();
421
+ }
422
+ bump(record) {
423
+ record.runtimeRevision = this.createRevision();
424
+ this.touch(record);
425
+ this.publish(record);
426
+ }
427
+ publish(record) {
428
+ this.options.onSummaryChanged?.(this.snapshot(record));
429
+ }
430
+ withCapacityLock(operation) {
431
+ const result = this.capacityQueue.then(operation, operation);
432
+ this.capacityQueue = result.then(() => undefined, () => undefined);
433
+ return result;
434
+ }
435
+ assertOpen() {
436
+ if (this.closed) {
437
+ throw new WebSessionRuntimeRegistryError(503, 'session_registry_closed', 'The Web Session registry is closed.');
438
+ }
439
+ }
440
+ }
441
+ exports.WebSessionRuntimeRegistryV1 = WebSessionRuntimeRegistryV1;
442
+ class WebSessionRuntimeRegistryError extends Error {
443
+ constructor(status, code, message) {
444
+ super(message);
445
+ this.status = status;
446
+ this.code = code;
447
+ this.name = 'WebSessionRuntimeRegistryError';
448
+ }
449
+ }
450
+ exports.WebSessionRuntimeRegistryError = WebSessionRuntimeRegistryError;
451
+ function normalizeKey(key) {
452
+ const workspaceId = key.workspaceId.trim();
453
+ const sessionId = key.sessionId.trim();
454
+ if (!workspaceId || !sessionId)
455
+ throw new Error('Session actor identity must not be empty.');
456
+ return Object.freeze({ workspaceId, sessionId });
457
+ }
458
+ function keyId(key) {
459
+ return `${key.workspaceId}\u0000${key.sessionId}`;
460
+ }
461
+ function normalizeBytes(value) {
462
+ return Number.isSafeInteger(value) && value > 0 ? value : 0;
463
+ }
464
+ function boundedInteger(value, fallback, minimum, maximum, name) {
465
+ const candidate = value ?? fallback;
466
+ if (!Number.isSafeInteger(candidate) || candidate < minimum || candidate > maximum) {
467
+ throw new Error(`${name} must be an integer between ${minimum} and ${maximum}.`);
468
+ }
469
+ return candidate;
470
+ }
471
+ //# sourceMappingURL=session-runtime-registry.js.map
@@ -361,7 +361,7 @@ class TerminalManagerV1 {
361
361
  entry.outputFlushTimer.unref();
362
362
  }
363
363
  }
364
- flushPendingOutput(entry, force) {
364
+ flushPendingOutput(entry, force, final = false) {
365
365
  let emitted = false;
366
366
  while (entry.pendingOutput.length > 0 &&
367
367
  (force || entry.pendingOutput.length >= MAX_OUTPUT_FRAME_CHARS)) {
@@ -372,14 +372,14 @@ class TerminalManagerV1 {
372
372
  isLowSurrogate(entry.pendingOutput.charCodeAt(end))) {
373
373
  end -= 1;
374
374
  }
375
- if (!force &&
375
+ if (!final &&
376
376
  end === entry.pendingOutput.length &&
377
377
  isHighSurrogate(entry.pendingOutput.charCodeAt(end - 1))) {
378
378
  break;
379
379
  }
380
380
  if (end <= 0)
381
381
  break;
382
- const value = entry.pendingOutput.slice(0, end);
382
+ const value = replaceUnpairedSurrogates(entry.pendingOutput.slice(0, end));
383
383
  entry.pendingOutput = entry.pendingOutput.slice(end);
384
384
  const frame = Object.freeze({
385
385
  sequence: entry.nextSequence++,
@@ -405,7 +405,7 @@ class TerminalManagerV1 {
405
405
  handleExit(entry, event) {
406
406
  if (this.terminals.get(entry.id) !== entry)
407
407
  return;
408
- this.flushPendingOutput(entry, true);
408
+ this.flushPendingOutput(entry, true, true);
409
409
  entry.state = 'exited';
410
410
  entry.exitCode = event.exitCode;
411
411
  entry.signal = event.signal;
@@ -610,6 +610,25 @@ function isHighSurrogate(value) {
610
610
  function isLowSurrogate(value) {
611
611
  return value >= 0xdc00 && value <= 0xdfff;
612
612
  }
613
+ function replaceUnpairedSurrogates(value) {
614
+ let normalized = '';
615
+ for (let index = 0; index < value.length; index += 1) {
616
+ const current = value.charCodeAt(index);
617
+ if (isHighSurrogate(current)) {
618
+ const next = value.charCodeAt(index + 1);
619
+ if (isLowSurrogate(next)) {
620
+ normalized += value[index] + value[index + 1];
621
+ index += 1;
622
+ }
623
+ else {
624
+ normalized += '\ufffd';
625
+ }
626
+ continue;
627
+ }
628
+ normalized += isLowSurrogate(current) ? '\ufffd' : value[index];
629
+ }
630
+ return normalized;
631
+ }
613
632
  function terminateProcessTree(entry) {
614
633
  signalProcessTree(entry, 'SIGTERM');
615
634
  }
@@ -67,6 +67,8 @@ function ownTerminalSocket(webSocket, terminalId, manager) {
67
67
  let connection;
68
68
  let backpressurePaused = false;
69
69
  let replayPaused = false;
70
+ const replayTail = [];
71
+ let replayExit;
70
72
  let drainTimer;
71
73
  let replayTimer;
72
74
  const timer = setTimeout(() => webSocket.close(4401, 'Authentication timeout'), AUTH_TIMEOUT_MS);
@@ -134,12 +136,33 @@ function ownTerminalSocket(webSocket, terminalId, manager) {
134
136
  checkBackpressure();
135
137
  return true;
136
138
  };
139
+ const sendExit = (event) => {
140
+ if (!send(event, () => webSocket.close(1000, 'Terminal exited'))) {
141
+ webSocket.close(1000, 'Terminal exited');
142
+ }
143
+ };
144
+ const drainReplayTail = () => {
145
+ if (webSocket.readyState !== ws_1.WebSocket.OPEN)
146
+ return;
147
+ const next = replayTail.shift();
148
+ if (next !== undefined) {
149
+ send(next, drainReplayTail);
150
+ return;
151
+ }
152
+ if (replayExit !== undefined) {
153
+ const exit = replayExit;
154
+ replayExit = undefined;
155
+ sendExit(exit);
156
+ return;
157
+ }
158
+ replayPaused = false;
159
+ applyFlowControl();
160
+ };
137
161
  const sendReplay = (values, index = 0) => {
138
162
  if (webSocket.readyState !== ws_1.WebSocket.OPEN)
139
163
  return;
140
164
  if (index >= values.length) {
141
- replayPaused = false;
142
- applyFlowControl();
165
+ drainReplayTail();
143
166
  return;
144
167
  }
145
168
  if (webSocket.bufferedAmount >= PAUSE_WS_BUFFERED_BYTES) {
@@ -183,11 +206,17 @@ function ownTerminalSocket(webSocket, terminalId, manager) {
183
206
  terminalId,
184
207
  ticket: auth.ticket,
185
208
  afterSequence: auth.afterSequence,
186
- onFrame: frame => send(frame),
209
+ onFrame: frame => {
210
+ if (replayPaused)
211
+ replayTail.push(frame);
212
+ else
213
+ send(frame);
214
+ },
187
215
  onExit: event => {
188
- if (!send(event, () => webSocket.close(1000, 'Terminal exited'))) {
189
- webSocket.close(1000, 'Terminal exited');
190
- }
216
+ if (replayPaused)
217
+ replayExit = event;
218
+ else
219
+ sendExit(event);
191
220
  },
192
221
  onReplaced: () => webSocket.close(4409, 'Terminal connection replaced'),
193
222
  });