@bastani/atomic 0.10.14-alpha.1 → 0.10.15-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  10. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  11. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  14. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  15. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  16. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  17. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  18. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  19. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  21. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  22. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  25. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  26. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  27. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  28. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  29. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  30. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  31. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  32. package/dist/builtin/intercom/package.json +1 -1
  33. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  34. package/dist/builtin/mcp/package.json +1 -1
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.code.js +1 -1
  40. package/dist/cli/auth-cli.impl.js +3 -3
  41. package/dist/cli/auth-cli.js +3 -3
  42. package/dist/cli/blueprint-command.impl.js +3 -3
  43. package/dist/cli/blueprint-command.js +3 -3
  44. package/dist/cli/intercom-command.code.js +3 -3
  45. package/dist/cli/intercom-command.impl.js +3 -3
  46. package/dist/cli/intercom-command.js +3 -3
  47. package/dist/cli/list-models.impl.js +3 -3
  48. package/dist/cli/list-models.js +3 -3
  49. package/dist/cli/session-picker.code.js +1 -1
  50. package/dist/cli/session-picker.impl.js +3 -3
  51. package/dist/cli/session-picker.js +3 -3
  52. package/dist/cli/startup-ui.code.js +1 -1
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.code.js +1 -1
  58. package/dist/cli/storage-search-session.impl.js +3 -3
  59. package/dist/cli/storage-search-session.js +3 -3
  60. package/dist/cli/team-command.code.js +1 -1
  61. package/dist/cli/team-command.impl.js +3 -3
  62. package/dist/cli/team-command.js +3 -3
  63. package/dist/cli.js +2 -2
  64. package/dist/core/compaction/compactor.d.ts +0 -8
  65. package/dist/core/debug.impl.js +3 -3
  66. package/dist/core/debug.js +3 -3
  67. package/dist/core/export-html/card-projection.impl.js +3 -3
  68. package/dist/core/export-html/card-projection.js +3 -3
  69. package/dist/core/export-html/index.code.js +2 -2
  70. package/dist/core/export-html/index.impl.js +3 -3
  71. package/dist/core/export-html/index.js +3 -3
  72. package/dist/core/export-html/json-spans.impl.js +3 -3
  73. package/dist/core/export-html/json-spans.js +3 -3
  74. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  76. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  77. package/dist/core/export-html/tool-renderer.js +3 -3
  78. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  79. package/dist/core/extensions/jiti-loader.js +3 -3
  80. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.js +3 -3
  82. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.js +3 -3
  84. package/dist/core/intercom-broker-control-host.code.js +1 -1
  85. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  86. package/dist/core/intercom-broker-control-host.js +3 -3
  87. package/dist/core/intercom-broker-control.code.js +2 -2
  88. package/dist/core/intercom-broker-control.impl.js +3 -3
  89. package/dist/core/intercom-broker-control.js +3 -3
  90. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.js +3 -3
  92. package/dist/core/sdk.code.js +1 -1
  93. package/dist/core/sdk.impl.js +3 -3
  94. package/dist/core/sdk.js +3 -3
  95. package/dist/core/session-manager-core.js +3 -3
  96. package/dist/core/session-manager-list.impl.js +3 -3
  97. package/dist/core/session-manager-list.js +3 -3
  98. package/dist/core/session-manager.impl.js +3 -3
  99. package/dist/core/session-manager.js +3 -3
  100. package/dist/core/session-storage.impl.js +3 -3
  101. package/dist/core/session-storage.js +3 -3
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/node-sqlite-thread.js +2 -2
  104. package/dist/core/storage/node-sqlite.js +2 -2
  105. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  106. package/dist/core/storage/offline-snapshot-file.js +3 -3
  107. package/dist/core/storage/provider.js +2 -2
  108. package/dist/core/storage/selection.js +2 -2
  109. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  111. package/dist/core/storage/session/branch-fork-source.js +3 -3
  112. package/dist/core/storage/session/card-view.impl.js +3 -3
  113. package/dist/core/storage/session/card-view.js +3 -3
  114. package/dist/core/storage/session/child-reader.code.js +2 -2
  115. package/dist/core/storage/session/child-reader.impl.js +3 -3
  116. package/dist/core/storage/session/child-reader.js +3 -3
  117. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  119. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  120. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  121. package/dist/core/storage/session/expanded-child-details.js +3 -3
  122. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  124. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.js +3 -3
  126. package/dist/core/storage/session/fork-staging.code.js +1 -1
  127. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  128. package/dist/core/storage/session/fork-staging.js +3 -3
  129. package/dist/core/storage/session/fork-window.code.js +2 -2
  130. package/dist/core/storage/session/fork-window.impl.js +3 -3
  131. package/dist/core/storage/session/fork-window.js +3 -3
  132. package/dist/core/storage/session/history-pages.impl.js +3 -3
  133. package/dist/core/storage/session/history-pages.js +3 -3
  134. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  136. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  138. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.js +3 -3
  140. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  141. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  142. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  143. package/dist/core/storage/session/released-history-files.code.js +1 -1
  144. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  145. package/dist/core/storage/session/released-history-files.js +3 -3
  146. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  148. package/dist/core/storage/session/session-resume.impl.js +3 -3
  149. package/dist/core/storage/session/session-resume.js +3 -3
  150. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.js +3 -3
  152. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  153. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  154. package/dist/core/storage/session/snapshot-history.js +3 -3
  155. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  156. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  157. package/dist/core/storage/session/sql-session-store.js +3 -3
  158. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  159. package/dist/core/storage/session/tree-outline.js +3 -3
  160. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.js +3 -3
  162. package/dist/core/storage/storage-status.impl.js +3 -3
  163. package/dist/core/storage/storage-status.js +3 -3
  164. package/dist/core/storage/team.impl.js +3 -3
  165. package/dist/core/storage/team.js +3 -3
  166. package/dist/core/structured-output/index.code.js +1 -1
  167. package/dist/core/structured-output/index.impl.js +3 -3
  168. package/dist/core/structured-output/index.js +3 -3
  169. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.js +3 -3
  171. package/dist/core/tasks/task-file-history.code.js +2 -2
  172. package/dist/core/tasks/task-file-history.impl.js +3 -3
  173. package/dist/core/tasks/task-file-history.js +3 -3
  174. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  175. package/dist/core/tasks/task-reference-archive.js +3 -3
  176. package/dist/core/tasks/task-reference-identity.js +3 -3
  177. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.js +3 -3
  179. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  181. package/dist/core/tasks/task-view-source.impl.js +3 -3
  182. package/dist/core/tasks/task-view-source.js +3 -3
  183. package/dist/core/tools/read-url.impl.js +3 -3
  184. package/dist/core/tools/read-url.js +3 -3
  185. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  186. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  187. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  188. package/dist/core/worktree-snapshot/errors.js +3 -3
  189. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  191. package/dist/extensions/codemode/execute.impl.js +3 -3
  192. package/dist/extensions/codemode/execute.js +3 -3
  193. package/dist/extensions/codemode/renderer.impl.js +3 -3
  194. package/dist/extensions/codemode/renderer.js +3 -3
  195. package/dist/extensions/mcp/cli.code.js +1 -1
  196. package/dist/extensions/mcp/cli.impl.js +3 -3
  197. package/dist/extensions/mcp/cli.js +3 -3
  198. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  199. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  200. package/dist/extensions/mcp/cli.lazy.js +3 -3
  201. package/dist/extensions/mcp/runtime.code.js +1 -1
  202. package/dist/extensions/mcp/runtime.impl.js +3 -3
  203. package/dist/extensions/mcp/runtime.js +3 -3
  204. package/dist/index.d.ts +21 -1
  205. package/dist/index.js +2 -2
  206. package/dist/main-first-time-setup.code.js +1 -1
  207. package/dist/main-first-time-setup.impl.js +3 -3
  208. package/dist/main-first-time-setup.js +3 -3
  209. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  210. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  211. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  212. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  214. package/dist/modes/print-mode.js +1 -1
  215. package/dist/package-manager-cli.code.js +2 -2
  216. package/dist/package-manager-cli.impl.js +3 -3
  217. package/dist/package-manager-cli.js +3 -3
  218. package/dist/startup-files.json +1 -1
  219. package/dist/startup-stages/6.js +1 -1
  220. package/dist/utils/startup-database-spare.code.js +1 -1
  221. package/dist/utils/startup-database-spare.impl.js +3 -3
  222. package/dist/utils/startup-database-spare.js +3 -3
  223. package/dist/utils/tools-manager.impl.js +3 -3
  224. package/dist/utils/tools-manager.js +3 -3
  225. package/docs/background-tasks/reference.md +182 -0
  226. package/docs/background-tasks.md +98 -405
  227. package/docs/build.md +67 -27
  228. package/docs/changelog.mdx +9 -0
  229. package/docs/codemode.md +108 -39
  230. package/docs/compaction/branch-summaries.md +54 -0
  231. package/docs/compaction/custom-compactors.md +161 -0
  232. package/docs/compaction/memory-compaction.md +77 -0
  233. package/docs/compaction/reference.md +86 -38
  234. package/docs/compaction.md +51 -252
  235. package/docs/computer-use.md +169 -321
  236. package/docs/containerization.md +71 -57
  237. package/docs/custom-provider/api-reference.md +119 -25
  238. package/docs/custom-provider/oauth.md +114 -132
  239. package/docs/custom-provider/override.md +37 -27
  240. package/docs/custom-provider/registration.md +107 -83
  241. package/docs/custom-provider/streaming.md +85 -71
  242. package/docs/custom-provider.md +85 -52
  243. package/docs/development.md +39 -29
  244. package/docs/docs.json +76 -63
  245. package/docs/environment-variables.md +94 -44
  246. package/docs/extensions/api-reference.md +86 -43
  247. package/docs/extensions/authoring.md +162 -154
  248. package/docs/extensions/events.md +80 -25
  249. package/docs/extensions/examples.md +90 -85
  250. package/docs/extensions/ui.md +206 -82
  251. package/docs/extensions.md +79 -108
  252. package/docs/getting-started/authentication.md +67 -36
  253. package/docs/getting-started/first-session.md +53 -43
  254. package/docs/getting-started/installation.md +116 -89
  255. package/docs/getting-started/project-instructions.md +48 -34
  256. package/docs/guides/configuration.md +82 -20
  257. package/docs/guides/non-interactive.md +66 -24
  258. package/docs/guides/resume-on-any-machine.md +135 -82
  259. package/docs/guides/team-setup.md +114 -105
  260. package/docs/guides.md +76 -32
  261. package/docs/herdr.md +15 -16
  262. package/docs/how-atomic-works.md +140 -0
  263. package/docs/index.md +58 -44
  264. package/docs/intercom/operations.md +141 -151
  265. package/docs/intercom/reference.md +85 -108
  266. package/docs/intercom.md +84 -145
  267. package/docs/json.md +120 -67
  268. package/docs/keybindings.md +85 -49
  269. package/docs/libraries/agent-core.md +137 -275
  270. package/docs/libraries/ai.md +100 -84
  271. package/docs/libraries/codemode.md +210 -300
  272. package/docs/libraries/schema.md +59 -53
  273. package/docs/libraries/storage-postgres.md +49 -35
  274. package/docs/libraries/telemetry.md +153 -354
  275. package/docs/libraries/tui.md +265 -393
  276. package/docs/libraries.md +42 -26
  277. package/docs/llama-cpp.md +171 -161
  278. package/docs/mcp-servers.md +90 -51
  279. package/docs/models/choose-a-model.md +188 -0
  280. package/docs/models/reference.md +74 -30
  281. package/docs/models.md +153 -88
  282. package/docs/orchestration/migrating-workflows.md +23 -16
  283. package/docs/orchestration/patterns.md +39 -44
  284. package/docs/orchestration.md +65 -26
  285. package/docs/packages/authoring.md +51 -29
  286. package/docs/packages/reference.md +42 -21
  287. package/docs/packages.md +69 -58
  288. package/docs/programmatic.md +118 -24
  289. package/docs/prompt-templates.md +84 -83
  290. package/docs/providers/reference.md +43 -48
  291. package/docs/providers.md +219 -451
  292. package/docs/quickstart.md +140 -120
  293. package/docs/reference/cli.md +135 -97
  294. package/docs/reference.md +20 -18
  295. package/docs/rpc/examples.md +76 -20
  296. package/docs/rpc/extension-ui.md +64 -38
  297. package/docs/rpc/protocol.md +361 -110
  298. package/docs/rpc.md +57 -17
  299. package/docs/sdk/reference.md +409 -534
  300. package/docs/sdk/storage.md +53 -13
  301. package/docs/sdk/structured-decisions.md +82 -56
  302. package/docs/sdk/web-server.md +57 -43
  303. package/docs/sdk.md +106 -84
  304. package/docs/security.md +42 -64
  305. package/docs/session-format.md +62 -38
  306. package/docs/sessions.md +99 -214
  307. package/docs/settings.md +165 -195
  308. package/docs/shell-aliases.md +9 -6
  309. package/docs/skills/authoring.md +69 -48
  310. package/docs/skills/reference.md +51 -20
  311. package/docs/skills.md +99 -148
  312. package/docs/slash-commands.md +129 -0
  313. package/docs/storage/custom-adapters.md +160 -85
  314. package/docs/storage/jsonl.md +81 -66
  315. package/docs/storage/postgres/pgbouncer.md +120 -126
  316. package/docs/storage/postgres/tuning.md +120 -143
  317. package/docs/storage/postgres.md +314 -330
  318. package/docs/storage/sqlite.md +71 -42
  319. package/docs/storage.md +298 -302
  320. package/docs/subagents/authoring.md +55 -38
  321. package/docs/subagents/reference.md +73 -33
  322. package/docs/subagents.md +119 -187
  323. package/docs/terminal-setup.md +50 -38
  324. package/docs/termux.md +67 -41
  325. package/docs/themes/reference.md +23 -19
  326. package/docs/themes.md +142 -127
  327. package/docs/tmux.md +47 -55
  328. package/docs/tools.md +147 -109
  329. package/docs/tui/reference.md +166 -214
  330. package/docs/tui.md +196 -341
  331. package/docs/usage.md +118 -138
  332. package/docs/verification.md +79 -51
  333. package/docs/web-access.md +121 -101
  334. package/docs/windows.md +26 -27
  335. package/docs/worktree-snapshots/reference.md +245 -0
  336. package/docs/worktree-snapshots.md +71 -259
  337. package/package.json +8 -8
  338. package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
  339. package/docs/guides/intercom.md +0 -32
  340. package/docs/guides/orchestration.md +0 -28
  341. package/docs/guides/subagents.md +0 -37
@@ -1,29 +1,45 @@
1
1
  ---
2
- title: "Non-interactive mode"
3
- sidebarTitle: "Non-interactive mode"
4
- description: "Run Atomic without the terminal UI using print mode (-p), JSON event streams, or RPC."
2
+ title: "Run Atomic non-interactively"
3
+ sidebarTitle: "Run non-interactively"
4
+ description: "Run Atomic from scripts, pipelines, and editors using print mode (-p), JSON event streams, RPC, or the SDK."
5
5
  ---
6
6
 
7
- You can run Atomic without the terminal UI in three ways, or embed it directly in TypeScript with the SDK.
7
+ You can run Atomic without the terminal UI in three CLI modes, or embed it directly in TypeScript with the SDK.
8
8
 
9
- | You want | Use | Read |
9
+ | What you want | Use | Read |
10
10
  | --- | --- | --- |
11
- | One prompt, one answer, then exit | Print mode (`-p`, `--print`) | [CLI modes](/reference/cli#modes) |
12
- | A machine-readable stream of everything the session does | JSON event stream (`--mode json`) | [JSON event stream](/json) |
13
- | A long-lived session another program drives | RPC (`--mode rpc`) | [RPC](/rpc) |
14
- | Embed Atomic in your own TypeScript program | SDK | [SDK](/sdk) |
11
+ | One prompt, one plain-text answer, then exit | Print mode (`-p`, `--print`) | [CLI modes](/reference/cli#modes) |
12
+ | A machine-readable stream of messages, tool calls, and results | JSON event stream (`--mode json`) | [JSON event stream](/json) |
13
+ | A long-lived session another program drives interactively | RPC (`--mode rpc`) | [RPC](/rpc) |
14
+ | Embed Atomic directly inside a TypeScript application | SDK | [SDK](/sdk) |
15
15
 
16
16
  ## Print mode
17
17
 
18
- `atomic --print "..."` (or `-p`) runs prompts without launching the terminal UI and exits when done.
18
+ `atomic -p "..."` (or `--print`) runs prompts without launching the terminal UI and exits when finished:
19
19
 
20
- - **Automatic print mode on pipes and redirects:** If standard input or standard output is not a TTY (for example piping text into `atomic` or redirecting `atomic > out.txt`), Atomic enters print mode automatically even without `-p`.
21
- - **Piped stdin and prompt merging:** Atomic reads piped stdin and separates it from CLI prompt text with a newline, so it composes cleanly with shell pipelines. When a prompt argument or `@file` is present, Atomic waits up to 2 seconds for the first piped byte before continuing without stdin (override with [`ATOMIC_STDIN_TIMEOUT_MS`](/environment-variables#diagnostics-and-performance), or set `0` to always wait for EOF).
22
- - **Multiple prompts:** Passing multiple positional prompts (such as `atomic -p "step 1" "step 2"`) runs them sequentially in the same session. Plain-text print mode prints only the final prompt's answer to stdout, while `--mode json` emits events for every turn.
23
- - **Disabled interactive tools and project trust:** Both print mode and `--mode json` automatically disable `ask_user_question` because no interactive terminal UI is available. Non-interactive runs never show project trust prompts; untrusted projects ignore project settings, extensions, and context files unless you pass `--approve` (`-a`) or set global `defaultProjectTrust` to `"always"`. See [Project trust](/settings#project-trust).
24
- - **Pre-flight checks and structured output:** Before starting an automated run, verify provider credentials with `atomic auth check` ([Verify readiness before a session](/providers#verify-readiness-before-a-session)). For typed classification or terminating structured-output payloads in scripts and SDK hosts, see [Structured decisions](/sdk/structured-decisions).
25
- - **Truncated responses:** If a text response hits the model's output token limit, print mode keeps the partial text on stdout, writes a truncation warning to stderr, and exits with code `1`. Check the exit code before treating redirected output as complete.
26
- - **Extension commands as prompts:** Running `atomic --session <id> -p "/curator off"` prints the command's reply. If the command sends a message or starts a turn, print mode waits for that response and prints it before running the next prompt or exiting.
20
+ ```bash
21
+ # Single prompt
22
+ atomic -p "Summarize the architecture of this repository"
23
+
24
+ # Pipe input into a prompt
25
+ git diff | atomic -p "Write a concise commit message for these changes"
26
+
27
+ # Run multiple sequential prompts in one session (prints the final answer)
28
+ atomic -p "Inspect src/auth.ts" "List any edge cases you found"
29
+
30
+ # Read-only analysis with structured JSON event output
31
+ atomic --mode json --tools read,search,find -p "Audit src/ for hardcoded secrets"
32
+ ```
33
+
34
+ Key behaviors in print mode:
35
+
36
+ - **Automatic print mode on pipes and redirects:** If standard input or standard output is not a TTY (for example piping into `atomic` or redirecting `atomic > out.txt`), Atomic enters print mode automatically even without `-p`.
37
+ - **Piped stdin and prompt merging:** Atomic trims piped stdin and separates it from CLI prompt text or `@file` blocks with a blank line when adjacent text has no whitespace boundary. When a prompt argument or `@file` is present, Atomic waits up to 2 seconds for the first piped byte before starting without stdin (override with [`ATOMIC_STDIN_TIMEOUT_MS`](/environment-variables#diagnostics-and-performance), or set `0` to always wait for EOF).
38
+ - **Multiple prompts:** Passing multiple positional prompts runs them sequentially in the same session. Plain-text print mode prints only the final prompt's answer to stdout, while `--mode json` streams events for every turn.
39
+ - **Interactive prompts and project trust:** Both print mode and `--mode json` automatically disable interactive question prompts (`ask_user_question`) because no terminal UI is available. Non-interactive runs never prompt for project trust; when an untrusted project has local settings, Atomic prints a stderr warning advising `--approve` (`-a`) and ignores project settings, extensions, and context files unless you pass `--approve` (`-a`) or set global `defaultProjectTrust` to `"always"`. See [Project trust](/security#project-trust).
40
+ - **Pre-flight checks and structured output:** Before starting an automated run, verify provider credentials with `atomic auth check` ([Verify readiness before a session](/providers#verify-readiness-before-a-session)). For typed classification or final structured JSON outputs in scripts and SDK hosts, see [Structured decisions](/sdk/structured-decisions).
41
+ - **Truncated responses:** If a response hits the model's output token limit, print mode keeps the partial text on stdout, writes a truncation warning to stderr, and exits `1`. Always check the exit code before treating redirected output as complete.
42
+ - **Extension slash commands:** You can invoke extension slash commands in print mode (for example `atomic --session <id> -p "/curator off"`). If the command sends a message or triggers a turn, print mode waits for that response and prints it before continuing or exiting.
27
43
 
28
44
  ### Exit codes and signals
29
45
 
@@ -36,19 +52,45 @@ You can run Atomic without the terminal UI in three ways, or embed it directly i
36
52
  | `130` | Stopped by `SIGINT` (`Ctrl+C`) after graceful shutdown |
37
53
  | `143` | Stopped by `SIGTERM` on Linux or macOS after graceful shutdown |
38
54
 
39
- Sending a second termination signal during graceful shutdown forces immediate exit. On Linux and macOS, the standalone binary preserves an ignored `SIGHUP` (as under `nohup atomic -p ...`) and keeps running after its terminal closes. An npm installation runs on Node.js, which resets an ignored `SIGHUP`; start it with `setsid` to keep it running after disconnect.
55
+ Sending a second termination signal during graceful shutdown forces immediate exit.
56
+
57
+ <Tip>
58
+ **Running after terminal disconnect (`SIGHUP`):** On Linux and macOS, the standalone Atomic binary preserves an ignored `SIGHUP` (such as under `nohup atomic -p ...`) and keeps running after the terminal closes. An npm installation runs on Node.js, which resets an ignored `SIGHUP`; start it with `setsid` to keep it running after disconnect.
59
+ </Tip>
40
60
 
41
61
  ## JSON events
42
62
 
43
- Use `--mode json` when another program needs to observe a run rather than read plain text. Atomic emits one JSON record per message, tool call, and result for logging, CI annotations, or downstream scripts. See [JSON event stream](/json) for the event shapes.
63
+ Use `--mode json` when a script or CI job needs to observe every message, tool call, and result rather than just the final text:
64
+
65
+ ```bash
66
+ atomic --mode json "Run the test suite and report any failures"
67
+ ```
68
+
69
+ Atomic writes one JSON event object per line to stdout. See [JSON event stream](/json) for the full event schema.
44
70
 
45
71
  ## RPC
46
72
 
47
- Use `--mode rpc` to keep a session alive so another process can send prompts, answer UI requests, and receive events over stdin and stdout. Use it for editors, bots, and long-running services that need multi-turn control. Start at [RPC](/rpc) and the [RPC protocol](/rpc/protocol).
73
+ Use `--mode rpc` to run a persistent session controlled over stdin and stdout JSON messages—ideal for editors, bots, and background services that need multi-turn control or interactive UI callbacks:
74
+
75
+ ```bash
76
+ atomic --mode rpc --no-session
77
+ ```
78
+
79
+ Start with [RPC](/rpc) and the [RPC protocol](/rpc/protocol).
48
80
 
49
81
  ## Next steps
50
82
 
51
- - [CLI reference](/reference/cli) for every flag, model-matching rule, and exit code.
52
- - [Environment variables](/environment-variables) for `ATOMIC_STDIN_TIMEOUT_MS`, `ATOMIC_STORAGE`, and CI overrides.
53
- - [Programmatic use](/programmatic) to choose between the SDK, RPC, and the JSON event stream.
54
- - [Background tasks](/background-tasks) when work should continue while you keep chatting interactively.
83
+ <Columns cols={2}>
84
+ <Card title="CLI reference" href="/reference/cli">
85
+ Every flag, model-matching rule, subcommand, and exit code.
86
+ </Card>
87
+ <Card title="Environment variables" href="/environment-variables">
88
+ Configure `ATOMIC_STDIN_TIMEOUT_MS`, `ATOMIC_STORAGE`, and CI overrides.
89
+ </Card>
90
+ <Card title="Programmatic use" href="/programmatic">
91
+ Compare print mode, JSON events, RPC, and the TypeScript SDK.
92
+ </Card>
93
+ <Card title="Background tasks" href="/background-tasks">
94
+ Run subagents and shells in the background during interactive sessions.
95
+ </Card>
96
+ </Columns>
@@ -1,55 +1,63 @@
1
1
  ---
2
2
  title: "Resume sessions on any machine"
3
3
  sidebarTitle: "Resume anywhere"
4
- description: "Continue sessions on another machine using shared storage, worktree snapshots, and environment blueprints."
4
+ description: "Continue sessions on another machine using shared PostgreSQL storage, worktree snapshots, environment blueprints, and CI runner caches."
5
5
  ---
6
6
 
7
- When several machines share one storage database, you can start a session on one machine and continue it on any other. Atomic reads the session from shared storage, rebuilds the repository files it was working against, runs optional environment blueprints, and continues the conversation where it stopped.
7
+ When several machines share one PostgreSQL storage database, you can start a session on one machine and continue it on any other. Atomic reads the session from shared storage, rebuilds the repository files it was working against, runs optional environment blueprints, and continues the conversation where it left off.
8
8
 
9
9
  ## Join each machine
10
10
 
11
- Every machine must use the same shared [PostgreSQL](/storage/postgres) database, PostgreSQL 16 or newer.
11
+ Every machine must use the same shared [PostgreSQL](/storage/postgres) database (PostgreSQL 16 or newer).
12
12
 
13
- 1. Set up the database once. Create the roles, then run `atomic storage migrate` as the owner role, and again after each Atomic upgrade. See [Set up the database](/storage/postgres#set-up-the-database).
14
- 2. On every machine, install the adapter, save the runtime role's password in a file, join the database as the runtime role, and restart Intercom:
13
+ <Steps>
14
+ <Step title="Set up the database once">
15
+ Create the owner and runtime roles, then run `atomic storage migrate` as the owner role (and re-run it after each Atomic upgrade). See [Set up the database](/storage/postgres#set-up-the-database).
16
+ </Step>
17
+ <Step title="Join every machine as the runtime role">
18
+ Install the PostgreSQL adapter, save the runtime role's password in a private file, join the database, and restart Intercom:
15
19
 
16
- ```bash
17
- atomic install npm:@bastani/atomic-storage-postgres
18
- (umask 077; printf 'Runtime password: '; read -rs password; printf '\n'; printf '%s' "$password" > ~/atomic-db-password)
19
- atomic storage join 'postgresql://atomic_runtime@db.example.com:5432/atomic' --password-file ~/atomic-db-password
20
- rm ~/atomic-db-password # atomic storage join keeps its own copy
21
- atomic intercom restart
22
- atomic storage status
23
- ```
20
+ ```bash
21
+ atomic install npm:@bastani/atomic-storage-postgres
22
+ (umask 077; printf 'Runtime password: '; read -rs password; printf '\n'; printf '%s' "$password" > ~/atomic-db-password)
23
+ atomic storage join 'postgresql://atomic_runtime@db.example.com:5432/atomic' --password-file ~/atomic-db-password
24
+ rm ~/atomic-db-password # atomic storage join keeps its own copy
25
+ atomic intercom restart
26
+ atomic storage status
27
+ ```
28
+ </Step>
29
+ </Steps>
24
30
 
25
- Never put a password in the database URL. Pass it with `--password-file`, `--token-file`, or `--auth`, as [Join a machine](/storage/postgres#join-a-machine) explains. A URL with a password fails with `credential-in-url`.
31
+ <Warning>
32
+ Never put a password in the database URL. Always pass credentials with `--password-file`, `--token-file`, or `--auth` (see [Join a machine](/storage/postgres#join-a-machine)). A URL containing a password is rejected immediately.
33
+ </Warning>
26
34
 
27
- `atomic storage join` keeps sessions in the shared database, so they resume on any machine that joined it. If a machine shares only Intercom and keeps its sessions local, with `sessions.storage` set to `{}`, remove that setting so its sessions go to the shared database too. See [Sharing storage across hosts](/storage#sharing-storage-across-hosts) for prefixes and `atomic storage status`.
35
+ `atomic storage join` stores sessions in the shared database so any joined machine can resume them. If a machine sets `sessions.storage` to `{}` (keeping sessions local while sharing only Intercom), remove that setting so its sessions go to the shared database too. See [Sharing storage across hosts](/storage#sharing-storage-across-hosts).
28
36
 
29
- Keep worktree snapshots enabled (`snapshots.enabled`, on by default). At the end of each turn that modifies files, Atomic saves uncommitted edits, untracked files, and unpushed commits in the shared database. If `snapshots.enabled` is set to `false`, no snapshots are captured, cross-machine resume cannot restore repository files, and `atomic blueprint prebuild` fails with `snapshots are disabled`.
37
+ Keep worktree snapshots enabled (`snapshots.enabled`, on by default). At the end of each turn that modifies files, Atomic saves uncommitted edits, untracked files, and unpushed commits in the shared database. If `snapshots.enabled` is `false`, session turns do not capture snapshots and cross-machine resume cannot restore repository files (`atomic blueprint prebuild` still runs because it snapshots the committed `HEAD` independently of `snapshots.enabled`).
30
38
 
31
- Work inside submodules and untracked nested repositories is not recorded, and resume warns with `nested-repository`, `submodule-changes`, or `unpushed-submodule-commit` so you can commit and push those changes first. See [What is left out](/worktree-snapshots#what-is-left-out).
39
+ Work inside submodules and untracked nested repositories is not recorded, and resume warns so you can commit and push those changes first. See [What is left out](/worktree-snapshots#what-is-left-out).
32
40
 
33
41
  ## Resume a session
34
42
 
35
43
  Resume as usual with `atomic --session <id>`, `atomic --resume`, or `/resume` (see [Resuming and deleting sessions](/sessions#resuming-and-deleting-sessions)).
36
44
 
37
45
  - **Matching local checkout.** If you start Atomic inside a checkout of the same repository whose files match the snapshot (or where the recorded edits were committed), the session continues there directly.
38
- - **Restored worktree.** Otherwise, Atomic restores the recorded state into a worktree under `~/.atomic/agent/worktree-snapshots` without modifying your local checkouts, and prints the restored path. Atomic reuses a clean idle worktree of the same repository when available so existing dependencies and build output stay intact. See [Restored worktrees](/worktree-snapshots#restored-worktrees).
46
+ - **Restored worktree.** Otherwise, Atomic restores the recorded state into a worktree under `~/.atomic/agent/worktree-snapshots` without modifying your local checkouts, and prints the restored path. Atomic reuses a clean idle worktree of the same repository when available so existing dependencies and build output stay intact ([Restored worktrees](/worktree-snapshots#restored-worktrees)).
39
47
  - **Changed local checkout.** If you start `atomic` interactively in a checkout of the same repository that differs and has uncommitted or untracked changes, Atomic asks whether to restore a fresh worktree (the default), continue in your checkout as-is, or cancel. `/resume`, non-interactive modes such as `-p`, and clean differing checkouts restore a fresh worktree automatically.
40
- - **Partial (degraded) restore.** If the exact tree cannot be rebuilt (for example, an unreachable remote, a missing blob, or unpushed commits touching denied secret files), the session still opens with its full conversation. Atomic restores the closest reachable state and prints a notice naming what is missing and how to recover. See [Resuming](/worktree-snapshots#resuming).
41
- - **Multiple checkouts.** A session that modified several checkouts restores each one that is missing on this machine. Only the checkout the session works in must be restorable; any other checkout that cannot be restored or changed locally produces a warning without blocking the resume.
42
- - **Timing diagnostics.** Run `/session snapshot` to inspect the **Last resume** timing breakdown (fetch, materialize, LFS, verify, and each blueprint step), or run `ATOMIC_TIMING=1 atomic --session <id>` to print timings to stderr. See [Inspecting snapshots](/worktree-snapshots#inspecting-snapshots).
48
+ - **Partial (degraded) restore.** If the exact tree cannot be rebuilt (for example, an unreachable remote, a missing blob, or unpushed commits touching denied secret files), the session still opens with its full conversation. Atomic restores the closest reachable state and prints a notice naming what is missing and how to recover ([Resuming](/worktree-snapshots#resuming)).
49
+ - **Multiple checkouts.** A session that modified several checkouts restores each one that is missing on this machine. Only the checkout the session works in must be restorable; any other checkout that cannot be restored produces a warning without blocking the resume.
50
+ - **Timing diagnostics.** Run `/session snapshot` to inspect the **Last resume** timing breakdown, or run `ATOMIC_TIMING=1 atomic --session <id>` to print timings to stderr ([Inspecting snapshots](/worktree-snapshots#inspecting-snapshots)).
43
51
 
44
52
  Absolute paths from the earlier machine keep working in built-in file tools because Atomic maps paths under the old checkout to the restored worktree. Shell commands run as written, so commands containing old absolute paths need the new worktree path.
45
53
 
46
- Passing `--session <id>` for a session whose recorded directory does not exist on this machine opens directly instead of offering to fork the session. SDK callers using `createAgentSession({ sessionManager })` get the same restore behavior unless they pass `cwd` or `workspace`, even when the recorded path exists on this machine with different files (such as runners built from the same container image). See [Worktree snapshots in the SDK](/sdk#worktree-snapshots) and [SDK session storage](/sdk/storage).
54
+ Passing `--session <id>` for a session whose recorded directory does not exist on this machine opens directly instead of offering to fork. If shared storage does not respond within 15 seconds, `atomic --session`, `--resume`, `--continue`, and `/resume` stop without modifying anything; verify connectivity with `atomic storage status` and try again.
47
55
 
48
- If shared storage does not answer, `atomic --session`, `--resume`, `--continue`, and `/resume` stop after 15 seconds with a retryable `ResumeCatalogTimeoutError`. Nothing is modified; resume again once `atomic storage status` connects.
56
+ For SDK resume behavior with `createAgentSession({ sessionManager })`, see [Worktree snapshots in the SDK](/sdk#worktree-snapshots) and [SDK session storage](/sdk/storage).
49
57
 
50
- ### When the session is already open
58
+ ### When the session is already open {#when-the-session-is-already-open}
51
59
 
52
- A session runs in one process at a time. `atomic --session`, `--resume`, and `--continue` claim the session before writing to it or restoring checkouts. If another live process on this machine already holds the session, resume makes no changes and exits with code `75`:
60
+ A session runs in one process at a time. `atomic --session`, `--resume`, and `--continue` claim the session before writing to it or restoring checkouts. If another live process on the same agent directory already holds the session, resume makes no changes and exits with code `75`:
53
61
 
54
62
  ```text
55
63
  Error: Session <id> is already open in process <pid> on <host>. Nothing was changed. Close it there or wait for that process to exit, then resume again.
@@ -57,9 +65,12 @@ Error: Session <id> is already open in process <pid> on <host>. Nothing was chan
57
65
 
58
66
  Interactive mode prints the same message before starting. If several resumes start simultaneously, one succeeds and the others exit with code `75`.
59
67
 
60
- Claims live under `~/.atomic/agent/session-claims` and apply to processes sharing that agent directory. A claim left by a dead process (such as after `SIGKILL`) is taken over automatically. Atomic matches holders by PID and, on Linux and Windows, by process start time so a later process reusing the same PID does not block resume. A claim from another host refreshes every 15 seconds and expires after 60 seconds without a refresh.
68
+ Atomic uses two separate coordination records:
61
69
 
62
- If a process using a different agent directory writes to the same session in shared storage at the same time, the conflicting write stops with `Another process wrote to session <id> ...` and exit code `1`. Resume the session again to continue from saved state.
70
+ - **Session claims (`~/.atomic/agent/session-claims/<id>.json`).** Prevent concurrent resumes across processes sharing an agent directory. Claims left by dead processes (such as after `SIGKILL`) are taken over automatically—matching holders by PID and, on Linux and Windows, by process start time so reused PIDs never block resume. Claims refresh every 15 seconds and expire after 60 seconds without a refresh on another host sharing the directory.
71
+ - **Open-session markers (SQL `session_open_markers` or `<agentDir>/open-sessions/<id>/<token>.json`).** Track active sessions across every host sharing a database so another host cannot delete an open session and one-way shared-history schema upgrades wait until older releases close. Markers refresh every 15 seconds, expire after 60 seconds from another host, and expire after 24 hours without a refresh on same-host markers that lack a process start timestamp (such as on macOS).
72
+
73
+ If a process using a different agent directory writes to the same session in shared storage at the same time, the conflicting write stops with `Another process wrote to session <id> ...` and exit code `1`. Resume again to continue from saved state.
63
74
 
64
75
  ## Resuming subagents on another machine
65
76
 
@@ -69,9 +80,9 @@ When a background subagent resumes on another machine, Atomic maps its recorded
69
80
 
70
81
  Only subagents whose parent uses JSONL session files, and file-backed subagents from earlier releases, stay tied to the machine that launched them and report as unrestorable elsewhere.
71
82
 
72
- ## Set the environment up with a blueprint
83
+ ## Set the environment up with a blueprint {#set-the-environment-up-with-a-blueprint}
73
84
 
74
- A restored worktree contains repository files, not installed dependencies, runtimes, or build output. A *blueprint* defines how Atomic sets up the environment again. Atomic uses the [blueprint](https://docs.devin.ai/onboard-devin/environment/blueprints) YAML format, except repository blueprints live at `.atomic/blueprint.yaml` instead of `.devin/blueprint.yaml`. Atomic never reads `.devin/` paths.
85
+ A restored worktree contains repository files, not installed dependencies, runtimes, or build output. A *blueprint* defines how Atomic rebuilds the environment. Atomic uses the [blueprint](https://docs.devin.ai/onboard-devin/environment/blueprints) YAML format, reading `.atomic/blueprint.yaml` instead of `.devin/blueprint.yaml` (Atomic never reads `.devin/` paths).
75
86
 
76
87
  | Blueprint | File | Working directory |
77
88
  | --- | --- | --- |
@@ -99,7 +110,9 @@ knowledge:
99
110
  Run the tests with `pnpm test`.
100
111
  ```
101
112
 
102
- **Always set `runs-on` for macOS or Windows.** If a blueprint omits `runs-on`, Atomic defaults to `["linux"]` only, which silently does nothing on macOS and Windows. Add `runs-on: [macos]`, `runs-on: [windows]`, or `runs-on: [linux, macos, windows]`, or define separate `---`-separated YAML documents per operating system.
113
+ <Warning>
114
+ **Always set `runs-on` for macOS or Windows.** If a blueprint omits `runs-on`, Atomic defaults to `["linux"]` only, which silently skips the blueprint on macOS and Windows. Set `runs-on: [macos]`, `runs-on: [windows]`, or `runs-on: [linux, macos, windows]`, or define separate `---`-separated YAML documents per operating system.
115
+ </Warning>
103
116
 
104
117
  | Section | Purpose | When it runs |
105
118
  | --- | --- | --- |
@@ -108,26 +121,38 @@ knowledge:
108
121
  | `knowledge` | List of `{ name, contents }` items (by convention `lint`, `test`, and `build`) | Never executed. Provided to the agent as context |
109
122
  | `post-build` | Verify the assembled environment (global blueprint only) | During a build, after all repositories |
110
123
 
111
- Each section accepts a single string (one `run` step) or a list of steps. A step is a bare string, `{ name?, run, env? }`, or `{ name?, uses, with?, env? }`, never both `run` and `uses`. `with` applies only to `uses`; YAML scalar values (including numbers and booleans) are converted to strings, and `null` becomes `""`.
124
+ Each section accepts a single string (one `run` step) or a list of steps. A step is a bare string, `{ name?, run, env? }`, or `{ name?, uses, with?, env? }`, never both `run` and `uses`. `with` applies only to `uses`: YAML scalars convert to strings, `null` becomes `""`, and YAML arrays or objects serialize as JSON strings.
125
+
126
+ `uses` accepts `github.com/<owner>/<repo>[/<subpath>]@<ref>` in `initialize` and `post-build` (never in `maintenance`, where Atomic rejects it). Owner must start with an alphanumeric character and use `[A-Za-z0-9-]`, repo uses `[A-Za-z0-9._-]`, and `ref` cannot start with `-` or contain whitespace, control characters, or `~^:?*[\`. Anything an action writes to `GITHUB_ENV` or `GITHUB_PATH` is appended to `$ENVRC` automatically for later steps and the session. Actions cache under `~/.atomic/agent/blueprint-actions`; set `ATOMIC_BLUEPRINT_GITHUB_BASE_URL` to fetch actions from a host other than `https://github.com`.
112
127
 
113
- `uses` accepts `github.com/<owner>/<repo>[/<subpath>]@<ref>` in `initialize` and `post-build` (never in `maintenance`, where Atomic rejects it with `'uses' steps are not supported in maintenance sections`). Owner must start with an alphanumeric character and use `[A-Za-z0-9-]`, repo uses `[A-Za-z0-9._-]`, and ref cannot contain whitespace, control characters, or `~^:?*[\`. Node.js and composite GitHub Actions are supported; Docker actions and composite actions using `hashFiles`, `secrets`, or `matrix` expressions fail the step. Anything an action writes to `GITHUB_ENV` or `GITHUB_PATH` is automatically appended to `$ENVRC` for later steps and the session. Actions cache under `~/.atomic/agent/blueprint-actions`. Set `ATOMIC_BLUEPRINT_GITHUB_BASE_URL` to fetch actions from a host other than `https://github.com`.
128
+ <Accordion title="GitHub Actions compatibility details">
129
+ - **Supported action types:** Node.js actions targeting `node12`, `node16`, `node20`, or `node24`, and composite actions. Docker actions and unknown `runs.using` types fail the step.
130
+ - **Lifecycle hooks:** Node.js actions run `runs.pre` (respecting `runs.pre-if`) and `runs.main`. `runs.post` and `runs.post-if` are ignored.
131
+ - **Nesting limit:** Composite actions can nest nested `uses` steps up to **10** levels deep.
132
+ - **Expressions:** Composite actions support `contains`, `startsWith`, `endsWith`, `format`, `join`, `toJSON`, `fromJSON`, `always`, `success`, `failure`, and `cancelled`, along with standard comparison and boolean operators. `hashFiles`, `secrets`, and `matrix` expressions fail the step.
133
+ - **Stubbed `github.*` context:** `github.workspace`, `github.action_path`, `github.action_repository`, and `github.action_ref` reflect the actual build directory and action. Other `github.*` fields use fixed stubs (such as `github.repository: "atomic/blueprint"`, `github.sha: "0000000000000000000000000000000000000000"`, `github.token: ""`, `github.event: {}`).
134
+ </Accordion>
114
135
 
115
136
  Key blueprint rules:
116
137
 
117
- - **Platforms and validation.** `runs-on` accepts a string or list matched case-insensitively (`default` and `linux` are aliases; `macos` and `windows` are explicit; omitting `runs-on` defaults to `["linux"]` only). A file can contain multiple `---`-separated YAML documents as long as no two documents target the same platform. A machine runs only the document matching its OS, but Atomic validates **every** document in the file, so a syntax or schema error in a `windows` document fails the blueprint on Linux too.
118
- - **Shell.** `shell` accepts `"default"`, `"bash"`, or `"powershell"` (case-insensitive). `run` steps execute in bash (Git Bash on Windows) with `set -e` so they stop at the first failing command. Setting `shell: powershell` runs PowerShell on Windows with `$ErrorActionPreference = 'Stop'` (on Linux and macOS, `run` steps always execute in bash). Commands must be non-interactive.
119
- - **Environment.** Step `env:` applies to that step only and overrides `$ENVRC`. In bash, Atomic sources `$ENVRC` with `set -a`, so plain `KEY=VALUE` lines appended to `$ENVRC` (for example `echo "API_URL=http://localhost:3000" >> "$ENVRC"`) are exported automatically to later steps and the resumed session's bash tool without needing `export`. On Windows, `$ENVRC` is evaluated by Git Bash with `PATH` converted back automatically; from PowerShell steps, write UTF-8 bash assignments with LF line endings and no BOM to `$env:ENVRC`. `$ENVRC` starts empty on every build, so `maintenance` should not depend on values `initialize` wrote during an earlier build.
138
+ - **Platforms and validation.** `runs-on` accepts a string or list matched case-insensitively (`default` and `linux` are aliases; `macos` and `windows` are explicit). A file can hold multiple `---`-separated YAML documents as long as no two documents target the same platform. A machine runs only its matching document, but Atomic validates **every** document in the file.
139
+ - **Shell.** `shell` accepts `"default"`, `"bash"`, or `"powershell"` (case-insensitive). `run` steps execute in bash (Git Bash on Windows) with `set -e`. Setting `shell: powershell` runs PowerShell on Windows with `$ErrorActionPreference = 'Stop'` (on Linux and macOS, `run` steps always execute in bash). Commands must be non-interactive.
140
+ - **Environment.** Step `env:` applies to that step only and overrides `$ENVRC`. In bash, Atomic sources `$ENVRC` with `set -a`, so plain `KEY=VALUE` lines appended to `$ENVRC` (for example `echo "API_URL=http://localhost:3000" >> "$ENVRC"`) are exported to later steps and the resumed session's bash tool without needing `export`. On Windows, `$ENVRC` is evaluated by Git Bash with `PATH` converted back automatically; from PowerShell steps, write UTF-8 bash assignments with LF line endings and no BOM to `$env:ENVRC`. `$ENVRC` starts empty on every build, so `maintenance` should not depend on values `initialize` wrote during an earlier build.
120
141
  - **Timeout.** Any step running longer than 3 hours is stopped and marked failed.
121
142
  - **Includes.** The repository blueprint can list workspace directories (or `<dir>/.atomic/blueprint.yaml` paths) in `includes`, without `..` or duplicates. Workspace blueprints cannot declare `includes`, global blueprints ignore `includes`, and only global blueprints allow `post-build`.
122
143
  - **Ignored keys.** `clone` is ignored with a warning because resume restores the recorded tree. `cache` triggers a warning pointing to `resume.cache`. Other unknown keys are ignored silently.
123
144
 
124
- Note: Legacy `.atomic/setup` is no longer read. `resume.setupCommand` is deprecated, acts temporarily as a single global maintenance step with a deprecation warning, and should be moved into the `maintenance` section of `.atomic/blueprint.yaml`.
145
+ <Note>
146
+ Legacy `.atomic/setup` is no longer read. `resume.setupCommand` is deprecated and **global-only** (project `.atomic/settings.json` values are silently ignored); it runs temporarily as a single global maintenance step with a deprecation warning. Move its command into `.atomic/blueprint.yaml` under `maintenance`.
147
+ </Note>
125
148
 
126
149
  ### How blueprint builds run
127
150
 
128
151
  When resume restores a worktree, Atomic builds in order: global `initialize` and `maintenance`, then each repository's `initialize` and `maintenance` (followed by its included workspaces), then global `post-build`. Existing local checkouts that resume directly are never built.
129
152
 
130
- **Project trust required.** A restored worktree is a new directory, so project trust starts unset just like a fresh clone. Because builds run project code, repository blueprints execute only for trusted projects (saved trust, `--approve`, or `"defaultProjectTrust": "always"`). Untrusted worktrees skip project instructions, resources, and blueprint builds silently (though the agent still receives `maintenance` and `knowledge` marked as not yet run), and the global blueprint runs only when at least one restored worktree is trusted.
153
+ <Note>
154
+ **Project trust required.** A restored worktree is a new directory, so project trust starts unset just like a fresh clone. Repository blueprints run only for trusted projects (saved trust, `--approve`, or `"defaultProjectTrust": "always"`). Untrusted worktrees skip project instructions, resources, and blueprint builds (the agent still receives `maintenance` and `knowledge` marked as not yet run), and the global blueprint runs only when at least one restored worktree is trusted.
155
+ </Note>
131
156
 
132
157
  Builds are differential. Atomic compares each workspace blueprint against the last successful build on this machine:
133
158
 
@@ -135,33 +160,40 @@ Builds are differential. Atomic compares each workspace blueprint against the la
135
160
  - New, edited, or previously failed workspaces run both `initialize` and `maintenance`.
136
161
  - A full rebuild runs across all workspaces (including global `initialize`) whenever the global blueprint changes or the last full build is older than 7 days.
137
162
 
138
- A step fails if its command exits non-zero, raises a PowerShell error, times out after 3 hours, or cannot start (Atomic briefly retries temporarily busy executables for up to 2 seconds before failing). When a step fails, the remaining steps of that blueprint are skipped while other repositories and workspaces continue building. A blueprint failure never blocks resuming the session:
163
+ A step fails if its command exits non-zero, raises a PowerShell error, times out after 3 hours, or cannot start (Atomic retries temporarily busy executables for up to 2 seconds before failing). When a step fails, the remaining steps of that blueprint are skipped while other repositories and workspaces continue building. A blueprint failure never blocks resuming the session:
139
164
 
140
165
  | Outcome | Result | What you see |
141
166
  | --- | --- | --- |
142
167
  | Repository or workspace blueprint failed | Partial. Worktree files are intact and usable. | Warning naming the blueprint, failing step, and log path |
143
- | Global blueprint or `post-build` failed | Failed. Repository blueprints do not run. | Prominent warning. The session still resumes |
168
+ | Global blueprint or `post-build` failed | Failed. Repository blueprints do not run. | Prominent warning; the session still resumes |
144
169
  | No blueprint, untrusted worktree, or no matching platform | Nothing ran | Nothing |
145
170
 
146
- On Windows, if a stopped step could not be tracked as a process group after its root command exited, Atomic warns that child processes may still be running. Check for leftover processes before retrying.
171
+ On Windows, if a stopped step could not be tracked as a process group after its root command exited, Atomic warns that child processes may still be running; check for leftover processes before retrying.
172
+
173
+ Blueprint build state lives under `~/.atomic/agent/worktree-snapshots/`:
147
174
 
148
- Every step writes a log under `~/.atomic/agent/worktree-snapshots/blueprint-logs` containing command, timestamps, duration, exit status, and output. To recover from a failed build, read the log, fix the environment or blueprint, and resume again.
175
+ - `blueprint-logs/`: per-step logs with command, timestamps, duration, exit status, and output.
176
+ - `blueprint-builds/ledger.json`: differential build ledger on this machine.
177
+ - `blueprint-builds/locks/<rootKey>.json`: active build lock per restored worktree.
178
+ - `blueprint-env/<hash>.envrc`: exported session environment written to `$ENVRC`.
149
179
 
150
- ### Start the first turn while the build runs
180
+ To recover from a failed build, read the step log, fix the environment or blueprint, and resume again.
181
+
182
+ ### Start the first turn while the build runs {#start-the-first-turn-while-the-build-runs}
151
183
 
152
184
  `resume.waitForBlueprint` controls whether Atomic waits for blueprint builds before opening the session:
153
185
 
154
- - `"prompt"` (default in the interactive TUI) opens the session after the build finishes.
186
+ - `"prompt"` (default in interactive mode) opens the session after the build finishes.
155
187
  - `"tools"` (default in `-p`, `--mode json`, `--mode rpc`, and SDK sessions) opens the session immediately after restoring files so the first model request starts while the build runs in the background.
156
188
 
157
- In `"tools"` mode, Atomic tells the agent that the environment is still building and holds every tool call and shell command in the restored worktree (including forks or switches into that worktree) until the build settles. The first waiting tool call receives the build result ahead of its own output. Warnings are reported once via stderr (`-p`) or a `blueprint_build_finished` event (`--mode json` and `--mode rpc`).
189
+ In `"tools"` mode, Atomic tells the agent that the environment is still building and holds every tool call and shell command in the restored worktree (including forks or switches into that worktree) until the build settles. The first waiting tool call receives the build result ahead of its own output. Warnings are delivered once via stderr (`-p`) or a `blueprint_build_finished` event (`--mode json` and `--mode rpc`).
158
190
 
159
191
  Interrupting a turn cancels the tool wait without stopping the build. `atomic -p` and `--mode json` print their answer and exit once the build finishes.
160
192
 
161
193
  Stopping and concurrent builds:
162
194
 
163
195
  - **Graceful stop (Ctrl-C, signals, or RPC stdin closing).** Atomic stops running build processes and rebuilds the worktree on the next resume.
164
- - **Abrupt kill (`SIGKILL`).** On Unix, the next resume cancels the interrupted build, terminates confirmed recorded build processes, sets that worktree aside so no session reuses it, and restores and builds a fresh worktree with a warning naming the set-aside path and logs. Atomic cleans up set-aside worktrees once no process uses them ([Restored worktrees](/worktree-snapshots#restored-worktrees)). On Windows, step processes exit with Atomic, so the next resume rebuilds the same worktree.
196
+ - **Abrupt kill (`SIGKILL`).** On Unix, the next resume cancels the interrupted build, terminates confirmed recorded build processes, sets that worktree aside so no session reuses it, and restores and builds a fresh worktree with a warning naming the set-aside path and logs. Atomic cleans up set-aside worktrees once no process uses them ([Pooling and set-aside worktrees](/worktree-snapshots/reference#idle-reuse-eviction-and-set-aside-worktrees)). On Windows, step processes exit with Atomic, so the next resume rebuilds the same worktree.
165
197
  - **Concurrent resumes on one worktree.** Only one build runs per worktree. Switching back to a session whose build is still running joins it. Another Atomic process waits up to 5 minutes (printing a stderr line or emitting `blueprint_build_waiting`) before rebuilding with a warning.
166
198
 
167
199
  To override the mode default, set `resume.waitForBlueprint` in settings:
@@ -172,20 +204,27 @@ To override the mode default, set `resume.waitForBlueprint` in settings:
172
204
 
173
205
  When an installed extension can decline saved project trust ([Project trust](/security#project-trust)), resume always defers the blueprint build like `"tools"` until trust is decided, and untrusted worktrees stay unbuilt.
174
206
 
207
+ <Accordion title="SDK and JSON/RPC events for background blueprint builds">
208
+ - **`blueprint_build_finished`** (SDK hook: `onBlueprintBuildFinished(listener)`): emitted once when a background build settles, with `{ type: "blueprint_build_finished", sessionId, roots, notices }` where each notice is `{ type: "info" | "warning", message }`.
209
+ - **`blueprint_build_waiting`** (SDK hook: `onBlueprintBuildWaiting(listener)`): emitted when a resume waits for another process's build on the same worktree, with `{ type: "blueprint_build_waiting", root, message }`.
210
+ - Both hooks replay any unannounced events from the current process when first subscribed and return an unsubscribe function. Use `blueprintBuildSettled(sessionId)` in the SDK to await build completion explicitly.
211
+ </Accordion>
212
+
175
213
  ### What the agent sees
176
214
 
177
215
  The first turn of a resumed session includes each applicable blueprint's `maintenance` steps and `knowledge` items, tagged with their build status (ran in this build, not yet run, or partial with the failing step and log path). The agent reruns `maintenance` itself if dependencies change. Atomic's default system prompt also guides the agent to maintain `.atomic/blueprint.yaml` as project setup evolves, leaving `~/.atomic/agent/blueprint.yaml` alone unless asked.
178
216
 
179
- ### Caches for runners
217
+ ### Caches for runners {#caches-for-runners}
180
218
 
181
- Ephemeral runners start with an empty home directory on every job. Run `atomic blueprint cache-key` to generate cache keys, restore prefixes, and paths for CI cache actions such as `actions/cache`. Atomic does not upload or download caches itself.
219
+ Ephemeral runners start with an empty home directory on every job. Run `atomic blueprint cache-key` to compute cache keys, restore prefixes, and paths for CI cache actions such as `actions/cache` (Atomic never uploads or downloads caches itself):
182
220
 
183
221
  ```bash
184
222
  atomic blueprint cache-key [dir] [--format text|json|github-output]
185
223
  ```
186
224
 
187
- Atomic detects package stores automatically from lockfiles at the repository root:
225
+ Atomic detects package stores automatically from lockfiles at the repository root (subdirectory lockfiles in monorepos are not auto-detected). It reads project `resume.cache` from `.atomic/settings.json` without requiring project trust (validating paths and refusing credential locations without executing any project code) and hashes the root `.atomic/blueprint.yaml`.
188
226
 
227
+ <Accordion title="Auto-detected package stores (11 ecosystems)">
189
228
  | Root files | Detected stores (Linux default) |
190
229
  | --- | --- |
191
230
  | `package-lock.json`, `npm-shrinkwrap.json` | `~/.npm` (`npm_config_cache`) |
@@ -200,9 +239,10 @@ Atomic detects package stores automatically from lockfiles at the repository roo
200
239
  | `build.gradle(.kts)`, `settings.gradle(.kts)`, `gradle.lockfile`, Gradle wrapper | `~/.gradle/caches`, `~/.gradle/wrapper` (`GRADLE_USER_HOME`) |
201
240
  | `pom.xml` | `~/.m2/repository` |
202
241
 
203
- Environment variables in parentheses move each store, and `XDG_CACHE_HOME` moves Linux `~/.cache` paths. On macOS, Yarn v1 uses `~/Library/Caches/Yarn`, pip uses `~/Library/Caches/pip`, Poetry uses `~/Library/Caches/pypoetry`, Go build cache uses `~/Library/Caches/go-build`, and pnpm uses `~/Library/pnpm/store` (npm, uv, Bun, Cargo, Go modules, Gradle, and Maven match Linux). Windows uses `%LOCALAPPDATA%` (such as `npm-cache`, `pnpm\store`, `Yarn\Cache`, `uv\cache`, `pip\Cache`, and `pypoetry\Cache`). Subdirectory lockfiles in monorepos are not auto-detected.
242
+ Environment variables in parentheses override each store path, and `XDG_CACHE_HOME` moves Linux `~/.cache` paths. On macOS, Yarn v1 uses `~/Library/Caches/Yarn`, pip uses `~/Library/Caches/pip`, Poetry uses `~/Library/Caches/pypoetry`, Go build cache uses `~/Library/Caches/go-build`, and pnpm uses `~/Library/pnpm/store` (npm, uv, Bun, Cargo, Go modules, Gradle, and Maven match Linux). On Windows, paths use `%LOCALAPPDATA%` (`npm-cache`, `pnpm\store`, `Yarn\Cache`, `uv\cache`, `pip\Cache`, `pypoetry\Cache`, and `go-build` for `GOCACHE`).
243
+ </Accordion>
204
244
 
205
- Declare additional stores or build outputs under `resume.cache` in `.atomic/settings.json` (a project list replaces the global list). Blueprints themselves do not declare caches:
245
+ Declare additional stores or build outputs under `resume.cache` in `.atomic/settings.json` (a project list replaces the global list; blueprints themselves do not declare caches):
206
246
 
207
247
  ```json
208
248
  {
@@ -224,35 +264,44 @@ Each entry takes `paths`, an optional `kind`, and optional `keyFiles`:
224
264
 
225
265
  | Entry | Paths | Key changes when |
226
266
  | --- | --- | --- |
227
- | `stores` | Detected package stores plus `"store"` paths in `resume.cache` | Lockfiles, `keyFiles`, `resume.cache`, repository blueprint, OS, or architecture change |
267
+ | `stores` | Detected package stores plus `"store"` paths in `resume.cache` | Lockfiles, `keyFiles`, `resume.cache`, root repository blueprint, OS, or architecture change |
228
268
  | `build` | Parked `"build"` paths and seed manifest | Same inputs as `stores` |
229
- | `git` | Atomic's Git object store for the repository | Checkout `HEAD` changes (restore newest via restore prefix) |
269
+ | `git` | Atomic's Git object store for the repository | Checkout `HEAD` changes (omits CPU architecture; uses `"unborn"` when `HEAD` has no commits yet; restore newest via restore prefix) |
230
270
  | `atomic` | Atomic's compiled extension cache | Atomic version, OS, or architecture change |
231
271
 
232
272
  Entries with no paths are omitted. The `git` and `build` entries require a Git remote. Atomic normalizes HTTPS remotes and `git@` SSH remotes by host and repository path so HTTPS runner checkouts reuse caches built from SSH checkouts (other SSH usernames stay distinct).
233
273
 
234
- To protect secrets, `cache-key` omits store paths inside the worktree, snapshot-denied paths ([What is left out](/worktree-snapshots#what-is-left-out)), and these home credential paths (along with any parent directory containing one, so `~/.cargo` is omitted because it holds `~/.cargo/credentials`, while `~/.cargo/registry` is allowed): `.aws`, `.azure`, `.cargo/credentials`, `.cargo/credentials.toml`, `.config/gcloud`, `.config/gh`, `.docker/config.json`, `.gem/credentials`, `.git-credentials`, `.gnupg`, `.gradle/gradle.properties`, `.kube`, `.m2/settings.xml`, `.netrc`, `.npmrc`, `.pypirc`, `.ssh`, `.terraform.d/credentials.tfrc.json`, and `.yarnrc.yml`. Checks run case-insensitively and across symlinks, with a warning on stderr.
274
+ <Accordion title="Excluded credential paths">
275
+ To protect secrets, `cache-key` omits store paths inside the worktree, snapshot-denied paths ([What is left out](/worktree-snapshots#what-is-left-out)), `<agentDir>/auth.json`, and these home credential paths (along with any parent directory containing one, so `~/.cargo` is omitted because it holds `~/.cargo/credentials`, while `~/.cargo/registry` is allowed):
276
+
277
+ `.aws`, `.azure`, `.cargo/credentials`, `.cargo/credentials.toml`, `.config/gcloud`, `.config/gh`, `.docker/config.json`, `.gem/credentials`, `.git-credentials`, `.gnupg`, `.gradle/gradle.properties`, `.kube`, `.m2/settings.xml`, `.netrc`, `.npmrc`, `.pypirc`, `.ssh`, `.terraform.d/credentials.tfrc.json`, and `.yarnrc.yml`.
278
+
279
+ Checks run case-insensitively and across symlinks, printing a warning on stderr for every omitted path.
280
+ </Accordion>
235
281
 
236
282
  Use `--format github-output` to emit `<name>-key`, `<name>-restore-prefix`, and `<name>-paths` lines for `$GITHUB_OUTPUT`. See [Caching between runs](/guides/team-setup#caching-between-runs) for a full GitHub Actions workflow.
237
283
 
238
- ### Prebuilt worktrees
284
+ ### Prebuilt worktrees {#prebuilt-worktrees}
239
285
 
240
286
  `atomic blueprint prebuild` prepares a repository ahead of time so a later resume starts with dependencies and build artifacts already built:
241
287
 
242
288
  ```bash
243
- atomic blueprint prebuild [dir] [--park] [--approve]
289
+ atomic blueprint prebuild [dir] [--park] [--approve|-a]
244
290
  ```
245
291
 
246
292
  Prebuild restores the committed `HEAD` at `dir` (defaulting to the current directory) into a new worktree, runs `initialize` and `maintenance`, and leaves the worktree idle for the next resume to claim. Only committed files are restored, so untracked or ignored files such as `.env` never enter the worktree.
247
293
 
248
294
  Prebuild requires:
249
295
 
250
- - `snapshots.enabled` set to `true` (otherwise it exits with `snapshots are disabled`).
251
296
  - A Git remote on the checkout.
252
- - No uncommitted edits to tracked files, and no unpushed commits touching denied secret files (`unpushed-history-denied`).
253
- - A trusted project (saved trust, `"defaultProjectTrust": "always"`, or `--approve`), because prebuild runs project code.
297
+ - No uncommitted edits to tracked files, and no unpushed commits touching denied secret files.
298
+ - A trusted project (saved trust, `"defaultProjectTrust": "always"`, or `--approve` / `-a`), because prebuild runs project code.
299
+
300
+ <Note>
301
+ `atomic blueprint prebuild` snapshots the committed `HEAD` directly (without untracked files) even if `snapshots.enabled` is set to `false` in `settings.json`.
302
+ </Note>
254
303
 
255
- If a blueprint step fails, prebuild exits `1`, deletes the new worktree, and preserves earlier worktrees and seeds. Timings print to stderr.
304
+ Exit codes: `0` when an idle worktree is ready, `1` when the project is untrusted, a precondition is not met, or a blueprint step fails (removing the new worktree while keeping earlier worktrees and seeds), and `2` on invalid CLI arguments. Timings print to stderr.
256
305
 
257
306
  With `--park`, Atomic moves untracked build output declared with `"kind": "build"` in [`resume.cache`](#caches-for-runners) into `~/.atomic/agent/worktree-snapshots/seeds/` along with a manifest naming the built commit. When another machine restores that cache and has no idle worktree, resume creates a worktree at the same path used during prebuild, moves the parked output into place (without overwriting tracked or existing files), and checks out the session snapshot. `/session snapshot` labels such restores `(seeded)` with a `seed` timing line.
258
307
 
@@ -260,38 +309,42 @@ If parking cannot acquire the seed lock, prebuild reports the error, leaves exis
260
309
 
261
310
  ## What can stop a resume
262
311
 
263
- Atomic checks required setup in one pass before restoring anything: the storage adapter, its credentials, and Git. When Git is absent, Atomic provisions a portable Git automatically unless offline or download fails.
312
+ Atomic checks required setup in one pass before restoring anything: the storage adapter, its credentials, and Git. When Git is absent, Atomic downloads a verified portable Git automatically unless offline or download fails.
264
313
 
265
- For session resumes, missing Git never blocks opening the session. Instead, the session opens in its recorded or current directory with a notice for each unrestored checkout. A session resume fails only when the session cannot be read, a snapshot fails security checks (`invalid-snapshot`), or a target directory contains unexpected files (`unsafe-target`). Blueprint failures never stop a resume.
314
+ For session resumes, missing Git never blocks opening the session—it opens in its recorded or launch directory with a notice for each unrestored checkout. A session resume fails only when the session cannot be read, a snapshot fails security checks, or a target directory contains unexpected files. Blueprint failures never stop a resume.
266
315
 
267
- | Symptom | Fix | SDK error and code |
268
- | --- | --- | --- |
269
- | Session ID not found on this machine | If this machine keeps its sessions locally (`local-storage-not-joined`), join the shared database with `atomic storage join`, and remove any `sessions.storage` setting that keeps sessions local. If already joined (`shared-miss`), check the session ID, database URL, and prefix. | `ResumeNotFoundError` (`not-found`) |
270
- | Missing storage adapter, missing or unreadable credentials, or unavailable Git | Follow each fix listed in the error, such as running `atomic install`, creating the token or password file, or unsetting offline mode. | `ResumePreconditionError` (`preconditions-unmet`) |
271
- | Git cannot be started or downloaded | Follow the hint (install Git on `PATH` or unset `ATOMIC_OFFLINE`). Session resumes still open without restoring checkouts. | `GitUnavailableError` (`not-installed`, `unsupported-platform`, `offline`, `checksum-mismatch`, `download-failed`, `install-failed`) |
272
- | Shared database unreachable during lookup | Check connectivity with `atomic storage status` and resume again. | `ResumeCatalogUnavailableError` (`catalog-unavailable`) |
273
- | Shared database lookup timed out after 15 seconds | Check connectivity with `atomic storage status` and resume again. | `ResumeCatalogTimeoutError` (`catalog-timeout`) |
274
- | Checkout cannot be rebuilt exactly (denied unpushed commits, missing blob, or full disk) | Follow the notice (for unpushed commits, push from the original machine and resume again). Session resumes still open with the closest state. | `WorkspaceDriftError` (`tree-drift`) |
275
- | Windows worktree path exceeds Git for Windows limits | Set `ATOMIC_CODING_AGENT_DIR` to a shorter path ([Long paths on Windows](#long-paths-on-windows)). Nothing is written. | `WorkspaceRestoreError` (`path-too-long`) |
276
- | Snapshot fails security validation (credentials in remote URL, `ext::` remote helper, or malformed hashes) | Resume only sessions from trusted storage, or re-export from the source machine. Nothing is fetched or run. | `WorkspaceRestoreError` (`invalid-snapshot`) |
277
-
278
- Secret values never appear in error messages; errors name only the file or environment variable. SDK error classes, codes, and `isResume*Error` guards are exported from `@bastani/atomic`; see [Resuming on another machine](/sdk/reference#resuming-on-another-machine).
316
+ | Symptom | What to do |
317
+ | --- | --- |
318
+ | Session ID not found on this machine | If this machine keeps sessions locally, join the shared database with `atomic storage join` and remove any `sessions.storage` override. If already joined, check the session ID, database URL, and table prefix. |
319
+ | Missing storage adapter, missing or unreadable credentials, or offline mode | Follow each fix listed in the error—run `atomic install`, create the password or token file, or unset offline mode. |
320
+ | Git cannot be started or downloaded | Install Git on `PATH` or unset `ATOMIC_OFFLINE`. Session resumes still open without restoring checkouts. |
321
+ | Shared database unreachable or timed out after 15 seconds | Check connectivity with `atomic storage status` and resume again. |
322
+ | Checkout cannot be rebuilt identically (denied unpushed commits, missing blob, or full disk) | Follow the printed notice (for unpushed commits, push from the original machine and resume again). The session still opens with the closest state. |
323
+ | Windows worktree path exceeds Git for Windows limits | Set `ATOMIC_CODING_AGENT_DIR` to a shorter path ([Long paths on Windows](#long-paths-on-windows)). Nothing is written. |
324
+ | Snapshot fails security validation (credentials in remote URL, `ext::` helper, or malformed hashes) | Resume only sessions from trusted storage, or re-export from the source machine. Nothing is fetched or run. |
279
325
 
280
- ## Windows
326
+ Secret values never appear in error messages; errors name only the file or environment variable.
281
327
 
282
- Sessions resume on Windows as they do on Linux and macOS.
328
+ <Accordion title="SDK resume and blueprint error classes">
329
+ All resume and blueprint errors carry stable `code`, `hint`, `retryable`, and JSON-safe `fields` and are exported from `@bastani/atomic`:
283
330
 
284
- ### Long paths on Windows
331
+ - **Resume errors:** `ResumeNotFoundError` (`not-found`, reasons `local-storage-not-joined` / `shared-miss`), `ResumePreconditionError` (`preconditions-unmet`), `ResumeCatalogUnavailableError` (`catalog-unavailable`), `ResumeCatalogTimeoutError` (`catalog-timeout`), `GitUnavailableError`, `WorkspaceDriftError`, and `WorkspaceRestoreError` (`path-too-long`, `invalid-snapshot`), with `isResume*Error` guards. See [Resuming on another machine](/sdk/reference#resuming-on-another-machine) and [Worktree snapshot errors](/worktree-snapshots/reference#errors).
332
+ - **Blueprint errors (`BlueprintError`):** Resuming never throws a `BlueprintError`—instead, builds record failures in `BlueprintBuildOutcome.failures` so the session still resumes with warnings:
333
+ - `BlueprintInvalidError` (`code: "blueprint-invalid"`): invalid YAML or rule violation (`reason`: `yaml-syntax`, `not-a-mapping`, `invalid-shell`, `invalid-field`, `uses-in-maintenance`, `run-and-uses`, `missing-run-or-uses`, `with-without-uses`, `invalid-uses-reference`, `duplicate-platform`, `nested-includes`, `include-parent-path`, `duplicate-include`, or `post-build-not-global`).
334
+ - `BlueprintStepFailedError` (`code: "blueprint-step-failed"`): step exited non-zero, stopped by a signal, or could not start (`exitStatus`, `signal`, `logPath`).
335
+ - `BlueprintStepTimedOutError` (`code: "blueprint-step-timed-out"`): step exceeded its 3-hour timeout (`timeoutMs`, `elapsedMs`, `phase`, `logPath`).
336
+ - `BlueprintUsesUnsupportedError` (`code: "blueprint-uses-unsupported"`): `uses` action could not run (`reason`: `docker-action`, `unknown-action-type`, `action-not-found`, `action-fetch-failed`, `action-metadata-invalid`, `node-unavailable`, `required-input-missing`, or `unsupported-expression`).
337
+ - `BlueprintBuildFailedError` (`code: "blueprint-build-failed"`): build infrastructure failure (`phase`: `read-blueprint`, `ledger`, `environment`, or `unknown`).
338
+ - Match and pass across boundaries with `isBlueprintError`, `isBlueprintInvalidError`, `isBlueprintStepFailedError`, `isBlueprintStepTimedOutError`, `isBlueprintUsesUnsupportedError`, `isBlueprintBuildFailedError`, `findBlueprintError`, `serializeBlueprintError`, and `rehydrateBlueprintError`.
339
+ </Accordion>
285
340
 
286
- Atomic restores worktrees under `%USERPROFILE%\.atomic\agent` unless `ATOMIC_CODING_AGENT_DIR` overrides it. Even with `core.longpaths`, Git for Windows enforces path limits on administrative paths:
341
+ ## Long paths on Windows {#long-paths-on-windows}
287
342
 
288
- - Object store (`worktree-snapshots\repositories\<id>.git`): 220 characters
289
- - Worktree root: 212 characters
290
- - Worktree Git directory under `<store>\worktrees`: 247 characters
343
+ Sessions resume on Windows the same way as on Linux and macOS (see [Windows setup](/windows)).
291
344
 
292
- Atomic keeps internal directory names short, opens local SQLite files with the `\\?\` long-path prefix, and enables `core.longpaths` inside restored object stores. With these defaults, an agent directory path up to about 155 characters works.
345
+ Atomic restores worktrees under `%USERPROFILE%\.atomic\agent` unless `ATOMIC_CODING_AGENT_DIR` overrides it. Even with `core.longpaths`, Git for Windows enforces path limits on administrative paths (220 characters for the object store, 212 for the worktree root, and 247 for the worktree Git directory). Atomic keeps internal names short and enables `core.longpaths`, so an agent directory path up to about 155 characters works.
293
346
 
294
- If a longer agent directory would exceed those limits, restore fails before writing anything with `WorkspaceRestoreError` (`code: "path-too-long"`). Move the agent directory to a shorter path:
347
+ If a longer agent directory would exceed those limits, restore stops before writing anything. Point `ATOMIC_CODING_AGENT_DIR` at a shorter path:
295
348
 
296
349
  ```powershell
297
350
  $env:ATOMIC_CODING_AGENT_DIR = "C:\atomic\agent"