@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
@@ -1,4 +1,4 @@
1
- import type { SqliteDatabase, SqliteExecutor } from "../database.js";
1
+ import type { SqliteDatabase, SqliteExecutor, SqliteStatement } from "../database.js";
2
2
  import type { SessionSearchCoverage, SessionSearchExtendOptions, SessionSearchIndex, SessionSearchText } from "./types.js";
3
3
  import { yieldTurn } from "./yield-turn.js";
4
4
  export { yieldTurn };
@@ -10,6 +10,24 @@ export declare const SESSION_SEARCH_TABLES: Readonly<{
10
10
  trigrams: "search_trgm";
11
11
  entriesForget: "entries_search_forget";
12
12
  }>;
13
+ /**
14
+ * The ledger step, `schema:session-search-tuning`, that gives an existing PostgreSQL trigram index the pending-list
15
+ * limit below and its entries table the autovacuum settings below.
16
+ */
17
+ export declare const SESSION_SEARCH_TUNING_DOMAIN = "session-search-tuning";
18
+ /**
19
+ * The PostgreSQL trigram index's `gin_pending_list_limit`, in kB: 64 MB rather than the server's default 4 MB. An insert
20
+ * that finds the pending list over this limit merges the whole list into the index itself, inside its transaction and
21
+ * the session's lock; the background merge (`SEARCH_PENDING_MERGE_CHARS`) and autovacuum keep the list far below it.
22
+ */
23
+ export declare const SEARCH_PENDING_LIST_LIMIT_KB = 65536;
24
+ /**
25
+ * The characters of search text one search index writes on PostgreSQL between background merges of the trigram
26
+ * index's pending list (`gin_clean_pending_list`): about 1 MB of pending list for text with many distinct trigrams.
27
+ * A merge empties the list of every writer's text, so with many processes writing, the list holds about this much
28
+ * text between merges whatever their number.
29
+ */
30
+ export declare const SEARCH_PENDING_MERGE_CHARS = 131072;
13
31
  export declare const SEARCH_PART_CHARS = 4096;
14
32
  export declare const SEARCH_PART_OVERLAP = 512;
15
33
  export declare const MAX_INDEXED_ENTRY_CHARS: number;
@@ -25,6 +43,12 @@ export declare class SqlSessionSearchIndex implements SessionSearchIndex {
25
43
  private readonly tables;
26
44
  private readonly engine;
27
45
  private writesPrepared;
46
+ /** Characters of search text written since the last background merge of the pending list began. */
47
+ private pendingChars;
48
+ /** The background merge of the pending list in flight, if any. */
49
+ private merging;
50
+ /** False once a merge found that this role may not merge the pending list, which autovacuum then merges. */
51
+ private mayMerge;
28
52
  private constructor();
29
53
  static open(database: SqliteDatabase, sessionTables: SessionTables, prefix: string | undefined): Promise<SqlSessionSearchIndex | undefined>;
30
54
  private static tablesExist;
@@ -32,12 +56,27 @@ export declare class SqlSessionSearchIndex implements SessionSearchIndex {
32
56
  forgetWithin(tx: SqliteExecutor, sessionId: string): Promise<void>;
33
57
  coverage(sessionId: string, format: number): Promise<SessionSearchCoverage | undefined>;
34
58
  extend(sessionId: string, format: number, afterSeq: number, throughSeq: number, texts: readonly SessionSearchText[], options?: SessionSearchExtendOptions): Promise<boolean>;
59
+ /**
60
+ * Counts `chars` of search text a committed write added, and once `SEARCH_PENDING_MERGE_CHARS` of them have, starts a
61
+ * background merge of the pending list, which this write and the writes after it do not wait for. So no write merges
62
+ * the list inside its transaction, which holds the session's lock (PostgreSQL only).
63
+ */
64
+ private notePendingChars;
35
65
  private mergeBacklog;
36
66
  /**
37
- * A write of the session `sessionId`'s index rows: the session's own domain, which the session store's writers take,
38
- * since `replace` and `delete` forget a session's index in their own transactions.
67
+ * A write of the session `sessionId`'s index rows, in the domain of that session's index rather than the session's
68
+ * own: saves to the session, which take the session's domain, run beside it. A rewrite of the session, which forgets
69
+ * its index, takes this domain too ({@link writeLock}), so an index write commits wholly before the rewrite reads
70
+ * the index or starts after it commits, and its checks then see the rewrite. `delete` holds the whole database.
71
+ */
72
+ private searchWrite;
73
+ private searchDomain;
74
+ /**
75
+ * On PostgreSQL, the statement that takes, inside a transaction of the session's own domain, the advisory lock index
76
+ * writes of the session `sessionId` hold ({@link searchWrite}), keyed as the driver keys a domain's lock. A rewrite
77
+ * runs it before it touches the index. Undefined where transactions do not run beside each other.
39
78
  */
40
- private sessionWrite;
79
+ writeLock(sessionId: string): SqliteStatement | undefined;
41
80
  private writeTransaction;
42
81
  candidates(sessionId: string, anyOf: readonly (readonly string[])[], fromSeq: number, toSeq: number, limit: number, generation?: string, signal?: AbortSignal): Promise<readonly number[] | undefined>;
43
82
  }
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using session storage.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using session storage.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using session storage.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using session storage.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -1,6 +1,6 @@
1
1
  import "../../../_shared/rolldown-runtime-BGM3D5V3.js";
2
2
  import { getBranchPath } from "../../../_shared/startup-0-3-4ZYBYQNM.js";
3
- import { ChildCatalog } from "../../../_shared/startup-0-1-7T2IAE7J.js";
3
+ import { ChildCatalog } from "../../../_shared/startup-0-1-RTOHJFDJ.js";
4
4
  import { assertSnapshotCut, foldSessionResume, lastBranchAnswer, sessionResumeOf, snapshotChunk, snapshotHead, snapshotPage, snapshotStamp, transcriptBranchSpan } from "../../../_shared/startup-8-0-34CBHPZH.js";
5
5
  // dist/core/storage/session/snapshot-history.js
6
6
  async function snapshotWindow(store, sessionId, leaf, through, expected, isProxy) {
@@ -66,7 +66,7 @@ function __atomicOnDemandFailed(error, feature) {
66
66
  return (async () => {
67
67
  const root = new URL("../../../", import.meta.url);
68
68
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
69
- const key = `${root.href}#0.10.11-alpha.2`;
69
+ const key = `${root.href}#0.10.11-alpha.3`;
70
70
  let release = releases.get(key);
71
71
  if (release === undefined) {
72
72
  const current = (async () => {
@@ -94,7 +94,7 @@ function __atomicOnDemandFailed(error, feature) {
94
94
  } catch {
95
95
  // No installation to read, as in a bundle of the package: the release the process runs decides.
96
96
  }
97
- const updatedTo = typeof installed === "string" && installed !== "0.10.11-alpha.2" ? installed : running !== undefined && running.version !== "0.10.11-alpha.2" ? "0.10.11-alpha.2" : undefined;
97
+ const updatedTo = typeof installed === "string" && installed !== "0.10.11-alpha.3" ? installed : running !== undefined && running.version !== "0.10.11-alpha.3" ? "0.10.11-alpha.3" : undefined;
98
98
  if (updatedTo === undefined) throw error;
99
99
  const application = typeof running?.name === "string" ? running.name : "atomic";
100
100
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using session storage.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using session storage.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using session storage.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using session storage.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -1,3 +1,3 @@
1
1
  import "../../../_shared/rolldown-runtime-BGM3D5V3.js";
2
- export { LISTING_FETCH_BATCH, SESSION_APPEND_FUNCTION_DOMAIN, SESSION_BLOB_CHUNK_BYTES, SESSION_DOMAIN, SESSION_ENTRY_CHUNK_BYTES, SESSION_FILLFACTOR_DOMAIN, SESSION_PRESENCE_DOMAIN, SESSION_PRESENCE_TABLES, SESSION_READ_FETCH, SESSION_READ_PAGE_CHARS, SESSION_RESUME_REBUILD, SESSION_SCHEMA_VERSION, SESSION_SCHEMA_VERSION_CHUNKED, SESSION_SCHEMA_VERSION_SHARED_HISTORY, SESSION_TABLES, SqlSessionStore } from "../../../_shared/sdk-IQMULKFU.js";
2
+ export { LISTING_FETCH_BATCH, SESSION_APPEND_FUNCTION_DOMAIN, SESSION_BLOB_CHUNK_BYTES, SESSION_DOMAIN, SESSION_ENTRY_CHUNK_BYTES, SESSION_FILLFACTOR_DOMAIN, SESSION_PRESENCE_DOMAIN, SESSION_PRESENCE_TABLES, SESSION_READ_FETCH, SESSION_READ_PAGE_CHARS, SESSION_RESUME_REBUILD, SESSION_SCHEMA_VERSION, SESSION_SCHEMA_VERSION_CHUNKED, SESSION_SCHEMA_VERSION_SHARED_HISTORY, SESSION_TABLES, SqlSessionStore } from "../../../_shared/sdk-B5LEWGGI.js";
3
3
  //# sourceMappingURL=sql-session-store.code.js.map
@@ -104,12 +104,16 @@ export declare class SqlSessionStore implements SessionStore {
104
104
  private chatStore?;
105
105
  /** The database's reader handle, once a read opened it: see `readerDatabase`. */
106
106
  private reader?;
107
+ /** Each session's writes this store started and has not finished, each settled as its write is: see `writing`. */
108
+ private readonly unfinishedWrites;
107
109
  /** The sessions schema version each transaction read first, by its handle: see `sharedHistoryForks`. */
108
110
  private readonly schemaVersions;
109
111
  /** The fork tables under this store's prefix, which exist once its sessions schema is version 3 (#6560). */
110
112
  private readonly forkTables;
111
113
  /** See {@link forkLinks}. */
112
114
  private forkLinkStatements?;
115
+ /** See {@link entryLinks}. */
116
+ private entryLinkStatements?;
113
117
  /**
114
118
  * Whether a read of this store found its sessions schema at {@link SESSION_SCHEMA_VERSION_SHARED_HISTORY}: one way,
115
119
  * as the switch is. A read outside a transaction reads sessions through their views once it is set, and before that
@@ -122,11 +126,6 @@ export declare class SqlSessionStore implements SessionStore {
122
126
  private readonly forkedSessions;
123
127
  /** The sessions each recently forked session's segments named when this store last read them (#6560). */
124
128
  private readonly forkSources;
125
- /**
126
- * Absent on a local libSQL file, which then behaves as before: @libsql/client waits for another process's write
127
- * lock on the calling thread, even to begin a transaction, so a side write would stop the event loop where an
128
- * ordinary turn-ending notice writes nothing (#5682).
129
- */
130
129
  get chatRecords(): SqlSessionChatRecords | undefined;
131
130
  private readonly entryByteLength;
132
131
  private chunkRowids?;
@@ -190,10 +189,19 @@ export declare class SqlSessionStore implements SessionStore {
190
189
  */
191
190
  private sessionWrite;
192
191
  /**
193
- * `transaction` for a body that only reads, in one read-only snapshot, on the database's reader handle when it
194
- * offers one: its reads then wait for neither the writes queued on this store's connection nor their locks.
192
+ * `transaction` for a body that only reads session `sessionId`, in one read-only snapshot, on the database's reader
193
+ * handle when it offers one: its reads then wait for neither the writes queued on this store's connection nor their
194
+ * locks. It first waits for the writes of that session this store started and has not finished (`writing`), so a
195
+ * caller that starts a write and then reads, without awaiting the write, reads it as the store's own connection would
196
+ * have; with none unfinished it waits for nothing.
195
197
  */
196
198
  private readTransaction;
199
+ /**
200
+ * `write`, a write of session `sessionId` this store has just started, kept in `unfinishedWrites` until it settles,
201
+ * for the reads of the session that start meanwhile to wait for (`readTransaction`). No write waits for a read, and
202
+ * no write of this store reads through `readTransaction`, so the wait never comes back to the write.
203
+ */
204
+ private writing;
197
205
  /**
198
206
  * The database's reader handle, opened at the first read and closed with the store; the database without one. A
199
207
  * reader that cannot open, such as when its file can no longer be opened anew, leaves the read on the store's own
@@ -295,9 +303,30 @@ export declare class SqlSessionStore implements SessionStore {
295
303
  private static switchAtOpen;
296
304
  get descriptor(): StorageDescriptor;
297
305
  create(header: SessionRecordHeader, entries: readonly SessionEntry[]): Promise<SessionWriteResult>;
306
+ private writeCreate;
307
+ /**
308
+ * The read that begins a transaction writing a new session `id`, by `create` or by a fork: whether it exists and, where
309
+ * this store has seen shared history, whether a deleted session with this ID left rows forks still read, in the same
310
+ * statement.
311
+ */
312
+ private newSessionRead;
313
+ /**
314
+ * In the transaction that writes a new session `id`, before its writes, given what {@link newSessionRead} found:
315
+ * refuses a session that exists. Where a deleted session with this ID left rows forks still read, those forks get
316
+ * their own copies first and the rows go, so the new session starts empty and their sweep never takes its rows. A
317
+ * fork whose copy a missing source chunk refuses keeps the old rows, and the new session is refused with it.
318
+ */
319
+ private startNewSession;
320
+ /**
321
+ * {@link startNewSession} for a fork with shared history, once it has read its donor: resolves with the donor. A donor
322
+ * that read the rows a deleted session with the child's ID left holds its own copy of them now, in segments of its
323
+ * own, and is read again (#6560).
324
+ */
325
+ private startSharedFork;
298
326
  createFork(header: SessionRecordHeader, entries: SessionForkSeed, source: ForkArchiveSource): Promise<(SessionWriteResult & {
299
327
  remainingBlobs?: readonly string[];
300
328
  }) | undefined>;
329
+ private writeCreateFork;
301
330
  /**
302
331
  * A fork from the entries a caller holds. Where the database has shared history (#6560) and the source is still in
303
332
  * the generation the fork read it in, every entry the store read from the source and the caller kept unchanged, and
@@ -354,6 +383,7 @@ export declare class SqlSessionStore implements SessionStore {
354
383
  createStagedFork(header: SessionRecordHeader, stream: SessionForkStream, source: ForkArchiveSource): Promise<SessionWriteResult & {
355
384
  readonly remainingBlobs: readonly string[];
356
385
  }>;
386
+ private writeCreateStagedFork;
357
387
  /**
358
388
  * Creates the fork staging table unless it exists, as `atomic storage migrate` does as the owner role (#5594): a
359
389
  * runtime role without DDL privileges then stages bounded clones too. Opens never create it.
@@ -371,6 +401,8 @@ export declare class SqlSessionStore implements SessionStore {
371
401
  private forkHost;
372
402
  /** The statements that link the entries a session with fork segments stores, as a copy links them (#6560). */
373
403
  private forkLinks;
404
+ /** How the snapshot index links a materialization's copies and a fork moved onto another copy (#6560). */
405
+ private entryLinks;
374
406
  /**
375
407
  * @internal Gives every fork that shares history with `sessionId` its own copy of what it reads, so the session's
376
408
  * rows no longer stay for them; see fork-detach.ts. Detaches a crash stopped are finished first. Nothing to do where
@@ -425,9 +457,10 @@ export declare class SqlSessionStore implements SessionStore {
425
457
  private lineageTables;
426
458
  /**
427
459
  * The reads that begin a fork of session `donor` into `child` with shared history (#6560), in order: whether the child
428
- * exists; the rows of the donor and of the sessions its segments name, as the statement starts or as this store last
429
- * saw them, each locked `key-share` in id order, unless the child exists, with the donor's watermark and generation,
430
- * and with `withState` its summary state; then the donor's segments, read once those locks are held.
460
+ * exists; the tombstones of the deleted sessions among the donor's sources, locked `key-share`; the rows of the donor
461
+ * and of the sessions its segments name, as the statement starts or as this store last saw them, each locked
462
+ * `key-share` in id order, unless the child exists, with the donor's watermark and generation, and with `withState`
463
+ * its summary state; then the donor's segments, read once those locks are held.
431
464
  */
432
465
  private sharedForkReads;
433
466
  /**
@@ -455,6 +488,7 @@ export declare class SqlSessionStore implements SessionStore {
455
488
  append(sessionId: string, entries: readonly SessionEntry[], options: SessionWriteOptions): Promise<{
456
489
  readonly lastSeq: number;
457
490
  }>;
491
+ private writeAppend;
458
492
  /**
459
493
  * Remembers `row`, the session's row a committed write of this store left, for the next append to plan from, where
460
494
  * appends go through the append function; forgets the session's row when `row` is undefined. At most
@@ -489,11 +523,14 @@ export declare class SqlSessionStore implements SessionStore {
489
523
  */
490
524
  prepareAppendFunction(): Promise<void>;
491
525
  replace(sessionId: string, header: SessionRecordHeader, entries: readonly SessionEntry[], options: SessionWriteOptions): Promise<SessionWriteResult>;
526
+ private writeReplace;
492
527
  updateHeader(header: SessionRecordHeader, options: SessionWriteOptions): Promise<SessionWriteResult>;
528
+ private writeUpdateHeader;
493
529
  load(sessionId: string): Promise<SessionSnapshot>;
494
530
  readEntryRange(sessionId: string, query: SessionEntriesQuery): Promise<SessionEntriesPage>;
495
531
  readHeader(sessionId: string): Promise<SessionRecordHeader | undefined>;
496
532
  delete(sessionId: string): Promise<void>;
533
+ private writeDelete;
497
534
  /**
498
535
  * The fork history of `sessionId` where the transaction `tx` runs on shared history: through `reads`, the transaction's
499
536
  * leading reads, or, for a store that had not seen shared history when the transaction began, read now.
@@ -675,7 +712,7 @@ export declare class SqlSessionStore implements SessionStore {
675
712
  readScanPage(sessionId: string, startSeq: number, endSeq: number, epoch: string | undefined, limit: number, options?: SessionScanOptions): Promise<SessionScanPage>;
676
713
  /**
677
714
  * A condition on an entries row that holds for every entry `select` selects (and more): an entry larger than a page;
678
- * on SQLite and libSQL, a message whose stored type and role say it is a tool result, or an assistant message with a
715
+ * on SQLite, a message whose stored type and role say it is a tool result, or an assistant message with a
679
716
  * tool call named other than `exceptCalls`, and any row that is not valid JSON; on Postgres, which would parse each
680
717
  * row's JSON to read those, any row whose JSON holds a tool call block's `"toolCall"` or a result's `"toolResult"`,
681
718
  * which `JSON.stringify`, the only writer of a row, always writes as such (it never escapes a letter).
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using session storage.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using session storage.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using session storage.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using session storage.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using /tree.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using /tree.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using /tree.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using /tree.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using /tree.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using /tree.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -6,7 +6,7 @@ try {
6
6
  } catch (error) {
7
7
  const root = new URL("../../../", import.meta.url);
8
8
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
9
- const key = `${root.href}#0.10.11-alpha.2`;
9
+ const key = `${root.href}#0.10.11-alpha.3`;
10
10
  let release = releases.get(key);
11
11
  if (release === undefined) {
12
12
  const current = (async () => {
@@ -27,8 +27,8 @@ try {
27
27
  release = current;
28
28
  }
29
29
  const running = await release;
30
- if (running === undefined || running.version === "0.10.11-alpha.2") throw error;
31
- throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.2 while this session was running; restart it to keep using /tree.", {
30
+ if (running === undefined || running.version === "0.10.11-alpha.3") throw error;
31
+ throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11-alpha.3 while this session was running; restart it to keep using /tree.", {
32
32
  cause: error,
33
33
  });
34
34
  }
@@ -63,6 +63,11 @@ export interface SqliteDriverTransactionOptions {
63
63
  * row it returns, instead of with the begin.
64
64
  */
65
65
  readonly lockIfLeadingFinds?: boolean;
66
+ /**
67
+ * Optional. `SqliteTransactionOptions.relaxedDurability`, never set on a read-only transaction: the driver may answer
68
+ * the commit before the transaction reaches disk.
69
+ */
70
+ readonly relaxedDurability?: boolean;
66
71
  }
67
72
  /** The driver calls `createSqliteDatabase` turns into a `SqliteDatabase`. */
68
73
  export interface SqliteDriver extends SqliteDriverExecutor {
@@ -142,7 +147,7 @@ export interface SqliteDriver extends SqliteDriverExecutor {
142
147
  /**
143
148
  * Optional. The bytes this process may still write on the file system that holds the database's file, or undefined
144
149
  * when the file system does not say; the facade exposes it as `SqliteDatabase.freeBytes`. Provide it only for a
145
- * database in a file this process can see, such as a local SQLite or libSQL file.
150
+ * database in a file this process can see, such as a local SQLite file.
146
151
  */
147
152
  freeBytes?(): Awaitable<number | undefined>;
148
153
  /**
@@ -830,6 +830,7 @@ class DriverDatabase {
830
830
  : {}),
831
831
  // `leading` holds the first statement whenever it holds any.
832
832
  ...(options?.lockIfLeadingFinds === true && leading.length > 0 ? { lockIfLeadingFinds: true } : {}),
833
+ ...(options?.relaxedDurability === true && options.readOnly !== true ? { relaxedDurability: true } : {}),
833
834
  };
834
835
  const run = () => this.retrying((attempt) => this.runTransaction(callback, attempt, begin), replay);
835
836
  const concurrentWrites = this.driver.concurrentTransactions === true;