@bastani/atomic 0.9.20-alpha.5 → 0.9.20-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +37 -0
  3. package/dist/builtin/intercom/CHANGELOG.md +10 -0
  4. package/dist/builtin/intercom/broker/broker.ts +110 -39
  5. package/dist/builtin/intercom/broker/client.ts +8 -1
  6. package/dist/builtin/intercom/index.bundle.mjs +61 -2
  7. package/dist/builtin/intercom/live-route-refusal.ts +69 -0
  8. package/dist/builtin/intercom/package.json +2 -2
  9. package/dist/builtin/intercom/recoverable-disconnect.ts +16 -4
  10. package/dist/builtin/intercom/skills/intercom/SKILL.md +11 -11
  11. package/dist/builtin/intercom/types.ts +3 -1
  12. package/dist/builtin/mcp/package.json +2 -2
  13. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  14. package/dist/builtin/subagents/package.json +3 -3
  15. package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +494 -0
  16. package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +578 -0
  17. package/dist/builtin/subagents/skills/cua-driver/LINUX.md +364 -0
  18. package/dist/builtin/subagents/skills/cua-driver/MACOS.md +509 -0
  19. package/dist/builtin/subagents/skills/cua-driver/README.md +113 -0
  20. package/dist/builtin/subagents/skills/cua-driver/RECORDING.md +162 -0
  21. package/dist/builtin/subagents/skills/cua-driver/SKILL.md +1105 -0
  22. package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +866 -0
  23. package/dist/builtin/web-access/package.json +2 -2
  24. package/dist/builtin/workflows/CHANGELOG.md +13 -0
  25. package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
  26. package/dist/builtin/workflows/builtin/{chunk-7f381xnq.js → chunk-2hzrv5y8.js} +140 -21
  27. package/dist/builtin/workflows/builtin/{chunk-e83tc6nr.js → chunk-3tx8ry44.js} +3 -2
  28. package/dist/builtin/workflows/builtin/{chunk-00ywx588.js → chunk-5724b0cf.js} +1 -1
  29. package/dist/builtin/workflows/builtin/{chunk-ne6vh5ct.js → chunk-7n51c5gh.js} +1 -1
  30. package/dist/builtin/workflows/builtin/{chunk-x2nftpgj.js → chunk-9z3ztr2a.js} +1 -1
  31. package/dist/builtin/workflows/builtin/{chunk-zj5162bh.js → chunk-deq63d9p.js} +3 -3
  32. package/dist/builtin/workflows/builtin/{chunk-7h7s5xdj.js → chunk-dxjxtgmp.js} +1 -1
  33. package/dist/builtin/workflows/builtin/{chunk-tvcydq13.js → chunk-ffdrv23t.js} +1 -1
  34. package/dist/builtin/workflows/builtin/{chunk-pfm1kgqz.js → chunk-hmt5w62g.js} +12 -4
  35. package/dist/builtin/workflows/builtin/{chunk-tdqvdrg1.js → chunk-jngsbbpm.js} +3 -3
  36. package/dist/builtin/workflows/builtin/{chunk-55p5dxjk.js → chunk-njmf5ze7.js} +1 -1
  37. package/dist/builtin/workflows/builtin/{chunk-evfb0312.js → chunk-vn0wb31x.js} +1 -1
  38. package/dist/builtin/workflows/builtin/classify-and-act.js +3 -3
  39. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -3
  40. package/dist/builtin/workflows/builtin/generate-and-filter.js +3 -3
  41. package/dist/builtin/workflows/builtin/goal.js +4 -4
  42. package/dist/builtin/workflows/builtin/index.js +12 -12
  43. package/dist/builtin/workflows/builtin/loop-until-done.js +3 -3
  44. package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
  45. package/dist/builtin/workflows/builtin/ralph.js +4 -4
  46. package/dist/builtin/workflows/builtin/steering-context.js +1 -1
  47. package/dist/builtin/workflows/builtin/tournament.js +3 -3
  48. package/dist/builtin/workflows/package.json +2 -2
  49. package/dist/builtin/workflows/src/extension/index.bundle.mjs +199 -36
  50. package/dist/builtin/workflows/src/index.js +1418 -1271
  51. package/dist/cli/args.d.ts.map +1 -1
  52. package/dist/cli/args.js +15 -4
  53. package/dist/cli/args.js.map +1 -1
  54. package/dist/cli/file-processor.d.ts +1 -1
  55. package/dist/cli/file-processor.d.ts.map +1 -1
  56. package/dist/cli/file-processor.js.map +1 -1
  57. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  58. package/dist/core/agent-session-auto-compaction.js +40 -12
  59. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  60. package/dist/core/agent-session-bash.d.ts.map +1 -1
  61. package/dist/core/agent-session-bash.js +9 -8
  62. package/dist/core/agent-session-bash.js.map +1 -1
  63. package/dist/core/agent-session-boundaries.d.ts +68 -0
  64. package/dist/core/agent-session-boundaries.d.ts.map +1 -0
  65. package/dist/core/agent-session-boundaries.js +334 -0
  66. package/dist/core/agent-session-boundaries.js.map +1 -0
  67. package/dist/core/agent-session-compaction.js +1 -1
  68. package/dist/core/agent-session-compaction.js.map +1 -1
  69. package/dist/core/agent-session-events.d.ts.map +1 -1
  70. package/dist/core/agent-session-events.js +27 -13
  71. package/dist/core/agent-session-events.js.map +1 -1
  72. package/dist/core/agent-session-export.d.ts.map +1 -1
  73. package/dist/core/agent-session-export.js +16 -20
  74. package/dist/core/agent-session-export.js.map +1 -1
  75. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  76. package/dist/core/agent-session-message-queue.js +3 -2
  77. package/dist/core/agent-session-message-queue.js.map +1 -1
  78. package/dist/core/agent-session-methods.d.ts +30 -4
  79. package/dist/core/agent-session-methods.d.ts.map +1 -1
  80. package/dist/core/agent-session-methods.js.map +1 -1
  81. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  82. package/dist/core/agent-session-persistent-custom-messages.js +2 -1
  83. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  84. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  85. package/dist/core/agent-session-prompt.js +93 -25
  86. package/dist/core/agent-session-prompt.js.map +1 -1
  87. package/dist/core/agent-session-retry.d.ts.map +1 -1
  88. package/dist/core/agent-session-retry.js +4 -9
  89. package/dist/core/agent-session-retry.js.map +1 -1
  90. package/dist/core/agent-session-runtime.js +1 -1
  91. package/dist/core/agent-session-runtime.js.map +1 -1
  92. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  93. package/dist/core/agent-session-tool-hooks.js +15 -5
  94. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  95. package/dist/core/agent-session-tree.d.ts.map +1 -1
  96. package/dist/core/agent-session-tree.js +2 -3
  97. package/dist/core/agent-session-tree.js.map +1 -1
  98. package/dist/core/agent-session-types.d.ts +6 -0
  99. package/dist/core/agent-session-types.d.ts.map +1 -1
  100. package/dist/core/agent-session-types.js.map +1 -1
  101. package/dist/core/agent-session.d.ts +15 -2
  102. package/dist/core/agent-session.d.ts.map +1 -1
  103. package/dist/core/agent-session.js +17 -1
  104. package/dist/core/agent-session.js.map +1 -1
  105. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  106. package/dist/core/compaction/branch-summarization.js +1 -0
  107. package/dist/core/compaction/branch-summarization.js.map +1 -1
  108. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  109. package/dist/core/compaction/compaction-boundary.js +11 -6
  110. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  111. package/dist/core/compaction/compaction.d.ts +3 -1
  112. package/dist/core/compaction/compaction.d.ts.map +1 -1
  113. package/dist/core/compaction/compaction.js +37 -0
  114. package/dist/core/compaction/compaction.js.map +1 -1
  115. package/dist/core/crash-log.d.ts +6 -0
  116. package/dist/core/crash-log.d.ts.map +1 -0
  117. package/dist/core/crash-log.js +69 -0
  118. package/dist/core/crash-log.js.map +1 -0
  119. package/dist/core/execution-model-router.d.ts +1 -0
  120. package/dist/core/execution-model-router.d.ts.map +1 -1
  121. package/dist/core/execution-model-router.js +15 -12
  122. package/dist/core/execution-model-router.js.map +1 -1
  123. package/dist/core/export-html/template-js/tree-filter-render.js +6 -1
  124. package/dist/core/export-html/template.js +6 -1
  125. package/dist/core/extensions/agent-events.d.ts +69 -3
  126. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  127. package/dist/core/extensions/agent-events.js.map +1 -1
  128. package/dist/core/extensions/api-types.d.ts +5 -3
  129. package/dist/core/extensions/api-types.d.ts.map +1 -1
  130. package/dist/core/extensions/api-types.js.map +1 -1
  131. package/dist/core/extensions/event-results.d.ts +3 -0
  132. package/dist/core/extensions/event-results.d.ts.map +1 -1
  133. package/dist/core/extensions/event-results.js.map +1 -1
  134. package/dist/core/extensions/event-types.d.ts +2 -2
  135. package/dist/core/extensions/event-types.d.ts.map +1 -1
  136. package/dist/core/extensions/event-types.js.map +1 -1
  137. package/dist/core/extensions/index.d.ts +1 -1
  138. package/dist/core/extensions/index.d.ts.map +1 -1
  139. package/dist/core/extensions/index.js.map +1 -1
  140. package/dist/core/extensions/provider-types.d.ts +2 -0
  141. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  142. package/dist/core/extensions/provider-types.js.map +1 -1
  143. package/dist/core/extensions/runner-events.d.ts +16 -2
  144. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  145. package/dist/core/extensions/runner-events.js +98 -5
  146. package/dist/core/extensions/runner-events.js.map +1 -1
  147. package/dist/core/extensions/runner.d.ts +3 -2
  148. package/dist/core/extensions/runner.d.ts.map +1 -1
  149. package/dist/core/extensions/runner.js +4 -1
  150. package/dist/core/extensions/runner.js.map +1 -1
  151. package/dist/core/index.d.ts +1 -1
  152. package/dist/core/index.d.ts.map +1 -1
  153. package/dist/core/index.js.map +1 -1
  154. package/dist/core/messages.d.ts +10 -0
  155. package/dist/core/messages.d.ts.map +1 -1
  156. package/dist/core/messages.js +57 -0
  157. package/dist/core/messages.js.map +1 -1
  158. package/dist/core/model-config.d.ts +52 -0
  159. package/dist/core/model-config.d.ts.map +1 -1
  160. package/dist/core/model-config.js +16 -0
  161. package/dist/core/model-config.js.map +1 -1
  162. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  163. package/dist/core/model-resolver-defaults.js +2 -1
  164. package/dist/core/model-resolver-defaults.js.map +1 -1
  165. package/dist/core/prompt-templates-async.d.ts +2 -2
  166. package/dist/core/prompt-templates-async.d.ts.map +1 -1
  167. package/dist/core/prompt-templates-async.js +57 -29
  168. package/dist/core/prompt-templates-async.js.map +1 -1
  169. package/dist/core/prompt-templates.d.ts +6 -1
  170. package/dist/core/prompt-templates.d.ts.map +1 -1
  171. package/dist/core/prompt-templates.js +61 -35
  172. package/dist/core/prompt-templates.js.map +1 -1
  173. package/dist/core/provider-composer-internal.d.ts +1 -0
  174. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  175. package/dist/core/provider-composer-internal.js +19 -0
  176. package/dist/core/provider-composer-internal.js.map +1 -1
  177. package/dist/core/resource-loader-assets.d.ts.map +1 -1
  178. package/dist/core/resource-loader-assets.js +6 -6
  179. package/dist/core/resource-loader-assets.js.map +1 -1
  180. package/dist/core/sdk.js +3 -2
  181. package/dist/core/sdk.js.map +1 -1
  182. package/dist/core/session-manager-core.d.ts +10 -3
  183. package/dist/core/session-manager-core.d.ts.map +1 -1
  184. package/dist/core/session-manager-core.js +65 -7
  185. package/dist/core/session-manager-core.js.map +1 -1
  186. package/dist/core/session-manager-entries.d.ts +4 -1
  187. package/dist/core/session-manager-entries.d.ts.map +1 -1
  188. package/dist/core/session-manager-entries.js +8 -0
  189. package/dist/core/session-manager-entries.js.map +1 -1
  190. package/dist/core/session-manager-history.d.ts +16 -1
  191. package/dist/core/session-manager-history.d.ts.map +1 -1
  192. package/dist/core/session-manager-history.js +105 -42
  193. package/dist/core/session-manager-history.js.map +1 -1
  194. package/dist/core/session-manager-types.d.ts +30 -3
  195. package/dist/core/session-manager-types.d.ts.map +1 -1
  196. package/dist/core/session-manager-types.js.map +1 -1
  197. package/dist/core/session-manager.d.ts +2 -2
  198. package/dist/core/session-manager.d.ts.map +1 -1
  199. package/dist/core/session-manager.js +1 -1
  200. package/dist/core/session-manager.js.map +1 -1
  201. package/dist/core/structured-output/index.d.ts +0 -1
  202. package/dist/core/structured-output/index.d.ts.map +1 -1
  203. package/dist/core/structured-output/index.js +3 -15
  204. package/dist/core/structured-output/index.js.map +1 -1
  205. package/dist/core/structured-output/jev-client.d.ts +4 -8
  206. package/dist/core/structured-output/jev-client.d.ts.map +1 -1
  207. package/dist/core/structured-output/jev-client.js +36 -32
  208. package/dist/core/structured-output/jev-client.js.map +1 -1
  209. package/dist/core/structured-output/jev.d.ts.map +1 -1
  210. package/dist/core/structured-output/jev.js +4 -12
  211. package/dist/core/structured-output/jev.js.map +1 -1
  212. package/dist/core/structured-output/types.d.ts +0 -2
  213. package/dist/core/structured-output/types.d.ts.map +1 -1
  214. package/dist/core/structured-output/types.js.map +1 -1
  215. package/dist/core/system-prompt.js +1 -1
  216. package/dist/core/system-prompt.js.map +1 -1
  217. package/dist/core/tools/read.d.ts +4 -0
  218. package/dist/core/tools/read.d.ts.map +1 -1
  219. package/dist/core/tools/read.js +5 -1
  220. package/dist/core/tools/read.js.map +1 -1
  221. package/dist/index-extensions.d.ts +1 -1
  222. package/dist/index-extensions.d.ts.map +1 -1
  223. package/dist/index-extensions.js.map +1 -1
  224. package/dist/index.d.ts +2 -2
  225. package/dist/index.d.ts.map +1 -1
  226. package/dist/index.js +2 -2
  227. package/dist/index.js.map +1 -1
  228. package/dist/main-app-mode.d.ts +1 -1
  229. package/dist/main-app-mode.d.ts.map +1 -1
  230. package/dist/main-app-mode.js +3 -2
  231. package/dist/main-app-mode.js.map +1 -1
  232. package/dist/main.d.ts.map +1 -1
  233. package/dist/main.js +1 -1
  234. package/dist/main.js.map +1 -1
  235. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  236. package/dist/modes/interactive/components/tree-selector-content.js +6 -0
  237. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  238. package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
  239. package/dist/modes/interactive/components/tree-selector-model.js +1 -0
  240. package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
  241. package/dist/modes/interactive/interactive-agent-events.js +17 -1
  242. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  243. package/dist/modes/interactive/interactive-mode-helpers.d.ts +1 -0
  244. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  245. package/dist/modes/interactive/interactive-mode-helpers.js +16 -0
  246. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  247. package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
  248. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  249. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  250. package/dist/modes/interactive/interactive-process-lifecycle.js +13 -1
  251. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  252. package/dist/modes/interactive/interactive-session-runtime.js +5 -1
  253. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  254. package/dist/utils/mime.js +1 -1
  255. package/dist/utils/mime.js.map +1 -1
  256. package/dist/utils/tool-result-images.d.ts +3 -1
  257. package/dist/utils/tool-result-images.d.ts.map +1 -1
  258. package/dist/utils/tool-result-images.js +4 -1
  259. package/dist/utils/tool-result-images.js.map +1 -1
  260. package/docs/compaction.md +5 -1
  261. package/docs/computer-use.md +105 -56
  262. package/docs/extensions/events.md +75 -7
  263. package/docs/extensions.md +6 -2
  264. package/docs/getting-started/first-session.md +1 -0
  265. package/docs/intercom/operations.md +13 -1
  266. package/docs/intercom.md +1 -1
  267. package/docs/models/evals.md +68 -82
  268. package/docs/models/reference.md +30 -2
  269. package/docs/packages.md +2 -0
  270. package/docs/prompt-templates.md +1 -0
  271. package/docs/providers.md +8 -2
  272. package/docs/sdk/reference.md +1 -2
  273. package/docs/sdk/structured-decisions.md +10 -9
  274. package/docs/sdk.md +13 -2
  275. package/docs/session-format.md +17 -2
  276. package/docs/settings.md +1 -1
  277. package/docs/skills.md +3 -1
  278. package/docs/subagents/reference.md +4 -4
  279. package/docs/subagents.md +1 -1
  280. package/docs/workflows/api-reference.md +2 -0
  281. package/docs/workflows/authoring.md +191 -0
  282. package/docs/workflows/operations.md +9 -3
  283. package/docs/workflows/verification.md +21 -8
  284. package/npm-shrinkwrap.json +69 -69
  285. package/package.json +8 -8
@@ -9,7 +9,7 @@ Atomic can work in applications, not just edit code. Computer-use automation, or
9
9
 
10
10
  This guide explains tool selection, setup, and safe operation. To test a software change and attach the results to a PR, see [Verification and evidence](/workflows/verification).
11
11
 
12
- Jump to [application scripting](#application-scripting-and-apis), [desktop CUA](#desktop-automation-with-pyautogui-and-uv), [browser automation](#browser-automation-with-agent-browser), [terminal automation](#terminal-automation-with-herdr), or [creative workflows](#creative-work-and-cua-workflows). Platform setup: [macOS](#macos), [Linux](#linux), [Windows](#windows).
12
+ Jump to [application scripting](#application-scripting-and-apis), [desktop CUA](#desktop-automation-with-cua-driver), [browser automation](#browser-automation-with-agent-browser), [terminal automation](#terminal-automation-with-herdr), or [creative workflows](#creative-work-and-cua-workflows). Platform setup: [macOS](#macos), [Linux](#linux), [Windows](#windows).
13
13
 
14
14
  ## Choose the right tool
15
15
 
@@ -19,12 +19,12 @@ Start with the result you need, not the application you could click through. If
19
19
  | --- | --- | --- |
20
20
  | Create or edit files, such as presentations, documents, spreadsheets, or media | **A file library or CLI** | Use an app API or UI when the library cannot preserve required features, or when you need rendering or visual adjustments. |
21
21
  | Interactive terminal or TUI | **Herdr** | Use tmux on macOS/Linux or native Windows psmux when Herdr cannot be used. Ordinary shell commands need no multiplexer. |
22
- | Browser page or web application | **agent-browser** | Use desktop CUA for browser chrome or OS dialogs that browser automation cannot reach. Keep existing browser test suites for repeatable tests. |
23
- | Desktop application or work across apps | **PyAutoGUI, run with uv** | Use native accessibility tools, application scripting, or a CLI when they make the task easier, safer, or more reliable. |
22
+ | Website or web app in Chrome/Chromium, Electron desktop app (VS Code, Slack, Discord, Figma, Notion, Spotify), Slack workspace, or cloud browser | **agent-browser** | This is the scope the `agent-browser` skill covers. Use Cua Driver for browser chrome, OS dialogs and permission prompts, non-Chromium browsers, or anything else agent-browser cannot reach. Keep existing browser test suites for repeatable tests. |
23
+ | Native desktop application, iOS simulator, Android emulator, work across apps, or any agent-browser limitation | **Cua Driver**: the `cua-driver` CLI through the bundled `cua-driver` skill when a model chooses each action; the `@trycua/cua-driver` TypeScript SDK inside `ctx.tool` when workflow code owns the scenario | Use application scripting or a CLI when they make the task easier, safer, or more reliable. |
24
24
 
25
- You can combine tools without driving the whole task through a desktop. Generate a presentation with `python-pptx`, then inspect rendered slides for layout problems. Use Blender's Python API to generate repeated objects, then PyAutoGUI for adjustments in the visible editor. Use browser DOM controls rather than desktop clicks for a web form. For a supported web-service operation that does not require browser interaction, an authorized API request may be enough.
25
+ You can combine tools without driving the whole task through a desktop. Generate a presentation with `python-pptx`, then inspect rendered slides for layout problems. Use Blender's Python API to generate repeated objects, then Cua Driver for adjustments in the visible editor. Use browser DOM controls rather than desktop clicks for a web form. For a supported web-service operation that does not require browser interaction, an authorized API request may be enough.
26
26
 
27
- Atomic's skills supply operating instructions, not an installed desktop or automatic permission to control one. Load the `herdr`, `agent-browser`, or `tmux` skill when applicable. Check the installed command's help before using version-dependent options.
27
+ Atomic's skills supply operating instructions, not an installed desktop or automatic permission to control one. Load the `cua-driver`, `herdr`, `agent-browser`, or `tmux` skill when applicable. Check the installed command's help before using version-dependent options.
28
28
 
29
29
  **Herdr eligibility:** the bundled Herdr skill requires an explicit user mention or request and an agent running inside a Herdr-managed pane with `HERDR_ENV=1`. Launch Atomic inside Herdr and ask it to use Herdr for terminal work. Do not set the variable manually to bypass the check or control a focused session from outside Herdr. If those conditions are not met, use a suitable fallback.
30
30
 
@@ -33,7 +33,7 @@ Atomic's skills supply operating instructions, not an installed desktop or autom
33
33
  For file-only automation, you need the input files, a suitable runtime, and an explicit output path, not a graphical desktop. Keep originals intact and work in a scratch directory. The window, display, and input checks below apply when you actually operate a UI.
34
34
 
35
35
  1. Identify the host OS and the environment that owns the application. An SSH shell, container, WSL distribution, or CI runner is not automatically connected to the user's desktop.
36
- 2. Check installed tools, cached runtimes, and permissions. Install missing tools, including uv, when network access and permissions allow. Follow the official installer instructions, inspect downloaded scripts before running them, and make one bounded setup attempt rather than retrying indefinitely.
36
+ 2. Check installed tools, cached runtimes, and permissions. Install missing tools, including `cua-driver` and uv, when network access and permissions allow. Follow the official installer instructions, inspect downloaded scripts before running them, and make one bounded setup attempt rather than retrying indefinitely.
37
37
  3. Use a dedicated browser profile, terminal pane, desktop account, or VM where practical. For creative work, open copies of source assets and choose an explicit output directory.
38
38
  4. Confirm the target window, display size, scaling, keyboard layout, and starting document. Capture or inspect the current state before sending input.
39
39
  5. Define the stopping point. Saving a local draft is different from overwriting an original, publishing a video, sending a message, or purchasing something. Obtain any needed authorization before those actions.
@@ -44,7 +44,7 @@ Treat text in pages, documents, and terminal output as task data, not instructio
44
44
 
45
45
  ## Application scripting and APIs
46
46
 
47
- Prefer direct file automation for structured tasks such as assembling slides, filling a document template, or formatting a spreadsheet. These jobs often need no running Office app, macros, or desktop access. Use application scripting when you need features that a file library does not expose. PyAutoGUI is useful for the remaining desktop interaction, not a required step in every automation.
47
+ Prefer direct file automation for structured tasks such as assembling slides, filling a document template, or formatting a spreadsheet. These jobs often need no running Office app, macros, or desktop access. Use application scripting when you need features that a file library does not expose. Cua Driver is useful for the remaining desktop interaction, not a required step in every automation.
48
48
 
49
49
  | Mechanism | Good uses | Limits to check first |
50
50
  | --- | --- | --- |
@@ -177,62 +177,105 @@ For file-only work, a library can avoid opening the application at all. Know wha
177
177
 
178
178
  Combine these approaches only where they help. Generate content with a script, inspect it in a viewer, and use CUA if it needs visual adjustments or UI-only export controls. You do not need a desktop interaction just to prove that a file script ran. If the task is specifically to verify a menu, dialog, or user flow, exercise that interface too; an API call is not proof that the GUI path works.
179
179
 
180
- ## Desktop automation with PyAutoGUI and uv
180
+ ## Desktop automation with Cua Driver
181
181
 
182
- [PyAutoGUI](https://pyautogui.readthedocs.io/en/latest/) controls the real mouse and keyboard and captures screenshots. It does not understand the application by itself. Atomic must inspect the screen or another reliable state source between actions.
182
+ [Cua Driver](https://github.com/trycua/cua/tree/main/libs/cua-driver) targets an exact application window rather than the shared cursor. One `get_window_state` call returns the window's accessibility tree and a screenshot; actions are delivered through snapshot-bound element tokens in the background by default, and the result reports `degraded` or `truncated` state so a scenario can refuse to act on a bad observation. Verification is snapshot, act, fresh snapshot, then a postcondition check, not a picture of a click.
183
183
 
184
- Prefer [uv](https://docs.astral.sh/uv/) to manage Python and the script's dependencies. If `uv --version` fails because uv is missing, install it using the instructions for your OS below. An existing Python environment is a fallback when uv installation is blocked, not a reason to change an unrelated repository's dependencies.
184
+ The bundled `cua-driver` skill carries the driving loop and the per-platform notes. For anything it does not cover, such as the full tool reference, SDK API, permissions model, or process model, read the upstream documentation: the [Cua docs index](https://cua.ai/docs/llms.txt) lists every page as a plain-text URL, so an agent can fetch the one it needs, for example the [process model](https://cua.ai/docs/reference/cua-driver/process-model.md), [macOS permissions](https://cua.ai/docs/reference/cua-driver/macos-permissions.md), [telemetry](https://cua.ai/docs/reference/cua-driver/telemetry.md), and [SDK reference](https://cua.ai/docs/reference/cua-driver/sdk-reference.md).
185
185
 
186
- ### Run an isolated script
186
+ Atomic uses Cua Driver through two faces of one typed surface. Choose by who decides the next action:
187
187
 
188
- Save the following as `desktop_probe.py` in a scratch directory. It takes a screenshot and reports geometry without clicking or typing:
188
+ | Situation | Face | Why |
189
+ | --- | --- | --- |
190
+ | A language model chooses each action: an interactive session driving, inspecting, or automating a desktop app, simulator, or emulator window, or any workflow stage acting outside `ctx.tool` | `cua-driver` CLI through the bundled `cua-driver` skill | The model decides turn by turn; the skill's loop is written for one-shot `cua-driver call <tool>` commands, and the evidence is the JSON results and `screenshot_out_file` images it saves. |
191
+ | A custom workflow's TypeScript owns the scenario and its postcondition, run inside `ctx.tool(name, args, fn, { timeoutMs })` | `@trycua/cua-driver` TypeScript SDK | Code owns the sequence; the result is durably checkpointed and replayed on resume. |
189
192
 
190
- ```python
191
- from pathlib import Path
193
+ The rule of thumb: **when a model chooses the next action, use the CLI; when TypeScript code owns the sequence and the postcondition, use the SDK.** Prefer [agent-browser](#browser-automation-with-agent-browser) for what its skill covers: websites and web apps in Chrome/Chromium, Electron desktop apps, Slack, and cloud browsers. Use Cua Driver for everything else, including iOS simulators, Android emulators, OS dialogs, and non-Chromium browsers, and whenever agent-browser hits a limitation. Terminals stay with [Herdr](#terminal-automation-with-herdr), falling back to tmux or psmux. Both faces share tool names (`list_apps`, `list_windows`, `get_window_state`, `click`, `type_text`, and the rest), so a scenario worked out interactively translates directly into code.
194
+
195
+ The bundled `cua-driver` skill is the upstream skill, vendored verbatim, and is the only place the driving loop is described. Do not run `cua-driver skills install`: it links the skill into `~/.agents/skills`, `~/.claude/skills`, and similar directories that Atomic does not own. The bundled copy is the skill.
196
+
197
+ ### Install if missing
192
198
 
193
- import pyautogui as gui
199
+ Check `cua-driver --version`. If the executable is missing, make **one bounded attempt** with upstream's one-line installer for the host. It needs no administrator access:
194
200
 
195
- gui.FAILSAFE = True
196
- gui.PAUSE = 0.25
201
+ ```sh
202
+ # macOS (14 Sonoma or later) and Linux
203
+ /bin/bash -c "$(curl -fsSL https://cua.ai/driver/install.sh)"
204
+ ```
197
205
 
198
- output = Path("artifacts")
199
- output.mkdir(exist_ok=True)
200
- print(f"Screen: {gui.size()}; pointer: {gui.position()}")
201
- gui.screenshot().save(output / "desktop-before.png")
206
+ ```powershell
207
+ # Windows PowerShell
208
+ irm https://cua.ai/driver/install.ps1 | iex
202
209
  ```
203
210
 
204
- Run it from that directory:
211
+ Report what the installer did. On macOS it places `CuaDriver.app` in `/Applications`, creates the `~/.local/bin/cua-driver` symlink, and appends an `export PATH=…` line to your `zsh`, `bash`, or `fish` rc file when `~/.local/bin` is not already on `PATH`; open a new shell or source the rc file before retrying `cua-driver --version`. On Linux it downloads into `~/.cua-driver/packages/releases/` and creates the same symlink; a minimal image may first need `sudo apt install libxi6 at-spi2-core`. On Windows it installs under `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin`, appends that directory to the user `Path`, and registers a `cua-driver-serve` autostart task when the session is interactive.
212
+
213
+ Never loop on the installer. In a workflow stage, a refused or failed install is reported as `blocked`/`needs_human` together with the exact installer command above, not worked around with an alternative tool.
214
+
215
+ If the installed driver is older than the bundled skill's `version` (`0.28.2`), run `cua-driver update --apply` once and restart the daemon with the platform's startup command below. If it is newer, proceed and note the skew in the report. `cua-driver check-update` only checks; it changes nothing.
216
+
217
+ ### Turn telemetry off
218
+
219
+ Cua Driver sends content-free, pseudonymous product telemetry to PostHog **by default, from every face**: the CLI, the daemon, the MCP server, and the Python and TypeScript SDKs. It is keyed by a persisted installation UUID, so it is pseudonymous rather than anonymous. Atomic's guidance turns it off before the first driver call on every path; it does not claim the driver is telemetry-free.
220
+
221
+ - **Every invocation.** Run every `cua-driver` command, every SDK scenario, and every `ctx.tool` child process with `CUA_DRIVER_RS_TELEMETRY_ENABLED=false` in the environment. The environment override takes precedence over any saved preference and needs no executable, so it is the control Atomic standardizes on.
222
+ - **After an executable install.** Additionally run `cua-driver telemetry disable` once, so the preference persists for daemon-owned sessions Atomic does not spawn (on macOS the daemon is launched through `open`, which does not inherit the agent's shell environment). Confirm with `cua-driver telemetry status --json`.
223
+ - Never post the installation UUID from `telemetry status` in an issue, an evidence artifact, or a transcript.
224
+
225
+ The startup update check is separate from telemetry. It carries no installation ID or usage data, fires only on `mcp`, `serve`, and `doctor` with a 20-hour cache, and is how you learn that `cua-driver update --apply` is warranted. Atomic leaves it at the upstream default. If you want the GitHub request gone, set `CUA_DRIVER_RS_UPDATE_CHECK=false` for one invocation, or run `cua-driver config set update_check_enabled false` to persist it.
226
+
227
+ ### Check readiness
228
+
229
+ A version string verifies the binary, not desktop access. Before the first action:
205
230
 
206
231
  ```sh
207
- uv run --no-project --with pyautogui --with pillow python desktop_probe.py
232
+ export CUA_DRIVER_RS_TELEMETRY_ENABLED=false
233
+ cua-driver status # the daemon is running
234
+ cua-driver doctor # session, display, accessibility bus, telemetry setup
235
+ cua-driver call list_apps # a GUI app you recognize appears
208
236
  ```
209
237
 
210
- `--no-project` avoids discovering or syncing an unrelated Python project. uv can download a Python runtime and dependencies if needed, so this first run may require network access. OS screenshot and accessibility dependencies still need separate setup. For a reusable script, declare dependencies in [inline script metadata](https://docs.astral.sh/uv/guides/scripts/#declaring-script-dependencies), pin versions, and use uv's script locking support. Keep scratch environments and captures out of the application's repository unless they belong in the deliverable.
238
+ `cua-driver call <tool>` is call-owned: it connects to the running daemon, prints one result, and exits. When no daemon is reachable it fails rather than executing in the CLI process, so a stopped daemon looks like a failed call. `list-tools`, `describe <tool>`, and `dump-docs` read the tool inventory without a runtime.
211
239
 
212
- Open the captured image and confirm it shows the intended desktop. A successful import is not proof that screenshots or input work. Test a harmless action in a disposable document before running a longer sequence.
240
+ - **macOS.** Start a stopped daemon with `open -n -g -a CuaDriver --args serve`, never with a bare `cua-driver serve` from a terminal: LaunchServices attributes the process to `CuaDriver.app` (`com.trycua.driver`), so the Accessibility and Screen Recording grants attach to the app and survive upgrades, while a terminal-launched daemon is attributed to the terminal app. Then run `cua-driver permissions status`; it reads the daemon's grants and reports `unknown` when no daemon is running. To grant, run `cua-driver permissions grant`, then toggle CuaDriver on under System Settings → Privacy & Security → Accessibility and under Screen & System Audio Recording. The prompt only registers the app; the toggle grants. macOS does not always raise both prompts in one pass, so rerun the pair and relaunch the daemon afterwards.
241
+ - **Windows.** The daemon must run in the interactive user session; Session 0 cannot see the desktop. If the autostart task was not registered, run `cua-driver serve` in an interactive desktop terminal and use a second terminal for the checks. Standard-user automation cannot drive elevated apps or the UAC secure desktop.
242
+ - **Linux.** Require a graphical X11 or XWayland session with `DISPLAY` set and AT-SPI available, and run `cua-driver serve` in the foreground inside that session. Native Wayland is opt-in with `CUA_DRIVER_RS_ENABLE_WAYLAND=1` and has compositor-specific limits; do not claim full Wayland support.
213
243
 
214
- ### Observe, act, and check
244
+ A missing macOS Accessibility or Screen Recording grant, a non-interactive Windows session, or no graphical Linux session is a `blocked`/`needs_human` finding in a workflow stage. Report the exact fix from the list above and re-run the readiness check on resume. Let the user grant permissions; do not script around consent dialogs.
245
+
246
+ ### Drive a window from the shell
247
+
248
+ Load the `cua-driver` skill and follow its loop. The shape, with `CUA_DRIVER_RS_TELEMETRY_ENABLED=false` exported as above, is:
249
+
250
+ ```sh
251
+ cua-driver call list_apps
252
+ cua-driver call list_windows '{"pid":844}'
253
+ cua-driver call get_window_state '{"pid":844,"window_id":10725,"screenshot_out_file":"artifacts/before.png"}' > artifacts/before.json
254
+ # Pick one element_token from before.json, then act on it in the background.
255
+ cua-driver call click '{"pid":844,"element_token":"s0000002a:14"}'
256
+ cua-driver call get_window_state '{"pid":844,"window_id":10725,"screenshot_out_file":"artifacts/after.png"}' > artifacts/after.json
257
+ ```
215
258
 
216
- - Use short action sequences. Inspect the result after opening a menu, changing focus, or switching applications.
217
- - Prefer named accessibility controls or application APIs where available. If using coordinates, derive them from the current screen rather than an old screenshot.
218
- - Keep the target on the primary monitor. PyAutoGUI's multi-monitor support is limited. Retina and DPI scaling can make screenshot pixels differ from input coordinates; compare screenshot dimensions with `gui.size()` before clicking.
219
- - `gui.write()` sends keystrokes to the focused window and is not a general Unicode text-insertion API. For non-ASCII content, prefer app scripting or a controlled clipboard paste. Clipboard contents may be sensitive, so preserve and restore them when appropriate.
220
- - For image matching, crop to the relevant region and use fixtures from the same theme and scaling. Handle a missing image as a failed observation, not a reason to click a default location. PyAutoGUI's `confidence` option requires OpenCV in the Python environment.
221
- - Wait for an observable result with a deadline. A fixed sleep alone does not prove a render, export, or save has finished.
259
+ Replace the pid, window id, and token with values read from your own output; tokens are bound to the snapshot that produced them and must be re-read after any UI change. Check the postcondition in `after.json` with a bounded poll deadline, never a fixed sleep and never a repeated click. A `degraded` or `truncated` snapshot is a reason to stop and re-observe, and a refused background action is an escalation signal, not something to retry. Foreground delivery is an explicit escalation. Keep the JSON results and the `screenshot_out_file` images as evidence. When the work ends in a PR, attach the before/after PNGs to the PR body (`gh pr create --body-file body.md --attach 'before.png#Before' --attach 'after.png#After'` on supported GitHub) next to the scenario they prove, and cite the JSON by name as a local artifact; see [Verification and evidence](/workflows/verification#native-github-media).
222
260
 
223
- See PyAutoGUI's [keyboard controls](https://pyautogui.readthedocs.io/en/latest/keyboard.html), [mouse controls](https://pyautogui.readthedocs.io/en/latest/mouse.html), and [screenshot functions](https://pyautogui.readthedocs.io/en/latest/screenshot.html) for API details.
261
+ ### Run a scenario from workflow code
224
262
 
225
- ### Stop and recover safely
263
+ When a custom workflow owns the scenario, use the `@trycua/cua-driver` TypeScript SDK inside `ctx.tool` so the observe → act → re-observe → assert loop is a durable, replayable node. The [workflow authoring guide](/workflows/authoring#desktop-verification-with-cua-driver-in-ctx-tool) has the runnable example; the summary is:
226
264
 
227
- Keep `FAILSAFE` enabled and leave a pause between calls. Moving the pointer to a corner of the primary monitor causes a subsequent PyAutoGUI call to raise `FailSafeException`. Keep a separate way to interrupt the automation process available too.
265
+ - **Prerequisite.** `node` (preferred) or `bun` on the host. If neither is present, install one in a bounded attempt (Node via [fnm](https://github.com/Schniz/fnm) with `fnm install --lts` or the host's package manager, Bun via `curl -fsSL https://bun.sh/install | bash`) and report what the installer did; if the install is refused or fails, report that as the limitation rather than retrying.
266
+ - **Install.** `npm install @trycua/cua-driver@<exact pin matching cua-driver --version>` into a scratch directory outside the user's repository, one bounded attempt. The package ships per-platform native optional dependencies, so it is self-contained. Pin the exact driver version: daemon-backed clients verify contract, tool-schema, capability, and protocol versions before each action and refuse on mismatch.
267
+ - **Acquire the driver.** When `cua-driver status` reports a running daemon, use `CuaDriver.connect()` so the scenario reuses the daemon's permission identity (on macOS, `CuaDriver.app`'s grants) and the persisted telemetry-off preference; upstream describes `connect()` as a compatibility and app-hosting path, and that is exactly the role it plays here. Only when no daemon is reachable, fall back to `CuaDriver.create()`, which loads the runtime into the node process. On macOS that in-process fallback attributes Accessibility and Screen Recording to the node host, normally the terminal app, as a **separate grant**; `checkPermissions` is then read-only, and the host must fully quit and relaunch after granting.
268
+ - **Telemetry.** Set `CUA_DRIVER_RS_TELEMETRY_ENABLED=false` in the child environment before constructing the driver.
269
+ - **Loop.** `listApps` → `listWindows` → `getWindowState` (refuse `degraded`/`truncated`) → resolve exactly one element → act by `elementToken` with `InputDeliveryMode.Background` → `getWindowState` again → bounded-poll the postcondition. `shutdown()` in `finally`, then `uniffiDestroy()` when present.
270
+ - **Result.** Machine-readable `verified` / `refuted` / `blocked` / `unknown`; the wrapper maps anything but `verified` to a nonzero outcome. An action that times out before its response is `unknown`, resolved by the postcondition, never by replaying the mutation.
228
271
 
229
- Prefer complete actions such as `press`, `hotkey`, and `click` over holding input across several steps. If a script must hold a key or mouse button, track what it holds and release it in cleanup. An interrupt or failsafe can itself prevent PyAutoGUI cleanup calls. Stop the script, check for held input, and release it manually or through a safe native mechanism before resuming. Do not disable the failsafe in order to keep clicking.
272
+ ### Stay safe
230
273
 
231
- After a timeout or interruption, inspect the current document and any output files. A save or export may have completed even if its acknowledgement was lost. Do not repeat destructive actions blindly.
274
+ One controller owns a desktop at a time. Use a dedicated session or account where practical, keep unrelated windows out of captures, and define an explicit stopping point before destructive or publishing actions such as overwriting an original, sending a message, or purchasing. After a timeout or interruption, inspect the current document and any output files before acting again; a save or export may have completed even if its acknowledgement was lost. Never disable OS security controls to make automation work.
232
275
 
233
276
  ## Browser automation with agent-browser
234
277
 
235
- For tasks that require browser interaction, prefer [agent-browser](https://github.com/vercel-labs/agent-browser) for websites and web apps on all three desktop platforms. Its accessibility-tree snapshots expose page structure and element references, so automation can use actual controls rather than screen coordinates. For data retrieval or batch operations, consider a supported API first when it meets the request and you have permission to use it.
278
+ Prefer [agent-browser](https://github.com/vercel-labs/agent-browser) for what its skill covers: websites and web apps in Chrome/Chromium on all three desktop platforms, Electron desktop apps (`agent-browser skills get electron`), Slack workspaces, and cloud browsers. Anything outside that scope, or a limitation you hit inside it, goes to [Cua Driver](#desktop-automation-with-cua-driver). Its accessibility-tree snapshots expose page structure and element references, so automation can use actual controls rather than screen coordinates. For data retrieval or batch operations, consider a supported API first when it meets the request and you have permission to use it.
236
279
 
237
280
  ### Setup and first session
238
281
 
@@ -265,6 +308,7 @@ For a real task, act between the snapshot and final capture. Read element refere
265
308
  - Inspect visible results and relevant console/network output (`agent-browser console`, `agent-browser errors`, `agent-browser network requests`). Keep semantic locators and assertions in a maintained browser test suite for repeatable regression coverage.
266
309
  - Use the CLI's file-upload support for supported file inputs rather than driving an OS file picker. Switch to CUA or native tooling only for UI outside the page, and then recheck focus before returning to browser control.
267
310
  - Treat cookies, saved authentication state, and network logs as sensitive. Do not commit or attach a browser profile as evidence.
311
+ - Keep `screenshot` PNGs and `record` recordings from the verified flow; when the work ends in a PR, attach them to the PR body with `gh pr create --attach` on supported GitHub, each next to the scenario it proves. See [Verification and evidence](/workflows/verification#native-github-media).
268
312
  - Browser mobile emulation tests a web viewport, not a native Android or iOS application.
269
313
 
270
314
  For verification captures and recordings, see [browser evidence](/workflows/verification#browser-changes).
@@ -326,11 +370,12 @@ For modified-key setup in Atomic, see [tmux setup](/tmux). For behavioral checks
326
370
 
327
371
  ### Desktop and native tools
328
372
 
329
- - Install missing uv with `brew install uv` when Homebrew is available, or use the reviewed macOS installer from [uv installation](https://docs.astral.sh/uv/getting-started/installation/). Confirm `uv --version` in the launching shell.
330
- - Allow the application launching automation, such as Terminal or your IDE, in System Settings > Privacy & Security > Accessibility. Screenshot capture also needs Screen Recording permission, which may be labelled Screen & System Audio Recording on newer macOS versions. Relaunch the affected app if macOS requests it.
373
+ - Install a missing `cua-driver` with the [one-line installer](#install-if-missing) (macOS 14 Sonoma or later), run `cua-driver telemetry disable` once, and open a new shell so `~/.local/bin` is on `PATH`. Install missing uv with `brew install uv` when Homebrew is available, or use the reviewed macOS installer from [uv installation](https://docs.astral.sh/uv/getting-started/installation/).
374
+ - The daemon is `CuaDriver.app`. Start it with `open -n -g -a CuaDriver --args serve` so macOS attributes the process, and its Accessibility and Screen Recording grants, to `com.trycua.driver` rather than to Terminal or your IDE. A daemon started from a terminal is the right binary with the wrong privacy identity.
375
+ - Grant with `cua-driver permissions grant`, then toggle CuaDriver on under System Settings > Privacy & Security > Accessibility and under Screen & System Audio Recording, and relaunch the daemon. Confirm with `cua-driver permissions status`. If CuaDriver is missing from either list, click **+** and add `/Applications/CuaDriver.app`.
376
+ - An in-process `CuaDriver.create()` runtime is attributed to the node host that imported it, normally the terminal app. That is a separate grant from the app's, `checkPermissions` is read-only there, and the host must fully quit and relaunch after a change.
331
377
  - AppleScript automation may also prompt for Automation permission to control another app. Let the user grant permissions; do not script around consent dialogs.
332
- - PyAutoGUI depends on native Python bindings on macOS. If import or capture fails, check the installed release's [installation requirements](https://pyautogui.readthedocs.io/en/latest/install.html) before adding dependencies to the uv environment.
333
- - Check Retina scaling and keep the target on the primary display. A black or incomplete capture usually needs permission or display troubleshooting, not more clicks.
378
+ - Window screenshots use the window's own coordinate space and report their scale factor; act by element token where possible and read dimensions from the same snapshot before any pixel action. A black or incomplete capture usually needs permission or display troubleshooting, not more clicks.
334
379
 
335
380
  Use `osascript` for AppleScript or JavaScript for Automation when an app's scripting dictionary exposes the operation you need. See [application scripting and recipes](#application-scripting-and-apis) for a runnable example and Office automation choices. `System Events` UI scripting and native accessibility APIs can address menus and controls more reliably than coordinates; consult Apple's [UI scripting guide](https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/AutomatetheUserInterface.html).
336
381
 
@@ -346,11 +391,10 @@ Herdr is the first choice for interactive terminals when eligible. Homebrew prov
346
391
 
347
392
  ### Desktop and native tools
348
393
 
349
- - Install missing uv through the [official Linux installer](https://docs.astral.sh/uv/getting-started/installation/) or an available distribution package. Review the installer before executing it, then confirm `uv --version`.
350
- - PyAutoGUI's Linux input backend uses X11. Run in an accessible graphical X11 session with the correct `DISPLAY` and authorization. Installing Python packages does not create a desktop session.
351
- - Check the distribution's screenshot and Python support packages. PyAutoGUI documents `scrot` and Python Tk/development packages for Linux; the required capture backend varies with the installed Pillow/PyScreeze versions. Use the distribution package manager with permission, not guessed cross-distribution commands.
352
- - A Wayland session is not equivalent to X11. XWayland does not grant access to every native Wayland app. Prefer compositor-supported capture/input tools, desktop portals, or native accessibility APIs when they support the operation. Do not weaken session security or claim PyAutoGUI has full Wayland support.
353
- - For unattended X11 work, a dedicated virtual display such as Xvfb can be useful. It does not prove behavior on a real Wayland desktop, GPU configuration, or physical display. Creative applications may require working graphics acceleration.
394
+ - Install a missing `cua-driver` with the [one-line installer](#install-if-missing); a minimal image may first need `sudo apt install libxi6 at-spi2-core`. Run `cua-driver telemetry disable` once and open a new shell so `~/.local/bin` is on `PATH`. Install missing uv through the [official Linux installer](https://docs.astral.sh/uv/getting-started/installation/) or an available distribution package.
395
+ - Installing the binary does not start the daemon or create a desktop session. Run `cua-driver serve` in the foreground in a terminal inside the graphical session that owns the apps, with the same `DISPLAY` and AT-SPI session bus, and run `cua-driver doctor` from a second terminal in that session.
396
+ - X11 and XWayland are the supported routes by default; toolkit-specific limits apply. Native Wayland is opt-in with `CUA_DRIVER_RS_ENABLE_WAYLAND=1` and depends on the compositor. Do not weaken session security or claim full Wayland support.
397
+ - For unattended X11 work, a dedicated virtual display such as Xvfb with a desktop session (for example `xfce4`) can be useful. It does not prove behavior on a real Wayland desktop, GPU configuration, or physical display. Creative applications may require working graphics acceleration.
354
398
 
355
399
  [AT-SPI](https://gnome.pages.gitlab.gnome.org/at-spi2-core/) can expose named controls in accessible applications. `xdotool` and `wmctrl` can help with focus and window placement on X11; they are not general Wayland replacements. On Wayland, choose tools for the actual compositor and inspect their permission requirements. Use app APIs where custom canvases do not expose useful accessibility controls.
356
400
 
@@ -366,13 +410,14 @@ Herdr is preferred when eligible; tmux is a practical fallback on local or remot
366
410
 
367
411
  ### Desktop and native tools
368
412
 
369
- - Install missing uv with `winget install --id=astral-sh.uv -e` or use the reviewed PowerShell installer from [uv installation](https://docs.astral.sh/uv/getting-started/installation/). Open a new shell if PATH changed, then run `uv --version`.
370
- - Run PyAutoGUI and uv in the Windows graphical session that owns the app. Running them inside WSL does not automatically control native Windows windows.
413
+ - Install a missing `cua-driver` with the [PowerShell one-liner](#install-if-missing) and run `cua-driver telemetry disable` once. Open a new shell if `Path` changed, then run `cua-driver --version`. Install missing uv with `winget install --id=astral-sh.uv -e` or use the reviewed PowerShell installer from [uv installation](https://docs.astral.sh/uv/getting-started/installation/).
414
+ - The daemon must run in the interactive user session (Session 1 or later); Session 0 services cannot see the desktop. The installer registers a `cua-driver-serve` autostart task when the session is interactive; otherwise run `cua-driver serve` in an interactive desktop terminal and use a second terminal for the checks.
415
+ - Run `cua-driver` in the Windows graphical session that owns the app. Running it inside WSL does not control native Windows windows.
371
416
  - Keep the session unlocked and available during automation. A disconnected or minimized Remote Desktop session can change rendering or input behavior; verify the actual remote-session setup before relying on it.
372
417
  - Use a consistent display scale and primary monitor. Check coordinates again after moving a window between displays with different DPI settings.
373
418
  - Standard-user automation cannot reliably drive elevated apps or the UAC secure desktop. Stop for the user or choose an authorized non-elevated path rather than escalating just to force input through.
374
419
 
375
- [Windows UI Automation](https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-overview) exposes controls by name and automation ID. Tools such as [pywinauto](https://pywinauto.readthedocs.io/en/latest/) can be easier than pixel matching for accessible Windows apps. For structured document operations, start with [file libraries and app scripting](#application-scripting-and-apis). Use PyAutoGUI for the remaining visual interactions.
420
+ [Windows UI Automation](https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-overview) exposes controls by name and automation ID. Cua Driver reads that UIA tree in `get_window_state` and acts on it in the background, so prefer element tokens over pixel matching for accessible Windows apps. For structured document operations, start with [file libraries and app scripting](#application-scripting-and-apis). Use Cua Driver for the remaining visual interactions.
376
421
 
377
422
  Snipping Tool or OBS can capture desktop evidence. Check the selected window and saved recording before sharing it.
378
423
 
@@ -390,22 +435,22 @@ Choose the deliverable first. A library or application API may produce it withou
390
435
 
391
436
  | Task | Practical approach | Useful deliverables |
392
437
  | --- | --- | --- |
393
- | Blender 3D modeling | Use Blender Python for repeatable geometry or scene setup; use PyAutoGUI for visible editor operations and visual inspection. | Editable `.blend` file, exported model if requested, preview render. |
438
+ | Blender 3D modeling | Use Blender Python for repeatable geometry or scene setup; use Cua Driver for visible editor operations and visual inspection. | Editable `.blend` file, exported model if requested, preview render. |
394
439
  | Presentations | Generate structured slides with `python-pptx`, inspect them in a compatible viewer, and use CUA for visual refinements or slideshow interaction when needed. | Editable deck plus PDF or slide previews exported through a compatible application. |
395
440
  | Video editing | Use the editor's scripting API or media CLI for repetitive operations; use CUA to adjust the timeline, inspect transitions, and review playback. | Editable project, required source references, final export. |
396
- | Work across applications | Use native scripting for named windows and file operations; use PyAutoGUI where the task needs visual interaction. | Saved documents and a concise record of completed steps. |
441
+ | Work across applications | Use native scripting for named windows and file operations; use Cua Driver where the task needs visual interaction, addressing each window by pid and window id. | Saved documents and a concise record of completed steps. |
397
442
 
398
443
  Do not substitute a screenshot for the editable project or final export the user requested. Reopen saved files, check missing assets and fonts, and inspect the actual export. For video, check audio and timing as well as a still frame. Keep originals intact and use explicit save paths. Rendering, uploading, or exporting through a paid service may need separate authorization.
399
444
 
400
- When the user specifically wants a CUA workflow, include PyAutoGUI in the stage that operates the desktop. For artifact-only requests, keep script-based work outside the desktop session and omit UI stages that add no useful operation or check. A desktop sequence is:
445
+ When the user specifically wants a CUA workflow, give the stage that operates the desktop the `cua-driver` skill, or put a code-owned scenario in `ctx.tool` with the SDK. For artifact-only requests, keep script-based work outside the desktop session and omit UI stages that add no useful operation or check. A desktop sequence is:
401
446
 
402
447
  1. Prepare assets and confirm the intended application, output formats, and permissions.
403
448
  2. Open the dedicated desktop and inspect its starting state.
404
- 3. Create or edit with PyAutoGUI and suitable native/app APIs, saving checkpoints.
449
+ 3. Create or edit with Cua Driver and suitable native/app APIs, saving checkpoints.
405
450
  4. Reopen and inspect the deliverables, then make bounded corrections if needed.
406
451
  5. Hand off local files. Publish or upload only to an authorized target.
407
452
 
408
- Pass scripts, project files, and artifact paths between stages rather than long click transcripts. Give one stage exclusive desktop ownership and use finite deadlines for renders and exports. Stop on unexpected dialogs, lost focus, missing permissions, or failed observations. On resume, inspect the app and files before repeating an action.
453
+ Pass scripts, project files, and artifact paths between stages rather than long click transcripts. Give one stage exclusive desktop ownership and use finite deadlines for renders and exports. Stop on unexpected dialogs, degraded or truncated snapshots, missing permissions, or failed observations. On resume, inspect the app and files before repeating an action.
409
454
 
410
455
  See [workflow authoring](/workflows/authoring) for stages and human-input gates. Use durable `ctx.tool` calls for workflow-owned external operations, with finite timeouts and cancellation; model stages can use the appropriate automation tools to operate the app. If the user asks to work inline, keep the same safety and deliverable checks without creating a workflow.
411
456
 
@@ -413,7 +458,11 @@ See [workflow authoring](/workflows/authoring) for stages and human-input gates.
413
458
 
414
459
  | Symptom | What to check |
415
460
  | --- | --- |
416
- | uv or another command is missing | Install it when permitted, refresh PATH, and check its version in the same shell that will launch automation. |
461
+ | `cua-driver`, uv, or another command is missing | Install it when permitted with one bounded attempt, refresh PATH, and check its version in the same shell that will launch automation. |
462
+ | `cua-driver call` fails or `permissions status` reports `unknown` | The daemon is not running. Start it with `open -n -g -a CuaDriver --args serve` on macOS, an interactive-session `cua-driver serve` on Windows, or a foreground `cua-driver serve` inside the graphical session on Linux, then rerun `cua-driver status`. |
463
+ | Grants look correct but actions or captures are refused | Stale TCC grants. Toggle CuaDriver off and on under Accessibility and Screen & System Audio Recording, or click **+** and re-add `/Applications/CuaDriver.app`, then fully relaunch the daemon. An in-process SDK runtime needs the node host relaunched instead. |
464
+ | Contract, schema, or protocol mismatch | Version skew between the bundled skill (`0.28.2`), the `@trycua/cua-driver` pin, and `cua-driver --version`. Run `cua-driver update --apply` once, restart the daemon, and reinstall the SDK at the exact driver version. |
465
+ | Snapshot reports `degraded` or `truncated` | Do not act on it. Re-observe, narrow the query, or fall back to a pixel action from the same snapshot only where the skill allows it. |
417
466
  | Black screenshot or no desktop | Check screen permissions, display/session ownership, X11 versus Wayland, and remote-session state. |
418
467
  | Input reaches the wrong app | Stop. Confirm focus, window identity, scaling, and that no other controller shares the desktop. |
419
468
  | Browser element reference no longer works | Take a fresh snapshot and locate the current control. |
@@ -32,7 +32,8 @@ user sends prompt ────────────────────
32
32
  │ ┌─── turn (repeats while LLM calls tools) ───┐ │
33
33
  │ │ │ │
34
34
  │ ├─► turn_start │ │
35
- │ ├─► context (can modify messages) │ │
35
+ │ ├─► context (can modify conversation messages) │
36
+ │ ├─► context_with_system (can modify the full transcript)
36
37
  │ ├─► before_provider_request (can inspect or replace payload)
37
38
  │ ├─► after_provider_response (status + headers, before stream consume)
38
39
  │ │ │ │
@@ -43,10 +44,14 @@ user sends prompt ────────────────────
43
44
  │ │ ├─► tool_result (can modify) │ │
44
45
  │ │ └─► tool_execution_end │ │
45
46
  │ │ │ │
46
- │ ├─► turn_end │ │
47
+ │ ├─► turn_end (can append entries and continue) │
47
48
  │ └─► post-tool threshold preflight │ │
48
49
  │ (may compact before the next provider request) │
49
- └─► agent_end │
50
+ ├─► agent_end │
51
+ ├─► retry backoff or final-attempt recovery (when selected)
52
+ │ └─► fresh agent_start on successful recovery │
53
+ ├─► agent_before_settle (can append entries and continue)│
54
+ └─► agent_settled (final, notification only) │
50
55
  │
51
56
  user sends another prompt ◄────────────────────────────────┘
52
57
 
@@ -302,20 +307,40 @@ Returning `systemPrompt`, or setting `forceSystemPrompt`, replaces the complete
302
307
 
303
308
  Inside `before_agent_start`, `event.systemPrompt` and `ctx.getSystemPrompt()` both reflect the chained system prompt as of the current handler. Later `before_agent_start` handlers can still modify it again.
304
309
 
305
- #### agent_start / agent_end / agent_settled
310
+ #### agent_start / agent_end / agent_before_settle / agent_settled
306
311
 
307
- `agent_start` begins a low-level run. `agent_end` fires when that run ends, but Atomic may still retry, compact and retry, or deliver queued follow-ups. Use `agent_settled` when a status integration needs to know Atomic has no automatic continuation left, including a chain of repeated output-cap continuations. Silence during a provider request or between these runs is not settlement.
312
+ `agent_start` begins a low-level run. `agent_end` fires when that run ends, but Atomic may still retry, compact and retry, or deliver queued follow-ups. `agent_before_settle` is the final actionable boundary: it can append session entries and request one continuation. `agent_settled` is final and notification-only; use it when a status integration needs to know Atomic has no automatic continuation left, including a chain of repeated output-cap continuations. Silence during a provider request or between these runs is not settlement.
308
313
 
309
314
  ```typescript
310
315
  pi.on("agent_start", async (_event, ctx) => {});
311
316
  pi.on("agent_end", async (event, ctx) => {
312
317
  // event.messages - messages from this low-level run
313
318
  });
319
+
320
+ let addedReviewReminder = false;
321
+ pi.on("agent_before_settle", async (event, ctx) => {
322
+ if (addedReviewReminder) return;
323
+ addedReviewReminder = true;
324
+ return {
325
+ entries: [...event.entries, {
326
+ type: "custom_message",
327
+ customType: "review-reminder",
328
+ content: "Review the final diff before replying.",
329
+ display: false,
330
+ }],
331
+ continue: true,
332
+ };
333
+ });
334
+
314
335
  pi.on("agent_settled", async (_event, ctx) => {
315
- // ctx.isIdle() is true unless another extension started a run.
336
+ // ctx.isIdle() is true; runs requested here start after all settled handlers finish.
316
337
  });
317
338
  ```
318
339
 
340
+ If the run is aborted while `agent_before_settle` handlers are running, valid returned entries are still committed, but requested continuation is suppressed. Work requested from `agent_settled` is deferred until every settled handler completes, so notification dispatch is non-reentrant. Input sent from an `agent_before_settle` handler with `deliverAs: "steer"` or `"followUp"` queues for the requested continuation instead of starting a second run.
341
+
342
+ Each provider request is built from the persisted session after every queued handler for the events before it (`agent_start`, `turn_start`, `message_start`, `message_end`, `tool_execution_*`) has finished, because a `message_end` handler may replace the message that gets persisted. Handlers run without blocking the event that triggered them, but a handler that waits for something later in the same run, such as the provider's response, stalls that run; wait in `agent_end` or `agent_settled` instead.
343
+
319
344
  #### ui_prompt_start / ui_prompt_end
320
345
 
321
346
  These notification-only events wrap blocking user-facing prompts. Each event has `reason: "ui_prompt" | "project_trust"`, the prompt `kind`, and the prompt `title` when available. Host and status integrations can use the pair to distinguish waiting for the user from active work.
@@ -349,11 +374,35 @@ pi.on("turn_start", async (event, ctx) => {
349
374
  // event.turnIndex, event.timestamp
350
375
  });
351
376
 
377
+ let replacedResponse = false;
352
378
  pi.on("turn_end", async (event, ctx) => {
353
379
  // event.turnIndex, event.message, event.toolResults
380
+ // event.messageEntryId, event.toolResultEntryIds, event.outcome
381
+ // event.entries contains the structural entries proposed so far.
382
+ if (replacedResponse || event.outcome !== "completed" || event.toolResults.length > 0) return;
383
+ replacedResponse = true;
384
+ return {
385
+ entries: [
386
+ ...event.entries,
387
+ { type: "context_edit", targetId: event.messageEntryId, replacement: null },
388
+ {
389
+ type: "custom_message",
390
+ customType: "replacement-instruction",
391
+ content: "Answer again using the persisted user request.",
392
+ display: false,
393
+ },
394
+ ],
395
+ continue: true,
396
+ };
354
397
  });
355
398
  ```
356
399
 
400
+ `turn_end` runs after the assistant and tool-result messages have been persisted and before the low-level `turn_end` event. Retry backoff and final-attempt recovery still happen after `agent_end`, preserving their existing lifecycle and queue ordering; `agent_before_settle` sees the repaired projection after that work completes. Boundary handlers run in extension load and registration order. Each handler sees prior proposals in `event.entries` and sees `event.context` rebuilt from them (`contextEntries`, `contextMessages`, `llmMessages`, `pendingMessages`, `canContinue`). Returning `entries` or `continue` replaces only that field; omitted fields preserve the current proposal. Allowed draft entry types are `custom`, `custom_message`, `context_edit`, and `compaction` (`summary` is the compacted transcript text; `firstKeptEntryId: null` keeps no preceding entries). The complete proposal is validated before it is appended in list order after all handlers finish; a handler error is reported and later handlers still run. Validation prevents partially applied semantic errors, but persistence is not transactional.
401
+
402
+ `continue: true` ensures one next provider request for that boundary invocation. If tool results, steering, or a follow-up already cause that request, they satisfy the decision and no additional request is made; otherwise Atomic makes one context-only request. Error and aborted responses remain hard exits. `continue: false` never suppresses natural work. Guard continuation conditions: an unconditional `continue: true` is evaluated again after the next response and can create an endless loop. A `custom_message` draft contributes a user-role model message but is extension-authored: it does not run human input hooks, slash commands, skills, or prompt templates.
403
+
404
+ Host integrations that construct `TurnEndEvent` values must provide `messageEntryId`, `toolResultEntryIds`, `outcome`, `entries`, `continue`, and `context`. `ExtensionEvent` exhaustive switches must also handle `agent_before_settle`. `ExtensionRunner.emit()` excludes actionable turn boundaries; dispatch `turn_end` and `agent_before_settle` through `emitBoundary(baseEvent, buildContext)` so handlers receive chained previews.
405
+
357
406
  #### message_start / message_update / message_end
358
407
 
359
408
  Fired for message lifecycle updates.
@@ -419,12 +468,31 @@ Fired before each LLM call. Modify messages non-destructively. See [Session Form
419
468
 
420
469
  ```typescript
421
470
  pi.on("context", async (event, ctx) => {
422
- // event.messages - deep copy, safe to modify
471
+ // event.messages - deep copy without system messages, safe to modify
423
472
  const filtered = event.messages.filter(m => !shouldPrune(m));
424
473
  return { messages: filtered };
425
474
  });
426
475
  ```
427
476
 
477
+ `event.messages` holds the conversation without system messages. The prompt and tool declarations belong to Atomic and are not part of this hook: when the handler returns a changed list (or edits `event.messages` in place), Atomic replays the current prompt sections and tool declarations into one leading system message ahead of the returned messages. Filtering, windowing, or slicing from a compaction boundary therefore cannot drop the prompt or the tools. An unchanged list keeps mid-conversation system messages in place, so models that accept them retain their cached prefix. System messages a handler adds are kept after Atomic's head. To change the prompt or the tool set durably, use [`before_agent_start`](#before_agent_start) or `pi.setActiveTools()`; to edit system messages for one request, use [`context_with_system`](#context_with_system).
478
+
479
+ #### context_with_system
480
+
481
+ Fired before each LLM call, after every `context` handler has run and Atomic has restored the prompt and tool state. `event.messages` is the full transcript, including the leading system message and any mid-conversation prompt or tool patches (see [Session Format](/session-format)). The returned messages are sent as they are: this hook owns the prompt and tool declarations for the request.
482
+
483
+ ```typescript
484
+ import { getCurrentSystemMessage } from "@bastani/pi-ai";
485
+
486
+ pi.on("context_with_system", async (event, ctx) => {
487
+ const cut = findCutIndex(event.messages);
488
+ // Fold the dropped prefix so its prompt and tool state survives as the new head.
489
+ const head = getCurrentSystemMessage(event.messages.slice(0, cut));
490
+ return { messages: head ? [head, ...event.messages.slice(cut)] : event.messages.slice(cut) };
491
+ });
492
+ ```
493
+
494
+ Rules: keep a system message at index 0 (providers read the prompt and initial tool declarations there; Atomic reports an extension error if a handler drops it). Removing a system message removes the tool declarations and section patches it carries. Check your output with `getCurrentSystemPrompt()` and `getCurrentTools()` from `@bastani/pi-ai`. Handlers run in extension load order; a `systemPrompt` forced from `before_agent_start` is still projected onto the request afterwards.
495
+
428
496
  #### before_provider_headers
429
497
 
430
498
  Fires after outgoing HTTP headers are assembled. Mutate `event.headers` to add, override, or remove headers. The event also identifies the provider and model.
@@ -318,9 +318,9 @@ Moved to [Extension events](/extensions/events#agent-events).
318
318
 
319
319
  Moved to [Extension events](/extensions/events#before_agent_start).
320
320
 
321
- #### agent_start / agent_end / agent_settled
321
+ #### agent_start / agent_end / agent_before_settle / agent_settled
322
322
 
323
- Moved to [Extension events](/extensions/events#agent_start-/-agent_end-/-agent_settled).
323
+ Moved to [Extension events](/extensions/events#agent_start-/-agent_end-/-agent_before_settle-/-agent_settled).
324
324
 
325
325
  #### ui_prompt_start / ui_prompt_end
326
326
 
@@ -342,6 +342,10 @@ Moved to [Extension events](/extensions/events#tool_execution_start-/-tool_execu
342
342
 
343
343
  Moved to [Extension events](/extensions/events#context).
344
344
 
345
+ #### context_with_system
346
+
347
+ Moved to [Extension events](/extensions/events#context_with_system).
348
+
345
349
  #### before_provider_headers
346
350
 
347
351
  Moved to [Extension events](/extensions/events#before_provider_headers).
@@ -115,6 +115,7 @@ Skills are reusable expert instructions. Trigger one with `/skill:<name>` follow
115
115
  | `tdd` | Test-first feature or bug work. | `/skill:tdd` |
116
116
  | `impeccable` | Critique or refine web/native frontend and product UI; includes detector hooks, framework-aware live review, and mount-failure recovery. | `/skill:impeccable` |
117
117
  | `agent-browser` | Drive a real browser for end-to-end UI checks, screenshots, and reviewable proof videos. | `/skill:agent-browser` |
118
+ | `cua-driver` | Drive a native desktop app, simulator, or emulator window through Cua Driver: accessibility snapshot, element-token actions, and a fresh snapshot to verify. | `/skill:cua-driver` |
118
119
  | `qlty` | Lint, auto-format, and measure code quality — complexity, duplication, and code smells — through one CLI across the repository's languages. | `/skill:qlty check this branch before I hand it off` |
119
120
  | `liteparse` | Pull text, tables, or values out of PDF, DOCX, PPTX, XLSX, and image files locally. | `/skill:liteparse` |
120
121
  | `show-me` | Explain a topic visually with concise diagrams, code-shape sketches, or focused HTML artifacts. HumanLayer, MIT licensed. | `/skill:show-me` |
@@ -23,7 +23,7 @@ Start with the state you can observe. The existing sections below explain the co
23
23
 
24
24
  ## How Connection Works
25
25
 
26
- Intercom connects when you use its tool, `/intercom`, or ALT+M. Launching an Intercom-enabled subagent may also connect the parent to authorize supervisor communication; the child connects when it needs the channel. Connections are cleaned up when the session closes or is replaced.
26
+ Intercom connects when you use its tool, `/intercom`, or ALT+M. Launching an Intercom-enabled subagent may also connect the parent to authorize supervisor communication. An admitted subagent child connects as soon as its session starts, so it appears in its supervisor's and peers' `intercom list` and can receive `send`/`ask` before it ever uses Intercom itself; if the broker is unavailable at that moment, the child falls back to connecting on its next Intercom use. Connections are cleaned up when the session closes or is replaced.
27
27
 
28
28
  A session becomes intercom-connected when all of these are true:
29
29
 
@@ -41,6 +41,18 @@ Name sessions with `/name` so they can target each other (for example `/name pla
41
41
 
42
42
  If initialization keeps failing, check the reported cause and `~/.atomic/agent/intercom/broker.log` (or the Intercom directory under `ATOMIC_CODING_AGENT_DIR`). Do not automatically resend an operation reported with an unknown delivery outcome; check with the recipient first.
43
43
 
44
+ ### Workflow-stage route refusals
45
+
46
+ When a workflow stage starts, its session registers a live Intercom route with the broker. A refusal names the condition that failed:
47
+
48
+ | Reason | Meaning | Behavior |
49
+ | --- | --- | --- |
50
+ | `Live workflow-stage route has no registered workflow owner` | The workflow owner's own broker connection is re-registering (for example after a reconnect). | Transient. The stage's bounded warm-up retry re-registers once the owner is back; the stage fails only if every attempt is refused. |
51
+ | `Live workflow-stage route is owned by another active session` | Another connected session already owns this exact stage. | Transient when the previous attempt's session is still being torn down; a genuinely live duplicate owner is refused on every attempt and the stage fails after the bounded retries. |
52
+ | `… capability does not match the workflow owner` / `… registrant is outside the workflow invocation group` / `… name a non-agent workflow node` | Authority or configuration mismatch. | Terminal for that stage startup; it repeats identically on retry. |
53
+
54
+ A stage name reused by a later occurrence in the same run (for example `reviewer-a` in a second review round while the first round's completed session is still connected) is not a duplicate owner. The later stage registers under its stage id, and the reused name is ambiguous: neither occurrence keeps a live name alias, so a send to that name is routed through the workflow owner rather than delivered to whichever occurrence registered first. Address such stages by the id-form target that `intercom list` shows.
55
+
44
56
  ## How It Works
45
57
 
46
58
  The local broker starts on first use and exits after five seconds without registered sessions. Clients reconnect automatically using delays of 1, 2, 5, 10, then 30 seconds. Explicit connection failures remain visible while background recovery continues.
package/docs/intercom.md CHANGED
@@ -9,7 +9,7 @@ description: "Direct messaging between Atomic sessions on the same machine"
9
9
 
10
10
  Atomic bundles `@bastani/intercom` for direct 1:1 messaging between sessions on the same machine. Send context, findings, or requests yourself, or let agents coordinate. No separate install is needed.
11
11
 
12
- The extension registers commands and tools at startup. Connections are lazy: a session connects when you or the model invoke Intercom.
12
+ The extension registers commands and tools at startup. Connections are lazy: a session connects when you or the model invoke Intercom. Workflow stages and admitted subagent children connect at session start so they are listable and steerable immediately.
13
13
 
14
14
  **Key capabilities:**
15
15
  - **Session messaging** - `send`, `ask` (blocking, 10-minute timeout), `reply`, `pending`, `list`, `groups`, and `status` via the `intercom` tool