@bastani/atomic 0.10.15 → 0.10.16
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.
- package/CHANGELOG.md +100 -0
- package/dist/__atomic_timers/index.js +112 -0
- package/dist/__atomic_timers/index.js.map +1 -0
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/http-YFAPTIZD.js +20 -22
- package/dist/_shared/http-YFAPTIZD.js.map +1 -1
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +55 -25
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +13 -14
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +16 -17
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/p0-cli-BB45ZQY6.js +23 -37
- package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -1
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +6 -5
- package/dist/_shared/p1a-prewarm-XIU57JHF.js.map +1 -1
- package/dist/_shared/{p1b-elig-TVB5CBLL.js → p1b-elig-BY2G5BUE.js} +28 -36
- package/dist/_shared/p1b-elig-BY2G5BUE.js.map +1 -0
- package/dist/_shared/runtime-O4KCSG4C.js +4 -4
- package/dist/_shared/sdk-OHKMDJ74.js +382 -45
- package/dist/_shared/sdk-OHKMDJ74.js.map +1 -1
- package/dist/_shared/session-data-AHTU7IS6.js +3 -3
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/settings-startup-HXQLSUWM.js.map +1 -1
- package/dist/_shared/{startup-0-0-Q3MWKUK4.js → startup-0-0-ERMIDHQT.js} +296 -382
- package/dist/_shared/startup-0-0-ERMIDHQT.js.map +1 -0
- package/dist/_shared/{startup-0-1-M6OWAYHH.js → startup-0-1-RTASI3HG.js} +430 -102
- package/dist/_shared/startup-0-1-RTASI3HG.js.map +1 -0
- package/dist/_shared/{startup-0-2-2HUMCPKX.js → startup-0-2-YZZOC22D.js} +8109 -7962
- package/dist/_shared/startup-0-2-YZZOC22D.js.map +1 -0
- package/dist/_shared/{startup-0-3-4ZYBYQNM.js → startup-0-3-DE2NCS6A.js} +130 -83
- package/dist/_shared/startup-0-3-DE2NCS6A.js.map +1 -0
- package/dist/_shared/startup-0-4-ZMJV547D.js +7 -7
- package/dist/_shared/{startup-0-5-YDW47QX6.js → startup-0-5-HZX3ZPTP.js} +411 -85
- package/dist/_shared/startup-0-5-HZX3ZPTP.js.map +1 -0
- package/dist/_shared/startup-10-0-TDQNBDDL.js +42 -29
- package/dist/_shared/startup-10-0-TDQNBDDL.js.map +1 -1
- package/dist/_shared/startup-12-0-55AAXBJZ.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +11 -10
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +9 -8
- package/dist/_shared/startup-15-0-YUKGAC63.js.map +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +24 -16
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +40 -19
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/startup-8-1-LZFXSD3Z.js +129 -92
- package/dist/_shared/startup-8-1-LZFXSD3Z.js.map +1 -1
- package/dist/_shared/storage-command-7MGXLJGZ.js +6 -4
- package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
- package/dist/_shared/storage-status-K7PX2RXA.js +7 -6
- package/dist/_shared/storage-status-K7PX2RXA.js.map +1 -1
- package/dist/_shared/task-reference-stream-JWMUZSJX.js +1 -1
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/team-DOQKICG2.js +4 -3
- package/dist/_shared/team-DOQKICG2.js.map +1 -1
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/index.bundle.mjs +1 -2
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +12 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +102 -42
- package/dist/builtin/web-access/index.bundle.mjs +1 -2
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +6 -6
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +7 -6
- package/dist/cli/blueprint-command.code.js.map +1 -1
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.js +2 -2
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +2 -2
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +2 -2
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +1 -1
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +2 -2
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/debug.code.js +1 -1
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.code.js +1 -1
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.code.js +1 -1
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +2 -2
- package/dist/core/extensions/runner-context.js +1 -1
- package/dist/core/http-dispatcher.d.ts +2 -1
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/lock-takeover.d.ts +2 -0
- package/dist/core/model-config.d.ts +28 -0
- package/dist/core/model-registry.js +1 -1
- package/dist/core/model-runtime-streaming.d.ts +3 -2
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/provider-rate-limits.d.ts +17 -10
- package/dist/core/provider-request-admission.d.ts +16 -0
- package/dist/core/resume/blueprint/barrier.d.ts +6 -6
- package/dist/core/resume/blueprint/build.d.ts +3 -1
- package/dist/core/resume/blueprint/ledger.d.ts +3 -2
- package/dist/core/resume/blueprint/resume.d.ts +2 -1
- package/dist/core/retry-policy.d.ts +3 -1
- package/dist/core/sdk.code.js +3 -3
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +6 -6
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager-types.d.ts +1 -1
- package/dist/core/session-manager.code.js +2 -2
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-open-markers.js +1 -1
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/settings-duration.d.ts +3 -0
- package/dist/core/settings-manager-resource-accessors.d.ts +2 -1
- package/dist/core/settings-schema.d.ts +1 -0
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-file-gate.js +7 -6
- package/dist/core/storage/node-sqlite-file-gate.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/prefix.js +3 -0
- package/dist/core/storage/prefix.js.map +1 -1
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +24 -7
- package/dist/core/storage/session/child-reader.code.js.map +1 -1
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.code.js +1 -1
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +3 -3
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.code.js +1 -1
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +4 -4
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.d.ts +2 -2
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.d.ts +2 -2
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.code.js +4 -4
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +4 -4
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.d.ts +13 -4
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.code.js +1 -1
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/session/types.d.ts +20 -2
- package/dist/core/storage/sqlite-facade.js +14 -13
- package/dist/core/storage/sqlite-facade.js.map +1 -1
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/heartbeat.d.ts +1 -0
- package/dist/core/tasks/task-completion-entry.code.js +1 -1
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +3 -3
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +3 -3
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts +1 -1
- package/dist/core/tools/history-session.d.ts +2 -0
- package/dist/core/tools/read-url.code.js +3 -3
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +5 -6
- package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
- package/dist/core/worktree-snapshot/errors.code.js +3 -3
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/git.d.ts +2 -0
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.code.js +6 -5
- package/dist/extensions/codemode/execute.code.js.map +1 -1
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +1 -1
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +8 -4
- package/dist/extensions/mcp/cli.code.js.map +1 -1
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.js +6 -6
- package/dist/main-first-time-setup.code.js +2 -2
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.code.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.code.js +1 -1
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
- package/dist/package-manager-cli.code.js +7 -7
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/10.js +1 -1
- package/dist/startup-stages/11.js +1 -1
- package/dist/startup-stages/12.js +1 -1
- package/dist/startup-stages/13.js +1 -0
- package/dist/startup-stages/2.js +2 -6
- package/dist/startup-stages/3.js +6 -1
- package/dist/startup-stages/4.js +1 -1
- package/dist/startup-stages/5.js +12 -1
- package/dist/startup-stages/6.js +8 -4
- package/dist/startup-stages/7.js +4 -3
- package/dist/startup-stages/8.js +1 -5
- package/dist/startup-stages/9.js +5 -1
- package/dist/startup-stages/stages.json +1 -1
- package/dist/utils/startup-database-spare.code.js +3 -3
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/dist/utils/windows-cwd.js +3 -3
- package/dist/utils/windows-cwd.js.map +1 -1
- package/docs/changelog.mdx +20 -5
- package/docs/codemode.md +5 -2
- package/docs/compaction/branch-summaries.md +1 -1
- package/docs/compaction/custom-compactors.md +1 -1
- package/docs/custom-provider/api-reference.md +1 -1
- package/docs/custom-provider/registration.md +3 -0
- package/docs/custom-provider/streaming.md +1 -1
- package/docs/environment-variables.md +2 -2
- package/docs/guides/resume-on-any-machine.md +1 -0
- package/docs/libraries/ai.md +4 -2
- package/docs/libraries/codemode.md +1 -1
- package/docs/models/choose-a-model.md +1 -1
- package/docs/models-configuration.md +5 -2
- package/docs/models.md +32 -0
- package/docs/providers.md +33 -1
- package/docs/sdk/structured-decisions.md +4 -2
- package/docs/sessions.md +1 -1
- package/docs/settings.md +78 -16
- package/docs/storage/postgres/tuning.md +1 -0
- package/docs/subagents/reference.md +2 -1
- package/docs/tools.md +4 -3
- package/docs/worktree-snapshots/reference.md +2 -0
- package/docs/worktree-snapshots.md +4 -0
- package/package.json +9 -9
- package/schemas/models.schema.json +21 -0
- package/schemas/settings.schema.json +14 -1
- package/dist/_shared/p1b-elig-TVB5CBLL.js.map +0 -1
- package/dist/_shared/startup-0-0-Q3MWKUK4.js.map +0 -1
- package/dist/_shared/startup-0-1-M6OWAYHH.js.map +0 -1
- package/dist/_shared/startup-0-2-2HUMCPKX.js.map +0 -1
- package/dist/_shared/startup-0-3-4ZYBYQNM.js.map +0 -1
- 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,
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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
|
|
944
|
+
for (const { sessionId: childId } of eligible) {
|
|
933
945
|
signal?.throwIfAborted();
|
|
934
|
-
|
|
935
|
-
|
|
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
|
-
|
|
944
|
-
|
|
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 (!
|
|
968
|
+
if (!entry.capture) continue;
|
|
950
969
|
const at = Date.parse(entry.timestamp);
|
|
951
|
-
|
|
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.
|
|
956
|
-
|
|
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, {
|
|
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 =
|
|
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", () =>
|
|
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", () =>
|
|
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
|
|
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 =
|
|
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 - (
|
|
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
|
-
|
|
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) ?
|
|
13451
|
+
const timer = Number.isFinite(effectiveMs) ? setLongTimeoutAt(() => {
|
|
13419
13452
|
removeOrCancel({ timedOut: true });
|
|
13420
|
-
},
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
13630
|
+
storeSignal.addEventListener("abort", onAbort, { once: true });
|
|
13590
13631
|
work.then((value) => {
|
|
13591
|
-
|
|
13632
|
+
storeSignal.removeEventListener("abort", onAbort);
|
|
13592
13633
|
resolve(value);
|
|
13593
13634
|
}, (error) => {
|
|
13594
|
-
|
|
13595
|
-
if (!this.signal?.aborted &&
|
|
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 =
|
|
16968
|
+
raceTimer = setLongTimeout(() => resolveTimeout(timeoutResult), remainingMs);
|
|
16924
16969
|
})]);
|
|
16925
|
-
|
|
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 =
|
|
17100
|
+
const targetTimer = setLongTimeout(() => {
|
|
17056
17101
|
timedOut = true;
|
|
17057
17102
|
stopChild?.();
|
|
17058
17103
|
}, remainingMs);
|
|
17059
17104
|
const cleanup = () => {
|
|
17060
|
-
|
|
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
|
-
|
|
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 ?
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
27514
|
+
timeout?.clear();
|
|
27478
27515
|
resolve(value);
|
|
27479
27516
|
},
|
|
27480
27517
|
reject: (error) => {
|
|
27481
|
-
|
|
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 =
|
|
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.
|
|
27752
|
+
const key = `${root.href}#0.10.16`;
|
|
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.
|
|
27780
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.16" ? installed : running !== undefined && running.version !== "0.10.16" ? "0.10.16" : 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}.`, {
|