@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
package/docs/security.md CHANGED
@@ -1,88 +1,151 @@
1
1
  ---
2
- title: "Security"
3
- description: "Atomic's local trust model, project trust prompts, sandbox boundaries, and credential export guarantees."
2
+ title: "Security and project trust"
3
+ sidebarTitle: "Security"
4
+ description: "Configure project trust, restrict tools, understand local security boundaries, and safely export credentials."
4
5
  ---
5
6
 
6
- # Security
7
-
8
7
  Atomic is a local coding agent. It runs with the permissions of the user account that starts it and treats files writable by that user as inside the same local trust boundary.
9
8
 
10
9
  ## Project trust
11
10
 
12
- Project trust controls whether Atomic loads project-local settings, resources, packages, and extensions. It is not a sandbox and does not restrict what the model can ask tools to do once a session starts.
11
+ Project trust controls whether Atomic loads project-local settings, instructions, resources, packages, and extensions. It is not a sandbox and does not restrict what tools can do once a session starts.
12
+
13
+ Atomic treats a folder as having trust-gated inputs when it finds any of these from the current working directory:
14
+
15
+ - Any of these 11 entries inside `.atomic/` or legacy `.pi/` in the current directory: `settings.json`, `extensions`, `skills`, `prompts`, `themes`, `workflows`, `agents`, `mcp.json`, `blueprint.yaml`, `SYSTEM.md`, or `APPEND_SYSTEM.md`. An empty `.atomic/` directory, or one containing only state such as `.atomic/todos`, does not trigger project trust.
16
+ - Project instruction files in the current directory or an ancestor directory: `AGENTS.override.md`, `AGENTS.md`, `AGENTS.MD`, `CLAUDE.md`, or `CLAUDE.MD`.
17
+ - `.agents/skills` in the current directory or an ancestor directory. `~/.agents/skills` in your home directory is always treated as a trusted user resource and never triggers project trust.
18
+ - At the nearest ancestor project root (any ancestor containing `.atomic/`, `.pi/`, or `.agents/`), any `.agents/` directory, `.atomic/agents`, `.pi/agents`, `.atomic/settings.json`, or `.pi/settings.json`. Your home directory is never treated as an ancestor project root for these checks.
19
+
20
+ Saved decisions live in `~/.atomic/agent/trust.json`, keyed by canonical directory path mapped to `true` or `false`. Atomic checks `trust.json` from the current directory upward and applies the closest saved decision ahead of global defaults. A saved `false` entry for the current folder or an ancestor still marks the folder untrusted even when no trust-gated files are present right now.
21
+
22
+ On Windows, saved paths match case-insensitively and saving removes duplicate entries with different casing. Atomic writes `trust.json` atomically through a temporary file while holding `trust.json.lock` (waiting up to 5 seconds, or taking over stale locks older than 10 seconds) and follows symlinks to update the target file. If `trust.json` contains malformed JSON or invalid values, Atomic warns once and treats it as empty until the next save. If the file cannot be read because of permissions, saving fails instead of overwriting it.
23
+
24
+ When no saved decision matches and the folder has trust-gated inputs, Atomic checks global `defaultProjectTrust` in `~/.atomic/agent/settings.json` (`"ask"`, `"always"`, or `"never"`; default `"ask"`). `defaultProjectTrust` is global-only: Atomic ignores it in project `.atomic/settings.json` and falls back to `"ask"` if the global value is invalid or unreadable (printing a warning on read failure).
25
+
26
+ In an interactive session with `defaultProjectTrust: "ask"`, Atomic opens a trust prompt with five options (four at the filesystem root):
27
+
28
+ - **Trust**
29
+ - **Trust parent folder (`<path>`)**
30
+ - **Trust (this session only)**
31
+ - **Do not trust**
32
+ - **Do not trust (this session only)** (selected by default)
13
33
 
14
- Atomic treats a project as having trust inputs when it finds any of these from the current working directory:
34
+ Choosing **Trust parent folder** saves `true` for the parent directory and removes any saved entry for the current directory so it inherits from the parent. Pressing `Escape` cancels the prompt and leaves the folder untrusted for this session only without writing to `trust.json`.
15
35
 
16
- - `.atomic/` (or legacy `.pi/`) in the current directory
17
- - `AGENTS.override.md`, `AGENTS.md`, or `CLAUDE.md` in the current directory or an ancestor directory
18
- - `.agents/skills` in the current directory or an ancestor directory
19
- - Agent definitions (`.atomic/agents`, legacy `.pi/agents`, or `.agents`) or a settings file at the nearest ancestor project root, which subagents read
36
+ Use the `Up` and `Down` arrow keys to pick an option, then press `Enter`. If you typed or pasted text before or while the prompt opened, `Enter` is disarmed so pressing `Enter` adds a newline to your draft instead of confirming trust by accident. Press `Up` or `Down` once to arm `Enter`, then confirm. Your draft stays in the editor afterward so you can review and send it.
20
37
 
21
- When an interactive session starts in a project with trust inputs and no saved decision for that directory or a parent, Atomic checks `defaultProjectTrust` from global settings. The default is `"ask"`, which opens a trust prompt when UI is available. Saved decisions live in `~/.atomic/agent/trust.json` by canonical directory path, and the closest saved decision on the current or parent path takes precedence over the global default.
38
+ Run `/trust` at any time to save a persistent choice (**Trust**, **Trust parent folder**, or **Do not trust**). Restart Atomic after saving in `/trust` for the new choice to take effect; `/reload` does not re-evaluate a newly saved `/trust` decision. To clear a saved decision completely, remove its path entry from `~/.atomic/agent/trust.json` (or choose **Trust parent folder** to clear a child override).
22
39
 
23
- The trust prompt defaults to **Do not trust (this session only)**. Use the up and down arrow keys to choose, then press Enter. Any text you typed before or during the prompt stays in the editor as a draft; review the draft and press Enter after answering to send it.
40
+ If you start an interactive session in a clean folder (no trust-gated inputs at startup and neither `--approve` nor `--no-approve`) and create trust-gated files such as `.atomic/settings.json` or `.atomic/extensions` during that session, running `/reload` automatically saves `true` for that folder in `trust.json` when no decision is saved yet.
24
41
 
25
- ### What project trust allows
42
+ ### What project trust unlocks
26
43
 
27
- Trusting a project allows Atomic to load:
44
+ Trusting a project lets Atomic load:
28
45
 
29
46
  - `.atomic/settings.json` (or legacy `.pi/settings.json`)
30
- - `.atomic`/`.pi` extensions, skills, prompt templates, themes, and system prompt files
31
- - Project subagent definitions and agent overrides
47
+ - `.atomic` and legacy `.pi` extensions, skills, prompt templates, themes, and system prompt files (`SYSTEM.md`, `APPEND_SYSTEM.md`)
48
+ - Project-local `AGENTS.override.md`, `AGENTS.md`, `AGENTS.MD`, `CLAUDE.md`, and `CLAUDE.MD`, plus project `.agents/skills`
49
+ - Project subagent definitions and agent overrides (`.atomic/agents`, `.pi/agents`, and `.agents`)
32
50
  - Earlier workflow files for on-demand [conversion to skills](/orchestration/migrating-workflows) (read as text only, never executed, modified, or deleted)
33
51
  - Project MCP server config (`.atomic/mcp.json`) and blueprint builds (`.atomic/blueprint.yaml`)
34
- - Project-configured packages and package-managed extensions
52
+ - Project-configured packages, automatic installation of missing project packages, and package-managed extensions
35
53
 
36
- Declining trust skips those project inputs, including project-local `AGENTS.override.md`, `AGENTS.md`, and `CLAUDE.md`. Global context, global workflow conversions, and explicit CLI resources remain available. Interactive sessions in an untrusted project show a warning; run `/trust` to save a decision, then restart Atomic.
54
+ Declining trust skips all of these project inputs. Global instructions, global skills, global settings, and explicit CLI resources remain available. Interactive sessions in an untrusted project display a warning; run `/trust` to save a decision, then restart Atomic.
37
55
 
38
- ### Resumed folders, worktrees, and extension hooks
56
+ ### Folders, worktrees, non-interactive runs, and extension hooks
39
57
 
40
58
  - **Per-folder trust:** Trust belongs to the folder a session works in, not the directory you started Atomic from. Resuming a session (`--resume`, `--continue`, `--session`, or `/resume`) applies that folder's trust decision and prompts if none is saved. Session-only choices last until Atomic exits and are never written to `trust.json`.
41
- - **Git worktrees:** A worktree outside its main repository folder has its own trust decision because it can check out different `.atomic` content. Choose **Trust parent folder** (at the prompt or in `/trust`) to trust sibling worktrees stored under one directory.
42
- - **Extension `project_trust` hooks:** User/global extensions and explicit CLI `-e` extensions can handle the `project_trust` event ahead of saved trust decisions. When such extensions are installed, Atomic waits for them before applying project settings, resources, or a project-configured session store (unless `--approve` or `--no-approve` overrides trust for that run). Switching to a resumed session in another folder shuts down the previous folder's extensions (with a 5-second limit) before loading the resumed folder's extensions.
43
- - **Borrowed `-e` sources:** If `-e <dir>` discovers resources from that directory's `.atomic`, legacy `.pi`, or `.agents/skills`, Atomic checks trust for that source before loading them, because borrowed extensions run with the Atomic process's permissions.
44
- - **Non-interactive runs:** Print mode (`-p`), `--mode json`, and `--mode rpc` do not show a trust prompt. Without a saved decision, `defaultProjectTrust: "ask"` and `"never"` ignore project resources, while `"always"` loads them. Pass `--approve` (`-a`) or `--no-approve` (`-na`) to override trust for one run.
59
+ - **Git worktrees:** A worktree outside its main repository folder has its own trust decision because it can check out different `.atomic` content. Choose **Trust parent folder** (at the prompt or in `/trust`) to trust sibling worktrees under one parent directory.
60
+ - **Extension `project_trust` hooks:** Global extensions and explicit CLI `-e` extensions can handle the `project_trust` event ahead of `trust.json` and `defaultProjectTrust`. When such extensions are installed, Atomic waits for them before applying project settings, resources, or a project-configured session store. Handlers run in extension load order: returning `{ trusted: "undecided" }` passes to the next handler, and the first `{ trusted: "yes" }` or `{ trusted: "no" }` wins (and writes to `trust.json` when `remember: true`). If a handler throws an error, Atomic logs a warning and continues to the next handler, or falls back to `trust.json`, `defaultProjectTrust`, and the prompt. Hooks do not run when a folder has no trust-gated inputs or when `--approve` or `--no-approve` overrides trust. Switching to a resumed session in another folder shuts down the previous folder's extensions (waiting up to 5 seconds before continuing) before loading the resumed folder's extensions.
61
+ - **Borrowed `-e` sources:** If `-e <dir>` discovers resources from that directory's `.atomic`, legacy `.pi`, or `.agents/skills`, Atomic checks `trust.json` under that source's canonical path (cached for the session) before loading them, because borrowed extensions run with your user permissions. Passing `--approve` (`-a`) or `--no-approve` (`-na`) also overrides trust for borrowed `-e` sources.
62
+ - **Non-interactive runs:** Print mode (`-p`), `--mode json`, and `--mode rpc` never open a trust prompt. Without a saved decision, `defaultProjectTrust: "ask"` and `"never"` leave the project untrusted and skip project resources, while `"always"` trusts the project. Pass `--approve` (`-a`) or `--no-approve` (`-na`) to override trust for one run.
45
63
 
46
64
  ## No built-in sandbox
47
65
 
48
66
  Atomic does not include a built-in sandbox. Built-in tools read, write, and edit files and run shell commands with the permissions of the Atomic process. Extensions run as TypeScript modules with the same permissions.
49
67
 
50
- Use OS isolation or a container when you need a security boundary.
68
+ Use OS isolation, a container, or a VM when you need a security boundary.
51
69
 
52
- Project trust only guards input loading so a repository cannot silently change settings or run extensions before you approve it. It does not make untrusted code, prompts, or model output safe. Prompt injection from repository files, comments, docs, context files, or command output is an inherent risk for local coding agents.
70
+ Project trust only guards project input loading so a repository cannot change settings or run extensions before you approve it. It does not make untrusted code, prompts, or model output safe. Prompt injection from repository files, comments, docs, context files, or command output is an inherent risk for any local coding agent.
53
71
 
54
- When the built-in `bash` tool is enabled, model-supplied commands run through the configured shell with the Atomic process's permissions. Atomic provides no command-level allowlist or denylist for `bash`. Use `tools`, `excludedTools`, or `noTools` to decide whether a session has shell access, and use a container, VM, remote sandbox, restricted OS account, or custom tool when you need command allowlisting or stronger isolation. Be careful with interpreters, shells, package managers, `curl`, `git`, `sudo`, `env`, `xargs`, and other programs that can run arbitrary commands.
72
+ When shell tools are enabled, model-supplied commands run through the configured shell with your user permissions, and Atomic provides no command-level allowlist or denylist. Be careful with shells, interpreters, package managers, `curl`, `git`, `sudo`, `env`, `xargs`, and any other program that can run arbitrary commands.
55
73
 
56
- ## Running untrusted or unmonitored work
74
+ You can narrow which tools a session exposes:
57
75
 
58
- For untrusted repositories, unreviewed generated code, or unattended automation, run Atomic inside an isolated environment with only the files and credentials required for the task.
76
+ - **CLI flags:** Pass `--tools` (`-t`) to set an allowlist or apply `+name`/`-name` modifiers, `--exclude-tools` (`-xt`) to remove specific tools, `--no-builtin-tools` (`-nbt`) to omit default coding tools, or `--no-tools` (`-nt`) to disable every tool (including extension tools such as `intercom`).
77
+ - **Settings:** Configure `defaultTools` in [Settings](/settings#tools) globally or in a trusted project.
78
+ - **SDK:** Pass `tools`, `excludedTools`, or `noTools` when creating a session.
59
79
 
60
- See [Containerization](/containerization) for common setups:
80
+ On native Windows, Atomic enables the `powershell` tool alongside `bash` whenever PowerShell is installed. Excluding `bash` alone still leaves `powershell` enabled. Exclude both when you want no shell execution:
61
81
 
62
- - Run the whole `atomic` process inside OpenShell or Docker.
82
+ ```bash
83
+ atomic --exclude-tools bash,powershell
84
+ ```
85
+
86
+ Use a container, VM, remote sandbox, restricted OS account, or custom tool wrapper when you need command allowlisting or filesystem isolation.
87
+
88
+ ## Running untrusted or unattended work
89
+
90
+ For untrusted repositories, unreviewed generated code, or unattended automation, run Atomic inside an isolated environment with only the files and credentials needed for the task.
91
+
92
+ See [Run Atomic in containers](/containerization) for common setups:
93
+
94
+ - Run the whole `atomic` process inside Docker or NVIDIA OpenShell.
63
95
  - Run Atomic on the host while routing built-in file and shell tools into a Gondolin micro-VM.
64
96
  - Mount only the workspace paths the agent needs.
65
97
  - Avoid mounting host `~/.atomic` or `~/.atomic/agent` unless the container should access host sessions, settings, and credentials.
66
98
  - Pass only the minimum required API keys or short-lived tokens.
67
- - Restrict network access when the task does not need it.
99
+ - Restrict outbound network access when the task does not need it.
68
100
  - Review diffs and outputs before copying files back to trusted systems.
69
101
 
70
102
  If you bind-mount a host directory read/write, writes inside the container or VM modify host files directly. Use read-only mounts or copy files in and out when you need to protect host checkouts from unintended writes.
71
103
 
72
104
  ## Credential export
73
105
 
74
- `atomic auth print-api-key`, `atomic auth print-bearer-token`, and `atomic auth check --credentials` export a stored or resolved credential so external clients can reuse your Atomic authentication without reading `auth.json`. `atomic auth check` without `--credentials` stays status-only.
75
-
76
- Credential-export guarantees:
77
-
78
- - **Stdout carries credentials only on explicit export.** Warnings, provider selection, refresh notices, and `atomic auth --help` go to stderr. In `KEY=$(atomic auth check --provider openai --credentials)`, stdout receives a credential only on success; failed checks leave stdout empty and write status to stderr (or return status-only JSON under `--json`).
79
- - **Clear failure exit codes.** If a stream fails after the full credential is written, Atomic reports the error on stderr and keeps exit code `0`. If writing fails partway through the credential, Atomic exits with code `9` so callers discard the partial stdout bytes. All other raw export failures leave stdout empty.
80
- - **No file or clipboard sink.** There is no `--output` flag; redirect stdout yourself if you choose to save the output. The print subcommands accept only `--provider` and `--model` (plus `--min-expiry` on `print-bearer-token`).
81
- - **No ambient target.** Print subcommands require `--model`, and `auth check --credentials` requires `--provider` or an exact `--model` (never a fuzzy match or an unnamed current session model).
82
- - **Minimum OAuth lifetime.** `auth check --credentials` and `print-bearer-token` require at least 30 minutes of remaining OAuth lifetime by default (configurable with `--min-expiry` on `print-bearer-token`). Normal runs refresh expiring tokens automatically; `--no-refresh` refuses short-lived tokens without modifying `auth.json`. `print-bearer-token` exits with code `5` when refresh fails while leaving stored credentials untouched.
83
- - **No log leakage.** Atomic never writes exported credentials to its logs, session transcripts, error messages, or RPC responses.
84
-
85
- Once a credential reaches stdout, it is ordinary text in your shell or pipeline. Prefer `print-bearer-token`, which emits an expiring token, over a long-lived API key, and never call credential export inside a script that logs its own output.
106
+ `atomic auth print-api-key`, `atomic auth print-bearer-token`, and `atomic auth check --credentials` export a resolved credential to stdout so external clients can reuse your Atomic authentication without reading `auth.json`. `atomic auth check` without `--credentials` stays status-only and never prints a secret.
107
+
108
+ ```bash
109
+ TOKEN=$(atomic auth print-bearer-token --provider openai-codex --model gpt-5.4 --min-expiry 45m)
110
+ KEY=$(atomic auth check --provider openai --credentials)
111
+ ```
112
+
113
+ Credential-export guarantees and exact flag rules:
114
+
115
+ - **Stdout carries credentials only on explicit export.** Warnings, provider selection, refresh notices, and `atomic auth --help` go to stderr. Failed exports leave stdout empty (except partial write exit code `9`) and report status on stderr, or emit status-only JSON under `auth check --json --credentials`.
116
+ - **Explicit targets and matching rules.** `print-api-key` and `print-bearer-token` always require `--model` (never an unnamed session model). Without `--provider`, both print subcommands use fuzzy model matching to infer the provider. If `--model` matches multiple configured providers, Atomic queries each candidate before exiting with code `3`, which can refresh and persist an expiring OAuth token on a candidate provider before reporting ambiguity. Pass `--provider` to avoid ambiguity and extra token checks. `auth check --credentials` requires `--provider` or an exact `--model` (never fuzzy matching).
117
+ - **Flag scope and OAuth lifetime.** `print-bearer-token` and `auth check --credentials` require at least 30 minutes of remaining OAuth lifetime by default and refresh expiring tokens automatically. `--min-expiry <duration>` accepts `<integer><ms|s|m|h>` (case-insensitive, default `30m`), works only on `print-bearer-token`, and is rejected on `print-api-key` (even after `--`) and `auth check`. `--no-refresh` works only on `auth check` (rejected with exit code `1` on `print-bearer-token`) and refuses short-lived tokens without modifying `auth.json`.
118
+ - **No file or clipboard sink.** There is no `--output` flag or clipboard option; redirect stdout yourself if you choose to save the output.
119
+ - **JSON output on `auth check --json --credentials`.** A ready check emits `{"status":"ready","provider":"...","authType":"...","credentials":"..."}`. A non-ready check emits the status JSON object without a `credentials` field.
120
+ - **Stream failure handling.** If a stream error occurs after the complete credential is written, Atomic reports the error on stderr and exits `0`. If writing fails partway through, Atomic exits with code `9` so callers discard the partial stdout bytes.
121
+ - **No log leakage.** Atomic never writes exported credentials to debug logs, session transcripts, error messages, or RPC responses.
122
+
123
+ ### Exit codes for `print-api-key` and `print-bearer-token`
124
+
125
+ | Exit code | Meaning |
126
+ | --- | --- |
127
+ | `0` | Credential written to stdout |
128
+ | `1` | Usage error (invalid flag or missing `--model`) |
129
+ | `2` | No credential configured for the resolved provider |
130
+ | `3` | Provider ambiguous (multiple configured providers matched `--model`) |
131
+ | `4` | Wrong credential kind (provider uses OAuth when API key was requested, or vice versa) |
132
+ | `5` | OAuth refresh failed (stored credential left untouched) |
133
+ | `6` | Refreshed token still expires sooner than `--min-expiry` |
134
+ | `7` | OAuth credential derivation failed (a refresh may already have persisted) |
135
+ | `8` | Output write failed before any bytes were emitted |
136
+ | `9` | Partial write to stdout; discard the received bytes |
137
+
138
+ ### Exit codes for `auth check`
139
+
140
+ | Exit code | Meaning |
141
+ | --- | --- |
142
+ | `0` | Provider is ready |
143
+ | `1` | Provider is not ready |
144
+ | `2` | Auth state or command is invalid |
145
+ | `8` | With `--credentials`, output write failed before any bytes were emitted |
146
+ | `9` | With `--credentials`, partial write to stdout; discard the received bytes |
147
+
148
+ Once a credential reaches stdout, it is ordinary text in your shell or pipeline. Prefer `print-bearer-token`, which emits an expiring token, over a long-lived API key, and never call credential export inside a script that logs its own stdout.
86
149
 
87
150
  ## Reporting security issues
88
151
 
@@ -1,21 +1,22 @@
1
1
  ---
2
- title: Session format
3
- description: Format-4 JSONL session schema, message and entry types, context projection, and the SessionManager API.
2
+ title: "Session file format"
3
+ sidebarTitle: "Session format"
4
+ description: "Format-4 JSONL session schema, message and entry types, context rebuilding rules, and the SessionManager API."
4
5
  ---
5
6
 
6
- # Session file format
7
-
8
- This page describes format-4 JSONL files used by explicit JSONL stores and session exports. Sessions default to SQLite; see [Session storage](/sessions#session-storage) to choose a store.
7
+ This reference describes format-4 JSONL files used by explicit JSONL stores and session exports. Sessions default to local SQLite; see [Session storage](/sessions#session-storage) to choose a store.
9
8
 
10
9
  In JSONL, each line is a JSON object with a `type` field. Session entries form a tree through `id` and `parentId`.
11
10
 
12
11
  ## File location
13
12
 
14
13
  ```text
15
- <selected-jsonl-directory>/<timestamp>_<session-id-hash>.jsonl
14
+ <selected-jsonl-directory>/--<encoded-cwd>--/<timestamp>_<sha256-of-id>.jsonl
16
15
  ```
17
16
 
18
- `sessions.storage.dir` and `--session-dir` select the directory that holds JSONL files. Resume and fork selection match by session ID rather than file path. Local artifacts and tool-result files stay on the filesystem even when a session is stored in a database.
17
+ `sessions.storage.dir` and `--session-dir` choose the root directory for JSONL files. Unless opened with `exactDirectory: true`, Atomic groups files into a per-project subdirectory named `--<encoded-cwd>--` (falling back to `--<sha256-of-cwd>--` when the encoded directory name exceeds 180 UTF-8 bytes), and names each file with its timestamp and the 64-character hex SHA-256 hash of the session ID.
18
+
19
+ Resume and fork selection match by session ID rather than file path. Local artifacts and tool-result files stay on the filesystem even when a session is stored in a database.
19
20
 
20
21
  ## Deleting sessions
21
22
 
@@ -23,8 +24,6 @@ In an explicit JSONL store, you can remove a session by deleting its `.jsonl` fi
23
24
 
24
25
  To delete individual sessions from `/resume`, select a session, press `Ctrl+D`, and confirm. Database stores delete the session record, and JSONL stores use the `trash` CLI when available.
25
26
 
26
- Entries in the active window keep their exact `id` and `parentId` strings. Very large IDs count toward that window's memory even when the message is short or referenced only by a compaction boundary. Atomic does not shorten IDs when copying or importing a session.
27
-
28
27
  ## Session version
29
28
 
30
29
  `SessionManager` writes format-4 headers with `createdAt` and `parentSessionId`. Sessions in formats 1, 2, and 3, along with early format-4 files that use `timestamp` and `parentSession`, upgrade automatically when opened, resumed, imported, or forked.
@@ -37,13 +36,13 @@ Future versions, unrecognized version numbers, and structurally invalid entries
37
36
 
38
37
  Inspect the exported TypeScript declarations in your installed packages:
39
38
 
40
- - `@bastani/atomic`: `SessionManager`, `SessionHeader`, `SessionEntry`, `BashExecutionMessage`, `CustomMessage`, and `BranchSummaryMessage`.
39
+ - `@bastani/atomic`: `SessionManager`, `SessionHeader`, `SessionEntry`, `UsageEntry`, `BashExecutionMessage`, `CustomMessage`, and `BranchSummaryMessage`.
41
40
  - `@bastani/atomic-ai`: `SystemMessage`, `UserMessage`, `AssistantMessage`, `ToolResultMessage`, `Usage`, and `StopReason`.
42
41
  - `@bastani/atomic-agent-core`: `AgentMessage`.
43
42
 
44
43
  ## Message types
45
44
 
46
- Session entries store `AgentMessage` objects. Understanding these shapes helps when parsing exports or building extensions.
45
+ Session entries store `AgentMessage` objects (and `SystemMessage` checkpoints). Understanding these shapes helps when parsing exports or building extensions.
47
46
 
48
47
  ### Content blocks
49
48
 
@@ -192,6 +191,8 @@ type AgentMessage =
192
191
  // compactionSummary appears only in older session files and is not part of the active union.
193
192
  ```
194
193
 
194
+ `SystemMessage` objects are saved inside `SessionMessageEntry` entries to track prompt and tool changes on each branch, but they are replayed into the session's system prompt and tool set separately rather than appearing in `AgentMessage`.
195
+
195
196
  ## Entry base
196
197
 
197
198
  All entries except `SessionHeader` extend `SessionEntryBase`:
@@ -205,6 +206,8 @@ interface SessionEntryBase {
205
206
  }
206
207
  ```
207
208
 
209
+ Entries loaded in the active context window keep their exact `id` and `parentId` strings. Very large IDs count toward memory even when the message is short or referenced only by a compaction boundary. Atomic does not shorten IDs when copying or importing a session.
210
+
208
211
  ## Entry types
209
212
 
210
213
  ### SessionHeader
@@ -221,6 +224,8 @@ Sessions created from another session through `/fork`, `/clone`, or `newSession(
221
224
  {"type":"session","version":4,"id":"uuid","createdAt":"2024-12-03T14:00:00.000Z","cwd":"/path/to/project","parentSessionId":"original-session-id"}
222
225
  ```
223
226
 
227
+ When a fork crosses into a different storage backend, Atomic also sets `parentInOtherStore: true` on the header and prints `Parent history is in its original store or is no longer available.` when the forked session reopens.
228
+
224
229
  Any session with `internal: true` in its header is excluded from `/resume`, `atomic -r`, `-c`, and `history://sessions`, while remaining openable by exact ID. Fresh subagent sessions and `newSession({ internal: true })` set this flag:
225
230
 
226
231
  ```json
@@ -231,7 +236,7 @@ Older workflow-stage sessions also carried `workflow` metadata (`runId`, `stageI
231
236
 
232
237
  ### SessionMessageEntry
233
238
 
234
- A conversation message whose `message` field holds an `AgentMessage`:
239
+ A conversation message whose `message` field holds an `AgentMessage` or `SystemMessage`. Queued messages also store an optional `queuedMessageId` receipt ID:
235
240
 
236
241
  ```json
237
242
  {"type":"message","id":"a1b2c3d4","parentId":"prev1234","timestamp":"2024-12-03T14:00:01.000Z","message":{"role":"user","content":"Hello"}}
@@ -262,6 +267,16 @@ Recorded when the thinking or reasoning level changes:
262
267
  {"type":"thinking_level_change","id":"e5f6g7h8","parentId":"d4e5f6g7","timestamp":"2024-12-03T14:06:00.000Z","thinkingLevel":"high"}
263
268
  ```
264
269
 
270
+ ### UsageEntry
271
+
272
+ Records auxiliary model usage (such as prompt cache warming with `kind: "cache_warm"`) toward session totals without adding anything to LLM context:
273
+
274
+ ```json
275
+ {"type":"usage","id":"u1v2w3x4","parentId":"e5f6g7h8","timestamp":"2024-12-03T14:06:10.000Z","kind":"cache_warm","provider":"anthropic","model":"claude-sonnet-4-5","usage":{"input":1200,"output":0,"cacheRead":0,"cacheWrite":1200,"totalTokens":1200,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0.0045,"total":0.0045}}}
276
+ ```
277
+
278
+ Fields: `kind` (string category), `provider`, `model`, `usage` (`Usage`), and optional `note`.
279
+
265
280
  ### CompactionEntry
266
281
 
267
282
  Created by `/compact`, RPC `compact`, and automatic compaction. The `summary` field holds the boundary message the model sees next, either a `Context cleared` message or a `Context compacted` message with compacted text, followed by recovery instructions. `firstKeptEntryId` is `null` because no earlier message stays in context.
@@ -274,6 +289,8 @@ An entry is active only when `details.strategy` is `"verbatim-lines"`:
274
289
 
275
290
  Rebuilt context contains one visible `custom` message with `customType: "compaction"` holding `summary`. Messages appended after the boundary stay ordinary messages, and resuming requires no model request.
276
291
 
292
+ Optional top-level fields on `CompactionEntry` include `usage` (compactor usage), `fromHook` (`true` when an extension supplied compacted text), `systemMessage` (replayed system prompt and tool checkpoint), `coveredThroughEntryId` (legacy mid-tool-call boundaries), and `recallSessionId` (legacy fork history link source).
293
+
277
294
  Key `details` fields include:
278
295
 
279
296
  - `form`: `"cleared"` or `"compacted"`.
@@ -281,7 +298,7 @@ Key `details` fields include:
281
298
  - `fallbackReason`: present when a configured compactor was not used and Atomic cleared context instead.
282
299
  - `history`: locates the boundary in `history://sessions/<sessionId>` with `rangeUnit: "entries"`, `entriesBefore`, `boundaryEntry`, and `totalEntries`.
283
300
  - `historyAccess`: `"read-search"` or `"session-history-tool"`.
284
- - `backupPath`: optional pre-compaction backup path.
301
+ - `backupPath`: optional pre-compaction backup path (JSONL stores only).
285
302
 
286
303
  See [Persistence and resume](/compaction/reference#persistence-and-resume) for every field.
287
304
 
@@ -331,9 +348,9 @@ Extension state persistence that does not enter LLM context:
331
348
  {"type":"custom","id":"h8i9j0k1","parentId":"g7h8i9j0","timestamp":"2024-12-03T14:20:00.000Z","customType":"my-extension","data":{"count":42}}
332
349
  ```
333
350
 
334
- Use `customType` to identify your extension's entries on reload. Atomic also writes three built-in custom entry types:
351
+ Use a unique `customType` to identify your extension's entries on reload. Atomic also writes built-in custom entry types for internal state, including:
335
352
 
336
- - `atomic.tool-output`: written before a tool result that points to `tool-output://<sha256>` when oversized output from a released subagent is stored with the session. `data` holds `{ toolCallId, hash, bytes }`. Exported JSONL files also include `base64` once per blob; import and fork verify each blob against `hash`, store it, and drop `base64`.
353
+ - `atomic.tool-output`: written before a tool result pointing to `tool-output://<sha256>` when oversized output from an unloaded subagent is stored with the session. `data` holds `{ toolCallId, hash, bytes }`. Exported JSONL files also include `base64` once per blob; import and fork verify each blob against `hash`, store it, and drop `base64`.
337
354
 
338
355
  ```json
339
356
  {"type":"custom","id":"i9j0k1l2","parentId":"h8i9j0k1","timestamp":"2024-12-03T14:21:00.000Z","customType":"atomic.tool-output","data":{"toolCallId":"call_1","hash":"9c56...","bytes":1048576}}
@@ -351,6 +368,8 @@ Use `customType` to identify your extension's entries on reload. Atomic also wri
351
368
  {"type":"custom","id":"k1l2m3n4","parentId":"j0k1l2m3","timestamp":"2024-12-03T14:23:00.000Z","customType":"resume_timings","data":{"version":1,"startedAt":"2024-12-03T14:22:00.000Z","restores":[{"root":"/home/me/project","mode":"fresh","fetch":"full","ms":18520,"phases":{"fetch":9900,"materialize":1400,"verify":210,"publish":12}}],"blueprint":[{"section":"maintenance","name":"npm install","ms":8600,"exit":"ok"}],"firstPromptReadyMs":28400,"blueprintReadyMs":28300}}
352
369
  ```
353
370
 
371
+ - `workspace_binding`: records a session's bound worktree path (`{ kind: "bound-workspace", worktree }`) when opened against a specific workspace binding. Atomic also uses additional reserved `customType` keys for Intercom memberships, tool deactivation, web search results, and task completion tracking.
372
+
354
373
  ### CustomMessageEntry
355
374
 
356
375
  Extension messages that enter LLM context unless `excludeFromContext` is `true`:
@@ -364,14 +383,6 @@ Extension messages that enter LLM context unless `excludeFromContext` is `true`:
364
383
  - `details`: optional extension metadata, never sent to the LLM.
365
384
  - `excludeFromContext`: `true` marks a display-only message excluded from model requests.
366
385
 
367
- ### Reader-only chat records
368
-
369
- Built-in stores save turn-ending diagnostic lines, such as cancelled retry errors, separately from session entries so reopening a session can display them in place. Each saved line is capped at 4,096 UTF-8 bytes and ends with `... [diagnostic truncated]` if trimmed, while the live terminal error stays intact.
370
-
371
- These records are not session entries. `/tree`, model requests, compaction, token totals, conversation exports, and continuation logic ignore them. Copying a JSONL file or importing a session does not transfer them, and local libSQL `file:` databases do not store them.
372
-
373
- Cache-miss and dropped-thinking notices are derived from saved assistant replies. When a compacted session opens on its active window, Atomic does not reload discarded history to reconstruct earlier notice counts.
374
-
375
386
  ### LabelEntry
376
387
 
377
388
  User-defined bookmark on an entry:
@@ -400,7 +411,7 @@ Generated one-line session summary written when the agent goes idle and shown in
400
411
  {"type":"session_summary","id":"l2m3n4o5","parentId":"k1l2m3n4","timestamp":"2024-12-03T14:36:00.000Z","summary":"Refactored auth module token refresh and added retry tests","summarizedThroughId":"j0k1l2m3","usage":{"input":812,"output":21}}
401
412
  ```
402
413
 
403
- - `summary`: stored one-line text with collapsed whitespace and bounded length.
414
+ - `summary`: stored one-line text with collapsed whitespace and bounded length (up to 160 characters).
404
415
  - `summarizedThroughId`: entry ID of the latest user or assistant message covered by the summary. Tool results do not invalidate it, but any newer user or assistant message or a later `branch_summary` retires it.
405
416
  - `usage`: optional token usage from the summary request, counted toward session totals.
406
417
 
@@ -415,12 +426,21 @@ Repository state of one checkout at the end of a turn that ran a file-writing to
415
426
  - `snapshot`: present when the state changed; an entry without `snapshot` references an earlier entry with the same `snapshotId`.
416
427
  - `restore`: present when a resume restored the snapshot into a new worktree (`{ from, to, snapshotId, tree, restoredAt }`). Later resumes map `from` to `to`.
417
428
  - `restore.degraded`: present when a resume restored less than the full snapshot (`{ stage, head, tree, basis?, missingLinks, missingPaths, missingCommits, cause, causeReason?, hint }`). `stage` is `"partial-changes"` or `"closest-commit"`, and `basis` (`"pushed-base"`, `"earlier-snapshot"`, or `"branch-tip"`) identifies the commit source for a closest-commit restore.
429
+ - `degradedFrom`: present on entries captured in a partly restored worktree to pin the original snapshot ID as the checkout's restore target until a full restore succeeds, `discardDegradedRestore()` releases it, or 30 days pass. On a full restore that carried over edits from a partly restored worktree, `degradedFrom` names the snapshot of those carried-over edits until the merged worktree is recorded or released.
418
430
  - `unrestored`: present instead of `restore` when a resume continued without restoring `root` (`{ snapshotId, continuedIn, place, from?, cause, causeReason?, detail, hint, at }`). `place` is `"recorded"` or `"launch"`. When `from` is set on the active checkout, file tools map paths under `from` to `continuedIn` until a later resume restores the checkout.
419
431
  - `restoreWarnings`: optional host warnings paired with `restore`, such as `{ code: "lfs-objects-unavailable", paths }` or `{ code: "stale-restore-retained", path, kind }`. Fresh-worktree LFS downloads run after the restore entry is written, so their warnings appear in resume notices instead.
420
432
  - `captureMs`: capture duration in milliseconds for a turn capture.
421
433
  - `capturedAt`: recording timestamp when a resume adopts a subagent's newer snapshot for a checkout.
422
434
  - `blobs`: present only in exported JSONL files, holding base64 patch and bundle payloads keyed by SHA-256. Import verifies and stores them, then drops `blobs`.
423
435
 
436
+ ## Saved diagnostic notices
437
+
438
+ Built-in stores save turn-ending diagnostic lines, such as cancelled retry errors, separately from session entries so reopening a session can display them in place. Each saved line is capped at 4,096 UTF-8 bytes and ends with `... [diagnostic truncated]` if trimmed, while the live terminal error stays intact.
439
+
440
+ These records are not session entries. `/tree`, model requests, compaction, token totals, conversation exports, and continuation logic ignore them. Copying a JSONL file or importing a session does not transfer them, and local libSQL `file:` databases do not store them.
441
+
442
+ Cache-miss and dropped-thinking notices are derived from saved assistant replies. When a compacted session opens on its active context window, Atomic does not reload discarded history to reconstruct earlier notice counts.
443
+
424
444
  ## Tree structure
425
445
 
426
446
  Entries form a tree rooted at the first entry (`parentId: null`). Each subsequent entry points to its parent through `parentId`, branching adds sibling children from an earlier entry, and the leaf marks the active position:
@@ -433,7 +453,7 @@ Entries form a tree rooted at the first entry (`parentId: null`). Each subsequen
433
453
 
434
454
  ## Context building
435
455
 
436
- `buildSessionProjection()` walks the active branch from root to leaf, replays model, thinking-level, and context-window changes, selects the latest `compaction` entry with `details.strategy === "verbatim-lines"`, and applies the latest `context_edit` for each target.
456
+ `buildSessionProjection()` walks the active branch from root to leaf, replays model and thinking-level changes, selects the latest `compaction` entry with `details.strategy === "verbatim-lines"`, and applies the latest `context_edit` for each target.
437
457
 
438
458
  It returns model-visible messages paired with their source entries (`entries[].sourceEntry` and `entries[].messages`). Omitted targets emit no message, content replacements preserve the source entry's role and metadata, and raw entries stay untouched. `buildSessionContext()` returns just the messages, thinking level, and model used for provider requests.
439
459
 
@@ -446,7 +466,7 @@ It returns model-visible messages paired with their source entries (`entries[].s
446
466
  ## Parsing example
447
467
 
448
468
  ```typescript
449
- import { readFileSync } from "fs";
469
+ import { readFileSync } from "node:fs";
450
470
 
451
471
  const lines = readFileSync("session.jsonl", "utf8").trim().split("\n");
452
472
 
@@ -460,6 +480,15 @@ for (const line of lines) {
460
480
  case "message":
461
481
  console.log(`[${entry.id}] ${entry.message.role}: ${JSON.stringify(entry.message.content)}`);
462
482
  break;
483
+ case "model_change":
484
+ console.log(`[${entry.id}] Model: ${entry.provider}/${entry.modelId}`);
485
+ break;
486
+ case "thinking_level_change":
487
+ console.log(`[${entry.id}] Thinking: ${entry.thinkingLevel}`);
488
+ break;
489
+ case "usage":
490
+ console.log(`[${entry.id}] Usage (${entry.kind}): ${entry.provider}/${entry.model} ${entry.usage.totalTokens} tokens`);
491
+ break;
463
492
  case "compaction":
464
493
  if (entry.details?.strategy === "verbatim-lines") {
465
494
  console.log(`[${entry.id}] Compaction boundary: ${entry.details.form ?? "compacted"}, ${entry.tokensBefore} tokens before`);
@@ -470,6 +499,9 @@ for (const line of lines) {
470
499
  case "context_compaction":
471
500
  console.log(`[${entry.id}] Retired logical-deletion compaction record`);
472
501
  break;
502
+ case "context_edit":
503
+ console.log(`[${entry.id}] Context edit on ${entry.targetId}: ${entry.replacement === null ? "omitted" : "replaced"}`);
504
+ break;
473
505
  case "branch_summary":
474
506
  console.log(`[${entry.id}] Branch from ${entry.fromId}`);
475
507
  break;
@@ -482,11 +514,14 @@ for (const line of lines) {
482
514
  case "label":
483
515
  console.log(`[${entry.id}] Label "${entry.label}" on ${entry.targetId}`);
484
516
  break;
485
- case "model_change":
486
- console.log(`[${entry.id}] Model: ${entry.provider}/${entry.modelId}`);
517
+ case "session_info":
518
+ console.log(`[${entry.id}] Session name: ${entry.name ?? "(cleared)"}`);
487
519
  break;
488
- case "thinking_level_change":
489
- console.log(`[${entry.id}] Thinking: ${entry.thinkingLevel}`);
520
+ case "session_summary":
521
+ console.log(`[${entry.id}] Summary: ${entry.summary}`);
522
+ break;
523
+ case "worktree_snapshot":
524
+ console.log(`[${entry.id}] Snapshot ${entry.snapshotId} for ${entry.root}`);
490
525
  break;
491
526
  }
492
527
  }
@@ -498,16 +533,18 @@ Await `create`, `open`, `continueRecent`, `forkFrom`, and every session mutation
498
533
 
499
534
  `inMemory()` selects memory storage explicitly without filesystem I/O. Factories without an explicit store or directory resolve configured storage, defaulting to the shared local SQLite database. Passing a directory selects JSONL explicitly. Store-open failures never fall back to memory.
500
535
 
536
+ By default, opening an existing session loads only the active tail window (entries from the latest compaction boundary onward, plus required branch metadata) into memory rather than the entire history. Methods below note whether they inspect only entries loaded in memory or read older entries from storage on demand.
537
+
501
538
  ### Static creation methods
502
539
 
503
540
  - `SessionManager.create(cwd, sessionDir?, options?)`: create a new session in configured storage, or in JSONL when `sessionDir` is provided.
504
541
  - `SessionManager.create(store, cwd, options?)`: create a new session in a supplied `SessionStore`.
505
- - `SessionManager.open(store, sessionId, cwdOverride?, options?)`: open an existing session by exact ID, raising `SessionNotFoundError` if missing. Defaults to `{ history: "tail" }`, loading from the latest compaction window; pass `{ history: "full" }` only when every stored entry must stay resident in memory. `openSessionById(id, cwd?, sessionDir?, options?)` and `continueRecent(store, cwd, options?)` share the same window behavior.
542
+ - `SessionManager.open(store, sessionId, cwdOverride?, options?)`: open an existing session by exact ID, raising `SessionNotFoundError` if missing. Defaults to `{ history: "tail" }`, loading from the latest compaction window; pass `{ history: "full" }` only when every stored entry must be loaded into memory. `openSessionById(id, cwd?, sessionDir?, options?)` and `continueRecent(store, cwd, options?)` share the same behavior.
506
543
  - `SessionManager.open(path, sessionDir?, cwdOverride?)`: open a JSONL file directly, creating it if missing. This is a file API rather than the CLI session selector.
507
544
  - `SessionManager.continueRecent(cwd, sessionDir?, options?)` or `continueRecent(store, cwd, options?)`: continue the most recent regular session or create a new one. Pass `{ includeInternal: true }` to include internal sessions.
508
545
  - `SessionManager.inMemory(cwd?, options?)`: create an empty memory-only session synchronously. To seed entries, await `SessionManager.inMemory(cwd, options, entries)` without mutating the supplied array until it resolves.
509
546
  - `SessionManager.forkFrom(sourcePath, targetCwd, sessionDir?, options?)`: fork a JSONL file into the target store. For database sessions, open the session by ID and await `manager.forkTo(targetCwd, targetStore?, options?)`.
510
- - `SessionManager.importFromJsonl(inputPath, cwd, targetStoreOrDir?)`: import a JSONL export preserving its ID and upgrading older supported formats. Raises `SessionExistsError` if the ID already exists, and opens at the current context window.
547
+ - `SessionManager.importFromJsonl(inputPath, cwd, targetStoreOrDir?)`: import a JSONL export preserving its ID and upgrading older supported formats. Raises `SessionExistsError` if the ID already exists, and opens at the active context window.
511
548
 
512
549
  ### Static listing methods
513
550
 
@@ -526,21 +563,21 @@ Select sessions by `SessionInfo.id`. `SessionInfo.path` holds a JSONL path when
526
563
 
527
564
  ### Appending methods
528
565
 
529
- Every append method returns a promise resolving to the new entry ID:
530
-
531
- | Method | Action |
532
- | --- | --- |
533
- | `appendMessage(message)` | Append a message entry |
534
- | `appendThinkingLevelChange(level)` | Record a thinking-level change |
535
- | `appendContextWindowChange(contextWindow)` | Record a context-window selection in tokens |
536
- | `appendModelChange(provider, modelId)` | Record a model change |
537
- | `appendCompaction(compactedText, firstKeptEntryId, tokensBefore, details)` | Append a durable compaction boundary (`null` for `firstKeptEntryId` on current boundaries) |
538
- | `appendCustomEntry(customType, data?)` | Append extension state (excluded from LLM context) |
539
- | `appendSessionInfo(name)` | Set the session display name (empty string clears it) |
540
- | `appendSessionSummary(summary, summarizedThroughId, usage?)` | Store a generated resume-picker summary anchored to a message |
541
- | `appendCustomMessageEntry(customType, content, display, details?)` | Append an extension message |
542
- | `appendLabelChange(targetId, label)` | Set or clear an entry bookmark label |
543
- | `appendContextEdit(targetId, replacement)` | Append a branch-local context edit (`null` omits the target; `{ content }` replaces only its content) |
566
+ All append methods below return `Promise<string>` resolving to the new entry ID, except `appendUsage()`, which returns `Promise<UsageEntry>`:
567
+
568
+ | Method | Returns | Action |
569
+ | --- | --- | --- |
570
+ | `appendMessage(message, options?)` | `Promise<string>` | Append a message entry (optional `{ queuedMessageId?: string }`) |
571
+ | `appendThinkingLevelChange(level)` | `Promise<string>` | Record a thinking-level change |
572
+ | `appendModelChange(provider, modelId, fallback?)` | `Promise<string>` | Record a model change (optional `ModelFallbackRecord`) |
573
+ | `appendUsage(kind, provider, model, usage, note?)` | `Promise<UsageEntry>` | Record auxiliary model usage without adding it to LLM context |
574
+ | `appendCompaction(compactedText, firstKeptEntryId, tokensBefore, details)` | `Promise<string>` | Append a durable compaction boundary (`null` for `firstKeptEntryId` on current boundaries) |
575
+ | `appendCustomEntry(customType, data?)` | `Promise<string>` | Append extension state (excluded from LLM context) |
576
+ | `appendSessionInfo(name)` | `Promise<string>` | Set the session display name (empty string clears it) |
577
+ | `appendSessionSummary(summary, summarizedThroughId, usage?)` | `Promise<string>` | Store a generated resume-picker summary anchored to a message |
578
+ | `appendCustomMessageEntry(customType, content, display, details?)` | `Promise<string>` | Append an extension message |
579
+ | `appendLabelChange(targetId, label)` | `Promise<string>` | Set or clear an entry bookmark label |
580
+ | `appendContextEdit(targetId, replacement)` | `Promise<string>` | Append a branch-local context edit (`null` omits the target; `{ content }` replaces only its content) |
544
581
 
545
582
  ### Tree navigation methods
546
583
 
@@ -548,10 +585,10 @@ Every append method returns a promise resolving to the new entry ID:
548
585
  | --- | --- |
549
586
  | `getLeafId()` | Return the current leaf entry ID |
550
587
  | `getLeafEntry()` | Return the current leaf entry |
551
- | `getEntry(id)` | Return a resident entry by ID |
588
+ | `getEntry(id)` | Return an entry loaded in memory by ID |
552
589
  | `getBranch(fromId?)` | Walk from an entry to the root |
553
- | `getTree()` | Return the tree of resident entries in the manager's current window; use `readHistory()` or `loadFullHistory()` for older entries outside the window |
554
- | `getChildren(parentId)` | Return direct resident children of an entry |
590
+ | `getTree()` | Return the tree of entries loaded in memory; use `readHistory()` or `loadFullHistory()` for older entries |
591
+ | `getChildren(parentId)` | Return direct child entries currently loaded in memory |
555
592
  | `getLabel(id)` | Return the label for an entry |
556
593
  | `branch(entryId)` | Move the leaf to an earlier entry in memory only (the session reopens at its last saved entry) |
557
594
  | `resetLeaf()` | Reset the leaf to `null` in memory only |
@@ -563,21 +600,21 @@ Every append method returns a promise resolving to the new entry ID:
563
600
  - `buildSessionProjection(mode?)`: return the context-edited projection (`entries` with source entries and model-visible messages, plus `thinkingLevel` and `model`). Pass `"transcript"` for saved chat rows that keep original displayed content for edited or omitted entries while hiding non-displayed custom messages. For a live session, `session.transcriptMessages` also includes unsaved live messages.
564
601
  - `buildSessionContext()`: return messages, thinking level, and model for the LLM.
565
602
  - `buildContextEntries()`: return active-branch entries after the latest compaction boundary.
566
- - `getEntries()`: return raw entries in the manager's current window, excluding the header. System tool-change messages and `atomic.appendEntry()` extension entries on the active branch stay resident here; use `readHistory()` or `readEntry(id)` for older retired entries.
567
- - `hasFullHistory()`: return whether every stored entry is resident in memory.
603
+ - `getEntries()`: return raw entries loaded in memory, excluding the header. System tool-change messages and `atomic.appendEntry()` extension entries on the active branch stay loaded here; use `readHistory()` or `readEntry(id)` for older retired entries.
604
+ - `hasFullHistory()`: return whether every stored entry is loaded in memory.
568
605
  - `loadFullHistory()`: load every stored entry on every branch into memory. Prefer `readHistory()` so large sessions stay bounded; Atomic itself never calls `loadFullHistory()`.
569
606
  - `readHistory({ fromSeq?, toSeq?, direction?, signal? }?)`: iterate pages of `{ seq, entry }` between inclusive bounds. Use `direction: "backward"` to start from the latest page while keeping entries inside each page in append order. Resume with `{ cursor: page.nextCursor }` without new bounds. Entries over 1 MiB appear as `{ kind: "oversized", seq, bytes }` references instead of truncated objects. Replaced or recreated sessions reject rather than mixing generations.
570
607
  - `readHistoryChunks(reference, { offset?, signal? }?)`: read an oversized entry's encoded UTF-8 bytes in chunks of at most 64 KiB. Track consumed bytes to resume at an offset and decode with a streaming UTF-8 decoder.
571
608
  - `readSessionHistory(store, sessionId, options?)` and `readSessionHistoryChunks(store, reference, options?)`: imported from `@bastani/atomic/storage` for read-only paged and chunked access directly from a `SessionStore` without opening a `SessionManager`.
572
- - `readEntry(id)`: read one entry by ID, including entries outside the active window, or return `undefined` if absent.
573
- - `getOmittedHistoryTotals()`: return usage and message counts omitted by a tail window, or `undefined` when full history is held.
574
- - `getLastSeq()`: return the session's last stored sequence number, including entries not held in memory.
575
- - `getEntrySeq(id)` and `findEntrySeq(id)`: return a resident entry's sequence synchronously (`getEntrySeq`) or look up any entry's sequence in the store without loading earlier transcript entries (`findEntrySeq`).
609
+ - `readEntry(id)`: read one entry by ID, including entries outside the loaded window, or return `undefined` if absent.
610
+ - `getOmittedHistoryTotals()`: return usage and message counts omitted by a tail window, or `undefined` when full history is loaded.
611
+ - `getLastSeq()`: return the session's last stored sequence number, including entries not loaded in memory.
612
+ - `getEntrySeq(id)` and `findEntrySeq(id)`: return a loaded entry's sequence synchronously (`getEntrySeq`) or look up any entry's sequence in the store without loading earlier transcript entries (`findEntrySeq`).
576
613
  - `forEachStoredEntry(fromSeq, visit)`: visit every stored entry from `fromSeq` in store order, paging older entries without holding them in memory, and resolve to the last visited sequence.
577
- - `getWorktreeSnapshotRecords()` and `getLatestWorktreeSnapshots()`: return held snapshot records (`getWorktreeSnapshotRecords`) or the latest snapshot per checkout root on the active branch (`getLatestWorktreeSnapshots`).
578
- - `loadWorktreeSnapshotRecords(ids, { signal? }?)`: resolve snapshot records by ID across any branch, reading the store for records outside the window and omitting unknown IDs.
614
+ - `getWorktreeSnapshotRecords()` and `getLatestWorktreeSnapshots()`: return loaded snapshot records (`getWorktreeSnapshotRecords`) or the latest snapshot per checkout root on the active branch (`getLatestWorktreeSnapshots`).
615
+ - `loadWorktreeSnapshotRecords(ids, { signal? }?)`: resolve snapshot records by ID across any branch, reading the store for records outside the loaded window and omitting unknown IDs.
579
616
  - `readWorktreeSnapshotPages({ branch?, direction?, signal? }?)`: iterate `worktree_snapshot` entries in pages of `{ seq, entry }` across all branches or the active branch (`branch: true`) without retaining them in memory.
580
- - `getAdmissionKeys().has(key)`: test synchronously whether an admission key has already been persisted to prevent duplicate admission after resume.
617
+ - `getAdmissionKeys().has(key)`: test synchronously whether a deduplication key (admission key) has already been persisted to prevent duplicate event or message admission after resume.
581
618
  - `getSessionRecoveryState()`: return persisted recovery state (admission keys and delivered Intercom message IDs) used to prevent duplicate deliveries after resume.
582
619
  - `getHeader()`: return the session header metadata.
583
620
  - `getSessionName()` and `getSessionNameState()`: return the display name (`undefined` if unset or cleared), or the durable name state (`{ hasName: false }`, `{ hasName: true }`, or `{ hasName: true, name }`).