@bastani/atomic 0.10.11-alpha.2 → 0.10.11-alpha.3

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 (432) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/README.md +5 -8
  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 +6 -6
  7. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +5 -5
  8. package/dist/_shared/mode-shared-2QJSCUM6.js +6 -6
  9. package/dist/_shared/p0-cli-BB45ZQY6.js +46 -67
  10. package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -1
  11. package/dist/_shared/p1a-prewarm-XIU57JHF.js +7 -8
  12. package/dist/_shared/p1a-prewarm-XIU57JHF.js.map +1 -1
  13. package/dist/_shared/{p1b-elig-ENCUPKKJ.js → p1b-elig-TVB5CBLL.js} +14 -2
  14. package/dist/_shared/{p1b-elig-ENCUPKKJ.js.map → p1b-elig-TVB5CBLL.js.map} +1 -1
  15. package/dist/_shared/runtime-O4KCSG4C.js +3 -3
  16. package/dist/_shared/{sdk-IQMULKFU.js → sdk-B5LEWGGI.js} +340 -163
  17. package/dist/_shared/sdk-B5LEWGGI.js.map +1 -0
  18. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  19. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  20. package/dist/_shared/{startup-0-0-3IXNMFM2.js → startup-0-0-EZUKEP4Q.js} +48 -40
  21. package/dist/_shared/startup-0-0-EZUKEP4Q.js.map +1 -0
  22. package/dist/_shared/{startup-0-1-7T2IAE7J.js → startup-0-1-RTOHJFDJ.js} +195 -42
  23. package/dist/_shared/startup-0-1-RTOHJFDJ.js.map +1 -0
  24. package/dist/_shared/startup-0-2-5QHPCEON.js +33 -43
  25. package/dist/_shared/startup-0-2-5QHPCEON.js.map +1 -1
  26. package/dist/_shared/startup-0-3-4ZYBYQNM.js +5 -5
  27. package/dist/_shared/startup-0-4-ZMJV547D.js +12 -7
  28. package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -1
  29. package/dist/_shared/startup-0-5-YDW47QX6.js +7 -7
  30. package/dist/_shared/startup-0-5-YDW47QX6.js.map +1 -1
  31. package/dist/_shared/startup-10-0-TDQNBDDL.js +6 -6
  32. package/dist/_shared/startup-12-0-55AAXBJZ.js +2 -2
  33. package/dist/_shared/startup-14-0-MLX36RBG.js +4 -5
  34. package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
  35. package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
  36. package/dist/_shared/startup-15-1-4S7FLMNG.js +19 -27
  37. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  38. package/dist/_shared/startup-8-0-34CBHPZH.js +39 -23
  39. package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
  40. package/dist/_shared/{startup-8-1-X32CYSXB.js → startup-8-1-LZFXSD3Z.js} +90 -1176
  41. package/dist/_shared/startup-8-1-LZFXSD3Z.js.map +1 -0
  42. package/dist/_shared/storage-command-7MGXLJGZ.js +186 -35
  43. package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
  44. package/dist/_shared/storage-status-K7PX2RXA.js +557 -0
  45. package/dist/_shared/storage-status-K7PX2RXA.js.map +1 -0
  46. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  47. package/dist/_shared/team-DOQKICG2.js +376 -0
  48. package/dist/_shared/team-DOQKICG2.js.map +1 -0
  49. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  50. package/dist/builtin/intercom/CHANGELOG.md +23 -0
  51. package/dist/builtin/intercom/README.md +2 -2
  52. package/dist/builtin/intercom/broker/broker.bundle.mjs +913 -289
  53. package/dist/builtin/intercom/broker/database-wake-up-bus.ts +243 -64
  54. package/dist/builtin/intercom/broker/multinode-router.ts +154 -22
  55. package/dist/builtin/intercom/broker/multinode-state-store.ts +30 -3
  56. package/dist/builtin/intercom/broker/open-broker-state.ts +14 -0
  57. package/dist/builtin/intercom/broker/sql-add-column.ts +29 -5
  58. package/dist/builtin/intercom/broker/sql-ended-child-queue-store.ts +3 -2
  59. package/dist/builtin/intercom/broker/sql-held-send-store.ts +2 -2
  60. package/dist/builtin/intercom/broker/sql-known-session-store.ts +43 -19
  61. package/dist/builtin/intercom/broker/sql-lease-store.ts +170 -74
  62. package/dist/builtin/intercom/broker/sql-outbox-store.ts +298 -47
  63. package/dist/builtin/intercom/broker/sql-pending-ask-store.ts +8 -5
  64. package/dist/builtin/intercom/broker/sql-released-ask-store.ts +12 -5
  65. package/dist/builtin/intercom/broker/sql-restoring-reservation-store.ts +24 -7
  66. package/dist/builtin/intercom/broker/sql-retention.ts +141 -0
  67. package/dist/builtin/intercom/broker/sql-schema.ts +136 -19
  68. package/dist/builtin/intercom/broker/sql-sent-message-authority.ts +74 -19
  69. package/dist/builtin/intercom/broker/wake-up-bus.ts +6 -0
  70. package/dist/builtin/intercom/index.bundle.mjs +2 -3
  71. package/dist/builtin/intercom/package.json +1 -1
  72. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  73. package/dist/builtin/mcp/package.json +1 -1
  74. package/dist/builtin/subagents/package.json +1 -1
  75. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  76. package/dist/builtin/web-access/index.bundle.mjs +2 -10
  77. package/dist/builtin/web-access/package.json +1 -1
  78. package/dist/bun/bundled-sqlite.js +41 -0
  79. package/dist/bun/bundled-sqlite.js.map +1 -0
  80. package/dist/cli/args.js +2 -2
  81. package/dist/cli/auth-cli.code.js +4 -4
  82. package/dist/cli/auth-cli.impl.js +3 -3
  83. package/dist/cli/auth-cli.js +3 -3
  84. package/dist/cli/blueprint-command.code.js +3 -3
  85. package/dist/cli/blueprint-command.impl.js +3 -3
  86. package/dist/cli/blueprint-command.js +3 -3
  87. package/dist/cli/intercom-command.code.js +3 -3
  88. package/dist/cli/intercom-command.code.js.map +1 -1
  89. package/dist/cli/intercom-command.impl.js +3 -3
  90. package/dist/cli/intercom-command.js +3 -3
  91. package/dist/cli/list-models.code.js +2 -2
  92. package/dist/cli/list-models.impl.js +3 -3
  93. package/dist/cli/list-models.js +3 -3
  94. package/dist/cli/session-picker.code.js +1 -1
  95. package/dist/cli/session-picker.impl.js +3 -3
  96. package/dist/cli/session-picker.js +3 -3
  97. package/dist/cli/startup-ui.code.js +1 -1
  98. package/dist/cli/startup-ui.impl.js +3 -3
  99. package/dist/cli/startup-ui.js +3 -3
  100. package/dist/cli/storage-command.impl.js +3 -3
  101. package/dist/cli/storage-command.js +3 -3
  102. package/dist/cli/storage-search-session.code.js +3 -3
  103. package/dist/cli/storage-search-session.impl.js +3 -3
  104. package/dist/cli/storage-search-session.js +3 -3
  105. package/dist/cli/team-command.code.js +19 -113
  106. package/dist/cli/team-command.code.js.map +1 -1
  107. package/dist/cli/team-command.impl.js +3 -3
  108. package/dist/cli/team-command.js +3 -3
  109. package/dist/cli.js +5 -18
  110. package/dist/cli.js.map +1 -1
  111. package/dist/core/agent-rehydrate-errors.d.ts +4 -9
  112. package/dist/core/compaction/compactor.d.ts +3 -3
  113. package/dist/core/debug.code.js +1 -1
  114. package/dist/core/debug.impl.js +3 -3
  115. package/dist/core/debug.js +3 -3
  116. package/dist/core/export-html/card-projection.impl.js +3 -3
  117. package/dist/core/export-html/card-projection.js +3 -3
  118. package/dist/core/export-html/index.code.js +2 -2
  119. package/dist/core/export-html/index.impl.js +3 -3
  120. package/dist/core/export-html/index.js +3 -3
  121. package/dist/core/export-html/json-spans.impl.js +3 -3
  122. package/dist/core/export-html/json-spans.js +3 -3
  123. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  124. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  125. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  126. package/dist/core/export-html/tool-renderer.js +3 -3
  127. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  128. package/dist/core/extensions/jiti-loader.js +3 -3
  129. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  130. package/dist/core/extensions/jiti-static-loader.js +3 -3
  131. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  132. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  133. package/dist/core/extensions/loader-host-modules.js +3 -3
  134. package/dist/core/extensions/loader-virtual-modules.js +1 -1
  135. package/dist/core/extensions/runner-context.js +2 -2
  136. package/dist/core/intercom-broker-control-host.code.js +2 -2
  137. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  138. package/dist/core/intercom-broker-control-host.js +3 -3
  139. package/dist/core/intercom-broker-control.code.js +3 -3
  140. package/dist/core/intercom-broker-control.impl.js +3 -3
  141. package/dist/core/intercom-broker-control.js +3 -3
  142. package/dist/core/package-manager-storage-adapters.code.js +1 -1
  143. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  144. package/dist/core/package-manager-storage-adapters.js +3 -3
  145. package/dist/core/process-start-token.d.ts +8 -0
  146. package/dist/core/process-tree-containment.d.ts +16 -0
  147. package/dist/core/sdk-types.d.ts +1 -2
  148. package/dist/core/sdk-types.js.map +1 -1
  149. package/dist/core/sdk.code.js +3 -3
  150. package/dist/core/sdk.impl.js +3 -3
  151. package/dist/core/sdk.js +3 -3
  152. package/dist/core/session-manager-core.js +5 -5
  153. package/dist/core/session-manager-list.impl.js +3 -3
  154. package/dist/core/session-manager-list.js +3 -3
  155. package/dist/core/session-manager.code.js +1 -1
  156. package/dist/core/session-manager.impl.js +3 -3
  157. package/dist/core/session-manager.js +3 -3
  158. package/dist/core/session-storage.code.js +1 -1
  159. package/dist/core/session-storage.impl.js +3 -3
  160. package/dist/core/session-storage.js +3 -3
  161. package/dist/core/settings-schema.d.ts +0 -3
  162. package/dist/core/storage/added-exports-0-10-11.js +19 -0
  163. package/dist/core/storage/added-exports-0-10-11.js.map +1 -0
  164. package/dist/core/storage/creation-time.js +105 -0
  165. package/dist/core/storage/creation-time.js.map +1 -0
  166. package/dist/core/storage/database.d.ts +19 -5
  167. package/dist/core/storage/database.js.map +1 -1
  168. package/dist/core/storage/dialect.d.ts +1 -1
  169. package/dist/core/storage/dialect.js +1 -1
  170. package/dist/core/storage/dialect.js.map +1 -1
  171. package/dist/core/storage/errors.d.ts +13 -13
  172. package/dist/core/storage/errors.js +10 -16
  173. package/dist/core/storage/errors.js.map +1 -1
  174. package/dist/core/storage/fenced-paths.d.ts +11 -0
  175. package/dist/core/storage/fenced-paths.js +11 -0
  176. package/dist/core/storage/fenced-paths.js.map +1 -1
  177. package/dist/core/storage/file-identity.d.ts +2 -0
  178. package/dist/core/storage/file-identity.js +24 -8
  179. package/dist/core/storage/file-identity.js.map +1 -1
  180. package/dist/core/storage/index.d.ts +3 -2
  181. package/dist/core/storage/index.js +5 -3
  182. package/dist/core/storage/index.js.map +1 -1
  183. package/dist/core/storage/libsql-removed.d.ts +71 -0
  184. package/dist/core/storage/libsql-removed.js +123 -0
  185. package/dist/core/storage/libsql-removed.js.map +1 -0
  186. package/dist/core/storage/migrations.d.ts +78 -14
  187. package/dist/core/storage/migrations.js +375 -49
  188. package/dist/core/storage/migrations.js.map +1 -1
  189. package/dist/core/storage/node-sqlite-file-gate.js +0 -15
  190. package/dist/core/storage/node-sqlite-file-gate.js.map +1 -1
  191. package/dist/core/storage/node-sqlite-thread.js +8 -13
  192. package/dist/core/storage/node-sqlite-thread.js.map +1 -1
  193. package/dist/core/storage/node-sqlite.js +51 -3
  194. package/dist/core/storage/node-sqlite.js.map +1 -1
  195. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  196. package/dist/core/storage/offline-snapshot-file.js +3 -3
  197. package/dist/core/storage/prefix.d.ts +1 -1
  198. package/dist/core/storage/prefix.js +9 -2
  199. package/dist/core/storage/prefix.js.map +1 -1
  200. package/dist/core/storage/process-selection.d.ts +5 -5
  201. package/dist/core/storage/provider.js +2 -2
  202. package/dist/core/storage/schema-catalog.d.ts +7 -8
  203. package/dist/core/storage/schema-catalog.js +8 -8
  204. package/dist/core/storage/schema-catalog.js.map +1 -1
  205. package/dist/core/storage/selection.d.ts +7 -82
  206. package/dist/core/storage/selection.js +20 -235
  207. package/dist/core/storage/selection.js.map +1 -1
  208. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  209. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  210. package/dist/core/storage/session/branch-fork-source.js +3 -3
  211. package/dist/core/storage/session/card-view.impl.js +3 -3
  212. package/dist/core/storage/session/card-view.js +3 -3
  213. package/dist/core/storage/session/child-reader.code.js +3 -3
  214. package/dist/core/storage/session/child-reader.impl.js +3 -3
  215. package/dist/core/storage/session/child-reader.js +3 -3
  216. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  217. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  218. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  219. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  220. package/dist/core/storage/session/expanded-child-details.js +3 -3
  221. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  222. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  223. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  224. package/dist/core/storage/session/fork-row-index.js +3 -3
  225. package/dist/core/storage/session/fork-staging.code.js +4 -7
  226. package/dist/core/storage/session/fork-staging.code.js.map +1 -1
  227. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  228. package/dist/core/storage/session/fork-staging.js +3 -3
  229. package/dist/core/storage/session/fork-window.code.js +3 -3
  230. package/dist/core/storage/session/fork-window.impl.js +3 -3
  231. package/dist/core/storage/session/fork-window.js +3 -3
  232. package/dist/core/storage/session/history-pages.impl.js +3 -3
  233. package/dist/core/storage/session/history-pages.js +3 -3
  234. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  235. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  236. package/dist/core/storage/session/jsonl-session-store.d.ts +5 -1
  237. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  238. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  239. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  240. package/dist/core/storage/session/memory-session-store.js +3 -3
  241. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  242. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  243. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  244. package/dist/core/storage/session/released-history-files.code.js +3 -3
  245. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  246. package/dist/core/storage/session/released-history-files.js +3 -3
  247. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  248. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  249. package/dist/core/storage/session/session-resume.impl.js +3 -3
  250. package/dist/core/storage/session/session-resume.js +3 -3
  251. package/dist/core/storage/session/session-search-index.d.ts +43 -4
  252. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  253. package/dist/core/storage/session/snapshot-cut.js +3 -3
  254. package/dist/core/storage/session/snapshot-history.code.js +3 -3
  255. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  256. package/dist/core/storage/session/snapshot-history.js +3 -3
  257. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  258. package/dist/core/storage/session/sql-session-store.d.ts +48 -11
  259. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  260. package/dist/core/storage/session/sql-session-store.js +3 -3
  261. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  262. package/dist/core/storage/session/tree-outline.js +3 -3
  263. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  264. package/dist/core/storage/session/tree-presentation.js +3 -3
  265. package/dist/core/storage/sqlite-facade.d.ts +6 -1
  266. package/dist/core/storage/sqlite-facade.js +1 -0
  267. package/dist/core/storage/sqlite-facade.js.map +1 -1
  268. package/dist/core/storage/storage-status.code.js +1 -1
  269. package/dist/core/storage/storage-status.impl.js +3 -3
  270. package/dist/core/storage/storage-status.js +3 -3
  271. package/dist/core/storage/team.code.js +1 -1
  272. package/dist/core/storage/team.d.ts +26 -115
  273. package/dist/core/storage/team.impl.js +3 -3
  274. package/dist/core/storage/team.js +3 -3
  275. package/dist/core/structured-output/index.code.js +1 -1
  276. package/dist/core/structured-output/index.impl.js +3 -3
  277. package/dist/core/structured-output/index.js +3 -3
  278. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  279. package/dist/core/tasks/task-completion-entry.js +3 -3
  280. package/dist/core/tasks/task-file-history.code.js +3 -3
  281. package/dist/core/tasks/task-file-history.impl.js +3 -3
  282. package/dist/core/tasks/task-file-history.js +3 -3
  283. package/dist/core/tasks/task-reference-archive.code.js +4 -4
  284. package/dist/core/tasks/task-reference-archive.js +3 -3
  285. package/dist/core/tasks/task-reference-identity.js +3 -3
  286. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  287. package/dist/core/tasks/task-reference-stream.js +3 -3
  288. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  289. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  290. package/dist/core/tasks/task-view-source.code.js +1 -1
  291. package/dist/core/tasks/task-view-source.impl.js +3 -3
  292. package/dist/core/tasks/task-view-source.js +3 -3
  293. package/dist/core/tools/history-tasks.d.ts +3 -2
  294. package/dist/core/tools/read-url.code.js +4 -4
  295. package/dist/core/tools/read-url.impl.js +3 -3
  296. package/dist/core/tools/read-url.js +3 -3
  297. package/dist/core/worktree-snapshot/blob-store.d.ts +40 -3
  298. package/dist/core/worktree-snapshot/blob-store.js +414 -21
  299. package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
  300. package/dist/core/worktree-snapshot/errors.code.js +2 -2
  301. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  302. package/dist/core/worktree-snapshot/errors.js +3 -3
  303. package/dist/core/worktree-snapshot/fork-blob-guard.js +81 -0
  304. package/dist/core/worktree-snapshot/fork-blob-guard.js.map +1 -0
  305. package/dist/core/worktree-snapshot/fork-snapshot-index.js +79 -38
  306. package/dist/core/worktree-snapshot/fork-snapshot-index.js.map +1 -1
  307. package/dist/core/worktree-snapshot/session-index-reset.code.js +4 -0
  308. package/dist/core/worktree-snapshot/session-index-reset.code.js.map +1 -1
  309. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  310. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  311. package/dist/extensions/codemode/execute.code.js +1 -1
  312. package/dist/extensions/codemode/execute.impl.js +3 -3
  313. package/dist/extensions/codemode/execute.js +3 -3
  314. package/dist/extensions/codemode/renderer.code.js +2 -2
  315. package/dist/extensions/codemode/renderer.impl.js +3 -3
  316. package/dist/extensions/codemode/renderer.js +3 -3
  317. package/dist/extensions/mcp/cli.code.js +3 -3
  318. package/dist/extensions/mcp/cli.impl.js +3 -3
  319. package/dist/extensions/mcp/cli.js +3 -3
  320. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  321. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  322. package/dist/extensions/mcp/cli.lazy.js +3 -3
  323. package/dist/extensions/mcp/runtime.code.js +1 -1
  324. package/dist/extensions/mcp/runtime.impl.js +3 -3
  325. package/dist/extensions/mcp/runtime.js +3 -3
  326. package/dist/index.d.ts +3 -1
  327. package/dist/index.js +5 -5
  328. package/dist/main-first-time-setup.code.js +1 -1
  329. package/dist/main-first-time-setup.impl.js +3 -3
  330. package/dist/main-first-time-setup.js +3 -3
  331. package/dist/main.js +1 -1
  332. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  333. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  334. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  335. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  336. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  337. package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
  338. package/dist/modes/interactive-engine/engine-prewarm.d.ts +1 -1
  339. package/dist/modes/print-mode.js +1 -1
  340. package/dist/package-manager-cli.code.js +6 -6
  341. package/dist/package-manager-cli.impl.js +3 -3
  342. package/dist/package-manager-cli.js +3 -3
  343. package/dist/rpc-entry.js +1 -1
  344. package/dist/startup-files.json +1 -1
  345. package/dist/startup-stages/10.js +1 -1
  346. package/dist/startup-stages/11.js +1 -1
  347. package/dist/startup-stages/12.js +1 -1
  348. package/dist/startup-stages/2.js +2 -4
  349. package/dist/startup-stages/3.js +1 -3
  350. package/dist/startup-stages/4.js +1 -2
  351. package/dist/startup-stages/5.js +1 -1
  352. package/dist/startup-stages/6.js +5 -7
  353. package/dist/startup-stages/7.js +3 -10
  354. package/dist/startup-stages/8.js +7 -2
  355. package/dist/startup-stages/9.js +1 -7
  356. package/dist/startup-stages/stages.json +1 -1
  357. package/dist/utils/compile-cache-deferral.js +8 -13
  358. package/dist/utils/compile-cache-deferral.js.map +1 -1
  359. package/dist/utils/compile-cache-warmup-host.js +3 -4
  360. package/dist/utils/compile-cache-warmup-host.js.map +1 -1
  361. package/dist/utils/compile-cache.js +12 -100
  362. package/dist/utils/compile-cache.js.map +1 -1
  363. package/dist/utils/startup-database-spare.code.js +2 -2
  364. package/dist/utils/startup-database-spare.impl.js +3 -3
  365. package/dist/utils/startup-database-spare.js +3 -3
  366. package/dist/utils/tools-manager.code.js +1 -1
  367. package/dist/utils/tools-manager.impl.js +3 -3
  368. package/dist/utils/tools-manager.js +3 -3
  369. package/dist/utils/worker-threads.js +2 -15
  370. package/dist/utils/worker-threads.js.map +1 -1
  371. package/docs/build.md +3 -3
  372. package/docs/changelog.mdx +1421 -69
  373. package/docs/compaction/reference.md +5 -5
  374. package/docs/compaction.md +7 -9
  375. package/docs/containerization.md +2 -2
  376. package/docs/custom-provider/api-reference.md +1 -1
  377. package/docs/docs.json +37 -10
  378. package/docs/environment-variables.md +0 -2
  379. package/docs/extensions/api-reference.md +4 -4
  380. package/docs/getting-started/installation.md +3 -0
  381. package/docs/guides/configuration.md +1 -1
  382. package/docs/guides/non-interactive.md +1 -1
  383. package/docs/guides/resume-on-any-machine.md +14 -22
  384. package/docs/guides/team-setup.md +56 -83
  385. package/docs/guides.md +2 -4
  386. package/docs/herdr.md +1 -1
  387. package/docs/index.md +1 -1
  388. package/docs/intercom/operations.md +26 -21
  389. package/docs/intercom/reference.md +2 -2
  390. package/docs/intercom.md +1 -1
  391. package/docs/libraries/storage-postgres.md +9 -9
  392. package/docs/libraries.md +2 -3
  393. package/docs/models-configuration.md +2 -2
  394. package/docs/models.md +2 -3
  395. package/docs/packages/authoring.md +7 -7
  396. package/docs/packages.md +1 -1
  397. package/docs/programmatic.md +2 -2
  398. package/docs/quickstart.md +1 -1
  399. package/docs/reference/cli.md +6 -11
  400. package/docs/reference.md +2 -2
  401. package/docs/rpc/extension-ui.md +2 -2
  402. package/docs/sdk/reference.md +5 -4
  403. package/docs/sdk/storage.md +8 -92
  404. package/docs/sdk/structured-decisions.md +1 -1
  405. package/docs/sdk/web-server.md +3 -3
  406. package/docs/sdk.md +14 -4
  407. package/docs/security.md +1 -1
  408. package/docs/session-format.md +5 -5
  409. package/docs/sessions.md +29 -49
  410. package/docs/settings.md +7 -8
  411. package/docs/storage/custom-adapters.md +255 -0
  412. package/docs/storage/jsonl.md +117 -0
  413. package/docs/{guides/postgres-pgbouncer.md → storage/postgres/pgbouncer.md} +66 -68
  414. package/docs/storage/postgres/tuning.md +337 -0
  415. package/docs/storage/postgres.md +556 -0
  416. package/docs/storage/sqlite.md +99 -0
  417. package/docs/storage.md +326 -990
  418. package/docs/subagents/authoring.md +1 -1
  419. package/docs/subagents.md +2 -2
  420. package/docs/tools.md +1 -1
  421. package/docs/worktree-snapshots.md +2 -2
  422. package/package.json +9 -9
  423. package/schemas/models.schema.json +2 -2
  424. package/schemas/settings.schema.json +0 -14
  425. package/dist/_shared/sdk-IQMULKFU.js.map +0 -1
  426. package/dist/_shared/startup-0-0-3IXNMFM2.js.map +0 -1
  427. package/dist/_shared/startup-0-1-7T2IAE7J.js.map +0 -1
  428. package/dist/_shared/startup-8-1-X32CYSXB.js.map +0 -1
  429. package/dist/core/intercom-broker-control.d.ts +0 -129
  430. package/dist/startup-stages/13.js +0 -1
  431. package/docs/guides/postgres-tuning.md +0 -311
  432. package/docs/libraries/storage-libsql.md +0 -97
@@ -21,7 +21,7 @@ Atomic provides three programmatic integration modes plus a component API for in
21
21
  ## SDK guides and APIs
22
22
 
23
23
  - [SDK overview](/sdk): create sessions, bind workspaces, configure Intercom policies, and handle lifecycle events.
24
- - [SDK storage backends](/sdk/storage): configure SQLite, JSONL, in-memory, libSQL/Turso, and PostgreSQL for `createAgentSession()`, `createAgentSessionRuntime()`, and `SessionManager`.
24
+ - [SDK storage backends](/sdk/storage): configure SQLite, JSONL, in-memory, and PostgreSQL for `createAgentSession()`, `createAgentSessionRuntime()`, and `SessionManager`.
25
25
  - [Structured decisions API](/sdk/structured-decisions): run typed classifier or chat decisions with `decide()` and `generateStructuredOutput()`.
26
26
  - [Embed Atomic in a web server](/sdk/web-server): build a streaming HTTP API with Next.js App Router and `createAgentSession()`.
27
27
  - [SDK API reference](/sdk/reference): complete session options, loaders, tool status, task supervision, run modes, and exports.
@@ -36,4 +36,4 @@ Atomic provides three programmatic integration modes plus a component API for in
36
36
  ## Terminal UI and standalone libraries
37
37
 
38
38
  - [Build TUI components](/tui) walks through custom interactive components and common patterns, and [TUI API reference](/tui/reference) documents the component, focus, input, and rendering contracts.
39
- - [Standalone libraries](/libraries) covers the six core `@bastani/atomic-*` packages (`ai`, `agent-core`, `tui`, `codemode`, `schema`, and `telemetry`) plus the optional storage adapter packages ([`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) and [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql)).
39
+ - [Standalone libraries](/libraries) covers the six core `@bastani/atomic-*` packages (`ai`, `agent-core`, `tui`, `codemode`, `schema`, and `telemetry`) plus the optional storage adapter packages ([`@bastani/atomic-storage-postgres`](/libraries/storage-postgres)).
@@ -156,7 +156,7 @@ Piped stdin is separated from CLI prompt text by a newline. Use `--mode json` fo
156
156
 
157
157
  - **[Interactive mode](/usage).** Learn slash commands, shortcuts, and message queueing.
158
158
  - **[Sessions](/sessions) and [Worktree snapshots](/worktree-snapshots).** Branch conversations, restore repository checkouts, and [resume on any machine with blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint).
159
- - **[Storage backends](/storage).** Keep local SQLite or switch to shared PostgreSQL or Turso/libSQL (or see [SDK storage backends](/sdk/storage) for embedded apps).
159
+ - **[Storage](/storage).** Keep local SQLite or switch to shared PostgreSQL (or see [SDK storage backends](/sdk/storage) for embedded apps).
160
160
  - **[Compaction](/compaction).** Manage long sessions and configure [custom remote compactors](/compaction#customize-morph-or-add-a-remote-compactor).
161
161
  - **[MCP servers](/mcp-servers).** Connect external tools and data sources over Model Context Protocol.
162
162
  - **[Subagents](/subagents), [Intercom](/intercom), and [Orchestration](/orchestration).** Delegate independent tasks, coordinate live sessions, and verify multi-step work.
@@ -374,16 +374,13 @@ Passing `--help` or `-h` after `--` (for example `atomic mcp add srv -- cmd --he
374
374
 
375
375
  ```bash
376
376
  atomic storage status [--json] # Selection, source, adapter, and connection per domain
377
- atomic storage join <url> [--token-file <path>] [--prefix <prefix>] # Use a shared libSQL or Turso database
378
377
  atomic storage join <postgres-url> --password-file <path>|--token-file <path>|--auth azure|aws|gcp [--prefix <prefix>] # Use a shared PostgreSQL database
379
378
  atomic storage migrate [--db <url> [--password-file <path> | --token-file <path> | --auth azure|aws|gcp]] [--prefix <prefix>]
380
379
  atomic storage move-snapshot-chunks <sqlite-file> [--prefix <prefix>]
381
380
  atomic storage search-session <sqlite-file> <session-id> <pattern> [cursor]
382
381
  atomic storage export <dir> [--sessions] [--limit <n>] [--since <time>] [--storage <json> | --storage-file <path>]
383
382
  atomic storage import <dir> [--sessions] [--storage <json> | --storage-file <path>]
384
- atomic team join <url> [--token-file <path>] [--prefix <prefix>] # Share Intercom (libSQL/Turso); sessions stay local
385
383
  atomic team status [--json] # Profile in effect plus the storage report
386
- atomic team leave # Remove what team join wrote
387
384
  atomic intercom status # This machine's Intercom broker and multi-node state
388
385
  atomic intercom restart # Replace the broker so it reads the current selection
389
386
  atomic intercom upgrade # Replace a broker an older Atomic started, when safe
@@ -391,14 +388,12 @@ atomic intercom upgrade # Replace a
391
388
 
392
389
  `atomic storage status` reports the selected storage for sessions and Intercom, where each selection came from (environment variable, project settings, global settings, or default), any outranked selections, whether each adapter loads, and whether each database answers `SELECT 1`. It also shows the running Intercom broker, its multi-node routing state, and peer brokers live in the shared database. It modifies nothing and exits `1` if a selection is invalid, an adapter fails to load, or a database does not answer.
393
390
 
394
- `atomic storage join` verifies the credential and connection (`SELECT 1` with a 15-second timeout) using `@bastani/atomic-storage-libsql` (for libSQL or Turso) or `@bastani/atomic-storage-postgres` (for `postgres://` or `postgresql://`), writes only the global `storage` setting, and reports any environment variables or settings that override it. It creates no tables and prints the install command if the adapter package is missing.
391
+ `atomic storage join` verifies the credential and connection (`SELECT 1` with a 15-second timeout) using `@bastani/atomic-storage-postgres` (for `postgres://` or `postgresql://` URLs), writes only the global `storage` setting, and reports any environment variables or settings that override it. It creates no tables and prints the install command if the adapter package is missing.
395
392
 
396
- - For libSQL, `--token-file` is required except for absolute `file:` URLs. Atomic copies the trimmed token into a new `storage-token.<id>` file (mode `600`) in the agent directory without overwriting earlier token files. Relative `file:` URLs and URLs carrying embedded credentials or `authToken` parameters are rejected.
397
- - For PostgreSQL, pass exactly one of `--password-file` (copied to a mode `600` `storage-token.<id>` file), `--token-file` (referenced in place and re-read on every new connection), or `--auth azure|aws|gcp`. Passwords in the URL are rejected, and settings store only file references.
393
+ - Pass exactly one of `--password-file` (copied to a mode `600` `storage-token.<id>` file), `--token-file` (referenced in place and re-read on every new connection), or `--auth azure|aws|gcp`. Passwords in the URL are rejected, and settings store only file references.
394
+ - A libSQL URL (`libsql://`, `https://`, `http://`, `wss://`, `ws://`, or `file:`) is refused with `libsql-removed`: Atomic 0.10.11 removed libSQL support. See [Moving off libSQL](/storage#moving-off-libsql).
398
395
 
399
- `atomic team join` supports **libSQL and Turso** databases (`--token-file` and `--prefix`; PostgreSQL `--password-file` and `--auth` options are only for `atomic storage join`). It runs the same validation and token handling, writes global `storage` (the team database) and `sessions.storage` (local default store) together, restarts the Intercom broker, and prints the profile and storage status. Nothing is written if validation fails.
400
-
401
- `atomic team status` adds the active profile (`individual`, `team`, `ci`, or `custom`) and project Intercom group. `atomic team leave` reverts only what `team join` wrote, deletes its token file unless another setting references it, and restarts the broker. See [Team and CI setup](/guides/team-setup).
396
+ `atomic team status` adds the active profile (`individual`, `team`, `ci`, or `custom`) and project Intercom group. `atomic team join` and `atomic team leave` were removed with libSQL support in 0.10.11 and fail with `libsql-removed`. See [Team and CI setup](/guides/team-setup).
402
397
 
403
398
  `atomic storage migrate` creates or upgrades session and Intercom tables in the selected shared database (or `--db`). Run it as the database owner after joining or upgrading Atomic so runtime-only roles do not need schema-creation privileges (DDL).
404
399
 
@@ -406,7 +401,7 @@ atomic intercom upgrade # Replace a
406
401
 
407
402
  `atomic storage search-session <sqlite-file> <session-id> <pattern> [cursor]` searches entries of a stored session in a local SQLite database by regex pattern, optionally resuming pagination from `cursor`. See [Recalling earlier work](/sessions#recalling-earlier-work).
408
403
 
409
- `atomic storage export` writes sessions to `<dir>/sessions/<sessionId>.jsonl` (compatible with `atomic --import`). Each file is replaced whole; identical files are skipped and no files are deleted. `--limit <n>` exports at most `n` most recently modified sessions, and `--since <time>` filters by modification date or timestamp. Exporting a shared libSQL or PostgreSQL database requires `--storage` or `--storage-file` explicitly.
404
+ `atomic storage export` writes sessions to `<dir>/sessions/<sessionId>.jsonl` (compatible with `atomic --import`). Each file is replaced whole; identical files are skipped and no files are deleted. `--limit <n>` exports at most `n` most recently modified sessions, and `--since <time>` filters by modification date or timestamp. Exporting a shared PostgreSQL database requires `--storage` or `--storage-file` explicitly.
410
405
 
411
406
  `atomic storage import` validates every file in `<dir>/sessions` before writing, then adds new sessions and newer entries for existing sessions while ignoring other directories. Partial failures list what was and was not written so you can rerun safely. Both `export` and `import` accept `--sessions`, plus `--storage <json>` or `--storage-file <path>` to target a specific store.
412
407
 
@@ -435,7 +430,7 @@ Because `prebuild` executes project code, the project must be trusted or `--appr
435
430
 
436
431
  See [Environment variables](/environment-variables) for the complete registry, exact boolean parsing rules, legacy `PI_*` aliases, color controls, and diagnostic knobs. Key CLI variables:
437
432
 
438
- - **Config & storage:** `ATOMIC_CODING_AGENT_DIR`, `ATOMIC_CODING_AGENT_SESSION_DIR`, `ATOMIC_STORAGE`, `ATOMIC_SESSIONS_STORAGE`, `ATOMIC_PROFILE` + `ATOMIC_TEAM_*` ([Team and CI setup](/guides/team-setup#ci-and-swarms)), `ATOMIC_PACKAGE_DIR`.
433
+ - **Config & storage:** `ATOMIC_CODING_AGENT_DIR`, `ATOMIC_CODING_AGENT_SESSION_DIR`, `ATOMIC_STORAGE`, `ATOMIC_SESSIONS_STORAGE`, `ATOMIC_PACKAGE_DIR`.
439
434
  - **Network & updates:** `ATOMIC_OFFLINE`, `ATOMIC_SKIP_VERSION_CHECK`, `ATOMIC_SELF_UPDATE_COMMAND` ([Custom update command](#custom-update-command)), `ATOMIC_TELEMETRY`, `ATOMIC_CACHE_RETENTION` ([Prompt-cache retention](/environment-variables#prompt-cache-retention)).
440
435
  - **Interactive & shell:** `NO_COLOR`, `FORCE_COLOR`, `ATOMIC_REDUCED_MOTION`, `ATOMIC_DEBUG`, `ATOMIC_NO_PTY`, `ATOMIC_STDIN_TIMEOUT_MS`, `VISUAL` / `EDITOR`, `AI_AGENT` (set to `atomic` on Atomic and its child processes).
441
436
 
package/docs/reference.md CHANGED
@@ -24,7 +24,7 @@ Look up exact commands, settings, configuration schemas, tool behaviors, and API
24
24
  - [Models configuration](/models-configuration) lists the generated `models.json` field reference (including [remote compaction models](/models#remote-compaction-models)).
25
25
  - [Session format](/session-format) specifies the JSONL format, entry types, and `SessionManager` API.
26
26
  - [Compaction reference](/compaction/reference) covers parameters, saved boundaries, custom compactor contracts, hooks, exports, settings, and historical formats.
27
- - [Storage](/storage) covers local SQLite, shared libSQL ([`@bastani/atomic-storage-libsql`](/libraries/storage-libsql)) and PostgreSQL ([`@bastani/atomic-storage-postgres`](/libraries/storage-postgres)) databases, adapters, CLI commands, and typed storage errors. For programmatic backend recipes, see [SDK storage backends](/sdk/storage).
27
+ - [Storage](/storage) covers choosing a session store, sharing one database between machines, the `atomic storage` commands, exporting and importing sessions, and storage errors. Each kind of store has its own page: [local SQLite](/storage/sqlite), [JSONL](/storage/jsonl), and [PostgreSQL](/storage/postgres), with its adapter library [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) and guides for [PgBouncer](/storage/postgres/pgbouncer) and [server tuning](/storage/postgres/tuning). [Custom adapters](/storage/custom-adapters) covers adapter packages, your own database drivers, and the conformance suites. For SDK apps, see [SDK session storage](/sdk/storage).
28
28
  - [Worktree snapshots SDK & errors](/worktree-snapshots#sdk) documents snapshot capture/restore functions, garbage collection, and `WorkspaceError` classes.
29
29
  - [Environment blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint) documents `.atomic/blueprint.yaml`, `atomic blueprint cache-key`, and `atomic blueprint prebuild`.
30
30
 
@@ -42,7 +42,7 @@ Look up exact commands, settings, configuration schemas, tool behaviors, and API
42
42
  - [Extension events](/extensions/events) lists every extension event and its payload.
43
43
  - [Provider API reference](/custom-provider/api-reference) specifies custom provider configuration and model definition options.
44
44
  - [SDK API reference](/sdk/reference) covers options, loaders, return values, run modes, and exports.
45
- - [SDK storage backends](/sdk/storage) documents `sessionStore`, `storage`, `resolveSessionStore()`, `StorageProvider`, and `createAgentSessionRuntime()` storage wiring.
45
+ - [SDK session storage](/sdk/storage) documents `sessionStore`, `storage`, `resolveSessionStore()`, `StorageProvider`, and `createAgentSessionRuntime()` storage wiring.
46
46
  - [Structured decisions](/sdk/structured-decisions) documents `decide()`, structured output tools, and provider limits.
47
47
  - [RPC protocol](/rpc/protocol) and [RPC extension UI](/rpc/extension-ui) document RPC commands, events, UI dialogs, types, and errors.
48
48
  - [JSON event stream](/json) documents `--mode json` event output.
@@ -134,7 +134,7 @@ Represents one `ask_user_question` tool call: one to four questions, each with a
134
134
  "header": "Storage",
135
135
  "options": [
136
136
  { "label": "SQLite", "description": "A local file" },
137
- { "label": "libSQL", "description": "A shared database" }
137
+ { "label": "PostgreSQL", "description": "A shared database" }
138
138
  ]
139
139
  }
140
140
  ]
@@ -152,7 +152,7 @@ Expected response: `extension_ui_response` with `answers` (one entry per answere
152
152
  {
153
153
  "type": "extension_ui_response",
154
154
  "id": "uuid-5",
155
- "answers": [{ "questionIndex": 0, "question": "Which storage should runs use?", "kind": "option", "answer": "libSQL" }]
155
+ "answers": [{ "questionIndex": 0, "question": "Which storage should runs use?", "kind": "option", "answer": "PostgreSQL" }]
156
156
  }
157
157
  ```
158
158
 
@@ -164,6 +164,8 @@ Remote catalogs persist locally so later runtimes can restore them without a net
164
164
  - Network refreshes are throttled to once per provider every four hours unless forced. Call `await modelRuntime.refresh({ allowNetwork: true, force: true, signal })` to force an immediate refresh.
165
165
  - Setting `ATOMIC_OFFLINE` (legacy alias `PI_OFFLINE`) disables model network access, and a `refresh()` call that omits `allowNetwork` follows that same runtime network policy.
166
166
 
167
+ A running session exposes the runtime it uses as `session.modelRuntime`, so you can add a provider to a live session without creating a new runtime. For example, `session.modelRuntime.registerProvider("acme", { ... })` makes the provider's models available to that session's model selection and compaction.
168
+
167
169
  `registerProvider()`, `registerNativeProvider()`, and `unregisterProvider()` return at once and refresh the catalog from cache in the background while checking provider credentials. `await modelRuntime.whenRegistrationRefreshesSettled()` resolves once no registration refresh is running, including refreshes started while you wait.
168
170
 
169
171
  ### API keys and OAuth
@@ -507,7 +509,7 @@ Without a detachment policy, detachable calls run inline. A host using persisten
507
509
  - **`session.isWaitingOnDetachedResults()`:** Reports whether the transcript still awaits a detached result. While waiting under a detachment policy, nothing starts a turn on the idle session (including subagent notices, steering, follow-ups, and post-compaction continuations); held custom messages are persisted and replayed after `resumeDetachedTurn()` continues the turn. Do not call `prompt()` while waiting on results.
508
510
  - **`session.hasPendingDetachedTurn()` and `session.redispatchDetachedToolCalls()`:** `hasPendingDetachedTurn()` reports whether a reopened transcript ends on a detached turn; continue it with `redispatchDetachedToolCalls()` and `resumeDetachedTurn()` instead of prompting again. `redispatchDetachedToolCalls()` restarts unanswered detachable calls with their original IDs and arguments and emits `tool_execution_start` before returning.
509
511
 
510
- Results handed to `resumeDetachedTurn()` pass through `tool_result` hooks, image resizing, and output persistence (stored as `tool-output://<sha256>` in blob-capable stores like SQLite, libSQL, and memory, or on disk otherwise; see [Persisted tool output](/tools#persisted-tool-output)).
512
+ Results handed to `resumeDetachedTurn()` pass through `tool_result` hooks, image resizing, and output persistence (stored as `tool-output://<sha256>` in blob-capable stores like SQLite, PostgreSQL, and memory, or on disk otherwise; see [Persisted tool output](/tools#persisted-tool-output)).
511
513
 
512
514
  Detached calls run outside the session's async context and hold no reference to the session:
513
515
 
@@ -1503,10 +1505,9 @@ StorageProvider, type StorageSelection, type StorageOpenContext, type StorageAda
1503
1505
  type AdapterOptions, type SecretRef, type SessionStorageOption, type SessionStore
1504
1506
  loadStorageAdapter, resolveAdapterOptions, adapterOpenContext, storageSelectionKey
1505
1507
  secretFilePath, secretFilePathAsync
1506
- LIBSQL_ADAPTER_PACKAGE, POSTGRES_ADAPTER_PACKAGE, LOCAL_SESSIONS_STORAGE, REDACTED_SECRET
1508
+ POSTGRES_ADAPTER_PACKAGE, LOCAL_SESSIONS_STORAGE, REDACTED_SECRET
1507
1509
  inMemorySecret, type InMemorySecretRef
1508
- teamProfileSelection, type TeamProfileSelectionOptions, type TeamStorageSelection
1509
- joinTeam, leaveTeam, getTeamProfile, isPostgresUrl
1510
+ getTeamProfile, isPostgresUrl
1510
1511
  selectStorage, selectStorageAsync, type StorageInputSelection, type StorageSettingsSelection
1511
1512
  selectProcessStorage, selectProcessStorageAsync, type ProcessStorageChoice, type StorageDomain
1512
1513
  processSharedStorageSelection, processSharedStorageSelectionAsync
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  title: "SDK storage backends"
3
3
  sidebarTitle: "Storage backends"
4
- description: "Configure local SQLite, JSONL, in-memory, libSQL/Turso, and PostgreSQL storage for createAgentSession(), createAgentSessionRuntime(), and SessionManager."
4
+ description: "Configure local SQLite, JSONL, in-memory, and PostgreSQL storage for createAgentSession(), createAgentSessionRuntime(), and SessionManager."
5
5
  ---
6
6
 
7
7
  By default, Atomic persists sessions in local SQLite at `~/.atomic/workflows/journal.sqlite` (`session_` table prefix). In SDK applications, you can select any built-in or remote backend per session, share one database connection across multiple sessions, or manage lifecycle explicitly through `createAgentSessionRuntime()` and `SessionManager`.
8
8
 
9
- For CLI setup, database role administration, migrations, and custom drivers, see [Storage backends](/storage).
9
+ For CLI setup, database role administration, migrations, and custom drivers, see [Storage](/storage).
10
10
 
11
11
  ## Choosing a backend
12
12
 
@@ -15,7 +15,6 @@ For CLI setup, database role administration, migrations, and custom drivers, see
15
15
  | **Local SQLite** (default) | Built into `@bastani/atomic` | `{ kind: "sqlite", path, prefix? }` or caller-owned `openNodeSqliteDatabase()` | Single-machine apps, full worktree snapshots, history search, zero external services |
16
16
  | **JSONL directory** | Built into `@bastani/atomic` | `{ kind: "jsonl", dir }` or `JsonlSessionStore.open(dir, { exactDirectory: true })` | Human-readable append-only `.jsonl` files (no snapshot blobs) |
17
17
  | **In-memory** | Built into `@bastani/atomic` | `SessionManager.inMemory()`, `new MemorySessionStore()`, or `{ kind: "memory" }` | Tests, ephemeral runs, or RAM-backed release/rehydrate |
18
- | **libSQL / Turso** | [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql) | `openLibsqlDatabase()` + `{ kind: "database", database }`, `{ kind: "adapter", ... }`, or `teamProfileSelection()` | Lightweight shared DB for small teams, multi-machine resume, or CI |
19
18
  | **PostgreSQL 16+** | [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) | `openPostgresDatabase()` + `{ kind: "database", database }` or `{ kind: "adapter", ... }` | Concurrent multi-machine writers, managed HA, connection poolers, cloud IAM |
20
19
 
21
20
  ### `@bastani/atomic` vs. `@bastani/atomic/storage`
@@ -199,9 +198,9 @@ npm install @bastani/atomic-storage-postgres @bastani/atomic
199
198
 
200
199
  Before connecting from an SDK host:
201
200
 
202
- - **PostgreSQL version:** Atomic sessions require **PostgreSQL 16 or later** (the adapter accepts PostgreSQL 14+ on connect for non-session tables).
201
+ - **PostgreSQL version:** Atomic needs **PostgreSQL 16 or newer**.
203
202
  - **Table prefix rules:** On PostgreSQL, `prefix` must be **lowercase** and at most **24 characters** (`POSTGRES_MAX_STORAGE_PREFIX_LENGTH`). Uppercase or oversized prefixes fail with `StoragePrefixError`.
204
- - **Owner-role migrations:** Run `atomic storage migrate` once as the database owner role before connecting with a least-privilege runtime role. See [Set up the database](/storage#set-up-the-database).
203
+ - **Owner-role migrations:** Run `atomic storage migrate` once as the database owner role before connecting with a least-privilege runtime role. See [Set up the database](/storage/postgres#set-up-the-database).
205
204
 
206
205
  **Option A — Caller-owned `openPostgresDatabase()` (recommended for SDK hosts sharing one pool):**
207
206
 
@@ -295,89 +294,7 @@ try {
295
294
 
296
295
  > **Module resolution for `{ kind: "adapter" }`:** Atomic resolves adapter package names from user-scope packages installed with `atomic install` (`~/.atomic/agent/npm`), paths passed in `DefaultResourceLoader({ additionalExtensionPaths: [packageRoot] })`, or relative to `agentDir` — **not** from your application's local `node_modules`. If your app installed `@bastani/atomic-storage-postgres` only with `npm install`, use **Option A** (`openPostgresDatabase()`), install the package in user scope (`atomic install npm:@bastani/atomic-storage-postgres`), pass its directory via `additionalExtensionPaths`, or pass a resolved file path (`fileURLToPath(import.meta.resolve(POSTGRES_ADAPTER_PACKAGE))`).
297
296
 
298
- ### libSQL / Turso
299
-
300
- Install the optional adapter alongside `@bastani/atomic`:
301
-
302
- ```bash
303
- npm install @bastani/atomic-storage-libsql @bastani/atomic
304
- ```
305
-
306
- **Option A — Caller-owned `openLibsqlDatabase()`:**
307
-
308
- ```typescript
309
- import { createAgentSession } from "@bastani/atomic";
310
- import { openLibsqlDatabase } from "@bastani/atomic-storage-libsql";
311
-
312
- const database = await openLibsqlDatabase({
313
- url: "libsql://<db>.turso.io",
314
- authToken: process.env.TURSO_AUTH_TOKEN,
315
- // Optional for self-hosted sqld (`libsql:`, `https:`, or `http:` URLs):
316
- // namespace: "team-a",
317
- // headers: { "x-custom-routing": "primary" },
318
- });
319
- try {
320
- const { session } = await createAgentSession({
321
- sessionStore: { kind: "database", database, prefix: "app_" },
322
- });
323
- try {
324
- await session.prompt("Summarize recent test failures");
325
- } finally {
326
- await session.dispose();
327
- }
328
- } finally {
329
- await database.close();
330
- }
331
- ```
332
-
333
- **Option B — `{ kind: "adapter" }` and `teamProfileSelection()`:**
334
-
335
- The `{ kind: "adapter" }` resolution rules are the same as PostgreSQL above (`atomic install npm:@bastani/atomic-storage-libsql`, `additionalExtensionPaths`, or resolved file path). For CI or team profiles, `teamProfileSelection()` builds a validated libSQL `storage` selection without touching `settings.json`:
336
-
337
- ```typescript
338
- import {
339
- createAgentSession,
340
- LIBSQL_ADAPTER_PACKAGE,
341
- teamProfileSelection,
342
- } from "@bastani/atomic";
343
-
344
- // Adapter selection
345
- {
346
- const { session } = await createAgentSession({
347
- sessionStore: {
348
- kind: "adapter",
349
- module: LIBSQL_ADAPTER_PACKAGE,
350
- options: { url: "libsql://<db>.turso.io" },
351
- secrets: { authToken: { env: "TURSO_AUTH_TOKEN" } },
352
- prefix: "app_",
353
- },
354
- });
355
- try {
356
- await session.prompt("Check release readiness");
357
- } finally {
358
- await session.dispose();
359
- }
360
- }
361
-
362
- // CI / team profile helper (libSQL / Turso only)
363
- // Pass exactly one of `token` (in-memory, redacted), `tokenEnv` (validated immediately), or `tokenFile`.
364
- {
365
- const storage = teamProfileSelection({
366
- profile: "ci",
367
- url: process.env.ATOMIC_TEAM_URL!,
368
- tokenEnv: "ATOMIC_TEAM_TOKEN",
369
- prefix: "ci_",
370
- });
371
- const { session } = await createAgentSession({ storage });
372
- try {
373
- await session.prompt("Run release checks");
374
- } finally {
375
- await session.dispose();
376
- }
377
- }
378
- ```
379
-
380
- See [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql) and [Team and CI setup](/guides/team-setup#from-the-sdk) for `sqld` checkpoints, retries, and CI environment variables.
297
+ > Atomic 0.10.11 removed libSQL and Turso support, including `@bastani/atomic-storage-libsql`, `teamProfileSelection()`, and `LIBSQL_ADAPTER_PACKAGE`. To move sessions off libSQL, see [Moving off libSQL](/storage#moving-off-libsql).
381
298
 
382
299
  ## `createAgentSessionRuntime()` and `SessionManager` with explicit stores
383
300
 
@@ -423,8 +340,8 @@ import { openNodeSqliteDatabase } from "@bastani/atomic/storage";
423
340
  const cwd = process.cwd();
424
341
  const agentDir = getAgentDir();
425
342
 
426
- // Swap openNodeSqliteDatabase() for openPostgresDatabase() or openLibsqlDatabase()
427
- // to run the exact same runtime against PostgreSQL or libSQL.
343
+ // Swap openNodeSqliteDatabase() for openPostgresDatabase()
344
+ // to run the exact same runtime against PostgreSQL.
428
345
  const database = await openNodeSqliteDatabase("./runtime-sessions.sqlite");
429
346
  try {
430
347
  const store = await SqlSessionStore.open(database, { prefix: "app_" });
@@ -529,7 +446,7 @@ When `createAgentSession()` chooses a session store, the first source set wins:
529
446
 
530
447
  1. `sessionManager` (caller-owned `SessionManager`).
531
448
  2. `sessionStore` (either a `SessionStore` instance or a tagged `StorageSelection`: `{ kind: "sqlite", path, prefix? }`, `{ kind: "jsonl", dir }`, `{ kind: "memory" }`, `{ kind: "database", database, prefix? }`, or `{ kind: "adapter", module, options?, secrets?, prefix? }`).
532
- 3. `storage` (`settings.json` shape: `{ path, prefix? }`, `{ database, prefix? }`, `{ memory: true }`, or `{ adapter, options?, secrets?, prefix? }` — also returned by `teamProfileSelection()`. Does not accept `{ dir }`; use `sessionStore: { kind: "jsonl", dir }` for JSONL).
449
+ 3. `storage` (`settings.json` shape: `{ path, prefix? }`, `{ database, prefix? }`, `{ memory: true }`, or `{ adapter, options?, secrets?, prefix? }`. Does not accept `{ dir }`; use `sessionStore: { kind: "jsonl", dir }` for JSONL).
533
450
  4. Process overrides (`ATOMIC_SESSIONS_STORAGE`, `ATOMIC_STORAGE`, `--storage`, `--storage-file`; see [Selecting storage per process](/storage#selecting-storage-per-process)).
534
451
  5. Settings (`sessions.storage`, then top-level `storage`).
535
452
  6. Default local SQLite (`~/.atomic/workflows/journal.sqlite`).
@@ -608,7 +525,6 @@ For the full list of storage error classes, cross-process `serializeStorageError
608
525
 
609
526
  - [Operator storage setup](/storage): PostgreSQL roles, TLS, proxies, poolers, migrations, `atomic storage` commands, and custom drivers.
610
527
  - [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres): PostgreSQL adapter options, cloud IAM, and SQL helpers.
611
- - [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql): Turso and self-hosted `sqld` adapter options and retry behavior.
612
528
  - [SDK overview](/sdk): `createAgentSession()`, workspaces, Intercom policies, and lifecycle hooks.
613
529
  - [SDK API reference](/sdk/reference): Full options, loaders, run modes, and exports.
614
530
  - [`SessionManager` API](/session-format#sessionmanager-api): Entry types, tree navigation, and session append methods.
@@ -234,7 +234,7 @@ console.log(result.value.category, result.model);
234
234
 
235
235
  `result.value` holds the schema-validated result, `result.model` identifies the candidate that answered, and `result.modelAttempts` records skipped and failed candidates when a fallback chain ran.
236
236
 
237
- `result.usage` reports chat token usage when a chat candidate produced the result (classifier billing is reported separately by the classifier operation). A schema-valid result does not guarantee policy compliance, so validate invariants before acting.
237
+ `result.usage` reports chat token usage when a chat candidate produced the result (classifier billing is reported separately by the classifier operation). A schema-valid result does not guarantee policy compliance, so check the result against your own rules before acting.
238
238
 
239
239
  The `structured_output` tool accepts required `instructions`, non-empty named `state`, and optional `model` and `fallbackModels` from the calling model. `createStructuredOutputTool({ schema })` fixes the output schema. The calling model cannot override the deadline; set it with `timeoutMs`. See [Structured output final results](/sdk/reference#structured-output-final-results).
240
240
 
@@ -31,7 +31,7 @@ const nextConfig: NextConfig = {
31
31
  export default nextConfig;
32
32
  ```
33
33
 
34
- Once `@bastani/atomic` is external, its dependencies load from `node_modules`. List any other Atomic packages your application imports directly, including [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) or [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql) when using remote SQL storage (see [SDK storage guide](/sdk/storage)).
34
+ Once `@bastani/atomic` is external, its dependencies load from `node_modules`. List any other Atomic packages your application imports directly, including [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) when using remote SQL storage (see [SDK storage guide](/sdk/storage)).
35
35
 
36
36
  Import TypeBox for custom tool schemas from `@bastani/atomic/typebox` (and its subpaths such as `/value`, `/compile`, and `/format`) rather than `typebox` directly so custom formats and settings share Atomic's TypeBox registry.
37
37
 
@@ -126,7 +126,7 @@ if (!state.shutdownRegistered) {
126
126
  }
127
127
  ```
128
128
 
129
- `SessionManager.inMemory()` keeps history in process memory. To persist conversations across restarts, pass a SQLite, JSONL, libSQL, or PostgreSQL `SessionManager` or `sessionStore` (see [SDK storage guide](/sdk/storage)). Call `closeConversation()` when a conversation finishes or goes idle, and run `closeAllConversations()` on `SIGTERM`/`SIGINT` so session stores and child processes close cleanly.
129
+ `SessionManager.inMemory()` keeps history in process memory. To persist conversations across restarts, pass a SQLite, JSONL, or PostgreSQL `SessionManager` or `sessionStore` (see [SDK storage guide](/sdk/storage)). Call `closeConversation()` when a conversation finishes or goes idle, and run `closeAllConversations()` on `SIGTERM`/`SIGINT` so session stores and child processes close cleanly.
130
130
 
131
131
  Sessions on `globalThis` live in one server process. Run this on a long-lived Node.js server with sticky routing per conversation if you scale to multiple instances; short-lived serverless functions discard process memory between requests.
132
132
 
@@ -278,7 +278,7 @@ Any route driving an agent session lets callers run tools with the server proces
278
278
  ## Next steps
279
279
 
280
280
  - [TypeScript SDK](/sdk): sessions, prompting, storage, and events.
281
- - [SDK storage guide](/sdk/storage): persist server sessions in SQLite, JSONL, libSQL, or PostgreSQL and wire `createAgentSessionRuntime()`.
281
+ - [SDK storage guide](/sdk/storage): persist server sessions in SQLite, JSONL, or PostgreSQL and wire `createAgentSessionRuntime()`.
282
282
  - [SDK API reference](/sdk/reference): every `createAgentSession()` option and export.
283
283
  - [Orchestration](/orchestration): multi-step workflows with codemode and subagents.
284
284
  - [Migrating workflows](/orchestration/migrating-workflows): replacing older workflow definitions.
package/docs/sdk.md CHANGED
@@ -8,7 +8,7 @@ Embed Atomic in Node.js applications (Node.js 24.20 or newer) to build custom UI
8
8
 
9
9
  - **Full options and exports:** [SDK API reference](/sdk/reference) (includes [Owner-bound task supervisor](/sdk/reference#owner-bound-task-supervisor), [Supervised command SDK](/sdk/reference#supervised-command-sdk), and [Task transcript references](/sdk/reference#task-transcript-references)).
10
10
  - **Typed decisions:** [Structured decisions API](/sdk/structured-decisions).
11
- - **Session storage:** [SDK storage guide](/sdk/storage) and [Storage backends](/storage).
11
+ - **Session storage:** [SDK storage guide](/sdk/storage) and [Storage](/storage).
12
12
  - **HTTP streaming servers:** [Embed Atomic in a web server](/sdk/web-server) (Next.js App Router guide).
13
13
  - **Compare modes:** [Programmatic integration](/programmatic).
14
14
 
@@ -146,7 +146,6 @@ Sessions default to local SQLite at `~/.atomic/workflows/journal.sqlite` with th
146
146
  | Local SQLite (default) | Built into `@bastani/atomic` (`@bastani/atomic/storage`) | `{ kind: "sqlite", path, prefix? }` or caller-owned `openNodeSqliteDatabase()` and `SqlSessionStore.open()` |
147
147
  | JSONL directory | Built into `@bastani/atomic` | `{ kind: "jsonl", dir }` or caller-owned `JsonlSessionStore.open()` |
148
148
  | In-memory | Built into `@bastani/atomic` | `new MemorySessionStore()` (caller-owned) or `{ kind: "memory" }` (discarded on `dispose()`) |
149
- | libSQL / Turso | [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql) | `{ kind: "adapter", module: LIBSQL_ADAPTER_PACKAGE, ... }` or caller-owned `openLibsqlDatabase()` |
150
149
  | PostgreSQL (16+ for sessions) | [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) | `{ kind: "adapter", module: POSTGRES_ADAPTER_PACKAGE, ... }` or caller-owned `openPostgresDatabase()` |
151
150
 
152
151
  Quick local SQLite session. Atomic opens the store and closes it in `dispose()`:
@@ -190,11 +189,11 @@ try {
190
189
  }
191
190
  ```
192
191
 
193
- - **`sessionStore` vs. `storage`:** `sessionStore` accepts a `SessionStore` instance (`SqlSessionStore`, `JsonlSessionStore`, `MemorySessionStore`) or a tagged selection (`{ kind: "sqlite" | "jsonl" | "memory" | "database" | "adapter", ... }`). `storage` uses the `settings.json` shape returned by `teamProfileSelection()` (`{ path, prefix? }`, `{ database, prefix? }`, `{ memory: true }`, or `{ adapter, options?, secrets?, prefix? }`) and does not support JSONL.
192
+ - **`sessionStore` vs. `storage`:** `sessionStore` accepts a `SessionStore` instance (`SqlSessionStore`, `JsonlSessionStore`, `MemorySessionStore`) or a tagged selection (`{ kind: "sqlite" | "jsonl" | "memory" | "database" | "adapter", ... }`). `storage` uses the `settings.json` shape (`{ path, prefix? }`, `{ database, prefix? }`, `{ memory: true }`, or `{ adapter, options?, secrets?, prefix? }`) and does not support JSONL.
194
193
  - **Precedence:** Atomic resolves storage in order from `sessionManager`, `sessionStore`, `storage`, process flags and variables (`ATOMIC_SESSIONS_STORAGE` and `ATOMIC_STORAGE`), settings (`sessions.storage` before `storage`), and default SQLite. Memory is never an automatic fallback.
195
194
  - **Ownership and mutations:** Atomic closes stores it opened from selection objects during `dispose()`, while leaving caller-owned `SessionStore`, `SessionManager`, and `database` instances open. Await every `SessionManager` write and every `atomic.appendEntry`, `setSessionName`, `setLabel`, `setThinkingLevel`, and `cycleThinkingLevel` call; there is no `flush()` method. `ExtensionContext.sessionSignal` aborts when reload or shutdown starts so extensions can cancel waits while finishing in-flight writes.
196
195
 
197
- See the **[SDK storage guide](/sdk/storage)** for all five backends, `createAgentSessionRuntime()` wiring, `SessionManager` CRUD, `JsonlSessionStore` `exactDirectory` behavior, `npm install` vs `atomic install` adapter resolution, ownership and close rules, and `StorageError` handling. For CLI session commands, the full `SessionManager` method list, operator setup, and cross-machine resume, see [Sessions](/sessions), [SessionManager API](/session-format#sessionmanager-api), [Storage backends](/storage), and [Resume on any machine](/guides/resume-on-any-machine).
196
+ See the **[SDK storage guide](/sdk/storage)** for all five backends, `createAgentSessionRuntime()` wiring, `SessionManager` CRUD, `JsonlSessionStore` `exactDirectory` behavior, `npm install` vs `atomic install` adapter resolution, ownership and close rules, and `StorageError` handling. For CLI session commands, the full `SessionManager` method list, operator setup, and cross-machine resume, see [Sessions](/sessions), [SessionManager API](/session-format#sessionmanager-api), [Storage](/storage), and [Resume on any machine](/guides/resume-on-any-machine).
198
197
 
199
198
  ### Human input without a terminal
200
199
 
@@ -572,6 +571,17 @@ When `npm install`, `pnpm add`, or `bun add` replaces `@bastani/atomic` while a
572
571
 
573
572
  Also restart after an in-place update if your process launched on an older Atomic release or before importing `@bastani/atomic/rpc-entry`.
574
573
 
574
+ ### Node 22 hosts
575
+
576
+ Atomic no longer runs on Node.js 22. It needs Node.js 24.20.0 or newer. To move a host off Node 22:
577
+
578
+ 1. Run `node --version` to see which version you have.
579
+ 2. Install the current Node.js 24 LTS release from [nodejs.org](https://nodejs.org/en/download), or with `nvm install 24`, `fnm install 24` or `mise use -g node@24`.
580
+ 3. Reinstall your project's dependencies with the new Node.js, for example with `npm install`.
581
+ 4. If you started your host with `node --experimental-async-context-frame` to make Node 22 faster, remove the flag. Node 24 doesn't need it and refuses to start with it.
582
+
583
+ See [Node.js version](/getting-started/installation#nodejs-version) for more on choosing a version.
584
+
575
585
  ### Migrating an existing Node host
576
586
 
577
587
  - **Builtins load automatically:** Remove manual registration of shipped builtin extensions; disable selectively with `builtins` and restrict tools with `tools` / `excludedTools` (`tools: []` excludes Intercom too).
package/docs/security.md CHANGED
@@ -92,7 +92,7 @@ Atomic enforces several local guardrails by default:
92
92
  - **SSRF blocking on URL reads.** `read` blocks `localhost`, `.localhost`, private IP ranges, cloud metadata endpoints, and redirects to them ([Documents and URLs](/tools#documents-and-urls)). Set `ATOMIC_ALLOW_PRIVATE_URL_READS=1` only when a workflow must read private URLs ([Environment variables](/environment-variables)). Bundled `@bastani/web-access` also keeps local or intranet hosts and credentialed URLs out of remote fallbacks ([Web access](/web-access)).
93
93
  - **Opt-in browser cookies.** Gemini Web cookie lookup is disabled by default and activates only when you set `allowBrowserCookies: true` in `~/.atomic/web-search.json` or `ATOMIC_ALLOW_BROWSER_COOKIES=1` ([Web access](/web-access)).
94
94
  - **Worktree snapshot secret deny list.** [Worktree snapshots](/worktree-snapshots) exclude `.env*`, `*.pem`, `*.key`, `*.p12`, `*.pfx`, `credentials`, `credentials.json`, `.netrc`, `_netrc`, `.git-credentials`, `.pgpass`, and private SSH key files before `.atomic/snapshot-ignore` or Git staging. This deny list cannot be overridden ([What is left out](/worktree-snapshots#what-is-left-out)).
95
- - **Storage credentials and process overrides.** Shared storage rejects credentials embedded in URLs and saves static tokens in mode-`600` files. Process-level storage overrides (`--storage`, `--storage-file`, `ATOMIC_STORAGE`, `ATOMIC_SESSIONS_STORAGE`, `ATOMIC_PROFILE=ci`) come from the launching host and bypass project trust ([Selecting storage per process](/storage#selecting-storage-per-process)).
95
+ - **Storage credentials and process overrides.** Shared storage rejects credentials embedded in URLs and saves static tokens in mode-`600` files. Process-level storage overrides (`--storage`, `--storage-file`, `ATOMIC_STORAGE`, `ATOMIC_SESSIONS_STORAGE`) come from the launching host and bypass project trust ([Selecting storage per process](/storage#selecting-storage-per-process)).
96
96
  - **Session sharing and debug snapshots.** `/share` uploads a private GitHub gist and strips worktree snapshots and large tool-output blobs, while keeping the rest of the transcript ([Exporting and sharing sessions](/usage#exporting-and-sharing-sessions)). `/debug` writes all current session messages unredacted to `~/.atomic/agent/atomic-debug.log` ([Diagnostics and debugging](/development#debugging)).
97
97
 
98
98
  ## Running untrusted or unattended work
@@ -4,7 +4,7 @@ sidebarTitle: "Session format"
4
4
  description: "Format-4 JSONL session schema, message and entry types, context rebuilding rules, and the SessionManager API."
5
5
  ---
6
6
 
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), [Storage backends](/storage), and [SDK session storage](/sdk/storage) to choose or open 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), [Storage](/storage), and [SDK session storage](/sdk/storage) to choose or open a store.
8
8
 
9
9
  In JSONL, each line is a JSON object with a `type` field. Session entries form a tree through `id` and `parentId`.
10
10
 
@@ -446,7 +446,7 @@ Repository state of one checkout at the end of a turn that ran a file-writing to
446
446
 
447
447
  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.
448
448
 
449
- 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.
449
+ 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.
450
450
 
451
451
  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.
452
452
 
@@ -540,7 +540,7 @@ for (const line of lines) {
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
- `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, libSQL, JSONL, or memory stores, see [SDK session storage](/sdk/storage), [Storage backends](/storage), and [Session management](/sdk/reference#session-management).
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
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.
546
546
 
@@ -550,8 +550,8 @@ By default, opening an existing session loads only the active tail window (entri
550
550
 
551
551
  - `SessionManager.create(cwd, sessionDir?, options?)`: create a new session in configured storage, or in flat-layout JSONL when `sessionDir` is provided.
552
552
  - `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, PostgreSQL, and libSQL 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.
554
- - `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, PostgreSQL, or libSQL session ID.
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.
554
+ - `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
555
  - `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
556
  - `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.
557
557
  - `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?)`.