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

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 (447) hide show
  1. package/CHANGELOG.md +150 -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} +36 -8
  14. package/dist/_shared/p1b-elig-TVB5CBLL.js.map +1 -0
  15. package/dist/_shared/p2-shell-main-B2WIALFD.js +6 -3
  16. package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
  17. package/dist/_shared/runtime-O4KCSG4C.js +3 -3
  18. package/dist/_shared/{sdk-IQMULKFU.js → sdk-B5LEWGGI.js} +1218 -657
  19. package/dist/_shared/sdk-B5LEWGGI.js.map +1 -0
  20. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  21. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  22. package/dist/_shared/{startup-0-0-3IXNMFM2.js → startup-0-0-XJJDOIEC.js} +50 -48
  23. package/dist/_shared/startup-0-0-XJJDOIEC.js.map +1 -0
  24. package/dist/_shared/{startup-0-1-7T2IAE7J.js → startup-0-1-M6OWAYHH.js} +540 -136
  25. package/dist/_shared/startup-0-1-M6OWAYHH.js.map +1 -0
  26. package/dist/_shared/startup-0-2-5QHPCEON.js +47 -48
  27. package/dist/_shared/startup-0-2-5QHPCEON.js.map +1 -1
  28. package/dist/_shared/startup-0-3-4ZYBYQNM.js +5 -5
  29. package/dist/_shared/startup-0-4-ZMJV547D.js +12 -7
  30. package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -1
  31. package/dist/_shared/startup-0-5-YDW47QX6.js +7 -7
  32. package/dist/_shared/startup-0-5-YDW47QX6.js.map +1 -1
  33. package/dist/_shared/startup-10-0-TDQNBDDL.js +6 -6
  34. package/dist/_shared/startup-12-0-55AAXBJZ.js +2 -2
  35. package/dist/_shared/startup-14-0-MLX36RBG.js +4 -5
  36. package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
  37. package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
  38. package/dist/_shared/startup-15-1-4S7FLMNG.js +19 -27
  39. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  40. package/dist/_shared/startup-8-0-34CBHPZH.js +2144 -249
  41. package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
  42. package/dist/_shared/{startup-8-1-X32CYSXB.js → startup-8-1-LZFXSD3Z.js} +98 -1184
  43. package/dist/_shared/startup-8-1-LZFXSD3Z.js.map +1 -0
  44. package/dist/_shared/storage-command-7MGXLJGZ.js +188 -37
  45. package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
  46. package/dist/_shared/storage-status-K7PX2RXA.js +557 -0
  47. package/dist/_shared/storage-status-K7PX2RXA.js.map +1 -0
  48. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  49. package/dist/_shared/team-DOQKICG2.js +376 -0
  50. package/dist/_shared/team-DOQKICG2.js.map +1 -0
  51. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  52. package/dist/builtin/intercom/CHANGELOG.md +42 -0
  53. package/dist/builtin/intercom/README.md +2 -2
  54. package/dist/builtin/intercom/broker/broker.bundle.mjs +1917 -381
  55. package/dist/builtin/intercom/broker/client.ts +8 -0
  56. package/dist/builtin/intercom/broker/database-wake-up-bus.ts +324 -68
  57. package/dist/builtin/intercom/broker/multinode-router.ts +256 -39
  58. package/dist/builtin/intercom/broker/multinode-state-store.ts +71 -5
  59. package/dist/builtin/intercom/broker/open-broker-state.ts +14 -0
  60. package/dist/builtin/intercom/broker/send-order-gate.ts +5 -2
  61. package/dist/builtin/intercom/broker/sql-add-column.ts +50 -5
  62. package/dist/builtin/intercom/broker/sql-ended-child-queue-store.ts +3 -2
  63. package/dist/builtin/intercom/broker/sql-held-send-store.ts +2 -2
  64. package/dist/builtin/intercom/broker/sql-known-session-store.ts +43 -19
  65. package/dist/builtin/intercom/broker/sql-lease-store.ts +473 -121
  66. package/dist/builtin/intercom/broker/sql-outbox-store.ts +821 -79
  67. package/dist/builtin/intercom/broker/sql-pending-ask-store.ts +8 -5
  68. package/dist/builtin/intercom/broker/sql-released-ask-store.ts +12 -5
  69. package/dist/builtin/intercom/broker/sql-restoring-reservation-store.ts +256 -8
  70. package/dist/builtin/intercom/broker/sql-retention.ts +150 -0
  71. package/dist/builtin/intercom/broker/sql-schema.ts +175 -24
  72. package/dist/builtin/intercom/broker/sql-sent-message-authority.ts +74 -19
  73. package/dist/builtin/intercom/broker/wake-up-bus.ts +6 -0
  74. package/dist/builtin/intercom/index.bundle.mjs +14 -4
  75. package/dist/builtin/intercom/package.json +1 -1
  76. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  77. package/dist/builtin/mcp/package.json +1 -1
  78. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  79. package/dist/builtin/subagents/package.json +1 -1
  80. package/dist/builtin/subagents/skills/skill-creator/eval-viewer/generate_review.py +8 -1
  81. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  82. package/dist/builtin/web-access/index.bundle.mjs +2 -10
  83. package/dist/builtin/web-access/package.json +1 -1
  84. package/dist/bun/bundled-sqlite.js +41 -0
  85. package/dist/bun/bundled-sqlite.js.map +1 -0
  86. package/dist/cli/args.js +2 -2
  87. package/dist/cli/auth-cli.code.js +4 -4
  88. package/dist/cli/auth-cli.impl.js +3 -3
  89. package/dist/cli/auth-cli.js +3 -3
  90. package/dist/cli/blueprint-command.code.js +3 -3
  91. package/dist/cli/blueprint-command.impl.js +3 -3
  92. package/dist/cli/blueprint-command.js +3 -3
  93. package/dist/cli/intercom-command.code.js +3 -3
  94. package/dist/cli/intercom-command.code.js.map +1 -1
  95. package/dist/cli/intercom-command.impl.js +3 -3
  96. package/dist/cli/intercom-command.js +3 -3
  97. package/dist/cli/list-models.code.js +2 -2
  98. package/dist/cli/list-models.impl.js +3 -3
  99. package/dist/cli/list-models.js +3 -3
  100. package/dist/cli/session-picker.code.js +1 -1
  101. package/dist/cli/session-picker.impl.js +3 -3
  102. package/dist/cli/session-picker.js +3 -3
  103. package/dist/cli/startup-ui.code.js +1 -1
  104. package/dist/cli/startup-ui.impl.js +3 -3
  105. package/dist/cli/startup-ui.js +3 -3
  106. package/dist/cli/storage-command.impl.js +3 -3
  107. package/dist/cli/storage-command.js +3 -3
  108. package/dist/cli/storage-search-session.code.js +3 -3
  109. package/dist/cli/storage-search-session.impl.js +3 -3
  110. package/dist/cli/storage-search-session.js +3 -3
  111. package/dist/cli/team-command.code.js +19 -113
  112. package/dist/cli/team-command.code.js.map +1 -1
  113. package/dist/cli/team-command.impl.js +3 -3
  114. package/dist/cli/team-command.js +3 -3
  115. package/dist/cli.js +5 -18
  116. package/dist/cli.js.map +1 -1
  117. package/dist/core/agent-rehydrate-errors.d.ts +4 -9
  118. package/dist/core/compaction/compactor.d.ts +3 -3
  119. package/dist/core/debug.code.js +1 -1
  120. package/dist/core/debug.impl.js +3 -3
  121. package/dist/core/debug.js +3 -3
  122. package/dist/core/export-html/card-projection.impl.js +3 -3
  123. package/dist/core/export-html/card-projection.js +3 -3
  124. package/dist/core/export-html/index.code.js +4 -4
  125. package/dist/core/export-html/index.code.js.map +1 -1
  126. package/dist/core/export-html/index.impl.js +3 -3
  127. package/dist/core/export-html/index.js +3 -3
  128. package/dist/core/export-html/json-spans.impl.js +3 -3
  129. package/dist/core/export-html/json-spans.js +3 -3
  130. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  131. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  132. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  133. package/dist/core/export-html/tool-renderer.js +3 -3
  134. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  135. package/dist/core/extensions/jiti-loader.js +3 -3
  136. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  137. package/dist/core/extensions/jiti-static-loader.js +3 -3
  138. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  139. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  140. package/dist/core/extensions/loader-host-modules.js +3 -3
  141. package/dist/core/extensions/loader-virtual-modules.js +1 -1
  142. package/dist/core/extensions/runner-context.js +2 -2
  143. package/dist/core/intercom-broker-control-host.code.js +2 -2
  144. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  145. package/dist/core/intercom-broker-control-host.js +3 -3
  146. package/dist/core/intercom-broker-control.code.js +3 -3
  147. package/dist/core/intercom-broker-control.impl.js +3 -3
  148. package/dist/core/intercom-broker-control.js +3 -3
  149. package/dist/core/package-manager-storage-adapters.code.js +1 -1
  150. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  151. package/dist/core/package-manager-storage-adapters.js +3 -3
  152. package/dist/core/process-start-token.d.ts +12 -3
  153. package/dist/core/process-tree-containment.d.ts +16 -0
  154. package/dist/core/sdk-types.d.ts +1 -2
  155. package/dist/core/sdk-types.js.map +1 -1
  156. package/dist/core/sdk.code.js +3 -3
  157. package/dist/core/sdk.impl.js +3 -3
  158. package/dist/core/sdk.js +3 -3
  159. package/dist/core/session-manager-core.js +5 -5
  160. package/dist/core/session-manager-list.impl.js +3 -3
  161. package/dist/core/session-manager-list.js +3 -3
  162. package/dist/core/session-manager.code.js +1 -1
  163. package/dist/core/session-manager.impl.js +3 -3
  164. package/dist/core/session-manager.js +3 -3
  165. package/dist/core/session-storage.code.js +1 -1
  166. package/dist/core/session-storage.impl.js +3 -3
  167. package/dist/core/session-storage.js +3 -3
  168. package/dist/core/settings-schema.d.ts +0 -3
  169. package/dist/core/storage/added-exports-0-10-11.js +19 -0
  170. package/dist/core/storage/added-exports-0-10-11.js.map +1 -0
  171. package/dist/core/storage/creation-time.js +105 -0
  172. package/dist/core/storage/creation-time.js.map +1 -0
  173. package/dist/core/storage/database.d.ts +25 -5
  174. package/dist/core/storage/database.js.map +1 -1
  175. package/dist/core/storage/dialect.d.ts +1 -1
  176. package/dist/core/storage/dialect.js +1 -1
  177. package/dist/core/storage/dialect.js.map +1 -1
  178. package/dist/core/storage/errors.d.ts +13 -13
  179. package/dist/core/storage/errors.js +10 -16
  180. package/dist/core/storage/errors.js.map +1 -1
  181. package/dist/core/storage/fenced-paths.d.ts +18 -6
  182. package/dist/core/storage/fenced-paths.js +18 -6
  183. package/dist/core/storage/fenced-paths.js.map +1 -1
  184. package/dist/core/storage/file-identity.d.ts +2 -0
  185. package/dist/core/storage/file-identity.js +24 -8
  186. package/dist/core/storage/file-identity.js.map +1 -1
  187. package/dist/core/storage/index.d.ts +3 -2
  188. package/dist/core/storage/index.js +5 -3
  189. package/dist/core/storage/index.js.map +1 -1
  190. package/dist/core/storage/libsql-removed.d.ts +71 -0
  191. package/dist/core/storage/libsql-removed.js +123 -0
  192. package/dist/core/storage/libsql-removed.js.map +1 -0
  193. package/dist/core/storage/migrations.d.ts +78 -14
  194. package/dist/core/storage/migrations.js +375 -49
  195. package/dist/core/storage/migrations.js.map +1 -1
  196. package/dist/core/storage/node-sqlite-file-gate.js +0 -15
  197. package/dist/core/storage/node-sqlite-file-gate.js.map +1 -1
  198. package/dist/core/storage/node-sqlite-thread.js +215 -30
  199. package/dist/core/storage/node-sqlite-thread.js.map +1 -1
  200. package/dist/core/storage/node-sqlite.js +484 -72
  201. package/dist/core/storage/node-sqlite.js.map +1 -1
  202. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  203. package/dist/core/storage/offline-snapshot-file.js +3 -3
  204. package/dist/core/storage/prefix.d.ts +1 -1
  205. package/dist/core/storage/prefix.js +9 -2
  206. package/dist/core/storage/prefix.js.map +1 -1
  207. package/dist/core/storage/process-selection.d.ts +5 -5
  208. package/dist/core/storage/provider.js +2 -2
  209. package/dist/core/storage/schema-catalog.d.ts +76 -15
  210. package/dist/core/storage/schema-catalog.js +359 -68
  211. package/dist/core/storage/schema-catalog.js.map +1 -1
  212. package/dist/core/storage/selection.d.ts +7 -82
  213. package/dist/core/storage/selection.js +20 -235
  214. package/dist/core/storage/selection.js.map +1 -1
  215. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  216. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  217. package/dist/core/storage/session/branch-fork-source.js +3 -3
  218. package/dist/core/storage/session/card-view.impl.js +3 -3
  219. package/dist/core/storage/session/card-view.js +3 -3
  220. package/dist/core/storage/session/child-reader.code.js +3 -3
  221. package/dist/core/storage/session/child-reader.impl.js +3 -3
  222. package/dist/core/storage/session/child-reader.js +3 -3
  223. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  224. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  225. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  226. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  227. package/dist/core/storage/session/expanded-child-details.js +3 -3
  228. package/dist/core/storage/session/fork-detach.d.ts +11 -1
  229. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  230. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  231. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  232. package/dist/core/storage/session/fork-row-index.js +3 -3
  233. package/dist/core/storage/session/fork-staging.code.js +4 -7
  234. package/dist/core/storage/session/fork-staging.code.js.map +1 -1
  235. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  236. package/dist/core/storage/session/fork-staging.js +3 -3
  237. package/dist/core/storage/session/fork-sweep.js +31 -7
  238. package/dist/core/storage/session/fork-sweep.js.map +1 -1
  239. package/dist/core/storage/session/fork-window.code.js +3 -3
  240. package/dist/core/storage/session/fork-window.impl.js +3 -3
  241. package/dist/core/storage/session/fork-window.js +3 -3
  242. package/dist/core/storage/session/history-pages.impl.js +3 -3
  243. package/dist/core/storage/session/history-pages.js +3 -3
  244. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  245. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  246. package/dist/core/storage/session/jsonl-session-lock.d.ts +100 -0
  247. package/dist/core/storage/session/jsonl-session-store.d.ts +46 -24
  248. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  249. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  250. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  251. package/dist/core/storage/session/memory-session-store.js +3 -3
  252. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  253. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  254. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  255. package/dist/core/storage/session/released-history-files.code.js +9 -9
  256. package/dist/core/storage/session/released-history-files.code.js.map +1 -1
  257. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  258. package/dist/core/storage/session/released-history-files.js +3 -3
  259. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  260. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  261. package/dist/core/storage/session/session-resume.impl.js +3 -3
  262. package/dist/core/storage/session/session-resume.js +3 -3
  263. package/dist/core/storage/session/session-search-index.d.ts +52 -5
  264. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  265. package/dist/core/storage/session/snapshot-cut.js +3 -3
  266. package/dist/core/storage/session/snapshot-history.code.js +3 -3
  267. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  268. package/dist/core/storage/session/snapshot-history.js +3 -3
  269. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  270. package/dist/core/storage/session/sql-session-store.d.ts +99 -18
  271. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  272. package/dist/core/storage/session/sql-session-store.js +3 -3
  273. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  274. package/dist/core/storage/session/tree-outline.js +3 -3
  275. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  276. package/dist/core/storage/session/tree-presentation.js +3 -3
  277. package/dist/core/storage/sqlite-facade.d.ts +12 -1
  278. package/dist/core/storage/sqlite-facade.js +310 -33
  279. package/dist/core/storage/sqlite-facade.js.map +1 -1
  280. package/dist/core/storage/sqlite-open-batch.js +10 -0
  281. package/dist/core/storage/sqlite-open-batch.js.map +1 -0
  282. package/dist/core/storage/storage-status.code.js +1 -1
  283. package/dist/core/storage/storage-status.impl.js +3 -3
  284. package/dist/core/storage/storage-status.js +3 -3
  285. package/dist/core/storage/team.code.js +1 -1
  286. package/dist/core/storage/team.d.ts +26 -115
  287. package/dist/core/storage/team.impl.js +3 -3
  288. package/dist/core/storage/team.js +3 -3
  289. package/dist/core/structured-output/index.code.js +1 -1
  290. package/dist/core/structured-output/index.impl.js +3 -3
  291. package/dist/core/structured-output/index.js +3 -3
  292. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  293. package/dist/core/tasks/task-completion-entry.js +3 -3
  294. package/dist/core/tasks/task-file-history.code.js +3 -3
  295. package/dist/core/tasks/task-file-history.impl.js +3 -3
  296. package/dist/core/tasks/task-file-history.js +3 -3
  297. package/dist/core/tasks/task-reference-archive.code.js +4 -4
  298. package/dist/core/tasks/task-reference-archive.js +3 -3
  299. package/dist/core/tasks/task-reference-identity.js +3 -3
  300. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  301. package/dist/core/tasks/task-reference-stream.js +3 -3
  302. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  303. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  304. package/dist/core/tasks/task-view-source.code.js +1 -1
  305. package/dist/core/tasks/task-view-source.impl.js +3 -3
  306. package/dist/core/tasks/task-view-source.js +3 -3
  307. package/dist/core/tools/history-tasks.d.ts +3 -2
  308. package/dist/core/tools/read-url.code.js +4 -4
  309. package/dist/core/tools/read-url.impl.js +3 -3
  310. package/dist/core/tools/read-url.js +3 -3
  311. package/dist/core/worktree-snapshot/blob-store.d.ts +44 -5
  312. package/dist/core/worktree-snapshot/blob-store.js +553 -30
  313. package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
  314. package/dist/core/worktree-snapshot/errors.code.js +2 -2
  315. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  316. package/dist/core/worktree-snapshot/errors.js +3 -3
  317. package/dist/core/worktree-snapshot/fork-blob-guard.js +81 -0
  318. package/dist/core/worktree-snapshot/fork-blob-guard.js.map +1 -0
  319. package/dist/core/worktree-snapshot/fork-snapshot-index.js +208 -50
  320. package/dist/core/worktree-snapshot/fork-snapshot-index.js.map +1 -1
  321. package/dist/core/worktree-snapshot/session-index-reset.code.js +4 -0
  322. package/dist/core/worktree-snapshot/session-index-reset.code.js.map +1 -1
  323. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  324. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  325. package/dist/extensions/codemode/execute.code.js +1 -1
  326. package/dist/extensions/codemode/execute.impl.js +3 -3
  327. package/dist/extensions/codemode/execute.js +3 -3
  328. package/dist/extensions/codemode/renderer.code.js +2 -2
  329. package/dist/extensions/codemode/renderer.impl.js +3 -3
  330. package/dist/extensions/codemode/renderer.js +3 -3
  331. package/dist/extensions/mcp/cli.code.js +3 -3
  332. package/dist/extensions/mcp/cli.impl.js +3 -3
  333. package/dist/extensions/mcp/cli.js +3 -3
  334. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  335. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  336. package/dist/extensions/mcp/cli.lazy.js +3 -3
  337. package/dist/extensions/mcp/runtime.code.js +1 -1
  338. package/dist/extensions/mcp/runtime.impl.js +3 -3
  339. package/dist/extensions/mcp/runtime.js +3 -3
  340. package/dist/index.d.ts +3 -1
  341. package/dist/index.js +5 -5
  342. package/dist/main-first-time-setup.code.js +1 -1
  343. package/dist/main-first-time-setup.impl.js +3 -3
  344. package/dist/main-first-time-setup.js +3 -3
  345. package/dist/main.js +1 -1
  346. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  347. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  348. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  349. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  350. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  351. package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
  352. package/dist/modes/interactive-engine/engine-prewarm.d.ts +1 -1
  353. package/dist/modes/print-mode.js +1 -1
  354. package/dist/package-manager-cli.code.js +6 -6
  355. package/dist/package-manager-cli.impl.js +3 -3
  356. package/dist/package-manager-cli.js +3 -3
  357. package/dist/rpc-entry.js +1 -1
  358. package/dist/startup-files.json +1 -1
  359. package/dist/startup-stages/10.js +1 -1
  360. package/dist/startup-stages/11.js +1 -1
  361. package/dist/startup-stages/12.js +1 -1
  362. package/dist/startup-stages/2.js +2 -4
  363. package/dist/startup-stages/3.js +1 -3
  364. package/dist/startup-stages/4.js +1 -2
  365. package/dist/startup-stages/5.js +1 -1
  366. package/dist/startup-stages/6.js +5 -7
  367. package/dist/startup-stages/7.js +3 -10
  368. package/dist/startup-stages/8.js +7 -2
  369. package/dist/startup-stages/9.js +1 -7
  370. package/dist/startup-stages/stages.json +1 -1
  371. package/dist/utils/compile-cache-deferral.js +8 -13
  372. package/dist/utils/compile-cache-deferral.js.map +1 -1
  373. package/dist/utils/compile-cache-warmup-host.js +3 -4
  374. package/dist/utils/compile-cache-warmup-host.js.map +1 -1
  375. package/dist/utils/compile-cache.js +12 -100
  376. package/dist/utils/compile-cache.js.map +1 -1
  377. package/dist/utils/startup-database-spare.code.js +2 -2
  378. package/dist/utils/startup-database-spare.impl.js +3 -3
  379. package/dist/utils/startup-database-spare.js +3 -3
  380. package/dist/utils/tools-manager.code.js +1 -1
  381. package/dist/utils/tools-manager.impl.js +3 -3
  382. package/dist/utils/tools-manager.js +3 -3
  383. package/dist/utils/worker-threads.js +2 -15
  384. package/dist/utils/worker-threads.js.map +1 -1
  385. package/docs/build.md +3 -3
  386. package/docs/changelog.mdx +1470 -69
  387. package/docs/compaction/reference.md +5 -5
  388. package/docs/compaction.md +7 -9
  389. package/docs/containerization.md +2 -2
  390. package/docs/custom-provider/api-reference.md +1 -1
  391. package/docs/docs.json +37 -10
  392. package/docs/environment-variables.md +0 -2
  393. package/docs/extensions/api-reference.md +4 -4
  394. package/docs/getting-started/installation.md +3 -0
  395. package/docs/guides/configuration.md +1 -1
  396. package/docs/guides/non-interactive.md +1 -1
  397. package/docs/guides/resume-on-any-machine.md +14 -22
  398. package/docs/guides/team-setup.md +56 -83
  399. package/docs/guides.md +2 -4
  400. package/docs/herdr.md +1 -1
  401. package/docs/index.md +1 -1
  402. package/docs/intercom/operations.md +26 -21
  403. package/docs/intercom/reference.md +2 -2
  404. package/docs/intercom.md +1 -1
  405. package/docs/libraries/storage-postgres.md +9 -9
  406. package/docs/libraries.md +2 -3
  407. package/docs/models-configuration.md +2 -2
  408. package/docs/models.md +2 -3
  409. package/docs/packages/authoring.md +7 -7
  410. package/docs/packages.md +1 -1
  411. package/docs/programmatic.md +2 -2
  412. package/docs/quickstart.md +1 -1
  413. package/docs/reference/cli.md +6 -11
  414. package/docs/reference.md +2 -2
  415. package/docs/rpc/extension-ui.md +2 -2
  416. package/docs/sdk/reference.md +5 -4
  417. package/docs/sdk/storage.md +8 -92
  418. package/docs/sdk/structured-decisions.md +1 -1
  419. package/docs/sdk/web-server.md +3 -3
  420. package/docs/sdk.md +14 -4
  421. package/docs/security.md +1 -1
  422. package/docs/session-format.md +5 -5
  423. package/docs/sessions.md +29 -49
  424. package/docs/settings.md +7 -8
  425. package/docs/storage/custom-adapters.md +255 -0
  426. package/docs/storage/jsonl.md +117 -0
  427. package/docs/{guides/postgres-pgbouncer.md → storage/postgres/pgbouncer.md} +66 -68
  428. package/docs/storage/postgres/tuning.md +337 -0
  429. package/docs/storage/postgres.md +556 -0
  430. package/docs/storage/sqlite.md +99 -0
  431. package/docs/storage.md +326 -990
  432. package/docs/subagents/authoring.md +1 -1
  433. package/docs/subagents.md +2 -2
  434. package/docs/tools.md +1 -1
  435. package/docs/worktree-snapshots.md +2 -2
  436. package/package.json +9 -9
  437. package/schemas/models.schema.json +2 -2
  438. package/schemas/settings.schema.json +0 -14
  439. package/dist/_shared/p1b-elig-ENCUPKKJ.js.map +0 -1
  440. package/dist/_shared/sdk-IQMULKFU.js.map +0 -1
  441. package/dist/_shared/startup-0-0-3IXNMFM2.js.map +0 -1
  442. package/dist/_shared/startup-0-1-7T2IAE7J.js.map +0 -1
  443. package/dist/_shared/startup-8-1-X32CYSXB.js.map +0 -1
  444. package/dist/core/intercom-broker-control.d.ts +0 -129
  445. package/dist/startup-stages/13.js +0 -1
  446. package/docs/guides/postgres-tuning.md +0 -311
  447. package/docs/libraries/storage-libsql.md +0 -97
@@ -0,0 +1,376 @@
1
+ import "./rolldown-runtime-BGM3D5V3.js";
2
+ import { randomUUID } from "node:crypto";
3
+ import { chmodSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
4
+ import { basename, dirname, join, relative, resolve, sep } from "node:path";
5
+ import { getAgentDir } from "./p0-cli-BB45ZQY6.js";
6
+ import { parseJsonFileContent } from "./p1-shared-RG5I5LJ6.js";
7
+ import { prepareLockTakeover } from "./startup-0-0-XJJDOIEC.js";
8
+ import { FileSettingsStorage, SettingsManager, resolvePackageStorageAdapter, selectSessionStorageWithSettings, writeSettingsFile } from "./startup-8-1-LZFXSD3Z.js";
9
+ import { describeStorageSelection, openAdapterSelectionDatabase, projectTrust, selectIntercomStorage, selectSharedStorage } from "./storage-status-K7PX2RXA.js";
10
+ import { StorageConfigError, StorageError, TeamProfileError, TeamProfileTimeoutError, describeStorageError } from "../core/storage/errors.js";
11
+ import { defaultSessionDatabasePath, storageHomeDir } from "../core/storage/file-identity.js";
12
+ import { loadStorageAdapter, secretFilePath as secretFilePath$1, storageSelectionKey } from "../core/storage/provider.js";
13
+ import { POSTGRES_ADAPTER_PACKAGE, STORAGE_TOKEN_FILE, checkSharedDatabaseArguments, checkTeamPrefix, inMemorySecret, readTeamTokenFile, selectStorage } from "../core/storage/selection.js";
14
+ import { assertTeamAdapterInstalled, joinTeam, joinTeamWith, leaveTeam, leaveTeamWith, storageFingerprint } from "../core/storage/libsql-removed.js";
15
+ // dist/core/storage/team.js
16
+ /**
17
+ * The layout in effect (`getTeamProfile`, `atomic team status`) and the shared PostgreSQL database join that
18
+ * `atomic storage join` runs.
19
+ */
20
+ function settingsPathOf(agentDir) {
21
+ return join(agentDir, "settings.json");
22
+ }
23
+ /**
24
+ * Why a settings file cannot be read, without any of its content: the file-system error code, or where its JSON
25
+ * breaks. A parser message can quote part of the file, such as a key, so it is never shown.
26
+ */
27
+ function unreadableSettingsDetail(error) {
28
+ const code = error.code;
29
+ if (typeof code === "string") return code;
30
+ if (!(error instanceof SyntaxError)) return error.name;
31
+ const position = /\(line (\d+) column (\d+)\)/.exec(error.message);
32
+ return position === null ? "not valid JSON" : `not valid JSON at line ${position[1]}, column ${position[2]}`;
33
+ }
34
+ function unreadableSettingsError(subject, cause) {
35
+ return new TeamProfileError("settings-unreadable", {
36
+ subject,
37
+ detail: unreadableSettingsDetail(cause),
38
+ hint: `Fix ${subject} first, then run the command again.`,
39
+ cause
40
+ });
41
+ }
42
+ function openGlobalSettings(cwd, agentDir) {
43
+ const manager = SettingsManager.create(cwd, agentDir, { projectTrusted: false });
44
+ const failure = manager.drainErrors().find(({ invalidKey }) => invalidKey === void 0);
45
+ if (failure !== void 0) {
46
+ const settingsPath = failure.path ?? settingsPathOf(agentDir);
47
+ if (isLocked(failure.error)) throw lockedError(settingsPath, failure.error, "Nothing was changed.");
48
+ throw unreadableSettingsError(settingsPath, failure.error);
49
+ }
50
+ return manager;
51
+ }
52
+ function writePrivateFile(path, token) {
53
+ mkdirSync(dirname(path), { recursive: true });
54
+ const temporary = `${path}.${process.pid}.tmp`;
55
+ try {
56
+ writeFileSync(temporary, token, { mode: 384 });
57
+ chmodSync(temporary, 384);
58
+ renameSync(temporary, path);
59
+ } catch (error) {
60
+ rmSync(temporary, { force: true });
61
+ throw error;
62
+ }
63
+ }
64
+ async function checkConnection(target, agentDir, adapter) {
65
+ const database = await openAdapterSelectionDatabase({
66
+ kind: "adapter",
67
+ module: target.adapter,
68
+ options: target.options,
69
+ ...target.secret === void 0 ? {} : { secrets: { [target.secretName]: inMemorySecret(target.secret) } }
70
+ }, {
71
+ agentDir,
72
+ domain: "sessions"
73
+ }, adapter);
74
+ try {
75
+ await database.get("SELECT 1 AS ok");
76
+ } finally {
77
+ await database.close();
78
+ }
79
+ }
80
+ /** The `StorageConfigError` `error` is, or was caused by, if any. */
81
+ function storageConfigCause(error) {
82
+ let current = error;
83
+ for (let depth = 0; depth < 8 && current instanceof Error; depth++) {
84
+ if (current instanceof StorageConfigError) return current;
85
+ current = current.cause;
86
+ }
87
+ }
88
+ /** How long a join waits for the shared database to connect and answer `SELECT 1`, after the adapter has loaded. */
89
+ const TEAM_CONNECTION_TIMEOUT_MS = 15e3;
90
+ /**
91
+ * `checkConnection`, bounded by `timeoutMs` once the adapter module has loaded: a database that does not answer fails
92
+ * with a retryable {@link TeamProfileTimeoutError} instead of waiting for the operating system's connection timeout. A
93
+ * check that fails after the deadline is recorded as the timeout error's `cleanupCause`. `elapsedMs` is never below
94
+ * `timeoutMs`: Node can fire a timer a millisecond before the wall clock shows its delay has passed.
95
+ */
96
+ async function checkConnectionWithin(target, agentDir, timeoutMs) {
97
+ const url = target.options.url;
98
+ let timer;
99
+ let started = 0;
100
+ let check;
101
+ let outcome;
102
+ try {
103
+ const adapter = await loadStorageAdapter(target.adapter, {
104
+ agentDir,
105
+ domain: "sessions"
106
+ });
107
+ started = Date.now();
108
+ check = checkConnection(target, agentDir, adapter).then(() => "answered");
109
+ const deadline = new Promise((resolveDeadline) => {
110
+ timer = setTimeout(() => resolveDeadline("timed-out"), timeoutMs);
111
+ });
112
+ outcome = await Promise.race([check, deadline]);
113
+ } catch (error) {
114
+ const config = storageConfigCause(error);
115
+ if (config?.reason === "auth-unavailable") throw new TeamProfileError("auth-unavailable", {
116
+ subject: url,
117
+ detail: "auth-unavailable",
118
+ hint: `Nothing was changed. ${config.hint ?? "Check the cloud identity's sign-in"}`,
119
+ cause: error
120
+ });
121
+ if (config !== void 0) throw config;
122
+ throw new TeamProfileError("connection-failed", {
123
+ subject: url,
124
+ detail: describeStorageError(error),
125
+ hint: "Nothing was changed. Check the URL, the token and the network, then run the command again.",
126
+ cause: error
127
+ });
128
+ } finally {
129
+ clearTimeout(timer);
130
+ }
131
+ if (outcome === "answered") return;
132
+ const timeout = new TeamProfileTimeoutError({
133
+ subject: url,
134
+ timeoutMs,
135
+ elapsedMs: Math.max(Date.now() - started, timeoutMs),
136
+ phase: "connect",
137
+ hint: "Nothing was changed. Check that the database is reachable from this machine, then run the command again."
138
+ });
139
+ check.catch((late) => {
140
+ Object.defineProperty(timeout, "cleanupCause", {
141
+ value: late,
142
+ configurable: true
143
+ });
144
+ });
145
+ throw timeout;
146
+ }
147
+ /** The token file a `{ file }` reference names, resolved like the storage provider resolves it. */
148
+ function secretFilePath(ref, agentDir) {
149
+ if (ref === void 0 || !("file" in ref)) return void 0;
150
+ return resolve(secretFilePath$1(ref.file, agentDir));
151
+ }
152
+ /** Whether a path is a token file that a join created in this agent directory. */
153
+ function isJoinTokenFile(path, agentDir) {
154
+ return dirname(path) === resolve(agentDir) && basename(path).startsWith(`${STORAGE_TOKEN_FILE}.`);
155
+ }
156
+ /** The join-created token file `storage` references as `secretName`, when it already holds `token`. */
157
+ function reusableTokenFile(storage, secretName, token, agentDir) {
158
+ const path = secretFilePath(storage?.secrets?.[secretName], agentDir);
159
+ if (path === void 0 || !isJoinTokenFile(path, agentDir)) return void 0;
160
+ let stored;
161
+ try {
162
+ stored = readFileSync(path, "utf8");
163
+ } catch (error) {
164
+ if (error instanceof Error) return void 0;
165
+ throw error;
166
+ }
167
+ return stored === token ? path : void 0;
168
+ }
169
+ function isLocked(error) {
170
+ return error.code === "ELOCKED";
171
+ }
172
+ /** Another process holds the settings lock: retryable, since a lock left by a killed process expires. */
173
+ function lockedError(settingsPath, cause, outcome) {
174
+ return new TeamProfileError("settings-locked", {
175
+ subject: settingsPath,
176
+ hint: `${outcome} Run the command again in a few seconds; a lock left by a killed process expires after 10 seconds.`,
177
+ cause
178
+ });
179
+ }
180
+ /** A failed settings write: `settings-locked` while another process holds the lock, else the I/O error. */
181
+ function settingsWriteError(settingsPath, cause, outcome) {
182
+ if (isLocked(cause)) return lockedError(settingsPath, cause, outcome);
183
+ return new TeamProfileError("settings-write-failed", {
184
+ subject: settingsPath,
185
+ detail: describeStorageError(cause),
186
+ hint: `${outcome} Check that the file and its directory are writable and the disk has space, then run the command again.`,
187
+ cause
188
+ });
189
+ }
190
+ function withGlobalSettings(agentDir, outcome, run) {
191
+ const settingsPath = settingsPathOf(agentDir);
192
+ let result;
193
+ try {
194
+ new FileSettingsStorage(dirname(agentDir), agentDir).withPrimaryWriteLock("global", (current) => {
195
+ let settings = {};
196
+ if (current !== void 0) try {
197
+ const parsed = parseJsonFileContent(current);
198
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) throw new TypeError("not a JSON object");
199
+ settings = parsed;
200
+ } catch (error) {
201
+ throw unreadableSettingsError(settingsPath, error);
202
+ }
203
+ result = run(settings);
204
+ });
205
+ } catch (error) {
206
+ if (error instanceof TeamProfileError) throw error;
207
+ throw settingsWriteError(settingsPath, error, outcome);
208
+ }
209
+ return result;
210
+ }
211
+ function cleanupAfter(primary, cleanup) {
212
+ try {
213
+ cleanup();
214
+ } catch (cleanupCause) {
215
+ Object.defineProperty(primary, "cleanupCause", {
216
+ value: cleanupCause,
217
+ configurable: true
218
+ });
219
+ }
220
+ }
221
+ function joinPlan(options, source, cwd) {
222
+ const checked = checkSharedDatabaseArguments(options);
223
+ const target = {
224
+ adapter: POSTGRES_ADAPTER_PACKAGE,
225
+ secretName: "password"
226
+ };
227
+ if (checked.auth !== void 0) return { target: {
228
+ ...target,
229
+ options: {
230
+ url: checked.url,
231
+ auth: checked.auth
232
+ }
233
+ } };
234
+ if (checked.passwordFile !== void 0) {
235
+ const password = readTeamTokenFile(resolve(cwd, checked.passwordFile), source, "--password-file");
236
+ return {
237
+ target: {
238
+ ...target,
239
+ options: { url: checked.url },
240
+ secret: password
241
+ },
242
+ copy: password
243
+ };
244
+ }
245
+ const reference = resolve(cwd, checked.tokenFile);
246
+ const password = readTeamTokenFile(reference, source, void 0, "as-connections-read");
247
+ return {
248
+ target: {
249
+ ...target,
250
+ options: { url: checked.url },
251
+ secret: password
252
+ },
253
+ reference
254
+ };
255
+ }
256
+ /**
257
+ * Point the global `storage` setting at a shared PostgreSQL database, as `atomic storage join` does. Every input and
258
+ * precondition is checked before the first write: the URL, the credential, the prefix, readable global settings, the
259
+ * installed adapter and a `SELECT 1` on the database. A `--password-file` password is stored in a private file in the
260
+ * agent directory (mode 600), reusing the file the current selection references when it already holds the same
261
+ * password, and settings are written in one update. On failure nothing is changed.
262
+ */
263
+ async function joinSharedDatabase(options, source, connectionTimeoutMs = TEAM_CONNECTION_TIMEOUT_MS) {
264
+ const agentDir = resolve(options.agentDir ?? getAgentDir());
265
+ const cwd = resolve(options.cwd ?? process.cwd());
266
+ const plan = joinPlan(options, source, cwd);
267
+ const { target } = plan;
268
+ const token = plan.copy;
269
+ const prefix = checkTeamPrefix(options.prefix, source);
270
+ openGlobalSettings(cwd, agentDir);
271
+ const settingsPath = settingsPathOf(agentDir);
272
+ if (await resolvePackageStorageAdapter(target.adapter, agentDir) === void 0) throw new TeamProfileError("adapter-not-installed", {
273
+ subject: `${target.adapter} for ${agentDir}`,
274
+ hint: `Install it, then run this command again: atomic install npm:${target.adapter}`
275
+ });
276
+ await checkConnectionWithin(target, agentDir, connectionTimeoutMs);
277
+ const unchanged = "Nothing was changed: the previous selection and its token are kept.";
278
+ await prepareLockTakeover(`${settingsPath}.lock`);
279
+ const { storage, previous, tokenPath, reused } = withGlobalSettings(agentDir, unchanged, (settings) => {
280
+ const previous = settings.storage;
281
+ const reused = token === void 0 ? void 0 : reusableTokenFile(previous, target.secretName, token, agentDir);
282
+ const tokenPath = token === void 0 ? void 0 : reused ?? join(agentDir, `${STORAGE_TOKEN_FILE}.${randomUUID()}`);
283
+ const created = token !== void 0 && tokenPath !== void 0 && reused === void 0 ? tokenPath : void 0;
284
+ if (token !== void 0 && created !== void 0) try {
285
+ writePrivateFile(created, token);
286
+ } catch (error) {
287
+ throw new TeamProfileError("token-write-failed", {
288
+ subject: created,
289
+ detail: describeStorageError(error),
290
+ hint: "Nothing was changed. Check that the agent directory is writable, then run the command again.",
291
+ cause: error
292
+ });
293
+ }
294
+ const file = tokenPath === void 0 ? plan.reference : relative(storageHomeDir(agentDir), tokenPath).split(sep).join("/");
295
+ const storage = {
296
+ adapter: target.adapter,
297
+ options: target.options,
298
+ ...file === void 0 ? {} : { secrets: { [target.secretName]: { file } } },
299
+ ...prefix === void 0 ? {} : { prefix }
300
+ };
301
+ const next = {
302
+ ...settings,
303
+ storage
304
+ };
305
+ try {
306
+ writeSettingsFile(settingsPath, JSON.stringify(next, null, 2));
307
+ } catch (error) {
308
+ const failure = settingsWriteError(settingsPath, error, unchanged);
309
+ if (created !== void 0) cleanupAfter(failure, () => rmSync(created, { force: true }));
310
+ throw failure;
311
+ }
312
+ return {
313
+ storage,
314
+ previous,
315
+ tokenPath,
316
+ reused
317
+ };
318
+ });
319
+ return {
320
+ settingsPath,
321
+ storage,
322
+ ...tokenPath === void 0 ? {} : { tokenPath },
323
+ token: tokenPath === void 0 ? "none" : reused === void 0 ? "new" : "reused",
324
+ ...plan.reference === void 0 ? {} : { referencedFile: plan.reference },
325
+ ...previous === void 0 || JSON.stringify(previous) === JSON.stringify(storage) ? {} : { replaced: describePrevious(() => selectStorage(previous, "settings", "storage", "")) }
326
+ };
327
+ }
328
+ function describePrevious(select) {
329
+ try {
330
+ return describeStorageSelection(select());
331
+ } catch (error) {
332
+ if (error instanceof StorageConfigError && error.reason === "libsql-removed") return "a libSQL database, which this release no longer opens";
333
+ if (error instanceof StorageError) return "an invalid selection";
334
+ throw error;
335
+ }
336
+ }
337
+ function isLocalDefault(selection, agentDir, settings) {
338
+ return selection.kind === "sqlite" && !selection.prefix && resolve(selection.path) === resolve(defaultSessionDatabasePath(agentDir, settings));
339
+ }
340
+ /**
341
+ * The layout in effect for this process and working directory, from the storage each domain selects (process-level
342
+ * selections, `ATOMIC_PROFILE=ci`, trusted project settings and global settings, as sessions and the Intercom broker
343
+ * resolve them). Reads only; an invalid selection throws its `StorageConfigError`.
344
+ */
345
+ function selectTeamProfile(options = {}) {
346
+ const agentDir = resolve(options.agentDir ?? getAgentDir());
347
+ const cwd = resolve(options.cwd ?? process.cwd());
348
+ const manager = SettingsManager.create(cwd, agentDir, { projectTrusted: projectTrust(cwd, agentDir) });
349
+ const failure = manager.drainErrors().find(({ invalidKey }) => invalidKey === void 0);
350
+ if (failure !== void 0) {
351
+ if (isLocked(failure.error)) throw lockedError(`${failure.scope} settings`, failure.error, "Nothing was read.");
352
+ throw new TeamProfileError("settings-unreadable", {
353
+ subject: `${failure.scope} settings`,
354
+ detail: unreadableSettingsDetail(failure.error),
355
+ hint: "Fix the settings file, then run the command again.",
356
+ cause: failure.error
357
+ });
358
+ }
359
+ const merged = manager.getSettings();
360
+ const sessions = selectSessionStorageWithSettings(cwd, {
361
+ agentDir,
362
+ settings: merged
363
+ });
364
+ const selected = selectSharedStorage(agentDir, merged);
365
+ const intercom = selectIntercomStorage(agentDir, manager.getGlobalSettings().storage);
366
+ const shared = intercom?.kind === "adapter" ? storageSelectionKey(intercom, agentDir) : void 0;
367
+ const sharesStorage = shared !== void 0 && selected !== void 0 && storageSelectionKey(selected, agentDir) === shared;
368
+ return {
369
+ profile: isLocalDefault(sessions, agentDir, merged) && (selected === void 0 || isLocalDefault(selected, agentDir, merged)) && intercom === void 0 ? "individual" : sharesStorage && isLocalDefault(sessions, agentDir, merged) ? "team" : sharesStorage && storageSelectionKey(sessions, agentDir) === shared ? "ci" : "custom",
370
+ sessions: describeStorageSelection(sessions),
371
+ intercom: intercom === void 0 ? "off" : describeStorageSelection(intercom)
372
+ };
373
+ }
374
+ export { TEAM_CONNECTION_TIMEOUT_MS, assertTeamAdapterInstalled, joinSharedDatabase, joinTeam, joinTeamWith, leaveTeam, leaveTeamWith, selectTeamProfile, storageFingerprint };
375
+
376
+ //# sourceMappingURL=team-DOQKICG2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-DOQKICG2.js","names":["resolveProviderSecretFilePath"],"sources":["../../src/core/storage/team.ts"],"mappings":";;;;;;;;;;;;;;;;;;;AAoHA,SAAS,eAAe,UAAgB;CACvC,OAAO,KAAK,UAAU,eAAe;AACtC;;;;;AAMA,SAAS,yBAAyB,OAAY;CAC7C,MAAM,OAAQ,MAAgC;CAC9C,IAAI,OAAO,SAAS,UAAU,OAAO;CACrC,IAAI,EAAE,iBAAiB,cAAc,OAAO,MAAM;CAClD,MAAM,WAAW,8BAA8B,KAAK,MAAM,OAAO;CACjE,OAAO,aAAa,OAAO,mBAAmB,0BAA0B,SAAS,GAAE,WAAY,SAAS;AACzG;AAEA,SAAS,wBAAwB,SAAiB,OAAY;CAC7D,OAAO,IAAI,iBAAiB,uBAAuB;EAClD;EACA,QAAQ,yBAAyB,KAAK;EACtC,MAAM,OAAO,QAAO;EACpB;CACA,CAAA;AACF;AAEA,SAAS,mBAAmB,KAAa,UAAgB;CACxD,MAAM,UAAU,gBAAgB,OAAO,KAAK,UAAU,EAAE,gBAAgB,MAAK,CAAE;CAG/E,MAAM,UAAU,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KAAA,IAAY,QAAQ,yBAAyB,QAAQ;CAC5E;AACF"}
@@ -88,7 +88,7 @@ function __atomicOnDemandFailed(error, feature) {
88
88
  return (async () => {
89
89
  const root = new URL("../", import.meta.url);
90
90
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
91
- const key = `${root.href}#0.10.11-alpha.2`;
91
+ const key = `${root.href}#0.10.11-alpha.4`;
92
92
  let release = releases.get(key);
93
93
  if (release === undefined) {
94
94
  const current = (async () => {
@@ -116,7 +116,7 @@ function __atomicOnDemandFailed(error, feature) {
116
116
  } catch {
117
117
  // No installation to read, as in a bundle of the package: the release the process runs decides.
118
118
  }
119
- 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;
119
+ const updatedTo = typeof installed === "string" && installed !== "0.10.11-alpha.4" ? installed : running !== undefined && running.version !== "0.10.11-alpha.4" ? "0.10.11-alpha.4" : undefined;
120
120
  if (updatedTo === undefined) throw error;
121
121
  const application = typeof running?.name === "string" ? running.name : "atomic";
122
122
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -4,6 +4,48 @@ All notable changes to Atomic's Intercom extension, `@bastani/intercom`, are doc
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.10.11-alpha.4] - 2026-11-27
8
+
9
+ ### Changed
10
+
11
+ - With multi-node routing on SQLite, messages that recipients confirm at about the same time are now recorded as delivered together in one batched statement and commit, matching PostgreSQL. A burst of N confirmations sent in the same turn now takes 3 requests to the connection thread with one write lock instead of 3N + 2 (with per-confirmation savepoints), while preserving per-message answers, call-order resolution, and full durability ([#6716](https://github.com/bastani-inc/atomic/issues/6716)).
12
+ - With multi-node routing, a broker now renews all the messages it is delivering in one statement every 10 seconds. It used to renew them one transaction at a time, waiting for each before the next. A broker delivering 20 messages to sessions that are still saving them now makes 1 round trip per renewal instead of 20. A message whose delivery another broker has taken over, or that was settled meanwhile, is still left alone, as before ([#6693](https://github.com/bastani-inc/atomic/pull/6693), [#6560](https://github.com/bastani-inc/atomic/issues/6560)).
13
+ - With multi-node routing, a broker now releases all in-flight message claims for a departing session, an unwritten claim tail, or broker shutdown in one durable statement instead of one transaction per message. On PostgreSQL, releasing N claims takes 1 round trip instead of N, keeps rows locked in sequence order, preserves per-sender message order, and restores attempt counts with a floor of 0 for unwritten rows ([#6713](https://github.com/bastani-inc/atomic/issues/6713)).
14
+ - With multi-node routing, a broker now renews all of its membership and presence leases in one update statement per heartbeat, and all of its mirrored restoring reservations in one update statement per heartbeat, instead of one update per lease (plus a separate read for each stale lease) and one transaction per reservation. On PostgreSQL, each batch finishes in 1 round trip, even when some leases or reservations have gone stale. A lease or reservation whose ownership or fencing token another broker has taken over is never extended. In an interleaved PostgreSQL benchmark with 200 brokers renewing 11 leases and 4 restoring reservations each, round trips dropped from 19.05 to 2 per broker tick, updates dropped from 15 to 2, and median broker tick time dropped from 1,254 ms to 102 ms ([#6714](https://github.com/bastani-inc/atomic/issues/6714)).
15
+ - With multi-node routing, a broker that checks for missed messages for all of its sessions now finds which sessions have any in one read of the shared database. Before, it ran a claim for each session. Only sessions with waiting messages get a claim. A broker hosting a session and its 20 subagents used to send 21 statements every 30 seconds, and on each reconnect, when nothing was waiting. It now sends 1. If the read fails, the broker claims for every session as before ([#6690](https://github.com/bastani-inc/atomic/pull/6690), [#6560](https://github.com/bastani-inc/atomic/issues/6560)).
16
+ - With multi-node routing on PostgreSQL and SQLite, concurrent wake-up bus publishes now batch into a single transaction and notify each distinct target broker once after commit, reducing a burst of N concurrent hints on PostgreSQL from 2N round trips to 2 while still resolving each publish only after its batch commits (or reporting `unavailable` to every publish in the batch if it fails). In an interleaved benchmark of 20 concurrent hints across 4 brokers at 40 ms latency, median time dropped from 245 ms to 81 ms ([#6715](https://github.com/bastani-inc/atomic/issues/6715)).
17
+ - With multi-node routing on PostgreSQL and SQLite, settling a delivered non-reply message now writes the origin broker's outcome wake-up hint atomically in the settlement transaction itself and notifies after commit, reducing settlement plus origin wake-up on PostgreSQL from 4 round trips (1 settlement + 1 publish, or 2+2N for a batch) to 1 round trip without failing the settlement when the hint table is locked (`NOWAIT`). Replies still clear their shared pending-ask route before waking the origin so a follow-up reply cannot race past route clearance. At 40 ms latency, settling and waking the origin dropped from 162 ms to 41 ms for one delivery and from 244 ms to 41 ms for 10 concurrent deliveries ([#6715](https://github.com/bastani-inc/atomic/issues/6715)).
18
+ - On a shared SQLite database, opening the Intercom broker now batches every store's schema setup, missing columns, generated address columns, indexes, counter seeds and schema stamps into a single write transaction with poll-until-done contention avoidance. Opening a new broker database now takes 1 write lock and 10 thread waits instead of 24 locks and 103 waits, and the second open takes 0 locks and 8 waits instead of 1 lock and 12 waits ([#6709](https://github.com/bastani-inc/atomic/issues/6709)).
19
+
20
+ ### Fixed
21
+
22
+ - On PostgreSQL, the post-commit wake-up notifications sent after a message to an offline recipient no longer enter the database's serial call queue as two separate calls. Before, each notification waited behind and blocked unrelated concurrent transactions on the sender's database handle and checked out two pool connections, raising 95th-percentile send-to-delivery latency under 200 concurrent brokers. Both notifications now go out together through `StorageNotifications.send` in one coalesced round trip without blocking other transactions ([#6712](https://github.com/bastani-inc/atomic/issues/6712)).
23
+ - Fixed an Intercom reply or ask-failure outcome whose durable inbox save failed transiently being silently dropped on subsequent redeliveries over the same connection. Unsaved outcomes are now forgotten when saving fails so a redelivery retries saving and confirms receipt once saved, while already-saved outcomes continue to deduplicate and re-confirm ([#6712](https://github.com/bastani-inc/atomic/issues/6712)).
24
+ - With multi-node routing, plain local sends queued behind an active local `requirePendingReply` reply on a responsive shared store no longer overtake that reply when a single contended database write takes longer than 300 ms; hung databases and hung remote replies still unblock plain local sends within 300 ms ([#6712](https://github.com/bastani-inc/atomic/issues/6712)).
25
+
26
+ ## [0.10.11-alpha.3] - 2026-11-26
27
+
28
+ ### Changed
29
+
30
+ - With multi-node routing, one broker at a time now cleans up the shared database, every 5 minutes, instead of every broker every 30 seconds. Cleanup deletes delivered messages and records past their retention, and expires messages left waiting for 7 days. The checks that recover a stopped broker's sessions still run on every broker every 30 seconds, and now read only the sessions and questions they look for instead of whole tables. The cleanup now finds old rows through indexes and deletes them 1,000 at a time. If the broker doing the cleanup stops, another takes over within about 15 minutes, or within 5 minutes when it shuts down normally. In a test with 200 brokers on PostgreSQL, the database ran 24 cleanup statements a minute, counting each broker's check of which broker cleans up, instead of 3,377, read 0 rows by full table scans instead of 194 million a minute, and spent 0.4 seconds on cleanup over 9 minutes instead of 26 minutes. Older brokers on the same database keep cleaning up as before ([#6675](https://github.com/bastani-inc/atomic/pull/6675)).
31
+ - On PostgreSQL and SQLite, the table of messages waiting for delivery has smaller indexes. The index brokers use to find a session's waiting messages now covers only undelivered messages, so it stays the size of what is still to deliver: 0.2 MB instead of 22.6 MB in the same test. On PostgreSQL the table also leaves 15% of each page free, so renewing a message's delivery can stay on its page. `atomic storage migrate`, run as the owner role, or a broker opened as the owner, makes these changes. Older brokers keep working with the new indexes ([#6675](https://github.com/bastani-inc/atomic/pull/6675)).
32
+ - On PostgreSQL, the lease renewals each broker sends every 10 seconds, for itself, for each of its sessions and for each message it is delivering, no longer wait for the database server to write them to disk. Losing one in a server crash does no harm, because the next renewal repeats it. In a benchmark the server flushed its log about 90% less often for these writes, and each renewal skips a disk flush that takes about 1 to 3 ms on a typical cloud disk. Messages, registrations and every other write still wait for the disk ([#6633](https://github.com/bastani-inc/atomic/pull/6633), [#6560](https://github.com/bastani-inc/atomic/issues/6560)).
33
+ - On PostgreSQL, the short notices that wake another broker when a message arrives for it are now kept in an unlogged table, which the server does not write to its write-ahead log. Each notice writes about 70% less to the log, and its commit no longer waits for a disk flush. A server crash or failover empties the table, which loses only notices: brokers still check for messages every 30 seconds, so every message arrives. New databases get the unlogged table at once. An existing one switches the next time `atomic storage migrate` runs as the owner role. Older Atomic versions keep working with it ([#6639](https://github.com/bastani-inc/atomic/pull/6639), [#6560](https://github.com/bastani-inc/atomic/issues/6560)).
34
+ - On PostgreSQL, recording several delivered messages together now sends the same statement whatever their number, so the server parses and plans it once per connection, and `pg_stat_statements` shows one line for it instead of one per number of messages ([#6644](https://github.com/bastani-inc/atomic/pull/6644), [#6560](https://github.com/bastani-inc/atomic/issues/6560)).
35
+ - With multi-node routing on PostgreSQL, a wake-up now reaches only the broker it is for. Each broker listens on a channel of its own as well as the shared one, so a wake-up no longer goes to every broker for each to check and drop. With 20 brokers, each wake-up used to reach all 20. Sends to the same broker that arrive together share one wake-up, so with 50 to 200 senders a send caused 0.4 to 0.8 wake-ups on average. Brokers of earlier releases still listen only on the shared channel. A broker still notifies that channel for any broker whose registration does not say it listens on its own, so brokers of both releases wake each other while an upgrade rolls out ([#6655](https://github.com/bastani-inc/atomic/pull/6655)).
36
+ - A wake-up for a queued message now names its recipient, and the broker that receives it reads only that recipient's queue instead of the queues of every session it hosts. A wake-up from a broker of an earlier release names no recipient, and still reads every queue ([#6655](https://github.com/bastani-inc/atomic/pull/6655)).
37
+ - On PostgreSQL, a send that wakes another broker no longer makes other such sends wait for it. Its commit used to hold a server-wide lock until it was written to disk. A wake-up now takes 2 round trips instead of 4, and a send to a recipient on another broker takes 1 round trip more than a send that wakes no one, instead of 3 ([#6655](https://github.com/bastani-inc/atomic/pull/6655)).
38
+ - With multi-node routing on PostgreSQL, a message to a session its sender found offline now takes 1 round trip instead of about 4, and no longer holds up other messages to that session while it waits on the network. It still wakes the broker that has the session, if there is one. When many senders write to one session at once, each of these messages now waits well under a second: in a test with 50 senders and 80 ms latency, the median went from about 23 s to under 1 s. Registering a session or a broker also takes 1 round trip instead of 3 for the registration itself ([#6636](https://github.com/bastani-inc/atomic/pull/6636)).
39
+ - Ended-subagent message queues on a shared database no longer block every other writer of that database while a broker retries deleting messages that were already delivered. The retry now only waits for other writes to the same queue ([#6636](https://github.com/bastani-inc/atomic/pull/6636)).
40
+
41
+ ### Fixed
42
+
43
+ - With multi-node routing, a wake-up notice that no broker reads, because its broker has stopped, is now deleted within 30 seconds while brokers keep sending messages, the time after which the 30-second check for missed messages has covered it. It could stay up to 40 seconds, because the cleanup runs at most every 10 seconds ([#6667](https://github.com/bastani-inc/atomic/pull/6667), [#6560](https://github.com/bastani-inc/atomic/issues/6560)).
44
+ - When a session moved to the machine of a session sending it messages, a new message from that sender could arrive before older messages that were waiting for the session while it was offline or on another machine. It happened when the session's broker took longer than about a third of a second to pick up the waiting messages, which is common on a remote PostgreSQL database, or when the machine the session left had not let go of them yet. A new message now waits until the older ones from the same sender have reached the session, and the sender is told to keep waiting meanwhile. Senders with no older messages waiting are not slowed down ([#6651](https://github.com/bastani-inc/atomic/pull/6651), [#6637](https://github.com/bastani-inc/atomic/issues/6637)).
45
+ - With multi-node routing on PostgreSQL, a broker that started before `atomic storage migrate` added the sequence that numbers new session registrations now uses it as soon as it exists, like a broker started afterwards. Before, the two brokers could give two registrations the same number, and lists of sessions then put those two in name order instead of the order they registered in. If someone drops the sequence, registering a session keeps working instead of failing with `relation does not exist`, and the next `atomic storage migrate` creates the sequence again ([#6630](https://github.com/bastani-inc/atomic/pull/6630), [#6560](https://github.com/bastani-inc/atomic/issues/6560)).
46
+ - Intercom calls on a busy shared PostgreSQL database could fail with a lock timeout instead of retrying. A send, a session's registration renewal, a broker taking waiting messages, or a delivery confirmation that waited too long for a lock, or that the database ended to break a deadlock, failed even though nothing had been written. They now try again after a short random wait, up to 5 times, and a send still keeps its place behind the earlier sends to the same session. A send to a session now takes 1 round trip instead of 3 and holds that session's lock only while the database runs it, so sends to a busy session no longer queue behind each other's network round trips. A registration renewal now gives up waiting for a lock after 2 seconds and tries again, so a session no longer goes stale while one renewal waits ([#6626](https://github.com/bastani-inc/atomic/pull/6626)).
47
+ - With multi-node routing, a broker's reads of the shared database now see the writes the broker started before them. These reads cover session presences, known sessions and their bindings. Since 0.10.11-alpha.1 they go through a separate reader connection, so they could miss a presence the broker had just taken or released, or a session it had just recorded. On PostgreSQL, the poll for wake-up hints no longer deletes through the reader connection, which is meant for reads. The poll still takes 1 round trip ([#6632](https://github.com/bastani-inc/atomic/pull/6632)).
48
+
7
49
  ## [0.10.11-alpha.2] - 2026-11-26
8
50
 
9
51
  ### Changed
@@ -379,7 +379,7 @@ graph TB
379
379
  B2 <-->|Local Socket/Pipe| B3
380
380
  ```
381
381
 
382
- The broker is a standalone process that manages session registration and message routing over length-prefixed JSON frames on a Unix domain socket (macOS and Linux) or named pipe (Windows). When [shared storage](https://docs.bastani.ai/storage) is configured through [`@bastani/atomic-storage-libsql`](https://docs.bastani.ai/libraries/storage-libsql) or [`@bastani/atomic-storage-postgres`](https://docs.bastani.ai/libraries/storage-postgres), brokers also enable multi-node routing so sessions on different machines can list and message each other, and ungrouped sessions default to their repository's `project:<owner>/<repo>` group instead of `default`.
382
+ The broker is a standalone process that manages session registration and message routing over length-prefixed JSON frames on a Unix domain socket (macOS and Linux) or named pipe (Windows). When [shared storage](https://docs.bastani.ai/storage) is configured through [`@bastani/atomic-storage-postgres`](https://docs.bastani.ai/libraries/storage-postgres), brokers also enable multi-node routing so sessions on different machines can list and message each other, and ungrouped sessions default to their repository's `project:<owner>/<repo>` group instead of `default`.
383
383
 
384
384
  ### Broker lifecycle and recovery
385
385
 
@@ -404,7 +404,7 @@ Runtime files live in `~/.atomic/agent/intercom/`. Setting [`ATOMIC_CODING_AGENT
404
404
 
405
405
  ## Limitations
406
406
 
407
- - **Local IPC by default:** Without [shared storage](https://docs.bastani.ai/storage), Intercom connects sessions on the same machine only. Cross-machine messaging requires configuring a shared storage adapter ([`@bastani/atomic-storage-libsql`](https://docs.bastani.ai/libraries/storage-libsql) or [`@bastani/atomic-storage-postgres`](https://docs.bastani.ai/libraries/storage-postgres)).
407
+ - **Local IPC by default:** Without [shared storage](https://docs.bastani.ai/storage), Intercom connects sessions on the same machine only. Cross-machine messaging requires configuring a shared storage adapter ([`@bastani/atomic-storage-postgres`](https://docs.bastani.ai/libraries/storage-postgres)).
408
408
  - **No separate transcript file:** Messages are stored in Atomic session history rather than a dedicated Intercom inbox file.
409
409
  - **No attachments UI:** The `intercom` tool supports `file`, `snippet`, and `context` attachments, while the `Alt+M` compose overlay sends plain text only.
410
410
  - **Connected sessions only:** `intercom list` shows sessions currently registered with the broker, not disconnected or offline Atomic processes.