@orion-agents/orion-code 0.1.9 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (757) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/README.md +142 -323
  3. package/README.zh-CN.md +118 -578
  4. package/dist/cli.js +65 -84
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/context-commands.d.ts.map +1 -1
  7. package/dist/commands/context-commands.js +14 -7
  8. package/dist/commands/context-commands.js.map +1 -1
  9. package/dist/commands/context-tool-command-handlers.d.ts +4 -5
  10. package/dist/commands/context-tool-command-handlers.d.ts.map +1 -1
  11. package/dist/commands/context-tool-command-handlers.js +132 -208
  12. package/dist/commands/context-tool-command-handlers.js.map +1 -1
  13. package/dist/commands/core-command-handlers.d.ts +3 -6
  14. package/dist/commands/core-command-handlers.d.ts.map +1 -1
  15. package/dist/commands/core-command-handlers.js +66 -664
  16. package/dist/commands/core-command-handlers.js.map +1 -1
  17. package/dist/commands/diagnostic-command-handlers.d.ts +1 -2
  18. package/dist/commands/diagnostic-command-handlers.d.ts.map +1 -1
  19. package/dist/commands/diagnostic-command-handlers.js +3 -17
  20. package/dist/commands/diagnostic-command-handlers.js.map +1 -1
  21. package/dist/commands/diagnostic-commands.d.ts.map +1 -1
  22. package/dist/commands/diagnostic-commands.js +0 -45
  23. package/dist/commands/diagnostic-commands.js.map +1 -1
  24. package/dist/commands/index.d.ts +1 -1
  25. package/dist/commands/index.d.ts.map +1 -1
  26. package/dist/commands/index.js +2 -7
  27. package/dist/commands/index.js.map +1 -1
  28. package/dist/commands/model-command-handlers.d.ts +1 -1
  29. package/dist/commands/model-command-handlers.js +2 -2
  30. package/dist/commands/model-command-handlers.js.map +1 -1
  31. package/dist/commands/model-commands.d.ts.map +1 -1
  32. package/dist/commands/model-commands.js +0 -11
  33. package/dist/commands/model-commands.js.map +1 -1
  34. package/dist/commands/registry.d.ts.map +1 -1
  35. package/dist/commands/registry.js +1 -139
  36. package/dist/commands/registry.js.map +1 -1
  37. package/dist/commands/session-command-handlers.d.ts +1 -1
  38. package/dist/commands/session-command-handlers.d.ts.map +1 -1
  39. package/dist/commands/session-command-handlers.js +52 -214
  40. package/dist/commands/session-command-handlers.js.map +1 -1
  41. package/dist/commands/session-commands.d.ts.map +1 -1
  42. package/dist/commands/session-commands.js +0 -48
  43. package/dist/commands/session-commands.js.map +1 -1
  44. package/dist/commands/target-command.d.ts +9 -15
  45. package/dist/commands/target-command.d.ts.map +1 -1
  46. package/dist/commands/target-command.js +16 -130
  47. package/dist/commands/target-command.js.map +1 -1
  48. package/dist/commands/tool-commands.d.ts.map +1 -1
  49. package/dist/commands/tool-commands.js +0 -10
  50. package/dist/commands/tool-commands.js.map +1 -1
  51. package/dist/commands/types.d.ts +10 -14
  52. package/dist/commands/types.d.ts.map +1 -1
  53. package/dist/commands/types.js +1 -1
  54. package/dist/commands/types.js.map +1 -1
  55. package/dist/commands/workflow-command-handlers.d.ts.map +1 -1
  56. package/dist/commands/workflow-command-handlers.js +1 -3
  57. package/dist/commands/workflow-command-handlers.js.map +1 -1
  58. package/dist/commands/workflow-commands.d.ts.map +1 -1
  59. package/dist/commands/workflow-commands.js +2 -24
  60. package/dist/commands/workflow-commands.js.map +1 -1
  61. package/dist/framework/agent-mode.d.ts +2 -3
  62. package/dist/framework/agent-mode.d.ts.map +1 -1
  63. package/dist/framework/agent-mode.js +8 -31
  64. package/dist/framework/agent-mode.js.map +1 -1
  65. package/dist/framework/index.d.ts +3 -3
  66. package/dist/framework/index.d.ts.map +1 -1
  67. package/dist/framework/index.js +6 -9
  68. package/dist/framework/index.js.map +1 -1
  69. package/dist/framework/loop-budget-contract.d.ts +20 -0
  70. package/dist/framework/loop-budget-contract.d.ts.map +1 -0
  71. package/dist/framework/loop-budget-contract.js +13 -0
  72. package/dist/framework/loop-budget-contract.js.map +1 -0
  73. package/dist/framework/prompt.d.ts.map +1 -1
  74. package/dist/framework/prompt.js +5 -4
  75. package/dist/framework/prompt.js.map +1 -1
  76. package/dist/framework/query.d.ts +45 -22
  77. package/dist/framework/query.d.ts.map +1 -1
  78. package/dist/framework/query.js +64 -52
  79. package/dist/framework/query.js.map +1 -1
  80. package/dist/framework/store.d.ts +4 -2
  81. package/dist/framework/store.d.ts.map +1 -1
  82. package/dist/framework/store.js +1 -0
  83. package/dist/framework/store.js.map +1 -1
  84. package/dist/framework/tool-call-orchestrator.d.ts +80 -0
  85. package/dist/framework/tool-call-orchestrator.d.ts.map +1 -0
  86. package/dist/framework/tool-call-orchestrator.js +192 -0
  87. package/dist/framework/tool-call-orchestrator.js.map +1 -0
  88. package/dist/framework/tool-state.d.ts +12 -11
  89. package/dist/framework/tool-state.d.ts.map +1 -1
  90. package/dist/framework/tool-state.js +36 -28
  91. package/dist/framework/tool-state.js.map +1 -1
  92. package/dist/framework/tool.d.ts +0 -9
  93. package/dist/framework/tool.d.ts.map +1 -1
  94. package/dist/framework/tool.js.map +1 -1
  95. package/dist/index.d.ts +70 -26
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +64 -65
  98. package/dist/index.js.map +1 -1
  99. package/dist/print-ui/launch.d.ts.map +1 -1
  100. package/dist/print-ui/launch.js +9 -2
  101. package/dist/print-ui/launch.js.map +1 -1
  102. package/dist/product/paths.d.ts +7 -0
  103. package/dist/product/paths.d.ts.map +1 -1
  104. package/dist/product/paths.js +19 -0
  105. package/dist/product/paths.js.map +1 -1
  106. package/dist/runtime/agent-loop.d.ts +80 -0
  107. package/dist/runtime/agent-loop.d.ts.map +1 -0
  108. package/dist/runtime/agent-loop.js +419 -0
  109. package/dist/runtime/agent-loop.js.map +1 -0
  110. package/dist/runtime/agent-runtime-controller.d.ts +10 -57
  111. package/dist/runtime/agent-runtime-controller.d.ts.map +1 -1
  112. package/dist/runtime/agent-runtime-controller.js +270 -1216
  113. package/dist/runtime/agent-runtime-controller.js.map +1 -1
  114. package/dist/runtime/agent-runtime-protocol.d.ts +4 -5
  115. package/dist/runtime/agent-runtime-protocol.d.ts.map +1 -1
  116. package/dist/runtime/agent-runtime-protocol.js.map +1 -1
  117. package/dist/runtime/agent-runtime-runner.d.ts +36 -0
  118. package/dist/runtime/agent-runtime-runner.d.ts.map +1 -0
  119. package/dist/runtime/agent-runtime-runner.js +3 -0
  120. package/dist/runtime/agent-runtime-runner.js.map +1 -0
  121. package/dist/runtime/batch-read-service.d.ts +29 -0
  122. package/dist/runtime/batch-read-service.d.ts.map +1 -0
  123. package/dist/runtime/batch-read-service.js +212 -0
  124. package/dist/runtime/batch-read-service.js.map +1 -0
  125. package/dist/runtime/builtin-tool-provider.d.ts +30 -0
  126. package/dist/runtime/builtin-tool-provider.d.ts.map +1 -0
  127. package/dist/runtime/builtin-tool-provider.js +233 -0
  128. package/dist/runtime/builtin-tool-provider.js.map +1 -0
  129. package/dist/runtime/capabilities/compiler.d.ts +11 -0
  130. package/dist/runtime/capabilities/compiler.d.ts.map +1 -0
  131. package/dist/runtime/capabilities/compiler.js +719 -0
  132. package/dist/runtime/capabilities/compiler.js.map +1 -0
  133. package/dist/runtime/capabilities/index.d.ts +3 -0
  134. package/dist/runtime/capabilities/index.d.ts.map +1 -0
  135. package/dist/runtime/capabilities/index.js +9 -0
  136. package/dist/runtime/capabilities/index.js.map +1 -0
  137. package/dist/runtime/capabilities/types.d.ts +175 -0
  138. package/dist/runtime/capabilities/types.d.ts.map +1 -0
  139. package/dist/runtime/capabilities/types.js +3 -0
  140. package/dist/runtime/capabilities/types.js.map +1 -0
  141. package/dist/runtime/capability-receipt-journal.d.ts +29 -0
  142. package/dist/runtime/capability-receipt-journal.d.ts.map +1 -0
  143. package/dist/runtime/capability-receipt-journal.js +264 -0
  144. package/dist/runtime/capability-receipt-journal.js.map +1 -0
  145. package/dist/runtime/capability-step-factory.d.ts +73 -0
  146. package/dist/runtime/capability-step-factory.d.ts.map +1 -0
  147. package/dist/runtime/capability-step-factory.js +302 -0
  148. package/dist/runtime/capability-step-factory.js.map +1 -0
  149. package/dist/runtime/compact-transaction.d.ts +225 -0
  150. package/dist/runtime/compact-transaction.d.ts.map +1 -0
  151. package/dist/runtime/compact-transaction.js +622 -0
  152. package/dist/runtime/compact-transaction.js.map +1 -0
  153. package/dist/runtime/composer/buffer.d.ts +3 -4
  154. package/dist/runtime/composer/buffer.d.ts.map +1 -1
  155. package/dist/runtime/composer/buffer.js +3 -4
  156. package/dist/runtime/composer/buffer.js.map +1 -1
  157. package/dist/runtime/composer/grapheme.d.ts +2 -4
  158. package/dist/runtime/composer/grapheme.d.ts.map +1 -1
  159. package/dist/runtime/composer/grapheme.js +2 -4
  160. package/dist/runtime/composer/grapheme.js.map +1 -1
  161. package/dist/runtime/composer/layout.d.ts +1 -3
  162. package/dist/runtime/composer/layout.d.ts.map +1 -1
  163. package/dist/runtime/composer/layout.js +1 -3
  164. package/dist/runtime/composer/layout.js.map +1 -1
  165. package/dist/runtime/core-tools/descriptors.d.ts +17 -0
  166. package/dist/runtime/core-tools/descriptors.d.ts.map +1 -0
  167. package/dist/runtime/core-tools/descriptors.js +185 -0
  168. package/dist/runtime/core-tools/descriptors.js.map +1 -0
  169. package/dist/runtime/first-party-core-provider.d.ts +55 -0
  170. package/dist/runtime/first-party-core-provider.d.ts.map +1 -0
  171. package/dist/runtime/first-party-core-provider.js +197 -0
  172. package/dist/runtime/first-party-core-provider.js.map +1 -0
  173. package/dist/runtime/first-party-long-tail-provider.d.ts +57 -0
  174. package/dist/runtime/first-party-long-tail-provider.d.ts.map +1 -0
  175. package/dist/runtime/first-party-long-tail-provider.js +238 -0
  176. package/dist/runtime/first-party-long-tail-provider.js.map +1 -0
  177. package/dist/runtime/first-party-tool-services.d.ts +43 -0
  178. package/dist/runtime/first-party-tool-services.d.ts.map +1 -0
  179. package/dist/runtime/first-party-tool-services.js +200 -0
  180. package/dist/runtime/first-party-tool-services.js.map +1 -0
  181. package/dist/runtime/first-party-tool-universe.d.ts +14 -0
  182. package/dist/runtime/first-party-tool-universe.d.ts.map +1 -0
  183. package/dist/runtime/first-party-tool-universe.js +20 -0
  184. package/dist/runtime/first-party-tool-universe.js.map +1 -0
  185. package/dist/runtime/goal-lifecycle-v2.d.ts +63 -0
  186. package/dist/runtime/goal-lifecycle-v2.d.ts.map +1 -0
  187. package/dist/runtime/goal-lifecycle-v2.js +253 -0
  188. package/dist/runtime/goal-lifecycle-v2.js.map +1 -0
  189. package/dist/runtime/goal-runtime-coordinator.d.ts +111 -0
  190. package/dist/runtime/goal-runtime-coordinator.d.ts.map +1 -0
  191. package/dist/runtime/goal-runtime-coordinator.js +511 -0
  192. package/dist/runtime/goal-runtime-coordinator.js.map +1 -0
  193. package/dist/runtime/harness-confluence.d.ts +165 -0
  194. package/dist/runtime/harness-confluence.d.ts.map +1 -0
  195. package/dist/runtime/harness-confluence.js +807 -0
  196. package/dist/runtime/harness-confluence.js.map +1 -0
  197. package/dist/runtime/harness-eval.d.ts +96 -0
  198. package/dist/runtime/harness-eval.d.ts.map +1 -0
  199. package/dist/runtime/harness-eval.js +181 -0
  200. package/dist/runtime/harness-eval.js.map +1 -0
  201. package/dist/runtime/harness-metrics.d.ts +202 -0
  202. package/dist/runtime/harness-metrics.d.ts.map +1 -0
  203. package/dist/runtime/harness-metrics.js +415 -0
  204. package/dist/runtime/harness-metrics.js.map +1 -0
  205. package/dist/runtime/legacy-session-importer.d.ts +99 -0
  206. package/dist/runtime/legacy-session-importer.d.ts.map +1 -0
  207. package/dist/runtime/legacy-session-importer.js +455 -0
  208. package/dist/runtime/legacy-session-importer.js.map +1 -0
  209. package/dist/runtime/legacy-thread-materializer.d.ts +72 -0
  210. package/dist/runtime/legacy-thread-materializer.d.ts.map +1 -0
  211. package/dist/runtime/legacy-thread-materializer.js +553 -0
  212. package/dist/runtime/legacy-thread-materializer.js.map +1 -0
  213. package/dist/runtime/long-tail-tools/descriptors.d.ts +23 -0
  214. package/dist/runtime/long-tail-tools/descriptors.d.ts.map +1 -0
  215. package/dist/runtime/long-tail-tools/descriptors.js +423 -0
  216. package/dist/runtime/long-tail-tools/descriptors.js.map +1 -0
  217. package/dist/runtime/loop-budget.d.ts +1 -1
  218. package/dist/runtime/loop-budget.d.ts.map +1 -1
  219. package/dist/runtime/loop-budget.js +2 -2
  220. package/dist/runtime/loop-budget.js.map +1 -1
  221. package/dist/runtime/mcp/first-party-mcp-adapter.d.ts +75 -0
  222. package/dist/runtime/mcp/first-party-mcp-adapter.d.ts.map +1 -0
  223. package/dist/runtime/mcp/first-party-mcp-adapter.js +484 -0
  224. package/dist/runtime/mcp/first-party-mcp-adapter.js.map +1 -0
  225. package/dist/runtime/mcp/first-party-mcp-config.d.ts +13 -0
  226. package/dist/runtime/mcp/first-party-mcp-config.d.ts.map +1 -0
  227. package/dist/runtime/mcp/first-party-mcp-config.js +139 -0
  228. package/dist/runtime/mcp/first-party-mcp-config.js.map +1 -0
  229. package/dist/runtime/mcp/index.d.ts +5 -0
  230. package/dist/runtime/mcp/index.d.ts.map +1 -0
  231. package/dist/{skills → runtime/mcp}/index.js +3 -9
  232. package/dist/runtime/mcp/index.js.map +1 -0
  233. package/dist/runtime/mcp/lazy-mcp-runtime.d.ts +95 -0
  234. package/dist/runtime/mcp/lazy-mcp-runtime.d.ts.map +1 -0
  235. package/dist/runtime/mcp/lazy-mcp-runtime.js +854 -0
  236. package/dist/runtime/mcp/lazy-mcp-runtime.js.map +1 -0
  237. package/dist/runtime/mcp/types.d.ts +128 -0
  238. package/dist/runtime/mcp/types.d.ts.map +1 -0
  239. package/dist/runtime/mcp/types.js +5 -0
  240. package/dist/runtime/mcp/types.js.map +1 -0
  241. package/dist/runtime/orion-runtime-v1.d.ts +322 -0
  242. package/dist/runtime/orion-runtime-v1.d.ts.map +1 -0
  243. package/dist/runtime/orion-runtime-v1.js +959 -0
  244. package/dist/runtime/orion-runtime-v1.js.map +1 -0
  245. package/dist/runtime/orion-session-runner.d.ts +38 -0
  246. package/dist/runtime/orion-session-runner.d.ts.map +1 -0
  247. package/dist/runtime/orion-session-runner.js +168 -0
  248. package/dist/runtime/orion-session-runner.js.map +1 -0
  249. package/dist/runtime/product-orion-runtime.d.ts +35 -0
  250. package/dist/runtime/product-orion-runtime.d.ts.map +1 -0
  251. package/dist/runtime/product-orion-runtime.js +1047 -0
  252. package/dist/runtime/product-orion-runtime.js.map +1 -0
  253. package/dist/runtime/prompts/index.d.ts +3 -0
  254. package/dist/runtime/prompts/index.d.ts.map +1 -0
  255. package/dist/{ink-ui/types.js → runtime/prompts/index.js} +3 -2
  256. package/dist/runtime/prompts/index.js.map +1 -0
  257. package/dist/runtime/prompts/prompt-registry.d.ts +22 -0
  258. package/dist/runtime/prompts/prompt-registry.d.ts.map +1 -0
  259. package/dist/runtime/prompts/prompt-registry.js +356 -0
  260. package/dist/runtime/prompts/prompt-registry.js.map +1 -0
  261. package/dist/runtime/prompts/types.d.ts +111 -0
  262. package/dist/runtime/prompts/types.d.ts.map +1 -0
  263. package/dist/runtime/prompts/types.js +5 -0
  264. package/dist/runtime/prompts/types.js.map +1 -0
  265. package/dist/runtime/protocol/canonical.d.ts +3 -0
  266. package/dist/runtime/protocol/canonical.d.ts.map +1 -0
  267. package/dist/runtime/protocol/canonical.js +21 -0
  268. package/dist/runtime/protocol/canonical.js.map +1 -0
  269. package/dist/runtime/protocol/index.d.ts +4 -0
  270. package/dist/runtime/protocol/index.d.ts.map +1 -0
  271. package/dist/runtime/protocol/index.js +16 -0
  272. package/dist/runtime/protocol/index.js.map +1 -0
  273. package/dist/runtime/protocol/runtime-protocol-v1.d.ts +671 -0
  274. package/dist/runtime/protocol/runtime-protocol-v1.d.ts.map +1 -0
  275. package/dist/runtime/protocol/runtime-protocol-v1.js +557 -0
  276. package/dist/runtime/protocol/runtime-protocol-v1.js.map +1 -0
  277. package/dist/runtime/release-receipts.d.ts +110 -0
  278. package/dist/runtime/release-receipts.d.ts.map +1 -0
  279. package/dist/runtime/release-receipts.js +305 -0
  280. package/dist/runtime/release-receipts.js.map +1 -0
  281. package/dist/runtime/resource-scope.d.ts +123 -0
  282. package/dist/runtime/resource-scope.d.ts.map +1 -0
  283. package/dist/runtime/resource-scope.js +363 -0
  284. package/dist/runtime/resource-scope.js.map +1 -0
  285. package/dist/runtime/runtime-event-buffer.d.ts +78 -0
  286. package/dist/runtime/runtime-event-buffer.d.ts.map +1 -0
  287. package/dist/runtime/runtime-event-buffer.js +237 -0
  288. package/dist/runtime/runtime-event-buffer.js.map +1 -0
  289. package/dist/runtime/runtime-services.d.ts +87 -0
  290. package/dist/runtime/runtime-services.d.ts.map +1 -0
  291. package/dist/runtime/runtime-services.js +180 -0
  292. package/dist/runtime/runtime-services.js.map +1 -0
  293. package/dist/runtime/session-history-recovery.d.ts +19 -0
  294. package/dist/runtime/session-history-recovery.d.ts.map +1 -0
  295. package/dist/runtime/session-history-recovery.js +45 -0
  296. package/dist/runtime/session-history-recovery.js.map +1 -0
  297. package/dist/runtime/skills/bounded-lru-cache.d.ts +34 -0
  298. package/dist/runtime/skills/bounded-lru-cache.d.ts.map +1 -0
  299. package/dist/runtime/skills/bounded-lru-cache.js +100 -0
  300. package/dist/runtime/skills/bounded-lru-cache.js.map +1 -0
  301. package/dist/runtime/skills/filesystem-skill-provider.d.ts +96 -0
  302. package/dist/runtime/skills/filesystem-skill-provider.d.ts.map +1 -0
  303. package/dist/runtime/skills/filesystem-skill-provider.js +829 -0
  304. package/dist/runtime/skills/filesystem-skill-provider.js.map +1 -0
  305. package/dist/runtime/skills/index.d.ts +5 -0
  306. package/dist/runtime/skills/index.d.ts.map +1 -0
  307. package/dist/{ink-ui/controllers/chat-controller.js → runtime/skills/index.js} +5 -2
  308. package/dist/runtime/skills/index.js.map +1 -0
  309. package/dist/runtime/skills/lazy-skill-runtime.d.ts +77 -0
  310. package/dist/runtime/skills/lazy-skill-runtime.d.ts.map +1 -0
  311. package/dist/runtime/skills/lazy-skill-runtime.js +673 -0
  312. package/dist/runtime/skills/lazy-skill-runtime.js.map +1 -0
  313. package/dist/runtime/skills/types.d.ts +137 -0
  314. package/dist/runtime/skills/types.d.ts.map +1 -0
  315. package/dist/runtime/skills/types.js +13 -0
  316. package/dist/runtime/skills/types.js.map +1 -0
  317. package/dist/runtime/step-snapshot.d.ts +183 -0
  318. package/dist/runtime/step-snapshot.d.ts.map +1 -0
  319. package/dist/runtime/step-snapshot.js +286 -0
  320. package/dist/runtime/step-snapshot.js.map +1 -0
  321. package/dist/runtime/subagent-thread-runtime.d.ts +239 -0
  322. package/dist/runtime/subagent-thread-runtime.d.ts.map +1 -0
  323. package/dist/runtime/subagent-thread-runtime.js +876 -0
  324. package/dist/runtime/subagent-thread-runtime.js.map +1 -0
  325. package/dist/runtime/subagents/index.d.ts +4 -1
  326. package/dist/runtime/subagents/index.d.ts.map +1 -1
  327. package/dist/runtime/subagents/index.js +10 -2
  328. package/dist/runtime/subagents/index.js.map +1 -1
  329. package/dist/runtime/subagents/parent-step-fork.d.ts +36 -0
  330. package/dist/runtime/subagents/parent-step-fork.d.ts.map +1 -0
  331. package/dist/runtime/subagents/parent-step-fork.js +83 -0
  332. package/dist/runtime/subagents/parent-step-fork.js.map +1 -0
  333. package/dist/runtime/subagents/production.d.ts +65 -46
  334. package/dist/runtime/subagents/production.d.ts.map +1 -1
  335. package/dist/runtime/subagents/production.js +494 -170
  336. package/dist/runtime/subagents/production.js.map +1 -1
  337. package/dist/runtime/subagents/receipt-journal.d.ts +20 -0
  338. package/dist/runtime/subagents/receipt-journal.d.ts.map +1 -0
  339. package/dist/runtime/subagents/receipt-journal.js +74 -0
  340. package/dist/runtime/subagents/receipt-journal.js.map +1 -0
  341. package/dist/runtime/subagents/runtime-contract.d.ts +29 -0
  342. package/dist/runtime/subagents/runtime-contract.d.ts.map +1 -0
  343. package/dist/runtime/subagents/runtime-contract.js +3 -0
  344. package/dist/runtime/subagents/runtime-contract.js.map +1 -0
  345. package/dist/runtime/subagents/runtime-integration.d.ts +41 -56
  346. package/dist/runtime/subagents/runtime-integration.d.ts.map +1 -1
  347. package/dist/runtime/subagents/runtime-integration.js +34 -198
  348. package/dist/runtime/subagents/runtime-integration.js.map +1 -1
  349. package/dist/runtime/subagents/supervisor.d.ts +19 -7
  350. package/dist/runtime/subagents/supervisor.d.ts.map +1 -1
  351. package/dist/runtime/subagents/supervisor.js +83 -40
  352. package/dist/runtime/subagents/supervisor.js.map +1 -1
  353. package/dist/runtime/subagents/types.d.ts +1 -1
  354. package/dist/runtime/subagents/types.js +1 -1
  355. package/dist/runtime/task-context-service.d.ts +91 -0
  356. package/dist/runtime/task-context-service.d.ts.map +1 -0
  357. package/dist/runtime/task-context-service.js +122 -0
  358. package/dist/runtime/task-context-service.js.map +1 -0
  359. package/dist/runtime/thread-admission.d.ts +130 -0
  360. package/dist/runtime/thread-admission.d.ts.map +1 -0
  361. package/dist/runtime/thread-admission.js +276 -0
  362. package/dist/runtime/thread-admission.js.map +1 -0
  363. package/dist/runtime/thread-compact-persistence.d.ts +50 -0
  364. package/dist/runtime/thread-compact-persistence.d.ts.map +1 -0
  365. package/dist/runtime/thread-compact-persistence.js +176 -0
  366. package/dist/runtime/thread-compact-persistence.js.map +1 -0
  367. package/dist/runtime/thread-event-store.d.ts +98 -0
  368. package/dist/runtime/thread-event-store.d.ts.map +1 -0
  369. package/dist/runtime/thread-event-store.js +737 -0
  370. package/dist/runtime/thread-event-store.js.map +1 -0
  371. package/dist/runtime/thread-projection.d.ts +91 -0
  372. package/dist/runtime/thread-projection.d.ts.map +1 -0
  373. package/dist/runtime/thread-projection.js +407 -0
  374. package/dist/runtime/thread-projection.js.map +1 -0
  375. package/dist/runtime/thread-runtime.d.ts +165 -0
  376. package/dist/runtime/thread-runtime.d.ts.map +1 -0
  377. package/dist/runtime/thread-runtime.js +704 -0
  378. package/dist/runtime/thread-runtime.js.map +1 -0
  379. package/dist/runtime/thread-session-view.d.ts +45 -0
  380. package/dist/runtime/thread-session-view.d.ts.map +1 -0
  381. package/dist/runtime/thread-session-view.js +264 -0
  382. package/dist/runtime/thread-session-view.js.map +1 -0
  383. package/dist/runtime/thread-tool-journal.d.ts +11 -0
  384. package/dist/runtime/thread-tool-journal.d.ts.map +1 -0
  385. package/dist/runtime/thread-tool-journal.js +131 -0
  386. package/dist/runtime/thread-tool-journal.js.map +1 -0
  387. package/dist/runtime/thread-ui-adapter.d.ts +87 -0
  388. package/dist/runtime/thread-ui-adapter.d.ts.map +1 -0
  389. package/dist/runtime/thread-ui-adapter.js +580 -0
  390. package/dist/runtime/thread-ui-adapter.js.map +1 -0
  391. package/dist/runtime/tool-gateway.d.ts +159 -0
  392. package/dist/runtime/tool-gateway.d.ts.map +1 -0
  393. package/dist/runtime/tool-gateway.js +311 -0
  394. package/dist/runtime/tool-gateway.js.map +1 -0
  395. package/dist/runtime/turn-commit.d.ts +103 -0
  396. package/dist/runtime/turn-commit.d.ts.map +1 -0
  397. package/dist/runtime/turn-commit.js +321 -0
  398. package/dist/runtime/turn-commit.js.map +1 -0
  399. package/dist/runtime/ui-events.d.ts +15 -5
  400. package/dist/runtime/ui-events.d.ts.map +1 -1
  401. package/dist/runtime/ui-events.js +0 -1
  402. package/dist/runtime/ui-events.js.map +1 -1
  403. package/dist/runtime/ui-view-model.d.ts +2 -1
  404. package/dist/runtime/ui-view-model.d.ts.map +1 -1
  405. package/dist/runtime/ui-view-model.js +6 -5
  406. package/dist/runtime/ui-view-model.js.map +1 -1
  407. package/dist/services/config-dir.d.ts +1 -1
  408. package/dist/services/config-dir.d.ts.map +1 -1
  409. package/dist/services/config-dir.js +2 -1
  410. package/dist/services/config-dir.js.map +1 -1
  411. package/dist/services/config.d.ts +2 -16
  412. package/dist/services/config.d.ts.map +1 -1
  413. package/dist/services/config.js +2 -29
  414. package/dist/services/config.js.map +1 -1
  415. package/dist/services/doctor.d.ts +0 -2
  416. package/dist/services/doctor.d.ts.map +1 -1
  417. package/dist/services/doctor.js +39 -64
  418. package/dist/services/doctor.js.map +1 -1
  419. package/dist/services/file-lock.d.ts.map +1 -1
  420. package/dist/services/file-lock.js +42 -17
  421. package/dist/services/file-lock.js.map +1 -1
  422. package/dist/services/global-config.d.ts +2 -2
  423. package/dist/services/global-config.d.ts.map +1 -1
  424. package/dist/services/session-storage.d.ts +8 -0
  425. package/dist/services/session-storage.d.ts.map +1 -1
  426. package/dist/services/session-storage.js +76 -12
  427. package/dist/services/session-storage.js.map +1 -1
  428. package/dist/skills/builtin/code-review/SKILL.md +51 -0
  429. package/dist/skills/builtin/security-check/SKILL.md +54 -0
  430. package/dist/skills/builtin/test-gen/SKILL.md +49 -0
  431. package/dist/terminal-ui/launch.d.ts +3 -1
  432. package/dist/terminal-ui/launch.d.ts.map +1 -1
  433. package/dist/terminal-ui/launch.js +21 -3
  434. package/dist/terminal-ui/launch.js.map +1 -1
  435. package/dist/tools/core/common.d.ts +34 -0
  436. package/dist/tools/core/common.d.ts.map +1 -0
  437. package/dist/tools/core/common.js +164 -0
  438. package/dist/tools/core/common.js.map +1 -0
  439. package/dist/tools/core/edit-file.d.ts +10 -0
  440. package/dist/tools/core/edit-file.d.ts.map +1 -0
  441. package/dist/tools/core/edit-file.js +301 -0
  442. package/dist/tools/core/edit-file.js.map +1 -0
  443. package/dist/tools/core/exec-command.d.ts +2 -0
  444. package/dist/tools/core/exec-command.d.ts.map +1 -0
  445. package/dist/tools/core/exec-command.js +347 -0
  446. package/dist/tools/core/exec-command.js.map +1 -0
  447. package/dist/tools/core/glob.d.ts +2 -0
  448. package/dist/tools/core/glob.d.ts.map +1 -0
  449. package/dist/tools/core/glob.js +133 -0
  450. package/dist/tools/core/glob.js.map +1 -0
  451. package/dist/tools/core/grep.d.ts +12 -0
  452. package/dist/tools/core/grep.d.ts.map +1 -0
  453. package/dist/tools/core/grep.js +223 -0
  454. package/dist/tools/core/grep.js.map +1 -0
  455. package/dist/tools/core/index.d.ts +15 -0
  456. package/dist/tools/core/index.d.ts.map +1 -0
  457. package/dist/tools/core/index.js +31 -0
  458. package/dist/tools/core/index.js.map +1 -0
  459. package/dist/tools/core/list-files.d.ts +2 -0
  460. package/dist/tools/core/list-files.d.ts.map +1 -0
  461. package/dist/tools/core/list-files.js +87 -0
  462. package/dist/tools/core/list-files.js.map +1 -0
  463. package/dist/tools/core/read-file.d.ts +2 -0
  464. package/dist/tools/core/read-file.d.ts.map +1 -0
  465. package/dist/tools/core/read-file.js +129 -0
  466. package/dist/tools/core/read-file.js.map +1 -0
  467. package/dist/tools/core/write-file.d.ts +2 -0
  468. package/dist/tools/core/write-file.d.ts.map +1 -0
  469. package/dist/tools/core/write-file.js +65 -0
  470. package/dist/tools/core/write-file.js.map +1 -0
  471. package/dist/tools/todo.d.ts +3 -4
  472. package/dist/tools/todo.d.ts.map +1 -1
  473. package/dist/tools/todo.js +80 -79
  474. package/dist/tools/todo.js.map +1 -1
  475. package/dist/tools/web.js +1 -1
  476. package/dist/tools/web.js.map +1 -1
  477. package/dist/tui-ui/chrome-view-model.d.ts.map +1 -1
  478. package/dist/tui-ui/chrome-view-model.js +22 -8
  479. package/dist/tui-ui/chrome-view-model.js.map +1 -1
  480. package/dist/tui-ui/launch.d.ts.map +1 -1
  481. package/dist/tui-ui/launch.js +13 -0
  482. package/dist/tui-ui/launch.js.map +1 -1
  483. package/dist/tui-ui/layout.js +1 -1
  484. package/dist/tui-ui/layout.js.map +1 -1
  485. package/dist/tui-ui/state.d.ts.map +1 -1
  486. package/dist/tui-ui/state.js +2 -0
  487. package/dist/tui-ui/state.js.map +1 -1
  488. package/docs/migration/v0.1.9-to-v0.2.0.md +98 -0
  489. package/docs/orion.example.json +79 -0
  490. package/docs/plan/v0.2.0-dsh-harness-redesign-plan.md +1234 -0
  491. package/docs/plan/v0.2.0-release-checklist.md +91 -0
  492. package/docs/readme.md +8 -8
  493. package/npm-shrinkwrap.json +45 -450
  494. package/package.json +17 -13
  495. package/dist/agents/coder.d.ts +0 -12
  496. package/dist/agents/coder.d.ts.map +0 -1
  497. package/dist/agents/coder.js +0 -48
  498. package/dist/agents/coder.js.map +0 -1
  499. package/dist/agents/coordinator.d.ts +0 -86
  500. package/dist/agents/coordinator.d.ts.map +0 -1
  501. package/dist/agents/coordinator.js +0 -291
  502. package/dist/agents/coordinator.js.map +0 -1
  503. package/dist/agents/fork.d.ts +0 -73
  504. package/dist/agents/fork.d.ts.map +0 -1
  505. package/dist/agents/fork.js +0 -163
  506. package/dist/agents/fork.js.map +0 -1
  507. package/dist/agents/leader.d.ts +0 -12
  508. package/dist/agents/leader.d.ts.map +0 -1
  509. package/dist/agents/leader.js +0 -49
  510. package/dist/agents/leader.js.map +0 -1
  511. package/dist/agents/router.d.ts +0 -59
  512. package/dist/agents/router.d.ts.map +0 -1
  513. package/dist/agents/router.js +0 -193
  514. package/dist/agents/router.js.map +0 -1
  515. package/dist/agents/worker-pool.d.ts +0 -72
  516. package/dist/agents/worker-pool.d.ts.map +0 -1
  517. package/dist/agents/worker-pool.js +0 -229
  518. package/dist/agents/worker-pool.js.map +0 -1
  519. package/dist/commands/legacy-commands.d.ts +0 -4
  520. package/dist/commands/legacy-commands.d.ts.map +0 -1
  521. package/dist/commands/legacy-commands.js +0 -44
  522. package/dist/commands/legacy-commands.js.map +0 -1
  523. package/dist/core/agent.d.ts +0 -84
  524. package/dist/core/agent.d.ts.map +0 -1
  525. package/dist/core/agent.js +0 -58
  526. package/dist/core/agent.js.map +0 -1
  527. package/dist/core/brain.d.ts +0 -50
  528. package/dist/core/brain.d.ts.map +0 -1
  529. package/dist/core/brain.js +0 -95
  530. package/dist/core/brain.js.map +0 -1
  531. package/dist/framework/tool-scheduler.d.ts +0 -191
  532. package/dist/framework/tool-scheduler.d.ts.map +0 -1
  533. package/dist/framework/tool-scheduler.js +0 -573
  534. package/dist/framework/tool-scheduler.js.map +0 -1
  535. package/dist/harness/harness.d.ts +0 -58
  536. package/dist/harness/harness.d.ts.map +0 -1
  537. package/dist/harness/harness.js +0 -195
  538. package/dist/harness/harness.js.map +0 -1
  539. package/dist/harness/safety.d.ts +0 -101
  540. package/dist/harness/safety.d.ts.map +0 -1
  541. package/dist/harness/safety.js +0 -322
  542. package/dist/harness/safety.js.map +0 -1
  543. package/dist/init.d.ts +0 -108
  544. package/dist/init.d.ts.map +0 -1
  545. package/dist/init.js +0 -393
  546. package/dist/init.js.map +0 -1
  547. package/dist/ink-ui/App.d.ts +0 -9
  548. package/dist/ink-ui/App.d.ts.map +0 -1
  549. package/dist/ink-ui/App.js +0 -12
  550. package/dist/ink-ui/App.js.map +0 -1
  551. package/dist/ink-ui/components/Markdown.d.ts +0 -10
  552. package/dist/ink-ui/components/Markdown.d.ts.map +0 -1
  553. package/dist/ink-ui/components/Markdown.js +0 -210
  554. package/dist/ink-ui/components/Markdown.js.map +0 -1
  555. package/dist/ink-ui/components/NativeCursor.d.ts +0 -12
  556. package/dist/ink-ui/components/NativeCursor.d.ts.map +0 -1
  557. package/dist/ink-ui/components/NativeCursor.js +0 -35
  558. package/dist/ink-ui/components/NativeCursor.js.map +0 -1
  559. package/dist/ink-ui/components/PixelHorseBanner.d.ts +0 -8
  560. package/dist/ink-ui/components/PixelHorseBanner.d.ts.map +0 -1
  561. package/dist/ink-ui/components/PixelHorseBanner.js +0 -97
  562. package/dist/ink-ui/components/PixelHorseBanner.js.map +0 -1
  563. package/dist/ink-ui/components/PromptInput.d.ts +0 -13
  564. package/dist/ink-ui/components/PromptInput.d.ts.map +0 -1
  565. package/dist/ink-ui/components/PromptInput.js +0 -30
  566. package/dist/ink-ui/components/PromptInput.js.map +0 -1
  567. package/dist/ink-ui/components/RunningHorseIndicator.d.ts +0 -13
  568. package/dist/ink-ui/components/RunningHorseIndicator.d.ts.map +0 -1
  569. package/dist/ink-ui/components/RunningHorseIndicator.js +0 -53
  570. package/dist/ink-ui/components/RunningHorseIndicator.js.map +0 -1
  571. package/dist/ink-ui/components/SelectList.d.ts +0 -16
  572. package/dist/ink-ui/components/SelectList.d.ts.map +0 -1
  573. package/dist/ink-ui/components/SelectList.js +0 -60
  574. package/dist/ink-ui/components/SelectList.js.map +0 -1
  575. package/dist/ink-ui/components/StatusLine.d.ts +0 -11
  576. package/dist/ink-ui/components/StatusLine.d.ts.map +0 -1
  577. package/dist/ink-ui/components/StatusLine.js +0 -70
  578. package/dist/ink-ui/components/StatusLine.js.map +0 -1
  579. package/dist/ink-ui/components/ToolActivity.d.ts +0 -19
  580. package/dist/ink-ui/components/ToolActivity.d.ts.map +0 -1
  581. package/dist/ink-ui/components/ToolActivity.js +0 -134
  582. package/dist/ink-ui/components/ToolActivity.js.map +0 -1
  583. package/dist/ink-ui/components/Transcript.d.ts +0 -14
  584. package/dist/ink-ui/components/Transcript.d.ts.map +0 -1
  585. package/dist/ink-ui/components/Transcript.js +0 -66
  586. package/dist/ink-ui/components/Transcript.js.map +0 -1
  587. package/dist/ink-ui/controllers/chat-controller.d.ts +0 -2
  588. package/dist/ink-ui/controllers/chat-controller.d.ts.map +0 -1
  589. package/dist/ink-ui/controllers/chat-controller.js.map +0 -1
  590. package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts +0 -6
  591. package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts.map +0 -1
  592. package/dist/ink-ui/hooks/use-raw-input-bridge.js +0 -27
  593. package/dist/ink-ui/hooks/use-raw-input-bridge.js.map +0 -1
  594. package/dist/ink-ui/hooks/use-terminal-size.d.ts +0 -7
  595. package/dist/ink-ui/hooks/use-terminal-size.d.ts.map +0 -1
  596. package/dist/ink-ui/hooks/use-terminal-size.js +0 -34
  597. package/dist/ink-ui/hooks/use-terminal-size.js.map +0 -1
  598. package/dist/ink-ui/launch.d.ts +0 -9
  599. package/dist/ink-ui/launch.d.ts.map +0 -1
  600. package/dist/ink-ui/launch.js +0 -101
  601. package/dist/ink-ui/launch.js.map +0 -1
  602. package/dist/ink-ui/runtime/grapheme.d.ts +0 -10
  603. package/dist/ink-ui/runtime/grapheme.d.ts.map +0 -1
  604. package/dist/ink-ui/runtime/grapheme.js +0 -17
  605. package/dist/ink-ui/runtime/grapheme.js.map +0 -1
  606. package/dist/ink-ui/runtime/input-buffer.d.ts +0 -10
  607. package/dist/ink-ui/runtime/input-buffer.d.ts.map +0 -1
  608. package/dist/ink-ui/runtime/input-buffer.js +0 -18
  609. package/dist/ink-ui/runtime/input-buffer.js.map +0 -1
  610. package/dist/ink-ui/runtime/layout-budget.d.ts +0 -13
  611. package/dist/ink-ui/runtime/layout-budget.d.ts.map +0 -1
  612. package/dist/ink-ui/runtime/layout-budget.js +0 -25
  613. package/dist/ink-ui/runtime/layout-budget.js.map +0 -1
  614. package/dist/ink-ui/runtime/native-cursor.d.ts +0 -62
  615. package/dist/ink-ui/runtime/native-cursor.d.ts.map +0 -1
  616. package/dist/ink-ui/runtime/native-cursor.js +0 -398
  617. package/dist/ink-ui/runtime/native-cursor.js.map +0 -1
  618. package/dist/ink-ui/runtime/prompt-layout.d.ts +0 -10
  619. package/dist/ink-ui/runtime/prompt-layout.d.ts.map +0 -1
  620. package/dist/ink-ui/runtime/prompt-layout.js +0 -21
  621. package/dist/ink-ui/runtime/prompt-layout.js.map +0 -1
  622. package/dist/ink-ui/runtime/raw-input.d.ts +0 -4
  623. package/dist/ink-ui/runtime/raw-input.d.ts.map +0 -1
  624. package/dist/ink-ui/runtime/raw-input.js +0 -15
  625. package/dist/ink-ui/runtime/raw-input.js.map +0 -1
  626. package/dist/ink-ui/runtime/transcript-state.d.ts +0 -37
  627. package/dist/ink-ui/runtime/transcript-state.d.ts.map +0 -1
  628. package/dist/ink-ui/runtime/transcript-state.js +0 -91
  629. package/dist/ink-ui/runtime/transcript-state.js.map +0 -1
  630. package/dist/ink-ui/screens/ReplScreen.d.ts +0 -27
  631. package/dist/ink-ui/screens/ReplScreen.d.ts.map +0 -1
  632. package/dist/ink-ui/screens/ReplScreen.js +0 -781
  633. package/dist/ink-ui/screens/ReplScreen.js.map +0 -1
  634. package/dist/ink-ui/types.d.ts +0 -2
  635. package/dist/ink-ui/types.d.ts.map +0 -1
  636. package/dist/ink-ui/types.js.map +0 -1
  637. package/dist/runtime/chat-checkpoint.d.ts +0 -17
  638. package/dist/runtime/chat-checkpoint.d.ts.map +0 -1
  639. package/dist/runtime/chat-checkpoint.js +0 -105
  640. package/dist/runtime/chat-checkpoint.js.map +0 -1
  641. package/dist/runtime/chat-command-scope.d.ts +0 -5
  642. package/dist/runtime/chat-command-scope.d.ts.map +0 -1
  643. package/dist/runtime/chat-command-scope.js +0 -22
  644. package/dist/runtime/chat-command-scope.js.map +0 -1
  645. package/dist/runtime/chat-compact.d.ts +0 -26
  646. package/dist/runtime/chat-compact.d.ts.map +0 -1
  647. package/dist/runtime/chat-compact.js +0 -132
  648. package/dist/runtime/chat-compact.js.map +0 -1
  649. package/dist/runtime/chat-controller.d.ts +0 -62
  650. package/dist/runtime/chat-controller.d.ts.map +0 -1
  651. package/dist/runtime/chat-controller.js +0 -1620
  652. package/dist/runtime/chat-controller.js.map +0 -1
  653. package/dist/runtime/chat-effort.d.ts +0 -5
  654. package/dist/runtime/chat-effort.d.ts.map +0 -1
  655. package/dist/runtime/chat-effort.js +0 -47
  656. package/dist/runtime/chat-effort.js.map +0 -1
  657. package/dist/runtime/chat-presentation.d.ts +0 -63
  658. package/dist/runtime/chat-presentation.d.ts.map +0 -1
  659. package/dist/runtime/chat-presentation.js +0 -561
  660. package/dist/runtime/chat-presentation.js.map +0 -1
  661. package/dist/runtime/chat-trace.d.ts +0 -52
  662. package/dist/runtime/chat-trace.d.ts.map +0 -1
  663. package/dist/runtime/chat-trace.js +0 -234
  664. package/dist/runtime/chat-trace.js.map +0 -1
  665. package/dist/runtime/chat-workspace.d.ts +0 -22
  666. package/dist/runtime/chat-workspace.d.ts.map +0 -1
  667. package/dist/runtime/chat-workspace.js +0 -154
  668. package/dist/runtime/chat-workspace.js.map +0 -1
  669. package/dist/runtime/goals/accounting.d.ts +0 -45
  670. package/dist/runtime/goals/accounting.d.ts.map +0 -1
  671. package/dist/runtime/goals/accounting.js +0 -114
  672. package/dist/runtime/goals/accounting.js.map +0 -1
  673. package/dist/runtime/goals/coordinator.d.ts +0 -92
  674. package/dist/runtime/goals/coordinator.d.ts.map +0 -1
  675. package/dist/runtime/goals/coordinator.js +0 -1471
  676. package/dist/runtime/goals/coordinator.js.map +0 -1
  677. package/dist/runtime/goals/lifecycle.d.ts +0 -13
  678. package/dist/runtime/goals/lifecycle.d.ts.map +0 -1
  679. package/dist/runtime/goals/lifecycle.js +0 -46
  680. package/dist/runtime/goals/lifecycle.js.map +0 -1
  681. package/dist/runtime/goals/prompt.d.ts +0 -16
  682. package/dist/runtime/goals/prompt.d.ts.map +0 -1
  683. package/dist/runtime/goals/prompt.js +0 -88
  684. package/dist/runtime/goals/prompt.js.map +0 -1
  685. package/dist/runtime/goals/stop-policy.d.ts +0 -9
  686. package/dist/runtime/goals/stop-policy.d.ts.map +0 -1
  687. package/dist/runtime/goals/stop-policy.js +0 -83
  688. package/dist/runtime/goals/stop-policy.js.map +0 -1
  689. package/dist/runtime/goals/tools.d.ts +0 -61
  690. package/dist/runtime/goals/tools.d.ts.map +0 -1
  691. package/dist/runtime/goals/tools.js +0 -568
  692. package/dist/runtime/goals/tools.js.map +0 -1
  693. package/dist/sdk/index.d.ts +0 -10
  694. package/dist/sdk/index.d.ts.map +0 -1
  695. package/dist/sdk/index.js +0 -23
  696. package/dist/sdk/index.js.map +0 -1
  697. package/dist/sdk/init.d.ts +0 -24
  698. package/dist/sdk/init.d.ts.map +0 -1
  699. package/dist/sdk/init.js +0 -48
  700. package/dist/sdk/init.js.map +0 -1
  701. package/dist/sdk/query.d.ts +0 -19
  702. package/dist/sdk/query.d.ts.map +0 -1
  703. package/dist/sdk/query.js +0 -42
  704. package/dist/sdk/query.js.map +0 -1
  705. package/dist/sdk/sessions.d.ts +0 -19
  706. package/dist/sdk/sessions.d.ts.map +0 -1
  707. package/dist/sdk/sessions.js +0 -57
  708. package/dist/sdk/sessions.js.map +0 -1
  709. package/dist/sdk/types.d.ts +0 -47
  710. package/dist/sdk/types.d.ts.map +0 -1
  711. package/dist/sdk/types.js +0 -8
  712. package/dist/sdk/types.js.map +0 -1
  713. package/dist/services/agent-runner.d.ts +0 -71
  714. package/dist/services/agent-runner.d.ts.map +0 -1
  715. package/dist/services/agent-runner.js +0 -185
  716. package/dist/services/agent-runner.js.map +0 -1
  717. package/dist/services/task-manager.d.ts +0 -161
  718. package/dist/services/task-manager.d.ts.map +0 -1
  719. package/dist/services/task-manager.js +0 -315
  720. package/dist/services/task-manager.js.map +0 -1
  721. package/dist/skills/discovery.d.ts +0 -22
  722. package/dist/skills/discovery.d.ts.map +0 -1
  723. package/dist/skills/discovery.js +0 -75
  724. package/dist/skills/discovery.js.map +0 -1
  725. package/dist/skills/index.d.ts +0 -11
  726. package/dist/skills/index.d.ts.map +0 -1
  727. package/dist/skills/index.js.map +0 -1
  728. package/dist/skills/loader.d.ts +0 -53
  729. package/dist/skills/loader.d.ts.map +0 -1
  730. package/dist/skills/loader.js +0 -421
  731. package/dist/skills/loader.js.map +0 -1
  732. package/dist/skills/registry.d.ts +0 -41
  733. package/dist/skills/registry.d.ts.map +0 -1
  734. package/dist/skills/registry.js +0 -157
  735. package/dist/skills/registry.js.map +0 -1
  736. package/dist/skills/runtime.d.ts +0 -46
  737. package/dist/skills/runtime.d.ts.map +0 -1
  738. package/dist/skills/runtime.js +0 -363
  739. package/dist/skills/runtime.js.map +0 -1
  740. package/dist/skills/types.d.ts +0 -112
  741. package/dist/skills/types.d.ts.map +0 -1
  742. package/dist/skills/types.js +0 -24
  743. package/dist/skills/types.js.map +0 -1
  744. package/dist/tools/index.d.ts +0 -52
  745. package/dist/tools/index.d.ts.map +0 -1
  746. package/dist/tools/index.js +0 -2268
  747. package/dist/tools/index.js.map +0 -1
  748. package/dist/tools/mcp.d.ts +0 -99
  749. package/dist/tools/mcp.d.ts.map +0 -1
  750. package/dist/tools/mcp.js +0 -695
  751. package/dist/tools/mcp.js.map +0 -1
  752. package/dist/tools/plan.d.ts +0 -17
  753. package/dist/tools/plan.d.ts.map +0 -1
  754. package/dist/tools/plan.js +0 -84
  755. package/dist/tools/plan.js.map +0 -1
  756. package/docs/migration/v0.1.8-to-v0.1.9.md +0 -60
  757. package/docs/plan/v0.1.9-release-checklist.md +0 -64
@@ -0,0 +1,159 @@
1
+ import type { ToolContext, ToolResult } from '../framework/tool';
2
+ import { ExecutionService, type BoundToolExecutionResultV1, type StepSnapshotV1, type ToolBindingDescriptorV1 } from './step-snapshot';
3
+ export type ToolPolicyBehaviorV1 = 'allow' | 'ask' | 'deny';
4
+ export type ToolTerminalV1 = 'completed' | 'failed' | 'interrupted' | 'indeterminate';
5
+ export interface ToolInvocationV1 {
6
+ readonly invocationId: string;
7
+ readonly parentInvocationId?: string;
8
+ readonly snapshot: StepSnapshotV1;
9
+ readonly toolName: string;
10
+ readonly args: Readonly<Record<string, unknown>>;
11
+ readonly context: ToolContext;
12
+ readonly abortSignal?: AbortSignal;
13
+ }
14
+ export interface ToolPolicyDecisionV1 {
15
+ readonly behavior: ToolPolicyBehaviorV1;
16
+ readonly source: string;
17
+ readonly reason?: string;
18
+ readonly digest: string;
19
+ }
20
+ export interface ToolApprovalDecisionV1 {
21
+ readonly approved: boolean;
22
+ readonly source: string;
23
+ readonly reason?: string;
24
+ readonly digest: string;
25
+ }
26
+ export interface SandboxPreparationV1 {
27
+ readonly backend: string;
28
+ readonly enforcement: 'full' | 'partial' | 'none';
29
+ readonly reason?: string;
30
+ readonly digest: string;
31
+ }
32
+ export interface ToolPolicyServiceV1 {
33
+ decide(input: {
34
+ readonly snapshot: StepSnapshotV1;
35
+ readonly descriptor: ToolBindingDescriptorV1;
36
+ readonly args: Readonly<Record<string, unknown>>;
37
+ }): Promise<ToolPolicyDecisionV1> | ToolPolicyDecisionV1;
38
+ }
39
+ export interface ToolApprovalServiceV1 {
40
+ decide(input: {
41
+ readonly snapshot: StepSnapshotV1;
42
+ readonly descriptor: ToolBindingDescriptorV1;
43
+ readonly args: Readonly<Record<string, unknown>>;
44
+ readonly policy: ToolPolicyDecisionV1;
45
+ readonly abortSignal?: AbortSignal;
46
+ }): Promise<ToolApprovalDecisionV1> | ToolApprovalDecisionV1;
47
+ }
48
+ export interface SandboxServiceV1 {
49
+ prepare(input: {
50
+ readonly snapshot: StepSnapshotV1;
51
+ readonly descriptor: ToolBindingDescriptorV1;
52
+ readonly args: Readonly<Record<string, unknown>>;
53
+ readonly abortSignal?: AbortSignal;
54
+ }): Promise<SandboxPreparationV1> | SandboxPreparationV1;
55
+ }
56
+ export interface ToolInvocationIntentV1 {
57
+ readonly version: 1;
58
+ readonly invocationId: string;
59
+ readonly parentInvocationId?: string;
60
+ readonly threadId: string;
61
+ readonly turnId: string;
62
+ readonly stepId: string;
63
+ readonly toolName: string;
64
+ readonly snapshotDigest: string;
65
+ readonly argsDigest: string;
66
+ readonly requestDigest: string;
67
+ readonly startedAt: number;
68
+ readonly digest: string;
69
+ }
70
+ export interface ToolInvocationReceiptV1 {
71
+ readonly version: 1;
72
+ readonly invocationId: string;
73
+ readonly parentInvocationId?: string;
74
+ readonly threadId: string;
75
+ readonly turnId: string;
76
+ readonly stepId: string;
77
+ readonly toolName: string;
78
+ readonly snapshotDigest: string;
79
+ readonly routerDigest: string;
80
+ readonly authorityDigest: string;
81
+ readonly executionPolicyDigest: string;
82
+ readonly intentDigest: string;
83
+ readonly policy?: ToolPolicyDecisionV1;
84
+ readonly approval?: ToolApprovalDecisionV1;
85
+ readonly sandbox?: SandboxPreparationV1;
86
+ readonly terminal: ToolTerminalV1;
87
+ readonly terminalPhase: 'capability' | 'policy' | 'approval' | 'sandbox' | 'execute';
88
+ readonly success: boolean;
89
+ readonly result: ToolResult;
90
+ readonly outputDigest: string;
91
+ readonly startedAt: number;
92
+ readonly finishedAt: number;
93
+ readonly durationMs: number;
94
+ readonly digest: string;
95
+ }
96
+ export interface ToolInvocationJournalEntryV1 {
97
+ readonly intent: ToolInvocationIntentV1;
98
+ readonly receipt?: ToolInvocationReceiptV1;
99
+ }
100
+ export interface ToolInvocationJournalV1 {
101
+ load(invocationId: string): Promise<ToolInvocationJournalEntryV1 | null>;
102
+ begin(intent: ToolInvocationIntentV1): Promise<void>;
103
+ complete(receipt: ToolInvocationReceiptV1): Promise<void>;
104
+ }
105
+ export interface ToolInvocationResultV1 {
106
+ readonly result: ToolResult;
107
+ readonly receipt: ToolInvocationReceiptV1;
108
+ }
109
+ export interface NestedToolInvocationV1 {
110
+ readonly invocationId: string;
111
+ readonly toolName: string;
112
+ readonly args: Readonly<Record<string, unknown>>;
113
+ }
114
+ /**
115
+ * ToolGateway-owned composite execution seam. Implementations may describe an
116
+ * aggregate operation, but every child effect must re-enter the same gateway.
117
+ */
118
+ export interface NestedToolExecutionServiceV1 {
119
+ handles(descriptor: ToolBindingDescriptorV1): boolean;
120
+ run(input: {
121
+ readonly invocation: ToolInvocationV1;
122
+ readonly descriptor: ToolBindingDescriptorV1;
123
+ readonly invokeChild: (child: NestedToolInvocationV1) => Promise<ToolInvocationResultV1>;
124
+ }): Promise<BoundToolExecutionResultV1>;
125
+ }
126
+ export interface ToolGatewayServicesV1 {
127
+ readonly policy: ToolPolicyServiceV1;
128
+ readonly approval: ToolApprovalServiceV1;
129
+ readonly sandbox: SandboxServiceV1;
130
+ readonly execution: ExecutionService;
131
+ readonly nested?: NestedToolExecutionServiceV1;
132
+ readonly journal: ToolInvocationJournalV1;
133
+ readonly clock?: () => number;
134
+ }
135
+ export declare class ToolGatewayError extends Error {
136
+ readonly code: 'ORION_TOOL_INVOCATION_INVALID' | 'ORION_TOOL_INVOCATION_CONFLICT' | 'ORION_TOOL_OUTCOME_INDETERMINATE' | 'ORION_TOOL_RECEIPT_PERSISTENCE';
137
+ readonly invocationId?: string | undefined;
138
+ constructor(code: 'ORION_TOOL_INVOCATION_INVALID' | 'ORION_TOOL_INVOCATION_CONFLICT' | 'ORION_TOOL_OUTCOME_INDETERMINATE' | 'ORION_TOOL_RECEIPT_PERSISTENCE', message: string, invocationId?: string | undefined);
139
+ }
140
+ /** Capability → Policy → Approval → Sandbox → Execute → durable terminal receipt. */
141
+ export declare class ToolGateway {
142
+ private readonly services;
143
+ private readonly inflight;
144
+ private readonly clock;
145
+ constructor(services: ToolGatewayServicesV1);
146
+ invoke(invocation: ToolInvocationV1): Promise<ToolInvocationResultV1>;
147
+ private invokeOnce;
148
+ private commitTerminal;
149
+ }
150
+ export declare class InMemoryToolInvocationJournalV1 implements ToolInvocationJournalV1 {
151
+ private readonly entries;
152
+ load(invocationId: string): Promise<ToolInvocationJournalEntryV1 | null>;
153
+ begin(intent: ToolInvocationIntentV1): Promise<void>;
154
+ complete(receipt: ToolInvocationReceiptV1): Promise<void>;
155
+ }
156
+ export declare function createStaticPolicyDecisionV1(input: Omit<ToolPolicyDecisionV1, 'digest'>): ToolPolicyDecisionV1;
157
+ export declare function createStaticApprovalDecisionV1(input: Omit<ToolApprovalDecisionV1, 'digest'>): ToolApprovalDecisionV1;
158
+ export declare function createSandboxPreparationV1(input: Omit<SandboxPreparationV1, 'digest'>): SandboxPreparationV1;
159
+ //# sourceMappingURL=tool-gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-gateway.d.ts","sourceRoot":"","sources":["../../src/runtime/tool-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGjE,OAAO,EACL,gBAAgB,EAChB,KAAK,0BAA0B,EAC/B,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC7B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,CAAC;AAEtF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAA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E,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,GAC5C,sBAAsB,CAExB;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,GAC1C,oBAAoB,CAEtB"}
@@ -0,0 +1,311 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InMemoryToolInvocationJournalV1 = exports.ToolGateway = exports.ToolGatewayError = void 0;
4
+ exports.createStaticPolicyDecisionV1 = createStaticPolicyDecisionV1;
5
+ exports.createStaticApprovalDecisionV1 = createStaticApprovalDecisionV1;
6
+ exports.createSandboxPreparationV1 = createSandboxPreparationV1;
7
+ const canonical_1 = require("./protocol/canonical");
8
+ const runtime_protocol_v1_1 = require("./protocol/runtime-protocol-v1");
9
+ class ToolGatewayError extends Error {
10
+ constructor(code, message, invocationId) {
11
+ super(message);
12
+ this.code = code;
13
+ this.invocationId = invocationId;
14
+ this.name = 'ToolGatewayError';
15
+ }
16
+ }
17
+ exports.ToolGatewayError = ToolGatewayError;
18
+ /** Capability → Policy → Approval → Sandbox → Execute → durable terminal receipt. */
19
+ class ToolGateway {
20
+ constructor(services) {
21
+ this.services = services;
22
+ this.inflight = new Map();
23
+ this.clock = services.clock ?? Date.now;
24
+ }
25
+ invoke(invocation) {
26
+ const existing = this.inflight.get(invocation.invocationId);
27
+ if (existing)
28
+ return existing;
29
+ const run = this.invokeOnce(invocation).finally(() => this.inflight.delete(invocation.invocationId));
30
+ this.inflight.set(invocation.invocationId, run);
31
+ return run;
32
+ }
33
+ async invokeOnce(invocation) {
34
+ validateInvocation(invocation);
35
+ const startedAt = this.clock();
36
+ const intent = createIntent(invocation, startedAt);
37
+ const existing = await this.services.journal.load(invocation.invocationId);
38
+ if (existing) {
39
+ if (existing.intent.requestDigest !== intent.requestDigest) {
40
+ throw new ToolGatewayError('ORION_TOOL_INVOCATION_CONFLICT', 'Invocation ID was reused with different arguments or snapshot', invocation.invocationId);
41
+ }
42
+ if (existing.receipt) {
43
+ return deepFreeze({ result: existing.receipt.result, receipt: existing.receipt });
44
+ }
45
+ throw new ToolGatewayError('ORION_TOOL_OUTCOME_INDETERMINATE', 'Invocation has a durable start but no terminal receipt; automatic re-execution is unsafe', invocation.invocationId);
46
+ }
47
+ await this.services.journal.begin(intent);
48
+ const descriptor = invocation.snapshot.toolRouter.resolveDescriptor(invocation.toolName);
49
+ if (!descriptor || !isDirectCapability(invocation.snapshot, descriptor.name)) {
50
+ return this.commitTerminal(invocation, intent, {
51
+ terminal: 'failed',
52
+ terminalPhase: 'capability',
53
+ result: failure(`Tool is not direct in this StepSnapshot: ${invocation.toolName}`),
54
+ });
55
+ }
56
+ let policy;
57
+ try {
58
+ policy = validatePolicyDecision(await this.services.policy.decide({
59
+ snapshot: invocation.snapshot,
60
+ descriptor,
61
+ args: invocation.args,
62
+ }));
63
+ }
64
+ catch (error) {
65
+ return this.commitTerminal(invocation, intent, {
66
+ terminal: 'failed',
67
+ terminalPhase: 'policy',
68
+ result: failure(`Policy failed closed: ${errorMessage(error)}`),
69
+ });
70
+ }
71
+ if (policy.behavior === 'deny') {
72
+ return this.commitTerminal(invocation, intent, {
73
+ policy,
74
+ terminal: 'failed',
75
+ terminalPhase: 'policy',
76
+ result: failure(policy.reason ?? 'Tool denied by policy'),
77
+ });
78
+ }
79
+ let approval;
80
+ if (policy.behavior === 'ask') {
81
+ try {
82
+ approval = validateApprovalDecision(await this.services.approval.decide({
83
+ snapshot: invocation.snapshot,
84
+ descriptor,
85
+ args: invocation.args,
86
+ policy,
87
+ abortSignal: invocation.abortSignal,
88
+ }));
89
+ }
90
+ catch (error) {
91
+ return this.commitTerminal(invocation, intent, {
92
+ policy,
93
+ terminal: 'failed',
94
+ terminalPhase: 'approval',
95
+ result: failure(`Approval failed closed: ${errorMessage(error)}`),
96
+ });
97
+ }
98
+ if (!approval.approved) {
99
+ return this.commitTerminal(invocation, intent, {
100
+ policy,
101
+ approval,
102
+ terminal: invocation.abortSignal?.aborted ? 'interrupted' : 'failed',
103
+ terminalPhase: 'approval',
104
+ result: failure(approval.reason ?? 'Tool approval denied'),
105
+ });
106
+ }
107
+ }
108
+ let sandbox;
109
+ try {
110
+ sandbox = validateSandboxPreparation(await this.services.sandbox.prepare({
111
+ snapshot: invocation.snapshot,
112
+ descriptor,
113
+ args: invocation.args,
114
+ abortSignal: invocation.abortSignal,
115
+ }));
116
+ }
117
+ catch (error) {
118
+ return this.commitTerminal(invocation, intent, {
119
+ policy,
120
+ approval,
121
+ terminal: 'failed',
122
+ terminalPhase: 'sandbox',
123
+ result: failure(`Sandbox preparation failed closed: ${errorMessage(error)}`),
124
+ });
125
+ }
126
+ let executed;
127
+ try {
128
+ const nested = this.services.nested;
129
+ executed =
130
+ nested?.handles(descriptor) === true
131
+ ? await nested.run({
132
+ invocation,
133
+ descriptor,
134
+ invokeChild: child => this.invoke({
135
+ invocationId: child.invocationId,
136
+ parentInvocationId: invocation.invocationId,
137
+ snapshot: invocation.snapshot,
138
+ toolName: child.toolName,
139
+ args: structuredClone(child.args),
140
+ context: invocation.context,
141
+ abortSignal: invocation.abortSignal,
142
+ }),
143
+ })
144
+ : await this.services.execution.run({
145
+ snapshot: invocation.snapshot,
146
+ toolName: invocation.toolName,
147
+ args: structuredClone(invocation.args),
148
+ context: invocation.context,
149
+ enforcement: sandbox.enforcement,
150
+ abortSignal: invocation.abortSignal,
151
+ });
152
+ }
153
+ catch (error) {
154
+ executed = {
155
+ terminal: invocation.abortSignal?.aborted ? 'interrupted' : 'failed',
156
+ result: failure(`Nested execution failed closed: ${errorMessage(error)}`),
157
+ durationMs: Math.max(0, this.clock() - intent.startedAt),
158
+ };
159
+ }
160
+ return this.commitTerminal(invocation, intent, {
161
+ policy,
162
+ approval,
163
+ sandbox,
164
+ terminal: executed.terminal,
165
+ terminalPhase: 'execute',
166
+ result: executed.result,
167
+ durationMs: executed.durationMs,
168
+ });
169
+ }
170
+ async commitTerminal(invocation, intent, outcome) {
171
+ const finishedAt = this.clock();
172
+ const content = {
173
+ version: 1,
174
+ invocationId: invocation.invocationId,
175
+ parentInvocationId: invocation.parentInvocationId,
176
+ threadId: invocation.snapshot.threadId,
177
+ turnId: invocation.snapshot.turnId,
178
+ stepId: invocation.snapshot.stepId,
179
+ toolName: invocation.toolName,
180
+ snapshotDigest: invocation.snapshot.digest,
181
+ routerDigest: invocation.snapshot.toolRouter.digest,
182
+ authorityDigest: invocation.snapshot.authority.digest,
183
+ executionPolicyDigest: invocation.snapshot.executionPolicy.digest,
184
+ intentDigest: intent.digest,
185
+ policy: outcome.policy,
186
+ approval: outcome.approval,
187
+ sandbox: outcome.sandbox,
188
+ terminal: outcome.terminal,
189
+ terminalPhase: outcome.terminalPhase,
190
+ success: outcome.terminal === 'completed' && outcome.result.success,
191
+ result: structuredClone(outcome.result),
192
+ outputDigest: (0, canonical_1.digestRuntimeValue)(outcome.result),
193
+ startedAt: intent.startedAt,
194
+ finishedAt,
195
+ durationMs: outcome.durationMs ?? Math.max(0, finishedAt - intent.startedAt),
196
+ };
197
+ const receipt = deepFreeze({ ...content, digest: (0, canonical_1.digestRuntimeValue)(content) });
198
+ try {
199
+ await this.services.journal.complete(receipt);
200
+ }
201
+ catch (error) {
202
+ throw new ToolGatewayError('ORION_TOOL_RECEIPT_PERSISTENCE', `Tool terminal receipt was not committed: ${errorMessage(error)}`, invocation.invocationId);
203
+ }
204
+ return deepFreeze({ result: receipt.result, receipt });
205
+ }
206
+ }
207
+ exports.ToolGateway = ToolGateway;
208
+ class InMemoryToolInvocationJournalV1 {
209
+ constructor() {
210
+ this.entries = new Map();
211
+ }
212
+ async load(invocationId) {
213
+ return this.entries.get(invocationId) ?? null;
214
+ }
215
+ async begin(intent) {
216
+ if (this.entries.has(intent.invocationId)) {
217
+ throw new ToolGatewayError('ORION_TOOL_INVOCATION_CONFLICT', `Invocation ${intent.invocationId} already started`, intent.invocationId);
218
+ }
219
+ this.entries.set(intent.invocationId, deepFreeze({ intent }));
220
+ }
221
+ async complete(receipt) {
222
+ const entry = this.entries.get(receipt.invocationId);
223
+ if (!entry || entry.intent.digest !== receipt.intentDigest || entry.receipt) {
224
+ throw new ToolGatewayError('ORION_TOOL_INVOCATION_CONFLICT', `Invocation ${receipt.invocationId} cannot accept another terminal receipt`, receipt.invocationId);
225
+ }
226
+ this.entries.set(receipt.invocationId, deepFreeze({ ...entry, receipt }));
227
+ }
228
+ }
229
+ exports.InMemoryToolInvocationJournalV1 = InMemoryToolInvocationJournalV1;
230
+ function createStaticPolicyDecisionV1(input) {
231
+ return deepFreeze({ ...input, digest: (0, canonical_1.digestRuntimeValue)(input) });
232
+ }
233
+ function createStaticApprovalDecisionV1(input) {
234
+ return deepFreeze({ ...input, digest: (0, canonical_1.digestRuntimeValue)(input) });
235
+ }
236
+ function createSandboxPreparationV1(input) {
237
+ return deepFreeze({ ...input, digest: (0, canonical_1.digestRuntimeValue)(input) });
238
+ }
239
+ function createIntent(invocation, startedAt) {
240
+ const requestDigest = (0, canonical_1.digestRuntimeValue)({
241
+ invocationId: invocation.invocationId,
242
+ parentInvocationId: invocation.parentInvocationId,
243
+ threadId: invocation.snapshot.threadId,
244
+ turnId: invocation.snapshot.turnId,
245
+ stepId: invocation.snapshot.stepId,
246
+ toolName: invocation.toolName,
247
+ snapshotDigest: invocation.snapshot.digest,
248
+ argsDigest: (0, canonical_1.digestRuntimeValue)(invocation.args),
249
+ });
250
+ const content = {
251
+ version: 1,
252
+ invocationId: invocation.invocationId,
253
+ parentInvocationId: invocation.parentInvocationId,
254
+ threadId: invocation.snapshot.threadId,
255
+ turnId: invocation.snapshot.turnId,
256
+ stepId: invocation.snapshot.stepId,
257
+ toolName: invocation.toolName,
258
+ snapshotDigest: invocation.snapshot.digest,
259
+ argsDigest: (0, canonical_1.digestRuntimeValue)(invocation.args),
260
+ requestDigest,
261
+ startedAt,
262
+ };
263
+ return deepFreeze({ ...content, digest: (0, canonical_1.digestRuntimeValue)(content) });
264
+ }
265
+ function isDirectCapability(snapshot, toolName) {
266
+ return snapshot.capabilityPlan.direct.some(entry => entry.id === toolName);
267
+ }
268
+ function validateInvocation(invocation) {
269
+ if (!(0, runtime_protocol_v1_1.isRuntimeId)(invocation.invocationId)) {
270
+ throw new ToolGatewayError('ORION_TOOL_INVOCATION_INVALID', 'invocationId must be a UUID', invocation.invocationId);
271
+ }
272
+ if (invocation.parentInvocationId && !(0, runtime_protocol_v1_1.isRuntimeId)(invocation.parentInvocationId)) {
273
+ throw new ToolGatewayError('ORION_TOOL_INVOCATION_INVALID', 'parentInvocationId must be a UUID', invocation.invocationId);
274
+ }
275
+ if (!invocation.toolName.trim()) {
276
+ throw new ToolGatewayError('ORION_TOOL_INVOCATION_INVALID', 'toolName must not be empty', invocation.invocationId);
277
+ }
278
+ }
279
+ function validatePolicyDecision(value) {
280
+ if (!['allow', 'ask', 'deny'].includes(value.behavior) || !value.source || !value.digest) {
281
+ throw new Error('Malformed policy decision');
282
+ }
283
+ return value;
284
+ }
285
+ function validateApprovalDecision(value) {
286
+ if (typeof value.approved !== 'boolean' || !value.source || !value.digest) {
287
+ throw new Error('Malformed approval decision');
288
+ }
289
+ return value;
290
+ }
291
+ function validateSandboxPreparation(value) {
292
+ if (!['full', 'partial', 'none'].includes(value.enforcement) || !value.backend || !value.digest) {
293
+ throw new Error('Malformed sandbox preparation');
294
+ }
295
+ return value;
296
+ }
297
+ function failure(error) {
298
+ return { success: false, output: '', error };
299
+ }
300
+ function errorMessage(error) {
301
+ return error instanceof Error ? error.message : String(error);
302
+ }
303
+ function deepFreeze(value) {
304
+ if (typeof value !== 'object' || value === null || Object.isFrozen(value))
305
+ return value;
306
+ Object.freeze(value);
307
+ for (const entry of Object.values(value))
308
+ deepFreeze(entry);
309
+ return value;
310
+ }
311
+ //# sourceMappingURL=tool-gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-gateway.js","sourceRoot":"","sources":["../../src/runtime/tool-gateway.ts"],"names":[],"mappings":";;;AA8aA,oEAIC;AA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,+BAA+B,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,OAAO,CAAC,KAAa;IAC5B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,UAAU,CAAI,KAAQ;IAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxF,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC;QAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACvF,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,103 @@
1
+ import type { Message } from '../services/llm';
2
+ import type { HarnessState } from '../harness/types';
3
+ import type { StopDecision } from '../framework/stop-decision';
4
+ import { ThreadEventStore } from './thread-event-store';
5
+ export type TurnCommitTerminalV1 = {
6
+ readonly status: 'completed';
7
+ readonly outcome?: string;
8
+ } | {
9
+ readonly status: 'failed';
10
+ readonly error: string;
11
+ } | {
12
+ readonly status: 'interrupted';
13
+ readonly reason?: string;
14
+ };
15
+ export type PlanExecutionModeV1 = 'build' | 'auto';
16
+ /** Product-owned input; the journal binds it to the authoritative turn facts. */
17
+ export interface PlanTurnCommitInputV1 {
18
+ readonly plan: string;
19
+ readonly returnMode: PlanExecutionModeV1;
20
+ readonly promptReceiptDigest: string;
21
+ }
22
+ /**
23
+ * Atomic receipt for the PLAN -> execution boundary.
24
+ *
25
+ * The plan body is intentionally persisted here as well as in history so the
26
+ * next logical turn never has to infer which assistant message was approved as
27
+ * the executable plan. Every other field binds it to the same TurnCommit.
28
+ */
29
+ export interface PlanReceiptV1 {
30
+ readonly version: 1;
31
+ readonly threadId: string;
32
+ readonly turnId: string;
33
+ readonly plan: string;
34
+ readonly planDigest: string;
35
+ readonly returnMode: PlanExecutionModeV1;
36
+ readonly historyDigest: string;
37
+ readonly taskContextDigest: string;
38
+ readonly taskContextRevision: number;
39
+ readonly stopDecisionDigest: string;
40
+ readonly capabilityReceiptDigests: readonly string[];
41
+ readonly toolReceiptDigests: readonly string[];
42
+ readonly promptReceiptDigest: string;
43
+ readonly createdAt: number;
44
+ readonly digest: string;
45
+ }
46
+ export interface ThreadTurnCommitInputV1 {
47
+ readonly commitId?: string;
48
+ readonly turnId: string;
49
+ readonly history: readonly Message[];
50
+ readonly taskContextState: HarnessState;
51
+ readonly taskContextRevision: number;
52
+ readonly terminal: TurnCommitTerminalV1;
53
+ readonly goalState?: unknown;
54
+ readonly compactPointer?: unknown;
55
+ readonly stopDecision?: StopDecision;
56
+ readonly plan?: PlanTurnCommitInputV1;
57
+ readonly createdAt?: number;
58
+ }
59
+ export interface TurnCommitV1 {
60
+ readonly version: 1;
61
+ readonly commitId: string;
62
+ readonly threadId: string;
63
+ readonly turnId: string;
64
+ readonly sourceCursor: number;
65
+ readonly terminal: 'completed' | 'failed' | 'interrupted';
66
+ readonly outcome?: string;
67
+ readonly error?: string;
68
+ readonly reason?: string;
69
+ readonly history: string;
70
+ readonly historyDigest: string;
71
+ readonly taskContext: string;
72
+ readonly taskContextDigest: string;
73
+ readonly taskContextRevision: number;
74
+ readonly goalState?: string;
75
+ readonly goalStateDigest?: string;
76
+ readonly compactPointer?: string;
77
+ readonly compactPointerDigest?: string;
78
+ readonly stopDecision?: string;
79
+ readonly stopDecisionDigest?: string;
80
+ readonly planReceipt?: string;
81
+ readonly planReceiptDigest?: string;
82
+ readonly stepSnapshotDigests: readonly string[];
83
+ readonly capabilityReceiptDigests: readonly string[];
84
+ readonly toolReceiptDigests: readonly string[];
85
+ readonly createdAt: number;
86
+ readonly digest: string;
87
+ }
88
+ export declare class TurnCommitError extends Error {
89
+ readonly code: 'ORION_TURN_COMMIT_INVALID' | 'ORION_TURN_COMMIT_CONFLICT' | 'ORION_TURN_COMMIT_OPEN_ITEM';
90
+ constructor(code: 'ORION_TURN_COMMIT_INVALID' | 'ORION_TURN_COMMIT_CONFLICT' | 'ORION_TURN_COMMIT_OPEN_ITEM', message: string);
91
+ }
92
+ /** Atomic durable owner for transcript, TaskContext, Goal, compact and receipts. */
93
+ export declare class ThreadTurnCommitJournalV1 {
94
+ private readonly store;
95
+ private readonly clock;
96
+ constructor(store: ThreadEventStore, clock?: () => number);
97
+ commit(input: ThreadTurnCommitInputV1): TurnCommitV1;
98
+ }
99
+ export declare function createTurnCommitV1(input: Omit<TurnCommitV1, 'version' | 'terminal' | 'history' | 'historyDigest' | 'taskContext' | 'taskContextDigest' | 'goalState' | 'goalStateDigest' | 'compactPointer' | 'compactPointerDigest' | 'stopDecision' | 'stopDecisionDigest' | 'planReceipt' | 'planReceiptDigest' | 'digest'> & Pick<ThreadTurnCommitInputV1, 'history' | 'taskContextState' | 'goalState' | 'compactPointer' | 'stopDecision' | 'plan' | 'terminal'>): TurnCommitV1;
100
+ export declare function parseTurnCommitV1(receipt: string): TurnCommitV1;
101
+ export declare function createPlanReceiptV1(input: Omit<PlanReceiptV1, 'version' | 'planDigest' | 'digest'>): PlanReceiptV1;
102
+ export declare function parsePlanReceiptV1(receipt: string): PlanReceiptV1;
103
+ //# sourceMappingURL=turn-commit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-commit.d.ts","sourceRoot":"","sources":["../../src/runtime/turn-commit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,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