@bastani/atomic 0.9.11-alpha.4 → 0.9.11-alpha.6

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 (1032) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +12 -5
  3. package/dist/builtin/intercom/package.json +2 -2
  4. package/dist/builtin/mcp/CHANGELOG.md +6 -0
  5. package/dist/builtin/mcp/README.md +3 -3
  6. package/dist/builtin/mcp/cli.js +0 -1
  7. package/dist/builtin/mcp/config.ts +0 -2
  8. package/dist/builtin/mcp/package.json +3 -3
  9. package/dist/builtin/mcp/types.ts +0 -1
  10. package/dist/builtin/subagents/CHANGELOG.md +19 -0
  11. package/dist/builtin/subagents/README.md +10 -1
  12. package/dist/builtin/subagents/agents/code-simplifier.md +47 -102
  13. package/dist/builtin/subagents/agents/codebase-analyzer.md +27 -130
  14. package/dist/builtin/subagents/agents/codebase-locator.md +24 -83
  15. package/dist/builtin/subagents/agents/codebase-online-researcher.md +60 -259
  16. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +29 -207
  17. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +28 -150
  18. package/dist/builtin/subagents/agents/codebase-research-locator.md +21 -118
  19. package/dist/builtin/subagents/agents/debugger.md +29 -65
  20. package/dist/builtin/subagents/agents/worker.md +23 -30
  21. package/dist/builtin/subagents/package.json +4 -4
  22. package/dist/builtin/subagents/prompts/gather-context-and-clarify.md +18 -11
  23. package/dist/builtin/subagents/prompts/parallel-cleanup.md +34 -33
  24. package/dist/builtin/subagents/prompts/parallel-context-build.md +22 -36
  25. package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +20 -52
  26. package/dist/builtin/subagents/prompts/parallel-research.md +17 -41
  27. package/dist/builtin/subagents/prompts/parallel-review.md +23 -28
  28. package/dist/builtin/subagents/prompts/review-loop.md +18 -27
  29. package/dist/builtin/subagents/skills/subagent/SKILL.md +6 -6
  30. package/dist/builtin/subagents/src/extension/prompt-guidance.ts +4 -1
  31. package/dist/builtin/subagents/src/runs/background/async-execution-chain.ts +23 -4
  32. package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +2 -0
  33. package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +10 -0
  34. package/dist/builtin/subagents/src/runs/background/subagent-runner-step.ts +1 -0
  35. package/dist/builtin/subagents/src/runs/foreground/chain-execution-dynamic-step.ts +2 -0
  36. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +8 -0
  37. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +1 -0
  38. package/dist/builtin/subagents/src/runs/foreground/chain-execution-sequential-step.ts +6 -0
  39. package/dist/builtin/subagents/src/runs/foreground/chain-execution-types.ts +2 -0
  40. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +7 -0
  41. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-chain.ts +1 -0
  42. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +3 -0
  43. package/dist/builtin/subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +1 -2
  44. package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +1 -0
  45. package/dist/builtin/subagents/src/runs/shared/pi-args.ts +5 -3
  46. package/dist/builtin/subagents/src/shared/settings.ts +4 -0
  47. package/dist/builtin/web-access/package.json +2 -2
  48. package/dist/builtin/workflows/CHANGELOG.md +53 -0
  49. package/dist/builtin/workflows/README.md +72 -70
  50. package/dist/builtin/workflows/ambient.d.ts +0 -5
  51. package/dist/builtin/workflows/builtin/adversarial-verification-prompts.ts +7 -4
  52. package/dist/builtin/workflows/builtin/adversarial-verification-runner.ts +1 -1
  53. package/dist/builtin/workflows/builtin/adversarial-verification.ts +2 -1
  54. package/dist/builtin/workflows/builtin/classify-and-act-prompts.ts +5 -2
  55. package/dist/builtin/workflows/builtin/classify-and-act-runner.ts +5 -7
  56. package/dist/builtin/workflows/builtin/classify-and-act.ts +3 -2
  57. package/dist/builtin/workflows/builtin/fan-out-and-synthesize-prompts.ts +6 -3
  58. package/dist/builtin/workflows/builtin/fan-out-and-synthesize-runner.ts +5 -5
  59. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.ts +3 -2
  60. package/dist/builtin/workflows/builtin/generate-and-filter-prompts.ts +7 -4
  61. package/dist/builtin/workflows/builtin/generate-and-filter-runner.ts +6 -3
  62. package/dist/builtin/workflows/builtin/generate-and-filter.ts +3 -2
  63. package/dist/builtin/workflows/builtin/goal-artifacts.ts +1 -1
  64. package/dist/builtin/workflows/builtin/goal-models.ts +39 -39
  65. package/dist/builtin/workflows/builtin/goal-orchestrator-prompts.ts +94 -0
  66. package/dist/builtin/workflows/builtin/goal-prompts.ts +66 -286
  67. package/dist/builtin/workflows/builtin/goal-reducer.ts +1 -1
  68. package/dist/builtin/workflows/builtin/goal-runner.ts +72 -116
  69. package/dist/builtin/workflows/builtin/goal.ts +9 -8
  70. package/dist/builtin/workflows/builtin/index.d.ts +17 -112
  71. package/dist/builtin/workflows/builtin/index.ts +1 -2
  72. package/dist/builtin/workflows/builtin/loop-until-done-prompts.ts +20 -12
  73. package/dist/builtin/workflows/builtin/loop-until-done-runner.ts +3 -0
  74. package/dist/builtin/workflows/builtin/loop-until-done.ts +3 -2
  75. package/dist/builtin/workflows/builtin/open-claude-design-phases.ts +52 -55
  76. package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +45 -52
  77. package/dist/builtin/workflows/builtin/open-claude-design-setup.ts +41 -46
  78. package/dist/builtin/workflows/builtin/open-claude-design-utils.ts +16 -21
  79. package/dist/builtin/workflows/builtin/open-claude-design.ts +2 -1
  80. package/dist/builtin/workflows/builtin/ralph-core.ts +61 -57
  81. package/dist/builtin/workflows/builtin/ralph-forked-prompts.ts +41 -45
  82. package/dist/builtin/workflows/builtin/ralph-models.ts +33 -43
  83. package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +35 -117
  84. package/dist/builtin/workflows/builtin/ralph-runner.ts +81 -108
  85. package/dist/builtin/workflows/builtin/ralph.ts +2 -1
  86. package/dist/builtin/workflows/builtin/shared-prompts.ts +111 -80
  87. package/dist/builtin/workflows/builtin/steering-context.ts +51 -0
  88. package/dist/builtin/workflows/builtin/tournament-prompts.ts +21 -12
  89. package/dist/builtin/workflows/builtin/tournament-runner.ts +3 -0
  90. package/dist/builtin/workflows/builtin/tournament.ts +3 -2
  91. package/dist/builtin/workflows/package.json +2 -2
  92. package/dist/builtin/workflows/skills/create-spec/SKILL.md +1 -1
  93. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +6 -8
  94. package/dist/builtin/workflows/skills/impeccable/reference/live.md +3 -4
  95. package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +2 -20
  96. package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +4 -42
  97. package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +3 -3
  98. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +2 -3
  99. package/dist/builtin/workflows/skills/impeccable/scripts/live-inject.mjs +0 -1
  100. package/dist/builtin/workflows/skills/impeccable/scripts/live-poll.mjs +2 -2
  101. package/dist/builtin/workflows/skills/impeccable/scripts/pin.mjs +4 -4
  102. package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +57 -252
  103. package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +70 -226
  104. package/dist/builtin/workflows/skills/prompt-engineer/references/core_prompting.md +64 -103
  105. package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +81 -155
  106. package/dist/builtin/workflows/src/authoring.d.ts +5 -1
  107. package/dist/builtin/workflows/src/durable/backend.ts +68 -9
  108. package/dist/builtin/workflows/src/durable/boundary-lifecycle.ts +148 -0
  109. package/dist/builtin/workflows/src/durable/boundary-topology.ts +420 -0
  110. package/dist/builtin/workflows/src/durable/child-invocation.ts +14 -0
  111. package/dist/builtin/workflows/src/durable/child-primitive.ts +74 -44
  112. package/dist/builtin/workflows/src/durable/completed-catalog-stage-groups.ts +250 -0
  113. package/dist/builtin/workflows/src/durable/completed-catalog.ts +205 -131
  114. package/dist/builtin/workflows/src/durable/completed-inspection.ts +8 -2
  115. package/dist/builtin/workflows/src/durable/completed-subtree.ts +31 -0
  116. package/dist/builtin/workflows/src/durable/dbos-backend.ts +28 -24
  117. package/dist/builtin/workflows/src/durable/dbos-envelope.ts +130 -3
  118. package/dist/builtin/workflows/src/durable/dbos-metadata.ts +18 -0
  119. package/dist/builtin/workflows/src/durable/scoped-backend.ts +64 -17
  120. package/dist/builtin/workflows/src/durable/stage-primitive.ts +60 -60
  121. package/dist/builtin/workflows/src/durable/stage-topology-validation.ts +234 -0
  122. package/dist/builtin/workflows/src/durable/stage-topology.ts +53 -0
  123. package/dist/builtin/workflows/src/durable/tool-failure-checkpoint.ts +49 -0
  124. package/dist/builtin/workflows/src/durable/tool-outcome.ts +120 -0
  125. package/dist/builtin/workflows/src/durable/tool-primitive.ts +367 -58
  126. package/dist/builtin/workflows/src/durable/types.ts +97 -0
  127. package/dist/builtin/workflows/src/durable/ui-primitive.ts +46 -0
  128. package/dist/builtin/workflows/src/durable/workflow-child-result.ts +58 -0
  129. package/dist/builtin/workflows/src/engine/options.ts +1 -0
  130. package/dist/builtin/workflows/src/engine/primitives/workflow.ts +19 -10
  131. package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +11 -1
  132. package/dist/builtin/workflows/src/engine/run-durable-topology.ts +190 -18
  133. package/dist/builtin/workflows/src/engine/run-terminal-event.ts +37 -0
  134. package/dist/builtin/workflows/src/engine/run-terminal-failure.ts +50 -0
  135. package/dist/builtin/workflows/src/engine/run-tool-execution-tracker.ts +152 -0
  136. package/dist/builtin/workflows/src/engine/run-tool-node-lifecycle.ts +87 -0
  137. package/dist/builtin/workflows/src/engine/run.ts +111 -110
  138. package/dist/builtin/workflows/src/engine/runtime.ts +15 -2
  139. package/dist/builtin/workflows/src/extension/extension-factory.ts +1 -0
  140. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +11 -0
  141. package/dist/builtin/workflows/src/extension/index.bundle.mjs +6599 -4776
  142. package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +16 -5
  143. package/dist/builtin/workflows/src/extension/render-result.ts +16 -2
  144. package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +3 -0
  145. package/dist/builtin/workflows/src/extension/runtime.ts +4 -0
  146. package/dist/builtin/workflows/src/extension/wiring.ts +3 -1
  147. package/dist/builtin/workflows/src/extension/workflow-command-surfaces.ts +1 -0
  148. package/dist/builtin/workflows/src/extension/workflow-durable-resume-command.ts +9 -3
  149. package/dist/builtin/workflows/src/extension/workflow-module-loader.ts +18 -3
  150. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +27 -9
  151. package/dist/builtin/workflows/src/extension/workflow-status-summary.ts +43 -0
  152. package/dist/builtin/workflows/src/extension/workflow-targets.ts +34 -30
  153. package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +12 -5
  154. package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +162 -63
  155. package/dist/builtin/workflows/src/runs/background/run-inspect.ts +7 -1
  156. package/dist/builtin/workflows/src/runs/background/status.ts +18 -8
  157. package/dist/builtin/workflows/src/runs/background/workflow-lifecycle-aggregate.ts +3 -11
  158. package/dist/builtin/workflows/src/runs/foreground/executor-child-boundary.ts +24 -21
  159. package/dist/builtin/workflows/src/runs/foreground/executor-hil.ts +1 -1
  160. package/dist/builtin/workflows/src/runs/foreground/executor-lifecycle.ts +30 -13
  161. package/dist/builtin/workflows/src/runs/foreground/executor-prompt-nodes.ts +102 -53
  162. package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +13 -5
  163. package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +26 -8
  164. package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +11 -4
  165. package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +4 -1
  166. package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +7 -1
  167. package/dist/builtin/workflows/src/runs/foreground/postmortem-stage-chat.ts +35 -1
  168. package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +136 -17
  169. package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +12 -4
  170. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +35 -42
  171. package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +5 -1
  172. package/dist/builtin/workflows/src/runs/foreground/stage-runner-pause.ts +195 -0
  173. package/dist/builtin/workflows/src/runs/foreground/stage-runner-session-options.ts +0 -13
  174. package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +14 -2
  175. package/dist/builtin/workflows/src/runs/shared/model-fallback-candidates.ts +3 -143
  176. package/dist/builtin/workflows/src/sdk-surface.ts +1 -1
  177. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +6 -11
  178. package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +6 -11
  179. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +57 -6
  180. package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +76 -11
  181. package/dist/builtin/workflows/src/shared/expanded-workflow-graph.ts +206 -116
  182. package/dist/builtin/workflows/src/shared/intercom-group.ts +17 -10
  183. package/dist/builtin/workflows/src/shared/persistence-restore-helpers.ts +30 -0
  184. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +5 -0
  185. package/dist/builtin/workflows/src/shared/render-inputs-schema.ts +3 -3
  186. package/dist/builtin/workflows/src/shared/store-factory.ts +2 -0
  187. package/dist/builtin/workflows/src/shared/store-internal.ts +8 -0
  188. package/dist/builtin/workflows/src/shared/store-public-types.ts +8 -0
  189. package/dist/builtin/workflows/src/shared/store-run-methods.ts +9 -0
  190. package/dist/builtin/workflows/src/shared/store-stage-methods.ts +2 -0
  191. package/dist/builtin/workflows/src/shared/store-tool-node-methods.ts +46 -0
  192. package/dist/builtin/workflows/src/shared/store-types.ts +34 -0
  193. package/dist/builtin/workflows/src/shared/types.ts +14 -24
  194. package/dist/builtin/workflows/src/shared/workflow-failures-classifier.ts +11 -5
  195. package/dist/builtin/workflows/src/shared/workflow-failures-signals.ts +58 -0
  196. package/dist/builtin/workflows/src/shared/workflow-run-ownership.ts +53 -0
  197. package/dist/builtin/workflows/src/tui/graph-view-input.ts +2 -8
  198. package/dist/builtin/workflows/src/tui/graph-view-render-helpers.ts +11 -4
  199. package/dist/builtin/workflows/src/tui/graph-view-render.ts +1 -0
  200. package/dist/builtin/workflows/src/tui/graph-view-state.ts +27 -9
  201. package/dist/builtin/workflows/src/tui/graph-view-types.ts +4 -3
  202. package/dist/builtin/workflows/src/tui/node-card.ts +4 -3
  203. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +0 -4
  204. package/dist/builtin/workflows/src/tui/run-detail.ts +53 -17
  205. package/dist/builtin/workflows/src/tui/session-list.ts +8 -4
  206. package/dist/builtin/workflows/src/tui/stage-chat-view-render-helpers.ts +12 -0
  207. package/dist/builtin/workflows/src/tui/stage-chat-view-render-settings.ts +21 -1
  208. package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +3 -19
  209. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +4 -2
  210. package/dist/builtin/workflows/src/tui/switcher.ts +13 -3
  211. package/dist/builtin/workflows/src/tui/workflow-attach-pane-handle.ts +1 -1
  212. package/dist/builtin/workflows/src/tui/workflow-attach-pane-types.ts +0 -9
  213. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +16 -49
  214. package/dist/builtin/workflows/src/tui/workflow-status.ts +7 -0
  215. package/dist/builtin/workflows/src/workflows/identity.ts +1 -1
  216. package/dist/cli/args.d.ts +0 -1
  217. package/dist/cli/args.d.ts.map +1 -1
  218. package/dist/cli/args.js +1 -20
  219. package/dist/cli/args.js.map +1 -1
  220. package/dist/cli/config-selector.js +1 -1
  221. package/dist/cli/config-selector.js.map +1 -1
  222. package/dist/cli/list-models.d.ts.map +1 -1
  223. package/dist/cli/list-models.js +1 -2
  224. package/dist/cli/list-models.js.map +1 -1
  225. package/dist/cli/session-picker.d.ts.map +1 -1
  226. package/dist/cli/session-picker.js +2 -1
  227. package/dist/cli/session-picker.js.map +1 -1
  228. package/dist/cli/startup-ui.js +2 -2
  229. package/dist/cli/startup-ui.js.map +1 -1
  230. package/dist/config-self-update.js +1 -1
  231. package/dist/config-self-update.js.map +1 -1
  232. package/dist/config.d.ts +2 -0
  233. package/dist/config.d.ts.map +1 -1
  234. package/dist/config.js +34 -10
  235. package/dist/config.js.map +1 -1
  236. package/dist/core/agent-session-accessors.d.ts.map +1 -1
  237. package/dist/core/agent-session-accessors.js +2 -1
  238. package/dist/core/agent-session-accessors.js.map +1 -1
  239. package/dist/core/agent-session-auto-compaction.d.ts +4 -3
  240. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  241. package/dist/core/agent-session-auto-compaction.js +55 -59
  242. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  243. package/dist/core/agent-session-bash.d.ts +9 -6
  244. package/dist/core/agent-session-bash.d.ts.map +1 -1
  245. package/dist/core/agent-session-bash.js +32 -13
  246. package/dist/core/agent-session-bash.js.map +1 -1
  247. package/dist/core/agent-session-compaction.d.ts +11 -1
  248. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  249. package/dist/core/agent-session-compaction.js +87 -19
  250. package/dist/core/agent-session-compaction.js.map +1 -1
  251. package/dist/core/agent-session-custom-message-commit.d.ts +14 -0
  252. package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -0
  253. package/dist/core/agent-session-custom-message-commit.js +141 -0
  254. package/dist/core/agent-session-custom-message-commit.js.map +1 -0
  255. package/dist/core/agent-session-delivery-forwarding.d.ts +9 -0
  256. package/dist/core/agent-session-delivery-forwarding.d.ts.map +1 -0
  257. package/dist/core/agent-session-delivery-forwarding.js +36 -0
  258. package/dist/core/agent-session-delivery-forwarding.js.map +1 -0
  259. package/dist/core/agent-session-events.d.ts +1 -1
  260. package/dist/core/agent-session-events.d.ts.map +1 -1
  261. package/dist/core/agent-session-events.js +45 -14
  262. package/dist/core/agent-session-events.js.map +1 -1
  263. package/dist/core/agent-session-extension-bindings.d.ts +2 -6
  264. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  265. package/dist/core/agent-session-extension-bindings.js +18 -11
  266. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  267. package/dist/core/agent-session-message-queue.d.ts +5 -2
  268. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  269. package/dist/core/agent-session-message-queue.js +91 -97
  270. package/dist/core/agent-session-message-queue.js.map +1 -1
  271. package/dist/core/agent-session-methods.d.ts +47 -39
  272. package/dist/core/agent-session-methods.d.ts.map +1 -1
  273. package/dist/core/agent-session-methods.js.map +1 -1
  274. package/dist/core/agent-session-models.d.ts +2 -38
  275. package/dist/core/agent-session-models.d.ts.map +1 -1
  276. package/dist/core/agent-session-models.js +5 -147
  277. package/dist/core/agent-session-models.js.map +1 -1
  278. package/dist/core/agent-session-persistent-custom-messages.d.ts +47 -0
  279. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -0
  280. package/dist/core/agent-session-persistent-custom-messages.js +267 -0
  281. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -0
  282. package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
  283. package/dist/core/agent-session-post-tool-compaction.js +34 -9
  284. package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
  285. package/dist/core/agent-session-prompt.d.ts +2 -0
  286. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  287. package/dist/core/agent-session-prompt.js +42 -16
  288. package/dist/core/agent-session-prompt.js.map +1 -1
  289. package/dist/core/agent-session-queue-pause.d.ts +10 -0
  290. package/dist/core/agent-session-queue-pause.d.ts.map +1 -0
  291. package/dist/core/agent-session-queue-pause.js +86 -0
  292. package/dist/core/agent-session-queue-pause.js.map +1 -0
  293. package/dist/core/agent-session-retry.d.ts +0 -11
  294. package/dist/core/agent-session-retry.d.ts.map +1 -1
  295. package/dist/core/agent-session-retry.js +8 -57
  296. package/dist/core/agent-session-retry.js.map +1 -1
  297. package/dist/core/agent-session-runtime-auth.d.ts +6 -0
  298. package/dist/core/agent-session-runtime-auth.d.ts.map +1 -0
  299. package/dist/core/agent-session-runtime-auth.js +26 -0
  300. package/dist/core/agent-session-runtime-auth.js.map +1 -0
  301. package/dist/core/agent-session-runtime.d.ts +13 -2
  302. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  303. package/dist/core/agent-session-runtime.js +32 -6
  304. package/dist/core/agent-session-runtime.js.map +1 -1
  305. package/dist/core/agent-session-services.d.ts +0 -2
  306. package/dist/core/agent-session-services.d.ts.map +1 -1
  307. package/dist/core/agent-session-services.js +6 -7
  308. package/dist/core/agent-session-services.js.map +1 -1
  309. package/dist/core/agent-session-state.d.ts.map +1 -1
  310. package/dist/core/agent-session-state.js +3 -0
  311. package/dist/core/agent-session-state.js.map +1 -1
  312. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  313. package/dist/core/agent-session-tool-hooks.js +6 -1
  314. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  315. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  316. package/dist/core/agent-session-tool-registry.js +2 -18
  317. package/dist/core/agent-session-tool-registry.js.map +1 -1
  318. package/dist/core/agent-session-transfer.d.ts +4 -0
  319. package/dist/core/agent-session-transfer.d.ts.map +1 -0
  320. package/dist/core/agent-session-transfer.js +71 -0
  321. package/dist/core/agent-session-transfer.js.map +1 -0
  322. package/dist/core/agent-session-tree.js +1 -1
  323. package/dist/core/agent-session-tree.js.map +1 -1
  324. package/dist/core/agent-session-types.d.ts +5 -11
  325. package/dist/core/agent-session-types.d.ts.map +1 -1
  326. package/dist/core/agent-session-types.js +0 -3
  327. package/dist/core/agent-session-types.js.map +1 -1
  328. package/dist/core/agent-session.d.ts +12 -2
  329. package/dist/core/agent-session.d.ts.map +1 -1
  330. package/dist/core/agent-session.js +8 -2
  331. package/dist/core/agent-session.js.map +1 -1
  332. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  333. package/dist/core/atomic-guide-command.js +31 -33
  334. package/dist/core/atomic-guide-command.js.map +1 -1
  335. package/dist/core/auth-storage.js +2 -2
  336. package/dist/core/auth-storage.js.map +1 -1
  337. package/dist/core/bash-executor.d.ts +5 -3
  338. package/dist/core/bash-executor.d.ts.map +1 -1
  339. package/dist/core/bash-executor.js +5 -4
  340. package/dist/core/bash-executor.js.map +1 -1
  341. package/dist/core/builtin-packages.d.ts.map +1 -1
  342. package/dist/core/builtin-packages.js +0 -6
  343. package/dist/core/builtin-packages.js.map +1 -1
  344. package/dist/core/compaction/branch-summarization.d.ts +8 -3
  345. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  346. package/dist/core/compaction/branch-summarization.js +17 -6
  347. package/dist/core/compaction/branch-summarization.js.map +1 -1
  348. package/dist/core/compaction/compaction-boundary.d.ts +18 -1
  349. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  350. package/dist/core/compaction/compaction-boundary.js +2 -2
  351. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  352. package/dist/core/compaction/compaction-runner.d.ts +61 -6
  353. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  354. package/dist/core/compaction/compaction-runner.js +242 -18
  355. package/dist/core/compaction/compaction-runner.js.map +1 -1
  356. package/dist/core/compaction/compaction-types.d.ts +53 -2
  357. package/dist/core/compaction/compaction-types.d.ts.map +1 -1
  358. package/dist/core/compaction/compaction-types.js.map +1 -1
  359. package/dist/core/compaction/fallback-planner.d.ts +64 -0
  360. package/dist/core/compaction/fallback-planner.d.ts.map +1 -0
  361. package/dist/core/compaction/fallback-planner.js +75 -0
  362. package/dist/core/compaction/fallback-planner.js.map +1 -0
  363. package/dist/core/compaction/index.d.ts +3 -0
  364. package/dist/core/compaction/index.d.ts.map +1 -1
  365. package/dist/core/compaction/index.js +3 -0
  366. package/dist/core/compaction/index.js.map +1 -1
  367. package/dist/core/compaction/planner-outcome.d.ts +86 -0
  368. package/dist/core/compaction/planner-outcome.d.ts.map +1 -0
  369. package/dist/core/compaction/planner-outcome.js +122 -0
  370. package/dist/core/compaction/planner-outcome.js.map +1 -0
  371. package/dist/core/compaction/range-planner-diagnostics.d.ts +58 -6
  372. package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
  373. package/dist/core/compaction/range-planner-diagnostics.js +69 -31
  374. package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
  375. package/dist/core/compaction/range-planner.d.ts +36 -8
  376. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  377. package/dist/core/compaction/range-planner.js +136 -51
  378. package/dist/core/compaction/range-planner.js.map +1 -1
  379. package/dist/core/compaction/region-trimming.d.ts +34 -0
  380. package/dist/core/compaction/region-trimming.d.ts.map +1 -0
  381. package/dist/core/compaction/region-trimming.js +73 -0
  382. package/dist/core/compaction/region-trimming.js.map +1 -0
  383. package/dist/core/compaction/transcript-serialization.d.ts +8 -1
  384. package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
  385. package/dist/core/compaction/transcript-serialization.js +78 -27
  386. package/dist/core/compaction/transcript-serialization.js.map +1 -1
  387. package/dist/core/context-tool-pairing.d.ts +19 -0
  388. package/dist/core/context-tool-pairing.d.ts.map +1 -0
  389. package/dist/core/context-tool-pairing.js +50 -0
  390. package/dist/core/context-tool-pairing.js.map +1 -0
  391. package/dist/core/diagnostics.d.ts +8 -0
  392. package/dist/core/diagnostics.d.ts.map +1 -1
  393. package/dist/core/diagnostics.js.map +1 -1
  394. package/dist/core/extensions/context-types.d.ts +3 -0
  395. package/dist/core/extensions/context-types.d.ts.map +1 -1
  396. package/dist/core/extensions/context-types.js.map +1 -1
  397. package/dist/core/extensions/index.d.ts +2 -0
  398. package/dist/core/extensions/index.d.ts.map +1 -1
  399. package/dist/core/extensions/index.js.map +1 -1
  400. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  401. package/dist/core/extensions/loader-api.js +48 -27
  402. package/dist/core/extensions/loader-api.js.map +1 -1
  403. package/dist/core/extensions/loader-runtime.d.ts +2 -4
  404. package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
  405. package/dist/core/extensions/loader-runtime.js +199 -18
  406. package/dist/core/extensions/loader-runtime.js.map +1 -1
  407. package/dist/core/extensions/message-types.d.ts +7 -4
  408. package/dist/core/extensions/message-types.d.ts.map +1 -1
  409. package/dist/core/extensions/message-types.js.map +1 -1
  410. package/dist/core/extensions/provider-types.d.ts +9 -4
  411. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  412. package/dist/core/extensions/provider-types.js.map +1 -1
  413. package/dist/core/extensions/runner-context.d.ts +2 -0
  414. package/dist/core/extensions/runner-context.d.ts.map +1 -1
  415. package/dist/core/extensions/runner-context.js +4 -0
  416. package/dist/core/extensions/runner-context.js.map +1 -1
  417. package/dist/core/extensions/runner.d.ts +1 -0
  418. package/dist/core/extensions/runner.d.ts.map +1 -1
  419. package/dist/core/extensions/runner.js +28 -20
  420. package/dist/core/extensions/runner.js.map +1 -1
  421. package/dist/core/extensions/runtime-types.d.ts +25 -0
  422. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  423. package/dist/core/extensions/runtime-types.js.map +1 -1
  424. package/dist/core/extensions/tool-types.d.ts +7 -3
  425. package/dist/core/extensions/tool-types.d.ts.map +1 -1
  426. package/dist/core/extensions/tool-types.js.map +1 -1
  427. package/dist/core/extensions/ui-types.d.ts +14 -4
  428. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  429. package/dist/core/extensions/ui-types.js.map +1 -1
  430. package/dist/core/fallback-models.d.ts +37 -0
  431. package/dist/core/fallback-models.d.ts.map +1 -0
  432. package/dist/core/fallback-models.js +48 -0
  433. package/dist/core/fallback-models.js.map +1 -0
  434. package/dist/core/flattened-tool-arguments.d.ts +4 -7
  435. package/dist/core/flattened-tool-arguments.d.ts.map +1 -1
  436. package/dist/core/flattened-tool-arguments.js +4 -7
  437. package/dist/core/flattened-tool-arguments.js.map +1 -1
  438. package/dist/core/http-dispatcher.d.ts.map +1 -1
  439. package/dist/core/http-dispatcher.js +0 -5
  440. package/dist/core/http-dispatcher.js.map +1 -1
  441. package/dist/core/messages.d.ts +14 -2
  442. package/dist/core/messages.d.ts.map +1 -1
  443. package/dist/core/messages.js +28 -4
  444. package/dist/core/messages.js.map +1 -1
  445. package/dist/core/model-capabilities.d.ts +18 -0
  446. package/dist/core/model-capabilities.d.ts.map +1 -0
  447. package/dist/core/model-capabilities.js +23 -0
  448. package/dist/core/model-capabilities.js.map +1 -0
  449. package/dist/core/model-registry-auth.d.ts.map +1 -1
  450. package/dist/core/model-registry-auth.js +0 -2
  451. package/dist/core/model-registry-auth.js.map +1 -1
  452. package/dist/core/model-registry-builtins.d.ts +0 -2
  453. package/dist/core/model-registry-builtins.d.ts.map +1 -1
  454. package/dist/core/model-registry-builtins.js +9 -76
  455. package/dist/core/model-registry-builtins.js.map +1 -1
  456. package/dist/core/model-registry-custom-loader.d.ts.map +1 -1
  457. package/dist/core/model-registry-custom-loader.js +1 -12
  458. package/dist/core/model-registry-custom-loader.js.map +1 -1
  459. package/dist/core/model-registry-dynamic.d.ts.map +1 -1
  460. package/dist/core/model-registry-dynamic.js +3 -15
  461. package/dist/core/model-registry-dynamic.js.map +1 -1
  462. package/dist/core/model-registry-extension-refresh.d.ts +23 -0
  463. package/dist/core/model-registry-extension-refresh.d.ts.map +1 -0
  464. package/dist/core/model-registry-extension-refresh.js +32 -0
  465. package/dist/core/model-registry-extension-refresh.js.map +1 -0
  466. package/dist/core/model-registry-schemas.d.ts +118 -9
  467. package/dist/core/model-registry-schemas.d.ts.map +1 -1
  468. package/dist/core/model-registry-schemas.js +10 -3
  469. package/dist/core/model-registry-schemas.js.map +1 -1
  470. package/dist/core/model-registry-types.d.ts +5 -5
  471. package/dist/core/model-registry-types.d.ts.map +1 -1
  472. package/dist/core/model-registry-types.js.map +1 -1
  473. package/dist/core/model-registry-validation.d.ts +7 -0
  474. package/dist/core/model-registry-validation.d.ts.map +1 -0
  475. package/dist/core/model-registry-validation.js +12 -0
  476. package/dist/core/model-registry-validation.js.map +1 -0
  477. package/dist/core/model-registry.d.ts +5 -3
  478. package/dist/core/model-registry.d.ts.map +1 -1
  479. package/dist/core/model-registry.js +34 -33
  480. package/dist/core/model-registry.js.map +1 -1
  481. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  482. package/dist/core/model-resolver-defaults.js +0 -1
  483. package/dist/core/model-resolver-defaults.js.map +1 -1
  484. package/dist/core/model-resolver-initial.d.ts.map +1 -1
  485. package/dist/core/model-resolver-initial.js +9 -0
  486. package/dist/core/model-resolver-initial.js.map +1 -1
  487. package/dist/core/model-resolver-patterns.d.ts.map +1 -1
  488. package/dist/core/model-resolver-patterns.js +0 -2
  489. package/dist/core/model-resolver-patterns.js.map +1 -1
  490. package/dist/core/model-resolver-scope.d.ts +2 -0
  491. package/dist/core/model-resolver-scope.d.ts.map +1 -1
  492. package/dist/core/model-resolver-scope.js +18 -4
  493. package/dist/core/model-resolver-scope.js.map +1 -1
  494. package/dist/core/model-resolver-types.d.ts +2 -0
  495. package/dist/core/model-resolver-types.d.ts.map +1 -1
  496. package/dist/core/model-resolver-types.js.map +1 -1
  497. package/dist/core/oauth-provider-bridge.d.ts +21 -0
  498. package/dist/core/oauth-provider-bridge.d.ts.map +1 -1
  499. package/dist/core/oauth-provider-bridge.js +68 -7
  500. package/dist/core/oauth-provider-bridge.js.map +1 -1
  501. package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
  502. package/dist/core/package-manager-auto-resources.js +12 -4
  503. package/dist/core/package-manager-auto-resources.js.map +1 -1
  504. package/dist/core/package-manager-resolver.d.ts.map +1 -1
  505. package/dist/core/package-manager-resolver.js +42 -11
  506. package/dist/core/package-manager-resolver.js.map +1 -1
  507. package/dist/core/package-manager-types.d.ts +2 -0
  508. package/dist/core/package-manager-types.d.ts.map +1 -1
  509. package/dist/core/package-manager-types.js.map +1 -1
  510. package/dist/core/package-manager.d.ts +1 -1
  511. package/dist/core/package-manager.d.ts.map +1 -1
  512. package/dist/core/package-manager.js.map +1 -1
  513. package/dist/core/remote-catalog-provider.d.ts +1 -1
  514. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  515. package/dist/core/remote-catalog-provider.js +17 -11
  516. package/dist/core/remote-catalog-provider.js.map +1 -1
  517. package/dist/core/resource-loader-assets.d.ts.map +1 -1
  518. package/dist/core/resource-loader-assets.js +30 -4
  519. package/dist/core/resource-loader-assets.js.map +1 -1
  520. package/dist/core/resource-loader-context-files.d.ts.map +1 -1
  521. package/dist/core/resource-loader-context-files.js +3 -1
  522. package/dist/core/resource-loader-context-files.js.map +1 -1
  523. package/dist/core/resource-loader-core.d.ts +2 -1
  524. package/dist/core/resource-loader-core.d.ts.map +1 -1
  525. package/dist/core/resource-loader-core.js +3 -0
  526. package/dist/core/resource-loader-core.js.map +1 -1
  527. package/dist/core/resource-loader-extensions.d.ts +1 -0
  528. package/dist/core/resource-loader-extensions.d.ts.map +1 -1
  529. package/dist/core/resource-loader-extensions.js +120 -7
  530. package/dist/core/resource-loader-extensions.js.map +1 -1
  531. package/dist/core/resource-loader-package-resources.d.ts.map +1 -1
  532. package/dist/core/resource-loader-package-resources.js +14 -1
  533. package/dist/core/resource-loader-package-resources.js.map +1 -1
  534. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  535. package/dist/core/resource-loader-reload.js +2 -1
  536. package/dist/core/resource-loader-reload.js.map +1 -1
  537. package/dist/core/resource-loader-source-info.d.ts.map +1 -1
  538. package/dist/core/resource-loader-source-info.js +6 -3
  539. package/dist/core/resource-loader-source-info.js.map +1 -1
  540. package/dist/core/sdk-types.d.ts +11 -10
  541. package/dist/core/sdk-types.d.ts.map +1 -1
  542. package/dist/core/sdk-types.js.map +1 -1
  543. package/dist/core/sdk.d.ts +1 -0
  544. package/dist/core/sdk.d.ts.map +1 -1
  545. package/dist/core/sdk.js +13 -84
  546. package/dist/core/sdk.js.map +1 -1
  547. package/dist/core/session-manager-core.d.ts +3 -3
  548. package/dist/core/session-manager-core.d.ts.map +1 -1
  549. package/dist/core/session-manager-core.js +18 -25
  550. package/dist/core/session-manager-core.js.map +1 -1
  551. package/dist/core/session-manager-entries.d.ts +2 -5
  552. package/dist/core/session-manager-entries.d.ts.map +1 -1
  553. package/dist/core/session-manager-entries.js +2 -8
  554. package/dist/core/session-manager-entries.js.map +1 -1
  555. package/dist/core/session-manager-history.d.ts +3 -3
  556. package/dist/core/session-manager-history.d.ts.map +1 -1
  557. package/dist/core/session-manager-history.js +49 -27
  558. package/dist/core/session-manager-history.js.map +1 -1
  559. package/dist/core/session-manager-storage.d.ts +6 -0
  560. package/dist/core/session-manager-storage.d.ts.map +1 -1
  561. package/dist/core/session-manager-storage.js +38 -5
  562. package/dist/core/session-manager-storage.js.map +1 -1
  563. package/dist/core/session-manager-types.d.ts +6 -6
  564. package/dist/core/session-manager-types.d.ts.map +1 -1
  565. package/dist/core/session-manager-types.js.map +1 -1
  566. package/dist/core/session-manager.d.ts +1 -1
  567. package/dist/core/session-manager.d.ts.map +1 -1
  568. package/dist/core/session-manager.js.map +1 -1
  569. package/dist/core/settings-manager-basic-accessors.d.ts +0 -4
  570. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  571. package/dist/core/settings-manager-basic-accessors.js +0 -50
  572. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  573. package/dist/core/settings-manager-core.d.ts +2 -4
  574. package/dist/core/settings-manager-core.d.ts.map +1 -1
  575. package/dist/core/settings-manager-core.js +5 -51
  576. package/dist/core/settings-manager-core.js.map +1 -1
  577. package/dist/core/settings-manager.d.ts +1 -1
  578. package/dist/core/settings-manager.d.ts.map +1 -1
  579. package/dist/core/settings-manager.js.map +1 -1
  580. package/dist/core/settings-storage.d.ts +3 -1
  581. package/dist/core/settings-storage.d.ts.map +1 -1
  582. package/dist/core/settings-storage.js +22 -0
  583. package/dist/core/settings-storage.js.map +1 -1
  584. package/dist/core/settings-types.d.ts +2 -4
  585. package/dist/core/settings-types.d.ts.map +1 -1
  586. package/dist/core/settings-types.js.map +1 -1
  587. package/dist/core/slash-commands.d.ts.map +1 -1
  588. package/dist/core/slash-commands.js +69 -23
  589. package/dist/core/slash-commands.js.map +1 -1
  590. package/dist/core/source-info.d.ts +3 -1
  591. package/dist/core/source-info.d.ts.map +1 -1
  592. package/dist/core/source-info.js +2 -0
  593. package/dist/core/source-info.js.map +1 -1
  594. package/dist/core/system-prompt.d.ts.map +1 -1
  595. package/dist/core/system-prompt.js +11 -0
  596. package/dist/core/system-prompt.js.map +1 -1
  597. package/dist/core/tools/ask-user-question/ask-user-question.js +1 -1
  598. package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
  599. package/dist/core/tools/bash-session-environment.d.ts +13 -0
  600. package/dist/core/tools/bash-session-environment.d.ts.map +1 -0
  601. package/dist/core/tools/bash-session-environment.js +35 -0
  602. package/dist/core/tools/bash-session-environment.js.map +1 -0
  603. package/dist/core/tools/bash.d.ts +4 -1
  604. package/dist/core/tools/bash.d.ts.map +1 -1
  605. package/dist/core/tools/bash.js +16 -8
  606. package/dist/core/tools/bash.js.map +1 -1
  607. package/dist/core/tools/tool-definition-wrapper.d.ts +3 -0
  608. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  609. package/dist/core/tools/tool-definition-wrapper.js +10 -2
  610. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  611. package/dist/extensions/index.js +1 -1
  612. package/dist/extensions/index.js.map +1 -1
  613. package/dist/extensions/llama/provider.d.ts +3 -2
  614. package/dist/extensions/llama/provider.d.ts.map +1 -1
  615. package/dist/extensions/llama/provider.js +9 -3
  616. package/dist/extensions/llama/provider.js.map +1 -1
  617. package/dist/index-extensions.d.ts +1 -1
  618. package/dist/index-extensions.d.ts.map +1 -1
  619. package/dist/index-extensions.js.map +1 -1
  620. package/dist/index.d.ts +2 -3
  621. package/dist/index.d.ts.map +1 -1
  622. package/dist/index.js +1 -2
  623. package/dist/index.js.map +1 -1
  624. package/dist/main-session-options.d.ts.map +1 -1
  625. package/dist/main-session-options.js +0 -4
  626. package/dist/main-session-options.js.map +1 -1
  627. package/dist/main-session.d.ts.map +1 -1
  628. package/dist/main-session.js +2 -1
  629. package/dist/main-session.js.map +1 -1
  630. package/dist/main.d.ts.map +1 -1
  631. package/dist/main.js +1 -17
  632. package/dist/main.js.map +1 -1
  633. package/dist/modes/index.d.ts +1 -1
  634. package/dist/modes/index.d.ts.map +1 -1
  635. package/dist/modes/index.js.map +1 -1
  636. package/dist/modes/interactive/chat-input-actions.d.ts +1 -1
  637. package/dist/modes/interactive/chat-input-actions.d.ts.map +1 -1
  638. package/dist/modes/interactive/chat-input-actions.js +14 -96
  639. package/dist/modes/interactive/chat-input-actions.js.map +1 -1
  640. package/dist/modes/interactive/components/atomic-banner.d.ts +9 -8
  641. package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
  642. package/dist/modes/interactive/components/atomic-banner.js +68 -24
  643. package/dist/modes/interactive/components/atomic-banner.js.map +1 -1
  644. package/dist/modes/interactive/components/atomic-working-status.d.ts +52 -0
  645. package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -0
  646. package/dist/modes/interactive/components/atomic-working-status.js +202 -0
  647. package/dist/modes/interactive/components/atomic-working-status.js.map +1 -0
  648. package/dist/modes/interactive/components/chat-message-renderer.js +1 -1
  649. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  650. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  651. package/dist/modes/interactive/components/chat-session-host-actions.js +99 -7
  652. package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
  653. package/dist/modes/interactive/components/chat-session-host-editor.js +3 -3
  654. package/dist/modes/interactive/components/chat-session-host-editor.js.map +1 -1
  655. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  656. package/dist/modes/interactive/components/chat-session-host-events.js +52 -9
  657. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  658. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  659. package/dist/modes/interactive/components/chat-session-host-rendering.js +23 -7
  660. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  661. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +2 -0
  662. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
  663. package/dist/modes/interactive/components/chat-session-host-runtime.js +67 -18
  664. package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
  665. package/dist/modes/interactive/components/chat-session-host-state.d.ts +9 -0
  666. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  667. package/dist/modes/interactive/components/chat-session-host-state.js +5 -0
  668. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  669. package/dist/modes/interactive/components/chat-session-host-types.d.ts +10 -0
  670. package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
  671. package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
  672. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  673. package/dist/modes/interactive/components/compaction-boundary-message.js +2 -1
  674. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  675. package/dist/modes/interactive/components/custom-message.d.ts +3 -1
  676. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  677. package/dist/modes/interactive/components/custom-message.js +9 -2
  678. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  679. package/dist/modes/interactive/components/extension-editor.d.ts +3 -2
  680. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  681. package/dist/modes/interactive/components/extension-editor.js +14 -43
  682. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  683. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  684. package/dist/modes/interactive/components/scoped-models-selector.js +18 -13
  685. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  686. package/dist/modes/interactive/components/startup-identity.d.ts +22 -0
  687. package/dist/modes/interactive/components/startup-identity.d.ts.map +1 -0
  688. package/dist/modes/interactive/components/startup-identity.js +58 -0
  689. package/dist/modes/interactive/components/startup-identity.js.map +1 -0
  690. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  691. package/dist/modes/interactive/components/tree-selector-content.js +0 -6
  692. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  693. package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
  694. package/dist/modes/interactive/components/tree-selector-model.js +0 -1
  695. package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
  696. package/dist/modes/interactive/components/working-status.d.ts +5 -11
  697. package/dist/modes/interactive/components/working-status.d.ts.map +1 -1
  698. package/dist/modes/interactive/components/working-status.js +14 -15
  699. package/dist/modes/interactive/components/working-status.js.map +1 -1
  700. package/dist/modes/interactive/external-editor.d.ts +23 -0
  701. package/dist/modes/interactive/external-editor.d.ts.map +1 -0
  702. package/dist/modes/interactive/external-editor.js +120 -0
  703. package/dist/modes/interactive/external-editor.js.map +1 -0
  704. package/dist/modes/interactive/interactive-agent-events.js +25 -20
  705. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  706. package/dist/modes/interactive/interactive-auth-login.js +16 -6
  707. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  708. package/dist/modes/interactive/interactive-auth-routing.js +3 -0
  709. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  710. package/dist/modes/interactive/interactive-bash-compact.d.ts +2 -1
  711. package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
  712. package/dist/modes/interactive/interactive-bash-compact.js +8 -0
  713. package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
  714. package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
  715. package/dist/modes/interactive/interactive-deferred-startup.js +49 -19
  716. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
  717. package/dist/modes/interactive/interactive-editor-actions.js +4 -3
  718. package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
  719. package/dist/modes/interactive/interactive-extension-dialogs.js +1 -1
  720. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  721. package/dist/modes/interactive/interactive-extension-runtime.js +3 -2
  722. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  723. package/dist/modes/interactive/interactive-initial-session-binding.d.ts +4 -0
  724. package/dist/modes/interactive/interactive-initial-session-binding.d.ts.map +1 -0
  725. package/dist/modes/interactive/interactive-initial-session-binding.js +23 -0
  726. package/dist/modes/interactive/interactive-initial-session-binding.js.map +1 -0
  727. package/dist/modes/interactive/interactive-input-handling.d.ts +2 -1
  728. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  729. package/dist/modes/interactive/interactive-input-handling.js +27 -51
  730. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  731. package/dist/modes/interactive/interactive-mode-base.d.ts +11 -7
  732. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  733. package/dist/modes/interactive/interactive-mode-base.js +14 -6
  734. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  735. package/dist/modes/interactive/interactive-mode-deps.d.ts +2 -4
  736. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  737. package/dist/modes/interactive/interactive-mode-deps.js +2 -4
  738. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  739. package/dist/modes/interactive/interactive-mode-surface.d.ts +9 -8
  740. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  741. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  742. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  743. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  744. package/dist/modes/interactive/interactive-mode.js +1 -0
  745. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  746. package/dist/modes/interactive/interactive-model-catalog-startup.d.ts +2 -3
  747. package/dist/modes/interactive/interactive-model-catalog-startup.d.ts.map +1 -1
  748. package/dist/modes/interactive/interactive-model-catalog-startup.js +3 -6
  749. package/dist/modes/interactive/interactive-model-catalog-startup.js.map +1 -1
  750. package/dist/modes/interactive/interactive-model-routing.js +26 -97
  751. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  752. package/dist/modes/interactive/interactive-pause.d.ts +4 -0
  753. package/dist/modes/interactive/interactive-pause.d.ts.map +1 -0
  754. package/dist/modes/interactive/interactive-pause.js +8 -0
  755. package/dist/modes/interactive/interactive-pause.js.map +1 -0
  756. package/dist/modes/interactive/interactive-process-lifecycle.js +5 -4
  757. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  758. package/dist/modes/interactive/interactive-prompt-turn.d.ts +2 -0
  759. package/dist/modes/interactive/interactive-prompt-turn.d.ts.map +1 -0
  760. package/dist/modes/interactive/interactive-prompt-turn.js +41 -0
  761. package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -0
  762. package/dist/modes/interactive/interactive-render-chat.js +20 -8
  763. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  764. package/dist/modes/interactive/interactive-resource-paths.js +11 -2
  765. package/dist/modes/interactive/interactive-resource-paths.js.map +1 -1
  766. package/dist/modes/interactive/interactive-resource-rendering.js +99 -0
  767. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  768. package/dist/modes/interactive/interactive-session-runtime.js +1 -1
  769. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  770. package/dist/modes/interactive/interactive-slash-commands.js +1 -1
  771. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  772. package/dist/modes/interactive/interactive-startup-chat-container.d.ts +20 -0
  773. package/dist/modes/interactive/interactive-startup-chat-container.d.ts.map +1 -0
  774. package/dist/modes/interactive/interactive-startup-chat-container.js +26 -0
  775. package/dist/modes/interactive/interactive-startup-chat-container.js.map +1 -0
  776. package/dist/modes/interactive/interactive-startup.d.ts +1 -1
  777. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  778. package/dist/modes/interactive/interactive-startup.js +30 -25
  779. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  780. package/dist/modes/interactive/interactive-summarization-retry-events.d.ts.map +1 -1
  781. package/dist/modes/interactive/interactive-summarization-retry-events.js +9 -3
  782. package/dist/modes/interactive/interactive-summarization-retry-events.js.map +1 -1
  783. package/dist/modes/interactive/theme/catppuccin-frappe.json +1 -1
  784. package/dist/modes/interactive/theme/catppuccin-latte.json +1 -1
  785. package/dist/modes/interactive/theme/catppuccin-macchiato.json +1 -1
  786. package/dist/modes/interactive/theme/catppuccin-mocha.json +9 -1
  787. package/dist/modes/interactive/theme/dark.json +1 -1
  788. package/dist/modes/interactive/theme/light.json +1 -1
  789. package/dist/modes/interactive/theme/theme-class.d.ts +4 -0
  790. package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
  791. package/dist/modes/interactive/theme/theme-class.js +7 -0
  792. package/dist/modes/interactive/theme/theme-class.js.map +1 -1
  793. package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
  794. package/dist/modes/interactive/theme/theme-loading.js +4 -0
  795. package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
  796. package/dist/modes/interactive/theme/theme-schema.d.ts +32 -0
  797. package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
  798. package/dist/modes/interactive/theme/theme-schema.js +8 -0
  799. package/dist/modes/interactive/theme/theme-schema.js.map +1 -1
  800. package/dist/modes/interactive/theme/theme-schema.json +15 -2
  801. package/dist/modes/interactive/whimsical-messages.d.ts +1 -0
  802. package/dist/modes/interactive/whimsical-messages.d.ts.map +1 -1
  803. package/dist/modes/interactive/whimsical-messages.js +2 -2
  804. package/dist/modes/interactive/whimsical-messages.js.map +1 -1
  805. package/dist/modes/interactive-engine/create-isolated-runtime.d.ts.map +1 -1
  806. package/dist/modes/interactive-engine/create-isolated-runtime.js +3 -1
  807. package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -1
  808. package/dist/modes/interactive-engine/engine-args.d.ts.map +1 -1
  809. package/dist/modes/interactive-engine/engine-args.js +0 -1
  810. package/dist/modes/interactive-engine/engine-args.js.map +1 -1
  811. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  812. package/dist/modes/interactive-engine/engine-custom-ui.js +5 -17
  813. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  814. package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
  815. package/dist/modes/interactive-engine/engine-render-service.js +8 -19
  816. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
  817. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +2 -0
  818. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  819. package/dist/modes/interactive-engine/extension-ui-bridge.js +3 -0
  820. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  821. package/dist/modes/interactive-engine/isolated-auth.d.ts +10 -0
  822. package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -0
  823. package/dist/modes/interactive-engine/isolated-auth.js +14 -0
  824. package/dist/modes/interactive-engine/isolated-auth.js.map +1 -0
  825. package/dist/modes/interactive-engine/isolated-runtime.d.ts +9 -1
  826. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  827. package/dist/modes/interactive-engine/isolated-runtime.js +46 -34
  828. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  829. package/dist/modes/interactive-engine/protocol.d.ts +1 -1
  830. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  831. package/dist/modes/interactive-engine/protocol.js +3 -10
  832. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  833. package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
  834. package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -1
  835. package/dist/modes/interactive-engine/remote-model-catalog.js +10 -1
  836. package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
  837. package/dist/modes/interactive-engine/remote-queue-pause.d.ts +13 -0
  838. package/dist/modes/interactive-engine/remote-queue-pause.d.ts.map +1 -0
  839. package/dist/modes/interactive-engine/remote-queue-pause.js +38 -0
  840. package/dist/modes/interactive-engine/remote-queue-pause.js.map +1 -0
  841. package/dist/modes/interactive-engine/remote-renderer.d.ts +3 -1
  842. package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
  843. package/dist/modes/interactive-engine/remote-renderer.js +4 -1
  844. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
  845. package/dist/modes/print-mode.d.ts.map +1 -1
  846. package/dist/modes/print-mode.js +5 -0
  847. package/dist/modes/print-mode.js.map +1 -1
  848. package/dist/modes/rpc/jsonl.d.ts +2 -7
  849. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  850. package/dist/modes/rpc/jsonl.js +7 -24
  851. package/dist/modes/rpc/jsonl.js.map +1 -1
  852. package/dist/modes/rpc/queued-writer.d.ts +19 -0
  853. package/dist/modes/rpc/queued-writer.d.ts.map +1 -0
  854. package/dist/modes/rpc/{bounded-writer.js → queued-writer.js} +7 -30
  855. package/dist/modes/rpc/queued-writer.js.map +1 -0
  856. package/dist/modes/rpc/rpc-bash-request-owners.d.ts +24 -0
  857. package/dist/modes/rpc/rpc-bash-request-owners.d.ts.map +1 -0
  858. package/dist/modes/rpc/rpc-bash-request-owners.js +45 -0
  859. package/dist/modes/rpc/rpc-bash-request-owners.js.map +1 -0
  860. package/dist/modes/rpc/rpc-client-api.d.ts +8 -5
  861. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  862. package/dist/modes/rpc/rpc-client-api.js +10 -11
  863. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  864. package/dist/modes/rpc/rpc-client-process.d.ts +1 -4
  865. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  866. package/dist/modes/rpc/rpc-client-process.js +2 -14
  867. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  868. package/dist/modes/rpc/rpc-client.d.ts +8 -4
  869. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  870. package/dist/modes/rpc/rpc-client.js +21 -30
  871. package/dist/modes/rpc/rpc-client.js.map +1 -1
  872. package/dist/modes/rpc/rpc-command-handler.d.ts +7 -4
  873. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  874. package/dist/modes/rpc/rpc-command-handler.js +76 -93
  875. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  876. package/dist/modes/rpc/rpc-input-scheduler.d.ts +3 -3
  877. package/dist/modes/rpc/rpc-input-scheduler.d.ts.map +1 -1
  878. package/dist/modes/rpc/rpc-input-scheduler.js +7 -4
  879. package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -1
  880. package/dist/modes/rpc/rpc-mode.d.ts +1 -1
  881. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  882. package/dist/modes/rpc/rpc-mode.js +5 -5
  883. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  884. package/dist/modes/rpc/rpc-model-fallback-prompt.d.ts +4 -0
  885. package/dist/modes/rpc/rpc-model-fallback-prompt.d.ts.map +1 -0
  886. package/dist/modes/rpc/rpc-model-fallback-prompt.js +11 -0
  887. package/dist/modes/rpc/rpc-model-fallback-prompt.js.map +1 -0
  888. package/dist/modes/rpc/rpc-oauth-client.d.ts +22 -0
  889. package/dist/modes/rpc/rpc-oauth-client.d.ts.map +1 -0
  890. package/dist/modes/rpc/rpc-oauth-client.js +74 -0
  891. package/dist/modes/rpc/rpc-oauth-client.js.map +1 -0
  892. package/dist/modes/rpc/rpc-oauth-interaction.d.ts +9 -0
  893. package/dist/modes/rpc/rpc-oauth-interaction.d.ts.map +1 -0
  894. package/dist/modes/rpc/rpc-oauth-interaction.js +49 -0
  895. package/dist/modes/rpc/rpc-oauth-interaction.js.map +1 -0
  896. package/dist/modes/rpc/rpc-output-buffer.d.ts +2 -1
  897. package/dist/modes/rpc/rpc-output-buffer.d.ts.map +1 -1
  898. package/dist/modes/rpc/rpc-output-buffer.js +4 -39
  899. package/dist/modes/rpc/rpc-output-buffer.js.map +1 -1
  900. package/dist/modes/rpc/rpc-provider-auth.d.ts +23 -0
  901. package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -0
  902. package/dist/modes/rpc/rpc-provider-auth.js +145 -0
  903. package/dist/modes/rpc/rpc-provider-auth.js.map +1 -0
  904. package/dist/modes/rpc/rpc-responses.d.ts +0 -1
  905. package/dist/modes/rpc/rpc-responses.d.ts.map +1 -1
  906. package/dist/modes/rpc/rpc-responses.js +0 -14
  907. package/dist/modes/rpc/rpc-responses.js.map +1 -1
  908. package/dist/modes/rpc/rpc-types.d.ts +83 -27
  909. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  910. package/dist/modes/rpc/rpc-types.js.map +1 -1
  911. package/dist/utils/clipboard.d.ts.map +1 -1
  912. package/dist/utils/clipboard.js +21 -8
  913. package/dist/utils/clipboard.js.map +1 -1
  914. package/dist/utils/version-check.d.ts.map +1 -1
  915. package/dist/utils/version-check.js +3 -1
  916. package/dist/utils/version-check.js.map +1 -1
  917. package/docs/changelog.mdx +12 -1
  918. package/docs/compaction.md +101 -18
  919. package/docs/custom-provider.md +13 -4
  920. package/docs/docs.json +1 -0
  921. package/docs/environment-variables.md +37 -0
  922. package/docs/extensions.md +45 -9
  923. package/docs/index.md +1 -0
  924. package/docs/intercom.md +1 -1
  925. package/docs/json.md +4 -4
  926. package/docs/keybindings.md +4 -2
  927. package/docs/llama-cpp.md +3 -1
  928. package/docs/models.md +29 -43
  929. package/docs/providers.md +18 -24
  930. package/docs/quickstart.md +19 -16
  931. package/docs/rpc.md +38 -85
  932. package/docs/sdk.md +15 -22
  933. package/docs/session-format.md +2 -15
  934. package/docs/sessions.md +1 -1
  935. package/docs/settings.md +10 -15
  936. package/docs/skills.md +8 -0
  937. package/docs/subagents.md +24 -8
  938. package/docs/themes.md +10 -1
  939. package/docs/tui.md +3 -3
  940. package/docs/usage.md +30 -2
  941. package/docs/windows.md +1 -1
  942. package/docs/workflows.md +1128 -522
  943. package/examples/extensions/README.md +1 -1
  944. package/examples/extensions/handoff.ts +8 -1
  945. package/examples/extensions/message-renderer.ts +2 -2
  946. package/examples/extensions/summarize.ts +3 -0
  947. package/examples/extensions/working-indicator.ts +2 -2
  948. package/npm-shrinkwrap.json +40 -46
  949. package/package.json +9 -7
  950. package/dist/builtin/cursor/CHANGELOG.md +0 -281
  951. package/dist/builtin/cursor/LICENSE +0 -26
  952. package/dist/builtin/cursor/README.md +0 -24
  953. package/dist/builtin/cursor/index.ts +0 -9
  954. package/dist/builtin/cursor/package.json +0 -47
  955. package/dist/builtin/cursor/src/auth.ts +0 -352
  956. package/dist/builtin/cursor/src/catalog-cache.ts +0 -155
  957. package/dist/builtin/cursor/src/config.ts +0 -123
  958. package/dist/builtin/cursor/src/conversation-state.ts +0 -135
  959. package/dist/builtin/cursor/src/cursor-models-raw.json +0 -412
  960. package/dist/builtin/cursor/src/model-mapper.ts +0 -369
  961. package/dist/builtin/cursor/src/model-reference.ts +0 -282
  962. package/dist/builtin/cursor/src/models.ts +0 -54
  963. package/dist/builtin/cursor/src/native-loader.ts +0 -71
  964. package/dist/builtin/cursor/src/proto/README.md +0 -34
  965. package/dist/builtin/cursor/src/proto/agent_pb.ts +0 -15294
  966. package/dist/builtin/cursor/src/proto/protobuf-codec-base64.ts +0 -22
  967. package/dist/builtin/cursor/src/proto/protobuf-codec-json.ts +0 -44
  968. package/dist/builtin/cursor/src/proto/protobuf-codec-request.ts +0 -311
  969. package/dist/builtin/cursor/src/proto/protobuf-codec-wire.ts +0 -248
  970. package/dist/builtin/cursor/src/proto/protobuf-codec.ts +0 -200
  971. package/dist/builtin/cursor/src/provider.ts +0 -301
  972. package/dist/builtin/cursor/src/stream.ts +0 -494
  973. package/dist/builtin/cursor/src/transport-errors.ts +0 -74
  974. package/dist/builtin/cursor/src/transport-frame.ts +0 -56
  975. package/dist/builtin/cursor/src/transport-http2.ts +0 -122
  976. package/dist/builtin/cursor/src/transport-native-client.ts +0 -161
  977. package/dist/builtin/cursor/src/transport-run-stream.ts +0 -188
  978. package/dist/builtin/cursor/src/transport-timeouts.ts +0 -87
  979. package/dist/builtin/cursor/src/transport-types.ts +0 -143
  980. package/dist/builtin/cursor/src/transport.ts +0 -26
  981. package/dist/builtin/workflows/builtin/deep-research-codebase-runner.ts +0 -492
  982. package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +0 -383
  983. package/dist/builtin/workflows/builtin/deep-research-codebase.d.ts +0 -35
  984. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +0 -47
  985. package/dist/builtin/workflows/skills/impeccable/scripts/hook-before-edit.mjs +0 -516
  986. package/dist/core/context-window.d.ts +0 -54
  987. package/dist/core/context-window.d.ts.map +0 -1
  988. package/dist/core/context-window.js +0 -110
  989. package/dist/core/context-window.js.map +0 -1
  990. package/dist/core/copilot-anthropic-sse-repair.d.ts +0 -23
  991. package/dist/core/copilot-anthropic-sse-repair.d.ts.map +0 -1
  992. package/dist/core/copilot-anthropic-sse-repair.js +0 -340
  993. package/dist/core/copilot-anthropic-sse-repair.js.map +0 -1
  994. package/dist/core/copilot-errors.d.ts +0 -9
  995. package/dist/core/copilot-errors.d.ts.map +0 -1
  996. package/dist/core/copilot-errors.js +0 -32
  997. package/dist/core/copilot-errors.js.map +0 -1
  998. package/dist/core/copilot-gemini-payload-sanitizer.d.ts +0 -72
  999. package/dist/core/copilot-gemini-payload-sanitizer.d.ts.map +0 -1
  1000. package/dist/core/copilot-gemini-payload-sanitizer.js +0 -296
  1001. package/dist/core/copilot-gemini-payload-sanitizer.js.map +0 -1
  1002. package/dist/core/copilot-gemini-reasoning.d.ts +0 -126
  1003. package/dist/core/copilot-gemini-reasoning.d.ts.map +0 -1
  1004. package/dist/core/copilot-gemini-reasoning.js +0 -265
  1005. package/dist/core/copilot-gemini-reasoning.js.map +0 -1
  1006. package/dist/core/copilot-gemini-tool-arguments.d.ts +0 -42
  1007. package/dist/core/copilot-gemini-tool-arguments.d.ts.map +0 -1
  1008. package/dist/core/copilot-gemini-tool-arguments.js +0 -159
  1009. package/dist/core/copilot-gemini-tool-arguments.js.map +0 -1
  1010. package/dist/core/copilot-hosts.d.ts +0 -12
  1011. package/dist/core/copilot-hosts.d.ts.map +0 -1
  1012. package/dist/core/copilot-hosts.js +0 -33
  1013. package/dist/core/copilot-hosts.js.map +0 -1
  1014. package/dist/core/copilot-model-catalog.d.ts +0 -114
  1015. package/dist/core/copilot-model-catalog.d.ts.map +0 -1
  1016. package/dist/core/copilot-model-catalog.js +0 -392
  1017. package/dist/core/copilot-model-catalog.js.map +0 -1
  1018. package/dist/core/copilot-model-static-fallbacks.d.ts +0 -43
  1019. package/dist/core/copilot-model-static-fallbacks.d.ts.map +0 -1
  1020. package/dist/core/copilot-model-static-fallbacks.js +0 -50
  1021. package/dist/core/copilot-model-static-fallbacks.js.map +0 -1
  1022. package/dist/core/copilot-model-synthesis.d.ts +0 -10
  1023. package/dist/core/copilot-model-synthesis.d.ts.map +0 -1
  1024. package/dist/core/copilot-model-synthesis.js +0 -91
  1025. package/dist/core/copilot-model-synthesis.js.map +0 -1
  1026. package/dist/modes/interactive/components/context-window-selector.d.ts +0 -53
  1027. package/dist/modes/interactive/components/context-window-selector.d.ts.map +0 -1
  1028. package/dist/modes/interactive/components/context-window-selector.js +0 -136
  1029. package/dist/modes/interactive/components/context-window-selector.js.map +0 -1
  1030. package/dist/modes/rpc/bounded-writer.d.ts +0 -27
  1031. package/dist/modes/rpc/bounded-writer.d.ts.map +0 -1
  1032. package/dist/modes/rpc/bounded-writer.js.map +0 -1
@@ -54,7 +54,7 @@ Workflow lifecycle notices are enabled by default. They send steer prompts into
54
54
  }
55
55
  ```
56
56
 
57
- Set `enabled` to `false` to disable all lifecycle notices, or narrow `notifyOn` to a non-empty list of selected events. Completion, failure, and blocked lifecycle notices are emitted for top-level workflow runs, use steer delivery, and wake an idle model so the lifecycle update enters the model context when it happens. Nested child workflow completion/failure is reflected inside the expanded parent graph instead of producing separate top-level completion cards. Awaiting-input states are tracked for dedupe/restore, but workflows do not enqueue main-chat `/workflow connect` cards for them; prompt state remains visible through workflow status/connect surfaces, avoiding stale actionable cards if a prompt resolves while the main chat is streaming.
57
+ Set `enabled` to `false` to disable all lifecycle notices, or narrow `notifyOn` to a non-empty list of selected events. Completion, failure, and blocked lifecycle notices are emitted for top-level workflow runs, use steer delivery, and wake an idle model so the lifecycle update enters the model context when it happens. When a fulfilled workflow body leaves admitted tool failures, the engine promotes the first admission and persists that exact tool origin for the failed notice. Ordinary body rejections retain their original error and failed graph nodes without claiming a tool origin because transparent native promises do not expose the source promise; this prevents a caught tool rejection from being misattributed when body code later throws the same object or primitive. Nested child workflow completion/failure is reflected inside the expanded parent graph instead of producing separate top-level completion cards. Awaiting-input states are tracked for dedupe/restore, but workflows do not enqueue main-chat `/workflow connect` cards for them; prompt state remains visible through workflow status/connect surfaces, avoiding stale actionable cards if a prompt resolves while the main chat is streaming.
58
58
 
59
59
  When a stage human-in-the-loop prompt is answered from the workflow TUI/stage chat, workflows also emits a separate display-only `workflows:hil-answer-notice` custom message. It records the answer for user-visible audit, but it does not wake the main agent, enter LLM context, or authorize answering later workflow prompts. Answers sent by the main-chat `workflow` tool do not emit this notice because the tool result already tells the main agent what happened.
60
60
 
@@ -62,9 +62,23 @@ When a stage human-in-the-loop prompt is answered from the workflow TUI/stage ch
62
62
 
63
63
  ## Authoring API
64
64
 
65
+ ### Dynamic topology is DAG-only
66
+
67
+ Atomic `workflow({ run })` definitions are imperative, dynamic TypeScript. Discovery loads modules and validates imports and definition shape, but it does not compile every `run` path into a complete graph or prove acyclicity. Runtime inputs, branches, loops, external data, model or human output, helpers, and nested workflows determine the materialized topology during execution.
68
+
69
+ **Cyclic workflow graphs are unsupported. Authors and coding agents MUST NOT create a self-edge or a dependency edge from the current frontier to an existing ancestor. Every materialized execution topology must remain a DAG. Redesign or stop before launch if a cycle cannot be removed.**
70
+
71
+ Sketch branches, loops, and nested boundaries before launch. Bounded loops must create distinct tracked work per iteration with stable identity and call order; never reopen an ancestor beneath its downstream work. Compose children through `ctx.workflow(...)` boundaries rather than recursive `run` invocation. Keep retained-session follow-up that creates no dependency work as activity, not a back-edge.
72
+
73
+ Execution, replay, and DBOS hydration are the authoritative topology-validation points. Runtime topology changes should add incremental edge checks and DBOS hydration validation; prompt guidance and TypeScript types cannot replace these checks.
74
+
65
75
  ### Workflow-owned side effects
66
76
 
67
- Prefer `ctx.tool(name, args, fn)` for workflow-owned TypeScript operations with side effects, including filesystem writes, network mutations, external API actions, and similar deterministic operations orchestrated directly by the workflow definition. Atomic durably caches a completed call's serializable result, so resume returns that result without rerunning `fn` or repeating the side effect. Keep pure computation and side-effect-free transformations as ordinary TypeScript. Do not wrap agent-stage internals or every function call indiscriminately.
77
+ Prefer `ctx.tool(name, args, fn)` for workflow-owned TypeScript operations with side effects, including filesystem writes, network mutations, external API actions, and similar deterministic operations orchestrated directly by the workflow definition. Each invocation creates a non-chat, non-attachable durable graph node before `fn` runs; it may appear before, between, after, or without model stages. Atomic durably caches a completed call's serializable result, so resume returns that result without rerunning `fn` or repeating the side effect. Tool-only workflows are valid tracked execution, while a normal return with no stage, child, tool, or explicit exit remains invalid. Keep pure computation and side-effect-free transformations as ordinary TypeScript. Do not wrap agent-stage internals or every function call indiscriminately. The executor closes tool admission before publishing any terminal outcome; calling a retained `ctx.tool` function afterward returns a rejected native promise and creates no callback, retry, graph node, or checkpoint.
78
+
79
+ Checks that may fail as part of a repair loop can opt into `failureMode: "return"`. That overload returns a typed `{ ok: true, value, attempts, cached } | { ok: false, error, attempts, cached }` outcome after configured retries. Failure details preserve exposed `exitCode`, `stdout`, and `stderr`; persisted text is best-effort secret-redacted and limited to 16 KiB per field. A recoverable failure keeps its tool node failed but lets author code continue. Replay returns the same durable outcome with `cached: true` and does not rerun the callback. Cancellation and storage faults still throw. Atomic never injects this evidence into a later prompt: pass the needed fields to a repair stage or artifact explicitly, and use distinct serializable arguments for each bounded rerun.
80
+
81
+ New tool checkpoints retain stable graph identity, invocation order, parents, and timing. A current-format checkpoint created before tool topology was added still replays safely: its cached output remains authoritative and the callback is never rerun. Root inspection derives deterministic fallback identity/order from checkpoint identity and record order; replay inside a child attempts to append topology metadata with the current child/boundary ownership without replacing the original output checkpoint. That additive migration write is best-effort: a storage rejection leaves the live replay cached in its inferred child, does not poison a later durable flush, and is retried by a later replay. Until one retry succeeds, a fresh completed inspection can only show the legacy record through the deterministic root fallback with topology unavailable; historical child ownership cannot be reconstructed from the old record alone. Fresh completed inspection reconstructs available tool topology but does not persist a workflow's declared root output; that existing limitation is separate from live `run()` output and graph correctness.
68
82
 
69
83
  ### Example 1 — Single task
70
84
 
@@ -186,36 +200,43 @@ Prefer regular TypeScript module imports for reusable child workflows: import th
186
200
  ```typescript
187
201
  import { workflow } from "@bastani/workflows";
188
202
  import { Type } from "typebox";
189
- import goal from "@bastani/workflows/builtin/goal";
190
- import sharedResearch from "./shared-research.js";
203
+ import { adversarialVerification, fanOutAndSynthesize } from "@bastani/workflows/builtin";
191
204
 
192
205
  export default workflow({
193
- name: "research-and-synthesize",
194
- description: "Run shared research, implement from it, then synthesize the result.",
195
- inputs: {
196
- topic: Type.String(),
197
- },
206
+ name: "research-and-verify",
207
+ description: "Map repository slices, synthesize cited evidence, then verify the report.",
208
+ inputs: { topic: Type.String() },
198
209
  outputs: {
199
- final: Type.String({ description: "Synthesis of the child research and implementation." }),
210
+ report_path: Type.String(),
211
+ approved: Type.Boolean(),
200
212
  },
201
213
  run: async (ctx) => {
202
- const child = await ctx.workflow(sharedResearch, {
203
- inputs: { topic: ctx.inputs.topic },
214
+ const research = await ctx.workflow(fanOutAndSynthesize, {
215
+ inputs: {
216
+ prompt: `Partition repository research for: ${ctx.inputs.topic}. Save cited findings per slice and synthesize conflicts.`,
217
+ max_branches: 6,
218
+ },
204
219
  });
220
+ if (research.exited) return ctx.exit({ status: research.status, reason: research.exitReason ?? "research stopped early" });
205
221
 
206
- const implementation = await ctx.workflow(goal, {
207
- inputs: { objective: `Implement improvements based on: ${String(child.outputs.summary)}` },
222
+ const verification = await ctx.workflow(adversarialVerification, {
223
+ inputs: { task: `Verify the cited report at ${research.outputs.synthesis_path}` },
208
224
  });
225
+ if (verification.exited) return ctx.exit({ status: verification.status, reason: verification.exitReason ?? "verification stopped early" });
209
226
 
210
- const final = await ctx.task("synthesize", {
211
- prompt: `Synthesize this research and implementation:\n\n${String(child.outputs.summary)}\n\n${String(implementation.outputs.result)}`,
212
- });
213
- return { final: final.text };
227
+ return {
228
+ report_path: research.outputs.synthesis_path,
229
+ approved: verification.outputs.approved,
230
+ };
214
231
  },
215
232
  });
216
233
  ```
217
234
 
218
- The child executes as a nested workflow behind a parent boundary stage named `workflow:<workflow-name>` by default, but user-facing status and graph views flatten it into the parent run. In practice it should feel like inlining the child workflow code: child stages, HIL prompt nodes, and deeper imported children appear in one expanded parent graph, while implementation-owned child run ids stay hidden from top-level `/workflow status` lists. The child still has a run id internally so the graph can attach to, pause, interrupt, or resume live child stages correctly. Inputs are strictly validated against the child workflow before it starts: unknown keys, missing required values, type mismatches, and invalid `select` choices fail before the child body runs. The parent receives the child's declared `outputs` on `child.outputs` after those outputs pass their declared runtime type checks.
235
+ The child executes as a nested workflow behind a parent boundary stage named `workflow:<workflow-name>` by default, but user-facing status and graph views recursively replace that boundary with a valid, non-empty child graph whose run reciprocally identifies the parent run and boundary stage. Every boundary parent connects to every child root, and every child terminal connects to each downstream dependent. Repeated or sibling children keep distinct virtual node ids and exact `{ runId, stageId }` control targets even when local stage ids or names collide, so attach, send, pause, interrupt, resume, stage selection, and post-mortem chat reach the true owning run and stage. Implementation-owned child runs stay out of top-level `/workflow status` lists.
236
+
237
+ For durable runs, Atomic writes and awaits a versioned boundary-start identity before child code can run. That record fixes the boundary id, child run id, owning root/parent, source order and parents, replay scope, alias, workflow, and a deterministic fingerprint of the child definition plus exact validated inputs across pause, process restart, cached replay, and completed inspection. Distinct-input parallel calls therefore keep their own cache even when restart reverses dispatch order; repeated identical calls share the fingerprint but retain a per-invocation ordinal. A completed child boundary and its `ctx.tool` side effects replay exactly once from the root's scoped checkpoints; only incomplete work continues.
238
+
239
+ If no valid child graph can stand in for the boundary—including a failed or skipped boundary, a missing or empty child graph, stale or mismatched ownership metadata, or a recursive link that cannot produce a valid expansion—the expanded graph keeps the boundary summary instead of flattening an unrelated or invalid child. Exact expanded ids resolve first; a local id, prefix, or stage name is accepted only when it identifies one visible stage. Inputs are strictly validated against the child workflow before it starts: unknown keys, missing required values, type mismatches, and invalid `select` choices fail before the child body runs. The parent receives the child's declared `outputs` on `child.outputs` after those outputs pass their declared runtime type checks.
219
240
 
220
241
  For workflows intended to be called as children, declare an `outputs` entry for every non-default field a parent should rely on. `outputs` is only the schema/contract: use normal TypeScript in `run()` to gather values from any stage/task/child workflow and return those keys.
221
242
 
@@ -249,11 +270,19 @@ Builtin workflows are also callable as modules for reuse:
249
270
 
250
271
  ```typescript
251
272
  import {
252
- adversarialVerification, classifyAndAct, deepResearchCodebase,
253
- fanOutAndSynthesize, generateAndFilter, goal, loopUntilDone,
254
- openClaudeDesign, ralph, tournament,
273
+ adversarialVerification,
274
+ classifyAndAct,
275
+ fanOutAndSynthesize,
276
+ generateAndFilter,
277
+ goal,
278
+ loopUntilDone,
279
+ openClaudeDesign,
280
+ ralph,
281
+ tournament,
255
282
  } from "@bastani/workflows/builtin";
283
+ import fanOutAndSynthesizeWorkflow from "@bastani/workflows/builtin/fan-out-and-synthesize";
256
284
  import goalWorkflow from "@bastani/workflows/builtin/goal";
285
+ import ralphWorkflow from "@bastani/workflows/builtin/ralph";
257
286
  import openClaudeDesignWorkflow from "@bastani/workflows/builtin/open-claude-design";
258
287
  ```
259
288
 
@@ -546,7 +575,7 @@ Tradeoff: `Type.Unsafe<T>()` does not deeply validate at runtime — it trusts t
546
575
  | `/workflow list` | List all registered workflows with descriptions |
547
576
  | `/workflow status [run-id]` | Show active plus retained terminal/current-session runs, or details for one run |
548
577
  | `/workflow connect [run-id]` | Open a workflow run graph |
549
- | `/workflow attach [run-id] [stage]` | Open the attach/chat pane for a run or stage |
578
+ | `/workflow attach [run-id] [stage]` | Open live stage chat or explicit terminal post-mortem chat |
550
579
  | `/workflow pause [run-id] [stage]` | Pause a live run or stage |
551
580
  | `/workflow interrupt [run-id\|--all]` | Pause active/named/all active runs so they can resume |
552
581
  | `/workflow quit [run-id\|--all]` | Gracefully pause live workflow runs so they can resume later |
@@ -560,15 +589,15 @@ Named workflow launches always run as **background tasks** in interactive sessio
560
589
 
561
590
  Named launches return only after startup admission, while the admitted workflow body and stages remain background work. Pre-body setup failures (including invalid input-bound reusable worktrees) are returned immediately from the original tool call as structured failed results with the concrete error and allocated run id; Atomic does not first claim that the workflow started, and it removes the unadmitted run so corrected inputs can be retried immediately. Failures after admission continue to use normal background status and lifecycle notices.
562
591
 
563
- Graceful quit is idempotent for already-paused runs and preserves unresolved `ctx.ui` prompts in DBOS. Stable author-callsite-and-composed-nested-scope reservations are created before prompting and released by exact current-format token generation after answer checkpoint, rejection, or abort. Answering while quit/paused cannot advance workflow code until explicit resume.
592
+ Graceful quit is idempotent for already-paused runs and preserves unresolved `ctx.ui` prompts in DBOS. Pausing or interrupting a stage also holds every queued steering and follow-up item in place: no queued turn, late context-bearing delivery, or workflow continuation starts while the stage is paused, and the existing `resume` action releases the items once in their existing per-queue order without queue release itself starting a provider turn. Stable author-callsite-and-composed-nested-scope reservations are created before prompting and released by exact current-format token generation after answer checkpoint, rejection, or abort. Answering while quit/paused cannot advance workflow code until explicit resume.
564
593
 
565
594
  Workflow durability requires DBOS/Postgres. Atomic configures and launches DBOS lazily on the first workflow action, reuses that process-wide instance, and awaits readiness before durable execution or control. Initialization or persistence failures fail the workflow action; no alternate backend is selected. `DBOS_SYSTEM_DATABASE_URL` selects an existing database when supplied; otherwise Atomic runs DBOS against its own embedded Postgres (npm-distributed binaries, detached `pg_ctl` daemon under `~/.atomic/postgres` on port 5439, shared across sessions and never stopped by Atomic), with DBOS's `dbos-db` Docker container only as a platform fallback. Concurrent Atomic sessions safely share one database: unique per-process executor ids, owner/heartbeat metadata on running workflows, and first-writer-wins claims on contended status transitions prevent double dispatch. Running workflows never appear as resume targets in any session; stale-heartbeat (crashed) ones surface as red `crashed` rows, paused rows render yellow, failed/blocked red, completed green, and the open picker live-updates on local changes plus a bounded cross-session poll.
566
595
 
567
- DBOS is the only durable catalog for resume, completed inspection, deletion, and targeted lookup. Session JSONL files remain chat transcripts only. Atomic reads and writes one current format; prior local workflow state and older DBOS records are not converted or discovered.
596
+ DBOS is the only durable catalog for resume, completed inspection, deletion, and targeted lookup. Session JSONL files remain chat transcripts only. Atomic reads one current durable format and does not convert prior local state or pre-current DBOS records. A completed current-format child checkpoint created before boundary-start or invocation-fingerprint identity existed is shown only when its child checkpoints reciprocally prove the same root, parent run, boundary, child owner, and scope. Active checkpoints without a provable invocation fingerprint, and malformed, duplicate, stale, nonreciprocal, mixed, aliased, cyclic, orphaned, or unsupported topology, fail closed before cache exposure or child/control dispatch: Atomic does not invent a child link or execute child code to repair it.
568
597
 
569
- Nested `ctx.workflow(...)` calls are displayed as an expanded graph within the top-level run. `/workflow status` and run pickers list only top-level user-launched workflows, not implementation-owned child runs. The `workflow` tool's `stages`, `stage`, `transcript`, `send`, `pause`, `interrupt`, and `resume` actions can still target visible child stage ids, prefixes, or names from the expanded graph; Atomic routes the control action to the owning nested run internally. The run-level `quit` action targets the selected top-level run or all live top-level runs. (`stages`, `stage`, `transcript`, and `send` are `workflow` tool actions, not `/workflow` slash subcommands; the slash command exposes `connect`, `attach`, `pause`, `list`, `status`, `interrupt`, `quit`, `resume`, `reload`, and `inputs`.)
598
+ Nested `ctx.workflow(...)` calls are displayed as an expanded graph within the top-level run. `/workflow status` and run pickers list only top-level user-launched workflows, not implementation-owned child runs. After a fresh process starts, active and completed graphs retain source stage ids, order, parent edges, lifecycle status, boundary ownership, and exact `{ runId, stageId }` control targets. The `workflow` tool's `stages`, `stage`, `transcript`, `pause`, `interrupt`, and `resume` actions route a uniquely identified visible child stage to that nested owner; `send` uses the same routing only while the root is nonterminal, and ambiguous local ids or names are rejected. Run-level `quit` still targets the selected top-level run or all live top-level runs. Completed graph inspection is read-only even when no stage transcript remains. `/workflow attach <root-run> <nested-stage>` remains the explicit user-driven path for retained post-mortem chat and routes to the true child owner without resuming or mutating execution. Programmatic `workflow send` rejects terminal roots before nested-owner routing or session probing. (`stages`, `stage`, `transcript`, and `send` are `workflow` tool actions, not `/workflow` slash subcommands; the slash command exposes `connect`, `attach`, `pause`, `list`, `status`, `interrupt`, `quit`, `resume`, `reload`, and `inputs`.)
570
599
 
571
- Prompt answer replay is live-memory only. `StageSnapshot.promptAnswerState` reports whether continuation can replay a prompt answer (`available`), must ask again because the private ledger entry is gone (`unavailable`), or must ask again because multiple matching prompt nodes are ambiguous (`ambiguous`). Raw answers stay in a private `PromptAnswerRecord` ledger, are never serialized to snapshots or persistence, and remain resident in memory until the answer is cleared, the run is removed, or the store is cleared. Replay keys include prompt kind, message text, select choices, input/editor initial value, custom prompt identity hash, and hashed author callsite, so changing any of those inputs may intentionally re-ask on continuation. Empty `ctx.ui.select(..., [])` calls throw before creating a prompt node. Arbitrary custom-widget answers cannot be supplied with `workflow send`; focus the `custom` awaiting-input node in the interactive graph instead.
600
+ Raw stage-chat prompt answer replay is live-memory only. `StageSnapshot.promptAnswerState` reports whether continuation can replay a raw stage-chat answer (`available`), must ask again because the private ledger entry is gone (`unavailable`), or must ask again because multiple matching prompt nodes are ambiguous (`ambiguous`). Raw answers stay in a private `PromptAnswerRecord` ledger, are never serialized to snapshots or persistence, and remain resident in memory until the answer is cleared, the run is removed, or the store is cleared. Durable `ctx.ui` responses are separate DBOS checkpoints: resume returns those cached responses without asking again, and graph-backed UI re-materializes the answered prompt node from metadata. Replay keys include prompt kind, message text, select choices, input/editor initial value, custom prompt identity hash, and hashed author callsite, so changing any of those inputs may intentionally re-ask on continuation. Empty `ctx.ui.select(..., [])` calls throw before creating a prompt node. Arbitrary custom-widget answers cannot be supplied with `workflow send`; focus the `custom` awaiting-input node in the interactive graph instead.
572
601
 
573
602
  ### `workflow` tool (LLM-callable)
574
603
 
@@ -577,7 +606,7 @@ Prompt answer replay is live-memory only. `StageSnapshot.promptAnswerState` repo
577
606
  ```json
578
607
  {
579
608
  "name": "workflow",
580
- "description": "Run named builtin, project, user, or package workflows; custom definitions may import reusable project/package workflows or builtin definitions from @bastani/workflows/builtin and nest them with ctx.workflow(...), including deeper composition within the configured maxDepth; when workflow execution fits but another shape would better achieve the task, author a custom TypeScript workflow({...}) inline with normal coding tools, reload it, and run it; discover with list/get/inputs/models, list session runs with status (no runId; statusFilter narrows the list), inspect status/stages/stage details, send prompt answers or steering, pause/resume/interrupt/quit runs, and reload workflow resources. For large stage handoffs, write context to files/artifacts, pass paths via reads, and prompt downstream agents to 'Read the file at <path>...' instead of injecting large previous text. For transcripts, prefer status/stages/stage to get sessionFile/transcriptPath, quote the exact path without rewriting separators (Windows backslashes are valid), then search it with rg/grep and read small ranges; transcript is path-only by default when sessionFile/transcriptPath exists, explicit tail/limit returns bounded previews, and missing transcript paths fall back to a small preview. Use action 'models' to inspect models in the configured catalog; the result is a configured-auth snapshot showing what's present in the registry with configured authentication, not proof of credentials, entitlements, OAuth freshness, or live provider access. When authoring a workflow that should dynamically select a model, first call workflow({ action: 'models' }) to inspect the configured catalog, then select from the returned provider/id entries considering the isCurrent marker and available thinking levels.",
609
+ "description": "Run named builtin, project, user, or package workflows; custom definitions may import reusable project/package workflows or builtin definitions from @bastani/workflows/builtin and nest them with ctx.workflow(...), including deeper composition within the configured maxDepth; when workflow execution fits but another shape would better achieve the task, author a custom TypeScript workflow({...}) inline with normal coding tools, reload it, and run it; discover with list/get/inputs/models, list session runs with status (no runId; statusFilter narrows the list), inspect status/stages/stage details, send prompt answers or steering only while the root workflow is nonterminal, pause/resume/interrupt/quit runs, and reload workflow resources. For large stage handoffs, write context to files/artifacts, pass paths via reads, and prompt downstream agents to 'Read the file at <path>...' instead of injecting large previous text. For transcripts, prefer status/stages/stage to get sessionFile/transcriptPath, quote the exact path without rewriting separators (Windows backslashes are valid), then search it with rg/grep and read small ranges; transcript is path-only by default when sessionFile/transcriptPath exists, explicit tail/limit returns bounded previews, and missing transcript paths fall back to a small preview. Use action 'models' to inspect models in the configured catalog; the result is a configured-auth snapshot showing what's present in the registry with configured authentication, not proof of credentials, entitlements, OAuth freshness, or live provider access. When authoring a workflow that should dynamically select a model, first call workflow({ action: 'models' }) to inspect the configured catalog, then select from the returned provider/id entries considering the isCurrent marker and available thinking levels.",
581
610
  "parameters": {
582
611
  "workflow": "string (optional) — workflow ID or normalized name",
583
612
  "inputs": "object (optional) — key/value map of workflow inputs",
@@ -603,7 +632,7 @@ Prompt answer replay is live-memory only. `StageSnapshot.promptAnswerState` repo
603
632
  - **`renderCall`** — renders a compact workflow call summary in the chat scroll.
604
633
  - **`renderResult`** — renders the result or dispatch banner; live progress continues through the widget and graph viewer. Named workflow runs are background-oriented.
605
634
  - **`transcript`** — path-only by default when a transcript file exists: use `status`, `stages`, or `stage` to identify the stage and its `sessionFile`/`transcriptPath`, quote the exact path without changing platform separators (for example, preserve Windows backslashes), then search that file with `rg`/`grep` for targeted terms and read only small surrounding ranges. Default text results include JSON-escaped `sessionFileJson`/`transcriptPathJson` lines for copy-safe path literals plus a `lazyReadPrompt`, with `entries: not inlined` so transcript bodies and tool outputs stay out of model context. Passing explicit `tail` or `limit` opts into a bounded inline preview for quick context checks. If no transcript path is available, the action falls back to a bounded preview of up to 5 recent entries with a `fallbackNote`. A registered live stage handle is used when one exists, even before live messages arrive; otherwise the action falls back to stored stage snapshots. Snapshot entries are ordered chronologically before `tail`/`limit` is applied, with terminal result/error entries kept after tool entries when timestamps are missing or tied. `includeToolOutput` applies only to inlined snapshot previews or no-path fallback previews; live session transcripts may not expose tool output.
606
- - **`send`** — answers pending primitive/structured stage prompts only when `text`, `response`, or `message` is present; an explicit empty string is a valid answer, while an omitted payload is a no-op. Follow-ups to eligible terminal agent stages revive an interactive **post-mortem chat** through the shared resolver: on a live-handle miss the stage's retained `sessionFile` is validated (existing, readable, context-bearing) and reopened as a detached, single-flight handle so the message is delivered as a conversational follow-up appended in place the same path used by `/workflow attach`, restored/replayed durable snapshots, and completed-workflow inspection without resuming, retrying, or re-dispatching workflow execution. If no valid retained session exists, the follow-up is refused (`No live handle for stage.`) instead of silently resetting or exposing a handle-less non-terminal session. Arbitrary `ctx.ui.custom<T>` widget prompts require the interactive workflow graph and return a clear unsupported message when targeted through `send`. `delivery: "auto"` answers pending prompts first, then resumes paused stages, steers streaming stages, or queues a follow-up.
635
+ - **`send`** — operates only while the authoritative root workflow is nonterminal. It answers pending primitive/structured stage prompts only when `text`, `response`, or `message` is present; an explicit empty string is a valid answer, while an omitted payload is a no-op. `delivery: "auto"` answers pending prompts first, then resumes paused stages, steers streaming stages, or starts/queues the eligible live turn. Terminal `completed`, `failed`, `skipped`, `cancelled`, `killed`, and terminal `blocked` roots fail closed with `status: "failed"`, `code: "WORKFLOW_TERMINAL"`, `delivery: "rejected"`, the requested root id/status, and guidance to start a new workflow (or proceed inline only for small, deterministic, low-risk work). The preflight guard rejects already-terminal roots before stage resolution, nested-owner routing, prompt inspection, retained-session probing/revival, handle lookup, message admission, or delivery selection, so it creates no session/handle/model/tool/file work, appends no transcript, answers no input, and mutates no workflow/stage snapshot. Missing or malformed retained sessions receive the same error without probing. A second check against the same shared authority runs at final synchronous SDK admission: if a live root terminates while retained-session creation is pending, Atomic rejects the send, disposes its unclaimed provisional session/handle, and starts no prompt, model, tool/file, transcript, or workflow-state work. Concurrent explicit `/workflow attach` or Intercom claims remain independent. Use `/workflow attach <run-id> <stage>` as the user-driven post-mortem path; that chat can append to a valid retained session but never resumes or changes workflow execution state.
607
636
  - **`reload`** — refreshes workflow resources directly in-process instead of queuing a literal `/workflow reload` chat follow-up.
608
637
  - **`models`** — returns safe model-catalog metadata from the configured registry. Each entry contains `provider` (e.g. `openai`), `id` (e.g. `gpt-4`), `fullId` (e.g. `openai/gpt-4`), `isCurrent` (whether this is the active model), and `availableThinkingLevels`, canonically derived from the registry model's `reasoning` and `thinkingLevelMap` metadata. The result is a configured-auth snapshot: it shows which models are present in the registry with configured authentication, not proof of credentials, entitlements, OAuth freshness, or live provider access. No secrets, tokens, or authentication details are returned.
609
638
 
@@ -647,6 +676,8 @@ For large handoffs, prefer artifact paths over prompt injection: write stage out
647
676
 
648
677
  Workflow stage sessions follow Atomic SDK directory defaults: `DefaultResourceLoader` is initialized with the project `cwd` and the Atomic default `~/.atomic/agent` directory, while legacy `.pi` paths remain readable where the SDK supports multiple config directories. A stage-supplied `agentDir` is treated as an explicit user override; a stage-supplied `resourceLoader` owns discovery, with `cwd`/`agentDir` left for session naming and tool path resolution.
649
678
 
679
+ Custom `AgentSessionAdapter` runtimes may optionally expose `queuedMessagesPaused`, `pauseQueuedMessages()`, and `resumeQueuedMessages()` on public `StageSessionRuntime`. Existing adapters that omit them retain the prior fallback pause behavior: the active call is aborted and runner-admitted public deliveries stay deferred until explicit resume. When both methods are present, Atomic uses the stronger native hold so raw queued steer/follow-up work is gated before abort settles and released without starting a provider turn. Atomic's official runtime implements this optional capability.
680
+
650
681
  To inspect a workflow's input schema inside pi, use `/workflow inputs <name>` or `/workflow <name> --help`.
651
682
 
652
683
  ---
@@ -692,68 +723,39 @@ const convergence = await ctx.workflow(loopUntilDone, {
692
723
 
693
724
  The parent can consume `fixes.outputs`, `verification.outputs`, and `convergence.outputs` directly, and can repeat the verification child per patch when its own typed input lists individual patch artifacts.
694
725
 
695
- ### `deep-research-codebase`
726
+ ### Repository-wide research
696
727
 
697
- Heavy research for tasks requiring comprehensive, whole-repository context.
728
+ For broad repository uncertainty, compose `fan-out-and-synthesize` with a partition prompt that produces distinct subsystem slices, writes each branch to an artifact, and requires the synthesis barrier to cite concrete paths and resolve conflicting findings. Use `/skill:research-codebase` when one focused subsystem or question is enough.
698
729
 
699
730
  ```text
700
- /workflow deep-research-codebase prompt="How does session persistence work?"
731
+ /workflow fan-out-and-synthesize prompt="Partition session persistence by subsystem, save cited findings per branch, and synthesize the end-to-end flow"
701
732
  ```
702
733
 
703
- | Input | Type | Required | Default | Description |
704
- | ----------------- | -------- | -------- | ------- | --------------------------------------------------------- |
705
- | `prompt` | `text` | ✓ | — | Research question or topic to investigate. |
706
- | `max_partitions` | `number` | — | `100` | Maximum number of codebase partitions to explore. |
707
- | `max_concurrency` | `number` | — | `100` | Maximum number of workflow stages to run concurrently. |
734
+ ### Task-specific implementation and review
708
735
 
709
- Final Markdown research documents are written to dated `research/` paths relative to the current working directory, with a numeric suffix if needed to avoid overwriting an existing document. Hidden run artifacts are written under `research/.deep-research-<run-id>/`.
710
-
711
- Child workflow outputs: `result`, `findings`, `research_doc_path`, `artifact_dir`, `manifest_path`, `partitions`, `explorer_count`, `specialist_count`, `max_concurrency`, and `history`.
736
+ Domain-specific implementation should use a custom worker fresh verifier reducer graph when no installed pattern covers the complete contract. Keep literal acceptance criteria visible to each reviewer, execute deterministic checks through workflow-owned tools, consolidate evidence-backed findings into bounded repair rounds, and stop on explicit approval, blocked evidence, or iteration exhaustion. Keep PR/MR creation, release, deployment, and publication as separately authorized post-approval actions.
712
737
 
713
738
  ### `goal`
714
739
 
715
- Goal Runner workflow: initialize a persisted goal ledger with a per-run goal id, immutable `acceptance_criteria`, and lifecycle events, render goal-continuation context, run bounded worker LM turns, append receipts, run three independent reviewers with objective-alignment findings and clause-by-clause requirements traceability, let a TypeScript reducer decide `complete`, `continue`, `blocked`, or `needs_human`, and optionally run a final-stage PR handoff after approval. All three reviewers start in clean, non-forked contexts like Ralph's reviewers and use Ralph's exact `reviewer-a` model chain, led by Claude Fable 5. At review start, every concurrent reviewer checks Intercom, discovers sibling reviewers in the same run, communicates its validation plan, and coordinates ownership and serialization of expensive, lock-prone, or conflicting shared-checkout/shared-environment commands. Reviewers announce coordinated check starts and finishes, release claimed resources, and share reusable execution evidence while still independently inspecting the patch and producing their own verdicts. Workers begin from an observable acceptance/contract matrix derived from the literal objective/acceptance criteria and are prompted to model states, transitions, and invariants explicitly for stateful work; each review round's findings are consolidated into a deduplicated cross-reviewer batch (`consolidated_findings` in the round artifact) that the next worker turn repairs together, with durable regression evidence required for reproduced findings. Reviewers independently derive adversarial checks from the literal contract before relying on the worker receipt or worker-authored tests. Workers and reviewers are prompted to verify user-visible behavior end-to-end when practical with `playwright-cli`-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios; they must assume credentials/auth/environment access exists until concrete checks plus an actual app/flow launch attempt prove otherwise, and skipped E2E must cite exact attempted commands and observed failure output. Reviewers also look for any QA E2E video referenced by the ledger or receipt and inspect the actual video before treating it as proof. Token budget behavior is intentionally excluded. Goal skips PR creation by default; prompt text alone does not opt in. Pass `create_pr=true` to authorize only the final `pull-request` stage to inspect provider credentials and attempt provider-appropriate PR/MR/review creation after Goal reaches `complete` within the turn budget.
716
-
717
- Resource release is itself a coordinated update: after releasing a claim, the reviewer explicitly notifies its siblings through Intercom rather than treating release as a silent local action.
740
+ Goal runs a bounded autonomous implementation loop with a durable objective ledger, immutable acceptance criteria, sub-agent orchestration receipts, parallel reviewers, and a deterministic reducer. It returns `complete`, `blocked`, or `needs_human`; set `create_pr=true` only to authorize the final PR/MR/review stage after approval.
718
741
 
719
742
  ```text
720
- /workflow goal objective="Migrate the database layer to Drizzle ORM" base_branch=develop
721
- /workflow goal objective="Migrate the database layer to Drizzle ORM and open a PR when complete" base_branch=develop create_pr=true
743
+ /workflow goal objective="Update CLI docs, add one example, and validate the docs build"
722
744
  ```
723
745
 
724
- | Input | Type | Required | Default | Description |
725
- | ------------- | -------- | -------- | ------------- | ------------------------------------------------------------- |
726
- | `objective` | `text` | ✓ | — | Goal-runner objective or delta. |
727
- | `acceptance_criteria` | `text` | — | objective | Original immutable task contract; pass the original task text when launching follow-up Goal runs from reviewer findings. |
728
- | `max_turns` | `number` | — | `10` | Maximum worker/review turns before human follow-up is needed. |
729
- | `base_branch` | `string` | — | `origin/main` | Branch reviewers and the optional final stage compare the current delta with. |
730
- | `create_pr` | `boolean` | — | `false` | Safe-by-default PR creation flag. Omitted or `false` skips the final `pull-request` stage and omits `pr_report`; prompt text alone does not opt in, and only strict `true` authorizes the final `pull-request` stage to attempt provider-appropriate PR/MR/review creation after Goal reaches `complete`. |
731
-
732
- `goal` defaults to 10 worker/review turns. Reviewer quorum is fixed internally at 2 reviewer `complete` votes, and approval is deterministic on each reviewer's self-reported `stop_review_loop` boolean: a reviewer approves exactly when it returns `stop_review_loop=true` with no `reviewer_error` (parse failures count as non-approval), and the reducer completes the run when quorum of those booleans is met. Findings and `requirements_traceability` remain required audit evidence and drive the reviewer prompts that derive the flag (`required_by_objective` findings mean `false` at any priority, P3 included; `consistent_with_objective` P3 nice-to-haves, out-of-scope observations, the quorum process itself, and the authorized post-approval PR final action must not hold the flag at `false`), but the harness does not recompute approval from those arrays. Without quorum, the decision reason records the reviewers' remaining work, and the bounded loop stops inspectably at `max_turns` as `needs_human`. The repeated-blocker threshold defaults to 3 consecutive same-blocker turns and is clamped to `max_turns` when you run fewer than 3 turns.
733
-
734
- Child workflow outputs: `result`, `status`, `approved`, `goal_id`, `objective`, `acceptance_criteria`, `ledger_path`, `turns_completed`, `iterations_completed`, `receipts`, `remaining_work`, `review_report`, and `review_report_path`. `pr_report` is included only when `create_pr=true`, Goal reaches `complete`, and the final `pull-request` stage runs.
746
+ Inputs: required `objective`; optional `acceptance_criteria`, `max_turns=10`, `base_branch=origin/main`, `git_worktree_dir=""`, and `create_pr=false`.
735
747
 
736
748
  ### `ralph`
737
749
 
738
- Raw prompt prompt-engineering research → orchestrate → review workflow with optional final-stage PR handoff: use the raw prompt as the operative objective, keep optional `acceptance_criteria` as the immutable original task contract (defaulting to `prompt`), transform the prompt into a codebase and online research question with `/skill:prompt-engineer`, run `/skill:research-codebase` against it, write findings under `research/`, delegate implementation through sub-agents from that research, run parallel reviewers across Claude Fable 5 and GPT-5.5 Codex model families, and iterate until approval or the loop limit. At review start, each concurrent Ralph reviewer checks Intercom, discovers same-run sibling reviewers, communicates its validation plan, claims expensive or lock-prone checks, and coordinates serialization of conflicting shared-checkout/shared-environment commands. Reviewers announce coordinated check starts and finishes, release claimed resources, and share reusable command evidence, but each still independently inspects the patch and returns its own verdict. Ralph's research, orchestrator, and reviewer prompts receive the objective next to the literal acceptance contract; when launching follow-up Ralph runs from reviewer findings, pass the ORIGINAL task text as `acceptance_criteria` so deltas cannot drift from the contract. The orchestrator begins from an observable acceptance/contract matrix derived from the literal prompt/acceptance criteria, models states/transitions/invariants explicitly for stateful work, and repairs unresolved reviewer findings as one consolidated batch (the round artifact carries a deduplicated cross-reviewer `consolidated_findings` list) with durable regression evidence for reproduced findings. Reviewers independently derive adversarial checks from the literal contract before relying on the implementation notes, orchestrator report, or worker-authored tests, and each reviewer derives a single authoritative `stop_review_loop` boolean from that evidence (`required_by_objective` findings mean `false` at any priority, P3 included, while `consistent_with_objective` P3 nice-to-haves stay non-blocking); the loop gate approves deterministically on that boolean plus a null `reviewer_error` without recomputing approval from the findings arrays. Ralph's orchestrator and reviewers are prompted to verify user-visible behavior end-to-end when practical with `playwright-cli`-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios. They must assume credentials/auth/environment access exists until concrete non-destructive checks plus an actual launch/flow attempt prove otherwise; skipped E2E is valid only when exact attempted commands and observed failure output are recorded. For UI-applicable or full-stack changes, the orchestrator runs a `playwright-cli` end-to-end QA pass and records a reviewable proof video, references it in the implementation notes, and exposes it as the `qa_video_path` output; reviewers receive that path and inspect the actual video before treating it as proof. Review decisions include `requirements_traceability`, a non-empty clause-by-clause map over every prompt/acceptance-criteria requirement kept as audit evidence for deriving the flag; worker-authored tests/snapshots passing are circular evidence unless tied to independent current-state proof, and process-only clauses (reviewer quorum, the authorized post-approval PR final action) must never hold `stop_review_loop` at `false`. When `create_pr=true`, the final `pull-request` stage attaches or links that video to the created PR/MR/review. Follow-up iterations pass unresolved review artifacts into prompt-engineering/research and fork research from prior research session data when available. Ralph skips PR creation by default; prompt text alone does not opt in. Pass `create_pr=true` to authorize only the final `pull-request` stage to inspect provider credentials and attempt provider-appropriate PR/MR/review creation (for example GitHub `gh`, Azure Repos `az repos pr create`, or Sapling/Phabricator tooling). Ralph's own PR-creation instructions live in that final stage. Reviewers inspect repository infrastructure directly as needed; Ralph no longer runs separate `infra-*` discovery stages.
739
-
740
- Resource release is itself a coordinated update: after releasing a claim, the reviewer explicitly notifies its sibling through Intercom rather than treating release as a silent local action.
750
+ Ralph runs prompt refinement, codebase research, delegated implementation, and independent multi-model review in a bounded loop. It can start from a task, issue, or spec path; set `create_pr=true` only to authorize the post-approval final stage.
741
751
 
742
752
  ```text
743
- /workflow ralph prompt="Migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop
744
- /workflow ralph prompt="Migrate the database layer to Drizzle ORM" max_loops=3 base_branch=develop create_pr=true
753
+ /workflow ralph prompt="Implement specs/rate-limit.md and validate burst traffic" max_loops=3
745
754
  ```
746
755
 
747
- | Input | Type | Required | Default | Description |
748
- | --------------------- | --------- | -------- | ------------- | ------------------------------------------------------------- |
749
- | `prompt` | `text` | ✓ | — | Task, feature request, issue summary, or spec path to research, execute, refine, and review. |
750
- | `acceptance_criteria` | `text` | — | prompt | Original immutable task contract; pass the original task text when launching follow-up Ralph runs from reviewer findings. |
751
- | `max_loops` | `number` | — | `10` | Maximum research/orchestrate/review iterations before completion or optional final handoff. |
752
- | `base_branch` | `string` | — | `origin/main` | Branch reviewers and the optional final stage compare the current delta with; also used to create a missing worktree. |
753
- | `git_worktree_dir` | `string` | — | `""` | Optional reusable Git worktree root. Empty runs in the invoking checkout; non-empty values run Ralph stages in the created/reused worktree. |
754
- | `create_pr` | `boolean` | — | `false` | Safe-by-default PR creation flag. Omitted or `false` skips the final `pull-request` stage and omits `pr_report`; prompt text alone does not opt in, and only strict `true` authorizes the final `pull-request` stage to attempt provider-appropriate PR/MR/review creation. |
756
+ Inputs: required `prompt`; optional `acceptance_criteria`, `max_loops=10`, `base_branch=origin/main`, `git_worktree_dir=""`, and `create_pr=false`.
755
757
 
756
- Child workflow outputs: `result`, `plan` (latest transformed research question), `plan_path` (compatibility alias for `research_path`), `research`, `research_path`, `implementation_notes_path`, `qa_video_path` (reviewable QA end-to-end proof video recorded with `playwright-cli` for UI-applicable changes, when produced), `approved`, `iterations_completed`, `review_report`, and `review_report_path`. `pr_report` is included only when `create_pr=true` and the final `pull-request` stage runs.
758
+ For either workflow, keep PR/MR creation out of the task text and pass the original task as `acceptance_criteria` on follow-up runs to prevent contract drift.
757
759
 
758
760
  ### `open-claude-design`
759
761
 
@@ -25,11 +25,6 @@ declare module "@bastani/workflows/builtin/classify-and-act" {
25
25
  export { default } from "@bastani/atomic/workflows/builtin/classify-and-act";
26
26
  }
27
27
 
28
- declare module "@bastani/workflows/builtin/deep-research-codebase" {
29
- export * from "@bastani/atomic/workflows/builtin/deep-research-codebase";
30
- export { default } from "@bastani/atomic/workflows/builtin/deep-research-codebase";
31
- }
32
-
33
28
  declare module "@bastani/workflows/builtin/fan-out-and-synthesize" {
34
29
  export * from "@bastani/atomic/workflows/builtin/fan-out-and-synthesize";
35
30
  export { default } from "@bastani/atomic/workflows/builtin/fan-out-and-synthesize";
@@ -1,15 +1,18 @@
1
+ const GROUNDED_REPORTING = "Before reporting progress, audit each claim against a tool result from this session. Report only work you can point to evidence for; say so explicitly when something is unverified.";
2
+ const READABLE_REPORT = "Lead with the outcome. Keep facts, decisions, caveats, and next steps; drop background and repetition. Use complete, readable sentences rather than compressed fragments.";
3
+
1
4
  export function renderWorkerPrompt(task: string): string {
2
- return `<role>\nYou produce a candidate solution for independent verification.\n</role>\n\n<objective>\n${task}\n</objective>\n\n<requirements>\nComplete the task, preserve concrete evidence, and state every validation performed. Do not claim success without observable support.\n</requirements>\n\n<output_format>\nA self-contained candidate with actions taken, evidence, validation, and remaining risks.\n</output_format>`;
5
+ return `<role>\nYou produce a candidate solution for independent verification.\n</role>\n\n<success_criteria>\nThe task is complete and important claims have observable support. Preserve concrete evidence and state every validation performed.\n</success_criteria>\n\n<stop_rules>\nStop when the candidate is complete and validated where practical, or state the evidence still missing.\n</stop_rules>\n\n<output_format>\nA self-contained candidate with actions taken, evidence, validation, and remaining risks. ${READABLE_REPORT}\n${GROUNDED_REPORTING}\n</output_format>\n\n<objective>\n${task}\n</objective>`;
3
6
  }
4
7
 
5
8
  export function renderVerifierPrompt(task: string, candidatePath: string, rubricPath: string): string {
6
- return `<role>\nYou are an independent adversarial verifier. Find blockers; do not rewrite the candidate.\n</role>\n\n<objective>\nVerify the candidate against the task and rubric. Task: ${task}\n</objective>\n\n<artifacts>\nRead the complete candidate at ${candidatePath} and rubric at ${rubricPath}.\n</artifacts>\n\n<requirements>\nTest important claims where practical. A pass requires concrete evidence for every rubric item. Report precise blocking findings; absence of evidence is not evidence of correctness.\n</requirements>\n\n<output_format>\nCall structured_output with verdict (pass or fail), evidence, and blocking_findings.\n</output_format>`;
9
+ return `<artifacts>\nRead the complete candidate at ${candidatePath} and rubric at ${rubricPath}.\n</artifacts>\n\n<role>\nYou are an independent adversarial verifier. Find blockers; do not rewrite the candidate.\n</role>\n\n<success_criteria>\nA pass requires concrete evidence for every rubric item; absence of evidence is not evidence of correctness.\n</success_criteria>\n\n<evidence_rules>\nTest important claims where practical. For each conclusion, report the command run, observed output, and file:line evidence where applicable. Report precise blocking findings. ${GROUNDED_REPORTING}\n</evidence_rules>\n\n<stop_rules>\nStop after every rubric item has pass evidence or a precise blocking finding.\n</stop_rules>\n\n<output_format>\nCall structured_output with verdict (pass or fail), concise evidence, and blocking_findings. ${READABLE_REPORT}\n</output_format>\n\n<objective>\nVerify the candidate against the task and rubric. Task: ${task}\n</objective>`;
7
10
  }
8
11
 
9
12
  export function renderReducerPrompt(task: string, candidatePath: string, verifierPaths: readonly string[], repairsCompleted: number, maxRepairs: number): string {
10
- return `<role>\nYou reduce independent verification reports into one deterministic next action.\n</role>\n\n<objective>\nDecide whether the candidate for ${task} is accepted, rejected, or needs repair.\n</objective>\n\n<artifacts>\nCandidate: ${candidatePath}\nVerifier reports: ${verifierPaths.join(", ")}\n</artifacts>\n\n<decision_rules>\nAccept only when all material rubric requirements have pass evidence. Request repair when findings are actionable and repair budget remains (${repairsCompleted}/${maxRepairs}). Reject when evidence proves the candidate cannot satisfy the task or the repair budget is exhausted. Preserve unresolved blockers verbatim.\n</decision_rules>\n\n<output_format>\nCall structured_output with decision (accept, reject, or repair), rationale, and remaining_work.\n</output_format>`;
13
+ return `<artifacts>\nCandidate: ${candidatePath}\nVerifier reports: ${verifierPaths.join(", ")}\n</artifacts>\n\n<role>\nYou reduce independent verification reports into one deterministic next action.\n</role>\n\n<decision_rules>\nAccept only when all material rubric requirements have pass evidence. Request repair when findings are actionable and repair budget remains (${repairsCompleted}/${maxRepairs}). Reject when evidence proves the candidate cannot satisfy the task or the repair budget is exhausted. Preserve unresolved blockers verbatim.\n</decision_rules>\n\n<success_criteria>\nThe decision follows the evidence and repair bound, with every unresolved blocker preserved.\n</success_criteria>\n\n<stop_rules>\nStop after selecting exactly one decision: accept, reject, or repair.\n</stop_rules>\n\n<output_format>\nCall structured_output with decision (accept, reject, or repair), a concise evidence-based rationale, and remaining_work. ${READABLE_REPORT}\n${GROUNDED_REPORTING}\n</output_format>\n\n<objective>\nDecide whether the candidate for ${task} is accepted, rejected, or needs repair.\n</objective>`;
11
14
  }
12
15
 
13
16
  export function renderRepairPrompt(task: string, candidatePath: string, reviewPath: string): string {
14
- return `<role>\nYou repair a candidate using independent blocking findings.\n</role>\n\n<objective>\nRepair the candidate for: ${task}\n</objective>\n\n<artifacts>\nRead the current candidate at ${candidatePath} and reducer report at ${reviewPath}.\n</artifacts>\n\n<requirements>\nAddress every actionable blocker, rerun relevant validation, and retain valid prior work. Do not dismiss a finding without contrary evidence.\n</requirements>\n\n<output_format>\nA complete replacement candidate with repair summary, evidence, validation, and remaining risks.\n</output_format>`;
17
+ return `<artifacts>\nRead the current candidate at ${candidatePath} and reducer report at ${reviewPath}.\n</artifacts>\n\n<role>\nYou repair a candidate using independent blocking findings.\n</role>\n\n<success_criteria>\nEvery actionable blocker is addressed, relevant validation is rerun, and valid prior work is retained.\n</success_criteria>\n\n<evidence_rules>\nDo not dismiss a finding without contrary evidence. Report commands run, observed output, and file:line evidence where applicable. ${GROUNDED_REPORTING}\n</evidence_rules>\n\n<stop_rules>\nStop when all actionable blockers are repaired and validated, or list any blocker that remains with the missing evidence.\n</stop_rules>\n\n<output_format>\nA complete replacement candidate with repair summary, evidence, validation, and remaining risks. ${READABLE_REPORT}\n</output_format>\n\n<objective>\nRepair the candidate for: ${task}\n</objective>`;
15
18
  }
@@ -47,7 +47,7 @@ export async function runAdversarialVerification(ctx: WorkflowRunContext<Inputs>
47
47
  const root = await stableArtifactRoot(ctx, "adversarial-verification");
48
48
  const rubricPath = join(root, "rubric.md");
49
49
  const candidatePath = join(root, "candidate.md");
50
- await writeFile(rubricPath, ["# Verification rubric", "- The candidate satisfies the literal task.", "- Important claims cite observable evidence.", "- Relevant validation is executed and reported.", "- No blocking correctness, safety, or completeness gap remains."].join("\n"));
50
+ await writeFile(rubricPath, ["# Verification rubric", "- The candidate satisfies the literal task.", "- Important claims cite observable evidence.", "- Relevant validation is executed and reported with commands run and observed output.", "- File findings cite file:line evidence where applicable.", "- No blocking correctness, safety, or completeness gap remains."].join("\n"));
51
51
  await ctx.task("worker", { prompt: renderWorkerPrompt(ctx.inputs.task), context: "fresh", output: candidatePath, outputMode: "file-only" });
52
52
 
53
53
  let repairsCompleted = 0;
@@ -1,5 +1,6 @@
1
1
  import { Type } from "typebox";
2
2
  import { workflow } from "../src/authoring/workflow.js";
3
+ import { withSteeringPropagationContext } from "./steering-context.js";
3
4
  import { runAdversarialVerification } from "./adversarial-verification-runner.js";
4
5
 
5
6
  export default workflow({
@@ -20,5 +21,5 @@ export default workflow({
20
21
  artifact_dir: Type.String({ description: "Directory containing run artifacts." }),
21
22
  remaining_work: Type.Array(Type.String(), { description: "Unresolved blocking findings when not approved." }),
22
23
  },
23
- run: runAdversarialVerification,
24
+ run: async (ctx) => await runAdversarialVerification(withSteeringPropagationContext(ctx)),
24
25
  });
@@ -1,5 +1,8 @@
1
+ const GROUNDED_REPORTING = "Before reporting progress, audit each claim against a tool result from this session. Report only work you can point to evidence for; say so explicitly when something is unverified.";
2
+ const READABLE_REPORT = "Lead with the outcome. Keep facts, decisions, caveats, and next steps; drop background and repetition. Use complete, readable sentences rather than compressed fragments.";
3
+
1
4
  export function classifierPrompt(prompt: string, categories: readonly string[]): string {
2
- return `<role>\nYou route a task to exactly one declared action category.\n</role>\n\n<objective>\nClassify this task: ${prompt}\n</objective>\n\n<categories>\n${categories.map((category) => `- ${category}`).join("\n")}\n</categories>\n\n<requirements>\nChoose a category verbatim from the list. Base confidence on concrete wording in the task. Use low confidence when the task is ambiguous or spans categories. Provide a concise evidence-based rationale. Return only the structured result requested by the schema.\n</requirements>`;
5
+ return `<categories>\n${categories.map((category) => `- ${category}`).join("\n")}\n</categories>\n\n<role>\nYou route a task to exactly one declared action category.\n</role>\n\n<success_criteria>\nThe selected category is copied verbatim and supported by the task's concrete wording.\n</success_criteria>\n\n<decision_rules>\nChoose exactly one listed category. Use low confidence when the task is ambiguous or spans categories. Stop after making that single classification.\n</decision_rules>\n\n<output_format>\nReturn only the structured result requested by the schema: category, confidence, and a concise evidence-based rationale in complete sentences.\n</output_format>\n\n<objective>\nClassify this task: ${prompt}\n</objective>`;
3
6
  }
4
7
 
5
8
  export function actionPrompt(input: {
@@ -7,5 +10,5 @@ export function actionPrompt(input: {
7
10
  readonly category: string;
8
11
  readonly classificationPath: string;
9
12
  }): string {
10
- return `<role>\nYou are the isolated action agent for category "${input.category}".\n</role>\n\n<objective>\n${input.prompt}\n</objective>\n\n<evidence>\nRead the classification artifact at ${input.classificationPath}. Use only relevant evidence available to this stage; do not assume access to classifier conversation context.\n</evidence>\n\n<success_criteria>\nComplete the requested action for this category, distinguish verified facts from assumptions, and report concrete evidence, validation, and remaining risks.\n</success_criteria>\n\n<output_format>\nMarkdown with Outcome, Evidence, Validation, and Remaining risks headings.\n</output_format>`;
13
+ return `<evidence>\nRead the classification artifact at ${input.classificationPath}. Use only relevant evidence available to this stage; do not assume access to classifier conversation context.\n</evidence>\n\n<role>\nYou are the isolated action agent for category "${input.category}".\n</role>\n\n<success_criteria>\nComplete the requested action for this category, distinguish verified facts from assumptions, and report concrete evidence, validation, and remaining risks.\n</success_criteria>\n\n<stop_rules>\nStop when the category-specific action is complete or a remaining blocker is stated with its missing evidence.\n</stop_rules>\n\n<output_format>\nMarkdown with Outcome, Evidence, Validation, and Remaining risks headings. ${READABLE_REPORT}\n${GROUNDED_REPORTING}\n</output_format>\n\n<objective>\n${input.prompt}\n</objective>`;
11
14
  }
@@ -1,4 +1,4 @@
1
- import { readFile, writeFile } from "node:fs/promises";
1
+ import { writeFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { Type } from "typebox";
4
4
  import type { WorkflowRunContext, WorkflowSerializableValue } from "../src/shared/types.js";
@@ -40,11 +40,6 @@ function actionTools(category: string): readonly string[] {
40
40
  return ["read"];
41
41
  }
42
42
 
43
-
44
- async function artifactText(path: string, fallback: string): Promise<string> {
45
- try { return await readFile(path, "utf8"); } catch { return fallback; }
46
- }
47
-
48
43
  /**
49
44
  * Resolve a low-confidence or unlisted classification. Interactive runs ask the
50
45
  * user; headless/non-interactive runs (where ctx.ui rejects) deterministically
@@ -105,6 +100,9 @@ export async function runClassifyAndAct(ctx: WorkflowRunContext<Inputs>): Promis
105
100
  output: actionPath,
106
101
  outputMode: "file-only",
107
102
  });
108
- const result = await artifactText(actionPath, action.text);
103
+ // `file-only` already returns a compact artifact reference. Reading the file
104
+ // back here would defeat that and push the whole report into the caller's
105
+ // context; `action_path` is returned for callers that want the contents.
106
+ const result = action.text;
109
107
  return { result, category, confidence, action: action.stageName, classification_path: classificationPath, action_path: actionPath, artifact_dir: artifactDir };
110
108
  }
@@ -1,5 +1,6 @@
1
1
  import { Type } from "typebox";
2
2
  import { workflow } from "../src/authoring/workflow.js";
3
+ import { withSteeringPropagationContext } from "./steering-context.js";
3
4
  import { runClassifyAndAct } from "./classify-and-act-runner.js";
4
5
 
5
6
  export const DEFAULT_ACTION_CATEGORIES = ["analysis", "implementation", "research"] as const;
@@ -23,7 +24,7 @@ export default workflow({
23
24
  }),
24
25
  },
25
26
  outputs: {
26
- result: Type.String({ description: "Category-specific action report." }),
27
+ result: Type.String({ description: "Compact reference to the category-specific action report artifact; read `action_path` for the full report." }),
27
28
  category: Type.String({ description: "Selected category, including any human fallback selection." }),
28
29
  confidence: Type.Number({ minimum: 0, maximum: 1, description: "Classifier confidence before fallback." }),
29
30
  action: Type.String({ description: "Executed category-specific action stage name." }),
@@ -31,5 +32,5 @@ export default workflow({
31
32
  action_path: Type.String({ description: "Category action report artifact path." }),
32
33
  artifact_dir: Type.String({ description: "Per-run artifact directory." }),
33
34
  },
34
- run: async (ctx) => await runClassifyAndAct(ctx),
35
+ run: async (ctx) => await runClassifyAndAct(withSteeringPropagationContext(ctx)),
35
36
  });
@@ -1,11 +1,14 @@
1
+ const GROUNDED_REPORTING = "Before reporting progress, audit each claim against a tool result from this session. Report only work you can point to evidence for; say so explicitly when something is unverified.";
2
+ const READABLE_REPORT = "Lead with the outcome. Keep facts, decisions, caveats, and next steps; drop background and repetition. Use complete, readable sentences rather than compressed fragments.";
3
+
1
4
  export function partitionPrompt(prompt: string, maxBranches: number): string {
2
- return `<role>\nYou partition work into independent evidence-producing branches.\n</role>\n\n<objective>\nPartition this task: ${prompt}\n</objective>\n\n<requirements>\nReturn between 1 and ${maxBranches} non-overlapping partitions. Split by files, sources, claims, candidates, or work items that can be evaluated independently. Give each partition a concise label and a self-contained objective. Avoid duplicate scope and identify boundaries explicitly. Return only the structured result requested by the schema.\n</requirements>`;
5
+ return `<role>\nYou partition work into independent evidence-producing branches.\n</role>\n\n<success_criteria>\nThe plan has between 1 and ${maxBranches} non-overlapping partitions whose labels and objectives are self-contained.\n</success_criteria>\n\n<decision_rules>\nSplit by files, sources, claims, candidates, or work items that can be evaluated independently. Avoid duplicate scope and identify boundaries explicitly. Stop when every required part of the task belongs to one partition.\n</decision_rules>\n\n<output_format>\nReturn only the structured result requested by the schema, with concise labels and self-contained objectives.\n</output_format>\n\n<objective>\nPartition this task: ${prompt}\n</objective>`;
3
6
  }
4
7
 
5
8
  export function branchPrompt(input: { readonly prompt: string; readonly label: string; readonly objective: string }): string {
6
- return `<role>\nYou own one independent branch of a larger task.\n</role>\n\n<overall_task>\n${input.prompt}\n</overall_task>\n\n<branch>\n${input.label}: ${input.objective}\n</branch>\n\n<success_criteria>\nInvestigate only this branch, cite concrete files/sources/commands or other observable evidence, distinguish findings from uncertainty, and produce a standalone artifact that a synthesizer can audit.\n</success_criteria>\n\n<output_format>\nMarkdown with Scope, Findings, Evidence, Conflicts or uncertainty, and Recommendations headings.\n</output_format>`;
9
+ return `<overall_task>\n${input.prompt}\n</overall_task>\n\n<role>\nYou own one independent branch of a larger task. Your artifact lets a synthesizer audit this branch without its conversation context.\n</role>\n\n<success_criteria>\nCite concrete files, sources, commands, or other observable evidence, distinguish findings from uncertainty, and produce a standalone artifact.\n</success_criteria>\n\n<stop_rules>\nStop when the branch objective is supported or when unresolved uncertainty and the evidence needed to resolve it are explicit.\n</stop_rules>\n\n<output_format>\nMarkdown with Scope, Findings, Evidence, Conflicts or uncertainty, and Recommendations headings. ${READABLE_REPORT}\n${GROUNDED_REPORTING}\n</output_format>\n\n<branch>\nInvestigate only ${input.label}: ${input.objective}\n</branch>`;
7
10
  }
8
11
 
9
12
  export function synthesisPrompt(prompt: string, manifestPath: string): string {
10
- return `<role>\nYou synthesize independent branch artifacts at a strict barrier.\n</role>\n\n<objective>\nProduce the final answer for: ${prompt}\n</objective>\n\n<artifact_contract>\nRead ${manifestPath} first, then read every branch artifact listed there. Do not omit a completed branch and do not assume access to branch conversations.\n</artifact_contract>\n\n<success_criteria>\nDeduplicate overlapping findings, explicitly resolve or preserve conflicting claims, retain material uncertainty, and cite branch labels and artifact paths for important conclusions. The answer must be traceable to evidence rather than majority vote.\n</success_criteria>\n\n<output_format>\nMarkdown with Executive synthesis, Consolidated findings, Conflicts and resolutions, Evidence index, and Remaining uncertainty headings.\n</output_format>`;
13
+ return `<artifact_contract>\nRead ${manifestPath} first, then read every branch artifact listed there. Do not omit a completed branch and do not assume access to branch conversations.\n</artifact_contract>\n\n<role>\nYou synthesize independent branch artifacts at a strict barrier. The final reader needs conclusions traceable to branch evidence rather than majority vote.\n</role>\n\n<success_criteria>\nDeduplicate overlapping findings, explicitly resolve or preserve conflicting claims, retain material uncertainty, and cite branch labels and artifact paths for important conclusions.\n</success_criteria>\n\n<stop_rules>\nStop after every completed branch is accounted for and each material conflict is resolved or preserved as uncertainty.\n</stop_rules>\n\n<output_format>\nMarkdown with Executive synthesis, Consolidated findings, Conflicts and resolutions, Evidence index, and Remaining uncertainty headings. ${READABLE_REPORT}\n${GROUNDED_REPORTING}\n</output_format>\n\n<objective>\nProduce the final answer for: ${prompt}\n</objective>`;
11
14
  }
@@ -1,4 +1,4 @@
1
- import { readFile, writeFile } from "node:fs/promises";
1
+ import { writeFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { Type } from "typebox";
4
4
  import type { WorkflowRunContext, WorkflowSerializableValue, WorkflowTaskStep } from "../src/shared/types.js";
@@ -31,9 +31,6 @@ function safeName(value: string, index: number): string {
31
31
  const normalized = value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
32
32
  return `${String(index + 1).padStart(2, "0")}-${normalized || "branch"}`;
33
33
  }
34
- async function artifactText(path: string, fallback: string): Promise<string> {
35
- try { return await readFile(path, "utf8"); } catch { return fallback; }
36
- }
37
34
  function parsedPartitions(value: WorkflowSerializableValue | undefined, limit: number, prompt: string): Partition[] {
38
35
  if (typeof value !== "object" || value === null || !("partitions" in value) || !Array.isArray(value.partitions)) {
39
36
  return [{ label: "whole-task", objective: prompt }];
@@ -86,7 +83,10 @@ export async function runFanOutAndSynthesize(ctx: WorkflowRunContext<Inputs>): P
86
83
  outputMode: "file-only",
87
84
  });
88
85
  return {
89
- result: await artifactText(synthesisPath, synthesis.text),
86
+ // `file-only` already returns a compact artifact reference. Reading the file
87
+ // back here would defeat that and push the whole report into the caller's
88
+ // context; `synthesis_path` is returned for callers that want the contents.
89
+ result: synthesis.text,
90
90
  partitions: partitions.map((partition) => partition.label),
91
91
  branch_artifact_paths: branchPaths,
92
92
  synthesis_path: synthesisPath,
@@ -1,5 +1,6 @@
1
1
  import { Type } from "typebox";
2
2
  import { workflow } from "../src/authoring/workflow.js";
3
+ import { withSteeringPropagationContext } from "./steering-context.js";
3
4
  import { runFanOutAndSynthesize } from "./fan-out-and-synthesize-runner.js";
4
5
 
5
6
  export default workflow({
@@ -21,12 +22,12 @@ export default workflow({
21
22
  }),
22
23
  },
23
24
  outputs: {
24
- result: Type.String({ description: "Evidence-citing synthesized report." }),
25
+ result: Type.String({ description: "Compact reference to the evidence-citing synthesis artifact; read `synthesis_path` for the full report." }),
25
26
  partitions: Type.Array(Type.String(), { description: "Ordered labels for executed partitions." }),
26
27
  branch_artifact_paths: Type.Array(Type.String(), { description: "Ordered branch artifact paths consumed by synthesis." }),
27
28
  synthesis_path: Type.String({ description: "Final synthesis artifact path." }),
28
29
  artifact_dir: Type.String({ description: "Per-run artifact directory." }),
29
30
  manifest_path: Type.String({ description: "Barrier manifest linking partitions to branch artifacts." }),
30
31
  },
31
- run: async (ctx) => await runFanOutAndSynthesize(ctx),
32
+ run: async (ctx) => await runFanOutAndSynthesize(withSteeringPropagationContext(ctx)),
32
33
  });