@bastani/atomic 0.10.18-alpha.1 → 0.10.18

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 (237) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +2 -2
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +2 -2
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +2 -2
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/sdk-OHKMDJ74.js +9 -10
  10. package/dist/_shared/sdk-OHKMDJ74.js.map +1 -1
  11. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  12. package/dist/_shared/startup-0-0-OV6RAEAP.js +2 -2
  13. package/dist/_shared/startup-0-1-EZAJI6RE.js +2 -2
  14. package/dist/_shared/startup-0-2-YZZOC22D.js +2 -2
  15. package/dist/_shared/startup-0-3-DE2NCS6A.js +2 -2
  16. package/dist/_shared/startup-0-4-ZMJV547D.js +4 -3
  17. package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -1
  18. package/dist/_shared/startup-0-5-HZX3ZPTP.js +3 -5
  19. package/dist/_shared/startup-0-5-HZX3ZPTP.js.map +1 -1
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +2 -2
  21. package/dist/_shared/startup-15-1-4S7FLMNG.js +2 -2
  22. package/dist/_shared/startup-8-0-34CBHPZH.js +2 -2
  23. package/dist/_shared/startup-8-1-LZFXSD3Z.js +2 -2
  24. package/dist/_shared/storage-command-7MGXLJGZ.js +72 -8
  25. package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
  26. package/dist/_shared/storage-status-K7PX2RXA.js +2 -2
  27. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  28. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  29. package/dist/builtin/intercom/broker/broker.bundle.mjs +158 -78
  30. package/dist/builtin/intercom/broker/multinode-router.ts +41 -8
  31. package/dist/builtin/intercom/broker/multinode-state-store.ts +6 -1
  32. package/dist/builtin/intercom/broker/sql-lease-store.ts +89 -80
  33. package/dist/builtin/intercom/broker/sql-pending-ask-store.ts +65 -6
  34. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  35. package/dist/builtin/intercom/package.json +1 -1
  36. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  37. package/dist/builtin/mcp/package.json +1 -1
  38. package/dist/builtin/subagents/package.json +1 -1
  39. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  40. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  41. package/dist/builtin/web-access/package.json +1 -1
  42. package/dist/cli/auth-cli.impl.js +3 -3
  43. package/dist/cli/auth-cli.js +3 -3
  44. package/dist/cli/blueprint-command.impl.js +3 -3
  45. package/dist/cli/blueprint-command.js +3 -3
  46. package/dist/cli/intercom-command.code.js +2 -2
  47. package/dist/cli/intercom-command.impl.js +3 -3
  48. package/dist/cli/intercom-command.js +3 -3
  49. package/dist/cli/list-models.impl.js +3 -3
  50. package/dist/cli/list-models.js +3 -3
  51. package/dist/cli/session-picker.impl.js +3 -3
  52. package/dist/cli/session-picker.js +3 -3
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.impl.js +3 -3
  58. package/dist/cli/storage-search-session.js +3 -3
  59. package/dist/cli/team-command.impl.js +3 -3
  60. package/dist/cli/team-command.js +3 -3
  61. package/dist/cli.js +2 -2
  62. package/dist/core/debug.impl.js +3 -3
  63. package/dist/core/debug.js +3 -3
  64. package/dist/core/export-html/card-projection.impl.js +3 -3
  65. package/dist/core/export-html/card-projection.js +3 -3
  66. package/dist/core/export-html/index.code.js +2 -2
  67. package/dist/core/export-html/index.impl.js +3 -3
  68. package/dist/core/export-html/index.js +3 -3
  69. package/dist/core/export-html/json-spans.impl.js +3 -3
  70. package/dist/core/export-html/json-spans.js +3 -3
  71. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  72. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  73. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  74. package/dist/core/export-html/tool-renderer.js +3 -3
  75. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  76. package/dist/core/extensions/jiti-loader.js +3 -3
  77. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  78. package/dist/core/extensions/jiti-static-loader.js +3 -3
  79. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  80. package/dist/core/extensions/loader-host-modules.js +3 -3
  81. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  82. package/dist/core/intercom-broker-control-host.js +3 -3
  83. package/dist/core/intercom-broker-control.code.js +2 -2
  84. package/dist/core/intercom-broker-control.impl.js +3 -3
  85. package/dist/core/intercom-broker-control.js +3 -3
  86. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  87. package/dist/core/package-manager-storage-adapters.js +3 -3
  88. package/dist/core/sdk.impl.js +3 -3
  89. package/dist/core/sdk.js +3 -3
  90. package/dist/core/session-manager-core.js +2 -2
  91. package/dist/core/session-manager-list.impl.js +3 -3
  92. package/dist/core/session-manager-list.js +3 -3
  93. package/dist/core/session-manager.impl.js +3 -3
  94. package/dist/core/session-manager.js +3 -3
  95. package/dist/core/session-storage.impl.js +3 -3
  96. package/dist/core/session-storage.js +3 -3
  97. package/dist/core/storage/database.d.ts +6 -2
  98. package/dist/core/storage/database.js.map +1 -1
  99. package/dist/core/storage/fenced-paths.d.ts +15 -0
  100. package/dist/core/storage/fenced-paths.js +25 -0
  101. package/dist/core/storage/fenced-paths.js.map +1 -1
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/migrations.d.ts +2 -11
  104. package/dist/core/storage/migrations.js +2 -9
  105. package/dist/core/storage/migrations.js.map +1 -1
  106. package/dist/core/storage/node-sqlite-thread.js +2 -2
  107. package/dist/core/storage/node-sqlite.js +2 -2
  108. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  109. package/dist/core/storage/offline-snapshot-file.js +3 -3
  110. package/dist/core/storage/postgres-locks.d.ts +11 -0
  111. package/dist/core/storage/postgres-locks.js +9 -0
  112. package/dist/core/storage/postgres-locks.js.map +1 -0
  113. package/dist/core/storage/provider.js +2 -2
  114. package/dist/core/storage/selection.js +2 -2
  115. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  116. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  117. package/dist/core/storage/session/branch-fork-source.js +3 -3
  118. package/dist/core/storage/session/card-view.impl.js +3 -3
  119. package/dist/core/storage/session/card-view.js +3 -3
  120. package/dist/core/storage/session/child-reader.code.js +2 -2
  121. package/dist/core/storage/session/child-reader.impl.js +3 -3
  122. package/dist/core/storage/session/child-reader.js +3 -3
  123. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  124. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  125. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  126. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  127. package/dist/core/storage/session/expanded-child-details.js +3 -3
  128. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  129. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  130. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  131. package/dist/core/storage/session/fork-row-index.js +3 -3
  132. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  133. package/dist/core/storage/session/fork-staging.js +3 -3
  134. package/dist/core/storage/session/fork-window.code.js +2 -2
  135. package/dist/core/storage/session/fork-window.impl.js +3 -3
  136. package/dist/core/storage/session/fork-window.js +3 -3
  137. package/dist/core/storage/session/history-pages.impl.js +3 -3
  138. package/dist/core/storage/session/history-pages.js +3 -3
  139. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  140. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  141. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  142. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  143. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  144. package/dist/core/storage/session/memory-session-store.js +3 -3
  145. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  146. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  147. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  148. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  149. package/dist/core/storage/session/released-history-files.js +3 -3
  150. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  151. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  152. package/dist/core/storage/session/session-resume.impl.js +3 -3
  153. package/dist/core/storage/session/session-resume.js +3 -3
  154. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  155. package/dist/core/storage/session/snapshot-cut.js +3 -3
  156. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  157. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  158. package/dist/core/storage/session/snapshot-history.js +3 -3
  159. package/dist/core/storage/session/sql-session-store.d.ts +1 -1
  160. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  161. package/dist/core/storage/session/sql-session-store.js +3 -3
  162. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  163. package/dist/core/storage/session/tree-outline.js +3 -3
  164. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  165. package/dist/core/storage/session/tree-presentation.js +3 -3
  166. package/dist/core/storage/sqlite-facade.js +6 -4
  167. package/dist/core/storage/sqlite-facade.js.map +1 -1
  168. package/dist/core/storage/storage-status.impl.js +3 -3
  169. package/dist/core/storage/storage-status.js +3 -3
  170. package/dist/core/storage/team.impl.js +3 -3
  171. package/dist/core/storage/team.js +3 -3
  172. package/dist/core/structured-output/index.impl.js +3 -3
  173. package/dist/core/structured-output/index.js +3 -3
  174. package/dist/core/tasks/heartbeat-notice.d.ts +0 -1
  175. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  176. package/dist/core/tasks/task-completion-entry.js +3 -3
  177. package/dist/core/tasks/task-file-history.code.js +2 -2
  178. package/dist/core/tasks/task-file-history.impl.js +3 -3
  179. package/dist/core/tasks/task-file-history.js +3 -3
  180. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  181. package/dist/core/tasks/task-reference-archive.js +3 -3
  182. package/dist/core/tasks/task-reference-identity.js +3 -3
  183. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  184. package/dist/core/tasks/task-reference-stream.js +3 -3
  185. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  186. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  187. package/dist/core/tasks/task-view-source.impl.js +3 -3
  188. package/dist/core/tasks/task-view-source.js +3 -3
  189. package/dist/core/tools/read-url.impl.js +3 -3
  190. package/dist/core/tools/read-url.js +3 -3
  191. package/dist/core/worktree-snapshot/blob-store.d.ts +14 -16
  192. package/dist/core/worktree-snapshot/blob-store.js +194 -81
  193. package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
  194. package/dist/core/worktree-snapshot/collection-claim.js +8 -0
  195. package/dist/core/worktree-snapshot/collection-claim.js.map +1 -0
  196. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  197. package/dist/core/worktree-snapshot/errors.js +3 -3
  198. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  199. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  200. package/dist/core/worktree-snapshot/snapshot-epoch-migration.js +209 -0
  201. package/dist/core/worktree-snapshot/snapshot-epoch-migration.js.map +1 -0
  202. package/dist/core/worktree-snapshot/snapshot-epoch.js +100 -0
  203. package/dist/core/worktree-snapshot/snapshot-epoch.js.map +1 -0
  204. package/dist/extensions/codemode/execute.impl.js +3 -3
  205. package/dist/extensions/codemode/execute.js +3 -3
  206. package/dist/extensions/codemode/renderer.impl.js +3 -3
  207. package/dist/extensions/codemode/renderer.js +3 -3
  208. package/dist/extensions/mcp/cli.impl.js +3 -3
  209. package/dist/extensions/mcp/cli.js +3 -3
  210. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  211. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  212. package/dist/extensions/mcp/cli.lazy.js +3 -3
  213. package/dist/extensions/mcp/runtime.impl.js +3 -3
  214. package/dist/extensions/mcp/runtime.js +3 -3
  215. package/dist/main-first-time-setup.impl.js +3 -3
  216. package/dist/main-first-time-setup.js +3 -3
  217. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  218. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  219. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  220. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  221. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  222. package/dist/package-manager-cli.code.js +2 -2
  223. package/dist/package-manager-cli.impl.js +3 -3
  224. package/dist/package-manager-cli.js +3 -3
  225. package/dist/startup-files.json +1 -1
  226. package/dist/utils/startup-database-spare.impl.js +3 -3
  227. package/dist/utils/startup-database-spare.js +3 -3
  228. package/dist/utils/tools-manager.impl.js +3 -3
  229. package/dist/utils/tools-manager.js +3 -3
  230. package/docs/background-tasks/reference.md +1 -1
  231. package/docs/background-tasks.md +1 -1
  232. package/docs/changelog.mdx +17 -0
  233. package/docs/reference/cli.md +3 -2
  234. package/docs/storage/postgres/tuning.md +2 -0
  235. package/docs/storage/postgres.md +17 -0
  236. package/docs/worktree-snapshots/reference.md +1 -1
  237. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.10.18] - 2026-11-28
6
+
7
+ Atomic keeps shared PostgreSQL sessions moving through stalls and maintenance, makes conversations easier to resume, and makes tool output and background updates easier to read.
8
+
9
+ **Breaking change:** Task heartbeat updates no longer include a subagent’s token count. If your extension shows token usage from heartbeat data, read `TaskRecord.metrics.tokenCount` instead ([#6837](https://github.com/bastani-inc/atomic/pull/6837)).
10
+
11
+ **Sessions and background work**
12
+
13
+ - **Resume the right conversation.** `atomic --continue` prefers a conversation you can pick up over a newer empty session. The resume command follows the session you switched to, and you can continue in another folder if the original is gone ([#6828](https://github.com/bastani-inc/atomic/pull/6828)).
14
+ - **See activity, not token counts, in task heartbeats.** Background updates still show what subagents are doing. Usage is still available in the agent panel and `/tasks` ([#6837](https://github.com/bastani-inc/atomic/pull/6837)).
15
+
16
+ **Shared PostgreSQL storage**
17
+
18
+ - **Keep working through database stalls.** A stalled PostgreSQL call no longer ends a live session. Atomic tells you it’s waiting and retries pending saves in order, including subagent records ([#6830](https://github.com/bastani-inc/atomic/pull/6830)).
19
+ - **Treat timeouts as failures.** A late PostgreSQL reply cannot turn a timed-out call into a success, and a stalled cancellation no longer holds up later calls ([#6830](https://github.com/bastani-inc/atomic/pull/6830)).
20
+ - **Keep agent check-ins and message recovery from holding up other sessions.** Agents sharing PostgreSQL are less likely to pause during check-ins, and an agent that has already reconnected keeps its unanswered messages ([#6834](https://github.com/bastani-inc/atomic/pull/6834)).
21
+ - **Back off when snapshot cleanup finds the database busy.** In the default cleanup mode, Atomic retries later instead of making session writes queue behind cleanup that hasn’t started ([#6833](https://github.com/bastani-inc/atomic/pull/6833)).
22
+ - **Opt in to faster snapshot cleanup.** The default stays compatible with older clients. Once every Atomic client using the PostgreSQL database has upgraded to `0.10.18` and restarted, the database owner can enable faster cleanup so deleting old worktree snapshots no longer pauses unrelated saves. The owner can switch back before starting an older client; see [how to check, enable, or disable the mode](docs/storage/postgres.md#enable-faster-worktree-snapshot-cleanup) ([#6838](https://github.com/bastani-inc/atomic/pull/6838)).
23
+
24
+ **Terminal and workspace tools**
25
+
26
+ - **Read more useful terminal output.** History and the initial results from terminal-mode shell commands omit formatting codes, so more readable text fits without changing raw output files ([#6828](https://github.com/bastani-inc/atomic/pull/6828)).
27
+ - **Retry interrupted worktree creation.** Atomic clears stale Git locks left by its own interrupted SDK worktree setup without removing unrelated locks ([#6828](https://github.com/bastani-inc/atomic/pull/6828)).
28
+
29
+ ### Breaking Changes
30
+
31
+ - Task heartbeats no longer show a subagent's token count. Subagents compact automatically, so a high count doesn't mean a task is stuck and shouldn't prompt a handoff. Extensions that display token usage can still read `TaskRecord.metrics.tokenCount`; `TaskHeartbeatDetails` no longer includes it ([#6837](https://github.com/bastani-inc/atomic/pull/6837)).
32
+
33
+ ### Added
34
+
35
+ - Shared PostgreSQL databases keep the older-compatible cleanup mode by default. After every client using the database is upgraded to `0.10.18` and restarted, the database owner can enable faster worktree snapshot cleanup so unrelated session saves continue during cleanup. Use `atomic storage migrate --snapshot-cleanup status` to check the mode, `enable` to switch, and `disable` to restore compatibility before starting an older client ([#6832](https://github.com/bastani-inc/atomic/issues/6832), [#6838](https://github.com/bastani-inc/atomic/pull/6838)).
36
+
37
+ ### Fixed
38
+
39
+ - Atomic agents sharing PostgreSQL are less likely to pause when other agents check in or recover unanswered messages after a disconnect. A busy check-in no longer holds up unrelated sessions, and a session that has already reconnected keeps its unanswered messages. No settings change is needed ([#6831](https://github.com/bastani-inc/atomic/issues/6831), [#6834](https://github.com/bastani-inc/atomic/pull/6834)).
40
+ - Background snapshot cleanup now backs off instead of making sessions queue while it waits for a busy database. In the default mode, cleanup still briefly pauses writes while deleting a batch to protect snapshots used by sessions and forks ([#6831](https://github.com/bastani-inc/atomic/issues/6831), [#6833](https://github.com/bastani-inc/atomic/pull/6833)).
41
+ - If PostgreSQL stops answering, Atomic shows that it's waiting instead of quitting. When the database comes back, the session saves its pending messages and subagent records in order without duplicates ([#6829](https://github.com/bastani-inc/atomic/issues/6829)).
42
+ - `atomic --continue` prefers the most recent session with a conversation, a name, or a summary over a newer empty session. After switching sessions, the interactive resume command and crash recovery follow the session you switched to. Resuming no longer saves another copy of unchanged model or thinking settings, and choosing **Continue** works when the original working directory is gone ([#6828](https://github.com/bastani-inc/atomic/pull/6828)).
43
+ - History reads and searches ignore terminal formatting in tool output, without changing user or assistant messages. The first `bash` or `powershell` result with `pty: true` also omits those codes in the text sent to the model. Saved raw output and structured output still contain the original codes ([#6828](https://github.com/bastani-inc/atomic/pull/6828)).
44
+ - Retrying an interrupted SDK workspace setup clears the stale Git branch lock left by Atomic, so the new checkout can finish without disturbing unrelated locks ([#6828](https://github.com/bastani-inc/atomic/pull/6828)).
45
+
5
46
  ## [0.10.18-alpha.1] - 2026-11-28
6
47
 
7
48
  Atomic makes it easier to resume the right session, keeps live sessions open through PostgreSQL stalls, and makes terminal output easier to read.
@@ -31842,7 +31842,7 @@ function __atomicOnDemandFailed(error, feature) {
31842
31842
  return (async () => {
31843
31843
  const root = new URL("../", import.meta.url);
31844
31844
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
31845
- const key = `${root.href}#0.10.18-alpha.1`;
31845
+ const key = `${root.href}#0.10.18`;
31846
31846
  let release = releases.get(key);
31847
31847
  if (release === undefined) {
31848
31848
  const current = (async () => {
@@ -31870,7 +31870,7 @@ function __atomicOnDemandFailed(error, feature) {
31870
31870
  } catch {
31871
31871
  // No installation to read, as in a bundle of the package: the release the process runs decides.
31872
31872
  }
31873
- const updatedTo = typeof installed === "string" && installed !== "0.10.18-alpha.1" ? installed : running !== undefined && running.version !== "0.10.18-alpha.1" ? "0.10.18-alpha.1" : undefined;
31873
+ const updatedTo = typeof installed === "string" && installed !== "0.10.18" ? installed : running !== undefined && running.version !== "0.10.18" ? "0.10.18" : undefined;
31874
31874
  if (updatedTo === undefined) throw error;
31875
31875
  const application = typeof running?.name === "string" ? running.name : "atomic";
31876
31876
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -40,7 +40,7 @@ function __atomicOnDemandFailed(error, feature) {
40
40
  return (async () => {
41
41
  const root = new URL("../", import.meta.url);
42
42
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
43
- const key = `${root.href}#0.10.18-alpha.1`;
43
+ const key = `${root.href}#0.10.18`;
44
44
  let release = releases.get(key);
45
45
  if (release === undefined) {
46
46
  const current = (async () => {
@@ -68,7 +68,7 @@ function __atomicOnDemandFailed(error, feature) {
68
68
  } catch {
69
69
  // No installation to read, as in a bundle of the package: the release the process runs decides.
70
70
  }
71
- const updatedTo = typeof installed === "string" && installed !== "0.10.18-alpha.1" ? installed : running !== undefined && running.version !== "0.10.18-alpha.1" ? "0.10.18-alpha.1" : undefined;
71
+ const updatedTo = typeof installed === "string" && installed !== "0.10.18" ? installed : running !== undefined && running.version !== "0.10.18" ? "0.10.18" : undefined;
72
72
  if (updatedTo === undefined) throw error;
73
73
  const application = typeof running?.name === "string" ? running.name : "atomic";
74
74
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -5131,7 +5131,7 @@ function __atomicOnDemandFailed(error, feature) {
5131
5131
  return (async () => {
5132
5132
  const root = new URL("../", import.meta.url);
5133
5133
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
5134
- const key = `${root.href}#0.10.18-alpha.1`;
5134
+ const key = `${root.href}#0.10.18`;
5135
5135
  let release = releases.get(key);
5136
5136
  if (release === undefined) {
5137
5137
  const current = (async () => {
@@ -5159,7 +5159,7 @@ function __atomicOnDemandFailed(error, feature) {
5159
5159
  } catch {
5160
5160
  // No installation to read, as in a bundle of the package: the release the process runs decides.
5161
5161
  }
5162
- const updatedTo = typeof installed === "string" && installed !== "0.10.18-alpha.1" ? installed : running !== undefined && running.version !== "0.10.18-alpha.1" ? "0.10.18-alpha.1" : undefined;
5162
+ const updatedTo = typeof installed === "string" && installed !== "0.10.18" ? installed : running !== undefined && running.version !== "0.10.18" ? "0.10.18" : undefined;
5163
5163
  if (updatedTo === undefined) throw error;
5164
5164
  const application = typeof running?.name === "string" ? running.name : "atomic";
5165
5165
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -28206,7 +28206,7 @@ function __atomicOnDemandFailed(error, feature) {
28206
28206
  return (async () => {
28207
28207
  const root = new URL("../", import.meta.url);
28208
28208
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
28209
- const key = `${root.href}#0.10.18-alpha.1`;
28209
+ const key = `${root.href}#0.10.18`;
28210
28210
  let release = releases.get(key);
28211
28211
  if (release === undefined) {
28212
28212
  const current = (async () => {
@@ -28234,7 +28234,7 @@ function __atomicOnDemandFailed(error, feature) {
28234
28234
  } catch {
28235
28235
  // No installation to read, as in a bundle of the package: the release the process runs decides.
28236
28236
  }
28237
- const updatedTo = typeof installed === "string" && installed !== "0.10.18-alpha.1" ? installed : running !== undefined && running.version !== "0.10.18-alpha.1" ? "0.10.18-alpha.1" : undefined;
28237
+ const updatedTo = typeof installed === "string" && installed !== "0.10.18" ? installed : running !== undefined && running.version !== "0.10.18" ? "0.10.18" : undefined;
28238
28238
  if (updatedTo === undefined) throw error;
28239
28239
  const application = typeof running?.name === "string" ? running.name : "atomic";
28240
28240
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -4186,7 +4186,7 @@ function __atomicOnDemandFailed(error, feature) {
4186
4186
  return (async () => {
4187
4187
  const root = new URL("../", import.meta.url);
4188
4188
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
4189
- const key = `${root.href}#0.10.18-alpha.1`;
4189
+ const key = `${root.href}#0.10.18`;
4190
4190
  let release = releases.get(key);
4191
4191
  if (release === undefined) {
4192
4192
  const current = (async () => {
@@ -4214,7 +4214,7 @@ function __atomicOnDemandFailed(error, feature) {
4214
4214
  } catch {
4215
4215
  // No installation to read, as in a bundle of the package: the release the process runs decides.
4216
4216
  }
4217
- const updatedTo = typeof installed === "string" && installed !== "0.10.18-alpha.1" ? installed : running !== undefined && running.version !== "0.10.18-alpha.1" ? "0.10.18-alpha.1" : undefined;
4217
+ const updatedTo = typeof installed === "string" && installed !== "0.10.18" ? installed : running !== undefined && running.version !== "0.10.18" ? "0.10.18" : undefined;
4218
4218
  if (updatedTo === undefined) throw error;
4219
4219
  const application = typeof running?.name === "string" ? running.name : "atomic";
4220
4220
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -27325,7 +27325,7 @@ function __atomicOnDemandFailed(error, feature) {
27325
27325
  return (async () => {
27326
27326
  const root = new URL("../", import.meta.url);
27327
27327
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
27328
- const key = `${root.href}#0.10.18-alpha.1`;
27328
+ const key = `${root.href}#0.10.18`;
27329
27329
  let release = releases.get(key);
27330
27330
  if (release === undefined) {
27331
27331
  const current = (async () => {
@@ -27353,7 +27353,7 @@ function __atomicOnDemandFailed(error, feature) {
27353
27353
  } catch {
27354
27354
  // No installation to read, as in a bundle of the package: the release the process runs decides.
27355
27355
  }
27356
- const updatedTo = typeof installed === "string" && installed !== "0.10.18-alpha.1" ? installed : running !== undefined && running.version !== "0.10.18-alpha.1" ? "0.10.18-alpha.1" : undefined;
27356
+ const updatedTo = typeof installed === "string" && installed !== "0.10.18" ? installed : running !== undefined && running.version !== "0.10.18" ? "0.10.18" : undefined;
27357
27357
  if (updatedTo === undefined) throw error;
27358
27358
  const application = typeof running?.name === "string" ? running.name : "atomic";
27359
27359
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -205,7 +205,7 @@ const INTERACTIVE_ENGINE_PREWARM_DEFAULT_MODEL_API_FLAG = `${INTERACTIVE_ENGINE_
205
205
  const INTERACTIVE_ENGINE_PREWARM_HANDOFF_FLAG = `${INTERACTIVE_ENGINE_PREWARM_FLAG}-handoff`;
206
206
  const PREWARM_HOST_ARGUMENTS_MAX_LENGTH = 8192;
207
207
  const PREWARM_READY_MAX_BYTES = 4096;
208
- const PREWARM_BUILD_STAMP = "606c252476ab1f955f02238cc7d625";
208
+ const PREWARM_BUILD_STAMP = "1c494f9badb3ecaf1ba3522b561496";
209
209
  const PREWARM_BUILD_STAMP_UNSTAMPED = ["__ATOMIC_PREWARM", "BUILD_STAMP__"].join("_");
210
210
  function prewarmBuildIdentity() {
211
211
  if (PREWARM_BUILD_STAMP === PREWARM_BUILD_STAMP_UNSTAMPED) return void 0;
@@ -569,7 +569,7 @@ function __atomicOnDemandFailed(error, feature) {
569
569
  return (async () => {
570
570
  const root = new URL("../", import.meta.url);
571
571
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
572
- const key = `${root.href}#0.10.18-alpha.1`;
572
+ const key = `${root.href}#0.10.18`;
573
573
  let release = releases.get(key);
574
574
  if (release === undefined) {
575
575
  const current = (async () => {
@@ -597,7 +597,7 @@ function __atomicOnDemandFailed(error, feature) {
597
597
  } catch {
598
598
  // No installation to read, as in a bundle of the package: the release the process runs decides.
599
599
  }
600
- const updatedTo = typeof installed === "string" && installed !== "0.10.18-alpha.1" ? installed : running !== undefined && running.version !== "0.10.18-alpha.1" ? "0.10.18-alpha.1" : undefined;
600
+ const updatedTo = typeof installed === "string" && installed !== "0.10.18" ? installed : running !== undefined && running.version !== "0.10.18" ? "0.10.18" : undefined;
601
601
  if (updatedTo === undefined) throw error;
602
602
  const application = typeof running?.name === "string" ? running.name : "atomic";
603
603
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -53,6 +53,7 @@ import { TEAM_JOIN_COMMAND } from "../core/storage/libsql-removed.js";
53
53
  import { createServer } from "node:http";
54
54
  import { ensureForkInheritedBlobGuard, installForkInheritedBlobGuard } from "../core/worktree-snapshot/fork-blob-guard.js";
55
55
  import { forkLinkWrites, legacyForkLinksTriggerName } from "../core/worktree-snapshot/fork-snapshot-index.js";
56
+ import { snapshotEpochFunctionPrelude, snapshotReferenceTransaction } from "../core/worktree-snapshot/snapshot-epoch.js";
56
57
  import { MAX_SEQUENCE_REQUEST_STATEMENTS, noteStorageSchemaTables, refreshStorageSchemaCatalog } from "../core/storage/added-exports-0-10-11.js";
57
58
  import { assertStorageSchemaVersion, assertStoredSchemaVersion } from "../core/storage/schema.js";
58
59
  import { applyStorageMigrationsTogether, statementBatch } from "../core/storage/statement-batches.js";
@@ -2179,13 +2180,13 @@ const SESSION_ROW_FILLFACTOR = 80;
2179
2180
  * newer body in place.
2180
2181
  */
2181
2182
  const SESSION_APPEND_FUNCTION_DOMAIN = "session-append-function";
2182
- const SESSION_APPEND_FUNCTION_REVISION = 1;
2183
+ const SESSION_APPEND_FUNCTION_REVISION = 2;
2183
2184
  /**
2184
2185
  * The session append function's name under the store's prefix. The version in the name is the function's contract:
2185
2186
  * its arguments and what it answers. A build that needs another contract creates a function of a new name beside
2186
2187
  * this one, which builds that call this one keep using.
2187
2188
  */
2188
- const SESSION_APPEND_FUNCTION = "append_v1";
2189
+ const SESSION_APPEND_FUNCTION = "append_v2";
2189
2190
  /**
2190
2191
  * The most bytes of a chunked session blob one row holds. New blobs use a header row and rows of at most this size,
2191
2192
  * so their bound and returned values stay within it: libSQL servers cap a row and a bound value (sqld's default is
@@ -3093,7 +3094,7 @@ var SqlSessionStore = class SqlSessionStore {
3093
3094
  * since this store opened it, and what it writes then is not this build's to read or write (#5065).
3094
3095
  */
3095
3096
  transaction(body, options) {
3096
- return this.database.transaction(async (tx) => {
3097
+ return snapshotReferenceTransaction(this.database, this.blobTable.table, async (tx) => {
3097
3098
  await this.assertReadableSchema(tx);
3098
3099
  return body(tx);
3099
3100
  }, this.checkedFirst(options));
@@ -3191,7 +3192,7 @@ var SqlSessionStore = class SqlSessionStore {
3191
3192
  * failure reported, whatever the body met.
3192
3193
  */
3193
3194
  transactionCheckedAlongside(body, options) {
3194
- return this.database.transaction(async (tx) => {
3195
+ return snapshotReferenceTransaction(this.database, this.blobTable.table, async (tx) => {
3195
3196
  if (sequenceRunner(tx) === void 0) {
3196
3197
  await this.assertReadableSchema(tx);
3197
3198
  return body(tx, Promise.resolve());
@@ -4502,7 +4503,7 @@ var SqlSessionStore = class SqlSessionStore {
4502
4503
  this.writtenRows.delete(sessionId);
4503
4504
  }
4504
4505
  /**
4505
- * The session append function of the store's tables, `<prefix>session_append_v1`: one statement, and so one round
4506
+ * The session append function of the store's tables, `<prefix>session_append_v2`: one statement, and so one round
4506
4507
  * trip, for what an append's transaction does with its two (#6599). Created by `atomic storage migrate` through
4507
4508
  * {@link prepareAppendFunction}. It runs with the caller's rights, so it lets a role do nothing its table
4508
4509
  * privileges do not, and in the caller's `search_path`, the schema a transaction of the store sets. It writes no
@@ -4520,7 +4521,6 @@ var SqlSessionStore = class SqlSessionStore {
4520
4521
  ) RETURNS TABLE (outcome text, detail text) LANGUAGE plpgsql AS $append$
4521
4522
  #variable_conflict use_column
4522
4523
  DECLARE
4523
- scope text := CASE WHEN current_schema() = 'public' THEN '' ELSE current_schema() || ':' END;
4524
4524
  stored_version bigint;
4525
4525
  head record;
4526
4526
  stored_blobs text[];
@@ -4528,8 +4528,7 @@ DECLARE
4528
4528
  BEGIN
4529
4529
  -- The locks of a session write transaction, waited for as long as one waits: its lock wait is the statement timeout.
4530
4530
  PERFORM set_config('lock_timeout', current_setting('statement_timeout'), true);
4531
- PERFORM pg_advisory_xact_lock_shared(hashtextextended(scope || 'atomic', 0)),
4532
- pg_advisory_xact_lock(hashtextextended(scope || p_domain, 0));
4531
+ ${snapshotEpochFunctionPrelude(this.blobTable.table, "p_domain")}
4533
4532
  SELECT schema_version INTO stored_version FROM ${t.meta};
4534
4533
  IF stored_version IS NULL OR stored_version < p_oldest OR stored_version > p_newest THEN
4535
4534
  RETURN QUERY SELECT 'version'::text, stored_version::text;
@@ -14079,7 +14078,7 @@ function __atomicOnDemandFailed(error, feature) {
14079
14078
  return (async () => {
14080
14079
  const root = new URL("../", import.meta.url);
14081
14080
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
14082
- const key = `${root.href}#0.10.18-alpha.1`;
14081
+ const key = `${root.href}#0.10.18`;
14083
14082
  let release = releases.get(key);
14084
14083
  if (release === undefined) {
14085
14084
  const current = (async () => {
@@ -14107,7 +14106,7 @@ function __atomicOnDemandFailed(error, feature) {
14107
14106
  } catch {
14108
14107
  // No installation to read, as in a bundle of the package: the release the process runs decides.
14109
14108
  }
14110
- const updatedTo = typeof installed === "string" && installed !== "0.10.18-alpha.1" ? installed : running !== undefined && running.version !== "0.10.18-alpha.1" ? "0.10.18-alpha.1" : undefined;
14109
+ const updatedTo = typeof installed === "string" && installed !== "0.10.18" ? installed : running !== undefined && running.version !== "0.10.18" ? "0.10.18" : undefined;
14111
14110
  if (updatedTo === undefined) throw error;
14112
14111
  const application = typeof running?.name === "string" ? running.name : "atomic";
14113
14112
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {