@bastani/atomic 0.9.20-alpha.1 → 0.9.20-alpha.10

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 (1175) hide show
  1. package/CHANGELOG.md +307 -0
  2. package/README.md +52 -7
  3. package/dist/builtin/intercom/CHANGELOG.md +34 -0
  4. package/dist/builtin/intercom/README.md +2 -2
  5. package/dist/builtin/intercom/broker/broker.ts +110 -39
  6. package/dist/builtin/intercom/broker/client.ts +8 -1
  7. package/dist/builtin/intercom/broker/send-handler.ts +59 -2
  8. package/dist/builtin/intercom/index.bundle.mjs +162 -18
  9. package/dist/builtin/intercom/live-route-refusal.ts +69 -0
  10. package/dist/builtin/intercom/package.json +3 -5
  11. package/dist/builtin/intercom/recoverable-disconnect.ts +16 -4
  12. package/dist/builtin/intercom/session-target.ts +34 -9
  13. package/dist/builtin/intercom/skills/intercom/SKILL.md +47 -16
  14. package/dist/builtin/intercom/types.ts +3 -1
  15. package/dist/builtin/mcp/CHANGELOG.md +13 -0
  16. package/dist/builtin/mcp/OAUTH.md +1 -1
  17. package/dist/builtin/mcp/README.md +3 -1
  18. package/dist/builtin/mcp/index.bundle.mjs +412 -64
  19. package/dist/builtin/mcp/package.json +4 -4
  20. package/dist/builtin/subagents/CHANGELOG.md +63 -0
  21. package/dist/builtin/subagents/README.md +4 -2
  22. package/dist/builtin/subagents/agents/code-simplifier.md +3 -4
  23. package/dist/builtin/subagents/agents/codebase-analyzer.md +3 -4
  24. package/dist/builtin/subagents/agents/codebase-locator.md +2 -3
  25. package/dist/builtin/subagents/agents/codebase-online-researcher.md +5 -6
  26. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -3
  27. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -3
  28. package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -3
  29. package/dist/builtin/subagents/agents/debugger.md +8 -7
  30. package/dist/builtin/subagents/agents/worker.md +5 -4
  31. package/dist/builtin/subagents/package.json +4 -4
  32. package/dist/builtin/subagents/skills/agent-browser/SKILL.md +56 -0
  33. package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +494 -0
  34. package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +578 -0
  35. package/dist/builtin/subagents/skills/cua-driver/LINUX.md +364 -0
  36. package/dist/builtin/subagents/skills/cua-driver/MACOS.md +509 -0
  37. package/dist/builtin/subagents/skills/cua-driver/README.md +113 -0
  38. package/dist/builtin/subagents/skills/cua-driver/RECORDING.md +162 -0
  39. package/dist/builtin/subagents/skills/cua-driver/SKILL.md +1105 -0
  40. package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +866 -0
  41. package/dist/builtin/subagents/skills/feedback/SKILL.md +49 -0
  42. package/dist/builtin/subagents/skills/feedback/scripts/scrub.mjs +498 -0
  43. package/dist/builtin/subagents/skills/subagent/SKILL.md +45 -19
  44. package/dist/builtin/subagents/src/extension/index.bundle.mjs +276 -68
  45. package/dist/builtin/web-access/CHANGELOG.md +18 -0
  46. package/dist/builtin/web-access/index.bundle.mjs +372 -300
  47. package/dist/builtin/web-access/package.json +3 -3
  48. package/dist/builtin/workflows/CHANGELOG.md +169 -0
  49. package/dist/builtin/workflows/README.md +20 -33
  50. package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
  51. package/dist/builtin/workflows/builtin/{chunk-g0csgs7w.js → chunk-18yz7r43.js} +8 -10
  52. package/dist/builtin/workflows/builtin/{chunk-31j2gs7h.js → chunk-1pd5zcfa.js} +4 -6
  53. package/dist/builtin/workflows/builtin/{chunk-xtxcq5tj.js → chunk-24c235x7.js} +17 -1
  54. package/dist/builtin/workflows/builtin/{chunk-6w6cvk6b.js → chunk-2jv44yz7.js} +4 -6
  55. package/dist/builtin/workflows/builtin/{chunk-yeee2jrc.js → chunk-2npg6daz.js} +76 -90
  56. package/dist/builtin/workflows/builtin/{chunk-z29qbehr.js → chunk-7ps7bnb4.js} +4 -6
  57. package/dist/builtin/workflows/builtin/{chunk-zqtm1d2c.js → chunk-ad864596.js} +13 -218
  58. package/dist/builtin/workflows/builtin/{chunk-fg9esgkj.js → chunk-f8jjd90r.js} +4 -6
  59. package/dist/builtin/workflows/builtin/{chunk-a2kdsqn8.js → chunk-gxrhbnaj.js} +5 -3
  60. package/dist/builtin/workflows/builtin/chunk-twefqrv0.js +10666 -0
  61. package/dist/builtin/workflows/builtin/{chunk-ewkkkbak.js → chunk-ynded223.js} +40 -111
  62. package/dist/builtin/workflows/builtin/{chunk-wf741bv3.js → chunk-z5xdqrs6.js} +4 -6
  63. package/dist/builtin/workflows/builtin/classify-and-act.js +3 -3
  64. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -3
  65. package/dist/builtin/workflows/builtin/generate-and-filter.js +3 -3
  66. package/dist/builtin/workflows/builtin/goal.js +4 -4
  67. package/dist/builtin/workflows/builtin/index.d.ts +1 -1
  68. package/dist/builtin/workflows/builtin/index.js +12 -12
  69. package/dist/builtin/workflows/builtin/loop-until-done.js +3 -3
  70. package/dist/builtin/workflows/builtin/open-claude-design.d.ts +1 -1
  71. package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
  72. package/dist/builtin/workflows/builtin/ralph.js +4 -4
  73. package/dist/builtin/workflows/builtin/steering-context.js +1 -1
  74. package/dist/builtin/workflows/builtin/tournament.js +3 -3
  75. package/dist/builtin/workflows/package.json +4 -4
  76. package/dist/builtin/workflows/skills/impeccable/SKILL.md +18 -11
  77. package/dist/builtin/workflows/skills/impeccable/reference/adapt.md +1 -1
  78. package/dist/builtin/workflows/skills/impeccable/reference/adapt.native.md +1 -1
  79. package/dist/builtin/workflows/skills/impeccable/reference/animate.md +1 -1
  80. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +5 -5
  81. package/dist/builtin/workflows/skills/impeccable/reference/audit.native.md +6 -6
  82. package/dist/builtin/workflows/skills/impeccable/reference/bolder.md +2 -2
  83. package/dist/builtin/workflows/skills/impeccable/reference/clarify.md +1 -1
  84. package/dist/builtin/workflows/skills/impeccable/reference/colorize.md +1 -1
  85. package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +0 -6
  86. package/dist/builtin/workflows/skills/impeccable/reference/critique.md +19 -41
  87. package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +11 -65
  88. package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +3 -3
  89. package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +4 -4
  90. package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +1 -1
  91. package/dist/builtin/workflows/skills/impeccable/reference/delight.md +1 -1
  92. package/dist/builtin/workflows/skills/impeccable/reference/distill.md +2 -2
  93. package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +4 -4
  94. package/dist/builtin/workflows/skills/impeccable/reference/document.md +4 -4
  95. package/dist/builtin/workflows/skills/impeccable/reference/extract.md +1 -1
  96. package/dist/builtin/workflows/skills/impeccable/reference/harden.md +1 -1
  97. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +21 -21
  98. package/dist/builtin/workflows/skills/impeccable/reference/init.md +8 -8
  99. package/dist/builtin/workflows/skills/impeccable/reference/layout.md +2 -2
  100. package/dist/builtin/workflows/skills/impeccable/reference/live-setup.md +10 -8
  101. package/dist/builtin/workflows/skills/impeccable/reference/live.md +39 -38
  102. package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +48 -21
  103. package/dist/builtin/workflows/skills/impeccable/reference/onboard.md +1 -1
  104. package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +1 -1
  105. package/dist/builtin/workflows/skills/impeccable/reference/overdrive.md +1 -1
  106. package/dist/builtin/workflows/skills/impeccable/reference/polish.md +11 -3
  107. package/dist/builtin/workflows/skills/impeccable/reference/quieter.md +2 -2
  108. package/dist/builtin/workflows/skills/impeccable/reference/routing.md +13 -7
  109. package/dist/builtin/workflows/skills/impeccable/reference/typeset.md +2 -2
  110. package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +13 -19
  111. package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -0
  112. package/dist/builtin/workflows/skills/impeccable/scripts/data/font-index-failures.json +121 -0
  113. package/dist/builtin/workflows/skills/impeccable/scripts/data/font-index.json +1 -0
  114. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable +212 -0
  115. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +218 -0
  116. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-dom.js +21 -0
  117. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-ignores.js +242 -0
  118. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +25 -4
  119. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +666 -197
  120. package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +10 -9
  121. package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +4 -4
  122. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +96 -23
  123. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +75 -27
  124. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +72 -26
  125. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +58 -22
  126. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +118 -0
  127. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +70 -29
  128. package/dist/builtin/workflows/skills/prompt-engineer/references/core_prompting.md +1 -1
  129. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +95 -32
  130. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +79 -30
  131. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +139 -0
  132. package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +4 -4
  133. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +1 -1
  134. package/dist/builtin/workflows/src/authoring.d.ts +6 -1
  135. package/dist/builtin/workflows/src/extension/index.bundle.mjs +25892 -21909
  136. package/dist/builtin/workflows/src/index.js +43029 -6422
  137. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +11 -0
  138. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +17 -1
  139. package/dist/bun/split-loader.js +13 -0
  140. package/dist/bun/split-loader.js.map +1 -1
  141. package/dist/cli/args.d.ts.map +1 -1
  142. package/dist/cli/args.js +17 -6
  143. package/dist/cli/args.js.map +1 -1
  144. package/dist/cli/file-processor.d.ts +1 -1
  145. package/dist/cli/file-processor.d.ts.map +1 -1
  146. package/dist/cli/file-processor.js.map +1 -1
  147. package/dist/config.d.ts +1 -0
  148. package/dist/config.d.ts.map +1 -1
  149. package/dist/config.js +1 -0
  150. package/dist/config.js.map +1 -1
  151. package/dist/core/agent-session-accessors.d.ts.map +1 -1
  152. package/dist/core/agent-session-accessors.js +2 -1
  153. package/dist/core/agent-session-accessors.js.map +1 -1
  154. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  155. package/dist/core/agent-session-auto-compaction.js +49 -14
  156. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  157. package/dist/core/agent-session-bash.d.ts +3 -1
  158. package/dist/core/agent-session-bash.d.ts.map +1 -1
  159. package/dist/core/agent-session-bash.js +27 -14
  160. package/dist/core/agent-session-bash.js.map +1 -1
  161. package/dist/core/agent-session-boundaries.d.ts +68 -0
  162. package/dist/core/agent-session-boundaries.d.ts.map +1 -0
  163. package/dist/core/agent-session-boundaries.js +339 -0
  164. package/dist/core/agent-session-boundaries.js.map +1 -0
  165. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  166. package/dist/core/agent-session-compaction.js +38 -15
  167. package/dist/core/agent-session-compaction.js.map +1 -1
  168. package/dist/core/agent-session-events.d.ts +6 -6
  169. package/dist/core/agent-session-events.d.ts.map +1 -1
  170. package/dist/core/agent-session-events.js +175 -74
  171. package/dist/core/agent-session-events.js.map +1 -1
  172. package/dist/core/agent-session-export.d.ts +1 -1
  173. package/dist/core/agent-session-export.d.ts.map +1 -1
  174. package/dist/core/agent-session-export.js +34 -39
  175. package/dist/core/agent-session-export.js.map +1 -1
  176. package/dist/core/agent-session-extension-bindings.d.ts +3 -2
  177. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  178. package/dist/core/agent-session-extension-bindings.js +274 -70
  179. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  180. package/dist/core/agent-session-message-queue.d.ts +1 -1
  181. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  182. package/dist/core/agent-session-message-queue.js +36 -7
  183. package/dist/core/agent-session-message-queue.js.map +1 -1
  184. package/dist/core/agent-session-methods.d.ts +55 -15
  185. package/dist/core/agent-session-methods.d.ts.map +1 -1
  186. package/dist/core/agent-session-methods.js.map +1 -1
  187. package/dist/core/agent-session-models.d.ts +2 -2
  188. package/dist/core/agent-session-models.d.ts.map +1 -1
  189. package/dist/core/agent-session-models.js +38 -29
  190. package/dist/core/agent-session-models.js.map +1 -1
  191. package/dist/core/agent-session-persistent-custom-messages.d.ts +1 -1
  192. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  193. package/dist/core/agent-session-persistent-custom-messages.js +2 -1
  194. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  195. package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
  196. package/dist/core/agent-session-post-tool-compaction.js +18 -1
  197. package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
  198. package/dist/core/agent-session-prompt.d.ts +1 -1
  199. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  200. package/dist/core/agent-session-prompt.js +186 -36
  201. package/dist/core/agent-session-prompt.js.map +1 -1
  202. package/dist/core/agent-session-queue-pause.d.ts +2 -0
  203. package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
  204. package/dist/core/agent-session-queue-pause.js +15 -3
  205. package/dist/core/agent-session-queue-pause.js.map +1 -1
  206. package/dist/core/agent-session-retry.d.ts +0 -3
  207. package/dist/core/agent-session-retry.d.ts.map +1 -1
  208. package/dist/core/agent-session-retry.js +28 -20
  209. package/dist/core/agent-session-retry.js.map +1 -1
  210. package/dist/core/agent-session-runtime-auth.d.ts.map +1 -1
  211. package/dist/core/agent-session-runtime-auth.js +10 -0
  212. package/dist/core/agent-session-runtime-auth.js.map +1 -1
  213. package/dist/core/agent-session-runtime.d.ts +21 -1
  214. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  215. package/dist/core/agent-session-runtime.js +434 -197
  216. package/dist/core/agent-session-runtime.js.map +1 -1
  217. package/dist/core/agent-session-services.d.ts +4 -0
  218. package/dist/core/agent-session-services.d.ts.map +1 -1
  219. package/dist/core/agent-session-services.js +31 -2
  220. package/dist/core/agent-session-services.js.map +1 -1
  221. package/dist/core/agent-session-state.d.ts +10 -2
  222. package/dist/core/agent-session-state.d.ts.map +1 -1
  223. package/dist/core/agent-session-state.js +32 -22
  224. package/dist/core/agent-session-state.js.map +1 -1
  225. package/dist/core/agent-session-summary.d.ts.map +1 -1
  226. package/dist/core/agent-session-summary.js +9 -2
  227. package/dist/core/agent-session-summary.js.map +1 -1
  228. package/dist/core/agent-session-tasks.d.ts +10 -0
  229. package/dist/core/agent-session-tasks.d.ts.map +1 -1
  230. package/dist/core/agent-session-tasks.js +94 -21
  231. package/dist/core/agent-session-tasks.js.map +1 -1
  232. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  233. package/dist/core/agent-session-tool-hooks.js +41 -8
  234. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  235. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  236. package/dist/core/agent-session-tool-registry.js +13 -26
  237. package/dist/core/agent-session-tool-registry.js.map +1 -1
  238. package/dist/core/agent-session-transfer.js.map +1 -1
  239. package/dist/core/agent-session-tree.d.ts.map +1 -1
  240. package/dist/core/agent-session-tree.js +8 -3
  241. package/dist/core/agent-session-tree.js.map +1 -1
  242. package/dist/core/agent-session-types.d.ts +13 -0
  243. package/dist/core/agent-session-types.d.ts.map +1 -1
  244. package/dist/core/agent-session-types.js.map +1 -1
  245. package/dist/core/agent-session.d.ts +36 -10
  246. package/dist/core/agent-session.d.ts.map +1 -1
  247. package/dist/core/agent-session.js +137 -68
  248. package/dist/core/agent-session.js.map +1 -1
  249. package/dist/core/auth-storage.d.ts +5 -3
  250. package/dist/core/auth-storage.d.ts.map +1 -1
  251. package/dist/core/auth-storage.js +18 -5
  252. package/dist/core/auth-storage.js.map +1 -1
  253. package/dist/core/builtin-diagnostics.d.ts +2 -0
  254. package/dist/core/builtin-diagnostics.d.ts.map +1 -0
  255. package/dist/core/builtin-diagnostics.js +14 -0
  256. package/dist/core/builtin-diagnostics.js.map +1 -0
  257. package/dist/core/builtin-packages.d.ts +5 -2
  258. package/dist/core/builtin-packages.d.ts.map +1 -1
  259. package/dist/core/builtin-packages.js +24 -3
  260. package/dist/core/builtin-packages.js.map +1 -1
  261. package/dist/core/builtin-resource-loader.d.ts +4 -0
  262. package/dist/core/builtin-resource-loader.d.ts.map +1 -0
  263. package/dist/core/builtin-resource-loader.js +239 -0
  264. package/dist/core/builtin-resource-loader.js.map +1 -0
  265. package/dist/core/cache-retention.d.ts +4 -0
  266. package/dist/core/cache-retention.d.ts.map +1 -0
  267. package/dist/core/cache-retention.js +58 -0
  268. package/dist/core/cache-retention.js.map +1 -0
  269. package/dist/core/cache-stats.d.ts +7 -1
  270. package/dist/core/cache-stats.d.ts.map +1 -1
  271. package/dist/core/cache-stats.js +34 -4
  272. package/dist/core/cache-stats.js.map +1 -1
  273. package/dist/core/cache-warmer.d.ts +66 -0
  274. package/dist/core/cache-warmer.d.ts.map +1 -0
  275. package/dist/core/cache-warmer.js +313 -0
  276. package/dist/core/cache-warmer.js.map +1 -0
  277. package/dist/core/child-session-options.d.ts +5 -0
  278. package/dist/core/child-session-options.d.ts.map +1 -0
  279. package/dist/core/child-session-options.js +30 -0
  280. package/dist/core/child-session-options.js.map +1 -0
  281. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  282. package/dist/core/compaction/branch-summarization.js +3 -2
  283. package/dist/core/compaction/branch-summarization.js.map +1 -1
  284. package/dist/core/compaction/compaction-boundary.d.ts +29 -1
  285. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  286. package/dist/core/compaction/compaction-boundary.js +48 -10
  287. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  288. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  289. package/dist/core/compaction/compaction-runner.js +18 -5
  290. package/dist/core/compaction/compaction-runner.js.map +1 -1
  291. package/dist/core/compaction/compaction-types.d.ts +7 -0
  292. package/dist/core/compaction/compaction-types.d.ts.map +1 -1
  293. package/dist/core/compaction/compaction-types.js.map +1 -1
  294. package/dist/core/compaction/compaction.d.ts +3 -1
  295. package/dist/core/compaction/compaction.d.ts.map +1 -1
  296. package/dist/core/compaction/compaction.js +55 -0
  297. package/dist/core/compaction/compaction.js.map +1 -1
  298. package/dist/core/compaction/fallback-planner.d.ts +1 -0
  299. package/dist/core/compaction/fallback-planner.d.ts.map +1 -1
  300. package/dist/core/compaction/fallback-planner.js +2 -0
  301. package/dist/core/compaction/fallback-planner.js.map +1 -1
  302. package/dist/core/compaction/index.d.ts +1 -0
  303. package/dist/core/compaction/index.d.ts.map +1 -1
  304. package/dist/core/compaction/index.js +1 -0
  305. package/dist/core/compaction/index.js.map +1 -1
  306. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  307. package/dist/core/compaction/range-planner.js +3 -3
  308. package/dist/core/compaction/range-planner.js.map +1 -1
  309. package/dist/core/compaction/session-summarization.d.ts.map +1 -1
  310. package/dist/core/compaction/session-summarization.js +2 -1
  311. package/dist/core/compaction/session-summarization.js.map +1 -1
  312. package/dist/core/compaction/whole-context-stats.d.ts +21 -0
  313. package/dist/core/compaction/whole-context-stats.d.ts.map +1 -0
  314. package/dist/core/compaction/whole-context-stats.js +32 -0
  315. package/dist/core/compaction/whole-context-stats.js.map +1 -0
  316. package/dist/core/crash-log.d.ts +6 -0
  317. package/dist/core/crash-log.d.ts.map +1 -0
  318. package/dist/core/crash-log.js +69 -0
  319. package/dist/core/crash-log.js.map +1 -0
  320. package/dist/core/credential-screening.d.ts +17 -0
  321. package/dist/core/credential-screening.d.ts.map +1 -0
  322. package/dist/core/credential-screening.js +30 -0
  323. package/dist/core/credential-screening.js.map +1 -0
  324. package/dist/core/execution-model-router.d.ts +45 -0
  325. package/dist/core/execution-model-router.d.ts.map +1 -0
  326. package/dist/core/execution-model-router.js +249 -0
  327. package/dist/core/execution-model-router.js.map +1 -0
  328. package/dist/core/export-html/template-js/tree-filter-render.js +6 -1
  329. package/dist/core/export-html/template.js +6 -1
  330. package/dist/core/extensions/agent-events.d.ts +82 -8
  331. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  332. package/dist/core/extensions/agent-events.js.map +1 -1
  333. package/dist/core/extensions/api-types.d.ts +51 -42
  334. package/dist/core/extensions/api-types.d.ts.map +1 -1
  335. package/dist/core/extensions/api-types.js.map +1 -1
  336. package/dist/core/extensions/context-types.d.ts +7 -1
  337. package/dist/core/extensions/context-types.d.ts.map +1 -1
  338. package/dist/core/extensions/context-types.js.map +1 -1
  339. package/dist/core/extensions/event-results.d.ts +10 -6
  340. package/dist/core/extensions/event-results.d.ts.map +1 -1
  341. package/dist/core/extensions/event-results.js.map +1 -1
  342. package/dist/core/extensions/event-types.d.ts +3 -2
  343. package/dist/core/extensions/event-types.d.ts.map +1 -1
  344. package/dist/core/extensions/event-types.js.map +1 -1
  345. package/dist/core/extensions/extension-work.d.ts +14 -0
  346. package/dist/core/extensions/extension-work.d.ts.map +1 -0
  347. package/dist/core/extensions/extension-work.js +73 -0
  348. package/dist/core/extensions/extension-work.js.map +1 -0
  349. package/dist/core/extensions/herdr-file-integration.d.ts +36 -0
  350. package/dist/core/extensions/herdr-file-integration.d.ts.map +1 -0
  351. package/dist/core/extensions/herdr-file-integration.js +60 -0
  352. package/dist/core/extensions/herdr-file-integration.js.map +1 -0
  353. package/dist/core/extensions/host-input.d.ts +51 -0
  354. package/dist/core/extensions/host-input.d.ts.map +1 -0
  355. package/dist/core/extensions/host-input.js +211 -0
  356. package/dist/core/extensions/host-input.js.map +1 -0
  357. package/dist/core/extensions/index.d.ts +4 -2
  358. package/dist/core/extensions/index.d.ts.map +1 -1
  359. package/dist/core/extensions/index.js +0 -3
  360. package/dist/core/extensions/index.js.map +1 -1
  361. package/dist/core/extensions/jiti-loader.d.ts +2 -0
  362. package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
  363. package/dist/core/extensions/jiti-loader.js +3 -0
  364. package/dist/core/extensions/jiti-loader.js.map +1 -0
  365. package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
  366. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
  367. package/dist/core/extensions/jiti-static-loader.js +3 -0
  368. package/dist/core/extensions/jiti-static-loader.js.map +1 -0
  369. package/dist/core/extensions/loader-api.d.ts +7 -0
  370. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  371. package/dist/core/extensions/loader-api.js +154 -28
  372. package/dist/core/extensions/loader-api.js.map +1 -1
  373. package/dist/core/extensions/loader-bindings.d.ts +24 -0
  374. package/dist/core/extensions/loader-bindings.d.ts.map +1 -0
  375. package/dist/core/extensions/loader-bindings.js +128 -0
  376. package/dist/core/extensions/loader-bindings.js.map +1 -0
  377. package/dist/core/extensions/loader-core.d.ts +2 -1
  378. package/dist/core/extensions/loader-core.d.ts.map +1 -1
  379. package/dist/core/extensions/loader-core.js +92 -14
  380. package/dist/core/extensions/loader-core.js.map +1 -1
  381. package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
  382. package/dist/core/extensions/loader-host-modules.js +3 -1
  383. package/dist/core/extensions/loader-host-modules.js.map +1 -1
  384. package/dist/core/extensions/loader-rollback.d.ts +14 -0
  385. package/dist/core/extensions/loader-rollback.d.ts.map +1 -0
  386. package/dist/core/extensions/loader-rollback.js +95 -0
  387. package/dist/core/extensions/loader-rollback.js.map +1 -0
  388. package/dist/core/extensions/loader-runtime.d.ts +3 -1
  389. package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
  390. package/dist/core/extensions/loader-runtime.js +38 -14
  391. package/dist/core/extensions/loader-runtime.js.map +1 -1
  392. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  393. package/dist/core/extensions/loader-virtual-modules.js +9 -2
  394. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  395. package/dist/core/extensions/loader.d.ts +1 -1
  396. package/dist/core/extensions/loader.d.ts.map +1 -1
  397. package/dist/core/extensions/loader.js +1 -1
  398. package/dist/core/extensions/loader.js.map +1 -1
  399. package/dist/core/extensions/provider-types.d.ts +34 -14
  400. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  401. package/dist/core/extensions/provider-types.js.map +1 -1
  402. package/dist/core/extensions/reactive-widget.d.ts +1 -1
  403. package/dist/core/extensions/reactive-widget.js.map +1 -1
  404. package/dist/core/extensions/runner-context.d.ts +4 -0
  405. package/dist/core/extensions/runner-context.d.ts.map +1 -1
  406. package/dist/core/extensions/runner-context.js +25 -0
  407. package/dist/core/extensions/runner-context.js.map +1 -1
  408. package/dist/core/extensions/runner-events.d.ts +24 -6
  409. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  410. package/dist/core/extensions/runner-events.js +153 -58
  411. package/dist/core/extensions/runner-events.js.map +1 -1
  412. package/dist/core/extensions/runner-project-trust.d.ts.map +1 -1
  413. package/dist/core/extensions/runner-project-trust.js +2 -4
  414. package/dist/core/extensions/runner-project-trust.js.map +1 -1
  415. package/dist/core/extensions/runner.d.ts +34 -6
  416. package/dist/core/extensions/runner.d.ts.map +1 -1
  417. package/dist/core/extensions/runner.js +223 -24
  418. package/dist/core/extensions/runner.js.map +1 -1
  419. package/dist/core/extensions/runtime-types.d.ts +6 -0
  420. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  421. package/dist/core/extensions/runtime-types.js.map +1 -1
  422. package/dist/core/extensions/tool-types.d.ts +9 -0
  423. package/dist/core/extensions/tool-types.d.ts.map +1 -1
  424. package/dist/core/extensions/tool-types.js.map +1 -1
  425. package/dist/core/extensions/types.d.ts +3 -2
  426. package/dist/core/extensions/types.d.ts.map +1 -1
  427. package/dist/core/extensions/types.js +0 -12
  428. package/dist/core/extensions/types.js.map +1 -1
  429. package/dist/core/extensions/workflow-activity-hub.d.ts +2 -0
  430. package/dist/core/extensions/workflow-activity-hub.d.ts.map +1 -1
  431. package/dist/core/extensions/workflow-activity-hub.js +5 -3
  432. package/dist/core/extensions/workflow-activity-hub.js.map +1 -1
  433. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  434. package/dist/core/extensions/wrapper.js +5 -3
  435. package/dist/core/extensions/wrapper.js.map +1 -1
  436. package/dist/core/fast-model-routing.d.ts +3 -3
  437. package/dist/core/fast-model-routing.d.ts.map +1 -1
  438. package/dist/core/fast-model-routing.js +4 -3
  439. package/dist/core/fast-model-routing.js.map +1 -1
  440. package/dist/core/fast-model-variants.d.ts +30 -0
  441. package/dist/core/fast-model-variants.d.ts.map +1 -1
  442. package/dist/core/fast-model-variants.js +43 -1
  443. package/dist/core/fast-model-variants.js.map +1 -1
  444. package/dist/core/index.d.ts +4 -1
  445. package/dist/core/index.d.ts.map +1 -1
  446. package/dist/core/index.js +2 -0
  447. package/dist/core/index.js.map +1 -1
  448. package/dist/core/mandatory-resource-loader.d.ts +4 -0
  449. package/dist/core/mandatory-resource-loader.d.ts.map +1 -1
  450. package/dist/core/mandatory-resource-loader.js +29 -1
  451. package/dist/core/mandatory-resource-loader.js.map +1 -1
  452. package/dist/core/mandatory-runtime-tools.d.ts +1 -4
  453. package/dist/core/mandatory-runtime-tools.d.ts.map +1 -1
  454. package/dist/core/mandatory-runtime-tools.js +1 -9
  455. package/dist/core/mandatory-runtime-tools.js.map +1 -1
  456. package/dist/core/messages.d.ts +10 -0
  457. package/dist/core/messages.d.ts.map +1 -1
  458. package/dist/core/messages.js +76 -2
  459. package/dist/core/messages.js.map +1 -1
  460. package/dist/core/model-config.d.ts +178 -10
  461. package/dist/core/model-config.d.ts.map +1 -1
  462. package/dist/core/model-config.js +48 -19
  463. package/dist/core/model-config.js.map +1 -1
  464. package/dist/core/model-registry.d.ts +6 -2
  465. package/dist/core/model-registry.d.ts.map +1 -1
  466. package/dist/core/model-registry.js +12 -2
  467. package/dist/core/model-registry.js.map +1 -1
  468. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  469. package/dist/core/model-resolver-defaults.js +2 -1
  470. package/dist/core/model-resolver-defaults.js.map +1 -1
  471. package/dist/core/model-routing-constraints.d.ts +24 -0
  472. package/dist/core/model-routing-constraints.d.ts.map +1 -0
  473. package/dist/core/model-routing-constraints.js +46 -0
  474. package/dist/core/model-routing-constraints.js.map +1 -0
  475. package/dist/core/model-routing-task.d.ts +4 -0
  476. package/dist/core/model-routing-task.d.ts.map +1 -0
  477. package/dist/core/model-routing-task.js +77 -0
  478. package/dist/core/model-routing-task.js.map +1 -0
  479. package/dist/core/model-runtime-auth.d.ts +2 -2
  480. package/dist/core/model-runtime-auth.d.ts.map +1 -1
  481. package/dist/core/model-runtime-auth.js.map +1 -1
  482. package/dist/core/model-runtime-streaming.d.ts +13 -3
  483. package/dist/core/model-runtime-streaming.d.ts.map +1 -1
  484. package/dist/core/model-runtime-streaming.js +16 -5
  485. package/dist/core/model-runtime-streaming.js.map +1 -1
  486. package/dist/core/model-runtime-types.d.ts +2 -2
  487. package/dist/core/model-runtime-types.d.ts.map +1 -1
  488. package/dist/core/model-runtime-types.js.map +1 -1
  489. package/dist/core/model-runtime.d.ts +29 -6
  490. package/dist/core/model-runtime.d.ts.map +1 -1
  491. package/dist/core/model-runtime.js +84 -7
  492. package/dist/core/model-runtime.js.map +1 -1
  493. package/dist/core/package-manager-npm.d.ts.map +1 -1
  494. package/dist/core/package-manager-npm.js +32 -8
  495. package/dist/core/package-manager-npm.js.map +1 -1
  496. package/dist/core/package-manager-resolver.js +3 -1
  497. package/dist/core/package-manager-resolver.js.map +1 -1
  498. package/dist/core/package-manager-types.d.ts +1 -0
  499. package/dist/core/package-manager-types.d.ts.map +1 -1
  500. package/dist/core/package-manager-types.js.map +1 -1
  501. package/dist/core/prompt-templates-async.d.ts +2 -2
  502. package/dist/core/prompt-templates-async.d.ts.map +1 -1
  503. package/dist/core/prompt-templates-async.js +57 -29
  504. package/dist/core/prompt-templates-async.js.map +1 -1
  505. package/dist/core/prompt-templates.d.ts +6 -1
  506. package/dist/core/prompt-templates.d.ts.map +1 -1
  507. package/dist/core/prompt-templates.js +61 -35
  508. package/dist/core/prompt-templates.js.map +1 -1
  509. package/dist/core/provider-composer-internal.d.ts +41 -20
  510. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  511. package/dist/core/provider-composer-internal.js +43 -20
  512. package/dist/core/provider-composer-internal.js.map +1 -1
  513. package/dist/core/provider-composer.d.ts +3 -3
  514. package/dist/core/provider-composer.d.ts.map +1 -1
  515. package/dist/core/provider-composer.js +54 -10
  516. package/dist/core/provider-composer.js.map +1 -1
  517. package/dist/core/remote-catalog-provider.d.ts +8 -1
  518. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  519. package/dist/core/remote-catalog-provider.js +46 -4
  520. package/dist/core/remote-catalog-provider.js.map +1 -1
  521. package/dist/core/resolve-config-value.d.ts +2 -0
  522. package/dist/core/resolve-config-value.d.ts.map +1 -1
  523. package/dist/core/resolve-config-value.js +23 -1
  524. package/dist/core/resolve-config-value.js.map +1 -1
  525. package/dist/core/resource-loader-assets.d.ts.map +1 -1
  526. package/dist/core/resource-loader-assets.js +6 -6
  527. package/dist/core/resource-loader-assets.js.map +1 -1
  528. package/dist/core/resource-loader-core.d.ts +6 -0
  529. package/dist/core/resource-loader-core.d.ts.map +1 -1
  530. package/dist/core/resource-loader-core.js +41 -6
  531. package/dist/core/resource-loader-core.js.map +1 -1
  532. package/dist/core/resource-loader-extension-warnings.d.ts +9 -0
  533. package/dist/core/resource-loader-extension-warnings.d.ts.map +1 -0
  534. package/dist/core/resource-loader-extension-warnings.js +54 -0
  535. package/dist/core/resource-loader-extension-warnings.js.map +1 -0
  536. package/dist/core/resource-loader-extensions.d.ts.map +1 -1
  537. package/dist/core/resource-loader-extensions.js +3 -0
  538. package/dist/core/resource-loader-extensions.js.map +1 -1
  539. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  540. package/dist/core/resource-loader-reload.js +13 -2
  541. package/dist/core/resource-loader-reload.js.map +1 -1
  542. package/dist/core/resource-loader.d.ts +1 -1
  543. package/dist/core/resource-loader.d.ts.map +1 -1
  544. package/dist/core/resource-loader.js +1 -1
  545. package/dist/core/resource-loader.js.map +1 -1
  546. package/dist/core/runtime-credentials.d.ts +2 -0
  547. package/dist/core/runtime-credentials.d.ts.map +1 -1
  548. package/dist/core/runtime-credentials.js +18 -1
  549. package/dist/core/runtime-credentials.js.map +1 -1
  550. package/dist/core/sdk-types.d.ts +18 -5
  551. package/dist/core/sdk-types.d.ts.map +1 -1
  552. package/dist/core/sdk-types.js.map +1 -1
  553. package/dist/core/sdk.d.ts +3 -1
  554. package/dist/core/sdk.d.ts.map +1 -1
  555. package/dist/core/sdk.js +231 -42
  556. package/dist/core/sdk.js.map +1 -1
  557. package/dist/core/session-lifecycle-scope.d.ts +15 -0
  558. package/dist/core/session-lifecycle-scope.d.ts.map +1 -0
  559. package/dist/core/session-lifecycle-scope.js +13 -0
  560. package/dist/core/session-lifecycle-scope.js.map +1 -0
  561. package/dist/core/session-lifecycle-work.d.ts +17 -0
  562. package/dist/core/session-lifecycle-work.d.ts.map +1 -0
  563. package/dist/core/session-lifecycle-work.js +144 -0
  564. package/dist/core/session-lifecycle-work.js.map +1 -0
  565. package/dist/core/session-manager-core.d.ts +19 -6
  566. package/dist/core/session-manager-core.d.ts.map +1 -1
  567. package/dist/core/session-manager-core.js +117 -12
  568. package/dist/core/session-manager-core.js.map +1 -1
  569. package/dist/core/session-manager-entries.d.ts +4 -1
  570. package/dist/core/session-manager-entries.d.ts.map +1 -1
  571. package/dist/core/session-manager-entries.js +8 -0
  572. package/dist/core/session-manager-entries.js.map +1 -1
  573. package/dist/core/session-manager-history.d.ts +16 -1
  574. package/dist/core/session-manager-history.d.ts.map +1 -1
  575. package/dist/core/session-manager-history.js +106 -40
  576. package/dist/core/session-manager-history.js.map +1 -1
  577. package/dist/core/session-manager-list.d.ts +3 -3
  578. package/dist/core/session-manager-list.d.ts.map +1 -1
  579. package/dist/core/session-manager-list.js +89 -74
  580. package/dist/core/session-manager-list.js.map +1 -1
  581. package/dist/core/session-manager-storage.d.ts.map +1 -1
  582. package/dist/core/session-manager-storage.js +10 -7
  583. package/dist/core/session-manager-storage.js.map +1 -1
  584. package/dist/core/session-manager-types.d.ts +41 -4
  585. package/dist/core/session-manager-types.d.ts.map +1 -1
  586. package/dist/core/session-manager-types.js.map +1 -1
  587. package/dist/core/session-manager.d.ts +2 -2
  588. package/dist/core/session-manager.d.ts.map +1 -1
  589. package/dist/core/session-manager.js +1 -1
  590. package/dist/core/session-manager.js.map +1 -1
  591. package/dist/core/session-startup-rollback.d.ts +5 -0
  592. package/dist/core/session-startup-rollback.d.ts.map +1 -0
  593. package/dist/core/session-startup-rollback.js +16 -0
  594. package/dist/core/session-startup-rollback.js.map +1 -0
  595. package/dist/core/settings-manager-basic-accessors.d.ts +5 -0
  596. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  597. package/dist/core/settings-manager-basic-accessors.js +35 -0
  598. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  599. package/dist/core/settings-manager-core.d.ts.map +1 -1
  600. package/dist/core/settings-manager-core.js +4 -0
  601. package/dist/core/settings-manager-core.js.map +1 -1
  602. package/dist/core/settings-manager.d.ts +1 -0
  603. package/dist/core/settings-manager.d.ts.map +1 -1
  604. package/dist/core/settings-manager.js +1 -0
  605. package/dist/core/settings-manager.js.map +1 -1
  606. package/dist/core/settings-types.d.ts +4 -0
  607. package/dist/core/settings-types.d.ts.map +1 -1
  608. package/dist/core/settings-types.js +1 -1
  609. package/dist/core/settings-types.js.map +1 -1
  610. package/dist/core/settings-write-ownership.d.ts +7 -0
  611. package/dist/core/settings-write-ownership.d.ts.map +1 -0
  612. package/dist/core/settings-write-ownership.js +24 -0
  613. package/dist/core/settings-write-ownership.js.map +1 -0
  614. package/dist/core/skill-catalog.d.ts.map +1 -1
  615. package/dist/core/skill-catalog.js +18 -6
  616. package/dist/core/skill-catalog.js.map +1 -1
  617. package/dist/core/slash-commands.js +1 -1
  618. package/dist/core/slash-commands.js.map +1 -1
  619. package/dist/core/structured-output/choice-schema.d.ts +8 -0
  620. package/dist/core/structured-output/choice-schema.d.ts.map +1 -0
  621. package/dist/core/structured-output/choice-schema.js +79 -0
  622. package/dist/core/structured-output/choice-schema.js.map +1 -0
  623. package/dist/core/structured-output/index.d.ts +10 -0
  624. package/dist/core/structured-output/index.d.ts.map +1 -0
  625. package/dist/core/structured-output/index.js +424 -0
  626. package/dist/core/structured-output/index.js.map +1 -0
  627. package/dist/core/structured-output/invalid-output.d.ts +8 -0
  628. package/dist/core/structured-output/invalid-output.d.ts.map +1 -0
  629. package/dist/core/structured-output/invalid-output.js +4 -0
  630. package/dist/core/structured-output/invalid-output.js.map +1 -0
  631. package/dist/core/structured-output/resolver.d.ts +3 -0
  632. package/dist/core/structured-output/resolver.d.ts.map +1 -0
  633. package/dist/core/structured-output/resolver.js +26 -0
  634. package/dist/core/structured-output/resolver.js.map +1 -0
  635. package/dist/core/structured-output/types.d.ts +76 -0
  636. package/dist/core/structured-output/types.d.ts.map +1 -0
  637. package/dist/core/structured-output/types.js +2 -0
  638. package/dist/core/structured-output/types.js.map +1 -0
  639. package/dist/core/system-prompt.d.ts +48 -5
  640. package/dist/core/system-prompt.d.ts.map +1 -1
  641. package/dist/core/system-prompt.js +141 -100
  642. package/dist/core/system-prompt.js.map +1 -1
  643. package/dist/core/tasks/child-command-owner.d.ts +34 -0
  644. package/dist/core/tasks/child-command-owner.d.ts.map +1 -0
  645. package/dist/core/tasks/child-command-owner.js +70 -0
  646. package/dist/core/tasks/child-command-owner.js.map +1 -0
  647. package/dist/core/tasks/contracts.d.ts +6 -0
  648. package/dist/core/tasks/contracts.d.ts.map +1 -1
  649. package/dist/core/tasks/contracts.js.map +1 -1
  650. package/dist/core/tasks/owner-store.d.ts +6 -0
  651. package/dist/core/tasks/owner-store.d.ts.map +1 -1
  652. package/dist/core/tasks/owner-store.js +16 -3
  653. package/dist/core/tasks/owner-store.js.map +1 -1
  654. package/dist/core/tasks/pause.js +1 -1
  655. package/dist/core/tasks/pause.js.map +1 -1
  656. package/dist/core/tasks/supervisor.d.ts +4 -2
  657. package/dist/core/tasks/supervisor.d.ts.map +1 -1
  658. package/dist/core/tasks/supervisor.js +16 -3
  659. package/dist/core/tasks/supervisor.js.map +1 -1
  660. package/dist/core/tools/ask-user-question/ask-user-question.d.ts +4 -1
  661. package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
  662. package/dist/core/tools/ask-user-question/ask-user-question.js +32 -35
  663. package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
  664. package/dist/core/tools/ask-user-question/index.d.ts +1 -1
  665. package/dist/core/tools/ask-user-question/index.js.map +1 -1
  666. package/dist/core/tools/ask-user-question/state/build-questionnaire.d.ts +1 -1
  667. package/dist/core/tools/ask-user-question/state/build-questionnaire.js.map +1 -1
  668. package/dist/core/tools/ask-user-question/state/key-router.d.ts +1 -1
  669. package/dist/core/tools/ask-user-question/state/key-router.js.map +1 -1
  670. package/dist/core/tools/ask-user-question/state/questionnaire-session.d.ts +1 -1
  671. package/dist/core/tools/ask-user-question/state/questionnaire-session.js.map +1 -1
  672. package/dist/core/tools/ask-user-question/state/row-intent.d.ts +1 -1
  673. package/dist/core/tools/ask-user-question/state/row-intent.js.map +1 -1
  674. package/dist/core/tools/ask-user-question/state/selectors/contract.d.ts +1 -1
  675. package/dist/core/tools/ask-user-question/state/selectors/contract.js.map +1 -1
  676. package/dist/core/tools/ask-user-question/state/selectors/derivations.d.ts +1 -1
  677. package/dist/core/tools/ask-user-question/state/selectors/derivations.js.map +1 -1
  678. package/dist/core/tools/ask-user-question/state/state-reducer.d.ts +1 -1
  679. package/dist/core/tools/ask-user-question/state/state-reducer.js.map +1 -1
  680. package/dist/core/tools/ask-user-question/state/state.d.ts +1 -1
  681. package/dist/core/tools/ask-user-question/state/state.js.map +1 -1
  682. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +1 -1
  683. package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
  684. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +1 -1
  685. package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
  686. package/dist/core/tools/ask-user-question/tool/validate-questionnaire.d.ts +1 -1
  687. package/dist/core/tools/ask-user-question/tool/validate-questionnaire.js.map +1 -1
  688. package/dist/core/tools/ask-user-question/view/components/multi-select-view.d.ts +1 -1
  689. package/dist/core/tools/ask-user-question/view/components/multi-select-view.js.map +1 -1
  690. package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.d.ts +1 -1
  691. package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.js.map +1 -1
  692. package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.d.ts +1 -1
  693. package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.js.map +1 -1
  694. package/dist/core/tools/ask-user-question/view/components/preview/preview-layout-decider.d.ts +1 -1
  695. package/dist/core/tools/ask-user-question/view/components/preview/preview-layout-decider.js.map +1 -1
  696. package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.d.ts +1 -1
  697. package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.js.map +1 -1
  698. package/dist/core/tools/ask-user-question/view/components/submit-picker.js.map +1 -1
  699. package/dist/core/tools/ask-user-question/view/components/wrapping-select.js.map +1 -1
  700. package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts +1 -1
  701. package/dist/core/tools/ask-user-question/view/dialog-builder.js.map +1 -1
  702. package/dist/core/tools/ask-user-question/view/props-adapter.d.ts +1 -1
  703. package/dist/core/tools/ask-user-question/view/props-adapter.js.map +1 -1
  704. package/dist/core/tools/ask-user-question/view/tab-content-strategy.d.ts +1 -1
  705. package/dist/core/tools/ask-user-question/view/tab-content-strategy.js.map +1 -1
  706. package/dist/core/tools/bash-pty-native.d.ts +5 -1
  707. package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
  708. package/dist/core/tools/bash-pty-native.js +15 -7
  709. package/dist/core/tools/bash-pty-native.js.map +1 -1
  710. package/dist/core/tools/bash.d.ts.map +1 -1
  711. package/dist/core/tools/bash.js +32 -24
  712. package/dist/core/tools/bash.js.map +1 -1
  713. package/dist/core/tools/edit.d.ts.map +1 -1
  714. package/dist/core/tools/edit.js +1 -0
  715. package/dist/core/tools/edit.js.map +1 -1
  716. package/dist/core/tools/file-mutation-coordinator.d.ts +4 -3
  717. package/dist/core/tools/file-mutation-coordinator.d.ts.map +1 -1
  718. package/dist/core/tools/file-mutation-coordinator.js +45 -38
  719. package/dist/core/tools/file-mutation-coordinator.js.map +1 -1
  720. package/dist/core/tools/find.d.ts +2 -2
  721. package/dist/core/tools/find.d.ts.map +1 -1
  722. package/dist/core/tools/find.js +1 -1
  723. package/dist/core/tools/find.js.map +1 -1
  724. package/dist/core/tools/kill.d.ts +2 -2
  725. package/dist/core/tools/kill.d.ts.map +1 -1
  726. package/dist/core/tools/kill.js +3 -4
  727. package/dist/core/tools/kill.js.map +1 -1
  728. package/dist/core/tools/powershell.d.ts +16 -0
  729. package/dist/core/tools/powershell.d.ts.map +1 -1
  730. package/dist/core/tools/read.d.ts +4 -0
  731. package/dist/core/tools/read.d.ts.map +1 -1
  732. package/dist/core/tools/read.js +5 -1
  733. package/dist/core/tools/read.js.map +1 -1
  734. package/dist/core/tools/structured-output.d.ts +9 -6
  735. package/dist/core/tools/structured-output.d.ts.map +1 -1
  736. package/dist/core/tools/structured-output.js +36 -8
  737. package/dist/core/tools/structured-output.js.map +1 -1
  738. package/dist/core/tools/todos.d.ts.map +1 -1
  739. package/dist/core/tools/todos.js +1 -0
  740. package/dist/core/tools/todos.js.map +1 -1
  741. package/dist/core/tools/tool-concurrency.d.ts +23 -0
  742. package/dist/core/tools/tool-concurrency.d.ts.map +1 -0
  743. package/dist/core/tools/tool-concurrency.js +58 -0
  744. package/dist/core/tools/tool-concurrency.js.map +1 -0
  745. package/dist/core/tools/tool-definition-wrapper.d.ts +4 -1
  746. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  747. package/dist/core/tools/tool-definition-wrapper.js +2 -0
  748. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  749. package/dist/core/tools/write.d.ts.map +1 -1
  750. package/dist/core/tools/write.js +1 -0
  751. package/dist/core/tools/write.js.map +1 -1
  752. package/dist/core/usage-totals.d.ts.map +1 -1
  753. package/dist/core/usage-totals.js +4 -0
  754. package/dist/core/usage-totals.js.map +1 -1
  755. package/dist/extensions/herdr/index.d.ts.map +1 -1
  756. package/dist/extensions/herdr/index.js +0 -7
  757. package/dist/extensions/herdr/index.js.map +1 -1
  758. package/dist/extensions/llama/client.d.ts +2 -0
  759. package/dist/extensions/llama/client.d.ts.map +1 -1
  760. package/dist/extensions/llama/client.js +6 -2
  761. package/dist/extensions/llama/client.js.map +1 -1
  762. package/dist/extensions/llama/provider.d.ts.map +1 -1
  763. package/dist/extensions/llama/provider.js +18 -4
  764. package/dist/extensions/llama/provider.js.map +1 -1
  765. package/dist/index-extensions.d.ts +1 -1
  766. package/dist/index-extensions.d.ts.map +1 -1
  767. package/dist/index-extensions.js.map +1 -1
  768. package/dist/index.d.ts +13 -4
  769. package/dist/index.d.ts.map +1 -1
  770. package/dist/index.js +8 -3
  771. package/dist/index.js.map +1 -1
  772. package/dist/main-app-mode.d.ts +1 -1
  773. package/dist/main-app-mode.d.ts.map +1 -1
  774. package/dist/main-app-mode.js +3 -2
  775. package/dist/main-app-mode.js.map +1 -1
  776. package/dist/main-session.d.ts.map +1 -1
  777. package/dist/main-session.js +24 -16
  778. package/dist/main-session.js.map +1 -1
  779. package/dist/main.d.ts.map +1 -1
  780. package/dist/main.js +9 -6
  781. package/dist/main.js.map +1 -1
  782. package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
  783. package/dist/modes/interactive/components/atomic-banner.js +3 -2
  784. package/dist/modes/interactive/components/atomic-banner.js.map +1 -1
  785. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  786. package/dist/modes/interactive/components/branch-summary-message.js +12 -5
  787. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  788. package/dist/modes/interactive/components/chat-message-renderer.d.ts +5 -1
  789. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  790. package/dist/modes/interactive/components/chat-message-renderer.js +4 -0
  791. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  792. package/dist/modes/interactive/components/chat-session-host-events.d.ts +2 -2
  793. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  794. package/dist/modes/interactive/components/compaction-boundary-message.d.ts +2 -0
  795. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  796. package/dist/modes/interactive/components/compaction-boundary-message.js +30 -12
  797. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  798. package/dist/modes/interactive/components/custom-editor.d.ts +6 -0
  799. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  800. package/dist/modes/interactive/components/custom-editor.js +17 -0
  801. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  802. package/dist/modes/interactive/components/host-input-form-mount.d.ts +1 -1
  803. package/dist/modes/interactive/components/host-input-form-mount.js.map +1 -1
  804. package/dist/modes/interactive/components/host-input-form.d.ts +1 -1
  805. package/dist/modes/interactive/components/host-input-form.js.map +1 -1
  806. package/dist/modes/interactive/components/host-session-picker.d.ts +1 -1
  807. package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
  808. package/dist/modes/interactive/components/reserved-bottom-overlay.d.ts +1 -1
  809. package/dist/modes/interactive/components/reserved-bottom-overlay.js.map +1 -1
  810. package/dist/modes/interactive/components/scroll-widget.d.ts +1 -1
  811. package/dist/modes/interactive/components/scroll-widget.js.map +1 -1
  812. package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
  813. package/dist/modes/interactive/components/settings-selector-handlers.js +3 -0
  814. package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
  815. package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
  816. package/dist/modes/interactive/components/settings-selector-items.js +52 -1
  817. package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
  818. package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
  819. package/dist/modes/interactive/components/settings-selector-submenus.js +2 -1
  820. package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
  821. package/dist/modes/interactive/components/settings-selector-types.d.ts +8 -2
  822. package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
  823. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  824. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  825. package/dist/modes/interactive/components/skill-invocation-message.js +11 -4
  826. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  827. package/dist/modes/interactive/components/startup-identity.d.ts +3 -0
  828. package/dist/modes/interactive/components/startup-identity.d.ts.map +1 -1
  829. package/dist/modes/interactive/components/startup-identity.js +11 -2
  830. package/dist/modes/interactive/components/startup-identity.js.map +1 -1
  831. package/dist/modes/interactive/components/task-inspector.d.ts +1 -0
  832. package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -1
  833. package/dist/modes/interactive/components/task-inspector.js +11 -11
  834. package/dist/modes/interactive/components/task-inspector.js.map +1 -1
  835. package/dist/modes/interactive/components/task-list.d.ts +9 -3
  836. package/dist/modes/interactive/components/task-list.d.ts.map +1 -1
  837. package/dist/modes/interactive/components/task-list.js +26 -2
  838. package/dist/modes/interactive/components/task-list.js.map +1 -1
  839. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  840. package/dist/modes/interactive/components/tool-execution.js +14 -9
  841. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  842. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  843. package/dist/modes/interactive/components/tree-selector-content.js +6 -0
  844. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  845. package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
  846. package/dist/modes/interactive/components/tree-selector-model.js +1 -0
  847. package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
  848. package/dist/modes/interactive/interactive-agent-events.js +20 -10
  849. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  850. package/dist/modes/interactive/interactive-auth-login.js +3 -5
  851. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  852. package/dist/modes/interactive/interactive-auth-routing.js +2 -2
  853. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  854. package/dist/modes/interactive/interactive-autocomplete.js +4 -0
  855. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  856. package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
  857. package/dist/modes/interactive/interactive-bash-compact.js +13 -6
  858. package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
  859. package/dist/modes/interactive/interactive-extension-runtime.js +5 -0
  860. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  861. package/dist/modes/interactive/interactive-input-handling.js +2 -2
  862. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  863. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  864. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  865. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  866. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  867. package/dist/modes/interactive/interactive-mode-helpers.d.ts +1 -0
  868. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  869. package/dist/modes/interactive/interactive-mode-helpers.js +16 -0
  870. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  871. package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -1
  872. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  873. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  874. package/dist/modes/interactive/interactive-process-lifecycle.js +13 -1
  875. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  876. package/dist/modes/interactive/interactive-render-chat.js +30 -34
  877. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  878. package/dist/modes/interactive/interactive-resource-rendering.js +6 -9
  879. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  880. package/dist/modes/interactive/interactive-selectors.js +11 -0
  881. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  882. package/dist/modes/interactive/interactive-session-runtime.js +5 -1
  883. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  884. package/dist/modes/interactive/interactive-slash-commands.js +2 -4
  885. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  886. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  887. package/dist/modes/interactive/interactive-startup.js +2 -2
  888. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  889. package/dist/modes/interactive/interactive-tui.d.ts +3 -6
  890. package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
  891. package/dist/modes/interactive/interactive-tui.js +15 -5
  892. package/dist/modes/interactive/interactive-tui.js.map +1 -1
  893. package/dist/modes/interactive/overlay-line-composite.d.ts +7 -0
  894. package/dist/modes/interactive/overlay-line-composite.d.ts.map +1 -0
  895. package/dist/modes/interactive/overlay-line-composite.js +24 -0
  896. package/dist/modes/interactive/overlay-line-composite.js.map +1 -0
  897. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  898. package/dist/modes/interactive-engine/engine-custom-ui.js +3 -1
  899. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  900. package/dist/modes/interactive-engine/engine-input-form.d.ts +1 -1
  901. package/dist/modes/interactive-engine/engine-input-form.js.map +1 -1
  902. package/dist/modes/interactive-engine/engine-session-picker.d.ts +1 -1
  903. package/dist/modes/interactive-engine/engine-session-picker.js.map +1 -1
  904. package/dist/modes/interactive-engine/isolated-auth.d.ts +16 -0
  905. package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
  906. package/dist/modes/interactive-engine/isolated-auth.js +27 -0
  907. package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
  908. package/dist/modes/interactive-engine/isolated-runtime.d.ts +5 -0
  909. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  910. package/dist/modes/interactive-engine/isolated-runtime.js +19 -2
  911. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  912. package/dist/modes/interactive-engine/protocol.d.ts +1 -1
  913. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  914. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  915. package/dist/modes/rpc/rpc-client-api.d.ts +2 -1
  916. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  917. package/dist/modes/rpc/rpc-client-api.js +7 -2
  918. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  919. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  920. package/dist/modes/rpc/rpc-command-handler.js +3 -1
  921. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  922. package/dist/modes/rpc/rpc-keybindings-reload.d.ts +1 -1
  923. package/dist/modes/rpc/rpc-keybindings-reload.js.map +1 -1
  924. package/dist/modes/rpc/rpc-provider-auth.d.ts +3 -2
  925. package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
  926. package/dist/modes/rpc/rpc-provider-auth.js +2 -2
  927. package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
  928. package/dist/modes/rpc/rpc-types.d.ts +2 -0
  929. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  930. package/dist/modes/rpc/rpc-types.js.map +1 -1
  931. package/dist/session-id-target.d.ts +31 -0
  932. package/dist/session-id-target.d.ts.map +1 -0
  933. package/dist/session-id-target.js +57 -0
  934. package/dist/session-id-target.js.map +1 -0
  935. package/dist/utils/abort.d.ts.map +1 -1
  936. package/dist/utils/abort.js +29 -4
  937. package/dist/utils/abort.js.map +1 -1
  938. package/dist/utils/child-process.d.ts +1 -0
  939. package/dist/utils/child-process.d.ts.map +1 -1
  940. package/dist/utils/child-process.js +7 -8
  941. package/dist/utils/child-process.js.map +1 -1
  942. package/dist/utils/clipboard-image.d.ts.map +1 -1
  943. package/dist/utils/clipboard-image.js +15 -29
  944. package/dist/utils/clipboard-image.js.map +1 -1
  945. package/dist/utils/clipboard.d.ts.map +1 -1
  946. package/dist/utils/clipboard.js +88 -12
  947. package/dist/utils/clipboard.js.map +1 -1
  948. package/dist/utils/mime.js +1 -1
  949. package/dist/utils/mime.js.map +1 -1
  950. package/dist/utils/shell.d.ts.map +1 -1
  951. package/dist/utils/shell.js +18 -1
  952. package/dist/utils/shell.js.map +1 -1
  953. package/dist/utils/tool-result-images.d.ts +3 -1
  954. package/dist/utils/tool-result-images.d.ts.map +1 -1
  955. package/dist/utils/tool-result-images.js +4 -1
  956. package/dist/utils/tool-result-images.js.map +1 -1
  957. package/dist/utils/wsl.d.ts +3 -0
  958. package/dist/utils/wsl.d.ts.map +1 -0
  959. package/dist/utils/wsl.js +15 -0
  960. package/dist/utils/wsl.js.map +1 -0
  961. package/docs/background-tasks.md +36 -16
  962. package/docs/build.md +6 -16
  963. package/docs/compaction/reference.md +12 -12
  964. package/docs/compaction.md +33 -109
  965. package/docs/computer-use.md +124 -76
  966. package/docs/containerization.md +4 -5
  967. package/docs/custom-provider/api-reference.md +10 -1
  968. package/docs/custom-provider/oauth.md +4 -2
  969. package/docs/custom-provider/registration.md +1 -1
  970. package/docs/custom-provider/streaming.md +8 -3
  971. package/docs/custom-provider.md +44 -2
  972. package/docs/development.md +13 -138
  973. package/docs/docs.json +19 -4
  974. package/docs/environment-variables.md +21 -5
  975. package/docs/extensions/api-reference.md +6 -2
  976. package/docs/extensions/authoring.md +29 -7
  977. package/docs/extensions/events.md +107 -31
  978. package/docs/extensions/examples.md +1 -0
  979. package/docs/extensions/ui.md +3 -4
  980. package/docs/extensions.md +28 -20
  981. package/docs/getting-started/authentication.md +4 -1
  982. package/docs/getting-started/first-session.md +11 -8
  983. package/docs/getting-started/installation.md +14 -6
  984. package/docs/getting-started/project-instructions.md +5 -1
  985. package/docs/guides/configuration.md +10 -5
  986. package/docs/guides/non-interactive.md +2 -2
  987. package/docs/guides.md +8 -17
  988. package/docs/herdr.md +2 -1
  989. package/docs/index.md +2 -2
  990. package/docs/intercom/operations.md +25 -67
  991. package/docs/intercom/reference.md +15 -5
  992. package/docs/intercom.md +16 -7
  993. package/docs/json.md +12 -2
  994. package/docs/keybindings.md +15 -8
  995. package/docs/llama-cpp.md +6 -2
  996. package/docs/mcp-servers.md +93 -0
  997. package/docs/models/evals.md +75 -465
  998. package/docs/models/model-selection.md +35 -116
  999. package/docs/models/reference.md +70 -24
  1000. package/docs/models.md +7 -4
  1001. package/docs/packages/authoring.md +8 -2
  1002. package/docs/packages/reference.md +5 -1
  1003. package/docs/packages.md +7 -3
  1004. package/docs/programmatic.md +3 -1
  1005. package/docs/prompt-templates.md +3 -2
  1006. package/docs/providers/reference.md +2 -2
  1007. package/docs/providers.md +55 -18
  1008. package/docs/quickstart.md +8 -4
  1009. package/docs/reference/cli.md +21 -13
  1010. package/docs/reference.md +3 -6
  1011. package/docs/rpc/examples.md +2 -0
  1012. package/docs/rpc/protocol.md +11 -13
  1013. package/docs/rpc.md +5 -1
  1014. package/docs/sdk/reference.md +62 -267
  1015. package/docs/sdk/structured-decisions.md +94 -0
  1016. package/docs/sdk.md +194 -19
  1017. package/docs/security.md +7 -4
  1018. package/docs/session-format.md +35 -7
  1019. package/docs/sessions.md +12 -6
  1020. package/docs/settings.md +68 -16
  1021. package/docs/skills/authoring.md +7 -1
  1022. package/docs/skills.md +33 -8
  1023. package/docs/subagents/authoring.md +11 -1
  1024. package/docs/subagents/reference.md +97 -10
  1025. package/docs/subagents.md +52 -36
  1026. package/docs/terminal-setup.md +4 -2
  1027. package/docs/termux.md +3 -1
  1028. package/docs/themes/reference.md +4 -1
  1029. package/docs/themes.md +1 -1
  1030. package/docs/tools.md +431 -20
  1031. package/docs/tui/reference.md +13 -14
  1032. package/docs/tui.md +10 -6
  1033. package/docs/usage.md +34 -7
  1034. package/docs/web-access.md +5 -1
  1035. package/docs/windows.md +18 -11
  1036. package/docs/workflows/api-reference.md +112 -27
  1037. package/docs/workflows/authoring.md +345 -33
  1038. package/docs/workflows/builtins.md +22 -28
  1039. package/docs/workflows/operations.md +253 -140
  1040. package/docs/workflows/reliable-design.md +59 -130
  1041. package/docs/workflows/verification.md +40 -14
  1042. package/docs/workflows.md +12 -17
  1043. package/examples/extensions/README.md +1 -0
  1044. package/examples/extensions/custom-provider-anthropic/index.ts +15 -10
  1045. package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
  1046. package/examples/extensions/debug-provider.ts +90 -0
  1047. package/examples/extensions/prompt-customizer.ts +17 -37
  1048. package/examples/extensions/structured-output.ts +6 -0
  1049. package/examples/rpc-client.ts +38 -0
  1050. package/examples/rpc-extension-ui.ts +19 -5
  1051. package/examples/sdk/README.md +1 -1
  1052. package/npm-shrinkwrap.json +506 -713
  1053. package/package.json +13 -11
  1054. package/dist/builtin/subagents/skills/playwright-cli/SKILL.md +0 -420
  1055. package/dist/builtin/subagents/skills/playwright-cli/references/element-attributes.md +0 -23
  1056. package/dist/builtin/subagents/skills/playwright-cli/references/playwright-tests.md +0 -39
  1057. package/dist/builtin/subagents/skills/playwright-cli/references/request-mocking.md +0 -87
  1058. package/dist/builtin/subagents/skills/playwright-cli/references/running-code.md +0 -241
  1059. package/dist/builtin/subagents/skills/playwright-cli/references/session-management.md +0 -225
  1060. package/dist/builtin/subagents/skills/playwright-cli/references/storage-state.md +0 -275
  1061. package/dist/builtin/subagents/skills/playwright-cli/references/test-generation.md +0 -433
  1062. package/dist/builtin/subagents/skills/playwright-cli/references/tracing.md +0 -139
  1063. package/dist/builtin/subagents/skills/playwright-cli/references/video-recording.md +0 -143
  1064. package/dist/builtin/workflows/builtin/chunk-m0xfsef8.js +0 -2813
  1065. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_asset_producer.toml +0 -94
  1066. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_documenter.toml +0 -27
  1067. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_finish_reviewer.toml +0 -41
  1068. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_manual_edit_applier.toml +0 -95
  1069. package/dist/builtin/workflows/skills/impeccable/agents/openai.yaml +0 -4
  1070. package/dist/builtin/workflows/skills/impeccable/scripts/concept-seed.mjs +0 -695
  1071. package/dist/builtin/workflows/skills/impeccable/scripts/context-signals.mjs +0 -325
  1072. package/dist/builtin/workflows/skills/impeccable/scripts/context.mjs +0 -1503
  1073. package/dist/builtin/workflows/skills/impeccable/scripts/critique-storage.mjs +0 -222
  1074. package/dist/builtin/workflows/skills/impeccable/scripts/detect-csp.mjs +0 -198
  1075. package/dist/builtin/workflows/skills/impeccable/scripts/detect.mjs +0 -21
  1076. package/dist/builtin/workflows/skills/impeccable/scripts/detector/browser/injected/index.mjs +0 -2073
  1077. package/dist/builtin/workflows/skills/impeccable/scripts/detector/cli/main.mjs +0 -432
  1078. package/dist/builtin/workflows/skills/impeccable/scripts/detector/design-system.mjs +0 -1121
  1079. package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +0 -8746
  1080. package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns.mjs +0 -51
  1081. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +0 -376
  1082. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +0 -1168
  1083. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +0 -1192
  1084. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +0 -290
  1085. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -189
  1086. package/dist/builtin/workflows/skills/impeccable/scripts/detector/findings.mjs +0 -18
  1087. package/dist/builtin/workflows/skills/impeccable/scripts/detector/node/file-system.mjs +0 -213
  1088. package/dist/builtin/workflows/skills/impeccable/scripts/detector/profile/profiler.mjs +0 -166
  1089. package/dist/builtin/workflows/skills/impeccable/scripts/detector/registry/antipatterns.mjs +0 -617
  1090. package/dist/builtin/workflows/skills/impeccable/scripts/detector/rules/checks.mjs +0 -5534
  1091. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/color.mjs +0 -588
  1092. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/constants.mjs +0 -112
  1093. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/fonts.mjs +0 -30
  1094. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/inline-ignores.mjs +0 -148
  1095. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/page.mjs +0 -35
  1096. package/dist/builtin/workflows/skills/impeccable/scripts/doctor.mjs +0 -338
  1097. package/dist/builtin/workflows/skills/impeccable/scripts/embed-prompt.mjs +0 -270
  1098. package/dist/builtin/workflows/skills/impeccable/scripts/generate-image.mjs +0 -277
  1099. package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +0 -783
  1100. package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +0 -2305
  1101. package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +0 -78
  1102. package/dist/builtin/workflows/skills/impeccable/scripts/lib/artifact-schema.mjs +0 -93
  1103. package/dist/builtin/workflows/skills/impeccable/scripts/lib/composition-catalog.mjs +0 -200
  1104. package/dist/builtin/workflows/skills/impeccable/scripts/lib/concept-catalog.mjs +0 -395
  1105. package/dist/builtin/workflows/skills/impeccable/scripts/lib/design-parser.mjs +0 -925
  1106. package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-config.mjs +0 -640
  1107. package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-paths.mjs +0 -137
  1108. package/dist/builtin/workflows/skills/impeccable/scripts/lib/is-generated.mjs +0 -72
  1109. package/dist/builtin/workflows/skills/impeccable/scripts/lib/open-system-browser.mjs +0 -57
  1110. package/dist/builtin/workflows/skills/impeccable/scripts/lib/provider.mjs +0 -5
  1111. package/dist/builtin/workflows/skills/impeccable/scripts/lib/roll-selection.mjs +0 -369
  1112. package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-deep.mjs +0 -483
  1113. package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-notice.mjs +0 -169
  1114. package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness.mjs +0 -528
  1115. package/dist/builtin/workflows/skills/impeccable/scripts/lib/surface-briefs.mjs +0 -151
  1116. package/dist/builtin/workflows/skills/impeccable/scripts/lib/target-args.mjs +0 -42
  1117. package/dist/builtin/workflows/skills/impeccable/scripts/lib/target-slug.mjs +0 -33
  1118. package/dist/builtin/workflows/skills/impeccable/scripts/lib/template-extensions.mjs +0 -146
  1119. package/dist/builtin/workflows/skills/impeccable/scripts/live/accept-css.mjs +0 -617
  1120. package/dist/builtin/workflows/skills/impeccable/scripts/live/accept-verify.mjs +0 -71
  1121. package/dist/builtin/workflows/skills/impeccable/scripts/live/browser-script-parts.mjs +0 -77
  1122. package/dist/builtin/workflows/skills/impeccable/scripts/live/completion.mjs +0 -28
  1123. package/dist/builtin/workflows/skills/impeccable/scripts/live/event-validation.mjs +0 -199
  1124. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/astro.mjs +0 -47
  1125. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/detect-utils.mjs +0 -157
  1126. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/index.mjs +0 -143
  1127. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/journal.mjs +0 -205
  1128. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/nextjs.mjs +0 -49
  1129. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/nuxt.mjs +0 -170
  1130. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/script-src.mjs +0 -26
  1131. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/static-html.mjs +0 -26
  1132. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/sveltekit.mjs +0 -71
  1133. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/tag-strategy.mjs +0 -247
  1134. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/tanstack-start.mjs +0 -70
  1135. package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/vite-generic.mjs +0 -42
  1136. package/dist/builtin/workflows/skills/impeccable/scripts/live/generation-preflight.mjs +0 -149
  1137. package/dist/builtin/workflows/skills/impeccable/scripts/live/insert-ui.mjs +0 -458
  1138. package/dist/builtin/workflows/skills/impeccable/scripts/live/instructions.mjs +0 -169
  1139. package/dist/builtin/workflows/skills/impeccable/scripts/live/manual-apply.mjs +0 -939
  1140. package/dist/builtin/workflows/skills/impeccable/scripts/live/manual-edit-routes.mjs +0 -357
  1141. package/dist/builtin/workflows/skills/impeccable/scripts/live/manual-edits-buffer.mjs +0 -152
  1142. package/dist/builtin/workflows/skills/impeccable/scripts/live/poll-lanes.mjs +0 -14
  1143. package/dist/builtin/workflows/skills/impeccable/scripts/live/roots.mjs +0 -670
  1144. package/dist/builtin/workflows/skills/impeccable/scripts/live/session-store.mjs +0 -563
  1145. package/dist/builtin/workflows/skills/impeccable/scripts/live/source-lock.mjs +0 -105
  1146. package/dist/builtin/workflows/skills/impeccable/scripts/live/source-search.mjs +0 -105
  1147. package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-ast.mjs +0 -969
  1148. package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-component.mjs +0 -1401
  1149. package/dist/builtin/workflows/skills/impeccable/scripts/live/sveltekit-adapter.mjs +0 -314
  1150. package/dist/builtin/workflows/skills/impeccable/scripts/live/tanstack-adapter.mjs +0 -280
  1151. package/dist/builtin/workflows/skills/impeccable/scripts/live/ui-surfaces.mjs +0 -75
  1152. package/dist/builtin/workflows/skills/impeccable/scripts/live/vocabulary.mjs +0 -171
  1153. package/dist/builtin/workflows/skills/impeccable/scripts/live-accept.mjs +0 -961
  1154. package/dist/builtin/workflows/skills/impeccable/scripts/live-commit-manual-edits.mjs +0 -1244
  1155. package/dist/builtin/workflows/skills/impeccable/scripts/live-complete.mjs +0 -107
  1156. package/dist/builtin/workflows/skills/impeccable/scripts/live-copy-edit-agent.mjs +0 -800
  1157. package/dist/builtin/workflows/skills/impeccable/scripts/live-discard-manual-edits.mjs +0 -51
  1158. package/dist/builtin/workflows/skills/impeccable/scripts/live-inject.mjs +0 -515
  1159. package/dist/builtin/workflows/skills/impeccable/scripts/live-insert.mjs +0 -292
  1160. package/dist/builtin/workflows/skills/impeccable/scripts/live-manual-edit-evidence.mjs +0 -371
  1161. package/dist/builtin/workflows/skills/impeccable/scripts/live-poll.mjs +0 -427
  1162. package/dist/builtin/workflows/skills/impeccable/scripts/live-resume.mjs +0 -123
  1163. package/dist/builtin/workflows/skills/impeccable/scripts/live-server.mjs +0 -1675
  1164. package/dist/builtin/workflows/skills/impeccable/scripts/live-status.mjs +0 -71
  1165. package/dist/builtin/workflows/skills/impeccable/scripts/live-target.mjs +0 -30
  1166. package/dist/builtin/workflows/skills/impeccable/scripts/live-wrap.mjs +0 -927
  1167. package/dist/builtin/workflows/skills/impeccable/scripts/live.mjs +0 -365
  1168. package/dist/builtin/workflows/skills/impeccable/scripts/palette.mjs +0 -628
  1169. package/dist/builtin/workflows/skills/impeccable/scripts/pin.mjs +0 -224
  1170. package/dist/builtin/workflows/skills/impeccable/scripts/serve-question.mjs +0 -1540
  1171. package/dist/builtin/workflows/skills/impeccable/scripts/surface-brief.mjs +0 -74
  1172. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_astra.md +0 -58
  1173. package/docs/models/artificial-analysis-index.md +0 -89
  1174. package/docs/models/pareto-efficiency.md +0 -90
  1175. package/docs/tools/edit.md +0 -378
@@ -0,0 +1,34 @@
1
+ import type { SupervisedCommandOwner } from "../tools/bash-pty-native.js";
2
+ import type { AgentTaskHost } from "./agent-adapter.js";
3
+ import type { TaskId, YieldReason } from "./contracts.js";
4
+ import type { TaskSupervisor, WaitLease } from "./supervisor.js";
5
+ export type TaskCompletionMessage = {
6
+ customType: string;
7
+ content: string;
8
+ details: object;
9
+ display: true;
10
+ };
11
+ /** Live delivery into the child that launched a shell task, while that child still runs. */
12
+ export interface ChildTaskCompletionRoute {
13
+ isOpen(): boolean;
14
+ deliver(message: TaskCompletionMessage): Promise<void>;
15
+ }
16
+ /**
17
+ * Parent-issued capability that lets an in-process subagent child run shell tasks
18
+ * in the parent's task owner, so they appear in the parent's `/tasks` and outlive
19
+ * the child. It never authorizes agent launches.
20
+ */
21
+ export interface ChildCommandTaskOwner {
22
+ bind(childId: string, route: ChildTaskCompletionRoute, waits: ChildTaskWaits): SupervisedCommandOwner;
23
+ }
24
+ /** Completion route for a task a child launched in this owner, only while that child accepts messages. */
25
+ export declare function childTaskCompletionRoute(host: AgentTaskHost, taskId: TaskId): ChildTaskCompletionRoute | undefined;
26
+ /** Resolve the parent's live owner per call so session replacement is followed like the parent's own shells. */
27
+ export declare function createChildCommandTaskOwner(resolveHost: () => AgentTaskHost): ChildCommandTaskOwner;
28
+ /** Child-side waits on parent-owned tasks; inbound child messages release observation, never execution. */
29
+ export declare class ChildTaskWaits {
30
+ private readonly waits;
31
+ track(supervisor: TaskSupervisor, wait: WaitLease): void;
32
+ yieldAll(reason: YieldReason): void;
33
+ }
34
+ //# sourceMappingURL=child-command-owner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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@@ -0,0 +1,70 @@
1
+ class ChildCommandTaskRoutes {
2
+ constructor() {
3
+ this.launchedBy = new Map();
4
+ this.routes = new Map();
5
+ }
6
+ bind(childId, route) {
7
+ this.routes.set(childId, route);
8
+ }
9
+ recordLaunch(taskId, childId) {
10
+ this.launchedBy.set(taskId, childId);
11
+ }
12
+ launchedByChild(taskId, childId) {
13
+ return this.launchedBy.get(taskId) === childId;
14
+ }
15
+ openRoute(taskId) {
16
+ const childId = this.launchedBy.get(taskId);
17
+ const route = childId === undefined ? undefined : this.routes.get(childId);
18
+ return route?.isOpen() ? route : undefined;
19
+ }
20
+ }
21
+ const routesByHost = new WeakMap();
22
+ function routesFor(host) {
23
+ let routes = routesByHost.get(host);
24
+ if (!routes) {
25
+ routes = new ChildCommandTaskRoutes();
26
+ routesByHost.set(host, routes);
27
+ }
28
+ return routes;
29
+ }
30
+ /** Completion route for a task a child launched in this owner, only while that child accepts messages. */
31
+ export function childTaskCompletionRoute(host, taskId) {
32
+ return routesByHost.get(host)?.openRoute(taskId);
33
+ }
34
+ /** Resolve the parent's live owner per call so session replacement is followed like the parent's own shells. */
35
+ export function createChildCommandTaskOwner(resolveHost) {
36
+ return {
37
+ bind(childId, route, waits) {
38
+ const host = resolveHost();
39
+ const routes = routesFor(host);
40
+ routes.bind(childId, route);
41
+ const { supervisor, owner } = host.ownerBinding;
42
+ return {
43
+ supervisor,
44
+ owner,
45
+ ownsTask: (taskId) => routes.launchedByChild(taskId, childId),
46
+ onCommandStarted: (taskId) => routes.recordLaunch(taskId, childId),
47
+ waitForTask: (taskId, budgetMs, onRegistered) => supervisor.waitForTaskId(owner, taskId, budgetMs, (wait) => {
48
+ waits.track(supervisor, wait);
49
+ onRegistered?.(wait);
50
+ }),
51
+ };
52
+ },
53
+ };
54
+ }
55
+ /** Child-side waits on parent-owned tasks; inbound child messages release observation, never execution. */
56
+ export class ChildTaskWaits {
57
+ constructor() {
58
+ this.waits = new Map();
59
+ }
60
+ track(supervisor, wait) {
61
+ this.waits.set(wait, supervisor);
62
+ const remove = () => this.waits.delete(wait);
63
+ void supervisor.observeTaskWait(wait).then(remove, remove);
64
+ }
65
+ yieldAll(reason) {
66
+ for (const [wait, supervisor] of this.waits)
67
+ supervisor.yieldTaskWait(wait, reason);
68
+ }
69
+ }
70
+ //# sourceMappingURL=child-command-owner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-command-owner.js","sourceRoot":"","sources":["../../../src/core/tasks/child-command-owner.ts"],"names":[],"mappings":"AA2BA,MAAM,sBAAsB;IAA5B;QACkB,eAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;QACvC,WAAM,GAAG,IAAI,GAAG,EAAoC,CAAC;IAmBvE,CAAC;IAjBA,IAAI,CAAC,OAAe,EAAE,KAA+B;QACpD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,YAAY,CAAC,MAAc,EAAE,OAAe;QAC3C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,eAAe,CAAC,MAAc,EAAE,OAAe;QAC9C,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC;IAChD,CAAC;IAED,SAAS,CAAC,MAAc;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5C,CAAC;CACD;AAED,MAAM,YAAY,GAAG,IAAI,OAAO,EAAyC,CAAC;AAE1E,SAAS,SAAS,CAA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C9B,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;gBACtB,CAAC,CAAC;aACH,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC;AAED,2GAA2G;AAC3G,MAAM,OAAO,cAAc;IAA3B;QACkB,UAAK,GAAG,IAAI,GAAG,EAA6B,CAAC;IAW/D,CAAC;IATA,KAAK,CAAC,UAA0B,EAAE,IAAe;QAChD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7C,KAAK,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;IAED,QAAQ,CAAC,MAAmB;QAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,KAAK;YAAE,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrF,CAAC;CACD","sourcesContent":["import type { SupervisedCommandOwner } from \"../tools/bash-pty-native.js\";\nimport type { AgentTaskHost } from \"./agent-adapter.js\";\nimport type { TaskId, YieldReason } from \"./contracts.js\";\nimport type { TaskSupervisor, WaitLease } from \"./supervisor.js\";\n\nexport type TaskCompletionMessage = {\n\tcustomType: string;\n\tcontent: string;\n\tdetails: object;\n\tdisplay: true;\n};\n\n/** Live delivery into the child that launched a shell task, while that child still runs. */\nexport interface ChildTaskCompletionRoute {\n\tisOpen(): boolean;\n\tdeliver(message: TaskCompletionMessage): Promise<void>;\n}\n\n/**\n * Parent-issued capability that lets an in-process subagent child run shell tasks\n * in the parent's task owner, so they appear in the parent's `/tasks` and outlive\n * the child. It never authorizes agent launches.\n */\nexport interface ChildCommandTaskOwner {\n\tbind(childId: string, route: ChildTaskCompletionRoute, waits: ChildTaskWaits): SupervisedCommandOwner;\n}\n\nclass ChildCommandTaskRoutes {\n\tprivate readonly launchedBy = new Map<TaskId, string>();\n\tprivate readonly routes = new Map<string, ChildTaskCompletionRoute>();\n\n\tbind(childId: string, route: ChildTaskCompletionRoute): void {\n\t\tthis.routes.set(childId, route);\n\t}\n\n\trecordLaunch(taskId: TaskId, childId: string): void {\n\t\tthis.launchedBy.set(taskId, childId);\n\t}\n\n\tlaunchedByChild(taskId: TaskId, childId: string): boolean {\n\t\treturn this.launchedBy.get(taskId) === childId;\n\t}\n\n\topenRoute(taskId: TaskId): ChildTaskCompletionRoute | undefined {\n\t\tconst childId = this.launchedBy.get(taskId);\n\t\tconst route = childId === undefined ? undefined : this.routes.get(childId);\n\t\treturn route?.isOpen() ? route : undefined;\n\t}\n}\n\nconst routesByHost = new WeakMap<AgentTaskHost, ChildCommandTaskRoutes>();\n\nfunction routesFor(host: AgentTaskHost): ChildCommandTaskRoutes {\n\tlet routes = routesByHost.get(host);\n\tif (!routes) {\n\t\troutes = new ChildCommandTaskRoutes();\n\t\troutesByHost.set(host, routes);\n\t}\n\treturn routes;\n}\n\n/** Completion route for a task a child launched in this owner, only while that child accepts messages. */\nexport function childTaskCompletionRoute(host: AgentTaskHost, taskId: TaskId): ChildTaskCompletionRoute | undefined {\n\treturn routesByHost.get(host)?.openRoute(taskId);\n}\n\n/** Resolve the parent's live owner per call so session replacement is followed like the parent's own shells. */\nexport function createChildCommandTaskOwner(resolveHost: () => AgentTaskHost): ChildCommandTaskOwner {\n\treturn {\n\t\tbind(childId, route, waits) {\n\t\t\tconst host = resolveHost();\n\t\t\tconst routes = routesFor(host);\n\t\t\troutes.bind(childId, route);\n\t\t\tconst { supervisor, owner } = host.ownerBinding;\n\t\t\treturn {\n\t\t\t\tsupervisor,\n\t\t\t\towner,\n\t\t\t\townsTask: (taskId) => routes.launchedByChild(taskId, childId),\n\t\t\t\tonCommandStarted: (taskId) => routes.recordLaunch(taskId, childId),\n\t\t\t\twaitForTask: (taskId, budgetMs, onRegistered) =>\n\t\t\t\t\tsupervisor.waitForTaskId(owner, taskId, budgetMs, (wait) => {\n\t\t\t\t\t\twaits.track(supervisor, wait);\n\t\t\t\t\t\tonRegistered?.(wait);\n\t\t\t\t\t}),\n\t\t\t};\n\t\t},\n\t};\n}\n\n/** Child-side waits on parent-owned tasks; inbound child messages release observation, never execution. */\nexport class ChildTaskWaits {\n\tprivate readonly waits = new Map<WaitLease, TaskSupervisor>();\n\n\ttrack(supervisor: TaskSupervisor, wait: WaitLease): void {\n\t\tthis.waits.set(wait, supervisor);\n\t\tconst remove = () => this.waits.delete(wait);\n\t\tvoid supervisor.observeTaskWait(wait).then(remove, remove);\n\t}\n\n\tyieldAll(reason: YieldReason): void {\n\t\tfor (const [wait, supervisor] of this.waits) supervisor.yieldTaskWait(wait, reason);\n\t}\n}\n"]}
@@ -94,6 +94,10 @@ export type WaitOutcome = {
94
94
  waitId: WaitId;
95
95
  reason: YieldReason;
96
96
  };
97
+ export type RouterSelection = {
98
+ readonly model: string;
99
+ readonly effort: string | null;
100
+ };
97
101
  export type AgentIntent = {
98
102
  kind: "agent";
99
103
  agent: string;
@@ -101,6 +105,7 @@ export type AgentIntent = {
101
105
  description?: string;
102
106
  cwd?: string;
103
107
  parentTaskId?: TaskId;
108
+ readonly routerSelection?: RouterSelection;
104
109
  };
105
110
  export type CommandIntent = {
106
111
  kind: "command";
@@ -234,6 +239,7 @@ export type TaskRecord = {
234
239
  /** Resolved execution settings, retained after completion. */
235
240
  model?: string;
236
241
  thinking?: string;
242
+ readonly routerSelection?: RouterSelection;
237
243
  execution: Execution;
238
244
  observation: HostObservation;
239
245
  /** Retained native background membership, independent of the current wait. */
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/core/tasks/contracts.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,MAAM,CAAC;AACnC,KAAK,KAAK,CAAC,IAAI,SAAS,MAAM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C,OAAO,EAAE,aAAa,GAAG,cAAc,CAAA;KAAE,CAAC,CAAC;CAC3E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/core/tasks/contracts.ts"],"names":[],"mappings":"","sourcesContent":["/** Owner-bound task wire contracts. Capabilities are deliberately not wire DTOs. */\ndeclare const brand: unique symbol;\ntype Brand<Name extends string> = { readonly [brand]: Name };\nexport type OwnerId = string & Brand<\"OwnerId\">;\nexport type TaskId = string & Brand<\"TaskId\">;\nexport type AttemptId = string & Brand<\"AttemptId\">;\nexport type WaitId = string & Brand<\"WaitId\">;\nexport type OperationId = string & Brand<\"OperationId\">;\nexport type Generation = string & Brand<\"Generation\">;\n/** Decimal u64, never a JavaScript number. */\nexport type Sequence = string & Brand<\"Sequence\">;\nexport type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };\nexport type Failure<Code extends string> = { code: Code; message: string };\nexport type OwnerError = Failure<\"ScopeMismatch\" | \"EnvironmentClosing\">;\nexport type StartError =\n\t| \"OwnerClosing\"\n\t| \"UnknownAgent\"\n\t| \"InvalidCwd\"\n\t| \"DepthExceeded\"\n\t| \"CapacityExhausted\"\n\t| \"DispatchGuardBusy\"\n\t| \"OperationConflict\"\n\t| \"RunnerUnavailable\"\n\t| \"SpawnFailed\"\n\t| \"ContainmentUnavailable\";\nexport type StartFailure = Failure<StartError>;\nexport type WaitError = Failure<\n\t\"UnknownTask\" | \"OwnerClosed\" | \"EnvironmentClosing\" | \"ScopeMismatch\" | \"ObserverCancelled\"\n>;\nexport type YieldError = Failure<\"UnknownWait\" | \"StaleGeneration\" | \"ObserverCancelled\">;\nexport type ForegroundError = Failure<\"TaskTerminal\" | \"OwnerClosing\" | \"UnknownTask\" | \"ObserverCancelled\">;\nexport type CancelError = Failure<\"UnknownTask\" | \"CleanupFailed\">;\nexport type CloseError = Failure<\"CleanupFailed\" | \"EnvironmentClosing\">;\nexport type WatchError = Failure<\"OwnerClosed\" | \"StaleGeneration\" | \"EnvironmentClosing\">;\nexport type ReportError = Failure<\"StaleAttempt\" | \"OwnerClosing\" | \"TaskTerminal\" | \"ReportConflict\">;\nexport type InputData = { kind: \"bytes\"; bytes: Uint8Array } | { kind: \"eof\" };\nexport type InputReceipt = { operationId: OperationId; acceptedBytes: number; kind: \"bytes\" | \"eof\" };\nexport type InputError = Failure<\n\t| \"TaskTerminal\"\n\t| \"StdinClosed\"\n\t| \"InputBackpressure\"\n\t| \"OperationConflict\"\n\t| \"InputDeliveryUnknown\"\n\t| \"UnknownTask\"\n\t| \"OutputUnavailable\"\n>;\nexport type OutputError = Failure<\"UnknownTask\" | \"OutputUnavailable\">;\nexport type OutputRange = { start: string; maximumBytes: number };\nexport type OutputPage = {\n\trequested: { start: string; end: string };\n\tchunks: Array<{ offsets: { start: string; end: string }; bytes: Uint8Array }>;\n\tomittedRanges: Array<{ start: string; end: string }>;\n\tnextOffset?: string;\n};\nexport type OwnerScope =\n\t| { kind: \"session\"; sessionId: string }\n\t| { kind: \"workflow-stage\"; sessionId: string; runId: string; stageId: string; stageAttemptId: string };\nexport type WaitPolicy = { kind: \"background\" } | { kind: \"foreground\"; budgetMs?: number };\nexport type YieldReason = \"explicit\" | \"default-background\" | \"elapsed\" | \"intercom-coordination\" | \"input-needed\";\nexport type WaitOutcome =\n\t| { kind: \"settled\"; taskId: TaskId; result: TaskResult }\n\t| { kind: \"yielded\"; taskId: TaskId; waitId: WaitId; reason: YieldReason };\nexport type AgentIntent = {\n\tkind: \"agent\";\n\tagent: string;\n\ttask: string;\n\tdescription?: string;\n\tcwd?: string;\n\tparentTaskId?: TaskId;\n};\nexport type CommandIntent = {\n\tkind: \"command\";\n\tcommand: string;\n\tdescription?: string;\n\tcwd?: string;\n\tenv?: Record<string, string>;\n\t/** Explicit executable and prefix arguments; command is appended as one argument. */\n\tshell?: { program: string; args: string[] };\n\t/** False replaces the inherited environment with env; omission preserves inheritance. */\n\tinheritEnv?: boolean;\n\tterminal: { kind: \"pipe\" } | { kind: \"pty\"; columns: number; rows: number };\n\texecutionTimeoutMs?: number;\n\tparentTaskId?: TaskId;\n};\nexport type TaskIntent = AgentIntent | CommandIntent;\nexport type TaskWaitConfiguration =\n\t| { kind: \"automatic\"; commandBudgetMs?: number; agentBudgetMs?: number }\n\t| { kind: \"until-settled\" };\nexport type CancelCause = \"user\" | \"owner-close\" | \"execution-timeout\" | \"output-limit\" | \"parent-handoff\" | \"shutdown\";\nexport type OwnerCloseCause = \"session-close\" | \"stage-close\" | \"app-shutdown\";\nexport type Cursor = { generation: Generation; sequence: Sequence };\nexport type NativeTaskRef = { ownerId: OwnerId; taskId: TaskId; attemptId: AttemptId; generation: Generation };\nexport type OutputRef = {\n\townerId: OwnerId;\n\ttaskId: TaskId;\n\tartifactId: string;\n\tbyteCount: string;\n\tomittedRanges: Array<{ start: string; end: string }>;\n};\nexport type TaskResult =\n\t| { kind: \"completed\"; output: OutputRef; exitCode?: number }\n\t| { kind: \"failed\"; code: string; message: string; output?: OutputRef; exitCode?: number }\n\t| { kind: \"cancelled\"; cause: CancelCause; output?: OutputRef };\nexport type Execution =\n\t| { kind: \"queued\" }\n\t| { kind: \"running\" }\n\t| { kind: \"cancelling\"; cause: CancelCause }\n\t| { kind: \"settled\"; result: TaskResult };\nexport type ResourceFailure = { resource: string; code: string; message: string };\nexport type Cleanup =\n\t| { kind: \"active\" }\n\t| { kind: \"draining\" }\n\t| { kind: \"reaped\" }\n\t| { kind: \"failed\"; resources: Array<ResourceFailure> };\nexport type PromptRoute = { sessionId: string; promptId: string; stageAttemptId?: string };\nexport type Attention =\n\t| { kind: \"none\" }\n\t| { kind: \"input-needed\"; requestId: string; prompt: string; route: PromptRoute }\n\t| { kind: \"no-recent-activity\"; lastActivityAt?: string };\nexport type HostObservation =\n\t| { kind: \"foreground\"; waitId: WaitId }\n\t| { kind: \"background\"; reason: YieldReason | \"not-observed\" | \"observer-cancelled\" }\n\t| { kind: \"none\"; reason: \"task-settled\" | \"owner-closing\" };\nexport type TaskRecord = {\n\tref: NativeTaskRef;\n\tlaunchOperationId: OperationId;\n\tparentTaskId?: TaskId;\n\tlaunchGroupId?: string;\n\tlaunchOrdinal: number;\n\tkind: \"agent\" | \"command\";\n\ttitle: string;\n\tagentName?: string;\n\t/** Resolved execution settings, retained after completion. */\n\tmodel?: string;\n\tthinking?: string;\n\texecution: Execution;\n\tobservation: HostObservation;\n\t/** Retained native background membership, independent of the current wait. */\n\twasBackground?: boolean;\n\tattention: Attention;\n\tcleanup: Cleanup;\n\tcurrentAction?: { tool: string; text: string };\n\tmetrics?: { elapsedMs?: number; toolCount?: number; tokenCount?: number };\n\toutput: OutputRef;\n};\n/**\n * The latest 256 accepted activity IDs per task retain SHA-256 payload hashes and receipts.\n * Identical replay is duplicate; changed payload conflicts, without events or retention refresh.\n * Evicted IDs are fresh reports, subject to existing terminal/owner guards, not task revival.\n */\nexport type ActivityReport = {\n\treportId: string;\n\tchange:\n\t\t| { kind: \"action\"; tool: string; text: string }\n\t\t| { kind: \"model\"; model?: string; thinking?: string }\n\t\t| { kind: \"metrics\"; elapsedMs?: number; toolCount?: number; tokenCount?: number }\n\t\t| { kind: \"output\"; offset: string; bytesBase64: string }\n\t\t| { kind: \"attention-set\"; attention: Exclude<Attention, { kind: \"none\" }> }\n\t\t| { kind: \"attention-clear\"; requestId: string };\n};\n/** Terminal reports and their receipts never expire while the task record exists. */\nexport type OutcomeReport = { reportId: string; result: TaskResult };\nexport type TaskEvent =\n\t| { kind: \"task-admitted\"; task: TaskRecord }\n\t| { kind: \"task-started\"; ref: NativeTaskRef }\n\t| { kind: \"wait-yielded\"; ref: NativeTaskRef; waitId: WaitId; reason: YieldReason }\n\t| { kind: \"wait-started\"; ref: NativeTaskRef; waitId: WaitId; observer: \"sdk\" | \"host\" }\n\t| { kind: \"host-observation-changed\"; ref: NativeTaskRef; observation: HostObservation }\n\t| { kind: \"task-activity\"; ref: NativeTaskRef; activity: ActivityReport }\n\t| { kind: \"task-cancelling\"; ref: NativeTaskRef; cause: CancelCause }\n\t| { kind: \"task-settled\"; ref: NativeTaskRef; result: TaskResult; completionId: string }\n\t| { kind: \"cleanup-changed\"; ref: NativeTaskRef; cleanup: Cleanup }\n\t| { kind: \"owner-closing\" }\n\t| { kind: \"owner-closed\" };\nexport type NativeEvent = {\n\tschemaVersion: 1;\n\tcursor: Cursor;\n\townerId: OwnerId;\n\ttaskId?: TaskId;\n\tpayload: TaskEvent;\n};\nexport type OwnerSnapshot = {\n\townerId: OwnerId;\n\tscope: OwnerScope;\n\tgeneration: Generation;\n\tstate: \"open\" | \"closing\" | \"closed\";\n\ttasks: Array<TaskRecord>;\n\tcursor: Cursor;\n};\nexport type ReportReceipt = { reportId: string; cursor: Cursor; disposition: \"accepted\" | \"duplicate\" };\nexport type SettlementReceipt = { taskId: TaskId; cursor: Cursor; result: TaskResult; completionId: string };\nexport type CancelReceipt = {\n\ttaskId: TaskId;\n\tdecision: \"already-settled\" | \"cancellation-requested\";\n\texecution: Execution;\n\tcleanup: Cleanup;\n};\nexport type OwnerCloseReceipt = { ownerId: OwnerId; state: \"closed\"; tasks: Array<CancelReceipt> };\nexport type ArtifactRef = { kind: \"transcript\" | \"result\"; uri: string };\nexport type ModelAdmitted = { kind: \"admitted\"; observation: WaitOutcome; artifacts?: Array<ArtifactRef> };\nexport type ModelRejected = { kind: \"unstarted\"; reason: { kind: \"rejected\"; error: StartFailure } };\nexport type ModelUnstarted =\n\t| ModelRejected\n\t| { kind: \"unstarted\"; reason: { kind: \"skipped\"; cause: \"parallel-group-detach\" } };\nexport type ModelSingleResponse = ModelAdmitted | ModelRejected;\nexport type ModelParallelResponse = {\n\tkind: \"parallel\";\n\tslots: Array<{ ordinal: number; outcome: ModelAdmitted | ModelUnstarted }>;\n};\n"]}
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/core/tasks/contracts.ts"],"names":[],"mappings":"","sourcesContent":["/** Owner-bound task wire contracts. Capabilities are deliberately not wire DTOs. */\ndeclare const brand: unique symbol;\ntype Brand<Name extends string> = { readonly [brand]: Name };\nexport type OwnerId = string & Brand<\"OwnerId\">;\nexport type TaskId = string & Brand<\"TaskId\">;\nexport type AttemptId = string & Brand<\"AttemptId\">;\nexport type WaitId = string & Brand<\"WaitId\">;\nexport type OperationId = string & Brand<\"OperationId\">;\nexport type Generation = string & Brand<\"Generation\">;\n/** Decimal u64, never a JavaScript number. */\nexport type Sequence = string & Brand<\"Sequence\">;\nexport type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };\nexport type Failure<Code extends string> = { code: Code; message: string };\nexport type OwnerError = Failure<\"ScopeMismatch\" | \"EnvironmentClosing\">;\nexport type StartError =\n\t| \"OwnerClosing\"\n\t| \"UnknownAgent\"\n\t| \"InvalidCwd\"\n\t| \"DepthExceeded\"\n\t| \"CapacityExhausted\"\n\t| \"DispatchGuardBusy\"\n\t| \"OperationConflict\"\n\t| \"RunnerUnavailable\"\n\t| \"SpawnFailed\"\n\t| \"ContainmentUnavailable\";\nexport type StartFailure = Failure<StartError>;\nexport type WaitError = Failure<\n\t\"UnknownTask\" | \"OwnerClosed\" | \"EnvironmentClosing\" | \"ScopeMismatch\" | \"ObserverCancelled\"\n>;\nexport type YieldError = Failure<\"UnknownWait\" | \"StaleGeneration\" | \"ObserverCancelled\">;\nexport type ForegroundError = Failure<\"TaskTerminal\" | \"OwnerClosing\" | \"UnknownTask\" | \"ObserverCancelled\">;\nexport type CancelError = Failure<\"UnknownTask\" | \"CleanupFailed\">;\nexport type CloseError = Failure<\"CleanupFailed\" | \"EnvironmentClosing\">;\nexport type WatchError = Failure<\"OwnerClosed\" | \"StaleGeneration\" | \"EnvironmentClosing\">;\nexport type ReportError = Failure<\"StaleAttempt\" | \"OwnerClosing\" | \"TaskTerminal\" | \"ReportConflict\">;\nexport type InputData = { kind: \"bytes\"; bytes: Uint8Array } | { kind: \"eof\" };\nexport type InputReceipt = { operationId: OperationId; acceptedBytes: number; kind: \"bytes\" | \"eof\" };\nexport type InputError = Failure<\n\t| \"TaskTerminal\"\n\t| \"StdinClosed\"\n\t| \"InputBackpressure\"\n\t| \"OperationConflict\"\n\t| \"InputDeliveryUnknown\"\n\t| \"UnknownTask\"\n\t| \"OutputUnavailable\"\n>;\nexport type OutputError = Failure<\"UnknownTask\" | \"OutputUnavailable\">;\nexport type OutputRange = { start: string; maximumBytes: number };\nexport type OutputPage = {\n\trequested: { start: string; end: string };\n\tchunks: Array<{ offsets: { start: string; end: string }; bytes: Uint8Array }>;\n\tomittedRanges: Array<{ start: string; end: string }>;\n\tnextOffset?: string;\n};\nexport type OwnerScope =\n\t| { kind: \"session\"; sessionId: string }\n\t| { kind: \"workflow-stage\"; sessionId: string; runId: string; stageId: string; stageAttemptId: string };\nexport type WaitPolicy = { kind: \"background\" } | { kind: \"foreground\"; budgetMs?: number };\nexport type YieldReason = \"explicit\" | \"default-background\" | \"elapsed\" | \"intercom-coordination\" | \"input-needed\";\nexport type WaitOutcome =\n\t| { kind: \"settled\"; taskId: TaskId; result: TaskResult }\n\t| { kind: \"yielded\"; taskId: TaskId; waitId: WaitId; reason: YieldReason };\nexport type RouterSelection = { readonly model: string; readonly effort: string | null };\nexport type AgentIntent = {\n\tkind: \"agent\";\n\tagent: string;\n\ttask: string;\n\tdescription?: string;\n\tcwd?: string;\n\tparentTaskId?: TaskId;\n\treadonly routerSelection?: RouterSelection;\n};\nexport type CommandIntent = {\n\tkind: \"command\";\n\tcommand: string;\n\tdescription?: string;\n\tcwd?: string;\n\tenv?: Record<string, string>;\n\t/** Explicit executable and prefix arguments; command is appended as one argument. */\n\tshell?: { program: string; args: string[] };\n\t/** False replaces the inherited environment with env; omission preserves inheritance. */\n\tinheritEnv?: boolean;\n\tterminal: { kind: \"pipe\" } | { kind: \"pty\"; columns: number; rows: number };\n\texecutionTimeoutMs?: number;\n\tparentTaskId?: TaskId;\n};\nexport type TaskIntent = AgentIntent | CommandIntent;\nexport type TaskWaitConfiguration =\n\t| { kind: \"automatic\"; commandBudgetMs?: number; agentBudgetMs?: number }\n\t| { kind: \"until-settled\" };\nexport type CancelCause = \"user\" | \"owner-close\" | \"execution-timeout\" | \"output-limit\" | \"parent-handoff\" | \"shutdown\";\nexport type OwnerCloseCause = \"session-close\" | \"stage-close\" | \"app-shutdown\";\nexport type Cursor = { generation: Generation; sequence: Sequence };\nexport type NativeTaskRef = { ownerId: OwnerId; taskId: TaskId; attemptId: AttemptId; generation: Generation };\nexport type OutputRef = {\n\townerId: OwnerId;\n\ttaskId: TaskId;\n\tartifactId: string;\n\tbyteCount: string;\n\tomittedRanges: Array<{ start: string; end: string }>;\n};\nexport type TaskResult =\n\t| { kind: \"completed\"; output: OutputRef; exitCode?: number }\n\t| { kind: \"failed\"; code: string; message: string; output?: OutputRef; exitCode?: number }\n\t| { kind: \"cancelled\"; cause: CancelCause; output?: OutputRef };\nexport type Execution =\n\t| { kind: \"queued\" }\n\t| { kind: \"running\" }\n\t| { kind: \"cancelling\"; cause: CancelCause }\n\t| { kind: \"settled\"; result: TaskResult };\nexport type ResourceFailure = { resource: string; code: string; message: string };\nexport type Cleanup =\n\t| { kind: \"active\" }\n\t| { kind: \"draining\" }\n\t| { kind: \"reaped\" }\n\t| { kind: \"failed\"; resources: Array<ResourceFailure> };\nexport type PromptRoute = { sessionId: string; promptId: string; stageAttemptId?: string };\nexport type Attention =\n\t| { kind: \"none\" }\n\t| { kind: \"input-needed\"; requestId: string; prompt: string; route: PromptRoute }\n\t| { kind: \"no-recent-activity\"; lastActivityAt?: string };\nexport type HostObservation =\n\t| { kind: \"foreground\"; waitId: WaitId }\n\t| { kind: \"background\"; reason: YieldReason | \"not-observed\" | \"observer-cancelled\" }\n\t| { kind: \"none\"; reason: \"task-settled\" | \"owner-closing\" };\nexport type TaskRecord = {\n\tref: NativeTaskRef;\n\tlaunchOperationId: OperationId;\n\tparentTaskId?: TaskId;\n\tlaunchGroupId?: string;\n\tlaunchOrdinal: number;\n\tkind: \"agent\" | \"command\";\n\ttitle: string;\n\tagentName?: string;\n\t/** Resolved execution settings, retained after completion. */\n\tmodel?: string;\n\tthinking?: string;\n\treadonly routerSelection?: RouterSelection;\n\texecution: Execution;\n\tobservation: HostObservation;\n\t/** Retained native background membership, independent of the current wait. */\n\twasBackground?: boolean;\n\tattention: Attention;\n\tcleanup: Cleanup;\n\tcurrentAction?: { tool: string; text: string };\n\tmetrics?: { elapsedMs?: number; toolCount?: number; tokenCount?: number };\n\toutput: OutputRef;\n};\n/**\n * The latest 256 accepted activity IDs per task retain SHA-256 payload hashes and receipts.\n * Identical replay is duplicate; changed payload conflicts, without events or retention refresh.\n * Evicted IDs are fresh reports, subject to existing terminal/owner guards, not task revival.\n */\nexport type ActivityReport = {\n\treportId: string;\n\tchange:\n\t\t| { kind: \"action\"; tool: string; text: string }\n\t\t| { kind: \"model\"; model?: string; thinking?: string }\n\t\t| { kind: \"metrics\"; elapsedMs?: number; toolCount?: number; tokenCount?: number }\n\t\t| { kind: \"output\"; offset: string; bytesBase64: string }\n\t\t| { kind: \"attention-set\"; attention: Exclude<Attention, { kind: \"none\" }> }\n\t\t| { kind: \"attention-clear\"; requestId: string };\n};\n/** Terminal reports and their receipts never expire while the task record exists. */\nexport type OutcomeReport = { reportId: string; result: TaskResult };\nexport type TaskEvent =\n\t| { kind: \"task-admitted\"; task: TaskRecord }\n\t| { kind: \"task-started\"; ref: NativeTaskRef }\n\t| { kind: \"wait-yielded\"; ref: NativeTaskRef; waitId: WaitId; reason: YieldReason }\n\t| { kind: \"wait-started\"; ref: NativeTaskRef; waitId: WaitId; observer: \"sdk\" | \"host\" }\n\t| { kind: \"host-observation-changed\"; ref: NativeTaskRef; observation: HostObservation }\n\t| { kind: \"task-activity\"; ref: NativeTaskRef; activity: ActivityReport }\n\t| { kind: \"task-cancelling\"; ref: NativeTaskRef; cause: CancelCause }\n\t| { kind: \"task-settled\"; ref: NativeTaskRef; result: TaskResult; completionId: string }\n\t| { kind: \"cleanup-changed\"; ref: NativeTaskRef; cleanup: Cleanup }\n\t| { kind: \"owner-closing\" }\n\t| { kind: \"owner-closed\" };\nexport type NativeEvent = {\n\tschemaVersion: 1;\n\tcursor: Cursor;\n\townerId: OwnerId;\n\ttaskId?: TaskId;\n\tpayload: TaskEvent;\n};\nexport type OwnerSnapshot = {\n\townerId: OwnerId;\n\tscope: OwnerScope;\n\tgeneration: Generation;\n\tstate: \"open\" | \"closing\" | \"closed\";\n\ttasks: Array<TaskRecord>;\n\tcursor: Cursor;\n};\nexport type ReportReceipt = { reportId: string; cursor: Cursor; disposition: \"accepted\" | \"duplicate\" };\nexport type SettlementReceipt = { taskId: TaskId; cursor: Cursor; result: TaskResult; completionId: string };\nexport type CancelReceipt = {\n\ttaskId: TaskId;\n\tdecision: \"already-settled\" | \"cancellation-requested\";\n\texecution: Execution;\n\tcleanup: Cleanup;\n};\nexport type OwnerCloseReceipt = { ownerId: OwnerId; state: \"closed\"; tasks: Array<CancelReceipt> };\nexport type ArtifactRef = { kind: \"transcript\" | \"result\"; uri: string };\nexport type ModelAdmitted = { kind: \"admitted\"; observation: WaitOutcome; artifacts?: Array<ArtifactRef> };\nexport type ModelRejected = { kind: \"unstarted\"; reason: { kind: \"rejected\"; error: StartFailure } };\nexport type ModelUnstarted =\n\t| ModelRejected\n\t| { kind: \"unstarted\"; reason: { kind: \"skipped\"; cause: \"parallel-group-detach\" } };\nexport type ModelSingleResponse = ModelAdmitted | ModelRejected;\nexport type ModelParallelResponse = {\n\tkind: \"parallel\";\n\tslots: Array<{ ordinal: number; outcome: ModelAdmitted | ModelUnstarted }>;\n};\n"]}
@@ -22,6 +22,7 @@ export declare class OwnerTaskStore {
22
22
  private activityCursors;
23
23
  private omittedActivity;
24
24
  private backgroundIds;
25
+ private settlements;
25
26
  readonly anchors: Map<TaskId, TaskAnchor>;
26
27
  private current?;
27
28
  readonly supervisor: TaskSupervisor;
@@ -32,6 +33,11 @@ export declare class OwnerTaskStore {
32
33
  get tasks(): TaskRecord[];
33
34
  /** Background membership survives foreground waits and terminal observation cleanup. */
34
35
  get backgroundTasks(): TaskRecord[];
36
+ /**
37
+ * Journal sequence at which each task settled; higher is more recent. Tasks first seen settled in a
38
+ * snapshot without their settlement event share that snapshot's sequence, so their order is unknown.
39
+ */
40
+ get settlementOrder(): ReadonlyMap<TaskId, bigint>;
35
41
  /** Resolve only within the owner that authorized this store. */
36
42
  resolveTask(id: TaskId): Result<TaskLease, WaitError>;
37
43
  recentActivity(id: TaskId): TaskActivity[];
@@ -1 +1 @@
1
- {"version":3,"file":"owner-store.d.ts","sourceRoot":"","sources":["../../../src/core/tasks/owner-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,MAAM,EAEN,aAAa,EACb,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,UAAU,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAoB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE/F,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACtB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,CAAC;AAOtE,qEAAqE;AACrE,qBAAa,cAAc;IAC1B,OAAO,CAAC,YAAY,CAAC,CAAmB;IACxC,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,aAAa,CAAqB;IAC1C,QAAQ,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AAS,CAE/B;IACD,IAAI,KAAK,IAAI,UAAU,EAAE,CAExB;IACD,wFAAwF;IACxF,IAAI,eAAe,IAAI,UAAU,EAAE,CAIlC;IACD;;;OAGG;IACH,IAAI,eAAe,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAEjD;IACD,gEAAgE;IAChE,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAEpD;IACD,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,EAAE,CAEzC;IACD,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEnC;IACD,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAK1C;IACD,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAUlC;IACD,kFAAkF;IAClF,KAAK,IAAI,IAAI,CAEZ;IACD,OAAO,IAAI,IAAI,CAGd;IACD,OAAO,CAAC,SAAS;YAgCH,OAAO;IAWrB,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,MAAM;CAGd;AAKD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAG/E;AACD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAE7E;AAED,oFAAoF;AACpF,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAU5F"}
@@ -14,6 +14,7 @@ export class OwnerTaskStore {
14
14
  this.activityCursors = new Map();
15
15
  this.omittedActivity = new Set();
16
16
  this.backgroundIds = new Set();
17
+ this.settlements = new Map();
17
18
  this.anchors = new Map();
18
19
  this.supervisor = supervisor;
19
20
  this.owner = owner;
@@ -31,6 +32,13 @@ export class OwnerTaskStore {
31
32
  get backgroundTasks() {
32
33
  return this.tasks.filter((task) => task.wasBackground || isBackground(task.observation) || this.backgroundIds.has(task.ref.taskId));
33
34
  }
35
+ /**
36
+ * Journal sequence at which each task settled; higher is more recent. Tasks first seen settled in a
37
+ * snapshot without their settlement event share that snapshot's sequence, so their order is unknown.
38
+ */
39
+ get settlementOrder() {
40
+ return this.settlements;
41
+ }
34
42
  /** Resolve only within the owner that authorized this store. */
35
43
  resolveTask(id) {
36
44
  return this.supervisor.lookupTask(this.owner, id);
@@ -54,8 +62,8 @@ export class OwnerTaskStore {
54
62
  return watched;
55
63
  const subscription = watched.value;
56
64
  this.subscription = subscription;
57
- this.reconcile(subscription.snapshot);
58
- subscription.onReconcile = (snapshot) => this.reconcile(snapshot);
65
+ this.reconcile(subscription.snapshot, []);
66
+ subscription.onReconcile = (snapshot, events) => this.reconcile(snapshot, events);
59
67
  void this.observe(subscription);
60
68
  return { ok: true, value: undefined };
61
69
  }
@@ -67,19 +75,24 @@ export class OwnerTaskStore {
67
75
  this.subscription?.dispose();
68
76
  this.subscription = undefined;
69
77
  }
70
- reconcile(snapshot) {
78
+ reconcile(snapshot, events) {
71
79
  if (this.current &&
72
80
  (snapshot.ownerId !== this.current.ownerId || snapshot.generation !== this.current.generation))
73
81
  throw new Error("StaleGeneration: cannot replace a task owner projection");
74
82
  if (this.current && BigInt(snapshot.cursor.sequence) <= BigInt(this.current.cursor.sequence))
75
83
  return;
76
84
  this.current = snapshot;
85
+ for (const event of events)
86
+ if (event.payload.kind === "task-settled" && !this.settlements.has(event.payload.ref.taskId))
87
+ this.settlements.set(event.payload.ref.taskId, BigInt(event.cursor.sequence));
77
88
  for (const task of snapshot.tasks) {
78
89
  const previous = this.records.get(task.ref.taskId);
79
90
  if (isBackground(task.observation) || isBackground(previous?.observation))
80
91
  this.backgroundIds.add(task.ref.taskId);
81
92
  // Native settlement is immutable, even when recovering a view from a snapshot.
82
93
  this.records.set(task.ref.taskId, previous?.execution.kind === "settled" ? { ...task, execution: previous.execution } : task);
94
+ if (task.execution.kind === "settled" && !this.settlements.has(task.ref.taskId))
95
+ this.settlements.set(task.ref.taskId, BigInt(snapshot.cursor.sequence));
83
96
  if (!this.anchors.has(task.ref.taskId))
84
97
  this.anchors.set(task.ref.taskId, {
85
98
  taskId: task.ref.taskId,
@@ -1 +1 @@
1
- {"version":3,"file":"owner-store.js","sourceRoot":"","sources":["../../../src/core/tasks/owner-store.ts"],"names":[],"mappings":"AAaA,oFAAoF;AACpF,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AASxC,SAAS,YAAY,CAAC,WAAkD;IACvE,4EAA4E;IAC5E,OAAO,WAAW,EAAE,IAAI,KAAK,YAAY,IAAI,WAAW,CAAC,MAAM,KAAK,cAAc,CAAC;AACpF,CAAC;AAED,qEAAqE;AACrE,MAAM,OAAO,cAAc;IAY1B,YAAY,UAA0B,EAAE,KAAiB;QAVjD,cAAS,GAAG,IAAI,GAAG,EAAc,CAAC;QAClC,YAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;QACxC,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;QAC7C,oBAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC5C,oBAAe,GAAG,IAAI,GAAG,EAAU,CAAC;QACpC,kBAAa,GAAG,IAAI,GAAG,EAAU,CAAC;QACjC,YAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;QAKhD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IACD,IAAI,MAAM;QACT,OAAO,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;IAC7B,CAAC;IACD,IAAI,KAAK;QACR,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,w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AAC;QAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;IACO,MAAM;QACb,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS;YAAE,QAAQ,EAAE,CAAC;IACnD,CAAC;CACD;AAED,qFAAqF;AACrF,MAAM,aAAa,GAAG,IAAI,OAAO,EAA0B,CAAC;AAC5D,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA2B,CAAC;AAChE,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,KAAqB;IACxE,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAClC,KAAK,MAAM,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,CAAC;AACxE,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAChD,OAAO,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,0BAA0B,CAAC,OAAe,EAAE,QAAoB;IAC/E,IAAI,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,gBAAgB,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;IACD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,OAAO,GAAG,EAAE;QACX,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tActivityReport,\n\tCursor,\n\tNativeEvent,\n\tOwnerSnapshot,\n\tResult,\n\tTaskId,\n\tTaskRecord,\n\tWaitError,\n\tWatchError,\n} from \"./contracts.js\";\nimport type { OwnerLease, TaskLease, TaskSubscription, TaskSupervisor } from \"./supervisor.js\";\n\n/** Activity previews are bounded independently of authoritative session history. */\nexport const TASK_ACTIVITY_LIMIT = 64;\nexport const TASK_ACTIVITY_BYTES = 8192;\nexport type TaskAnchor = {\n\ttaskId: TaskId;\n\tactivitySequence: Cursor[\"sequence\"];\n\tcellOffset: number;\n\tfollowBottom: boolean;\n};\nexport type TaskActivity = { cursor: Cursor; report: ActivityReport };\n\nfunction isBackground(observation: TaskRecord[\"observation\"] | undefined): boolean {\n\t// Admission starts unobserved; that placeholder is not a background launch.\n\treturn observation?.kind === \"background\" && observation.reason !== \"not-observed\";\n}\n\n/** A view subscription owns neither the owner nor its executions. */\nexport class OwnerTaskStore {\n\tprivate subscription?: TaskSubscription;\n\tprivate listeners = new Set<() => void>();\n\tprivate records = new Map<TaskId, TaskRecord>();\n\tprivate activity = new Map<TaskId, TaskActivity[]>();\n\tprivate activityCursors = new Map<TaskId, bigint>();\n\tprivate omittedActivity = new Set<TaskId>();\n\tprivate backgroundIds = new Set<TaskId>();\n\treadonly anchors = new Map<TaskId, TaskAnchor>();\n\tprivate current?: OwnerSnapshot;\n\treadonly supervisor: TaskSupervisor;\n\tprivate readonly owner: OwnerLease;\n\tconstructor(supervisor: TaskSupervisor, owner: OwnerLease) {\n\t\tthis.supervisor = supervisor;\n\t\tthis.owner = owner;\n\t}\n\n\tget snapshot(): OwnerSnapshot | undefined {\n\t\treturn this.current;\n\t}\n\tget cursor(): Cursor | undefined {\n\t\treturn this.current?.cursor;\n\t}\n\tget tasks(): TaskRecord[] {\n\t\treturn [...this.records.values()];\n\t}\n\t/** Background membership survives foreground waits and terminal observation cleanup. */\n\tget backgroundTasks(): TaskRecord[] {\n\t\treturn this.tasks.filter(\n\t\t\t(task) => task.wasBackground || isBackground(task.observation) || this.backgroundIds.has(task.ref.taskId),\n\t\t);\n\t}\n\t/** Resolve only within the owner that authorized this store. */\n\tresolveTask(id: TaskId): Result<TaskLease, WaitError> {\n\t\treturn this.supervisor.lookupTask(this.owner, id);\n\t}\n\trecentActivity(id: TaskId): TaskActivity[] {\n\t\treturn [...(this.activity.get(id) ?? [])];\n\t}\n\tactivityOmitted(id: TaskId): boolean {\n\t\treturn this.omittedActivity.has(id);\n\t}\n\tsubscribe(listener: () => void): () => void {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tconnect(): Result<void, WatchError> {\n\t\tthis.dispose();\n\t\tconst watched = this.supervisor.watchOwnerTasks(this.owner, this.cursor);\n\t\tif (!watched.ok) return watched;\n\t\tconst subscription = watched.value;\n\t\tthis.subscription = subscription;\n\t\tthis.reconcile(subscription.snapshot);\n\t\tsubscription.onReconcile = (snapshot) => this.reconcile(snapshot);\n\t\tvoid this.observe(subscription);\n\t\treturn { ok: true, value: undefined };\n\t}\n\t/** Useful at explicit host barriers; no transcript repaint timer is installed. */\n\tdrain(): void {\n\t\tthis.subscription?.drain();\n\t}\n\tdispose(): void {\n\t\tthis.subscription?.dispose();\n\t\tthis.subscription = undefined;\n\t}\n\tprivate reconcile(snapshot: OwnerSnapshot): void {\n\t\tif (\n\t\t\tthis.current &&\n\t\t\t(snapshot.ownerId !== this.current.ownerId || snapshot.generation !== this.current.generation)\n\t\t)\n\t\t\tthrow new Error(\"StaleGeneration: cannot replace a task owner projection\");\n\t\tif (this.current && BigInt(snapshot.cursor.sequence) <= BigInt(this.current.cursor.sequence)) return;\n\t\tthis.current = snapshot;\n\t\tfor (const task of snapshot.tasks) {\n\t\t\tconst previous = this.records.get(task.ref.taskId);\n\t\t\tif (isBackground(task.observation) || isBackground(previous?.observation))\n\t\t\t\tthis.backgroundIds.add(task.ref.taskId);\n\t\t\t// Native settlement is immutable, even when recovering a view from a snapshot.\n\t\t\tthis.records.set(\n\t\t\t\ttask.ref.taskId,\n\t\t\t\tprevious?.execution.kind === \"settled\" ? { ...task, execution: previous.execution } : task,\n\t\t\t);\n\t\t\tif (!this.anchors.has(task.ref.taskId))\n\t\t\t\tthis.anchors.set(task.ref.taskId, {\n\t\t\t\t\ttaskId: task.ref.taskId,\n\t\t\t\t\tactivitySequence: snapshot.cursor.sequence,\n\t\t\t\t\tcellOffset: 0,\n\t\t\t\t\tfollowBottom: true,\n\t\t\t\t});\n\t\t}\n\t\tthis.notify();\n\t}\n\tprivate async observe(subscription: TaskSubscription): Promise<void> {\n\t\t// Journal overflow ends the old iterator after publishing a reset snapshot.\n\t\twhile (this.subscription === subscription && this.current?.state !== \"closed\") {\n\t\t\tfor await (const event of subscription.events) {\n\t\t\t\tif (this.subscription !== subscription) return;\n\t\t\t\tthis.retainActivity(event);\n\t\t\t}\n\t\t\tif (this.subscription !== subscription || this.snapshot?.state === \"closed\") return;\n\t\t\tawait new Promise<void>((resolve) => setImmediate(resolve));\n\t\t}\n\t}\n\tprivate retainActivity(event: NativeEvent): void {\n\t\tif (event.payload.kind === \"host-observation-changed\" && isBackground(event.payload.observation)) {\n\t\t\tthis.backgroundIds.add(event.payload.ref.taskId);\n\t\t\tthis.notify();\n\t\t}\n\t\tif (event.payload.kind !== \"task-activity\") return;\n\t\tconst id = event.payload.ref.taskId;\n\t\tconst sequence = BigInt(event.cursor.sequence);\n\t\tif (sequence <= (this.activityCursors.get(id) ?? -1n)) return;\n\t\tthis.activityCursors.set(id, sequence);\n\t\tconst entries = this.activity.get(id) ?? [];\n\t\tentries.push({ cursor: event.cursor, report: event.payload.activity });\n\t\twhile (entries.length > TASK_ACTIVITY_LIMIT || Buffer.byteLength(JSON.stringify(entries)) > TASK_ACTIVITY_BYTES) {\n\t\t\tentries.shift();\n\t\t\tthis.omittedActivity.add(id);\n\t\t}\n\t\tthis.activity.set(id, entries);\n\t\tthis.notify();\n\t}\n\tprivate notify(): void {\n\t\tfor (const listener of this.listeners) listener();\n\t}\n}\n\n// Host adapters bind their existing session object, never a model-provided owner id.\nconst sessionStores = new WeakMap<object, OwnerTaskStore>();\nconst bindingListeners = new WeakMap<object, Set<() => void>>();\nexport function bindOwnerTaskStore(session: object, store: OwnerTaskStore): void {\n\tsessionStores.set(session, store);\n\tfor (const listener of bindingListeners.get(session) ?? []) listener();\n}\nexport function getOwnerTaskStore(session: object): OwnerTaskStore | undefined {\n\treturn sessionStores.get(session);\n}\n\n/** Observe lazy producer binding without waiting for another tool/session event. */\nexport function watchOwnerTaskStoreBinding(session: object, listener: () => void): () => void {\n\tlet listeners = bindingListeners.get(session);\n\tif (!listeners) {\n\t\tlisteners = new Set();\n\t\tbindingListeners.set(session, listeners);\n\t}\n\tlisteners.add(listener);\n\treturn () => {\n\t\tlisteners.delete(listener);\n\t};\n}\n"]}
1
+ {"version":3,"file":"owner-store.js","sourceRoot":"","sources":["../../../src/core/tasks/owner-store.ts"],"names":[],"mappings":"AAaA,oFAAoF;AACpF,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AASxC,SAAS,YAAY,CAAC,WAAkD;IACvE,4EAA4E;IAC5E,OAAO,WAAW,EAAE,IAAI,KAAK,YAAY,IAAI,WAAW,CAAC,MAAM,KAAK,cAAc,CAAC;AACpF,CAAC;AAED,qEAAqE;AACrE,MAAM,OAAO,cAAc;IAa1B,YAAY,UAA0B,EAAE,KAAiB;QAXjD,cAAS,GAAG,IAAI,GAAG,EAAc,CAAC;QAClC,YAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;QACxC,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;QAC7C,oBAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC5C,oBAAe,GAAG,IAAI,GAAG,EAAU,CAAC;QACpC,kBAAa,GAAG,IAAI,GAAG,EAAU,CAAC;QAClC,gBAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;QACvC,YAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;QAKhD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,QAAQ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OAAO,EAA2B,CAAC;AAChE,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,KAAqB;IACxE,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAClC,KAAK,MAAM,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,CAAC;AACxE,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAChD,OAAO,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,0BAA0B,CAAC,OAAe,EAAE,QAAoB;IAC/E,IAAI,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,gBAAgB,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;IACD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,OAAO,GAAG,EAAE;QACX,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tActivityReport,\n\tCursor,\n\tNativeEvent,\n\tOwnerSnapshot,\n\tResult,\n\tTaskId,\n\tTaskRecord,\n\tWaitError,\n\tWatchError,\n} from \"./contracts.js\";\nimport type { OwnerLease, TaskLease, TaskSubscription, TaskSupervisor } from \"./supervisor.js\";\n\n/** Activity previews are bounded independently of authoritative session history. */\nexport const TASK_ACTIVITY_LIMIT = 64;\nexport const TASK_ACTIVITY_BYTES = 8192;\nexport type TaskAnchor = {\n\ttaskId: TaskId;\n\tactivitySequence: Cursor[\"sequence\"];\n\tcellOffset: number;\n\tfollowBottom: boolean;\n};\nexport type TaskActivity = { cursor: Cursor; report: ActivityReport };\n\nfunction isBackground(observation: TaskRecord[\"observation\"] | undefined): boolean {\n\t// Admission starts unobserved; that placeholder is not a background launch.\n\treturn observation?.kind === \"background\" && observation.reason !== \"not-observed\";\n}\n\n/** A view subscription owns neither the owner nor its executions. */\nexport class OwnerTaskStore {\n\tprivate subscription?: TaskSubscription;\n\tprivate listeners = new Set<() => void>();\n\tprivate records = new Map<TaskId, TaskRecord>();\n\tprivate activity = new Map<TaskId, TaskActivity[]>();\n\tprivate activityCursors = new Map<TaskId, bigint>();\n\tprivate omittedActivity = new Set<TaskId>();\n\tprivate backgroundIds = new Set<TaskId>();\n\tprivate settlements = new Map<TaskId, bigint>();\n\treadonly anchors = new Map<TaskId, TaskAnchor>();\n\tprivate current?: OwnerSnapshot;\n\treadonly supervisor: TaskSupervisor;\n\tprivate readonly owner: OwnerLease;\n\tconstructor(supervisor: TaskSupervisor, owner: OwnerLease) {\n\t\tthis.supervisor = supervisor;\n\t\tthis.owner = owner;\n\t}\n\n\tget snapshot(): OwnerSnapshot | undefined {\n\t\treturn this.current;\n\t}\n\tget cursor(): Cursor | undefined {\n\t\treturn this.current?.cursor;\n\t}\n\tget tasks(): TaskRecord[] {\n\t\treturn [...this.records.values()];\n\t}\n\t/** Background membership survives foreground waits and terminal observation cleanup. */\n\tget backgroundTasks(): TaskRecord[] {\n\t\treturn this.tasks.filter(\n\t\t\t(task) => task.wasBackground || isBackground(task.observation) || this.backgroundIds.has(task.ref.taskId),\n\t\t);\n\t}\n\t/**\n\t * Journal sequence at which each task settled; higher is more recent. Tasks first seen settled in a\n\t * snapshot without their settlement event share that snapshot's sequence, so their order is unknown.\n\t */\n\tget settlementOrder(): ReadonlyMap<TaskId, bigint> {\n\t\treturn this.settlements;\n\t}\n\t/** Resolve only within the owner that authorized this store. */\n\tresolveTask(id: TaskId): Result<TaskLease, WaitError> {\n\t\treturn this.supervisor.lookupTask(this.owner, id);\n\t}\n\trecentActivity(id: TaskId): TaskActivity[] {\n\t\treturn [...(this.activity.get(id) ?? [])];\n\t}\n\tactivityOmitted(id: TaskId): boolean {\n\t\treturn this.omittedActivity.has(id);\n\t}\n\tsubscribe(listener: () => void): () => void {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tconnect(): Result<void, WatchError> {\n\t\tthis.dispose();\n\t\tconst watched = this.supervisor.watchOwnerTasks(this.owner, this.cursor);\n\t\tif (!watched.ok) return watched;\n\t\tconst subscription = watched.value;\n\t\tthis.subscription = subscription;\n\t\tthis.reconcile(subscription.snapshot, []);\n\t\tsubscription.onReconcile = (snapshot, events) => this.reconcile(snapshot, events);\n\t\tvoid this.observe(subscription);\n\t\treturn { ok: true, value: undefined };\n\t}\n\t/** Useful at explicit host barriers; no transcript repaint timer is installed. */\n\tdrain(): void {\n\t\tthis.subscription?.drain();\n\t}\n\tdispose(): void {\n\t\tthis.subscription?.dispose();\n\t\tthis.subscription = undefined;\n\t}\n\tprivate reconcile(snapshot: OwnerSnapshot, events: readonly NativeEvent[]): void {\n\t\tif (\n\t\t\tthis.current &&\n\t\t\t(snapshot.ownerId !== this.current.ownerId || snapshot.generation !== this.current.generation)\n\t\t)\n\t\t\tthrow new Error(\"StaleGeneration: cannot replace a task owner projection\");\n\t\tif (this.current && BigInt(snapshot.cursor.sequence) <= BigInt(this.current.cursor.sequence)) return;\n\t\tthis.current = snapshot;\n\t\tfor (const event of events)\n\t\t\tif (event.payload.kind === \"task-settled\" && !this.settlements.has(event.payload.ref.taskId))\n\t\t\t\tthis.settlements.set(event.payload.ref.taskId, BigInt(event.cursor.sequence));\n\t\tfor (const task of snapshot.tasks) {\n\t\t\tconst previous = this.records.get(task.ref.taskId);\n\t\t\tif (isBackground(task.observation) || isBackground(previous?.observation))\n\t\t\t\tthis.backgroundIds.add(task.ref.taskId);\n\t\t\t// Native settlement is immutable, even when recovering a view from a snapshot.\n\t\t\tthis.records.set(\n\t\t\t\ttask.ref.taskId,\n\t\t\t\tprevious?.execution.kind === \"settled\" ? { ...task, execution: previous.execution } : task,\n\t\t\t);\n\t\t\tif (task.execution.kind === \"settled\" && !this.settlements.has(task.ref.taskId))\n\t\t\t\tthis.settlements.set(task.ref.taskId, BigInt(snapshot.cursor.sequence));\n\t\t\tif (!this.anchors.has(task.ref.taskId))\n\t\t\t\tthis.anchors.set(task.ref.taskId, {\n\t\t\t\t\ttaskId: task.ref.taskId,\n\t\t\t\t\tactivitySequence: snapshot.cursor.sequence,\n\t\t\t\t\tcellOffset: 0,\n\t\t\t\t\tfollowBottom: true,\n\t\t\t\t});\n\t\t}\n\t\tthis.notify();\n\t}\n\tprivate async observe(subscription: TaskSubscription): Promise<void> {\n\t\t// Journal overflow ends the old iterator after publishing a reset snapshot.\n\t\twhile (this.subscription === subscription && this.current?.state !== \"closed\") {\n\t\t\tfor await (const event of subscription.events) {\n\t\t\t\tif (this.subscription !== subscription) return;\n\t\t\t\tthis.retainActivity(event);\n\t\t\t}\n\t\t\tif (this.subscription !== subscription || this.snapshot?.state === \"closed\") return;\n\t\t\tawait new Promise<void>((resolve) => setImmediate(resolve));\n\t\t}\n\t}\n\tprivate retainActivity(event: NativeEvent): void {\n\t\tif (event.payload.kind === \"host-observation-changed\" && isBackground(event.payload.observation)) {\n\t\t\tthis.backgroundIds.add(event.payload.ref.taskId);\n\t\t\tthis.notify();\n\t\t}\n\t\tif (event.payload.kind !== \"task-activity\") return;\n\t\tconst id = event.payload.ref.taskId;\n\t\tconst sequence = BigInt(event.cursor.sequence);\n\t\tif (sequence <= (this.activityCursors.get(id) ?? -1n)) return;\n\t\tthis.activityCursors.set(id, sequence);\n\t\tconst entries = this.activity.get(id) ?? [];\n\t\tentries.push({ cursor: event.cursor, report: event.payload.activity });\n\t\twhile (entries.length > TASK_ACTIVITY_LIMIT || Buffer.byteLength(JSON.stringify(entries)) > TASK_ACTIVITY_BYTES) {\n\t\t\tentries.shift();\n\t\t\tthis.omittedActivity.add(id);\n\t\t}\n\t\tthis.activity.set(id, entries);\n\t\tthis.notify();\n\t}\n\tprivate notify(): void {\n\t\tfor (const listener of this.listeners) listener();\n\t}\n}\n\n// Host adapters bind their existing session object, never a model-provided owner id.\nconst sessionStores = new WeakMap<object, OwnerTaskStore>();\nconst bindingListeners = new WeakMap<object, Set<() => void>>();\nexport function bindOwnerTaskStore(session: object, store: OwnerTaskStore): void {\n\tsessionStores.set(session, store);\n\tfor (const listener of bindingListeners.get(session) ?? []) listener();\n}\nexport function getOwnerTaskStore(session: object): OwnerTaskStore | undefined {\n\treturn sessionStores.get(session);\n}\n\n/** Observe lazy producer binding without waiting for another tool/session event. */\nexport function watchOwnerTaskStoreBinding(session: object, listener: () => void): () => void {\n\tlet listeners = bindingListeners.get(session);\n\tif (!listeners) {\n\t\tlisteners = new Set();\n\t\tbindingListeners.set(session, listeners);\n\t}\n\tlisteners.add(listener);\n\treturn () => {\n\t\tlisteners.delete(listener);\n\t};\n}\n"]}
@@ -39,7 +39,7 @@ export async function cancelPausedOwnerTasks(host) {
39
39
  resolve();
40
40
  };
41
41
  watch.drain();
42
- watch.onReconcile(watch.snapshot);
42
+ watch.onReconcile(watch.snapshot, []);
43
43
  });
44
44
  }
45
45
  finally {
@@ -1 +1 @@
1
- {"version":3,"file":"pause.js","sourceRoot":"","sources":["../../../src/core/tasks/pause.ts"],"names":[],"mappings":"AAGA,iGAAiG;AACjG,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,IAAmB;IAC/D,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,KAAK,EAAE,KAAmB,EAAiB,EAAE;QAC3D,oFAAoF;QACpF,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CACzB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC,CACvF,CAAC;QACF,MAAM,OAAO,GAA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,CACD,CAAC;;oBACE,OAAO,EAAE,CAAC;YAChB,CAAC,CAAC;YACF,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACJ,CAAC;YAAS,CAAC;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;AACF,CAAC","sourcesContent":["import type { AgentTaskHost } from \"./agent-adapter.js\";\nimport type { OwnerSnapshot, TaskRecord } from \"./contracts.js\";\n\n/** The caller synchronously blocks new launches; this never closes the owner or its messages. */\nexport async function cancelPausedOwnerTasks(host: AgentTaskHost): Promise<void> {\n\tconst errors: Error[] = [];\n\tconst cancel = async (tasks: TaskRecord[]): Promise<void> => {\n\t\t// Cancel every queued agent before an active cancellation can free a dispatch slot.\n\t\tconst ordered = tasks.sort(\n\t\t\t(a, b) => Number(b.execution.kind === \"queued\") - Number(a.execution.kind === \"queued\"),\n\t\t);\n\t\tconst results = await Promise.allSettled(ordered.map((task) => host.cancelTask(task.ref.taskId, \"user\")));\n\t\tfor (const result of results) {\n\t\t\tif (result.status === \"rejected\") errors.push(new Error(String(result.reason)));\n\t\t\telse if (!result.value.ok) errors.push(new Error(`${result.value.error.code}: ${result.value.error.message}`));\n\t\t}\n\t};\n\tconst watched = host.watchOwnerTasks();\n\tif (!watched.ok) throw new Error(`${watched.error.code}: ${watched.error.message}`);\n\tconst watch = watched.value;\n\ttry {\n\t\tawait cancel(watch.snapshot.tasks.filter((task) => task.kind === \"agent\" && task.execution.kind !== \"settled\"));\n\t\tconst { supervisor, owner } = host.ownerBinding;\n\t\t// Already-started native setup may briefly launch during the transition. Wait for\n\t\t// every admitted lease before cancelling shells and certifying the final snapshot.\n\t\tawait supervisor.drainCommandAdmissions(owner);\n\t\twatch.drain();\n\t\tawait cancel(watch.snapshot.tasks.filter((task) => task.kind === \"command\" && task.execution.kind !== \"settled\"));\n\t\tif (errors.length) throw new AggregateError(errors, \"Workflow stage task cancellation failed\");\n\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\twatch.onReconcile = (snapshot: OwnerSnapshot) => {\n\t\t\t\tif (\n\t\t\t\t\tsnapshot.tasks.some(\n\t\t\t\t\t\t(task) =>\n\t\t\t\t\t\t\ttask.cleanup.kind === \"active\" ||\n\t\t\t\t\t\t\ttask.cleanup.kind === \"draining\" ||\n\t\t\t\t\t\t\t(task.execution.kind !== \"settled\" && task.cleanup.kind !== \"failed\"),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\tconst failures = snapshot.tasks.flatMap((task) =>\n\t\t\t\t\ttask.cleanup.kind === \"failed\" ? task.cleanup.resources : [],\n\t\t\t\t);\n\t\t\t\tif (failures.length)\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Workflow stage task cleanup failed: ${failures.map((failure) => `${failure.resource}: ${failure.message}`).join(\"; \")}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\telse resolve();\n\t\t\t};\n\t\t\twatch.drain();\n\t\t\twatch.onReconcile(watch.snapshot);\n\t\t});\n\t} finally {\n\t\twatch.dispose();\n\t}\n}\n"]}
1
+ {"version":3,"file":"pause.js","sourceRoot":"","sources":["../../../src/core/tasks/pause.ts"],"names":[],"mappings":"AAGA,iGAAiG;AACjG,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,IAAmB;IAC/D,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,KAAK,EAAE,KAAmB,EAAiB,EAAE;QAC3D,oFAAoF;QACpF,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CACzB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC,C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I,CAAC,IAAI,CAAC,EAAE,CACxH,CACD,CAAC;;oBACE,OAAO,EAAE,CAAC;YAChB,CAAC,CAAC;YACF,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACJ,CAAC;YAAS,CAAC;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;AACF,CAAC","sourcesContent":["import type { AgentTaskHost } from \"./agent-adapter.js\";\nimport type { OwnerSnapshot, TaskRecord } from \"./contracts.js\";\n\n/** The caller synchronously blocks new launches; this never closes the owner or its messages. */\nexport async function cancelPausedOwnerTasks(host: AgentTaskHost): Promise<void> {\n\tconst errors: Error[] = [];\n\tconst cancel = async (tasks: TaskRecord[]): Promise<void> => {\n\t\t// Cancel every queued agent before an active cancellation can free a dispatch slot.\n\t\tconst ordered = tasks.sort(\n\t\t\t(a, b) => Number(b.execution.kind === \"queued\") - Number(a.execution.kind === \"queued\"),\n\t\t);\n\t\tconst results = await Promise.allSettled(ordered.map((task) => host.cancelTask(task.ref.taskId, \"user\")));\n\t\tfor (const result of results) {\n\t\t\tif (result.status === \"rejected\") errors.push(new Error(String(result.reason)));\n\t\t\telse if (!result.value.ok) errors.push(new Error(`${result.value.error.code}: ${result.value.error.message}`));\n\t\t}\n\t};\n\tconst watched = host.watchOwnerTasks();\n\tif (!watched.ok) throw new Error(`${watched.error.code}: ${watched.error.message}`);\n\tconst watch = watched.value;\n\ttry {\n\t\tawait cancel(watch.snapshot.tasks.filter((task) => task.kind === \"agent\" && task.execution.kind !== \"settled\"));\n\t\tconst { supervisor, owner } = host.ownerBinding;\n\t\t// Already-started native setup may briefly launch during the transition. Wait for\n\t\t// every admitted lease before cancelling shells and certifying the final snapshot.\n\t\tawait supervisor.drainCommandAdmissions(owner);\n\t\twatch.drain();\n\t\tawait cancel(watch.snapshot.tasks.filter((task) => task.kind === \"command\" && task.execution.kind !== \"settled\"));\n\t\tif (errors.length) throw new AggregateError(errors, \"Workflow stage task cancellation failed\");\n\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\twatch.onReconcile = (snapshot: OwnerSnapshot) => {\n\t\t\t\tif (\n\t\t\t\t\tsnapshot.tasks.some(\n\t\t\t\t\t\t(task) =>\n\t\t\t\t\t\t\ttask.cleanup.kind === \"active\" ||\n\t\t\t\t\t\t\ttask.cleanup.kind === \"draining\" ||\n\t\t\t\t\t\t\t(task.execution.kind !== \"settled\" && task.cleanup.kind !== \"failed\"),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\tconst failures = snapshot.tasks.flatMap((task) =>\n\t\t\t\t\ttask.cleanup.kind === \"failed\" ? task.cleanup.resources : [],\n\t\t\t\t);\n\t\t\t\tif (failures.length)\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Workflow stage task cleanup failed: ${failures.map((failure) => `${failure.resource}: ${failure.message}`).join(\"; \")}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\telse resolve();\n\t\t\t};\n\t\t\twatch.drain();\n\t\t\twatch.onReconcile(watch.snapshot, []);\n\t\t});\n\t} finally {\n\t\twatch.dispose();\n\t}\n}\n"]}
@@ -69,10 +69,12 @@ export declare function taskTranscriptSource(task: TaskLease): C.Result<{
69
69
  session: TaskTranscriptSource;
70
70
  taskId: C.TaskId;
71
71
  }, C.Failure<"UnknownTask" | "TranscriptUnavailable">>;
72
+ /** History the runner produced; a forked child's inherited parent entries are excluded. */
73
+ export declare function taskOwnTranscriptEntries(task: TaskLease): ReturnType<TaskTranscriptSource["getEntries"]> | undefined;
72
74
  export declare class TaskSubscription {
73
75
  #private;
74
- /** Reconciliation supplements the RFC snapshot/cursor/iterable contract. */
75
- onReconcile: (snapshot: C.OwnerSnapshot) => void;
76
+ /** Reconciliation supplements the RFC snapshot/cursor/iterable contract with the events it applied. */
77
+ onReconcile: (snapshot: C.OwnerSnapshot, events: readonly C.NativeEvent[]) => void;
76
78
  readonly events: AsyncIterable<C.NativeEvent>;
77
79
  readonly lease: SubscriptionLease;
78
80
  constructor(actor: native.TaskSupervisor, initial: native.NativeTaskSubscription, onDispose: () => void);
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../../src/core/tasks/supervisor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEzC,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,YAAY,CAAC,GAAG;IACxF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACjD,6EAA6E;IAC7E,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACrE,mBAAmB,CAAC,IAAI,YAAY,GAAG,SAAS,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAClD,qFAAqF;AACrF,cAAM,UAAU;;IAEf,MAAM,IAAI,KAAK,CAEd;CACD;AACD,cAAM,cAAe,SAAQ,UAAU;IACtC,QAAQ,CAAC,IAAI,UAAU;CACvB;AACD,cAAM,eAAgB,SAAQ,UAAU;IACvC,QAAQ,CAAC,IAAI,WAAW;CACxB;AACD,cAAM,cAAe,SAAQ,UAAU;IACtC,QAAQ,CAAC,IAAI,UAAU;CACvB;AACD,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AS,EACf,MAAM,CAAC,EAAE,CAAC,CAAC,UAAU,EACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GACtC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAmB/C;IACK,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAQzG;IACK,cAAc,CACnB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,CAAC,CAAC,eAAe,GACtB,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAyBtD;IACD;;;;;;OAMG;IACH,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,UAAU,CAAC,CAc5F;CA2CD"}
@@ -64,6 +64,11 @@ export function taskTranscriptSource(task) {
64
64
  return { ok: false, error: { code: "TranscriptUnavailable", message: "Transcript unavailable" } };
65
65
  return { ok: true, value: { session: state.transcript, taskId: state.ref.taskId } };
66
66
  }
67
+ /** History the runner produced; a forked child's inherited parent entries are excluded. */
68
+ export function taskOwnTranscriptEntries(task) {
69
+ const state = environment.tasks.get(task);
70
+ return state?.transcript?.getEntries().slice(state.inheritedEntryCount ?? 0);
71
+ }
67
72
  /** Promise rejections, setup throws and consumer exceptions may be arbitrary JavaScript values. */
68
73
  function rejectionMessage(reason) {
69
74
  try {
@@ -164,9 +169,13 @@ function observation(value) {
164
169
  return { kind: value.kind, reason };
165
170
  throw new Error("Invalid native host observation");
166
171
  }
172
+ // Native records own lifecycle and mutable execution metadata. Routing provenance is
173
+ // immutable host metadata, retained for the same environment lifetime as task records.
174
+ const routerSelections = new Map();
167
175
  function record(value) {
168
176
  if (value.kind !== "agent" && value.kind !== "command")
169
177
  throw new Error(`Invalid native task kind: ${value.kind}`);
178
+ const routerSelection = routerSelections.get(value.ref.taskId);
170
179
  return {
171
180
  ref: reference(value.ref),
172
181
  launchOperationId: value.launchOperationId,
@@ -178,6 +187,7 @@ function record(value) {
178
187
  ...(value.agentName === undefined ? {} : { agentName: value.agentName }),
179
188
  ...(value.model === undefined ? {} : { model: value.model }),
180
189
  ...(value.thinking === undefined ? {} : { thinking: value.thinking }),
190
+ ...(routerSelection ? { routerSelection } : {}),
181
191
  execution: execution(value.execution),
182
192
  observation: observation(value.observation),
183
193
  ...(value.wasBackground === undefined ? {} : { wasBackground: value.wasBackground }),
@@ -387,7 +397,7 @@ export class TaskSubscription {
387
397
  this.#queue = [];
388
398
  this.#epoch = 0;
389
399
  this.#disposed = false;
390
- /** Reconciliation supplements the RFC snapshot/cursor/iterable contract. */
400
+ /** Reconciliation supplements the RFC snapshot/cursor/iterable contract with the events it applied. */
391
401
  this.onReconcile = () => { };
392
402
  this.lease = new SubscriptionCapability();
393
403
  Object.freeze(this.lease);
@@ -477,7 +487,7 @@ export class TaskSubscription {
477
487
  }
478
488
  if (drained.value.snapshot || events.length) {
479
489
  try {
480
- this.#resource.runInAsyncScope(this.onReconcile, undefined, this.#snapshot);
490
+ this.#resource.runInAsyncScope(this.onReconcile, undefined, this.#snapshot, events);
481
491
  }
482
492
  catch (error) {
483
493
  this.#failure = new Error(rejectionMessage(error));
@@ -599,7 +609,7 @@ export class TaskSupervisor {
599
609
  if (failure)
600
610
  throw failure;
601
611
  };
602
- watched.value.onReconcile(watched.value.snapshot);
612
+ watched.value.onReconcile(watched.value.snapshot, []);
603
613
  return owner;
604
614
  }, ownerErrors);
605
615
  }
@@ -694,6 +704,8 @@ export class TaskSupervisor {
694
704
  const existing = state.tasks.get(id);
695
705
  if (existing)
696
706
  return { ok: true, value: existing };
707
+ if (intent.routerSelection)
708
+ routerSelections.set(id, Object.freeze({ ...intent.routerSelection }));
697
709
  const task = new TaskCapability();
698
710
  Object.freeze(task);
699
711
  const taskState = {
@@ -716,6 +728,7 @@ export class TaskSupervisor {
716
728
  ref: reference(taskState.ref),
717
729
  signal: taskState.controller.signal,
718
730
  bindTranscript: (session) => {
731
+ taskState.inheritedEntryCount ??= session.getEntries().length;
719
732
  taskState.transcript = session;
720
733
  },
721
734
  reportActivity: (report) => mapped(this.#native.reportTaskActivity(runner.value, report), reportReceipt, reportErrors),