@bastani/atomic 0.10.15-alpha.2 → 0.10.16-alpha.1

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 (351) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/__atomic_timers/index.js +112 -0
  3. package/dist/__atomic_timers/index.js.map +1 -0
  4. package/dist/_shared/dist-KOELCESV.js +2 -2
  5. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  6. package/dist/_shared/http-YFAPTIZD.js +20 -22
  7. package/dist/_shared/http-YFAPTIZD.js.map +1 -1
  8. package/dist/_shared/lib-4PES5P4V.js +2 -2
  9. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +55 -25
  10. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
  11. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +13 -14
  12. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
  13. package/dist/_shared/mode-shared-2QJSCUM6.js +16 -17
  14. package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
  15. package/dist/_shared/p0-cli-BB45ZQY6.js +23 -37
  16. package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -1
  17. package/dist/_shared/p1a-prewarm-XIU57JHF.js +6 -5
  18. package/dist/_shared/p1a-prewarm-XIU57JHF.js.map +1 -1
  19. package/dist/_shared/{p1b-elig-TVB5CBLL.js → p1b-elig-BY2G5BUE.js} +28 -36
  20. package/dist/_shared/p1b-elig-BY2G5BUE.js.map +1 -0
  21. package/dist/_shared/runtime-O4KCSG4C.js +4 -4
  22. package/dist/_shared/sdk-OHKMDJ74.js +382 -45
  23. package/dist/_shared/sdk-OHKMDJ74.js.map +1 -1
  24. package/dist/_shared/session-data-AHTU7IS6.js +3 -3
  25. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  26. package/dist/_shared/settings-startup-HXQLSUWM.js.map +1 -1
  27. package/dist/_shared/{startup-0-0-Q3MWKUK4.js → startup-0-0-ERMIDHQT.js} +296 -382
  28. package/dist/_shared/startup-0-0-ERMIDHQT.js.map +1 -0
  29. package/dist/_shared/{startup-0-1-M6OWAYHH.js → startup-0-1-RTASI3HG.js} +430 -102
  30. package/dist/_shared/startup-0-1-RTASI3HG.js.map +1 -0
  31. package/dist/_shared/{startup-0-2-2HUMCPKX.js → startup-0-2-YZZOC22D.js} +8109 -7962
  32. package/dist/_shared/startup-0-2-YZZOC22D.js.map +1 -0
  33. package/dist/_shared/{startup-0-3-4ZYBYQNM.js → startup-0-3-DE2NCS6A.js} +130 -83
  34. package/dist/_shared/startup-0-3-DE2NCS6A.js.map +1 -0
  35. package/dist/_shared/startup-0-4-ZMJV547D.js +7 -7
  36. package/dist/_shared/{startup-0-5-YDW47QX6.js → startup-0-5-HZX3ZPTP.js} +411 -85
  37. package/dist/_shared/startup-0-5-HZX3ZPTP.js.map +1 -0
  38. package/dist/_shared/startup-10-0-TDQNBDDL.js +42 -29
  39. package/dist/_shared/startup-10-0-TDQNBDDL.js.map +1 -1
  40. package/dist/_shared/startup-12-0-55AAXBJZ.js +3 -3
  41. package/dist/_shared/startup-14-0-MLX36RBG.js +11 -10
  42. package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
  43. package/dist/_shared/startup-15-0-YUKGAC63.js +9 -8
  44. package/dist/_shared/startup-15-0-YUKGAC63.js.map +1 -1
  45. package/dist/_shared/startup-15-1-4S7FLMNG.js +24 -16
  46. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  47. package/dist/_shared/startup-8-0-34CBHPZH.js +40 -19
  48. package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
  49. package/dist/_shared/startup-8-1-LZFXSD3Z.js +129 -92
  50. package/dist/_shared/startup-8-1-LZFXSD3Z.js.map +1 -1
  51. package/dist/_shared/storage-command-7MGXLJGZ.js +6 -4
  52. package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
  53. package/dist/_shared/storage-status-K7PX2RXA.js +7 -6
  54. package/dist/_shared/storage-status-K7PX2RXA.js.map +1 -1
  55. package/dist/_shared/task-reference-stream-JWMUZSJX.js +1 -1
  56. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  57. package/dist/_shared/team-DOQKICG2.js +4 -3
  58. package/dist/_shared/team-DOQKICG2.js.map +1 -1
  59. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  60. package/dist/builtin/intercom/index.bundle.mjs +1 -2
  61. package/dist/builtin/intercom/package.json +1 -1
  62. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  63. package/dist/builtin/mcp/package.json +1 -1
  64. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  65. package/dist/builtin/subagents/package.json +1 -1
  66. package/dist/builtin/subagents/src/extension/index.bundle.mjs +102 -42
  67. package/dist/builtin/web-access/index.bundle.mjs +1 -2
  68. package/dist/builtin/web-access/package.json +1 -1
  69. package/dist/cli/args.js +2 -2
  70. package/dist/cli/auth-cli.code.js +6 -6
  71. package/dist/cli/auth-cli.impl.js +3 -3
  72. package/dist/cli/auth-cli.js +3 -3
  73. package/dist/cli/blueprint-command.code.js +7 -6
  74. package/dist/cli/blueprint-command.code.js.map +1 -1
  75. package/dist/cli/blueprint-command.impl.js +3 -3
  76. package/dist/cli/blueprint-command.js +3 -3
  77. package/dist/cli/intercom-command.code.js +3 -3
  78. package/dist/cli/intercom-command.impl.js +3 -3
  79. package/dist/cli/intercom-command.js +3 -3
  80. package/dist/cli/list-models.code.js +2 -2
  81. package/dist/cli/list-models.impl.js +3 -3
  82. package/dist/cli/list-models.js +3 -3
  83. package/dist/cli/session-picker.code.js +2 -2
  84. package/dist/cli/session-picker.impl.js +3 -3
  85. package/dist/cli/session-picker.js +3 -3
  86. package/dist/cli/startup-ui.code.js +2 -2
  87. package/dist/cli/startup-ui.impl.js +3 -3
  88. package/dist/cli/startup-ui.js +3 -3
  89. package/dist/cli/storage-command.impl.js +3 -3
  90. package/dist/cli/storage-command.js +3 -3
  91. package/dist/cli/storage-search-session.code.js +1 -1
  92. package/dist/cli/storage-search-session.impl.js +3 -3
  93. package/dist/cli/storage-search-session.js +3 -3
  94. package/dist/cli/team-command.code.js +2 -2
  95. package/dist/cli/team-command.impl.js +3 -3
  96. package/dist/cli/team-command.js +3 -3
  97. package/dist/cli.js +2 -2
  98. package/dist/core/agent-session.d.ts +1 -0
  99. package/dist/core/debug.code.js +1 -1
  100. package/dist/core/debug.impl.js +3 -3
  101. package/dist/core/debug.js +3 -3
  102. package/dist/core/export-html/card-projection.code.js +1 -1
  103. package/dist/core/export-html/card-projection.impl.js +3 -3
  104. package/dist/core/export-html/card-projection.js +3 -3
  105. package/dist/core/export-html/index.code.js +2 -2
  106. package/dist/core/export-html/index.impl.js +3 -3
  107. package/dist/core/export-html/index.js +3 -3
  108. package/dist/core/export-html/json-spans.impl.js +3 -3
  109. package/dist/core/export-html/json-spans.js +3 -3
  110. package/dist/core/export-html/oversized-render-inputs.code.js +1 -1
  111. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  112. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  113. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  114. package/dist/core/export-html/tool-renderer.js +3 -3
  115. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  116. package/dist/core/extensions/jiti-loader.js +3 -3
  117. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  118. package/dist/core/extensions/jiti-static-loader.js +3 -3
  119. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  120. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  121. package/dist/core/extensions/loader-host-modules.js +3 -3
  122. package/dist/core/extensions/loader-virtual-modules.js +2 -2
  123. package/dist/core/extensions/runner-context.js +1 -1
  124. package/dist/core/http-dispatcher.d.ts +2 -1
  125. package/dist/core/intercom-broker-control-host.code.js +1 -1
  126. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  127. package/dist/core/intercom-broker-control-host.js +3 -3
  128. package/dist/core/intercom-broker-control.code.js +3 -3
  129. package/dist/core/intercom-broker-control.impl.js +3 -3
  130. package/dist/core/intercom-broker-control.js +3 -3
  131. package/dist/core/lock-takeover.d.ts +2 -0
  132. package/dist/core/model-config.d.ts +28 -0
  133. package/dist/core/model-registry.js +1 -1
  134. package/dist/core/model-runtime-streaming.d.ts +3 -2
  135. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  136. package/dist/core/package-manager-storage-adapters.js +3 -3
  137. package/dist/core/provider-rate-limits.d.ts +17 -10
  138. package/dist/core/provider-request-admission.d.ts +16 -0
  139. package/dist/core/resume/blueprint/barrier.d.ts +6 -6
  140. package/dist/core/resume/blueprint/build.d.ts +3 -1
  141. package/dist/core/resume/blueprint/ledger.d.ts +3 -2
  142. package/dist/core/resume/blueprint/resume.d.ts +2 -1
  143. package/dist/core/retry-policy.d.ts +3 -1
  144. package/dist/core/sdk.code.js +3 -3
  145. package/dist/core/sdk.impl.js +3 -3
  146. package/dist/core/sdk.js +3 -3
  147. package/dist/core/session-manager-core.js +6 -6
  148. package/dist/core/session-manager-list.impl.js +3 -3
  149. package/dist/core/session-manager-list.js +3 -3
  150. package/dist/core/session-manager-types.d.ts +1 -1
  151. package/dist/core/session-manager.code.js +2 -2
  152. package/dist/core/session-manager.impl.js +3 -3
  153. package/dist/core/session-manager.js +3 -3
  154. package/dist/core/session-open-markers.js +1 -1
  155. package/dist/core/session-storage.impl.js +3 -3
  156. package/dist/core/session-storage.js +3 -3
  157. package/dist/core/settings-duration.d.ts +3 -0
  158. package/dist/core/settings-manager-resource-accessors.d.ts +2 -1
  159. package/dist/core/settings-schema.d.ts +1 -0
  160. package/dist/core/storage/index.js +2 -2
  161. package/dist/core/storage/node-sqlite-file-gate.js +7 -6
  162. package/dist/core/storage/node-sqlite-file-gate.js.map +1 -1
  163. package/dist/core/storage/node-sqlite-thread.js +2 -2
  164. package/dist/core/storage/node-sqlite.js +2 -2
  165. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  166. package/dist/core/storage/offline-snapshot-file.js +3 -3
  167. package/dist/core/storage/prefix.js +3 -0
  168. package/dist/core/storage/prefix.js.map +1 -1
  169. package/dist/core/storage/provider.js +2 -2
  170. package/dist/core/storage/selection.js +2 -2
  171. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  172. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  173. package/dist/core/storage/session/branch-fork-source.js +3 -3
  174. package/dist/core/storage/session/card-view.impl.js +3 -3
  175. package/dist/core/storage/session/card-view.js +3 -3
  176. package/dist/core/storage/session/child-reader.code.js +24 -7
  177. package/dist/core/storage/session/child-reader.code.js.map +1 -1
  178. package/dist/core/storage/session/child-reader.impl.js +3 -3
  179. package/dist/core/storage/session/child-reader.js +3 -3
  180. package/dist/core/storage/session/chunked-resume-projection.code.js +1 -1
  181. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  182. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  183. package/dist/core/storage/session/expanded-child-details.code.js +3 -3
  184. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  185. package/dist/core/storage/session/expanded-child-details.js +3 -3
  186. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  187. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  188. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  189. package/dist/core/storage/session/fork-row-index.js +3 -3
  190. package/dist/core/storage/session/fork-staging.code.js +1 -1
  191. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  192. package/dist/core/storage/session/fork-staging.js +3 -3
  193. package/dist/core/storage/session/fork-window.code.js +4 -4
  194. package/dist/core/storage/session/fork-window.impl.js +3 -3
  195. package/dist/core/storage/session/fork-window.js +3 -3
  196. package/dist/core/storage/session/history-pages.impl.js +3 -3
  197. package/dist/core/storage/session/history-pages.js +3 -3
  198. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  199. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  200. package/dist/core/storage/session/jsonl-session-store.d.ts +2 -2
  201. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  202. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  203. package/dist/core/storage/session/memory-session-store.d.ts +2 -2
  204. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  205. package/dist/core/storage/session/memory-session-store.js +3 -3
  206. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  207. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  208. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  209. package/dist/core/storage/session/released-history-files.code.js +4 -4
  210. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  211. package/dist/core/storage/session/released-history-files.js +3 -3
  212. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  213. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  214. package/dist/core/storage/session/session-resume.impl.js +3 -3
  215. package/dist/core/storage/session/session-resume.js +3 -3
  216. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  217. package/dist/core/storage/session/snapshot-cut.js +3 -3
  218. package/dist/core/storage/session/snapshot-history.code.js +4 -4
  219. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  220. package/dist/core/storage/session/snapshot-history.js +3 -3
  221. package/dist/core/storage/session/sql-session-store.d.ts +13 -4
  222. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  223. package/dist/core/storage/session/sql-session-store.js +3 -3
  224. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  225. package/dist/core/storage/session/tree-outline.js +3 -3
  226. package/dist/core/storage/session/tree-presentation.code.js +1 -1
  227. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  228. package/dist/core/storage/session/tree-presentation.js +3 -3
  229. package/dist/core/storage/session/types.d.ts +20 -2
  230. package/dist/core/storage/sqlite-facade.js +14 -13
  231. package/dist/core/storage/sqlite-facade.js.map +1 -1
  232. package/dist/core/storage/storage-status.impl.js +3 -3
  233. package/dist/core/storage/storage-status.js +3 -3
  234. package/dist/core/storage/team.impl.js +3 -3
  235. package/dist/core/storage/team.js +3 -3
  236. package/dist/core/structured-output/index.impl.js +3 -3
  237. package/dist/core/structured-output/index.js +3 -3
  238. package/dist/core/tasks/heartbeat.d.ts +1 -0
  239. package/dist/core/tasks/task-completion-entry.code.js +1 -1
  240. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  241. package/dist/core/tasks/task-completion-entry.js +3 -3
  242. package/dist/core/tasks/task-file-history.code.js +3 -3
  243. package/dist/core/tasks/task-file-history.impl.js +3 -3
  244. package/dist/core/tasks/task-file-history.js +3 -3
  245. package/dist/core/tasks/task-reference-archive.code.js +3 -3
  246. package/dist/core/tasks/task-reference-archive.js +3 -3
  247. package/dist/core/tasks/task-reference-identity.js +3 -3
  248. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  249. package/dist/core/tasks/task-reference-stream.js +3 -3
  250. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  251. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  252. package/dist/core/tasks/task-view-source.impl.js +3 -3
  253. package/dist/core/tasks/task-view-source.js +3 -3
  254. package/dist/core/tools/ask-user-question/ask-user-question.d.ts +1 -1
  255. package/dist/core/tools/history-session.d.ts +2 -0
  256. package/dist/core/tools/read-url.code.js +3 -3
  257. package/dist/core/tools/read-url.impl.js +3 -3
  258. package/dist/core/tools/read-url.js +3 -3
  259. package/dist/core/worktree-snapshot/blob-store.js +5 -6
  260. package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
  261. package/dist/core/worktree-snapshot/errors.code.js +3 -3
  262. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  263. package/dist/core/worktree-snapshot/errors.js +3 -3
  264. package/dist/core/worktree-snapshot/git.d.ts +2 -0
  265. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  266. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  267. package/dist/extensions/codemode/execute.code.js +6 -5
  268. package/dist/extensions/codemode/execute.code.js.map +1 -1
  269. package/dist/extensions/codemode/execute.impl.js +3 -3
  270. package/dist/extensions/codemode/execute.js +3 -3
  271. package/dist/extensions/codemode/renderer.code.js +1 -1
  272. package/dist/extensions/codemode/renderer.impl.js +3 -3
  273. package/dist/extensions/codemode/renderer.js +3 -3
  274. package/dist/extensions/mcp/cli.code.js +8 -4
  275. package/dist/extensions/mcp/cli.code.js.map +1 -1
  276. package/dist/extensions/mcp/cli.impl.js +3 -3
  277. package/dist/extensions/mcp/cli.js +3 -3
  278. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  279. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  280. package/dist/extensions/mcp/cli.lazy.js +3 -3
  281. package/dist/extensions/mcp/runtime.impl.js +3 -3
  282. package/dist/extensions/mcp/runtime.js +3 -3
  283. package/dist/index.js +6 -6
  284. package/dist/main-first-time-setup.code.js +2 -2
  285. package/dist/main-first-time-setup.impl.js +3 -3
  286. package/dist/main-first-time-setup.js +3 -3
  287. package/dist/modes/interactive/components/stored-tree-view.code.js +3 -3
  288. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  289. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  290. package/dist/modes/interactive/components/user-message-selector-archive.code.js +1 -1
  291. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  292. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  293. package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
  294. package/dist/package-manager-cli.code.js +7 -7
  295. package/dist/package-manager-cli.impl.js +3 -3
  296. package/dist/package-manager-cli.js +3 -3
  297. package/dist/rpc-entry.js +1 -1
  298. package/dist/startup-files.json +1 -1
  299. package/dist/startup-stages/10.js +1 -1
  300. package/dist/startup-stages/11.js +1 -1
  301. package/dist/startup-stages/12.js +1 -1
  302. package/dist/startup-stages/13.js +1 -0
  303. package/dist/startup-stages/2.js +2 -6
  304. package/dist/startup-stages/3.js +6 -1
  305. package/dist/startup-stages/4.js +1 -1
  306. package/dist/startup-stages/5.js +12 -1
  307. package/dist/startup-stages/6.js +8 -4
  308. package/dist/startup-stages/7.js +4 -3
  309. package/dist/startup-stages/8.js +1 -5
  310. package/dist/startup-stages/9.js +5 -1
  311. package/dist/startup-stages/stages.json +1 -1
  312. package/dist/utils/startup-database-spare.code.js +3 -3
  313. package/dist/utils/startup-database-spare.impl.js +3 -3
  314. package/dist/utils/startup-database-spare.js +3 -3
  315. package/dist/utils/tools-manager.code.js +1 -1
  316. package/dist/utils/tools-manager.impl.js +3 -3
  317. package/dist/utils/tools-manager.js +3 -3
  318. package/dist/utils/windows-cwd.js +3 -3
  319. package/dist/utils/windows-cwd.js.map +1 -1
  320. package/docs/changelog.mdx +2 -2
  321. package/docs/codemode.md +5 -2
  322. package/docs/compaction/branch-summaries.md +1 -1
  323. package/docs/compaction/custom-compactors.md +1 -1
  324. package/docs/custom-provider/api-reference.md +1 -1
  325. package/docs/custom-provider/registration.md +3 -0
  326. package/docs/custom-provider/streaming.md +1 -1
  327. package/docs/environment-variables.md +2 -2
  328. package/docs/guides/resume-on-any-machine.md +1 -0
  329. package/docs/libraries/ai.md +4 -2
  330. package/docs/libraries/codemode.md +1 -1
  331. package/docs/models/choose-a-model.md +1 -1
  332. package/docs/models-configuration.md +5 -2
  333. package/docs/models.md +32 -0
  334. package/docs/providers.md +33 -1
  335. package/docs/sdk/structured-decisions.md +4 -2
  336. package/docs/sessions.md +1 -1
  337. package/docs/settings.md +78 -16
  338. package/docs/storage/postgres/tuning.md +1 -0
  339. package/docs/subagents/reference.md +2 -1
  340. package/docs/tools.md +4 -3
  341. package/docs/worktree-snapshots/reference.md +2 -0
  342. package/docs/worktree-snapshots.md +4 -0
  343. package/package.json +9 -9
  344. package/schemas/models.schema.json +21 -0
  345. package/schemas/settings.schema.json +14 -1
  346. package/dist/_shared/p1b-elig-TVB5CBLL.js.map +0 -1
  347. package/dist/_shared/startup-0-0-Q3MWKUK4.js.map +0 -1
  348. package/dist/_shared/startup-0-1-M6OWAYHH.js.map +0 -1
  349. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +0 -1
  350. package/dist/_shared/startup-0-3-4ZYBYQNM.js.map +0 -1
  351. package/dist/_shared/startup-0-5-YDW47QX6.js.map +0 -1
@@ -1,15 +1,15 @@
1
1
  import { __name } from "./rolldown-runtime-BGM3D5V3.js";
2
2
  import { APP_NAME, BUILTIN_PACKAGE_DIR_NAMES, CONFIG_DIR_NAME, ENV_CLEAR_ON_SHRINK, ENV_HARDWARE_CURSOR, INTERACTIVE_ENGINE_BOOTSTRAP_FLAG, addHostStorageAdapter, canonicalizePath as canonicalizePath$1, createChildProcessEnvironment, flushPersistentCompileCache, formatPathRelativeToCwdOrAbsolute, getAgentConfigPaths, getAgentDir, getAgentDirs, getBinDir, getBlueprintActionsDir, getCwdRelativePath, getEnvValue, getGlobalBlueprintPath, getHomeDir, getProjectBlueprintPath, getProjectConfigPaths, getReadmePath, hostStorageAdapter, isBunBinary, isBunRuntime, isChildProcessExitStatusUnknownError, isLocalPath, markLifecycleTiming, normalizePath, removeOwnedInteractiveEngineBootstrapAsync, resolvePath, shortenHomePath, splitBom, stripBom, waitForChildProcess, writeInteractiveEngineBootstrapAsync } from "./p0-cli-BB45ZQY6.js";
3
- import { BLUEPRINT_CONTEXT_TYPE, BlueprintBuildFailedError, BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, CACHE_WARMING_MODES, COMMAND_FOREGROUND_BUDGET_MS, CompactionConfigError, DEFAULT_BUILTIN_SELECTION_EXTRA_TOOLS, DEFAULT_MAX_BYTES, EditInputError, EditMatchError, EditTargetError, FileToolAbortedError, HostListenerFailures, LONG_LIVED_COMMANDS, Minimatch, RESTART_CANCELLED_MESSAGE, STALE_EXTENSION_CONTEXT_MESSAGE, ShellTimeoutError, SqliteSelectorConnection, SubscriptionChildUnavailableError, SubscriptionClosedError, SubscriptionConfigError, TASK_MARKS, TaskMessageError, TaskMessageTimeoutError, WriteSelectorError, activeToolExecutionStarts, allToolNames, announceBlueprintBuildWaiting, applyBashSessionEnvironment, asyncScope, attachJsonlLineReader, attachLineReader, bindSavedTaskOrigins, blueprintBuildShared, blueprintDigest, canonicalEventBusFor, chatPosition, clearAssignmentIfClosed, clearLockHolder, clearLockHolderAsync, convertBufferWithMarkit, convertFileWithMarkit, createGitEnvironment, defaultToolNamesFor, defineTool, detectSupportedImageMimeTypeFromFile, displayTodoId, entryLines, expandSearchUrl, experimentalToolSamplingProperty, filterSearchOutputByLineRange, formatReadLineRange as formatReadLineRange$1, formatSelectedLines, formatSize, formatTimeoutSeconds as formatTimeoutSeconds$1, formatTodoId, frozenClocks, getManifestFromPackageJson, getTextOutput, getTodoPath, getTodoStatus, getTodoTitle, getTodosDir, getTodosDirLabel, getToolListError, handOverBuildTimings, holdDeprecationWarnings, holdToolsUntilBuilt, hostInputError, invalidArgText, invalidateNativeSearchCache, isBlueprintError, isGitProvisionError, isGitUnavailableError, isPathInside, isPlainObject as isPlainObject$1, isReadResourceSelector, isReadableUrlPath, isTodoClosed, isToolModifier, isValidBudgetMs, keptTaskHint, linkPath, literalPathLike, loadNativeSearchBinding, mergeReadRanges, nativeModuleProblem, normalizePathLikeInput, normalizeTodoId, normalizeWaitPolicy, noteSavedSeq, originalHistoryNote, prepareLockTakeover, prepareWaitableToolInput, projectTrustHandlerRegistered, projectTrustedBeforeExtensions, readLedger, readTaskOutputTail, receiveChatReceipt, recordLockHolder, recordLockHolderAsync, registerCanonicalEventBus, releaseDeprecationWarnings, renderBlueprintContext, renderToolPath, replaceTabs, reportContained, repositoryKey, resolvePhysicalPathAsync, rootKey, savedReadLines, scopedBackgroundTasks, searchPosition, selectExactReadRanges, selectReadRanges, serializeJsonLine, settingsFileNoticeKey, settingsInternals, shortenPath, sleep, sliceHead, snapshotBashSessionEnvironment, sortTodos, spawnHostProcess, splitLineRangeSelector, splitPathLikeGlob, splitReadLineSelector, splitTodosByAssignment, startShellDeadline, startToolTimer, str, stringEntries, takeOverDeadHolder, takeOverDeadHolderAsync, takeQueuedDeliveryChange, taskResumer, timestamp, toolTimerText, transcriptHeaderLines, truncateHead, truncateLine, updateLedger, validateTodoId, warnDeprecation, withFileMutationQueue, withResolvingFileMutationQueue, workspaceKey } from "./startup-0-0-Q3MWKUK4.js";
4
- import { EMPTY_OUTPUT_TEXT, HistorySearchPositions, MAX_INDEXED_ENTRY_CHARS, ResumeTimingsRecorder, SEARCH_PART_CHARS, SessionStorageSelectionSchema, TaskElapsedClocks, TaskToolError, WorkspaceDriftError, WorkspaceRestoreError, WorkspaceSnapshotError, bindTaskClock, bindTaskClockSource, buildDirectoryTree, buildDirectoryTreeFromOperations, cancelReceiptSentence, captureRegistrationInvocation, compareCreated, compareFrozen, conflictEntries, convertToLlm, createBranchSummaryMessage, createCustomMessage, diffLines, ensureTool, execCommand, findWorkspaceError, formatResumeTimings, invocationExtension, invocationRuntime, isWorkspaceConfigError, isWorkspaceDriftError, isWorkspaceError, isWorkspaceGitError, isWorkspaceSnapshotError, lifecycleScopeForOwner, normalizeAzureSettings, openEventSubscription, originalRegistrationCallback, ownedSettingsManagers, parseArgs, parseConflictBytes, parseInteractiveEngineMessage, parseSkillUri, presentTaskError, prewarmModelApi, readConflictUrl, readLocalFileChunks, recordBlueprintStep, recordResumeTimings, recordSettingsWrite, refreshConflictFile, registerConflictBlocks, registerFactoryStartupHandler, renderTodoCall, renderTodoResult, resolveInstalledGit, resolveInvocationRuntime, selectReadLinesFromChunks, selectReadLinesFromList, serializeInteractiveEngineFrame, serializeTodoForAgent, serializeTodoListForAgent, sessionPosition, settingsWriteOwner, splitSearchTextParts, startupSourceId, taskClockOf, taskClockRunning, timeCheckoutRestore, unpackIds, unreadablePathError, validateEventSource, validateSubscriptionAdmission, waitResultTail, waitStatus, withoutSearchPosition, writeRenderers } from "./startup-0-1-M6OWAYHH.js";
3
+ import { BLUEPRINT_CONTEXT_TYPE, BlueprintBuildFailedError, BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, CACHE_WARMING_MODES, COMMAND_FOREGROUND_BUDGET_MS, CompactionConfigError, DEFAULT_BUILTIN_SELECTION_EXTRA_TOOLS, DEFAULT_MAX_BYTES, EditInputError, EditMatchError, EditTargetError, FileToolAbortedError, HostListenerFailures, LONG_LIVED_COMMANDS, Minimatch, RESTART_CANCELLED_MESSAGE, STALE_EXTENSION_CONTEXT_MESSAGE, ShellTimeoutError, SqliteSelectorConnection, SubscriptionChildUnavailableError, SubscriptionClosedError, SubscriptionConfigError, TASK_MARKS, TaskMessageError, TaskMessageTimeoutError, WriteSelectorError, activeToolExecutionStarts, allToolNames, announceBlueprintBuildWaiting, applyBashSessionEnvironment, asyncScope, attachJsonlLineReader, attachLineReader, bindSavedTaskOrigins, blueprintBuildShared, canonicalEventBusFor, chatPosition, clearAssignmentIfClosed, clearLockHolder, clearLockHolderAsync, convertBufferWithMarkit, convertFileWithMarkit, createGitEnvironment, defaultToolNamesFor, defineTool, detectSupportedImageMimeTypeFromFile, displayTodoId, entryLines, expandSearchUrl, experimentalToolSamplingProperty, filterSearchOutputByLineRange, formatReadLineRange as formatReadLineRange$1, formatSelectedLines, formatSize, formatTimeoutSeconds as formatTimeoutSeconds$1, formatTodoId, frozenClocks, getManifestFromPackageJson, getTextOutput, getTodoPath, getTodoStatus, getTodoTitle, getTodosDir, getTodosDirLabel, getToolListError, handOverBuildTimings, holdDeprecationWarnings, holdToolsUntilBuilt, hostInputError, invalidArgText, invalidateNativeSearchCache, isBlueprintError, isGitProvisionError, isGitUnavailableError, isPathInside, isPlainObject as isPlainObject$1, isReadResourceSelector, isReadableUrlPath, isTodoClosed, isToolModifier, isValidBudgetMs, keptTaskHint, linkPath, literalPathLike, loadNativeSearchBinding, mergeReadRanges, nativeModuleProblem, normalizePathLikeInput, normalizeTodoId, normalizeWaitPolicy, noteSavedSeq, originalHistoryNote, prepareLockTakeover, prepareWaitableToolInput, projectTrustHandlerRegistered, projectTrustedBeforeExtensions, readTaskOutputTail, receiveChatReceipt, recordLockHolder, recordLockHolderAsync, registerCanonicalEventBus, releaseDeprecationWarnings, renderBlueprintContext, renderToolPath, replaceTabs, reportContained, resolvePhysicalPathAsync, savedReadLines, scopedBackgroundTasks, searchPosition, selectExactReadRanges, selectReadRanges, serializeJsonLine, settingsFileNoticeKey, settingsInternals, shortenPath, sleep, sliceHead, snapshotBashSessionEnvironment, sortTodos, spawnHostProcess, splitLineRangeSelector, splitPathLikeGlob, splitReadLineSelector, splitTodosByAssignment, startShellDeadline, startToolTimer, str, stringEntries, takeOverDeadHolder, takeOverDeadHolderAsync, takeQueuedDeliveryChange, taskResumer, timestamp, toolTimerText, transcriptHeaderLines, truncateHead, truncateLine, validateTodoId, warnDeprecation, withFileMutationQueue, withResolvingFileMutationQueue } from "./startup-0-0-ERMIDHQT.js";
4
+ import { EMPTY_OUTPUT_TEXT, HistorySearchPositions, MAX_INDEXED_ENTRY_CHARS, ResumeTimingsRecorder, SEARCH_PART_CHARS, SessionStorageSelectionSchema, TaskElapsedClocks, TaskToolError, WorkspaceDriftError, WorkspaceRestoreError, WorkspaceSnapshotError, bindTaskClock, bindTaskClockSource, blueprintDigest, buildDirectoryTree, buildDirectoryTreeFromOperations, cancelReceiptSentence, captureRegistrationInvocation, compareCreated, compareFrozen, conflictEntries, convertToLlm, createBranchSummaryMessage, createCustomMessage, diffLines, ensureTool, execCommand, findWorkspaceError, formatResumeTimings, invocationExtension, invocationRuntime, isWorkspaceConfigError, isWorkspaceDriftError, isWorkspaceError, isWorkspaceGitError, isWorkspaceSnapshotError, lifecycleScopeForOwner, normalizeAzureSettings, openEventSubscription, originalRegistrationCallback, ownedSettingsManagers, parseArgs, parseConflictBytes, parseInteractiveEngineMessage, parseSkillUri, presentTaskError, prewarmModelApi, readConflictUrl, readLedger, readLocalFileChunks, recordBlueprintStep, recordResumeTimings, recordSettingsWrite, refreshConflictFile, registerConflictBlocks, registerFactoryStartupHandler, renderTodoCall, renderTodoResult, repositoryKey, resolveInstalledGit, resolveInvocationRuntime, rootKey, selectReadLinesFromChunks, selectReadLinesFromList, serializeInteractiveEngineFrame, serializeTodoForAgent, serializeTodoListForAgent, sessionPosition, settingsWriteOwner, splitSearchTextParts, startupSourceId, taskClockOf, taskClockRunning, timeCheckoutRestore, unpackIds, unreadablePathError, updateLedger, validateEventSource, validateSubscriptionAdmission, waitResultTail, waitStatus, withWorktreeLockProgress, withoutSearchPosition, workspaceKey, writeRenderers } from "./startup-0-1-RTASI3HG.js";
5
5
  import { CodeHighlighter, FS_WATCH_RETRY_DELAY_MS, applyEarlyInputChunk, closeWatcher, getLanguageFromPath, graphemeAt, highlightCode, isSafeFsWatchPathError, keepStartupDialogDraft, migrateKeybindingsConfig, parenthesizedKeyHint, recordTimingLines, sanitizeTerminalText, singleLineDisplayText, slashCommandHint, terminalDisplayText, theme, watchWithErrorHandlerAsync, withEarlyInputHeldForStartupDialog } from "./p2-shell-main-B2WIALFD.js";
6
6
  import { parseJsonFileContent } from "./p1-shared-RG5I5LJ6.js";
7
- import { ProjectTrustStore, failureDebugFields, hasProjectTrustInputsAsync, inLockTurn, matchesOnSameLineCI, redactUrlCredentials, releaseLock, releaseLockSync, renameReplacing, renameReplacingAsync, renameWithRetry, reportDebugAsync, waitForLock, waitForLockSync } from "./p1b-elig-TVB5CBLL.js";
8
- import { FILE_HEADERS_ONLY, InteractiveEngineMonitor, ModelConfig, RpcTerminalDrain, TodoParams, addShellOutputPreview, assertSessionOpen, bindTaskChatPage, captureTaskChatFile, chatPageRequest, createTwoFilesPatch, drainSessionWork, dropWrongTypedSettings, estimateTokens, formatKillCall, formatPatch, formatTruncationNotice, formatWorkingElapsed, getNativeMcpToolIdentity, getPowerShellConfigAsync, getShellConfigAsync, getShellEnvAsync, hasCallingSessionWork, invalidSettingMessage, isPowerShellAvailable, isResumePreconditionError, isTodoOperationError, killChildProcessTree, loadTaskOwnTranscriptEntries, markNativeMcpToolDefinition, rebuildKillResult, rebuildShellWaitResult, selectProcessStorageSteps, sessionGenerationClosing, sessionLifetime, spawnShellProcess, structuredPatch, taskChatPage, taskExtensionStatuses, taskOwnTranscriptEntries, taskTranscriptSource, trackDetachedChildPid, trackDetachedChildProcess, trackSessionWork, untrackDetachedChildPid, watchTaskExtensionStatuses, wrapToolDefinition } from "./startup-0-2-2HUMCPKX.js";
9
- import { appendToLog, applyContextEdit, assertExtensionAction, buildProcessStarting, extensionWorkOpen, findSessionOpenHolder, getBaseDirsForScope, getOwnerTaskSession, getOwnerTaskStore, inExtensionCleanup, isResumeFailure, isRetiredExtensionCleanup, isTaskTurnInterrupted, loadArchiveSnapshot, logTail, migrateAzureProvider, migrateAzureProviderAsync, onExtensionSessionQuit, openStepLog, processImage, resolvePathFromBase, resolveWorktreeSnapshotSettings, runLoggedProcess, sessionEntryToContextMessages, sha256Hex, startElapsedMs, stripLeadingCdCommandAsync, taskResumedTurns, trackExtensionWork, watchOwnerTaskStoreBinding, withTodoLock } from "./startup-0-3-4ZYBYQNM.js";
7
+ import { ProjectTrustStore, failureDebugFields, hasProjectTrustInputsAsync, inLockTurn, matchesOnSameLineCI, redactUrlCredentials, releaseLock, releaseLockSync, renameReplacing, renameReplacingAsync, renameWithRetry, reportDebugAsync, waitForLock, waitForLockSync } from "./p1b-elig-BY2G5BUE.js";
8
+ import { FILE_HEADERS_ONLY, InteractiveEngineMonitor, ModelConfig, RpcTerminalDrain, TodoParams, addShellOutputPreview, assertSessionOpen, bindTaskChatPage, captureTaskChatFile, chatPageRequest, createTwoFilesPatch, drainSessionWork, dropWrongTypedSettings, estimateTokens, formatKillCall, formatPatch, formatTruncationNotice, formatWorkingElapsed, getNativeMcpToolIdentity, getPowerShellConfigAsync, getShellConfigAsync, getShellEnvAsync, hasCallingSessionWork, invalidSettingMessage, isPowerShellAvailable, isResumePreconditionError, isTodoOperationError, killChildProcessTree, loadTaskOwnTranscriptEntries, markNativeMcpToolDefinition, rebuildKillResult, rebuildShellWaitResult, selectProcessStorageSteps, sessionGenerationClosing, sessionLifetime, spawnShellProcess, structuredPatch, taskChatPage, taskExtensionStatuses, taskOwnTranscriptEntries, taskTranscriptSource, trackDetachedChildPid, trackDetachedChildProcess, trackSessionWork, untrackDetachedChildPid, watchTaskExtensionStatuses, wrapToolDefinition } from "./startup-0-2-YZZOC22D.js";
9
+ import { appendToLog, applyContextEdit, assertExtensionAction, buildProcessStarting, extensionWorkOpen, findSessionOpenHolder, getBaseDirsForScope, getOwnerTaskSession, getOwnerTaskStore, inExtensionCleanup, isResumeFailure, isRetiredExtensionCleanup, isTaskTurnInterrupted, loadArchiveSnapshot, logTail, migrateAzureProvider, migrateAzureProviderAsync, onExtensionSessionQuit, openStepLog, processImage, resolvePathFromBase, resolveWorktreeSnapshotSettings, runLoggedProcess, sessionEntryToContextMessages, sha256Hex, startElapsedMs, stripLeadingCdCommandAsync, taskResumedTurns, trackExtensionWork, watchOwnerTaskStoreBinding, withTodoLock } from "./startup-0-3-DE2NCS6A.js";
10
10
  import { DecisionConfigError, SessionHistoryNotLoadedError, asAcceptedRequestFailure, isDecisionConfigError, markRpcTransportFailure, rpcTransportError } from "./settings-startup-HXQLSUWM.js";
11
- import { JsonlSessionStore, LegacySessionStore, checkedCustomMessage, checkedCustomType, checkedLabel, getLastConversationMessageId, getLatestSessionSummary, historyPageGeneration, storeSnapshotIndex, transcriptCursorWithin } from "./startup-8-0-34CBHPZH.js";
12
- import { TASK_COMPLETION_MESSAGE_TYPE, admitPooledWorktree, adoptPrebuiltSeed, assertRpcSuccess, authForStream, captureLocatedCheckout, captureWorktreeSnapshot, carryOverDegradedWork, childOfAttempt, chunkedToolResult, chunkedToolResultEntry, claimIdleWorktree, completionTitleDescription, confirmPooledWorktreeLease, createLoadedAskUserQuestionToolDefinition, createToolNameMatcher, defaultResumePreflightIo, discardPooledWorktree, evictIdleWorktrees, executeNativePty, executeSupervisedCommand, expandSkillCommand, extensionsCanDecideProjectTrust, getExistingGitInstallPathAsync, getManagedNpmInstallPath, gitText, holdRestoredWorktree, holdsSessionSnapshotRef, hostPlatform, inheritWorkspace, isHeadOnlyAdvance, isMcpToolName, isRecoverableRestoreFailure, keepSessionSnapshotCommit, loadSnapshotPathPolicy, locateCheckout, lookupOwnedTask, nextCaptureTick, parseBlueprint, parseSource, pendingLfsDownload, pooledWorktreeHolder, readRepositoryConfig, recordPooledWorktreeState, recordWorktreeCapture, releaseRestoredWorktree, releaseSessionSnapshotRefs, removeRestoredWorktree, require_dist, restoreBestWorktree, restoreDegradedWorktree, restoreDegradedWorktreeAt, restoreWorktree, restoreWorktreeAt, retireSessionSnapshotRefs, runGit, selectDocument, setAsideWorktree, snapshotRestoreWarnings, unrestoredRecord, validateBashWait, validateTaskHeartbeatMs, verifyWorktree, waitForSupervisedCommand, waitingReleasedTools, withScratchDirectory, withoutSupersededAttempts, worktreeSetAside, writeWorkingTree } from "./startup-0-5-YDW47QX6.js";
11
+ import { JsonlSessionStore, LegacySessionStore, checkedCustomMessage, checkedCustomType, checkedLabel, getLastConversationMessageId, getLatestSessionSummary, historyPageGeneration, readSessionRange, storeSnapshotIndex, transcriptCursorWithin } from "./startup-8-0-34CBHPZH.js";
12
+ import { TASK_COMPLETION_MESSAGE_TYPE, admitPooledWorktree, adoptPrebuiltSeed, assertRpcSuccess, authForStream, captureLocatedCheckout, captureWorktreeSnapshot, carryOverDegradedWork, childOfAttempt, chunkedToolResult, chunkedToolResultEntry, claimIdleWorktree, completionTitleDescription, confirmPooledWorktreeLease, createLoadedAskUserQuestionToolDefinition, createToolNameMatcher, defaultResumePreflightIo, discardPooledWorktree, evictIdleWorktrees, executeNativePty, executeSupervisedCommand, expandSkillCommand, extensionsCanDecideProjectTrust, getExistingGitInstallPathAsync, getManagedNpmInstallPath, gitText, holdRestoredWorktree, holdsSessionSnapshotRef, hostPlatform, inheritWorkspace, isHeadOnlyAdvance, isMcpToolName, isRecoverableRestoreFailure, keepSessionSnapshotCommit, loadSnapshotPathPolicy, locateCheckout, lookupOwnedTask, nextCaptureTick, parseBlueprint, parseSource, pendingLfsDownload, pooledWorktreeHolder, readRepositoryConfig, recordPooledWorktreeState, recordWorktreeCapture, releaseRestoredWorktree, releaseSessionSnapshotRefs, removeRestoredWorktree, require_dist, restoreBestWorktree, restoreDegradedWorktree, restoreDegradedWorktreeAt, restoreWorktree, restoreWorktreeAt, retireSessionSnapshotRefs, runGit, selectDocument, setAsideWorktree, snapshotRestoreWarnings, unrestoredRecord, validateBashWait, validateTaskHeartbeatMs, verifyWorktree, waitForSupervisedCommand, waitingReleasedTools, withScratchDirectory, withoutSupersededAttempts, worktreeSetAside, writeWorkingTree } from "./startup-0-5-HZX3ZPTP.js";
13
13
  import { OutputAccumulator, SNAPSHOT_COLLECTION_SESSION_DELAY_MS, TOOL_BLOCK_LIMITS, ToolBlockRecords, applyModelsJson, cancelledBuilds, canonicalPaths, canonicalizeWorktreePathAsync, collapseToolBlockLines, defaultWorktreeSnapshotStoreDir, migrateAuthJsonConfigValues, migrateAuthJsonConfigValuesAsync, migrateModelsJsonConfigValues, migrateModelsJsonConfigValuesAsync, renderDiff, runCanonicalSteps, runCanonicalStepsAsync, sameRemote, scheduleSnapshotCollection, settleOtherBuilds, taskTranscriptPageWithCuts, withBuildLocks } from "./startup-0-4-ZMJV547D.js";
14
14
  import { SETTINGS_DEFAULTS } from "./p2-common-YLSYXMDQ.js";
15
15
  import { adoptPrewarmedEngine, engineLaunch, waitForPrewarmedEngineReady } from "./p1a-prewarm-XIU57JHF.js";
@@ -20,6 +20,7 @@ import nodePath, { dirname, isAbsolute, join, resolve, sep } from "path";
20
20
  import { constants as constants$1, tmpdir } from "node:os";
21
21
  import path, { basename as basename$1, delimiter as delimiter$1, dirname as dirname$1, extname, isAbsolute as isAbsolute$1, join as join$1, parse as parse$2, relative as relative$1, resolve as resolve$1, sep as sep$1, win32 as win32$1 } from "node:path";
22
22
  import { spawn } from "node:child_process";
23
+ import { createTimeoutSignal, setLongTimeout, setLongTimeoutAt, sleepFor } from "../__atomic_timers/index.js";
23
24
  import { execFile as execFile$1 } from "child_process";
24
25
  import { createSessionCwdMatcherAsync } from "../utils/canonical-path.js";
25
26
  import { pathExists, pathExists as pathExists$1 } from "../utils/path-exists.js";
@@ -40,11 +41,11 @@ import { randomUUID as randomUUID$1 } from "crypto";
40
41
  import { createInterface } from "node:readline";
41
42
  import { DEGRADED_RESTORE_RETENTION_DAYS, snapshotBlobHashes } from "../core/worktree-snapshot/blob-store.js";
42
43
  import { StorageProvider } from "../core/storage/provider.js";
43
- import { setImmediate as setImmediate$1 } from "node:timers";
44
44
  import { isProxy } from "node:util/types";
45
45
  import { defaultSessionDatabasePathAsync, defaultSessionDatabasePathSteps, defaultSharedStoragePathSteps, runStorageSteps, runStorageStepsSync, storagePathBaseDirSteps, storageSettingsSteps } from "../core/storage/file-identity.js";
46
46
  import { Type as Type$1 } from "@bastani/atomic-ai/utils/typebox/index";
47
47
  import { deflateRaw as deflateRaw$1, gunzip as gunzip$1, gzip as gzip$1, inflateRaw as inflateRaw$1 } from "node:zlib";
48
+ import { setImmediate as setImmediate$1 } from "node:timers";
48
49
  import { getAllBuiltinModels } from "@bastani/atomic-ai/providers/all";
49
50
  import { Value } from "@bastani/atomic-ai/utils/typebox/value";
50
51
  import { selectStorageSteps } from "../core/storage/selection.js";
@@ -257,7 +258,7 @@ function beginCapture(slots, key, capture, lookUpAgain) {
257
258
  return active;
258
259
  }
259
260
  function promoteQueuedCapture(queued) {
260
- clearTimeout(queued.timer);
261
+ queued.timer.clear();
261
262
  queued.start().result.then(queued.resolve, queued.reject);
262
263
  }
263
264
  function settleActiveCapture(slots, key, finished, outcome) {
@@ -277,14 +278,12 @@ function expireActiveCaptureWait(slots, key, stuck) {
277
278
  }
278
279
  function enqueueBehindActiveCapture(slots, key, active, capture) {
279
280
  const { promise, resolve: resolveNext, reject: rejectNext } = Promise.withResolvers();
280
- const timer = setTimeout(() => expireActiveCaptureWait(slots, key, active), Math.max(0, active.startedMs + queuedCaptureWaitMs() - performance.now()));
281
- timer.unref?.();
282
281
  const queued = {
283
282
  start: () => beginCapture(slots, key, capture, true),
284
283
  promise,
285
284
  resolve: resolveNext,
286
285
  reject: rejectNext,
287
- timer
286
+ timer: setLongTimeoutAt(() => expireActiveCaptureWait(slots, key, active), active.startedMs + queuedCaptureWaitMs(), { ref: false })
288
287
  };
289
288
  slots.set(key, {
290
289
  kind: "running_with_queued",
@@ -883,6 +882,14 @@ function subagentCaptureHints(sessionManager) {
883
882
  }
884
883
  return hints;
885
884
  }
885
+ async function captureRecordAt(store, childId, cut, snapshotId) {
886
+ if (!Object.hasOwn(cut.records, snapshotId)) return void 0;
887
+ const seq = cut.records[snapshotId];
888
+ const read = await readSessionRange(store, childId, seq, seq, cut.epoch);
889
+ if (read.epoch !== cut.epoch || read.lastSeq < cut.lastSeq) return void 0;
890
+ const entry = read.entries[0];
891
+ return entry?.type === "worktree_snapshot" && entry.snapshotId === snapshotId ? entry.snapshot : void 0;
892
+ }
886
893
  /**
887
894
  * Before a resume decides what to restore, each checkout the session recorded, or works in, that one of its own finished
888
895
  * subagents captured later than the session itself did gets that capture as the session's latest snapshot, so the
@@ -907,9 +914,10 @@ async function adoptSubagentCaptures(sessionManager, signal) {
907
914
  if (plannedAt !== null) throw new Error("The session's branch changed while its subagents' captures were compared");
908
915
  };
909
916
  const mappings = sessionManager.getWorktreeRootMappings();
917
+ const canonical = canonicalPaths();
910
918
  const own = /* @__PURE__ */ new Map();
911
919
  const note = async (root, at) => {
912
- const original = await runCanonicalStepsAsync(originalRoot(root, mappings));
920
+ const original = await runCanonicalStepsAsync(originalRoot(root, mappings), canonical);
913
921
  own.set(original, {
914
922
  root,
915
923
  at: Math.max(own.get(original)?.at ?? Number.NEGATIVE_INFINITY, at)
@@ -920,52 +928,68 @@ async function adoptSubagentCaptures(sessionManager, signal) {
920
928
  await note(entry.root, Number.isFinite(at) ? at : Number.NEGATIVE_INFINITY);
921
929
  }
922
930
  const pinned = /* @__PURE__ */ new Set();
923
- for (const [original, checkout] of await runCanonicalStepsAsync(checkoutRecords(sessionManager, mappings))) if (checkout.pin !== void 0 && !checkout.pin.lapsed) pinned.add(original);
931
+ for (const [original, checkout] of await runCanonicalStepsAsync(checkoutRecords(sessionManager, mappings), canonical)) if (checkout.pin !== void 0 && !checkout.pin.lapsed) pinned.add(original);
924
932
  const cwd = sessionManager.getHeader()?.cwd ?? sessionManager.getCwd();
925
933
  /** Whether the session works in checkout `original`: it recorded it, or its working directory is inside it. */
926
- const works = async (original) => own.has(original) || await runCanonicalStepsAsync(isInside$2(original, cwd));
934
+ const works = async (original) => own.has(original) || await runCanonicalStepsAsync(isInside$2(original, cwd), canonical);
927
935
  let coversCwd = false;
928
- for (const original of own.keys()) if (await runCanonicalStepsAsync(isInside$2(original, cwd))) coversCwd = true;
936
+ for (const original of own.keys()) if (await runCanonicalStepsAsync(isInside$2(original, cwd), canonical)) coversCwd = true;
929
937
  let threshold = coversCwd ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
930
938
  for (const checkout of own.values()) threshold = Math.min(threshold, checkout.at);
939
+ const eligible = [...hints.values()].filter((hint) => hint.at > threshold);
940
+ const store = sessionManager.getSessionStore();
941
+ signal?.throwIfAborted();
942
+ const candidates = eligible.length === 0 ? void 0 : await store.readBranchSnapshotMetadata?.(eligible.map(({ sessionId }) => sessionId)).catch(() => void 0);
931
943
  const best = /* @__PURE__ */ new Map();
932
- for (const hint of hints.values()) {
944
+ for (const { sessionId: childId } of eligible) {
933
945
  signal?.throwIfAborted();
934
- if (hint.at <= threshold) continue;
935
- let child;
936
- try {
937
- child = await sessionManager.openSessionById(hint.sessionId, void 0, void 0, { history: "tail" });
938
- } catch {
939
- continue;
940
- }
941
- const childMappings = child.getWorktreeRootMappings();
946
+ const candidate = candidates?.get(childId);
947
+ if (candidate === null) continue;
942
948
  let entries;
943
- try {
944
- entries = await branchSnapshotEntries(child, signal);
949
+ let childMappings;
950
+ let readRecord;
951
+ if (candidate) {
952
+ entries = candidate.entries;
953
+ childMappings = entries.flatMap((entry) => entry.restore ? [entry.restore] : []);
954
+ readRecord = (id) => captureRecordAt(store, childId, candidate, id);
955
+ } else try {
956
+ const child = await sessionManager.openSessionById(childId, void 0, void 0, { history: "tail" });
957
+ childMappings = child.getWorktreeRootMappings();
958
+ entries = (await branchSnapshotEntries(child, signal)).map((entry) => ({
959
+ ...entry,
960
+ capture: isCapture(entry)
961
+ }));
962
+ readRecord = async (id) => (await snapshotRecordsOf(child, [id], signal)).get(id);
945
963
  } catch {
946
964
  continue;
947
965
  }
966
+ const originals = /* @__PURE__ */ new Map();
948
967
  for (const entry of entries) {
949
- if (!isCapture(entry)) continue;
968
+ if (!entry.capture) continue;
950
969
  const at = Date.parse(entry.timestamp);
951
- const original = await runCanonicalStepsAsync(originalRoot(entry.root, childMappings));
970
+ let original = originals.get(entry.root);
971
+ if (original === void 0) {
972
+ original = await runCanonicalStepsAsync(originalRoot(entry.root, childMappings), canonical);
973
+ originals.set(entry.root, original);
974
+ }
952
975
  if (pinned.has(original) || !await works(original)) continue;
953
976
  if (at <= (own.get(original)?.at ?? Number.NEGATIVE_INFINITY)) continue;
954
977
  const chosen = best.get(original);
955
- if (chosen === void 0 || at > chosen.at || chosen.child === child && at >= chosen.at) best.set(original, {
956
- child,
978
+ if (chosen === void 0 || at > chosen.at || chosen.childId === childId && at >= chosen.at) best.set(original, {
979
+ childId,
957
980
  entry,
958
- at
981
+ at,
982
+ readRecord
959
983
  });
960
984
  }
961
985
  }
962
986
  const adopted = [];
963
- for (const [original, { child, entry }] of best) {
987
+ for (const [original, { entry, readRecord }] of best) {
964
988
  signal?.throwIfAborted();
965
989
  let record;
966
990
  let held;
967
991
  try {
968
- record = (await snapshotRecordsOf(child, [entry.snapshotId], signal)).get(entry.snapshotId);
992
+ record = await readRecord(entry.snapshotId);
969
993
  held = (await snapshotRecordsOf(sessionManager, [entry.snapshotId], signal)).has(entry.snapshotId);
970
994
  } catch (error) {
971
995
  if (signal?.aborted) throw error;
@@ -3971,7 +3995,7 @@ function statusOf(run, globalFailed) {
3971
3995
  if (globalFailed) return "failed";
3972
3996
  return run.failures.length > 0 ? "partial" : "success";
3973
3997
  }
3974
- async function executeBuild(repositories, config, signal) {
3998
+ async function executeBuild(repositories, config, signal, onLedgerWait) {
3975
3999
  const platform = config.platform ?? hostPlatform();
3976
4000
  const now = config.now ?? Date.now;
3977
4001
  const trusted = await trustedOf(repositories, config);
@@ -4018,8 +4042,9 @@ async function executeBuild(repositories, config, signal) {
4018
4042
  workspaces: /* @__PURE__ */ new Map(),
4019
4043
  roots: /* @__PURE__ */ new Map()
4020
4044
  };
4045
+ const writeLedger = (update) => updateLedger(config.storeDir, update, (message) => onLedgerWait?.(trusted[0].root, message));
4021
4046
  const startedAt = new Date(now()).toISOString();
4022
- await inPhase("ledger", "the build ledger could not be written", () => updateLedger(config.storeDir, (current) => ({
4047
+ await inPhase("ledger", "the build ledger could not be written", () => writeLedger((current) => ({
4023
4048
  ...current,
4024
4049
  roots: {
4025
4050
  ...current.roots,
@@ -4047,7 +4072,7 @@ async function executeBuild(repositories, config, signal) {
4047
4072
  const finishedAt = new Date(now()).toISOString();
4048
4073
  const failedRoots = new Set(run.failures.map((failure) => failure.root).filter((root) => root !== null));
4049
4074
  await inPhase("environment", "the $ENVRC of the build could not be kept for the session", () => writeSessionEnvironment(run, trusted));
4050
- await inPhase("ledger", "the build ledger could not be written", () => updateLedger(config.storeDir, (current) => {
4075
+ await inPhase("ledger", "the build ledger could not be written", () => writeLedger((current) => {
4051
4076
  const workspaces = { ...current.workspaces };
4052
4077
  for (const [key, entry] of run.workspaces) if (entry === null) delete workspaces[key];
4053
4078
  else workspaces[key] = entry;
@@ -4129,10 +4154,10 @@ async function layersOfCrashedBuild(repositories, config, failure) {
4129
4154
  * `post-build`. A step that fails stops the rest of its blueprint, never the other blueprints, and never the resume:
4130
4155
  * the failure is in the outcome. Only `signal` aborting rejects, with its reason. Untrusted repositories run nothing.
4131
4156
  */
4132
- async function runBlueprintBuild(repositories, config, signal) {
4157
+ async function runBlueprintBuild(repositories, config, signal, onLedgerWait) {
4133
4158
  signal?.throwIfAborted();
4134
4159
  try {
4135
- return await executeBuild(repositories, config, signal);
4160
+ return await executeBuild(repositories, config, signal, onLedgerWait);
4136
4161
  } catch (error) {
4137
4162
  if (signal?.aborted) throw error;
4138
4163
  const crash = isBlueprintError(error) ? error : crashedBuild(error);
@@ -4238,7 +4263,7 @@ function inheritedRemotes(root, own, restores, snapshots) {
4238
4263
  */
4239
4264
  async function setUpAndDescribe(options) {
4240
4265
  const restored = options.restored.map(blueprintRepository);
4241
- const outcome = restored.length === 0 ? void 0 : await runBlueprintBuild(restored, options.config, options.signal);
4266
+ const outcome = restored.length === 0 ? void 0 : await runBlueprintBuild(restored, options.config, options.signal, options.onLedgerWait);
4242
4267
  const layers = [...outcome?.layers ?? []];
4243
4268
  const described = [[options.inPlace, "in-place"], [options.earlier, "earlier"]];
4244
4269
  for (const [checkouts, reason] of described) {
@@ -4624,6 +4649,9 @@ async function hasLocalChanges(root, signal) {
4624
4649
  * that never stops the resume.
4625
4650
  */
4626
4651
  async function prepareSessionResume(sessionManager, options) {
4652
+ return withWorktreeLockProgress(options.onProgress, () => prepareSessionResumeWithTimings(sessionManager, options));
4653
+ }
4654
+ async function prepareSessionResumeWithTimings(sessionManager, options) {
4627
4655
  const storeDir = resolveStoreDir(options);
4628
4656
  await holdSessionWorktrees(sessionManager, sessionManager, storeDir, options.signal);
4629
4657
  const timings = new ResumeTimingsRecorder(options.entryPoint === "cli" ? 0 : void 0);
@@ -5163,12 +5191,13 @@ async function setUpCheckoutBlueprints(sessionManager, restoredNow, storeDir, op
5163
5191
  for (const root of claimed) buildsInProgress.set(root, settled);
5164
5192
  try {
5165
5193
  await Promise.all(joined.map((checkout) => buildInProgress(checkout.root)));
5194
+ const onWait = (root, message) => {
5195
+ options.onProgress?.(message);
5196
+ announceBlueprintBuildWaiting(root, message);
5197
+ };
5166
5198
  const settled = await settleOtherBuilds(storeDir, claimed, {
5167
5199
  signal: options.signal,
5168
- onWait: (root, message) => {
5169
- options.onProgress?.(message);
5170
- announceBlueprintBuildWaiting(root, message);
5171
- }
5200
+ onWait
5172
5201
  }).catch((error) => {
5173
5202
  if (options.signal?.aborted) throw error;
5174
5203
  return {
@@ -5190,7 +5219,8 @@ async function setUpCheckoutBlueprints(sessionManager, restoredNow, storeDir, op
5190
5219
  ...options.blueprint,
5191
5220
  storeDir
5192
5221
  },
5193
- signal: options.signal
5222
+ signal: options.signal,
5223
+ onLedgerWait: onWait
5194
5224
  }), (message) => unlocked.push(message));
5195
5225
  } finally {
5196
5226
  await settled.release();
@@ -5326,6 +5356,9 @@ async function workedInCheckout(snapshot, root, sessionId, signal) {
5326
5356
  * in, after the restores it recorded, which `reopen` opens it in.
5327
5357
  */
5328
5358
  async function continueSessionWhereItWorked(opened, options, reopen = (cwd) => opened.openSessionById(opened.getSessionId(), cwd, void 0, { history: "tail" })) {
5359
+ return withWorktreeLockProgress(options.onProgress, () => continueSessionWithWorktrees(opened, options, reopen));
5360
+ }
5361
+ async function continueSessionWithWorktrees(opened, options, reopen) {
5329
5362
  const storeDir = resolveStoreDir(options);
5330
5363
  await holdSessionWorktrees(opened, opened, storeDir, options.signal);
5331
5364
  try {
@@ -12594,7 +12627,7 @@ function createBashToolDefinition(cwd, options, presentation = BASH_SHELL_PRESEN
12594
12627
  const emitOutputUpdate = () => {
12595
12628
  if (!onUpdate || !updateDirty) return;
12596
12629
  updateDirty = false;
12597
- lastUpdateAt = Date.now();
12630
+ lastUpdateAt = performance.now();
12598
12631
  const snapshot = output.snapshot({ persistIfTruncated: true });
12599
12632
  onUpdate({
12600
12633
  content: [{
@@ -12616,7 +12649,7 @@ function createBashToolDefinition(cwd, options, presentation = BASH_SHELL_PRESEN
12616
12649
  const scheduleOutputUpdate = () => {
12617
12650
  if (!onUpdate) return;
12618
12651
  updateDirty = true;
12619
- const delay = BASH_UPDATE_THROTTLE_MS - (Date.now() - lastUpdateAt);
12652
+ const delay = BASH_UPDATE_THROTTLE_MS - (performance.now() - lastUpdateAt);
12620
12653
  if (delay <= 0) {
12621
12654
  clearUpdateTimer();
12622
12655
  emitOutputUpdate();
@@ -13382,7 +13415,7 @@ function runWorkerTask(payload, timeoutMs, signal, transfer) {
13382
13415
  settle(outcome) {
13383
13416
  if (settled) return;
13384
13417
  settled = true;
13385
- clearTimeout(timer);
13418
+ timer?.clear();
13386
13419
  clearTimeout(task.handOff);
13387
13420
  signal?.removeEventListener("abort", onAbort);
13388
13421
  if ("error" in outcome) reject(outcome.error);
@@ -13415,9 +13448,9 @@ function runWorkerTask(payload, timeoutMs, signal, transfer) {
13415
13448
  const onAbort = () => {
13416
13449
  removeOrCancel({ error: signal?.reason ?? /* @__PURE__ */ new Error("Operation aborted") });
13417
13450
  };
13418
- const timer = Number.isFinite(effectiveMs) ? setTimeout(() => {
13451
+ const timer = Number.isFinite(effectiveMs) ? setLongTimeoutAt(() => {
13419
13452
  removeOrCancel({ timedOut: true });
13420
- }, effectiveMs) : void 0;
13453
+ }, deadline) : void 0;
13421
13454
  signal?.addEventListener("abort", onAbort, { once: true });
13422
13455
  waitingQueue.push(task);
13423
13456
  pumpQueue();
@@ -13525,14 +13558,11 @@ function isHistoryDeadlineError(error) {
13525
13558
  function yieldTurn() {
13526
13559
  return new Promise((resolve) => setImmediate$1(resolve));
13527
13560
  }
13528
- /** A signal that aborts after `ms`, or never for an unlimited (infinite) time budget. */
13529
- function timeoutSignal(ms) {
13530
- return Number.isFinite(ms) ? AbortSignal.timeout(ms) : new AbortController().signal;
13531
- }
13532
13561
  var HistoryCallBudget = class {
13533
13562
  signal;
13534
13563
  reservedBytes;
13535
13564
  callSignal;
13565
+ clearCallTimer;
13536
13566
  timeMs;
13537
13567
  deadline;
13538
13568
  floor;
@@ -13540,15 +13570,17 @@ var HistoryCallBudget = class {
13540
13570
  rowsLeft;
13541
13571
  sliceStart = performance.now();
13542
13572
  constructor(budget, signal, noteBytes = NOTE_RESERVE_BYTES) {
13573
+ signal?.throwIfAborted();
13543
13574
  this.signal = signal;
13544
13575
  this.timeMs = Math.max(STORE_WAIT_MIN_MS, budget.timeMs);
13545
13576
  this.deadline = performance.now() + budget.timeMs;
13546
- this.callSignal = this.withCaller(timeoutSignal(this.timeMs));
13577
+ const timeout = createTimeoutSignal(this.timeMs);
13578
+ this.callSignal = this.withCaller(timeout.signal);
13579
+ this.clearCallTimer = timeout.clear;
13547
13580
  const reserve = Math.max(Math.min(NOTE_RESERVE_BYTES, Math.floor(budget.bytes * .25)) + Math.max(0, noteBytes - NOTE_RESERVE_BYTES), budget.bytes < NOTE_RESERVE_BYTES ? Math.min(noteBytes, Math.floor(budget.bytes / 2)) : 0);
13548
13581
  this.bytesLeft = Math.max(1, budget.bytes - reserve);
13549
13582
  this.reservedBytes = budget.bytes - this.bytesLeft;
13550
13583
  this.rowsLeft = budget.rows;
13551
- signal?.throwIfAborted();
13552
13584
  }
13553
13585
  get storeSignal() {
13554
13586
  return this.floor?.signal ?? this.callSignal;
@@ -13556,14 +13588,22 @@ var HistoryCallBudget = class {
13556
13588
  holdProgressFloor() {
13557
13589
  const floorMs = Math.max(PROGRESS_FLOOR_MS, this.timeMs);
13558
13590
  const until = performance.now() + floorMs;
13591
+ this.floor?.clear();
13592
+ const timeout = createTimeoutSignal(floorMs);
13559
13593
  this.floor = {
13560
13594
  until,
13561
- signal: this.withCaller(timeoutSignal(floorMs))
13595
+ signal: this.withCaller(timeout.signal),
13596
+ clear: timeout.clear
13562
13597
  };
13563
13598
  }
13564
13599
  markProgress() {
13600
+ this.floor?.clear();
13565
13601
  this.floor = void 0;
13566
13602
  }
13603
+ dispose() {
13604
+ this.clearCallTimer();
13605
+ this.markProgress();
13606
+ }
13567
13607
  withCaller(timeout) {
13568
13608
  return this.signal ? AbortSignal.any([this.signal, timeout]) : timeout;
13569
13609
  }
@@ -13580,19 +13620,20 @@ var HistoryCallBudget = class {
13580
13620
  race(work) {
13581
13621
  work.catch(() => {});
13582
13622
  if (this.signal?.aborted) return Promise.reject(this.signal.reason ?? /* @__PURE__ */ new Error("Operation aborted"));
13583
- if (this.storeSignal.aborted) return Promise.reject(new HistoryDeadlineError());
13623
+ const storeSignal = this.storeSignal;
13624
+ if (storeSignal.aborted) return Promise.reject(new HistoryDeadlineError());
13584
13625
  return new Promise((resolve, reject) => {
13585
13626
  const onAbort = () => {
13586
13627
  if (this.signal?.aborted) reject(this.signal.reason ?? /* @__PURE__ */ new Error("Operation aborted"));
13587
13628
  else reject(new HistoryDeadlineError());
13588
13629
  };
13589
- this.storeSignal.addEventListener("abort", onAbort, { once: true });
13630
+ storeSignal.addEventListener("abort", onAbort, { once: true });
13590
13631
  work.then((value) => {
13591
- this.storeSignal.removeEventListener("abort", onAbort);
13632
+ storeSignal.removeEventListener("abort", onAbort);
13592
13633
  resolve(value);
13593
13634
  }, (error) => {
13594
- this.storeSignal.removeEventListener("abort", onAbort);
13595
- if (!this.signal?.aborted && this.storeSignal.aborted) reject(new HistoryDeadlineError());
13635
+ storeSignal.removeEventListener("abort", onAbort);
13636
+ if (!this.signal?.aborted && storeSignal.aborted) reject(new HistoryDeadlineError());
13596
13637
  else reject(error);
13597
13638
  });
13598
13639
  });
@@ -16207,6 +16248,8 @@ function createHistoryRouter(sources) {
16207
16248
  return bounded(`[the time budget ran out waiting for the store; continue with ${retry}]`);
16208
16249
  }
16209
16250
  throw error;
16251
+ } finally {
16252
+ budget.dispose();
16210
16253
  }
16211
16254
  }
16212
16255
  return {
@@ -16225,11 +16268,11 @@ function createHistoryRouter(sources) {
16225
16268
  if (target.order) request.signal?.throwIfAborted();
16226
16269
  const url = expanded?.url ?? (target.order ? withoutSearchPosition(input) : input);
16227
16270
  const multiline = isMultilineSearchPattern(request.pattern, request.ignoreCase, request.literal);
16228
- const budget = newBudget(request.signal, noteBytes(url, target, request.ranges, target.id === void 0 ? 2 : 1, multiline));
16229
16271
  selectRegexEngine(normalizeSearchPattern(request.pattern, request.ignoreCase), request.literal, multiline);
16230
16272
  const prefilter = multiline ? void 0 : indexLiterals(request.pattern, request.ignoreCase, request.literal);
16231
16273
  const positions = target.id === void 0 ? new HistorySearchPositions(historyNoteWindows.get(rawRequest)) : void 0;
16232
16274
  const render = (lines) => bounded(positions ? positions.render(lines) : lines.join("\n"));
16275
+ const budget = newBudget(request.signal, noteBytes(url, target, request.ranges, target.id === void 0 ? 2 : 1, multiline));
16233
16276
  try {
16234
16277
  if (!target.domain && limits.rows === 0) {
16235
16278
  request.signal?.throwIfAborted();
@@ -16246,6 +16289,8 @@ function createHistoryRouter(sources) {
16246
16289
  return render([note]);
16247
16290
  }
16248
16291
  throw error;
16292
+ } finally {
16293
+ budget.dispose();
16249
16294
  }
16250
16295
  }
16251
16296
  };
@@ -16920,9 +16965,9 @@ function createFindToolDefinition(cwd, options) {
16920
16965
  limit: remaining + 1,
16921
16966
  hidden: hidden !== false
16922
16967
  })), new Promise((resolveTimeout) => {
16923
- raceTimer = setTimeout(() => resolveTimeout(timeoutResult), remainingMs);
16968
+ raceTimer = setLongTimeout(() => resolveTimeout(timeoutResult), remainingMs);
16924
16969
  })]);
16925
- if (raceTimer) clearTimeout(raceTimer);
16970
+ raceTimer?.clear();
16926
16971
  if (!Array.isArray(results)) {
16927
16972
  timedOut = true;
16928
16973
  break;
@@ -17052,12 +17097,12 @@ function createFindToolDefinition(cwd, options) {
17052
17097
  stopChild = () => {
17053
17098
  if (!child.killed) child.kill();
17054
17099
  };
17055
- const targetTimer = setTimeout(() => {
17100
+ const targetTimer = setLongTimeout(() => {
17056
17101
  timedOut = true;
17057
17102
  stopChild?.();
17058
17103
  }, remainingMs);
17059
17104
  const cleanup = () => {
17060
- clearTimeout(targetTimer);
17105
+ targetTimer.clear();
17061
17106
  detachLines();
17062
17107
  };
17063
17108
  child.stderr?.on("data", (chunk) => {
@@ -17155,18 +17200,7 @@ function outcomeOf(result, signal) {
17155
17200
  });
17156
17201
  }
17157
17202
  function delay(ms, signal) {
17158
- if (signal?.aborted) return Promise.resolve("aborted");
17159
- return new Promise((resolve) => {
17160
- const timer = setTimeout(() => {
17161
- signal?.removeEventListener("abort", onAbort);
17162
- resolve("elapsed");
17163
- }, ms);
17164
- const onAbort = () => {
17165
- clearTimeout(timer);
17166
- resolve("aborted");
17167
- };
17168
- signal?.addEventListener("abort", onAbort, { once: true });
17169
- });
17203
+ return sleepFor(ms, { signal }).then(() => "elapsed", () => "aborted");
17170
17204
  }
17171
17205
  function errorMessage(error) {
17172
17206
  return error instanceof Error ? error.message || error.name : String(error);
@@ -19119,7 +19153,7 @@ function createGrepToolDefinition(cwd, options) {
19119
19153
  "pipe"
19120
19154
  ]
19121
19155
  });
19122
- const timeoutTimer = timeoutMs !== void 0 ? setTimeout(() => stopChild(), timeoutMs) : void 0;
19156
+ const timeoutTimer = timeoutMs !== void 0 ? setLongTimeout(() => stopChild(), timeoutMs) : void 0;
19123
19157
  let detachLines = () => {};
19124
19158
  let stderr = "";
19125
19159
  let matchCount = 0;
@@ -19129,7 +19163,7 @@ function createGrepToolDefinition(cwd, options) {
19129
19163
  let killedDueToLimit = false;
19130
19164
  const outputLines = [];
19131
19165
  const cleanup = () => {
19132
- if (timeoutTimer) clearTimeout(timeoutTimer);
19166
+ timeoutTimer?.clear();
19133
19167
  detachLines();
19134
19168
  signal?.removeEventListener("abort", onAbort);
19135
19169
  };
@@ -23673,6 +23707,9 @@ Object.assign(SettingsManager.prototype, {
23673
23707
  getHideThinkingBlock() {
23674
23708
  return settingsInternals(this).settings.hideThinkingBlock ?? SETTINGS_DEFAULTS.hideThinkingBlock;
23675
23709
  },
23710
+ getAnthropicThinkingDisplay() {
23711
+ return settingsInternals(this).settings.anthropicThinkingDisplay;
23712
+ },
23676
23713
  getExternalEditorCommand() {
23677
23714
  const configuredEditor = settingsInternals(this).settings.externalEditor;
23678
23715
  if (typeof configuredEditor === "string" && configuredEditor.trim() !== "") return configuredEditor;
@@ -26632,13 +26669,13 @@ function createStderrReporter(report) {
26632
26669
  // dist/modes/rpc/rpc-client-waits.js
26633
26670
  function waitForRpcIdle(source, timeout) {
26634
26671
  return new Promise((resolve, reject) => {
26635
- const timer = setTimeout(() => {
26672
+ const timer = setLongTimeout(() => {
26636
26673
  unsubscribe();
26637
26674
  reject(/* @__PURE__ */ new Error(`Timeout waiting for agent to become idle. Stderr: ${source.getStderr()}`));
26638
26675
  }, timeout);
26639
26676
  const unsubscribe = source.onEvent((event) => {
26640
26677
  if (event.type !== "agent_end") return;
26641
- clearTimeout(timer);
26678
+ timer.clear();
26642
26679
  unsubscribe();
26643
26680
  resolve();
26644
26681
  });
@@ -26647,14 +26684,14 @@ function waitForRpcIdle(source, timeout) {
26647
26684
  function collectRpcEvents(source, timeout) {
26648
26685
  return new Promise((resolve, reject) => {
26649
26686
  const events = [];
26650
- const timer = setTimeout(() => {
26687
+ const timer = setLongTimeout(() => {
26651
26688
  unsubscribe();
26652
26689
  reject(/* @__PURE__ */ new Error(`Timeout collecting events. Stderr: ${source.getStderr()}`));
26653
26690
  }, timeout);
26654
26691
  const unsubscribe = source.onEvent((event) => {
26655
26692
  events.push(event);
26656
26693
  if (event.type !== "agent_end") return;
26657
- clearTimeout(timer);
26694
+ timer.clear();
26658
26695
  unsubscribe();
26659
26696
  resolve(events);
26660
26697
  });
@@ -27035,12 +27072,12 @@ var RpcClient = class extends RpcClientApi {
27035
27072
  const stopListening = this.onGenerationEnded((event) => {
27036
27073
  if (event.generation === generation) done.resolve(false);
27037
27074
  });
27038
- const timer = setTimeout(() => done.resolve(false), timeoutMs);
27075
+ const timer = setLongTimeout(() => done.resolve(false), timeoutMs);
27039
27076
  try {
27040
27077
  this.bestEffort(writer.writeUrgent(serializeInteractiveEngineFrame({ type: "engine_explicit_quit" })), "explicit quit");
27041
27078
  return await done.promise;
27042
27079
  } finally {
27043
- clearTimeout(timer);
27080
+ timer.clear();
27044
27081
  stopListening();
27045
27082
  if (this.explicitQuitAck?.generation === generation) this.explicitQuitAck = void 0;
27046
27083
  }
@@ -27474,11 +27511,11 @@ var RpcClient = class extends RpcClientApi {
27474
27511
  rejectResponse = reject;
27475
27512
  this.pendingRequests.add(id, {
27476
27513
  resolve: (value) => {
27477
- if (timeout) clearTimeout(timeout);
27514
+ timeout?.clear();
27478
27515
  resolve(value);
27479
27516
  },
27480
27517
  reject: (error) => {
27481
- if (timeout) clearTimeout(timeout);
27518
+ timeout?.clear();
27482
27519
  reject(error);
27483
27520
  }
27484
27521
  });
@@ -27490,7 +27527,7 @@ var RpcClient = class extends RpcClientApi {
27490
27527
  rejectResponse(markRpcTransportFailure(error));
27491
27528
  return response;
27492
27529
  }
27493
- if (this.pendingRequests.has(id) && !LONG_LIVED_COMMANDS.has(command.type)) timeout = setTimeout(() => {
27530
+ if (this.pendingRequests.has(id) && !LONG_LIVED_COMMANDS.has(command.type)) timeout = setLongTimeout(() => {
27494
27531
  this.pendingRequests.delete(id);
27495
27532
  rejectResponse(/* @__PURE__ */ new Error(`Timeout waiting for response to ${command.type}. Stderr: ${this.stderr}`));
27496
27533
  }, this.options.requestTimeoutMs ?? 3e4);
@@ -27712,7 +27749,7 @@ function __atomicOnDemandFailed(error, feature) {
27712
27749
  return (async () => {
27713
27750
  const root = new URL("../", import.meta.url);
27714
27751
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
27715
- const key = `${root.href}#0.10.15-alpha.2`;
27752
+ const key = `${root.href}#0.10.16-alpha.1`;
27716
27753
  let release = releases.get(key);
27717
27754
  if (release === undefined) {
27718
27755
  const current = (async () => {
@@ -27740,7 +27777,7 @@ function __atomicOnDemandFailed(error, feature) {
27740
27777
  } catch {
27741
27778
  // No installation to read, as in a bundle of the package: the release the process runs decides.
27742
27779
  }
27743
- const updatedTo = typeof installed === "string" && installed !== "0.10.15-alpha.2" ? installed : running !== undefined && running.version !== "0.10.15-alpha.2" ? "0.10.15-alpha.2" : undefined;
27780
+ const updatedTo = typeof installed === "string" && installed !== "0.10.16-alpha.1" ? installed : running !== undefined && running.version !== "0.10.16-alpha.1" ? "0.10.16-alpha.1" : undefined;
27744
27781
  if (updatedTo === undefined) throw error;
27745
27782
  const application = typeof running?.name === "string" ? running.name : "atomic";
27746
27783
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {