@bastani/atomic 0.10.9 → 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 +57 -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,13 +1,12 @@
1
1
  ---
2
- title: Worktree snapshots
3
- description: Capture and restore Git repository state so sessions resume cleanly on any machine.
2
+ title: "Worktree snapshots"
3
+ sidebarTitle: "Worktree snapshots"
4
+ description: "How Atomic automatically saves and restores Git checkout state, handles exclusions and partial restores, and cleans up old worktrees."
4
5
  ---
5
6
 
6
- # Worktree snapshots
7
-
8
7
  Atomic records the state of each Git checkout a session modifies. You can resume a session on another machine, or after a local checkout is deleted or reset, with the same repository files.
9
8
 
10
- For cross-machine setup, shared storage, and environment blueprints, see [Resume on any machine](/guides/resume-on-any-machine).
9
+ For cross-machine setup, shared storage, and environment blueprints, see [Resume sessions on any machine](/guides/resume-on-any-machine).
11
10
 
12
11
  ## What a snapshot holds
13
12
 
@@ -16,52 +15,41 @@ For each repository root a session changes, a snapshot records:
16
15
  - `root`: the checkout path on the recording machine (informational).
17
16
  - `remotes`: configured remote fetch URLs with embedded credentials stripped.
18
17
  - `branch` and `head`: the active branch name (or `null` when detached) and `HEAD` commit.
19
- - `tree`: the Git tree of the working copy, built through a private index so your own index, branch, and files are untouched.
20
- - A patch chain: a binary delta against `head`, followed by incremental deltas against earlier snapshots, restarting from `head` every `snapshots.fullEvery` snapshots or when `HEAD` changes.
18
+ - `tree`: the Git tree of the working copy, built through a private index so your own index, branch, and files stay untouched.
19
+ - A patch chain: a binary delta against `head`, followed by incremental deltas against earlier snapshots, restarting from `head` every `snapshots.fullEvery` snapshots (default `10`) or when `HEAD` changes.
21
20
  - A bundle of commits reachable from `HEAD` but not from any remote-tracking ref, so unpushed commits travel with the session.
22
21
  - `omitted`: paths or commits left out of the snapshot and why.
23
22
  - `filters`: conversion settings on the recording host (`core.autocrlf`, `core.eol`, and `.gitattributes` filter drivers such as Git LFS).
24
- - `envHash`: a SHA-256 hash of root lockfiles and toolchain files (`package-lock.json`, `Cargo.lock`, `.devcontainer/devcontainer.json`, `.nvmrc`, and similar) to detect when dependencies need rebuilding.
23
+ - `envHash`: a SHA-256 hash of these 24 root-relative lockfiles and toolchain files to detect when dependencies need rebuilding: `.devcontainer.json`, `.devcontainer/Dockerfile`, `.devcontainer/devcontainer.json`, `.mise.toml`, `.node-version`, `.nvmrc`, `.python-version`, `.tool-versions`, `Cargo.lock`, `Gemfile.lock`, `Pipfile.lock`, `bun.lock`, `bun.lockb`, `composer.lock`, `flake.lock`, `go.sum`, `mise.toml`, `npm-shrinkwrap.json`, `package-lock.json`, `pnpm-lock.yaml`, `poetry.lock`, `rust-toolchain`, `rust-toolchain.toml`, `uv.lock`, and `yarn.lock`. Other files such as `requirements.txt`, `build.gradle`, and `pom.xml` are not included in `envHash`.
25
24
 
26
- Patches and bundles are stored once by content hash in the session's database (`snapshot_blobs` table). Payloads over 1 MiB split into rows of at most 1 MiB, so every backend supports files up to `snapshots.maxFileBytes`. Machines sharing one database read the same blobs automatically.
25
+ Patches and bundles are stored once by content hash in the session's database (`snapshot_blobs` table). Payloads over 1 MiB split into rows of at most 1 MiB, so every SQL backend supports files up to `snapshots.maxFileBytes` (default 5 MiB). Machines sharing one database read the same blobs automatically.
27
26
 
28
27
  **What "the same tree" means.** A restore reproduces the repository's Git content so the restored worktree's Git tree ID matches `tree` and every file blob matches. Host-specific worktree encodings are not copied. For example, a source checkout with `core.autocrlf=true` and CRLF files restores with LF files and identical Git content, accompanied by a filter warning.
29
28
 
30
29
  ## When snapshots are taken
31
30
 
32
- Atomic captures snapshots at the end of any turn that ran `bash`, `edit`, `write`, `powershell`, or an extension tool declaring `writesFiles: true`. It captures the session's working directory along with the directories of files targeted by `edit` and `write`.
33
-
34
- If `HEAD`, the working tree, and the omitted-file list are all unchanged, Atomic records a reference to the previous snapshot instead of creating a new one. Adding a newly omitted file, such as a new `.env.local`, writes a new snapshot listing it in `omitted` so restores warn about it.
35
-
36
- ### Unpushed-commit omission caching
37
-
38
- When unpushed commits are left out of a snapshot (because a commit modifies a deny-listed path or the bundle exceeds `snapshots.maxSnapshotBytes`), Atomic remembers that omission per checkout for the lifetime of the running process so repeated turns do not re-bundle large unpushed histories.
39
-
40
- Atomic re-bundles unpushed commits and re-checks them against the deny list when any of these happen:
41
-
42
- - The list of unpushed commits changes, including after pushing commits or when a remote branch moves back (such as a force push) and exposes newly unpushed commits.
43
- - A new Atomic process starts.
44
- - The repository is repacked with `git gc` or `git repack`.
45
- - Git packing settings (`core.compression`, `core.bigFileThreshold`, `pack.*`, `core.attributesFile`, or `attr.tree`) or delta-compression rules (such as `-delta` in `.gitattributes` or Git attributes files) change.
46
- - `snapshots.maxSnapshotBytes` is raised above the bundle size.
31
+ Snapshots require a Git checkout with at least one commit and a SQL database store (local SQLite, PostgreSQL, or Turso/libSQL). Directories outside Git repositories, in-memory sessions, JSONL directory stores, and custom stores without blob tables record nothing. A new session in a blob-less store reports `blob-store-unsupported` once; a transient store failure reports `blob-store-failed` once without failing the turn.
47
32
 
48
- ### Subagents, storage, and capture edge cases
33
+ Atomic captures snapshots at the end of any turn that ran `bash`, `edit`, `write`, `powershell`, or an extension tool declaring `writesFiles: true`. It captures the session's working directory along with the directories of files targeted by `edit` and `write`.
49
34
 
35
+ - **Unchanged trees.** If `HEAD`, the working tree, and the omitted-file list are all unchanged, Atomic records a reference to the previous snapshot instead of creating a new one. Adding a newly omitted file, such as a new `.env.local`, writes a new snapshot listing it in `omitted` so restores warn about it.
50
36
  - **Subagent snapshots.** A subagent's session lives in its parent's store and captures snapshots of its own when backed by a database. When multiple subagents finish file-writing turns in the same checkout while a capture is already running, they share the next snapshot.
37
+ - **Unpushed-commit omission reuse.** When unpushed commits are omitted because a commit touches a deny-listed secret or the bundle exceeds `snapshots.maxSnapshotBytes` (default 50 MiB), Atomic caches that omission for the running process so later turns avoid re-bundling large unpushed histories. Atomic re-checks and re-bundles automatically if the set of unpushed commits changes (including after pushing or a force push), a new Atomic process starts, the repository is repacked (`git gc` or `git repack`), Git packing or attributes settings change, or `snapshots.maxSnapshotBytes` is raised above the bundle size.
51
38
  - **Private capture index.** Captures share a private Git index per checkout under `~/.atomic/agent/worktree-snapshots/capture-index/` so unchanged files are not re-read on later turns. Deleting that directory is safe; the next capture rebuilds it automatically.
52
- - **Git and storage requirements.** Captures use Atomic's resolved Git binary (including a provisioned portable copy). Directories outside Git repositories, in-memory sessions, and stores without blob tables (such as JSONL directories or database-less adapters) record nothing. A new session in a blob-less store reports `blob-store-unsupported` once; a transient store failure reports `blob-store-failed` once without failing the turn.
53
39
  - **Unreadable paths.** If a path cannot be read because of permissions or a looping symlink, capture skips that checkout and reports `unreadable-path` without failing the turn. Fix the path or add it to `.atomic/snapshot-ignore` to resume capturing.
54
40
 
55
41
  ## What is left out
56
42
 
57
43
  Atomic excludes the following from snapshots:
58
44
 
59
- - **Git-ignored files.** Files matched by `.gitignore`, `.git/info/exclude`, or global excludes are skipped unless explicitly staged with `git add -f`.
60
- - **Project snapshot excludes.** Rules in `.atomic/snapshot-ignore` at the repository root match using `.gitignore` syntax and respect the repository's `core.ignorecase` setting.
61
- - **Built-in secret deny list.** `.env*`, `*.pem`, `*.key`, `*.p12`, `*.pfx`, `credentials`, `credentials.json`, `.netrc`, `_netrc`, `.git-credentials`, `.pgpass`, plus SSH key files: any extensionless `id_*` file and any file starting with `id_rsa`, `id_ed25519`, `id_ecdsa`, `id_dsa`, `id_mldsa`, or `id_xmss` regardless of suffix (such as `id_rsa.bak`), except `.pub` public keys and certificates. Other `id_*` files with extensions, such as `id_utils.ts`, are kept unless they carry a denied extension like `.pem` or `.key`.
62
- - **Untracked and oversized files.** Untracked files when `snapshots.includeUntracked` is `false`, files larger than `snapshots.maxFileBytes`, and files pushing the snapshot past `snapshots.maxSnapshotBytes`.
45
+ - **Built-in secret deny list (cannot be overridden).** `.env*`, `*.pem`, `*.key`, `*.p12`, `*.pfx`, `credentials`, `credentials.json`, `.netrc`, `_netrc`, `.git-credentials`, `.pgpass`, plus SSH key files: any extensionless `id_*` file and any file starting with `id_rsa`, `id_ed25519`, `id_ecdsa`, `id_dsa`, `id_mldsa`, or `id_xmss` regardless of suffix (such as `id_rsa.bak`), except `.pub` public keys and certificates. Other `id_*` files with extensions, such as `id_utils.ts`, are kept unless they carry a denied extension like `.pem` or `.key`.
46
+ - Built-in deny rules match **case-insensitively at any directory depth** and run **before** `.atomic/snapshot-ignore` and Git staging. You cannot un-deny a built-in pattern with a `!` negation rule in `.atomic/snapshot-ignore` or with `git add -f`.
47
+ - Because `.env*` matches at any depth, non-secret template files such as `.env.example` or `.env.template` are also excluded and cannot be re-included with `!.env.example`.
48
+ - **Git-ignored files.** Files matched by `.gitignore`, `.git/info/exclude`, or global excludes are skipped unless explicitly staged with `git add -f` (staging overrides `.gitignore`, not the built-in secret deny list).
49
+ - **Project snapshot excludes.** Rules in `.atomic/snapshot-ignore` at the repository root use `.gitignore` syntax and respect the repository's `core.ignorecase` setting.
50
+ - **Untracked and oversized files.** Untracked files when `snapshots.includeUntracked` is `false`, files larger than `snapshots.maxFileBytes` (default 5 MiB), and files pushing the snapshot past `snapshots.maxSnapshotBytes` (default 50 MiB).
63
51
  - **Nested repositories.** Untracked Git repositories inside the checkout appear in `omitted` as `nested-repository`.
64
- - **Submodule contents.** Snapshots record only each submodule's checked-out commit and do not check submodules out on restore. Uncommitted submodule changes appear as `submodule-changes`, unpushed submodule commits as `unpushed-submodule-commit`, and submodules that time out after 10 seconds as `submodule-unchecked`. Commit and push submodule work to preserve it.
52
+ - **Submodule contents.** When `.gitmodules` is present, snapshots record only each submodule's checked-out commit and do not check submodules out on restore. Uncommitted submodule changes appear as `submodule-changes`, unpushed submodule commits as `unpushed-submodule-commit`, and submodules that time out after 10 seconds as `submodule-unchecked`. Commit and push submodule work to preserve it.
65
53
 
66
54
  Tracked files that are ignored or denied keep their `HEAD` content in the snapshot, and local edits to them are listed in `omitted`.
67
55
 
@@ -69,24 +57,36 @@ Tracked files that are ignored or denied keep their `HEAD` content in the snapsh
69
57
 
70
58
  ## Settings
71
59
 
72
- Configure `snapshots.*` options in `~/.atomic/agent/settings.json` or `.atomic/settings.json`. See [Snapshots settings](/settings#snapshots) for the full table of keys and defaults (`snapshots.enabled`, `includeUntracked`, `maxFileBytes`, `maxSnapshotBytes`, `fullEvery`, `autoCollect`, `collectIntervalSeconds`, `graceSeconds`, and `pool.maxIdlePerRepository`).
60
+ Configure `snapshots.*` options in `~/.atomic/agent/settings.json` or `.atomic/settings.json`:
61
+
62
+ | Setting | Default | Meaning |
63
+ | --- | --- | --- |
64
+ | `snapshots.enabled` | `true` | Capture worktree snapshots after file-writing turns |
65
+ | `snapshots.includeUntracked` | `true` | Include non-ignored untracked files |
66
+ | `snapshots.maxFileBytes` | `5242880` (5 MiB) | Largest individual file captured (positive integer) |
67
+ | `snapshots.maxSnapshotBytes` | `52428800` (50 MiB) | Largest total snapshot or unpushed bundle size (positive integer) |
68
+ | `snapshots.fullEvery` | `10` | Restart patch chain from `HEAD` after this many incremental snapshots |
69
+ | `snapshots.autoCollect` | `true` | Run background snapshot garbage collection |
70
+ | `snapshots.collectIntervalSeconds` | `3600` (1 hour) | Minimum interval between automatic garbage collection runs |
71
+ | `snapshots.graceSeconds` | `3600` (1 hour) | Protect newly written blobs for this many seconds (`0` disables grace window) |
72
+ | `snapshots.pool.maxIdlePerRepository` | `2` | Maximum clean idle restored worktrees kept per repository |
73
73
 
74
- In the SDK, pass `createAgentSession({ snapshots })` to override settings for one session. Invalid values fail fast with `WorkspaceConfigError` before running Git commands.
74
+ See [Snapshots settings](/settings#snapshots) for full schema notes. In the SDK, pass `createAgentSession({ snapshots })` to override settings for one session. Invalid values fail immediately with `WorkspaceConfigError` before running Git commands.
75
75
 
76
76
  ## Resuming
77
77
 
78
78
  When you resume a session, Atomic checks every checkout the session recorded a snapshot for, not only its working directory.
79
79
 
80
- If a finished subagent stored in the same session store captured a checkout later than the parent session did, Atomic adopts that newer subagent capture as the checkout's latest snapshot. Captures compare by recording timestamp, with the parent session winning ties. Partly restored checkouts keep their pinned snapshot, and named subagent worktrees stay separate.
80
+ If a finished subagent stored in the same session store captured a checkout later than the parent session did, Atomic adopts that newer subagent capture as the checkout's latest snapshot. Captures compare by recording timestamp, with the parent session winning ties. Partly restored checkouts keep their original restore target, and named subagent worktrees stay separate.
81
81
 
82
82
  For each checkout, Atomic applies these rules in order:
83
83
 
84
84
  - **In-place resume.** If the tree matches and `HEAD` is the recorded commit or a descendant of it, the session resumes in place. If the active checkout changed locally since its snapshot but is still the same checkout on this machine (holding the snapshot commit, the session's [snapshot ref](#snapshot-refs-in-your-repository), or a local Atomic restore), the session continues there without overwriting your files.
85
85
  - **Return to original checkout.** If an earlier resume moved the session into a restored worktree and no new work was saved there, Atomic returns to the original checkout once it is available again on this machine.
86
86
  - **Automatic restore.** If another checkout drifted, or the active checkout is missing, belongs to a different clone, or has no commits, Atomic restores the snapshot into a fresh worktree under `~/.atomic/agent/worktree-snapshots/worktrees/` and prints a one-line notice. Your existing checkouts are never modified.
87
- - **Non-blocking secondary checkouts.** A checkout outside the session's working directory never stops a resume. If it cannot be checked or restored, Atomic skips it with a warning and builds [blueprints](/guides/resume-on-any-machine) for every restored worktree.
87
+ - **Non-blocking secondary checkouts.** Secondary checkouts outside the session's working directory restore concurrently (up to 4 at a time) and never stop a resume. If one cannot be checked or restored, Atomic skips it with a warning and builds [blueprints](/guides/resume-on-any-machine) for every restored worktree.
88
88
 
89
- ### Degraded restores
89
+ ### Partial (degraded) restores
90
90
 
91
91
  A resume always opens the session with its full conversation. When a snapshot cannot be restored exactly (for example because unpushed commits touched denied files, a remote is unreachable, a blob is missing, or a patch fails to apply), Atomic restores the closest reachable state in order:
92
92
 
@@ -94,24 +94,26 @@ A resume always opens the session with its full conversation. When a snapshot ca
94
94
  2. Otherwise, the closest commit fetchable from recorded remotes: the pushed base of the unpushed bundle, then earlier snapshots of the same checkout (nearest first), then the tip of the recorded branch (or default branch when detached).
95
95
  3. Otherwise, Atomic skips the restore and continues in the session's recorded directory without writing to it, or in the directory where the resume started if the recorded directory is absent. Missing Git or a missing snapshot record also ends here.
96
96
 
97
- Each degraded or unrestored checkout emits one notice listing what was restored, what is missing, and how to fix it (such as pushing missing commits and resuming again). The outcome is stored on the session entry (`restore.degraded` or `unrestored`) and displayed by `/session snapshot`.
97
+ Each partial or unrestored checkout emits one notice listing what was restored, what is missing, and how to fix it (such as pushing missing commits and resuming again). The outcome is stored on the session entry (`restore.degraded` or `unrestored`) and displayed by `/session snapshot`.
98
98
 
99
99
  Only three errors refuse a resume: an unreadable session, a snapshot failing security validation (`invalid-snapshot`), or a non-empty restore target (`unsafe-target`). Working directories reached through symlinks are matched by their resolved physical path.
100
100
 
101
- ### Snapshots restored only partly
101
+ <div id="snapshots-restored-only-partly" />
102
+
103
+ ### Recovering from a partial restore
102
104
 
103
- A partly restored snapshot remains the checkout's restore target for 30 days, and garbage collection keeps its blobs and patch chain until one of three events occurs: a later resume restores it completely, you release it with `discardDegradedRestore` (see [SDK](#sdk)), or 30 days pass since the partial restore.
105
+ When a snapshot restores only partly, Atomic keeps trying to restore the full original snapshot for 30 days, and garbage collection retains its blobs and patch chain until one of three things happens: a later resume restores it completely, you clear the target with `discardDegradedRestore()` (see [SDK](#sdk)), or 30 days pass since the partial restore.
104
106
 
105
- Each turn captured in a partly restored worktree records its actual tree and links back to the original snapshot via `degradedFrom`, so partial restores never overwrite the original target.
107
+ Each turn captured in a partly restored worktree records its actual tree and links back to the original snapshot in `degradedFrom`, so work done in a partial restore never overwrites the original target.
106
108
 
107
- On a later resume, Atomic tries to restore the original snapshot again:
109
+ On a later resume, Atomic retries restoring the original snapshot:
108
110
 
109
- - **Full restore succeeds.** If you edited files in the partly restored worktree, Atomic applies those edits on top as a single patch, shows an info notice, and records a new snapshot immediately. Once that new snapshot saves, the pin ends.
111
+ - **Full restore succeeds.** If you edited files in the partly restored worktree, Atomic applies those edits on top as a single patch, shows an info notice, and records a new snapshot immediately. Once saved, Atomic stops retrying the older target.
110
112
  - **Carried-over edits conflict.** Atomic leaves the restored worktree at the original snapshot, saves your conflicting edits under `refs/atomic/degraded-work/<snapshot>`, keeps them in snapshot storage until discarded or 30 days pass, and prints a `git diff ... | git apply --3way` command so you can merge them manually.
111
- - **Carried-over edits are unavailable.** If the partial-restore edits cannot be read on this machine (for example, unpushed commits made there), Atomic reports them, leaves them in the partial worktree, and clears the original pin.
112
- - **Full restore still fails.** Atomic restores the partly restored worktree's latest snapshot so your new work is preserved, warns that the original is still unreachable, and keeps the pin active.
113
+ - **Carried-over edits are unavailable.** If the partial-restore edits cannot be read on this machine (for example, unpushed commits made there), Atomic reports them, leaves them in the partial worktree, and clears the original target.
114
+ - **Full restore still fails.** Atomic restores the partly restored worktree's latest snapshot so your new work stays intact, warns that the original is still unreachable, and keeps retrying on later resumes.
113
115
 
114
- After 30 days, the next resume warns that the original snapshot is no longer retained, promotes the partial worktree's latest snapshot to the restore target, and drops `degradedFrom` on the next capture.
116
+ After 30 days, the next resume warns that the original snapshot is no longer retained, promotes the partial worktree's latest snapshot to the active target, and clears `degradedFrom` on the next capture.
115
117
 
116
118
  ### Restored worktrees
117
119
 
@@ -121,17 +123,11 @@ Only checkouts sharing the same repository remotes share a pool. Checkouts witho
121
123
 
122
124
  A worktree stays associated with the session it was restored for after that session closes so resuming it again continues in the same directory. If another session later takes over that worktree, the original session gets a fresh worktree on its next resume.
123
125
 
124
- #### Leases and pool locks
125
-
126
- An open session refreshes its worktree lease every 10 seconds. If a process stops refreshing (for example after sleeping or stalling), it keeps the worktree for 90 seconds after its last refresh (30 seconds until stale, plus a 60-second grace window) before another machine sharing the pool can claim or remove it.
127
-
128
- On shared filesystems where host clocks may disagree, Atomic measures lease and lock ages against the filesystem's own clock using a short-lived probe file. On all platforms, Atomic advances the sampled filesystem time with monotonic elapsed time through probe cleanup and ignores wall-clock jumps.
129
-
130
- On the same host, a worktree held by a still-running session process is never reclaimed. Both Linux and Windows record the holder's process start time on leases (Linux through `/proc`, Windows through the native module with a PowerShell fallback), so a reused PID after a reboot or container restart never keeps a stale worktree on either OS. Only macOS and other platforms without a process start-time reader fall back to a 24-hour cap without a refresh.
126
+ #### Worktree leases
131
127
 
132
- Before recording a snapshot or continuing in a pooled worktree, a session verifies it still holds the lease. If another session claimed the worktree meanwhile, Atomic skips the snapshot and warns with `pooled-worktree-lost` so you know to resume into a fresh worktree.
128
+ An open session refreshes its worktree lease every 10 seconds. On the same host, a worktree held by a running session process is never reclaimed (Linux and Windows check both PID and process start time so reused PIDs after a reboot do not block reuse; macOS falls back to a 24-hour cap without a refresh). If a process stalls or stops refreshing on another host sharing the pool, the worktree remains reserved for 90 seconds after the last refresh before another machine can claim or remove it.
133
129
 
134
- On Windows, pool and seed lock acquisition retries temporary `EPERM` errors for up to 10 seconds before failing. Contended pool locks wait up to 60 seconds (120 seconds when parking a seed) and respond to cancellation.
130
+ Before saving a snapshot or continuing in a pooled worktree, Atomic verifies that the session still holds the lease. If another session claimed the worktree meanwhile, Atomic skips the snapshot and warns with `pooled-worktree-lost` so you can stop editing there and run `/resume` to open a fresh worktree.
135
131
 
136
132
  #### Idle reuse, eviction, and set-aside worktrees
137
133
 
@@ -139,7 +135,7 @@ When restoring a repository, Atomic reuses an idle pooled worktree if one matche
139
135
 
140
136
  When idle worktrees for one repository exceed `snapshots.pool.maxIdlePerRepository`, Atomic removes the oldest clean idle ones. Any worktree with unrecorded edits or excluded files (such as `.env`) is preserved.
141
137
 
142
- If Atomic is killed mid-blueprint build, that worktree is marked set-aside under `~/.atomic/agent/worktree-snapshots/pool/set-aside/` so no session reuses it while build processes might still run (see [Start the first turn while the build runs](/guides/resume-on-any-machine#start-the-first-turn-while-the-build-runs)). Atomic deletes set-aside pooled worktrees on a later restore once no user process has an open file or working directory inside them (checked via `/proc` on Linux and `lsof` on macOS). When a non-dumpable process prevents verification, or for non-pooled worktrees, check with `lsof +D <path>` and delete the directory manually.
138
+ If Atomic is killed mid-blueprint build, that worktree is marked set-aside under `~/.atomic/agent/worktree-snapshots/pool/set-aside/` so no session reuses it while build processes might still run (see [Start the first turn while the build runs](/guides/resume-on-any-machine#start-the-first-turn-while-the-build-runs)). Atomic deletes set-aside pooled worktrees on a later restore once no user process has an open file or working directory inside them. If another user's or protected process prevents checking open files, or for non-pooled worktrees, inspect with `lsof +D <path>` and delete the directory manually.
143
139
 
144
140
  #### Shared object stores, SSH, LFS, and interrupted restores
145
141
 
@@ -186,13 +182,13 @@ Snapshot refs sit outside `refs/heads` and `refs/tags`, so `git push`, `git push
186
182
 
187
183
  Snapshot commits appear in `git for-each-ref` and `git log --all` titled `Atomic worktree snapshot`. Exclude them from `git log --all` with:
188
184
 
189
- ```sh
185
+ ```bash
190
186
  git log --exclude='refs/atomic/*' --all
191
187
  ```
192
188
 
193
189
  Sessions deleted on another machine or via `SessionStore.delete()` can leave local refs behind. Remove all Atomic snapshot refs in a repository with:
194
190
 
195
- ```sh
191
+ ```bash
196
192
  git for-each-ref --format='delete %(refname)' refs/atomic/snapshots/ | git update-ref --stdin
197
193
  ```
198
194
 
@@ -200,12 +196,12 @@ git for-each-ref --format='delete %(refname)' refs/atomic/snapshots/ | git updat
200
196
 
201
197
  Snapshot blobs live in one shared table per database and are garbage-collected automatically when no retained session needs them:
202
198
 
203
- - **Retained snapshots.** For every branch of every session (including internal sessions), Atomic keeps the latest snapshot of each checkout on that branch. Deleting a session releases its snapshots. A partly restored snapshot remains retained for up to 30 days (see [Snapshots restored only partly](#snapshots-restored-only-partly)). Unfinished workflow runs kept in the database from earlier releases retain their snapshots until removed.
199
+ - **Retained snapshots.** For every branch of every session (including internal sessions), Atomic keeps the latest snapshot of each checkout on that branch. Deleting a session releases its snapshots. A partly restored snapshot remains retained for up to 30 days (see [Recovering from a partial restore](#snapshots-restored-only-partly)). Unfinished workflow runs kept in the database from earlier releases retain their snapshots until removed.
204
200
  - **Background schedule.** When `snapshots.autoCollect` is `true`, Atomic runs collection in the background 10 seconds after an interactive or RPC session starts and 10 seconds after it closes, at most once per `snapshots.collectIntervalSeconds` per database (measured on the database clock). Collection runs in short batches so the UI stays responsive, aborts cleanly when the last store on the database closes, and resumes later if interrupted.
205
- - **Grace window.** Blobs stored or reused within `snapshots.graceSeconds` (default one hour) are never deleted, protecting captures in progress. Reusing an earlier patch resets its age; if a blob is collected before its snapshot commits, Atomic retries storing it or reports `blobs-collected` without recording a broken snapshot. Raise `snapshots.graceSeconds` if `blobs-collected` repeats.
201
+ - **Grace window.** Blobs stored or reused within `snapshots.graceSeconds` (default 1 hour) are never deleted, protecting captures in progress. Reusing an earlier patch resets its age; if a blob is collected before its snapshot commits, Atomic retries storing it or reports `blobs-collected` without recording a broken snapshot. Raise `snapshots.graceSeconds` if `blobs-collected` repeats.
206
202
  - **Failures and disk space.** Collection errors never fail an active session; they are recorded in the `snapshot_collection` table (`finished_at`, `deleted`, `error_code`) and retried after the configured interval. SQLite reuses freed space internally without shrinking the file; run `VACUUM` while no Atomic process uses the database to reclaim disk space.
207
203
 
208
- To trigger collection immediately from code, call `collectSnapshotGarbage`. If a large legacy chunk-table migration was deferred for free-space checks, the result includes `pendingChunkMove`; see [Size limits](/storage#size-limits) for the offline migration command.
204
+ To trigger collection immediately from code, call `collectSnapshotGarbage()`. For older local SQLite databases that need offline chunk-table migration, see [Size limits](/storage#size-limits).
209
205
 
210
206
  ## SDK
211
207
 
@@ -241,13 +237,13 @@ if (capture.status === "captured" || capture.status === "unchanged") {
241
237
  ### Session resume and partial restores
242
238
 
243
239
  - `openSessionInWorktree(sessionManager, { settings, storeDir?, signal?, beforeRecord?, pendingMappings?, keepInPlace?, cannotRestore?, fallbackCwd?, skipMissingRecords? })`: checks every recorded checkout and restores drifted or missing ones without running blueprints, resolving `{ sessionManager, notices, unrestored, missingRecords }`. `resumeSessionWorktree` performs the same restore without reopening the session. For standard SDK resume with blueprints, pass `sessionManager` directly to `createAgentSession({ sessionManager })`.
244
- - `discardDegradedRestore(sessionManager, { settings, root?, signal? })`: records each partly restored worktree (or only `root`) without `degradedFrom` so it becomes the active restore target and releases the pinned snapshot on the next collection.
245
- - `degradedRestorePin(sessionManager, root)`: returns `{ snapshotId, since, base?, lapsed, work?, kept? }` for a pinned checkout, or `undefined` when unpinned.
240
+ - `discardDegradedRestore(sessionManager, { settings, root?, signal? })`: records each partly restored worktree (or only `root`) without `degradedFrom` so it becomes the active restore target and releases the original snapshot on the next collection.
241
+ - `degradedRestorePin(sessionManager, root)`: returns `{ snapshotId, since, base?, lapsed, work?, kept? }` for a checkout with an active partial-restore target, or `undefined` otherwise.
246
242
  - `withWorktreeRestoreNotices(notices, work)` and `currentWorktreeRestoreNotices()`: scope `worktree_restore` system prompt notices across sessions opened inside `work`.
247
243
 
248
- ### Reading snapshots from windowed sessions
244
+ ### Reading older snapshots on demand
249
245
 
250
- Sessions opened at the default tail window hold only the snapshot records needed for resume. Use `sessionManager.readWorktreeSnapshotPages()` and `sessionManager.loadWorktreeSnapshotRecords()` to inspect older snapshots on demand:
246
+ Sessions opened at the default tail window load only the snapshot records needed for resume into memory. Use `sessionManager.readWorktreeSnapshotPages()` and `sessionManager.loadWorktreeSnapshotRecords()` to inspect older snapshots on demand:
251
247
 
252
248
  ```typescript
253
249
  const session = await SessionManager.open(store, sessionId);
@@ -261,7 +257,7 @@ const records = await session.loadWorktreeSnapshotRecords(ids);
261
257
 
262
258
  ### Garbage collection
263
259
 
264
- - `collectSnapshotGarbage(blobs, { graceSeconds?, signal? })`: deletes eligible unreferenced blobs from a `SqlSnapshotBlobStore` (default `graceSeconds` is `DEFAULT_BLOB_GRACE_SECONDS`, one hour) and resolves `{ deleted, pendingChunkMove? }`. Rejects non-SQL stores with `blob-store-unsupported`.
260
+ - `collectSnapshotGarbage(blobs, { graceSeconds?, signal? })`: deletes eligible unreferenced blobs from a `SqlSnapshotBlobStore` (default `graceSeconds` is `DEFAULT_BLOB_GRACE_SECONDS`, 1 hour) and resolves `{ deleted, pendingChunkMove? }`. Rejects non-SQL stores with `blob-store-unsupported`.
265
261
  - `scheduleSnapshotCollection(blobs, settings, { onFailure?, delayMs? })`: starts background collection when `settings.autoCollect` is enabled and due (sessions pass `SNAPSHOT_COLLECTION_SESSION_DELAY_MS`). Never rejects after validating settings; resolves with `collected`, `skipped`, `interrupted`, or `failed`, and does not keep an idle process alive.
266
262
  - `runningSnapshotCollection(blobs)`: returns a promise settling when the current process's active collection finishes, or `undefined` if none is running.
267
263
 
@@ -291,6 +287,7 @@ Match errors by class or `code`, never by message text. Use `isRetryableWorkspac
291
287
  | `WorkspaceRestoreError` | `tree-mismatch` | The materialized worktree tree differs from the snapshot | `target`, `expectedTree`, `actualTree` | Check `.gitattributes` filters on this host, then retry |
292
288
  | `WorkspaceRestoreError` | `unsafe-target` | `into` is non-empty (`not-empty`), or `removeRestoredWorktree` received a non-restored path (`not-restored`) | `target`, `reason` | Pass a new or empty directory, or omit `into` |
293
289
  | `WorkspaceRestoreError` | `unwritable-path` | A restore or removal could not write a directory or file | `target`, `snapshotId`, `cause` | Free disk space or fix directory permissions, then retry |
290
+ | `WorkspaceRestoreError` | `path-too-long` | On Windows, a restored worktree path or Git directory exceeds Git for Windows path limits. Nothing is written. | `snapshotId`, `target`, `limit`, `agentDir` | Set `ATOMIC_CODING_AGENT_DIR` to a shorter path ([Long paths on Windows](/guides/resume-on-any-machine#long-paths-on-windows)) |
294
291
  | `WorkspaceRestoreError` | `invalid-snapshot` | A snapshot record has unsafe remotes or malformed IDs or hashes | `snapshotId`, `field`, `reason` (`unsafe-remote`, `invalid-object-id`, `invalid-snapshot-id`, `invalid-blob-hash`) | Restore only trusted storage records or re-export on the recording machine |
295
292
  | `WorkspaceDriftError` | `tree-drift` | A checkout drifted from its snapshot and could not be restored | `root`, `expectedHead`, `actualHead`, `expectedTree`, `actualTree`, `snapshotId`, `reason?`, `restoreCode?`, `cause?` | Follow `hint` |
296
293
  | `WorkspaceCollectionError` | `collection-failed` | Database garbage collection failed (`retryable: true`; retained blobs are untouched) | `table`, `phase` (`claim`, `index`, `sweep`, `record`), `deleted`, `cause` | Check database permissions, disk space, and locks; drop broken triggers or views if hinted ([Size limits](/storage#size-limits)) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.10.9",
3
+ "version": "0.10.10-alpha.1",
4
4
  "description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "atomicConfig": {
@@ -118,13 +118,13 @@
118
118
  "prepack": "node -e \"require('node:fs').existsSync('scripts/split-dist.mjs') && import('./scripts/split-dist.mjs').then(() => import('./scripts/write-startup-files.mjs')).then(() => import('./scripts/write-startup-stages.mjs'))\""
119
119
  },
120
120
  "dependencies": {
121
- "@bastani/atomic-natives": "0.10.9",
122
- "@bastani/atomic-ai": "0.10.9",
123
- "@bastani/atomic-agent-core": "0.10.9",
124
- "@bastani/atomic-codemode": "0.10.9",
125
- "@bastani/atomic-tui": "0.10.9",
126
- "@bastani/atomic-schema": "0.10.9",
127
- "@bastani/atomic-telemetry": "0.10.9",
121
+ "@bastani/atomic-natives": "0.10.10-alpha.1",
122
+ "@bastani/atomic-ai": "0.10.10-alpha.1",
123
+ "@bastani/atomic-agent-core": "0.10.10-alpha.1",
124
+ "@bastani/atomic-codemode": "0.10.10-alpha.1",
125
+ "@bastani/atomic-tui": "0.10.10-alpha.1",
126
+ "@bastani/atomic-schema": "0.10.10-alpha.1",
127
+ "@bastani/atomic-telemetry": "0.10.10-alpha.1",
128
128
  "@silvia-odwyer/photon-node": "0.3.4",
129
129
  "chalk": "6.0.0",
130
130
  "glob": "14.0.6",
@@ -72,6 +72,20 @@
72
72
  "minLength": 1,
73
73
  "description": "Display name, also matched by --model patterns."
74
74
  },
75
+ "type": {
76
+ "anyOf": [
77
+ {
78
+ "type": "string",
79
+ "const": "chat"
80
+ },
81
+ {
82
+ "type": "string",
83
+ "const": "compactor"
84
+ }
85
+ ],
86
+ "default": "chat",
87
+ "description": "Model kind: \"chat\" (default) or \"compactor\" for a dedicated remote compaction endpoint."
88
+ },
75
89
  "api": {
76
90
  "type": "string",
77
91
  "minLength": 1,
@@ -82,6 +96,10 @@
82
96
  "minLength": 1,
83
97
  "description": "Overrides the provider baseUrl."
84
98
  },
99
+ "endpointPath": {
100
+ "type": "string",
101
+ "description": "Endpoint path appended to baseUrl for compactor requests (default \"/compact\"). Set to \"\" to POST directly to baseUrl. Applies only to compactor models."
102
+ },
85
103
  "reasoning": {
86
104
  "type": "boolean",
87
105
  "default": false,
@@ -126,6 +144,11 @@
126
144
  "default": 16384,
127
145
  "description": "Maximum output tokens."
128
146
  },
147
+ "timeoutMs": {
148
+ "type": "number",
149
+ "exclusiveMinimum": 0,
150
+ "description": "Wall-clock timeout in milliseconds for one compactor request (default 120000). Applies only to compactor models."
151
+ },
129
152
  "samplingParams": {
130
153
  "type": "object",
131
154
  "patternProperties": {
@@ -181,6 +204,13 @@
181
204
  },
182
205
  "description": "samplingParams per thinking level, merged over samplingParams."
183
206
  },
207
+ "compactionParams": {
208
+ "type": "object",
209
+ "patternProperties": {
210
+ "^.*$": {}
211
+ },
212
+ "description": "API-specific request-body parameters merged into { messages, query, model } for compactor requests. Omit to let the remote API use its own defaults. Applies only to compactor models."
213
+ },
184
214
  "headers": {
185
215
  "type": "object",
186
216
  "patternProperties": {
@@ -208,6 +238,15 @@
208
238
  "minLength": 1,
209
239
  "description": "Display name, also matched by --model patterns."
210
240
  },
241
+ "baseUrl": {
242
+ "type": "string",
243
+ "minLength": 1,
244
+ "description": "Overrides the model baseUrl."
245
+ },
246
+ "endpointPath": {
247
+ "type": "string",
248
+ "description": "Endpoint path appended to baseUrl for compactor requests (default \"/compact\"). Set to \"\" to POST directly to baseUrl. Applies only to compactor models."
249
+ },
211
250
  "reasoning": {
212
251
  "type": "boolean",
213
252
  "description": "Whether the model supports thinking."
@@ -300,6 +339,11 @@
300
339
  "exclusiveMinimum": 0,
301
340
  "description": "Maximum output tokens."
302
341
  },
342
+ "timeoutMs": {
343
+ "type": "number",
344
+ "exclusiveMinimum": 0,
345
+ "description": "Wall-clock timeout in milliseconds for one compactor request (default 120000). Applies only to compactor models."
346
+ },
303
347
  "samplingParams": {
304
348
  "type": "object",
305
349
  "patternProperties": {
@@ -355,6 +399,13 @@
355
399
  },
356
400
  "description": "samplingParams per thinking level, merged over samplingParams."
357
401
  },
402
+ "compactionParams": {
403
+ "type": "object",
404
+ "patternProperties": {
405
+ "^.*$": {}
406
+ },
407
+ "description": "API-specific request-body parameters merged into { messages, query, model } for compactor requests. Omit to let the remote API use its own defaults. Applies only to compactor models."
408
+ },
358
409
  "headers": {
359
410
  "type": "object",
360
411
  "patternProperties": {