@bastani/atomic 0.10.9-alpha.1 → 0.10.10-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 (401) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +211 -155
  3. package/dist/_shared/dist-KOELCESV.js +2 -2
  4. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  5. package/dist/_shared/lib-4PES5P4V.js +2 -2
  6. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +27 -12
  7. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
  8. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +47 -7
  9. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
  10. package/dist/_shared/mode-shared-2QJSCUM6.js +48 -19
  11. package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
  12. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js → p1a-prewarm-XIU57JHF.js} +5 -5
  13. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js.map → p1a-prewarm-XIU57JHF.js.map} +1 -1
  14. package/dist/_shared/p2-shell-main-B2WIALFD.js +30 -25
  15. package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
  16. package/dist/_shared/runtime-O4KCSG4C.js +5 -5
  17. package/dist/_shared/{sdk-OSBEPR3Q.js → sdk-RRLVN7ER.js} +15 -9
  18. package/dist/_shared/sdk-RRLVN7ER.js.map +1 -0
  19. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  20. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  21. package/dist/_shared/settings-startup-8-DNZ2RIHM.js +4 -1
  22. package/dist/_shared/settings-startup-8-DNZ2RIHM.js.map +1 -1
  23. package/dist/_shared/{startup-0-0-TYUFUOJZ.js → startup-0-0-4VG2G44V.js} +427 -33
  24. package/dist/_shared/startup-0-0-4VG2G44V.js.map +1 -0
  25. package/dist/_shared/{startup-0-1-W2G2UY7R.js → startup-0-1-XTIL65D4.js} +18 -11
  26. package/dist/_shared/startup-0-1-XTIL65D4.js.map +1 -0
  27. package/dist/_shared/{startup-0-2-UXBUEOXW.js → startup-0-2-27OWFHV6.js} +145 -58
  28. package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -0
  29. package/dist/_shared/startup-0-3-T4DVFYWX.js +15 -25
  30. package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
  31. package/dist/_shared/{startup-0-4-HN5EB4K7.js → startup-0-4-ZMJV547D.js} +81 -12
  32. package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -0
  33. package/dist/_shared/startup-0-5-FD2P735I.js +90 -50
  34. package/dist/_shared/startup-0-5-FD2P735I.js.map +1 -1
  35. package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
  36. package/dist/_shared/startup-12-0-55AAXBJZ.js +13 -7
  37. package/dist/_shared/startup-12-0-55AAXBJZ.js.map +1 -1
  38. package/dist/_shared/startup-14-0-MLX36RBG.js +4 -4
  39. package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
  40. package/dist/_shared/startup-15-1-4S7FLMNG.js +88 -28
  41. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  42. package/dist/_shared/startup-8-0-34CBHPZH.js +5 -5
  43. package/dist/_shared/startup-8-1-4KANEHRA.js +61 -17
  44. package/dist/_shared/startup-8-1-4KANEHRA.js.map +1 -1
  45. package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
  46. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  47. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  48. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  49. package/dist/builtin/intercom/README.md +85 -114
  50. package/dist/builtin/intercom/broker/broker.bundle.mjs +3 -3
  51. package/dist/builtin/intercom/broker/presence-handler.ts +1 -1
  52. package/dist/builtin/intercom/group.ts +7 -3
  53. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  54. package/dist/builtin/intercom/package.json +1 -1
  55. package/dist/builtin/mcp/README.md +37 -27
  56. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  57. package/dist/builtin/mcp/package.json +1 -1
  58. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  59. package/dist/builtin/subagents/README.md +71 -138
  60. package/dist/builtin/subagents/package.json +1 -1
  61. package/dist/builtin/subagents/src/extension/index.bundle.mjs +213 -74
  62. package/dist/builtin/web-access/CHANGELOG.md +9 -0
  63. package/dist/builtin/web-access/README.md +60 -87
  64. package/dist/builtin/web-access/index.bundle.mjs +387 -351
  65. package/dist/builtin/web-access/package.json +1 -1
  66. package/dist/cli/args.js +2 -2
  67. package/dist/cli/auth-cli.code.js +4 -4
  68. package/dist/cli/auth-cli.impl.js +3 -3
  69. package/dist/cli/auth-cli.js +3 -3
  70. package/dist/cli/blueprint-command.code.js +2 -2
  71. package/dist/cli/blueprint-command.impl.js +3 -3
  72. package/dist/cli/blueprint-command.js +3 -3
  73. package/dist/cli/intercom-command.code.js +3 -3
  74. package/dist/cli/intercom-command.impl.js +3 -3
  75. package/dist/cli/intercom-command.js +3 -3
  76. package/dist/cli/list-models.code.js +3 -3
  77. package/dist/cli/list-models.impl.js +3 -3
  78. package/dist/cli/list-models.js +3 -3
  79. package/dist/cli/session-picker.code.js +2 -2
  80. package/dist/cli/session-picker.impl.js +3 -3
  81. package/dist/cli/session-picker.js +3 -3
  82. package/dist/cli/startup-ui.code.js +2 -2
  83. package/dist/cli/startup-ui.impl.js +3 -3
  84. package/dist/cli/startup-ui.js +3 -3
  85. package/dist/cli/storage-command.impl.js +3 -3
  86. package/dist/cli/storage-command.js +3 -3
  87. package/dist/cli/storage-search-session.code.js +2 -2
  88. package/dist/cli/storage-search-session.impl.js +3 -3
  89. package/dist/cli/storage-search-session.js +3 -3
  90. package/dist/cli/team-command.code.js +2 -2
  91. package/dist/cli/team-command.impl.js +3 -3
  92. package/dist/cli/team-command.js +3 -3
  93. package/dist/cli.js +2 -2
  94. package/dist/core/agent-session-methods.d.ts +4 -1
  95. package/dist/core/agent-session-methods.js.map +1 -1
  96. package/dist/core/agent-session.d.ts +3 -0
  97. package/dist/core/compaction/compactor.d.ts +20 -14
  98. package/dist/core/compaction/errors.d.ts +120 -0
  99. package/dist/core/compaction/index.d.ts +1 -0
  100. package/dist/core/compaction/model-resolver.d.ts +2 -2
  101. package/dist/core/debug.impl.js +3 -3
  102. package/dist/core/debug.js +3 -3
  103. package/dist/core/export-html/card-projection.impl.js +3 -3
  104. package/dist/core/export-html/card-projection.js +3 -3
  105. package/dist/core/export-html/index.code.js +2 -2
  106. package/dist/core/export-html/index.impl.js +3 -3
  107. package/dist/core/export-html/index.js +3 -3
  108. package/dist/core/export-html/json-spans.impl.js +3 -3
  109. package/dist/core/export-html/json-spans.js +3 -3
  110. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  111. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  112. package/dist/core/export-html/tool-renderer.code.js +1 -1
  113. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  114. package/dist/core/export-html/tool-renderer.js +3 -3
  115. package/dist/core/extensions/api-types.d.ts +1 -1
  116. package/dist/core/extensions/api-types.js.map +1 -1
  117. package/dist/core/extensions/index.d.ts +1 -1
  118. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  119. package/dist/core/extensions/jiti-loader.js +3 -3
  120. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  121. package/dist/core/extensions/jiti-static-loader.js +3 -3
  122. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  123. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  124. package/dist/core/extensions/loader-host-modules.js +3 -3
  125. package/dist/core/extensions/loader-virtual-modules.js +1 -1
  126. package/dist/core/extensions/provider-types.d.ts +18 -6
  127. package/dist/core/extensions/provider-types.js.map +1 -1
  128. package/dist/core/extensions/runner-context.js +1 -1
  129. package/dist/core/intercom-broker-control-host.code.js +1 -1
  130. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  131. package/dist/core/intercom-broker-control-host.js +3 -3
  132. package/dist/core/intercom-broker-control.code.js +3 -3
  133. package/dist/core/intercom-broker-control.impl.js +3 -3
  134. package/dist/core/intercom-broker-control.js +3 -3
  135. package/dist/core/model-config.d.ts +40 -0
  136. package/dist/core/model-registry.js +1 -1
  137. package/dist/core/model-resolver-scope.d.ts +4 -4
  138. package/dist/core/model-runtime.d.ts +1 -1
  139. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  140. package/dist/core/package-manager-storage-adapters.js +3 -3
  141. package/dist/core/provider-composer-internal.d.ts +11 -2
  142. package/dist/core/sdk.code.js +3 -3
  143. package/dist/core/sdk.impl.js +3 -3
  144. package/dist/core/sdk.js +3 -3
  145. package/dist/core/session-manager-core.js +5 -5
  146. package/dist/core/session-manager-list.impl.js +3 -3
  147. package/dist/core/session-manager-list.js +3 -3
  148. package/dist/core/session-manager.code.js +1 -1
  149. package/dist/core/session-manager.impl.js +3 -3
  150. package/dist/core/session-manager.js +3 -3
  151. package/dist/core/session-storage.impl.js +3 -3
  152. package/dist/core/session-storage.js +3 -3
  153. package/dist/core/settings-manager-basic-accessors.d.ts +6 -2
  154. package/dist/core/storage/index.js +2 -2
  155. package/dist/core/storage/node-sqlite-thread.js +2 -2
  156. package/dist/core/storage/node-sqlite.js +2 -2
  157. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  158. package/dist/core/storage/offline-snapshot-file.js +3 -3
  159. package/dist/core/storage/provider.js +2 -2
  160. package/dist/core/storage/selection.js +2 -2
  161. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  162. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  163. package/dist/core/storage/session/branch-fork-source.js +3 -3
  164. package/dist/core/storage/session/card-view.impl.js +3 -3
  165. package/dist/core/storage/session/card-view.js +3 -3
  166. package/dist/core/storage/session/child-reader.code.js +3 -3
  167. package/dist/core/storage/session/child-reader.impl.js +3 -3
  168. package/dist/core/storage/session/child-reader.js +3 -3
  169. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  170. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  171. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  172. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  173. package/dist/core/storage/session/expanded-child-details.js +3 -3
  174. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  175. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  176. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  177. package/dist/core/storage/session/fork-row-index.js +3 -3
  178. package/dist/core/storage/session/fork-staging.code.js +2 -2
  179. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  180. package/dist/core/storage/session/fork-staging.js +3 -3
  181. package/dist/core/storage/session/fork-window.code.js +3 -3
  182. package/dist/core/storage/session/fork-window.impl.js +3 -3
  183. package/dist/core/storage/session/fork-window.js +3 -3
  184. package/dist/core/storage/session/history-pages.impl.js +3 -3
  185. package/dist/core/storage/session/history-pages.js +3 -3
  186. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  187. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  188. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  189. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  190. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  191. package/dist/core/storage/session/memory-session-store.js +3 -3
  192. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  193. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  194. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  195. package/dist/core/storage/session/released-history-files.code.js +3 -3
  196. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  197. package/dist/core/storage/session/released-history-files.js +3 -3
  198. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  199. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  200. package/dist/core/storage/session/session-resume.impl.js +3 -3
  201. package/dist/core/storage/session/session-resume.js +3 -3
  202. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  203. package/dist/core/storage/session/snapshot-cut.js +3 -3
  204. package/dist/core/storage/session/snapshot-history.code.js +3 -3
  205. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  206. package/dist/core/storage/session/snapshot-history.js +3 -3
  207. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  208. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  209. package/dist/core/storage/session/sql-session-store.js +3 -3
  210. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  211. package/dist/core/storage/session/tree-outline.js +3 -3
  212. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  213. package/dist/core/storage/session/tree-presentation.js +3 -3
  214. package/dist/core/storage/storage-status.impl.js +3 -3
  215. package/dist/core/storage/storage-status.js +3 -3
  216. package/dist/core/storage/team.impl.js +3 -3
  217. package/dist/core/storage/team.js +3 -3
  218. package/dist/core/structured-output/index.code.js +1 -1
  219. package/dist/core/structured-output/index.impl.js +3 -3
  220. package/dist/core/structured-output/index.js +3 -3
  221. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  222. package/dist/core/tasks/task-completion-entry.js +3 -3
  223. package/dist/core/tasks/task-file-history.code.js +3 -3
  224. package/dist/core/tasks/task-file-history.impl.js +3 -3
  225. package/dist/core/tasks/task-file-history.js +3 -3
  226. package/dist/core/tasks/task-reference-archive.code.js +4 -4
  227. package/dist/core/tasks/task-reference-archive.js +3 -3
  228. package/dist/core/tasks/task-reference-identity.code.js +1 -1
  229. package/dist/core/tasks/task-reference-identity.js +3 -3
  230. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  231. package/dist/core/tasks/task-reference-stream.js +3 -3
  232. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  233. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  234. package/dist/core/tasks/task-view-source.impl.js +3 -3
  235. package/dist/core/tasks/task-view-source.js +3 -3
  236. package/dist/core/tools/read-url.code.js +2 -2
  237. package/dist/core/tools/read-url.impl.js +3 -3
  238. package/dist/core/tools/read-url.js +3 -3
  239. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  240. package/dist/core/worktree-snapshot/errors.code.js +3 -3
  241. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  242. package/dist/core/worktree-snapshot/errors.js +3 -3
  243. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  244. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  245. package/dist/extensions/codemode/execute.code.js +1 -1
  246. package/dist/extensions/codemode/execute.impl.js +3 -3
  247. package/dist/extensions/codemode/execute.js +3 -3
  248. package/dist/extensions/codemode/renderer.code.js +2 -2
  249. package/dist/extensions/codemode/renderer.impl.js +3 -3
  250. package/dist/extensions/codemode/renderer.js +3 -3
  251. package/dist/extensions/mcp/cli.code.js +2 -2
  252. package/dist/extensions/mcp/cli.impl.js +3 -3
  253. package/dist/extensions/mcp/cli.js +3 -3
  254. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  255. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  256. package/dist/extensions/mcp/cli.lazy.js +3 -3
  257. package/dist/extensions/mcp/runtime.code.js +1 -1
  258. package/dist/extensions/mcp/runtime.impl.js +3 -3
  259. package/dist/extensions/mcp/runtime.js +3 -3
  260. package/dist/index-extensions.d.ts +1 -1
  261. package/dist/index.d.ts +8 -1
  262. package/dist/index.js +7 -7
  263. package/dist/main-first-time-setup.code.js +2 -2
  264. package/dist/main-first-time-setup.impl.js +3 -3
  265. package/dist/main-first-time-setup.js +3 -3
  266. package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -0
  267. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  268. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  269. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  270. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  271. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  272. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  273. package/dist/modes/interactive/theme/color-utils.d.ts +5 -5
  274. package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
  275. package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
  276. package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
  277. package/dist/modes/print-mode.js +1 -1
  278. package/dist/modes/rpc/rpc-client-api.d.ts +6 -0
  279. package/dist/modes/rpc/rpc-types.d.ts +29 -2
  280. package/dist/package-manager-cli.code.js +5 -5
  281. package/dist/package-manager-cli.impl.js +3 -3
  282. package/dist/package-manager-cli.js +3 -3
  283. package/dist/rpc-entry.js +1 -1
  284. package/dist/startup-files.json +1 -1
  285. package/dist/startup-stages/5.js +1 -1
  286. package/dist/startup-stages/7.js +1 -1
  287. package/dist/startup-stages/8.js +1 -2
  288. package/dist/startup-stages/9.js +2 -1
  289. package/dist/utils/native-module.d.ts +44 -0
  290. package/dist/utils/startup-database-spare.code.js +3 -3
  291. package/dist/utils/startup-database-spare.impl.js +3 -3
  292. package/dist/utils/startup-database-spare.js +3 -3
  293. package/dist/utils/tools-manager.code.js +1 -1
  294. package/dist/utils/tools-manager.impl.js +3 -3
  295. package/dist/utils/tools-manager.js +3 -3
  296. package/docs/background-tasks.md +235 -243
  297. package/docs/build.md +12 -11
  298. package/docs/codemode.md +60 -51
  299. package/docs/compaction/reference.md +61 -24
  300. package/docs/compaction.md +117 -65
  301. package/docs/computer-use.md +179 -146
  302. package/docs/containerization.md +79 -33
  303. package/docs/custom-provider/api-reference.md +148 -11
  304. package/docs/custom-provider/oauth.md +44 -27
  305. package/docs/custom-provider/override.md +14 -7
  306. package/docs/custom-provider/registration.md +75 -65
  307. package/docs/custom-provider/streaming.md +42 -19
  308. package/docs/custom-provider.md +25 -61
  309. package/docs/development.md +47 -43
  310. package/docs/docs.json +33 -33
  311. package/docs/environment-variables.md +83 -57
  312. package/docs/extensions/api-reference.md +323 -734
  313. package/docs/extensions/authoring.md +186 -269
  314. package/docs/extensions/events.md +308 -375
  315. package/docs/extensions/examples.md +122 -74
  316. package/docs/extensions/ui.md +217 -197
  317. package/docs/extensions.md +152 -259
  318. package/docs/getting-started/authentication.md +27 -14
  319. package/docs/getting-started/first-session.md +25 -26
  320. package/docs/getting-started/installation.md +62 -84
  321. package/docs/getting-started/project-instructions.md +39 -14
  322. package/docs/guides/configuration.md +42 -20
  323. package/docs/guides/intercom.md +17 -13
  324. package/docs/guides/non-interactive.md +29 -16
  325. package/docs/guides/orchestration.md +16 -10
  326. package/docs/guides/resume-on-any-machine.md +54 -49
  327. package/docs/guides/subagents.md +22 -14
  328. package/docs/guides/team-setup.md +37 -26
  329. package/docs/guides.md +22 -21
  330. package/docs/herdr.md +21 -16
  331. package/docs/index.md +16 -17
  332. package/docs/intercom/operations.md +68 -66
  333. package/docs/intercom/reference.md +196 -191
  334. package/docs/intercom.md +103 -92
  335. package/docs/json.md +71 -71
  336. package/docs/keybindings.md +63 -50
  337. package/docs/libraries/agent-core.md +49 -8
  338. package/docs/libraries/ai.md +21 -12
  339. package/docs/libraries/codemode.md +28 -6
  340. package/docs/libraries/schema.md +7 -7
  341. package/docs/libraries/telemetry.md +7 -7
  342. package/docs/libraries/tui.md +74 -94
  343. package/docs/libraries.md +5 -5
  344. package/docs/llama-cpp.md +38 -33
  345. package/docs/mcp-servers.md +96 -90
  346. package/docs/models/reference.md +46 -33
  347. package/docs/models-configuration.md +12 -6
  348. package/docs/models.md +93 -88
  349. package/docs/orchestration/migrating-workflows.md +21 -19
  350. package/docs/orchestration/patterns.md +35 -20
  351. package/docs/orchestration.md +22 -21
  352. package/docs/packages/authoring.md +28 -19
  353. package/docs/packages/reference.md +75 -16
  354. package/docs/packages.md +31 -33
  355. package/docs/programmatic.md +22 -21
  356. package/docs/prompt-templates.md +63 -41
  357. package/docs/providers/reference.md +35 -19
  358. package/docs/providers.md +61 -71
  359. package/docs/quickstart.md +32 -46
  360. package/docs/reference/cli.md +249 -252
  361. package/docs/reference.md +23 -20
  362. package/docs/rpc/examples.md +74 -17
  363. package/docs/rpc/extension-ui.md +79 -62
  364. package/docs/rpc/protocol.md +816 -358
  365. package/docs/rpc.md +75 -151
  366. package/docs/sdk/reference.md +175 -45
  367. package/docs/sdk/structured-decisions.md +92 -62
  368. package/docs/sdk/web-server.md +79 -46
  369. package/docs/sdk.md +237 -195
  370. package/docs/security.md +106 -43
  371. package/docs/session-format.md +96 -59
  372. package/docs/sessions.md +149 -113
  373. package/docs/settings.md +289 -204
  374. package/docs/shell-aliases.md +15 -6
  375. package/docs/skills/authoring.md +17 -9
  376. package/docs/skills/reference.md +23 -21
  377. package/docs/skills.md +104 -97
  378. package/docs/storage.md +140 -242
  379. package/docs/subagents/authoring.md +147 -16
  380. package/docs/subagents/reference.md +100 -30
  381. package/docs/subagents.md +220 -252
  382. package/docs/terminal-setup.md +97 -69
  383. package/docs/termux.md +51 -85
  384. package/docs/themes/reference.md +51 -37
  385. package/docs/themes.md +49 -54
  386. package/docs/tmux.md +38 -21
  387. package/docs/tools.md +198 -147
  388. package/docs/tui/reference.md +64 -32
  389. package/docs/tui.md +38 -66
  390. package/docs/usage.md +76 -78
  391. package/docs/verification.md +25 -25
  392. package/docs/web-access.md +72 -55
  393. package/docs/windows.md +53 -58
  394. package/docs/worktree-snapshots.md +62 -65
  395. package/package.json +8 -8
  396. package/schemas/models.schema.json +51 -0
  397. package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
  398. package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
  399. package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
  400. package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
  401. package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
@@ -1,39 +1,52 @@
1
1
  ---
2
- title: "Non-interactive use"
3
- description: "Orientation for running Atomic without the interactive TUI: print mode, the JSON event stream, and RPC."
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."
4
5
  ---
5
6
 
6
- # Non-interactive use
7
-
8
- Atomic's session engine supports three non-interactive entry points. Use the table below to choose one, or embed the engine with the SDK.
7
+ You can run Atomic without the terminal UI in three ways, or embed it directly in TypeScript with the SDK.
9
8
 
10
9
  | You want | Use | Read |
11
10
  | --- | --- | --- |
12
- | One prompt, one answer, then exit | Print mode (`-p`, `--print`) | [CLI reference](/reference/cli#modes) |
13
- | A machine-readable stream of everything the session does | JSON event stream | [JSON event stream](/json) |
14
- | A long-lived session another program drives | RPC | [RPC](/rpc) |
15
- | To embed Atomic in your own TypeScript program | SDK | [SDK](/sdk) |
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) |
16
15
 
17
16
  ## Print mode
18
17
 
19
- `atomic --print "..."` (or `-p`) runs a single turn and exits. It reads piped stdin and merges it into the prompt, so it composes with shell pipelines. See the [CLI reference](/reference/cli) for all flags, exit codes, and stdin merge rules.
18
+ `atomic --print "..."` (or `-p`) runs prompts without launching the terminal UI and exits when done.
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`, 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"`.
24
+ - **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.
25
+ - **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
26
 
21
- 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.
27
+ ### Exit codes and signals
22
28
 
23
- On Linux and macOS, `SIGTERM` or `SIGHUP` stops a print-mode run after the session shuts down and exits with code `143` or `129`. 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.
29
+ | Exit code | Meaning |
30
+ | --- | --- |
31
+ | `0` | Completed normally |
32
+ | `1` | Model error, aborted or truncated response, session write conflict, or CLI error |
33
+ | `75` | Target `--session` is already open in another live Atomic process |
34
+ | `129` | Stopped by `SIGHUP` on Linux or macOS after graceful shutdown |
35
+ | `130` | Stopped by `SIGINT` (`Ctrl+C`) after graceful shutdown |
36
+ | `143` | Stopped by `SIGTERM` on Linux or macOS after graceful shutdown |
24
37
 
25
- Extension commands also work 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.
38
+ 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.
26
39
 
27
40
  ## JSON events
28
41
 
29
- Use the JSON event stream 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.
42
+ 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.
30
43
 
31
44
  ## RPC
32
45
 
33
- RPC keeps 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).
46
+ 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).
34
47
 
35
48
  ## Next steps
36
49
 
37
- - [CLI reference](/reference/cli) for every flag and exit code.
50
+ - [CLI reference](/reference/cli) for every flag, model-matching rule, and exit code.
38
51
  - [Programmatic use](/programmatic) to choose between the SDK, RPC, and the JSON event stream.
39
52
  - [Background tasks](/background-tasks) when work should continue while you keep chatting interactively.
@@ -1,20 +1,26 @@
1
1
  ---
2
- title: "Plan a task with subagents"
3
- description: "Ask Atomic to split work, check the results, and pick up after an interruption."
2
+ title: "Plan multi-step work"
3
+ sidebarTitle: "Plan multi-step work"
4
+ description: "Delegate multi-step work in plain language, monitor background subagents, and resume after interruptions."
4
5
  ---
5
6
 
6
- # Plan a task with subagents
7
-
8
- This page introduces multi-step task delegation in plain language. Give Atomic a goal, a way to verify completion, and any limits on edits, cost, or time. You do not need to write JavaScript.
7
+ Give Atomic a goal, a way to verify completion, and any limits on edits, cost, or time. You do not need to write JavaScript to split work across agents.
9
8
 
10
9
  > Review the installation guide for Linux and Windows. Give each platform to a separate read-only agent. Check disputed commands against the CLI, then report discrepancies by platform. Do not edit files.
11
10
 
12
- The parent session launches the reviews and continues as each child reports back. Open `/tasks` or focus the agent panel below the prompt to check which reviews are queued, running, or finished. Select any child to read its transcript or send it a message on the same screen without interrupting the others. If you close Atomic, reopen the same parent session to restore its unfinished children and inspect their results.
11
+ Your main session launches the subagents in the background and continues as each subagent reports back. To check which subagents are queued, running, or finished, run `/tasks` or focus the agent panel below the prompt (press `↓` on an empty prompt, or click a row in fullscreen mode). Select any subagent to read its live transcript or send it a message on the same screen without interrupting the others.
12
+
13
+ If you close Atomic while subagents are running, reopen the same main session to restore them and collect their results:
14
+
15
+ - Running subagents relaunch automatically when you reopen the session.
16
+ - Paused and quit subagents stay awaiting manual resume unless you set `resumeInFlight` to `"ask"` or `"auto"` in `~/.atomic/agent/extensions/subagent/config.json`.
17
+ - Forking a session (`/fork` or `--fork`) never restores the original session's subagents.
18
+ - Sessions started with `--no-session` are not saved, so their subagents cannot be restored after Atomic closes.
13
19
 
14
20
  ## Next steps
15
21
 
16
- - [Orchestration](/orchestration) explains how the parent coordinates multi-step work with codemode and subagents.
22
+ - [Orchestrate with codemode and subagents](/orchestration) explains how your main session coordinates multi-step work using small JavaScript scripts in codemode alongside subagents.
17
23
  - [Orchestration patterns](/orchestration/patterns) shows seven reusable ways to split and verify work.
18
- - [Subagents](/subagents) covers bundled specialists, execution modes, and run control.
19
- - [Background and parallel work](/background-tasks) explains the agent panel, `/tasks`, and background shells.
20
- - [Skills as workflows](/skills#skills-as-workflows) explains how to save a repeatable procedure as a skill. If you have a workflow file from an earlier release, follow [Convert an earlier workflow into a skill](/orchestration/migrating-workflows).
24
+ - [Run subagents](/subagents) covers bundled specialists, context modes, worktrees, and run control.
25
+ - [Manage background tasks](/background-tasks) explains the agent panel, `/tasks`, heartbeats, and background shells.
26
+ - [Skills as workflows](/skills#skills-as-workflows) explains how to save a repeatable procedure as a skill. If you have a workflow file from an earlier release, follow [Migrate an earlier workflow to a skill](/orchestration/migrating-workflows).
@@ -1,15 +1,14 @@
1
1
  ---
2
- title: Resume on any machine
3
- description: "Continue a session on another machine that shares your storage: what Atomic restores, when it asks, how blueprints set the environment up again, and what each error means."
2
+ title: "Resume sessions on any machine"
3
+ sidebarTitle: "Resume anywhere"
4
+ description: "Continue sessions on another machine using shared storage, worktree snapshots, and environment blueprints."
4
5
  ---
5
6
 
6
- # Resume on any machine
7
-
8
- 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 state it was working against, and continues the conversation where it stopped.
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.
9
8
 
10
9
  ## Join each machine
11
10
 
12
- Every machine must use the same shared database, either PostgreSQL or libSQL / Turso.
11
+ Every machine must use the same shared database, either PostgreSQL or Turso / libSQL.
13
12
 
14
13
  **PostgreSQL:**
15
14
 
@@ -27,9 +26,11 @@ atomic install npm:@bastani/atomic-storage-libsql
27
26
  atomic storage join libsql://<db>.turso.io --token-file ~/turso-token
28
27
  ```
29
28
 
30
- `atomic storage join` stores sessions in the shared database so they resume on any joined machine. By contrast, `atomic team join` shares Intercom while keeping sessions local. To share sessions on a machine joined with `atomic team join`, run `atomic team leave` and then `atomic storage join`. See [Sharing storage across hosts](/storage#sharing-storage-across-hosts) for prefixes, tokens, and `atomic storage status`.
29
+ `atomic storage join` stores sessions in the shared database so they resume on any joined machine. By contrast, `atomic team join` shares Intercom while keeping personal sessions local. To share sessions on a machine joined with `atomic team join`, run `atomic team leave` and then `atomic storage join`. See [Sharing storage across hosts](/storage#sharing-storage-across-hosts) for prefixes, tokens, and `atomic storage status`.
30
+
31
+ 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`.
31
32
 
32
- 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. 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).
33
+ 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).
33
34
 
34
35
  ## Resume a session
35
36
 
@@ -58,17 +59,17 @@ Error: Session <id> is already open in process <pid> on <host>. Nothing was chan
58
59
 
59
60
  Interactive mode prints the same message before starting. If several resumes start simultaneously, one succeeds and the others exit with code `75`.
60
61
 
61
- 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.
62
+ 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.
62
63
 
63
64
  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.
64
65
 
65
- ## Wake a released subagent
66
+ ## Resuming subagents on another machine
66
67
 
67
- Both fresh and forked (`context: "fork"`) subagents store their sessions in the launching parent's shared database and can wake, resume, and export on another machine.
68
+ Both fresh and forked (`context: "fork"`) subagents store their sessions in the launching parent's shared database and can resume and export on another machine.
68
69
 
69
- When a released subagent wakes on another machine, Atomic maps its recorded directory through the parent session's restored checkouts, then prepares the subagent's own checkouts from its snapshots and builds their blueprints. Its file tools resolve old absolute paths into the restored worktrees.
70
+ When a background subagent resumes on another machine, Atomic maps its recorded directory through the parent session's restored checkouts, then prepares the subagent's own checkouts from its snapshots and builds their blueprints. Its file tools resolve old absolute paths into the restored worktrees.
70
71
 
71
- Only subagents launched with an explicit `sessionDir`, subagents whose parent uses JSONL session files, or file-backed subagents created by releases before 0.10.4 stay tied to the machine that launched them and report as unrestorable elsewhere.
72
+ Only subagents launched with an explicit `sessionDir`, subagents whose parent uses JSONL session files, or legacy file-backed subagents stay tied to the machine that launched them and report as unrestorable elsewhere.
72
73
 
73
74
  ## Set the environment up with a blueprint
74
75
 
@@ -81,6 +82,7 @@ A restored worktree contains repository files, not installed dependencies, runti
81
82
  | Workspace | `<dir>/.atomic/blueprint.yaml`, listed in `includes` of the repository blueprint | Workspace directory |
82
83
 
83
84
  ```yaml
85
+ runs-on: [linux, macos, windows]
84
86
  includes:
85
87
  - services/api
86
88
  initialize:
@@ -99,6 +101,8 @@ knowledge:
99
101
  Run the tests with `pnpm test`.
100
102
  ```
101
103
 
104
+ **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.
105
+
102
106
  | Section | Purpose | When it runs |
103
107
  | --- | --- | --- |
104
108
  | `initialize` | Install tools, runtimes, and system packages | During a build |
@@ -106,24 +110,26 @@ knowledge:
106
110
  | `knowledge` | List of `{ name, contents }` items (by convention `lint`, `test`, and `build`) | Never executed. Provided to the agent as context |
107
111
  | `post-build` | Verify the assembled environment (global blueprint only) | During a build, after all repositories |
108
112
 
109
- 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` and takes string values.
113
+ 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 `""`.
110
114
 
111
- `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`). Node.js and composite GitHub Actions are supported; Docker actions and composite actions using `hashFiles`, `secrets`, or `matrix` expressions fail the step. Actions cache under `~/.atomic/agent/blueprint-actions`. Set `ATOMIC_BLUEPRINT_GITHUB_BASE_URL` to fetch actions from a host other than `https://github.com`.
115
+ `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`.
112
116
 
113
117
  Key blueprint rules:
114
118
 
115
- - **Shell.** `run` steps execute in bash (Git Bash on Windows) and stop at the first failing command. Set `shell: powershell` to run in PowerShell on Windows. Commands must be non-interactive.
116
- - **Environment.** Step `env` applies to that step only. Append exports to `$ENVRC` (for example `echo "API_URL=http://localhost:3000" >> $ENVRC` or `export PATH=...`) to pass variables to later steps and the resumed session's bash tool. In PowerShell, append 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.
119
+ - **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.
120
+ - **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.
121
+ - **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.
117
122
  - **Timeout.** Any step running longer than 3 hours is stopped and marked failed.
118
- - **Platforms.** `runs-on` accepts a string or list (`default` and `linux` are aliases; `macos` and `windows` are explicit). 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.
119
123
  - **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`.
120
124
  - **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.
121
125
 
122
- ### Builds
126
+ 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`.
127
+
128
+ ### How blueprint builds run
123
129
 
124
130
  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.
125
131
 
126
- Builds run project code, so they execute only for trusted projects (saved trust, `--approve`, or `"defaultProjectTrust": "always"`). Untrusted worktrees are skipped silently, and the global blueprint runs only when at least one restored worktree is trusted.
132
+ **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.
127
133
 
128
134
  Builds are differential. Atomic compares each workspace blueprint against the last successful build on this machine:
129
135
 
@@ -139,7 +145,7 @@ A step fails if its command exits non-zero, raises a PowerShell error, times out
139
145
  | Global blueprint or `post-build` failed | Failed. Repository blueprints do not run. | Prominent warning. The session still resumes |
140
146
  | No blueprint, untrusted worktree, or no matching platform | Nothing ran | Nothing |
141
147
 
142
- On Windows, if a stopped step could not be placed in a Job object after its root command exited, Atomic warns that child processes may still be running. Check for leftover processes before retrying.
148
+ 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.
143
149
 
144
150
  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.
145
151
 
@@ -166,7 +172,7 @@ To override the mode default, set `resume.waitForBlueprint` in settings:
166
172
  { "resume": { "waitForBlueprint": "prompt" } }
167
173
  ```
168
174
 
169
- When a user or global extension registers a `project_trust` handler that can decline saved trust ([Project trust](/security#project-trust)), resume always defers the build like `"tools"` until trust is decided. Worktrees not covered by trust stay unbuilt.
175
+ 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.
170
176
 
171
177
  ### What the agent sees
172
178
 
@@ -176,7 +182,7 @@ The first turn of a resumed session includes each applicable blueprint's `mainte
176
182
 
177
183
  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.
178
184
 
179
- ```sh
185
+ ```bash
180
186
  atomic blueprint cache-key [dir] [--format text|json|github-output]
181
187
  ```
182
188
 
@@ -196,7 +202,7 @@ Atomic detects package stores automatically from lockfiles at the repository roo
196
202
  | `build.gradle(.kts)`, `settings.gradle(.kts)`, `gradle.lockfile`, Gradle wrapper | `~/.gradle/caches`, `~/.gradle/wrapper` (`GRADLE_USER_HOME`) |
197
203
  | `pom.xml` | `~/.m2/repository` |
198
204
 
199
- Environment variables in parentheses move each store, and `XDG_CACHE_HOME` moves Linux `~/.cache` paths. macOS uses `~/Library/Caches` (and `~/Library/pnpm/store` for pnpm; npm, uv, Bun, Cargo, Go modules, Gradle, and Maven match Linux). Windows uses `%LOCALAPPDATA%` (such as `npm-cache`, `pnpm\store`, `Yarn\Cache`, `uv\cache`, and `pip\Cache`). Subdirectory lockfiles in monorepos are not auto-detected.
205
+ 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.
200
206
 
201
207
  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:
202
208
 
@@ -214,8 +220,8 @@ Declare additional stores or build outputs under `resume.cache` in `.atomic/sett
214
220
  Each entry takes `paths`, an optional `kind`, and optional `keyFiles`:
215
221
 
216
222
  - `"kind": "store"` (default) paths must be absolute or start with `~/` outside the worktree and join the `stores` entry.
217
- - `"kind": "build"` paths must be repository-relative and name build outputs parked by `atomic blueprint prebuild --park` under `~/.atomic/agent/worktree-snapshots/seeds/`.
218
- - `keyFiles` lists root-relative files hashed into the key (defaulting to detected lockfiles and toolchain files).
223
+ - `"kind": "build"` paths must be repository-relative and name build outputs parked by `atomic blueprint prebuild --park` under `~/.atomic/agent/worktree-snapshots/seeds/`. Build paths cannot name `.npmrc`, `.pypirc`, `.yarnrc.yml`, or snapshot-denied paths. If a `"build"` path contains Git-tracked files, `cache-key` warns and `prebuild --park` parks only untracked and ignored files under it while leaving tracked files untouched.
224
+ - `keyFiles` lists root-relative files hashed into the key (defaulting to detected lockfiles and toolchain files). `keyFiles` cannot be empty (`[]` causes the entry to be ignored with a warning) and cannot contain `..` or absolute/drive paths.
219
225
  - Paths must be literal paths without glob characters (`*`, `?`, `[`, `]`, `{`, `}`) or a leading `!`. Invalid entries are skipped with a warning.
220
226
 
221
227
  | Entry | Paths | Key changes when |
@@ -223,11 +229,11 @@ Each entry takes `paths`, an optional `kind`, and optional `keyFiles`:
223
229
  | `stores` | Detected package stores plus `"store"` paths in `resume.cache` | Lockfiles, `keyFiles`, `resume.cache`, repository blueprint, OS, or architecture change |
224
230
  | `build` | Parked `"build"` paths and seed manifest | Same inputs as `stores` |
225
231
  | `git` | Atomic's Git object store for the repository | Checkout `HEAD` changes (restore newest via restore prefix) |
226
- | `atomic` | Atomic's extension transpile cache | Atomic version, OS, or architecture change |
232
+ | `atomic` | Atomic's compiled extension cache | Atomic version, OS, or architecture change |
227
233
 
228
234
  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).
229
235
 
230
- To protect secrets, `cache-key` omits store paths inside the worktree and paths that can hold credentials (such as `~/.ssh`, `~/.cargo`, `~/.config/gh`, `.npmrc`, `.env*`, and the [snapshot deny list](/worktree-snapshots#what-is-left-out)), checking case-insensitively and across symlinks, with a warning on stderr.
236
+ 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.
231
237
 
232
238
  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.
233
239
 
@@ -235,21 +241,24 @@ Use `--format github-output` to emit `<name>-key`, `<name>-restore-prefix`, and
235
241
 
236
242
  `atomic blueprint prebuild` prepares a repository ahead of time so a later resume starts with dependencies and build artifacts already built:
237
243
 
238
- ```sh
244
+ ```bash
239
245
  atomic blueprint prebuild [dir] [--park] [--approve]
240
246
  ```
241
247
 
242
248
  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.
243
249
 
244
- The checkout must have a Git remote and no uncommitted changes to tracked files. Because prebuild runs project code, it requires a trusted project (saved trust, `"defaultProjectTrust": "always"`, or `--approve`). If a blueprint step fails, prebuild exits `1`, deletes the new worktree, and preserves earlier worktrees and seeds. Timings print to stderr.
250
+ Prebuild requires:
245
251
 
246
- 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.
252
+ - `snapshots.enabled` set to `true` (otherwise it exits with `snapshots are disabled`).
253
+ - A Git remote on the checkout.
254
+ - No uncommitted edits to tracked files, and no unpushed commits touching denied secret files (`unpushed-history-denied`).
255
+ - A trusted project (saved trust, `"defaultProjectTrust": "always"`, or `--approve`), because prebuild runs project code.
247
256
 
248
- If parking cannot acquire the seed lock (including after a 10-second `EPERM` retry on Windows), prebuild reports the error, leaves existing seeds intact, and keeps the completed build in its idle worktree for local reuse.
257
+ If a blueprint step fails, prebuild exits `1`, deletes the new worktree, and preserves earlier worktrees and seeds. Timings print to stderr.
249
258
 
250
- ### `resume.setupCommand` and `.atomic/setup`
259
+ 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.
251
260
 
252
- `.atomic/setup` is no longer read. `resume.setupCommand` is deprecated, acts temporarily as an alias for a single global maintenance step in each restored worktree, and prints a deprecation warning when set. Move setup commands into the `maintenance` section of `.atomic/blueprint.yaml`.
261
+ If parking cannot acquire the seed lock, prebuild reports the error, leaves existing seeds intact, and keeps the completed build in its idle worktree for local reuse.
253
262
 
254
263
  ## What can stop a resume
255
264
 
@@ -257,18 +266,18 @@ Atomic checks required setup in one pass before restoring anything: the storage
257
266
 
258
267
  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.
259
268
 
260
- | Error | Code | When it happens | What to do |
261
- | --- | --- | --- | --- |
262
- | `ResumeNotFoundError` | `not-found` | Session ID matches nothing this machine can read. `reason: "local-storage-not-joined"` means this machine uses local storage only. | Join shared storage with `atomic storage join` (if joined with `atomic team join`, run `atomic team leave` first). For `shared-miss`, check the ID, storage URL, and prefix. |
263
- | `ResumePreconditionError` | `preconditions-unmet` | Required setup is missing. `problems` lists `adapter-not-installed`, `credential-missing`, `credential-unreadable`, or `git-unavailable` (with optional `checkout` and `GitUnavailableError` `cause`). | Run each fix listed in the error, such as installing the storage adapter, creating the token or password file, or unsetting offline mode. |
264
- | `GitUnavailableError` | `not-installed`, `unsupported-platform`, `offline`, `checksum-mismatch`, `download-failed`, `install-failed` | Git could not be started or provisioned for verification or restore. Session resumes continue without restoring checkouts and attach this error to the notice. | Follow the hint, such as unsetting `ATOMIC_OFFLINE` or installing Git. |
265
- | `ResumeCatalogUnavailableError` | `catalog-unavailable` | Shared storage could not be reached during session lookup. Retryable. | Check connectivity with `atomic storage status` and resume again. |
266
- | `ResumeCatalogTimeoutError` | `catalog-timeout` | Shared storage did not answer lookup within 15 seconds. Retryable. | Check connectivity with `atomic storage status` and resume again. |
267
- | `WorkspaceDriftError` | `tree-drift` | A checkout cannot be rebuilt exactly (for example, unpushed commits touching secret files, a missing blob, or a full disk). Session resumes continue with the closest state and a notice. | Follow the message (for unpushed commits, push from the original machine and resume again). |
268
- | `WorkspaceRestoreError` | `path-too-long` | On Windows, a restored worktree path or Git directory under the agent directory exceeds Git for Windows limits. Nothing is written. | Set `ATOMIC_CODING_AGENT_DIR` to a shorter path. See [Long paths on Windows](#long-paths-on-windows). |
269
- | `WorkspaceRestoreError` | `invalid-snapshot` | A snapshot contains credentials in a remote URL, a Git remote helper (`ext::`), an unsupported scheme, or malformed data. Nothing is fetched or run. | Resume only sessions from trusted storage, or re-export from the source machine. |
269
+ | Symptom | Fix | SDK error and code |
270
+ | --- | --- | --- |
271
+ | Session ID not found on this machine | If this machine uses local storage only (`local-storage-not-joined`), join shared storage with `atomic storage join` (run `atomic team leave` first if joined with `atomic team join`). If already joined (`shared-miss`), check the session ID, database URL, and prefix. | `ResumeNotFoundError` (`not-found`) |
272
+ | 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`) |
273
+ | 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`) |
274
+ | Shared database unreachable during lookup | Check connectivity with `atomic storage status` and resume again. | `ResumeCatalogUnavailableError` (`catalog-unavailable`) |
275
+ | Shared database lookup timed out after 15 seconds | Check connectivity with `atomic storage status` and resume again. | `ResumeCatalogTimeoutError` (`catalog-timeout`) |
276
+ | 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`) |
277
+ | 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`) |
278
+ | 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`) |
270
279
 
271
- Secret values never appear in error messages; errors name only the file or environment variable. Error classes, codes, and `isResume*Error` guards are exported from `@bastani/atomic`.
280
+ 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`.
272
281
 
273
282
  ## Windows
274
283
 
@@ -289,7 +298,3 @@ If a longer agent directory would exceed those limits, restore fails before writ
289
298
  ```powershell
290
299
  $env:ATOMIC_CODING_AGENT_DIR = "C:\atomic\agent"
291
300
  ```
292
-
293
- ## Trust
294
-
295
- A restored worktree is a new directory, so project trust starts unset just like a fresh clone. Until you trust it, project instructions and resources do not load and project blueprints do not run, though the agent still receives `maintenance` and `knowledge` marked as not yet run.
@@ -1,25 +1,33 @@
1
1
  ---
2
- title: "Subagents"
3
- description: "What subagents are, when delegation helps, and where the full subagent guide lives."
2
+ title: "Subagents overview"
3
+ sidebarTitle: "Subagents overview"
4
+ description: "Learn what subagents do, when to delegate tasks, and how background subagents work."
4
5
  ---
5
6
 
6
- # Subagents
7
+ A subagent is a separate agent session that your main session launches for a focused task. It runs in its own context window, so a long code search or debugging trace does not crowd out your main conversation.
7
8
 
8
- This short overview introduces subagents and when to delegate work. A subagent is a separate agent session that your main session launches for a focused task. It runs in its own context window, so a long search or debugging trace does not crowd out your main conversation.
9
+ Ask Atomic to delegate in plain language:
9
10
 
10
- ## When to use one
11
+ ```text
12
+ Have codebase-analyzer trace the authentication flow and report the entry points.
13
+ Keep working with me here while it runs.
14
+ ```
11
15
 
12
- Delegate bounded, independent work. Good fits include searching an unfamiliar area of the codebase, reproducing a failure, reviewing a diff with fresh context, or running several independent tasks at once. Keep work in your main session when it is small or relies on context the subagent would need to rediscover.
16
+ ## When to use a subagent
13
17
 
14
- ## What you get
18
+ Delegate bounded, independent work. Good fits include searching an unfamiliar area of the codebase, reproducing a failure, reviewing a diff with fresh context, or running several independent tasks at once. Keep work in your main session when it is small or relies on nuance the subagent would need to rediscover.
15
19
 
16
- - Single or parallel runs that return results to your session.
17
- - Fresh or forked context, so a child can start clean or reuse the parent's conversation.
18
- - Background execution, so you can keep chatting while children run and collect results as they finish.
20
+ ## Key capabilities
21
+
22
+ - **Background execution.** Every subagent runs in the background, so you can keep chatting in your main session while subagents work and collect results as completion notices arrive.
23
+ - **Bundled specialists.** Atomic includes ready-to-use agents such as `codebase-analyzer`, `debugger`, and `worker`. Run `/agents` to browse available specialists and inspect their prompts and tools.
24
+ - **Single or parallel runs.** Launch one subagent or a parallel batch, with optional Git worktree isolation so writers do not conflict on the same files.
25
+ - **Fresh or forked context.** Most agents start with a fresh context window so they inspect code without bias. The `worker` agent starts with a forked copy of your main conversation by default so it can pick up an approved plan immediately.
26
+ - **One-level delegation.** Only your main session launches subagents; subagents cannot launch other subagents.
19
27
 
20
28
  ## Next steps
21
29
 
22
- - [Subagents](/subagents) is the full guide to bundled agents, run control, worktrees, and execution modes.
23
- - [Custom subagents](/subagents/authoring) explains how to define and scope your own agents.
24
- - [Background and parallel work](/background-tasks) covers inspecting, waiting on, messaging, and stopping delegated tasks.
25
- - [Orchestration](/orchestration) shows how to combine codemode scripts with subagents for multi-step work.
30
+ - [Run subagents](/subagents) covers bundled agents, worktrees, run control, and coordination.
31
+ - [Create custom subagents](/subagents/authoring) explains how to write Markdown agent definitions and override built-in agents.
32
+ - [Manage background tasks](/background-tasks) covers the agent panel, `/tasks`, steering, and stopping running work.
33
+ - [Orchestrate with codemode and subagents](/orchestration) shows how to combine codemode scripts with subagents for multi-step work.
@@ -1,13 +1,12 @@
1
1
  ---
2
- title: "Team and CI setup"
3
- description: "Share Intercom with your team through one database while sessions stay private, and configure CI runners with environment variables alone."
2
+ title: "Set up teams and CI"
3
+ sidebarTitle: "Team and CI setup"
4
+ description: "Share Intercom across a team while keeping personal sessions local, and configure CI runners with environment variables."
4
5
  ---
5
6
 
6
- # Team and CI setup
7
-
8
7
  Share one libSQL or Turso database across machines so teammates can message each other over Intercom while keeping their personal sessions local. CI runners can point both sessions and Intercom at the same database using environment variables alone, so teammates can inspect and resume CI runs.
9
8
 
10
- To share both sessions and Intercom across machines, or to use PostgreSQL instead of libSQL, follow the [Storage](/storage) guide and use `atomic storage join`.
9
+ To share both sessions and Intercom across machines, or to use PostgreSQL instead of libSQL, follow the [Storage backends](/storage) guide and use `atomic storage join`.
11
10
 
12
11
  | Scope | Sessions | Intercom |
13
12
  | --- | --- | --- |
@@ -15,7 +14,12 @@ To share both sessions and Intercom across machines, or to use PostgreSQL instea
15
14
  | Team | Local (share explicitly with `/share` or export and import) | Team database, project group |
16
15
  | CI and swarms | Team database | Team database, per-run group (`ATOMIC_INTERCOM_GROUP`) |
17
16
 
18
- Run `atomic team status` to see the active profile (`individual`, `team`, `ci`, or `custom` when your settings do not match a preset).
17
+ Run `atomic team status` to see the active profile:
18
+
19
+ - `individual`: sessions use default local SQLite and Intercom has no shared adapter storage.
20
+ - `team`: sessions use default local SQLite while Intercom and shared `storage` use the same shared adapter database.
21
+ - `ci`: sessions, Intercom, and shared `storage` all use the same shared adapter database (if you ran `atomic storage join` to share sessions across your own laptops, `atomic team status` also reports `ci`).
22
+ - `custom`: any other combination, such as JSONL sessions, a non-default local SQLite file, a project `storage` override, or different adapters or prefixes between sessions and Intercom.
19
23
 
20
24
  ## Join a team
21
25
 
@@ -33,23 +37,22 @@ Command syntax:
33
37
  atomic team join <url> [--token-file <path>] [--prefix <prefix>]
34
38
  ```
35
39
 
40
+ Only `--token-file <path>` is accepted on the command line (there is no `--token` flag) so database tokens do not leak into shell history or process lists.
41
+
36
42
  Before writing anything, Atomic validates the URL, token, prefix, global settings, installed adapter, and a `SELECT 1` health check with a 15-second timeout. If any check fails, Atomic changes nothing. When all checks pass, Atomic performs four steps:
37
43
 
38
- 1. Saves the token to a mode-`600` file in your agent directory, and reuses that file if you rerun with the same token.
39
- 2. Updates three keys in `~/.atomic/agent/settings.json` atomically while leaving all other settings untouched:
40
- - `storage` points to the team database.
41
- - `sessions.storage` pins sessions to `{ "path": "workflows/journal.sqlite" }` so local transcripts stay private. Atomic prints a notice if this replaces another store.
42
- - `teamJoin` records the managed `storage` fingerprint so `atomic team leave` can separate managed values from manual edits. Leave `teamJoin` unchanged.
44
+ 1. Saves the token to a mode-`600` file in your agent directory, reusing that file if you rerun with the same token.
45
+ 2. Updates `~/.atomic/agent/settings.json` atomically while leaving all other settings untouched: sets `storage` to the team database and pins `sessions.storage` to `{ "path": "workflows/journal.sqlite" }` so personal transcripts stay local (printing a notice if this replaces another store). Atomic also writes a `teamJoin` marker used by `atomic team leave`; leave it unchanged.
43
46
  3. Restarts the Intercom broker so it routes through the team database.
44
47
  4. Prints the active profile, the current project's Intercom group, and the `atomic storage status` report.
45
48
 
46
49
  URL and prefix rules:
47
50
 
48
- - Supported URLs are `libsql://`, `https://`, `wss://`, or an absolute `file:` URL, which needs no token. Atomic refuses URLs that contain an embedded token. See [Joining a machine to a shared database](/storage#joining-a-machine-to-a-shared-database) for full database setup.
51
+ - Supported URLs are `libsql://`, `https://`, `http://`, `wss://`, `ws://`, or an absolute `file:` URL (which needs no token). Prefer TLS (`libsql://`, `https://`, or `wss://`) for remote hosts; `http://` and `ws://` work for local or private-network `sqld`. Atomic refuses URLs that contain an embedded token. See [Joining a machine to a shared database](/storage#joining-a-machine-to-a-shared-database) for full database setup.
49
52
  - Pass `--prefix` to isolate multiple teams inside one database. Everyone on a team must use the same URL and prefix.
50
53
  - Sessions that were already running keep their previous Intercom group until they restart or run `/reload`.
51
54
 
52
- ### Check and leave
55
+ ### Check status and leave
53
56
 
54
57
  ```bash
55
58
  atomic team status # Profile, project group, and storage report
@@ -63,7 +66,7 @@ atomic team leave # Return to the individual layout
63
66
 
64
67
  - Removes `storage` and `teamJoin` only when `storage` still matches the `teamJoin` record. Any manual edit leaves `storage` and its token file intact and reports why.
65
68
  - Keeps a `storage` entry that has no `teamJoin` record. Run `atomic team join` once to record it before leaving.
66
- - Removes `sessions.storage` only while it holds the local pin and no other `storage` selection remains. Other selections include a customized `storage`, a trusted project's `storage`, or a legacy `~/.pi/agent/settings.json` `storage` when using the default agent directory.
69
+ - Removes `sessions.storage` only while it holds the local pin and no other `storage` selection remains (including a customized `storage`, a trusted project's `storage`, or a legacy `~/.pi/agent/settings.json` `storage` when using the default agent directory).
67
70
  - Deletes the managed token file only if no remaining setting references it, then restarts the Intercom broker.
68
71
  - Refuses to modify settings or delete token files if global or project settings cannot be read. Fix the unreadable file first.
69
72
  - Running `atomic team leave` again makes no changes.
@@ -78,22 +81,26 @@ For multi-node broker behavior, Git lookup errors, and routing checks, see [Runn
78
81
 
79
82
  ## CI and swarms
80
83
 
84
+ > Using PostgreSQL in CI? Configure [`ATOMIC_STORAGE`](/storage#selecting-storage-per-process) instead. `ATOMIC_PROFILE=ci` and `teamProfileSelection()` support libSQL and Turso only.
85
+
81
86
  CI runners do not need a `settings.json` file. Configure them with environment variables:
82
87
 
83
88
  | Variable | Value |
84
89
  | --- | --- |
85
90
  | `ATOMIC_PROFILE` | `ci` |
86
- | `ATOMIC_TEAM_URL` | Team database URL |
87
- | `ATOMIC_TEAM_TOKEN` or `ATOMIC_TEAM_TOKEN_FILE` | Database token or an absolute path to a token file, such as under `$RUNNER_TEMP`. Omit only for an absolute `file:` URL. Atomic rejects relative paths at startup because child processes may run in different working directories. |
91
+ | `ATOMIC_TEAM_URL` | Team libSQL/Turso database URL |
92
+ | `ATOMIC_TEAM_TOKEN` or `ATOMIC_TEAM_TOKEN_FILE` | Database token, or an absolute path to a token file (such as under `$RUNNER_TEMP`). Omit only for an absolute `file:` URL. Relative paths are rejected at startup because child processes may run in different working directories. |
88
93
  | `ATOMIC_TEAM_PREFIX` | Optional prefix matching the team's database prefix |
89
94
 
90
95
  With `ATOMIC_PROFILE=ci`, both sessions and Intercom use the team database for this process and every child process it spawns. Atomic writes nothing to settings. It reads the token when opening a store and never copies it into settings, logs, or child storage selections.
91
96
 
92
97
  Validation and precedence:
93
98
 
94
- - Atomic validates these variables at startup before opening a session. Missing paired variables, unknown profiles, invalid URLs or prefixes, and empty or unreadable token files fail immediately with one error listing everything missing.
99
+ - Atomic validates these variables at startup before opening a session. Leaving **any** of `ATOMIC_TEAM_URL`, `ATOMIC_TEAM_TOKEN`, `ATOMIC_TEAM_TOKEN_FILE`, or `ATOMIC_TEAM_PREFIX` exported without `ATOMIC_PROFILE=ci` fails startup immediately (`incomplete-profile`), so unset them when not using the CI profile.
100
+ - Setting both `ATOMIC_TEAM_TOKEN` and `ATOMIC_TEAM_TOKEN_FILE` fails startup (`conflicting-token`). Empty string values (such as `ATOMIC_TEAM_PREFIX=""`) are treated as unset.
101
+ - Unknown profiles, invalid URLs or prefixes, and empty or unreadable token files fail immediately with one error listing everything missing.
95
102
  - `--storage`, `--storage-file`, and `ATOMIC_STORAGE` override the profile for all stores, including Intercom. Session-specific flags and `ATOMIC_SESSIONS_STORAGE` override only sessions. See [Selecting storage per process](/storage#selecting-storage-per-process) for the full precedence order.
96
- - If the profile selects the libSQL adapter and it is not installed, startup fails with the `atomic install` command to run.
103
+ - If the libSQL adapter is not installed, startup fails with the `atomic install` command to run.
97
104
 
98
105
  ### GitHub Actions
99
106
 
@@ -120,7 +127,7 @@ Hosted CI runners start with an empty home directory. Use `atomic blueprint cach
120
127
 
121
128
  Save caches only from a trusted job on the default branch (`push`, `schedule`, or `workflow_dispatch`), and restore them read-only in agent jobs with `actions/cache/restore`.
122
129
 
123
- In the trusted job, run [`atomic blueprint prebuild --park --approve`](/guides/resume-on-any-machine#prebuilt-worktrees). It restores the commit into a worktree, runs its blueprints to warm package stores, writes the commit into Atomic's Git object store, and parks `"kind": "build"` paths from `resume.cache`:
130
+ In the trusted job, run [`atomic blueprint prebuild --park --approve`](/guides/resume-on-any-machine#prebuilt-worktrees). It restores the commit into a worktree, runs its blueprints to warm package stores, writes the commit into Atomic's Git object store, and parks `"kind": "build"` paths from `resume.cache`. Prebuild requires a Git remote, `snapshots.enabled: true`, no uncommitted edits to tracked files, and no unpushed commits touching denied secret files. If your project extensions depend on installed Atomic packages, install those packages before running `atomic --list-models` to warm the compiled extension cache:
124
131
 
125
132
  ```yaml
126
133
  on:
@@ -137,7 +144,7 @@ jobs:
137
144
  - id: keys
138
145
  run: atomic blueprint cache-key --format github-output >> "$GITHUB_OUTPUT"
139
146
  - run: atomic blueprint prebuild --park --approve # Runs blueprints to populate stores; trust only the default branch
140
- - run: atomic --list-models # Transpiles installed extensions into Atomic's cache
147
+ - run: atomic --list-models # Compiles installed extensions into Atomic's cache
141
148
  - uses: actions/cache/save@v4
142
149
  with:
143
150
  key: ${{ steps.keys.outputs.stores-key }}
@@ -195,15 +202,19 @@ When the agent job resumes a session, Atomic fetches only the commits missing fr
195
202
  - Keys include lockfiles, key files, `resume.cache`, the repository blueprint, OS, architecture, and Atomic version, so exact hits never return stale content. `restore-keys` falls back to the newest older cache so package managers can update incrementally.
196
203
  - `cache-key` omits paths that may hold credentials and warns on stderr while leaving `$GITHUB_OUTPUT` clean. Restore only entries that `cache-key` outputs for your repository, because a cache step with an empty `path` fails.
197
204
 
198
- ### From the SDK
205
+ ## From the SDK
206
+
207
+ `@bastani/atomic/storage` exports async helpers `joinTeam()`, `leaveTeam()`, and `getTeamProfile()`, plus `teamProfileSelection()` (libSQL and Turso only).
199
208
 
200
- `@bastani/atomic/storage` exports async helpers `joinTeam()`, `leaveTeam()`, and `getTeamProfile()`, plus `teamProfileSelection()`.
209
+ Use `teamProfileSelection({ profile: "ci", url, token })` to pass a storage selection to `createAgentSession({ storage })` without modifying settings:
201
210
 
202
- Use `teamProfileSelection({ profile: "ci", url, token })` to pass a storage selection to `createAgentSession({ storage })` without modifying settings. An in-memory `token` stays in memory, serializes as `[redacted]`, and cannot be reopened by other processes. Pass `tokenFile` or `tokenEnv` instead when child processes need to open the store.
211
+ - `token` stays in memory, serializes as `[redacted]`, and cannot be reopened by child processes.
212
+ - `tokenEnv` stores `{ env: "<VAR>" }` so child processes can reopen the store, and checks immediately at call time that the named environment variable is set (throwing `missing-token` if unset).
213
+ - `tokenFile` resolves relative paths against `cwd` and reads the file immediately to verify it is non-empty.
203
214
 
204
215
  Intercom runs one broker per agent directory, so pass the CI environment variables to both the host process and any spawned `atomic` processes:
205
216
 
206
- ```ts
217
+ ```typescript
207
218
  import { spawn } from "node:child_process";
208
219
  import { createAgentSession } from "@bastani/atomic";
209
220
  import { teamProfileSelection } from "@bastani/atomic/storage";
@@ -211,7 +222,7 @@ import { teamProfileSelection } from "@bastani/atomic/storage";
211
222
  const url = process.env.TEAM_DATABASE_URL!;
212
223
  const token = process.env.TEAM_DATABASE_TOKEN!;
213
224
 
214
- // In-process agent: sessions use the team database.
225
+ // Embedded SDK agent: sessions use the team database.
215
226
  const storage = teamProfileSelection({ profile: "ci", url, token });
216
227
  const { session } = await createAgentSession({ storage });
217
228
  await session.prompt("Summarize the failing tests");
@@ -235,6 +246,6 @@ Anyone with read access to the team database can read everything stored in it, i
235
246
 
236
247
  ## Related
237
248
 
238
- - [Storage](/storage) for storage setup, selections, precedence, and error reference.
249
+ - [Storage backends](/storage) for storage setup, selections, precedence, and error reference.
239
250
  - [Running Intercom across machines](/intercom/operations#running-intercom-across-machines) for multi-node broker details.
240
251
  - [Intercom groups](/intercom/reference#groups) for how groups isolate sessions.