@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.
- package/CHANGELOG.md +71 -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 +6 -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 +2 -2
- 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,7 +1,7 @@
|
|
|
1
1
|
import { __commonJSMin, __name, __require } from "./rolldown-runtime-BGM3D5V3.js";
|
|
2
2
|
import { APP_NAME, CONFIG_DIR_NAME, DiagnosticWriter, ENV_AGENT_DIR, ENV_TELEMETRY, NATIVES_VERSION, canonicalizePath as canonicalizePath$1, canonicalizePathAsync as canonicalizePathAsync$1, createModuleRequire, detectInstallChangeAsync, getAgentDir, getCwdRelativePath, getDocsPath, getEnvValue, getPackageDir, getPathComparisonKey, getSettingsPath, isBunBinary, isBunRuntime, isChildProcessExitStatusUnknownError, loadOnDemand, markNativeContainedChild, moduleDirFromMetaUrl, normalizePath as normalizePath$1, pathsEqual, requiredEntriesForBuiltin, resolvePath, shortenHomePath, stripBom } from "./p0-cli-BB45ZQY6.js";
|
|
3
3
|
import { clickableKeyTextHint, getGlobalTheme, navActionText, navFirstKeyText, renderNavHintLine, renderNavKeyOverlay, slashCommandHint, terminalDisplayText, theme } from "./p2-shell-main-B2WIALFD.js";
|
|
4
|
-
import { PROJECT_TRUST_DISTRUST_LABEL, PROJECT_TRUST_SESSION_DISTRUST_LABEL, REDACTED_PLACEHOLDER, applyRedactionRanges, findInCauseChain as findInCauseChain$1, hasErrorIdentity, isAsciiDigitCode, isAsciiHexCode, isAsciiLetterCode, isAsciiWordCode, isHorizontalWsCode, lockHolderPath, matchesAsciiCaseInsensitiveAt, prepareTakeoverMutex, processMayRun, processMayRunAsync, processStartToken, processStartTokenAsync, putBack, putBackAsync, readProcessStartToken, redactCredentialShapes, redactUrlCredentials, rehydrateErrorCause, releaseLock, removeAside, removeAsideAsync, removeLeftoverHolderFiles, removeLeftoverHolderFilesAsync, renameReplacing, renameReplacingAsync, scanBasicAuthEndAt, serializeErrorCause, skipHorizontalWs, stripAnsiWithOrigin, takeTakeoverMutex, takeTakeoverMutexAsync } from "./p1b-elig-
|
|
4
|
+
import { PROJECT_TRUST_DISTRUST_LABEL, PROJECT_TRUST_SESSION_DISTRUST_LABEL, REDACTED_PLACEHOLDER, applyRedactionRanges, findInCauseChain as findInCauseChain$1, hasErrorIdentity, isAsciiDigitCode, isAsciiHexCode, isAsciiLetterCode, isAsciiWordCode, isHorizontalWsCode, lockHolderPath, matchesAsciiCaseInsensitiveAt, newLockToken, prepareTakeoverMutex, processMayRun, processMayRunAsync, processStartToken, processStartTokenAsync, putBack, putBackAsync, readProcessStartToken, redactCredentialShapes, redactUrlCredentials, rehydrateErrorCause, releaseLock, removeAside, removeAsideAsync, removeLeftoverHolderFiles, removeLeftoverHolderFilesAsync, renameReplacing, renameReplacingAsync, scanBasicAuthEndAt, serializeErrorCause, skipHorizontalWs, stripAnsiWithOrigin, takeTakeoverMutex, takeTakeoverMutexAsync } from "./p1b-elig-BY2G5BUE.js";
|
|
5
5
|
import { DecisionTimeoutError, SessionAlreadyOpenError } from "./settings-startup-HXQLSUWM.js";
|
|
6
6
|
import { SETTINGS_DEFAULTS } from "./p2-common-YLSYXMDQ.js";
|
|
7
7
|
import { isBuiltin } from "node:module";
|
|
@@ -13,6 +13,7 @@ import * as path$1 from "node:path";
|
|
|
13
13
|
import path$2, { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, parse, relative as relative$1, resolve as resolve$1, sep as sep$2, toNamespacedPath } from "node:path";
|
|
14
14
|
import { pathToFileURL } from "node:url";
|
|
15
15
|
import { execFile, spawn } from "node:child_process";
|
|
16
|
+
import { createTimeoutSignal, setLongInterval, setLongTimeout, setLongTimeoutAt, sleepFor } from "../__atomic_timers/index.js";
|
|
16
17
|
import { canonicalizePathAsync } from "../utils/canonical-path.js";
|
|
17
18
|
import { pathExists } from "../utils/path-exists.js";
|
|
18
19
|
import * as fs from "node:fs";
|
|
@@ -1996,46 +1997,46 @@ const RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
|
1996
1997
|
503,
|
|
1997
1998
|
504
|
|
1998
1999
|
]);
|
|
1999
|
-
|
|
2000
|
-
* Fetch a management HTTP resource with a bounded immediate retry.
|
|
2001
|
-
*
|
|
2002
|
-
* This is intentionally a transport-level helper for idempotent management
|
|
2003
|
-
* requests (version checks, catalogs, and downloads). It must not be used for
|
|
2004
|
-
* agent/model operations: those can fail after the HTTP request starts and are
|
|
2005
|
-
* retried by their semantic caller instead.
|
|
2006
|
-
*
|
|
2007
|
-
* Caller cancellation is terminal. When timeoutMs is supplied, it is the
|
|
2008
|
-
* overall time budget shared by all attempts.
|
|
2009
|
-
*/
|
|
2010
|
-
async function fetchWithRetry(input, init = void 0, options = {}) {
|
|
2000
|
+
async function fetchWithRetry(input, init = void 0, options = {}, read) {
|
|
2011
2001
|
const maxRetries = options.maxRetries === void 0 || !Number.isFinite(options.maxRetries) ? 2 : Math.max(0, Math.floor(options.maxRetries));
|
|
2012
2002
|
const retryOnStatus = options.retryOnStatus ?? true;
|
|
2013
2003
|
const parentSignal = init?.signal;
|
|
2014
|
-
const
|
|
2004
|
+
const timeout = options.timeoutMs !== void 0 && options.timeoutMs > 0 ? createTimeoutSignal(options.timeoutMs) : void 0;
|
|
2005
|
+
const timeoutSignal = timeout?.signal;
|
|
2015
2006
|
const attemptTimeoutMs = options.attemptTimeoutMs && options.attemptTimeoutMs > 0 ? options.attemptTimeoutMs : void 0;
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
const response = await fetch(input, signal ? {
|
|
2028
|
-
...init,
|
|
2029
|
-
signal
|
|
2030
|
-
} : init);
|
|
2031
|
-
if (!(retryOnStatus && RETRYABLE_STATUS_CODES.has(response.status) && attempt < maxRetries)) return response;
|
|
2007
|
+
try {
|
|
2008
|
+
for (let attempt = 0;; attempt += 1) {
|
|
2009
|
+
parentSignal?.throwIfAborted();
|
|
2010
|
+
timeoutSignal?.throwIfAborted();
|
|
2011
|
+
const attemptTimeout = attemptTimeoutMs ? createTimeoutSignal(attemptTimeoutMs) : void 0;
|
|
2012
|
+
const signals = [
|
|
2013
|
+
parentSignal,
|
|
2014
|
+
timeoutSignal,
|
|
2015
|
+
attemptTimeout?.signal
|
|
2016
|
+
].filter((signal) => signal !== void 0);
|
|
2017
|
+
const signal = signals.length > 1 ? AbortSignal.any(signals) : signals[0];
|
|
2032
2018
|
try {
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2019
|
+
let response;
|
|
2020
|
+
try {
|
|
2021
|
+
response = await fetch(input, signal ? {
|
|
2022
|
+
...init,
|
|
2023
|
+
signal
|
|
2024
|
+
} : init);
|
|
2025
|
+
} catch (error) {
|
|
2026
|
+
const attemptTimedOut = attemptTimeout?.signal.aborted === true && !parentSignal?.aborted && !timeoutSignal?.aborted;
|
|
2027
|
+
if (parentSignal?.aborted || timeoutSignal?.aborted || error instanceof Error && error.name === "AbortError" && !attemptTimedOut && timeoutSignal === void 0 || attempt >= maxRetries) throw error;
|
|
2028
|
+
continue;
|
|
2029
|
+
}
|
|
2030
|
+
if (!(retryOnStatus && RETRYABLE_STATUS_CODES.has(response.status) && attempt < maxRetries)) return read ? await read(response) : response;
|
|
2031
|
+
try {
|
|
2032
|
+
await response.body?.cancel();
|
|
2033
|
+
} catch {}
|
|
2034
|
+
} finally {
|
|
2035
|
+
attemptTimeout?.clear();
|
|
2036
|
+
}
|
|
2038
2037
|
}
|
|
2038
|
+
} finally {
|
|
2039
|
+
timeout?.clear();
|
|
2039
2040
|
}
|
|
2040
2041
|
}
|
|
2041
2042
|
// dist/utils/pi-user-agent.js
|
|
@@ -2338,6 +2339,32 @@ function assertForkSegments(sessionId, segments, length) {
|
|
|
2338
2339
|
sourceEnds.set(sourceId, toSeq);
|
|
2339
2340
|
}
|
|
2340
2341
|
}
|
|
2342
|
+
/** The index of the segment that holds view seq `seq`, or -1 when `seq` is a row of the session's own. */
|
|
2343
|
+
function segmentIndexOf(segments, seq) {
|
|
2344
|
+
let low = 0;
|
|
2345
|
+
let high = segments.length - 1;
|
|
2346
|
+
while (low <= high) {
|
|
2347
|
+
const middle = low + high >> 1;
|
|
2348
|
+
const segment = segments[middle];
|
|
2349
|
+
if (seq <= segment.baseSeq) high = middle - 1;
|
|
2350
|
+
else if (seq > segmentEnd(segment)) low = middle + 1;
|
|
2351
|
+
else return middle;
|
|
2352
|
+
}
|
|
2353
|
+
return -1;
|
|
2354
|
+
}
|
|
2355
|
+
/** Where view seq `seq` of session `sessionId` is stored. */
|
|
2356
|
+
function locateForkSeq(sessionId, segments, seq) {
|
|
2357
|
+
const index = segmentIndexOf(segments, seq);
|
|
2358
|
+
if (index < 0) return {
|
|
2359
|
+
sessionId,
|
|
2360
|
+
seq
|
|
2361
|
+
};
|
|
2362
|
+
const segment = segments[index];
|
|
2363
|
+
return {
|
|
2364
|
+
sessionId: segment.sourceId,
|
|
2365
|
+
seq: segment.fromSeq + (seq - segment.baseSeq) - 1
|
|
2366
|
+
};
|
|
2367
|
+
}
|
|
2341
2368
|
/**
|
|
2342
2369
|
* The view seqs `fromSeq` through `toSeq` of session `sessionId` as runs stored in one place each, in view order: what a
|
|
2343
2370
|
* read of that range reads, one statement a piece.
|
|
@@ -2618,11 +2645,32 @@ const sharedClockFs = {
|
|
|
2618
2645
|
* holding it (#5050): a holder on a host whose clock lags keeps its lock, and one whose clock runs ahead loses it once
|
|
2619
2646
|
* it stopped refreshing it for the stale time.
|
|
2620
2647
|
*/
|
|
2621
|
-
function lockShared(path, options) {
|
|
2622
|
-
return lockfile.lock(path, {
|
|
2648
|
+
async function lockShared(path, options, removal) {
|
|
2649
|
+
if (removal === void 0) return lockfile.lock(path, {
|
|
2623
2650
|
...options,
|
|
2624
2651
|
fs: sharedClockFs
|
|
2625
2652
|
});
|
|
2653
|
+
let created = false;
|
|
2654
|
+
const mkdir = ((file, callback) => {
|
|
2655
|
+
fs.mkdir(file, (error) => {
|
|
2656
|
+
created = error === null;
|
|
2657
|
+
callback(error);
|
|
2658
|
+
});
|
|
2659
|
+
});
|
|
2660
|
+
const rmdir = ((file, callback) => {
|
|
2661
|
+
const lockPath = String(file);
|
|
2662
|
+
readings.delete(lockPath);
|
|
2663
|
+
(created ? removal.release(lockPath) : removal.stale(lockPath)).then(() => callback(null), (error) => callback(error));
|
|
2664
|
+
});
|
|
2665
|
+
return lockfile.lock(path, {
|
|
2666
|
+
...options,
|
|
2667
|
+
fs: {
|
|
2668
|
+
...sharedClockFs,
|
|
2669
|
+
mkdir,
|
|
2670
|
+
rmdir,
|
|
2671
|
+
rmdirSync: () => {}
|
|
2672
|
+
}
|
|
2673
|
+
});
|
|
2626
2674
|
}
|
|
2627
2675
|
// ../../node_modules/fast-sha256/sha256.js
|
|
2628
2676
|
var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module, this$1) => {
|
|
@@ -3036,6 +3084,185 @@ function yieldTurn() {
|
|
|
3036
3084
|
else setTimeout(resolve, 0);
|
|
3037
3085
|
});
|
|
3038
3086
|
}
|
|
3087
|
+
// dist/core/lock-holder.js
|
|
3088
|
+
const MAX_SAFE_INO = BigInt(Number.MAX_SAFE_INTEGER);
|
|
3089
|
+
function lockDirectoryIdentityFromStats(stats) {
|
|
3090
|
+
const birthtimeMs = Number(stats.birthtimeNs / 1000000000n) * 1e3 + Number(stats.birthtimeNs % 1000000000n) / 1e6;
|
|
3091
|
+
return {
|
|
3092
|
+
exact: `${stats.dev}:${stats.ino}:${stats.birthtimeNs}`,
|
|
3093
|
+
legacy: `${Number(stats.ino)}:${birthtimeMs}`,
|
|
3094
|
+
legacyInoSafe: stats.ino <= MAX_SAFE_INO
|
|
3095
|
+
};
|
|
3096
|
+
}
|
|
3097
|
+
function readLockIdentity(lockPath) {
|
|
3098
|
+
try {
|
|
3099
|
+
return lockDirectoryIdentityFromStats(statSync$1(lockPath, { bigint: true }));
|
|
3100
|
+
} catch {
|
|
3101
|
+
return;
|
|
3102
|
+
}
|
|
3103
|
+
}
|
|
3104
|
+
async function readLockIdentityAsync(lockPath) {
|
|
3105
|
+
try {
|
|
3106
|
+
return lockDirectoryIdentityFromStats(await stat(lockPath, { bigint: true }));
|
|
3107
|
+
} catch {
|
|
3108
|
+
return;
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
function matchesHolderRecord(identity, record) {
|
|
3112
|
+
if (identity === void 0) return false;
|
|
3113
|
+
if (record.lockId !== void 0) return identity.exact === record.lockId && (record.lock === identity.legacy || record.lock === identity.exact);
|
|
3114
|
+
if (record.lock === identity.exact) return true;
|
|
3115
|
+
return identity.legacyInoSafe && record.lock === identity.legacy;
|
|
3116
|
+
}
|
|
3117
|
+
/**
|
|
3118
|
+
* Names this process as the holder of the lock directory at `lockPath`, which it has just taken. Best effort: a lock
|
|
3119
|
+
* whose holder is not named is only taken over once it is stale.
|
|
3120
|
+
*/
|
|
3121
|
+
function recordLockHolder(lockPath) {
|
|
3122
|
+
const identity = readLockIdentity(lockPath);
|
|
3123
|
+
if (identity === void 0) return;
|
|
3124
|
+
const record = {
|
|
3125
|
+
host: hostname(),
|
|
3126
|
+
pid: process.pid,
|
|
3127
|
+
started: processStartToken(process.pid),
|
|
3128
|
+
lock: identity.legacyInoSafe ? identity.legacy : identity.exact,
|
|
3129
|
+
lockId: identity.exact
|
|
3130
|
+
};
|
|
3131
|
+
const path = lockHolderPath(lockPath);
|
|
3132
|
+
const temporary = `${path}.${process.pid}.${newLockToken()}.tmp`;
|
|
3133
|
+
try {
|
|
3134
|
+
writeFileSync$1(temporary, JSON.stringify(record));
|
|
3135
|
+
renameReplacing(temporary, path);
|
|
3136
|
+
} catch {
|
|
3137
|
+
rmSync$1(temporary, { force: true });
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
let ownStart;
|
|
3141
|
+
async function recordLockHolderAsync(lockPath) {
|
|
3142
|
+
const identity = await readLockIdentityAsync(lockPath);
|
|
3143
|
+
if (identity === void 0) return;
|
|
3144
|
+
ownStart ??= processStartTokenAsync(process.pid);
|
|
3145
|
+
const record = {
|
|
3146
|
+
host: hostname(),
|
|
3147
|
+
pid: process.pid,
|
|
3148
|
+
started: await ownStart,
|
|
3149
|
+
lock: identity.legacyInoSafe ? identity.legacy : identity.exact,
|
|
3150
|
+
lockId: identity.exact
|
|
3151
|
+
};
|
|
3152
|
+
const path = lockHolderPath(lockPath);
|
|
3153
|
+
const temporary = `${path}.${process.pid}.${newLockToken()}.tmp`;
|
|
3154
|
+
try {
|
|
3155
|
+
await writeFile(temporary, JSON.stringify(record));
|
|
3156
|
+
await renameReplacingAsync(temporary, path);
|
|
3157
|
+
} catch {
|
|
3158
|
+
await rm(temporary, { force: true }).catch(() => {});
|
|
3159
|
+
}
|
|
3160
|
+
return identity.exact;
|
|
3161
|
+
}
|
|
3162
|
+
/** Forgets this process as the holder of the lock at `lockPath`, before it releases the lock. */
|
|
3163
|
+
function clearLockHolder(lockPath) {
|
|
3164
|
+
try {
|
|
3165
|
+
rmSync$1(lockHolderPath(lockPath), { force: true });
|
|
3166
|
+
} catch {}
|
|
3167
|
+
}
|
|
3168
|
+
async function clearLockHolderAsync(lockPath, lockId) {
|
|
3169
|
+
if (lockId !== void 0 && (await readHolderRecordAsync(lockPath))?.lockId !== lockId) return;
|
|
3170
|
+
try {
|
|
3171
|
+
await rm(lockHolderPath(lockPath), { force: true });
|
|
3172
|
+
} catch {}
|
|
3173
|
+
}
|
|
3174
|
+
function readHolderRecord(lockPath) {
|
|
3175
|
+
try {
|
|
3176
|
+
return parseHolderRecord(readFileSync$1(lockHolderPath(lockPath), "utf8"));
|
|
3177
|
+
} catch {
|
|
3178
|
+
return;
|
|
3179
|
+
}
|
|
3180
|
+
}
|
|
3181
|
+
async function readHolderRecordAsync(lockPath) {
|
|
3182
|
+
try {
|
|
3183
|
+
return parseHolderRecord(await readFile(lockHolderPath(lockPath), "utf8"));
|
|
3184
|
+
} catch {
|
|
3185
|
+
return;
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
function parseHolderRecord(content) {
|
|
3189
|
+
const record = JSON.parse(content);
|
|
3190
|
+
if (typeof record.host !== "string" || typeof record.pid !== "number" || !Number.isSafeInteger(record.pid) || record.pid <= 0 || typeof record.lock !== "string") return void 0;
|
|
3191
|
+
if (record.started !== void 0 && typeof record.started !== "string") return void 0;
|
|
3192
|
+
if (record.lockId !== void 0 && typeof record.lockId !== "string") return void 0;
|
|
3193
|
+
return record;
|
|
3194
|
+
}
|
|
3195
|
+
/** Whether the current lock names a local holder. Only a process check, not age, may displace such a holder. */
|
|
3196
|
+
async function lockNamesLocalHolder(lockPath) {
|
|
3197
|
+
const record = await readHolderRecordAsync(lockPath);
|
|
3198
|
+
return record?.host === hostname() && matchesHolderRecord(await readLockIdentityAsync(lockPath), record);
|
|
3199
|
+
}
|
|
3200
|
+
async function prepareLockTakeover(lockPath) {
|
|
3201
|
+
await prepareTakeoverMutex(lockPath, await readHolderRecordAsync(lockPath));
|
|
3202
|
+
}
|
|
3203
|
+
/**
|
|
3204
|
+
* Removes the lock directory at `lockPath` when its holder is proven dead, so the next attempt to take it follows at
|
|
3205
|
+
* once; true when it did. Takeovers are serialized by the takeover mutex, an advisory lock the kernel releases when
|
|
3206
|
+
* its holder dies (#5193), and the whole move runs while it is held: the holder record and the lock directory are
|
|
3207
|
+
* checked again inside it, so a lock another process took after the dead holder's is never moved. A directory that,
|
|
3208
|
+
* once moved, turns out not to be the dead holder's is put back only while the lock path is free, never replacing
|
|
3209
|
+
* anything, and otherwise left aside, never removed.
|
|
3210
|
+
*/
|
|
3211
|
+
function takeOverDeadHolder(lockPath) {
|
|
3212
|
+
const record = readHolderRecord(lockPath);
|
|
3213
|
+
if (record === void 0 || !matchesHolderRecord(readLockIdentity(lockPath), record) || processMayRun(record)) return false;
|
|
3214
|
+
const mutex = takeTakeoverMutex(lockPath);
|
|
3215
|
+
if (mutex === void 0) return false;
|
|
3216
|
+
try {
|
|
3217
|
+
const current = readHolderRecord(lockPath);
|
|
3218
|
+
if (current === void 0 || !sameRecord(current, record) || !matchesHolderRecord(readLockIdentity(lockPath), record)) return false;
|
|
3219
|
+
const aside = `${lockPath}.${newLockToken()}.dead`;
|
|
3220
|
+
if (!mutex.owned()) return false;
|
|
3221
|
+
try {
|
|
3222
|
+
renameSync$1(lockPath, aside);
|
|
3223
|
+
} catch {
|
|
3224
|
+
return false;
|
|
3225
|
+
}
|
|
3226
|
+
if (!matchesHolderRecord(readLockIdentity(aside), record)) {
|
|
3227
|
+
putBack(aside, lockPath);
|
|
3228
|
+
return false;
|
|
3229
|
+
}
|
|
3230
|
+
removeAside(aside);
|
|
3231
|
+
removeLeftoverHolderFiles(lockPath);
|
|
3232
|
+
return true;
|
|
3233
|
+
} finally {
|
|
3234
|
+
mutex.release();
|
|
3235
|
+
}
|
|
3236
|
+
}
|
|
3237
|
+
async function takeOverDeadHolderAsync(lockPath) {
|
|
3238
|
+
const record = await readHolderRecordAsync(lockPath);
|
|
3239
|
+
if (record === void 0 || !matchesHolderRecord(await readLockIdentityAsync(lockPath), record) || await processMayRunAsync(record)) return false;
|
|
3240
|
+
const mutex = await takeTakeoverMutexAsync(lockPath);
|
|
3241
|
+
if (mutex === void 0) return false;
|
|
3242
|
+
try {
|
|
3243
|
+
const current = await readHolderRecordAsync(lockPath);
|
|
3244
|
+
if (current === void 0 || !sameRecord(current, record) || !matchesHolderRecord(await readLockIdentityAsync(lockPath), record)) return false;
|
|
3245
|
+
const aside = `${lockPath}.${newLockToken()}.dead`;
|
|
3246
|
+
if (!await mutex.owned()) return false;
|
|
3247
|
+
try {
|
|
3248
|
+
await rename(lockPath, aside);
|
|
3249
|
+
} catch {
|
|
3250
|
+
return false;
|
|
3251
|
+
}
|
|
3252
|
+
if (!matchesHolderRecord(await readLockIdentityAsync(aside), record)) {
|
|
3253
|
+
await putBackAsync(aside, lockPath);
|
|
3254
|
+
return false;
|
|
3255
|
+
}
|
|
3256
|
+
await removeAsideAsync(aside);
|
|
3257
|
+
await removeLeftoverHolderFilesAsync(lockPath);
|
|
3258
|
+
return true;
|
|
3259
|
+
} finally {
|
|
3260
|
+
await mutex.release();
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
function sameRecord(a, b) {
|
|
3264
|
+
return a.host === b.host && a.pid === b.pid && a.started === b.started && a.lock === b.lock && a.lockId === b.lockId;
|
|
3265
|
+
}
|
|
3039
3266
|
// dist/utils/physical-path.js
|
|
3040
3267
|
/** Matches the Linux limit on symbolic links followed while resolving one path. */
|
|
3041
3268
|
const MAX_SYMLINK_HOPS = 40;
|
|
@@ -3860,122 +4087,6 @@ function rehydrateBlueprintError(form, cause) {
|
|
|
3860
4087
|
});
|
|
3861
4088
|
return error;
|
|
3862
4089
|
}
|
|
3863
|
-
// dist/core/resume/blueprint/ledger.js
|
|
3864
|
-
const DIGEST_VERSION = "atomic-blueprint-v1";
|
|
3865
|
-
function sha256(parts) {
|
|
3866
|
-
const hash = createHash("sha256");
|
|
3867
|
-
for (const part of parts) hash.update(`${part.length}:`).update(part);
|
|
3868
|
-
return hash.digest("hex");
|
|
3869
|
-
}
|
|
3870
|
-
/** The digest of a blueprint file's inputs: the file's text and, for a workspace, where it sits. */
|
|
3871
|
-
function blueprintDigest(directory, source, extra = "") {
|
|
3872
|
-
return sha256([
|
|
3873
|
-
DIGEST_VERSION,
|
|
3874
|
-
directory,
|
|
3875
|
-
source,
|
|
3876
|
-
extra
|
|
3877
|
-
]);
|
|
3878
|
-
}
|
|
3879
|
-
/** The ledger key of the workspace at `directory` (`.` for the root) of the repository `identity`. */
|
|
3880
|
-
function workspaceKey(identity, directory) {
|
|
3881
|
-
return `${repositoryKey(identity)}:${directory === "" ? "." : directory}`;
|
|
3882
|
-
}
|
|
3883
|
-
/** The prefix of the ledger keys of every workspace of the repository `identity`. */
|
|
3884
|
-
function repositoryKey(identity) {
|
|
3885
|
-
return sha256([identity]).slice(0, 16);
|
|
3886
|
-
}
|
|
3887
|
-
/** The ledger key of the restored worktree at `root`. */
|
|
3888
|
-
function rootKey(root) {
|
|
3889
|
-
return sha256([resolve$1(root)]).slice(0, 16);
|
|
3890
|
-
}
|
|
3891
|
-
function ledgerPath(storeDir) {
|
|
3892
|
-
return join$1(storeDir, "blueprint-builds", "ledger.json");
|
|
3893
|
-
}
|
|
3894
|
-
const EMPTY_LEDGER = {
|
|
3895
|
-
version: 1,
|
|
3896
|
-
workspaces: {},
|
|
3897
|
-
roots: {}
|
|
3898
|
-
};
|
|
3899
|
-
function isLedger(value) {
|
|
3900
|
-
if (typeof value !== "object" || value === null) return false;
|
|
3901
|
-
const candidate = value;
|
|
3902
|
-
return candidate.version === 1 && typeof candidate.workspaces === "object" && candidate.workspaces !== null && typeof candidate.roots === "object" && candidate.roots !== null;
|
|
3903
|
-
}
|
|
3904
|
-
/**
|
|
3905
|
-
* The ledger of the builds on this machine. A missing ledger, and one that is not a ledger this version wrote, is an
|
|
3906
|
-
* empty one: the next build then has no parent and runs in full, and its write replaces the file.
|
|
3907
|
-
*/
|
|
3908
|
-
async function readLedger(storeDir) {
|
|
3909
|
-
let text;
|
|
3910
|
-
try {
|
|
3911
|
-
text = await readFile(ledgerPath(storeDir), "utf8");
|
|
3912
|
-
} catch (error) {
|
|
3913
|
-
if (error.code === "ENOENT") return EMPTY_LEDGER;
|
|
3914
|
-
throw error;
|
|
3915
|
-
}
|
|
3916
|
-
let parsed;
|
|
3917
|
-
try {
|
|
3918
|
-
parsed = JSON.parse(text);
|
|
3919
|
-
} catch (error) {
|
|
3920
|
-
if (error instanceof SyntaxError) return EMPTY_LEDGER;
|
|
3921
|
-
throw error;
|
|
3922
|
-
}
|
|
3923
|
-
return isLedger(parsed) ? parsed : EMPTY_LEDGER;
|
|
3924
|
-
}
|
|
3925
|
-
const ledgerQueues = /* @__PURE__ */ new Map();
|
|
3926
|
-
/** A lock held by a stopped process is given up after this long; a live holder refreshes it every few seconds. */
|
|
3927
|
-
const LEDGER_LOCK_STALE_MS = 15e3;
|
|
3928
|
-
const LEDGER_LOCK_UPDATE_MS = 5e3;
|
|
3929
|
-
const LEDGER_LOCK_RETRIES = {
|
|
3930
|
-
retries: 40,
|
|
3931
|
-
factor: 1.2,
|
|
3932
|
-
minTimeout: 20,
|
|
3933
|
-
maxTimeout: 250
|
|
3934
|
-
};
|
|
3935
|
-
/** Serializes work on one ledger within this process, in the order it was asked for. */
|
|
3936
|
-
async function inProcessTurn(key, work) {
|
|
3937
|
-
const previous = ledgerQueues.get(key) ?? Promise.resolve();
|
|
3938
|
-
let release;
|
|
3939
|
-
const current = new Promise((resolveTurn) => {
|
|
3940
|
-
release = resolveTurn;
|
|
3941
|
-
});
|
|
3942
|
-
const chained = previous.then(() => current);
|
|
3943
|
-
ledgerQueues.set(key, chained);
|
|
3944
|
-
await previous;
|
|
3945
|
-
try {
|
|
3946
|
-
return await work();
|
|
3947
|
-
} finally {
|
|
3948
|
-
release();
|
|
3949
|
-
if (ledgerQueues.get(key) === chained) ledgerQueues.delete(key);
|
|
3950
|
-
}
|
|
3951
|
-
}
|
|
3952
|
-
/**
|
|
3953
|
-
* Applies `update` to the ledger as it is now and writes the result atomically. Updates are serialized, within this
|
|
3954
|
-
* process by a queue and across processes by a lock file, so builds that finish at about the same time keep each
|
|
3955
|
-
* other's entries. A lock that cannot be taken within its retries rejects with the lock's error.
|
|
3956
|
-
*/
|
|
3957
|
-
async function updateLedger(storeDir, update) {
|
|
3958
|
-
const path = ledgerPath(storeDir);
|
|
3959
|
-
return inProcessTurn(path, async () => {
|
|
3960
|
-
await mkdir(dirname$1(path), { recursive: true });
|
|
3961
|
-
const release = await lockfile.lock(dirname$1(path), {
|
|
3962
|
-
realpath: false,
|
|
3963
|
-
lockfilePath: `${path}.lock`,
|
|
3964
|
-
stale: LEDGER_LOCK_STALE_MS,
|
|
3965
|
-
update: LEDGER_LOCK_UPDATE_MS,
|
|
3966
|
-
retries: LEDGER_LOCK_RETRIES
|
|
3967
|
-
});
|
|
3968
|
-
try {
|
|
3969
|
-
const next = update(await readLedger(storeDir));
|
|
3970
|
-
const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
3971
|
-
await writeFile(temporary, `${JSON.stringify(next, null, 2)}\n`, { mode: 384 });
|
|
3972
|
-
await rename(temporary, path);
|
|
3973
|
-
return next;
|
|
3974
|
-
} finally {
|
|
3975
|
-
await releaseLock(release, `${path}.lock`);
|
|
3976
|
-
}
|
|
3977
|
-
});
|
|
3978
|
-
}
|
|
3979
4090
|
// ../../node_modules/yaml/dist/nodes/identity.js
|
|
3980
4091
|
var require_identity = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3981
4092
|
const ALIAS = Symbol.for("yaml.alias");
|
|
@@ -4525,8 +4636,8 @@ function onBlueprintBuildFinished(listener) {
|
|
|
4525
4636
|
const unannouncedWaits = [];
|
|
4526
4637
|
const waitListeners = /* @__PURE__ */ new Set();
|
|
4527
4638
|
/**
|
|
4528
|
-
* Tells the user, through the listeners of {@link onBlueprintBuildWaiting}, that
|
|
4529
|
-
* build
|
|
4639
|
+
* Tells the user, through the listeners of {@link onBlueprintBuildWaiting}, that the build of `root` waits for another
|
|
4640
|
+
* blueprint build, the leftovers of an interrupted build, or an update to the blueprint ledger.
|
|
4530
4641
|
*/
|
|
4531
4642
|
function announceBlueprintBuildWaiting(root, message) {
|
|
4532
4643
|
const waiting = {
|
|
@@ -4538,8 +4649,8 @@ function announceBlueprintBuildWaiting(root, message) {
|
|
|
4538
4649
|
for (const listener of waitListeners) listener(waiting);
|
|
4539
4650
|
}
|
|
4540
4651
|
/**
|
|
4541
|
-
* Tells `listener` each time a
|
|
4542
|
-
*
|
|
4652
|
+
* Tells `listener` each time a resumed worktree's blueprint build starts waiting, and at once of waits that started
|
|
4653
|
+
* before anyone listened. Returns the unsubscribe.
|
|
4543
4654
|
*/
|
|
4544
4655
|
function onBlueprintBuildWaiting(listener) {
|
|
4545
4656
|
waitListeners.add(listener);
|
|
@@ -5058,20 +5169,11 @@ function cancelHeldInput(session) {
|
|
|
5058
5169
|
return cancelled;
|
|
5059
5170
|
}
|
|
5060
5171
|
// dist/utils/sleep.js
|
|
5061
|
-
/**
|
|
5062
|
-
* Sleep helper that respects abort signal.
|
|
5063
|
-
*/
|
|
5172
|
+
/** @deprecated New internal callers should use the shared deadline timer. */
|
|
5064
5173
|
function sleep(ms, signal) {
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
return;
|
|
5069
|
-
}
|
|
5070
|
-
const timeout = setTimeout(resolve, ms);
|
|
5071
|
-
signal?.addEventListener("abort", () => {
|
|
5072
|
-
clearTimeout(timeout);
|
|
5073
|
-
reject(/* @__PURE__ */ new Error("Aborted"));
|
|
5074
|
-
});
|
|
5174
|
+
if (!signal) return sleepFor(ms);
|
|
5175
|
+
return sleepFor(ms, { signal }).catch((error) => {
|
|
5176
|
+
throw signal.aborted ? /* @__PURE__ */ new Error("Aborted") : error;
|
|
5075
5177
|
});
|
|
5076
5178
|
}
|
|
5077
5179
|
// dist/core/codex-errors.js
|
|
@@ -5521,10 +5623,10 @@ var HostInputBridge = class {
|
|
|
5521
5623
|
ownerSignal?.addEventListener("abort", abort, { once: true });
|
|
5522
5624
|
this.pending.add(controller);
|
|
5523
5625
|
let timer;
|
|
5524
|
-
if (options?.timeout !== void 0) timer =
|
|
5626
|
+
if (options?.timeout !== void 0) timer = setLongTimeout(cancelCaller, options.timeout);
|
|
5525
5627
|
let onAbort;
|
|
5526
5628
|
const cleanup = () => {
|
|
5527
|
-
|
|
5629
|
+
timer?.clear();
|
|
5528
5630
|
options?.signal?.removeEventListener("abort", cancelCaller);
|
|
5529
5631
|
ownerSignal?.removeEventListener("abort", abort);
|
|
5530
5632
|
if (onAbort) controller.signal.removeEventListener("abort", onAbort);
|
|
@@ -10240,22 +10342,9 @@ const MAX_PERSISTED_OUTPUT_BYTES = 67108864;
|
|
|
10240
10342
|
/** Appended in place of the content dropped at {@link MAX_PERSISTED_OUTPUT_BYTES}. */
|
|
10241
10343
|
const PERSISTED_OUTPUT_TRUNCATION_MARKER = `\n[Output truncated: persisted-output cap of ${MAX_PERSISTED_OUTPUT_BYTES} bytes reached]\n`;
|
|
10242
10344
|
// dist/core/tools/shell-deadline.js
|
|
10243
|
-
/**
|
|
10244
|
-
const MAX_TIMER_DELAY_MS = 0x7fffffff;
|
|
10245
|
-
/**
|
|
10246
|
-
* Calls `expire` once `timeoutMs` has passed. A command's timeout has no maximum, so a deadline past Node's longest
|
|
10247
|
-
* timer is waited out in steps of it rather than firing at once. Returns the function that cancels it.
|
|
10248
|
-
*/
|
|
10345
|
+
/** @deprecated New internal callers should use the shared deadline timer. */
|
|
10249
10346
|
function startShellDeadline(timeoutMs, expire) {
|
|
10250
|
-
|
|
10251
|
-
let timer;
|
|
10252
|
-
const arm = () => {
|
|
10253
|
-
const step = Math.min(remaining, MAX_TIMER_DELAY_MS);
|
|
10254
|
-
remaining -= step;
|
|
10255
|
-
timer = setTimeout(remaining > 0 ? arm : expire, step);
|
|
10256
|
-
};
|
|
10257
|
-
arm();
|
|
10258
|
-
return () => clearTimeout(timer);
|
|
10347
|
+
return setLongTimeout(expire, timeoutMs).clear;
|
|
10259
10348
|
}
|
|
10260
10349
|
// dist/core/tools/wait-args.js
|
|
10261
10350
|
const WAIT_ACTION_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -14141,8 +14230,7 @@ function isReadableUrlPath(readPath) {
|
|
|
14141
14230
|
return /^https?:\/\//i.test(repaired) || /^www\./i.test(readPath);
|
|
14142
14231
|
}
|
|
14143
14232
|
// dist/core/structured-output/deadline.js
|
|
14144
|
-
|
|
14145
|
-
const MAX_DEADLINE_MS = 0x7fffffff;
|
|
14233
|
+
const DISABLED_IDLE_DECISION_DEADLINE_MS = 0x7fffffff;
|
|
14146
14234
|
const CANCELLED_MESSAGE = "Structured output cancelled; no decision was accepted.";
|
|
14147
14235
|
/** The failure for an aborted decision: the deadline error when the deadline fired, otherwise a plain cancellation. */
|
|
14148
14236
|
function abortFailure(signal) {
|
|
@@ -14153,13 +14241,13 @@ function validateTimeoutOverride(value) {
|
|
|
14153
14241
|
if (!Number.isSafeInteger(value) || value <= 0) throw new Error("Structured output timeoutMs must be a positive integer.");
|
|
14154
14242
|
}
|
|
14155
14243
|
/**
|
|
14156
|
-
* The
|
|
14157
|
-
* setting's default.
|
|
14244
|
+
* The elapsed time limit for one decision: an explicit `timeoutMs`, else the session's `httpIdleTimeoutMs`, else that
|
|
14245
|
+
* setting's default. Disabled idle timeouts still use the documented fallback decision deadline.
|
|
14158
14246
|
*/
|
|
14159
14247
|
function resolveDecisionDeadlineMs(timeoutMs, httpIdleTimeoutMs) {
|
|
14160
14248
|
validateTimeoutOverride(timeoutMs);
|
|
14161
14249
|
const requested = timeoutMs ?? httpIdleTimeoutMs ?? SETTINGS_DEFAULTS.httpIdleTimeoutMs;
|
|
14162
|
-
return requested === 0 ?
|
|
14250
|
+
return requested === 0 ? DISABLED_IDLE_DECISION_DEADLINE_MS : requested;
|
|
14163
14251
|
}
|
|
14164
14252
|
function formatDuration(milliseconds) {
|
|
14165
14253
|
const ms = Math.round(milliseconds);
|
|
@@ -14237,14 +14325,14 @@ async function withinDecisionDeadline(callerSignal, timeoutMs, run, options) {
|
|
|
14237
14325
|
at: startedAt + timeoutMs,
|
|
14238
14326
|
onExpired: expire
|
|
14239
14327
|
};
|
|
14240
|
-
const timer =
|
|
14328
|
+
const timer = setLongTimeoutAt(expire, startedAt + timeoutMs);
|
|
14241
14329
|
try {
|
|
14242
14330
|
return await run({
|
|
14243
14331
|
signal: controller.signal,
|
|
14244
14332
|
trace
|
|
14245
14333
|
});
|
|
14246
14334
|
} finally {
|
|
14247
|
-
|
|
14335
|
+
timer.clear();
|
|
14248
14336
|
callerSignal?.removeEventListener("abort", forwardCallerAbort);
|
|
14249
14337
|
}
|
|
14250
14338
|
}
|
|
@@ -14270,8 +14358,6 @@ function getLockPath(todosDir, id) {
|
|
|
14270
14358
|
// dist/core/tools/tool-abort-grace.js
|
|
14271
14359
|
/** How long a tool call may run on after its turn is interrupted before the turn stops waiting for it (#5486). */
|
|
14272
14360
|
const DEFAULT_TOOL_ABORT_GRACE_MS = 1e4;
|
|
14273
|
-
/** The longest delay a timer takes; a larger value would fire at once. */
|
|
14274
|
-
const MAX_TIMER_MS = 0x7fffffff;
|
|
14275
14361
|
const graceOwners = /* @__PURE__ */ new WeakMap();
|
|
14276
14362
|
function graceOwnerState(owner) {
|
|
14277
14363
|
let state = graceOwners.get(owner);
|
|
@@ -14364,7 +14450,7 @@ function holdToolAbortGraceWhenObserved(owner, promise) {
|
|
|
14364
14450
|
*/
|
|
14365
14451
|
function armToolAbortGraceTimer(owner, graceMs, onExpire) {
|
|
14366
14452
|
const state = owner === void 0 ? void 0 : graceOwnerState(owner);
|
|
14367
|
-
const timer =
|
|
14453
|
+
const timer = setLongTimeout(() => {
|
|
14368
14454
|
if (owner !== void 0 && state !== void 0) {
|
|
14369
14455
|
state.timers.delete(timer);
|
|
14370
14456
|
pruneGraceOwner(owner, state);
|
|
@@ -14380,7 +14466,7 @@ function armToolAbortGraceTimer(owner, graceMs, onExpire) {
|
|
|
14380
14466
|
/** Clear an abort-grace timer armed through {@link armToolAbortGraceTimer}. */
|
|
14381
14467
|
function clearToolAbortGraceTimer(owner, timer) {
|
|
14382
14468
|
if (timer === void 0) return;
|
|
14383
|
-
|
|
14469
|
+
timer.clear();
|
|
14384
14470
|
if (owner === void 0) return;
|
|
14385
14471
|
const state = graceOwners.get(owner);
|
|
14386
14472
|
if (state === void 0) return;
|
|
@@ -14398,7 +14484,8 @@ function releaseToolAbortGraceTimers(owner) {
|
|
|
14398
14484
|
/** `ATOMIC_TOOL_ABORT_GRACE_MS` when it is a whole number of milliseconds, otherwise the default. */
|
|
14399
14485
|
function toolAbortGraceMs(env = process.env) {
|
|
14400
14486
|
const value = env.ATOMIC_TOOL_ABORT_GRACE_MS?.trim();
|
|
14401
|
-
|
|
14487
|
+
const ms = value !== void 0 && /^\d+$/.test(value) ? Number(value) : NaN;
|
|
14488
|
+
return Number.isSafeInteger(ms) ? ms : DEFAULT_TOOL_ABORT_GRACE_MS;
|
|
14402
14489
|
}
|
|
14403
14490
|
function seconds(ms) {
|
|
14404
14491
|
const value = Number((ms / 1e3).toFixed(3));
|
|
@@ -15972,10 +16059,7 @@ function deserializeSubscriptionError(serialized) {
|
|
|
15972
16059
|
const systemTimerHost = {
|
|
15973
16060
|
now: () => Date.now(),
|
|
15974
16061
|
elapsed: () => performance.now(),
|
|
15975
|
-
setTimer: (callback, ms) => {
|
|
15976
|
-
const timer = setTimeout(callback, ms);
|
|
15977
|
-
return { cancel: () => clearTimeout(timer) };
|
|
15978
|
-
}
|
|
16062
|
+
setTimer: (callback, ms) => ({ cancel: setLongTimeout(callback, ms).clear })
|
|
15979
16063
|
};
|
|
15980
16064
|
/** Abort callbacks registered on owned signals; their owner runs them, so the signal itself holds no listener. */
|
|
15981
16065
|
const ownedAborts = /* @__PURE__ */ new WeakMap();
|
|
@@ -17426,178 +17510,6 @@ function lockShownNotices(path) {
|
|
|
17426
17510
|
Atomics.wait(lockPoll, 0, 0, SHOWN_NOTICES_LOCK_POLL_MS);
|
|
17427
17511
|
}
|
|
17428
17512
|
}
|
|
17429
|
-
// dist/core/lock-holder.js
|
|
17430
|
-
const MAX_SAFE_INO = BigInt(Number.MAX_SAFE_INTEGER);
|
|
17431
|
-
function lockDirectoryIdentityFromStats(stats) {
|
|
17432
|
-
const birthtimeMs = Number(stats.birthtimeNs / 1000000000n) * 1e3 + Number(stats.birthtimeNs % 1000000000n) / 1e6;
|
|
17433
|
-
return {
|
|
17434
|
-
exact: `${stats.dev}:${stats.ino}:${stats.birthtimeNs}`,
|
|
17435
|
-
legacy: `${Number(stats.ino)}:${birthtimeMs}`,
|
|
17436
|
-
legacyInoSafe: stats.ino <= MAX_SAFE_INO
|
|
17437
|
-
};
|
|
17438
|
-
}
|
|
17439
|
-
function readLockIdentity(lockPath) {
|
|
17440
|
-
try {
|
|
17441
|
-
return lockDirectoryIdentityFromStats(statSync$1(lockPath, { bigint: true }));
|
|
17442
|
-
} catch {
|
|
17443
|
-
return;
|
|
17444
|
-
}
|
|
17445
|
-
}
|
|
17446
|
-
async function readLockIdentityAsync(lockPath) {
|
|
17447
|
-
try {
|
|
17448
|
-
return lockDirectoryIdentityFromStats(await stat(lockPath, { bigint: true }));
|
|
17449
|
-
} catch {
|
|
17450
|
-
return;
|
|
17451
|
-
}
|
|
17452
|
-
}
|
|
17453
|
-
function matchesHolderRecord(identity, record) {
|
|
17454
|
-
if (identity === void 0) return false;
|
|
17455
|
-
if (record.lockId !== void 0) return identity.exact === record.lockId && (record.lock === identity.legacy || record.lock === identity.exact);
|
|
17456
|
-
if (record.lock === identity.exact) return true;
|
|
17457
|
-
return identity.legacyInoSafe && record.lock === identity.legacy;
|
|
17458
|
-
}
|
|
17459
|
-
/**
|
|
17460
|
-
* Names this process as the holder of the lock directory at `lockPath`, which it has just taken. Best effort: a lock
|
|
17461
|
-
* whose holder is not named is only taken over once it is stale.
|
|
17462
|
-
*/
|
|
17463
|
-
function recordLockHolder(lockPath) {
|
|
17464
|
-
const identity = readLockIdentity(lockPath);
|
|
17465
|
-
if (identity === void 0) return;
|
|
17466
|
-
const record = {
|
|
17467
|
-
host: hostname(),
|
|
17468
|
-
pid: process.pid,
|
|
17469
|
-
started: processStartToken(process.pid),
|
|
17470
|
-
lock: identity.legacyInoSafe ? identity.legacy : identity.exact,
|
|
17471
|
-
lockId: identity.exact
|
|
17472
|
-
};
|
|
17473
|
-
const path = lockHolderPath(lockPath);
|
|
17474
|
-
const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
17475
|
-
try {
|
|
17476
|
-
writeFileSync$1(temporary, JSON.stringify(record));
|
|
17477
|
-
renameReplacing(temporary, path);
|
|
17478
|
-
} catch {
|
|
17479
|
-
rmSync$1(temporary, { force: true });
|
|
17480
|
-
}
|
|
17481
|
-
}
|
|
17482
|
-
let ownStart;
|
|
17483
|
-
async function recordLockHolderAsync(lockPath) {
|
|
17484
|
-
const identity = await readLockIdentityAsync(lockPath);
|
|
17485
|
-
if (identity === void 0) return;
|
|
17486
|
-
ownStart ??= processStartTokenAsync(process.pid);
|
|
17487
|
-
const record = {
|
|
17488
|
-
host: hostname(),
|
|
17489
|
-
pid: process.pid,
|
|
17490
|
-
started: await ownStart,
|
|
17491
|
-
lock: identity.legacyInoSafe ? identity.legacy : identity.exact,
|
|
17492
|
-
lockId: identity.exact
|
|
17493
|
-
};
|
|
17494
|
-
const path = lockHolderPath(lockPath);
|
|
17495
|
-
const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
17496
|
-
try {
|
|
17497
|
-
await writeFile(temporary, JSON.stringify(record));
|
|
17498
|
-
await renameReplacingAsync(temporary, path);
|
|
17499
|
-
} catch {
|
|
17500
|
-
await rm(temporary, { force: true });
|
|
17501
|
-
}
|
|
17502
|
-
}
|
|
17503
|
-
/** Forgets this process as the holder of the lock at `lockPath`, before it releases the lock. */
|
|
17504
|
-
function clearLockHolder(lockPath) {
|
|
17505
|
-
try {
|
|
17506
|
-
rmSync$1(lockHolderPath(lockPath), { force: true });
|
|
17507
|
-
} catch {}
|
|
17508
|
-
}
|
|
17509
|
-
async function clearLockHolderAsync(lockPath) {
|
|
17510
|
-
try {
|
|
17511
|
-
await rm(lockHolderPath(lockPath), { force: true });
|
|
17512
|
-
} catch {}
|
|
17513
|
-
}
|
|
17514
|
-
function readHolderRecord(lockPath) {
|
|
17515
|
-
try {
|
|
17516
|
-
return parseHolderRecord(readFileSync$1(lockHolderPath(lockPath), "utf8"));
|
|
17517
|
-
} catch {
|
|
17518
|
-
return;
|
|
17519
|
-
}
|
|
17520
|
-
}
|
|
17521
|
-
async function readHolderRecordAsync(lockPath) {
|
|
17522
|
-
try {
|
|
17523
|
-
return parseHolderRecord(await readFile(lockHolderPath(lockPath), "utf8"));
|
|
17524
|
-
} catch {
|
|
17525
|
-
return;
|
|
17526
|
-
}
|
|
17527
|
-
}
|
|
17528
|
-
function parseHolderRecord(content) {
|
|
17529
|
-
const record = JSON.parse(content);
|
|
17530
|
-
if (typeof record.host !== "string" || !Number.isSafeInteger(record.pid) || typeof record.lock !== "string") return void 0;
|
|
17531
|
-
if (record.started !== void 0 && typeof record.started !== "string") return void 0;
|
|
17532
|
-
if (record.lockId !== void 0 && typeof record.lockId !== "string") return void 0;
|
|
17533
|
-
return record;
|
|
17534
|
-
}
|
|
17535
|
-
async function prepareLockTakeover(lockPath) {
|
|
17536
|
-
await prepareTakeoverMutex(lockPath, await readHolderRecordAsync(lockPath));
|
|
17537
|
-
}
|
|
17538
|
-
/**
|
|
17539
|
-
* Removes the lock directory at `lockPath` when its holder is proven dead, so the next attempt to take it follows at
|
|
17540
|
-
* once; true when it did. Takeovers are serialized by the takeover mutex, an advisory lock the kernel releases when
|
|
17541
|
-
* its holder dies (#5193), and the whole move runs while it is held: the holder record and the lock directory are
|
|
17542
|
-
* checked again inside it, so a lock another process took after the dead holder's is never moved. A directory that,
|
|
17543
|
-
* once moved, turns out not to be the dead holder's is put back only while the lock path is free, never replacing
|
|
17544
|
-
* anything, and otherwise left aside, never removed.
|
|
17545
|
-
*/
|
|
17546
|
-
function takeOverDeadHolder(lockPath) {
|
|
17547
|
-
const record = readHolderRecord(lockPath);
|
|
17548
|
-
if (record === void 0 || !matchesHolderRecord(readLockIdentity(lockPath), record) || processMayRun(record)) return false;
|
|
17549
|
-
const mutex = takeTakeoverMutex(lockPath);
|
|
17550
|
-
if (mutex === void 0) return false;
|
|
17551
|
-
try {
|
|
17552
|
-
const current = readHolderRecord(lockPath);
|
|
17553
|
-
if (current === void 0 || !sameRecord(current, record) || !matchesHolderRecord(readLockIdentity(lockPath), record)) return false;
|
|
17554
|
-
const aside = `${lockPath}.${randomUUID()}.dead`;
|
|
17555
|
-
if (!mutex.owned()) return false;
|
|
17556
|
-
try {
|
|
17557
|
-
renameSync$1(lockPath, aside);
|
|
17558
|
-
} catch {
|
|
17559
|
-
return false;
|
|
17560
|
-
}
|
|
17561
|
-
if (!matchesHolderRecord(readLockIdentity(aside), record)) {
|
|
17562
|
-
putBack(aside, lockPath);
|
|
17563
|
-
return false;
|
|
17564
|
-
}
|
|
17565
|
-
removeAside(aside);
|
|
17566
|
-
removeLeftoverHolderFiles(lockPath);
|
|
17567
|
-
return true;
|
|
17568
|
-
} finally {
|
|
17569
|
-
mutex.release();
|
|
17570
|
-
}
|
|
17571
|
-
}
|
|
17572
|
-
async function takeOverDeadHolderAsync(lockPath) {
|
|
17573
|
-
const record = await readHolderRecordAsync(lockPath);
|
|
17574
|
-
if (record === void 0 || !matchesHolderRecord(await readLockIdentityAsync(lockPath), record) || await processMayRunAsync(record)) return false;
|
|
17575
|
-
const mutex = await takeTakeoverMutexAsync(lockPath);
|
|
17576
|
-
if (mutex === void 0) return false;
|
|
17577
|
-
try {
|
|
17578
|
-
const current = await readHolderRecordAsync(lockPath);
|
|
17579
|
-
if (current === void 0 || !sameRecord(current, record) || !matchesHolderRecord(await readLockIdentityAsync(lockPath), record)) return false;
|
|
17580
|
-
const aside = `${lockPath}.${randomUUID()}.dead`;
|
|
17581
|
-
if (!await mutex.owned()) return false;
|
|
17582
|
-
try {
|
|
17583
|
-
await rename(lockPath, aside);
|
|
17584
|
-
} catch {
|
|
17585
|
-
return false;
|
|
17586
|
-
}
|
|
17587
|
-
if (!matchesHolderRecord(await readLockIdentityAsync(aside), record)) {
|
|
17588
|
-
await putBackAsync(aside, lockPath);
|
|
17589
|
-
return false;
|
|
17590
|
-
}
|
|
17591
|
-
await removeAsideAsync(aside);
|
|
17592
|
-
await removeLeftoverHolderFilesAsync(lockPath);
|
|
17593
|
-
return true;
|
|
17594
|
-
} finally {
|
|
17595
|
-
await mutex.release();
|
|
17596
|
-
}
|
|
17597
|
-
}
|
|
17598
|
-
function sameRecord(a, b) {
|
|
17599
|
-
return a.host === b.host && a.pid === b.pid && a.started === b.started && a.lock === b.lock && a.lockId === b.lockId;
|
|
17600
|
-
}
|
|
17601
17513
|
// dist/core/resource-loader-internals.js
|
|
17602
17514
|
function resourceInternals(loader) {
|
|
17603
17515
|
return loader;
|
|
@@ -18443,7 +18355,9 @@ var ProfileSampler = class {
|
|
|
18443
18355
|
this.scheduleCollection();
|
|
18444
18356
|
});
|
|
18445
18357
|
}
|
|
18446
|
-
exit() {
|
|
18358
|
+
exit() {
|
|
18359
|
+
if (!isBunRuntime) this.session.disconnect();
|
|
18360
|
+
}
|
|
18447
18361
|
scheduleCollection() {
|
|
18448
18362
|
if (this.collectionScheduled) return;
|
|
18449
18363
|
this.collectionScheduled = true;
|
|
@@ -19066,11 +18980,11 @@ var ActivityWatchdog = class {
|
|
|
19066
18980
|
}
|
|
19067
18981
|
start() {
|
|
19068
18982
|
if (this.timer) return;
|
|
19069
|
-
this.timer =
|
|
18983
|
+
this.timer = setLongInterval(() => this.inspect(), this.thresholds.pollMs);
|
|
19070
18984
|
this.timer.unref?.();
|
|
19071
18985
|
}
|
|
19072
18986
|
stop() {
|
|
19073
|
-
|
|
18987
|
+
this.timer?.clear();
|
|
19074
18988
|
this.timer = void 0;
|
|
19075
18989
|
this.activities.clear();
|
|
19076
18990
|
}
|
|
@@ -20228,16 +20142,16 @@ function formatAppendRecoveryNotice({ state, elapsedMs, reconnecting }) {
|
|
|
20228
20142
|
if (state === "waiting") return `Waiting for PostgreSQL ${reconnecting ? "to reconnect " : ""}to save this session (${seconds}s elapsed).`;
|
|
20229
20143
|
return reconnecting ? `PostgreSQL reconnected after ${seconds}s; session changes saved.` : `PostgreSQL saved session changes after ${seconds}s.`;
|
|
20230
20144
|
}
|
|
20231
|
-
export { ActivityWatchdog, AgentSessionBusyError, BLUEPRINT_CONTEXT_TYPE, BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, BUILTIN_SLASH_COMMANDS, BUNDLED_EXTENSION_SLASH_COMMANDS, BlueprintBuildFailedError, BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, CACHE_WARMING_MODES, COMMAND_DETAIL_TAIL_BYTES, COMMAND_FOREGROUND_BUDGET_MS, CONTINUE_AFTER_FAILURE, CURRENT_SESSION_VERSION, CompactionCancelledError, CompactionConfigError, CompactionError, CompactionStateError, CompactorFailure, CountdownTimer, DEFAULT_BUILTIN_SELECTION_EXTRA_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_MAX_RESULT_SIZE_CHARS, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_THINKING_LEVEL, Diff, DynamicBorder, ENGINE_UNRESPONSIVE_MS, EditInputError, EditMatchError, EditTargetError, EditToolError, EngineSessionStats, EntryTypeReader, EventSourceError, ExtensionStartupError, FILE_KINDS, FILE_PATTERNS, FINISHED_TASK_RETENTION, FORKED_PACKAGE_NAMES, FORKED_PACKAGE_WORKSPACE_DIRS, FileToolAbortedError, ForkSourceIncompleteError, FramedSelector, GIT_LOCAL_ENV_VARS, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionError, GitProvisionTimeoutError, GitUnavailableError, HOST, HOST_NOTICE_TYPE, HostInputBridge, HostListenerFailures, INTERACTIVE_MODEL_REFRESH_TIMEOUT_MS, InteractiveEngineResourceReadinessError, IntercomPolicyError, JSON_RPC_ERROR_CODES, JsonTextChecker, LATEST_PROTOCOL_VERSION, LIVE_COMMAND_LIMIT_MESSAGE, LONG_LIVED_COMMANDS, LlamaServerError, LlamaServerRequestError, LlamaServerUnreachableError, MAX_INTERCOM_REACHABLE_GROUPS, MAX_PERSISTED_OUTPUT_BYTES, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, Minimatch, MissingSessionCwdError, NETWORK_TIMEOUT_MS, NON_SECRET_HTTP_HEADERS, NO_QUEUED_MESSAGES, NativeModuleUnavailableError, PERSISTED_OUTPUT_CLOSING_TAG, PERSISTED_OUTPUT_TAG, PERSISTED_OUTPUT_TRUNCATION_MARKER, PLAIN_SELECTOR_STYLE, POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS, PREVIEW_SIZE_BYTES, QueuedDeliveryRelay, QueuedDeliveryView, RESOURCE_TYPES, RESTART_CANCELLED_MESSAGE, ROW_INTENT_META, RawStdoutWriteError, SESSION_HISTORY_TOOL_NAME, STALE_EXTENSION_CONTEXT_MARKER, STALE_EXTENSION_CONTEXT_MESSAGE, STARTUP_DECISION_TYPED_TEXT_NOTICE, SUPPORTED_PROTOCOL_VERSIONS, Selector, SelectorState, SessionAppendRecovery, SessionIntercomPolicy, ShellTimeoutError, ShellToolError, SqliteSelectorConnection, Stop, SubscriptionChildUnavailableError, SubscriptionClosedError, SubscriptionConfigError, SubscriptionError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, SubscriptionSetupError, SubscriptionSubscriberUnavailableError, SubscriptionTimeoutError, TASK_MARKS, THINKING_LEVELS, TOOL_DEACTIVATION_ENTRY_TYPE, TOOL_RESULTS_SUBDIR, TYPEBOX_SUBPATHS, TaskCleanupAdmissionTimeoutError, TaskCleanupError, TaskEvictedError, TaskMessageError, TaskMessageTimeoutError, ToolDetachmentError, TrustDecisionSelector, VALID_THINKING_LEVELS, VERBATIM_COMPACTION_STRATEGY, VisualLinePreview, WriteSelectorError, abandonedToolResult, abortFailure, abortSymbol, activeToolExecutionStarts, addHistoryUsageToTotals, addUsageToTotals, allToolNames, announceBlueprintBuildWaiting, announceHistoryLoad, applyBashSessionEnvironment, applyExifOrientation, applySessionSummaryEntries, areExperimentalFeaturesEnabled, armToolAbortGraceTimer, assertForkSegments, assertSessionCwdExists, assertToolPairingInvariant, assignMissingToolCallIds, asyncScope, attachCleanupCause, attachGitCleanupFailure, attachJsonlLineReader, attachLineReader, attachSessionClaim, awaitBlueprintReady, backgroundTaskScope, beginQueuedMessageDelivery, belongsToSession, bindChatEpoch, bindChatReceipt, bindReleasedTaskOwner, bindSavedReadLines, bindSavedTaskOrigins, bindSavedTaskRowKey, bindTaskResumer, blueprintBuildPending, blueprintBuildSettled, blueprintBuildShared, blueprintBuildsRunning, blueprintBuildsSettled, blueprintDigest, boundedChatRecord, buildBoundaryText, buildBoundaryTextWithLocation, canWatchProcessUntilHostDies, cancelHeldInput, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, carryDroppedQueuedMessages, carryRowSource, chatEpoch, chatPosition, chatReceipt, chatReceiptWrite, chatRecordSavesSettled, claimPaneReporting, claimSession, classifiedWorkflowMetadata, cleanupWindowsSelfUpdateQuarantine, clearAssignmentIfClosed, clearFunctionList, clearLockHolder, clearLockHolderAsync, clearToolAbortGraceTimer, collectDeclaredDisplaySecrets, collectSecretsForMasking, combineMany, combineManyMut, combineUsage, compactTemplate, compactUrl, completeStartup, computeBoxDimensions, confinedIntercomChildGroup, containProcessTree, containProcessTreeAllowingBreakaway, conventionDirsForResource, convertBufferWithMarkit, convertFileWithMarkit, copyHostQuestionnaire, createBatchedCanonicalizePathAsync, createConversationRegion, createEventBus, createGitEnvironment, createOwnedAbortController, createSourceInfo, createStagedEventBus, createSyntheticSourceInfo, createTypeScriptSourceSpecifierTransform, createUsageTotals, createWakeDispatcher, customMessageExcludesContext, decodeChatOrder, decodeChatRecord, deduplicateDiagnostics, defaultModelPerProvider, defaultToolNamesFor, deferDeprecationWarnings, defineTool, deserializeSubscriptionError, deserializeToolDetachmentError, detectSupportedImageMimeTypeFromFile, displayTodoId, drainAgentMessageQueue, dropStoredNotes, earlierHeldInputs, emitProgress, encodeChatOrder, endQueuedMessageDelivery, entryLines, epochHasCreationTime, expandSearchUrl, experimentalToolSamplingProperty, extractHeaderSecrets, fListSymbol, fetchWithRetry, fieldTone, fileEpochOf, filterSearchOutputByLineRange, final, finalSymbol, finalValue, findBlueprintError, findCompactionError, findGitProvisionError, findLegacyWorkflowFiles, findLlamaServerError, findMissingSessionCwdIssue, findMissingSessionCwdIssueAsync, findPreferredAvailableModel, findProviderDefaultModel, findSubscriptionError, findTaskEvictedError, findTaskMessageError, findToolDetachmentError, finishHeldInput, firstChatOrders, flushRawStdout, flushSymbol, flushable, forkRunSegments, forkScope, forkStoreRelation, forkedPackageExportAliases, formatAppendRecoveryNotice, formatCodexProviderError, formatMissingSessionCwdPrompt, formatNoApiKeyFoundMessage, formatNoModelSelectedMessage, formatNoModelsAvailableMessage, formatReadLineRange, formatSelectedLines, formatSize, formatTimeoutSeconds, formatTodoId, formatTokenCount, formatToolCallWithArgs, formatUnresolvedModelMessage, frozenClocks, getAllBuiltinPackageLocations, getBuiltinPackageLocations, getBuiltinPackagePaths, getDefaultCacheRetention, getDefaultSessionDir, getDefaultSessionDirAsync, getDefaultSessionDirPath, getEngineSessionStats, getErrnoCode, getFinalValue, getFunctionList, getHostQuestionnaire, getLockPath, getMandatoryBuiltinExtensionPaths, getManifestFromPackageJson, getManyValues, getMissingSessionCwdOptions, getPiUserAgent, getProviderLoginHelp, getResourcePathKey, getResourcePathKeyAsync, getSyntheticPathSource, getTextOutput, getTodoPath, getTodoStatus, getTodoTitle, getTodosDir, getTodosDirLabel, getToolExecutionStartedAt, getToolListError, handOverBuildTimings, handlePackageCommandParseOutcome, hasHeldInput, hasHistoryLoadObserver, hasNativeProcessHold, heldInputView, historySnapshotFor, holdDeprecationWarnings, holdProcessDescendants, holdProcessDescendantsResult, holdToolAbortGraceWhenObserved, holdToolsUntilBuilt, holdToolsUntilOwnerBuilt, holderRuns, hostInputError, hostNoticeForEvent, inheritForkScope, interactiveQuitOf, invalidArgText, invalidateNativeSearchCache, isAgentSessionBusyError, isBlueprintBuildFailedError, isBlueprintError, isBlueprintInvalidError, isBlueprintStepFailedError, isBlueprintStepTimedOutError, isBlueprintUsesUnsupportedError, isClassifiedWorkflowSession, isCodexTokenInvalidationError, isCompactionCancelledError, isCompactionConfigError, isCompactionError, isCompactionStateError, isCompactorFailure, isEditInputError, isEditMatchError, isEditTargetError, isEditToolError, isEventSourceError, isExtensionLoadError, isExtensionStartupFailure, isFileToolAbortedError, isFinalValue, isFlushable, isFunctionList, isGitProvisionConfigError, isGitProvisionError, isGitProvisionTimeoutError, isGitUnavailableError, isInstallTelemetryEnabled, isInteractiveEngineResourceReadinessError, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isLlamaServerError, isLlamaServerRequestError, isLlamaServerUnreachableError, isManagedToolDownloadError, isManagedToolError, isManagedToolTimeoutError, isMandatoryRuntimeTool, isMany, isMissingSessionCwdError, isObject, isPathInside, isPlainObject$1 as isPlainObject, isReadResourceSelector, isReadableUrlPath, isRetryableCompactionError, isRetryableGitProvisionError, isRetryableLlamaServerError, isRetryableManagedToolError, isRetryableSubscriptionError, isRetryableTaskError, isRetryableTaskMessageError, isSensitiveKeyNameForMasking, isSerializedMissingSessionCwdError, isShellTimeoutError, isShellToolError, isSingleGenericAbortTextContent, isStaleExtensionContextError, isStdoutTakenOver, isStop, isSubscriptionChildUnavailableError, isSubscriptionClosedError, isSubscriptionConfigError, isSubscriptionError, isSubscriptionEventError, isSubscriptionHandlerError, isSubscriptionRecordError, isSubscriptionSetupError, isSubscriptionSubscriberUnavailableError, isSubscriptionTimeoutError, isSyntheticPath, isTaskCleanupAdmissionTimeoutError, isTaskCleanupError, isTaskEvictedError, isTaskMessageError, isTaskMessageTimeoutError, isTodoClosed, isToolDeactivationEntryData, isToolDetachmentError, isToolModifier, isTransientExtensionStartupFailure, isTrustDecision, isTrustedMandatoryRuntimeTool, isUnknownModel, isValidBudgetMs, isValidThinkingLevel, isWindowsInstallDirectoryLockError, isWriteSelectorError, joinForkSegments, keepDroppedQueuedMessages, keepsDroppedQueuedMessages, keptTaskHint, keptTaskId, leadingAndTrailingWs, leadingWs, legacyFileEpochOf, legacyWorkflowFilePaths, legacyWorkflowFilePatterns, legacyWorkflowSection, linkPath, literalPathLike, loadConfig, loadNativeSearchBinding, loadShownDeprecationNotices, loadedConfig, lockShared, longestCommonPrefix, longestCommonSuffix, many, manySymbol, markEventLoopShutdown, markEventLoopStartupComplete, markTrustedMandatoryRuntimeExtension, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, mergeSessionTrustDecisions, minimatch, modelCallUsage, nativeForkReader, nativeModuleProblem, nativeModuleUnavailable, noOpUIContext, none, normalizeDisplayText, normalizeInterruptAbortMessage, normalizeMany, normalizePathLikeInput, normalizeTodoId, normalizeWaitPolicy, noteQueueUpdateDeliveries, noteQueuedMessagesDropped, noteRowSource, noteSavedSeq, noteSnapshotGeneration, noteUserMessageOrigin, notifySessionProviderRequestDispatched, observeArchiveLoad, observeHistoryLoads, observeReferenceCut, observeToolExecutionTiming, omitLegacyThinkingSections, onBlueprintBuildFinished, onBlueprintBuildWaiting, onSessionProviderRequestDispatched, operationSignal, originalHistoryNote, outputExtensionLoadErrors, parseJsonRpcMessage, parsePackageCommand, parseSerializedCompactionError, parseSlashCommand, parseTranscriptFrameLayout, pendingProjectResourcesTrusted, placeTranscriptFrame, postgresAppendConnectionFailure, prefixForkSegments, prepareLockTakeover, prepareSessionClaim, prepareWaitableToolInput, priorityHoldCounts, processTreeEnded, projectTrustHandlerRegistered, projectTrustWarningVisible, projectTrustedBeforeExtensions, providerOfModelReference, quarantineWindowsNativeDependencies, queueUpdateDeliveries, queuedMessagesUnderWay, queuedReceiptsUnderWay, queuedTextsUnderWay, quitAsInteractiveApp, raceWithAbortSignal, rawStdoutWriteFailed, readLedger, readPiManifestFile, readTaskOutputTail, receiveChatReceipt, recordLockHolder, recordLockHolderAsync, recordStartupThinkingLevel, redactAuthorizationUrlForDisplay, redactCredentials, redactOAuthErrorText, redactOAuthErrorTextCapped, redactUrlForDisplay, redactUrlForTransportDisplay, redactWwwAuthenticateHeader, referenceMetadataRead, refreshConfig, registerArchiveLoad, registerCanonicalEventBus, registerForkScope, registerHeldInput, registerHistorySnapshot, registerStartupRollback, rehydrateBlueprintError, rehydrateCompactionError, rehydrateEditToolError, rehydrateGitProvisionError, rehydrateLlamaServerError, rehydrateMissingSessionCwdError, rehydrateShellToolError, rehydrateTaskCleanupError, rehydrateTaskEvictedError, rehydrateTaskMessageError, rehydrateWriteSelectorError, releaseDeprecationWarnings, releasePaneReporting, releaseRetiredPaneReporting, releaseToolAbortGraceTimers, releaseTurnPause, releaseUnownedPaneRegistration, removePrefix, removeSuffix, removedProviderMessage, renderBlueprintContext, renderBorderedBox, renderToolPath, repairCollapsedScheme, replacePrefix, replaceSuffix, replaceTabs, replacementAbortContent, reportContained, reportPaneActivity, repositoryKey, require_applyReviver, require_constants, require_debug, require_errors, require_identifiers, require_identity, require_ignore, require_line_counter, require_parse_options, require_parse_url, require_resolve_end, require_resolve_props, require_sha256, require_stringifyComment, require_stringifyNumber, require_util_contains_newline, resolveDecisionDeadlineMs, resolvePhysicalPath, resolvePhysicalPathAsync, resolveSchemaRef, resourceInternals, restoreStdout, retirePaneReporting, retryStatusUpdate, rollbackStartup, rootKey, rowSource, rowTone, safeTrustChoiceIndex, sanitizeMcpServers, sanitizeOpenAIResponsesPayload, saveChatRecord, savedConversationThinkingLevel, savedReadLines, savedRowKey, savedRowSpan, savedSeqOf, savedTaskRowKey, savedTaskRows, scopedBackgroundTasks, scrubFetchError, scrubPreCompactionAssistantUsage, scrubUnknownErrorData, searchPosition, segment, segmentLength, selectExactReadRanges, selectReadRanges, selectorHintEntries, sentinelsToAppend, serializeBlueprintError, serializeCompactionError, serializeConversationForCompaction, serializeFileToolError, serializeJsonLine, serializeMissingSessionCwdError, serializeRetainedTranscript, serializeSessionMutation, serializeSubscriptionError, sessionIntercomFacade, sessionTasks, sessionWaitsToRetry, setDeprecationWarningSink, setFunctionList, setMarkitDiagnosticSink, setSharedHistorySwitchHost, settingsFileNoticeKey, settingsInternals, settleTurnPause, sha256Hex, shareBlueprintBuild, sharedClockNow, sharedHistorySwitchHost, sharedWakeDispatcher, shortenPath, shouldRenderEngineDiagnosticAsChatError, shouldRunFirstTimeSetup, sleep, sliceHead, sliceTail, snapshotBashSessionEnvironment, sortTodos, spanElapsedMs, spawnContainedProcess, spawnHostProcess, splitLineRangeSelector, splitPathLikeGlob, splitReadLineSelector, splitTodosByAssignment, sqliteSessionResumeArgs, startEventLoopMonitor, startShellDeadline, startToolTimer, startupCleanupFailureMessage, startupProjectTrust, stop, stopBlueprintBuilds, stopErrorSymbol, stopWaiting, storedEntryNotes, storedRows, str, stringEntries, stripFenceMarkers, stripUrlUserinfoAndHash, styleFieldTone, summarizeSession, takeOverDeadHolder, takeOverDeadHolderAsync, takeOverStdout, takeQueuedDeliveryChange, takeQueuedMessagesDroppedAt, taskMark, taskOutcomeStatus, taskOutputText, taskResumer, taskSessionKey, taskStoppedForResume, themeSelectorStyle, thisProcess, timestamp, toError, toMany, toolAbortGraceMs, toolTimerText, trackChatRecordSave, trailingWs, transcriptHeaderLines, transcriptLayoutOf, truncateHead, truncateLine, truncateMiddle, truncateTail, truncateToVisualLines, uniquifyToolCallIds, updateLedger, usageCostBreakdown, userMessageOrigin, validQuestionnaire, validateGuidanceFields, validateIntercomSessionOptions, validateTimeoutOverride, validateTodoId, waitForEventLoopMonitorReady, waitForRawStdoutBackpressure, warnDeprecation, watchFirstProjectTrustHandler, watchProcessUntilHostDies, watchReferenceCut, whenAborted, windowsTemporaryFiles, withCleanup, withFileMutationQueue, withInstallLock, withLegacyPackageNames, withProgress, withQueuedDeliveryChange, withResolvingFileMutationQueue, withToolAbortGrace, withinDecisionDeadline, workspaceKey, writeOutputFile, writeRawStdout, writeRawStdoutControl, writeRawStdoutOnce, yieldToEventLoop, yieldToEventLoopIfSlow, yieldToTimerTurn, yieldTurn };
|
|
20145
|
+
export { ActivityWatchdog, AgentSessionBusyError, BLUEPRINT_CONTEXT_TYPE, BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, BUILTIN_SLASH_COMMANDS, BUNDLED_EXTENSION_SLASH_COMMANDS, BlueprintBuildFailedError, BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, CACHE_WARMING_MODES, COMMAND_DETAIL_TAIL_BYTES, COMMAND_FOREGROUND_BUDGET_MS, CONTINUE_AFTER_FAILURE, CURRENT_SESSION_VERSION, CompactionCancelledError, CompactionConfigError, CompactionError, CompactionStateError, CompactorFailure, CountdownTimer, DEFAULT_BUILTIN_SELECTION_EXTRA_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_MAX_RESULT_SIZE_CHARS, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_THINKING_LEVEL, Diff, DynamicBorder, ENGINE_UNRESPONSIVE_MS, EditInputError, EditMatchError, EditTargetError, EditToolError, EngineSessionStats, EntryTypeReader, EventSourceError, ExtensionStartupError, FILE_KINDS, FILE_PATTERNS, FINISHED_TASK_RETENTION, FORKED_PACKAGE_NAMES, FORKED_PACKAGE_WORKSPACE_DIRS, FileToolAbortedError, ForkSourceIncompleteError, FramedSelector, GIT_LOCAL_ENV_VARS, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionError, GitProvisionTimeoutError, GitUnavailableError, HOST, HOST_NOTICE_TYPE, HostInputBridge, HostListenerFailures, INTERACTIVE_MODEL_REFRESH_TIMEOUT_MS, InteractiveEngineResourceReadinessError, IntercomPolicyError, JSON_RPC_ERROR_CODES, JsonTextChecker, LATEST_PROTOCOL_VERSION, LIVE_COMMAND_LIMIT_MESSAGE, LONG_LIVED_COMMANDS, LlamaServerError, LlamaServerRequestError, LlamaServerUnreachableError, MAX_INTERCOM_REACHABLE_GROUPS, MAX_PERSISTED_OUTPUT_BYTES, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, Minimatch, MissingSessionCwdError, NETWORK_TIMEOUT_MS, NON_SECRET_HTTP_HEADERS, NO_QUEUED_MESSAGES, NativeModuleUnavailableError, PERSISTED_OUTPUT_CLOSING_TAG, PERSISTED_OUTPUT_TAG, PERSISTED_OUTPUT_TRUNCATION_MARKER, PLAIN_SELECTOR_STYLE, POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS, PREVIEW_SIZE_BYTES, QueuedDeliveryRelay, QueuedDeliveryView, RESOURCE_TYPES, RESTART_CANCELLED_MESSAGE, ROW_INTENT_META, RawStdoutWriteError, SESSION_HISTORY_TOOL_NAME, STALE_EXTENSION_CONTEXT_MARKER, STALE_EXTENSION_CONTEXT_MESSAGE, STARTUP_DECISION_TYPED_TEXT_NOTICE, SUPPORTED_PROTOCOL_VERSIONS, Selector, SelectorState, SessionAppendRecovery, SessionIntercomPolicy, ShellTimeoutError, ShellToolError, SqliteSelectorConnection, Stop, SubscriptionChildUnavailableError, SubscriptionClosedError, SubscriptionConfigError, SubscriptionError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, SubscriptionSetupError, SubscriptionSubscriberUnavailableError, SubscriptionTimeoutError, TASK_MARKS, THINKING_LEVELS, TOOL_DEACTIVATION_ENTRY_TYPE, TOOL_RESULTS_SUBDIR, TYPEBOX_SUBPATHS, TaskCleanupAdmissionTimeoutError, TaskCleanupError, TaskEvictedError, TaskMessageError, TaskMessageTimeoutError, ToolDetachmentError, TrustDecisionSelector, VALID_THINKING_LEVELS, VERBATIM_COMPACTION_STRATEGY, VisualLinePreview, WriteSelectorError, abandonedToolResult, abortFailure, abortSymbol, activeToolExecutionStarts, addHistoryUsageToTotals, addUsageToTotals, allToolNames, announceBlueprintBuildWaiting, announceHistoryLoad, applyBashSessionEnvironment, applyExifOrientation, applySessionSummaryEntries, areExperimentalFeaturesEnabled, armToolAbortGraceTimer, assertForkSegments, assertSessionCwdExists, assertToolPairingInvariant, assignMissingToolCallIds, asyncScope, attachCleanupCause, attachGitCleanupFailure, attachJsonlLineReader, attachLineReader, attachSessionClaim, awaitBlueprintReady, backgroundTaskScope, beginQueuedMessageDelivery, belongsToSession, bindChatEpoch, bindChatReceipt, bindReleasedTaskOwner, bindSavedReadLines, bindSavedTaskOrigins, bindSavedTaskRowKey, bindTaskResumer, blueprintBuildPending, blueprintBuildSettled, blueprintBuildShared, blueprintBuildsRunning, blueprintBuildsSettled, boundedChatRecord, buildBoundaryText, buildBoundaryTextWithLocation, canWatchProcessUntilHostDies, cancelHeldInput, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, carryDroppedQueuedMessages, carryRowSource, chatEpoch, chatPosition, chatReceipt, chatReceiptWrite, chatRecordSavesSettled, claimPaneReporting, claimSession, classifiedWorkflowMetadata, cleanupWindowsSelfUpdateQuarantine, clearAssignmentIfClosed, clearFunctionList, clearLockHolder, clearLockHolderAsync, clearToolAbortGraceTimer, collectDeclaredDisplaySecrets, collectSecretsForMasking, combineMany, combineManyMut, combineUsage, compactTemplate, compactUrl, completeStartup, computeBoxDimensions, confinedIntercomChildGroup, containProcessTree, containProcessTreeAllowingBreakaway, conventionDirsForResource, convertBufferWithMarkit, convertFileWithMarkit, copyHostQuestionnaire, createBatchedCanonicalizePathAsync, createConversationRegion, createEventBus, createGitEnvironment, createOwnedAbortController, createSourceInfo, createStagedEventBus, createSyntheticSourceInfo, createTypeScriptSourceSpecifierTransform, createUsageTotals, createWakeDispatcher, customMessageExcludesContext, decodeChatOrder, decodeChatRecord, deduplicateDiagnostics, defaultModelPerProvider, defaultToolNamesFor, deferDeprecationWarnings, defineTool, deserializeSubscriptionError, deserializeToolDetachmentError, detectSupportedImageMimeTypeFromFile, displayTodoId, drainAgentMessageQueue, dropStoredNotes, earlierHeldInputs, emitProgress, encodeChatOrder, endQueuedMessageDelivery, entryLines, epochHasCreationTime, expandSearchUrl, experimentalToolSamplingProperty, extractHeaderSecrets, fListSymbol, fetchWithRetry, fieldTone, fileEpochOf, filterSearchOutputByLineRange, final, finalSymbol, finalValue, findBlueprintError, findCompactionError, findGitProvisionError, findLegacyWorkflowFiles, findLlamaServerError, findMissingSessionCwdIssue, findMissingSessionCwdIssueAsync, findPreferredAvailableModel, findProviderDefaultModel, findSubscriptionError, findTaskEvictedError, findTaskMessageError, findToolDetachmentError, finishHeldInput, firstChatOrders, flushRawStdout, flushSymbol, flushable, forkRunSegments, forkScope, forkStoreRelation, forkedPackageExportAliases, formatAppendRecoveryNotice, formatCodexProviderError, formatMissingSessionCwdPrompt, formatNoApiKeyFoundMessage, formatNoModelSelectedMessage, formatNoModelsAvailableMessage, formatReadLineRange, formatSelectedLines, formatSize, formatTimeoutSeconds, formatTodoId, formatTokenCount, formatToolCallWithArgs, formatUnresolvedModelMessage, frozenClocks, getAllBuiltinPackageLocations, getBuiltinPackageLocations, getBuiltinPackagePaths, getDefaultCacheRetention, getDefaultSessionDir, getDefaultSessionDirAsync, getDefaultSessionDirPath, getEngineSessionStats, getErrnoCode, getFinalValue, getFunctionList, getHostQuestionnaire, getLockPath, getMandatoryBuiltinExtensionPaths, getManifestFromPackageJson, getManyValues, getMissingSessionCwdOptions, getPiUserAgent, getProviderLoginHelp, getResourcePathKey, getResourcePathKeyAsync, getSyntheticPathSource, getTextOutput, getTodoPath, getTodoStatus, getTodoTitle, getTodosDir, getTodosDirLabel, getToolExecutionStartedAt, getToolListError, handOverBuildTimings, handlePackageCommandParseOutcome, hasHeldInput, hasHistoryLoadObserver, hasNativeProcessHold, heldInputView, historySnapshotFor, holdDeprecationWarnings, holdProcessDescendants, holdProcessDescendantsResult, holdToolAbortGraceWhenObserved, holdToolsUntilBuilt, holdToolsUntilOwnerBuilt, holderRuns, hostInputError, hostNoticeForEvent, inheritForkScope, interactiveQuitOf, invalidArgText, invalidateNativeSearchCache, isAgentSessionBusyError, isBlueprintBuildFailedError, isBlueprintError, isBlueprintInvalidError, isBlueprintStepFailedError, isBlueprintStepTimedOutError, isBlueprintUsesUnsupportedError, isClassifiedWorkflowSession, isCodexTokenInvalidationError, isCompactionCancelledError, isCompactionConfigError, isCompactionError, isCompactionStateError, isCompactorFailure, isEditInputError, isEditMatchError, isEditTargetError, isEditToolError, isEventSourceError, isExtensionLoadError, isExtensionStartupFailure, isFileToolAbortedError, isFinalValue, isFlushable, isFunctionList, isGitProvisionConfigError, isGitProvisionError, isGitProvisionTimeoutError, isGitUnavailableError, isInstallTelemetryEnabled, isInteractiveEngineResourceReadinessError, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isLlamaServerError, isLlamaServerRequestError, isLlamaServerUnreachableError, isManagedToolDownloadError, isManagedToolError, isManagedToolTimeoutError, isMandatoryRuntimeTool, isMany, isMissingSessionCwdError, isObject, isPathInside, isPlainObject$1 as isPlainObject, isReadResourceSelector, isReadableUrlPath, isRetryableCompactionError, isRetryableGitProvisionError, isRetryableLlamaServerError, isRetryableManagedToolError, isRetryableSubscriptionError, isRetryableTaskError, isRetryableTaskMessageError, isSensitiveKeyNameForMasking, isSerializedMissingSessionCwdError, isShellTimeoutError, isShellToolError, isSingleGenericAbortTextContent, isStaleExtensionContextError, isStdoutTakenOver, isStop, isSubscriptionChildUnavailableError, isSubscriptionClosedError, isSubscriptionConfigError, isSubscriptionError, isSubscriptionEventError, isSubscriptionHandlerError, isSubscriptionRecordError, isSubscriptionSetupError, isSubscriptionSubscriberUnavailableError, isSubscriptionTimeoutError, isSyntheticPath, isTaskCleanupAdmissionTimeoutError, isTaskCleanupError, isTaskEvictedError, isTaskMessageError, isTaskMessageTimeoutError, isTodoClosed, isToolDeactivationEntryData, isToolDetachmentError, isToolModifier, isTransientExtensionStartupFailure, isTrustDecision, isTrustedMandatoryRuntimeTool, isUnknownModel, isValidBudgetMs, isValidThinkingLevel, isWindowsInstallDirectoryLockError, isWriteSelectorError, joinForkSegments, keepDroppedQueuedMessages, keepsDroppedQueuedMessages, keptTaskHint, keptTaskId, leadingAndTrailingWs, leadingWs, legacyFileEpochOf, legacyWorkflowFilePaths, legacyWorkflowFilePatterns, legacyWorkflowSection, linkPath, literalPathLike, loadConfig, loadNativeSearchBinding, loadShownDeprecationNotices, loadedConfig, locateForkSeq, lockNamesLocalHolder, lockShared, longestCommonPrefix, longestCommonSuffix, many, manySymbol, markEventLoopShutdown, markEventLoopStartupComplete, markTrustedMandatoryRuntimeExtension, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, mergeSessionTrustDecisions, minimatch, modelCallUsage, nativeForkReader, nativeModuleProblem, nativeModuleUnavailable, noOpUIContext, none, normalizeDisplayText, normalizeInterruptAbortMessage, normalizeMany, normalizePathLikeInput, normalizeTodoId, normalizeWaitPolicy, noteQueueUpdateDeliveries, noteQueuedMessagesDropped, noteRowSource, noteSavedSeq, noteSnapshotGeneration, noteUserMessageOrigin, notifySessionProviderRequestDispatched, observeArchiveLoad, observeHistoryLoads, observeReferenceCut, observeToolExecutionTiming, omitLegacyThinkingSections, onBlueprintBuildFinished, onBlueprintBuildWaiting, onSessionProviderRequestDispatched, operationSignal, originalHistoryNote, outputExtensionLoadErrors, parseJsonRpcMessage, parsePackageCommand, parseSerializedCompactionError, parseSlashCommand, parseTranscriptFrameLayout, pendingProjectResourcesTrusted, placeTranscriptFrame, postgresAppendConnectionFailure, prefixForkSegments, prepareLockTakeover, prepareSessionClaim, prepareWaitableToolInput, priorityHoldCounts, processTreeEnded, projectTrustHandlerRegistered, projectTrustWarningVisible, projectTrustedBeforeExtensions, providerOfModelReference, quarantineWindowsNativeDependencies, queueUpdateDeliveries, queuedMessagesUnderWay, queuedReceiptsUnderWay, queuedTextsUnderWay, quitAsInteractiveApp, raceWithAbortSignal, rawStdoutWriteFailed, readPiManifestFile, readTaskOutputTail, receiveChatReceipt, recordLockHolder, recordLockHolderAsync, recordStartupThinkingLevel, redactAuthorizationUrlForDisplay, redactCredentials, redactOAuthErrorText, redactOAuthErrorTextCapped, redactUrlForDisplay, redactUrlForTransportDisplay, redactWwwAuthenticateHeader, referenceMetadataRead, refreshConfig, registerArchiveLoad, registerCanonicalEventBus, registerForkScope, registerHeldInput, registerHistorySnapshot, registerStartupRollback, rehydrateBlueprintError, rehydrateCompactionError, rehydrateEditToolError, rehydrateGitProvisionError, rehydrateLlamaServerError, rehydrateMissingSessionCwdError, rehydrateShellToolError, rehydrateTaskCleanupError, rehydrateTaskEvictedError, rehydrateTaskMessageError, rehydrateWriteSelectorError, releaseDeprecationWarnings, releasePaneReporting, releaseRetiredPaneReporting, releaseToolAbortGraceTimers, releaseTurnPause, releaseUnownedPaneRegistration, removePrefix, removeSuffix, removedProviderMessage, renderBlueprintContext, renderBorderedBox, renderToolPath, repairCollapsedScheme, replacePrefix, replaceSuffix, replaceTabs, replacementAbortContent, reportContained, reportPaneActivity, require_applyReviver, require_constants, require_debug, require_errors, require_identifiers, require_identity, require_ignore, require_line_counter, require_parse_options, require_parse_url, require_resolve_end, require_resolve_props, require_sha256, require_stringifyComment, require_stringifyNumber, require_util_contains_newline, resolveDecisionDeadlineMs, resolvePhysicalPath, resolvePhysicalPathAsync, resolveSchemaRef, resourceInternals, restoreStdout, retirePaneReporting, retryStatusUpdate, rollbackStartup, rowSource, rowTone, safeTrustChoiceIndex, sanitizeMcpServers, sanitizeOpenAIResponsesPayload, saveChatRecord, savedConversationThinkingLevel, savedReadLines, savedRowKey, savedRowSpan, savedSeqOf, savedTaskRowKey, savedTaskRows, scopedBackgroundTasks, scrubFetchError, scrubPreCompactionAssistantUsage, scrubUnknownErrorData, searchPosition, segment, segmentLength, selectExactReadRanges, selectReadRanges, selectorHintEntries, sentinelsToAppend, serializeBlueprintError, serializeCompactionError, serializeConversationForCompaction, serializeFileToolError, serializeJsonLine, serializeMissingSessionCwdError, serializeRetainedTranscript, serializeSessionMutation, serializeSubscriptionError, sessionIntercomFacade, sessionTasks, sessionWaitsToRetry, setDeprecationWarningSink, setFunctionList, setMarkitDiagnosticSink, setSharedHistorySwitchHost, settingsFileNoticeKey, settingsInternals, settleTurnPause, sha256Hex, shareBlueprintBuild, sharedClockNow, sharedHistorySwitchHost, sharedWakeDispatcher, shortenPath, shouldRenderEngineDiagnosticAsChatError, shouldRunFirstTimeSetup, sleep, sliceHead, sliceTail, snapshotBashSessionEnvironment, sortTodos, spanElapsedMs, spawnContainedProcess, spawnHostProcess, splitLineRangeSelector, splitPathLikeGlob, splitReadLineSelector, splitTodosByAssignment, sqliteSessionResumeArgs, startEventLoopMonitor, startShellDeadline, startToolTimer, startupCleanupFailureMessage, startupProjectTrust, stop, stopBlueprintBuilds, stopErrorSymbol, stopWaiting, storedEntryNotes, storedRows, str, stringEntries, stripFenceMarkers, stripUrlUserinfoAndHash, styleFieldTone, summarizeSession, takeOverDeadHolder, takeOverDeadHolderAsync, takeOverStdout, takeQueuedDeliveryChange, takeQueuedMessagesDroppedAt, taskMark, taskOutcomeStatus, taskOutputText, taskResumer, taskSessionKey, taskStoppedForResume, themeSelectorStyle, thisProcess, timestamp, toError, toMany, toolAbortGraceMs, toolTimerText, trackChatRecordSave, trailingWs, transcriptHeaderLines, transcriptLayoutOf, truncateHead, truncateLine, truncateMiddle, truncateTail, truncateToVisualLines, uniquifyToolCallIds, usageCostBreakdown, userMessageOrigin, validQuestionnaire, validateGuidanceFields, validateIntercomSessionOptions, validateTimeoutOverride, validateTodoId, waitForEventLoopMonitorReady, waitForRawStdoutBackpressure, warnDeprecation, watchFirstProjectTrustHandler, watchProcessUntilHostDies, watchReferenceCut, whenAborted, windowsTemporaryFiles, withCleanup, withFileMutationQueue, withInstallLock, withLegacyPackageNames, withProgress, withQueuedDeliveryChange, withResolvingFileMutationQueue, withToolAbortGrace, withinDecisionDeadline, writeOutputFile, writeRawStdout, writeRawStdoutControl, writeRawStdoutOnce, yieldToEventLoop, yieldToEventLoopIfSlow, yieldToTimerTurn, yieldTurn };
|
|
20232
20146
|
|
|
20233
|
-
//# sourceMappingURL=startup-0-0-
|
|
20147
|
+
//# sourceMappingURL=startup-0-0-ERMIDHQT.js.map
|
|
20234
20148
|
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
20235
20149
|
// demand that fails in a process an in-place update left running says to restart.
|
|
20236
20150
|
function __atomicOnDemandFailed(error, feature) {
|
|
20237
20151
|
return (async () => {
|
|
20238
20152
|
const root = new URL("../", import.meta.url);
|
|
20239
20153
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
20240
|
-
const key = `${root.href}#0.10.
|
|
20154
|
+
const key = `${root.href}#0.10.16-alpha.1`;
|
|
20241
20155
|
let release = releases.get(key);
|
|
20242
20156
|
if (release === undefined) {
|
|
20243
20157
|
const current = (async () => {
|
|
@@ -20265,7 +20179,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
20265
20179
|
} catch {
|
|
20266
20180
|
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
20267
20181
|
}
|
|
20268
|
-
const updatedTo = typeof installed === "string" && installed !== "0.10.
|
|
20182
|
+
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;
|
|
20269
20183
|
if (updatedTo === undefined) throw error;
|
|
20270
20184
|
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
20271
20185
|
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|