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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  10. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  11. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  14. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  15. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  16. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  17. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  18. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  19. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  21. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  22. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  25. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  26. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  27. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  28. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  29. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  30. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  31. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  32. package/dist/builtin/intercom/package.json +1 -1
  33. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  34. package/dist/builtin/mcp/package.json +1 -1
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.code.js +1 -1
  40. package/dist/cli/auth-cli.impl.js +3 -3
  41. package/dist/cli/auth-cli.js +3 -3
  42. package/dist/cli/blueprint-command.impl.js +3 -3
  43. package/dist/cli/blueprint-command.js +3 -3
  44. package/dist/cli/intercom-command.code.js +3 -3
  45. package/dist/cli/intercom-command.impl.js +3 -3
  46. package/dist/cli/intercom-command.js +3 -3
  47. package/dist/cli/list-models.impl.js +3 -3
  48. package/dist/cli/list-models.js +3 -3
  49. package/dist/cli/session-picker.code.js +1 -1
  50. package/dist/cli/session-picker.impl.js +3 -3
  51. package/dist/cli/session-picker.js +3 -3
  52. package/dist/cli/startup-ui.code.js +1 -1
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.code.js +1 -1
  58. package/dist/cli/storage-search-session.impl.js +3 -3
  59. package/dist/cli/storage-search-session.js +3 -3
  60. package/dist/cli/team-command.code.js +1 -1
  61. package/dist/cli/team-command.impl.js +3 -3
  62. package/dist/cli/team-command.js +3 -3
  63. package/dist/cli.js +2 -2
  64. package/dist/core/compaction/compactor.d.ts +0 -8
  65. package/dist/core/debug.impl.js +3 -3
  66. package/dist/core/debug.js +3 -3
  67. package/dist/core/export-html/card-projection.impl.js +3 -3
  68. package/dist/core/export-html/card-projection.js +3 -3
  69. package/dist/core/export-html/index.code.js +2 -2
  70. package/dist/core/export-html/index.impl.js +3 -3
  71. package/dist/core/export-html/index.js +3 -3
  72. package/dist/core/export-html/json-spans.impl.js +3 -3
  73. package/dist/core/export-html/json-spans.js +3 -3
  74. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  76. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  77. package/dist/core/export-html/tool-renderer.js +3 -3
  78. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  79. package/dist/core/extensions/jiti-loader.js +3 -3
  80. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.js +3 -3
  82. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.js +3 -3
  84. package/dist/core/intercom-broker-control-host.code.js +1 -1
  85. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  86. package/dist/core/intercom-broker-control-host.js +3 -3
  87. package/dist/core/intercom-broker-control.code.js +2 -2
  88. package/dist/core/intercom-broker-control.impl.js +3 -3
  89. package/dist/core/intercom-broker-control.js +3 -3
  90. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.js +3 -3
  92. package/dist/core/sdk.code.js +1 -1
  93. package/dist/core/sdk.impl.js +3 -3
  94. package/dist/core/sdk.js +3 -3
  95. package/dist/core/session-manager-core.js +3 -3
  96. package/dist/core/session-manager-list.impl.js +3 -3
  97. package/dist/core/session-manager-list.js +3 -3
  98. package/dist/core/session-manager.impl.js +3 -3
  99. package/dist/core/session-manager.js +3 -3
  100. package/dist/core/session-storage.impl.js +3 -3
  101. package/dist/core/session-storage.js +3 -3
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/node-sqlite-thread.js +2 -2
  104. package/dist/core/storage/node-sqlite.js +2 -2
  105. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  106. package/dist/core/storage/offline-snapshot-file.js +3 -3
  107. package/dist/core/storage/provider.js +2 -2
  108. package/dist/core/storage/selection.js +2 -2
  109. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  111. package/dist/core/storage/session/branch-fork-source.js +3 -3
  112. package/dist/core/storage/session/card-view.impl.js +3 -3
  113. package/dist/core/storage/session/card-view.js +3 -3
  114. package/dist/core/storage/session/child-reader.code.js +2 -2
  115. package/dist/core/storage/session/child-reader.impl.js +3 -3
  116. package/dist/core/storage/session/child-reader.js +3 -3
  117. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  119. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  120. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  121. package/dist/core/storage/session/expanded-child-details.js +3 -3
  122. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  124. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.js +3 -3
  126. package/dist/core/storage/session/fork-staging.code.js +1 -1
  127. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  128. package/dist/core/storage/session/fork-staging.js +3 -3
  129. package/dist/core/storage/session/fork-window.code.js +2 -2
  130. package/dist/core/storage/session/fork-window.impl.js +3 -3
  131. package/dist/core/storage/session/fork-window.js +3 -3
  132. package/dist/core/storage/session/history-pages.impl.js +3 -3
  133. package/dist/core/storage/session/history-pages.js +3 -3
  134. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  136. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  138. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.js +3 -3
  140. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  141. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  142. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  143. package/dist/core/storage/session/released-history-files.code.js +1 -1
  144. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  145. package/dist/core/storage/session/released-history-files.js +3 -3
  146. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  148. package/dist/core/storage/session/session-resume.impl.js +3 -3
  149. package/dist/core/storage/session/session-resume.js +3 -3
  150. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.js +3 -3
  152. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  153. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  154. package/dist/core/storage/session/snapshot-history.js +3 -3
  155. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  156. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  157. package/dist/core/storage/session/sql-session-store.js +3 -3
  158. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  159. package/dist/core/storage/session/tree-outline.js +3 -3
  160. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.js +3 -3
  162. package/dist/core/storage/storage-status.impl.js +3 -3
  163. package/dist/core/storage/storage-status.js +3 -3
  164. package/dist/core/storage/team.impl.js +3 -3
  165. package/dist/core/storage/team.js +3 -3
  166. package/dist/core/structured-output/index.code.js +1 -1
  167. package/dist/core/structured-output/index.impl.js +3 -3
  168. package/dist/core/structured-output/index.js +3 -3
  169. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.js +3 -3
  171. package/dist/core/tasks/task-file-history.code.js +2 -2
  172. package/dist/core/tasks/task-file-history.impl.js +3 -3
  173. package/dist/core/tasks/task-file-history.js +3 -3
  174. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  175. package/dist/core/tasks/task-reference-archive.js +3 -3
  176. package/dist/core/tasks/task-reference-identity.js +3 -3
  177. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.js +3 -3
  179. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  181. package/dist/core/tasks/task-view-source.impl.js +3 -3
  182. package/dist/core/tasks/task-view-source.js +3 -3
  183. package/dist/core/tools/read-url.impl.js +3 -3
  184. package/dist/core/tools/read-url.js +3 -3
  185. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  186. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  187. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  188. package/dist/core/worktree-snapshot/errors.js +3 -3
  189. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  191. package/dist/extensions/codemode/execute.impl.js +3 -3
  192. package/dist/extensions/codemode/execute.js +3 -3
  193. package/dist/extensions/codemode/renderer.impl.js +3 -3
  194. package/dist/extensions/codemode/renderer.js +3 -3
  195. package/dist/extensions/mcp/cli.code.js +1 -1
  196. package/dist/extensions/mcp/cli.impl.js +3 -3
  197. package/dist/extensions/mcp/cli.js +3 -3
  198. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  199. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  200. package/dist/extensions/mcp/cli.lazy.js +3 -3
  201. package/dist/extensions/mcp/runtime.code.js +1 -1
  202. package/dist/extensions/mcp/runtime.impl.js +3 -3
  203. package/dist/extensions/mcp/runtime.js +3 -3
  204. package/dist/index.d.ts +21 -1
  205. package/dist/index.js +2 -2
  206. package/dist/main-first-time-setup.code.js +1 -1
  207. package/dist/main-first-time-setup.impl.js +3 -3
  208. package/dist/main-first-time-setup.js +3 -3
  209. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  210. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  211. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  212. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  214. package/dist/modes/print-mode.js +1 -1
  215. package/dist/package-manager-cli.code.js +2 -2
  216. package/dist/package-manager-cli.impl.js +3 -3
  217. package/dist/package-manager-cli.js +3 -3
  218. package/dist/startup-files.json +1 -1
  219. package/dist/startup-stages/6.js +1 -1
  220. package/dist/utils/startup-database-spare.code.js +1 -1
  221. package/dist/utils/startup-database-spare.impl.js +3 -3
  222. package/dist/utils/startup-database-spare.js +3 -3
  223. package/dist/utils/tools-manager.impl.js +3 -3
  224. package/dist/utils/tools-manager.js +3 -3
  225. package/docs/background-tasks/reference.md +182 -0
  226. package/docs/background-tasks.md +98 -405
  227. package/docs/build.md +67 -27
  228. package/docs/changelog.mdx +9 -0
  229. package/docs/codemode.md +108 -39
  230. package/docs/compaction/branch-summaries.md +54 -0
  231. package/docs/compaction/custom-compactors.md +161 -0
  232. package/docs/compaction/memory-compaction.md +77 -0
  233. package/docs/compaction/reference.md +86 -38
  234. package/docs/compaction.md +51 -252
  235. package/docs/computer-use.md +169 -321
  236. package/docs/containerization.md +71 -57
  237. package/docs/custom-provider/api-reference.md +119 -25
  238. package/docs/custom-provider/oauth.md +114 -132
  239. package/docs/custom-provider/override.md +37 -27
  240. package/docs/custom-provider/registration.md +107 -83
  241. package/docs/custom-provider/streaming.md +85 -71
  242. package/docs/custom-provider.md +85 -52
  243. package/docs/development.md +39 -29
  244. package/docs/docs.json +76 -63
  245. package/docs/environment-variables.md +94 -44
  246. package/docs/extensions/api-reference.md +86 -43
  247. package/docs/extensions/authoring.md +162 -154
  248. package/docs/extensions/events.md +80 -25
  249. package/docs/extensions/examples.md +90 -85
  250. package/docs/extensions/ui.md +206 -82
  251. package/docs/extensions.md +79 -108
  252. package/docs/getting-started/authentication.md +67 -36
  253. package/docs/getting-started/first-session.md +53 -43
  254. package/docs/getting-started/installation.md +116 -89
  255. package/docs/getting-started/project-instructions.md +48 -34
  256. package/docs/guides/configuration.md +82 -20
  257. package/docs/guides/non-interactive.md +66 -24
  258. package/docs/guides/resume-on-any-machine.md +135 -82
  259. package/docs/guides/team-setup.md +114 -105
  260. package/docs/guides.md +76 -32
  261. package/docs/herdr.md +15 -16
  262. package/docs/how-atomic-works.md +140 -0
  263. package/docs/index.md +58 -44
  264. package/docs/intercom/operations.md +141 -151
  265. package/docs/intercom/reference.md +85 -108
  266. package/docs/intercom.md +84 -145
  267. package/docs/json.md +120 -67
  268. package/docs/keybindings.md +85 -49
  269. package/docs/libraries/agent-core.md +137 -275
  270. package/docs/libraries/ai.md +100 -84
  271. package/docs/libraries/codemode.md +210 -300
  272. package/docs/libraries/schema.md +59 -53
  273. package/docs/libraries/storage-postgres.md +49 -35
  274. package/docs/libraries/telemetry.md +153 -354
  275. package/docs/libraries/tui.md +265 -393
  276. package/docs/libraries.md +42 -26
  277. package/docs/llama-cpp.md +171 -161
  278. package/docs/mcp-servers.md +90 -51
  279. package/docs/models/choose-a-model.md +188 -0
  280. package/docs/models/reference.md +74 -30
  281. package/docs/models.md +153 -88
  282. package/docs/orchestration/migrating-workflows.md +23 -16
  283. package/docs/orchestration/patterns.md +39 -44
  284. package/docs/orchestration.md +65 -26
  285. package/docs/packages/authoring.md +51 -29
  286. package/docs/packages/reference.md +42 -21
  287. package/docs/packages.md +69 -58
  288. package/docs/programmatic.md +118 -24
  289. package/docs/prompt-templates.md +84 -83
  290. package/docs/providers/reference.md +43 -48
  291. package/docs/providers.md +219 -451
  292. package/docs/quickstart.md +140 -120
  293. package/docs/reference/cli.md +135 -97
  294. package/docs/reference.md +20 -18
  295. package/docs/rpc/examples.md +76 -20
  296. package/docs/rpc/extension-ui.md +64 -38
  297. package/docs/rpc/protocol.md +361 -110
  298. package/docs/rpc.md +57 -17
  299. package/docs/sdk/reference.md +409 -534
  300. package/docs/sdk/storage.md +53 -13
  301. package/docs/sdk/structured-decisions.md +82 -56
  302. package/docs/sdk/web-server.md +57 -43
  303. package/docs/sdk.md +106 -84
  304. package/docs/security.md +42 -64
  305. package/docs/session-format.md +62 -38
  306. package/docs/sessions.md +99 -214
  307. package/docs/settings.md +165 -195
  308. package/docs/shell-aliases.md +9 -6
  309. package/docs/skills/authoring.md +69 -48
  310. package/docs/skills/reference.md +51 -20
  311. package/docs/skills.md +99 -148
  312. package/docs/slash-commands.md +129 -0
  313. package/docs/storage/custom-adapters.md +160 -85
  314. package/docs/storage/jsonl.md +81 -66
  315. package/docs/storage/postgres/pgbouncer.md +120 -126
  316. package/docs/storage/postgres/tuning.md +120 -143
  317. package/docs/storage/postgres.md +314 -330
  318. package/docs/storage/sqlite.md +71 -42
  319. package/docs/storage.md +298 -302
  320. package/docs/subagents/authoring.md +55 -38
  321. package/docs/subagents/reference.md +73 -33
  322. package/docs/subagents.md +119 -187
  323. package/docs/terminal-setup.md +50 -38
  324. package/docs/termux.md +67 -41
  325. package/docs/themes/reference.md +23 -19
  326. package/docs/themes.md +142 -127
  327. package/docs/tmux.md +47 -55
  328. package/docs/tools.md +147 -109
  329. package/docs/tui/reference.md +166 -214
  330. package/docs/tui.md +196 -341
  331. package/docs/usage.md +118 -138
  332. package/docs/verification.md +79 -51
  333. package/docs/web-access.md +121 -101
  334. package/docs/windows.md +26 -27
  335. package/docs/worktree-snapshots/reference.md +245 -0
  336. package/docs/worktree-snapshots.md +71 -259
  337. package/package.json +8 -8
  338. package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
  339. package/docs/guides/intercom.md +0 -32
  340. package/docs/guides/orchestration.md +0 -28
  341. package/docs/guides/subagents.md +0 -37
@@ -27,11 +27,9 @@ Do not mix both layouts on the same directory. Files stored under `--<encoded-cw
27
27
 
28
28
  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.
29
29
 
30
- ## Deleting sessions
31
-
32
- In an explicit JSONL store, you can remove a session by deleting its `.jsonl` file. Do not delete the shared SQLite database to remove a single session.
33
-
34
- 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.
30
+ <Note>
31
+ **Deleting sessions.** To delete individual sessions safely across any store, use `/resume` (`Ctrl+D`) or `SessionManager.deleteSession()` (see [Resuming and deleting sessions](/sessions#resuming-and-deleting-sessions)). Never delete a shared SQLite database file to remove one session; deleting a `.jsonl` file manually in a JSONL store leaves its `<session>.jsonl.idx` index sidecar behind.
32
+ </Note>
35
33
 
36
34
  ## Session version
37
35
 
@@ -185,7 +183,7 @@ interface BranchSummaryMessage {
185
183
  }
186
184
  ```
187
185
 
188
- `compactionSummary` appears only in older session files and is inert. Active compaction boundaries appear in rebuilt context as visible `custom` messages with `customType: "compaction"`.
186
+ Active compaction boundaries appear in rebuilt context as visible `custom` messages with `customType: "compaction"`.
189
187
 
190
188
  ### AgentMessage union
191
189
 
@@ -197,7 +195,6 @@ type AgentMessage =
197
195
  | BashExecutionMessage
198
196
  | CustomMessage
199
197
  | BranchSummaryMessage;
200
- // compactionSummary appears only in older session files and is not part of the active union.
201
198
  ```
202
199
 
203
200
  `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`.
@@ -241,7 +238,7 @@ Any session with `internal: true` in its header is excluded from `/resume`, `ato
241
238
  {"type":"session","version":4,"id":"uuid","createdAt":"2024-12-03T14:00:00.000Z","cwd":"/path/to/project","internal":true}
242
239
  ```
243
240
 
244
- Older workflow-stage sessions also carried `workflow` metadata (`runId`, `stageId`, and `stageName`). Current Atomic releases do not write new `workflow` metadata, and session stores preserve existing `workflow` fields read-only during export and import. Atomic does not infer internal status from `parentSessionId`, so ordinary user forks remain listed.
241
+ Atomic does not infer internal status from `parentSessionId`, so ordinary user forks remain listed.
245
242
 
246
243
  ### SessionMessageEntry
247
244
 
@@ -286,9 +283,9 @@ Records auxiliary model usage (such as prompt cache warming with `kind: "cache_w
286
283
 
287
284
  Fields: `kind` (string category), `provider`, `model`, `usage` (`Usage`), and optional `note`.
288
285
 
289
- ### CompactionEntry
286
+ ### CompactionEntry {#compactionentry}
290
287
 
291
- 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.
288
+ 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.
292
289
 
293
290
  An entry is active only when `details.strategy` is `"verbatim-lines"`:
294
291
 
@@ -296,9 +293,15 @@ An entry is active only when `details.strategy` is `"verbatim-lines"`:
296
293
  {"type":"compaction","id":"c1","parentId":"m9","timestamp":"2026-11-17T10:00:00.000Z","summary":"Context cleared. Your earlier conversation (51,234 tokens) is no longer in your context window. ...","firstKeptEntryId":null,"tokensBefore":51234,"details":{"strategy":"verbatim-lines","promptVersion":7,"parameters":{"query":"fix the test"},"stats":{"linesBefore":812,"linesDeleted":812,"linesKept":0,"rangeCount":0,"tokensBefore":51234,"tokensAfter":2210,"percentReduction":95.7},"form":"cleared","history":{"sessionId":"019f6a2e-...","rangeUnit":"entries","entriesBefore":4210,"boundaryEntry":4211,"totalEntries":4211}}}
297
294
  ```
298
295
 
296
+ <Note>
297
+ **Schema compatibility markers.** `"strategy": "verbatim-lines"`, `promptVersion: 7`, and `stats.rangeCount: 0` are retained from earlier line-based compaction versions as stable schema discriminators. They mark an active compaction boundary even on a memory-compaction clear (`form: "cleared"`).
298
+ </Note>
299
+
299
300
  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.
300
301
 
301
- 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).
302
+ 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`, and `recallSessionId` (legacy fork history link source).
303
+
304
+ - **`coveredThroughEntryId`.** Actively written during resume-budget compaction on Claude models with fixed thinking budgets so newly added resume context (updated instructions, blueprint context, or recovery notices) replays after the boundary. Also present on boundaries written by earlier versions while a tool call waited for its result (current Atomic never writes a boundary while a tool call waits).
302
305
 
303
306
  Key `details` fields include:
304
307
 
@@ -311,19 +314,7 @@ Key `details` fields include:
311
314
 
312
315
  See [Persistence and resume](/compaction/reference#persistence-and-resume) for every field.
313
316
 
314
- Atomic does not write a boundary while a tool call is waiting for its result. Older boundaries written in that state carry `coveredThroughEntryId`, so the waiting turn replays after the boundary. Older verbatim boundaries with a string `firstKeptEntryId` or legacy `details` fields remain active and replay as written. Older `compaction` records without `details.strategy: "verbatim-lines"`, and `custom` entries with `customType: "atomic:background-compaction-result"`, remain parseable for export and audit but are inert in active context.
315
-
316
- ### ContextCompactionEntry (retired)
317
-
318
- Older Atomic versions stored logical entry and content-block deletions in `type: "context_compaction"` records:
319
-
320
- ```json
321
- {"type":"context_compaction","id":"ctx12345","parentId":"f6g7h8i9","timestamp":"2024-12-03T14:12:00.000Z","promptVersion":1,"deletedTargets":[{"kind":"entry","entryId":"b2c3d4e5"}],"protectedEntryIds":["a1b2c3d4"],"stats":{"objectsBefore":20,"objectsAfter":19,"objectsDeleted":1,"tokensBefore":50000,"tokensAfter":43000,"percentReduction":14}}
322
- ```
323
-
324
- Current Atomic never writes or applies these records. When an old session resumes, content hidden by these records may reappear in context until a new compaction writes an active boundary.
325
-
326
- ### ContextEditEntry
317
+ ### ContextEditEntry {#contexteditentry}
327
318
 
328
319
  Append-only edit of one earlier context-producing entry. It changes only future model context; raw history, UI display, exports, and session accounting keep the original entry intact.
329
320
 
@@ -335,7 +326,7 @@ Targets may be user, assistant, tool-result, or custom-message entries. `replace
335
326
 
336
327
  Atomic writes `context_edit` entries when omitting failed attempts from model context, such as provider retries, model fallbacks, overflow or length recoveries, and interrupted empty replies. Extensions can append them from `turn_end` and `agent_before_settle`.
337
328
 
338
- ### BranchSummaryEntry
329
+ ### BranchSummaryEntry {#branchsummaryentry}
339
330
 
340
331
  Created when `/tree` switches away from a branch with a summary of the abandoned path up to the common ancestor:
341
332
 
@@ -371,7 +362,7 @@ Use a unique `customType` to identify your extension's entries on reload. Atomic
371
362
  {"type":"custom","id":"j0k1l2m3","parentId":"c3d4e5f6","timestamp":"2024-12-03T14:22:00.000Z","customType":"atomic.leaf"}
372
363
  ```
373
364
 
374
- - `resume_timings`: records millisecond restore and blueprint durations for `/session snapshot`. `phases` holds only the phases that ran (`fetch`, `reconstruct`, `materialize`, `lfs`, `verify`, `publish`, `seed`), `mode` is `fresh`, `claimed`, `in-place`, or `degraded`, `fetch` is `none`, `shallow`, `full`, or `bundle`, and `exit` is `ok`, `failed`, or `timed-out`. Read it with `latestResumeTimings(sessionManager)` and format it with `formatResumeTimings()`.
365
+ - `resume_timings`: records millisecond restore and blueprint durations for `/session snapshot`. `phases` holds only the phases that ran (`fetch`, `reconstruct`, `materialize`, `lfs`, `verify`, `publish`, `seed`), `mode` is `"fresh"`, `"claimed"`, `"seeded"`, `"in-place"`, or `"degraded"`, `fetch` is `"none"`, `"shallow"`, `"full"`, or `"bundle"`, and `exit` is `"ok"`, `"failed"`, or `"timed-out"`. Read it with `latestResumeTimings(sessionManager)` and format it with `formatResumeTimings()`.
375
366
 
376
367
  ```json
377
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}}
@@ -420,13 +411,13 @@ Generated one-line session summary written when the agent goes idle and shown in
420
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}}
421
412
  ```
422
413
 
423
- - `summary`: stored one-line text with collapsed whitespace and bounded length (up to 160 characters).
414
+ - `summary`: stored one-line text with collapsed whitespace and bounded length (up to 160 characters, truncated with `…`).
424
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.
425
416
  - `usage`: optional token usage from the summary request, counted toward session totals.
426
417
 
427
- ### WorktreeSnapshotEntry
418
+ ### WorktreeSnapshotEntry {#worktreesnapshotentry}
428
419
 
429
- Repository state of one checkout at the end of a turn that ran a file-writing tool. Never sent to the LLM. See [Worktree snapshots](/worktree-snapshots).
420
+ Repository state of one checkout at the end of a turn that ran a file-writing tool. Never sent to the LLM. See [Worktree snapshots](/worktree-snapshots) and [Worktree snapshots reference](/worktree-snapshots/reference).
430
421
 
431
422
  ```json
432
423
  {"type":"worktree_snapshot","id":"m3n4o5p6","parentId":"l2m3n4o5","timestamp":"2024-12-03T14:37:00.000Z","root":"/home/me/project","snapshotId":"3f9a...","snapshot":{"version":1,"id":"3f9a...","root":"/home/me/project","remotes":["https://github.com/me/project.git"],"branch":"main","head":"...","tree":"...","envHash":"...","delta":{"base":"head","patch":"...","bytes":412},"chain":[{"tree":"...","patch":"...","bytes":412}],"bundle":null,"omitted":[],"filters":null,"capturedAt":"2024-12-03T14:37:00.000Z","snapshot":"..."}}
@@ -435,6 +426,7 @@ Repository state of one checkout at the end of a turn that ran a file-writing to
435
426
  - `snapshot`: present when the state changed; an entry without `snapshot` references an earlier entry with the same `snapshotId`.
436
427
  - `restore`: present when a resume restored the snapshot into a new worktree (`{ from, to, snapshotId, tree, restoredAt }`). Later resumes map `from` to `to`.
437
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
+ - `restore.degradedWork`: present on a full restore that followed a partial restore in which the session modified files (`{ snapshotId, root, outcome, paths, base?, commit?, ref?, reason? }`). `outcome` is `"applied"` (edits applied cleanly on top), `"kept"` (conflicting edits saved at `commit` / `ref` from `base`), or `"unavailable"` (partial-restore edits could not be read on this machine, with `reason`).
438
430
  - `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.
439
431
  - `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.
440
432
  - `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.
@@ -468,10 +460,18 @@ It returns model-visible messages paired with their source entries (`entries[].s
468
460
 
469
461
  - Without an active boundary, message, custom-message, and branch-summary entries emit verbatim.
470
462
  - With `firstKeptEntryId: null`, Atomic emits the boundary message and post-boundary messages only.
463
+ - With `coveredThroughEntryId`, entries between `coveredThroughEntryId` and the compaction boundary replay as ordinary messages after the boundary message (used both for resume-budget additions on Claude models with fixed thinking budgets and for older mid-tool-call boundaries).
471
464
  - With a legacy string `firstKeptEntryId`, Atomic emits one `customType: "compaction"` message combining the boundary text and the kept tail (with context edits applied and retained images kept), followed by post-boundary messages. If that entry ID is missing, Atomic omits pre-boundary entries rather than resurrecting older history.
472
- - With a legacy `coveredThroughEntryId`, entries between that entry and the boundary replay as ordinary messages after the compaction message.
473
465
  - Retired `context_compaction` entries and non-verbatim `compaction` entries are skipped as archival records.
474
466
 
467
+ ## Legacy and retired entry types
468
+
469
+ Older session files may contain archival fields and entry types that current Atomic parses for export and audit without reapplying to active context:
470
+
471
+ - **`ContextCompactionEntry` (`type: "context_compaction"`).** Earlier versions stored logical entry and content-block deletions in `context_compaction` records (`deletedTargets`, `protectedEntryIds`, `stats`). Current Atomic never writes or applies them, so content they previously hid may reappear on resume until a new compaction writes an active boundary.
472
+ - **Non-verbatim `compaction` entries and `compactionSummary` messages.** Older `compaction` entries without `details.strategy: "verbatim-lines"`, legacy `compactionSummary` messages, and `custom` entries with `customType: "atomic:background-compaction-result"` remain parseable but are inert in active context.
473
+ - **Legacy `workflow` header metadata.** Older workflow-stage sessions carried `workflow` (`runId`, `stageId`, `stageName`) on `SessionHeader`. Current Atomic does not write new `workflow` metadata and preserves existing fields read-only during export and import.
474
+
475
475
  ## Parsing example
476
476
 
477
477
  ```typescript
@@ -536,13 +536,15 @@ for (const line of lines) {
536
536
  }
537
537
  ```
538
538
 
539
- ## SessionManager API
539
+ ## SessionManager API {#sessionmanager-api}
540
540
 
541
541
  Await `create`, `open`, `continueRecent`, `forkFrom`, and every session mutation. A resolved mutation has committed to its store, and a failed write rejects with a typed storage error without publishing the entry. There is no `flush` method.
542
542
 
543
543
  `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. To open SQLite, PostgreSQL, JSONL, or memory stores, see [SDK session storage](/sdk/storage), [Storage](/storage), and [Session management](/sdk/reference#session-management).
544
544
 
545
- **Store ownership and closing.** `SessionManager` has no `close()` method. Calling `SessionManager.create(cwd)`, `SessionManager.continueRecent(cwd)`, or `SessionManager.open(filePath)` without passing a `SessionStore` opens an internal store that `createAgentSession({ sessionManager })` does **not** close during `session.dispose()`. Close `sessionManager.getSessionStore().close()` when finished, or open and close a `SessionStore` explicitly and pass it to `SessionManager.create(store, cwd)` or `SessionManager.open(store, sessionId)`. Calling `close()` twice on a direct `SqlSessionStore`, `JsonlSessionStore`, or `MemorySessionStore` throws `StoreClosedError`, and `SqlSessionStore.close()` leaves a caller-owned `database` open. See [SDK session storage](/sdk/storage) for the ownership matrix.
545
+ <Note>
546
+ **Store ownership and closing.** `SessionManager` has no `close()` method. Calling `SessionManager.create(cwd)`, `SessionManager.continueRecent(cwd)`, or `SessionManager.open(filePath)` without passing a `SessionStore` opens an internal store that `createAgentSession({ sessionManager })` does **not** close during `session.dispose()`. Close `sessionManager.getSessionStore().close()` when finished, or open and close a `SessionStore` explicitly and pass it to `SessionManager.create(store, cwd)` or `SessionManager.open(store, sessionId)`. Calling `close()` twice on a direct `SqlSessionStore`, `JsonlSessionStore`, or `MemorySessionStore` throws `StoreClosedError`, and `SqlSessionStore.close()` leaves a caller-owned `database` open. See [SDK session storage](/sdk/storage).
547
+ </Note>
546
548
 
547
549
  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.
548
550
 
@@ -550,7 +552,7 @@ By default, opening an existing session loads only the active tail window (entri
550
552
 
551
553
  - `SessionManager.create(cwd, sessionDir?, options?)`: create a new session in configured storage, or in flat-layout JSONL when `sessionDir` is provided.
552
554
  - `SessionManager.create(store, cwd, options?)`: create a new session in a supplied `SessionStore`.
553
- - `SessionManager.open(store, sessionId, cwdOverride?, options?)`: open an existing session by exact ID in any `SessionStore` (required for SQLite and PostgreSQL sessions), 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. `continueRecent(store, cwd, options?)` and instance method `openSessionById()` share the same behavior.
555
+ - `SessionManager.open(store, sessionId, cwdOverride?, options?)`: open an existing session by exact ID in any `SessionStore` (required for SQLite and PostgreSQL sessions), raising `SessionNotFoundError` if missing. `SessionOpenOptions` accepts `{ history?: "tail" | "full", leafId?: string }`: `"tail"` (default) loads from the latest compaction window; `"full"` loads every stored entry into memory; `leafId` resumes from a specific entry instead of the current leaf. `continueRecent(store, cwd, options?)` and `openSessionById()` share the same options.
554
556
  - `SessionManager.open(path, sessionDir?, cwdOverride?, options?)`: open a JSONL file directly by filesystem path, creating it if missing. This is a JSONL file API only and cannot open a SQLite or PostgreSQL session ID.
555
557
  - `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.
556
558
  - `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.
@@ -567,11 +569,11 @@ Both methods accept `{ includeInternal: true, signal }`. Select sessions by `Ses
567
569
  ### Session management methods
568
570
 
569
571
  - `newSession(options?)`: start a new session. `NewSessionOptions` accepts `id`, `parentSession`, and `internal` (`internal: true` hides the session from `/resume`, `atomic -r`, `-c`, and `history://sessions` while keeping it openable by ID).
570
- - `openSessionById(sessionId, cwdOverride?, sessionDirectory?, options?)`: open an existing session by exact ID from this manager's active store (or from a flat-layout JSONL directory when `sessionDirectory` is passed), returning a new `SessionManager`. Defaults to `{ history: "tail" }`; pass `{ history: "full" }` only when every stored entry must be loaded into memory.
572
+ - `openSessionById(sessionId, cwdOverride?, sessionDirectory?, options?)`: open an existing session by exact ID from this manager's active store (or from a flat-layout JSONL directory when `sessionDirectory` is passed), returning a new `SessionManager`. Accepts `SessionOpenOptions` (`{ history?, leafId? }`).
571
573
  - `setSessionFile(path)`: switch directly to a JSONL file. For ID-based loading, create a new manager with `SessionManager.open(store, sessionId)` or `manager.openSessionById(sessionId)`.
572
574
  - `createBranchedSession(leafId)`: extract a branch into a new session in the same store.
573
575
  - `forkTo(cwd, targetStoreOrDir?, options?)`: copy the session into a new session at the destination.
574
- - `deleteSession(sessionId)`: delete another session and its entries from the active store. Deleting a missing ID is a no-op. Rejects for the currently open session, and raises `SessionOpenElsewhereError` if another live Atomic session holds it open (tracked by an active heartbeat that expires after 60 seconds on another host). A session deleted while running fails its next save once with `SessionDeletedError`. `SessionStore.delete(sessionId)` is the unguarded store-level operation underneath.
576
+ - `deleteSession(sessionId)`: delete another session and its entries from the active store. Deleting a missing ID is a no-op. Rejects for the currently open session, and raises `SessionOpenElsewhereError` if another live Atomic session holds an open-session marker for it (stored in SQL `session_open_markers` or `<agentDir>/open-sessions/<id>/<token>.json`, refreshed every 15 seconds, expiring after 60 seconds on another host or 24 hours without a refresh on a same-host marker lacking a process start time such as macOS—distinct from the per-agent-dir `session-claims/` resume lock). A session deleted while running fails its next save once with `SessionDeletedError`. `SessionStore.delete(sessionId)` is the unguarded store-level operation underneath.
575
577
 
576
578
  ### Appending methods
577
579
 
@@ -617,7 +619,16 @@ Await `branch`, `resetLeaf`, `recordBranch`, and `branchWithSummary`. All read m
617
619
  - `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.
618
620
  - `hasFullHistory()`: return whether every stored entry is loaded in memory.
619
621
  - `loadFullHistory()`: load every stored entry on every branch into memory. Prefer `readHistory()` so large sessions stay bounded; Atomic itself never calls `loadFullHistory()`.
620
- - `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.
622
+ - `readHistory(options?)`: iterate pages of `{ seq, entry }` with `SessionHistoryReadOptions`:
623
+ - `fromSeq` / `toSeq`: inclusive stored sequence bounds.
624
+ - `direction`: `"forward"` (default) or `"backward"` (starts from the latest page while keeping entries inside each page chronological).
625
+ - `cursor`: resume from `page.nextCursor` without passing new bounds.
626
+ - `limit`: cap entries returned per page.
627
+ - `adjacent`: when `true`, populate `page.adjacent` (`{ older?, newer?, current? }`) cursors for bidirectional navigation without maintaining a cursor stack.
628
+ - `branchLeafSeq`: walk only entries on the path from that stored sequence to the root, including pre-compaction history.
629
+ - `pageEntries`: larger page size for full-session scans (such as exports), still bounded by page byte limits.
630
+ - `signal`: optional `AbortSignal`.
631
+ - Entries over 1 MiB appear as `{ kind: "oversized", seq, bytes }` references instead of truncated objects. Replaced or recreated sessions reject rather than mixing generations.
621
632
  - `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.
622
633
  - `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`.
623
634
  - `readEntry(id)`: read one entry by ID, including entries outside the loaded window, or return `undefined` if absent.
@@ -628,8 +639,21 @@ Await `branch`, `resetLeaf`, `recordBranch`, and `branchWithSummary`. All read m
628
639
  - `getWorktreeSnapshotRecords()` and `getLatestWorktreeSnapshots()`: return loaded snapshot records (`getWorktreeSnapshotRecords`) or the latest snapshot per checkout root on the active branch (`getLatestWorktreeSnapshots`).
629
640
  - `loadWorktreeSnapshotRecords(ids, { signal? }?)`: resolve snapshot records by ID across any branch, reading the store for records outside the loaded window and omitting unknown IDs.
630
641
  - `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.
631
- - `getAdmissionKeys().has(key)`: test synchronously whether a deduplication key (admission key) has already been persisted to prevent duplicate event or message admission after resume.
632
- - `getSessionRecoveryState()`: return persisted recovery state (admission keys and delivered Intercom message IDs) used to prevent duplicate deliveries after resume.
642
+ - `getAdmissionKeys()` and `getSessionRecoveryState()`: inspect persisted deduplication state used when recovering interrupted sessions. An **admission key** is a durable deduplication token recorded for delivered peer messages, queued prompts, or subagent completions so replaying interrupted deliveries after a crash never processes the same event twice. `getAdmissionKeys().has(key)` checks synchronously whether a key is already recorded; `getSessionRecoveryState()` returns the persisted admission keys and delivered Intercom message IDs.
633
643
  - `getHeader()`: return the session header metadata.
634
644
  - `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 }`).
635
645
  - `getCwd()`, `getSessionDir()`, `getSessionId()`, `getSessionStore()`, `getSessionFile()`, and `isPersisted()`: inspect the session's working directory, JSONL directory (empty string for non-JSONL stores), exact ID, active `SessionStore`, optional JSONL file path, and whether the store is persisted rather than in-memory.
646
+
647
+ ### SessionManager and transfer errors
648
+
649
+ | Class | Fields | When |
650
+ | --- | --- | --- |
651
+ | `SessionEntryError` | `entryId`, `reason` (`"missing"`, `"inactive"`, `"not-editable"`, `"not-forkable"`, `"invalid-replacement"`) | Target entry is missing, off the active branch, or invalid for context edits or forking |
652
+ | `SessionHistoryNotLoadedError` | `sessionId` | A full-history operation ran on a tail-loaded `SessionManager` (use `readHistory()` or `loadFullHistory()`) |
653
+ | `SessionIdError` | `sessionId` | Custom session ID is empty or violates `[A-Za-z0-9][A-Za-z0-9._-]*[A-Za-z0-9]` |
654
+ | `SessionDeletedError` | `sessionId` | The currently open session was deleted from its store; fails the next append once, then stops saving |
655
+ | `SessionOpenElsewhereError` | `sessionId`, `pid`, `host` | `deleteSession()` refused because another live process holds an open-session marker for the session |
656
+ | `SessionAlreadyOpenError` | `sessionId`, `pid`, `host`, `exitCode` (`75`) | Resume refused because another live process on the same agent directory already holds the session claim |
657
+ | `ForkSourceIncompleteError` | `sessionId`, `sourceId`, `sourceSeq` | Copying a shared-history fork failed because a parent row or chunk is missing; nothing was written |
658
+ | `StorageTransferError` | `path`, `line?`, `id?`, `reason` | Export or import failed validation before writing anything |
659
+ | `StorageImportIncompleteError` | `written`, `notWritten` | Multi-session import failed partway through; re-running the import writes only `notWritten` sessions |