open-multi-agent-kit 0.99.0 → 1.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 (464) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/README.md +3 -3
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/cli.js +1 -0
  5. package/dist/bun/cli.js.map +1 -1
  6. package/dist/bun/register-bundled-coding-agent.d.ts +10 -0
  7. package/dist/bun/register-bundled-coding-agent.d.ts.map +1 -0
  8. package/dist/bun/register-bundled-coding-agent.js +12 -0
  9. package/dist/bun/register-bundled-coding-agent.js.map +1 -0
  10. package/dist/cli/args.d.ts +1 -1
  11. package/dist/cli/args.d.ts.map +1 -1
  12. package/dist/cli/args.js +1 -1
  13. package/dist/cli/args.js.map +1 -1
  14. package/dist/cli/help.d.ts.map +1 -1
  15. package/dist/cli/help.js +2 -1
  16. package/dist/cli/help.js.map +1 -1
  17. package/dist/cli.d.ts.map +1 -1
  18. package/dist/cli.js +14 -2
  19. package/dist/cli.js.map +1 -1
  20. package/dist/commands/neo-cli.d.ts +9 -0
  21. package/dist/commands/neo-cli.d.ts.map +1 -0
  22. package/dist/commands/neo-cli.js +61 -0
  23. package/dist/commands/neo-cli.js.map +1 -0
  24. package/dist/coordination/awareness.d.ts +32 -0
  25. package/dist/coordination/awareness.d.ts.map +1 -0
  26. package/dist/coordination/awareness.js +55 -0
  27. package/dist/coordination/awareness.js.map +1 -0
  28. package/dist/coordination/broker.d.ts +79 -0
  29. package/dist/coordination/broker.d.ts.map +1 -0
  30. package/dist/coordination/broker.js +195 -0
  31. package/dist/coordination/broker.js.map +1 -0
  32. package/dist/coordination/index.d.ts +16 -0
  33. package/dist/coordination/index.d.ts.map +1 -0
  34. package/dist/coordination/index.js +16 -0
  35. package/dist/coordination/index.js.map +1 -0
  36. package/dist/coordination/integration.d.ts +59 -0
  37. package/dist/coordination/integration.d.ts.map +1 -0
  38. package/dist/coordination/integration.js +126 -0
  39. package/dist/coordination/integration.js.map +1 -0
  40. package/dist/coordination/operation.d.ts +106 -0
  41. package/dist/coordination/operation.d.ts.map +1 -0
  42. package/dist/coordination/operation.js +179 -0
  43. package/dist/coordination/operation.js.map +1 -0
  44. package/dist/coordination/resource.d.ts +33 -0
  45. package/dist/coordination/resource.d.ts.map +1 -0
  46. package/dist/coordination/resource.js +89 -0
  47. package/dist/coordination/resource.js.map +1 -0
  48. package/dist/coordination/session.d.ts +74 -0
  49. package/dist/coordination/session.d.ts.map +1 -0
  50. package/dist/coordination/session.js +143 -0
  51. package/dist/coordination/session.js.map +1 -0
  52. package/dist/coordination/types.d.ts +68 -0
  53. package/dist/coordination/types.d.ts.map +1 -0
  54. package/dist/coordination/types.js +26 -0
  55. package/dist/coordination/types.js.map +1 -0
  56. package/dist/core/agent-session.d.ts +29 -2
  57. package/dist/core/agent-session.d.ts.map +1 -1
  58. package/dist/core/agent-session.js +135 -37
  59. package/dist/core/agent-session.js.map +1 -1
  60. package/dist/core/bundled-skills.d.ts +4 -0
  61. package/dist/core/bundled-skills.d.ts.map +1 -0
  62. package/dist/core/bundled-skills.js +32 -0
  63. package/dist/core/bundled-skills.js.map +1 -0
  64. package/dist/core/cli-diagnostics.d.ts +6 -0
  65. package/dist/core/cli-diagnostics.d.ts.map +1 -0
  66. package/dist/core/cli-diagnostics.js +20 -0
  67. package/dist/core/cli-diagnostics.js.map +1 -0
  68. package/dist/core/compaction/control-state.d.ts +41 -0
  69. package/dist/core/compaction/control-state.d.ts.map +1 -0
  70. package/dist/core/compaction/control-state.js +85 -0
  71. package/dist/core/compaction/control-state.js.map +1 -0
  72. package/dist/core/compaction/fallback.d.ts +60 -0
  73. package/dist/core/compaction/fallback.d.ts.map +1 -0
  74. package/dist/core/compaction/fallback.js +117 -0
  75. package/dist/core/compaction/fallback.js.map +1 -0
  76. package/dist/core/compaction/index.d.ts +2 -0
  77. package/dist/core/compaction/index.d.ts.map +1 -1
  78. package/dist/core/compaction/index.js +2 -0
  79. package/dist/core/compaction/index.js.map +1 -1
  80. package/dist/core/context-budget-headroom-candidates.d.ts +16 -1
  81. package/dist/core/context-budget-headroom-candidates.d.ts.map +1 -1
  82. package/dist/core/context-budget-headroom-candidates.js +31 -13
  83. package/dist/core/context-budget-headroom-candidates.js.map +1 -1
  84. package/dist/core/context-budget-headroom-types.d.ts +7 -1
  85. package/dist/core/context-budget-headroom-types.d.ts.map +1 -1
  86. package/dist/core/context-budget-headroom-types.js +0 -1
  87. package/dist/core/context-budget-headroom-types.js.map +1 -1
  88. package/dist/core/context-budget-headroom.d.ts +22 -0
  89. package/dist/core/context-budget-headroom.d.ts.map +1 -1
  90. package/dist/core/context-budget-headroom.js +46 -2
  91. package/dist/core/context-budget-headroom.js.map +1 -1
  92. package/dist/core/context-budget-v2-global-pass.d.ts +21 -0
  93. package/dist/core/context-budget-v2-global-pass.d.ts.map +1 -0
  94. package/dist/core/context-budget-v2-global-pass.js +203 -0
  95. package/dist/core/context-budget-v2-global-pass.js.map +1 -0
  96. package/dist/core/context-budget-v2-input-validation.d.ts +4 -0
  97. package/dist/core/context-budget-v2-input-validation.d.ts.map +1 -0
  98. package/dist/core/context-budget-v2-input-validation.js +79 -0
  99. package/dist/core/context-budget-v2-input-validation.js.map +1 -0
  100. package/dist/core/context-budget-v2-observability.d.ts +15 -0
  101. package/dist/core/context-budget-v2-observability.d.ts.map +1 -0
  102. package/dist/core/context-budget-v2-observability.js +35 -0
  103. package/dist/core/context-budget-v2-observability.js.map +1 -0
  104. package/dist/core/context-budget-v2-planned-items.d.ts +17 -0
  105. package/dist/core/context-budget-v2-planned-items.d.ts.map +1 -0
  106. package/dist/core/context-budget-v2-planned-items.js +59 -0
  107. package/dist/core/context-budget-v2-planned-items.js.map +1 -0
  108. package/dist/core/context-budget-v2-planner.d.ts.map +1 -1
  109. package/dist/core/context-budget-v2-planner.js +69 -51
  110. package/dist/core/context-budget-v2-planner.js.map +1 -1
  111. package/dist/core/context-budget-v2-scoring.d.ts +7 -1
  112. package/dist/core/context-budget-v2-scoring.d.ts.map +1 -1
  113. package/dist/core/context-budget-v2-scoring.js.map +1 -1
  114. package/dist/core/context-budget-v2-selection.d.ts +22 -3
  115. package/dist/core/context-budget-v2-selection.d.ts.map +1 -1
  116. package/dist/core/context-budget-v2-selection.js +41 -59
  117. package/dist/core/context-budget-v2-selection.js.map +1 -1
  118. package/dist/core/context-budget-v2-tiers.d.ts.map +1 -1
  119. package/dist/core/context-budget-v2-tiers.js +9 -42
  120. package/dist/core/context-budget-v2-tiers.js.map +1 -1
  121. package/dist/core/context-budget-v2-types.d.ts +14 -2
  122. package/dist/core/context-budget-v2-types.d.ts.map +1 -1
  123. package/dist/core/context-budget-v2-types.js +6 -1
  124. package/dist/core/context-budget-v2-types.js.map +1 -1
  125. package/dist/core/extensions/bundled-virtual-modules.d.ts +15 -0
  126. package/dist/core/extensions/bundled-virtual-modules.d.ts.map +1 -0
  127. package/dist/core/extensions/bundled-virtual-modules.js +63 -0
  128. package/dist/core/extensions/bundled-virtual-modules.js.map +1 -0
  129. package/dist/core/extensions/loader.d.ts.map +1 -1
  130. package/dist/core/extensions/loader.js +2 -42
  131. package/dist/core/extensions/loader.js.map +1 -1
  132. package/dist/core/extensions/runner.d.ts +1 -0
  133. package/dist/core/extensions/runner.d.ts.map +1 -1
  134. package/dist/core/extensions/runner.js +6 -0
  135. package/dist/core/extensions/runner.js.map +1 -1
  136. package/dist/core/extensions/types.d.ts +10 -0
  137. package/dist/core/extensions/types.d.ts.map +1 -1
  138. package/dist/core/extensions/types.js.map +1 -1
  139. package/dist/core/index.d.ts +2 -1
  140. package/dist/core/index.d.ts.map +1 -1
  141. package/dist/core/index.js +2 -1
  142. package/dist/core/index.js.map +1 -1
  143. package/dist/core/loadout-runtime.d.ts +2 -8
  144. package/dist/core/loadout-runtime.d.ts.map +1 -1
  145. package/dist/core/loadout-runtime.js.map +1 -1
  146. package/dist/core/mcp/client.d.ts +27 -6
  147. package/dist/core/mcp/client.d.ts.map +1 -1
  148. package/dist/core/mcp/client.js +80 -20
  149. package/dist/core/mcp/client.js.map +1 -1
  150. package/dist/core/mcp/manager.d.ts +10 -1
  151. package/dist/core/mcp/manager.d.ts.map +1 -1
  152. package/dist/core/mcp/manager.js +68 -9
  153. package/dist/core/mcp/manager.js.map +1 -1
  154. package/dist/core/mcp/protocol.d.ts +9 -3
  155. package/dist/core/mcp/protocol.d.ts.map +1 -1
  156. package/dist/core/mcp/protocol.js +61 -15
  157. package/dist/core/mcp/protocol.js.map +1 -1
  158. package/dist/core/mcp/stdio-transport.d.ts +12 -1
  159. package/dist/core/mcp/stdio-transport.d.ts.map +1 -1
  160. package/dist/core/mcp/stdio-transport.js +30 -2
  161. package/dist/core/mcp/stdio-transport.js.map +1 -1
  162. package/dist/core/mcp-descriptor-injection.d.ts +26 -0
  163. package/dist/core/mcp-descriptor-injection.d.ts.map +1 -0
  164. package/dist/core/mcp-descriptor-injection.js +25 -0
  165. package/dist/core/mcp-descriptor-injection.js.map +1 -0
  166. package/dist/core/mcp-public-presets.d.ts +1 -3
  167. package/dist/core/mcp-public-presets.d.ts.map +1 -1
  168. package/dist/core/mcp-public-presets.js +3 -15
  169. package/dist/core/mcp-public-presets.js.map +1 -1
  170. package/dist/core/model-registry.d.ts.map +1 -1
  171. package/dist/core/model-registry.js +24 -3
  172. package/dist/core/model-registry.js.map +1 -1
  173. package/dist/core/neo/catalog.d.ts +20 -0
  174. package/dist/core/neo/catalog.d.ts.map +1 -0
  175. package/dist/core/neo/catalog.js +50 -0
  176. package/dist/core/neo/catalog.js.map +1 -0
  177. package/dist/core/neo/setup.d.ts +3 -0
  178. package/dist/core/neo/setup.d.ts.map +1 -0
  179. package/dist/core/neo/setup.js +47 -0
  180. package/dist/core/neo/setup.js.map +1 -0
  181. package/dist/core/provider-default-models.d.ts +2 -0
  182. package/dist/core/provider-default-models.d.ts.map +1 -1
  183. package/dist/core/provider-default-models.js +2 -0
  184. package/dist/core/provider-default-models.js.map +1 -1
  185. package/dist/core/provider-display-names.d.ts.map +1 -1
  186. package/dist/core/provider-display-names.js +2 -0
  187. package/dist/core/provider-display-names.js.map +1 -1
  188. package/dist/core/provider-error-classification.d.ts +57 -0
  189. package/dist/core/provider-error-classification.d.ts.map +1 -0
  190. package/dist/core/provider-error-classification.js +103 -0
  191. package/dist/core/provider-error-classification.js.map +1 -0
  192. package/dist/core/provider-resilience.d.ts +10 -0
  193. package/dist/core/provider-resilience.d.ts.map +1 -1
  194. package/dist/core/provider-resilience.js +36 -3
  195. package/dist/core/provider-resilience.js.map +1 -1
  196. package/dist/core/provider-usage-commandcode.d.ts +9 -0
  197. package/dist/core/provider-usage-commandcode.d.ts.map +1 -0
  198. package/dist/core/provider-usage-commandcode.js +198 -0
  199. package/dist/core/provider-usage-commandcode.js.map +1 -0
  200. package/dist/core/provider-usage-devin.d.ts +5 -3
  201. package/dist/core/provider-usage-devin.d.ts.map +1 -1
  202. package/dist/core/provider-usage-devin.js +15 -5
  203. package/dist/core/provider-usage-devin.js.map +1 -1
  204. package/dist/core/provider-usage-types.d.ts +1 -1
  205. package/dist/core/provider-usage-types.d.ts.map +1 -1
  206. package/dist/core/provider-usage-types.js.map +1 -1
  207. package/dist/core/provider-usage.d.ts.map +1 -1
  208. package/dist/core/provider-usage.js +6 -0
  209. package/dist/core/provider-usage.js.map +1 -1
  210. package/dist/core/reasoning-router-resolver.d.ts +7 -0
  211. package/dist/core/reasoning-router-resolver.d.ts.map +1 -1
  212. package/dist/core/reasoning-router-resolver.js +21 -3
  213. package/dist/core/reasoning-router-resolver.js.map +1 -1
  214. package/dist/core/reasoning-router-v4.d.ts +8 -5
  215. package/dist/core/reasoning-router-v4.d.ts.map +1 -1
  216. package/dist/core/reasoning-router-v4.js +8 -5
  217. package/dist/core/reasoning-router-v4.js.map +1 -1
  218. package/dist/core/resource-admission.d.ts +36 -0
  219. package/dist/core/resource-admission.d.ts.map +1 -1
  220. package/dist/core/resource-admission.js +59 -0
  221. package/dist/core/resource-admission.js.map +1 -1
  222. package/dist/core/resource-loader.d.ts.map +1 -1
  223. package/dist/core/resource-loader.js +2 -2
  224. package/dist/core/resource-loader.js.map +1 -1
  225. package/dist/core/run-usage-ledger.d.ts +47 -0
  226. package/dist/core/run-usage-ledger.d.ts.map +1 -0
  227. package/dist/core/run-usage-ledger.js +162 -0
  228. package/dist/core/run-usage-ledger.js.map +1 -0
  229. package/dist/core/run-usage-operation.d.ts +8 -0
  230. package/dist/core/run-usage-operation.d.ts.map +1 -0
  231. package/dist/core/run-usage-operation.js +12 -0
  232. package/dist/core/run-usage-operation.js.map +1 -0
  233. package/dist/core/sdk.d.ts.map +1 -1
  234. package/dist/core/sdk.js +5 -6
  235. package/dist/core/sdk.js.map +1 -1
  236. package/dist/core/session-compaction-service.d.ts +15 -0
  237. package/dist/core/session-compaction-service.d.ts.map +1 -1
  238. package/dist/core/session-compaction-service.js +17 -4
  239. package/dist/core/session-compaction-service.js.map +1 -1
  240. package/dist/core/session-failure-cause.d.ts.map +1 -1
  241. package/dist/core/session-failure-cause.js +14 -5
  242. package/dist/core/session-failure-cause.js.map +1 -1
  243. package/dist/core/session-prompt-lifecycle.d.ts +6 -0
  244. package/dist/core/session-prompt-lifecycle.d.ts.map +1 -1
  245. package/dist/core/session-prompt-lifecycle.js +47 -2
  246. package/dist/core/session-prompt-lifecycle.js.map +1 -1
  247. package/dist/core/session-termination.d.ts.map +1 -1
  248. package/dist/core/session-termination.js +4 -2
  249. package/dist/core/session-termination.js.map +1 -1
  250. package/dist/core/subagent-lane-authority.d.ts +28 -0
  251. package/dist/core/subagent-lane-authority.d.ts.map +1 -0
  252. package/dist/core/subagent-lane-authority.js +119 -0
  253. package/dist/core/subagent-lane-authority.js.map +1 -0
  254. package/dist/core/subagent-lane-contract.d.ts +114 -0
  255. package/dist/core/subagent-lane-contract.d.ts.map +1 -0
  256. package/dist/core/subagent-lane-contract.js +18 -0
  257. package/dist/core/subagent-lane-contract.js.map +1 -0
  258. package/dist/core/subagent-lane-launcher.d.ts +3 -6
  259. package/dist/core/subagent-lane-launcher.d.ts.map +1 -1
  260. package/dist/core/subagent-lane-launcher.js +53 -12
  261. package/dist/core/subagent-lane-launcher.js.map +1 -1
  262. package/dist/core/subagent-orchestration.d.ts +4 -17
  263. package/dist/core/subagent-orchestration.d.ts.map +1 -1
  264. package/dist/core/subagent-orchestration.js.map +1 -1
  265. package/dist/core/todo-runtime-state.d.ts +12 -0
  266. package/dist/core/todo-runtime-state.d.ts.map +1 -1
  267. package/dist/core/todo-runtime-state.js +23 -0
  268. package/dist/core/todo-runtime-state.js.map +1 -1
  269. package/dist/core/verified-run/broker.d.ts.map +1 -1
  270. package/dist/core/verified-run/broker.js +4 -1
  271. package/dist/core/verified-run/broker.js.map +1 -1
  272. package/dist/core/workload-permit-pool.d.ts +1 -1
  273. package/dist/core/workload-permit-pool.d.ts.map +1 -1
  274. package/dist/core/workload-permit-pool.js +3 -0
  275. package/dist/core/workload-permit-pool.js.map +1 -1
  276. package/dist/guardrails/strict-evidence-approval-adapter.d.ts +34 -0
  277. package/dist/guardrails/strict-evidence-approval-adapter.d.ts.map +1 -0
  278. package/dist/guardrails/strict-evidence-approval-adapter.js +70 -0
  279. package/dist/guardrails/strict-evidence-approval-adapter.js.map +1 -0
  280. package/dist/index.d.ts +5 -0
  281. package/dist/index.d.ts.map +1 -1
  282. package/dist/index.js +3 -0
  283. package/dist/index.js.map +1 -1
  284. package/dist/main.d.ts.map +1 -1
  285. package/dist/main.js +11 -18
  286. package/dist/main.js.map +1 -1
  287. package/dist/metacognition/calibration-selective.d.ts +78 -0
  288. package/dist/metacognition/calibration-selective.d.ts.map +1 -0
  289. package/dist/metacognition/calibration-selective.js +161 -0
  290. package/dist/metacognition/calibration-selective.js.map +1 -0
  291. package/dist/metacognition/calibration.d.ts +62 -0
  292. package/dist/metacognition/calibration.d.ts.map +1 -0
  293. package/dist/metacognition/calibration.js +122 -0
  294. package/dist/metacognition/calibration.js.map +1 -0
  295. package/dist/metacognition/checkpoint.d.ts +60 -0
  296. package/dist/metacognition/checkpoint.d.ts.map +1 -0
  297. package/dist/metacognition/checkpoint.js +57 -0
  298. package/dist/metacognition/checkpoint.js.map +1 -0
  299. package/dist/metacognition/context7.d.ts +48 -0
  300. package/dist/metacognition/context7.d.ts.map +1 -0
  301. package/dist/metacognition/context7.js +154 -0
  302. package/dist/metacognition/context7.js.map +1 -0
  303. package/dist/metacognition/decision.d.ts +44 -0
  304. package/dist/metacognition/decision.d.ts.map +1 -0
  305. package/dist/metacognition/decision.js +111 -0
  306. package/dist/metacognition/decision.js.map +1 -0
  307. package/dist/metacognition/evaluation.d.ts +73 -0
  308. package/dist/metacognition/evaluation.d.ts.map +1 -0
  309. package/dist/metacognition/evaluation.js +97 -0
  310. package/dist/metacognition/evaluation.js.map +1 -0
  311. package/dist/metacognition/index.d.ts +31 -0
  312. package/dist/metacognition/index.d.ts.map +1 -0
  313. package/dist/metacognition/index.js +31 -0
  314. package/dist/metacognition/index.js.map +1 -0
  315. package/dist/metacognition/knowledge-action.d.ts +43 -0
  316. package/dist/metacognition/knowledge-action.d.ts.map +1 -0
  317. package/dist/metacognition/knowledge-action.js +60 -0
  318. package/dist/metacognition/knowledge-action.js.map +1 -0
  319. package/dist/metacognition/knowledge.d.ts +84 -0
  320. package/dist/metacognition/knowledge.d.ts.map +1 -0
  321. package/dist/metacognition/knowledge.js +165 -0
  322. package/dist/metacognition/knowledge.js.map +1 -0
  323. package/dist/metacognition/obligations.d.ts +82 -0
  324. package/dist/metacognition/obligations.d.ts.map +1 -0
  325. package/dist/metacognition/obligations.js +139 -0
  326. package/dist/metacognition/obligations.js.map +1 -0
  327. package/dist/metacognition/observation-validity.d.ts +83 -0
  328. package/dist/metacognition/observation-validity.d.ts.map +1 -0
  329. package/dist/metacognition/observation-validity.js +118 -0
  330. package/dist/metacognition/observation-validity.js.map +1 -0
  331. package/dist/metacognition/observe.d.ts +45 -0
  332. package/dist/metacognition/observe.d.ts.map +1 -0
  333. package/dist/metacognition/observe.js +59 -0
  334. package/dist/metacognition/observe.js.map +1 -0
  335. package/dist/metacognition/policy.d.ts +53 -0
  336. package/dist/metacognition/policy.d.ts.map +1 -0
  337. package/dist/metacognition/policy.js +155 -0
  338. package/dist/metacognition/policy.js.map +1 -0
  339. package/dist/metacognition/predictions.d.ts +78 -0
  340. package/dist/metacognition/predictions.d.ts.map +1 -0
  341. package/dist/metacognition/predictions.js +181 -0
  342. package/dist/metacognition/predictions.js.map +1 -0
  343. package/dist/metacognition/retrieval.d.ts +53 -0
  344. package/dist/metacognition/retrieval.d.ts.map +1 -0
  345. package/dist/metacognition/retrieval.js +170 -0
  346. package/dist/metacognition/retrieval.js.map +1 -0
  347. package/dist/metacognition/risk.d.ts +48 -0
  348. package/dist/metacognition/risk.d.ts.map +1 -0
  349. package/dist/metacognition/risk.js +165 -0
  350. package/dist/metacognition/risk.js.map +1 -0
  351. package/dist/metacognition/route-economics.d.ts +95 -0
  352. package/dist/metacognition/route-economics.d.ts.map +1 -0
  353. package/dist/metacognition/route-economics.js +110 -0
  354. package/dist/metacognition/route-economics.js.map +1 -0
  355. package/dist/metacognition/runtime-bridge.d.ts +54 -0
  356. package/dist/metacognition/runtime-bridge.d.ts.map +1 -0
  357. package/dist/metacognition/runtime-bridge.js +140 -0
  358. package/dist/metacognition/runtime-bridge.js.map +1 -0
  359. package/dist/metacognition/skills.d.ts +42 -0
  360. package/dist/metacognition/skills.d.ts.map +1 -0
  361. package/dist/metacognition/skills.js +220 -0
  362. package/dist/metacognition/skills.js.map +1 -0
  363. package/dist/metacognition/state.d.ts +110 -0
  364. package/dist/metacognition/state.d.ts.map +1 -0
  365. package/dist/metacognition/state.js +52 -0
  366. package/dist/metacognition/state.js.map +1 -0
  367. package/dist/metacognition/validation.d.ts +19 -0
  368. package/dist/metacognition/validation.d.ts.map +1 -0
  369. package/dist/metacognition/validation.js +58 -0
  370. package/dist/metacognition/validation.js.map +1 -0
  371. package/dist/metacognition/verification.d.ts +93 -0
  372. package/dist/metacognition/verification.d.ts.map +1 -0
  373. package/dist/metacognition/verification.js +132 -0
  374. package/dist/metacognition/verification.js.map +1 -0
  375. package/dist/metacognition/verifier.d.ts +49 -0
  376. package/dist/metacognition/verifier.d.ts.map +1 -0
  377. package/dist/metacognition/verifier.js +88 -0
  378. package/dist/metacognition/verifier.js.map +1 -0
  379. package/dist/modes/acp/acp-agent.d.ts +24 -0
  380. package/dist/modes/acp/acp-agent.d.ts.map +1 -0
  381. package/dist/modes/acp/acp-agent.js +133 -0
  382. package/dist/modes/acp/acp-agent.js.map +1 -0
  383. package/dist/modes/acp/acp-mode.d.ts +4 -0
  384. package/dist/modes/acp/acp-mode.d.ts.map +1 -0
  385. package/dist/modes/acp/acp-mode.js +34 -0
  386. package/dist/modes/acp/acp-mode.js.map +1 -0
  387. package/dist/modes/acp/acp-session.d.ts +4 -0
  388. package/dist/modes/acp/acp-session.d.ts.map +1 -0
  389. package/dist/modes/acp/acp-session.js +76 -0
  390. package/dist/modes/acp/acp-session.js.map +1 -0
  391. package/dist/modes/acp/acp-transport.d.ts +5 -0
  392. package/dist/modes/acp/acp-transport.d.ts.map +1 -0
  393. package/dist/modes/acp/acp-transport.js +90 -0
  394. package/dist/modes/acp/acp-transport.js.map +1 -0
  395. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  396. package/dist/modes/interactive/interactive-mode.js +1 -0
  397. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  398. package/dist/observation/identity.d.ts +14 -0
  399. package/dist/observation/identity.d.ts.map +1 -0
  400. package/dist/observation/identity.js +29 -0
  401. package/dist/observation/identity.js.map +1 -0
  402. package/dist/observation/index.d.ts +13 -0
  403. package/dist/observation/index.d.ts.map +1 -0
  404. package/dist/observation/index.js +13 -0
  405. package/dist/observation/index.js.map +1 -0
  406. package/dist/observation/observe-mode.d.ts +46 -0
  407. package/dist/observation/observe-mode.d.ts.map +1 -0
  408. package/dist/observation/observe-mode.js +83 -0
  409. package/dist/observation/observe-mode.js.map +1 -0
  410. package/dist/observation/store.d.ts +53 -0
  411. package/dist/observation/store.d.ts.map +1 -0
  412. package/dist/observation/store.js +126 -0
  413. package/dist/observation/store.js.map +1 -0
  414. package/dist/observation/types.d.ts +72 -0
  415. package/dist/observation/types.d.ts.map +1 -0
  416. package/dist/observation/types.js +9 -0
  417. package/dist/observation/types.js.map +1 -0
  418. package/dist/observation/view.d.ts +39 -0
  419. package/dist/observation/view.d.ts.map +1 -0
  420. package/dist/observation/view.js +173 -0
  421. package/dist/observation/view.js.map +1 -0
  422. package/docs/audit-revalidation-2026-09-17.md +77 -0
  423. package/docs/devin-harness.md +33 -4
  424. package/docs/ecraf-normalization.md +83 -0
  425. package/docs/metacognition.md +51 -0
  426. package/docs/model-catalog-refresh.md +110 -1
  427. package/docs/models.md +1 -1
  428. package/docs/neo.md +134 -0
  429. package/docs/providers.md +125 -6
  430. package/docs/run-usage-ledger.md +56 -0
  431. package/docs/runtime-algorithms.md +151 -3
  432. package/docs/skills.md +1 -1
  433. package/docs/usage.md +2 -1
  434. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  435. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  436. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  437. package/examples/extensions/gondolin/package-lock.json +2 -2
  438. package/examples/extensions/gondolin/package.json +1 -1
  439. package/examples/extensions/sandbox/package-lock.json +2 -2
  440. package/examples/extensions/sandbox/package.json +1 -1
  441. package/examples/extensions/subagent/adaptive-agent-runtime.ts +14 -1
  442. package/examples/extensions/subagent/graph-result.ts +48 -0
  443. package/examples/extensions/subagent/index.ts +246 -111
  444. package/examples/extensions/subagent/managed-process-tree.ts +42 -0
  445. package/examples/extensions/subagent/managed-process.test.ts +24 -0
  446. package/examples/extensions/subagent/managed-process.ts +93 -112
  447. package/examples/extensions/subagent/subagent-runtime-types.ts +17 -1
  448. package/examples/extensions/subagent/subagent-stream.ts +161 -0
  449. package/examples/extensions/terminal-browser/README.md +54 -0
  450. package/examples/extensions/terminal-browser/bridge-protocol.ts +29 -0
  451. package/examples/extensions/terminal-browser/bridge.ts +219 -0
  452. package/examples/extensions/terminal-browser/browser-surface.ts +288 -0
  453. package/examples/extensions/terminal-browser/index.ts +215 -0
  454. package/examples/extensions/terminal-browser/placeholders.ts +49 -0
  455. package/examples/extensions/with-deps/package-lock.json +2 -2
  456. package/examples/extensions/with-deps/package.json +1 -1
  457. package/npm-shrinkwrap.json +18 -18
  458. package/package.json +8 -7
  459. package/resources/neo/skills/omk-browser/SKILL.md +32 -0
  460. package/resources/neo/skills/omk-code-review/SKILL.md +24 -0
  461. package/resources/neo/skills/omk-computeruse/SKILL.md +34 -0
  462. package/resources/neo/skills/omk-mcp-setup/SKILL.md +48 -0
  463. package/resources/neo/skills/omk-research/SKILL.md +24 -0
  464. package/resources/neo/skills/omk-site/SKILL.md +28 -0
@@ -1,5 +1,81 @@
1
1
  # Runtime Algorithms and Direction
2
2
 
3
+ ## Current feature status (audit §19.3)
4
+
5
+ "Implemented", "wired", "enabled", "verified in CI", "released", and
6
+ "measured benefit" are different gates. A pure function passing unit tests is
7
+ not a live product path, and a live path is not a measured improvement. This
8
+ table records each mechanism's actual gate at the pinned commit; the dated
9
+ baseline below is history, not current truth.
10
+
11
+ | Mechanism | Implemented | Wired into live path | Enabled by default | Verified in CI | Released | Measured benefit |
12
+ | --- | --- | --- | --- | --- | --- | --- |
13
+ | DAG claim scheduler (`tool-dag-scheduler`) | yes | `agent-loop` frontier executor | `toolScheduler: "dag-v2"` | unit + integration tests | v0.99.x line | not measured |
14
+ | Ready-frontier admission (`runDagFrontier`) | yes | `agent-loop` | same | `tool-dag-ready-frontier`, `tool-dag-hook-replan` tests | working tree | not measured |
15
+ | Dynamic-claim conflict check (`conflictsWithUnsettledClaim`) | yes | `agent-loop` | same | `tool-dag-dependencies` + hook tests | working tree | not measured |
16
+ | ECRAF admission planner (`tool-dag-ecraf`) | yes | **no** — no call path wires it | n/a | unit tests only | unreleased | not measured |
17
+ | Context Budget V2 | yes | system-prompt assembly | opt-in policy | planner/selection/cache tests | working tree | not measured |
18
+ | Tier floor reservation | yes | context-budget-v2 planner | when V2 enabled | `context-budget-v2-tier-floor` tests | working tree | not measured |
19
+ | Reasoning router v4 | yes | `/think auto` lane | opt-in | router tests | released | classification only, not success-probability calibration |
20
+ | Workload permit pool | yes | resource admission | default | pool tests | released | not measured |
21
+ | Provider retry/failover classification | yes | `provider-retry`, `session-failure-cause` | default | resilience/classification tests | released | not measured |
22
+ | MCP descriptor injection screen | yes | `mcp/manager` import path | default | quarantine tests | released | pattern rule score, not calibrated risk |
23
+ | verified-run coordinator + evidence | yes | verified-run paths | opt-in command | coordinator/evidence tests | working tree | scope-limited binding, not general correctness |
24
+
25
+ Gates are reported per row so a green "implemented" never upgrades itself to
26
+ "released" or "measured".
27
+
28
+ ## ECRAF arithmetic boundary (2026-09-17)
29
+
30
+ The internal `planEcrafAdmissions()` planner rejects non-finite derived density
31
+ denominators, scores, and reserved usage with `RangeError`, even when each input
32
+ number is finite. Scores are computed once per candidate before sorting or
33
+ calling the conflict predicate; singleton and zero-slot batches receive the same
34
+ validation. A bounded resource overflow still defers the candidate and allows
35
+ later feasible candidates. An unbounded resource has no capacity limit, but its
36
+ usage must remain representable as a finite number. Failed passes return no
37
+ partial admission plan and do not mutate caller input.
38
+
39
+ Regression coverage is in
40
+ `packages/agent/test/tool-dag-ecraf-arithmetic.test.ts`; existing numeric and
41
+ property tests remain in `packages/agent/test/tool-dag-ecraf.test.ts`.
42
+ This is local pure-planner validation, not live frontier wiring, CI confirmation,
43
+ a release, or evidence of latency/quality improvement. Resource normalization,
44
+ slot-aware ranking, fairness, and equal-budget runtime comparisons remain separate
45
+ work.
46
+
47
+ ## Final claim resolution is abort-bound (2026-09-19 audit F02)
48
+
49
+ The dag-v2 frontier re-resolves each prepared call's resource claims from its
50
+ exact post-hook arguments before admission. That wait was a bare `await`; the
51
+ initial scheduling pass in `tool-dag-memo` was already raced against the run's
52
+ abort signal, so an extension `resourceClaims()` that never settled on the
53
+ second call pinned a cancelled run until the callback returned on its own.
54
+ `resolveFinalResolution` now uses the same `awaitWithAbort` boundary. The
55
+ callback itself is not killed — a plain Promise cannot be — but the aborted
56
+ outcome settles the call, the frontier loop exits on the same signal, and a late
57
+ fulfilment or rejection lands in a finished batch and admits nothing. In-flight
58
+ peers keep the existing abort contract (`aborted`, `executionStarted: true`),
59
+ and the authorization hook still runs once. Coverage:
60
+ `packages/agent/test/tool-dag-final-claims-abort.test.ts`. This is the wait
61
+ boundary only; isolating a non-cooperative extension needs a killable execution
62
+ boundary, which this change does not add.
63
+
64
+ ## Reasoning router resolver contract (2026-09-19 audit F05/F06)
65
+
66
+ The low-confidence escalation in `resolveThinkingLevelV4WithUncertainty` is
67
+ monotone at a fixed bias and hint only; it is not a floor at the class base
68
+ level, because a negative learning bias is applied before the +1 step (`debug`
69
+ with `bias=-2` still resolves to `medium`). The docstring previously claimed the
70
+ stronger floor. A policy that must never drop below the base level needs an
71
+ explicit safety floor, which is a cost decision not taken here. The shared
72
+ resolver also normalizes `bias` and `escalationSteps` to finite integers
73
+ (non-finite → 0, fractions truncated toward zero) so a corrupted value keeps the
74
+ class's own level instead of walking the ladder lookup off its rungs to the
75
+ lowest available level; the session's bias-snapshot validator already rejects
76
+ such values before they reach the resolver. Coverage:
77
+ `packages/coding-agent/test/reasoning-router-resolver-contract.test.ts`.
78
+
3
79
  ## Working-tree shared run budgets
4
80
 
5
81
  The SDK `prompt(..., { runBudget })` path now shares a monotonic deadline and
@@ -130,21 +206,93 @@ The planner:
130
206
  4. scores optional items for relevance, recency, evidence, redundancy,
131
207
  priority, and full-text token cost;
132
208
  5. sorts optional items by
133
- `density -> effectiveScore -> priorityRank -> fullTokens -> id`; and
209
+ `density -> effectiveScore -> priorityRank -> fullTokens -> id`;
134
210
  6. selects a full, summary, headroom-compressed, pointer, or omitted
135
- representation that fits.
211
+ representation that fits (floor pass per tier, then the global pass);
212
+ 7. lets each still-omitted item buy its cheapest admissible form by stepping
213
+ selected items down to theirs, applied all-or-nothing; and
214
+ 8. re-offers each remaining item its costlier representations against the
215
+ leftover budget and promotes only when the selection policy prefers the
216
+ costlier form and it fits both the tier ceiling and the global remainder
217
+ (`context-budget-v2-global-pass.ts`; never touches hard items).
218
+
219
+ Breadth is settled before quality: step 7 runs before step 8, so an exchange
220
+ that admits another item cannot be undone by a promotion.
136
221
 
137
222
  Density divides effective score by the cheapest non-omit representation
138
223
  (`admissibleTokens`), not by full-text size. This avoids penalizing an item that
139
224
  can be represented by a small evidence pointer. Stable item IDs and explicit
140
- selection policy `sel-2` make tie-breaking and plan-cache invalidation
225
+ selection policy `sel-3` make tie-breaking and plan-cache invalidation
141
226
  deterministic.
142
227
 
228
+ ### Representation cost accounting (2026-09-19 audit F01/F03)
229
+
230
+ Every derived representation is priced by counting the string it materializes
231
+ with the planner's own token counter, the same counter that priced the full
232
+ text. The former `ceil(0.15 * full) + 8` summary price was a compression target,
233
+ not a cost: a 100-character "summary" identical to its source was recorded at
234
+ 12 tokens against the source's 25 and admitted into a 12-token budget. A
235
+ representation whose text equals the source, or whose counted cost is not below
236
+ the full text, is no longer offered. `createPlannedItems` stores the priced
237
+ candidates on each planned item so ranking and selection read one cost; the
238
+ selection policy token moved from `sel-2` to `sel-3` so plans and
239
+ representation entries cached under the old prices are not served.
240
+
241
+ ### Representation exchange (2026-09-19 audit F04)
242
+
243
+ Items are ranked by their cheapest admissible representation but admitted at
244
+ whatever the selector prefers, so a high-priority item priced at 10 for ordering
245
+ could consume 100 and displace two 45-token items. On the audit's counterexample
246
+ that scored 121 against 169.5 for `A-pointer + B-full + C-full` at the same 100
247
+ tokens, measured with the selector's own preference score.
248
+
249
+ The repair is bounded. After the global pass, each still-omitted item in rank
250
+ order may pay for its admission by stepping already-selected items down to their
251
+ cheapest admissible representation. Donors yield in order of the preference the
252
+ policy loses per token freed, the whole exchange is applied or none of it is,
253
+ and a donor is skipped when stepping it down would drop its tier below the floor
254
+ it is currently honouring. An item admitted this way leaves the omitted list, so
255
+ it is never reported as both included and omitted.
256
+
257
+ This is not joint `(item, representation)` optimization: donor choice is greedy
258
+ and admission order is unchanged, so the planner can still trail a brute-force
259
+ oracle on instances the bounded repair cannot reach. It does reach the oracle on
260
+ the audit counterexample, and a 200-instance randomized property check holds
261
+ feasibility (global and tier caps), disjoint included/omitted sets, and
262
+ maximality: no omitted item still fits at its cheapest admissible form.
263
+
264
+ The quality-policy field `preferFullForHighPriority` is deprecated: nothing
265
+ reads it, and flipping it changes no candidate or choice
266
+ (`context-budget-quality-policy-semantics.test.ts`). The priority weight already
267
+ prefers full text for high-priority items.
268
+
269
+ Evidence:
270
+
271
+ - `packages/coding-agent/test/context-budget-representation-accounting.test.ts`
272
+ - `packages/coding-agent/test/context-budget-representation-exchange.test.ts`
273
+ - `packages/coding-agent/test/context-budget-representation-promotion.test.ts`
274
+ - `packages/coding-agent/test/context-budget-quality-policy-semantics.test.ts`
275
+
143
276
  When enabled, representation and negative-result entries persist under
144
277
  `.omk/cache/context-budget-v2`; plan entries remain session-memory-only.
145
278
  `OMK_CONTEXT_GOVERNOR_CACHE=memory` keeps every cache entry in session memory,
146
279
  and `OMK_CONTEXT_GOVERNOR_CACHE_DIR` relocates the representation snapshot.
147
280
 
281
+ Cache keys are bound to the counter that produced the prices. Two of the three
282
+ layers bind it implicitly — a plan key hashes each planned item's token counts,
283
+ and an exact representation key hashes a fingerprint containing
284
+ `estimatedTokens` — but the materialized (semantic) key is bucketed at 100
285
+ tokens and carries the tokenizer as a field, and no caller passed one, so every
286
+ counter shared the static `heuristic-v1` key space and the entry's
287
+ `tokenizer_mismatch` check compared that constant against itself. Since F01 made
288
+ every representation price counter-dependent, that let one estimator's price be
289
+ admitted in another estimator's run. The planner now resolves the key's
290
+ tokenizer from the counter's own `adapterId`
291
+ (`resolveEffectiveTokenizerIdV2`, probing a non-empty string because
292
+ `countText("")` short-circuits to the fallback estimator); an explicit
293
+ `tokenizerId` input still wins. Coverage:
294
+ `packages/coding-agent/test/context-budget-cache-tokenizer-binding.test.ts`.
295
+
148
296
  Evidence:
149
297
 
150
298
  - `packages/coding-agent/src/core/context-budget-v2-planner.ts`
package/docs/skills.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Skills are self-contained capability packages that the agent loads on-demand. A skill provides specialized workflows, setup instructions, helper scripts, and reference documentation for specific tasks.
6
6
 
7
- OMK ships with **no built-in skills** — every skill is user-installed via the locations below, an OMK package, or `--skill`. The default session has zero skills and zero MCP servers configured.
7
+ This source tree includes six public [Neo skills](neo.md) in `resources/neo/skills`. They fill names not supplied by user, project, or explicit skills. `--no-skills` disables automatic loading, while `OMK_BUNDLED_SKILLS=0` disables only the bundled set. Explicit `--skill` paths remain available. Bundled instructions do not install or connect MCP servers; MCP setup remains opt-in. This source integration does not imply that older published packages include Neo.
8
8
 
9
9
  OMK implements the [Agent Skills standard](https://agentskills.io/specification), warning about most violations but remaining lenient. OMK allows skill names to differ from their parent directory even though the standard disallows it; that rule is suboptimal for shared skill directories used across multiple agent harnesses.
10
10
 
package/docs/usage.md CHANGED
@@ -146,7 +146,8 @@ When the resolved model ID is exactly `gpt-6-astra`, the built-in preset appends
146
146
  such as `openai/gpt-6-astra` and `openrouter/openai/gpt-6-astra` match the same
147
147
  model. Similar names, dated variants, and other GPT models do not select this
148
148
  preset. Select the configured model through `/model`; the preset does not add
149
- model availability to an account.
149
+ model availability to an account. `--thinking ultra` is a selector alias for
150
+ Astra's documented ceiling `max`; OMK does not send `reasoning.effort: "ultra"`.
150
151
 
151
152
  The Astra guidance encourages completing authorized work, asking only material
152
153
  clarifying questions, explaining any skill instruction that blocks progress,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omk-extension-custom-provider-anthropic",
3
- "version": "0.99.0",
3
+ "version": "1.2.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omk-extension-custom-provider-anthropic",
9
- "version": "0.99.0",
9
+ "version": "1.2.0",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "omk-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.99.0",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "omk-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.99.0",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omk-extension-gondolin",
3
- "version": "0.99.0",
3
+ "version": "1.2.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omk-extension-gondolin",
9
- "version": "0.99.0",
9
+ "version": "1.2.0",
10
10
  "dependencies": {
11
11
  "@earendil-works/gondolin": "0.12.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "omk-extension-gondolin",
3
3
  "private": true,
4
- "version": "0.99.0",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omk-extension-sandbox",
3
- "version": "0.99.0",
3
+ "version": "1.2.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omk-extension-sandbox",
9
- "version": "0.99.0",
9
+ "version": "1.2.0",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "0.0.26"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "omk-extension-sandbox",
3
3
  "private": true,
4
- "version": "0.99.0",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -28,6 +28,7 @@ import {
28
28
  remainingExecutionMs,
29
29
  } from "./deadline-budget.ts";
30
30
  import type { DeadlineProfileStore } from "./deadline-profile-store.ts";
31
+ import type { ManagedProcessResult } from "./managed-process.ts";
31
32
  import type {
32
33
  DeadlineAttemptMetadata,
33
34
  DeadlineOutcome,
@@ -99,6 +100,7 @@ export async function runAdaptiveAgent(options: RunAdaptiveAgentOptions): Promis
99
100
  let duplicateResumeBlocked = false;
100
101
  let lastCheckpoint: Awaited<ReturnType<typeof readCheckpoint>> | undefined;
101
102
  let terminalOutcome: DeadlineOutcome = "budget-exhausted";
103
+ let unsettledProcess: ManagedProcessResult | undefined;
102
104
  const checkpointPrefix = options.checkpointPrefix ?? path.join(os.tmpdir(), "omk-subagent-checkpoint-");
103
105
  const workspace = await createCheckpointWorkspace(checkpointPrefix);
104
106
 
@@ -183,7 +185,11 @@ export async function runAdaptiveAgent(options: RunAdaptiveAgentOptions): Promis
183
185
  processReason: attempt.process.reason,
184
186
  cleanup: attempt.process.cleanup,
185
187
  });
186
-
188
+ if (attempt.process.terminationObserved === false) {
189
+ unsettledProcess = attempt.result.process;
190
+ terminalOutcome = "failed";
191
+ break outer;
192
+ }
187
193
  if (outcome === "completed") {
188
194
  completedShardIds.push(shard.id);
189
195
  terminalOutcome = "completed";
@@ -228,6 +234,13 @@ export async function runAdaptiveAgent(options: RunAdaptiveAgentOptions): Promis
228
234
  attempts,
229
235
  ...(lastCheckpoint === undefined ? {} : { checkpoint: lastCheckpoint }),
230
236
  };
237
+ if (unsettledProcess) {
238
+ aggregate.exitCode = 1;
239
+ aggregate.stopReason = "unsettled";
240
+ aggregate.errorMessage = "Subagent termination unconfirmed (unsettled)";
241
+ aggregate.process = unsettledProcess;
242
+ return aggregate;
243
+ }
231
244
  return aggregate;
232
245
  }
233
246
 
@@ -0,0 +1,48 @@
1
+ import { createHash } from "node:crypto";
2
+ import { emptyUsage, type SingleResult } from "./subagent-runtime-types.ts";
3
+ import type { GraphTask } from "./workflow-graph.ts";
4
+
5
+ export function failedResult(result: SingleResult): boolean {
6
+ return (
7
+ result.process?.terminationObserved === false ||
8
+ result.exitCode !== 0 ||
9
+ result.stopReason === "error" ||
10
+ result.stopReason === "aborted"
11
+ );
12
+ }
13
+
14
+ export function laneResult(
15
+ result: SingleResult,
16
+ ): void | { status: "failed" } | { status: "unsettled"; settlement: Promise<void> } {
17
+ if (result.process?.terminationObserved === false)
18
+ return { status: "unsettled", settlement: result.process.settlement };
19
+ if (failedResult(result)) return { status: "failed" };
20
+ }
21
+
22
+ export function blockedResult(task: GraphTask, reason = "blocked-dependency"): SingleResult {
23
+ return {
24
+ nodeId: task.id,
25
+ agent: task.agent,
26
+ agentSource: "unknown",
27
+ task: task.task,
28
+ exitCode: 1,
29
+ messages: [],
30
+ stderr: reason,
31
+ stopReason: reason,
32
+ usage: emptyUsage(),
33
+ };
34
+ }
35
+
36
+ export function dependencyDigests(
37
+ task: GraphTask,
38
+ outputs: ReadonlyMap<string, string>,
39
+ ): Readonly<Record<string, string>> {
40
+ return Object.fromEntries(
41
+ (task.dependsOn ?? []).map((id) => [
42
+ id,
43
+ createHash("sha256")
44
+ .update(outputs.get(id) ?? "")
45
+ .digest("hex"),
46
+ ]),
47
+ );
48
+ }