@bastani/atomic 0.9.74-alpha.1 → 0.9.75-alpha.1

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 (383) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/dist/builtin/intercom/package.json +2 -2
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  5. package/dist/builtin/subagents/package.json +3 -3
  6. package/dist/builtin/subagents/skills/agent-browser/SKILL.md +8 -10
  7. package/dist/builtin/subagents/skills/agent-desktop/SKILL.md +9 -5
  8. package/dist/builtin/subagents/src/extension/index.bundle.mjs +7 -1
  9. package/dist/builtin/web-access/package.json +2 -2
  10. package/dist/builtin/workflows/CHANGELOG.md +48 -0
  11. package/dist/builtin/workflows/README.md +5 -2
  12. package/dist/builtin/workflows/builtin/{chunk-m8eg152f.js → chunk-89we7r4p.js} +1 -1
  13. package/dist/builtin/workflows/builtin/{chunk-a4fdm2cw.js → chunk-8yfssw01.js} +1 -1
  14. package/dist/builtin/workflows/builtin/{chunk-774myqzs.js → chunk-v8mb0005.js} +366 -45
  15. package/dist/builtin/workflows/builtin/{chunk-d5cxskkp.js → chunk-wh2p4qjg.js} +2 -2
  16. package/dist/builtin/workflows/builtin/goal.js +2 -2
  17. package/dist/builtin/workflows/builtin/index.d.ts +10 -0
  18. package/dist/builtin/workflows/builtin/index.js +4 -4
  19. package/dist/builtin/workflows/builtin/open-claude-design.d.ts +12 -0
  20. package/dist/builtin/workflows/builtin/open-claude-design.js +1 -1
  21. package/dist/builtin/workflows/builtin/ralph.js +2 -2
  22. package/dist/builtin/workflows/package.json +2 -2
  23. package/dist/builtin/workflows/skills/impeccable/SKILL.md +4 -4
  24. package/dist/builtin/workflows/skills/impeccable/reference/android.md +1 -1
  25. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +2 -2
  26. package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +1 -1
  27. package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +1 -1
  28. package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +4 -4
  29. package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +2 -2
  30. package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +3 -2
  31. package/dist/builtin/workflows/skills/impeccable/reference/distill.md +3 -3
  32. package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +1 -1
  33. package/dist/builtin/workflows/skills/impeccable/reference/document.md +3 -3
  34. package/dist/builtin/workflows/skills/impeccable/reference/harden.md +19 -0
  35. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +15 -8
  36. package/dist/builtin/workflows/skills/impeccable/reference/init.md +2 -0
  37. package/dist/builtin/workflows/skills/impeccable/reference/live.md +8 -6
  38. package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +4 -4
  39. package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +0 -1
  40. package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +1 -1
  41. package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -1
  42. package/dist/builtin/workflows/skills/impeccable/scripts/command-metadata.json +2 -2
  43. package/dist/builtin/workflows/skills/impeccable/scripts/engine-checksums.txt +9 -0
  44. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable +98 -44
  45. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +101 -34
  46. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-ignores.js +6 -2
  47. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +4 -1
  48. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +444 -144
  49. package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +3 -1
  50. package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +2 -2
  51. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +13 -11
  52. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +10 -8
  53. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_2.md +143 -0
  54. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_haiku_5_5.md +11 -7
  55. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +3 -3
  56. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +6 -2
  57. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +7 -7
  58. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +2 -2
  59. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5_5.md +3 -3
  60. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +2 -2
  61. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +2 -2
  62. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +6 -5
  63. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_sol.md +4 -4
  64. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_terra.md +2 -2
  65. package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +4 -3
  66. package/dist/builtin/workflows/skills/skill-creator/scripts/aggregate_benchmark.py +0 -0
  67. package/dist/builtin/workflows/skills/skill-creator/scripts/generate_report.py +0 -0
  68. package/dist/builtin/workflows/skills/skill-creator/scripts/improve_description.py +0 -0
  69. package/dist/builtin/workflows/skills/skill-creator/scripts/package_skill.py +0 -0
  70. package/dist/builtin/workflows/skills/skill-creator/scripts/quick_validate.py +0 -0
  71. package/dist/builtin/workflows/skills/skill-creator/scripts/run_eval.py +0 -0
  72. package/dist/builtin/workflows/skills/skill-creator/scripts/run_loop.py +0 -0
  73. package/dist/builtin/workflows/skills/unslop/SKILL.md +15 -34
  74. package/dist/builtin/workflows/src/durable/journal/memory-run-journal.d.ts +1 -0
  75. package/dist/builtin/workflows/src/durable/journal/values.d.ts +2 -0
  76. package/dist/builtin/workflows/src/extension/index.bundle.mjs +809 -410
  77. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +695 -305
  78. package/dist/builtin/workflows/src/index.js +685 -295
  79. package/dist/builtin/workflows/src/local-worker-entry.mjs +695 -305
  80. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +6 -6
  81. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +2 -2
  82. package/dist/builtin/workflows/src/shared/serializable-error-families.d.ts +2 -0
  83. package/dist/bun/app-host-modules.d.ts +1 -1
  84. package/dist/bun/app-host-modules.d.ts.map +1 -1
  85. package/dist/bun/app-host-modules.js.map +1 -1
  86. package/dist/bun/internal-workflow-worker.d.ts +2 -0
  87. package/dist/bun/internal-workflow-worker.d.ts.map +1 -1
  88. package/dist/bun/internal-workflow-worker.js +2 -1
  89. package/dist/bun/internal-workflow-worker.js.map +1 -1
  90. package/dist/codemode-worker.js +2 -0
  91. package/dist/config.d.ts +8 -0
  92. package/dist/config.d.ts.map +1 -1
  93. package/dist/config.js +14 -0
  94. package/dist/config.js.map +1 -1
  95. package/dist/core/agent-session-bash.d.ts.map +1 -1
  96. package/dist/core/agent-session-bash.js +2 -1
  97. package/dist/core/agent-session-bash.js.map +1 -1
  98. package/dist/core/agent-session-blueprint-environment.d.ts +10 -0
  99. package/dist/core/agent-session-blueprint-environment.d.ts.map +1 -0
  100. package/dist/core/agent-session-blueprint-environment.js +28 -0
  101. package/dist/core/agent-session-blueprint-environment.js.map +1 -0
  102. package/dist/core/agent-session-events.d.ts.map +1 -1
  103. package/dist/core/agent-session-events.js +2 -0
  104. package/dist/core/agent-session-events.js.map +1 -1
  105. package/dist/core/agent-session-methods.d.ts +1 -0
  106. package/dist/core/agent-session-methods.d.ts.map +1 -1
  107. package/dist/core/agent-session-methods.js.map +1 -1
  108. package/dist/core/agent-session-retry.d.ts.map +1 -1
  109. package/dist/core/agent-session-retry.js +14 -4
  110. package/dist/core/agent-session-retry.js.map +1 -1
  111. package/dist/core/agent-session-runtime.d.ts +20 -0
  112. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  113. package/dist/core/agent-session-runtime.js +55 -6
  114. package/dist/core/agent-session-runtime.js.map +1 -1
  115. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  116. package/dist/core/agent-session-tool-registry.js +2 -1
  117. package/dist/core/agent-session-tool-registry.js.map +1 -1
  118. package/dist/core/agent-session.d.ts +2 -0
  119. package/dist/core/agent-session.d.ts.map +1 -1
  120. package/dist/core/agent-session.js +2 -0
  121. package/dist/core/agent-session.js.map +1 -1
  122. package/dist/core/async-scope.d.ts +13 -0
  123. package/dist/core/async-scope.d.ts.map +1 -0
  124. package/dist/core/async-scope.js +20 -0
  125. package/dist/core/async-scope.js.map +1 -0
  126. package/dist/core/cache-warmer.d.ts +3 -14
  127. package/dist/core/cache-warmer.d.ts.map +1 -1
  128. package/dist/core/cache-warmer.js +8 -60
  129. package/dist/core/cache-warmer.js.map +1 -1
  130. package/dist/core/extensions/extension-work.js +2 -2
  131. package/dist/core/extensions/extension-work.js.map +1 -1
  132. package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
  133. package/dist/core/extensions/loader-host-modules.js +3 -1
  134. package/dist/core/extensions/loader-host-modules.js.map +1 -1
  135. package/dist/core/extensions/ui-types.d.ts +2 -1
  136. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  137. package/dist/core/extensions/ui-types.js.map +1 -1
  138. package/dist/core/extensions/workflow-events.d.ts +1 -1
  139. package/dist/core/extensions/workflow-events.d.ts.map +1 -1
  140. package/dist/core/extensions/workflow-events.js.map +1 -1
  141. package/dist/core/extensions/workflow-run-control.d.ts +4 -2
  142. package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
  143. package/dist/core/extensions/workflow-run-control.js.map +1 -1
  144. package/dist/core/model-fallback-failures.d.ts +6 -0
  145. package/dist/core/model-fallback-failures.d.ts.map +1 -1
  146. package/dist/core/model-fallback-failures.js +10 -1
  147. package/dist/core/model-fallback-failures.js.map +1 -1
  148. package/dist/core/preferred-providers.d.ts +19 -0
  149. package/dist/core/preferred-providers.d.ts.map +1 -0
  150. package/dist/core/preferred-providers.js +25 -0
  151. package/dist/core/preferred-providers.js.map +1 -0
  152. package/dist/core/provider-alias.d.ts.map +1 -1
  153. package/dist/core/provider-alias.js +4 -0
  154. package/dist/core/provider-alias.js.map +1 -1
  155. package/dist/core/provider-composer.d.ts.map +1 -1
  156. package/dist/core/provider-composer.js +1 -0
  157. package/dist/core/provider-composer.js.map +1 -1
  158. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  159. package/dist/core/remote-catalog-provider.js +3 -0
  160. package/dist/core/remote-catalog-provider.js.map +1 -1
  161. package/dist/core/resume/blueprint/action-expressions.d.ts +32 -0
  162. package/dist/core/resume/blueprint/action-expressions.d.ts.map +1 -0
  163. package/dist/core/resume/blueprint/action-expressions.js +389 -0
  164. package/dist/core/resume/blueprint/action-expressions.js.map +1 -0
  165. package/dist/core/resume/blueprint/actions.d.ts +90 -0
  166. package/dist/core/resume/blueprint/actions.d.ts.map +1 -0
  167. package/dist/core/resume/blueprint/actions.js +818 -0
  168. package/dist/core/resume/blueprint/actions.js.map +1 -0
  169. package/dist/core/resume/blueprint/build.d.ts +102 -0
  170. package/dist/core/resume/blueprint/build.d.ts.map +1 -0
  171. package/dist/core/resume/blueprint/build.js +535 -0
  172. package/dist/core/resume/blueprint/build.js.map +1 -0
  173. package/dist/core/resume/blueprint/context.d.ts +11 -0
  174. package/dist/core/resume/blueprint/context.d.ts.map +1 -0
  175. package/dist/core/resume/blueprint/context.js +106 -0
  176. package/dist/core/resume/blueprint/context.js.map +1 -0
  177. package/dist/core/resume/blueprint/envrc.d.ts +19 -0
  178. package/dist/core/resume/blueprint/envrc.d.ts.map +1 -0
  179. package/dist/core/resume/blueprint/envrc.js +77 -0
  180. package/dist/core/resume/blueprint/envrc.js.map +1 -0
  181. package/dist/core/resume/blueprint/errors.d.ts +179 -0
  182. package/dist/core/resume/blueprint/errors.d.ts.map +1 -0
  183. package/dist/core/resume/blueprint/errors.js +169 -0
  184. package/dist/core/resume/blueprint/errors.js.map +1 -0
  185. package/dist/core/resume/blueprint/ledger.d.ts +51 -0
  186. package/dist/core/resume/blueprint/ledger.d.ts.map +1 -0
  187. package/dist/core/resume/blueprint/ledger.js +119 -0
  188. package/dist/core/resume/blueprint/ledger.js.map +1 -0
  189. package/dist/core/resume/blueprint/notices.d.ts +14 -0
  190. package/dist/core/resume/blueprint/notices.d.ts.map +1 -0
  191. package/dist/core/resume/blueprint/notices.js +44 -0
  192. package/dist/core/resume/blueprint/notices.js.map +1 -0
  193. package/dist/core/resume/blueprint/process.d.ts +44 -0
  194. package/dist/core/resume/blueprint/process.d.ts.map +1 -0
  195. package/dist/core/resume/blueprint/process.js +142 -0
  196. package/dist/core/resume/blueprint/process.js.map +1 -0
  197. package/dist/core/resume/blueprint/resume.d.ts +73 -0
  198. package/dist/core/resume/blueprint/resume.d.ts.map +1 -0
  199. package/dist/core/resume/blueprint/resume.js +206 -0
  200. package/dist/core/resume/blueprint/resume.js.map +1 -0
  201. package/dist/core/resume/blueprint/schema.d.ts +26 -0
  202. package/dist/core/resume/blueprint/schema.d.ts.map +1 -0
  203. package/dist/core/resume/blueprint/schema.js +243 -0
  204. package/dist/core/resume/blueprint/schema.js.map +1 -0
  205. package/dist/core/resume/blueprint/steps.d.ts +54 -0
  206. package/dist/core/resume/blueprint/steps.d.ts.map +1 -0
  207. package/dist/core/resume/blueprint/steps.js +155 -0
  208. package/dist/core/resume/blueprint/steps.js.map +1 -0
  209. package/dist/core/resume/blueprint/types.d.ts +63 -0
  210. package/dist/core/resume/blueprint/types.d.ts.map +1 -0
  211. package/dist/core/resume/blueprint/types.js +2 -0
  212. package/dist/core/resume/blueprint/types.js.map +1 -0
  213. package/dist/core/resume/errors.d.ts +7 -35
  214. package/dist/core/resume/errors.d.ts.map +1 -1
  215. package/dist/core/resume/errors.js +1 -21
  216. package/dist/core/resume/errors.js.map +1 -1
  217. package/dist/core/resume/index.d.ts +12 -4
  218. package/dist/core/resume/index.d.ts.map +1 -1
  219. package/dist/core/resume/index.js +11 -4
  220. package/dist/core/resume/index.js.map +1 -1
  221. package/dist/core/resume/run-setup.d.ts +36 -15
  222. package/dist/core/resume/run-setup.d.ts.map +1 -1
  223. package/dist/core/resume/run-setup.js +70 -54
  224. package/dist/core/resume/run-setup.js.map +1 -1
  225. package/dist/core/resume/session-resume.d.ts +34 -20
  226. package/dist/core/resume/session-resume.d.ts.map +1 -1
  227. package/dist/core/resume/session-resume.js +244 -106
  228. package/dist/core/resume/session-resume.js.map +1 -1
  229. package/dist/core/retry-policy.d.ts +19 -1
  230. package/dist/core/retry-policy.d.ts.map +1 -1
  231. package/dist/core/retry-policy.js +26 -1
  232. package/dist/core/retry-policy.js.map +1 -1
  233. package/dist/core/sdk.js +1 -1
  234. package/dist/core/sdk.js.map +1 -1
  235. package/dist/core/session-cwd.d.ts +56 -1
  236. package/dist/core/session-cwd.d.ts.map +1 -1
  237. package/dist/core/session-cwd.js +94 -4
  238. package/dist/core/session-cwd.js.map +1 -1
  239. package/dist/core/session-manager-core.d.ts +1 -1
  240. package/dist/core/session-manager-core.d.ts.map +1 -1
  241. package/dist/core/session-manager-core.js +10 -5
  242. package/dist/core/session-manager-core.js.map +1 -1
  243. package/dist/core/session-worktree-snapshots.d.ts +11 -0
  244. package/dist/core/session-worktree-snapshots.d.ts.map +1 -1
  245. package/dist/core/session-worktree-snapshots.js +10 -4
  246. package/dist/core/session-worktree-snapshots.js.map +1 -1
  247. package/dist/core/settings-defaults.d.ts +1 -1
  248. package/dist/core/settings-defaults.d.ts.map +1 -1
  249. package/dist/core/settings-defaults.js +1 -1
  250. package/dist/core/settings-defaults.js.map +1 -1
  251. package/dist/core/settings-manager-basic-accessors.d.ts +3 -2
  252. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  253. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  254. package/dist/core/settings-schema.d.ts.map +1 -1
  255. package/dist/core/settings-schema.js +2 -1
  256. package/dist/core/settings-schema.js.map +1 -1
  257. package/dist/core/slash-commands.d.ts.map +1 -1
  258. package/dist/core/slash-commands.js +4 -0
  259. package/dist/core/slash-commands.js.map +1 -1
  260. package/dist/core/storage/write-ahead-log.d.ts +2 -1
  261. package/dist/core/storage/write-ahead-log.d.ts.map +1 -1
  262. package/dist/core/storage/write-ahead-log.js +27 -6
  263. package/dist/core/storage/write-ahead-log.js.map +1 -1
  264. package/dist/core/system-prompt.d.ts.map +1 -1
  265. package/dist/core/system-prompt.js +10 -0
  266. package/dist/core/system-prompt.js.map +1 -1
  267. package/dist/core/tools/file-tool-errors.d.ts +1 -1
  268. package/dist/core/tools/file-tool-errors.js +1 -1
  269. package/dist/core/tools/file-tool-errors.js.map +1 -1
  270. package/dist/core/tools/find.d.ts.map +1 -1
  271. package/dist/core/tools/find.js +52 -26
  272. package/dist/core/tools/find.js.map +1 -1
  273. package/dist/core/tools/grep.d.ts +2 -0
  274. package/dist/core/tools/grep.d.ts.map +1 -1
  275. package/dist/core/tools/grep.js.map +1 -1
  276. package/dist/core/tools/powershell.d.ts.map +1 -1
  277. package/dist/core/tools/powershell.js +10 -2
  278. package/dist/core/tools/powershell.js.map +1 -1
  279. package/dist/core/tools/tool-concurrency.d.ts.map +1 -1
  280. package/dist/core/tools/tool-concurrency.js +2 -2
  281. package/dist/core/tools/tool-concurrency.js.map +1 -1
  282. package/dist/index.d.ts +3 -2
  283. package/dist/index.d.ts.map +1 -1
  284. package/dist/index.js +2 -1
  285. package/dist/index.js.map +1 -1
  286. package/dist/main-session.d.ts +12 -4
  287. package/dist/main-session.d.ts.map +1 -1
  288. package/dist/main-session.js +28 -4
  289. package/dist/main-session.js.map +1 -1
  290. package/dist/main.d.ts.map +1 -1
  291. package/dist/main.js +6 -8
  292. package/dist/main.js.map +1 -1
  293. package/dist/modes/interactive/components/chat-session-host.d.ts +5 -1
  294. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  295. package/dist/modes/interactive/components/chat-session-host.js +6 -1
  296. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  297. package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
  298. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  299. package/dist/modes/interactive/components/oauth-selector.js +34 -13
  300. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  301. package/dist/modes/interactive/components/provider-brand.d.ts +16 -0
  302. package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
  303. package/dist/modes/interactive/components/provider-brand.js +67 -0
  304. package/dist/modes/interactive/components/provider-brand.js.map +1 -0
  305. package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
  306. package/dist/modes/interactive/interactive-auth-routing.js +8 -6
  307. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  308. package/dist/modes/interactive/interactive-extension-dialogs.js +4 -3
  309. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  310. package/dist/modes/interactive/interactive-extension-runtime.js +8 -3
  311. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  312. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  313. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  314. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  315. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  316. package/dist/modes/interactive/interactive-mode-surface.d.ts +12 -2
  317. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  318. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  319. package/dist/modes/interactive/interactive-session-routing.js +59 -21
  320. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  321. package/dist/modes/interactive/interactive-slash-commands.js +23 -12
  322. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  323. package/dist/modes/interactive/login-provider-options.d.ts.map +1 -1
  324. package/dist/modes/interactive/login-provider-options.js +2 -1
  325. package/dist/modes/interactive/login-provider-options.js.map +1 -1
  326. package/dist/modes/interactive-engine/isolated-runtime.d.ts +2 -0
  327. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  328. package/dist/modes/interactive-engine/isolated-runtime.js +8 -3
  329. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  330. package/dist/modes/rpc/rpc-client-api.d.ts +2 -1
  331. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  332. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  333. package/dist/modes/rpc/rpc-client.d.ts +0 -1
  334. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  335. package/dist/modes/rpc/rpc-client.js +2 -18
  336. package/dist/modes/rpc/rpc-client.js.map +1 -1
  337. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  338. package/dist/modes/rpc/rpc-command-handler.js +8 -2
  339. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  340. package/dist/modes/rpc/rpc-error-decoding.d.ts +7 -0
  341. package/dist/modes/rpc/rpc-error-decoding.d.ts.map +1 -0
  342. package/dist/modes/rpc/rpc-error-decoding.js +25 -0
  343. package/dist/modes/rpc/rpc-error-decoding.js.map +1 -0
  344. package/dist/modes/rpc/rpc-responses.d.ts.map +1 -1
  345. package/dist/modes/rpc/rpc-responses.js +12 -0
  346. package/dist/modes/rpc/rpc-responses.js.map +1 -1
  347. package/dist/modes/rpc/rpc-types.d.ts +11 -0
  348. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  349. package/dist/modes/rpc/rpc-types.js.map +1 -1
  350. package/dist/package-manager-cli.d.ts.map +1 -1
  351. package/dist/package-manager-cli.js +12 -3
  352. package/dist/package-manager-cli.js.map +1 -1
  353. package/docs/background-tasks.md +1 -1
  354. package/docs/codemode.md +22 -0
  355. package/docs/extensions/api-reference.md +27 -1
  356. package/docs/extensions/authoring.md +1 -1
  357. package/docs/extensions/ui.md +1 -1
  358. package/docs/getting-started/first-session.md +1 -1
  359. package/docs/guides/resume-on-any-machine.md +72 -19
  360. package/docs/models/evals.md +85 -17
  361. package/docs/models/reference.md +1 -1
  362. package/docs/providers.md +38 -5
  363. package/docs/reference/cli.md +2 -0
  364. package/docs/rpc/protocol.md +11 -1
  365. package/docs/sdk/reference.md +36 -4
  366. package/docs/sdk.md +2 -2
  367. package/docs/sessions.md +11 -1
  368. package/docs/settings.md +7 -2
  369. package/docs/skills.md +3 -3
  370. package/docs/storage.md +1 -1
  371. package/docs/tools.md +3 -1
  372. package/docs/workflows/api-reference.md +14 -12
  373. package/docs/workflows/authoring.md +29 -1
  374. package/docs/workflows/builtins.md +9 -1
  375. package/docs/workflows/operations.md +8 -8
  376. package/docs/worktree-snapshots.md +3 -2
  377. package/npm-shrinkwrap.json +83 -67
  378. package/package.json +7 -7
  379. package/schemas/settings.schema.json +3 -2
  380. package/dist/core/resume/setup-hook.d.ts +0 -69
  381. package/dist/core/resume/setup-hook.d.ts.map +0 -1
  382. package/dist/core/resume/setup-hook.js +0 -261
  383. package/dist/core/resume/setup-hook.js.map +0 -1
@@ -861,14 +861,24 @@ When choosing a session from another project's JSONL store, pass `sessionDirecto
861
861
 
862
862
  Response:
863
863
  ```json
864
- {"type": "response", "command": "switch_session", "success": true, "data": {"cancelled": false}}
864
+ {"type": "response", "command": "switch_session", "success": true, "data": {"cancelled": false, "notices": []}}
865
865
  ```
866
866
 
867
+ `notices` lists the warnings the resume earned, such as a [blueprint](/guides/resume-on-any-machine) build that was Partial, each as `{"type": "warning", "message": "..."}`. A client that shows resume warnings shows them once.
868
+
867
869
  If an extension cancelled the switch:
868
870
  ```json
869
871
  {"type": "response", "command": "switch_session", "success": true, "data": {"cancelled": true}}
870
872
  ```
871
873
 
874
+ If the session's recorded working directory does not exist on this machine, the command fails before it opens anything, with the typed error `MissingSessionCwdError`, in any session storage. The response carries `errorCode: "missing_session_cwd"` and the error's `name`, `code`, `message`, `hint` and `fields` (`sessionCwd`, `fallbackCwd` and, for a session kept in a file, `sessionFile`) in `errorDetails`. Send the command again with `cwdOverride` set to run the session in another directory:
875
+
876
+ ```json
877
+ {"type": "response", "command": "switch_session", "success": false, "error": "Stored session working directory does not exist: /old/project\nCurrent working directory: /new/project", "errorCode": "missing_session_cwd", "errorDetails": {"name": "MissingSessionCwdError", "code": "session-cwd-missing", "message": "Stored session working directory does not exist: /old/project\nCurrent working directory: /new/project", "hint": "Open the session from its original working directory, or continue or fork it when asked.", "retryable": false, "fields": {"sessionCwd": "/old/project", "fallbackCwd": "/new/project"}}}
878
+ ```
879
+
880
+ `import_session` fails the same way when the imported session's working directory is missing, and stores nothing; repeat it with `cwdOverride`.
881
+
872
882
  #### start_pending_recovery
873
883
 
874
884
  Recover work an earlier process left unfinished in the current session. Send it after you have shown the transcript, at startup or after `switch_session`.
@@ -783,17 +783,38 @@ await sm.createBranchedSession(leafId); // Extract path to new file
783
783
 
784
784
  > See [examples/sdk/11-sessions.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/sdk/11-sessions.ts) and [Session Format](/session-format)
785
785
 
786
- **Resuming on another machine:** `runtime.switchSession()` prepares a session recorded on another machine before it opens it: a matching checkout is used as-is, otherwise the session's worktree snapshot is restored into a fresh worktree and the session continues there (see [Resume on any machine](/guides/resume-on-any-machine)). `runtime.rehydrate(sessionId)` does the same when it wakes a session, except that each checkout the session worked in on this machine (a worktree this machine restored for it, or a checkout whose repository holds the commit of its latest snapshot, which also holds for a clone where Atomic captured exactly that state) stays as it is, and only the session's other checkouts are checked and restored. A session's tools resolve paths under a checkout it recorded into the worktree that checkout was restored into, after the restores of the run or session it was opened in, if any; a checkout the session restored itself follows its own restore. To resolve paths the same way in your own code, run it inside `withWorktreeRootMappings(sessionManager.getWorktreeRootMappings(), work, outer)` and call `mapPathForCwd(path, cwd)` there; `outer` is `currentWorktreeRootMappings()` read where the session was opened, and defaults to the scope the call runs in. `createAgentSession({ sessionManager })` does the same for a supplied session that recorded worktree snapshots, unless you pass `cwd` or `workspace`. It starts in the recorded checkout when that still matches the snapshot, compared under the `snapshots` option you pass; a recorded path that exists here with a different tree, for example on a runner built from the same image, is restored like a missing one. A session without snapshots, or created with `snapshots: { enabled: false }`, starts as supplied. `prepareSessionResume(sessionManager, options)` runs the step for a `SessionManager` you opened yourself and returns the session opened where it continues. Failures are typed, exported from `@bastani/atomic`, and carry `code`, `hint` and JSON `fields`; `serializeResumeError` and `rehydrateResumeError` carry them across processes. `isResumeFailure(error)` tells a failure the user can fix from a bug. In shared storage, `switchSession()`, `rehydrate()` and the workflows `run()` with an existing run's `runId` bound their lookup by `RESUME_CATALOG_TIMEOUT_MS` (15 seconds). `/workflow resume` reports a run id that is not found with the journal catalog's `run-not-found` error, not with `ResumeNotFoundError`; `run()` with a run id its journal does not hold starts a new run under that id.
786
+ **Resuming on another machine:** `runtime.switchSession()` prepares a session recorded on another machine before it opens it: a matching checkout is used as-is, otherwise the session's worktree snapshot is restored into a fresh worktree and the session continues there (see [Resume on any machine](/guides/resume-on-any-machine)). `runtime.rehydrate(sessionId)` does the same when it wakes a session, except that each checkout the session worked in on this machine (a worktree this machine restored for it, or a checkout whose repository holds the commit of its latest snapshot, which also holds for a clone where Atomic captured exactly that state) stays as it is, and only the session's other checkouts are checked and restored. A session's tools resolve paths under a checkout it recorded into the worktree that checkout was restored into, after the restores of the run or session it was opened in, if any; a checkout the session restored itself follows its own restore. To resolve paths the same way in your own code, run it inside `withWorktreeRootMappings(sessionManager.getWorktreeRootMappings(), work, outer)` and call `mapPathForCwd(path, cwd)` there; `outer` is `currentWorktreeRootMappings()` read where the session was opened, and defaults to the scope the call runs in. `createAgentSession({ sessionManager })` does the same for a supplied session that recorded worktree snapshots, unless you pass `cwd` or `workspace`. It starts in the recorded checkout when that still matches the snapshot, compared under the `snapshots` option you pass; a recorded path that exists here with a different tree, for example on a runner built from the same image, is restored like a missing one. A session without snapshots, or created with `snapshots: { enabled: false }`, starts as supplied. `prepareSessionResume(sessionManager, options)` runs the step for a `SessionManager` you opened yourself and returns the session opened where it continues, with `notices` for what it did. Only the checkout the session's working directory is in must be restorable: another recorded checkout that is missing or changed never refuses the resume. It continues as it is, or is restored or left out with a `warning` notice that names its path and why; `switchSession()`, `rehydrate()` and `createAgentSession()` do not show these notices. Failures are typed, exported from `@bastani/atomic`, and carry `code`, `hint` and JSON `fields`; `serializeResumeError` and `rehydrateResumeError` carry them across processes. `isResumeFailure(error)` tells a failure the user can fix from a bug. In shared storage, `switchSession()`, `rehydrate()` and the workflows `run()` with an existing run's `runId` bound their lookup by `RESUME_CATALOG_TIMEOUT_MS` (15 seconds). `/workflow resume` reports a run id that is not found with the journal catalog's `run-not-found` error, not with `ResumeNotFoundError`; `run()` with a run id its journal does not hold starts a new run under that id.
787
787
 
788
788
  | Class | Code | When | Fields | Guard |
789
789
  |---|---|---|---|---|
790
790
  | `ResumeNotFoundError` | `not-found` | The session id matches nothing in the selected storage. `reason` is `local-storage-not-joined` (storage only this machine reads; the hint is `atomic storage join <url> --token-file <path>`, after `atomic team leave` on a machine joined with `atomic team join`) or `shared-miss`. | `subject`, `id`, `reason`, `storage` | `isResumeNotFoundError` |
791
- | `ResumePreconditionError` | `preconditions-unmet` | Checked before anything is opened or written; lists every unmet piece in one pass. | `entryPoint` (`cli`, `switch-session`, `create-agent-session`, `workflow-resume` or `rehydrate`), `problems[]` of `{ code, subject, why, fix }` with codes `adapter-not-installed`, `credential-missing`, `credential-unreadable`, `git-unavailable`, `setup-hook-missing`. With `git-unavailable`, `cause` is the `GitUnavailableError` or `GitProvisionError` that says why no Git could be started or provisioned | `isResumePreconditionError` |
791
+ | `ResumePreconditionError` | `preconditions-unmet` | Checked before anything is opened or written; lists every unmet piece in one pass. | `entryPoint` (`cli`, `switch-session`, `create-agent-session`, `workflow-resume` or `rehydrate`), `problems[]` of `{ code, subject, why, fix, checkout? }` (`checkout` is the path of the checkout a problem belongs to) with codes `adapter-not-installed`, `credential-missing`, `credential-unreadable`, `git-unavailable`. With `git-unavailable`, `cause` is the `GitUnavailableError` or `GitProvisionError` that says why no Git could be started or provisioned | `isResumePreconditionError` |
792
792
  | `ResumeCatalogUnavailableError` | `catalog-unavailable` | The storage could not be reached during the lookup. `retryable: true`; nothing was changed. | `subject` (`session` or `run`), `id`, `storage`, `phase` | `isResumeCatalogUnavailableError`, `isRetryableResumeError` |
793
793
  | `ResumeCatalogTimeoutError` | `catalog-timeout` | The storage did not answer the lookup within 15 seconds. `retryable: true`; nothing was changed. | `subject` (`session` or `run`), `id`, `storage`, `phase`, `timeoutMs`, `elapsedMs` | `isResumeCatalogTimeoutError`, `isRetryableResumeError` |
794
- | `ResumeSetupHookError` | `setup-hook-failed`, `setup-hook-timed-out` | The setup hook of a restored worktree failed, was stopped, or ran past its timeout. | `hook`, `worktree`, `envHash`, `exitStatus`, `signal`, `logPath`, `timeoutMs`, `elapsedMs` | `isResumeSetupHookError` |
795
794
 
796
- All of them extend `ResumeError` (`isResumeError`, `findResumeError`), and cross worker and process boundaries as themselves (`serializeResumeError`, `rehydrateResumeError`). A snapshot that cannot be restored stays a `WorkspaceDriftError` with the restore failure as its `cause`. Cancelling a resume through its `AbortSignal` rejects with the signal's reason, never with one of these errors.
795
+ All of them extend `ResumeError` (`isResumeError`, `findResumeError`), and cross worker and process boundaries as themselves (`serializeResumeError`, `rehydrateResumeError`). A snapshot that cannot be restored stays a `WorkspaceDriftError` with the restore failure as its `cause`. A blueprint never stops a resume, so none of these errors is raised for one; see the blueprint errors below. Cancelling a resume through its `AbortSignal` rejects with the signal's reason, never with one of these errors.
796
+
797
+ #### Missing session directory
798
+
799
+ `runtime.switchSession()` and `runtime.importFromJsonl()` check a session's recorded working directory, whether the session lives in a JSONL file or in database storage. They reject with a `MissingSessionCwdError` when it does not exist on this machine and no worktree snapshot restored one. Nothing was opened, and an import leaves no copy in storage.
800
+
801
+ | Class | `code` | When | Fields | What to do |
802
+ |---|---|---|---|---|
803
+ | `MissingSessionCwdError` | `session-cwd-missing` | The session's working directory does not exist. `retryable` is `false`. | `sessionCwd` (the recorded directory), `fallbackCwd` (the runtime's directory), `sessionFile` (only for a session kept in a file), `hint` | Retry with `{ cwdOverride }` (`switchSession`) or `importFromJsonl(path, cwdOverride)` to run the session in another directory, or fork it there with `SessionManager.forkTo(cwd, store)`. |
804
+
805
+ `isMissingSessionCwdError(error)` recognizes it, including an error that crossed a process boundary as a plain object with the same `name`, `code` and `issue`. `serializeMissingSessionCwdError(error)` returns a `SerializedMissingSessionCwdError`, and `rehydrateMissingSessionCwdError(serialized)` rebuilds it; `isSerializedMissingSessionCwdError(value)` checks an envelope before you do. The RPC client does this for the `switch_session` and `import_session` commands, so the error reaches the host as itself. Its message names both directories and is the text print and RPC modes show. Interactive mode answers it with a prompt to continue in the current directory, fork the session there, or cancel; see [Sessions](/sessions#resuming-and-deleting-sessions).
806
+
807
+ #### Blueprint errors
808
+
809
+ A blueprint step that fails, a blueprint that is invalid, or a build that cannot read its ledger never rejects a resume. The error is carried in the build outcome (`runBlueprintBuild`, `setUpResumedBlueprints`) and reported as a warning. All of them extend `BlueprintError` (`isBlueprintError`, `findBlueprintError`) and cross worker and process boundaries as themselves (`serializeBlueprintError`, `rehydrateBlueprintError`). None is retryable.
810
+
811
+ | Class | Code | When | Fields | Guard |
812
+ |---|---|---|---|---|
813
+ | `BlueprintInvalidError` | `blueprint-invalid` | A blueprint file breaks the schema or a rule. `reason` names the rule, and `rule` carries Devin's own text for those it words, such as `'uses' steps are not supported in maintenance sections`. | `blueprint`, `scope`, `reason`, `rule`, `subject` | `isBlueprintInvalidError` |
814
+ | `BlueprintStepFailedError` | `blueprint-step-failed` | A step exited non-zero, was stopped by a signal, or could not be started. The rest of its blueprint did not run. | `blueprint`, `scope`, `section`, `index`, `step`, `exitStatus`, `signal`, `logPath` | `isBlueprintStepFailedError` |
815
+ | `BlueprintStepTimedOutError` | `blueprint-step-timed-out` | A step ran for its 3-hour limit and was stopped. | the step fields, `logPath`, `timeoutMs`, `elapsedMs`, `phase` | `isBlueprintStepTimedOutError` |
816
+ | `BlueprintUsesUnsupportedError` | `blueprint-uses-unsupported` | A `uses` step names an action Atomic cannot run (`docker-action`, `unknown-action-type`, `action-not-found`, `action-fetch-failed`, `action-metadata-invalid`, `node-unavailable`, `required-input-missing`, `unsupported-expression`). | the step fields, `uses`, `reason`, `detail`, `logPath` | `isBlueprintUsesUnsupportedError` |
817
+ | `BlueprintBuildFailedError` | `blueprint-build-failed` | The build itself failed, not a step: a blueprint file or the build ledger could not be read or written. | `phase`, `detail` | `isBlueprintBuildFailedError` |
797
818
 
798
819
  ### Settings Management
799
820
 
@@ -1248,6 +1269,17 @@ type DebugValue
1248
1269
  type DebugErrorCode
1249
1270
  type DebugSettingSource
1250
1271
 
1272
+ // Session working directory
1273
+ MissingSessionCwdError
1274
+ isMissingSessionCwdError
1275
+ serializeMissingSessionCwdError
1276
+ rehydrateMissingSessionCwdError
1277
+ isSerializedMissingSessionCwdError
1278
+ type SerializedMissingSessionCwdError
1279
+ type MissingSessionCwdErrorCode
1280
+ type MissingSessionCwdFields
1281
+ type SessionCwdIssue
1282
+
1251
1283
  // Event subscriptions (session.subscribe, ctx.subscribe, ctx.events)
1252
1284
  type EventSource
1253
1285
  type SubscriptionEvent
package/docs/sdk.md CHANGED
@@ -343,7 +343,7 @@ const sessionManager = await SessionManager.open(store, sessionId);
343
343
  const { session } = await createAgentSession({ sessionManager });
344
344
  ```
345
345
 
346
- The session is reopened in its restored worktree; restoration rejects with `WorkspaceDriftError` when a checkout cannot be rebuilt. Missing Git or setup hooks fail before restoration with typed errors and remediation hints. `createAgentSession({ snapshots: { enabled: false } })` turns snapshots off for one session; the other fields (`includeUntracked`, `maxFileBytes`, `maxSnapshotBytes`, `fullEvery`) override `snapshots.*` settings. `captureWorktreeSnapshot()`, `restoreWorktreeSnapshot()`, `verifyWorktree()` and the `WorkspaceBinding` type are exported for hosts and schedulers that move work between machines; `session.sessionManager.getWorktreeRootMappings()` returns the restores a session went through. `session.exportToJsonl()` returns a promise and carries snapshot content inline. See [Resume on any machine](/guides/resume-on-any-machine) for setup hooks and [Worktree snapshots](/worktree-snapshots) for the API and error table.
346
+ The session is reopened in its restored worktree; restoration rejects with `WorkspaceDriftError` when a checkout cannot be rebuilt. Missing Git fails before restoration with a typed error and remediation hints; a blueprint that fails never does, and is reported as a warning. `createAgentSession({ snapshots: { enabled: false } })` turns snapshots off for one session; the other fields (`includeUntracked`, `maxFileBytes`, `maxSnapshotBytes`, `fullEvery`) override `snapshots.*` settings. `captureWorktreeSnapshot()`, `restoreWorktreeSnapshot()`, `verifyWorktree()` and the `WorkspaceBinding` type are exported for hosts and schedulers that move work between machines; `session.sessionManager.getWorktreeRootMappings()` returns the restores a session went through. `session.exportToJsonl()` returns a promise and carries snapshot content inline. See [Resume on any machine](/guides/resume-on-any-machine) for blueprints and [Worktree snapshots](/worktree-snapshots) for the API and error table.
347
347
 
348
348
  ### Workflow journal selection
349
349
 
@@ -524,7 +524,7 @@ The inherited `isFallbackModelAllowed` predicate also applies when a workflow re
524
524
 
525
525
  ### Waiting workflow stages
526
526
 
527
- A workflow stage that only waits on a long tool call does not keep its session in memory. Give the tool `detachable: true` (see [Detachable tool calls](/sdk/reference#detachable-tool-calls)); once a call of it outlasts the stage's `releaseWhenWaiting` threshold, the stage closes its session, frees its admission slot, and reopens the same session from the session store when the result arrives:
527
+ A workflow stage that only waits on a long tool call does not keep its session in memory. Give the tool `detachable: true` (see [Detachable tool calls](/sdk/reference#detachable-tool-calls)); once a call of it outlasts the stage's `releaseWhenWaiting` threshold, the stage closes its session, frees its admission slot, and reopens the same session from the session store when the result arrives. While its session is released the stage's status is `suspended`:
528
528
 
529
529
  ```typescript
530
530
  import { run } from "@bastani/atomic/workflows";
package/docs/sessions.md CHANGED
@@ -101,7 +101,17 @@ Each session records the working directory it was created in and never changes i
101
101
 
102
102
  `atomic --session <id>` from another directory opens a session whose working directory lies inside a checkout it recorded a [worktree snapshot](/worktree-snapshots) of as itself, without offering a fork: it continues in that checkout when it still matches the snapshot, and otherwise in a fresh worktree restored from it. Other sessions are offered as a fork into the current directory.
103
103
 
104
- If a session's working directory no longer exists, interactive mode offers to continue in the current directory instead; other modes exit with an error that names both directories.
104
+ If a session's working directory no longer exists, for example after the project folder was renamed, interactive mode asks how to open it:
105
+
106
+ - **Continue** runs the session in the current directory. Atomic does not store that choice, so it asks again the next time you open the session.
107
+ - **Fork** copies the session into the current directory as a new session with a new ID, like `--fork`. The original stays unchanged, and the copy records the current directory, so opening it does not ask again. The copy is stored in the same session storage the original was opened from.
108
+ - **Cancel** leaves the current session open, or exits at startup.
109
+
110
+ This applies to `--session`, `--resume`, `/resume` and `/import`, for sessions in the default database and in JSONL files alike. `/import` of a session whose working directory is missing stores nothing until you choose, so cancelling or forking leaves no imported copy behind.
111
+
112
+ An extension that calls `ctx.switchSession()` is asked the same way only when Atomic runs the session in the same process as the terminal. In the default interactive mode, where extensions run in a separate process, the call rejects with a `MissingSessionCwdError`, as it does in print and RPC modes; those modes exit with an error that names both directories.
113
+
114
+ Known limitation: at startup in the default interactive mode, choosing **Continue** ends with `Stored session working directory does not exist`. Choose **Fork** instead, or start Atomic from a directory that exists and open the session with `/resume`, where **Continue** works.
105
115
 
106
116
  A session that recorded [worktree snapshots](/worktree-snapshots) is checked against its last snapshot when it resumes. When its checkout drifted, or does not exist on this machine, Atomic restores the snapshot into a fresh worktree under `~/.atomic/agent/worktree-snapshots/`, prints one line naming it, and runs the session there. `/session snapshot` shows the recorded snapshots and how they differ from the current tree.
107
117
 
package/docs/settings.md CHANGED
@@ -64,8 +64,11 @@ See [Herdr](/herdr) for state aggregation, reporter conflicts, privacy, and Herd
64
64
  | `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
65
65
  | `thinkingBudgets` | object | - | Custom token budgets per thinking level. Anthropic, Google, and Bedrock use these natively. OpenAI-compatible models use them when `compat.thinkingTokenBudgetField` (or `supportsThinkingTokenBudget`) is set. |
66
66
  | `showCacheMissNotices` | boolean | `false` | Show transcript notices for significant prompt-cache misses, billed compaction or branch-summary usage, and provider recovery diagnostics such as dropped Anthropic thinking blocks, including when a persisted transcript is resumed |
67
+ | `cacheWarming` | `"off" \| "streaming" \| "idle"` | `"idle"` | Keep eligible provider prompt caches warm during active runs and, with `"idle"`, for up to 30 minutes between runs. `"streaming"` warms only during active runs; `"off"` never warms. Each refresh costs money. Global setting only; project settings are ignored. |
67
68
  | `fallbackModels` | string[] | - | Ordered fallback models, written as `"provider/model"` with optional model-supported reasoning suffixes such as `:high`, `:xhigh`, or `:max`. Used by main-chat turns and, since compaction fallback rungs, borrowed for compaction planner requests |
68
69
 
70
+ Cache warming runs only when the model declares a cache lifetime (`promptCache` in [Models Configuration](/models-configuration)) and Atomic estimates at least $0.05 in avoided cache-miss cost. Refreshes are recorded as usage entries and never enter the model's context. Extensions can override each decision with the `cache_warming_decision` event.
71
+
69
72
  `defaultProvider` and `defaultModel` form one exact saved selection when both are present. Atomic waits for built-in, configured, and extension provider registration before classifying the provider.
70
73
 
71
74
  If it remains unsupported, Atomic does not silently switch providers:
@@ -381,7 +384,7 @@ Both fields must be non-negative safe integers, including ordinary settings. Inv
381
384
 
382
385
  | Setting | Type | Default | Description |
383
386
  |---------|------|---------|-------------|
384
- | `resume.setupCommand` | string | unset | Command run in a worktree restored on resume, or by a worker host for a pooled child, when its lockfiles were never installed on this machine; a trusted repository's `.atomic/setup` runs instead. Read from global settings only; a project's settings cannot set it. See [Resume on any machine](/guides/resume-on-any-machine) |
387
+ | `resume.setupCommand` | string | unset | Deprecated; remove it in favour of a blueprint. Kept for one release as an alias for one maintenance step of the global blueprint: the command runs in the root of each worktree restored on resume, or by a worker host for a pooled child, in a trusted project. A resume that builds a worktree prints a deprecation warning while it is set. Move the command into the `maintenance` section of `.atomic/blueprint.yaml`. Read from global settings only; a project's settings cannot set it. See [Set the environment up with a blueprint](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint) |
385
388
 
386
389
  ### Snapshots
387
390
 
@@ -413,6 +416,8 @@ See [Worktree snapshots](/worktree-snapshots).
413
416
 
414
417
  Agent-level retries use exponential backoff capped by `retry.maxAgentDelayMs`, including the shared main-chat and workflow retry policy and summary calls. When a failed response carries a server retry hint (`Retry-After-Ms` or `Retry-After` header, a Cloudflare 5xx `retry_after` body field, or a Google `RetryInfo.retryDelay` in the error body), Atomic waits as long as the server asks instead, up to `retry.provider.maxRetryDelayMs`. OpenAI, OpenAI-compatible, ChatGPT (Codex), Anthropic, Azure OpenAI, Mistral, Google (Generative AI and Vertex) and Amazon Bedrock providers report these hints. `retry.maxRetries` still limits the number of retries, so with the defaults a hinted outage can take up to about 3 × 60s before the turn fails or switches to a configured `fallbackModels` entry. Cloudflare 520-524 responses and connection resets count as transient errors; non-retryable 4xx and quota errors still stop immediately. This is independent of provider retry limits. Legacy `retry.maxDelayMs` still migrates to `retry.provider.maxRetryDelayMs`, not the agent cap.
415
418
 
419
+ A GitHub Copilot response that ends early after an attempt that ran 5 minutes or more is a long cut, and repeating it is likely to be cut again. A long cut gets one more retry, and a second one with no successful response in between stops retrying that model: the turn moves to the next `fallbackModels` entry when there is one, and otherwise ends with a message that suggests splitting the work into smaller steps, lowering the thinking effort or setting `fallbackModels`. Cuts after shorter attempts use the `retry.maxRetries` budget as above. Partial output is never replayed; each retry restarts the turn. See [GitHub Copilot errors](/providers#streams-cut-after-a-long-attempt).
420
+
416
421
  When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs` (e.g., Google's "quota will reset after 5h"), the request fails immediately with an informative error instead of waiting silently. Set to `0` to disable the cap.
417
422
 
418
423
  `retry.provider.maxRetries` follows upstream Pi's behavior and defaults to `0` SDK/provider retries. Atomic still performs agent-level retries via `retry.maxRetries`; set `retry.provider.maxRetries` explicitly only when you want the underlying provider SDK to retry before Atomic observes the failure.
@@ -469,7 +474,7 @@ The `/settings` picker offers these presets:
469
474
  | `transport` | string | `"auto"` | Preferred transport for providers that support multiple transports: `"sse"`, `"websocket"`, `"websocket-cached"`, or `"auto"` |
470
475
  | `httpIdleTimeoutMs` | number or string | `600000` | HTTP idle timeout in milliseconds, a duration string, or `"disabled"`; also used by providers with explicit stream idle timeouts. |
471
476
  | `websocketConnectTimeoutMs` | number or string | `15000` | WebSocket connect/open handshake timeout; accepts milliseconds, a duration string, or `"disabled"`/`0` to disable. |
472
- | `streamDeadlineMs` | number or string | `300000` | Maximum idle gap between two provider stream events, enforced below the HTTP layer; accepts milliseconds, duration strings such as `30s`, `5m`, or `1h`, or `"disabled"`/`0` to disable. A stream that stalls without an error — for example a response body that fails to decompress — is cut at this deadline and retried or failed over instead of hanging the request. |
477
+ | `streamDeadlineMs` | number or string | `300000` | Maximum idle gap between two provider stream events, enforced below the HTTP layer; accepts milliseconds, duration strings such as `30s`, `5m`, or `1h`, or `"disabled"`/`0` to disable. A stream that stalls without an error — for example a response body that fails to decompress — is cut at this deadline and retried or failed over instead of hanging the request. Anthropic `ping` events count as activity, so a model that thinks silently while the server keeps the connection alive is not cut. |
473
478
 
474
479
  Older settings with a boolean `websockets` value are migrated to `transport`: `true` becomes `"websocket"` and `false` becomes `"sse"` when `transport` is not already set.
475
480
 
package/docs/skills.md CHANGED
@@ -82,11 +82,11 @@ This is progressive disclosure: only descriptions are always in context, full in
82
82
 
83
83
  ### Built-in prompt engineering guidance
84
84
 
85
- The bundled `/skill:prompt-engineer` creates, optimizes, evaluates, and troubleshoots prompts for GPT and Claude models. Its small routing file points to separate, source-attributed guides for GPT-6.1 Sol, GPT-6 Astra, GPT-5.6, GPT-5.5, Claude Fable 5.1, Claude Fable 5, Claude Opus 5.5, Claude Opus 5, Claude Opus 4.8, Claude Sonnet 5.5, and Claude Sonnet 5. Read the target model's page, or both relevant pages for a migration, without loading every guide. Shared references cover prompt structure, tools, evaluation, and instruction audits; model defaults, effort, verification, and API compatibility stay in their own pages. For example, use `/skill:prompt-engineer Improve this prompt for GPT-6.1 Sol: ...`.
85
+ The bundled `/skill:prompt-engineer` creates, optimizes, evaluates, and troubleshoots prompts for GPT and Claude models. Its small routing file points to separate, source-attributed guides for GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Astra and Luna, GPT-5.6, GPT-5.5, Claude Fable 5.2, Claude Fable 5.1, Claude Fable 5, Claude Opus 5.5, Claude Opus 5, Claude Opus 4.8, Claude Sonnet 5.5, Claude Sonnet 5, and Claude Haiku 5.5. Read the target model's page, or both relevant pages for a migration, without loading every guide. Shared references cover prompt structure, tools, evaluation, and instruction audits; model defaults, effort, verification, and API compatibility stay in their own pages. For example, use `/skill:prompt-engineer Improve this prompt for GPT-6.1 Sol: ...`.
86
86
 
87
87
  Each model guide pairs an observed behavior with a prompt adjustment, example wording, and caveats. Choose the patterns that address your task instead of copying the whole guide; compatibility notes explain when a prompt also needs provider or application support.
88
88
 
89
- Astra guidance distills [OpenAI's model guide](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-6-astra) into completion and permission rules, proportionate verification, useful parallel delegation, concise writing, and API migration checks. An instruction audit based on [Eric Provencher's advice](https://x.com/pvncher/status/2095991462416490862) explains how to shorten skill descriptions, use small routing files with optional references, remove obsolete recipes, and define safe local work and stopping points. It preserves binding repository requirements and separates API features from capabilities actually exposed by the host.
89
+ Astra guidance distills [OpenAI's model guide](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-6-astra) into completion and permission rules, proportionate verification, useful parallel delegation, concise writing, and API migration checks. An instruction audit based on OpenAI's [Rethinking skills and prompts for GPT-6 Astra](https://developers.openai.com/blog/rethinking-skills-and-prompts-for-gpt-6-astra) explains how to shorten skill descriptions, use small routing files with optional references, remove obsolete recipes, and define safe local work and stopping points. It preserves binding repository requirements and separates API features from capabilities actually exposed by the host.
90
90
 
91
91
  Opus 5.5 guidance covers its always-on thinking and medium-effort API default, progress updates returned in thinking blocks, bounded continuations for unattended work, and pasted-content boundaries. Use it when migrating Opus 5 prompts or troubleshooting silent or prematurely stopped tool loops; verify provider and host support before applying API-specific controls.
92
92
 
@@ -117,7 +117,7 @@ Offline, `qlty metrics` and `qlty smells` still work through built-in static ana
117
117
 
118
118
  Load `/skill:agent-browser` first for anything it covers: websites and web apps in Chrome/Chromium, Mobile Safari in the iOS Simulator (`agent-browser -p ios`), Electron and other apps that expose a CDP port, Slack, and cloud browsers. Its text snapshots cost far fewer tokens than desktop accessibility trees and screenshots. For native desktop apps, menus and menu bars, OS dialogs and permission prompts, desktop Safari and other non-Chromium browsers, and work across apps, load `/skill:agent-desktop` and drive the app with one-shot `agent-desktop` commands; when a custom workflow's TypeScript owns the scenario, call the `agent-desktop` CLI from `ctx.tool` instead. Native iOS apps in the Simulator and Android emulators need native mobile tooling; agent-desktop sees them only as desktop windows. See [what agent-browser covers](/computer-use#what-agent-browser-covers) for the full split, and [Computer use](/computer-use#desktop-automation-with-agent-desktop) for installing the agent-desktop CLI, readiness, permissions, and [coverage limits](/computer-use#coverage-and-limits). For terminal automation/testing, prefer `/skill:herdr` on macOS, Linux and Windows. Install Herdr if missing when network access and permissions permit; fall back to `/skill:tmux` or native Windows psmux when installation or use is not possible. Preserve the upstream skill's explicit-request and managed-pane requirements. These are separate interfaces, not interchangeable command names. See [verification and desktop safety](/workflows/verification) for installation, permissions, dedicated sessions and evidence.
119
119
 
120
- The bundled [agent-desktop skill](https://github.com/vercel-labs/agent-desktop/tree/v1.0.2/skills/agent-desktop) is upstream's `skills/agent-desktop/SKILL.md` at tag `v1.0.2`, Apache-2.0 licensed. Atomic owns its frontmatter and adds one section, "Install and permissions", with the bounded install attempt and the readiness check; the rest is upstream's text. It is a short guide: the detailed guides and every reference are compiled into the CLI and printed by `agent-desktop skills get desktop`, `agent-desktop skills get platform`, and `agent-desktop skills get desktop <reference>`, so they always match the installed version. The skill does not install the `agent-desktop` executable, and Atomic never runs `npx skills add` for it. Permission prompts stay with you: on macOS the agent opens `agent-desktop permissions --guide` and you approve it.
120
+ The bundled [agent-desktop skill](https://github.com/vercel-labs/agent-desktop/tree/v1.2.0/skills/agent-desktop) is upstream's `skills/agent-desktop/SKILL.md` at tag `v1.2.0`, Apache-2.0 licensed. Atomic owns its frontmatter and adds one section, "Install and permissions", with the bounded install attempt and the readiness check; the rest is upstream's text. It is a short guide: the detailed guides and every reference are compiled into the CLI and printed by `agent-desktop skills get desktop`, `agent-desktop skills get platform`, and `agent-desktop skills get desktop <reference>`, so they always match the installed version. The skill does not install the `agent-desktop` executable, and Atomic never runs `npx skills add` for it. Permission prompts stay with you: on macOS the agent opens `agent-desktop permissions --guide` and you approve it.
121
121
 
122
122
  The bundled [Herdr skill](https://github.com/herdrdev/herdr/blob/v0.9.5/skills/herdr/SKILL.md) requires an explicit Herdr mention or request and `HERDR_ENV=1`; it stops outside a Herdr-managed pane. It does not install Herdr or authorize control of unrelated panes. Use returned pane IDs, and check completion separately from command submission.
123
123
 
package/docs/storage.md CHANGED
@@ -183,7 +183,7 @@ Driver calls may return values or promises. The returned facade follows the rule
183
183
 
184
184
  When `transientFailure` recognizes a failure, the call rejects with `StorageTransientError` instead. A statement or batch that such a failure ended before it wrote anything runs again after 250 ms, then after waits that double, each varying by up to a fifth, up to `STORAGE_TRANSIENT_RETRY_ATTEMPTS` (5) runs in all. A failure inside an open transaction ends that transaction uncommitted, so the transaction counts as not applied whatever the request; only a commit, a batch, or a statement outside a transaction can be `"unknown"`, and such a call never runs again. A transaction runs again, callback included, only when you pass `{ retryTransientFailures: true }`: set it only for callbacks that do nothing but use the transaction handle. It runs again when the callback fails after a transient failure, or when the commit itself fails without having written anything; once the callback has returned, a failure the callback caught no longer counts, so a commit that may have applied, or that failed for a reason the driver does not recognize, never runs again. A value that is not a boolean rejects with `StorageConfigError` (field `retryTransientFailures`) before anything runs. Closing the database stops the waits and rejects with the last failure. The first failure a database runs a call again after is emitted once as a process warning.
185
185
 
186
- For a local file that several processes share, switch it to the write-ahead log with `switchToWriteAheadLog(exec, busyTimeoutMs)` from `@bastani/atomic/storage`, passing a call that runs SQL on the database, such as `(sql) => database.exec(sql)`, and the connection's busy timeout. SQLite does not wait for another connection's lock while it changes a file's journal mode, so a plain `PRAGMA journal_mode = WAL` fails at once with `SQLITE_BUSY` while another process writes the file or switches it at the same moment. The helper retries the switch until `busyTimeoutMs` has passed, as other statements wait, and throws any other failure at once.
186
+ For a local file that several processes share, switch it to the write-ahead log with `switchToWriteAheadLog(exec, busyTimeoutMs)` from `@bastani/atomic/storage`, passing a call that runs SQL on the database, such as `(sql) => database.exec(sql)`, and the connection's busy timeout. SQLite does not wait for another connection's lock while it changes a file's journal mode, so a plain `PRAGMA journal_mode = WAL` fails at once with `SQLITE_BUSY` while another process writes the file or switches it at the same moment. The helper retries `SQLITE_BUSY` until `busyTimeoutMs` has passed, as other statements wait. It also retries `SQLITE_IOERR_TRUNCATE` for at most 5 seconds or `busyTimeoutMs`, whichever is shorter. This can occur on Windows just after another process using the database exits. Other failures are thrown immediately, and a zero busy timeout disables both waits.
187
187
 
188
188
  You can also implement `SqliteDatabase` yourself by following the same rules. Either way, run the [conformance suite](#adapter-conformance) against it.
189
189
 
package/docs/tools.md CHANGED
@@ -151,6 +151,8 @@ Shell internal-URL expansion only touches URLs that stand in plain shell words.
151
151
 
152
152
  The `powershell` tool uses PowerShell single-quoted literals for resolved paths, doubling both ASCII apostrophes and PowerShell's smart single-quote delimiters (U+2018–U+201B). Bash keeps POSIX quoting, including when Bash runs on Windows. SDK adapters using `createBashToolDefinition` with custom PowerShell operations can set `shellDialect: "powershell"` for generated path literals; this option does not select the executable or rewrite deliberate shell code.
153
153
 
154
+ On Windows, the `powershell` tool prefers PowerShell 7 and falls back to Windows PowerShell 5.1. A successful native command such as `git push 2>&1 | Select-Object -Last 3` reports success even when Windows PowerShell 5.1 turns its redirected stderr into error records. Failed final statements still report failure; use an explicit `exit <code>` when your script needs to return a specific code.
155
+
154
156
  Configured command prefixes and SDK `spawnHook` rewrites remain executable shell syntax, not a sandbox. Balanced setup commands such as quoted exports remain supported. A prefix that leaves a quote, substitution, or heredoc open across the following command can invalidate the generated path quoting; automatic URL expansion does not validate that composed shell context. Do not combine URL expansion with such wrappers. Use structured `cwd` and `env` for path data instead.
155
157
 
156
158
  ## `kill`
@@ -208,7 +210,7 @@ Directory reads show a depth-2 tree sorted by most-recent modification time, wit
208
210
 
209
211
  These are the only internal URL schemes. `read`, `search`, `write`, `find` and `bash` share one list, and any other `scheme://` is not an Atomic resource: `read`, `search` and `write` report it as unsupported and `bash` leaves it as text. `find` accepts the schemes that resolve to filesystem paths (`skill://`, `local://`, `artifact://`).
210
212
 
211
- A cancelled `read` throws the same `FileToolAbortedError` as a cancelled `edit` or `write` (see [Edit and write errors](#edit-and-write-errors)). Filesystem failures such as `ENOENT` or `EACCES` are the filesystem's own errors.
213
+ A cancelled `read` or `find` throws the same `FileToolAbortedError` as a cancelled `edit` or `write` (see [Edit and write errors](#edit-and-write-errors)). Filesystem failures such as `ENOENT` or `EACCES` are the filesystem's own errors.
212
214
 
213
215
  Workspace-scoped selectors reject lexical and symlink escapes outside the workspace or skill root. Existing non-SQLite `.db` and `.sqlite` files remain plain files. Archive writes reject directory targets ending in `/` and return the resolved archive path. SQLite writes return source-path metadata.
214
216
 
@@ -848,10 +848,10 @@ The threshold applies to these waits; `wait.kind` on the stage's snapshot says w
848
848
 
849
849
  | `wait.kind` | The stage waits on | Status | What reopens the session |
850
850
  |---|---|---|---|
851
- | `tool` | A call of a `detachable` tool in its turn, including the built-in `bash`/`powershell` `wait` action without `budgetMs` and `ask_user_question`. Calls of other tools always run inline | `waiting`, or stays `awaiting_input` for an `ask_user_question` | The call's result (the task's end, or your answer); the same turn continues without a new user message |
852
- | `release` | `stage.release()` (see [StageContext](#stagecontext)), which releases at once | `waiting` | `stage.rehydrate()`, or the stage's next `sendUserMessage`, `steer`, or `followUp` |
851
+ | `tool` | A call of a `detachable` tool in its turn, including the built-in `bash`/`powershell` `wait` action without `budgetMs` and `ask_user_question`. Calls of other tools always run inline | `suspended`, or stays `awaiting_input` for an `ask_user_question` | The call's result (the task's end, or your answer); the same turn continues without a new user message |
852
+ | `release` | `stage.release()` (see [StageContext](#stagecontext)), which releases at once | `suspended` | `stage.rehydrate()`, or the stage's next `sendUserMessage`, `steer`, or `followUp` |
853
853
  | `prompt` | A human answer to its readiness question (advance, or keep chatting) | stays `awaiting_input` | The answer, before the stage continues |
854
- | `idle` | Nothing: the workflow holds the finished stage without using it, for example while it awaits `ctx.workflow(...)` or a run-level `ctx.ui` prompt | `waiting` | The stage's next `sendUserMessage`, `steer`, or `followUp`, or `rehydrate()` |
854
+ | `idle` | Nothing: the workflow holds the finished stage without using it, for example while it awaits `ctx.workflow(...)` or a run-level `ctx.ui` prompt | `suspended` | The stage's next `sendUserMessage`, `steer`, or `followUp`, or `rehydrate()` |
855
855
 
856
856
  A stage's own shell `wait` without a budget waits until its task ends instead of returning after 10 seconds, so the stage can release while a long build or test run goes on; the task keeps running on the stage's task host. A question the model asks with `ask_user_question` stays on the stage, in its chat and in `status`, while the stage is released, and your answer reopens it. After a restart, `/workflow resume` starts the shell wait again, and a wait whose task ended with the old process gets an error result naming the task (`TaskToolError`, `UnknownTask`) instead of hanging; the question is asked again.
857
857
 
@@ -863,7 +863,7 @@ Input sent to a stage waiting on a tool call (`sendUserMessage`, `steer`, `follo
863
863
 
864
864
  When the results of a tool wait arrive, the stage saves them with its wait before it reopens its session. Reopening tries the session store up to three times, waiting about 0.5 and then 2 seconds between attempts; a paused stage waits for its resume before trying again, and aborting the stage or the run stops the attempts with the abort's reason. Only a failure of the session store or the network is tried again. The reopened session then saves the results into its transcript; when the store or the network fails that save, the stage gives the session up, reopens it and hands the results over again, with the same three attempts and waits. A stage whose store is still unreachable after the third attempt fails with [`StageRehydrationError`](#stage-wait-errors) (`session-unavailable`, `phase: "reopen"` or `"resume-turn"`), and the run is blocked, not failed: once the store is reachable, `/workflow resume` continues the stage's turn from the saved results without running the tool again. A stage never completes on a turn whose results its session did not save: a reopened session that returns from the turn without them fails the stage with `StageRehydrationError` (`results-not-saved`), the run fails resumably, and `/workflow resume` continues the turn from the results the stage saved with its wait. A session the store does not hold fails at once with `session-not-found`. Any other failure, such as a missing credential or an unknown model, is reported as itself and handled as it would be anywhere else. A stage that cannot save one of its wait records after three attempts carries on, and its snapshot reports why in `waitRecordFailure`.
865
865
 
866
- A message, `rehydrate()`, or a prompt that arrives while the stage is still releasing its session waits for the release to finish, then reopens the stage: the stage is never left `waiting` with a live session, and `stage_waiting` always comes before the matching `stage_rehydrated`.
866
+ A message, `rehydrate()`, or a prompt that arrives while the stage is still releasing its session waits for the release to finish, then reopens the stage: the stage is never left `suspended` with a live session, and `stage_waiting` always comes before the matching `stage_rehydrated`.
867
867
 
868
868
  Resuming a run whose stage waited between turns (`release` or `idle`) sends no prompt again, neither the original nor a "continue" prompt: the stage's finished calls are answered from the run's record, and its next `sendUserMessage`, `steer` or `followUp` reopens the session and is sent as written. This needs the workflow to make the same stage calls in the same order, as durable replay already does. Before it takes the run, a resume checks that every stage the run left waiting can find its session in the session store, whether the run stopped with its process or failed or blocked and is resumed with `/workflow resume`. If any cannot, the resume changes nothing: `run()` throws `StageRehydrationError` with code `session-not-found` listing every missing session, and `/workflow resume` reports that error as its startup failure. A child workflow's waiting stages, also those of a child a local or shared worker pool runs, are checked the same way when the resumed child starts, in the session store the child reopens them from, before the child does any work. A worker pool keeps its children's sessions in a store the root run's journal selects: the journal itself for a SQLite journal or a shared pool, and a database on the machine that ran the pool for a local pool over a remote journal. A missing session fails the child, not the worker: its result is `failed` with a `StageRehydrationError` `session-not-found` whose `rootRunId` names the root run to resume, the parent's `ctx.workflow()` call rejects with that error in its `cause` chain, and the pool does not retry the child. Resuming the root runs the child again, so it checks its sessions again rather than repeating the refusal. A stage that keeps its session in its own `sessionStore` option is checked when the resumed workflow calls that stage again, before the stage does any work. A missing session fails with `StageRehydrationError` `session-not-found` naming the stage.
869
869
 
@@ -1373,7 +1373,7 @@ stage.release(): Promise<void>;
1373
1373
  stage.rehydrate(): Promise<void>;
1374
1374
  ```
1375
1375
 
1376
- `release()` gives up the stage's session between prompts, for a workflow that holds a stage across a long wait of its own (a child workflow, an external job). The stage is `waiting` with `wait.kind: "release"` until `rehydrate()`, or the next `sendUserMessage`, `steer`, or `followUp`, reopens the same session from the session store. A `ctx.stage` runs one `prompt()`, so `release()` does not make a second `prompt()` possible: it is refused, as it is without a release. A `ctx.task` reopens through its own continuation. `rehydrate()` also reopens the session of a stage whose tool wait ended without reopening it. Both calls do nothing when there is nothing to do: `release()` on a stage with no session or one already released, including a stage a resumed run replayed from its checkpoint, `rehydrate()` on a resident stage or one waiting on a tool call, whose result reopens it. On a replayed stage, `rehydrate()` rejects with `StageRehydrationError` `replayed-stage`.
1376
+ `release()` gives up the stage's session between prompts, for a workflow that holds a stage across a long wait of its own (a child workflow, an external job). The stage is `suspended` with `wait.kind: "release"` until `rehydrate()`, or the next `sendUserMessage`, `steer`, or `followUp`, reopens the same session from the session store. A `ctx.stage` runs one `prompt()`, so `release()` does not make a second `prompt()` possible: it is refused, as it is without a release. A `ctx.task` reopens through its own continuation. `rehydrate()` also reopens the session of a stage whose tool wait ended without reopening it. Both calls do nothing when there is nothing to do: `release()` on a stage with no session or one already released, including a stage a resumed run replayed from its checkpoint, `rehydrate()` on a resident stage or one waiting on a tool call, whose result reopens it. On a replayed stage, `rehydrate()` rejects with `StageRehydrationError` `replayed-stage`.
1377
1377
 
1378
1378
  `release()` throws `StageReleaseError` with code `stage-busy` while one of the stage's prompts runs, and `not-reopenable` when no store can reopen its session; the stage is unchanged. A stage that cannot reopen its session fails with `StageRehydrationError`.
1379
1379
 
@@ -1555,7 +1555,7 @@ interface RunFailureClassification extends WorkflowSerializableObject {
1555
1555
  readonly disposition?: "active_blocked" | "terminal_killed" | "terminal_failed";
1556
1556
  readonly retryAfterMs?: number;
1557
1557
  }
1558
- type StageStatus = RunStatus | "skipped" | "awaiting_input" | "blocked" | "waiting";
1558
+ type StageStatus = RunStatus | "skipped" | "awaiting_input" | "blocked" | "suspended";
1559
1559
  interface StageSnapshot extends WorkflowSerializableObject {
1560
1560
  readonly id: string;
1561
1561
  readonly name: string;
@@ -1573,7 +1573,7 @@ interface StageSnapshot extends WorkflowSerializableObject {
1573
1573
  }
1574
1574
  ```
1575
1575
 
1576
- Programmatic `run(...)` returns this type. `exited` identifies `ctx.exit(...)` termination, and `stages` contains the final stage snapshots. A stage is `waiting` while it waits with its session released; `wait` says on what (see [`releaseWhenWaiting`](#releasewhenwaiting)). A stage's snapshot also carries `waitRecordFailure`, a serialized `StageWaitRecordError` that `deserializeStageWaitError` rebuilds, when a record of its wait could not be saved after three attempts; the stage carried on, and a resume after a restart may start it from an earlier record (see [Stage wait errors](#stage-wait-errors)).
1576
+ Programmatic `run(...)` returns this type. `exited` identifies `ctx.exit(...)` termination, and `stages` contains the final stage snapshots. A stage is `suspended` while it waits with its session released; `wait` says on what (see [`releaseWhenWaiting`](#releasewhenwaiting)). `suspended` was called `waiting` before: records written under the old name still read as `suspended`, and the workflow tool's `statusFilter` still accepts `waiting` as a deprecated alias. A stage's snapshot also carries `waitRecordFailure`, a serialized `StageWaitRecordError` that `deserializeStageWaitError` rebuilds, when a record of its wait could not be saved after three attempts; the stage carried on, and a resume after a restart may start it from an earlier record (see [Stage wait errors](#stage-wait-errors)).
1577
1577
 
1578
1578
  `failure` describes how a run that failed, or blocked on a failure, was classified. It is absent for runs that did not fail, and for results recorded before this field existed.
1579
1579
  - `kind` and `code` say what failed.
@@ -1920,7 +1920,7 @@ interface WorkflowWorkerHost {
1920
1920
 
1921
1921
  `workspace` binds the root's pooled children to a repository state, identified by its `remotes`, `head`, `tree` and `envHash`. A child started with `ctx.workflow(child, { workspace })` is bound to its own workspace's state instead. A bound child runs only on a host whose `placement.prefer(binding)` returns the path of a worktree with that tree, or on a host that restores it, at the path the restore resolves; never elsewhere, and never on the root's own workers. A child bound with `ctx.workflow(child, { workspace })` runs with its workspace bound to that host's worktree. A cold host can restore a bound tree, the root's or a child's, with its uncommitted, untracked and unpushed content: the root snapshots its own bound worktree when it starts and a child's bound worktree when it dispatches the child, following the root's `snapshots` settings, and the work carries that snapshot. A binding with no worktree on the root's machine, such as a `WorkspaceBinding` alone, restores only from its remotes and from snapshots that checkpoints recorded of that exact tree. If no host that could run it claims it within `claimWindowMs` (default `60000`), it fails with `WorkspaceRestoreUnavailableError`. A child without a binding runs on any host in the root's recorded working directory.
1922
1922
 
1923
- `startWorkflowWorkerHost` serves every running root with shared placement on `journal`, with up to `maxWorkers` workers, for the worker definitions it has at the same paths and entry digest. `labels` and `hostId` (default: an id kept in this machine's Atomic state) name it in the pool's host registry. `restore` makes a binding's tree available on the host and resolves a verified worktree path. `options.snapshot` is the `WorktreeSnapshot` the work carries, when its root captured one. By default the host restores with [`restoreWorktree`](#worktree-snapshots): it rebuilds the tree from that snapshot, or else from the binding's remotes and the worktree snapshots recorded with the same `tree` and `head` in the shared journal, so uncommitted content restores too, into a new worktree under `<agentDir>/worktree-snapshots/worktrees`, and then runs the resume setup hook there from that agent directory's global `resume.setupCommand`, or a trusted repository's `.atomic/setup`, before the child starts (a host with neither refuses work whose snapshot has dependency inputs; a host given its own `restore` runs no hook; see [Resume on any machine](/guides/resume-on-any-machine)). `restore: false` turns restoring off; such a host takes bound work only where `prefer` finds its tree. A binding whose restore fails waits before the host tries it again, one second after the first failure and twice as long after each further one, up to a minute; while it waits, the host does not count as able to restore it. `git` is how it runs git, as `{ path, env }`. By default it runs the git `resolveGit()` from `@bastani/atomic` resolves: a host given a `restore` function gets a portable git when the machine has none, and any other host never downloads one and restores by default only when it has git. The host's workers find that git first on their `PATH`, with its `env` set, and `prefer` and `restore` receive it as `options.git` for the git commands they run. `stop()` stops its workers at once and puts the children they held back in the queue, without waiting for a `prefer` or `restore` call in flight (the host aborts the `signal` it passed them) or for workers still starting up, which it stops too. `drain()` lets running children finish first; a `stop()` during a drain stops at once. `stats()` returns `{ hostId, labels, git, restore, maxWorkers, workers, busy, roots, lastPlacementFailure?, lastDetach?, lastHealth? }`: `git` is `"system"`, `"provisioned"` (a portable git Atomic downloaded) or `"unavailable"`, `restore` says whether the host takes bound work it does not have warm, and `roots` holds each served root's `SharedPoolStats` (`ready`, `leased`, `completed`, `failed`, `pendingStageInputs`, `hosts` with their workers, the roots they serve and their leases, and `leases` with `renewedAgoMs` and `expiresInMs`). `lastPlacementFailure` is the last `prefer` or `restore` that failed, `lastDetach` why the host last stopped serving a root, and `lastHealth` the last health warning of its workers, such as a worker cleanup it could not confirm.
1923
+ `startWorkflowWorkerHost` serves every running root with shared placement on `journal`, with up to `maxWorkers` workers, for the worker definitions it has at the same paths and entry digest. `labels` and `hostId` (default: an id kept in this machine's Atomic state) name it in the pool's host registry. `restore` makes a binding's tree available on the host and resolves a verified worktree path. `options.snapshot` is the `WorktreeSnapshot` the work carries, when its root captured one. By default the host restores with [`restoreWorktree`](#worktree-snapshots): it rebuilds the tree from that snapshot, or else from the binding's remotes and the worktree snapshots recorded with the same `tree` and `head` in the shared journal, so uncommitted content restores too, into a new worktree under `<agentDir>/worktree-snapshots/worktrees`, and then builds the worktree's blueprints there from that agent directory's global blueprint and a trusted repository's `.atomic/blueprint.yaml`, before the child starts (a blueprint that fails is a warning the host prints, never a reason to refuse the child; a host given its own `restore` builds none; see [Resume on any machine](/guides/resume-on-any-machine)). `restore: false` turns restoring off; such a host takes bound work only where `prefer` finds its tree. A binding whose restore fails waits before the host tries it again, one second after the first failure and twice as long after each further one, up to a minute; while it waits, the host does not count as able to restore it. `git` is how it runs git, as `{ path, env }`. By default it runs the git `resolveGit()` from `@bastani/atomic` resolves: a host given a `restore` function gets a portable git when the machine has none, and any other host never downloads one and restores by default only when it has git. The host's workers find that git first on their `PATH`, with its `env` set, and `prefer` and `restore` receive it as `options.git` for the git commands they run. `stop()` stops its workers at once and puts the children they held back in the queue, without waiting for a `prefer` or `restore` call in flight (the host aborts the `signal` it passed them) or for workers still starting up, which it stops too. `drain()` lets running children finish first; a `stop()` during a drain stops at once. `stats()` returns `{ hostId, labels, git, restore, maxWorkers, workers, busy, roots, lastPlacementFailure?, lastDetach?, lastHealth? }`: `git` is `"system"`, `"provisioned"` (a portable git Atomic downloaded) or `"unavailable"`, `restore` says whether the host takes bound work it does not have warm, and `roots` holds each served root's `SharedPoolStats` (`ready`, `leased`, `completed`, `failed`, `pendingStageInputs`, `hosts` with their workers, the roots they serve and their leases, and `leases` with `renewedAgoMs` and `expiresInMs`). `lastPlacementFailure` is the last `prefer` or `restore` that failed, `lastDetach` why the host last stopped serving a root, and `lastHealth` the last health warning of its workers, such as a worker cleanup it could not confirm.
1924
1924
 
1925
1925
  #### Worker placement errors
1926
1926
 
@@ -1930,7 +1930,7 @@ Every error of shared placement extends `WorkerPlacementError`, carries a stable
1930
1930
  | --- | --- | --- | --- | --- |
1931
1931
  | `WorkerPlacementConfigError` (`isWorkerPlacementConfigError`) | `invalid-option`, `requires-local-workers`, `unsupported-option`, `changed-on-resume` | A `workers`, `startWorkflowWorkerHost` or worker option is invalid, checked before anything starts; or a resume changes a `workers` setting that cannot change (`changed-on-resume`: shared placement turned on or off, or a different `workspace`). | `source` (`sdk`, `settings`, `env`), `field`, `detail` (for `changed-on-resume`, every refused change) | Fix the named field, or resume with the settings the root started with. |
1932
1932
  | `SharedPoolSetupError` (`isSharedPoolSetupError`) | `shared-journal-required`, `storage-adapter-unavailable`, `journal-secret-unavailable`, `git-unavailable`, `process-containment-unavailable`, `pool-on-another-host` | Setup is missing: the journal is not shared, its adapter does not load, a secret's variable or file is missing, a host has `restore` but no git, a worker host or a root with `localWorkers` runs where its workers cannot contain their tool processes (Windows, or no native process identity), or a non-shared pooled root is resumed on another machine. Every missing piece is reported together, before anything is opened. `code` is the first one's. | `operation` (`shared-placement`, `worker-host`, `resume`, `local-pool`), `problems[]` with each `code`, `subject`, `hint` and fields | Follow each problem's `hint`, for example `atomic team join <url> --token-file <path>`, `atomic install npm:@bastani/atomic-storage-libsql`, or the platform's git install command. |
1933
- | `WorkspaceRestoreUnavailableError` (`isWorkspaceRestoreUnavailableError`) | `workspace-restore-unavailable` | A bound child cannot run anywhere: no capable live host claimed it within `claimWindowMs` (`reason: "no-capable-host"`; a host waiting after failed restores of the binding is not capable, and its last failure is the `cause`), or the default restore cannot run on a host because its git does not run (`"no-restore-port"`, reported as the host's `lastPlacementFailure`). | `reason`, `binding` (identity, remote credentials removed), `childRunId`, `claimWindowMs`, `cause` | Start a host that has the tree or can restore it (install git, make the binding's remotes reachable, and, when the snapshot has dependency inputs, set `resume.setupCommand` in its global settings or trust restored worktrees to run `.atomic/setup`), then resume the root. |
1933
+ | `WorkspaceRestoreUnavailableError` (`isWorkspaceRestoreUnavailableError`) | `workspace-restore-unavailable` | A bound child cannot run anywhere: no capable live host claimed it within `claimWindowMs` (`reason: "no-capable-host"`; a host waiting after failed restores of the binding is not capable, and its last failure is the `cause`), or the default restore cannot run on a host because its git does not run (`"no-restore-port"`, reported as the host's `lastPlacementFailure`). | `reason`, `binding` (identity, remote credentials removed), `childRunId`, `claimWindowMs`, `cause` | Start a host that has the tree or can restore it (install git and make the binding's remotes reachable), then resume the root. |
1934
1934
  | `StaleStageLeaseError` (`isStaleStageLeaseError`) | `stale-stage-lease` | A worker that no longer holds a stage tried to settle one of its inputs: its attempt was replaced, or another holder took the stage's lease. Nothing was written. | `reason`, `root`, `runId`, `stageId`, `seq` | None; the stage's current holder processes the input. |
1935
1935
  | `StageInputInvalidError` (`isStageInputInvalidError`) | `stage-input-invalid` | An input queued for a stage of a shared pool has a `kind` the stage does not take (`reason: "unknown-kind"`) or a payload that lacks what its kind needs (`"malformed-payload"`). Nothing was written. | `reason`, `kind`, `runId`, `stageId`, `field` | Queue the input with one of the `PooledStageInputKind`s and the payload that kind takes. |
1936
1936
  | `StageInputTimeoutError` (`isStageInputTimeoutError`) | `stage-input-timeout` | The root waited longer than its bound for the receipt of an input it queued for a stage on another host: no host runs the stage's work (`phase: "unclaimed"`), the host running it has not had the stage take it yet, as while the stage waits for an answer (`"deferred"`), or the host that took it did not acknowledge it (`"applying"`). `retryable` is `true`: the input stays queued and is applied once. | `root`, `runId`, `stageId`, `seq`, `kind`, `timeoutMs`, `elapsedMs`, `phase` | Check that a worker host serving the root is running; the input is delivered once a host holding the stage takes it. |
@@ -2225,7 +2225,7 @@ interface StageWaitSnapshot {
2225
2225
  }
2226
2226
  ```
2227
2227
 
2228
- `stage_waiting` fires once the stage released its session and its wait is saved; `stage_rehydrated` fires once the same session reopened. The stage's `StageSnapshot` carries the same `wait` while its session is released: with status `waiting`, or `awaiting_input` for a `prompt` wait. Exceptions and rejections from the listener are logged and do not affect the stage.
2228
+ `stage_waiting` fires once the stage released its session and its wait is saved; `stage_rehydrated` fires once the same session reopened. The stage's `StageSnapshot` carries the same `wait` while its session is released: with status `suspended`, or `awaiting_input` for a `prompt` wait. Exceptions and rejections from the listener are logged and do not affect the stage.
2229
2229
 
2230
2230
  #### Stage wait errors
2231
2231
 
@@ -2251,7 +2251,7 @@ The errors around waiting stages share the family base `StageWaitError`. Each ha
2251
2251
 
2252
2252
  `evictWhenWaiting` lets a root run leave memory while its stages only wait on detached tool calls. [`releaseWhenWaiting`](#releasewhenwaiting) gives up each waiting stage's session; eviction also drops the run's stage objects and everything the workflow body awaits, so each waiting stage is only a small index entry: its run, stage, replay key, wait reason, the ids of the calls it waits on and of those that already have results, and its stored session, named as a released agent session names it. The calls keep running. It accepts `true` (evict after `DEFAULT_EVICT_WHEN_WAITING_AFTER_MS`, 60 seconds), `{ afterMs }` with a number of milliseconds from 0 to 2147483647, or `false`, the default.
2253
2253
 
2254
- A run is evicted once, for `afterMs`, every one of its stages either waits released on a detached call or holds nothing, at least one waits on a call, and no `ctx.tool`, `ctx.ui` or `ctx.workflow` call, pause, or message held for a waiting stage is outstanding. A run that is busy beside its waiting stages is checked again every `afterMs`, and at most once a second. An evicted run stays `running`, its waiting stages show `waiting`, and the process keeps the run's lease, so no other process resumes it. The run is rebuilt in the same process when every call of one of its stages has a result, when `deliverStageWake` sends a waiting stage a message, when its run control pauses or quits it, or when its `signal` or cancellation registry kills it. Results that arrive together rebuild it once. The rebuild runs the workflow body again from the start, as a resume does: stage calls that had finished return their recorded results without asking the model, stages still waiting wait on the same calls again without reopening their sessions or running the calls again, and woken stages continue their turns. A rebuilt run is evicted again the next time it only waits. `onRunStart` and `onWorkflowStartReady` run once and the run keeps its first start time, however often it is rebuilt; stage-level callbacks such as `onStageLifecycleEvent` can repeat for stages the rebuild replays, as they do on a resume. If the process exits while a run is evicted, `/workflow resume` continues it like any run whose stages were waiting.
2254
+ A run is evicted once, for `afterMs`, every one of its stages either waits released on a detached call or holds nothing, at least one waits on a call, and no `ctx.tool`, `ctx.ui` or `ctx.workflow` call, pause, or message held for a waiting stage is outstanding. A run that is busy beside its waiting stages is checked again every `afterMs`, and at most once a second. An evicted run stays `running`, its waiting stages show `suspended`, and the process keeps the run's lease, so no other process resumes it. The run is rebuilt in the same process when every call of one of its stages has a result, when `deliverStageWake` sends a waiting stage a message, when its run control pauses or quits it, or when its `signal` or cancellation registry kills it. Results that arrive together rebuild it once. The rebuild runs the workflow body again from the start, as a resume does: stage calls that had finished return their recorded results without asking the model, stages still waiting wait on the same calls again without reopening their sessions or running the calls again, and woken stages continue their turns. A rebuilt run is evicted again the next time it only waits. `onRunStart` and `onWorkflowStartReady` run once and the run keeps its first start time, however often it is rebuilt; stage-level callbacks such as `onStageLifecycleEvent` can repeat for stages the rebuild replays, as they do on a resume. If the process exits while a run is evicted, `/workflow resume` continues it like any run whose stages were waiting.
2255
2255
 
2256
2256
  Enable it only for a workflow body that a resume can replay. Code outside `ctx` calls runs again on every rebuild, and anything the body awaits besides `ctx` calls is dropped at eviction: code that still runs afterwards, such as a timer callback, gets `RunEvictedError` from its next `ctx` call. While a run is evicted its stages have no control handles, so stage chat and `stageControlRegistry` sends reach them only once a wake has rebuilt the run, and `deliverStageWake` to a stage that is not waiting returns `stage-not-open`.
2257
2257
 
@@ -2296,7 +2296,9 @@ When a child workflow fails on a typed error, in this process or on a pooled wor
2296
2296
  | `task-tool` | `TaskToolError` | `isTaskToolError` |
2297
2297
  | `task-message` | `TaskMessageError`, `TaskMessageTimeoutError` | `isTaskMessageError` |
2298
2298
  | `intercom-broker` | [`IntercomBrokerError`](/intercom/operations) and its subclasses `IntercomBrokerSuccessorTimeoutError`, `IntercomBrokerProtocolError`, `IntercomBrokerUpgradeError` and `IntercomBrokerStopTimeoutError` | `isIntercomBrokerError` |
2299
- | `resume` | [`ResumeError`](/guides/resume-on-any-machine#what-can-stop-a-resume) and its subclasses `ResumeNotFoundError`, `ResumePreconditionError`, `ResumeSetupHookError`, `ResumeCatalogUnavailableError`, `ResumeCatalogTimeoutError` | `isResumeError` |
2299
+ | `resume` | [`ResumeError`](/guides/resume-on-any-machine#what-can-stop-a-resume) and its subclasses `ResumeNotFoundError`, `ResumePreconditionError`, `ResumeCatalogUnavailableError`, `ResumeCatalogTimeoutError` | `isResumeError` |
2300
+ | `missing-session-cwd` | [`MissingSessionCwdError`](/sdk/reference#missing-session-directory) | `isMissingSessionCwdError` |
2301
+ | `blueprint` | [`BlueprintError`](/sdk/reference#blueprint-errors) and its subclasses `BlueprintInvalidError`, `BlueprintStepFailedError`, `BlueprintStepTimedOutError`, `BlueprintUsesUnsupportedError`, `BlueprintBuildFailedError` | `isBlueprintError` |
2300
2302
  | `worker-pool`, `workflow-infrastructure`, `journal`, `worker-placement`, `task-cleanup` | The [worker pool errors](#worker-pool-errors), journal lease errors, shared placement and setup errors (`WorkerPlacementConfigError`, `SharedPoolSetupError`, `WorkspaceRestoreUnavailableError`, `StaleStageLeaseError`) and `TaskCleanupError` | Each class's guard |
2301
2303
  | `storage`, `journal-store`, `fork` | Storage errors (team profile errors among them), journal store errors and [fork errors](#fork-errors) | Each family's guard |
2302
2304
 
@@ -799,7 +799,35 @@ export default workflow({
799
799
 
800
800
  Hand the path to a later chat stage in its prompt. Review generated assets before publishing them or citing them as evidence: a generated image is not proof of a real-world state.
801
801
 
802
- To call OpenAI's Images API with your own OpenAI API key instead of OpenRouter, use an `openai-images` model, for example `models.getModelOfType("image", "openai-images", "gpt-image-2.6-flare")`. The provider also lists `gpt-image-2.6-sunburst`, `gpt-image-2.5-flare`, `gpt-image-2.5-sunburst`, `gpt-image-2`, `gpt-image-1.5`, `gpt-image-1`, and `gpt-image-1-mini`. It has no login of its own: it uses the key saved for `openai-api`, then a key saved for `openai`, then `OPENAI_API_KEY`. A ChatGPT sign-in cannot call the Images API, so with only that sign-in the call returns `stopReason: "error"` with `Provider is not configured: openai-images`. Text blocks become the prompt; add image blocks to `input` to edit them or use them as references. Pass `size`, `quality`, `n`, `background`, `outputFormat`, `outputCompression`, `complexity`, `moderation`, or `safetyIdentifier` with the other options when you need them, for example `{ signal, size: "1024x1024", quality: "low" }`; each generated image is a separate image block in `result.output`. GPT Image 2.6 models also return an animated GIF (`outputFormat: "gif"` with `frameCount` 2-16 and `frameDurationMs`) or an SVG (`outputFormat: "svg"`, `n` 1, and `svg: { model }` naming the model that writes it); both are generation-only, and the `mimeType` of the block (`image/gif`, `image/svg+xml`) decides the file extension. In an edit, the first image is the base and the others are references; mark one image block `role: "markup"` (a transparent PNG with annotations, the size of the first image) or `role: "mask"` to send it as the `markup` or `mask` field instead. A request that cannot succeed returns `stopReason: "error"` before anything is sent, with a typed `result.error` whose `code` is `invalid-option` and whose `fields.field` names the option; a blocked prompt returns `code: "moderation-blocked"`. See [Image generation](/extensions/api-reference#ctx-modelregistry-/-ctx-model-/-ctx-scopedmodels).
802
+ To call OpenAI's Images API with your own OpenAI API key instead of OpenRouter, use an `openai-images` model, for example `models.getModelOfType("image", "openai-images", "gpt-image-2.6-flare")`. The provider also lists `gpt-image-2.6-sunburst`, `gpt-image-2.5-flare`, `gpt-image-2.5-sunburst`, `gpt-image-2`, `gpt-image-1.5`, `gpt-image-1`, and `gpt-image-1-mini`. It has no login of its own: it uses the key saved for `openai-api`, then a key saved for `openai`, then `OPENAI_API_KEY`. A ChatGPT sign-in cannot call the Images API, so with only that sign-in the call returns `stopReason: "error"` with `Provider is not configured: openai-images`. Text blocks become the prompt; add image blocks to `input` to edit them or use them as references. Pass `size`, `quality`, `n`, `background`, `outputFormat`, `outputCompression`, `complexity`, `moderation`, or `safetyIdentifier` with the other options when you need them, for example `{ signal, size: "1024x1024", quality: "low" }`; each generated image is a separate image block in `result.output`. GPT Image 2.6 models also return an animated GIF (`outputFormat: "gif"` with `frameCount` 2-16 and `frameDurationMs`) or an SVG (`outputFormat: "svg"` and `n` 1); both are generation-only, and the `mimeType` of the block (`image/gif`, `image/svg+xml`) decides the file extension. SVG needs no `svg` option: when the account's API answers that `svg.model` is required and the call set no `svg`, `generateImages()` retries once with `gpt-6.1-sol`, and `result.svgModel` reports the model that wrote the SVG. OpenAI's API reference lists no authoring models and no default, so `gpt-6.1-sol` is a value that worked in testing, not a documented default; pass `svg: { model, reasoning }` to choose another, which is always sent as given. A rejected `svg.model` returns `error.code` `invalid-option` with `error.fields.field` `svg.model` and `error.fields.reason` `required-by-api` or `rejected-by-api`. SVG authoring takes tens of seconds (plain requests took 12 to 46 seconds in testing, and OpenAI says complex prompts can take up to 2 minutes), so give the `ctx.tool` step a `timeoutMs` of at least 180_000 instead of the 120_000 above, or omit it. In an edit, the first image is the base and the others are references; mark one image block `role: "markup"` (a transparent PNG with annotations, the size of the first image) or `role: "mask"` to send it as the `markup` or `mask` field instead. A request that cannot succeed returns `stopReason: "error"` before anything is sent, with a typed `result.error` whose `code` is `invalid-option` and whose `fields.field` names the option; a blocked prompt returns `code: "moderation-blocked"`. See [Image generation](/extensions/api-reference#ctx-modelregistry-/-ctx-model-/-ctx-scopedmodels).
803
+
804
+ Inside the `run` function above, a step that writes a plain SVG and a four-frame GIF with an OpenAI key:
805
+
806
+ ```ts
807
+ const assets = await ctx.tool("generate-svg-and-gif", { brief, outputDir }, async ({ signal }) => {
808
+ const models = builtinModels({ credentials: AuthStorage.create() });
809
+ const flare = models.getModelOfType("image", "openai-images", "gpt-image-2.6-flare");
810
+ if (!flare) throw new Error("gpt-image-2.6-flare is unavailable");
811
+ const input = [{ type: "text" as const, text: brief }];
812
+ const svg = await models.generateImages(flare, { input }, { signal, outputFormat: "svg" });
813
+ const gif = await models.generateImages(flare, { input }, {
814
+ signal,
815
+ outputFormat: "gif",
816
+ frameCount: 4,
817
+ frameDurationMs: 200,
818
+ size: "512x512",
819
+ });
820
+ const paths: Record<string, string> = {};
821
+ await mkdir(outputDir, { recursive: true });
822
+ for (const [name, result] of [["image.svg", svg], ["image.gif", gif]] as const) {
823
+ const image = result.output.find((block) => block.type === "image");
824
+ if (result.stopReason !== "stop" || !image) throw new Error(result.errorMessage ?? `No image for ${name}`);
825
+ paths[name] = join(outputDir, name);
826
+ await writeFile(paths[name], Buffer.from(image.data, "base64"));
827
+ }
828
+ return { svgModel: svg.svgModel, paths };
829
+ }, { timeoutMs: 300_000 });
830
+ ```
803
831
 
804
832
  `builtinModels()` covers Atomic's built-in image providers. For another image backend, register its implementation for a new `api` ID with `registerImagesApiProvider({ api, generateImages })` from `@bastani/pi-ai/compat`, then call `generateImages(model, context, { apiKey, signal })` from the same entry point with a model whose `api` matches. That call dispatches on `model.api` and does not look up credentials, so take `apiKey` from your own configuration, such as an environment variable, and never put it in workflow state or outputs. `@bastani/pi-ai/compat` is not one of the host-provided imports, so install `@bastani/pi-ai` next to the workflow. To make an image backend available to codemode and extensions through the session's model registry instead, register a provider with `images`; see [Custom providers](/custom-provider#quick-reference).
805
833
 
@@ -213,9 +213,16 @@ Inputs:
213
213
  |---|---|---|---|---|
214
214
  | `prompt` | text | yes | — | What to design. The discovery stage refines the brief, output type, and references. |
215
215
  | `discover_references` | boolean | no | `true` | Discover current design references and feed them to generation. |
216
+ | `image_model` | text | no | newest available image model | Image model for design reference images, as `provider/id` (for example `openai-images/gpt-image-2.6-flare`). Overrides the automatic choice. |
216
217
 
217
218
  The workflow establishes or loads project design context, extracts user-provided references, can browse curated galleries, writes one live `preview.html`, and exports an HTML spec and implementation handoff after the review session. Browser-backed preview and review use the `agent-browser` skill when available. Research context moves between stages as artifact files rather than inline prompt payloads: the composed project design context is written to `<artifact_dir>/design-context.md` and the curated references brief to `<artifact_dir>/references.md`; `reference-discovery`, `generate-1`, and `exporter` read the required files via `reads` with explicit read instructions.
218
219
 
220
+ **Reference images.** When an image model is available, the workflow renders three design reference images after reference discovery and before generation: one per visual direction (reference-led, brand-forward, and information-dense), prompted from the confirmed brief, `PRODUCT.md`, `DESIGN.md`, and the curated references, at high quality. They are written to `<artifact_dir>/references/`. `generate-1` reads them and matches the direction that best fits the brief; the run-level gate and the session-start stage list each image with its `file://` URL; and the exporter adds a "Design References" section to `spec.html` that links the images by relative path, so keep `spec.html` next to its `references/` folder when you move it.
221
+
222
+ The workflow picks the newest available GPT Image model first (`openai-images/gpt-image-2.6-flare`, then `gpt-image-2.6-sunburst`, then older GPT Image versions in descending order), so newer releases win automatically, and then other image providers such as OpenRouter. Pass `image_model` to choose a model yourself; if it does not name an available model, the images are skipped instead of falling back to another one. Models come from Atomic's built-in image providers and the credentials you saved: an OpenAI API key enables the `openai-images` models and an OpenRouter key enables OpenRouter's image models. A ChatGPT sign-in cannot call the Images API, and image models added through `models.json` or an extension are not used. Each run with an image model makes three image requests billed to that provider account.
223
+
224
+ With no image model, or when generation fails (moderation, quota, rate limit, timeout, and so on), the run continues exactly as it would without images and shows no warning. The `reference_images_status` output records what happened: `status` (`skipped`, `generated`, or `failed`), the `reason`, the `model` used, the image `paths`, and `retryable` for a failure the provider classified. For a classified failure the `reason` is the provider's error code, such as `moderation-blocked`, `quota-exceeded`, `rate-limited`, or `timeout`; otherwise it is `no-image-model`, `image-model-unavailable`, `unclassified`, `no-images-written`, `write-failed`, `unexpected-error`, or `tool-failed`.
225
+
219
226
  **The run-level gate.** The browser review is a long-poll, not an `awaiting_input` graph node, so the run first pauses at a deterministic prompt that names the preview path and `file://` URL. Answer `Start live review` to open the browser session — the session-start stage prints the live `http://` review URL in its first lines of output, visible via `/workflow connect <run-id>` — or `Skip remaining review rounds and export as-is` to export the current preview without opening a session. In headless runs the gate is skipped.
220
227
 
221
228
  **One live session, then export.** The `live` session is unbounded: the user picks elements, receives three on-brand variants, accepts edits that are written into `preview.html` in place, and steers the page until leaving. The workflow-owned loop ends on the helper's `exit` event, and the exporter receives the preview exactly as it stands. There is no second opinion, decision stage, or later review session.
@@ -224,11 +231,12 @@ The workflow uses Atomic's bundled live-review helper, not a project-vendored co
224
231
 
225
232
  **Ending the review is the user's job.** The session waits through any amount of silence — a poll timeout is not an ending — so the run advances only when the user clicks exit in the Impeccable overlay, closes the browser tab, or says `exit live`. The run-level gate says so before the session opens, and the session-start stage prints it again directly under the live review URL. Ending the session exports the design as it then stands: there is no further round and no confirmation step.
226
233
 
227
- No `<artifact_dir>/feedback/` directory, JSON record, Markdown copy, or annotated-snapshot copy is written. The declared outputs are `output_type`, `design_system`, `artifact`, `handoff`, `import_context`, `run_id`, `artifact_dir`, `preview_path`, `preview_file_url`, `spec_path`, `spec_file_url`, and `agent_browser_status`. It has no implicit `result` output.
234
+ No `<artifact_dir>/feedback/` directory, JSON record, Markdown copy, or annotated-snapshot copy is written. The declared outputs are `output_type`, `design_system`, `artifact`, `handoff`, `import_context`, `run_id`, `artifact_dir`, `preview_path`, `preview_file_url`, `spec_path`, `spec_file_url`, `agent_browser_status`, and `reference_images_status`. It has no implicit `result` output.
228
235
 
229
236
  ```text
230
237
  /workflow open-claude-design prompt="Refresh the settings page hierarchy"
231
238
  /workflow open-claude-design prompt="Design a marketing landing page" discover_references=false
239
+ /workflow open-claude-design prompt="Design a pricing page" image_model=openai-images/gpt-image-2.6-flare
232
240
  ```
233
241
 
234
242
  ### Launching with natural language
@@ -261,7 +261,7 @@ The workflow tool exposes lifecycle controls for non-interactive use:
261
261
  workflow({ action: "status" }) // list every session run, in-flight first
262
262
  workflow({ action: "status", statusFilter: "running" }) // filter the run listing by status
263
263
  workflow({ action: "status", statusFilter: "awaiting_input" }) // runs with a pending human prompt
264
- workflow({ action: "status", statusFilter: "waiting" }) // runs with a stage waiting with its session released
264
+ workflow({ action: "status", statusFilter: "suspended" }) // runs with a stage suspended with its session released
265
265
  workflow({ action: "status", format: "json" }) // structured listing for programmatic use
266
266
  workflow({ action: "status", runId: "<full-run-uuid>" }) // full detail for one run
267
267
  workflow({ action: "status", runId: "<full-run-uuid>", summary: true }) // status, outputs and blockers only
@@ -300,9 +300,9 @@ Control behavior:
300
300
 
301
301
  - `runId` accepts the full UUID or a unique 8-character hexadecimal prefix for lifecycle and inspection actions, including `status`. Status lists and run pickers show top-level user-launched workflows; nested child runs remain part of the expanded parent graph.
302
302
  - `status`, `stages`, `stage`, and `transcript` with a full `runId` use the session store, then read the journal if the run is absent locally. Inspection never claims ownership or executes workflow code. A running root with an expired lease appears as `crashed`; a live foreign lease remains protected.
303
- - `status` without `runId` lists every top-level run in the session with a concise per-run summary: the full run id, workflow name, run status, started/ended timing with pause-adjusted elapsed time, currently active stages, awaiting-input details (count plus the stage, prompt id, kind, and message for each pending human prompt), and `waitingCount`, the number of stages waiting with their session released. In-flight runs are listed first. The summaries carry the exact identifiers that `answer`, `pause`, `resume`, and `quit` accept, so an orchestrating agent can list runs and act on them directly.
303
+ - `status` without `runId` lists every top-level run in the session with a concise per-run summary: the full run id, workflow name, run status, started/ended timing with pause-adjusted elapsed time, currently active stages, awaiting-input details (count plus the stage, prompt id, kind, and message for each pending human prompt), and `suspendedCount`, the number of stages suspended with their session released (`suspendedStages` names them). In-flight runs are listed first. The summaries carry the exact identifiers that `answer`, `pause`, `resume`, and `quit` accept, so an orchestrating agent can list runs and act on them directly.
304
304
  - `status` with a `runId` includes the run's final outputs as `detail.result`, also when another session started the run and Atomic reads it back from the journal. The detail lists every stage and can be large for a run with many stages. Add `summary: true` for a compact `summary` object instead of `detail`: `runId`, `name`, `status`, timing, `result`, `error`, `resumable`, `resumeGuidance`, and `blockers`. Each blocker names a failed or blocked stage or `ctx.tool` node, or a stage awaiting input (with its `promptId` and prompt text), and is empty for a run that completed, was cancelled, or was killed. The summary omits the stage and tool history; `summary` has no effect on the `status` listing without a `runId`.
305
- - `statusFilter` narrows the `status` run listing: run statuses (`pending`, `running`, `paused`, `blocked`, `completed`, `failed`, `skipped`, `cancelled`, `killed`) match runs directly, `awaiting_input` selects runs with at least one stage awaiting input or pending human prompt, `waiting` selects runs with at least one stage waiting with its session released, and `all` (the default) includes everything. On `stages`, `waiting` selects stages that wait with their session released (see [Waiting stages](#waiting-stages)).
305
+ - `statusFilter` narrows the `status` run listing: run statuses (`pending`, `running`, `paused`, `blocked`, `completed`, `failed`, `skipped`, `cancelled`, `killed`) match runs directly, `awaiting_input` selects runs with at least one stage awaiting input or pending human prompt, `suspended` selects runs with at least one stage suspended with its session released, and `all` (the default) includes everything. On `stages`, `suspended` selects stages that wait with their session released (see [Suspended stages](#suspended-stages)). `waiting`, the earlier name of `suspended`, is still accepted as a deprecated alias.
306
306
  - `format: "json"` on data-bearing inspection actions (`status`, `stages`, `stage`, `transcript`) returns the full structured result; the default text output for `status` is the concise per-run summary list.
307
307
  - `status` / `status <runId>` show terminal `ctx.exit(...)` statuses (`completed`, `skipped`, `cancelled`, or `blocked`) and the optional exit reason when one was supplied.
308
308
  - `stages` lists stage summaries, including flattened stages from nested `ctx.workflow(...)` imports and `sessionFile`/`transcriptPath` when a stage has a persisted session. A stage whose session has started [background compaction](/compaction#background-compaction) also carries `compaction`, the same `{ state, upToEntryId, startedAt, error }` state RPC `get_state` reports; `stage` returns it too. After the stage finishes it shows the state its session ended in, and a session that already holds a saved result shows `ready` as soon as the stage attaches it. Use `statusFilter: "all"` to include completed, failed, skipped, and pending stages.
@@ -330,13 +330,13 @@ Control behavior:
330
330
 
331
331
  Use slash commands for graph connect and stage attach because those are interactive TUI surfaces. When a run needs user input or attention, tell the user instead of polling silently.
332
332
 
333
- ### Waiting stages
333
+ ### Suspended stages
334
334
 
335
- A stage whose model called a long-running tool that supports it (a CI wait, a deployment, a `bash` or `powershell` `wait` on a background task without `budgetMs`, or `ask_user_question`) does not keep its session while it waits. Once the call has run longer than the stage's `releaseWhenWaiting` threshold (60 seconds by default), Atomic saves the stage's conversation and its pending call, closes the session, and frees the stage's slot for other stages. `status` and `stages` show the stage as `waiting` and say what it waits on (`waiting (tool: wait_ci)` for the tool calls, `waiting (released)` after `stage.release()`, `waiting (idle)` for a stage the workflow holds unused), and the JSON `stages` result carries its `wait`; a stage waiting for a human answer reads `awaiting_input (released)`. A stage still released when its run ends leaves `waiting`; `statusFilter: "waiting"` lists the runs that have such a stage. When the results arrive, Atomic reopens the same session from the session store and the stage continues the same turn. Short calls, and tools that do not support it, run inline as before.
335
+ A stage whose model called a long-running tool that supports it (a CI wait, a deployment, a `bash` or `powershell` `wait` on a background task without `budgetMs`, or `ask_user_question`) does not keep its session while it waits. Once the call has run longer than the stage's `releaseWhenWaiting` threshold (60 seconds by default), Atomic saves the stage's conversation and its pending call, closes the session, and frees the stage's slot for other stages. `status` and `stages` show the stage as `suspended` and say what it waits on (`suspended (tool: wait_ci)` for the tool calls, `suspended (between turns)` after `stage.release()` or for a stage the workflow holds unused), and the JSON `stages` result carries its `wait`; a stage waiting for a human answer reads `awaiting_input (released)`. In the stage's chat, the call it waits on shows as pending, not as interrupted, and shows its result once the stage reopens. A stage still released when its run ends leaves `suspended`; `statusFilter: "suspended"` lists the runs that have such a stage. When the results arrive, Atomic reopens the same session from the session store and the stage continues the same turn. Short calls, and tools that do not support it, run inline as before.
336
336
 
337
- A stage waiting on its model's `ask_user_question` also stays `awaiting_input`; answer it in the stage's chat as usual. The same threshold releases a stage whose readiness question waits on you (the stage stays `awaiting_input` and reopens with your answer), and a finished stage the workflow keeps without using it, for example while it waits for a child workflow (the stage is `waiting` until it is messaged or rehydrated). See [`releaseWhenWaiting`](/workflows/api-reference#releasewhenwaiting).
337
+ A stage waiting on its model's `ask_user_question` also stays `awaiting_input`; answer it in the stage's chat as usual. The same threshold releases a stage whose readiness question waits on you (the stage stays `awaiting_input` and reopens with your answer), and a finished stage the workflow keeps without using it, for example while it waits for a child workflow (the stage is `suspended` until it is messaged or rehydrated). See [`releaseWhenWaiting`](/workflows/api-reference#releasewhenwaiting).
338
338
 
339
- Controls work on a waiting stage:
339
+ Controls work on a suspended stage:
340
340
 
341
341
  - Messages and steering to a stage waiting on a tool call are held, and reach the stage in order when it reopens. They are held in memory, so they are lost if Atomic stops before the stage wakes; Intercom sends wait in the run's queue and survive a restart. A message to a stage waiting between turns reopens it.
342
342
  - `pause` holds the stage: results that arrive meanwhile wait until you resume it.
@@ -1034,7 +1034,7 @@ A worker host serves every running root on that journal that uses shared placeme
1034
1034
  To bind children to a repository state, pass `workers.workspace`: a binding with `remotes`, `head`, `tree` and `envHash`, a bound workspace, or a `workspace({ … })` value, which the root resolves when it starts. A child started with `ctx.workflow(child, { workspace })` is bound to its own workspace's state instead, and on the host that runs it, its workspace is that host's worktree. A bound child runs only on a host that can run it on that tree, never in another host's copy of the root's directory:
1035
1035
 
1036
1036
  - A host whose `placement.prefer(binding)` returns the path of a local worktree whose current tree is `binding.tree` takes that work first and runs it there.
1037
- - A host that restores takes bound work it does not have and runs it at the verified path its restore returns. By default a host with git restores the tree from the snapshot the work carries, or else from the binding's remotes and the worktree snapshots recorded in the shared journal, into a new worktree under its agent directory; pass `restore` to restore another way, or `restore: false` to turn restoring off. The default restore then runs the resume setup hook in the new worktree, from the host's own agent directory (its global `resume.setupCommand`, or a trusted repository's `.atomic/setup`), before the child starts; a host with neither refuses work whose snapshot has dependency inputs. A host given its own `restore` runs no hook. See [Resume on any machine](/guides/resume-on-any-machine). A failed restore puts the work back for another host, without counting as one of the child's attempts, and the host waits before it restores that binding again: one second after the first failure, twice as long after each further one, up to a minute.
1037
+ - A host that restores takes bound work it does not have and runs it at the verified path its restore returns. By default a host with git restores the tree from the snapshot the work carries, or else from the binding's remotes and the worktree snapshots recorded in the shared journal, into a new worktree under its agent directory; pass `restore` to restore another way, or `restore: false` to turn restoring off. The default restore then builds the new worktree's blueprints, from the host's own agent directory (its global blueprint and a trusted repository's `.atomic/blueprint.yaml`), before the child starts; a blueprint that fails is a warning the host prints and never stops the child. A host given its own `restore` builds none. See [Resume on any machine](/guides/resume-on-any-machine). A failed restore puts the work back for another host, without counting as one of the child's attempts, and the host waits before it restores that binding again: one second after the first failure, twice as long after each further one, up to a minute.
1038
1038
  - A host with neither never takes bound work, however long it waits. The root's own workers take only unbound work.
1039
1039
 
1040
1040
  A cold host can restore a bound tree, the root's or a child's, with its uncommitted, untracked and unpushed content. The root's machine snapshots the root's bound worktree when the root starts, and a child's bound worktree when it dispatches the child, and the work carries that snapshot. These snapshots follow the root's `snapshots` settings: Git ignores, `.atomic/snapshot-ignore`, the deny list and the size limits apply, and `snapshots.enabled: false` turns them off. Snapshot garbage collection keeps the root's own snapshot while the root's worker pool runs, and the snapshot a child carries for as long as the root run's queued work exists, which is until the root run is deleted from history. Both are kept at any `snapshots.graceSeconds`, `0` included. A root bound by a `WorkspaceBinding` alone, or resumed without its `workspace({ … })` value, has no worktree to snapshot. Its children's trees then restore only from the binding's remotes and from snapshots that checkpoints recorded of that exact tree, and children it queued earlier keep the snapshot they carried.