@bastani/atomic 0.9.20-alpha.8 → 0.9.20

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 (309) hide show
  1. package/CHANGELOG.md +288 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +25 -0
  3. package/dist/builtin/intercom/package.json +3 -5
  4. package/dist/builtin/mcp/CHANGELOG.md +13 -0
  5. package/dist/builtin/mcp/package.json +3 -3
  6. package/dist/builtin/subagents/CHANGELOG.md +56 -0
  7. package/dist/builtin/subagents/package.json +3 -3
  8. package/dist/builtin/subagents/skills/tdd/SKILL.md +10 -2
  9. package/dist/builtin/subagents/skills/tdd/mocking.md +4 -0
  10. package/dist/builtin/subagents/skills/tdd/test-audit.md +105 -0
  11. package/dist/builtin/subagents/skills/tdd/tests.md +3 -1
  12. package/dist/builtin/subagents/src/extension/index.bundle.mjs +13 -3
  13. package/dist/builtin/web-access/CHANGELOG.md +13 -0
  14. package/dist/builtin/web-access/package.json +1 -1
  15. package/dist/builtin/workflows/CHANGELOG.md +169 -0
  16. package/dist/builtin/workflows/README.md +1 -1
  17. package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
  18. package/dist/builtin/workflows/builtin/{chunk-njmf5ze7.js → chunk-0nrgfbag.js} +1 -1
  19. package/dist/builtin/workflows/builtin/{chunk-hmt5w62g.js → chunk-2hak3b7g.js} +1 -1
  20. package/dist/builtin/workflows/builtin/{chunk-2hzrv5y8.js → chunk-73c5tayt.js} +1020 -200
  21. package/dist/builtin/workflows/builtin/{chunk-ffdrv23t.js → chunk-bzdvx2xr.js} +1 -1
  22. package/dist/builtin/workflows/builtin/{chunk-5724b0cf.js → chunk-crw7q5g1.js} +1 -1
  23. package/dist/builtin/workflows/builtin/{chunk-7n51c5gh.js → chunk-cw86srkf.js} +1 -1
  24. package/dist/builtin/workflows/builtin/{chunk-dxjxtgmp.js → chunk-jaj27rqc.js} +1 -1
  25. package/dist/builtin/workflows/builtin/{chunk-3tx8ry44.js → chunk-kspvwc24.js} +3 -2
  26. package/dist/builtin/workflows/builtin/{chunk-7bzcersz.js → chunk-maqv731g.js} +3 -3
  27. package/dist/builtin/workflows/builtin/{chunk-9z3ztr2a.js → chunk-vkmpdat4.js} +1 -1
  28. package/dist/builtin/workflows/builtin/{chunk-vn0wb31x.js → chunk-w18kbz63.js} +1 -1
  29. package/dist/builtin/workflows/builtin/{chunk-jngsbbpm.js → chunk-wh19f5ee.js} +3 -3
  30. package/dist/builtin/workflows/builtin/classify-and-act.js +3 -3
  31. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -3
  32. package/dist/builtin/workflows/builtin/generate-and-filter.js +3 -3
  33. package/dist/builtin/workflows/builtin/goal.js +4 -4
  34. package/dist/builtin/workflows/builtin/index.js +12 -12
  35. package/dist/builtin/workflows/builtin/loop-until-done.js +3 -3
  36. package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
  37. package/dist/builtin/workflows/builtin/ralph.js +4 -4
  38. package/dist/builtin/workflows/builtin/steering-context.js +1 -1
  39. package/dist/builtin/workflows/builtin/tournament.js +3 -3
  40. package/dist/builtin/workflows/package.json +4 -4
  41. package/dist/builtin/workflows/src/authoring.d.ts +6 -3
  42. package/dist/builtin/workflows/src/extension/index.bundle.mjs +12164 -11365
  43. package/dist/builtin/workflows/src/index.js +41685 -12907
  44. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +13 -0
  45. package/dist/core/agent-session-boundaries.d.ts.map +1 -1
  46. package/dist/core/agent-session-boundaries.js +9 -4
  47. package/dist/core/agent-session-boundaries.js.map +1 -1
  48. package/dist/core/agent-session-events.d.ts.map +1 -1
  49. package/dist/core/agent-session-events.js +4 -0
  50. package/dist/core/agent-session-events.js.map +1 -1
  51. package/dist/core/agent-session-methods.d.ts +3 -0
  52. package/dist/core/agent-session-methods.d.ts.map +1 -1
  53. package/dist/core/agent-session-methods.js.map +1 -1
  54. package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
  55. package/dist/core/agent-session-queue-pause.js +2 -1
  56. package/dist/core/agent-session-queue-pause.js.map +1 -1
  57. package/dist/core/agent-session-tasks.js +4 -4
  58. package/dist/core/agent-session-tasks.js.map +1 -1
  59. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  60. package/dist/core/agent-session-tool-registry.js +4 -3
  61. package/dist/core/agent-session-tool-registry.js.map +1 -1
  62. package/dist/core/agent-session.d.ts +3 -0
  63. package/dist/core/agent-session.d.ts.map +1 -1
  64. package/dist/core/agent-session.js +3 -0
  65. package/dist/core/agent-session.js.map +1 -1
  66. package/dist/core/cache-stats.d.ts +7 -1
  67. package/dist/core/cache-stats.d.ts.map +1 -1
  68. package/dist/core/cache-stats.js +24 -5
  69. package/dist/core/cache-stats.js.map +1 -1
  70. package/dist/core/context-tool-pairing.d.ts +10 -14
  71. package/dist/core/context-tool-pairing.d.ts.map +1 -1
  72. package/dist/core/context-tool-pairing.js +99 -28
  73. package/dist/core/context-tool-pairing.js.map +1 -1
  74. package/dist/core/execution-model-router.d.ts +1 -1
  75. package/dist/core/execution-model-router.d.ts.map +1 -1
  76. package/dist/core/execution-model-router.js +23 -14
  77. package/dist/core/execution-model-router.js.map +1 -1
  78. package/dist/core/extensions/agent-events.d.ts +9 -1
  79. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  80. package/dist/core/extensions/agent-events.js.map +1 -1
  81. package/dist/core/extensions/api-types.d.ts +2 -1
  82. package/dist/core/extensions/api-types.d.ts.map +1 -1
  83. package/dist/core/extensions/api-types.js.map +1 -1
  84. package/dist/core/extensions/event-types.d.ts +2 -2
  85. package/dist/core/extensions/event-types.d.ts.map +1 -1
  86. package/dist/core/extensions/event-types.js.map +1 -1
  87. package/dist/core/extensions/index.d.ts +1 -1
  88. package/dist/core/extensions/index.d.ts.map +1 -1
  89. package/dist/core/extensions/index.js.map +1 -1
  90. package/dist/core/extensions/loader-core.d.ts.map +1 -1
  91. package/dist/core/extensions/loader-core.js +1 -0
  92. package/dist/core/extensions/loader-core.js.map +1 -1
  93. package/dist/core/extensions/provider-types.d.ts +34 -16
  94. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  95. package/dist/core/extensions/provider-types.js.map +1 -1
  96. package/dist/core/extensions/runtime-types.d.ts +4 -0
  97. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  98. package/dist/core/extensions/runtime-types.js.map +1 -1
  99. package/dist/core/extensions/tool-types.d.ts +9 -0
  100. package/dist/core/extensions/tool-types.d.ts.map +1 -1
  101. package/dist/core/extensions/tool-types.js.map +1 -1
  102. package/dist/core/fast-model-routing.d.ts.map +1 -1
  103. package/dist/core/fast-model-routing.js +1 -0
  104. package/dist/core/fast-model-routing.js.map +1 -1
  105. package/dist/core/messages.d.ts.map +1 -1
  106. package/dist/core/messages.js +2 -1
  107. package/dist/core/messages.js.map +1 -1
  108. package/dist/core/model-registry.d.ts +3 -1
  109. package/dist/core/model-registry.d.ts.map +1 -1
  110. package/dist/core/model-registry.js +6 -0
  111. package/dist/core/model-registry.js.map +1 -1
  112. package/dist/core/model-runtime-auth.d.ts +2 -2
  113. package/dist/core/model-runtime-auth.d.ts.map +1 -1
  114. package/dist/core/model-runtime-auth.js.map +1 -1
  115. package/dist/core/model-runtime-streaming.d.ts.map +1 -1
  116. package/dist/core/model-runtime-streaming.js +2 -1
  117. package/dist/core/model-runtime-streaming.js.map +1 -1
  118. package/dist/core/model-runtime.d.ts +11 -3
  119. package/dist/core/model-runtime.d.ts.map +1 -1
  120. package/dist/core/model-runtime.js +41 -6
  121. package/dist/core/model-runtime.js.map +1 -1
  122. package/dist/core/package-manager-npm.d.ts.map +1 -1
  123. package/dist/core/package-manager-npm.js +32 -8
  124. package/dist/core/package-manager-npm.js.map +1 -1
  125. package/dist/core/package-manager-resolver.js +3 -1
  126. package/dist/core/package-manager-resolver.js.map +1 -1
  127. package/dist/core/package-manager-types.d.ts +1 -0
  128. package/dist/core/package-manager-types.d.ts.map +1 -1
  129. package/dist/core/package-manager-types.js.map +1 -1
  130. package/dist/core/provider-composer-internal.d.ts +40 -21
  131. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  132. package/dist/core/provider-composer-internal.js +22 -20
  133. package/dist/core/provider-composer-internal.js.map +1 -1
  134. package/dist/core/provider-composer.d.ts +3 -3
  135. package/dist/core/provider-composer.d.ts.map +1 -1
  136. package/dist/core/provider-composer.js +54 -10
  137. package/dist/core/provider-composer.js.map +1 -1
  138. package/dist/core/remote-catalog-provider.d.ts +8 -1
  139. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  140. package/dist/core/remote-catalog-provider.js +46 -4
  141. package/dist/core/remote-catalog-provider.js.map +1 -1
  142. package/dist/core/resource-loader-core.d.ts.map +1 -1
  143. package/dist/core/resource-loader-core.js +7 -3
  144. package/dist/core/resource-loader-core.js.map +1 -1
  145. package/dist/core/resource-loader-extension-warnings.d.ts +9 -0
  146. package/dist/core/resource-loader-extension-warnings.d.ts.map +1 -0
  147. package/dist/core/resource-loader-extension-warnings.js +54 -0
  148. package/dist/core/resource-loader-extension-warnings.js.map +1 -0
  149. package/dist/core/resource-loader-extensions.d.ts.map +1 -1
  150. package/dist/core/resource-loader-extensions.js +1 -0
  151. package/dist/core/resource-loader-extensions.js.map +1 -1
  152. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  153. package/dist/core/resource-loader-reload.js +6 -0
  154. package/dist/core/resource-loader-reload.js.map +1 -1
  155. package/dist/core/runtime-credentials.d.ts.map +1 -1
  156. package/dist/core/runtime-credentials.js +3 -1
  157. package/dist/core/runtime-credentials.js.map +1 -1
  158. package/dist/core/sdk.js +16 -6
  159. package/dist/core/sdk.js.map +1 -1
  160. package/dist/core/settings-manager-basic-accessors.js +4 -4
  161. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  162. package/dist/core/structured-output/choice-schema.d.ts +8 -0
  163. package/dist/core/structured-output/choice-schema.d.ts.map +1 -0
  164. package/dist/core/structured-output/choice-schema.js +79 -0
  165. package/dist/core/structured-output/choice-schema.js.map +1 -0
  166. package/dist/core/structured-output/index.d.ts +3 -5
  167. package/dist/core/structured-output/index.d.ts.map +1 -1
  168. package/dist/core/structured-output/index.js +218 -41
  169. package/dist/core/structured-output/index.js.map +1 -1
  170. package/dist/core/structured-output/resolver.d.ts +0 -46
  171. package/dist/core/structured-output/resolver.d.ts.map +1 -1
  172. package/dist/core/structured-output/resolver.js +15 -93
  173. package/dist/core/structured-output/resolver.js.map +1 -1
  174. package/dist/core/structured-output/types.d.ts +27 -21
  175. package/dist/core/structured-output/types.d.ts.map +1 -1
  176. package/dist/core/structured-output/types.js.map +1 -1
  177. package/dist/core/system-prompt.d.ts.map +1 -1
  178. package/dist/core/system-prompt.js +9 -1
  179. package/dist/core/system-prompt.js.map +1 -1
  180. package/dist/core/tasks/owner-store.d.ts +6 -0
  181. package/dist/core/tasks/owner-store.d.ts.map +1 -1
  182. package/dist/core/tasks/owner-store.js +16 -3
  183. package/dist/core/tasks/owner-store.js.map +1 -1
  184. package/dist/core/tasks/pause.js +1 -1
  185. package/dist/core/tasks/pause.js.map +1 -1
  186. package/dist/core/tasks/supervisor.d.ts +4 -2
  187. package/dist/core/tasks/supervisor.d.ts.map +1 -1
  188. package/dist/core/tasks/supervisor.js +9 -3
  189. package/dist/core/tasks/supervisor.js.map +1 -1
  190. package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
  191. package/dist/core/tools/ask-user-question/ask-user-question.js +1 -0
  192. package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
  193. package/dist/core/tools/bash.d.ts.map +1 -1
  194. package/dist/core/tools/bash.js +1 -0
  195. package/dist/core/tools/bash.js.map +1 -1
  196. package/dist/core/tools/edit.d.ts.map +1 -1
  197. package/dist/core/tools/edit.js +1 -0
  198. package/dist/core/tools/edit.js.map +1 -1
  199. package/dist/core/tools/file-mutation-coordinator.d.ts +4 -3
  200. package/dist/core/tools/file-mutation-coordinator.d.ts.map +1 -1
  201. package/dist/core/tools/file-mutation-coordinator.js +45 -38
  202. package/dist/core/tools/file-mutation-coordinator.js.map +1 -1
  203. package/dist/core/tools/powershell.d.ts +16 -0
  204. package/dist/core/tools/powershell.d.ts.map +1 -1
  205. package/dist/core/tools/structured-output.d.ts +9 -6
  206. package/dist/core/tools/structured-output.d.ts.map +1 -1
  207. package/dist/core/tools/structured-output.js +36 -8
  208. package/dist/core/tools/structured-output.js.map +1 -1
  209. package/dist/core/tools/todos.d.ts.map +1 -1
  210. package/dist/core/tools/todos.js +1 -0
  211. package/dist/core/tools/todos.js.map +1 -1
  212. package/dist/core/tools/tool-concurrency.d.ts +23 -0
  213. package/dist/core/tools/tool-concurrency.d.ts.map +1 -0
  214. package/dist/core/tools/tool-concurrency.js +58 -0
  215. package/dist/core/tools/tool-concurrency.js.map +1 -0
  216. package/dist/core/tools/tool-definition-wrapper.d.ts +4 -1
  217. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  218. package/dist/core/tools/tool-definition-wrapper.js +2 -0
  219. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  220. package/dist/core/tools/write.d.ts.map +1 -1
  221. package/dist/core/tools/write.js +1 -0
  222. package/dist/core/tools/write.js.map +1 -1
  223. package/dist/index-extensions.d.ts +1 -1
  224. package/dist/index-extensions.d.ts.map +1 -1
  225. package/dist/index-extensions.js.map +1 -1
  226. package/dist/index.d.ts +1 -1
  227. package/dist/index.d.ts.map +1 -1
  228. package/dist/index.js +1 -1
  229. package/dist/index.js.map +1 -1
  230. package/dist/main.d.ts.map +1 -1
  231. package/dist/main.js +4 -0
  232. package/dist/main.js.map +1 -1
  233. package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
  234. package/dist/modes/interactive/components/settings-selector-items.js +11 -9
  235. package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
  236. package/dist/modes/interactive/components/settings-selector-types.d.ts +2 -1
  237. package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
  238. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  239. package/dist/modes/interactive/components/task-inspector.d.ts +1 -0
  240. package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -1
  241. package/dist/modes/interactive/components/task-inspector.js +11 -11
  242. package/dist/modes/interactive/components/task-inspector.js.map +1 -1
  243. package/dist/modes/interactive/components/task-list.d.ts +9 -3
  244. package/dist/modes/interactive/components/task-list.d.ts.map +1 -1
  245. package/dist/modes/interactive/components/task-list.js +26 -2
  246. package/dist/modes/interactive/components/task-list.js.map +1 -1
  247. package/dist/modes/interactive/interactive-agent-events.js +3 -9
  248. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  249. package/dist/modes/interactive/interactive-auth-login.js +1 -1
  250. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  251. package/dist/modes/interactive/interactive-render-chat.js +3 -9
  252. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  253. package/dist/modes/interactive/interactive-resource-rendering.js +6 -9
  254. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  255. package/dist/modes/interactive/interactive-selectors.js +1 -0
  256. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  257. package/dist/modes/interactive/interactive-slash-commands.js +2 -4
  258. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  259. package/dist/modes/interactive-engine/isolated-runtime.d.ts +1 -0
  260. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  261. package/dist/modes/interactive-engine/isolated-runtime.js +5 -0
  262. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  263. package/dist/utils/clipboard-image.d.ts.map +1 -1
  264. package/dist/utils/clipboard-image.js +14 -17
  265. package/dist/utils/clipboard-image.js.map +1 -1
  266. package/docs/background-tasks.md +1 -0
  267. package/docs/computer-use.md +33 -9
  268. package/docs/custom-provider/registration.md +1 -1
  269. package/docs/custom-provider.md +43 -1
  270. package/docs/extensions/authoring.md +22 -3
  271. package/docs/extensions/events.md +18 -0
  272. package/docs/extensions/examples.md +1 -0
  273. package/docs/getting-started/first-session.md +1 -1
  274. package/docs/models/evals.md +31 -79
  275. package/docs/models/model-selection.md +5 -1
  276. package/docs/packages/authoring.md +3 -1
  277. package/docs/providers.md +7 -11
  278. package/docs/sdk/reference.md +18 -42
  279. package/docs/sdk/structured-decisions.md +44 -89
  280. package/docs/sdk.md +1 -1
  281. package/docs/settings.md +6 -6
  282. package/docs/skills.md +2 -2
  283. package/docs/subagents/reference.md +7 -8
  284. package/docs/usage.md +13 -0
  285. package/docs/workflows/api-reference.md +38 -35
  286. package/docs/workflows/authoring.md +113 -1
  287. package/docs/workflows/builtins.md +1 -1
  288. package/docs/workflows/operations.md +53 -29
  289. package/docs/workflows/reliable-design.md +1 -1
  290. package/docs/workflows/verification.md +38 -7
  291. package/docs/workflows.md +1 -1
  292. package/examples/extensions/README.md +1 -0
  293. package/examples/extensions/debug-provider.ts +90 -0
  294. package/examples/extensions/structured-output.ts +6 -0
  295. package/npm-shrinkwrap.json +32 -32
  296. package/package.json +3 -3
  297. package/dist/builtin/workflows/src/durable/dependency-doctor-types.d.ts +0 -42
  298. package/dist/core/decision-provider.d.ts +0 -4
  299. package/dist/core/decision-provider.d.ts.map +0 -1
  300. package/dist/core/decision-provider.js +0 -12
  301. package/dist/core/decision-provider.js.map +0 -1
  302. package/dist/core/structured-output/jev-client.d.ts +0 -25
  303. package/dist/core/structured-output/jev-client.d.ts.map +0 -1
  304. package/dist/core/structured-output/jev-client.js +0 -174
  305. package/dist/core/structured-output/jev-client.js.map +0 -1
  306. package/dist/core/structured-output/jev.d.ts +0 -5
  307. package/dist/core/structured-output/jev.d.ts.map +0 -1
  308. package/dist/core/structured-output/jev.js +0 -249
  309. package/dist/core/structured-output/jev.js.map +0 -1
@@ -647,11 +647,11 @@ Scopes MCP servers for one stage. The runtime applies the scope before execution
647
647
  readonly schema?: TSchema;
648
648
  ```
649
649
 
650
- Enables a schema-specific, single-use final-answer tool for that item. `ctx.stage`, `ctx.task`, `ctx.chain`, and `ctx.parallel` items accept a TypeBox schema or a plain JSON Schema descriptor object. The schema may describe an object, array, or primitive, and the captured JSON value becomes the schema-backed `stage.prompt(...)` result or `WorkflowTaskResult.structured`; task text remains formatted JSON for handoffs.
650
+ Enables one schema-backed `structured_output` call for that item. `ctx.stage`, `ctx.task`, `ctx.chain`, and `ctx.parallel` items accept a TypeBox schema or a plain JSON Schema descriptor object. The calling model supplies `instructions` and a nonempty named `state`, plus optional exact `model` and `fallbackModels` IDs. The tool infers a value matching the schema; that inferred value becomes the schema-backed `stage.prompt(...)` result or `WorkflowTaskResult.structured`. The calling model's arguments are not the result. Omit `model` to use the current stage chat model. After the primary and explicit fallbacks, the current chat model is tried if it was not already used. Atomic resolves each ID through the stage model registry. A registered classifier is used only when the schema is a finite Choice; otherwise that candidate is skipped and the skip is recorded. A classifier runtime failure advances to the next model unless the request was cancelled or refused for safety.
651
651
 
652
- A schema-backed `StageContext` supports one `prompt()` call, so create another stage for another structured prompt. Missing or invalid `structured_output` calls receive up to three corrective follow-ups quoting the contract error and reminding the model to call `structured_output` instead of replying with plain JSON. That budget is per model candidate: a candidate that spends the initial prompt and all three follow-ups without a valid call is treated as a failed candidate and the stage advances to the next entry in [`fallbackModels`](#fallbackmodels-/-fallbackthinkinglevels), which receives the original stage prompt and its own fresh budget. The recorded attempt error names what the turn actually looked like — no assistant message after the prompt, an assistant message with empty text, or the `structured_output` validation error — so a repeated external cause is attributable. With no fallback candidate left, the stage fails with the contract error rather than completing. An explicit tool allowlist automatically receives the final-answer tool, while items without `schema` do not.
652
+ A schema-backed `StageContext` supports one `prompt()` call, so create another stage for another structured prompt. A missing call, or an inference failure that exhausts the tool's own model chain, receives up to three corrective follow-ups quoting the contract error. That budget is per stage model candidate. A candidate that spends the initial prompt and all three follow-ups without a valid inferred result fails, and the stage advances to the next entry in [`fallbackModels`](#fallbackmodels-/-fallbackthinkinglevels), which receives the original stage prompt and its own fresh budget. With no stage fallback left, the stage fails with the contract error rather than completing. An explicit tool allowlist automatically receives `structured_output`, while items without `schema` do not.
653
653
 
654
- With both `schema` and `output`, ordinary text from the successful `structured_output` message goes to the artifact; tool arguments become the typed result. Corrective attempts and later turns cannot replace that pair. If the successful message has no ordinary text, the artifact uses the most recent earlier assistant text without a `structured_output` call, or stays empty with a warning. The pattern builtins save their inter-stage decisions as JSON separately.
654
+ With both `schema` and `output`, ordinary text from the successful `structured_output` message goes to the artifact. The inferred tool result is the typed value. Corrective attempts and later turns cannot replace that pair. If the successful message has no ordinary text, the artifact uses the most recent earlier assistant text without a `structured_output` call, or stays empty with a warning. The pattern builtins save their inter-stage decisions as JSON separately.
655
655
 
656
656
  ### `output` / `outputMode`
657
657
 
@@ -662,7 +662,7 @@ readonly outputMode?: "inline" | "file-only";
662
662
 
663
663
  Writes stage/task output to a path or disables output persistence with `false`. `outputMode` defaults to `inline`; `file-only` keeps the parent result compact by returning an artifact reference instead of full text and requires an output path.
664
664
 
665
- The runner owns `output`. For an ordinary stage, it saves the completed assistant answers from the current prompt generation in order. The first answer is unchanged; later answers are appended after `## Supplement 1`, `## Supplement 2`, and so on. Text blocks retain their original text, including whitespace and repeated answers. Tool-call progress, reasoning, user input, tool results and earlier session history remain transcript-only. A single answer therefore keeps its existing artifact format. A schema-backed stage retains its separate contract: the ordinary text paired with the successful `structured_output` call owns the artifact, not the tool arguments.
665
+ The runner owns `output`. For an ordinary stage, it saves the completed assistant answers from the current prompt generation in order. The first answer is unchanged; later answers are appended after `## Supplement 1`, `## Supplement 2`, and so on. Text blocks retain their original text, including whitespace and repeated answers. Tool-call progress, reasoning, user input, tool results and earlier session history remain transcript-only. A single answer therefore keeps its existing artifact format. A schema-backed stage retains its separate contract: the ordinary text paired with the successful `structured_output` call owns the artifact, and the tool's inferred value is the structured result.
666
666
 
667
667
  Follow-ups accepted before the stage closes append numbered supplements. Corrections must say what they correct; Atomic does not infer replacement intent. Later retained-session chat cannot overwrite a completed artifact. Use a new tracked stage and output path for replacement. Compaction, branch navigation, and model fallback do not discard already accepted answers; historical branch text is not appended as new output. Stages without `output` retain their last-response behavior.
668
668
 
@@ -1250,37 +1250,6 @@ registry.names();
1250
1250
  registry.get("alpha");
1251
1251
  ```
1252
1252
 
1253
- ### `workflowDependency(operation?)`
1254
-
1255
- ```typescript
1256
- import {
1257
- workflowDependency,
1258
- type WorkflowDependencyOperation,
1259
- type WorkflowDependencyReport,
1260
- } from "@bastani/atomic/workflows";
1261
-
1262
- const report: WorkflowDependencyReport = await workflowDependency("doctor");
1263
- ```
1264
-
1265
- Accepts `"status" | "doctor" | "recover"`, defaulting to `"status"`. Returns `Promise<WorkflowDependencyReport>` without launching workflow execution. `status` and `doctor` inspect read-only; `recover` may restart only the registered managed cluster while preserving its data. For an external database URL, all three operations only query the configured endpoint. Docker fallback receives guidance rather than lifecycle actions.
1266
-
1267
- Managed `doctor` also checks the installed `postgres`, `pg_ctl` and `initdb` binaries with bounded `--version` commands, without repairing links or permissions. `recover` requires this runtime check before attempting repair of a registered cluster. `status` skips installed-binary checks so an existing server can still be inspected when the local installation is broken.
1268
-
1269
- | Report field | Meaning |
1270
- | --- | --- |
1271
- | `provider` | `managed`, `external`, or `docker` |
1272
- | `state` | `ready`, `unavailable`, `uninitialized`, `checking`, or `recovering` |
1273
- | `checkedAt` | Optional ISO timestamp of the reported check |
1274
- | `runtime` | Current JavaScript `executable` and `version`, plus SQL `postgresVersion` when available. Managed `doctor` and `recover` also report `installation.executable` and `installation.version` after version-only runtime checks. |
1275
- | `endpoint` | Optional actual `host` and `port`, without URL credentials |
1276
- | `cluster` | Optional trusted managed cluster metadata, including cluster ID, data directory, directory identity, major version and published server identity |
1277
- | `identityVerified` | Whether managed SQL/data/process identity agreed during this check; external reachability does not grant managed ownership |
1278
- | `consumers` | Conservative live managed-consumer leases with process and runtime identity, not workflow counts |
1279
- | `lastFailure` | Optional most recently observed failure, retained after successful checks until a newer failure replaces it. Process-local, not a persisted incident history; use `state` for current availability. |
1280
- | `guidance` | Safe next steps for the reported condition |
1281
-
1282
- The response budget is five seconds. A `checking` or `recovering` report leaves the existing operation running; concurrent calls join it instead of starting another operation. These states do not confirm availability or recovery success. Inspect again before resuming the original run ID. The workflow tool returns `{ action: "dependency", operation, report }`; `/workflow dependency [status|doctor|recover]` exposes the same capability. See [database inspection and recovery](/workflows/operations#inspecting-and-recovering-the-workflow-database) for troubleshooting and safety limits.
1283
-
1284
1253
  ### `run(definition, inputs, opts?)`
1285
1254
 
1286
1255
  ```typescript
@@ -1323,6 +1292,7 @@ interface RunOpts {
1323
1292
  readonly signal?: AbortSignal;
1324
1293
  readonly deferWorkflowStart?: boolean;
1325
1294
  readonly config?: WorkflowRuntimeConfig;
1295
+ readonly durability?: WorkflowDurability;
1326
1296
  readonly models?: WorkflowModelCatalogPort;
1327
1297
  readonly registry?: WorkflowRegistry;
1328
1298
  readonly depth?: number;
@@ -1347,6 +1317,39 @@ Supplies runtime adapters, execution policy, persistence, MCP, cancellation, gra
1347
1317
 
1348
1318
  The public authoring declaration intentionally excludes runtime-only executor fields such as `defaultSessionDir`, `gitWorktreeSetupCache`, `durableBackend`, `durableScope`, and `onStageSession`.
1349
1319
 
1320
+ #### Choosing the durable backend
1321
+
1322
+ ```typescript
1323
+ type WorkflowDurability =
1324
+ | { readonly mode: "memory" }
1325
+ | { readonly mode: "durable"; readonly systemDatabaseUrl?: string };
1326
+ ```
1327
+
1328
+ `run()` sets up workflow durability itself and shuts it down when the run ends, unless another Atomic session in the same process is still using it. `durability` chooses the backend for one call:
1329
+
1330
+ - **Omitted:** durable, with Atomic's default database selection (`DBOS_SYSTEM_DATABASE_URL`, then its managed Postgres). If Postgres can't start, the run uses memory and prints a warning.
1331
+ - **`{ mode: "memory" }`:** runs with an in-memory backend that lasts only for this call. Postgres is never started, and nothing can be resumed after the process exits.
1332
+ - **`{ mode: "durable" }`:** requires durable state and fails fast. If the backend can't start, or only an in-memory fallback is available, `run()` rejects with `WorkflowDurabilityRequiredError` before the workflow runs.
1333
+ - **`{ mode: "durable", systemDatabaseUrl }`:** also chooses the Postgres database, for example a hosted one, and Atomic doesn't start or manage a local Postgres. `DBOS_SYSTEM_DATABASE_URL` overrides this value when set, so an operator can point a deployment at another database without changing code.
1334
+
1335
+ One process uses one workflow database: DBOS runs a single executor per process, so a later run in the same process that asks for a different URL rejects. Separate processes are independent. The Atomic CLI and any number of SDK applications can each use their own database, or share one, including Atomic's managed Postgres. Each process only recovers its own interrupted runs, and an SDK process that exits doesn't stop the managed Postgres other processes are using.
1336
+
1337
+ ```ts
1338
+ import { run, WorkflowDurabilityRequiredError } from "@bastani/atomic/workflows";
1339
+
1340
+ await run(helloWorld, { name: "Atomic" }, { adapters, durability: { mode: "memory" } });
1341
+
1342
+ try {
1343
+ await run(helloWorld, { name: "Atomic" }, {
1344
+ adapters,
1345
+ durability: { mode: "durable", systemDatabaseUrl: process.env.WORKFLOW_DATABASE_URL },
1346
+ });
1347
+ } catch (error) {
1348
+ if (error instanceof WorkflowDurabilityRequiredError) console.error(error.message);
1349
+ throw error;
1350
+ }
1351
+ ```
1352
+
1350
1353
  ### `resolveInputs(schema, provided)`
1351
1354
 
1352
1355
  ```typescript
@@ -62,7 +62,7 @@ const result = await ctx.task("analyze", {
62
62
 
63
63
  Long prompts are excerpted for model selection only; the stage still receives the full execution prompt. The excerpt preserves the beginning, end, and `<keepContext>...</keepContext>` spans. Protect essential selection requirements with those tags, since unprotected middle text may be omitted. If protected text cannot fit, the normal router context-limit and fallback behavior applies. Hard `modelConstraints` remain enforced independently.
64
64
 
65
- The shared `routerModel` setting chooses the decision provider. It does not choose which workflow to launch. Jev can make the decision but never executes the stage. See [automatic stage operation](/workflows/operations#automatic-stage-models) for failures and resume behavior.
65
+ An explicit `routerModel` chooses the routing decision provider. An unset or `auto` value uses the current chat model; saved classifier credentials do not change that choice. The setting does not choose which workflow to launch. A classifier can make the routing decision but never executes the stage. See [automatic stage operation](/workflows/operations#automatic-stage-models) for failures and resume behavior.
66
66
 
67
67
  **Write workflow code for both Atomic hosts.** Standalone binaries run under Bun; npm installs run under Node. A `Bun.*` global is available only when Atomic itself runs under Bun. Otherwise it fails with `Bun is not defined`, even if Bun is installed separately.
68
68
 
@@ -523,6 +523,8 @@ Prerequisites and setup, each as one bounded attempt:
523
523
  - The `cua-driver` executable (`cua-driver --version`), installed with upstream's one-line installer if missing, followed by `cua-driver telemetry disable` once.
524
524
  - The SDK installed at the exact driver version into a scratch directory outside the user's repository, for example `npm install @trycua/cua-driver@0.28.2 --prefix ~/.cache/atomic-cua`. The package ships per-platform native optional dependencies. Daemon-backed clients verify contract, tool-schema, capability, and protocol versions before each action and refuse on mismatch, so the pin must match `cua-driver --version`.
525
525
 
526
+ The executable installer does not install an agent skill. Atomic bundles the skill, so skip upstream's optional `cua-driver skills install`, `cua-driver skills update`, and `clawhub install @cua/driver` steps; leave existing user-level skills alone.
527
+
526
528
  The scenario itself is a small script in that scratch directory. It acquires the driver with `CuaDriver.connect()` when a daemon is running, so it reuses the daemon's permission identity (on macOS, `CuaDriver.app`'s Accessibility and Screen Recording grants) and the persisted telemetry-off preference; upstream describes `connect()` as a compatibility and app-hosting path, which is exactly the role it plays here. Only when no daemon is reachable does it fall back to `CuaDriver.create()`, which loads the runtime into the node process. On macOS that in-process fallback attributes permissions to the node host, normally the terminal app, as a **separate grant** from the app's; `checkPermissions` is then read-only, and the host must fully quit and relaunch after granting. Save it as `~/.cache/atomic-cua/verify-counter.mjs`:
527
529
 
528
530
  ```js
@@ -702,6 +704,116 @@ export default workflow({
702
704
 
703
705
  A `verified` result is cached durably, so a resumed run does not click again. A thrown `refuted`, `blocked`, or `unknown` result fails the node and is not replayed from cache; a new run executes the preflight and the scenario again from a fresh snapshot, and a durable retry of a resumable failure replays the completed preflight checkpoint and re-runs only the scenario. Keep the artifacts directory outside the repository unless the evidence belongs in the deliverable, and never post the installation UUID from `cua-driver telemetry status` in a result or reason. Safety is the same on both faces: one controller per desktop, a dedicated session or account where practical, and an explicit stopping point before destructive or publishing actions.
704
706
 
707
+ ### Classifier and image models in `ctx.tool`
708
+
709
+ Workflow stages run chat language models. For a schema-backed decision, use the stage's `schema` and `structured_output` tool. It resolves an exact chat or registered classifier ID through the stage model registry and falls back on a classifier runtime failure. The direct `@bastani/pi-ai` examples below are for cases that need the classifier's probabilities or image generation from workflow TypeScript inside `ctx.tool(name, args, fn, { timeoutMs })`. Those calls are durable, replayable nodes. `model: "auto"` selects only chat language models for stage execution; `routerModel` may select a classifier for routing, but a classifier never executes a chat stage.
710
+
711
+ Discovery loads a workflow file with the project that owns it as the module root. The host provides `@bastani/atomic/workflows` and `typebox`; other imports, including `@bastani/atomic` for `AuthStorage`, resolve from that project's `node_modules` in npm and standalone-binary installs alike. Install both libraries next to the workflow at the version `atomic --version` prints, because older releases have no `classify()` or `generateImages()`:
712
+
713
+ ```sh
714
+ npm install --save-dev @bastani/atomic@"$(atomic --version)" @bastani/pi-ai@"$(atomic --version)"
715
+ ```
716
+
717
+ Pass `AuthStorage.create()` to `builtinModels()` so classifier and image requests use credentials saved by Atomic's `/login` flows in `auth.json`; this is the recommended default for workflows running inside Atomic. Ambient provider environment variables such as `TYPESAFE_API_KEY` and `OPENROUTER_API_KEY` continue to work. Never read, print, or pass credential values in workflow state, prompts, or artifacts. Both operations resolve instead of throwing: check `stopReason === "stop"` before using a result, and forward the tool's `signal` so a quit or targeted abort cancels the request.
718
+
719
+ #### Classify a request before choosing a stage
720
+
721
+ Use a classifier for a narrow, structured decision such as routing an incoming request. This follows TypeSafe's [intent routing](https://docs.typesafe.ai/patterns/intent-routing.md) and [confidence-gated routing](https://docs.typesafe.ai/patterns/confidence-routing.md) patterns (index: [docs.typesafe.ai/llms.txt](https://docs.typesafe.ai/llms.txt)): one Choice question returns the selected option with a probability per option and a confidence value, and your code decides what to do with that answer. The classifier does **not** execute a stage; workflow code reads its answer and starts a chat stage or asks for human review. Pick thresholds for your own stakes, as TypeSafe's pattern pages do; a threshold is not a guarantee of correctness. In `.atomic/workflows/triage.ts`:
722
+
723
+ ```ts
724
+ import { AuthStorage } from "@bastani/atomic";
725
+ import { workflow } from "@bastani/atomic/workflows";
726
+ import { builtinModels } from "@bastani/pi-ai/providers/all";
727
+ import { Type } from "typebox";
728
+
729
+ export default workflow({
730
+ name: "triage",
731
+ description: "Route a support request to a suitable handler.",
732
+ inputs: { request: Type.String() },
733
+ outputs: { handler: Type.String() },
734
+ run: async (ctx) => {
735
+ const request = ctx.inputs.request;
736
+ const decision = await ctx.tool("classify-intent", { request }, async ({ signal }) => {
737
+ const models = builtinModels({ credentials: AuthStorage.create() });
738
+ const model = models.getModelOfType("classifier", "typesafe", "jev-latest");
739
+ if (!model) throw new Error("TypeSafe classifier is unavailable");
740
+ const result = await models.classify(model, {
741
+ state: { request },
742
+ questions: {
743
+ intent: {
744
+ type: "choice",
745
+ instructions: "Which support handler should review this request?",
746
+ criteria: {
747
+ account: "Questions about an existing account",
748
+ product: "Questions about product behavior",
749
+ other: "Neither account nor product",
750
+ },
751
+ },
752
+ },
753
+ }, { signal });
754
+ if (result.stopReason !== "stop") throw new Error(result.errorMessage ?? "Classification failed");
755
+ const intent = result.answers.intent;
756
+ if (intent?.type !== "choice") throw new Error("Missing intent answer");
757
+ return { choice: intent.choice, confidence: intent.confidence };
758
+ }, { timeoutMs: 60_000 });
759
+
760
+ // Only workflow code chooses the next action; uncertain requests go to a person.
761
+ if (decision.confidence < 0.7 || decision.choice === "other") {
762
+ return { handler: "human review required" };
763
+ }
764
+ await ctx.task(`${decision.choice}-review`, {
765
+ prompt: `Review this ${decision.choice} request and propose a response: ${request}`,
766
+ });
767
+ return { handler: decision.choice };
768
+ },
769
+ });
770
+ ```
771
+
772
+ The cached `{ choice, confidence }` is what a resumed run replays; the classifier is not asked again. For a consequential action, add policy checks or `ctx.ui.confirm(...)` before the side effect. Without the extra install, a schema-backed stage or task (`ctx.task(name, { schema, prompt })`, as the `classify-and-act` builtin does) can also make a validated decision. Its `structured_output` call can name a registered classifier or omit `model` and use the current chat model. A classifier probability is available only from a direct `classify()` call like the example above; a chat result does not supply one.
773
+
774
+ #### Generate an image artifact in a durable tool step
775
+
776
+ For an illustrative asset or a design mock, call an image model inside `ctx.tool()` and write the returned base64 image to a file; the cached node returns only the path. Image generation uses `generateImages()`, never a stage prompt or `structured_output`. In `.atomic/workflows/preview-asset.ts`:
777
+
778
+ ```ts
779
+ import { mkdir, writeFile } from "node:fs/promises";
780
+ import { dirname, join } from "node:path";
781
+ import { AuthStorage } from "@bastani/atomic";
782
+ import { workflow } from "@bastani/atomic/workflows";
783
+ import { builtinModels } from "@bastani/pi-ai/providers/all";
784
+ import { Type } from "typebox";
785
+
786
+ export default workflow({
787
+ name: "preview-asset",
788
+ description: "Generate a draft visual asset for review.",
789
+ inputs: { brief: Type.String() },
790
+ outputs: { imagePath: Type.String() },
791
+ run: async (ctx) => {
792
+ const brief = ctx.inputs.brief;
793
+ const outputDir = join(ctx.cwd ?? process.cwd(), ".atomic", "workflow-assets", ctx.runId ?? "local");
794
+ const generated = await ctx.tool("generate-preview", { brief, outputDir }, async ({ signal }) => {
795
+ const models = builtinModels({ credentials: AuthStorage.create() });
796
+ const model = models.getModelOfType("image", "openrouter", "google/gemini-2.5-flash-image");
797
+ if (!model) throw new Error("OpenRouter image model is unavailable");
798
+ const result = await models.generateImages(model, {
799
+ input: [{ type: "text", text: `Draft visual asset: ${brief}` }],
800
+ }, { signal });
801
+ if (result.stopReason !== "stop") throw new Error(result.errorMessage ?? "Image generation failed");
802
+ const image = result.output.find((block) => block.type === "image");
803
+ if (!image) throw new Error("The response contained no image");
804
+ const extension = image.mimeType === "image/jpeg" ? "jpg" : image.mimeType === "image/webp" ? "webp" : "png";
805
+ const imagePath = join(outputDir, `preview.${extension}`);
806
+ await mkdir(dirname(imagePath), { recursive: true });
807
+ await writeFile(imagePath, Buffer.from(image.data, "base64"));
808
+ return { imagePath };
809
+ }, { timeoutMs: 120_000 });
810
+ return { imagePath: generated.imagePath };
811
+ },
812
+ });
813
+ ```
814
+
815
+ 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.
816
+
705
817
  ### Workflow Composition
706
818
 
707
819
  Use workflow composition when a workflow calls a reusable user-defined workflow from the project or package, or a bundled builtin workflow, and consumes its outputs as a tracked boundary stage. Import the child definition with a normal TypeScript import, then pass it directly to `ctx.workflow(workflowDefinition, options)`. `ctx.workflow(...)` does not accept registry names, path objects, or string aliases.
@@ -100,7 +100,7 @@ Builtin stages report evidence and bounded results. Give each run a concrete obj
100
100
 
101
101
  All nine builtins default to `model: "auto"` for every model stage, including review, scoring, repair and final handoff stages. This also applies when you import a builtin as a child with `ctx.workflow(...)`. Each stage routes independently from its actual prompt; reviewers may select the same model. Builtins no longer ship concrete fallback chains.
102
102
 
103
- Use `/settings` → **Router model** to choose the decision provider without changing your main-chat model. Routing failures stop that stage before execution; inspect `/workflow status <run-id>` and correct the reported router, credentials or eligibility problem before retrying. See [automatic stage models](/workflows/operations#automatic-stage-models) for failure and resume behavior.
103
+ Use `/settings` → **Router model** to choose the decision provider without changing your main-chat model. Unset and `auto` use the current chat model. A complete routing failure can still run the stage on that chat model when it satisfies the stage constraints; otherwise the stage stops before execution. Inspect `/workflow status <run-id>` and correct the reported router, credentials, or eligibility problem before retrying. See [automatic stage models](/workflows/operations#automatic-stage-models) for failure and resume behavior.
104
104
 
105
105
  Explicit `tournament` `models` inputs still assign attempt models in their supplied order, round-robin; an omitted or empty list uses automatic routing. Custom workflow definitions keep their existing defaults. For an explicit model, effort or capability requirement in your own stages, use the [stage model options](/workflows/authoring#automatic-stage-model-selection).
106
106
 
@@ -8,7 +8,7 @@ For stages authored with `model: "auto"`, Atomic ranks up to three distinct elig
8
8
 
9
9
  Model selection uses the actual stage prompt, stage name, hard constraints, eligible model catalog, and compact dated evaluation records, not full human guides. Stage system and appended system prompts are not sent to the model router. Put requirements that should influence model selection in the stage prompt; the execution session still receives its configured system prompts.
10
10
 
11
- Malformed or schema-invalid routing answers receive up to three corrective retries after the initial attempt, independently for Jev and any current-chat fallback, and transient provider failures (connection errors, HTTP 408, 429 and 5xx) are retried up to three times with backoff. Model selection has no built-in wall-clock deadline; cancellation and independent provider limits still apply. Any Jev failure triggers a reported switch to the current chat model, whether the router was selected automatically or pinned. If routing inference fails completely — Jev and the chat structured-output fallback both — the stage runs on the current chat model instead of failing, with a recorded warning, but only when that model is available and satisfies every routing constraint (such as `allowedModels` and effort, cost, context and input limits). Otherwise the stage fails. An empty eligible catalog, stale decisions, credential-bearing routing context and cancellation still prevent stage execution without fallback. Choose router and chat providers permitted to receive the stage task and reference context.
11
+ Malformed or schema-invalid chat routing answers receive up to three corrective retries after the initial attempt. A classifier routing failure, including a provider size or context rejection, switches to the current chat model instead of repeating the classifier request. Transient provider failures (connection errors, HTTP 408, 429 and 5xx) are retried up to three times with backoff. Model selection has no built-in wall-clock deadline; cancellation and independent provider limits still apply. An unset or `auto` router uses the current chat model; an explicit `routerModel` selects a registered classifier or chat model. Saved classifier credentials do not select the router. If routing inference fails completely, the stage runs on the current chat model instead of failing, with a recorded warning, but only when that model is available and satisfies every routing constraint (such as `allowedModels` and effort, cost, context and input limits). Otherwise the stage fails. An empty eligible catalog, stale decisions, credential-bearing routing context and cancellation still prevent stage execution without fallback. Choose router and chat providers permitted to receive the stage task and reference context.
12
12
 
13
13
  Replay reuses recorded results without routing. Resume of a saved auto stage retains its verified selection and revalidates it against the current catalog and restrictions before fresh session admission, without a hidden new decision. If it is no longer eligible, resume fails rather than choosing another model. See [authoring automatic stages](/workflows/authoring#automatic-stage-model-selection).
14
14
 
@@ -105,7 +105,6 @@ The workflow tool action surface is:
105
105
  - inspection: `status`, `stages`, `stage`, `transcript`
106
106
  - prompt response: `answer`; run control: `pause`, `quit`, `resume`; free-form stage communication: ordinary Intercom `send`/live `ask` to `workflow:<rootRunId>/<segment>[/<segment>...]` path targets, including `*` and `**` globs
107
107
  - rediscovery: `reload`
108
- - database diagnostics: `dependency` with `operation: "status"`, `"doctor"`, or `"recover"`
109
108
 
110
109
  Every registered `workflow` tool call has one hard two-minute wall-clock deadline at the shared public tool boundary. The deadline covers request handling through the returned result; for background `run` and `resume`, it therefore covers startup/resume admission and acknowledgement only, not the workflow execution that continues after acknowledgement. A deadline returns one structured result:
111
110
 
@@ -180,7 +179,6 @@ Graph node cards show each model stage's effective model and thinking level abov
180
179
  /workflow pause [run-id|--all]
181
180
  /workflow status [run-id]
182
181
  /workflow status --all
183
- /workflow dependency [status|doctor|recover]
184
182
  /workflow quit <run-id|--all>
185
183
  /workflow resume <run-id> [stage-id-or-name] [message]
186
184
  /workflows [full-workflow-uuid]
@@ -458,6 +456,8 @@ The readiness prompt can be answered in the attached stage UI or with `workflow(
458
456
 
459
457
  Atomic workflows use **DBOS/Postgres as their sole persistent workflow backend**. Atomic configures and launches DBOS lazily on the first workflow action, reuses that process-wide instance, and awaits readiness before workflow execution, resume, inspection, or deletion can access durable state. `DBOS_SYSTEM_DATABASE_URL` may select an existing database. Once DBOS is ready, query and write failures fail the workflow action and never switch backends.
460
458
 
459
+ SDK callers can choose the backend and database for each `run()` call, and require durable state so a run fails fast instead of using the in-memory fallback; see [Choosing the durable backend](/workflows/api-reference#choosing-the-durable-backend).
460
+
461
461
  Root database registration has a 10-second deadline. First-time database provisioning and DBOS initialization are outside that deadline and can take longer. If registration fails or is cancelled, that attempt cannot start workflow code later when PostgreSQL returns. For an outage, restore the database before retrying; do not delete its data to bypass the failure. Authentication and schema errors keep their original diagnostics so you can correct the reported problem. A failed admission can remain a local same-ID retry target, but it is not confirmation that the run was saved for cross-session resume. A previously initialized durable backend does not fall back to in-memory execution after losing its connection.
462
462
 
463
463
  Pausing during startup acknowledges the local pause immediately and retains the live executor for resume, without waiting for database admission. Workflow code stays held until explicit resume. Registration continues under its existing 10-second deadline; inspect `/workflow status <run-id>` for a later persistence error. Do not start a replacement run or delete database records to bypass the error.
@@ -488,17 +488,47 @@ The first workflow action initializes and starts the database. Concurrent Atomic
488
488
 
489
489
  Cluster ownership records live beside the data in `~/.atomic/postgres/v18.shared`, outside Atomic installation/version directories. On Linux root installs, use `/var/lib/atomic-postgres/v18.shared`. Preserve these records and the existing data if Atomic reports an identity mismatch or missing `PG_VERSION`; do not delete either to force initialization. Closing or reloading an updated Atomic client does not stop a ready shared server. Older clients without this lifetime behavior can still stop servers they started, so finish and close those sessions before relying on the updated behavior for long-running work. An explicit `DBOS_SYSTEM_DATABASE_URL` remains outside managed-cluster lifecycle operations.
490
490
 
491
+ New managed PostgreSQL servers start from a complete, immutable runtime under
492
+ `~/.atomic/postgres/pg-runtime` (or `/var/lib/atomic-postgres/pg-runtime` when
493
+ running as root on Linux), separate from data and project checkouts. Removing
494
+ the original worktree or reinstalling packages does not remove files needed by
495
+ a server already using that runtime. Do not delete a runtime generation,
496
+ including a damaged one, while a managed server may still use it.
497
+ Set `ATOMIC_POSTGRES_RUNTIME_CACHE_DIR` before starting Atomic to share retained runtime generations across separate cluster homes; only the runtime cache moves, not cluster data or ownership records. Keep this directory private to a trusted account and do not remove generations while a server may use them.
498
+
499
+ Atomic only uses a runtime cache whose parent folders other accounts can't write to. A folder that only its group can write to is accepted when that group is your own private group: no other account in `/etc/passwd` uses that group as its primary group, and `/etc/group` lists no member other than you. That's the default on Ubuntu and Debian, where umask 002 makes `~/.atomic` group-writable. If Atomic reports an **Untrusted embedded Postgres runtime cache directory ancestor** and falls back to in-memory workflows, run `chmod go-w` on the folder named in the message and restart Atomic.
500
+
491
501
  **Running as root on Linux.** Atomic needs an available unprivileged account, `postgres`, `nobody`, or `daemon`, because PostgreSQL cannot run as root. The cluster is stored under `/var/lib/atomic-postgres`. If privilege or runtime preparation fails, inspect the diagnostic rather than changing data ownership blindly.
492
502
 
493
- **Administrator accounts (Windows).** Atomic can start embedded Postgres from an elevated terminal or an administrative account without changing your account or system permissions. The server runs with reduced privileges, as it does under PostgreSQL's own launcher. Regular Windows accounts remain supported. On either path, server output goes to `~/.atomic/postgres/v18.log`, not your terminal; unrelated commands starting concurrently do not keep the server's log file open. If Postgres exits during startup, Atomic reports the recent log output instead of waiting for a generic readiness timeout. Check that log for configuration or cluster errors; do not delete the cluster while a server may still be using it.
503
+ **Administrator accounts (Windows).** Atomic can start embedded Postgres from an elevated terminal or an administrative account without changing your account or system permissions. The server runs with reduced privileges, as it does under PostgreSQL's own launcher. Regular Windows accounts remain supported.
504
+
505
+ Managed PostgreSQL writes startup output to `~/.atomic/postgres/v18.log` and, after startup, server logs to `~/.atomic/postgres/v18/log/postgresql-<Day>.log`, rotating daily through seven weekday files. If Postgres exits during startup, Atomic reports recent output from both logs. Check these logs for configuration or cluster errors; do not delete the cluster while a server may still be using it.
494
506
 
495
507
  Set `ATOMIC_POSTGRES_PORT` before starting Atomic to choose a preferred loopback port, for example `ATOMIC_POSTGRES_PORT=15439 atomic`. The default is `5439`; valid values are integers from 1 through 65535. An occupied port causes Atomic to choose another loopback port without changing or stopping the listener. Concurrent sessions use one elected starter and discover the verified actual port from `v18.shared/cluster.json`. A persisted port takes precedence over a changed preference. Startup bind races have at most three attempts; inspect `v18.log` if they fail.
496
508
 
497
- Atomic checks PostgreSQL readiness and matches the server to the managed data and process identity before attachment. A listening TCP port alone is not sufficient. If an existing cluster has no trusted ownership records, Atomic refuses to adopt or initialize it. Preserve its data and use an explicit `DBOS_SYSTEM_DATABASE_URL` for that database instead. An explicit URL uses only that endpoint, never alternate managed ports.
509
+ Atomic checks PostgreSQL readiness and matches the server to the managed data and process identity before attachment. A listening TCP port alone is not sufficient. If an existing cluster has no trusted ownership records, Atomic registers it only when it is the embedded cluster an older Atomic (0.9.10–0.9.19) provisioned, recognized by PostgreSQL major version 18 and the loopback launch of that exact data directory recorded in `postmaster.opts`; registration never reinitializes or modifies the data. Any other unregistered data is refused, and recovery never registers a cluster. Preserve refused data and use an explicit `DBOS_SYSTEM_DATABASE_URL` for that database instead. An explicit URL uses only that endpoint, never alternate managed ports.
498
510
 
499
511
  After attachment, Atomic checks the managed server's SQL and process identity before borrowing database connections and every five seconds while idle. Lost health discards old connections. One elected process may restart the existing managed cluster under the shared setup lock; other sessions reconnect to its verified, persisted port. Recovery never initializes missing data, signals an unrelated listener, switches to Docker, or restarts the DBOS executor.
500
512
 
501
- Each process makes at most three recovery attempts per outage, with 250ms and 500ms backoffs. If they fail, monitoring still detects a restored server but does not keep restarting it. Inspect `v18.log`, correct the reported runtime or identity problem, and preserve both the data and ownership records. New admission keeps its 10-second deadline even if shared recovery takes longer. Restoring the connection does not automatically resume a paused run or prove that an interrupted write or external side effect committed. Inspect the original run before retrying. External database URLs receive no managed recovery; restore that exact endpoint yourself.
513
+ Each process makes at most three recovery attempts per check, with short
514
+ backoffs. Later health checks retry after a cooldown if the problem persists.
515
+ If the retained PostgreSQL runtime is damaged or missing, reinstall a complete
516
+ healthy Atomic package or repair your `ATOMIC_POSTGRES_RUNTIME_DIR` override,
517
+ then inspect `v18.log`. Atomic can select a verified replacement, including
518
+ after a same-version reinstall, even when the damaged runtime prevents new
519
+ database connections. A running server must pass process-identity verification
520
+ before Atomic stops it; if the server has already exited, Atomic starts from
521
+ the replacement without stopping anything. If a present server's identity
522
+ cannot be verified, automatic restart is refused; preserve the data,
523
+ `v18.shared`, and damaged runtime, and report the diagnostic for help instead
524
+ of deleting files or starting another server. Identity mismatches and database
525
+ corruption require investigation, not a package reinstall.
526
+ New admission keeps its
527
+ 10-second deadline even if shared recovery takes longer. Restoring the
528
+ connection does not automatically resume a paused run or prove that an
529
+ interrupted write or external side effect committed. Inspect the original run
530
+ before retrying. External database URLs receive no managed recovery; restore
531
+ that exact endpoint yourself.
502
532
 
503
533
  Restart Atomic after upgrading to enable health supervision in a session whose database executor was already initialized by an older version.
504
534
 
@@ -516,29 +546,21 @@ Fallback starts only after failed DBOS initialization has been cleaned up. If At
516
546
 
517
547
  Independent root workflows persist independently. Nested workflows share their root's ordering.
518
548
 
519
- ### Inspecting and recovering the workflow database
520
-
521
- Dependency inspection is separate from run status and does not start a workflow or initialize a database:
522
-
523
- ```text
524
- /workflow dependency # defaults to status
525
- /workflow dependency doctor
526
- /workflow dependency recover
527
- ```
528
-
529
- The tool equivalents are `workflow({ action: "dependency", operation: "doctor" })` and `workflow({ action: "dependency", operation: "recover" })`. SDK integrations can use [`workflowDependency()`](/workflows/api-reference#workflowdependency-operation).
530
-
531
- `status` and `doctor` perform read-only checks. For a managed cluster, the report identifies the actual host/port, trusted cluster and data-directory identity, PostgreSQL process identity, current JavaScript runtime, and PostgreSQL server version when available. `identityVerified: true` means SQL, data and process identity agreed during that check. The consumer list conservatively retains leases whose process may still be alive; it is not a count of running workflows. `lastFailure` retains the most recently observed failure, including runtime diagnostics, after successful checks until a newer failure replaces it. It is process-local history, not a shared or permanent incident log. Use `state`, not the presence of `lastFailure`, to determine whether the latest check succeeded.
532
-
533
- `doctor` also checks the installed PostgreSQL 18 executables with one-second `--version` probes and reports the executable path and version under `runtime.installation`. Missing libraries or an incompatible runtime produce `unavailable` and a diagnostic. These checks do not repair links or permissions. `status` skips them, so it can inspect an existing healthy server even when local runtime files need repair.
549
+ ### Workflow database recovery
534
550
 
535
- Each request returns within a five-second response budget. `checking` or `recovering` means the existing operation continues in the background, not that it succeeded or was cancelled. Repeated calls join that operation. Use `/workflow dependency status` to check again rather than launching duplicate recovery or a replacement workflow.
551
+ Atomic monitors the managed PostgreSQL server and coordinates recovery when it
552
+ loses health. The shared cluster keeps its data and ownership records; database
553
+ recovery neither starts a replacement workflow nor proves an unfinished external
554
+ effect succeeded. Inspect `/workflow status <full-run-uuid>` for the original run
555
+ and explicitly resume it when eligible. Do not start a duplicate run or delete
556
+ `v18` or `v18.shared` to bypass an identity or availability error.
536
557
 
537
- `recover` retries only an already registered managed cluster under its shared setup lock. It preserves data and ownership records, never runs `initdb` over existing data, never adopts an unregistered cluster, and never kills a listener to free a port. Identity mismatches require investigation, not deletion of `v18` or `v18.shared`. If runtime files or libraries are missing, repair the complete installation using [Configuring DBOS/Postgres](#configuring-dbos/postgres), then retry recovery.
538
-
539
- With `DBOS_SYSTEM_DATABASE_URL`, every operation only checks that configured endpoint with a bounded query. Atomic does not restart it, choose another port, or provision a replacement. Correct its service, credentials or TLS settings yourself. A selected Docker fallback returns guidance for inspecting `dbos-db`; dependency recovery does not manage that container.
540
-
541
- Once the dependency is ready, inspect `/workflow status <full-run-uuid>` and explicitly resume the same ID when eligible. Database recovery itself never resumes workflow execution or proves an uncheckpointed external effect succeeded. Keep the original Atomic process open for a retained failed-admission retry. Existing pause and quit acknowledgements remain immediate during admission; inspect run status for later database settlement errors.
558
+ For an explicit `DBOS_SYSTEM_DATABASE_URL`, Atomic does not manage the external
559
+ database. Restore that endpoint or correct its credentials and TLS settings,
560
+ then inspect and resume the original workflow. If the Docker fallback is in use,
561
+ inspect `dbos-db` and correct its service configuration. A database repair does
562
+ not automatically resume a paused workflow or establish whether an interrupted
563
+ write committed.
542
564
 
543
565
  ### How it works
544
566
 
@@ -637,6 +659,8 @@ Changing `iteration` makes each loop pass a distinct durable call. Reusing the s
637
659
 
638
660
  The `/workflow resume` command mirrors `/resume` ergonomics and `/workflows` is its alias. With no id, it builds one newest-first picker from live runs that satisfy the shared resumability predicate and current DBOS resumable/completed records. DBOS is the authoritative catalog; selected records are hydrated and revalidated before resume or inspection. Running workflows never appear: fresh-heartbeat rows are excluded in every session to prevent double dispatch, and stale ones surface as `crashed`. A row whose durable checkpoint or referenced artifact is missing is not resumable and is omitted rather than offered and rejected later. Naming such an id explicitly still produces the existing clear no-checkpoint/not-resumable error.
639
661
 
662
+ Picker rows use the workflow ID as the primary label for search and direct resume. The adjacent details show status, completed stages or checkpoints, then the workflow name; on narrow terminals, the picker may truncate the ID or name visually, but searching the full ID still works.
663
+
640
664
  If resume reports a checkpoint decoding error or an unavailable serializer, retain the full run ID and original diagnostic when reporting the problem. Do not delete saved progress or launch a fresh copy just to bypass the error: that can repeat completed side effects.
641
665
 
642
666
  Only runs with usable durable checkpoints or pending prompts can resume. Deleted durable entries and missing artifacts are not offered. Status and connect/attach still expose eligible terminal runs for inspection.
@@ -682,7 +706,7 @@ Recovery requires saved checkpoints proving one unfinished tool and its complete
682
706
 
683
707
  A tool-frontier continuation must reach and consume the exact unfinished tool before reporting `completed`, whether the body returns normally or calls `ctx.exit({ status: "completed" })`. Omitting the call, including by changing control flow, fails with `insufficient_state: replay topology mismatch` and the pending tool's exact ID. A substituted tool is rejected before its callback runs. While that frontier is pending, completed model and child-workflow predecessors can replay, but new model stages, tasks, and child workflows cannot execute in its place. Stage and task worktree setup also waits for live admission. Replaying completed predecessors alone is not proof of completion. Failed replay publishes no successful result; inspect the same ID and restore the matching flow before another supported resume. Quit, kill, caught targeted cancellation, and intentional non-completed exits retain their existing behavior.
684
708
 
685
- After upgrading or applying a runtime fix, start a new Atomic process; `/workflow reload` refreshes definitions, not the installed runtime. A process-local non-durable warning means cross-process recovery is unavailable.
709
+ After upgrading Atomic itself or applying a code fix, start a new Atomic process; `/workflow reload` refreshes definitions, not loaded code. A process-local non-durable warning means cross-process recovery is unavailable.
686
710
 
687
711
  If saved state cannot prove safe replay, reconcile the original run and external effects before choosing recovery. Do not restart the original workflow from the beginning to bypass the error. A separately authorized recovery-only workflow may perform verified remaining operations, but must not repeat completed side effects or fabricate checkpoints.
688
712
 
@@ -711,7 +735,7 @@ Set `ATOMIC_POSTGRES_RUNTIME_DIR` to a complete extracted runtime containing `bi
711
735
 
712
736
  Keep the complete extracted archive, not only the `atomic` executable. `ATOMIC_POSTGRES_RUNTIME_DIR` accepts complete legacy runtimes without provenance; an incomplete override falls through to installed candidates. Packaging failures do not require deleting or reinitializing the v18 cluster.
713
737
 
714
- If installation reports **incomplete PostgreSQL runtime**, or macOS reports a missing library such as `libzstd.1.dylib`, download a repaired release and reinstall the complete archive. A rejected upgrade leaves your previous installation selected. Do not copy libraries from another version or delete your PostgreSQL data directory: this is an installation problem, not database corruption. An already-running server does not prove that the new installation is usable.
738
+ If starting workflows reports a missing PostgreSQL executable or library, such as `libzstd.1.dylib` on macOS, download a repaired release and reinstall the complete archive. The installers do not check the bundled PostgreSQL runtime, so the problem shows up the first time Atomic starts its embedded database. With `DBOS_SYSTEM_DATABASE_URL` set, Atomic never uses the bundled runtime. If embedded startup fails and the Docker fallback succeeds, workflows run on Docker without reporting the embedded failure. Check `~/.atomic/postgres/v18.log` if the managed database never starts. Do not copy libraries from another version or delete your PostgreSQL data directory: this is an installation problem, not database corruption. An already-running server does not prove that the new installation is usable.
715
739
 
716
740
  To check an archive runtime, set `runtime` to its `node_modules/@bastani/atomic-natives/postgres-runtime`, then run `"$runtime/bin/postgres" --version` and `"$runtime/bin/pg_ctl" --version`. On Windows use the corresponding `.exe` files in PowerShell. Both must succeed. If a library-link or copy error is reported, repair the complete installation instead of mixing libraries from different releases.
717
741
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Use this guide to turn an objective into an acyclic, evidence-producing workflow with explicit contracts, context boundaries, verification, and stop conditions. Read [Custom Workflow Authoring](/workflows/authoring) first if you have not built a workflow definition yet.
4
4
 
5
- The agent decides whether a workflow fits. Well-defined, authorized work that benefits from durable stages, checkpoints, dependencies, recovery, review loops or approval gates runs as a workflow; brainstorming, discussion, unclear goals, simple bounded work, or an explicit request to work inline, quickly or without a workflow stays inline. To launch, inspect the input contract with `workflow inputs`, then call `workflow run` with the registered workflow name and inputs. Ask only for genuinely missing information.
5
+ The agent decides whether a workflow fits. Non-trivial work with structure and a verifiable objective runs as a workflow unless you ask for inline execution: implementation, bug fixes, debugging, migrations, multi-file changes with validation, and requests phrased as "repeat until" or "fix until green". Brainstorming, discussion, unclear goals, tiny low-risk answers or edits, or an explicit request to work inline, quickly or without a workflow stays inline. To launch, inspect the input contract with `workflow inputs`, then call `workflow run` with the registered workflow name and inputs. Ask only for genuinely missing information.
6
6
 
7
7
  Preserve the user's actual words, uncertainty and preferences; do not turn discussion into an implementation objective. User-issued `/workflow` commands launch directly and authored `ctx.workflow(...)` remains internal composition. For workflow authoring, carry the [domain/environment verification and media evidence contract](/workflows/verification) into worker, reviewer and final handoff prompts.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Verify the behavior that changed, then give the reviewer enough evidence to understand the result. A small fix may need a focused test and a short explanation. An interactive change usually needs a real user scenario as well. A video is useful when it shows something a test log or screenshot cannot; it is not required for every PR.
4
4
 
5
- For tool installation, automation techniques, platform permissions, and general work in applications, read [Computer use](/computer-use). That guide covers Herdr for terminals, agent-browser for browsers, and Cua Driver for desktop, simulator, and emulator CUA on macOS, Linux, and Windows. It also covers native accessibility and application tools when they are easier or more reliable.
5
+ For tool installation, automation techniques, platform permissions, and general work in applications, read [Computer use](/computer-use). That guide covers Herdr for terminals, agent-browser for browsers, Mobile Safari, and CDP-exposing apps, and Cua Driver for other desktop, simulator, and emulator CUA on macOS, Linux, and Windows. It also covers native accessibility and application tools when they are easier or more reliable.
6
6
 
7
7
  <a id="select-the-verification-environment" />
8
8
 
@@ -13,12 +13,23 @@ Start with the project's existing tests, build, typecheck, and lint commands. Ad
13
13
  | Changed behavior | Preferred mechanism | What to check |
14
14
  | --- | --- | --- |
15
15
  | Interactive terminal or TUI | **Herdr**, under its explicit-request and managed-pane requirements; tmux or native Windows psmux as fallbacks | Actual input, rendered output, navigation, resizing, and exit behavior relevant to the change. |
16
- | Browser/frontend, Electron desktop app, Slack, or cloud browser | **agent-browser**, for the scope its skill covers; Cua Driver when agent-browser hits a limitation | The user flow and its visible result, with DOM or network assertions where useful. |
17
- | Native desktop app, iOS simulator, or Android emulator | **Cua Driver**: the `cua-driver` CLI through the bundled skill when a model chooses actions, or the `@trycua/cua-driver` SDK inside `ctx.tool` when workflow code owns the scenario; supplemented by native/app APIs | The exact window's before/after accessibility state and screenshots, a checked postcondition, and the saved or exported result. |
16
+ | Browser/frontend in Chrome/Chromium, Mobile Safari in the iOS Simulator, Electron desktop app or another CDP-exposing app, Slack, or cloud browser | **agent-browser**, for everything in [its scope](/computer-use#what-agent-browser-covers); Cua Driver when agent-browser hits a limitation | The user flow and its visible result, with DOM or network assertions where useful. |
17
+ | Native desktop app, native iOS app in the iOS Simulator, Android emulator, desktop Safari or another non-Chromium browser, or OS dialogs | **Cua Driver**: the `cua-driver` CLI through the bundled skill when a model chooses actions, or the `@trycua/cua-driver` SDK inside `ctx.tool` when workflow code owns the scenario; supplemented by native/app APIs | The exact window's before/after accessibility state and screenshots, a checked postcondition, and the saved or exported result. |
18
18
  | API, library, script, or other non-UI behavior | Existing test runner and shell commands | Inputs, outputs, error handling, and relevant build/type contracts. |
19
19
  | Documentation | Documentation checks and example review | Links, navigation, command accuracy, and whether a reader can follow the instructions. |
20
20
 
21
- See [tool selection](/computer-use#choose-the-right-tool) before operating a session. Herdr is the terminal priority, but the preference does not authorize control from outside a Herdr-managed pane. Install missing tools when permitted; otherwise use the available fallback and describe any coverage gap.
21
+ See [tool selection](/computer-use#choose-the-right-tool) before operating a session. Reach for agent-browser first whenever the target is in its scope: its text snapshots cost far fewer tokens than screenshot-driven CUA. Herdr is the terminal priority, but the preference does not authorize control from outside a Herdr-managed pane. Install missing tools when permitted; otherwise use the available fallback and describe any coverage gap.
22
+
23
+ ### Reuse past verification
24
+
25
+ When a shell tool is available, the agent records each check it ran or attempted as an `Assistant-verification` line in the commits and PRs it writes, for example:
26
+
27
+ ```text
28
+ Assistant-verification: herdr terminal E2E passed: /tasks lists running tasks first at 80x24
29
+ Assistant-verification: cua-driver unavailable: Accessibility permission not granted
30
+ ```
31
+
32
+ Before choosing checks for a change, the agent looks up these lines for comparable changes (for example with `git log --format='%h %s%n%(trailers:key=Assistant-verification)' -- <path>`) and reuses the commands and scenarios that proved them. A setup recorded as `unavailable` is not retried without a reason to expect a different result. Past records guide the choice; they do not replace the project's required checks. See [execution history](/usage#system-prompt-files) to turn these records off.
22
33
 
23
34
  ## Define a reproducible scenario
24
35
 
@@ -56,6 +67,24 @@ agent-browser --session pr-check record stop
56
67
 
57
68
  Open the saved artifact and confirm it includes the final state. Keep recordings short and focused. Inspect authentication state and network output for secrets before sharing. See [browser setup and best practices](/computer-use#browser-automation-with-agent-browser).
58
69
 
70
+ #### Mobile Safari
71
+
72
+ For a mobile web change where Safari behavior matters, run the same flow in real Mobile Safari with agent-browser's iOS provider rather than Chromium device emulation. It needs macOS with Xcode simulator runtimes, Appium, and the XCUITest driver:
73
+
74
+ ```sh
75
+ agent-browser device list
76
+ agent-browser -p ios --device "iPhone 16 Pro" open http://localhost:3000
77
+ xcrun simctl io booted recordVideo ios-flow.mp4 &
78
+ recorder=$!
79
+ agent-browser -p ios snapshot -i
80
+ # Exercise the scenario here.
81
+ agent-browser -p ios screenshot ios-after.png
82
+ kill -INT "$recorder"; wait "$recorder"
83
+ agent-browser -p ios close
84
+ ```
85
+
86
+ The iOS provider does not support `record`, so the example records the booted simulator with `simctl`, which finalizes the file when it receives SIGINT. Stop the recording before `close`, which shuts the simulator down. Name the simulator device and iOS version in the evidence. `set device` emulation in Chrome shows a mobile viewport, not WebKit behavior.
87
+
59
88
  <a id="terminal-contracts" />
60
89
 
61
90
  ### Terminal changes
@@ -70,16 +99,18 @@ See [terminal setup and capture commands](/computer-use#terminal-automation-with
70
99
 
71
100
  <a id="desktop-safety" />
72
101
 
73
- ### Desktop, simulator, and emulator changes
102
+ ### Native desktop, simulator, and emulator changes
74
103
 
75
104
  Use Cua Driver in a dedicated graphical session, following [the desktop guide](/computer-use#desktop-automation-with-cua-driver). When a language model chooses each action, whether in an interactive session or in any workflow stage acting outside `ctx.tool`, load the bundled `cua-driver` skill and drive the exact window with one-shot `cua-driver call <tool>` commands, running every command with `CUA_DRIVER_RS_TELEMETRY_ENABLED=false`. When a custom workflow's TypeScript owns the scenario and its postcondition, run it with the `@trycua/cua-driver` SDK inside `ctx.tool` as shown in [workflow authoring](/workflows/authoring#desktop-verification-with-cua-driver-in-ctx-tool). Either way the loop is the same: snapshot the window with `get_window_state`, act through a snapshot-bound element token, take a fresh snapshot, and check a postcondition with a bounded poll deadline. Application APIs can still give the strongest assertion, for example checking a saved document through the app API after exercising the visible Save flow.
76
105
 
77
106
  Evidence is the structured window state plus screenshots, not a screenshot alone. Save each `get_window_state` JSON result and its `screenshot_out_file` image (before and after the action) to the artifacts directory, and state the postcondition that was checked. A `degraded` or `truncated` snapshot is a failed observation, not a reason to act.
78
107
 
79
- Capture the actual application or simulator. A browser recording is not desktop or iOS evidence. Cua Driver can interact with a visible simulator/emulator window, but does not directly control an arbitrary physical phone. Use supported native tooling where needed, and name the device or emulator actually exercised.
108
+ Capture the actual application or simulator. A Chrome recording is not desktop or native iOS evidence, and an agent-browser `-p ios` session proves Mobile Safari behavior, not a native iOS app. Cua Driver can interact with a visible simulator/emulator window, but does not directly control an arbitrary physical phone. Use supported native tooling where needed, and name the device or emulator actually exercised.
80
109
 
81
110
  Missing readiness is a blocked finding, not a failure to work around. Before the first action the stage checks `cua-driver --version` (one bounded install attempt with upstream's one-line installer if it is missing, then `cua-driver telemetry disable`), `cua-driver status`, `cua-driver doctor`, and `cua-driver call list_apps`, plus `cua-driver permissions status` on macOS. A builtin Goal or Ralph stage reports a missing macOS Accessibility or Screen Recording grant, a non-interactive Windows session, no graphical Linux session, or a refused or failed install as `blocked`/`needs_human` with the exact remediation (for macOS: `cua-driver permissions grant`, toggle CuaDriver on under System Settings → Privacy & Security → Accessibility and Screen & System Audio Recording, then relaunch the daemon with `open -n -g -a CuaDriver --args serve`), and re-runs the readiness check when the run resumes. A custom workflow does the same from a preflight `ctx.tool` that calls `ctx.exit({ status: "blocked", reason })`. Unlike a builtin stage, a blocked author exit is terminal and not resumable: after the user grants the permission, start a new run, whose fresh preflight checks again rather than replaying a cached result.
82
111
 
112
+ The executable installer does not install an agent skill. Atomic bundles the skill, so skip upstream's optional `cua-driver skills install`, `cua-driver skills update`, and `clawhub install @cua/driver` steps; leave existing user-level skills alone.
113
+
83
114
  Inspect saved files and exports rather than assuming a returned action means a completed operation. An action that times out before its response is `unknown`; resolve it with a fresh snapshot and the postcondition, never by replaying the action.
84
115
 
85
116
  ## Use evidence in a workflow
@@ -125,7 +156,7 @@ Give the reviewer a short summary before linking logs or media. For example, rep
125
156
  - Limits: <checks/platforms not exercised>
126
157
  ```
127
158
 
128
- Attach a screenshot for a visual state, a short recording for an interaction, or logs for command behavior. When a run used Cua Driver, the evidence is the before/after `screenshot_out_file` PNGs from `get_window_state`, one pair per verified postcondition, with the window-state JSON kept locally and cited by name; when it used agent-browser, the evidence is its `screenshot` PNGs and `record` recordings. Put them in the PR body next to the scenario they prove. Include reproduction steps even when media is available. Label local-only paths as local; reviewers cannot open a file on your machine. CI artifact links are useful when readers have access, but note retention limits where relevant.
159
+ Attach a screenshot for a visual state, a short recording for an interaction, or logs for command behavior. When a run used Cua Driver, the evidence is the before/after `screenshot_out_file` PNGs from `get_window_state`, one pair per verified postcondition, with the window-state JSON kept locally and cited by name; when it used agent-browser, the evidence is its `screenshot` PNGs and `record` recordings (for an iOS Simulator session, its screenshots plus any `simctl` recording). Put them in the PR body next to the scenario they prove. Include reproduction steps even when media is available. Label local-only paths as local; reviewers cannot open a file on your machine. CI artifact links are useful when readers have access, but note retention limits where relevant.
129
160
 
130
161
  Only upload to an authorized repository or destination. Inspect and redact secrets, personal information, private source content, and unrelated windows before attaching files. Permission to collect local evidence is not permission to publish it.
131
162
 
package/docs/workflows.md CHANGED
@@ -46,7 +46,7 @@ For checking changes and sharing results in PRs, see [Verification and evidence]
46
46
 
47
47
  ## When to Use Workflows
48
48
 
49
- The agent decides whether a workflow fits. Well-defined, authorized work that benefits from durable stages, checkpoints, dependencies, recovery, review loops or approval gates runs as a workflow; brainstorming, discussion, unclear goals, simple bounded work, or an explicit request to work inline, quickly or without a workflow stays inline. To launch, inspect the input contract with `workflow inputs`, then call `workflow run` with the registered workflow name and inputs. Ask only for genuinely missing information.
49
+ The agent decides whether a workflow fits. Non-trivial work with structure and a verifiable objective runs as a workflow unless you ask for inline execution: implementation, bug fixes, debugging, migrations, multi-file changes with validation, and requests phrased as "repeat until" or "fix until green". Brainstorming, discussion, unclear goals, tiny low-risk answers or edits, or an explicit request to work inline, quickly or without a workflow stays inline. To launch, inspect the input contract with `workflow inputs`, then call `workflow run` with the registered workflow name and inputs. Ask only for genuinely missing information.
50
50
 
51
51
  Safety, authorization, testing and evidence requirements remain in force. For an active user-requested switch to inline, safely hold/stop the affected run and reconcile completed work and in-flight effects before continuing without duplicates. User `/workflow` commands launch directly; authored `ctx.workflow(...)` remains internal composition.
52
52
 
@@ -112,6 +112,7 @@ cp permission-gate.ts ~/.atomic/agent/extensions/
112
112
  | Extension | Description |
113
113
  |-----------|-------------|
114
114
  | `message-renderer.ts` | Custom message rendering with colors and expandable details via `registerMessageRenderer` |
115
+ | `debug-provider.ts` | Toggle raw provider stream capture with `/debug-provider` and inspect each assistant message in a TUI-only session entry |
115
116
  | `event-bus.ts` | Inter-extension communication via `pi.events` |
116
117
 
117
118
  ### Session Metadata