@orion-agents/orion-code 0.1.8 → 0.2.0

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 (861) hide show
  1. package/CHANGELOG.md +495 -0
  2. package/README.md +142 -314
  3. package/README.zh-CN.md +117 -559
  4. package/dist/cli.js +71 -90
  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 +174 -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 +2 -2
  29. package/dist/commands/model-command-handlers.d.ts.map +1 -1
  30. package/dist/commands/model-command-handlers.js +168 -3
  31. package/dist/commands/model-command-handlers.js.map +1 -1
  32. package/dist/commands/model-commands.d.ts.map +1 -1
  33. package/dist/commands/model-commands.js +0 -11
  34. package/dist/commands/model-commands.js.map +1 -1
  35. package/dist/commands/registry.d.ts.map +1 -1
  36. package/dist/commands/registry.js +1 -139
  37. package/dist/commands/registry.js.map +1 -1
  38. package/dist/commands/session-command-handlers.d.ts.map +1 -1
  39. package/dist/commands/session-command-handlers.js +35 -119
  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 +2 -50
  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 +14 -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 +8 -6
  66. package/dist/framework/index.d.ts.map +1 -1
  67. package/dist/framework/index.js +14 -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 +71 -26
  77. package/dist/framework/query.d.ts.map +1 -1
  78. package/dist/framework/query.js +371 -102
  79. package/dist/framework/query.js.map +1 -1
  80. package/dist/framework/stop-decision.d.ts +56 -0
  81. package/dist/framework/stop-decision.d.ts.map +1 -0
  82. package/dist/framework/stop-decision.js +36 -0
  83. package/dist/framework/stop-decision.js.map +1 -0
  84. package/dist/framework/store.d.ts +4 -2
  85. package/dist/framework/store.d.ts.map +1 -1
  86. package/dist/framework/store.js +1 -0
  87. package/dist/framework/store.js.map +1 -1
  88. package/dist/framework/tool-call-orchestrator.d.ts +80 -0
  89. package/dist/framework/tool-call-orchestrator.d.ts.map +1 -0
  90. package/dist/framework/tool-call-orchestrator.js +192 -0
  91. package/dist/framework/tool-call-orchestrator.js.map +1 -0
  92. package/dist/framework/tool-state.d.ts +12 -11
  93. package/dist/framework/tool-state.d.ts.map +1 -1
  94. package/dist/framework/tool-state.js +36 -28
  95. package/dist/framework/tool-state.js.map +1 -1
  96. package/dist/framework/tool.d.ts +0 -9
  97. package/dist/framework/tool.d.ts.map +1 -1
  98. package/dist/framework/tool.js.map +1 -1
  99. package/dist/harness/assembler.d.ts.map +1 -1
  100. package/dist/harness/assembler.js +77 -19
  101. package/dist/harness/assembler.js.map +1 -1
  102. package/dist/harness/capability-profile.d.ts +3 -0
  103. package/dist/harness/capability-profile.d.ts.map +1 -0
  104. package/dist/harness/capability-profile.js +44 -0
  105. package/dist/harness/capability-profile.js.map +1 -0
  106. package/dist/harness/capsule.d.ts.map +1 -1
  107. package/dist/harness/capsule.js +22 -3
  108. package/dist/harness/capsule.js.map +1 -1
  109. package/dist/harness/compact-benchmark-corpus.d.ts +10 -0
  110. package/dist/harness/compact-benchmark-corpus.d.ts.map +1 -0
  111. package/dist/harness/compact-benchmark-corpus.js +56 -0
  112. package/dist/harness/compact-benchmark-corpus.js.map +1 -0
  113. package/dist/harness/context-harness.d.ts +23 -3
  114. package/dist/harness/context-harness.d.ts.map +1 -1
  115. package/dist/harness/context-harness.js +183 -11
  116. package/dist/harness/context-harness.js.map +1 -1
  117. package/dist/harness/contract.d.ts.map +1 -1
  118. package/dist/harness/contract.js +106 -11
  119. package/dist/harness/contract.js.map +1 -1
  120. package/dist/harness/drift-guard.d.ts +2 -1
  121. package/dist/harness/drift-guard.d.ts.map +1 -1
  122. package/dist/harness/drift-guard.js +315 -20
  123. package/dist/harness/drift-guard.js.map +1 -1
  124. package/dist/harness/evidence.d.ts.map +1 -1
  125. package/dist/harness/evidence.js +25 -12
  126. package/dist/harness/evidence.js.map +1 -1
  127. package/dist/harness/index.d.ts +7 -2
  128. package/dist/harness/index.d.ts.map +1 -1
  129. package/dist/harness/index.js +19 -1
  130. package/dist/harness/index.js.map +1 -1
  131. package/dist/harness/ledger.d.ts.map +1 -1
  132. package/dist/harness/ledger.js +44 -14
  133. package/dist/harness/ledger.js.map +1 -1
  134. package/dist/harness/progress-controller.d.ts +14 -0
  135. package/dist/harness/progress-controller.d.ts.map +1 -0
  136. package/dist/harness/progress-controller.js +110 -0
  137. package/dist/harness/progress-controller.js.map +1 -0
  138. package/dist/harness/state.d.ts.map +1 -1
  139. package/dist/harness/state.js +5 -2
  140. package/dist/harness/state.js.map +1 -1
  141. package/dist/harness/stop-controller.d.ts +15 -0
  142. package/dist/harness/stop-controller.d.ts.map +1 -0
  143. package/dist/harness/stop-controller.js +87 -0
  144. package/dist/harness/stop-controller.js.map +1 -0
  145. package/dist/harness/types.d.ts +137 -0
  146. package/dist/harness/types.d.ts.map +1 -1
  147. package/dist/harness/verification.d.ts +7 -0
  148. package/dist/harness/verification.d.ts.map +1 -0
  149. package/dist/harness/verification.js +122 -0
  150. package/dist/harness/verification.js.map +1 -0
  151. package/dist/index.d.ts +70 -26
  152. package/dist/index.d.ts.map +1 -1
  153. package/dist/index.js +64 -59
  154. package/dist/index.js.map +1 -1
  155. package/dist/memory/index.d.ts +1 -0
  156. package/dist/memory/index.d.ts.map +1 -1
  157. package/dist/memory/index.js +1 -0
  158. package/dist/memory/index.js.map +1 -1
  159. package/dist/memory/prompt-context.d.ts +42 -0
  160. package/dist/memory/prompt-context.d.ts.map +1 -0
  161. package/dist/memory/prompt-context.js +129 -0
  162. package/dist/memory/prompt-context.js.map +1 -0
  163. package/dist/print-ui/launch.d.ts.map +1 -1
  164. package/dist/print-ui/launch.js +9 -2
  165. package/dist/print-ui/launch.js.map +1 -1
  166. package/dist/product/paths.d.ts +7 -0
  167. package/dist/product/paths.d.ts.map +1 -1
  168. package/dist/product/paths.js +19 -0
  169. package/dist/product/paths.js.map +1 -1
  170. package/dist/runtime/agent-loop.d.ts +78 -0
  171. package/dist/runtime/agent-loop.d.ts.map +1 -0
  172. package/dist/runtime/agent-loop.js +418 -0
  173. package/dist/runtime/agent-loop.js.map +1 -0
  174. package/dist/runtime/agent-runtime-controller.d.ts +10 -57
  175. package/dist/runtime/agent-runtime-controller.d.ts.map +1 -1
  176. package/dist/runtime/agent-runtime-controller.js +265 -1215
  177. package/dist/runtime/agent-runtime-controller.js.map +1 -1
  178. package/dist/runtime/agent-runtime-protocol.d.ts +4 -5
  179. package/dist/runtime/agent-runtime-protocol.d.ts.map +1 -1
  180. package/dist/runtime/agent-runtime-protocol.js.map +1 -1
  181. package/dist/runtime/agent-runtime-runner.d.ts +34 -0
  182. package/dist/runtime/agent-runtime-runner.d.ts.map +1 -0
  183. package/dist/runtime/agent-runtime-runner.js +3 -0
  184. package/dist/runtime/agent-runtime-runner.js.map +1 -0
  185. package/dist/runtime/batch-read-service.d.ts +29 -0
  186. package/dist/runtime/batch-read-service.d.ts.map +1 -0
  187. package/dist/runtime/batch-read-service.js +212 -0
  188. package/dist/runtime/batch-read-service.js.map +1 -0
  189. package/dist/runtime/builtin-tool-provider.d.ts +30 -0
  190. package/dist/runtime/builtin-tool-provider.d.ts.map +1 -0
  191. package/dist/runtime/builtin-tool-provider.js +233 -0
  192. package/dist/runtime/builtin-tool-provider.js.map +1 -0
  193. package/dist/runtime/capabilities/compiler.d.ts +11 -0
  194. package/dist/runtime/capabilities/compiler.d.ts.map +1 -0
  195. package/dist/runtime/capabilities/compiler.js +719 -0
  196. package/dist/runtime/capabilities/compiler.js.map +1 -0
  197. package/dist/runtime/capabilities/index.d.ts +3 -0
  198. package/dist/runtime/capabilities/index.d.ts.map +1 -0
  199. package/dist/runtime/capabilities/index.js +9 -0
  200. package/dist/runtime/capabilities/index.js.map +1 -0
  201. package/dist/runtime/capabilities/types.d.ts +175 -0
  202. package/dist/runtime/capabilities/types.d.ts.map +1 -0
  203. package/dist/runtime/capabilities/types.js +3 -0
  204. package/dist/runtime/capabilities/types.js.map +1 -0
  205. package/dist/runtime/capability-receipt-journal.d.ts +29 -0
  206. package/dist/runtime/capability-receipt-journal.d.ts.map +1 -0
  207. package/dist/runtime/capability-receipt-journal.js +264 -0
  208. package/dist/runtime/capability-receipt-journal.js.map +1 -0
  209. package/dist/runtime/capability-step-factory.d.ts +73 -0
  210. package/dist/runtime/capability-step-factory.d.ts.map +1 -0
  211. package/dist/runtime/capability-step-factory.js +302 -0
  212. package/dist/runtime/capability-step-factory.js.map +1 -0
  213. package/dist/runtime/compact-transaction.d.ts +225 -0
  214. package/dist/runtime/compact-transaction.d.ts.map +1 -0
  215. package/dist/runtime/compact-transaction.js +622 -0
  216. package/dist/runtime/compact-transaction.js.map +1 -0
  217. package/dist/runtime/composer/buffer.d.ts +3 -4
  218. package/dist/runtime/composer/buffer.d.ts.map +1 -1
  219. package/dist/runtime/composer/buffer.js +3 -4
  220. package/dist/runtime/composer/buffer.js.map +1 -1
  221. package/dist/runtime/composer/grapheme.d.ts +2 -4
  222. package/dist/runtime/composer/grapheme.d.ts.map +1 -1
  223. package/dist/runtime/composer/grapheme.js +2 -4
  224. package/dist/runtime/composer/grapheme.js.map +1 -1
  225. package/dist/runtime/composer/layout.d.ts +1 -3
  226. package/dist/runtime/composer/layout.d.ts.map +1 -1
  227. package/dist/runtime/composer/layout.js +1 -3
  228. package/dist/runtime/composer/layout.js.map +1 -1
  229. package/dist/runtime/core-tools/descriptors.d.ts +17 -0
  230. package/dist/runtime/core-tools/descriptors.d.ts.map +1 -0
  231. package/dist/runtime/core-tools/descriptors.js +185 -0
  232. package/dist/runtime/core-tools/descriptors.js.map +1 -0
  233. package/dist/runtime/first-party-core-provider.d.ts +55 -0
  234. package/dist/runtime/first-party-core-provider.d.ts.map +1 -0
  235. package/dist/runtime/first-party-core-provider.js +197 -0
  236. package/dist/runtime/first-party-core-provider.js.map +1 -0
  237. package/dist/runtime/first-party-long-tail-provider.d.ts +57 -0
  238. package/dist/runtime/first-party-long-tail-provider.d.ts.map +1 -0
  239. package/dist/runtime/first-party-long-tail-provider.js +238 -0
  240. package/dist/runtime/first-party-long-tail-provider.js.map +1 -0
  241. package/dist/runtime/first-party-tool-services.d.ts +43 -0
  242. package/dist/runtime/first-party-tool-services.d.ts.map +1 -0
  243. package/dist/runtime/first-party-tool-services.js +200 -0
  244. package/dist/runtime/first-party-tool-services.js.map +1 -0
  245. package/dist/runtime/first-party-tool-universe.d.ts +14 -0
  246. package/dist/runtime/first-party-tool-universe.d.ts.map +1 -0
  247. package/dist/runtime/first-party-tool-universe.js +20 -0
  248. package/dist/runtime/first-party-tool-universe.js.map +1 -0
  249. package/dist/runtime/goal-lifecycle-v2.d.ts +63 -0
  250. package/dist/runtime/goal-lifecycle-v2.d.ts.map +1 -0
  251. package/dist/runtime/goal-lifecycle-v2.js +253 -0
  252. package/dist/runtime/goal-lifecycle-v2.js.map +1 -0
  253. package/dist/runtime/goal-runtime-coordinator.d.ts +105 -0
  254. package/dist/runtime/goal-runtime-coordinator.d.ts.map +1 -0
  255. package/dist/runtime/goal-runtime-coordinator.js +506 -0
  256. package/dist/runtime/goal-runtime-coordinator.js.map +1 -0
  257. package/dist/runtime/goals/types.d.ts +0 -1
  258. package/dist/runtime/goals/types.d.ts.map +1 -1
  259. package/dist/runtime/goals/types.js +0 -1
  260. package/dist/runtime/goals/types.js.map +1 -1
  261. package/dist/runtime/harness-confluence.d.ts +165 -0
  262. package/dist/runtime/harness-confluence.d.ts.map +1 -0
  263. package/dist/runtime/harness-confluence.js +807 -0
  264. package/dist/runtime/harness-confluence.js.map +1 -0
  265. package/dist/runtime/harness-eval.d.ts +96 -0
  266. package/dist/runtime/harness-eval.d.ts.map +1 -0
  267. package/dist/runtime/harness-eval.js +181 -0
  268. package/dist/runtime/harness-eval.js.map +1 -0
  269. package/dist/runtime/harness-metrics.d.ts +202 -0
  270. package/dist/runtime/harness-metrics.d.ts.map +1 -0
  271. package/dist/runtime/harness-metrics.js +415 -0
  272. package/dist/runtime/harness-metrics.js.map +1 -0
  273. package/dist/runtime/legacy-session-importer.d.ts +99 -0
  274. package/dist/runtime/legacy-session-importer.d.ts.map +1 -0
  275. package/dist/runtime/legacy-session-importer.js +455 -0
  276. package/dist/runtime/legacy-session-importer.js.map +1 -0
  277. package/dist/runtime/legacy-thread-materializer.d.ts +72 -0
  278. package/dist/runtime/legacy-thread-materializer.d.ts.map +1 -0
  279. package/dist/runtime/legacy-thread-materializer.js +553 -0
  280. package/dist/runtime/legacy-thread-materializer.js.map +1 -0
  281. package/dist/runtime/long-tail-tools/descriptors.d.ts +23 -0
  282. package/dist/runtime/long-tail-tools/descriptors.d.ts.map +1 -0
  283. package/dist/runtime/long-tail-tools/descriptors.js +423 -0
  284. package/dist/runtime/long-tail-tools/descriptors.js.map +1 -0
  285. package/dist/runtime/loop-budget.d.ts +1 -1
  286. package/dist/runtime/loop-budget.d.ts.map +1 -1
  287. package/dist/runtime/loop-budget.js +2 -2
  288. package/dist/runtime/loop-budget.js.map +1 -1
  289. package/dist/runtime/mcp/first-party-mcp-adapter.d.ts +75 -0
  290. package/dist/runtime/mcp/first-party-mcp-adapter.d.ts.map +1 -0
  291. package/dist/runtime/mcp/first-party-mcp-adapter.js +484 -0
  292. package/dist/runtime/mcp/first-party-mcp-adapter.js.map +1 -0
  293. package/dist/runtime/mcp/first-party-mcp-config.d.ts +13 -0
  294. package/dist/runtime/mcp/first-party-mcp-config.d.ts.map +1 -0
  295. package/dist/runtime/mcp/first-party-mcp-config.js +139 -0
  296. package/dist/runtime/mcp/first-party-mcp-config.js.map +1 -0
  297. package/dist/runtime/mcp/index.d.ts +5 -0
  298. package/dist/runtime/mcp/index.d.ts.map +1 -0
  299. package/dist/{skills → runtime/mcp}/index.js +3 -9
  300. package/dist/runtime/mcp/index.js.map +1 -0
  301. package/dist/runtime/mcp/lazy-mcp-runtime.d.ts +95 -0
  302. package/dist/runtime/mcp/lazy-mcp-runtime.d.ts.map +1 -0
  303. package/dist/runtime/mcp/lazy-mcp-runtime.js +854 -0
  304. package/dist/runtime/mcp/lazy-mcp-runtime.js.map +1 -0
  305. package/dist/runtime/mcp/types.d.ts +128 -0
  306. package/dist/runtime/mcp/types.d.ts.map +1 -0
  307. package/dist/runtime/mcp/types.js +5 -0
  308. package/dist/runtime/mcp/types.js.map +1 -0
  309. package/dist/runtime/model-coordinator.d.ts +44 -1
  310. package/dist/runtime/model-coordinator.d.ts.map +1 -1
  311. package/dist/runtime/model-coordinator.js +161 -19
  312. package/dist/runtime/model-coordinator.js.map +1 -1
  313. package/dist/runtime/orion-runtime-v1.d.ts +321 -0
  314. package/dist/runtime/orion-runtime-v1.d.ts.map +1 -0
  315. package/dist/runtime/orion-runtime-v1.js +958 -0
  316. package/dist/runtime/orion-runtime-v1.js.map +1 -0
  317. package/dist/runtime/orion-session-runner.d.ts +37 -0
  318. package/dist/runtime/orion-session-runner.d.ts.map +1 -0
  319. package/dist/runtime/orion-session-runner.js +146 -0
  320. package/dist/runtime/orion-session-runner.js.map +1 -0
  321. package/dist/runtime/product-orion-runtime.d.ts +35 -0
  322. package/dist/runtime/product-orion-runtime.d.ts.map +1 -0
  323. package/dist/runtime/product-orion-runtime.js +1019 -0
  324. package/dist/runtime/product-orion-runtime.js.map +1 -0
  325. package/dist/runtime/prompts/index.d.ts +3 -0
  326. package/dist/runtime/prompts/index.d.ts.map +1 -0
  327. package/dist/{ink-ui/types.js → runtime/prompts/index.js} +3 -2
  328. package/dist/runtime/prompts/index.js.map +1 -0
  329. package/dist/runtime/prompts/prompt-registry.d.ts +22 -0
  330. package/dist/runtime/prompts/prompt-registry.d.ts.map +1 -0
  331. package/dist/runtime/prompts/prompt-registry.js +356 -0
  332. package/dist/runtime/prompts/prompt-registry.js.map +1 -0
  333. package/dist/runtime/prompts/types.d.ts +111 -0
  334. package/dist/runtime/prompts/types.d.ts.map +1 -0
  335. package/dist/runtime/prompts/types.js +5 -0
  336. package/dist/runtime/prompts/types.js.map +1 -0
  337. package/dist/runtime/protocol/canonical.d.ts +3 -0
  338. package/dist/runtime/protocol/canonical.d.ts.map +1 -0
  339. package/dist/runtime/protocol/canonical.js +21 -0
  340. package/dist/runtime/protocol/canonical.js.map +1 -0
  341. package/dist/runtime/protocol/index.d.ts +4 -0
  342. package/dist/runtime/protocol/index.d.ts.map +1 -0
  343. package/dist/runtime/protocol/index.js +16 -0
  344. package/dist/runtime/protocol/index.js.map +1 -0
  345. package/dist/runtime/protocol/runtime-protocol-v1.d.ts +671 -0
  346. package/dist/runtime/protocol/runtime-protocol-v1.d.ts.map +1 -0
  347. package/dist/runtime/protocol/runtime-protocol-v1.js +557 -0
  348. package/dist/runtime/protocol/runtime-protocol-v1.js.map +1 -0
  349. package/dist/runtime/release-receipts.d.ts +109 -0
  350. package/dist/runtime/release-receipts.d.ts.map +1 -0
  351. package/dist/runtime/release-receipts.js +304 -0
  352. package/dist/runtime/release-receipts.js.map +1 -0
  353. package/dist/runtime/resource-scope.d.ts +123 -0
  354. package/dist/runtime/resource-scope.d.ts.map +1 -0
  355. package/dist/runtime/resource-scope.js +363 -0
  356. package/dist/runtime/resource-scope.js.map +1 -0
  357. package/dist/runtime/runtime-event-buffer.d.ts +78 -0
  358. package/dist/runtime/runtime-event-buffer.d.ts.map +1 -0
  359. package/dist/runtime/runtime-event-buffer.js +237 -0
  360. package/dist/runtime/runtime-event-buffer.js.map +1 -0
  361. package/dist/runtime/runtime-services.d.ts +87 -0
  362. package/dist/runtime/runtime-services.d.ts.map +1 -0
  363. package/dist/runtime/runtime-services.js +180 -0
  364. package/dist/runtime/runtime-services.js.map +1 -0
  365. package/dist/runtime/skills/bounded-lru-cache.d.ts +34 -0
  366. package/dist/runtime/skills/bounded-lru-cache.d.ts.map +1 -0
  367. package/dist/runtime/skills/bounded-lru-cache.js +100 -0
  368. package/dist/runtime/skills/bounded-lru-cache.js.map +1 -0
  369. package/dist/runtime/skills/filesystem-skill-provider.d.ts +96 -0
  370. package/dist/runtime/skills/filesystem-skill-provider.d.ts.map +1 -0
  371. package/dist/runtime/skills/filesystem-skill-provider.js +829 -0
  372. package/dist/runtime/skills/filesystem-skill-provider.js.map +1 -0
  373. package/dist/runtime/skills/index.d.ts +5 -0
  374. package/dist/runtime/skills/index.d.ts.map +1 -0
  375. package/dist/{ink-ui/controllers/chat-controller.js → runtime/skills/index.js} +5 -2
  376. package/dist/runtime/skills/index.js.map +1 -0
  377. package/dist/runtime/skills/lazy-skill-runtime.d.ts +77 -0
  378. package/dist/runtime/skills/lazy-skill-runtime.d.ts.map +1 -0
  379. package/dist/runtime/skills/lazy-skill-runtime.js +673 -0
  380. package/dist/runtime/skills/lazy-skill-runtime.js.map +1 -0
  381. package/dist/runtime/skills/types.d.ts +137 -0
  382. package/dist/runtime/skills/types.d.ts.map +1 -0
  383. package/dist/runtime/skills/types.js +13 -0
  384. package/dist/runtime/skills/types.js.map +1 -0
  385. package/dist/runtime/step-snapshot.d.ts +183 -0
  386. package/dist/runtime/step-snapshot.d.ts.map +1 -0
  387. package/dist/runtime/step-snapshot.js +286 -0
  388. package/dist/runtime/step-snapshot.js.map +1 -0
  389. package/dist/runtime/subagent-thread-runtime.d.ts +239 -0
  390. package/dist/runtime/subagent-thread-runtime.d.ts.map +1 -0
  391. package/dist/runtime/subagent-thread-runtime.js +876 -0
  392. package/dist/runtime/subagent-thread-runtime.js.map +1 -0
  393. package/dist/runtime/subagents/index.d.ts +5 -2
  394. package/dist/runtime/subagents/index.d.ts.map +1 -1
  395. package/dist/runtime/subagents/index.js +10 -2
  396. package/dist/runtime/subagents/index.js.map +1 -1
  397. package/dist/runtime/subagents/parent-step-fork.d.ts +36 -0
  398. package/dist/runtime/subagents/parent-step-fork.d.ts.map +1 -0
  399. package/dist/runtime/subagents/parent-step-fork.js +83 -0
  400. package/dist/runtime/subagents/parent-step-fork.js.map +1 -0
  401. package/dist/runtime/subagents/production.d.ts +65 -42
  402. package/dist/runtime/subagents/production.d.ts.map +1 -1
  403. package/dist/runtime/subagents/production.js +494 -151
  404. package/dist/runtime/subagents/production.js.map +1 -1
  405. package/dist/runtime/subagents/receipt-journal.d.ts +20 -0
  406. package/dist/runtime/subagents/receipt-journal.d.ts.map +1 -0
  407. package/dist/runtime/subagents/receipt-journal.js +74 -0
  408. package/dist/runtime/subagents/receipt-journal.js.map +1 -0
  409. package/dist/runtime/subagents/runner.d.ts +12 -1
  410. package/dist/runtime/subagents/runner.d.ts.map +1 -1
  411. package/dist/runtime/subagents/runner.js +62 -1
  412. package/dist/runtime/subagents/runner.js.map +1 -1
  413. package/dist/runtime/subagents/runtime-contract.d.ts +29 -0
  414. package/dist/runtime/subagents/runtime-contract.d.ts.map +1 -0
  415. package/dist/runtime/subagents/runtime-contract.js +3 -0
  416. package/dist/runtime/subagents/runtime-contract.js.map +1 -0
  417. package/dist/runtime/subagents/runtime-integration.d.ts +41 -56
  418. package/dist/runtime/subagents/runtime-integration.d.ts.map +1 -1
  419. package/dist/runtime/subagents/runtime-integration.js +34 -197
  420. package/dist/runtime/subagents/runtime-integration.js.map +1 -1
  421. package/dist/runtime/subagents/supervisor.d.ts +19 -7
  422. package/dist/runtime/subagents/supervisor.d.ts.map +1 -1
  423. package/dist/runtime/subagents/supervisor.js +88 -39
  424. package/dist/runtime/subagents/supervisor.js.map +1 -1
  425. package/dist/runtime/subagents/types.d.ts +5 -2
  426. package/dist/runtime/subagents/types.d.ts.map +1 -1
  427. package/dist/runtime/subagents/types.js +1 -1
  428. package/dist/runtime/subagents/types.js.map +1 -1
  429. package/dist/runtime/task-context-service.d.ts +91 -0
  430. package/dist/runtime/task-context-service.d.ts.map +1 -0
  431. package/dist/runtime/task-context-service.js +122 -0
  432. package/dist/runtime/task-context-service.js.map +1 -0
  433. package/dist/runtime/thread-admission.d.ts +130 -0
  434. package/dist/runtime/thread-admission.d.ts.map +1 -0
  435. package/dist/runtime/thread-admission.js +276 -0
  436. package/dist/runtime/thread-admission.js.map +1 -0
  437. package/dist/runtime/thread-compact-persistence.d.ts +50 -0
  438. package/dist/runtime/thread-compact-persistence.d.ts.map +1 -0
  439. package/dist/runtime/thread-compact-persistence.js +176 -0
  440. package/dist/runtime/thread-compact-persistence.js.map +1 -0
  441. package/dist/runtime/thread-event-store.d.ts +98 -0
  442. package/dist/runtime/thread-event-store.d.ts.map +1 -0
  443. package/dist/runtime/thread-event-store.js +737 -0
  444. package/dist/runtime/thread-event-store.js.map +1 -0
  445. package/dist/runtime/thread-projection.d.ts +91 -0
  446. package/dist/runtime/thread-projection.d.ts.map +1 -0
  447. package/dist/runtime/thread-projection.js +407 -0
  448. package/dist/runtime/thread-projection.js.map +1 -0
  449. package/dist/runtime/thread-runtime.d.ts +165 -0
  450. package/dist/runtime/thread-runtime.d.ts.map +1 -0
  451. package/dist/runtime/thread-runtime.js +704 -0
  452. package/dist/runtime/thread-runtime.js.map +1 -0
  453. package/dist/runtime/thread-tool-journal.d.ts +11 -0
  454. package/dist/runtime/thread-tool-journal.d.ts.map +1 -0
  455. package/dist/runtime/thread-tool-journal.js +131 -0
  456. package/dist/runtime/thread-tool-journal.js.map +1 -0
  457. package/dist/runtime/thread-ui-adapter.d.ts +85 -0
  458. package/dist/runtime/thread-ui-adapter.d.ts.map +1 -0
  459. package/dist/runtime/thread-ui-adapter.js +514 -0
  460. package/dist/runtime/thread-ui-adapter.js.map +1 -0
  461. package/dist/runtime/tool-gateway.d.ts +159 -0
  462. package/dist/runtime/tool-gateway.d.ts.map +1 -0
  463. package/dist/runtime/tool-gateway.js +311 -0
  464. package/dist/runtime/tool-gateway.js.map +1 -0
  465. package/dist/runtime/turn-commit.d.ts +103 -0
  466. package/dist/runtime/turn-commit.d.ts.map +1 -0
  467. package/dist/runtime/turn-commit.js +321 -0
  468. package/dist/runtime/turn-commit.js.map +1 -0
  469. package/dist/runtime/ui-events.d.ts +15 -5
  470. package/dist/runtime/ui-events.d.ts.map +1 -1
  471. package/dist/runtime/ui-events.js +0 -1
  472. package/dist/runtime/ui-events.js.map +1 -1
  473. package/dist/runtime/ui-view-model.d.ts +1 -1
  474. package/dist/runtime/ui-view-model.d.ts.map +1 -1
  475. package/dist/runtime/ui-view-model.js +3 -5
  476. package/dist/runtime/ui-view-model.js.map +1 -1
  477. package/dist/services/compact/auto-compact.d.ts +82 -2
  478. package/dist/services/compact/auto-compact.d.ts.map +1 -1
  479. package/dist/services/compact/auto-compact.js +226 -44
  480. package/dist/services/compact/auto-compact.js.map +1 -1
  481. package/dist/services/compact/compact.d.ts +54 -37
  482. package/dist/services/compact/compact.d.ts.map +1 -1
  483. package/dist/services/compact/compact.js +512 -127
  484. package/dist/services/compact/compact.js.map +1 -1
  485. package/dist/services/compact/coordinator.d.ts +5 -1
  486. package/dist/services/compact/coordinator.d.ts.map +1 -1
  487. package/dist/services/compact/coordinator.js +10 -1
  488. package/dist/services/compact/coordinator.js.map +1 -1
  489. package/dist/services/compact/fingerprint.d.ts +27 -0
  490. package/dist/services/compact/fingerprint.d.ts.map +1 -0
  491. package/dist/services/compact/fingerprint.js +69 -0
  492. package/dist/services/compact/fingerprint.js.map +1 -0
  493. package/dist/services/compact/index.d.ts +7 -5
  494. package/dist/services/compact/index.d.ts.map +1 -1
  495. package/dist/services/compact/index.js +19 -6
  496. package/dist/services/compact/index.js.map +1 -1
  497. package/dist/services/compact/planner.d.ts +41 -0
  498. package/dist/services/compact/planner.d.ts.map +1 -0
  499. package/dist/services/compact/planner.js +102 -0
  500. package/dist/services/compact/planner.js.map +1 -0
  501. package/dist/services/compact/semantic-summary.d.ts +93 -0
  502. package/dist/services/compact/semantic-summary.d.ts.map +1 -0
  503. package/dist/services/compact/semantic-summary.js +158 -0
  504. package/dist/services/compact/semantic-summary.js.map +1 -0
  505. package/dist/services/compact/summary-generator.d.ts +23 -0
  506. package/dist/services/compact/summary-generator.d.ts.map +1 -1
  507. package/dist/services/compact/summary-generator.js +173 -39
  508. package/dist/services/compact/summary-generator.js.map +1 -1
  509. package/dist/services/config-dir.d.ts +1 -1
  510. package/dist/services/config-dir.d.ts.map +1 -1
  511. package/dist/services/config-dir.js +2 -1
  512. package/dist/services/config-dir.js.map +1 -1
  513. package/dist/services/config.d.ts +2 -16
  514. package/dist/services/config.d.ts.map +1 -1
  515. package/dist/services/config.js +2 -29
  516. package/dist/services/config.js.map +1 -1
  517. package/dist/services/doctor.d.ts +0 -2
  518. package/dist/services/doctor.d.ts.map +1 -1
  519. package/dist/services/doctor.js +39 -64
  520. package/dist/services/doctor.js.map +1 -1
  521. package/dist/services/file-context.d.ts.map +1 -1
  522. package/dist/services/file-context.js +29 -33
  523. package/dist/services/file-context.js.map +1 -1
  524. package/dist/services/global-config.d.ts +8 -2
  525. package/dist/services/global-config.d.ts.map +1 -1
  526. package/dist/services/global-config.js +8 -0
  527. package/dist/services/global-config.js.map +1 -1
  528. package/dist/services/llm.d.ts +3 -0
  529. package/dist/services/llm.d.ts.map +1 -1
  530. package/dist/services/llm.js +7 -0
  531. package/dist/services/llm.js.map +1 -1
  532. package/dist/services/project-instructions.d.ts.map +1 -1
  533. package/dist/services/project-instructions.js +10 -17
  534. package/dist/services/project-instructions.js.map +1 -1
  535. package/dist/services/safe-project-reader.d.ts +30 -0
  536. package/dist/services/safe-project-reader.d.ts.map +1 -0
  537. package/dist/services/safe-project-reader.js +141 -0
  538. package/dist/services/safe-project-reader.js.map +1 -0
  539. package/dist/services/session-storage.d.ts +134 -5
  540. package/dist/services/session-storage.d.ts.map +1 -1
  541. package/dist/services/session-storage.js +727 -57
  542. package/dist/services/session-storage.js.map +1 -1
  543. package/dist/services/usage-state.d.ts +7 -0
  544. package/dist/services/usage-state.d.ts.map +1 -1
  545. package/dist/services/usage-state.js +117 -16
  546. package/dist/services/usage-state.js.map +1 -1
  547. package/dist/skills/builtin/code-review/SKILL.md +51 -0
  548. package/dist/skills/builtin/security-check/SKILL.md +54 -0
  549. package/dist/skills/builtin/test-gen/SKILL.md +49 -0
  550. package/dist/terminal-ui/launch.d.ts +3 -1
  551. package/dist/terminal-ui/launch.d.ts.map +1 -1
  552. package/dist/terminal-ui/launch.js +19 -3
  553. package/dist/terminal-ui/launch.js.map +1 -1
  554. package/dist/tools/core/common.d.ts +34 -0
  555. package/dist/tools/core/common.d.ts.map +1 -0
  556. package/dist/tools/core/common.js +164 -0
  557. package/dist/tools/core/common.js.map +1 -0
  558. package/dist/tools/core/edit-file.d.ts +10 -0
  559. package/dist/tools/core/edit-file.d.ts.map +1 -0
  560. package/dist/tools/core/edit-file.js +301 -0
  561. package/dist/tools/core/edit-file.js.map +1 -0
  562. package/dist/tools/core/exec-command.d.ts +2 -0
  563. package/dist/tools/core/exec-command.d.ts.map +1 -0
  564. package/dist/tools/core/exec-command.js +347 -0
  565. package/dist/tools/core/exec-command.js.map +1 -0
  566. package/dist/tools/core/glob.d.ts +2 -0
  567. package/dist/tools/core/glob.d.ts.map +1 -0
  568. package/dist/tools/core/glob.js +133 -0
  569. package/dist/tools/core/glob.js.map +1 -0
  570. package/dist/tools/core/grep.d.ts +12 -0
  571. package/dist/tools/core/grep.d.ts.map +1 -0
  572. package/dist/tools/core/grep.js +223 -0
  573. package/dist/tools/core/grep.js.map +1 -0
  574. package/dist/tools/core/index.d.ts +15 -0
  575. package/dist/tools/core/index.d.ts.map +1 -0
  576. package/dist/tools/core/index.js +31 -0
  577. package/dist/tools/core/index.js.map +1 -0
  578. package/dist/tools/core/list-files.d.ts +2 -0
  579. package/dist/tools/core/list-files.d.ts.map +1 -0
  580. package/dist/tools/core/list-files.js +87 -0
  581. package/dist/tools/core/list-files.js.map +1 -0
  582. package/dist/tools/core/read-file.d.ts +2 -0
  583. package/dist/tools/core/read-file.d.ts.map +1 -0
  584. package/dist/tools/core/read-file.js +129 -0
  585. package/dist/tools/core/read-file.js.map +1 -0
  586. package/dist/tools/core/write-file.d.ts +2 -0
  587. package/dist/tools/core/write-file.d.ts.map +1 -0
  588. package/dist/tools/core/write-file.js +65 -0
  589. package/dist/tools/core/write-file.js.map +1 -0
  590. package/dist/tools/todo.d.ts +3 -4
  591. package/dist/tools/todo.d.ts.map +1 -1
  592. package/dist/tools/todo.js +80 -79
  593. package/dist/tools/todo.js.map +1 -1
  594. package/dist/tui-ui/chrome-view-model.js +1 -1
  595. package/dist/tui-ui/chrome-view-model.js.map +1 -1
  596. package/dist/tui-ui/layout.js +1 -1
  597. package/dist/tui-ui/layout.js.map +1 -1
  598. package/docs/migration/v0.1.9-to-v0.2.0.md +98 -0
  599. package/docs/orion.example.json +79 -0
  600. package/docs/plan/v0.2.0-dsh-harness-redesign-plan.md +1234 -0
  601. package/docs/plan/v0.2.0-release-checklist.md +91 -0
  602. package/docs/readme.md +27 -0
  603. package/npm-shrinkwrap.json +9 -438
  604. package/package.json +19 -11
  605. package/dist/agents/coder.d.ts +0 -12
  606. package/dist/agents/coder.d.ts.map +0 -1
  607. package/dist/agents/coder.js +0 -48
  608. package/dist/agents/coder.js.map +0 -1
  609. package/dist/agents/coordinator.d.ts +0 -86
  610. package/dist/agents/coordinator.d.ts.map +0 -1
  611. package/dist/agents/coordinator.js +0 -251
  612. package/dist/agents/coordinator.js.map +0 -1
  613. package/dist/agents/fork.d.ts +0 -69
  614. package/dist/agents/fork.d.ts.map +0 -1
  615. package/dist/agents/fork.js +0 -164
  616. package/dist/agents/fork.js.map +0 -1
  617. package/dist/agents/leader.d.ts +0 -12
  618. package/dist/agents/leader.d.ts.map +0 -1
  619. package/dist/agents/leader.js +0 -49
  620. package/dist/agents/leader.js.map +0 -1
  621. package/dist/agents/router.d.ts +0 -59
  622. package/dist/agents/router.d.ts.map +0 -1
  623. package/dist/agents/router.js +0 -193
  624. package/dist/agents/router.js.map +0 -1
  625. package/dist/agents/worker-pool.d.ts +0 -72
  626. package/dist/agents/worker-pool.d.ts.map +0 -1
  627. package/dist/agents/worker-pool.js +0 -224
  628. package/dist/agents/worker-pool.js.map +0 -1
  629. package/dist/commands/legacy-commands.d.ts +0 -4
  630. package/dist/commands/legacy-commands.d.ts.map +0 -1
  631. package/dist/commands/legacy-commands.js +0 -44
  632. package/dist/commands/legacy-commands.js.map +0 -1
  633. package/dist/core/agent.d.ts +0 -84
  634. package/dist/core/agent.d.ts.map +0 -1
  635. package/dist/core/agent.js +0 -58
  636. package/dist/core/agent.js.map +0 -1
  637. package/dist/core/brain.d.ts +0 -50
  638. package/dist/core/brain.d.ts.map +0 -1
  639. package/dist/core/brain.js +0 -95
  640. package/dist/core/brain.js.map +0 -1
  641. package/dist/framework/tool-scheduler.d.ts +0 -186
  642. package/dist/framework/tool-scheduler.d.ts.map +0 -1
  643. package/dist/framework/tool-scheduler.js +0 -558
  644. package/dist/framework/tool-scheduler.js.map +0 -1
  645. package/dist/harness/harness.d.ts +0 -58
  646. package/dist/harness/harness.d.ts.map +0 -1
  647. package/dist/harness/harness.js +0 -195
  648. package/dist/harness/harness.js.map +0 -1
  649. package/dist/harness/safety.d.ts +0 -101
  650. package/dist/harness/safety.d.ts.map +0 -1
  651. package/dist/harness/safety.js +0 -322
  652. package/dist/harness/safety.js.map +0 -1
  653. package/dist/init.d.ts +0 -108
  654. package/dist/init.d.ts.map +0 -1
  655. package/dist/init.js +0 -393
  656. package/dist/init.js.map +0 -1
  657. package/dist/ink-ui/App.d.ts +0 -9
  658. package/dist/ink-ui/App.d.ts.map +0 -1
  659. package/dist/ink-ui/App.js +0 -12
  660. package/dist/ink-ui/App.js.map +0 -1
  661. package/dist/ink-ui/components/Markdown.d.ts +0 -10
  662. package/dist/ink-ui/components/Markdown.d.ts.map +0 -1
  663. package/dist/ink-ui/components/Markdown.js +0 -210
  664. package/dist/ink-ui/components/Markdown.js.map +0 -1
  665. package/dist/ink-ui/components/NativeCursor.d.ts +0 -12
  666. package/dist/ink-ui/components/NativeCursor.d.ts.map +0 -1
  667. package/dist/ink-ui/components/NativeCursor.js +0 -35
  668. package/dist/ink-ui/components/NativeCursor.js.map +0 -1
  669. package/dist/ink-ui/components/PixelHorseBanner.d.ts +0 -8
  670. package/dist/ink-ui/components/PixelHorseBanner.d.ts.map +0 -1
  671. package/dist/ink-ui/components/PixelHorseBanner.js +0 -97
  672. package/dist/ink-ui/components/PixelHorseBanner.js.map +0 -1
  673. package/dist/ink-ui/components/PromptInput.d.ts +0 -13
  674. package/dist/ink-ui/components/PromptInput.d.ts.map +0 -1
  675. package/dist/ink-ui/components/PromptInput.js +0 -30
  676. package/dist/ink-ui/components/PromptInput.js.map +0 -1
  677. package/dist/ink-ui/components/RunningHorseIndicator.d.ts +0 -13
  678. package/dist/ink-ui/components/RunningHorseIndicator.d.ts.map +0 -1
  679. package/dist/ink-ui/components/RunningHorseIndicator.js +0 -53
  680. package/dist/ink-ui/components/RunningHorseIndicator.js.map +0 -1
  681. package/dist/ink-ui/components/SelectList.d.ts +0 -16
  682. package/dist/ink-ui/components/SelectList.d.ts.map +0 -1
  683. package/dist/ink-ui/components/SelectList.js +0 -60
  684. package/dist/ink-ui/components/SelectList.js.map +0 -1
  685. package/dist/ink-ui/components/StatusLine.d.ts +0 -11
  686. package/dist/ink-ui/components/StatusLine.d.ts.map +0 -1
  687. package/dist/ink-ui/components/StatusLine.js +0 -70
  688. package/dist/ink-ui/components/StatusLine.js.map +0 -1
  689. package/dist/ink-ui/components/ToolActivity.d.ts +0 -19
  690. package/dist/ink-ui/components/ToolActivity.d.ts.map +0 -1
  691. package/dist/ink-ui/components/ToolActivity.js +0 -134
  692. package/dist/ink-ui/components/ToolActivity.js.map +0 -1
  693. package/dist/ink-ui/components/Transcript.d.ts +0 -14
  694. package/dist/ink-ui/components/Transcript.d.ts.map +0 -1
  695. package/dist/ink-ui/components/Transcript.js +0 -66
  696. package/dist/ink-ui/components/Transcript.js.map +0 -1
  697. package/dist/ink-ui/controllers/chat-controller.d.ts +0 -2
  698. package/dist/ink-ui/controllers/chat-controller.d.ts.map +0 -1
  699. package/dist/ink-ui/controllers/chat-controller.js.map +0 -1
  700. package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts +0 -6
  701. package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts.map +0 -1
  702. package/dist/ink-ui/hooks/use-raw-input-bridge.js +0 -27
  703. package/dist/ink-ui/hooks/use-raw-input-bridge.js.map +0 -1
  704. package/dist/ink-ui/hooks/use-terminal-size.d.ts +0 -7
  705. package/dist/ink-ui/hooks/use-terminal-size.d.ts.map +0 -1
  706. package/dist/ink-ui/hooks/use-terminal-size.js +0 -34
  707. package/dist/ink-ui/hooks/use-terminal-size.js.map +0 -1
  708. package/dist/ink-ui/launch.d.ts +0 -9
  709. package/dist/ink-ui/launch.d.ts.map +0 -1
  710. package/dist/ink-ui/launch.js +0 -101
  711. package/dist/ink-ui/launch.js.map +0 -1
  712. package/dist/ink-ui/runtime/grapheme.d.ts +0 -10
  713. package/dist/ink-ui/runtime/grapheme.d.ts.map +0 -1
  714. package/dist/ink-ui/runtime/grapheme.js +0 -17
  715. package/dist/ink-ui/runtime/grapheme.js.map +0 -1
  716. package/dist/ink-ui/runtime/input-buffer.d.ts +0 -10
  717. package/dist/ink-ui/runtime/input-buffer.d.ts.map +0 -1
  718. package/dist/ink-ui/runtime/input-buffer.js +0 -18
  719. package/dist/ink-ui/runtime/input-buffer.js.map +0 -1
  720. package/dist/ink-ui/runtime/layout-budget.d.ts +0 -13
  721. package/dist/ink-ui/runtime/layout-budget.d.ts.map +0 -1
  722. package/dist/ink-ui/runtime/layout-budget.js +0 -25
  723. package/dist/ink-ui/runtime/layout-budget.js.map +0 -1
  724. package/dist/ink-ui/runtime/native-cursor.d.ts +0 -62
  725. package/dist/ink-ui/runtime/native-cursor.d.ts.map +0 -1
  726. package/dist/ink-ui/runtime/native-cursor.js +0 -398
  727. package/dist/ink-ui/runtime/native-cursor.js.map +0 -1
  728. package/dist/ink-ui/runtime/prompt-layout.d.ts +0 -10
  729. package/dist/ink-ui/runtime/prompt-layout.d.ts.map +0 -1
  730. package/dist/ink-ui/runtime/prompt-layout.js +0 -21
  731. package/dist/ink-ui/runtime/prompt-layout.js.map +0 -1
  732. package/dist/ink-ui/runtime/raw-input.d.ts +0 -4
  733. package/dist/ink-ui/runtime/raw-input.d.ts.map +0 -1
  734. package/dist/ink-ui/runtime/raw-input.js +0 -15
  735. package/dist/ink-ui/runtime/raw-input.js.map +0 -1
  736. package/dist/ink-ui/runtime/transcript-state.d.ts +0 -37
  737. package/dist/ink-ui/runtime/transcript-state.d.ts.map +0 -1
  738. package/dist/ink-ui/runtime/transcript-state.js +0 -91
  739. package/dist/ink-ui/runtime/transcript-state.js.map +0 -1
  740. package/dist/ink-ui/screens/ReplScreen.d.ts +0 -24
  741. package/dist/ink-ui/screens/ReplScreen.d.ts.map +0 -1
  742. package/dist/ink-ui/screens/ReplScreen.js +0 -756
  743. package/dist/ink-ui/screens/ReplScreen.js.map +0 -1
  744. package/dist/ink-ui/types.d.ts +0 -2
  745. package/dist/ink-ui/types.d.ts.map +0 -1
  746. package/dist/ink-ui/types.js.map +0 -1
  747. package/dist/runtime/chat-checkpoint.d.ts +0 -17
  748. package/dist/runtime/chat-checkpoint.d.ts.map +0 -1
  749. package/dist/runtime/chat-checkpoint.js +0 -105
  750. package/dist/runtime/chat-checkpoint.js.map +0 -1
  751. package/dist/runtime/chat-command-scope.d.ts +0 -5
  752. package/dist/runtime/chat-command-scope.d.ts.map +0 -1
  753. package/dist/runtime/chat-command-scope.js +0 -22
  754. package/dist/runtime/chat-command-scope.js.map +0 -1
  755. package/dist/runtime/chat-controller.d.ts +0 -62
  756. package/dist/runtime/chat-controller.d.ts.map +0 -1
  757. package/dist/runtime/chat-controller.js +0 -1630
  758. package/dist/runtime/chat-controller.js.map +0 -1
  759. package/dist/runtime/chat-effort.d.ts +0 -5
  760. package/dist/runtime/chat-effort.d.ts.map +0 -1
  761. package/dist/runtime/chat-effort.js +0 -47
  762. package/dist/runtime/chat-effort.js.map +0 -1
  763. package/dist/runtime/chat-presentation.d.ts +0 -63
  764. package/dist/runtime/chat-presentation.d.ts.map +0 -1
  765. package/dist/runtime/chat-presentation.js +0 -561
  766. package/dist/runtime/chat-presentation.js.map +0 -1
  767. package/dist/runtime/chat-trace.d.ts +0 -52
  768. package/dist/runtime/chat-trace.d.ts.map +0 -1
  769. package/dist/runtime/chat-trace.js +0 -234
  770. package/dist/runtime/chat-trace.js.map +0 -1
  771. package/dist/runtime/chat-workspace.d.ts +0 -22
  772. package/dist/runtime/chat-workspace.d.ts.map +0 -1
  773. package/dist/runtime/chat-workspace.js +0 -154
  774. package/dist/runtime/chat-workspace.js.map +0 -1
  775. package/dist/runtime/goals/accounting.d.ts +0 -45
  776. package/dist/runtime/goals/accounting.d.ts.map +0 -1
  777. package/dist/runtime/goals/accounting.js +0 -114
  778. package/dist/runtime/goals/accounting.js.map +0 -1
  779. package/dist/runtime/goals/coordinator.d.ts +0 -89
  780. package/dist/runtime/goals/coordinator.d.ts.map +0 -1
  781. package/dist/runtime/goals/coordinator.js +0 -1481
  782. package/dist/runtime/goals/coordinator.js.map +0 -1
  783. package/dist/runtime/goals/lifecycle.d.ts +0 -13
  784. package/dist/runtime/goals/lifecycle.d.ts.map +0 -1
  785. package/dist/runtime/goals/lifecycle.js +0 -46
  786. package/dist/runtime/goals/lifecycle.js.map +0 -1
  787. package/dist/runtime/goals/prompt.d.ts +0 -16
  788. package/dist/runtime/goals/prompt.d.ts.map +0 -1
  789. package/dist/runtime/goals/prompt.js +0 -88
  790. package/dist/runtime/goals/prompt.js.map +0 -1
  791. package/dist/runtime/goals/tools.d.ts +0 -61
  792. package/dist/runtime/goals/tools.d.ts.map +0 -1
  793. package/dist/runtime/goals/tools.js +0 -568
  794. package/dist/runtime/goals/tools.js.map +0 -1
  795. package/dist/sdk/index.d.ts +0 -10
  796. package/dist/sdk/index.d.ts.map +0 -1
  797. package/dist/sdk/index.js +0 -23
  798. package/dist/sdk/index.js.map +0 -1
  799. package/dist/sdk/init.d.ts +0 -24
  800. package/dist/sdk/init.d.ts.map +0 -1
  801. package/dist/sdk/init.js +0 -48
  802. package/dist/sdk/init.js.map +0 -1
  803. package/dist/sdk/query.d.ts +0 -19
  804. package/dist/sdk/query.d.ts.map +0 -1
  805. package/dist/sdk/query.js +0 -42
  806. package/dist/sdk/query.js.map +0 -1
  807. package/dist/sdk/sessions.d.ts +0 -19
  808. package/dist/sdk/sessions.d.ts.map +0 -1
  809. package/dist/sdk/sessions.js +0 -57
  810. package/dist/sdk/sessions.js.map +0 -1
  811. package/dist/sdk/types.d.ts +0 -47
  812. package/dist/sdk/types.d.ts.map +0 -1
  813. package/dist/sdk/types.js +0 -8
  814. package/dist/sdk/types.js.map +0 -1
  815. package/dist/services/agent-runner.d.ts +0 -71
  816. package/dist/services/agent-runner.d.ts.map +0 -1
  817. package/dist/services/agent-runner.js +0 -185
  818. package/dist/services/agent-runner.js.map +0 -1
  819. package/dist/services/compact/micro-compact.d.ts +0 -21
  820. package/dist/services/compact/micro-compact.d.ts.map +0 -1
  821. package/dist/services/compact/micro-compact.js +0 -99
  822. package/dist/services/compact/micro-compact.js.map +0 -1
  823. package/dist/services/task-manager.d.ts +0 -161
  824. package/dist/services/task-manager.d.ts.map +0 -1
  825. package/dist/services/task-manager.js +0 -315
  826. package/dist/services/task-manager.js.map +0 -1
  827. package/dist/skills/discovery.d.ts +0 -22
  828. package/dist/skills/discovery.d.ts.map +0 -1
  829. package/dist/skills/discovery.js +0 -75
  830. package/dist/skills/discovery.js.map +0 -1
  831. package/dist/skills/index.d.ts +0 -11
  832. package/dist/skills/index.d.ts.map +0 -1
  833. package/dist/skills/index.js.map +0 -1
  834. package/dist/skills/loader.d.ts +0 -53
  835. package/dist/skills/loader.d.ts.map +0 -1
  836. package/dist/skills/loader.js +0 -421
  837. package/dist/skills/loader.js.map +0 -1
  838. package/dist/skills/registry.d.ts +0 -41
  839. package/dist/skills/registry.d.ts.map +0 -1
  840. package/dist/skills/registry.js +0 -157
  841. package/dist/skills/registry.js.map +0 -1
  842. package/dist/skills/runtime.d.ts +0 -46
  843. package/dist/skills/runtime.d.ts.map +0 -1
  844. package/dist/skills/runtime.js +0 -364
  845. package/dist/skills/runtime.js.map +0 -1
  846. package/dist/skills/types.d.ts +0 -112
  847. package/dist/skills/types.d.ts.map +0 -1
  848. package/dist/skills/types.js +0 -24
  849. package/dist/skills/types.js.map +0 -1
  850. package/dist/tools/index.d.ts +0 -52
  851. package/dist/tools/index.d.ts.map +0 -1
  852. package/dist/tools/index.js +0 -2268
  853. package/dist/tools/index.js.map +0 -1
  854. package/dist/tools/mcp.d.ts +0 -99
  855. package/dist/tools/mcp.d.ts.map +0 -1
  856. package/dist/tools/mcp.js +0 -695
  857. package/dist/tools/mcp.js.map +0 -1
  858. package/dist/tools/plan.d.ts +0 -17
  859. package/dist/tools/plan.d.ts.map +0 -1
  860. package/dist/tools/plan.js +0 -84
  861. package/dist/tools/plan.js.map +0 -1
@@ -0,0 +1,73 @@
1
+ import type { Message } from '../services/llm';
2
+ import type { AgentLoopPreparedStepV1, AgentLoopStepFactoryV1 } from './agent-loop';
3
+ import { type CapabilityCompilerInputV1, type CapabilityReceiptV1 } from './capabilities';
4
+ import { type EnvironmentSnapshotV1, type ExecutionPolicySnapshotV1, type ModelSnapshotV1, type PromptSnapshotV1, type StepSnapshotV1, type ToolBindingV1 } from './step-snapshot';
5
+ export type CapabilityStepCompilerInputV1 = Omit<CapabilityCompilerInputV1, 'baseMode' | 'taskContextRevision' | 'receipt'>;
6
+ export type AgentLoopStepPrepareInputV1 = Parameters<AgentLoopStepFactoryV1['prepare']>[0];
7
+ export interface CapabilityStepConfigurationV1 {
8
+ readonly taskEpoch: number;
9
+ readonly compiler: CapabilityStepCompilerInputV1;
10
+ readonly model: ModelSnapshotV1;
11
+ readonly executionPolicy: ExecutionPolicySnapshotV1;
12
+ readonly environment: EnvironmentSnapshotV1;
13
+ }
14
+ export interface CapabilityStepReceiptV1 {
15
+ readonly version: 1;
16
+ readonly threadId: string;
17
+ readonly turnId: string;
18
+ readonly stepId: string;
19
+ readonly capabilityReceiptDigest: string;
20
+ readonly promptDigest: string;
21
+ readonly snapshotDigest: string;
22
+ readonly digest: string;
23
+ }
24
+ export interface CapabilityStepPersistenceBundleV1 {
25
+ readonly snapshot: StepSnapshotV1;
26
+ readonly capabilityReceipt: CapabilityReceiptV1;
27
+ readonly receipt: CapabilityStepReceiptV1;
28
+ }
29
+ export interface PreparedCapabilityStepV1 extends AgentLoopPreparedStepV1 {
30
+ readonly capabilityPlanDigest: string;
31
+ readonly persistenceBundle: CapabilityStepPersistenceBundleV1 | undefined;
32
+ }
33
+ export interface CapabilityStepIdentityFactoryInputV1 {
34
+ readonly kind: 'step' | 'request' | 'commit';
35
+ readonly threadId: string;
36
+ readonly turnId: string;
37
+ readonly requestIndex: number;
38
+ }
39
+ export interface CapabilityAgentLoopStepFactoryOptionsV1 {
40
+ readonly resolveConfiguration: (input: AgentLoopStepPrepareInputV1) => CapabilityStepConfigurationV1 | Promise<CapabilityStepConfigurationV1>;
41
+ /** Registry is keyed by the compiler catalog's stable bindingId, not tool name. */
42
+ readonly resolveToolRegistry: (input: AgentLoopStepPrepareInputV1) => ReadonlyMap<string, ToolBindingV1> | Promise<ReadonlyMap<string, ToolBindingV1>>;
43
+ readonly idFactory?: (input: CapabilityStepIdentityFactoryInputV1) => string;
44
+ readonly clock?: () => number;
45
+ /** Called before capture resolves so persistence failure blocks the model request. */
46
+ readonly onCaptured?: (bundle: CapabilityStepPersistenceBundleV1) => void | Promise<void>;
47
+ }
48
+ type CapabilityStepFactoryErrorCode = 'ORION_CAPABILITY_STEP_ABORTED' | 'ORION_CAPABILITY_STEP_CONFIG_INVALID' | 'ORION_CAPABILITY_STEP_ID_INVALID' | 'ORION_CAPABILITY_STEP_BINDING_MISSING' | 'ORION_CAPABILITY_STEP_EXECUTOR_MISSING' | 'ORION_CAPABILITY_STEP_BINDING_MISMATCH' | 'ORION_CAPABILITY_STEP_ROUTER_MISMATCH' | 'ORION_CAPABILITY_STEP_ALREADY_CAPTURED';
49
+ export declare class CapabilityStepFactoryError extends Error {
50
+ readonly code: CapabilityStepFactoryErrorCode;
51
+ constructor(code: CapabilityStepFactoryErrorCode, message: string);
52
+ }
53
+ /**
54
+ * Recompiles capabilities per provider request and binds selected descriptors
55
+ * to exact executor references before AgentLoop can expose them to the model.
56
+ */
57
+ export declare class CapabilityAgentLoopStepFactoryV1 implements AgentLoopStepFactoryV1 {
58
+ private readonly options;
59
+ private readonly idFactory;
60
+ private readonly clock;
61
+ constructor(options: CapabilityAgentLoopStepFactoryOptionsV1);
62
+ prepare(input: AgentLoopStepPrepareInputV1): Promise<PreparedCapabilityStepV1>;
63
+ private createIdentity;
64
+ private bindExactExecutors;
65
+ private createRouter;
66
+ private assertRouterMatchesCompilation;
67
+ private assertSnapshotMatchesCompilation;
68
+ private validateConfiguration;
69
+ private throwIfAborted;
70
+ }
71
+ export declare function createFinalPromptSnapshotV1(messages: readonly Message[]): PromptSnapshotV1;
72
+ export {};
73
+ //# sourceMappingURL=capability-step-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-step-factory.d.ts","sourceRoot":"","sources":["../../src/runtime/capability-step-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAGL,KAAK,yBAAyB,EAE9B,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAE9B,KA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pC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0D;IACpF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;gBAER,OAAO,EAAE,uCAAuC;IAKvE,OAAO,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,wBAAwB,CAAC;IA8GpF,OAAO,CAAC,cAAc;IA+BtB,OAAO,CAAC,kBAAkB;IAkC1B,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,8BAA8B;IAoBtC,OAAO,CAAC,gCAAgC;IAiBxC,OAAO,CAAC,qBAAqB;IA+C7B,OAAO,CAAC,cAAc;CAOvB;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,gBAAgB,CAc1F"}
@@ -0,0 +1,302 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CapabilityAgentLoopStepFactoryV1 = exports.CapabilityStepFactoryError = void 0;
4
+ exports.createFinalPromptSnapshotV1 = createFinalPromptSnapshotV1;
5
+ const token_estimate_1 = require("../utils/token-estimate");
6
+ const capabilities_1 = require("./capabilities");
7
+ const canonical_1 = require("./protocol/canonical");
8
+ const runtime_protocol_v1_1 = require("./protocol/runtime-protocol-v1");
9
+ const step_snapshot_1 = require("./step-snapshot");
10
+ class CapabilityStepFactoryError extends Error {
11
+ constructor(code, message) {
12
+ super(message);
13
+ this.code = code;
14
+ this.name = 'CapabilityStepFactoryError';
15
+ }
16
+ }
17
+ exports.CapabilityStepFactoryError = CapabilityStepFactoryError;
18
+ /**
19
+ * Recompiles capabilities per provider request and binds selected descriptors
20
+ * to exact executor references before AgentLoop can expose them to the model.
21
+ */
22
+ class CapabilityAgentLoopStepFactoryV1 {
23
+ constructor(options) {
24
+ this.options = options;
25
+ this.idFactory = options.idFactory ?? (() => (0, runtime_protocol_v1_1.createRuntimeId)());
26
+ this.clock = options.clock ?? Date.now;
27
+ }
28
+ async prepare(input) {
29
+ this.throwIfAborted(input.abortSignal);
30
+ const configuration = cloneConfiguration(await this.options.resolveConfiguration(input));
31
+ this.throwIfAborted(input.abortSignal);
32
+ this.validateConfiguration(configuration);
33
+ const identity = this.createIdentity(input);
34
+ const baseMode = normalizeBaseMode(input.mode);
35
+ const initialCompilation = (0, capabilities_1.compileCapabilityPlanV1)({
36
+ ...configuration.compiler,
37
+ baseMode,
38
+ taskContextRevision: input.taskContextRevision,
39
+ receipt: identity,
40
+ });
41
+ const registry = await this.options.resolveToolRegistry(input);
42
+ this.throwIfAborted(input.abortSignal);
43
+ if (!registry || typeof registry.get !== 'function') {
44
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_CONFIG_INVALID', 'Tool registry must implement ReadonlyMap.get().');
45
+ }
46
+ const toolBindings = this.bindExactExecutors(initialCompilation, registry);
47
+ const preparedRouter = this.createRouter(toolBindings, 'prepared');
48
+ this.assertRouterMatchesCompilation(initialCompilation, preparedRouter, 'prepared');
49
+ let persistenceBundle;
50
+ let captured = false;
51
+ const prepared = {
52
+ stepId: identity.stepId,
53
+ toolBindings,
54
+ capabilityPlanDigest: initialCompilation.plan.digest,
55
+ get persistenceBundle() {
56
+ return persistenceBundle;
57
+ },
58
+ capture: async (captureInput) => {
59
+ if (captured) {
60
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_ALREADY_CAPTURED', `Step ${identity.stepId} has already crossed the model boundary.`);
61
+ }
62
+ captured = true;
63
+ this.throwIfAborted(input.abortSignal);
64
+ const prompt = createFinalPromptSnapshotV1(captureInput.messages);
65
+ const finalPromptManifest = mergePromptManifest(configuration.compiler.promptManifest ?? [], prompt);
66
+ const finalCompilation = (0, capabilities_1.compileCapabilityPlanV1)({
67
+ ...configuration.compiler,
68
+ promptManifest: finalPromptManifest,
69
+ baseMode,
70
+ taskContextRevision: captureInput.taskContextRevision,
71
+ receipt: identity,
72
+ });
73
+ if (finalCompilation.plan.digest !== initialCompilation.plan.digest) {
74
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_BINDING_MISMATCH', 'Capability selection changed while binding the final prompt.');
75
+ }
76
+ this.assertRouterMatchesCompilation(finalCompilation, preparedRouter, 'final');
77
+ const snapshot = (0, step_snapshot_1.captureStepSnapshotV1)({
78
+ threadId: input.threadId,
79
+ turnId: input.turnId,
80
+ stepId: identity.stepId,
81
+ taskEpoch: configuration.taskEpoch,
82
+ baseMode,
83
+ model: configuration.model,
84
+ authority: configuration.compiler.authority,
85
+ executionPolicy: configuration.executionPolicy,
86
+ environment: configuration.environment,
87
+ capabilityPlan: finalCompilation.plan,
88
+ prompt,
89
+ toolBindings,
90
+ skills: createSkillSnapshot(finalCompilation, configuration.compiler.skillCatalogDigest),
91
+ mcp: createMcpSnapshot(finalCompilation, configuration.compiler.mcpCatalogDigest),
92
+ taskContextRevision: captureInput.taskContextRevision,
93
+ });
94
+ this.assertSnapshotMatchesCompilation(snapshot, finalCompilation);
95
+ const receiptContent = {
96
+ version: 1,
97
+ threadId: input.threadId,
98
+ turnId: input.turnId,
99
+ stepId: identity.stepId,
100
+ capabilityReceiptDigest: finalCompilation.receipt.digest,
101
+ promptDigest: prompt.digest,
102
+ snapshotDigest: snapshot.digest,
103
+ };
104
+ const receipt = freeze({
105
+ ...receiptContent,
106
+ digest: (0, canonical_1.digestRuntimeValue)(receiptContent),
107
+ });
108
+ const bundle = freeze({
109
+ snapshot,
110
+ capabilityReceipt: finalCompilation.receipt,
111
+ receipt,
112
+ });
113
+ persistenceBundle = bundle;
114
+ await this.options.onCaptured?.(bundle);
115
+ this.throwIfAborted(input.abortSignal);
116
+ return snapshot;
117
+ },
118
+ };
119
+ return Object.freeze(prepared);
120
+ }
121
+ createIdentity(input) {
122
+ if (!(0, runtime_protocol_v1_1.isRuntimeId)(input.threadId) || !(0, runtime_protocol_v1_1.isRuntimeId)(input.turnId)) {
123
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_ID_INVALID', 'Capability Step Factory requires UUID threadId and turnId values.');
124
+ }
125
+ const create = (kind) => this.idFactory({
126
+ kind,
127
+ threadId: input.threadId,
128
+ turnId: input.turnId,
129
+ requestIndex: input.requestIndex,
130
+ });
131
+ const stepId = create('step');
132
+ if (!(0, runtime_protocol_v1_1.isRuntimeId)(stepId)) {
133
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_ID_INVALID', 'Capability Step Factory must issue a UUID stepId.');
134
+ }
135
+ return freeze({
136
+ requestId: create('request'),
137
+ threadId: input.threadId,
138
+ turnId: input.turnId,
139
+ stepId,
140
+ durableCommitId: create('commit'),
141
+ createdAt: this.clock(),
142
+ });
143
+ }
144
+ bindExactExecutors(compilation, registry) {
145
+ const bindings = compilation.directToolBindings.map(selection => {
146
+ const binding = registry.get(selection.bindingId);
147
+ if (!binding) {
148
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_BINDING_MISSING', `No executor binding is registered for ${selection.bindingId}.`);
149
+ }
150
+ if (typeof binding.execute !== 'function') {
151
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_EXECUTOR_MISSING', `Binding ${selection.bindingId} does not provide an executor.`);
152
+ }
153
+ const actualRouter = this.createRouter([binding], `binding:${selection.bindingId}`);
154
+ const actualDescriptor = actualRouter.descriptors[0];
155
+ if (!descriptorsEqual(actualDescriptor, selection.descriptor)) {
156
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_BINDING_MISMATCH', `Binding ${selection.bindingId} does not match the compiled descriptor.`);
157
+ }
158
+ return freeze({
159
+ descriptor: structuredClone(actualDescriptor),
160
+ execute: binding.execute,
161
+ });
162
+ });
163
+ return Object.freeze(bindings);
164
+ }
165
+ createRouter(bindings, phase) {
166
+ try {
167
+ return new step_snapshot_1.ToolRouterSnapshotV1(bindings);
168
+ }
169
+ catch (error) {
170
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_BINDING_MISMATCH', `Invalid ${phase} tool binding: ${errorMessage(error)}`);
171
+ }
172
+ }
173
+ assertRouterMatchesCompilation(compilation, router, phase) {
174
+ const receipt = compilation.receipt;
175
+ const names = router.descriptors.map(descriptor => descriptor.name);
176
+ if (receipt.toolSchemaDigest !== router.visibleSchemaDigest ||
177
+ receipt.toolBindingDigest !== router.bindingDigest ||
178
+ receipt.toolRouterDigest !== router.digest ||
179
+ (0, canonical_1.digestRuntimeValue)(receipt.directToolNames) !== (0, canonical_1.digestRuntimeValue)(names)) {
180
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_ROUTER_MISMATCH', `Capability compiler and ${phase} ToolRouter digests differ.`);
181
+ }
182
+ }
183
+ assertSnapshotMatchesCompilation(snapshot, compilation) {
184
+ this.assertRouterMatchesCompilation(compilation, snapshot.toolRouter, 'snapshot');
185
+ if (snapshot.capabilityPlan.digest !== compilation.plan.digest ||
186
+ snapshot.prompt.digest !==
187
+ compilation.receipt.promptManifest.find(item => item.id === 'final-model-messages')?.digest) {
188
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_ROUTER_MISMATCH', 'Final StepSnapshot is not bound to its capability plan and prompt receipt.');
189
+ }
190
+ }
191
+ validateConfiguration(configuration) {
192
+ if (!Number.isSafeInteger(configuration.taskEpoch) || configuration.taskEpoch < 0) {
193
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_CONFIG_INVALID', 'Capability step taskEpoch must be a non-negative safe integer.');
194
+ }
195
+ if (configuration.compiler.executionPolicyDigest !== configuration.executionPolicy.digest) {
196
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_CONFIG_INVALID', 'Compiler executionPolicyDigest does not match the StepSnapshot policy.');
197
+ }
198
+ const { digest: policyDigest, ...policyContent } = configuration.executionPolicy;
199
+ if ((0, canonical_1.digestRuntimeValue)(policyContent) !== policyDigest) {
200
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_CONFIG_INVALID', 'ExecutionPolicy snapshot digest does not match its content.');
201
+ }
202
+ if (!Number.isSafeInteger(configuration.model.contextWindow) ||
203
+ configuration.model.contextWindow <= 0) {
204
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_CONFIG_INVALID', 'Model contextWindow must be a positive safe integer.');
205
+ }
206
+ for (const [name, value] of [
207
+ ['model providerId', configuration.model.providerId],
208
+ ['model modelId', configuration.model.modelId],
209
+ ['model protocol', configuration.model.protocol],
210
+ ['environment cwd', configuration.environment.cwd],
211
+ ['environment platform', configuration.environment.platform],
212
+ ['environment arch', configuration.environment.arch],
213
+ ['environment digest', configuration.environment.environmentDigest],
214
+ ]) {
215
+ if (!value.trim()) {
216
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_CONFIG_INVALID', `${name} must not be empty.`);
217
+ }
218
+ }
219
+ }
220
+ throwIfAborted(signal) {
221
+ if (!signal.aborted)
222
+ return;
223
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_ABORTED', 'Capability step preparation was aborted.');
224
+ }
225
+ }
226
+ exports.CapabilityAgentLoopStepFactoryV1 = CapabilityAgentLoopStepFactoryV1;
227
+ function createFinalPromptSnapshotV1(messages) {
228
+ const cloned = structuredClone(messages);
229
+ const sections = cloned.map((message, index) => ({
230
+ id: `message:${String(index).padStart(4, '0')}:${message.role}`,
231
+ content: message.content,
232
+ estimatedTokens: (0, token_estimate_1.estimateMessagesTokens)([message]),
233
+ sourceDigest: (0, canonical_1.digestRuntimeValue)(message),
234
+ }));
235
+ return freeze({
236
+ version: 1,
237
+ sections,
238
+ estimatedTokens: (0, token_estimate_1.estimateMessagesTokens)(cloned),
239
+ digest: (0, canonical_1.digestRuntimeValue)(cloned),
240
+ });
241
+ }
242
+ function mergePromptManifest(configured, prompt) {
243
+ const reservedId = 'final-model-messages';
244
+ if (configured.some(section => section.id === reservedId)) {
245
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_CONFIG_INVALID', `Prompt manifest id ${reservedId} is reserved by the Step Factory.`);
246
+ }
247
+ return freeze([
248
+ ...structuredClone(configured),
249
+ { id: reservedId, digest: prompt.digest, selected: true },
250
+ ]);
251
+ }
252
+ function createSkillSnapshot(compilation, catalogDigest) {
253
+ const content = {
254
+ version: 1,
255
+ selected: compilation.selectedSkills.map(skill => ({
256
+ id: skill.id,
257
+ descriptorDigest: skill.digest,
258
+ definitionDigest: skill.loaded ? skill.digest : undefined,
259
+ })),
260
+ catalogDigest,
261
+ };
262
+ return freeze({ ...content, digest: (0, canonical_1.digestRuntimeValue)(content) });
263
+ }
264
+ function createMcpSnapshot(compilation, catalogDigest) {
265
+ const content = {
266
+ version: 1,
267
+ selected: compilation.selectedMcpBindings
268
+ .filter(binding => binding.direct)
269
+ .map(binding => ({
270
+ serverId: binding.serverId,
271
+ toolName: binding.toolName,
272
+ bindingDigest: binding.bindingDigest,
273
+ })),
274
+ catalogDigest,
275
+ };
276
+ return freeze({ ...content, digest: (0, canonical_1.digestRuntimeValue)(content) });
277
+ }
278
+ function cloneConfiguration(configuration) {
279
+ try {
280
+ return freeze(structuredClone(configuration));
281
+ }
282
+ catch (error) {
283
+ throw new CapabilityStepFactoryError('ORION_CAPABILITY_STEP_CONFIG_INVALID', `Capability step configuration is not snapshot-safe: ${errorMessage(error)}`);
284
+ }
285
+ }
286
+ function descriptorsEqual(actual, expected) {
287
+ return (0, canonical_1.digestRuntimeValue)(actual) === (0, canonical_1.digestRuntimeValue)(expected);
288
+ }
289
+ function normalizeBaseMode(mode) {
290
+ return mode === 'plan' || mode === 'auto' ? mode : 'build';
291
+ }
292
+ function errorMessage(error) {
293
+ return error instanceof Error ? error.message : String(error);
294
+ }
295
+ function freeze(value) {
296
+ if (typeof value !== 'object' || value === null || Object.isFrozen(value))
297
+ return value;
298
+ for (const nested of Object.values(value))
299
+ freeze(nested);
300
+ return Object.freeze(value);
301
+ }
302
+ //# sourceMappingURL=capability-step-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-step-factory.js","sourceRoot":"","sources":["../../src/runtime/capability-step-factory.ts"],"names":[],"mappings":";;;AA6YA,kEAcC;AA1ZD,4DAAiE;AAEj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AAO,CAAC;AAC7D,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,MAAM,CAAI,KAAQ;IACzB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxF,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC;QAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrF,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,225 @@
1
+ import { type RuntimeEventEnvelopeV1, type RuntimeEventV1 } from './protocol/runtime-protocol-v1';
2
+ export declare const COMPACT_TRANSACTION_VERSION: 1;
3
+ export type CompactRuntimeEventV1 = Extract<RuntimeEventV1, {
4
+ type: 'compact.started' | 'compact.completed' | 'compact.failed';
5
+ }>;
6
+ export type CompactTransactionBoundaryV1 = 'after_source_prepare' | 'after_started_commit' | 'after_candidate_prepare' | 'after_candidate_validate' | 'before_cas_recheck' | 'after_cas_recheck' | 'after_checkpoint_write' | 'after_pointer_commit' | 'after_completed_commit' | 'after_failed_commit';
7
+ export type CompactCasBoundaryV1 = Extract<CompactTransactionBoundaryV1, 'before_cas_recheck' | 'after_cas_recheck' | 'after_checkpoint_write' | 'after_pointer_commit'>;
8
+ export type CompactCasConflictReasonV1 = 'cursor_changed' | 'projection_changed' | 'history_changed' | 'task_context_changed' | 'task_context_revision_changed' | 'checkpoint_pointer_changed';
9
+ export type CompactTransactionFailureCodeV1 = 'candidate_prepare_failed' | 'candidate_validation_failed' | 'candidate_rejected' | 'cas_commit_failed' | `cas_conflict:${CompactCasConflictReasonV1}` | 'orphaned_before_checkpoint_commit';
10
+ export interface CompactMaintenanceTurnV1 {
11
+ readonly turnId: string;
12
+ readonly mode: 'maintenance';
13
+ readonly active: true;
14
+ readonly steerable: false;
15
+ }
16
+ /** Snapshot captured atomically by the persistence owner before candidate work starts. */
17
+ export interface CompactAuthoritativeSourceV1 {
18
+ readonly threadId: string;
19
+ readonly maintenanceTurn: CompactMaintenanceTurnV1;
20
+ readonly cursor: number;
21
+ readonly projectionDigest: string;
22
+ readonly history: readonly unknown[];
23
+ readonly taskContext: unknown;
24
+ readonly taskContextRevision: number;
25
+ readonly activeCheckpointId: string | null;
26
+ }
27
+ export interface CompactPrepareSourceReceiptV1 {
28
+ readonly version: 1;
29
+ readonly threadId: string;
30
+ readonly turnId: string;
31
+ readonly nonSteerable: true;
32
+ readonly cursor: number;
33
+ readonly projectionDigest: string;
34
+ readonly historyDigest: string;
35
+ readonly historyEntries: number;
36
+ readonly taskContextDigest: string;
37
+ readonly taskContextRevision: number;
38
+ readonly activeCheckpointId: string | null;
39
+ readonly digest: string;
40
+ }
41
+ export interface CompactPreparedCandidateV1 {
42
+ readonly checkpointId: string;
43
+ /** Durable sidecar payload. It is not copied into transaction receipts. */
44
+ readonly checkpoint: unknown;
45
+ readonly modelVisibleHistory: readonly unknown[];
46
+ }
47
+ export interface CompactCandidateValidationContextV1 {
48
+ readonly source: CompactPrepareSourceReceiptV1;
49
+ readonly checkpointId: string;
50
+ readonly checkpoint: unknown;
51
+ readonly checkpointDigest: string;
52
+ readonly modelVisibleHistory: readonly unknown[];
53
+ readonly nextModelVisibleHistoryDigest: string;
54
+ }
55
+ export interface CompactCandidateValidatorV1 {
56
+ readonly id: string;
57
+ validate(context: CompactCandidateValidationContextV1, signal: AbortSignal): boolean | Promise<boolean>;
58
+ }
59
+ export interface CompactValidationReceiptV1 {
60
+ readonly version: 1;
61
+ readonly validatorId: string;
62
+ readonly sourceReceiptDigest: string;
63
+ readonly checkpointDigest: string;
64
+ readonly nextModelVisibleHistoryDigest: string;
65
+ readonly valid: true;
66
+ readonly digest: string;
67
+ }
68
+ export interface CompactEventAnchorV1 {
69
+ readonly cursor: number;
70
+ readonly projectionDigest: string;
71
+ }
72
+ export interface CompactCheckpointPointerV1 {
73
+ readonly version: 1;
74
+ readonly checkpointId: string;
75
+ readonly transactionId: string;
76
+ readonly sourceReceiptDigest: string;
77
+ readonly nextModelVisibleHistoryDigest: string;
78
+ readonly digest: string;
79
+ }
80
+ /** Receipt persisted with the checkpoint before its pointer becomes authoritative. */
81
+ export interface CompactCheckpointCommitReceiptV1 {
82
+ readonly version: 1;
83
+ readonly transactionId: string;
84
+ readonly threadId: string;
85
+ readonly turnId: string;
86
+ readonly source: CompactPrepareSourceReceiptV1;
87
+ readonly startedEvent: CompactEventAnchorV1;
88
+ readonly checkpointId: string;
89
+ readonly checkpointDigest: string;
90
+ readonly candidateDigest: string;
91
+ readonly validation: CompactValidationReceiptV1;
92
+ readonly previousCheckpointId: string | null;
93
+ readonly pointer: CompactCheckpointPointerV1;
94
+ readonly digest: string;
95
+ }
96
+ export interface CompactTransactionCompletedReceiptV1 {
97
+ readonly version: 1;
98
+ readonly status: 'completed';
99
+ readonly recovered: boolean;
100
+ readonly commit: CompactCheckpointCommitReceiptV1;
101
+ readonly completedSeq: number;
102
+ readonly nextModelVisibleHistoryDigest: string;
103
+ readonly digest: string;
104
+ }
105
+ export interface CompactTransactionFailedReceiptV1 {
106
+ readonly version: 1;
107
+ readonly status: 'failed';
108
+ /** Missing only when v1 protocol recovery cannot reconstruct it from compact.started. */
109
+ readonly transactionId?: string;
110
+ readonly threadId: string;
111
+ readonly turnId: string;
112
+ readonly source?: CompactPrepareSourceReceiptV1;
113
+ readonly sourceSeq: number;
114
+ readonly startedSeq: number;
115
+ readonly failedSeq: number;
116
+ readonly failureCode: CompactTransactionFailureCodeV1;
117
+ readonly previousCheckpointId?: string | null;
118
+ readonly digest: string;
119
+ }
120
+ export type CompactTransactionOutcomeV1 = {
121
+ readonly status: 'completed';
122
+ readonly receipt: CompactTransactionCompletedReceiptV1;
123
+ } | {
124
+ readonly status: 'failed';
125
+ readonly receipt: CompactTransactionFailedReceiptV1;
126
+ };
127
+ export interface CompactEventAppendResultV1 {
128
+ readonly event: RuntimeEventEnvelopeV1<CompactRuntimeEventV1>;
129
+ readonly projectionDigest: string;
130
+ }
131
+ export interface CompactCompareAndCommitInputV1 {
132
+ readonly source: CompactPrepareSourceReceiptV1;
133
+ readonly expectedEventAnchor: CompactEventAnchorV1;
134
+ readonly candidate: CompactPreparedCandidateV1;
135
+ readonly commit: CompactCheckpointCommitReceiptV1;
136
+ /** These hooks execute while the persistence lock is held. */
137
+ readonly onBoundary: (boundary: CompactCasBoundaryV1) => void;
138
+ }
139
+ export type CompactCompareAndCommitResultV1 = {
140
+ readonly status: 'committed';
141
+ readonly pointer: CompactCheckpointPointerV1;
142
+ } | {
143
+ readonly status: 'conflict';
144
+ readonly reason: CompactCasConflictReasonV1;
145
+ };
146
+ type MaybePromise<T> = T | Promise<T>;
147
+ /**
148
+ * Atomic persistence boundary required by CompactTransactionV1.
149
+ *
150
+ * compareAndCommit must hold one exclusive lock while it rechecks every source
151
+ * field, writes/reloads the checkpoint, and advances the pointer. A failure at
152
+ * or before after_checkpoint_write must restore the previous pointer/history.
153
+ * A failure at after_pointer_commit may leave the new pointer authoritative and
154
+ * is reconciled from the persisted commit receipt on resume.
155
+ */
156
+ export interface CompactTransactionPersistenceV1 {
157
+ readonly threadId: string;
158
+ captureSource(turnId: string): MaybePromise<CompactAuthoritativeSourceV1>;
159
+ appendCompactEvent(input: {
160
+ readonly turnId: string;
161
+ readonly payload: CompactRuntimeEventV1;
162
+ }): MaybePromise<CompactEventAppendResultV1>;
163
+ compareAndCommit(input: CompactCompareAndCommitInputV1): MaybePromise<CompactCompareAndCommitResultV1>;
164
+ findCommittedCheckpoint(turnId: string, sourceSeq: number): MaybePromise<CompactCheckpointCommitReceiptV1 | undefined>;
165
+ listCompactEvents(): MaybePromise<readonly RuntimeEventEnvelopeV1<CompactRuntimeEventV1>[]>;
166
+ }
167
+ export interface CompactTransactionRunInputV1 {
168
+ readonly transactionId: string;
169
+ readonly turnId: string;
170
+ readonly prepare: (context: {
171
+ readonly source: CompactPrepareSourceReceiptV1;
172
+ readonly history: readonly unknown[];
173
+ readonly taskContext: unknown;
174
+ }, signal: AbortSignal) => Promise<CompactPreparedCandidateV1>;
175
+ readonly signal?: AbortSignal;
176
+ }
177
+ export interface CompactTransactionOptionsV1 {
178
+ readonly onBoundary?: (boundary: CompactTransactionBoundaryV1, context: {
179
+ readonly transactionId: string;
180
+ readonly turnId: string;
181
+ readonly sourceSeq?: number;
182
+ readonly checkpointId?: string;
183
+ }) => void;
184
+ }
185
+ export interface CompactRecoveryReportV1 {
186
+ readonly version: 1;
187
+ readonly completed: number;
188
+ readonly failed: number;
189
+ readonly receipts: readonly (CompactTransactionCompletedReceiptV1 | CompactTransactionFailedReceiptV1)[];
190
+ readonly digest: string;
191
+ }
192
+ export declare const COMPACT_PROTOCOL_V1_ADDITIVE_FIELDS: {
193
+ readonly 'compact.started': readonly ["transactionId", "sourceReceiptDigest", "startedProjectionDigest"];
194
+ readonly 'compact.completed': readonly ["transactionId", "commitReceiptDigest", "nextModelVisibleHistoryDigest"];
195
+ readonly 'compact.failed': readonly ["transactionId", "sourceSeq", "failureCode", "failureReceiptDigest"];
196
+ };
197
+ export declare const COMPACT_EVENT_STORE_ADDITIVE_API = "appendCompactCheckpointCas(expectedCursor, expectedProjectionDigest, sourceReceipt, checkpoint, pointer)";
198
+ export declare class CompactTransactionError extends Error {
199
+ readonly code: 'ORION_COMPACT_INVALID' | 'ORION_COMPACT_EVENT_CORRUPT' | 'ORION_COMPACT_RECOVERY_REQUIRED';
200
+ constructor(code: 'ORION_COMPACT_INVALID' | 'ORION_COMPACT_EVENT_CORRUPT' | 'ORION_COMPACT_RECOVERY_REQUIRED', message: string);
201
+ }
202
+ export declare class CompactCrashInjectionError extends Error {
203
+ readonly boundary: CompactTransactionBoundaryV1;
204
+ readonly cause: unknown;
205
+ readonly code = "ORION_COMPACT_CRASH_INJECTED";
206
+ constructor(boundary: CompactTransactionBoundaryV1, cause: unknown);
207
+ }
208
+ /** Non-steerable maintenance transaction for compact checkpoint replacement. */
209
+ export declare class CompactTransactionV1 {
210
+ private readonly persistence;
211
+ private readonly validator;
212
+ private readonly options;
213
+ readonly version: 1;
214
+ constructor(persistence: CompactTransactionPersistenceV1, validator: CompactCandidateValidatorV1, options?: CompactTransactionOptionsV1);
215
+ run(input: CompactTransactionRunInputV1): Promise<CompactTransactionOutcomeV1>;
216
+ /** Resolve orphan compact.started events without guessing that candidate work succeeded. */
217
+ recoverOrphans(): Promise<CompactRecoveryReportV1>;
218
+ private completeCommittedTransaction;
219
+ private boundary;
220
+ }
221
+ export declare function verifyCompactPrepareSourceReceipt(receipt: CompactPrepareSourceReceiptV1): void;
222
+ export declare function verifyCompactValidationReceipt(receipt: CompactValidationReceiptV1): void;
223
+ export declare function verifyCompactCheckpointCommitReceipt(receipt: CompactCheckpointCommitReceiptV1): void;
224
+ export {};
225
+ //# sourceMappingURL=compact-transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compact-transaction.d.ts","sourceRoot":"","sources":["../../src/runtime/compact-transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,2BAA2B,EAAG,CAAU,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,cAAc,EACd;IAAE,IAAI,EAAE,iBAAiB,GAAG,mBAAmB,GAAG,gBAAgB,CAAA;CAAE,CACrE,CAAC;AAEF,MAAM,MAAM,4BAA4B,GACpC,sBAAsB,GACtB,sBAAsB,GACtB,yBAAyB,GACzB,0BAA0B,GAC1B,oBAAoB,GACpB,mBAAmB,GACnB,wBAAwB,GACxB,sBAAsB,GACtB,wBAAwB,GACxB,qBAAqB,CAAC;AAE1B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