@bastani/atomic 0.10.10 → 0.10.11-alpha.2

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 (402) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/README.md +1 -1
  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 +11 -13
  7. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
  8. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +9 -9
  9. package/dist/_shared/mode-shared-2QJSCUM6.js +55 -18
  10. package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
  11. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  12. package/dist/_shared/runtime-O4KCSG4C.js +5 -5
  13. package/dist/_shared/{sdk-RRLVN7ER.js → sdk-IQMULKFU.js} +2962 -470
  14. package/dist/_shared/sdk-IQMULKFU.js.map +1 -0
  15. package/dist/_shared/session-data-AHTU7IS6.js +4 -4
  16. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  17. package/dist/_shared/settings-startup-8-DNZ2RIHM.js +1 -1
  18. package/dist/_shared/{settings-startup-4QCVCI53.js → settings-startup-HXQLSUWM.js} +8 -2
  19. package/dist/_shared/settings-startup-HXQLSUWM.js.map +1 -0
  20. package/dist/_shared/{startup-0-0-4VG2G44V.js → startup-0-0-3IXNMFM2.js} +482 -53
  21. package/dist/_shared/startup-0-0-3IXNMFM2.js.map +1 -0
  22. package/dist/_shared/{startup-0-1-XTIL65D4.js → startup-0-1-7T2IAE7J.js} +121 -251
  23. package/dist/_shared/startup-0-1-7T2IAE7J.js.map +1 -0
  24. package/dist/_shared/{startup-0-2-27OWFHV6.js → startup-0-2-5QHPCEON.js} +293 -10
  25. package/dist/_shared/startup-0-2-5QHPCEON.js.map +1 -0
  26. package/dist/_shared/{startup-0-3-T4DVFYWX.js → startup-0-3-4ZYBYQNM.js} +273 -14
  27. package/dist/_shared/startup-0-3-4ZYBYQNM.js.map +1 -0
  28. package/dist/_shared/startup-0-4-ZMJV547D.js +6 -6
  29. package/dist/_shared/{startup-0-5-FD2P735I.js → startup-0-5-YDW47QX6.js} +29 -71
  30. package/dist/_shared/startup-0-5-YDW47QX6.js.map +1 -0
  31. package/dist/_shared/startup-10-0-TDQNBDDL.js +9 -9
  32. package/dist/_shared/startup-12-0-55AAXBJZ.js +4 -4
  33. package/dist/_shared/startup-14-0-MLX36RBG.js +6 -6
  34. package/dist/_shared/startup-15-0-YUKGAC63.js +34 -10
  35. package/dist/_shared/startup-15-0-YUKGAC63.js.map +1 -1
  36. package/dist/_shared/startup-15-1-4S7FLMNG.js +10 -9
  37. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  38. package/dist/_shared/startup-8-0-34CBHPZH.js +421 -84
  39. package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
  40. package/dist/_shared/{startup-8-1-4KANEHRA.js → startup-8-1-X32CYSXB.js} +1291 -722
  41. package/dist/_shared/startup-8-1-X32CYSXB.js.map +1 -0
  42. package/dist/_shared/storage-command-7MGXLJGZ.js +17 -9
  43. package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
  44. package/dist/_shared/task-reference-stream-JWMUZSJX.js +1 -1
  45. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  46. package/dist/_shared/tree-outline-MUEPK5B7.js +3 -3
  47. package/dist/builtin/intercom/CHANGELOG.md +29 -0
  48. package/dist/builtin/intercom/broker/broker.bundle.mjs +1138 -384
  49. package/dist/builtin/intercom/broker/database-wake-up-bus.ts +103 -24
  50. package/dist/builtin/intercom/broker/multinode-router.ts +42 -21
  51. package/dist/builtin/intercom/broker/multinode-state-store.ts +22 -1
  52. package/dist/builtin/intercom/broker/open-broker-state.ts +82 -31
  53. package/dist/builtin/intercom/broker/paths.ts +8 -4
  54. package/dist/builtin/intercom/broker/released-asker-remote-replies.ts +18 -6
  55. package/dist/builtin/intercom/broker/sql-add-column.ts +4 -1
  56. package/dist/builtin/intercom/broker/sql-ended-child-queue-store.ts +65 -44
  57. package/dist/builtin/intercom/broker/sql-held-send-store.ts +11 -3
  58. package/dist/builtin/intercom/broker/sql-known-session-store.ts +24 -12
  59. package/dist/builtin/intercom/broker/sql-lease-store.ts +386 -65
  60. package/dist/builtin/intercom/broker/sql-outbox-store.ts +462 -130
  61. package/dist/builtin/intercom/broker/sql-pending-ask-store.ts +20 -9
  62. package/dist/builtin/intercom/broker/sql-released-ask-store.ts +14 -6
  63. package/dist/builtin/intercom/broker/sql-restoring-reservation-store.ts +27 -11
  64. package/dist/builtin/intercom/broker/sql-schema.ts +198 -5
  65. package/dist/builtin/intercom/broker/sql-sent-message-authority.ts +97 -34
  66. package/dist/builtin/intercom/index.bundle.mjs +11 -8
  67. package/dist/builtin/intercom/package.json +1 -1
  68. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  69. package/dist/builtin/mcp/package.json +1 -1
  70. package/dist/builtin/subagents/CHANGELOG.md +18 -0
  71. package/dist/builtin/subagents/package.json +1 -1
  72. package/dist/builtin/subagents/skills/skill-creator/SKILL.md +1 -1
  73. package/dist/builtin/subagents/src/extension/index.bundle.mjs +62 -23
  74. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  75. package/dist/builtin/web-access/package.json +1 -1
  76. package/dist/cli/args.js +2 -2
  77. package/dist/cli/auth-cli.code.js +6 -6
  78. package/dist/cli/auth-cli.impl.js +3 -3
  79. package/dist/cli/auth-cli.js +3 -3
  80. package/dist/cli/blueprint-command.code.js +4 -4
  81. package/dist/cli/blueprint-command.impl.js +3 -3
  82. package/dist/cli/blueprint-command.js +3 -3
  83. package/dist/cli/intercom-command.code.js +3 -3
  84. package/dist/cli/intercom-command.impl.js +3 -3
  85. package/dist/cli/intercom-command.js +3 -3
  86. package/dist/cli/list-models.code.js +2 -2
  87. package/dist/cli/list-models.impl.js +3 -3
  88. package/dist/cli/list-models.js +3 -3
  89. package/dist/cli/session-picker.code.js +2 -2
  90. package/dist/cli/session-picker.impl.js +3 -3
  91. package/dist/cli/session-picker.js +3 -3
  92. package/dist/cli/startup-ui.code.js +2 -2
  93. package/dist/cli/startup-ui.impl.js +3 -3
  94. package/dist/cli/startup-ui.js +3 -3
  95. package/dist/cli/storage-command.impl.js +3 -3
  96. package/dist/cli/storage-command.js +3 -3
  97. package/dist/cli/storage-search-session.code.js +3 -3
  98. package/dist/cli/storage-search-session.impl.js +3 -3
  99. package/dist/cli/storage-search-session.js +3 -3
  100. package/dist/cli/team-command.code.js +3 -3
  101. package/dist/cli/team-command.impl.js +3 -3
  102. package/dist/cli/team-command.js +3 -3
  103. package/dist/cli.js +2 -2
  104. package/dist/core/agent-session-methods.d.ts +3 -0
  105. package/dist/core/agent-session-methods.js.map +1 -1
  106. package/dist/core/agent-session.d.ts +1 -0
  107. package/dist/core/compaction/compactor.d.ts +2 -0
  108. package/dist/core/debug.impl.js +3 -3
  109. package/dist/core/debug.js +3 -3
  110. package/dist/core/export-html/card-projection.code.js +1 -1
  111. package/dist/core/export-html/card-projection.impl.js +3 -3
  112. package/dist/core/export-html/card-projection.js +3 -3
  113. package/dist/core/export-html/index.code.js +2 -2
  114. package/dist/core/export-html/index.impl.js +3 -3
  115. package/dist/core/export-html/index.js +3 -3
  116. package/dist/core/export-html/json-spans.impl.js +3 -3
  117. package/dist/core/export-html/json-spans.js +3 -3
  118. package/dist/core/export-html/oversized-render-inputs.code.js +2 -2
  119. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  120. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  121. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  122. package/dist/core/export-html/tool-renderer.js +3 -3
  123. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  124. package/dist/core/extensions/jiti-loader.js +3 -3
  125. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  126. package/dist/core/extensions/jiti-static-loader.js +3 -3
  127. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  128. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  129. package/dist/core/extensions/loader-host-modules.js +3 -3
  130. package/dist/core/extensions/loader-virtual-modules.js +2 -2
  131. package/dist/core/extensions/runner-context.js +4 -4
  132. package/dist/core/extensions/runner-context.js.map +1 -1
  133. package/dist/core/intercom-broker-control-host.code.js +1 -1
  134. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  135. package/dist/core/intercom-broker-control-host.js +3 -3
  136. package/dist/core/intercom-broker-control.code.js +3 -3
  137. package/dist/core/intercom-broker-control.impl.js +3 -3
  138. package/dist/core/intercom-broker-control.js +3 -3
  139. package/dist/core/model-registry.js +1 -1
  140. package/dist/core/model-resolver-defaults.d.ts +3 -2
  141. package/dist/core/package-manager-storage-adapters.code.js +1 -1
  142. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  143. package/dist/core/package-manager-storage-adapters.js +3 -3
  144. package/dist/core/sdk.code.js +4 -5
  145. package/dist/core/sdk.impl.js +3 -3
  146. package/dist/core/sdk.js +3 -3
  147. package/dist/core/session-manager-core.d.ts +5 -2
  148. package/dist/core/session-manager-core.js +39 -23
  149. package/dist/core/session-manager-core.js.map +1 -1
  150. package/dist/core/session-manager-list.impl.js +3 -3
  151. package/dist/core/session-manager-list.js +3 -3
  152. package/dist/core/session-manager.code.js +3 -3
  153. package/dist/core/session-manager.impl.js +3 -3
  154. package/dist/core/session-manager.js +3 -3
  155. package/dist/core/session-open-markers.js +3 -0
  156. package/dist/core/session-open-markers.js.map +1 -0
  157. package/dist/core/session-storage.code.js +1 -1
  158. package/dist/core/session-storage.impl.js +3 -3
  159. package/dist/core/session-storage.js +3 -3
  160. package/dist/core/storage/added-exports.d.ts +6 -0
  161. package/dist/core/storage/added-exports.js +19 -0
  162. package/dist/core/storage/added-exports.js.map +1 -0
  163. package/dist/core/storage/database.d.ts +53 -0
  164. package/dist/core/storage/database.js.map +1 -1
  165. package/dist/core/storage/fenced-paths.d.ts +47 -0
  166. package/dist/core/storage/fenced-paths.js +53 -0
  167. package/dist/core/storage/fenced-paths.js.map +1 -1
  168. package/dist/core/storage/file-identity.js +31 -2
  169. package/dist/core/storage/file-identity.js.map +1 -1
  170. package/dist/core/storage/index.d.ts +4 -1
  171. package/dist/core/storage/index.js +5 -2
  172. package/dist/core/storage/index.js.map +1 -1
  173. package/dist/core/storage/migrations.d.ts +33 -2
  174. package/dist/core/storage/migrations.js +73 -5
  175. package/dist/core/storage/migrations.js.map +1 -1
  176. package/dist/core/storage/node-sqlite-thread.js +48 -6
  177. package/dist/core/storage/node-sqlite-thread.js.map +1 -1
  178. package/dist/core/storage/node-sqlite.js +137 -4
  179. package/dist/core/storage/node-sqlite.js.map +1 -1
  180. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  181. package/dist/core/storage/offline-snapshot-file.js +3 -3
  182. package/dist/core/storage/prefix.d.ts +3 -2
  183. package/dist/core/storage/prefix.js +23 -2
  184. package/dist/core/storage/prefix.js.map +1 -1
  185. package/dist/core/storage/provider.js +2 -2
  186. package/dist/core/storage/schema-catalog.d.ts +120 -0
  187. package/dist/core/storage/schema-catalog.js +351 -0
  188. package/dist/core/storage/schema-catalog.js.map +1 -0
  189. package/dist/core/storage/selection.js +2 -2
  190. package/dist/core/storage/session/branch-fork-source.code.js +47 -25
  191. package/dist/core/storage/session/branch-fork-source.code.js.map +1 -1
  192. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  193. package/dist/core/storage/session/branch-fork-source.js +3 -3
  194. package/dist/core/storage/session/card-view.impl.js +3 -3
  195. package/dist/core/storage/session/card-view.js +3 -3
  196. package/dist/core/storage/session/child-reader.code.js +4 -4
  197. package/dist/core/storage/session/child-reader.impl.js +3 -3
  198. package/dist/core/storage/session/child-reader.js +3 -3
  199. package/dist/core/storage/session/chunked-resume-projection.code.js +1 -1
  200. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  201. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  202. package/dist/core/storage/session/errors.js +1 -1
  203. package/dist/core/storage/session/expanded-child-details.code.js +4 -4
  204. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  205. package/dist/core/storage/session/expanded-child-details.js +3 -3
  206. package/dist/core/storage/session/fork-detach.d.ts +118 -0
  207. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  208. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  209. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  210. package/dist/core/storage/session/fork-row-index.js +3 -3
  211. package/dist/core/storage/session/fork-schema.js +53 -0
  212. package/dist/core/storage/session/fork-schema.js.map +1 -0
  213. package/dist/core/storage/session/fork-segments.d.ts +58 -0
  214. package/dist/core/storage/session/fork-staging.code.js +176 -36
  215. package/dist/core/storage/session/fork-staging.code.js.map +1 -1
  216. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  217. package/dist/core/storage/session/fork-staging.js +3 -3
  218. package/dist/core/storage/session/fork-sweep.js +61 -0
  219. package/dist/core/storage/session/fork-sweep.js.map +1 -0
  220. package/dist/core/storage/session/fork-window.code.js +4 -4
  221. package/dist/core/storage/session/fork-window.impl.js +3 -3
  222. package/dist/core/storage/session/fork-window.js +3 -3
  223. package/dist/core/storage/session/history-pages.impl.js +3 -3
  224. package/dist/core/storage/session/history-pages.js +3 -3
  225. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  226. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  227. package/dist/core/storage/session/jsonl-session-store.d.ts +37 -1
  228. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  229. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  230. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  231. package/dist/core/storage/session/memory-session-store.js +3 -3
  232. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  233. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  234. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  235. package/dist/core/storage/session/released-history-files.code.js +3 -3
  236. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  237. package/dist/core/storage/session/released-history-files.js +3 -3
  238. package/dist/core/storage/session/resident-fork-rows.code.js +1 -1
  239. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  240. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  241. package/dist/core/storage/session/session-resume.impl.js +3 -3
  242. package/dist/core/storage/session/session-resume.js +3 -3
  243. package/dist/core/storage/session/session-search-index.d.ts +5 -0
  244. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  245. package/dist/core/storage/session/snapshot-cut.js +3 -3
  246. package/dist/core/storage/session/snapshot-history.code.js +4 -4
  247. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  248. package/dist/core/storage/session/snapshot-history.js +3 -3
  249. package/dist/core/storage/session/sql-chat-records.d.ts +15 -0
  250. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  251. package/dist/core/storage/session/sql-session-store.d.ts +445 -11
  252. package/dist/core/storage/session/sql-session-store.impl.js +4 -4
  253. package/dist/core/storage/session/sql-session-store.js +4 -4
  254. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  255. package/dist/core/storage/session/tree-outline.js +3 -3
  256. package/dist/core/storage/session/tree-presentation.code.js +1 -1
  257. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  258. package/dist/core/storage/session/tree-presentation.js +3 -3
  259. package/dist/core/storage/session/types.d.ts +36 -0
  260. package/dist/core/storage/sqlite-facade.d.ts +54 -6
  261. package/dist/core/storage/sqlite-facade.js +384 -18
  262. package/dist/core/storage/sqlite-facade.js.map +1 -1
  263. package/dist/core/storage/statement-sequence.d.ts +83 -0
  264. package/dist/core/storage/statement-sequence.js +21 -0
  265. package/dist/core/storage/statement-sequence.js.map +1 -1
  266. package/dist/core/storage/storage-status.code.js +1 -1
  267. package/dist/core/storage/storage-status.impl.js +3 -3
  268. package/dist/core/storage/storage-status.js +3 -3
  269. package/dist/core/storage/team.code.js +1 -1
  270. package/dist/core/storage/team.impl.js +3 -3
  271. package/dist/core/storage/team.js +3 -3
  272. package/dist/core/structured-output/index.code.js +1 -1
  273. package/dist/core/structured-output/index.impl.js +3 -3
  274. package/dist/core/structured-output/index.js +3 -3
  275. package/dist/core/tasks/task-completion-entry.code.js +1 -1
  276. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  277. package/dist/core/tasks/task-completion-entry.js +3 -3
  278. package/dist/core/tasks/task-file-history.code.js +4 -4
  279. package/dist/core/tasks/task-file-history.impl.js +3 -3
  280. package/dist/core/tasks/task-file-history.js +3 -3
  281. package/dist/core/tasks/task-reference-archive.code.js +5 -5
  282. package/dist/core/tasks/task-reference-archive.js +3 -3
  283. package/dist/core/tasks/task-reference-identity.js +3 -3
  284. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  285. package/dist/core/tasks/task-reference-stream.js +3 -3
  286. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  287. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  288. package/dist/core/tasks/task-view-source.code.js +1 -1
  289. package/dist/core/tasks/task-view-source.impl.js +3 -3
  290. package/dist/core/tasks/task-view-source.js +3 -3
  291. package/dist/core/tools/bash.d.ts +8 -4
  292. package/dist/core/tools/history-session.d.ts +7 -0
  293. package/dist/core/tools/history-tasks.d.ts +123 -0
  294. package/dist/core/tools/kill.d.ts +5 -2
  295. package/dist/core/tools/powershell.d.ts +2 -2
  296. package/dist/core/tools/read-url.code.js +3 -3
  297. package/dist/core/tools/read-url.impl.js +3 -3
  298. package/dist/core/tools/read-url.js +3 -3
  299. package/dist/core/tools/read.d.ts +12 -2
  300. package/dist/core/tools/resource-selectors.d.ts +2 -0
  301. package/dist/core/tools/search.d.ts +12 -2
  302. package/dist/core/worktree-snapshot/blob-store.d.ts +45 -2
  303. package/dist/core/worktree-snapshot/blob-store.js +228 -60
  304. package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
  305. package/dist/core/worktree-snapshot/errors.code.js +3 -3
  306. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  307. package/dist/core/worktree-snapshot/errors.js +3 -3
  308. package/dist/core/worktree-snapshot/fork-snapshot-index.js +121 -0
  309. package/dist/core/worktree-snapshot/fork-snapshot-index.js.map +1 -0
  310. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  311. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  312. package/dist/extensions/codemode/execute.code.js +3 -3
  313. package/dist/extensions/codemode/execute.impl.js +3 -3
  314. package/dist/extensions/codemode/execute.js +3 -3
  315. package/dist/extensions/codemode/renderer.code.js +2 -2
  316. package/dist/extensions/codemode/renderer.impl.js +3 -3
  317. package/dist/extensions/codemode/renderer.js +3 -3
  318. package/dist/extensions/mcp/cli.code.js +3 -3
  319. package/dist/extensions/mcp/cli.impl.js +3 -3
  320. package/dist/extensions/mcp/cli.js +3 -3
  321. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  322. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  323. package/dist/extensions/mcp/cli.lazy.js +3 -3
  324. package/dist/extensions/mcp/runtime.code.js +1 -1
  325. package/dist/extensions/mcp/runtime.impl.js +3 -3
  326. package/dist/extensions/mcp/runtime.js +3 -3
  327. package/dist/index.js +8 -8
  328. package/dist/main-first-time-setup.code.js +2 -2
  329. package/dist/main-first-time-setup.impl.js +3 -3
  330. package/dist/main-first-time-setup.js +3 -3
  331. package/dist/main.js +1 -1
  332. package/dist/modes/interactive/components/agent-panel.d.ts +1 -0
  333. package/dist/modes/interactive/components/stored-tree-view.code.js +3 -3
  334. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  335. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  336. package/dist/modes/interactive/components/task-inspector.d.ts +2 -0
  337. package/dist/modes/interactive/components/user-message-selector-archive.code.js +1 -1
  338. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  339. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  340. package/dist/modes/interactive/interactive-mode-helpers.d.ts +2 -2
  341. package/dist/modes/print-mode.js +1 -1
  342. package/dist/modes/rpc/agent-panel-bridge.d.ts +5 -0
  343. package/dist/package-manager-cli.code.js +7 -7
  344. package/dist/package-manager-cli.impl.js +3 -3
  345. package/dist/package-manager-cli.js +3 -3
  346. package/dist/rpc-entry.js +1 -1
  347. package/dist/startup-files.json +1 -1
  348. package/dist/startup-stages/0.js +1 -1
  349. package/dist/startup-stages/1.js +1 -1
  350. package/dist/startup-stages/10.js +1 -1
  351. package/dist/startup-stages/12.js +1 -1
  352. package/dist/startup-stages/2.js +9 -1
  353. package/dist/startup-stages/3.js +1 -6
  354. package/dist/startup-stages/5.js +1 -1
  355. package/dist/startup-stages/7.js +1 -1
  356. package/dist/startup-stages/8.js +2 -2
  357. package/dist/utils/startup-database-spare.code.js +3 -3
  358. package/dist/utils/startup-database-spare.impl.js +3 -3
  359. package/dist/utils/startup-database-spare.js +3 -3
  360. package/dist/utils/tools-manager.code.js +1 -1
  361. package/dist/utils/tools-manager.impl.js +3 -3
  362. package/dist/utils/tools-manager.js +3 -3
  363. package/docs/background-tasks.md +123 -23
  364. package/docs/compaction.md +18 -0
  365. package/docs/docs.json +2 -0
  366. package/docs/environment-variables.md +1 -1
  367. package/docs/getting-started/installation.md +9 -2
  368. package/docs/guides/postgres-pgbouncer.md +346 -0
  369. package/docs/guides/postgres-tuning.md +311 -0
  370. package/docs/guides/resume-on-any-machine.md +2 -2
  371. package/docs/guides.md +2 -0
  372. package/docs/index.md +1 -1
  373. package/docs/libraries/agent-core.md +1 -1
  374. package/docs/libraries/ai.md +2 -2
  375. package/docs/libraries/codemode.md +1 -1
  376. package/docs/libraries/storage-libsql.md +6 -1
  377. package/docs/libraries/storage-postgres.md +11 -6
  378. package/docs/libraries/tui.md +1 -1
  379. package/docs/libraries.md +2 -2
  380. package/docs/programmatic.md +1 -1
  381. package/docs/quickstart.md +1 -1
  382. package/docs/sdk/storage.md +1 -1
  383. package/docs/sdk/web-server.md +1 -3
  384. package/docs/sdk.md +1 -7
  385. package/docs/sessions.md +67 -2
  386. package/docs/settings.md +20 -1
  387. package/docs/skills/authoring.md +1 -1
  388. package/docs/skills.md +79 -6
  389. package/docs/storage.md +305 -14
  390. package/docs/subagents/reference.md +2 -2
  391. package/docs/subagents.md +4 -3
  392. package/docs/tools.md +44 -10
  393. package/docs/windows.md +1 -1
  394. package/package.json +9 -9
  395. package/dist/_shared/sdk-RRLVN7ER.js.map +0 -1
  396. package/dist/_shared/settings-startup-4QCVCI53.js.map +0 -1
  397. package/dist/_shared/startup-0-0-4VG2G44V.js.map +0 -1
  398. package/dist/_shared/startup-0-1-XTIL65D4.js.map +0 -1
  399. package/dist/_shared/startup-0-2-27OWFHV6.js.map +0 -1
  400. package/dist/_shared/startup-0-3-T4DVFYWX.js.map +0 -1
  401. package/dist/_shared/startup-0-5-FD2P735I.js.map +0 -1
  402. package/dist/_shared/startup-8-1-4KANEHRA.js.map +0 -1
@@ -1,29 +1,29 @@
1
1
  import { __commonJSMin, __name, __require, __toESM } from "./rolldown-runtime-BGM3D5V3.js";
2
2
  import { APP_NAME, BUILTIN_PACKAGE_DIR_NAMES, CONFIG_DIR_NAME, ENV_AGENT_DIR, ENV_DEBUG, ENV_OFFLINE, ENV_PACKAGE_DIR, ENV_SELF_UPDATE_COMMAND, ENV_SESSION_DIR, ENV_SHARE_VIEWER_URL, ENV_STDIN_TIMEOUT_MS, ENV_TELEMETRY, INSTALLED_EXTENSION_ENTRIES, SOURCE_EXTENSION_ENTRIES, VERSION, createChildProcessEnvironment, createModuleRequire, findHelperExecutableAsync, getAgentDir, getAgentDirs, getBinDir, getEnvValue, getPackageDir, helperLaunchAsync, isBunBinary, isBundledBuild, isChildProcessExitStatusUnknownError, missingHelperOptions, resolvePath, stripBom, waitForChildProcess } from "./p0-cli-BB45ZQY6.js";
3
- import { BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, CountdownTimer, Diff, DynamicBorder, EventSourceError, FORKED_PACKAGE_NAMES, FileToolAbortedError, FramedSelector, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionTimeoutError, GitUnavailableError, JSON_RPC_ERROR_CODES, LlamaServerRequestError, LlamaServerUnreachableError, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, ROW_INTENT_META, STALE_EXTENSION_CONTEXT_MESSAGE, SUPPORTED_PROTOCOL_VERSIONS, Stop, SubscriptionClosedError, SubscriptionConfigError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, TASK_MARKS, TaskCleanupError, TaskEvictedError, ToolDetachmentError, VALID_THINKING_LEVELS, abortSymbol, applyExifOrientation, applySessionSummaryEntries, asyncScope, attachCleanupCause as attachCleanupCause$1, attachGitCleanupFailure, attachSessionClaim, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, combineUsage, compactTemplate, compactUrl, createGitEnvironment, createOwnedAbortController, decodeChatOrder, decodeChatRecord, defaultToolNamesFor, deserializeToolDetachmentError, encodeChatOrder, fetchWithRetry, fieldTone, firstChatOrders, flushable, formatSize, formatTodoId, formatTokenCount, getBuiltinPackageLocations, getDefaultCacheRetention, getDefaultSessionDirPath, getFinalValue, getFunctionList, getManyValues, getPiUserAgent, getProviderLoginHelp, getResourcePathKeyAsync, getTodoStatus, getTodoTitle, getToolListError, holdProcessDescendants, isEventSourceError, isExtensionStartupFailure, isFinalValue, isFlushable, isFunctionList, isGitProvisionError, isGitUnavailableError, isInstallTelemetryEnabled, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isManagedToolError, isMandatoryRuntimeTool, isMany, isObject, isStop, isSyntheticPath, isTodoClosed, isTrustedMandatoryRuntimeTool, isValidThinkingLevel, leadingAndTrailingWs, leadingWs, longestCommonPrefix, longestCommonSuffix, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, none, normalizeDisplayText, normalizeTodoId, parseTranscriptFrameLayout, registerCanonicalEventBus, removePrefix, removeSuffix, renderToolPath, replacePrefix, replaceSuffix, replaceTabs, reportContained, require_constants, require_debug, require_identity, require_ignore, require_parse_url, require_sha256, require_stringifyNumber, require_util_contains_newline, rowTone, segment, setFunctionList, sharedClockNow, sharedWakeDispatcher, sleep as sleep$1, spanElapsedMs, spawnHostProcess, splitTodosByAssignment, stop, str as str$1, stripFenceMarkers, styleFieldTone, summarizeSession, toError, trailingWs, uniquifyToolCallIds, validQuestionnaire, withCleanup, withLegacyPackageNames, yieldToEventLoop, yieldTurn } from "./startup-0-0-4VG2G44V.js";
3
+ import { BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, CountdownTimer, Diff, DynamicBorder, EventSourceError, FORKED_PACKAGE_NAMES, FileToolAbortedError, FramedSelector, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionTimeoutError, GitUnavailableError, JSON_RPC_ERROR_CODES, LlamaServerRequestError, LlamaServerUnreachableError, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, ROW_INTENT_META, STALE_EXTENSION_CONTEXT_MESSAGE, SUPPORTED_PROTOCOL_VERSIONS, Stop, SubscriptionClosedError, SubscriptionConfigError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, TASK_MARKS, TaskCleanupError, TaskEvictedError, ToolDetachmentError, VALID_THINKING_LEVELS, abortSymbol, applyExifOrientation, applySessionSummaryEntries, asyncScope, attachCleanupCause as attachCleanupCause$1, attachGitCleanupFailure, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, combineUsage, compactTemplate, compactUrl, createGitEnvironment, createOwnedAbortController, decodeChatOrder, decodeChatRecord, defaultToolNamesFor, deserializeToolDetachmentError, encodeChatOrder, fetchWithRetry, fieldTone, firstChatOrders, flushable, formatSize, formatTodoId, formatTokenCount, getBuiltinPackageLocations, getDefaultCacheRetention, getDefaultSessionDirPath, getFinalValue, getFunctionList, getManyValues, getPiUserAgent, getProviderLoginHelp, getResourcePathKeyAsync, getTodoStatus, getTodoTitle, getToolListError, holdProcessDescendants, isEventSourceError, isExtensionStartupFailure, isFinalValue, isFlushable, isFunctionList, isGitProvisionError, isGitUnavailableError, isInstallTelemetryEnabled, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isManagedToolError, isMandatoryRuntimeTool, isMany, isObject, isPathInside, isStop, isSyntheticPath, isTodoClosed, isTrustedMandatoryRuntimeTool, isValidThinkingLevel, joinForkSegments, leadingAndTrailingWs, leadingWs, longestCommonPrefix, longestCommonSuffix, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, none, normalizeDisplayText, normalizeTodoId, parseTranscriptFrameLayout, registerCanonicalEventBus, removePrefix, removeSuffix, renderToolPath, replacePrefix, replaceSuffix, replaceTabs, reportContained, require_constants, require_debug, require_identity, require_ignore, require_parse_url, require_sha256, require_stringifyNumber, require_util_contains_newline, rowTone, segment, segmentLength, sessionWriteTransaction, setFunctionList, sharedWakeDispatcher, sleep as sleep$1, spanElapsedMs, spawnHostProcess, splitTodosByAssignment, stop, str as str$1, stripFenceMarkers, styleFieldTone, summarizeSession, toError, trailingWs, uniquifyToolCallIds, validQuestionnaire, withCleanup, withLegacyPackageNames, yieldToEventLoop, yieldTurn } from "./startup-0-0-3IXNMFM2.js";
4
4
  import { CodeHighlighter, OVERLAY_ACTIVE_ROW_MARKER, getLanguageFromPath, graphemeAt, highlightCode, keyHint, loadPhoton, navActionText, navFirstKeyText, parenthesizedKeyHint, rawKeyHint, renderNavHintLine, singleLineDisplayText, terminalDisplayCursor, terminalDisplayText, theme } from "./p2-shell-main-B2WIALFD.js";
5
- import { failureDebugFields, findInCauseChain, hasErrorIdentity, ownProcessStartToken, readProcessStartToken, reportDebugAsync, serializeErrorCause } from "./p1b-elig-ENCUPKKJ.js";
5
+ import { failureDebugFields, findInCauseChain, hasErrorIdentity, reportDebugAsync, serializeErrorCause } from "./p1b-elig-ENCUPKKJ.js";
6
6
  import { windowsPowerShellEnvironment } from "./p1-elig-shell-WWRO3L2R.js";
7
- import { SessionOpenElsewhereError, parseSerializedDecisionError } from "./settings-startup-4QCVCI53.js";
7
+ import { parseSerializedDecisionError } from "./settings-startup-HXQLSUWM.js";
8
8
  import { SETTINGS_DEFAULTS } from "./p2-common-YLSYXMDQ.js";
9
9
  import { interactiveEngineStartupEnv } from "./p1a-prewarm-XIU57JHF.js";
10
- import { access, lstat, mkdir, open, readFile, readdir, rename, rm, rmdir, stat, unlink, writeFile } from "node:fs/promises";
10
+ import { access, lstat, open, readFile, readdir, rename, rm, stat, unlink } from "node:fs/promises";
11
11
  import { existsSync, readFileSync, readdirSync, statSync } from "fs";
12
12
  import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "path";
13
- import { constants as constants$1, hostname } from "node:os";
13
+ import { constants as constants$1 } from "node:os";
14
14
  import { basename as basename$1, dirname as dirname$1, extname, isAbsolute as isAbsolute$1, join as join$1, relative as relative$1, resolve as resolve$1, sep as sep$1 } from "node:path";
15
15
  import { execFile, spawn, spawnSync } from "node:child_process";
16
16
  import { execFile as execFile$1, spawnSync as spawnSync$1 } from "child_process";
17
17
  import { arch, hostname as hostname$1, platform } from "os";
18
18
  import { pathExists } from "../utils/path-exists.js";
19
- import { constants as constants$2, readFileSync as readFileSync$1, readdirSync as readdirSync$1, rmSync as rmSync$1, rmdirSync as rmdirSync$1, statSync as statSync$1 } from "node:fs";
19
+ import { constants as constants$2, readFileSync as readFileSync$1, readdirSync as readdirSync$1, statSync as statSync$1 } from "node:fs";
20
20
  import { CACHE_WARMING_MAX_AGE_MS, CACHE_WARMING_MAX_IDLE_AGE_MS, GitHubCopilotStreamEndedEarlyError, OAuthRefreshRejectedError, Type, evaluateCacheWarming, findGitHubCopilotError, findTlsCertificateRefusal, getCacheWarmingDelayMs, getCacheWarmingRequestOptions, getCurrentTools, getPromptCacheTtlMs as getPromptCacheTtlMs$1, getTlsCertificateRefusal, isCacheWarmingReplayable, isModelType, isOAuthRefreshRejectedError, isPermanentRefreshRejection, lazyStream, normalizeProviderId, parseOAuthErrorBody, validateToolArguments } from "@bastani/atomic-ai";
21
21
  import { Container, Input, Key, Markdown, Spacer, Text, fuzzyFilter, getCapabilities, getKeybindings, getSelectPageIndex, matchesKey, setImageTranscoder, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@bastani/atomic-tui";
22
22
  import chalk from "chalk";
23
23
  import { SessionBlobError, StorageConfigError, StorageError, isStorageError, rehydrateStorageError, serializeStorageError } from "../core/storage/errors.js";
24
24
  import { renderStorageIdentifiers, storageMigrationTable, validateStoragePrefix } from "../core/storage/prefix.js";
25
25
  import { chmod as chmod$1, lstat as lstat$1, mkdir as mkdir$1, mkdtemp as mkdtemp$1, open as open$1, readFile as readFile$1, readdir as readdir$1, readlink as readlink$1, rename as rename$1, rm as rm$1, stat as stat$2, utimes as utimes$1, writeFile as writeFile$1 } from "fs/promises";
26
- import { createHash, randomBytes, randomUUID } from "node:crypto";
26
+ import { createHash, randomUUID } from "node:crypto";
27
27
  import lockfile from "proper-lockfile";
28
28
  import { StringEnum as StringEnum$1, clampThinkingLevel, getApiProvider } from "@bastani/atomic-ai/compat";
29
29
  import { createHash as createHash$1, randomUUID as randomUUID$1 } from "crypto";
@@ -38,6 +38,7 @@ import { isProxy } from "node:util/types";
38
38
  import { Type as Type$1 } from "@bastani/atomic-ai/utils/typebox/index";
39
39
  import { dialectOf } from "../core/storage/dialect.js";
40
40
  import { applyStorageMigrations, withShortSchemaLockWaits } from "../core/storage/migrations.js";
41
+ import { schemaCatalogOf } from "../core/storage/schema-catalog.js";
41
42
  import { sequenceRunner } from "../core/storage/statement-sequence.js";
42
43
  import { TextDecoder as TextDecoder$1 } from "util";
43
44
  import { ModelThinkingLevelSchema } from "@bastani/atomic-ai/providers/model-schema";
@@ -240,7 +241,7 @@ const BUILTIN_TOOL_HELP_DESCRIPTIONS = {
240
241
  read: "Read path selectors (files, dirs, archives, URLs)",
241
242
  bash: "Execute shell commands",
242
243
  powershell: "Execute PowerShell commands on Windows",
243
- kill: "Stop an owned background shell task by task ID (default)",
244
+ kill: "Stop a background shell or history task by its task ID (default)",
244
245
  edit: "Edit files with find/replace",
245
246
  write: "Create or overwrite writable path selectors",
246
247
  find: "Find filesystem paths by glob pattern (default)",
@@ -2857,247 +2858,55 @@ function formatResumeTimings(timings) {
2857
2858
  if (timings.firstPromptReadyMs !== null) lines.push(`ready after ${seconds(timings.firstPromptReadyMs)} s`);
2858
2859
  return lines;
2859
2860
  }
2860
- // dist/core/session-open-markers.js
2861
+ // dist/core/storage/session/fork-detach-map.js
2861
2862
  /**
2862
- * Which sessions are running (#4971): a process that runs a session keeps a marker for it, refreshed on a heartbeat and
2863
- * removed when the session closes or the process exits. A store that keeps markers (`SessionStore.openMarkers`, a table
2864
- * in a SQL store) holds them, so every host and agent directory sharing the store sees them; for any other store they
2865
- * are files under the agent directory, `open-sessions/<session id>/<token>.json`. Deleting a session that has a fresh
2866
- * marker, from another process or from another session of the same process, is refused. A marker of a process on
2867
- * this host counts while that process runs, however long it was suspended; one of another host counts while its
2868
- * heartbeat is fresh, judged on the clock that stamps the marker (#5058): the store's, or the shared file system's.
2863
+ * Segment arithmetic for detaching lazy forks (detach_ancestor): which rows a detach page copies, and when a sibling's
2864
+ * segments can be re-pointed at a detached child. See fork-segments.ts for what a segment is.
2869
2865
  */
2870
- /** How often a held marker's heartbeat is refreshed. */
2871
- const HEARTBEAT_MS = 15e3;
2872
- /** How old the heartbeat of another host's marker may be before the marker no longer counts. */
2873
- const STALE_MS = 4 * HEARTBEAT_MS;
2874
2866
  /**
2875
- * How long a marker of this host that does not say when its holder started counts while a process with its pid runs: a
2876
- * later process may have been given the pid (#5058).
2867
+ * The first `rows` rows of `segment`, which a detach page copies into the child, and what remains of the segment
2868
+ * after them; `rest` is undefined when the page takes the whole segment. Copying `page` and replacing `segment` with
2869
+ * `rest` in one transaction leaves the child's view unchanged: no seq is covered both by a segment and by a row of its own.
2877
2870
  */
2878
- const UNSTARTED_MARKER_LIMIT_MS = 864e5;
2879
- const PROCESS_NONCE = randomBytes(8).toString("hex");
2880
- let processToken;
2881
- /**
2882
- * This process's markers: its pid, a nonce that tells it from an earlier process given the same pid, and when it
2883
- * started, where that can be read, which tells it from a later one (#5058). Fixed once first used.
2884
- */
2885
- function ownToken() {
2886
- if (processToken === void 0) {
2887
- const started = ownProcessStartToken();
2888
- processToken = `${process.pid}-${PROCESS_NONCE}${started === void 0 ? "" : `-${started}`}`;
2889
- }
2890
- return processToken;
2891
- }
2892
- async function prepareSessionOpenMarkers() {
2893
- await readProcessStartToken(process.pid);
2894
- }
2895
- /** A marker token that names when its holder started. */
2896
- const STARTED_TOKEN = /^\d+-[0-9a-f]{16}-([0-9a-f]{12})$/;
2897
- /** The session ids a marker directory can be named after, as `assertValidSessionId` accepts them. */
2898
- const VALID_SESSION_ID = /^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/;
2899
- /** Marker files under an agent directory, for stores that keep no markers. */
2900
- var FileOpenMarkers = class {
2901
- agentDir;
2902
- pending = /* @__PURE__ */ new Map();
2903
- constructor(agentDir) {
2904
- this.agentDir = agentDir;
2905
- }
2906
- directory(sessionId) {
2907
- return join$1(this.agentDir, "open-sessions", sessionId);
2908
- }
2909
- inOrder(path, operation) {
2910
- const result = (this.pending.get(path) ?? Promise.resolve()).then(operation);
2911
- const settled = result.catch(() => {});
2912
- this.pending.set(path, settled);
2913
- settled.then(() => {
2914
- if (this.pending.get(path) === settled) this.pending.delete(path);
2915
- });
2916
- return result;
2917
- }
2918
- put(sessionId, marker) {
2919
- const path = join$1(this.directory(sessionId), `${marker.token}.json`);
2920
- return this.inOrder(path, async () => {
2921
- await mkdir(dirname$1(path), { recursive: true });
2922
- await writeFile(path, JSON.stringify({
2923
- pid: marker.pid,
2924
- host: marker.host
2925
- }));
2926
- });
2927
- }
2928
- remove(sessionId, token) {
2929
- const directory = this.directory(sessionId);
2930
- const path = join$1(directory, `${token}.json`);
2931
- return this.inOrder(path, async () => {
2932
- try {
2933
- await rm(path);
2934
- await rmdir(directory);
2935
- } catch {}
2936
- });
2937
- }
2938
- removeSync(sessionId, token) {
2939
- const directory = this.directory(sessionId);
2940
- try {
2941
- rmSync$1(join$1(directory, `${token}.json`));
2942
- rmdirSync$1(directory);
2943
- } catch {}
2944
- }
2945
- async list(sessionId) {
2946
- const directory = this.directory(sessionId);
2947
- await Promise.all([...this.pending].flatMap(([path, settled]) => dirname$1(path) === directory ? [settled] : []));
2948
- let names;
2949
- try {
2950
- names = await readdir(directory);
2951
- } catch {
2952
- return [];
2953
- }
2954
- if (names.length === 0) return [];
2955
- const now = await sharedClockNow(dirname$1(directory));
2956
- const markers = [];
2957
- for (const name of names) {
2958
- const path = join$1(directory, name);
2959
- try {
2960
- const parsed = JSON.parse(await readFile(path, "utf8"));
2961
- if (typeof parsed.pid !== "number" || typeof parsed.host !== "string") continue;
2962
- const token = name.replace(/\.json$/, "");
2963
- const ageMs = Math.max(0, now - (await stat(path)).mtimeMs);
2964
- markers.push({
2965
- token,
2966
- pid: parsed.pid,
2967
- host: parsed.host,
2968
- ageMs
2969
- });
2970
- } catch {}
2971
- }
2972
- return markers;
2973
- }
2974
- };
2975
- const fileMarkers = /* @__PURE__ */ new Map();
2976
- function fileMarkersIn(agentDir) {
2977
- let markers = fileMarkers.get(agentDir);
2978
- if (markers === void 0) {
2979
- markers = new FileOpenMarkers(agentDir);
2980
- fileMarkers.set(agentDir, markers);
2981
- }
2982
- return markers;
2983
- }
2984
- /** Where `store`'s sessions are marked open: in the store when it keeps markers, else under `agentDir`. */
2985
- function markersFor(store, agentDir) {
2986
- return store?.openMarkers ?? fileMarkersIn(agentDir);
2987
- }
2988
- /** Markers this process holds, by store and then session id. */
2989
- const held = /* @__PURE__ */ new Map();
2990
- let heldCount = 0;
2991
- let heartbeat;
2992
- function ownMarker() {
2993
- return {
2994
- token: ownToken(),
2995
- pid: process.pid,
2996
- host: hostname()
2871
+ function splitSegment(segment, rows) {
2872
+ if (rows >= segmentLength(segment)) return {
2873
+ page: segment,
2874
+ rest: void 0
2997
2875
  };
2998
- }
2999
- function refreshMarkers() {
3000
- for (const sessions of held.values()) for (const marker of sessions.values()) marker.markers.put(marker.sessionId, ownMarker()).catch(() => {});
3001
- }
3002
- process.on("exit", () => {
3003
- for (const sessions of held.values()) for (const marker of sessions.values()) if (marker.markers instanceof FileOpenMarkers) marker.markers.removeSync(marker.sessionId, ownToken());
3004
- });
3005
- /**
3006
- * Records that this process has `sessionId` of `store` open, until the returned function is called, once; holds by
3007
- * one process for one session share a marker. Never throws, and neither does the release: a marker that cannot be
3008
- * written leaves the session unprotected.
3009
- */
3010
- function holdSessionOpenMarker(sessionId, options = {}) {
3011
- if (!VALID_SESSION_ID.test(sessionId)) return async () => {};
3012
- const markers = markersFor(options.store, options.agentDir ?? getAgentDir());
3013
- let sessions = held.get(markers);
3014
- if (sessions === void 0) {
3015
- sessions = /* @__PURE__ */ new Map();
3016
- held.set(markers, sessions);
3017
- }
3018
- let marker = sessions.get(sessionId);
3019
- if (marker === void 0) {
3020
- marker = {
3021
- markers,
3022
- sessionId,
3023
- holds: 0,
3024
- releaseClaim: attachSessionClaim(sessionId)
3025
- };
3026
- sessions.set(sessionId, marker);
3027
- heldCount++;
3028
- markers.put(sessionId, ownMarker()).catch(() => {});
3029
- if (heartbeat === void 0) {
3030
- heartbeat = setInterval(refreshMarkers, HEARTBEAT_MS);
3031
- heartbeat.unref();
3032
- }
3033
- }
3034
- const holding = marker;
3035
- const owner = sessions;
3036
- holding.holds++;
3037
- let released = false;
3038
- return async () => {
3039
- if (released) return;
3040
- released = true;
3041
- if (--holding.holds > 0) return;
3042
- owner.delete(sessionId);
3043
- if (owner.size === 0) held.delete(markers);
3044
- const releasingClaim = holding.releaseClaim?.();
3045
- if (--heldCount === 0 && heartbeat !== void 0) {
3046
- clearInterval(heartbeat);
3047
- heartbeat = void 0;
3048
- }
3049
- await releasingClaim;
3050
- if (held.get(markers)?.has(sessionId)) return;
3051
- await markers.remove(sessionId, ownToken()).catch(() => {});
2876
+ const toSeq = segment.fromSeq + rows - 1;
2877
+ return {
2878
+ page: {
2879
+ ...segment,
2880
+ toSeq
2881
+ },
2882
+ rest: {
2883
+ sourceId: segment.sourceId,
2884
+ fromSeq: toSeq + 1,
2885
+ toSeq: segment.toSeq,
2886
+ baseSeq: segment.baseSeq + rows
2887
+ }
3052
2888
  };
3053
2889
  }
3054
- /** Whether `pid` is a live process on this host; one this process may not signal (EPERM) still exists. */
3055
- function processAlive(pid) {
3056
- try {
3057
- process.kill(pid, 0);
3058
- return true;
3059
- } catch (error) {
3060
- return error.code === "EPERM";
3061
- }
3062
- }
3063
2890
  /**
3064
- * Whether the holder of `marker`, a marker of this host, still runs (#5058): a process with its pid that started when
3065
- * the marker says, or, for a marker that does not say, any process with its pid for a day after its last heartbeat. A
3066
- * marker whose start cannot be read right now is its holder's while a process with its pid runs (#5141).
2891
+ * `sibling`'s segments re-pointed from `parentId` at the detached child `childId`, or undefined when the sibling must
2892
+ * keep reading the parent. `childOnParent` are the child's segments on the parent as they were before the detach. A
2893
+ * sibling is re-pointed only when each of its segments on the parent lies within one of those that maps the parent's
2894
+ * seq `j` to the child's own seq `j`, the prefix the child forked: the sibling then reads the same seqs of the child
2895
+ * that it read of the parent, and those rows of the child are copies of exactly those rows of the parent, so its view
2896
+ * does not change. A sibling that reads parent rows past the child's cut-off would read the child's own later rows
2897
+ * there instead, and one that reads rows a branch fork skipped would read other rows; both are left on the parent, to
2898
+ * be detached on their own.
3067
2899
  */
3068
- async function holderRuns(marker) {
3069
- if (marker.pid === process.pid) {
3070
- await prepareSessionOpenMarkers();
3071
- return marker.token === ownToken();
3072
- }
3073
- const started = STARTED_TOKEN.exec(marker.token)?.[1];
3074
- const current = started === void 0 ? void 0 : await readProcessStartToken(marker.pid);
3075
- if (current !== void 0) return current === started;
3076
- return (started !== void 0 || marker.ageMs <= UNSTARTED_MARKER_LIMIT_MS) && processAlive(marker.pid);
3077
- }
3078
- /**
3079
- * A running session, in another process or in this one, that has `sessionId` of `store` open, or undefined when none
3080
- * does. Stale markers are removed.
3081
- */
3082
- async function findSessionOpenHolder(sessionId, options = {}) {
3083
- if (!VALID_SESSION_ID.test(sessionId)) return void 0;
3084
- const markers = markersFor(options.store, options.agentDir ?? getAgentDir());
3085
- const host = hostname();
3086
- for (const marker of await markers.list(sessionId)) {
3087
- if (marker.host === host ? !await holderRuns(marker) : marker.ageMs > STALE_MS) {
3088
- await markers.remove(sessionId, marker.token).catch(() => {});
3089
- continue;
3090
- }
3091
- return {
3092
- pid: marker.pid,
3093
- host: marker.host
3094
- };
3095
- }
3096
- }
3097
- /** Rejects with a {@link SessionOpenElsewhereError} when a running session has `sessionId` of `store` open (#4971). */
3098
- async function assertSessionNotOpenElsewhere(sessionId, options = {}) {
3099
- const holder = await findSessionOpenHolder(sessionId, options);
3100
- if (holder !== void 0) throw new SessionOpenElsewhereError(sessionId, holder);
2900
+ function reparentedSegments(sibling, parentId, childId, childOnParent) {
2901
+ const prefix = childOnParent.filter((cover) => cover.baseSeq + 1 === cover.fromSeq);
2902
+ const onParent = sibling.filter((segment) => segment.sourceId === parentId);
2903
+ if (onParent.length === 0) return void 0;
2904
+ const held = (segment) => prefix.some((cover) => cover.fromSeq <= segment.fromSeq && segment.toSeq <= cover.toSeq);
2905
+ if (!onParent.every(held)) return void 0;
2906
+ return joinForkSegments(sibling.map((segment) => segment.sourceId === parentId ? {
2907
+ ...segment,
2908
+ sourceId: childId
2909
+ } : segment));
3101
2910
  }
3102
2911
  // dist/core/tasks/reopened-completion.js
3103
2912
  function readable(value, isProxy) {
@@ -7628,7 +7437,7 @@ const SubagentParams = Type.Object({
7628
7437
  artifacts: Type.Optional(Type.Boolean({ description: "Write debug artifacts (default: true)" })),
7629
7438
  includeProgress: Type.Optional(Type.Boolean({ description: "Include full progress in result (default: false)" })),
7630
7439
  share: Type.Optional(Type.Boolean({ description: "Has no effect: nothing is uploaded or shared (default: false)" })),
7631
- sessionDir: Type.Optional(Type.String({ description: "Keep fresh (not forked) subagents' sessions as JSONL files under this directory instead of the launching session's store" })),
7440
+ sessionDir: Type.Optional(Type.String({ description: "Deprecated and ignored: a subagent's session is always kept in the launching session's store" })),
7632
7441
  control: Type.Optional(ControlOverrides),
7633
7442
  output: Type.Optional(Type.Unsafe({
7634
7443
  anyOf: [{ type: "string" }, { type: "boolean" }],
@@ -9354,6 +9163,57 @@ function convertToLlmWithForkBoundaries(messages, onNormalized) {
9354
9163
  const converted = normalized.filter((m) => m !== void 0);
9355
9164
  return repairOrphanToolResults(deferMessagesInterleavedWithToolBatch(uniquifyToolCallIds(converted)));
9356
9165
  }
9166
+ // dist/core/tools/skill-protocol.js
9167
+ /**
9168
+ * skill:// resolution against the session's loaded skills.
9169
+ *
9170
+ * `skill://<name>` is the skill's own file (usually SKILL.md) and `skill://<name>/<path>` is a file inside the skill's
9171
+ * directory. `<name>` is a name or qualified selector exactly as the skill catalog lists it, so a bare name is the
9172
+ * precedence winner and `<name>@<qualifier>` is one specific skill. Characters that would end the name (`/`, `:`,
9173
+ * whitespace and so on) are percent-encoded.
9174
+ */
9175
+ const SKILL_SCHEME = "skill://";
9176
+ /** The `skill://` URI for a skill name or selector. */
9177
+ function skillUri(name) {
9178
+ const encoded = encodeURIComponent(name).replace(/%40/g, "@").replace(/[!'()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
9179
+ return `${SKILL_SCHEME}${encoded}`;
9180
+ }
9181
+ function parseSkillUri(url) {
9182
+ if (!url.startsWith(SKILL_SCHEME)) return void 0;
9183
+ const rest = url.slice(8);
9184
+ const slash = rest.indexOf("/");
9185
+ const encoded = slash === -1 ? rest : rest.slice(0, slash);
9186
+ let name = encoded;
9187
+ try {
9188
+ name = decodeURIComponent(encoded);
9189
+ } catch {}
9190
+ return {
9191
+ name,
9192
+ subpath: slash === -1 ? "" : rest.slice(slash + 1)
9193
+ };
9194
+ }
9195
+ /**
9196
+ * Resolves `skill://` URIs to the files of the skills in `catalog`. A name the catalog does not know is left to the
9197
+ * workspace fallback; a path that leaves the skill's directory, or a selector naming several skills, is an error.
9198
+ */
9199
+ function createSkillRouter(catalog) {
9200
+ return { resolve: (url) => {
9201
+ const parts = parseSkillUri(url);
9202
+ if (!parts) return void 0;
9203
+ const resolution = catalog()?.resolve(parts.name);
9204
+ if (!resolution) return void 0;
9205
+ if (!resolution.ok) {
9206
+ if (resolution.kind === "unknown") return void 0;
9207
+ const choices = resolution.candidates.map((candidate) => skillUri(candidate.selector)).join(", ");
9208
+ throw new Error(`${url} names more than one skill. Use one of: ${choices}`);
9209
+ }
9210
+ const { skill } = resolution.candidate;
9211
+ if (!parts.subpath) return skill.filePath;
9212
+ const target = resolve$1(skill.baseDir, parts.subpath);
9213
+ if (!isPathInside(skill.baseDir, target)) throw new Error(`${url} points outside the skill's directory`);
9214
+ return target;
9215
+ } };
9216
+ }
9357
9217
  // ../../node_modules/stream-chain/src/exec.js
9358
9218
  const cancelSymbol = Symbol.for("object-stream.cancel");
9359
9219
  const dropNullSymbol = Symbol.for("object-stream.dropNull");
@@ -12749,6 +12609,7 @@ async function createTrigramIndex(tx, dialect, tables) {
12749
12609
  }
12750
12610
  }
12751
12611
  async function trigramIndexExists(database, dialect, tables) {
12612
+ if ((await schemaCatalogOf(database))?.hasObject(tables.trigrams)) return true;
12752
12613
  return await database.get("SELECT indexname FROM pg_catalog.pg_indexes WHERE schemaname = current_schema() AND indexname = ?", dialect.identifier(tables.trigrams)) !== void 0;
12753
12614
  }
12754
12615
  const postgresTrigrams = {
@@ -12884,6 +12745,8 @@ var SqlSessionSearchIndex = class SqlSessionSearchIndex {
12884
12745
  static async tablesExist(database, tables) {
12885
12746
  const dialect = dialectOf(database);
12886
12747
  if (dialect.versionedMigrations) return false;
12748
+ const catalog = await schemaCatalogOf(database);
12749
+ if (catalog?.hasTable(tables.state) === true && catalog.hasTable(tables.fts)) return true;
12887
12750
  const probes = [tables.state, tables.fts].map((table) => dialect.tableExists(table));
12888
12751
  return (await Promise.all(probes.map((probe) => database.get(probe.sql, ...probe.params)))).every((row) => row !== void 0);
12889
12752
  }
@@ -12917,7 +12780,7 @@ var SqlSessionSearchIndex = class SqlSessionSearchIndex {
12917
12780
  indexedSeq,
12918
12781
  lastSeq
12919
12782
  }, generation, row.session_revision);
12920
- await this.database.transaction((tx) => this.forget(tx, sessionId), { retryTransientFailures: true });
12783
+ await this.database.transaction((tx) => this.forget(tx, sessionId), this.sessionWrite(sessionId));
12921
12784
  return withCoverageMeta({
12922
12785
  indexedSeq: 0,
12923
12786
  lastSeq
@@ -12926,11 +12789,11 @@ var SqlSessionSearchIndex = class SqlSessionSearchIndex {
12926
12789
  async extend(sessionId, format, afterSeq, throughSeq, texts, options) {
12927
12790
  if (throughSeq >= SEQ_SPACE || throughSeq < afterSeq) return false;
12928
12791
  options?.signal?.throwIfAborted();
12929
- const txOptions = { retryTransientFailures: true };
12792
+ const txOptions = this.sessionWrite(sessionId);
12930
12793
  const { docs, oversizedSeqs } = prepareDocs(texts);
12931
12794
  if (docs.reduce((sum, doc) => sum + doc.text.length, 0) <= BATCH_CHARS) {
12932
12795
  let backlog = false;
12933
- const extended = await this.writeTransaction(async (tx) => {
12796
+ const extended = await this.writeTransaction(sessionId, async (tx) => {
12934
12797
  options?.signal?.throwIfAborted();
12935
12798
  const row = await tx.get(`SELECT s.last_seq, s.revision AS session_revision, st.sid, st.format, st.indexed_seq, st.revision AS generation, st.entry_id AS whole_seqs
12936
12799
  FROM ${this.sessionTables.sessions} s LEFT JOIN ${this.tables.state} st ON st.session_id = s.id
@@ -12965,7 +12828,7 @@ var SqlSessionSearchIndex = class SqlSessionSearchIndex {
12965
12828
  if (extended && backlog) await this.mergeBacklog(options?.signal);
12966
12829
  return extended;
12967
12830
  }
12968
- const started = await this.writeTransaction(async (tx) => {
12831
+ const started = await this.writeTransaction(sessionId, async (tx) => {
12969
12832
  options?.signal?.throwIfAborted();
12970
12833
  const row = await tx.get(`SELECT s.last_seq, s.revision AS session_revision, st.sid, st.format, st.indexed_seq, st.revision AS generation, st.entry_id AS whole_seqs
12971
12834
  FROM ${this.sessionTables.sessions} s LEFT JOIN ${this.tables.state} st ON st.session_id = s.id
@@ -13032,7 +12895,14 @@ var SqlSessionSearchIndex = class SqlSessionSearchIndex {
13032
12895
  if (!await this.database.transaction((tx) => this.engine.merge(tx, this.tables, MERGE_STEPS_PER_WRITE, signal), { retryTransientFailures: true })) return;
13033
12896
  }
13034
12897
  }
13035
- async writeTransaction(body) {
12898
+ /**
12899
+ * A write of the session `sessionId`'s index rows: the session's own domain, which the session store's writers take,
12900
+ * since `replace` and `delete` forget a session's index in their own transactions.
12901
+ */
12902
+ sessionWrite(sessionId) {
12903
+ return sessionWriteTransaction(this.sessionTables.sessions, sessionId);
12904
+ }
12905
+ async writeTransaction(sessionId, body) {
13036
12906
  let prepared = this.writesPrepared;
13037
12907
  const result = await this.database.transaction(async (tx) => {
13038
12908
  if (!this.writesPrepared) {
@@ -13040,7 +12910,7 @@ var SqlSessionSearchIndex = class SqlSessionSearchIndex {
13040
12910
  prepared = true;
13041
12911
  }
13042
12912
  return body(tx);
13043
- }, { retryTransientFailures: true });
12913
+ }, this.sessionWrite(sessionId));
13044
12914
  if (prepared) this.writesPrepared = true;
13045
12915
  return result;
13046
12916
  }
@@ -19432,16 +19302,16 @@ var ChildCatalog = class ChildCatalog {
19432
19302
  function sessionScratchDir(agentDir, cwd, _sessionId) {
19433
19303
  return getDefaultSessionDirPath(cwd, agentDir);
19434
19304
  }
19435
- export { AgentRehydrateError, AgentReleaseConfigError, CacheWarmer, ChildCatalog, CommandDeliveries, DEFAULT_MAX_MESSAGE_BYTES, DEFAULT_SUBSCRIPTION_MAX_CONCURRENT, EMPTY_OUTPUT_TEXT, EngineHealthController, ExtensionInputComponent, ExtensionSelectorComponent, FirstTimeSetupComponent, GIT_RELEASE, HistorySearchPositions, IMAGE_RESIZE_WORKER_RESPONSE_TYPE, LEGACY_AZURE_PROVIDER, LlamaClient, MAX_INDEXED_ENTRY_CHARS, MULTI_SUBMIT_LABEL, MarkdownContentCache, McpClient, MultiSelectView, NestedGitignore, NestedToolCallRunner, NoUsableModelError, QuestionParamsSchema, RESERVED_LABELS, RESUME_TIMINGS_TYPE, RemoteModelCatalog, RemoteQueuePause, ReopenedCompletionHeaders, ResumeTimingsRecorder, SEARCH_PART_CHARS, SESSIONS_TRANSFER_DIRECTORY, SESSION_STORAGE_JOIN, STORAGE_JOIN_COMMAND, SUMMARY_COMPACTION_PREFIX, SessionKeyDigests, SessionStorageSelectionSchema, SettingsSchema, SqlSessionSearchIndex, StorageImportIncompleteError, StorageSelectionSchema, StorageTransferError, StringEnum, TEAM_JOIN_COMMAND, TOOL_OUTPUT_ENTRY_TYPE, TRANSPILE_CACHE_WRITE_WAIT_MS, TaskElapsedClocks, TaskToolError, ToolExecutionScheduler, TransportEvents, UNORDERED_ADMISSION, VERBATIM_COMPACTION_PREFIX, VERIFICATION_PENDING_REASON, WorkspaceBindingError, WorkspaceCollectionError, WorkspaceConfigError, WorkspaceDriftError, WorkspaceError, WorkspaceGitError, WorkspacePublicationError, WorkspaceRestoreError, WorkspaceSandboxError, WorkspaceSnapshotError, WorkspaceTimeoutError, WrappingSelect, acceptsForkReplay, addResource, adoptCommandSession, appendFileChatRecord, assertSessionBlobStore, assertSessionNotOpenElsewhere, assertSettingsWrites, attachCleanupCause, bindRegistrationCallbacks, bindTaskClock, bindTaskClockSource, bodyWidths, buildDirectoryTree, buildDirectoryTreeFromOperations, buildToolStatusReport, cancelInitialBinding, cancelPausedOwnerTasks, cancelReceiptSentence, cancelReceiptStatus, captureForkReplayPair, captureRegistrationInvocation, carriedTransformedPrompt, carryCompletionEvidence, chatAnswerIntent, chatNumberingFor, childPresentationInput, claimInteractiveBind, classifyCompactionModel, cleanupFailureSummary, collectAgentTasks, collectCommandDeliveries, collectExtensionPackageWarnings, collectFlags, collectMarkdownTransformers, collectPackageInstallWarnings, collectRegisteredTools, collectSettingsDiagnostics, columnWidths, compareCreated, compareFrozen, computeFocusedOptionHasPreview, conflictEntries, convertImageBytesToPng, convertToLlm, convertToLlmWithForkBoundaries, convertToPng, copyRegistrations, copySessionBlobs, createAccumulator, createBranchSummaryMessage, createCustomMessage, createInvocationBindings, createLazyBuiltinFactory, createManagedTaskClocks, createProviderAlias, createSessionHistoryToolDefinition, createVerbatimCompactionMessage, crossTabLeftWidthWithDonation, currentResourceAdmission, decideLayout, deferCommandTurn, deferMessagesInterleavedWithToolBatch, deferRestorePhase, deleteFileChatRecords, describeToolSelection, detectLinuxLibc, diffLines, diffWords, discoverChatFile, drainProcessStdio, drainWindowsDirectorySecurityReads, dropDeferredCommandTurn, ensurePngTranscoder, ensureTool, errorMessage$1 as errorMessage, execCommand, extensionRefreshRejection, extensionSource, filterSupersededHerdrIntegrationPaths, findEntryRenderer, findMessageRenderer, findSessionOpenHolder, findToolDefinition, findWorkspaceError, fixUtf8Stream, flush, forkReplayFilter, forkToolDeclarations, formatAnswerScalar, formatBytes, formatNoUsableModelMessage, formatPackageInstallWarning, formatResumeTimings, formatTokenSegment, formatToolStatus, genBridge, getBuiltinExtensionEntryLabel, getClientIdentity, getCommandEnv, getGitDistributionTarget, getGitInstallDir, getGitReleaseMarker, getGitShellEnvironment, getGitShellEnvironmentAsync, getGitStatus, getGitStatusAsync, getLatestVersion, getLazyBuiltinSpec, getLoaderAgentDirs, getPromptCacheTtlMs, getStorageAdapterHostModules, getToolEnv, getToolPath, getVirtualModules, gitInstallCommand, gitignoreMatcher, hasExtensionHandlers, hasFileChatRecords, hasLazyBuiltinSpec, hasQuitStoppableCommands, hasRecordedTransformedPrompt, hasTaskPromptHost, hasTransformedPrompt, heldPromptInput, heldPrompts, holdSessionOpenMarker, initialBindScope, inlineToolOutput, insertForcedOptionsBeforeTerminator, invocationExtension, invocationRuntime, isAgentRehydrateError, isAgentReleaseConfigError, isBashToolResult, isContentFilterRefusal, isEditToolResult, isFindToolResult, isForkHeader, isHeldPromptInput, isInsideInputHook, isJsonValue, isLocalOnlySessionStorage, isLsToolResult, isNativeBuiltinExtensionPath, isOfflineModeEnabled, isPowerShellToolResult, isPresentationHostInput, isProviderCredentialRejection, isReadToolResult, isRetryableAgentRehydrateError, isRetryableModelFailure, isRetryableSameModelFailure, isRetryableWorkspaceError, isSafetyRefusalFailure, isSourceBuiltinExtensionPath, isStorageImportIncompleteError, isStorageTransferError, isTaskToolError, isToolCallEventType, isTruthyEnvFlag, isUnrecognizedModelFailure, isVerbatimCompactionMessage, isWorkspaceBindingError, isWorkspaceCollectionError, isWorkspaceConfigError, isWorkspaceDriftError, isWorkspaceError, isWorkspaceGitError, isWorkspacePublicationError, isWorkspaceRestoreError, isWorkspaceSandboxError, isWorkspaceSnapshotError, isWorkspaceTimeoutError, isWriteToolResult, joinCommandSend, joinCommandTurn, killQuitStoppableCommandsNow, latestLegacyMessageTime, latestResumeTimings, legacyCompletionTarget, lifecycleScopeForOwner, llamaInferenceUrl, loadVirtualModules, loaderHostModulesTestHooks, mergeExtensionWarnings, mergeResourcePaths, messageIsLlmVisible, messageStartsLlmUserTurn, migrateCompactionModelSettings, modelFailureMessage, next, nextTransformedPromptRecord, normalizeAzureSettings, normalizeLlamaServerUrl, normalizeMessageContent, normalizeModelFailureSignal, normalizeModelProvider, normalizeModelReference, normalizeProviderKeys, noteCommandAnswer, noteCommandTurnMessage, noteRestoreFetch, openEventSubscription, originalRegistrationCallback, ownedSettingsManagers, parseArgs, parseConflictBytes, parseEngineExplicitQuitCommand, parseGitVersion, parseInteractiveEngineCommand, parseInteractiveEngineMessage, partitionByCredentials, plainStatMtimeMs, powershellCandidates, prepareRegistrationCallbacks, prepareSessionOpenMarkers, presentTaskError, presentationHostInput, prewarmModelApi, printHelp, projectTransformedPrompt, providerOfModelReference, publishEvent, readConflictUrl, readFileChatOrders, readFileChatRecords, readHostInputFormRequest, readInlineCaret, readInlineDraft, readLocalFileChunks, readPipedStdin, readTransferDirectory, reconcileRegistration, recordBlueprintStep, recordClosedStart, recordResumeTimings, recordSettingsWrite, refreshConflictFile, registerConflictBlocks, registerFactoryStartupHandler, registerInitialBindings, registerLazyBuiltin, registrationFields, rehydrateAgentRehydrateError, rehydrateTaskToolError, rehydrateWorkspaceError, rejectMalformedToolArguments, rememberEarlierCompletion, renderTodoCall, renderTodoResult, reopenedCompletionName, repairOrphanToolResults, reportDiagnostics, requestedThinkingLevelForModelSwitch, requireTimerMs, require_from_url, require_int, require_int$1, require_log, require_re, require_timestamp, require_toJS, require_trim_comparator_whitespace, require_util_flow_indent_check, require_util_map_includes, require_visit, reserveQueuedInputAdmission, resetGitProvisionStateForTest, resizeImageInProcess, resolveCompactionModel, resolveGit, resolveGitSync, resolveInlineDraftValue, resolveInstalledGit, resolveInvocationRuntime, resolveRegisteredCommands, resolveResourcePath, resolveToolConcurrency, resolvesCompletionHeader, routeKey, routeNamesPrompt, runCallback, runCommandHandler, runInputHook, runSynchronousCallback, runWithProgress, scheduleToolExecution, selectActivePreviewPaneIndex, selectActiveTabItems, selectConfirmedIndicator, selectReadLinesFromChunks, selectReadLinesFromList, serializeAgentRehydrateError, serializeInteractiveEngineFrame, serializeInteractiveEngineMessage, serializeTodoForAgent, serializeTodoListForAgent, serializeWorkspaceError, sessionBlobHashes, sessionBlobOutput, sessionLifecycleCreation, sessionLifecycleScopes, sessionPosition, sessionScratchDir, setCallbackActivityReporter, settingsWriteOwner, shareCompletionEvidence, showLlamaUi, shownSpanMs, splitSearchTextParts, startedAsFork, startupRegistrationTokens, startupSourceId, stopIndex, storeInlineToolOutputs, storeSessionBlobs, streamCutDurationMs, stripVerbatimCompactionPrefix, subagentsLazyBuiltinSpec, summarizeLegacySession, takeInlineToolOutput, takeInlineToolOutputEntry, taskClockOf, taskClockRunning, taskClocksFor, taskElapsedMs, taskPromptHost, thinkingLevelForModelSwitch, timeCheckoutRestore, timeRestorePhase, toResolvedPaths, tokenize, toolChangeSupport, toolOutputUrl, toolOutputUrlHash, trackAdmittedAgentTask, trackTranspileCacheWrite, trackWindowsDirectorySecurityWork, transferFile, transformedPromptOwner, transpileCacheWritesSettled, unpackIds, unreadablePathError, unreadableTrustSettingsDiagnostics, unwritablePathError, userLikeContentBlockIsLlmVisible, validateEventSource, validateSubscriptionAdmission, verbatimRecallHint, verifyWindowsDirectorySecurity, verifyWindowsDirectorySecurityAsync, waitResultTail, waitStatus, watchHeldPromptAttention, withGitProvisionSettingsForTest, withImagesBlocked, withInlineDraft, withOwnResourceAdmission, withResourceAdmission, withTranspileCacheWriteOwner, withWindowsDirectorySecurityOwner, withoutCarriedToolOutput, withoutSearchPosition, writeChunksAtomically, writeLinesAtomically, writeRenderers };
19305
+ export { AgentRehydrateError, AgentReleaseConfigError, CacheWarmer, ChildCatalog, CommandDeliveries, DEFAULT_MAX_MESSAGE_BYTES, DEFAULT_SUBSCRIPTION_MAX_CONCURRENT, EMPTY_OUTPUT_TEXT, EngineHealthController, ExtensionInputComponent, ExtensionSelectorComponent, FirstTimeSetupComponent, GIT_RELEASE, HistorySearchPositions, IMAGE_RESIZE_WORKER_RESPONSE_TYPE, LEGACY_AZURE_PROVIDER, LlamaClient, MAX_INDEXED_ENTRY_CHARS, MULTI_SUBMIT_LABEL, MarkdownContentCache, McpClient, MultiSelectView, NestedGitignore, NestedToolCallRunner, NoUsableModelError, QuestionParamsSchema, RESERVED_LABELS, RESUME_TIMINGS_TYPE, RemoteModelCatalog, RemoteQueuePause, ReopenedCompletionHeaders, ResumeTimingsRecorder, SEARCH_PART_CHARS, SESSIONS_TRANSFER_DIRECTORY, SESSION_STORAGE_JOIN, STORAGE_JOIN_COMMAND, SUMMARY_COMPACTION_PREFIX, SessionKeyDigests, SessionStorageSelectionSchema, SettingsSchema, SqlSessionSearchIndex, StorageImportIncompleteError, StorageSelectionSchema, StorageTransferError, StringEnum, TEAM_JOIN_COMMAND, TOOL_OUTPUT_ENTRY_TYPE, TRANSPILE_CACHE_WRITE_WAIT_MS, TaskElapsedClocks, TaskToolError, ToolExecutionScheduler, TransportEvents, UNORDERED_ADMISSION, VERBATIM_COMPACTION_PREFIX, VERIFICATION_PENDING_REASON, WorkspaceBindingError, WorkspaceCollectionError, WorkspaceConfigError, WorkspaceDriftError, WorkspaceError, WorkspaceGitError, WorkspacePublicationError, WorkspaceRestoreError, WorkspaceSandboxError, WorkspaceSnapshotError, WorkspaceTimeoutError, WrappingSelect, acceptsForkReplay, addResource, adoptCommandSession, appendFileChatRecord, assertSessionBlobStore, assertSettingsWrites, attachCleanupCause, bindRegistrationCallbacks, bindTaskClock, bindTaskClockSource, bodyWidths, buildDirectoryTree, buildDirectoryTreeFromOperations, buildToolStatusReport, cancelInitialBinding, cancelPausedOwnerTasks, cancelReceiptSentence, cancelReceiptStatus, captureForkReplayPair, captureRegistrationInvocation, carriedTransformedPrompt, carryCompletionEvidence, chatAnswerIntent, chatNumberingFor, childPresentationInput, claimInteractiveBind, classifyCompactionModel, cleanupFailureSummary, collectAgentTasks, collectCommandDeliveries, collectExtensionPackageWarnings, collectFlags, collectMarkdownTransformers, collectPackageInstallWarnings, collectRegisteredTools, collectSettingsDiagnostics, columnWidths, compareCreated, compareFrozen, computeFocusedOptionHasPreview, conflictEntries, convertImageBytesToPng, convertToLlm, convertToLlmWithForkBoundaries, convertToPng, copyRegistrations, copySessionBlobs, createAccumulator, createBranchSummaryMessage, createCustomMessage, createInvocationBindings, createLazyBuiltinFactory, createManagedTaskClocks, createProviderAlias, createSessionHistoryToolDefinition, createSkillRouter, createVerbatimCompactionMessage, crossTabLeftWidthWithDonation, currentResourceAdmission, decideLayout, deferCommandTurn, deferMessagesInterleavedWithToolBatch, deferRestorePhase, deleteFileChatRecords, describeToolSelection, detectLinuxLibc, diffLines, diffWords, discoverChatFile, drainProcessStdio, drainWindowsDirectorySecurityReads, dropDeferredCommandTurn, ensurePngTranscoder, ensureTool, errorMessage$1 as errorMessage, execCommand, extensionRefreshRejection, extensionSource, filterSupersededHerdrIntegrationPaths, findEntryRenderer, findMessageRenderer, findToolDefinition, findWorkspaceError, fixUtf8Stream, flush, forkReplayFilter, forkToolDeclarations, formatAnswerScalar, formatBytes, formatNoUsableModelMessage, formatPackageInstallWarning, formatResumeTimings, formatTokenSegment, formatToolStatus, genBridge, getBuiltinExtensionEntryLabel, getClientIdentity, getCommandEnv, getGitDistributionTarget, getGitInstallDir, getGitReleaseMarker, getGitShellEnvironment, getGitShellEnvironmentAsync, getGitStatus, getGitStatusAsync, getLatestVersion, getLazyBuiltinSpec, getLoaderAgentDirs, getPromptCacheTtlMs, getStorageAdapterHostModules, getToolEnv, getToolPath, getVirtualModules, gitInstallCommand, gitignoreMatcher, hasExtensionHandlers, hasFileChatRecords, hasLazyBuiltinSpec, hasQuitStoppableCommands, hasRecordedTransformedPrompt, hasTaskPromptHost, hasTransformedPrompt, heldPromptInput, heldPrompts, initialBindScope, inlineToolOutput, insertForcedOptionsBeforeTerminator, invocationExtension, invocationRuntime, isAgentRehydrateError, isAgentReleaseConfigError, isBashToolResult, isContentFilterRefusal, isEditToolResult, isFindToolResult, isForkHeader, isHeldPromptInput, isInsideInputHook, isJsonValue, isLocalOnlySessionStorage, isLsToolResult, isNativeBuiltinExtensionPath, isOfflineModeEnabled, isPowerShellToolResult, isPresentationHostInput, isProviderCredentialRejection, isReadToolResult, isRetryableAgentRehydrateError, isRetryableModelFailure, isRetryableSameModelFailure, isRetryableWorkspaceError, isSafetyRefusalFailure, isSourceBuiltinExtensionPath, isStorageImportIncompleteError, isStorageTransferError, isTaskToolError, isToolCallEventType, isTruthyEnvFlag, isUnrecognizedModelFailure, isVerbatimCompactionMessage, isWorkspaceBindingError, isWorkspaceCollectionError, isWorkspaceConfigError, isWorkspaceDriftError, isWorkspaceError, isWorkspaceGitError, isWorkspacePublicationError, isWorkspaceRestoreError, isWorkspaceSandboxError, isWorkspaceSnapshotError, isWorkspaceTimeoutError, isWriteToolResult, joinCommandSend, joinCommandTurn, killQuitStoppableCommandsNow, latestLegacyMessageTime, latestResumeTimings, legacyCompletionTarget, lifecycleScopeForOwner, llamaInferenceUrl, loadVirtualModules, loaderHostModulesTestHooks, mergeExtensionWarnings, mergeResourcePaths, messageIsLlmVisible, messageStartsLlmUserTurn, migrateCompactionModelSettings, modelFailureMessage, next, nextTransformedPromptRecord, normalizeAzureSettings, normalizeLlamaServerUrl, normalizeMessageContent, normalizeModelFailureSignal, normalizeModelProvider, normalizeModelReference, normalizeProviderKeys, noteCommandAnswer, noteCommandTurnMessage, noteRestoreFetch, openEventSubscription, originalRegistrationCallback, ownedSettingsManagers, parseArgs, parseConflictBytes, parseEngineExplicitQuitCommand, parseGitVersion, parseInteractiveEngineCommand, parseInteractiveEngineMessage, parseSkillUri, partitionByCredentials, plainStatMtimeMs, powershellCandidates, prepareRegistrationCallbacks, presentTaskError, presentationHostInput, prewarmModelApi, printHelp, projectTransformedPrompt, providerOfModelReference, publishEvent, readConflictUrl, readFileChatOrders, readFileChatRecords, readHostInputFormRequest, readInlineCaret, readInlineDraft, readLocalFileChunks, readPipedStdin, readTransferDirectory, reconcileRegistration, recordBlueprintStep, recordClosedStart, recordResumeTimings, recordSettingsWrite, refreshConflictFile, registerConflictBlocks, registerFactoryStartupHandler, registerInitialBindings, registerLazyBuiltin, registrationFields, rehydrateAgentRehydrateError, rehydrateTaskToolError, rehydrateWorkspaceError, rejectMalformedToolArguments, rememberEarlierCompletion, renderTodoCall, renderTodoResult, reopenedCompletionName, repairOrphanToolResults, reparentedSegments, reportDiagnostics, requestedThinkingLevelForModelSwitch, requireTimerMs, require_from_url, require_int, require_int$1, require_log, require_re, require_timestamp, require_toJS, require_trim_comparator_whitespace, require_util_flow_indent_check, require_util_map_includes, require_visit, reserveQueuedInputAdmission, resetGitProvisionStateForTest, resizeImageInProcess, resolveCompactionModel, resolveGit, resolveGitSync, resolveInlineDraftValue, resolveInstalledGit, resolveInvocationRuntime, resolveRegisteredCommands, resolveResourcePath, resolveToolConcurrency, resolvesCompletionHeader, routeKey, routeNamesPrompt, runCallback, runCommandHandler, runInputHook, runSynchronousCallback, runWithProgress, scheduleToolExecution, selectActivePreviewPaneIndex, selectActiveTabItems, selectConfirmedIndicator, selectReadLinesFromChunks, selectReadLinesFromList, serializeAgentRehydrateError, serializeInteractiveEngineFrame, serializeInteractiveEngineMessage, serializeTodoForAgent, serializeTodoListForAgent, serializeWorkspaceError, sessionBlobHashes, sessionBlobOutput, sessionLifecycleCreation, sessionLifecycleScopes, sessionPosition, sessionScratchDir, setCallbackActivityReporter, settingsWriteOwner, shareCompletionEvidence, showLlamaUi, shownSpanMs, skillUri, splitSearchTextParts, splitSegment, startedAsFork, startupRegistrationTokens, startupSourceId, stopIndex, storeInlineToolOutputs, storeSessionBlobs, streamCutDurationMs, stripVerbatimCompactionPrefix, subagentsLazyBuiltinSpec, summarizeLegacySession, takeInlineToolOutput, takeInlineToolOutputEntry, taskClockOf, taskClockRunning, taskClocksFor, taskElapsedMs, taskPromptHost, thinkingLevelForModelSwitch, timeCheckoutRestore, timeRestorePhase, toResolvedPaths, tokenize, toolChangeSupport, toolOutputUrl, toolOutputUrlHash, trackAdmittedAgentTask, trackTranspileCacheWrite, trackWindowsDirectorySecurityWork, transferFile, transformedPromptOwner, transpileCacheWritesSettled, unpackIds, unreadablePathError, unreadableTrustSettingsDiagnostics, unwritablePathError, userLikeContentBlockIsLlmVisible, validateEventSource, validateSubscriptionAdmission, verbatimRecallHint, verifyWindowsDirectorySecurity, verifyWindowsDirectorySecurityAsync, waitResultTail, waitStatus, watchHeldPromptAttention, withGitProvisionSettingsForTest, withImagesBlocked, withInlineDraft, withOwnResourceAdmission, withResourceAdmission, withTranspileCacheWriteOwner, withWindowsDirectorySecurityOwner, withoutCarriedToolOutput, withoutSearchPosition, writeChunksAtomically, writeLinesAtomically, writeRenderers };
19436
19306
 
19437
- //# sourceMappingURL=startup-0-1-XTIL65D4.js.map
19307
+ //# sourceMappingURL=startup-0-1-7T2IAE7J.js.map
19438
19308
  // __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
19439
19309
  // demand that fails in a process an in-place update left running says to restart.
19440
19310
  function __atomicOnDemandFailed(error, feature) {
19441
19311
  return (async () => {
19442
19312
  const root = new URL("../", import.meta.url);
19443
19313
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
19444
- const key = `${root.href}#0.10.10`;
19314
+ const key = `${root.href}#0.10.11-alpha.2`;
19445
19315
  let release = releases.get(key);
19446
19316
  if (release === undefined) {
19447
19317
  const current = (async () => {
@@ -19469,7 +19339,7 @@ function __atomicOnDemandFailed(error, feature) {
19469
19339
  } catch {
19470
19340
  // No installation to read, as in a bundle of the package: the release the process runs decides.
19471
19341
  }
19472
- const updatedTo = typeof installed === "string" && installed !== "0.10.10" ? installed : running !== undefined && running.version !== "0.10.10" ? "0.10.10" : undefined;
19342
+ 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;
19473
19343
  if (updatedTo === undefined) throw error;
19474
19344
  const application = typeof running?.name === "string" ? running.name : "atomic";
19475
19345
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {