@orion-agents/orion-code 0.3.66 → 0.4.3

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 (370) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +78 -361
  3. package/README.zh-CN.md +71 -262
  4. package/bin/orion +4 -1
  5. package/dist/acp/session-updates.d.ts +34 -0
  6. package/dist/acp/session-updates.js +162 -0
  7. package/dist/acp/sessions.d.ts +32 -0
  8. package/dist/acp/sessions.js +315 -0
  9. package/dist/acp/stdio.d.ts +3 -0
  10. package/dist/acp/stdio.js +59 -0
  11. package/dist/cli.js +136 -185
  12. package/dist/commands/context-tool-command-handlers.d.ts +1 -1
  13. package/dist/commands/context-tool-command-handlers.js +24 -3
  14. package/dist/commands/core-command-handlers.js +5 -1
  15. package/dist/commands/diagnostic-command-handlers.js +20 -6
  16. package/dist/commands/diagnostic-commands.js +0 -12
  17. package/dist/commands/init-command.d.ts +3 -0
  18. package/dist/commands/init-command.js +131 -0
  19. package/dist/commands/model-command-handlers.d.ts +1 -2
  20. package/dist/commands/model-command-handlers.js +15 -100
  21. package/dist/commands/model-commands.js +0 -11
  22. package/dist/commands/registry.js +0 -18
  23. package/dist/commands/rsi-command.d.ts +2 -0
  24. package/dist/commands/rsi-command.js +180 -0
  25. package/dist/commands/session-command-handlers.js +28 -19
  26. package/dist/commands/system-commands.js +0 -1
  27. package/dist/commands/tool-commands.js +1 -1
  28. package/dist/commands/types.d.ts +4 -10
  29. package/dist/commands/types.js +1 -21
  30. package/dist/commands/workflow-command-handlers.js +13 -4
  31. package/dist/framework/loop-budget-contract.d.ts +7 -2
  32. package/dist/framework/loop-budget-contract.js +4 -1
  33. package/dist/framework/loop-progress.d.ts +22 -0
  34. package/dist/framework/loop-progress.js +79 -0
  35. package/dist/framework/prompt.d.ts +0 -2
  36. package/dist/framework/prompt.js +9 -27
  37. package/dist/framework/query.d.ts +27 -20
  38. package/dist/framework/query.js +453 -153
  39. package/dist/framework/store.d.ts +6 -10
  40. package/dist/framework/store.js +2 -21
  41. package/dist/framework/tool-call-orchestrator.d.ts +7 -0
  42. package/dist/framework/tool-call-orchestrator.js +8 -3
  43. package/dist/framework/tool-state.d.ts +2 -0
  44. package/dist/framework/tool.d.ts +0 -23
  45. package/dist/framework/verification-command.d.ts +15 -0
  46. package/dist/framework/verification-command.js +32 -0
  47. package/dist/harness/assembler.d.ts +1 -0
  48. package/dist/harness/assembler.js +24 -0
  49. package/dist/harness/capsule.d.ts +1 -1
  50. package/dist/harness/capsule.js +33 -14
  51. package/dist/harness/context-harness.d.ts +31 -12
  52. package/dist/harness/context-harness.js +491 -35
  53. package/dist/harness/contract.js +1 -1
  54. package/dist/harness/drift-guard.d.ts +4 -0
  55. package/dist/harness/drift-guard.js +68 -16
  56. package/dist/harness/intent.js +21 -0
  57. package/dist/harness/ledger.d.ts +6 -11
  58. package/dist/harness/ledger.js +39 -9
  59. package/dist/harness/progress-controller.d.ts +12 -7
  60. package/dist/harness/progress-controller.js +66 -21
  61. package/dist/harness/state.js +9 -1
  62. package/dist/harness/task-checklist.d.ts +16 -0
  63. package/dist/harness/task-checklist.js +95 -0
  64. package/dist/harness/types.d.ts +73 -1
  65. package/dist/harness/verification.d.ts +19 -1
  66. package/dist/harness/verification.js +116 -29
  67. package/dist/index.d.ts +1 -1
  68. package/dist/index.js +1 -3
  69. package/dist/print-ui/event-stream.d.ts +38 -0
  70. package/dist/print-ui/event-stream.js +187 -0
  71. package/dist/print-ui/launch.d.ts +12 -1
  72. package/dist/print-ui/launch.js +173 -11
  73. package/dist/product/environment.d.ts +1 -1
  74. package/dist/product/environment.js +1 -1
  75. package/dist/product/identity.d.ts +1 -1
  76. package/dist/product/identity.js +1 -1
  77. package/dist/product/paths.d.ts +3 -2
  78. package/dist/product/paths.js +6 -2
  79. package/dist/runtime/agent-loop.d.ts +11 -2
  80. package/dist/runtime/agent-loop.js +165 -25
  81. package/dist/runtime/agent-runtime-controller.d.ts +13 -3
  82. package/dist/runtime/agent-runtime-controller.js +347 -183
  83. package/dist/runtime/agent-runtime-protocol.d.ts +10 -18
  84. package/dist/runtime/agent-runtime-runner.d.ts +10 -0
  85. package/dist/runtime/builtin-tool-provider.js +5 -1
  86. package/dist/runtime/capability-receipt-journal.js +1 -0
  87. package/dist/runtime/durable-tool-receipt-reader.js +2 -1
  88. package/dist/runtime/first-party-tool-services.d.ts +1 -0
  89. package/dist/runtime/first-party-tool-services.js +2 -12
  90. package/dist/runtime/first-party-tool-universe.d.ts +1 -0
  91. package/dist/runtime/first-party-tool-universe.js +1 -1
  92. package/dist/runtime/followup-queue-store.d.ts +16 -0
  93. package/dist/runtime/followup-queue-store.js +75 -0
  94. package/dist/runtime/goal-lifecycle-v2.d.ts +11 -1
  95. package/dist/runtime/goal-lifecycle-v2.js +85 -15
  96. package/dist/runtime/goal-runtime-coordinator.d.ts +10 -1
  97. package/dist/runtime/goal-runtime-coordinator.js +81 -24
  98. package/dist/runtime/loop-budget.js +7 -5
  99. package/dist/runtime/mcp/first-party-mcp-adapter.d.ts +2 -0
  100. package/dist/runtime/mcp/first-party-mcp-adapter.js +23 -19
  101. package/dist/runtime/model-coordinator.js +2 -5
  102. package/dist/runtime/orion-runtime-v1.d.ts +18 -2
  103. package/dist/runtime/orion-runtime-v1.js +135 -39
  104. package/dist/runtime/orion-session-runner.d.ts +7 -0
  105. package/dist/runtime/orion-session-runner.js +82 -0
  106. package/dist/runtime/plan-review.d.ts +1 -0
  107. package/dist/runtime/plan-review.js +8 -4
  108. package/dist/runtime/product-bootstrap.d.ts +6 -0
  109. package/dist/runtime/product-bootstrap.js +41 -51
  110. package/dist/runtime/product-orion-runtime.js +128 -52
  111. package/dist/runtime/release-receipts.d.ts +24 -133
  112. package/dist/runtime/release-receipts.js +129 -693
  113. package/dist/runtime/rich-text/layout.js +108 -65
  114. package/dist/runtime/rsi/contracts.d.ts +50 -0
  115. package/dist/runtime/rsi/contracts.js +17 -0
  116. package/dist/runtime/rsi/diagnosis.d.ts +46 -0
  117. package/dist/runtime/rsi/diagnosis.js +98 -0
  118. package/dist/runtime/rsi/evaluation-suite.d.ts +25 -0
  119. package/dist/runtime/rsi/evaluation-suite.js +141 -0
  120. package/dist/runtime/rsi/evaluation-worker.d.ts +19 -0
  121. package/dist/runtime/rsi/evaluation-worker.js +64 -0
  122. package/dist/runtime/rsi/evaluation.d.ts +49 -0
  123. package/dist/runtime/rsi/evaluation.js +351 -0
  124. package/dist/runtime/rsi/lifecycle.d.ts +54 -0
  125. package/dist/runtime/rsi/lifecycle.js +279 -0
  126. package/dist/runtime/rsi/proposal.d.ts +39 -0
  127. package/dist/runtime/rsi/proposal.js +312 -0
  128. package/dist/runtime/rsi/receipt.d.ts +28 -0
  129. package/dist/runtime/rsi/receipt.js +138 -0
  130. package/dist/runtime/rsi/skill-state.d.ts +7 -0
  131. package/dist/runtime/rsi/skill-state.js +50 -0
  132. package/dist/runtime/rsi/trajectory.d.ts +19 -0
  133. package/dist/runtime/rsi/trajectory.js +314 -0
  134. package/dist/runtime/rsi/triage.d.ts +274 -0
  135. package/dist/runtime/rsi/triage.js +58 -0
  136. package/dist/runtime/session-composer-control.d.ts +5 -24
  137. package/dist/runtime/session-composer-control.js +27 -189
  138. package/dist/runtime/step-snapshot.d.ts +1 -0
  139. package/dist/runtime/subagents/policy.js +0 -1
  140. package/dist/runtime/subagents/production.js +1 -1
  141. package/dist/runtime/subagents/runtime-integration.js +2 -4
  142. package/dist/runtime/subagents/types.d.ts +0 -5
  143. package/dist/runtime/subagents/types.js +0 -2
  144. package/dist/runtime/task-context-recovery.d.ts +55 -0
  145. package/dist/runtime/task-context-recovery.js +342 -0
  146. package/dist/runtime/task-context-service.d.ts +16 -10
  147. package/dist/runtime/task-context-service.js +35 -4
  148. package/dist/runtime/thread-admission.d.ts +1 -1
  149. package/dist/runtime/thread-admission.js +12 -6
  150. package/dist/runtime/thread-event-store.d.ts +2 -2
  151. package/dist/runtime/thread-event-store.js +7 -2
  152. package/dist/runtime/thread-projection.js +4 -2
  153. package/dist/runtime/thread-runtime.d.ts +7 -0
  154. package/dist/runtime/thread-runtime.js +43 -0
  155. package/dist/runtime/thread-session-index.d.ts +8 -0
  156. package/dist/runtime/thread-session-index.js +50 -1
  157. package/dist/runtime/thread-session-view.d.ts +2 -1
  158. package/dist/runtime/thread-session-view.js +4 -0
  159. package/dist/runtime/thread-tool-journal.d.ts +1 -0
  160. package/dist/runtime/thread-tool-journal.js +6 -2
  161. package/dist/runtime/thread-ui-adapter.d.ts +1 -0
  162. package/dist/runtime/thread-ui-adapter.js +88 -11
  163. package/dist/runtime/tool-gateway.d.ts +7 -0
  164. package/dist/runtime/tool-gateway.js +20 -0
  165. package/dist/runtime/tool-transcript-entry.d.ts +16 -0
  166. package/dist/runtime/tool-transcript-entry.js +73 -0
  167. package/dist/runtime/turn-commit.d.ts +4 -1
  168. package/dist/runtime/turn-commit.js +19 -15
  169. package/dist/runtime/ui-events.d.ts +12 -0
  170. package/dist/runtime/ui-view-model.d.ts +6 -5
  171. package/dist/runtime/ui-view-model.js +33 -19
  172. package/dist/runtime/workspace-runtime-kernel.js +0 -1
  173. package/dist/services/atomic-write.d.ts +2 -0
  174. package/dist/services/atomic-write.js +12 -1
  175. package/dist/services/code-review/format.d.ts +4 -1
  176. package/dist/services/code-review/format.js +5 -1
  177. package/dist/services/code-review/runner.d.ts +2 -2
  178. package/dist/services/code-review/runner.js +86 -64
  179. package/dist/services/code-review/snapshot.d.ts +9 -9
  180. package/dist/services/code-review/snapshot.js +182 -166
  181. package/dist/services/compact/auto-compact.d.ts +21 -6
  182. package/dist/services/compact/auto-compact.js +148 -22
  183. package/dist/services/compact/background-candidate.d.ts +33 -0
  184. package/dist/services/compact/background-candidate.js +184 -0
  185. package/dist/services/compact/compact.d.ts +4 -1
  186. package/dist/services/compact/compact.js +30 -3
  187. package/dist/services/compact/coordinator.d.ts +10 -4
  188. package/dist/services/compact/coordinator.js +17 -7
  189. package/dist/services/compact/summary-generator.d.ts +4 -2
  190. package/dist/services/compact/summary-generator.js +17 -3
  191. package/dist/services/config.d.ts +5 -5
  192. package/dist/services/config.js +30 -45
  193. package/dist/services/doctor.js +85 -13
  194. package/dist/services/effort.d.ts +5 -5
  195. package/dist/services/effort.js +5 -11
  196. package/dist/services/file-lock.d.ts +9 -3
  197. package/dist/services/file-lock.js +92 -26
  198. package/dist/services/global-config.d.ts +26 -56
  199. package/dist/services/global-config.js +213 -183
  200. package/dist/services/llm.d.ts +40 -4
  201. package/dist/services/llm.js +164 -45
  202. package/dist/services/model-client-pool.d.ts +15 -9
  203. package/dist/services/model-client-pool.js +62 -33
  204. package/dist/services/model-context.d.ts +2 -1
  205. package/dist/services/model-context.js +15 -9
  206. package/dist/services/model-registry.d.ts +4 -15
  207. package/dist/services/model-registry.js +32 -101
  208. package/dist/services/provider-diagnostics.d.ts +7 -0
  209. package/dist/services/provider-diagnostics.js +9 -10
  210. package/dist/services/provider-resilience/coordinator.d.ts +1 -1
  211. package/dist/services/provider-resilience/coordinator.js +10 -6
  212. package/dist/services/provider-resilience/request-gate.d.ts +3 -0
  213. package/dist/services/provider-resilience/request-gate.js +29 -18
  214. package/dist/services/provider-resilience/types.d.ts +2 -0
  215. package/dist/services/session-storage.d.ts +7 -10
  216. package/dist/services/session-storage.js +57 -30
  217. package/dist/services/settings-coordinator.d.ts +0 -6
  218. package/dist/services/settings-coordinator.js +19 -56
  219. package/dist/services/settings-document-repository.d.ts +3 -10
  220. package/dist/services/settings-document-repository.js +7 -85
  221. package/dist/services/usage-state.d.ts +3 -3
  222. package/dist/services/usage-state.js +11 -42
  223. package/dist/terminal-ui/answer-format.d.ts +14 -0
  224. package/dist/terminal-ui/answer-format.js +119 -0
  225. package/dist/terminal-ui/launch.d.ts +7 -6
  226. package/dist/terminal-ui/launch.js +160 -70
  227. package/dist/terminal-ui/output-queue.d.ts +2 -1
  228. package/dist/terminal-ui/output-queue.js +1 -1
  229. package/dist/terminal-ui/raw-editor.d.ts +2 -1
  230. package/dist/terminal-ui/raw-editor.js +56 -15
  231. package/dist/tools/core/edit-file.js +2 -0
  232. package/dist/tools/core/write-file.js +5 -0
  233. package/dist/tools/lsp.d.ts +16 -1
  234. package/dist/tools/lsp.js +60 -19
  235. package/dist/tools/sandbox.d.ts +1 -1
  236. package/dist/tools/sandbox.js +3 -16
  237. package/dist/tools/todo.d.ts +4 -2
  238. package/dist/tools/todo.js +76 -31
  239. package/dist/tui-core/input-parser.d.ts +1 -0
  240. package/dist/tui-core/input-parser.js +6 -0
  241. package/dist/tui-core/style.d.ts +1 -8
  242. package/dist/tui-core/style.js +3 -110
  243. package/dist/tui-ui/chrome-view-model.d.ts +1 -1
  244. package/dist/tui-ui/chrome-view-model.js +22 -27
  245. package/dist/tui-ui/launch.js +14 -14
  246. package/dist/tui-ui/layout.d.ts +5 -7
  247. package/dist/tui-ui/layout.js +129 -124
  248. package/dist/tui-ui/runner.d.ts +11 -12
  249. package/dist/tui-ui/runner.js +88 -67
  250. package/dist/tui-ui/state.d.ts +0 -11
  251. package/dist/tui-ui/state.js +22 -33
  252. package/dist/tui-ui/terminal-image.js +22 -4
  253. package/dist/tui-ui/transcript-inspector-layout.js +6 -3
  254. package/dist/tui-ui/transcript-inspector.d.ts +1 -0
  255. package/dist/tui-ui/transcript-inspector.js +7 -1
  256. package/dist/tui-ui/transcript-layout.js +42 -6
  257. package/dist/utils/terminal-text.d.ts +11 -0
  258. package/dist/utils/terminal-text.js +114 -0
  259. package/docs/cli-guide.md +562 -0
  260. package/docs/orion.example.yaml +42 -0
  261. package/docs/readme.md +12 -57
  262. package/npm-shrinkwrap.json +484 -1855
  263. package/package.json +13 -63
  264. package/dist/migration/command.d.ts +0 -9
  265. package/dist/migration/command.js +0 -100
  266. package/dist/migration/index.d.ts +0 -7
  267. package/dist/migration/index.js +0 -14
  268. package/dist/migration/migrate.d.ts +0 -19
  269. package/dist/migration/migrate.js +0 -406
  270. package/dist/migration/types.d.ts +0 -55
  271. package/dist/migration/types.js +0 -6
  272. package/dist/services/tool-allowlist.d.ts +0 -110
  273. package/dist/services/tool-allowlist.js +0 -299
  274. package/dist/services/yaml-config.d.ts +0 -57
  275. package/dist/services/yaml-config.js +0 -178
  276. package/dist/web/cli-options.d.ts +0 -17
  277. package/dist/web/cli-options.js +0 -51
  278. package/dist/web/code-review-run-service.d.ts +0 -68
  279. package/dist/web/code-review-run-service.js +0 -228
  280. package/dist/web/context-text.d.ts +0 -17
  281. package/dist/web/context-text.js +0 -40
  282. package/dist/web/errors.d.ts +0 -6
  283. package/dist/web/errors.js +0 -13
  284. package/dist/web/event-hub.d.ts +0 -45
  285. package/dist/web/event-hub.js +0 -370
  286. package/dist/web/file-read-service.d.ts +0 -101
  287. package/dist/web/file-read-service.js +0 -593
  288. package/dist/web/file-write-service.d.ts +0 -16
  289. package/dist/web/file-write-service.js +0 -103
  290. package/dist/web/git-compare-service.d.ts +0 -45
  291. package/dist/web/git-compare-service.js +0 -160
  292. package/dist/web/git-diff-document.d.ts +0 -102
  293. package/dist/web/git-diff-document.js +0 -258
  294. package/dist/web/git-file-source.d.ts +0 -25
  295. package/dist/web/git-file-source.js +0 -21
  296. package/dist/web/git-history-service.d.ts +0 -151
  297. package/dist/web/git-history-service.js +0 -619
  298. package/dist/web/git-index-transaction.d.ts +0 -45
  299. package/dist/web/git-index-transaction.js +0 -174
  300. package/dist/web/git-patch-builder.d.ts +0 -30
  301. package/dist/web/git-patch-builder.js +0 -138
  302. package/dist/web/git-read-model-service.d.ts +0 -452
  303. package/dist/web/git-read-model-service.js +0 -1833
  304. package/dist/web/git-version-service.d.ts +0 -79
  305. package/dist/web/git-version-service.js +0 -279
  306. package/dist/web/host-daemon.d.ts +0 -70
  307. package/dist/web/host-daemon.js +0 -237
  308. package/dist/web/index.d.ts +0 -6
  309. package/dist/web/index.js +0 -28
  310. package/dist/web/launch.d.ts +0 -12
  311. package/dist/web/launch.js +0 -89
  312. package/dist/web/native-directory-picker.d.ts +0 -63
  313. package/dist/web/native-directory-picker.js +0 -169
  314. package/dist/web/protocol.d.ts +0 -705
  315. package/dist/web/protocol.js +0 -639
  316. package/dist/web/review-service.d.ts +0 -22
  317. package/dist/web/review-service.js +0 -68
  318. package/dist/web/server.d.ts +0 -20
  319. package/dist/web/server.js +0 -1453
  320. package/dist/web/session-runtime-registry.d.ts +0 -138
  321. package/dist/web/session-runtime-registry.js +0 -471
  322. package/dist/web/terminal-manager.d.ts +0 -156
  323. package/dist/web/terminal-manager.js +0 -779
  324. package/dist/web/terminal-server.d.ts +0 -8
  325. package/dist/web/terminal-server.js +0 -304
  326. package/dist/web/workbench-controller.d.ts +0 -395
  327. package/dist/web/workbench-controller.js +0 -3077
  328. package/dist/web/workspace-discovery.d.ts +0 -92
  329. package/dist/web/workspace-discovery.js +0 -324
  330. package/dist/web/workspace-mutation-arbiter.d.ts +0 -54
  331. package/dist/web/workspace-mutation-arbiter.js +0 -267
  332. package/dist/web/workspace-open-telemetry.d.ts +0 -55
  333. package/dist/web/workspace-open-telemetry.js +0 -73
  334. package/dist/web-client/assets/FilesPanel-CPDovK_K.js +0 -1
  335. package/dist/web-client/assets/GitPanel-DtU_TD61.js +0 -4
  336. package/dist/web-client/assets/ReviewPanel-vMO7BEA3.js +0 -6
  337. package/dist/web-client/assets/TerminalPanel-C9vDTAlS.js +0 -23
  338. package/dist/web-client/assets/TerminalPanel-DLuoa74B.css +0 -1
  339. package/dist/web-client/assets/index-CABdwh4l.css +0 -1
  340. package/dist/web-client/assets/index-KvshfEbl.js +0 -20
  341. package/dist/web-client/assets/useAutoNotice-IE1g2wcb.js +0 -1
  342. package/dist/web-client/favicon.svg +0 -9
  343. package/dist/web-client/index.html +0 -17
  344. package/docs/architecture/agent-mode-permission-contract.md +0 -87
  345. package/docs/architecture/v0.3.0-web-api.yaml +0 -1340
  346. package/docs/architecture/v0.3.1-web-api.yaml +0 -2338
  347. package/docs/architecture/v0.3.2-web-api.yaml +0 -3029
  348. package/docs/architecture/v0.3.3-web-api.yaml +0 -3205
  349. package/docs/architecture/v0.3.4-stabilization-contract.md +0 -32
  350. package/docs/migration/v0.1.9-to-v0.2.0.md +0 -98
  351. package/docs/migration/v0.2.2-to-v0.3.0-settings.md +0 -114
  352. package/docs/migration/v0.2.2-to-v0.3.0.md +0 -55
  353. package/docs/migration/v0.3.0-to-v0.3.1.md +0 -88
  354. package/docs/migration/v0.3.1-to-v0.3.2.md +0 -94
  355. package/docs/migration/v0.3.2-to-v0.3.3.md +0 -62
  356. package/docs/migration/v0.3.3-to-v0.3.4.md +0 -36
  357. package/docs/orion.example.json +0 -86
  358. package/docs/plan/v0.2.0-dsh-harness-redesign-plan.md +0 -1234
  359. package/docs/plan/v0.2.0-release-checklist.md +0 -91
  360. package/docs/plan/v0.3.0-node-runtime-compatibility-plan.md +0 -57
  361. package/docs/plan/v0.3.0-settings-integration-plan.md +0 -740
  362. package/docs/plan/v0.3.0-web-workbench-plan.md +0 -376
  363. package/docs/plan/v0.3.1-web-workbench-professional-shell-plan.md +0 -848
  364. package/docs/plan/v0.3.2-web-workbench-layout-and-composer-plan.md +0 -869
  365. package/docs/plan/v0.3.3-plan.md +0 -1113
  366. package/docs/plan/v0.3.4-stabilization-plan.md +0 -89
  367. package/docs/test/v0.3.1-web-workbench-e2e-plan.md +0 -140
  368. package/docs/test/v0.3.2-web-workbench-e2e-plan.md +0 -100
  369. package/docs/test/v0.3.3-web-workbench-e2e-plan.md +0 -79
  370. package/docs/test/v0.3.4-stabilization-e2e-plan.md +0 -54
@@ -1,10 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GoalRuntimeCoordinatorV2 = void 0;
3
+ exports.GoalRuntimeCoordinatorV2 = exports.DEFAULT_GOAL_RUNTIME_BUDGET_V2 = void 0;
4
4
  exports.readGoalRuntimePersistenceV2 = readGoalRuntimePersistenceV2;
5
+ exports.recoverInterruptedGoalState = recoverInterruptedGoalState;
5
6
  const stop_decision_1 = require("../framework/stop-decision");
7
+ const verification_1 = require("../harness/verification");
6
8
  const goal_lifecycle_v2_1 = require("./goal-lifecycle-v2");
7
9
  const canonical_1 = require("./protocol/canonical");
10
+ /** Total resource bounds for newly created Goals, independent of per-turn checkpoints. */
11
+ exports.DEFAULT_GOAL_RUNTIME_BUDGET_V2 = Object.freeze({
12
+ maxTokens: 1000000,
13
+ maxElapsedMs: 2 * 60 * 60 * 1000,
14
+ });
8
15
  /** Validate and expose the Goal fact owned by an authoritative TurnCommit. */
9
16
  function readGoalRuntimePersistenceV2(commit) {
10
17
  return deepFreeze(structuredClone(parseGoalPersistence(commit)));
@@ -20,11 +27,14 @@ class GoalRuntimeCoordinatorV2 {
20
27
  constructor(options = {}) {
21
28
  this.serviceId = 'goal-runtime-v2';
22
29
  this.turnStartedAt = new Map();
30
+ this.turnEvidenceAtStart = new Map();
23
31
  this.pendingContinuations = new Map();
24
32
  this.restoredContinuationAvailable = false;
25
33
  this.closed = false;
26
34
  this.clock = options.clock ?? Date.now;
27
35
  this.continuationInput = options.continuationInput ?? defaultContinuationInput;
36
+ this.continuation = options.continuation ?? 'agent';
37
+ this.defaultBudget = options.defaultBudget ?? exports.DEFAULT_GOAL_RUNTIME_BUDGET_V2;
28
38
  const restored = parseGoalPersistence(options.restoredCommit);
29
39
  this.tombstoneValue = restored.tombstone;
30
40
  const definition = restored.state
@@ -88,7 +98,7 @@ class GoalRuntimeCoordinatorV2 {
88
98
  }
89
99
  candidate = createLifecycle({
90
100
  objective,
91
- budget: control.budget ?? defaultGoalBudget(),
101
+ budget: control.budget ?? this.defaultBudget,
92
102
  }, this.clock);
93
103
  tombstone = undefined;
94
104
  scheduleContinuation = true;
@@ -120,8 +130,12 @@ class GoalRuntimeCoordinatorV2 {
120
130
  candidate.resume();
121
131
  else if (current.status !== 'active')
122
132
  accepted = false;
133
+ if (candidate.state.status !== 'active')
134
+ accepted = false;
123
135
  scheduleContinuation = accepted && candidate.state.status === 'active';
124
- message = accepted ? 'Goal resumed.' : `Goal cannot resume from ${current.status}.`;
136
+ message = accepted
137
+ ? 'Goal resumed.'
138
+ : `Goal cannot resume from ${current.status}; inspect its persisted budget and stop reason. An exhausted budget requires clearing and explicitly creating a new Goal with an appropriate total budget.`;
125
139
  break;
126
140
  }
127
141
  case 'clear': {
@@ -167,12 +181,13 @@ class GoalRuntimeCoordinatorV2 {
167
181
  this.restoredContinuationAvailable = false;
168
182
  return this.lifecycle.resume();
169
183
  }
170
- markTurnStarted(turnId, startedAt = this.clock()) {
184
+ markTurnStarted(turnId, startedAt = this.clock(), existingEvidenceRefs = []) {
171
185
  if (this.closed || !this.lifecycle)
172
186
  return;
173
187
  if (!Number.isSafeInteger(startedAt) || startedAt < 0)
174
188
  return;
175
189
  this.turnStartedAt.set(turnId, startedAt);
190
+ this.turnEvidenceAtStart.set(turnId, new Set(existingEvidenceRefs));
176
191
  }
177
192
  /**
178
193
  * Finalize Goal state and persist it with transcript/TaskContext in one TurnCommit.
@@ -217,6 +232,7 @@ class GoalRuntimeCoordinatorV2 {
217
232
  });
218
233
  this.tombstoneValue = undefined;
219
234
  this.turnStartedAt.delete(turn.turnId);
235
+ this.turnEvidenceAtStart.delete(turn.turnId);
220
236
  this.restoredContinuationAvailable = false;
221
237
  this.pendingContinuations.delete(turn.turnId);
222
238
  if (resolution.scheduleContinuation && receipt.terminal === 'completed') {
@@ -247,6 +263,7 @@ class GoalRuntimeCoordinatorV2 {
247
263
  this.closed = true;
248
264
  this.restoredContinuationAvailable = false;
249
265
  this.turnStartedAt.clear();
266
+ this.turnEvidenceAtStart.clear();
250
267
  this.pendingContinuations.clear();
251
268
  }
252
269
  controlStatus() {
@@ -281,11 +298,11 @@ class GoalRuntimeCoordinatorV2 {
281
298
  const failed = turn.queryComplete.stats?.finishReason === 'failed';
282
299
  const aborted = turn.queryComplete.stats?.finishReason === 'cancelled';
283
300
  const providerFailure = isProviderFailureDecision(requestDecision);
284
- // A provider stream cancelled by explicit user control commonly has no
285
- // terminal usage frame. That is an expected abort boundary, not corrupted
286
- // accounting. Every non-cancelled Goal turn still fails closed when usage
287
- // is absent, so autonomous work cannot continue on unknown cost.
288
- const accountingFailure = usage || aborted
301
+ // A checklist deferral can stop before the first provider request.
302
+ const taskPlanStoppedBeforeRequests = (0, goal_lifecycle_v2_1.isTaskPlanStopDecision)(requestDecision) &&
303
+ turn.queryComplete.stats?.llmRequests === 0 &&
304
+ subagentTokens === 0;
305
+ const accountingFailure = usage || aborted || (failed && providerFailure) || taskPlanStoppedBeforeRequests
289
306
  ? undefined
290
307
  : 'Goal usage accounting is unavailable; autonomous continuation is stopped fail-closed.';
291
308
  const runtimeFailure = failed && !providerFailure
@@ -296,6 +313,12 @@ class GoalRuntimeCoordinatorV2 {
296
313
  ...(requestDecision ? { requestDecision } : {}),
297
314
  ...(turn.taskContextCompletion ? { taskContextCompletion: turn.taskContextCompletion } : {}),
298
315
  madeProgress: madeProgress(turn),
316
+ continuationMode: this.continuation,
317
+ ...(turn.queryComplete.stats?.finishReason === 'budget_exceeded'
318
+ ? {
319
+ checkpoint: checkpointEvidence(turn, startedAt, now, this.lifecycle?.state, this.turnEvidenceAtStart.get(turn.turnId)),
320
+ }
321
+ : {}),
299
322
  ...(blocked ? { blocked } : {}),
300
323
  tokenDelta,
301
324
  elapsedMs: Math.max(0, now - startedAt),
@@ -346,8 +369,17 @@ function parseGoalPersistence(commit) {
346
369
  (0, goal_lifecycle_v2_1.assertGoalLifecycleStateV2)(state);
347
370
  return { state };
348
371
  }
372
+ /** Keep a crashed Goal's saved budget and require a deliberate resume. */
373
+ function recoverInterruptedGoalState(commit) {
374
+ const { state, tombstone } = parseGoalPersistence(commit);
375
+ return state?.status === 'active'
376
+ ? createLifecycleFromState(state, Date.now).pause('Goal turn was interrupted by a process restart.', 'runtime_restarted_before_terminal_commit')
377
+ : (state ?? tombstone);
378
+ }
349
379
  function requestDecisionForGoal(turn) {
350
380
  const current = turn.queryComplete.stats?.stopDecision;
381
+ if (current?.status === 'failed' && current.disposition === 'resume_allowed')
382
+ return current;
351
383
  const stats = turn.queryComplete.stats;
352
384
  const providerFailure = stats?.finishReason === 'failed' &&
353
385
  ((stats.providerRetryErrorTypes?.length ?? 0) > 0 || Boolean(stats.providerLastRetryErrorType));
@@ -379,13 +411,44 @@ function requestDecisionForGoal(turn) {
379
411
  });
380
412
  }
381
413
  function madeProgress(turn) {
382
- const completionDelta = turn.taskContextCompletion?.progressDelta;
383
- if (completionDelta)
384
- return completionDelta.changed;
385
- const stateDelta = turn.taskContextState.progressState?.lastDelta;
386
- if (stateDelta)
387
- return stateDelta.changed;
388
- return turn.queryComplete.stats?.lastToolSuccess === true;
414
+ const delta = turn.taskContextCompletion?.progressDelta ?? turn.taskContextState.progressState?.lastDelta;
415
+ if (!delta?.reason)
416
+ return delta?.changed ?? turn.queryComplete.stats?.lastToolSuccess === true;
417
+ return (delta.reason === 'workspace_change' ||
418
+ delta.reason === 'verification_change' ||
419
+ delta.reason === 'explicit_task_state');
420
+ }
421
+ function checkpointEvidence(turn, startedAt, now, previous, existingEvidenceRefs) {
422
+ const consumed = new Set(previous?.lastStopDecision?.evidenceRefs ?? []);
423
+ const verificationRefs = turn.taskContextState.ledger
424
+ .filter(entry => {
425
+ const metadata = entry.metadata;
426
+ return (entry.type === 'verification' &&
427
+ (0, verification_1.isFreshVerification)(entry, turn.taskContextState.workspaceRevision) &&
428
+ entry.ttl === 'task' &&
429
+ entry.source.kind === 'test' &&
430
+ entry.createdAt >= startedAt &&
431
+ entry.createdAt <= now &&
432
+ !consumed.has(entry.id) &&
433
+ !existingEvidenceRefs?.has(entry.id) &&
434
+ metadata?.success === true &&
435
+ metadata.resultTrust === 'structured' &&
436
+ metadata.exitCode === 0 &&
437
+ metadata.freshness === 'current_run' &&
438
+ typeof metadata.recordedAt === 'number' &&
439
+ metadata.recordedAt >= startedAt &&
440
+ metadata.recordedAt <= now);
441
+ })
442
+ .map(entry => entry.id);
443
+ return {
444
+ unfinishedPlan: turn.taskContextState.taskTodos?.some(todo => todo.status !== 'completed') === true ||
445
+ (turn.taskContextState.ledger.some(entry => entry.type === 'todo')
446
+ ? (turn.taskContextState.capsule?.currentPlan.some(step => step.status !== 'completed') ??
447
+ false)
448
+ : (turn.taskContextState.contract?.criteria?.some(criterion => criterion.status !== 'passed' &&
449
+ !(criterion.status === 'waived' && criterion.waiver?.authorizedBy === 'user')) ?? false)),
450
+ verificationRefs,
451
+ };
389
452
  }
390
453
  function isProviderFailureDecision(decision) {
391
454
  return Boolean(decision &&
@@ -437,12 +500,6 @@ function createLifecycleFromState(state, clock) {
437
500
  clock,
438
501
  });
439
502
  }
440
- function defaultGoalBudget() {
441
- return {
442
- maxTokens: Number.MAX_SAFE_INTEGER,
443
- maxElapsedMs: Number.MAX_SAFE_INTEGER,
444
- };
445
- }
446
503
  function createGoalTombstone(state, clearedAt) {
447
504
  const content = {
448
505
  version: 2,
@@ -495,8 +552,8 @@ function controlDecision(action, accepted, message) {
495
552
  function defaultContinuationInput(state) {
496
553
  const objective = state.objective.slice(0, 8192);
497
554
  return [
498
- 'Continue the active Goal autonomously from the latest durable TaskContext and receipts.',
499
- `Goal objective: ${objective}`,
555
+ 'Continue the active Goal using saved state and receipts.',
556
+ `Objective: ${objective}`,
500
557
  'Do not claim completion unless the TaskContext completion gate verifies every criterion.',
501
558
  ].join('\n');
502
559
  }
@@ -15,15 +15,16 @@ function toBaseProfile(value) {
15
15
  return value === 'complex' || value === 'release' ? value : 'default';
16
16
  }
17
17
  function applyConfigOverrides(budget, overrides) {
18
- const configured = overrides?.budget;
19
- if (!configured)
20
- return budget;
21
- const numericOverrides = Object.fromEntries(Object.entries(configured).filter(([, value]) => typeof value === 'number' && Number.isFinite(value) && value > 0));
18
+ const numericOverrides = Object.fromEntries(Object.entries(overrides?.budget ?? {}).filter(([, value]) => typeof value === 'number' && Number.isFinite(value) && value > 0));
19
+ const requestPolicy = overrides?.budgetPolicy === 'fixed' || numericOverrides.maxLlmRequestsPerUserTurn !== undefined
20
+ ? 'fixed'
21
+ : 'adaptive';
22
22
  if (Object.keys(numericOverrides).length === 0)
23
- return budget;
23
+ return { ...budget, requestPolicy };
24
24
  return {
25
25
  ...budget,
26
26
  ...numericOverrides,
27
+ requestPolicy,
27
28
  profile: 'config',
28
29
  baseProfile: budget.baseProfile ?? toBaseProfile(budget.profile),
29
30
  configOverride: true,
@@ -83,6 +84,7 @@ function resolveRuntimeLoopBudget(input, config, harnessState) {
83
84
  function capAutonomousGoalLoopBudget(budget) {
84
85
  return {
85
86
  ...budget,
87
+ requestPolicy: 'fixed',
86
88
  maxLlmRequestsPerUserTurn: Math.min(budget.maxLlmRequestsPerUserTurn, types_1.GOAL_INVARIANTS.maxAutonomousLlmRequestsPerTurn),
87
89
  maxToolCallsPerUserTurn: Math.min(budget.maxToolCallsPerUserTurn, types_1.GOAL_INVARIANTS.maxAutonomousToolCallsPerTurn),
88
90
  maxModelVisibleToolBytes: Math.min(budget.maxModelVisibleToolBytes, types_1.GOAL_INVARIANTS.maxAutonomousModelVisibleBytesPerTurn),
@@ -46,6 +46,8 @@ export interface FirstPartyMcpAdapterV1 {
46
46
  }
47
47
  export interface CreateFirstPartyMcpAdapterOptionsV1 {
48
48
  readonly config: FirstPartyMcpConfigurationV1;
49
+ /** Session-supplied server values are literal and never expand the host environment. */
50
+ readonly sessionServers?: Readonly<Record<string, FirstPartyMcpServerConfigV1>>;
49
51
  readonly baseDirectory?: string;
50
52
  readonly environment?: NodeJS.ProcessEnv;
51
53
  readonly stdioFactory?: FirstPartyMcpStdioFactoryV1;
@@ -71,16 +71,21 @@ function createFirstPartyMcpAdapterV1(options) {
71
71
  const baseDirectory = (0, path_1.resolve)(options.baseDirectory ?? process.cwd());
72
72
  const servers = selectServerEnvelope(options.config);
73
73
  const registry = new Map();
74
- for (const [rawId, rawConfig] of Object.entries(servers).sort(([left], [right]) => left.localeCompare(right))) {
75
- const serverId = requiredText(rawId, 'MCP server id');
76
- if (registry.has(serverId)) {
77
- throw new FirstPartyMcpAdapterError('ORION_MCP_DUPLICATE_SERVER', `MCP server ids collide after normalization: ${serverId}`);
74
+ const configuredIds = new Set(Object.keys(servers).map(id => id.trim()));
75
+ function registerServers(configs, literal) {
76
+ for (const [rawId, rawConfig] of Object.entries(configs).sort(([left], [right]) => left.localeCompare(right))) {
77
+ const serverId = requiredText(rawId, 'MCP server id');
78
+ if (registry.has(serverId) || (literal && configuredIds.has(serverId))) {
79
+ throw new FirstPartyMcpAdapterError('ORION_MCP_DUPLICATE_SERVER', `MCP server ids collide after normalization: ${serverId}`);
80
+ }
81
+ if (!isEnabled(rawConfig))
82
+ continue;
83
+ registry.set(serverId, normalizeServer(serverId, rawConfig, baseDirectory, environment, literal));
78
84
  }
79
- if (!isEnabled(rawConfig))
80
- continue;
81
- const normalized = normalizeServer(serverId, rawConfig, baseDirectory, environment);
82
- registry.set(serverId, normalized);
83
85
  }
86
+ registerServers(servers, false);
87
+ if (options.sessionServers)
88
+ registerServers(options.sessionServers, true);
84
89
  const stdioFactory = options.stdioFactory ??
85
90
  createNodeStdioMcpFactoryV1({
86
91
  environment,
@@ -340,24 +345,23 @@ function selectServerEnvelope(config) {
340
345
  function isEnabled(config) {
341
346
  return config.disabled !== true && config.enabled !== false;
342
347
  }
343
- function normalizeServer(serverId, config, baseDirectory, environment) {
348
+ function normalizeServer(serverId, config, baseDirectory, environment, literal) {
349
+ const valueFor = (value) => (literal ? value : expandText(value, environment));
350
+ const optionalValueFor = (value) => literal ? value : optionalExpandedText(value, environment);
344
351
  const transport = config.type ?? 'stdio';
345
352
  if (!isTransport(transport)) {
346
353
  throw new FirstPartyMcpAdapterError('ORION_MCP_INVALID_TRANSPORT', `MCP server ${serverId} has an invalid transport.`);
347
354
  }
348
- const command = optionalExpandedText(config.command, environment);
355
+ const command = optionalValueFor(config.command);
349
356
  if (transport === 'stdio' && !command) {
350
357
  throw new FirstPartyMcpAdapterError('ORION_MCP_MISSING_COMMAND', `MCP stdio server ${serverId} requires a command.`);
351
358
  }
352
- const args = Object.freeze((config.args ?? []).map(value => expandText(value, environment)));
353
- const env = freezeRecord(Object.fromEntries(Object.entries(config.env ?? {}).map(([key, value]) => [key, expandText(value, environment)])));
354
- const cwdValue = optionalExpandedText(config.cwd, environment);
359
+ const args = Object.freeze((config.args ?? []).map(valueFor));
360
+ const env = freezeRecord(Object.fromEntries(Object.entries(config.env ?? {}).map(([key, value]) => [key, valueFor(value)])));
361
+ const cwdValue = optionalValueFor(config.cwd);
355
362
  const cwd = cwdValue ? (0, path_1.resolve)(baseDirectory, cwdValue) : undefined;
356
- const url = optionalExpandedText(config.url, environment);
357
- const headers = freezeRecord(Object.fromEntries(Object.entries(config.headers ?? {}).map(([key, value]) => [
358
- key,
359
- expandText(value, environment),
360
- ])));
363
+ const url = optionalValueFor(config.url);
364
+ const headers = freezeRecord(Object.fromEntries(Object.entries(config.headers ?? {}).map(([key, value]) => [key, valueFor(value)])));
361
365
  const digestInput = {
362
366
  transport,
363
367
  ...(command ? { command } : {}),
@@ -389,7 +393,7 @@ function normalizeServer(serverId, config, baseDirectory, environment) {
389
393
  return Object.freeze({ serverId, transport, configDigest, descriptor, stdio });
390
394
  }
391
395
  function buildFirstPartyMcpChildEnvironmentV1(configured = {}, parent = process.env) {
392
- const env = {};
396
+ const env = Object.create(null);
393
397
  for (const [key, value] of Object.entries(parent)) {
394
398
  if (value === undefined)
395
399
  continue;
@@ -13,6 +13,7 @@ exports.ModelCoordinator = void 0;
13
13
  exports.validateModelSwitchCompactReceipt = validateModelSwitchCompactReceipt;
14
14
  exports.resolveProfileSafeInputBudget = resolveProfileSafeInputBudget;
15
15
  const events_1 = require("events");
16
+ const model_context_1 = require("../services/model-context");
16
17
  function validateModelSwitchCompactReceipt(receipt, targetTokens, safeInputBudget = targetTokens) {
17
18
  if (receipt.status === 'rejected')
18
19
  return { valid: false, error: receipt.error };
@@ -261,10 +262,6 @@ class ModelCoordinator extends events_1.EventEmitter {
261
262
  }
262
263
  exports.ModelCoordinator = ModelCoordinator;
263
264
  function resolveProfileSafeInputBudget(profile) {
264
- const reserveCeiling = Math.max(1, Math.floor(profile.resolvedContextWindow * 0.5));
265
- const reservedOutput = Math.min(profile.resolvedMaxOutputTokens, reserveCeiling);
266
- const safetyMargin = Math.max(1024, Math.ceil(profile.resolvedContextWindow * 0.02));
267
- const budget = profile.resolvedContextWindow - reservedOutput - safetyMargin;
268
- return budget > 0 ? budget : Math.max(1, Math.floor(profile.resolvedContextWindow * 0.6));
265
+ return (0, model_context_1.resolveContextBudget)(profile.model, profile.resolvedMaxOutputTokens, profile.resolvedContextWindow).safeInputBudget;
269
266
  }
270
267
  //# sourceMappingURL=model-coordinator.js.map
@@ -2,7 +2,7 @@ import type { ToolContext } from '../framework/tool';
2
2
  import type { StopDecision } from '../framework/stop-decision';
3
3
  import type { LLMService, Message, StreamCallbacks } from '../services/llm';
4
4
  import { AgentLoopV1 } from './agent-loop';
5
- import type { BuiltinToolCatalogV1 } from './builtin-tool-provider';
5
+ import { type BuiltinToolCatalogV1 } from './builtin-tool-provider';
6
6
  import type { CapabilityToolCandidateV1 } from './capabilities';
7
7
  import { CapabilityReceiptJournalV1, type CapabilityReceiptJournalCommitV1 } from './capability-receipt-journal';
8
8
  import type { CompactRecoveryReportV1 } from './compact-transaction';
@@ -79,6 +79,8 @@ export interface OrionSubagentCompositionV1 extends RuntimeServicePort {
79
79
  export interface OrionRuntimeLoopOptionsV1 {
80
80
  readonly streamCallbacks?: StreamCallbacks;
81
81
  readonly loopBudget?: ConstructorParameters<typeof AgentLoopV1>[0]['loopBudget'];
82
+ /** Resolve each turn from trusted product input, not a model-authored continuation prompt. */
83
+ readonly resolveLoopBudget?: (context: ThreadTurnExecutionContextV1, goal: GoalRuntimeCoordinatorV2) => ConstructorParameters<typeof AgentLoopV1>[0]['loopBudget'];
82
84
  readonly onContextUsage?: ConstructorParameters<typeof AgentLoopV1>[0]['onContextUsage'];
83
85
  readonly compactCoordinator?: ConstructorParameters<typeof AgentLoopV1>[0]['compactCoordinator'];
84
86
  /**
@@ -101,10 +103,16 @@ export interface OrionRuntimeLoopOptionsV1 {
101
103
  export interface OrionExplicitCompactInputV1 {
102
104
  readonly maxMessages?: number;
103
105
  readonly focus?: string;
106
+ /** Model-switch preflight uses the destination profile's budget. */
107
+ readonly modelSwitchBudget?: {
108
+ readonly safeInputBudget: number;
109
+ readonly targetTokens: number;
110
+ };
104
111
  }
105
112
  export interface OrionRuntimeV1Options {
106
113
  /** The caller owns provider configuration; the runtime owns model invocation routing. */
107
114
  readonly modelExecutor: LLMService;
115
+ readonly enableTaskTodos?: boolean;
108
116
  /** Already-normalized first-party tools. No global TOOLS collection is consulted. */
109
117
  readonly toolCatalog: BuiltinToolCatalogV1;
110
118
  readonly toolContext: ToolContext;
@@ -112,6 +120,10 @@ export interface OrionRuntimeV1Options {
112
120
  readonly projectPath: string;
113
121
  readonly taskContext: TaskContextServiceOptions;
114
122
  readonly goal?: GoalRuntimeDefinitionV2;
123
+ readonly goalPolicy?: {
124
+ readonly continuation?: 'agent' | 'manual';
125
+ readonly defaultBudget?: GoalRuntimeDefinitionV2['budget'];
126
+ };
115
127
  readonly skills: Omit<LazySkillRuntimeOptions, 'signal'>;
116
128
  readonly mcp: Omit<LazyMcpRuntimeOptions, 'signal'>;
117
129
  readonly resolveCapabilityConfiguration: OrionCapabilityConfigurationResolverV1;
@@ -122,6 +134,8 @@ export interface OrionRuntimeV1Options {
122
134
  readonly thread?: Omit<ThreadRuntimeOptionsV1, 'store' | 'runner' | 'maintenanceRunner' | 'projectPath' | 'requireTurnCommit'>;
123
135
  readonly compact?: ThreadCompactMaintenanceRunnerOptionsV1;
124
136
  readonly loop?: OrionRuntimeLoopOptionsV1;
137
+ /** Provider-safe history imported before the first Thread TurnCommit. */
138
+ readonly loadImportedHistory?: () => readonly Message[];
125
139
  readonly loadBaseMessages?: (store: ThreadEventStore, context: ThreadTurnExecutionContextV1, prompts: PromptRegistryV1, composition: OrionPromptCompositionContextV1) => readonly Message[] | Promise<readonly Message[]>;
126
140
  readonly closeDeadlineMs?: number;
127
141
  }
@@ -284,13 +298,15 @@ export declare class OrionRuntimeV1Error extends Error {
284
298
  readonly code: OrionRuntimeErrorCode;
285
299
  constructor(code: OrionRuntimeErrorCode, message: string);
286
300
  }
301
+ /** Process-local guard; it is an ownership check, never a service lookup path. */
287
302
  /**
288
303
  * Explicit first-party production composition root for exactly one ThreadRuntime.
289
304
  * Construction is side-effect free; start() owns resources and close() releases them.
290
305
  */
291
306
  export declare class OrionRuntimeV1 {
292
307
  readonly scope: ResourceScope;
293
- private readonly ownerKey;
308
+ private releaseWriter?;
309
+ private writerThread?;
294
310
  private readonly options;
295
311
  private stateValue;
296
312
  private graphValue?;