@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,21 +1,23 @@
|
|
|
1
1
|
import { __commonJSMin, __name, __require, __toESM } from "./rolldown-runtime-BGM3D5V3.js";
|
|
2
2
|
import { APP_NAME, BUILTIN_PACKAGE_DIR_NAMES, CONFIG_DIR_NAME, ENV_AGENT_DIR, ENV_DEBUG, ENV_OFFLINE, ENV_PACKAGE_DIR, ENV_SELF_UPDATE_COMMAND, ENV_SESSION_DIR, ENV_SHARE_VIEWER_URL, ENV_STDIN_TIMEOUT_MS, ENV_TELEMETRY, INSTALLED_EXTENSION_ENTRIES, SOURCE_EXTENSION_ENTRIES, VERSION, createChildProcessEnvironment, createModuleRequire, findHelperExecutableAsync, getAgentDir, getAgentDirs, getBinDir, getEnvValue, getPackageDir, helperLaunchAsync, isBunBinary, isBundledBuild, isChildProcessExitStatusUnknownError, missingHelperOptions, resolvePath, stripBom, waitForChildProcess } from "./p0-cli-BB45ZQY6.js";
|
|
3
|
-
import { BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, CountdownTimer, Diff, DynamicBorder, EventSourceError, FORKED_PACKAGE_NAMES, FileToolAbortedError, FramedSelector, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionTimeoutError, GitUnavailableError, JSON_RPC_ERROR_CODES, LlamaServerRequestError, LlamaServerUnreachableError, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, ROW_INTENT_META, STALE_EXTENSION_CONTEXT_MESSAGE, SUPPORTED_PROTOCOL_VERSIONS, Stop, SubscriptionClosedError, SubscriptionConfigError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, TASK_MARKS, TaskCleanupError, TaskEvictedError, ToolDetachmentError, VALID_THINKING_LEVELS, abortSymbol, applyExifOrientation, applySessionSummaryEntries, asyncScope, attachCleanupCause as attachCleanupCause$1, attachGitCleanupFailure, canWatchProcessUntilHostDies, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, combineUsage, compactTemplate, compactUrl, createGitEnvironment, createOwnedAbortController, decodeChatOrder, decodeChatRecord, defaultToolNamesFor, deserializeToolDetachmentError, encodeChatOrder, fetchWithRetry, fieldTone, firstChatOrders, flushable, formatSize, formatTodoId, formatTokenCount, getBuiltinPackageLocations, getDefaultCacheRetention, getDefaultSessionDirPath, getFinalValue, getFunctionList, getManyValues, getPiUserAgent, getProviderLoginHelp, getResourcePathKeyAsync, getTodoStatus, getTodoTitle, getToolListError, holdProcessDescendants, isEventSourceError, isExtensionStartupFailure, isFinalValue, isFlushable, isFunctionList, isGitProvisionError, isGitUnavailableError, isInstallTelemetryEnabled, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isManagedToolError, isMandatoryRuntimeTool, isMany, isObject, isPathInside, isStop, isSyntheticPath, isTodoClosed, isTrustedMandatoryRuntimeTool, isValidThinkingLevel, joinForkSegments, leadingAndTrailingWs, leadingWs, longestCommonPrefix, longestCommonSuffix, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, none, normalizeDisplayText, normalizeTodoId, parseTranscriptFrameLayout, registerCanonicalEventBus, removePrefix, removeSuffix, renderToolPath, replacePrefix, replaceSuffix, replaceTabs, reportContained, require_constants, require_debug, require_identity, require_ignore, require_parse_url, require_sha256, require_stringifyNumber, require_util_contains_newline, rowTone, segment, segmentLength, setFunctionList, sharedWakeDispatcher, sleep as sleep$1, spanElapsedMs, spawnHostProcess, splitTodosByAssignment, stop, str as str$1, stripFenceMarkers, styleFieldTone, summarizeSession, toError, trailingWs, uniquifyToolCallIds, validQuestionnaire, watchProcessUntilHostDies, withCleanup, withLegacyPackageNames, yieldToEventLoop, yieldTurn } from "./startup-0-0-
|
|
3
|
+
import { BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, CountdownTimer, Diff, DynamicBorder, EventSourceError, FORKED_PACKAGE_NAMES, FileToolAbortedError, FramedSelector, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionTimeoutError, GitUnavailableError, JSON_RPC_ERROR_CODES, LlamaServerRequestError, LlamaServerUnreachableError, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, ROW_INTENT_META, STALE_EXTENSION_CONTEXT_MESSAGE, SUPPORTED_PROTOCOL_VERSIONS, Stop, SubscriptionClosedError, SubscriptionConfigError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, TASK_MARKS, TaskCleanupError, TaskEvictedError, ToolDetachmentError, VALID_THINKING_LEVELS, abortSymbol, applyExifOrientation, applySessionSummaryEntries, asyncScope, attachCleanupCause as attachCleanupCause$1, attachGitCleanupFailure, canWatchProcessUntilHostDies, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, clearLockHolderAsync, combineUsage, compactTemplate, compactUrl, createGitEnvironment, createOwnedAbortController, decodeChatOrder, decodeChatRecord, defaultToolNamesFor, deserializeToolDetachmentError, encodeChatOrder, fetchWithRetry, fieldTone, firstChatOrders, flushable, formatSize, formatTodoId, formatTokenCount, getBuiltinPackageLocations, getDefaultCacheRetention, getDefaultSessionDirPath, getFinalValue, getFunctionList, getManyValues, getPiUserAgent, getProviderLoginHelp, getResourcePathKeyAsync, getTodoStatus, getTodoTitle, getToolListError, holdProcessDescendants, isEventSourceError, isExtensionStartupFailure, isFinalValue, isFlushable, isFunctionList, isGitProvisionError, isGitUnavailableError, isInstallTelemetryEnabled, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isManagedToolError, isMandatoryRuntimeTool, isMany, isObject, isPathInside, isStop, isSyntheticPath, isTodoClosed, isTrustedMandatoryRuntimeTool, isValidThinkingLevel, joinForkSegments, leadingAndTrailingWs, leadingWs, lockNamesLocalHolder, lockShared, longestCommonPrefix, longestCommonSuffix, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, none, normalizeDisplayText, normalizeTodoId, parseTranscriptFrameLayout, recordLockHolderAsync, registerCanonicalEventBus, removePrefix, removeSuffix, renderToolPath, replacePrefix, replaceSuffix, replaceTabs, reportContained, require_constants, require_debug, require_identity, require_ignore, require_parse_url, require_sha256, require_stringifyNumber, require_util_contains_newline, rowTone, segment, segmentLength, setFunctionList, sharedClockNow, sharedWakeDispatcher, sleep as sleep$1, spanElapsedMs, spawnHostProcess, splitTodosByAssignment, stop, str as str$1, stripFenceMarkers, styleFieldTone, summarizeSession, takeOverDeadHolderAsync, toError, trailingWs, uniquifyToolCallIds, validQuestionnaire, watchProcessUntilHostDies, withCleanup, withLegacyPackageNames, yieldToEventLoop, yieldTurn } from "./startup-0-0-ERMIDHQT.js";
|
|
4
4
|
import { CodeHighlighter, OVERLAY_ACTIVE_ROW_MARKER, getLanguageFromPath, graphemeAt, highlightCode, keyHint, loadPhoton, navActionText, navFirstKeyText, parenthesizedKeyHint, rawKeyHint, renderNavHintLine, singleLineDisplayText, terminalDisplayCursor, terminalDisplayText, theme } from "./p2-shell-main-B2WIALFD.js";
|
|
5
|
-
import { failureDebugFields, findInCauseChain, hasErrorIdentity, reportDebugAsync, serializeErrorCause } from "./p1b-elig-
|
|
5
|
+
import { failureDebugFields, findInCauseChain, hasErrorIdentity, lockHolderAsync, releaseLock, removeLeftoverHolderFilesAsync, reportDebugAsync, serializeErrorCause, takeTakeoverMutexAsync } from "./p1b-elig-BY2G5BUE.js";
|
|
6
6
|
import { windowsPowerShellEnvironment } from "./p1-elig-shell-WWRO3L2R.js";
|
|
7
7
|
import { parseSerializedDecisionError } from "./settings-startup-HXQLSUWM.js";
|
|
8
8
|
import { SETTINGS_DEFAULTS } from "./p2-common-YLSYXMDQ.js";
|
|
9
9
|
import { interactiveEngineStartupEnv } from "./p1a-prewarm-XIU57JHF.js";
|
|
10
|
-
import { access, lstat, open, readFile, readdir, rename, rm, stat, unlink } from "node:fs/promises";
|
|
10
|
+
import { access, lstat, mkdir, open, readFile, readdir, rename, rm, rmdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
11
11
|
import { existsSync, readFileSync, readdirSync, statSync } from "fs";
|
|
12
12
|
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "path";
|
|
13
13
|
import { constants as constants$1 } from "node:os";
|
|
14
14
|
import { basename as basename$1, dirname as dirname$1, extname, isAbsolute as isAbsolute$1, join as join$1, relative as relative$1, resolve as resolve$1, sep as sep$1 } from "node:path";
|
|
15
15
|
import { execFile, spawn, spawnSync } from "node:child_process";
|
|
16
|
+
import { createTimeoutSignal, setLongTimeout, setWallTimeoutAt, sleepFor } from "../__atomic_timers/index.js";
|
|
16
17
|
import { execFile as execFile$1, spawnSync as spawnSync$1 } from "child_process";
|
|
17
18
|
import { arch, hostname as hostname$1, platform } from "os";
|
|
18
19
|
import { pathExists } from "../utils/path-exists.js";
|
|
20
|
+
import * as fs from "node:fs";
|
|
19
21
|
import { constants as constants$2, readFileSync as readFileSync$1, readdirSync as readdirSync$1, statSync as statSync$1 } from "node:fs";
|
|
20
22
|
import { CACHE_WARMING_MAX_AGE_MS, CACHE_WARMING_MAX_IDLE_AGE_MS, GitHubCopilotStreamEndedEarlyError, OAuthRefreshRejectedError, Type, evaluateCacheWarming, findGitHubCopilotError, findTlsCertificateRefusal, getCacheWarmingDelayMs, getCacheWarmingRequestOptions, getCurrentTools, getPromptCacheTtlMs as getPromptCacheTtlMs$1, getTlsCertificateRefusal, isCacheWarmingReplayable, isModelType, isOAuthRefreshRejectedError, isPermanentRefreshRejection, lazyStream, normalizeProviderId, parseOAuthErrorBody, validateToolArguments } from "@bastani/atomic-ai";
|
|
21
23
|
import { Container, Input, Key, Markdown, Spacer, Text, fuzzyFilter, getCapabilities, getKeybindings, getSelectPageIndex, matchesKey, setImageTranscoder, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@bastani/atomic-tui";
|
|
@@ -31,7 +33,9 @@ import { setTimeout as setTimeout$1 } from "timers/promises";
|
|
|
31
33
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
32
34
|
import { memoizeAsync } from "../utils/memoize-async.js";
|
|
33
35
|
import { refreshGitHubCopilotAccountModelLists } from "@bastani/atomic-ai/providers/github-copilot";
|
|
34
|
-
import {
|
|
36
|
+
import { isProviderQuotaExhaustionText, responsesErrorKind } from "@bastani/atomic-ai/utils/responses-errors/codes";
|
|
37
|
+
import { resolveAzureBaseUrl } from "@bastani/atomic-ai/api/azure-openai-config";
|
|
38
|
+
import { getAtomicEnvValue, getProviderEnvValue } from "@bastani/atomic-ai/utils/provider-env";
|
|
35
39
|
import { Buffer as Buffer$1, constants as constants$3 } from "node:buffer";
|
|
36
40
|
import { StringDecoder } from "node:string_decoder";
|
|
37
41
|
import { isProxy } from "node:util/types";
|
|
@@ -45,7 +49,6 @@ import { queueSqliteSchemaSetup } from "../core/storage/sqlite-open-batch.js";
|
|
|
45
49
|
import { sequenceRunner } from "../core/storage/statement-sequence.js";
|
|
46
50
|
import { TextDecoder as TextDecoder$1 } from "util";
|
|
47
51
|
import { ModelThinkingLevelSchema } from "@bastani/atomic-ai/providers/model-schema";
|
|
48
|
-
import { getAtomicEnvValue } from "@bastani/atomic-ai/utils/provider-env";
|
|
49
52
|
import { isProducedByModel } from "@bastani/atomic-ai/api/transform-messages";
|
|
50
53
|
// dist/cli/args.js
|
|
51
54
|
/**
|
|
@@ -832,7 +835,7 @@ function describeFailure(error) {
|
|
|
832
835
|
async function requestManagedTool(request, read) {
|
|
833
836
|
const { tool, phase, url, timeoutMs } = request;
|
|
834
837
|
const startedAt = Date.now();
|
|
835
|
-
const timeout =
|
|
838
|
+
const { signal: timeout, clear } = createTimeoutSignal(timeoutMs);
|
|
836
839
|
try {
|
|
837
840
|
return await read(await fetchWithRetry(url, {
|
|
838
841
|
...request.init,
|
|
@@ -853,6 +856,8 @@ async function requestManagedTool(request, read) {
|
|
|
853
856
|
url,
|
|
854
857
|
detail: describeFailure(error)
|
|
855
858
|
}, { cause: error });
|
|
859
|
+
} finally {
|
|
860
|
+
clear();
|
|
856
861
|
}
|
|
857
862
|
}
|
|
858
863
|
async function getLatestVersion(tool) {
|
|
@@ -2322,7 +2327,7 @@ async function acquireGitInstallLock(target, layout, signal, emit) {
|
|
|
2322
2327
|
message: "Another Atomic process is installing git. Waiting for it to finish..."
|
|
2323
2328
|
}, "starts");
|
|
2324
2329
|
}
|
|
2325
|
-
await
|
|
2330
|
+
await sleepFor(gitProvisionSettings.lockPollMs, { signal });
|
|
2326
2331
|
}
|
|
2327
2332
|
}
|
|
2328
2333
|
function isProcessAlive(pid) {
|
|
@@ -2359,7 +2364,7 @@ async function removeAbandonedStagingDirectories(binDir) {
|
|
|
2359
2364
|
}
|
|
2360
2365
|
async function downloadGitArchive(target, signal) {
|
|
2361
2366
|
const startedAt = Date.now();
|
|
2362
|
-
const timeout =
|
|
2367
|
+
const { signal: timeout, clear } = createTimeoutSignal(gitProvisionSettings.downloadTimeoutMs);
|
|
2363
2368
|
try {
|
|
2364
2369
|
const response = await fetchWithRetry(target.url, {
|
|
2365
2370
|
headers: { "User-Agent": getPiUserAgent(VERSION) },
|
|
@@ -2388,6 +2393,8 @@ async function downloadGitArchive(target, signal) {
|
|
|
2388
2393
|
url: target.url,
|
|
2389
2394
|
...await hostPlatformAsync()
|
|
2390
2395
|
}, { cause: error });
|
|
2396
|
+
} finally {
|
|
2397
|
+
clear();
|
|
2391
2398
|
}
|
|
2392
2399
|
}
|
|
2393
2400
|
function firstLine$2(text) {
|
|
@@ -2397,7 +2404,7 @@ __name(firstLine$2, "firstLine");
|
|
|
2397
2404
|
/** Run a provisioning step; cancellation rejects with `signal.reason`, the time limit with a typed timeout. */
|
|
2398
2405
|
async function runProvisionStep(command, args, options) {
|
|
2399
2406
|
const startedAt = Date.now();
|
|
2400
|
-
const timeout =
|
|
2407
|
+
const { signal: timeout, clear } = createTimeoutSignal(options.timeoutMs);
|
|
2401
2408
|
const timedOut = async (cause) => {
|
|
2402
2409
|
throw new GitProvisionTimeoutError({
|
|
2403
2410
|
phase: options.phase,
|
|
@@ -2406,49 +2413,53 @@ async function runProvisionStep(command, args, options) {
|
|
|
2406
2413
|
...await installCommandFieldAsync()
|
|
2407
2414
|
}, { cause });
|
|
2408
2415
|
};
|
|
2409
|
-
let launch;
|
|
2410
2416
|
try {
|
|
2411
|
-
launch
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2417
|
+
let launch;
|
|
2418
|
+
try {
|
|
2419
|
+
launch = await helperLaunchAsync(command, {
|
|
2420
|
+
env: options.env,
|
|
2421
|
+
signal: AbortSignal.any([options.signal, timeout])
|
|
2422
|
+
});
|
|
2423
|
+
} catch (error) {
|
|
2424
|
+
if (options.signal.aborted) throw options.signal.reason;
|
|
2425
|
+
if (timeout.aborted) return timedOut(error);
|
|
2426
|
+
throw error;
|
|
2427
|
+
}
|
|
2416
2428
|
if (options.signal.aborted) throw options.signal.reason;
|
|
2417
|
-
if (timeout.aborted) return timedOut(
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2429
|
+
if (timeout.aborted) return timedOut(timeout.reason);
|
|
2430
|
+
return await new Promise((resolvePromise, rejectPromise) => {
|
|
2431
|
+
execFile$1(launch.file, [...args], {
|
|
2432
|
+
env: options.env,
|
|
2433
|
+
maxBuffer: 16777216,
|
|
2434
|
+
signal: AbortSignal.any([options.signal, timeout]),
|
|
2435
|
+
...missingHelperOptions(launch)
|
|
2436
|
+
}, (error, stdout, stderr) => {
|
|
2437
|
+
if (options.signal.aborted) {
|
|
2438
|
+
rejectPromise(options.signal.reason);
|
|
2439
|
+
return;
|
|
2440
|
+
}
|
|
2441
|
+
if (timeout.aborted) {
|
|
2442
|
+
timedOut(error).catch(rejectPromise);
|
|
2443
|
+
return;
|
|
2444
|
+
}
|
|
2445
|
+
if (error === null) {
|
|
2446
|
+
resolvePromise({
|
|
2447
|
+
ok: true,
|
|
2448
|
+
stdout
|
|
2449
|
+
});
|
|
2450
|
+
return;
|
|
2451
|
+
}
|
|
2452
|
+
const status = typeof error.code === "number" ? `exited with status ${error.code}` : String(error.code);
|
|
2453
|
+
const reason = stderr === "" ? "" : `: ${firstLine$2(stderr)}`;
|
|
2438
2454
|
resolvePromise({
|
|
2439
|
-
ok:
|
|
2440
|
-
|
|
2455
|
+
ok: false,
|
|
2456
|
+
detail: `${command.split(/[\\/]/).pop()} ${status}${reason}`
|
|
2441
2457
|
});
|
|
2442
|
-
return;
|
|
2443
|
-
}
|
|
2444
|
-
const status = typeof error.code === "number" ? `exited with status ${error.code}` : String(error.code);
|
|
2445
|
-
const reason = stderr === "" ? "" : `: ${firstLine$2(stderr)}`;
|
|
2446
|
-
resolvePromise({
|
|
2447
|
-
ok: false,
|
|
2448
|
-
detail: `${command.split(/[\\/]/).pop()} ${status}${reason}`
|
|
2449
2458
|
});
|
|
2450
2459
|
});
|
|
2451
|
-
}
|
|
2460
|
+
} finally {
|
|
2461
|
+
clear();
|
|
2462
|
+
}
|
|
2452
2463
|
}
|
|
2453
2464
|
async function gitTarCommand() {
|
|
2454
2465
|
return platform() === "win32" ? await getWindowsTarCommand() : "tar";
|
|
@@ -4013,6 +4024,248 @@ var NestedGitignore = class NestedGitignore {
|
|
|
4013
4024
|
return false;
|
|
4014
4025
|
}
|
|
4015
4026
|
};
|
|
4027
|
+
// dist/core/worktree-snapshot/shared-lock.js
|
|
4028
|
+
const worktreeLockProgress = asyncScope();
|
|
4029
|
+
/** Sends lock waits to the resume UI rather than writing over it on stderr. */
|
|
4030
|
+
function withWorktreeLockProgress(onProgress, run) {
|
|
4031
|
+
return onProgress === void 0 ? run() : worktreeLockProgress.run(onProgress, run);
|
|
4032
|
+
}
|
|
4033
|
+
function reportWorktreeLockProgress(message) {
|
|
4034
|
+
(worktreeLockProgress.getStore() ?? process.emitWarning)(message);
|
|
4035
|
+
}
|
|
4036
|
+
/**
|
|
4037
|
+
* Takes a shared-clock directory lock and records its holder. Publishing an acquisition and both kinds of takeover
|
|
4038
|
+
* use the same mutex: an expired-lock remover can't unlink a new lock created after its last stat. Callers can use
|
|
4039
|
+
* `takeOverDeadHolderAsync` after `ELOCKED` to reclaim a lock with a dead local owner without waiting for its mtime.
|
|
4040
|
+
*/
|
|
4041
|
+
async function lockSharedWithHolder(file, options) {
|
|
4042
|
+
const lockPath = options.lockfilePath ?? `${resolve$1(file)}.lock`;
|
|
4043
|
+
const directory = dirname$1(lockPath);
|
|
4044
|
+
const mutex = await takeTakeoverMutexAsync(lockPath, 0);
|
|
4045
|
+
if (mutex === void 0) {
|
|
4046
|
+
await access(directory, constants$2.W_OK);
|
|
4047
|
+
throw Object.assign(/* @__PURE__ */ new Error("Lock is changing hands"), { code: "ELOCKED" });
|
|
4048
|
+
}
|
|
4049
|
+
let compromised = false;
|
|
4050
|
+
let published = false;
|
|
4051
|
+
let generation;
|
|
4052
|
+
let unlock;
|
|
4053
|
+
const releaseDirectory = async (candidate) => {
|
|
4054
|
+
if (published && (generation === void 0 || await lockHolderAsync(candidate) !== generation)) return;
|
|
4055
|
+
await rmdir(candidate);
|
|
4056
|
+
};
|
|
4057
|
+
try {
|
|
4058
|
+
unlock = await lockShared(file, {
|
|
4059
|
+
...options,
|
|
4060
|
+
onCompromised: (error) => {
|
|
4061
|
+
compromised = true;
|
|
4062
|
+
options.onCompromised?.(error);
|
|
4063
|
+
}
|
|
4064
|
+
}, {
|
|
4065
|
+
stale: async (candidate) => {
|
|
4066
|
+
if (await lockNamesLocalHolder(candidate)) return;
|
|
4067
|
+
const now = await sharedClockNow(directory);
|
|
4068
|
+
try {
|
|
4069
|
+
if (now - (await stat(candidate)).mtimeMs <= options.stale || !await mutex.owned()) return;
|
|
4070
|
+
await rmdir(candidate);
|
|
4071
|
+
} catch (error) {
|
|
4072
|
+
if (error.code !== "ENOENT") throw error;
|
|
4073
|
+
}
|
|
4074
|
+
await removeLeftoverHolderFilesAsync(candidate);
|
|
4075
|
+
},
|
|
4076
|
+
release: releaseDirectory
|
|
4077
|
+
});
|
|
4078
|
+
generation = await recordLockHolderAsync(lockPath);
|
|
4079
|
+
published = true;
|
|
4080
|
+
} finally {
|
|
4081
|
+
await mutex.release();
|
|
4082
|
+
}
|
|
4083
|
+
return async () => {
|
|
4084
|
+
const releaseMutex = await takeTakeoverMutexAsync(lockPath);
|
|
4085
|
+
try {
|
|
4086
|
+
await unlock();
|
|
4087
|
+
} finally {
|
|
4088
|
+
if (releaseMutex !== void 0) try {
|
|
4089
|
+
if (compromised) await releaseDirectory(lockPath).catch(() => {});
|
|
4090
|
+
if (generation !== void 0) await clearLockHolderAsync(lockPath, generation);
|
|
4091
|
+
} finally {
|
|
4092
|
+
await releaseMutex.release();
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
};
|
|
4096
|
+
}
|
|
4097
|
+
// dist/core/resume/blueprint/ledger.js
|
|
4098
|
+
const DIGEST_VERSION = "atomic-blueprint-v1";
|
|
4099
|
+
function sha256(parts) {
|
|
4100
|
+
const hash = createHash("sha256");
|
|
4101
|
+
for (const part of parts) hash.update(`${part.length}:`).update(part);
|
|
4102
|
+
return hash.digest("hex");
|
|
4103
|
+
}
|
|
4104
|
+
/** The digest of a blueprint file's inputs: the file's text and, for a workspace, where it sits. */
|
|
4105
|
+
function blueprintDigest(directory, source, extra = "") {
|
|
4106
|
+
return sha256([
|
|
4107
|
+
DIGEST_VERSION,
|
|
4108
|
+
directory,
|
|
4109
|
+
source,
|
|
4110
|
+
extra
|
|
4111
|
+
]);
|
|
4112
|
+
}
|
|
4113
|
+
/** The ledger key of the workspace at `directory` (`.` for the root) of the repository `identity`. */
|
|
4114
|
+
function workspaceKey(identity, directory) {
|
|
4115
|
+
return `${repositoryKey(identity)}:${directory === "" ? "." : directory}`;
|
|
4116
|
+
}
|
|
4117
|
+
/** The prefix of the ledger keys of every workspace of the repository `identity`. */
|
|
4118
|
+
function repositoryKey(identity) {
|
|
4119
|
+
return sha256([identity]).slice(0, 16);
|
|
4120
|
+
}
|
|
4121
|
+
/** The ledger key of the restored worktree at `root`. */
|
|
4122
|
+
function rootKey(root) {
|
|
4123
|
+
return sha256([resolve$1(root)]).slice(0, 16);
|
|
4124
|
+
}
|
|
4125
|
+
function ledgerPath(storeDir) {
|
|
4126
|
+
return join$1(storeDir, "blueprint-builds", "ledger.json");
|
|
4127
|
+
}
|
|
4128
|
+
const EMPTY_LEDGER = {
|
|
4129
|
+
version: 1,
|
|
4130
|
+
workspaces: {},
|
|
4131
|
+
roots: {}
|
|
4132
|
+
};
|
|
4133
|
+
function isLedger(value) {
|
|
4134
|
+
if (typeof value !== "object" || value === null) return false;
|
|
4135
|
+
const candidate = value;
|
|
4136
|
+
return candidate.version === 1 && typeof candidate.workspaces === "object" && candidate.workspaces !== null && typeof candidate.roots === "object" && candidate.roots !== null;
|
|
4137
|
+
}
|
|
4138
|
+
/**
|
|
4139
|
+
* The ledger of the builds on this machine. A missing ledger, and one that is not a ledger this version wrote, is an
|
|
4140
|
+
* empty one: the next build then has no parent and runs in full, and its write replaces the file.
|
|
4141
|
+
*/
|
|
4142
|
+
async function readLedger(storeDir) {
|
|
4143
|
+
let text;
|
|
4144
|
+
try {
|
|
4145
|
+
text = await readFile(ledgerPath(storeDir), "utf8");
|
|
4146
|
+
} catch (error) {
|
|
4147
|
+
if (error.code === "ENOENT") return EMPTY_LEDGER;
|
|
4148
|
+
throw error;
|
|
4149
|
+
}
|
|
4150
|
+
let parsed;
|
|
4151
|
+
try {
|
|
4152
|
+
parsed = JSON.parse(text);
|
|
4153
|
+
} catch (error) {
|
|
4154
|
+
if (error instanceof SyntaxError) return EMPTY_LEDGER;
|
|
4155
|
+
throw error;
|
|
4156
|
+
}
|
|
4157
|
+
return isLedger(parsed) ? parsed : EMPTY_LEDGER;
|
|
4158
|
+
}
|
|
4159
|
+
const ledgerQueues = /* @__PURE__ */ new Map();
|
|
4160
|
+
/** A lock without a matching local holder record is stale after this long without a heartbeat. */
|
|
4161
|
+
const LEDGER_LOCK_STALE_MS = 15e3;
|
|
4162
|
+
const LEDGER_LOCK_UPDATE_MS = 5e3;
|
|
4163
|
+
const LEDGER_LOCK_RETRIES = {
|
|
4164
|
+
retries: 40,
|
|
4165
|
+
factor: 1.2,
|
|
4166
|
+
minTimeout: 20,
|
|
4167
|
+
maxTimeout: 250
|
|
4168
|
+
};
|
|
4169
|
+
const LEDGER_WAIT_NOTICE = "Waiting for another Atomic process to finish writing the blueprint ledger.";
|
|
4170
|
+
function ledgerLocked() {
|
|
4171
|
+
return Object.assign(/* @__PURE__ */ new Error("Blueprint ledger lock is already being held"), { code: "ELOCKED" });
|
|
4172
|
+
}
|
|
4173
|
+
async function tryLockLedger(path, lockPath) {
|
|
4174
|
+
const mutex = await takeTakeoverMutexAsync(lockPath, 0);
|
|
4175
|
+
if (mutex === void 0) {
|
|
4176
|
+
await access(dirname$1(path), fs.constants.W_OK);
|
|
4177
|
+
throw ledgerLocked();
|
|
4178
|
+
}
|
|
4179
|
+
try {
|
|
4180
|
+
if (await lockNamesLocalHolder(lockPath) || !await mutex.owned()) throw ledgerLocked();
|
|
4181
|
+
let acquired = false;
|
|
4182
|
+
let generation;
|
|
4183
|
+
const rmdir = ((candidate, callback) => {
|
|
4184
|
+
if (!acquired) return fs.rmdir(candidate, callback);
|
|
4185
|
+
lockHolderAsync(lockPath).then((current) => {
|
|
4186
|
+
if (generation !== void 0 && current === generation) fs.rmdir(candidate, callback);
|
|
4187
|
+
else callback(null);
|
|
4188
|
+
});
|
|
4189
|
+
});
|
|
4190
|
+
const unlock = await lockfile.lock(path, {
|
|
4191
|
+
realpath: false,
|
|
4192
|
+
lockfilePath: lockPath,
|
|
4193
|
+
stale: LEDGER_LOCK_STALE_MS,
|
|
4194
|
+
update: LEDGER_LOCK_UPDATE_MS,
|
|
4195
|
+
fs: {
|
|
4196
|
+
...fs,
|
|
4197
|
+
rmdir,
|
|
4198
|
+
rmdirSync: () => {}
|
|
4199
|
+
}
|
|
4200
|
+
});
|
|
4201
|
+
generation = await recordLockHolderAsync(lockPath);
|
|
4202
|
+
acquired = true;
|
|
4203
|
+
return async () => {
|
|
4204
|
+
const releaseMutex = await takeTakeoverMutexAsync(lockPath);
|
|
4205
|
+
try {
|
|
4206
|
+
await unlock();
|
|
4207
|
+
if (generation !== void 0 && await releaseMutex?.owned()) await clearLockHolderAsync(lockPath, generation);
|
|
4208
|
+
} finally {
|
|
4209
|
+
await releaseMutex?.release();
|
|
4210
|
+
}
|
|
4211
|
+
};
|
|
4212
|
+
} finally {
|
|
4213
|
+
await mutex.release();
|
|
4214
|
+
}
|
|
4215
|
+
}
|
|
4216
|
+
async function lockLedger(path, lockPath, onWait) {
|
|
4217
|
+
let retries = 0;
|
|
4218
|
+
for (;;) try {
|
|
4219
|
+
return await tryLockLedger(path, lockPath);
|
|
4220
|
+
} catch (error) {
|
|
4221
|
+
if (error.code !== "ELOCKED") throw error;
|
|
4222
|
+
if (await takeOverDeadHolderAsync(lockPath)) continue;
|
|
4223
|
+
if (retries >= LEDGER_LOCK_RETRIES.retries) throw error;
|
|
4224
|
+
if (retries === 0) onWait?.(LEDGER_WAIT_NOTICE);
|
|
4225
|
+
const delay = Math.min(Math.round(LEDGER_LOCK_RETRIES.minTimeout * LEDGER_LOCK_RETRIES.factor ** retries++), LEDGER_LOCK_RETRIES.maxTimeout);
|
|
4226
|
+
await new Promise((resolveWait) => setTimeout(resolveWait, delay));
|
|
4227
|
+
}
|
|
4228
|
+
}
|
|
4229
|
+
/** Serializes work on one ledger within this process, in the order it was asked for. */
|
|
4230
|
+
async function inProcessTurn(key, work) {
|
|
4231
|
+
const previous = ledgerQueues.get(key) ?? Promise.resolve();
|
|
4232
|
+
let release;
|
|
4233
|
+
const current = new Promise((resolveTurn) => {
|
|
4234
|
+
release = resolveTurn;
|
|
4235
|
+
});
|
|
4236
|
+
const chained = previous.then(() => current);
|
|
4237
|
+
ledgerQueues.set(key, chained);
|
|
4238
|
+
await previous;
|
|
4239
|
+
try {
|
|
4240
|
+
return await work();
|
|
4241
|
+
} finally {
|
|
4242
|
+
release();
|
|
4243
|
+
if (ledgerQueues.get(key) === chained) ledgerQueues.delete(key);
|
|
4244
|
+
}
|
|
4245
|
+
}
|
|
4246
|
+
/**
|
|
4247
|
+
* Applies `update` to the ledger as it is now and writes the result atomically. Updates are serialized, within this
|
|
4248
|
+
* process by a queue and across processes by a lock file, so builds that finish at about the same time keep each
|
|
4249
|
+
* other's entries. Reports contention through `onWait`. A lock that cannot be taken within its retries rejects with
|
|
4250
|
+
* the lock's error.
|
|
4251
|
+
*/
|
|
4252
|
+
async function updateLedger(storeDir, update, onWait) {
|
|
4253
|
+
const path = resolve$1(ledgerPath(storeDir));
|
|
4254
|
+
const lockPath = `${path}.lock`;
|
|
4255
|
+
return inProcessTurn(path, async () => {
|
|
4256
|
+
await mkdir(dirname$1(path), { recursive: true });
|
|
4257
|
+
const release = await lockLedger(path, lockPath, onWait);
|
|
4258
|
+
try {
|
|
4259
|
+
const next = update(await readLedger(storeDir));
|
|
4260
|
+
const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
4261
|
+
await writeFile(temporary, `${JSON.stringify(next, null, 2)}\n`, { mode: 384 });
|
|
4262
|
+
await rename(temporary, path);
|
|
4263
|
+
return next;
|
|
4264
|
+
} finally {
|
|
4265
|
+
await releaseLock(release, lockPath);
|
|
4266
|
+
}
|
|
4267
|
+
});
|
|
4268
|
+
}
|
|
4016
4269
|
// ../../node_modules/yaml/dist/visit.js
|
|
4017
4270
|
var require_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4018
4271
|
var identity = require_identity();
|
|
@@ -4997,7 +5250,7 @@ async function transpileCacheWritesSettled(owner, limitMs) {
|
|
|
4997
5250
|
if (!writes?.size) return 0;
|
|
4998
5251
|
let timer;
|
|
4999
5252
|
const expired = new Promise((resolve) => {
|
|
5000
|
-
timer =
|
|
5253
|
+
timer = setLongTimeout(() => resolve("expired"), limitMs);
|
|
5001
5254
|
});
|
|
5002
5255
|
try {
|
|
5003
5256
|
while (writes.size > 0) {
|
|
@@ -5006,7 +5259,7 @@ async function transpileCacheWritesSettled(owner, limitMs) {
|
|
|
5006
5259
|
}
|
|
5007
5260
|
return writes.size;
|
|
5008
5261
|
} finally {
|
|
5009
|
-
|
|
5262
|
+
timer?.clear();
|
|
5010
5263
|
}
|
|
5011
5264
|
}
|
|
5012
5265
|
// dist/core/tools/windows-directory-security.js
|
|
@@ -5148,7 +5401,7 @@ var SharedSecurityRead = class {
|
|
|
5148
5401
|
const leave = (security) => {
|
|
5149
5402
|
if (left) return;
|
|
5150
5403
|
left = true;
|
|
5151
|
-
|
|
5404
|
+
deadline.clear();
|
|
5152
5405
|
signal?.removeEventListener("abort", stopWaiting);
|
|
5153
5406
|
this.waiters -= 1;
|
|
5154
5407
|
if (!background) this.foregroundWaiters -= 1;
|
|
@@ -5161,8 +5414,7 @@ var SharedSecurityRead = class {
|
|
|
5161
5414
|
}
|
|
5162
5415
|
};
|
|
5163
5416
|
const stopWaiting = () => leave(void 0);
|
|
5164
|
-
const deadline =
|
|
5165
|
-
if (background) deadline.unref();
|
|
5417
|
+
const deadline = setLongTimeout(stopWaiting, timeoutMs, { ref: !background });
|
|
5166
5418
|
signal?.addEventListener("abort", stopWaiting, { once: true });
|
|
5167
5419
|
this.result.then(leave, () => leave(void 0));
|
|
5168
5420
|
});
|
|
@@ -5572,9 +5824,13 @@ function diagnosticErrors(value) {
|
|
|
5572
5824
|
if (!Array.isArray(diagnostics)) return [];
|
|
5573
5825
|
const errors = [];
|
|
5574
5826
|
for (const diagnostic of diagnostics) {
|
|
5575
|
-
const diagnosticType = stringField(diagnostic, "type");
|
|
5827
|
+
const diagnosticType = normalizeCode(stringField(diagnostic, "type"));
|
|
5576
5828
|
const diagnosticError = field(diagnostic, "error");
|
|
5577
|
-
|
|
5829
|
+
if (diagnosticType === "pi_messages_response_failure" && diagnosticError !== void 0) errors.push({
|
|
5830
|
+
...asRecord(diagnosticError),
|
|
5831
|
+
status: statusFrom(diagnostic)
|
|
5832
|
+
});
|
|
5833
|
+
else errors.push(diagnosticType === "provider_transport_failure" ? diagnostic : diagnosticError ?? diagnostic);
|
|
5578
5834
|
}
|
|
5579
5835
|
return errors;
|
|
5580
5836
|
}
|
|
@@ -5618,7 +5874,7 @@ function kindFromStatus(status) {
|
|
|
5618
5874
|
}
|
|
5619
5875
|
function refusalKindFromCode(code) {
|
|
5620
5876
|
const normalizedCode = normalizeCode(code);
|
|
5621
|
-
if (normalizedCode === void 0) return void 0;
|
|
5877
|
+
if (normalizedCode === void 0 || responsesErrorKind(normalizedCode) !== void 0) return void 0;
|
|
5622
5878
|
if (/(?:^|_)tool(?:_|$)/.test(normalizedCode) && normalizedCode.includes("refus")) return "task_failure";
|
|
5623
5879
|
if (normalizedCode.includes("content_filter") || normalizedCode.includes("contentfilter")) return "content_filter";
|
|
5624
5880
|
if (normalizedCode.includes("safety") || normalizedCode.includes("policy")) return "content_filter";
|
|
@@ -5636,13 +5892,11 @@ const REQUEST_INCOMPATIBLE_CODES = /* @__PURE__ */ new Set([
|
|
|
5636
5892
|
"invalid_request",
|
|
5637
5893
|
"invalid_request_error",
|
|
5638
5894
|
"bad_request",
|
|
5639
|
-
"context_length_exceeded",
|
|
5640
5895
|
"request_too_large",
|
|
5641
5896
|
"too_large",
|
|
5642
5897
|
"request_entity_too_large",
|
|
5643
5898
|
"max_tokens",
|
|
5644
|
-
"max_context_length"
|
|
5645
|
-
"context_window_exceeded"
|
|
5899
|
+
"max_context_length"
|
|
5646
5900
|
]);
|
|
5647
5901
|
function requestIncompatibleKindFromCode(code) {
|
|
5648
5902
|
const normalized = normalizeCode(code);
|
|
@@ -5656,6 +5910,8 @@ function kindFromCode(code) {
|
|
|
5656
5910
|
if (CREDENTIAL_REJECTION_CODES.has(normalizedCode)) return "auth_on_candidate_provider";
|
|
5657
5911
|
const httpStatusKind = kindFromStatus(integerFrom(code));
|
|
5658
5912
|
if (httpStatusKind !== void 0) return httpStatusKind;
|
|
5913
|
+
const mappedKind = responsesErrorKind(normalizedCode);
|
|
5914
|
+
if (mappedKind !== void 0) return mappedKind === "context_overflow" ? "request_incompatible" : mappedKind;
|
|
5659
5915
|
const requestIncompatibleKind = requestIncompatibleKindFromCode(code);
|
|
5660
5916
|
if (requestIncompatibleKind !== void 0) return requestIncompatibleKind;
|
|
5661
5917
|
switch (normalizedCode) {
|
|
@@ -5682,17 +5938,10 @@ function kindFromCode(code) {
|
|
|
5682
5938
|
case "err_http2_stream_cancel":
|
|
5683
5939
|
case "und_err_socket": return "transport_error";
|
|
5684
5940
|
case "rate_limit":
|
|
5685
|
-
case "
|
|
5941
|
+
case "rate_limit_error":
|
|
5686
5942
|
case "too_many_requests":
|
|
5687
5943
|
case "throttlingexception":
|
|
5688
5944
|
case "resource_exhausted": return "rate_limit";
|
|
5689
|
-
case "quota_exceeded":
|
|
5690
|
-
case "insufficient_quota":
|
|
5691
|
-
case "usage_limit":
|
|
5692
|
-
case "usage_limit_reached":
|
|
5693
|
-
case "usage_limit_exceeded":
|
|
5694
|
-
case "payment_required":
|
|
5695
|
-
case "servicequotaexceededexception": return "quota_exhausted";
|
|
5696
5945
|
case "aborterror":
|
|
5697
5946
|
case "aborted":
|
|
5698
5947
|
case "cancelled":
|
|
@@ -5822,8 +6071,6 @@ const TRANSPORT_OUTAGE_FAILURE_PATTERNS = [
|
|
|
5822
6071
|
/\bstream\s+ended\s+without\s+finish[_\s-]?reason\b/i,
|
|
5823
6072
|
/(?<![a-z0-9_])UND_ERR_SOCKET(?![a-z0-9_])/i
|
|
5824
6073
|
];
|
|
5825
|
-
const QUOTA_EXHAUSTED_FAILURE_PATTERN = /(?<![a-z0-9.])402(?![a-z0-9.])|payment[_\s-]*required|insufficient[_\s-]*quota|\bServiceQuotaExceededException\b|"quotaId"\s*:\s*"[^"]*PerDay|"(?:code|type|error_code)"\s*:\s*"(?:quota_exceeded|usage_limit|usage_limit_reached|usage_limit_exceeded)"/i;
|
|
5826
|
-
const BILLING_EXHAUSTED_FAILURE_PATTERN = /credit\s+balance\s+is\s+too\s+low|insufficient[_\s-]*(?:credits?|balance|funds)|(?:requires|purchase|buy|add)\s+more\s+credits|used\s+all\s+(?:of\s+)?(?:your\s+)?available\s+credits|out\s+of\s+(?:credits?|budget)|spending\s+limit|available\s+balance|check\s+your\s+plan\s+and\s+billing/i;
|
|
5827
6074
|
const API_KEY_REJECTED_FAILURE_PATTERN = /\b(?:invalid|incorrect|expired|disabled|leaked)[_\s-]*api[_\s-]*key\b|\bapi[_\s-]+key[_\s-]+(?:(?:is|was|has|been)[_\s-]+){0,3}(?:not[_\s-]+valid|invalid|incorrect|expired|disabled|leaked|rejected|reported[_\s-]+as[_\s-]+leaked)\b/i;
|
|
5828
6075
|
const TOKEN_REJECTED_FAILURE_PATTERN = /\b(?:expired|revoked|invalidated)[_\s-]+(?:(?:oauth|auth|access|refresh)[_\s-]+)?token\b|\b(?:(?:oauth|auth|access|refresh)[_\s-]+)?token[_\s-]+(?:(?:is|was|has|been)[_\s-]+){0,3}(?:expired|revoked|invalidated)\b|\bsecurity\s+token\s+(?:included\s+in\s+the\s+request\s+)?(?:is|has)\s+(?:expired|invalid)\b/i;
|
|
5829
6076
|
function transportOutageKindFromMessage(message) {
|
|
@@ -5855,12 +6102,11 @@ function fallbackKindFromMessage(message, name) {
|
|
|
5855
6102
|
if (refusalKind !== void 0) return refusalKind;
|
|
5856
6103
|
const transportOutageKind = transportOutageKindFromMessage(message);
|
|
5857
6104
|
if (transportOutageKind !== void 0) return transportOutageKind;
|
|
5858
|
-
if (
|
|
6105
|
+
if (isProviderQuotaExhaustionText(message)) return "quota_exhausted";
|
|
5859
6106
|
if (API_KEY_REJECTED_FAILURE_PATTERN.test(message) || TOKEN_REJECTED_FAILURE_PATTERN.test(message) || CREDENTIAL_REJECTION_CODE_PATTERN.test(message)) return "auth_on_candidate_provider";
|
|
5860
6107
|
if (REQUEST_INCOMPATIBLE_FAILURE_PATTERNS.some((pattern) => pattern.test(message))) return "request_incompatible";
|
|
5861
6108
|
const nameKind = kindFromCode(name);
|
|
5862
6109
|
if (nameKind !== void 0) return nameKind;
|
|
5863
|
-
if (QUOTA_EXHAUSTED_FAILURE_PATTERN.test(message)) return "quota_exhausted";
|
|
5864
6110
|
const transientKind = transientKindFromMessage(message);
|
|
5865
6111
|
if (!(transientKind !== void 0 || RETRYABLE_MODEL_FAILURE_PATTERNS.some((pattern) => pattern.test(message)) || messageLooksLikeModelUnavailable(message))) return void 0;
|
|
5866
6112
|
if (/rate\s*limit|too\s*many\s*requests|\bthrottl(?:ing|ed)\b|\b429\b|quota|usage[\s_-]*limit|billing|credit/i.test(message)) return "rate_limit";
|
|
@@ -5910,18 +6156,22 @@ const MODEL_BLOCKING_FAILURE_KINDS = /* @__PURE__ */ new Set([
|
|
|
5910
6156
|
"request_incompatible"
|
|
5911
6157
|
]);
|
|
5912
6158
|
/**
|
|
5913
|
-
* The direct message's signal, unless
|
|
5914
|
-
*
|
|
6159
|
+
* The direct message's signal, unless its text would condemn the model over a structured transient or quota
|
|
6160
|
+
* failure. A quota can name its API key without rejecting that key (#4918).
|
|
5915
6161
|
*/
|
|
5916
|
-
function
|
|
6162
|
+
function directMessageSignalUnlessMoreSpecific(value, source) {
|
|
5917
6163
|
const signal = fallbackSignalFromDirectMessage(value, source);
|
|
5918
6164
|
if (signal === void 0 || !MODEL_BLOCKING_FAILURE_KINDS.has(signal.kind)) return signal;
|
|
5919
6165
|
const rawDiagnostics = field(value, "diagnostics");
|
|
5920
|
-
return [value, ...Array.isArray(rawDiagnostics) ? rawDiagnostics : []].
|
|
6166
|
+
return [value, ...Array.isArray(rawDiagnostics) ? rawDiagnostics : []].some((source) => {
|
|
6167
|
+
const code = codeFrom(source);
|
|
6168
|
+
return responsesErrorKind(normalizeCode(code)) === "quota_exhausted" || [kindFromStatus(statusFrom(source)), kindFromCode(code)].some((kind) => kind !== void 0 && SAME_MODEL_RETRYABLE_FAILURE_KINDS.has(kind));
|
|
6169
|
+
}) ? void 0 : signal;
|
|
5921
6170
|
}
|
|
5922
6171
|
function classifyAssistantRefusalSignal(value, source) {
|
|
5923
6172
|
if (normalizeCode(codeFrom(value)) === "econnaborted") return void 0;
|
|
5924
|
-
const
|
|
6173
|
+
const rawStopReason = stopReasonFrom(value) === "error" ? stringField(value, "rawStopReason") : void 0;
|
|
6174
|
+
const codeRefusalKind = refusalKindFromCode(codeFrom(value)) ?? refusalKindFromCode(errorName(value)) ?? refusalKindFromCode(finishReasonFrom(value)) ?? refusalKindFromCode(rawStopReason) ?? (rawStopReason === "sensitive" && stringField(value, "api") === "anthropic-messages" ? "content_filter" : void 0);
|
|
5925
6175
|
if (codeRefusalKind !== void 0) return makeSignal(codeRefusalKind, value, source);
|
|
5926
6176
|
const messageRefusalKind = refusalKindFromMessage(directMessageFrom(value) ?? "");
|
|
5927
6177
|
return messageRefusalKind === void 0 ? void 0 : makeSignal(messageRefusalKind, value, source);
|
|
@@ -5979,13 +6229,21 @@ function structuredSignal(value, seen, source) {
|
|
|
5979
6229
|
if (bestNestedFallbackSignal === void 0 || nestedSignalPriority(causeSignal) > nestedSignalPriority(bestNestedFallbackSignal)) bestNestedFallbackSignal = causeSignal;
|
|
5980
6230
|
}
|
|
5981
6231
|
if (directRefusalSignal === void 0 && directCancellationSignal === void 0 && normalizeCode(codeFrom(value)) === "model_not_available_for_integrator") return makeSignal("model_unavailable", value, source);
|
|
5982
|
-
const directMessageSignal =
|
|
6232
|
+
const directMessageSignal = directMessageSignalUnlessMoreSpecific(value, source);
|
|
5983
6233
|
const quotaExhausted = directMessageSignal?.kind === "quota_exhausted" || bestNestedFallbackSignal?.kind === "quota_exhausted";
|
|
6234
|
+
if (quotaExhausted && bestNestedFallbackSignal?.kind === "request_incompatible") bestNestedFallbackSignal = void 0;
|
|
6235
|
+
if (directCancellationSignal === void 0 && codeKind !== "content_filter" && codeKind !== "task_failure") {
|
|
6236
|
+
const rateLimit = codeKind === "rate_limit" || statusFrom(value) === 429 && codeKind === void 0 ? makeSignal("rate_limit", value, source) : bestNestedFallbackSignal?.kind === "rate_limit" && bestNestedFallbackSignal.status === 429 ? bestNestedFallbackSignal : void 0;
|
|
6237
|
+
if (rateLimit !== void 0) {
|
|
6238
|
+
if (isProviderQuotaExhaustionText(directMessageFrom(value) ?? "")) return makeSignal("quota_exhausted", value, source);
|
|
6239
|
+
if (!quotaExhausted) return rateLimit;
|
|
6240
|
+
}
|
|
6241
|
+
}
|
|
5984
6242
|
const directSignals = [
|
|
5985
6243
|
directRefusalSignal,
|
|
5986
6244
|
directCancellationSignal,
|
|
5987
6245
|
providerTransportSignal,
|
|
5988
|
-
directMessageSignal,
|
|
6246
|
+
quotaExhausted && directMessageSignal?.kind === "request_incompatible" ? void 0 : directMessageSignal,
|
|
5989
6247
|
kindFromStatus(statusFrom(value)) === void 0 || kindFromCode(codeFrom(value)) !== void 0 || quotaExhausted ? void 0 : makeSignal(kindFromStatus(statusFrom(value)), value, source),
|
|
5990
6248
|
kindFromCode(codeFrom(value)) === void 0 || quotaExhausted && kindFromCode(codeFrom(value)) === "request_incompatible" ? void 0 : makeSignal(kindFromCode(codeFrom(value)), value, source),
|
|
5991
6249
|
kindFromCode(errorName(value)) === void 0 ? void 0 : makeSignal(kindFromCode(errorName(value)), value, source)
|
|
@@ -6158,7 +6416,7 @@ function isProviderCredentialRejection(error) {
|
|
|
6158
6416
|
const code = normalizeCode(value);
|
|
6159
6417
|
return code !== void 0 && (CREDENTIAL_REJECTION_CODES.has(code) || status !== 403 && AUTHENTICATION_FAILURE_CODES.has(code));
|
|
6160
6418
|
})) return true;
|
|
6161
|
-
const message = `${signal.message}\n${typedFailure?.detail ?? stringField(error, "detail") ?? ""}`;
|
|
6419
|
+
const message = `${signal.message}\n${errorMessage$1(error)}\n${typedFailure?.detail ?? stringField(error, "detail") ?? ""}`;
|
|
6162
6420
|
return API_KEY_REJECTED_FAILURE_PATTERN.test(message) || TOKEN_REJECTED_FAILURE_PATTERN.test(message) || CREDENTIAL_REJECTION_CODE_PATTERN.test(message);
|
|
6163
6421
|
}
|
|
6164
6422
|
/** Whether a failure is a provider safety/refusal response: a content-filter refusal, or a refused tool call. */
|
|
@@ -6209,6 +6467,80 @@ function isRetryableSameModelFailure(error) {
|
|
|
6209
6467
|
function isUnrecognizedModelFailure(error) {
|
|
6210
6468
|
return isRetryableModelFailure(error) && isUnrecognizedSignal(normalizeModelFailureSignal(error));
|
|
6211
6469
|
}
|
|
6470
|
+
// dist/core/provider-account.js
|
|
6471
|
+
const failureAccounts = /* @__PURE__ */ new WeakMap();
|
|
6472
|
+
function observeFailedProviderAccount(message, account) {
|
|
6473
|
+
failureAccounts.set(message, account);
|
|
6474
|
+
}
|
|
6475
|
+
function failedProviderAccount(message) {
|
|
6476
|
+
return failureAccounts.get(message);
|
|
6477
|
+
}
|
|
6478
|
+
function normalizedEndpoint(model, options) {
|
|
6479
|
+
const baseUrl = options.baseUrl ?? model.baseUrl;
|
|
6480
|
+
try {
|
|
6481
|
+
const url = new URL(model.api === "azure-openai-responses" ? resolveAzureBaseUrl({ baseUrl }, options) : baseUrl);
|
|
6482
|
+
url.hash = "";
|
|
6483
|
+
return url.toString().replace(/\/+(?=\?|$)/, "");
|
|
6484
|
+
} catch {
|
|
6485
|
+
return baseUrl.trim().replace(/\/+$/, "");
|
|
6486
|
+
}
|
|
6487
|
+
}
|
|
6488
|
+
function codexAccountId(apiKey) {
|
|
6489
|
+
const parts = apiKey?.split(".");
|
|
6490
|
+
if (parts?.length !== 3 || !parts[1]) return void 0;
|
|
6491
|
+
try {
|
|
6492
|
+
const id = JSON.parse(Buffer.from(parts[1], "base64url").toString("utf8"))?.["https://api.openai.com/auth"]?.chatgpt_account_id;
|
|
6493
|
+
return typeof id === "string" && id.length > 0 ? id : void 0;
|
|
6494
|
+
} catch {
|
|
6495
|
+
return;
|
|
6496
|
+
}
|
|
6497
|
+
}
|
|
6498
|
+
function credentialIdentity(model, options) {
|
|
6499
|
+
if (model.api === "openai-codex-responses") {
|
|
6500
|
+
const account = codexAccountId(options.apiKey);
|
|
6501
|
+
if (account) return ["codex-account", account];
|
|
6502
|
+
}
|
|
6503
|
+
const headers = new Map([...Object.entries(model.headers ?? {}), ...Object.entries(options.headers ?? {})].map(([name, value]) => [name.toLowerCase(), value]));
|
|
6504
|
+
const key = (headers.get("authorization") ?? headers.get("cf-aig-authorization"))?.replace(/^Bearer\s+/i, "") ?? headers.get("x-api-key") ?? headers.get("api-key") ?? headers.get("x-goog-api-key") ?? options.apiKey;
|
|
6505
|
+
const env = (name) => getProviderEnvValue(name, options.env);
|
|
6506
|
+
if (model.api === "bedrock-converse-stream") {
|
|
6507
|
+
if (env("AWS_BEDROCK_SKIP_AUTH") === "1") return void 0;
|
|
6508
|
+
const bearer = options.bearerToken || key || env("AWS_BEARER_TOKEN_BEDROCK");
|
|
6509
|
+
if (bearer) return ["key", bearer];
|
|
6510
|
+
const profile = options.profile || options.env?.AWS_PROFILE;
|
|
6511
|
+
if (profile) return ["aws-profile", profile];
|
|
6512
|
+
const accessKey = env("AWS_ACCESS_KEY_ID");
|
|
6513
|
+
if (accessKey) return ["aws-access-key", accessKey];
|
|
6514
|
+
if (env("AWS_PROFILE")) return ["aws-profile", env("AWS_PROFILE")];
|
|
6515
|
+
const role = env("AWS_ROLE_ARN") ?? env("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI") ?? env("AWS_CONTAINER_CREDENTIALS_FULL_URI") ?? env("AWS_WEB_IDENTITY_TOKEN_FILE");
|
|
6516
|
+
if (role) return ["aws-role", role];
|
|
6517
|
+
}
|
|
6518
|
+
if (key) return ["key", key];
|
|
6519
|
+
if (model.api === "google-vertex") {
|
|
6520
|
+
const project = options.project || env("GOOGLE_CLOUD_PROJECT") || env("GCLOUD_PROJECT");
|
|
6521
|
+
const location = options.location || env("GOOGLE_CLOUD_LOCATION");
|
|
6522
|
+
if (project && location) return [
|
|
6523
|
+
"vertex-adc",
|
|
6524
|
+
project,
|
|
6525
|
+
location,
|
|
6526
|
+
env("GOOGLE_APPLICATION_CREDENTIALS")
|
|
6527
|
+
];
|
|
6528
|
+
}
|
|
6529
|
+
if (model.api === "anthropic-messages" && env("ANTHROPIC_FEDERATION_RULE_ID")) return [
|
|
6530
|
+
"anthropic-federation",
|
|
6531
|
+
env("ANTHROPIC_ORGANIZATION_ID"),
|
|
6532
|
+
env("ANTHROPIC_FEDERATION_RULE_ID"),
|
|
6533
|
+
env("ANTHROPIC_SERVICE_ACCOUNT_ID"),
|
|
6534
|
+
env("ANTHROPIC_WORKSPACE_ID"),
|
|
6535
|
+
env("ANTHROPIC_IDENTITY_TOKEN_FILE")
|
|
6536
|
+
];
|
|
6537
|
+
}
|
|
6538
|
+
/** Hash the effective endpoint and credential. Never retain either raw value in limit or turn state. */
|
|
6539
|
+
function providerAccount(model, options) {
|
|
6540
|
+
const credential = credentialIdentity(model, options);
|
|
6541
|
+
if (!credential) return void 0;
|
|
6542
|
+
return createHash("sha256").update(JSON.stringify([normalizedEndpoint(model, options), credential])).digest("hex");
|
|
6543
|
+
}
|
|
6212
6544
|
// dist/core/settings-write-ownership.js
|
|
6213
6545
|
const settingsWriteOwner = asyncScope();
|
|
6214
6546
|
const ownedSettingsManagers = /* @__PURE__ */ new WeakMap();
|
|
@@ -8187,10 +8519,10 @@ function stopLookupOn(lookup, options, onQuit) {
|
|
|
8187
8519
|
const stop = () => lookup.abort();
|
|
8188
8520
|
options?.signal?.addEventListener("abort", stop, { once: true });
|
|
8189
8521
|
if (options?.signal?.aborted) stop();
|
|
8190
|
-
const timer = options?.timeout && options.timeout > 0 ?
|
|
8522
|
+
const timer = options?.timeout && options.timeout > 0 ? setLongTimeout(stop, options.timeout) : void 0;
|
|
8191
8523
|
const stopOnQuit = onQuit?.(stop);
|
|
8192
8524
|
return () => {
|
|
8193
|
-
|
|
8525
|
+
timer?.clear();
|
|
8194
8526
|
options?.signal?.removeEventListener("abort", stop);
|
|
8195
8527
|
stopOnQuit?.();
|
|
8196
8528
|
};
|
|
@@ -8326,7 +8658,7 @@ async function execCommand(command, args, cwd, options, onQuit) {
|
|
|
8326
8658
|
if (options.signal.aborted) killProcess(true);
|
|
8327
8659
|
else options.signal.addEventListener("abort", abort, { once: true });
|
|
8328
8660
|
}
|
|
8329
|
-
if (options?.timeout && options.timeout > 0) timeoutId =
|
|
8661
|
+
if (options?.timeout && options.timeout > 0) timeoutId = setLongTimeout(abort, options.timeout - lookupMs);
|
|
8330
8662
|
const takeWithinCap = (data) => {
|
|
8331
8663
|
if (truncated) return void 0;
|
|
8332
8664
|
const remaining = maxBuffer - outputBytes;
|
|
@@ -8358,7 +8690,7 @@ async function execCommand(command, args, cwd, options, onQuit) {
|
|
|
8358
8690
|
else if (!stderr) stderr = error.message;
|
|
8359
8691
|
} finally {
|
|
8360
8692
|
hostDeathWatch?.release();
|
|
8361
|
-
|
|
8693
|
+
timeoutId?.clear();
|
|
8362
8694
|
options?.signal?.removeEventListener("abort", abort);
|
|
8363
8695
|
stopOnQuit?.();
|
|
8364
8696
|
quitStoppableCommands.delete(proc);
|
|
@@ -11612,9 +11944,9 @@ var McpClient = class {
|
|
|
11612
11944
|
if (isObject(params) && isJsonRpcId(params.requestId)) this.incoming.get(params.requestId)?.abort(params.reason);
|
|
11613
11945
|
}
|
|
11614
11946
|
armTimeout(id, entry) {
|
|
11615
|
-
|
|
11947
|
+
entry.timer?.clear();
|
|
11616
11948
|
if (!Number.isFinite(entry.timeoutMs) || entry.timeoutMs <= 0) return;
|
|
11617
|
-
entry.timer =
|
|
11949
|
+
entry.timer = setLongTimeout(() => {
|
|
11618
11950
|
this.cancelPending(id, new McpTimeoutError(entry.timeoutMs), entry.cancellable, "Request timed out");
|
|
11619
11951
|
}, entry.timeoutMs);
|
|
11620
11952
|
}
|
|
@@ -11634,7 +11966,7 @@ var McpClient = class {
|
|
|
11634
11966
|
}
|
|
11635
11967
|
removePending(id, entry) {
|
|
11636
11968
|
this.pending.delete(id);
|
|
11637
|
-
|
|
11969
|
+
entry.timer?.clear();
|
|
11638
11970
|
if (entry.progressToken !== void 0) this.progressRequests.delete(entry.progressToken);
|
|
11639
11971
|
entry.signal?.removeEventListener("abort", entry.onAbort);
|
|
11640
11972
|
entry.sendController.abort();
|
|
@@ -17136,6 +17468,7 @@ const SettingsSchema = Type$1.Object({
|
|
|
17136
17468
|
resume: Type$1.Optional(ResumeSettingsSchema),
|
|
17137
17469
|
retry: Type$1.Optional(RetrySettingsSchema),
|
|
17138
17470
|
hideThinkingBlock: Type$1.Optional(Type$1.Boolean({ default: SETTINGS_DEFAULTS.hideThinkingBlock })),
|
|
17471
|
+
anthropicThinkingDisplay: Type$1.Optional(Type$1.Union([Type$1.Literal("updates"), Type$1.Literal("summarized")], { description: "On supported Claude models, choose visible progress updates or reasoning summaries." })),
|
|
17139
17472
|
externalEditor: Type$1.Optional(Type$1.String({ description: "Command for Ctrl+G external editor; takes precedence over VISUAL and EDITOR." })),
|
|
17140
17473
|
shellPath: Type$1.Optional(Type$1.String({ description: "Custom shell path, for example for Cygwin on Windows, with support for leading ~ expansion." })),
|
|
17141
17474
|
quietStartup: Type$1.Optional(Type$1.Union([Type$1.Boolean(), Type$1.Literal("header")], {
|
|
@@ -17253,7 +17586,7 @@ const SettingsSchema = Type$1.Object({
|
|
|
17253
17586
|
default: SETTINGS_DEFAULTS.cacheWarming
|
|
17254
17587
|
})),
|
|
17255
17588
|
websocketConnectTimeoutMs: Type$1.Optional(timeoutSetting({ description: "WebSocket connect or open handshake timeout as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables it." })),
|
|
17256
|
-
streamDeadlineMs: Type$1.Optional(timeoutSetting({ description: "Maximum
|
|
17589
|
+
streamDeadlineMs: Type$1.Optional(timeoutSetting({ description: "Maximum wait for provider stream progress (keepalives do not count), as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables the progress timer." })),
|
|
17257
17590
|
queueMode: Type$1.Optional(Type$1.Union([Type$1.Literal("all"), Type$1.Literal("one-at-a-time")], {
|
|
17258
17591
|
description: "Legacy setting migrated to steeringMode.",
|
|
17259
17592
|
deprecated: true
|
|
@@ -17684,6 +18017,7 @@ function firstBlock(message) {
|
|
|
17684
18017
|
}
|
|
17685
18018
|
function leadsWithThinking(block) {
|
|
17686
18019
|
if (!block || typeof block !== "object" || !("type" in block)) return false;
|
|
18020
|
+
if (block.type === "text") return "anthropicProgressSignature" in block && typeof block.anthropicProgressSignature === "string" && block.anthropicProgressSignature.length > 0;
|
|
17687
18021
|
return block.type === "thinking" ? "thinkingSignature" in block && typeof block.thinkingSignature === "string" && block.thinkingSignature.length > 0 : block.type === "redacted_thinking" && "data" in block && typeof block.data === "string" && block.data.length > 0;
|
|
17688
18022
|
}
|
|
17689
18023
|
const OPENING_TAIL_SLOTS = 8;
|
|
@@ -17890,7 +18224,7 @@ var CacheWarmer = class {
|
|
|
17890
18224
|
const run = this.run;
|
|
17891
18225
|
if (!run) return;
|
|
17892
18226
|
this.run = void 0;
|
|
17893
|
-
|
|
18227
|
+
run.timer?.clear();
|
|
17894
18228
|
run.controller.abort();
|
|
17895
18229
|
}
|
|
17896
18230
|
stop(reason, stopped) {
|
|
@@ -17910,12 +18244,11 @@ var CacheWarmer = class {
|
|
|
17910
18244
|
this.stop(run.phase === "idle" ? "30-minute idle safety limit reached" : "one-hour safety limit reached");
|
|
17911
18245
|
return;
|
|
17912
18246
|
}
|
|
17913
|
-
run.timer =
|
|
18247
|
+
run.timer = setWallTimeoutAt(() => {
|
|
17914
18248
|
this.runRefresh(() => this.refresh(run)).catch(() => {
|
|
17915
18249
|
if (this.run === run) this.stop("inactive");
|
|
17916
18250
|
});
|
|
17917
|
-
},
|
|
17918
|
-
run.timer.unref?.();
|
|
18251
|
+
}, run.nextWarmAt, { ref: false });
|
|
17919
18252
|
}
|
|
17920
18253
|
async refresh(run) {
|
|
17921
18254
|
run.timer = void 0;
|
|
@@ -17994,17 +18327,12 @@ function getClientIdentity(settingsManager) {
|
|
|
17994
18327
|
// dist/main-stdio.js
|
|
17995
18328
|
/** How long a run waits for the first piped byte, or the end of stdin, by default. */
|
|
17996
18329
|
const DEFAULT_STDIN_TIMEOUT_MS = 2e3;
|
|
17997
|
-
/**
|
|
17998
|
-
const MAX_TIMER_DELAY_MS = 0x7fffffff;
|
|
17999
|
-
/**
|
|
18000
|
-
* `ATOMIC_STDIN_TIMEOUT_MS`: a whole number of milliseconds, at most `MAX_TIMER_DELAY_MS` (about 24.8 days); `0` waits
|
|
18001
|
-
* for the end of piped input.
|
|
18002
|
-
*/
|
|
18330
|
+
/** `ATOMIC_STDIN_TIMEOUT_MS`: a whole number of milliseconds; `0` waits for the end of piped input. */
|
|
18003
18331
|
function stdinTimeoutMs() {
|
|
18004
18332
|
const raw = getEnvValue(ENV_STDIN_TIMEOUT_MS)?.trim();
|
|
18005
18333
|
if (!raw) return DEFAULT_STDIN_TIMEOUT_MS;
|
|
18006
18334
|
const value = Number(raw);
|
|
18007
|
-
return Number.isSafeInteger(value) && value >= 0 ?
|
|
18335
|
+
return Number.isSafeInteger(value) && value >= 0 ? value : DEFAULT_STDIN_TIMEOUT_MS;
|
|
18008
18336
|
}
|
|
18009
18337
|
function warn(message) {
|
|
18010
18338
|
console.error(chalk.yellow(`Warning: ${message}`));
|
|
@@ -18036,14 +18364,14 @@ async function readPipedStdin(options) {
|
|
|
18036
18364
|
const settle = (value) => {
|
|
18037
18365
|
if (settled) return;
|
|
18038
18366
|
settled = true;
|
|
18039
|
-
|
|
18367
|
+
timer?.clear();
|
|
18040
18368
|
stdin.off("data", onData);
|
|
18041
18369
|
stdin.off("end", onEnd);
|
|
18042
18370
|
resolve(value);
|
|
18043
18371
|
};
|
|
18044
18372
|
stdin.on("data", onData);
|
|
18045
18373
|
stdin.on("end", onEnd);
|
|
18046
|
-
if (timeoutMs > 0) timer =
|
|
18374
|
+
if (timeoutMs > 0) timer = setLongTimeout(() => {
|
|
18047
18375
|
if (received) return;
|
|
18048
18376
|
if (!options.hasPrompt) {
|
|
18049
18377
|
warn("Waiting for input on stdin. Pass a prompt argument, or close stdin (for example with `< /dev/null`), to start without it.");
|
|
@@ -19706,16 +20034,16 @@ var ChildCatalog = class ChildCatalog {
|
|
|
19706
20034
|
function sessionScratchDir(agentDir, cwd, _sessionId) {
|
|
19707
20035
|
return getDefaultSessionDirPath(cwd, agentDir);
|
|
19708
20036
|
}
|
|
19709
|
-
export { AgentRehydrateError, AgentReleaseConfigError, CacheWarmer, ChildCatalog, CommandDeliveries, DEFAULT_MAX_MESSAGE_BYTES, DEFAULT_SUBSCRIPTION_MAX_CONCURRENT, EMPTY_OUTPUT_TEXT, EngineHealthController, ExtensionInputComponent, ExtensionSelectorComponent, FirstTimeSetupComponent, GIT_RELEASE, HistorySearchPositions, IMAGE_RESIZE_WORKER_RESPONSE_TYPE, LEGACY_AZURE_PROVIDER, LlamaClient, MAX_INDEXED_ENTRY_CHARS, MULTI_SUBMIT_LABEL, MarkdownContentCache, McpClient, MultiSelectView, NestedGitignore, NestedToolCallRunner, NoUsableModelError, QuestionParamsSchema, RESERVED_LABELS, RESUME_TIMINGS_TYPE, RemoteModelCatalog, RemoteQueuePause, ReopenedCompletionHeaders, ResumeTimingsRecorder, SEARCH_PART_CHARS, SESSIONS_TRANSFER_DIRECTORY, SESSION_STORAGE_JOIN, STORAGE_JOIN_COMMAND, SUMMARY_COMPACTION_PREFIX, SessionKeyDigests, SessionStorageSelectionSchema, SettingsSchema, SqlSessionSearchIndex, StorageImportIncompleteError, StorageSelectionSchema, StorageTransferError, StringEnum, TOOL_OUTPUT_ENTRY_TYPE, TRANSPILE_CACHE_WRITE_WAIT_MS, TaskElapsedClocks, TaskToolError, ToolExecutionScheduler, TransportEvents, UNORDERED_ADMISSION, VERBATIM_COMPACTION_PREFIX, VERIFICATION_PENDING_REASON, WorkspaceBindingError, WorkspaceCollectionError, WorkspaceConfigError, WorkspaceDriftError, WorkspaceError, WorkspaceGitError, WorkspacePublicationError, WorkspaceRestoreError, WorkspaceSandboxError, WorkspaceSnapshotError, WorkspaceTimeoutError, WrappingSelect, acceptsForkReplay, addResource, adoptCommandSession, appendFileChatRecords, assertSessionBlobStore, assertSettingsWrites, attachCleanupCause, bindRegistrationCallbacks, bindTaskClock, bindTaskClockSource, bodyWidths, buildDirectoryTree, buildDirectoryTreeFromOperations, buildToolStatusReport, cancelInitialBinding, cancelPausedOwnerTasks, cancelReceiptSentence, cancelReceiptStatus, captureForkReplayPair, captureRegistrationInvocation, carriedTransformedPrompt, carryCompletionEvidence, chatAnswerIntent, chatNumberingFor, childPresentationInput, claimInteractiveBind, classifyCompactionModel, cleanupFailureSummary, collectAgentTasks, collectCommandDeliveries, collectExtensionPackageWarnings, collectFlags, collectMarkdownTransformers, collectPackageInstallWarnings, collectRegisteredTools, collectSettingsDiagnostics, columnWidths, compareCreated, compareFrozen, computeFocusedOptionHasPreview, conflictEntries, convertImageBytesToPng, convertToLlm, convertToLlmWithForkBoundaries, convertToPng, copyRegistrations, copySessionBlobs, createAccumulator, createBranchSummaryMessage, createCustomMessage, createInvocationBindings, createLazyBuiltinFactory, createManagedTaskClocks, createProviderAlias, createSessionHistoryToolDefinition, createSkillRouter, createVerbatimCompactionMessage, crossTabLeftWidthWithDonation, currentResourceAdmission, decideLayout, deferCommandTurn, deferMessagesInterleavedWithToolBatch, deferRestorePhase, deleteFileChatRecords, describeToolSelection, detectLinuxLibc, diffLines, diffWords, discoverChatFile, drainProcessStdio, drainWindowsDirectorySecurityReads, dropDeferredCommandTurn, ensurePngTranscoder, ensureTool, errorMessage$1 as errorMessage, execCommand, extensionRefreshRejection, extensionSource, filterSupersededHerdrIntegrationPaths, findEntryRenderer, findMessageRenderer, findToolDefinition, findWorkspaceError, fixUtf8Stream, flush, forkReplayFilter, forkToolDeclarations, formatAnswerScalar, formatBytes, formatNoUsableModelMessage, formatPackageInstallWarning, formatResumeTimings, formatTokenSegment, formatToolStatus, genBridge, getBuiltinExtensionEntryLabel, getClientIdentity, getCommandEnv, getGitDistributionTarget, getGitInstallDir, getGitReleaseMarker, getGitShellEnvironment, getGitShellEnvironmentAsync, getGitStatus, getGitStatusAsync, getLatestVersion, getLazyBuiltinSpec, getLoaderAgentDirs, getPromptCacheTtlMs, getStorageAdapterHostModules, getToolEnv, getToolPath, getVirtualModules, gitInstallCommand, gitignoreMatcher, hasExtensionHandlers, hasFileChatRecords, hasLazyBuiltinSpec, hasQuitStoppableCommands, hasRecordedTransformedPrompt, hasTaskPromptHost, hasTransformedPrompt, heldPromptInput, heldPrompts, initialBindScope, inlineToolOutput, insertForcedOptionsBeforeTerminator, invocationExtension, invocationRuntime, isAgentRehydrateError, isAgentReleaseConfigError, isBashToolResult, isContentFilterRefusal, isEditToolResult, isFindToolResult, isForkHeader, isHeldPromptInput, isInsideInputHook, isJsonValue, isLocalOnlySessionStorage, isLsToolResult, isNativeBuiltinExtensionPath, isOfflineModeEnabled, isPowerShellToolResult, isPresentationHostInput, isProviderCredentialRejection, isReadToolResult, isRetryableAgentRehydrateError, isRetryableModelFailure, isRetryableSameModelFailure, isRetryableWorkspaceError, isSafetyRefusalFailure, isSourceBuiltinExtensionPath, isStorageImportIncompleteError, isStorageTransferError, isTaskToolError, isToolCallEventType, isTruthyEnvFlag, isUnrecognizedModelFailure, isVerbatimCompactionMessage, isWorkspaceBindingError, isWorkspaceCollectionError, isWorkspaceConfigError, isWorkspaceDriftError, isWorkspaceError, isWorkspaceGitError, isWorkspacePublicationError, isWorkspaceRestoreError, isWorkspaceSandboxError, isWorkspaceSnapshotError, isWorkspaceTimeoutError, isWriteToolResult, joinCommandSend, joinCommandTurn, killQuitStoppableCommandsNow, latestLegacyMessageTime, latestResumeTimings, legacyCompletionTarget, lifecycleScopeForOwner, llamaInferenceUrl, loadVirtualModules, loaderHostModulesTestHooks, mergeExtensionWarnings, mergeResourcePaths, messageIsLlmVisible, messageStartsLlmUserTurn, migrateCompactionModelSettings, modelFailureMessage, next, nextTransformedPromptRecord, normalizeAzureSettings, normalizeLlamaServerUrl, normalizeMessageContent, normalizeModelFailureSignal, normalizeModelProvider, normalizeModelReference, normalizeProviderKeys, noteCommandAnswer, noteCommandTurnMessage, noteRestoreFetch, openEventSubscription, originalRegistrationCallback, ownedSettingsManagers, parseArgs, parseConflictBytes, parseEngineExplicitQuitCommand, parseGitVersion, parseInteractiveEngineCommand, parseInteractiveEngineMessage, parseSkillUri, partitionByCredentials, plainStatMtimeMs, powershellCandidates, prepareRegistrationCallbacks, presentTaskError, presentationHostInput, prewarmModelApi, printHelp, projectTransformedPrompt, providerOfModelReference, publishEvent, readConflictUrl, readFileChatOrders, readFileChatRecords, readHostInputFormRequest, readInlineCaret, readInlineDraft, readLocalFileChunks, readPipedStdin, readTransferDirectory, reconcileRegistration, recordBlueprintStep, recordClosedStart, recordResumeTimings, recordSettingsWrite, refreshConflictFile, registerConflictBlocks, registerFactoryStartupHandler, registerInitialBindings, registerLazyBuiltin, registrationFields, rehydrateAgentRehydrateError, rehydrateTaskToolError, rehydrateWorkspaceError, rejectMalformedToolArguments, rememberEarlierCompletion, renderTodoCall, renderTodoResult, reopenedCompletionName, repairOrphanToolResults, reparentedSegments, reportDiagnostics, requestedThinkingLevelForModelSwitch, requireTimerMs, require_from_url, require_int, require_int$1, require_log, require_re, require_timestamp, require_toJS, require_trim_comparator_whitespace, require_util_flow_indent_check, require_util_map_includes, require_visit, reserveQueuedInputAdmission, resetGitProvisionStateForTest, resizeImageInProcess, resolveCompactionModel, resolveGit, resolveGitSync, resolveInlineDraftValue, resolveInstalledGit, resolveInvocationRuntime, resolveRegisteredCommands, resolveResourcePath, resolveToolConcurrency, resolvesCompletionHeader, routeKey, routeNamesPrompt, runCallback, runCommandHandler, runInputHook, runSynchronousCallback, runWithProgress, scheduleToolExecution, selectActivePreviewPaneIndex, selectActiveTabItems, selectConfirmedIndicator, selectReadLinesFromChunks, selectReadLinesFromList, serializeAgentRehydrateError, serializeInteractiveEngineFrame, serializeInteractiveEngineMessage, serializeTodoForAgent, serializeTodoListForAgent, serializeWorkspaceError, sessionBlobHashes, sessionBlobOutput, sessionLifecycleCreation, sessionLifecycleScopes, sessionPosition, sessionScratchDir, setCallbackActivityReporter, settingsWriteOwner, shareCompletionEvidence, showLlamaUi, shownSpanMs, skillUri, splitSearchTextParts, splitSegment, startedAsFork, startupRegistrationTokens, startupSourceId, stopIndex, storeInlineToolOutputs, storeSessionBlobs, streamCutDurationMs, stripVerbatimCompactionPrefix, subagentsLazyBuiltinSpec, summarizeLegacySession, takeInlineToolOutput, takeInlineToolOutputEntry, taskClockOf, taskClockRunning, taskClocksFor, taskElapsedMs, taskPromptHost, thinkingLevelForModelSwitch, timeCheckoutRestore, timeRestorePhase, toResolvedPaths, tokenize, toolChangeSupport, toolOutputUrl, toolOutputUrlHash, trackAdmittedAgentTask, trackTranspileCacheWrite, trackWindowsDirectorySecurityWork, transferFile, transformedPromptOwner, transpileCacheWritesSettled, unpackIds, unreadablePathError, unreadableTrustSettingsDiagnostics, unwritablePathError, userLikeContentBlockIsLlmVisible, validateEventSource, validateSubscriptionAdmission, verbatimRecallHint, verifyWindowsDirectorySecurity, verifyWindowsDirectorySecurityAsync, waitResultTail, waitStatus, watchHeldPromptAttention, withGitProvisionSettingsForTest, withImagesBlocked, withInlineDraft, withOwnResourceAdmission, withResourceAdmission, withTranspileCacheWriteOwner, withWindowsDirectorySecurityOwner, withoutCarriedToolOutput, withoutSearchPosition, writeChunksAtomically, writeLinesAtomically, writeRenderers };
|
|
20037
|
+
export { AgentRehydrateError, AgentReleaseConfigError, CacheWarmer, ChildCatalog, CommandDeliveries, DEFAULT_MAX_MESSAGE_BYTES, DEFAULT_SUBSCRIPTION_MAX_CONCURRENT, EMPTY_OUTPUT_TEXT, EngineHealthController, ExtensionInputComponent, ExtensionSelectorComponent, FirstTimeSetupComponent, GIT_RELEASE, HistorySearchPositions, IMAGE_RESIZE_WORKER_RESPONSE_TYPE, LEGACY_AZURE_PROVIDER, LlamaClient, MAX_INDEXED_ENTRY_CHARS, MULTI_SUBMIT_LABEL, MarkdownContentCache, McpClient, MultiSelectView, NestedGitignore, NestedToolCallRunner, NoUsableModelError, QuestionParamsSchema, RESERVED_LABELS, RESUME_TIMINGS_TYPE, RemoteModelCatalog, RemoteQueuePause, ReopenedCompletionHeaders, ResumeTimingsRecorder, SEARCH_PART_CHARS, SESSIONS_TRANSFER_DIRECTORY, SESSION_STORAGE_JOIN, STORAGE_JOIN_COMMAND, SUMMARY_COMPACTION_PREFIX, SessionKeyDigests, SessionStorageSelectionSchema, SettingsSchema, SqlSessionSearchIndex, StorageImportIncompleteError, StorageSelectionSchema, StorageTransferError, StringEnum, TOOL_OUTPUT_ENTRY_TYPE, TRANSPILE_CACHE_WRITE_WAIT_MS, TaskElapsedClocks, TaskToolError, ToolExecutionScheduler, TransportEvents, UNORDERED_ADMISSION, VERBATIM_COMPACTION_PREFIX, VERIFICATION_PENDING_REASON, WorkspaceBindingError, WorkspaceCollectionError, WorkspaceConfigError, WorkspaceDriftError, WorkspaceError, WorkspaceGitError, WorkspacePublicationError, WorkspaceRestoreError, WorkspaceSandboxError, WorkspaceSnapshotError, WorkspaceTimeoutError, WrappingSelect, acceptsForkReplay, addResource, adoptCommandSession, appendFileChatRecords, assertSessionBlobStore, assertSettingsWrites, attachCleanupCause, bindRegistrationCallbacks, bindTaskClock, bindTaskClockSource, blueprintDigest, bodyWidths, buildDirectoryTree, buildDirectoryTreeFromOperations, buildToolStatusReport, cancelInitialBinding, cancelPausedOwnerTasks, cancelReceiptSentence, cancelReceiptStatus, captureForkReplayPair, captureRegistrationInvocation, carriedTransformedPrompt, carryCompletionEvidence, chatAnswerIntent, chatNumberingFor, childPresentationInput, claimInteractiveBind, classifyCompactionModel, cleanupFailureSummary, collectAgentTasks, collectCommandDeliveries, collectExtensionPackageWarnings, collectFlags, collectMarkdownTransformers, collectPackageInstallWarnings, collectRegisteredTools, collectSettingsDiagnostics, columnWidths, compareCreated, compareFrozen, computeFocusedOptionHasPreview, conflictEntries, convertImageBytesToPng, convertToLlm, convertToLlmWithForkBoundaries, convertToPng, copyRegistrations, copySessionBlobs, createAccumulator, createBranchSummaryMessage, createCustomMessage, createInvocationBindings, createLazyBuiltinFactory, createManagedTaskClocks, createProviderAlias, createSessionHistoryToolDefinition, createSkillRouter, createVerbatimCompactionMessage, crossTabLeftWidthWithDonation, currentResourceAdmission, decideLayout, deferCommandTurn, deferMessagesInterleavedWithToolBatch, deferRestorePhase, deleteFileChatRecords, describeToolSelection, detectLinuxLibc, diffLines, diffWords, discoverChatFile, drainProcessStdio, drainWindowsDirectorySecurityReads, dropDeferredCommandTurn, ensurePngTranscoder, ensureTool, errorMessage$1 as errorMessage, execCommand, extensionRefreshRejection, extensionSource, failedProviderAccount, filterSupersededHerdrIntegrationPaths, findEntryRenderer, findMessageRenderer, findToolDefinition, findWorkspaceError, fixUtf8Stream, flush, forkReplayFilter, forkToolDeclarations, formatAnswerScalar, formatBytes, formatNoUsableModelMessage, formatPackageInstallWarning, formatResumeTimings, formatTokenSegment, formatToolStatus, genBridge, getBuiltinExtensionEntryLabel, getClientIdentity, getCommandEnv, getGitDistributionTarget, getGitInstallDir, getGitReleaseMarker, getGitShellEnvironment, getGitShellEnvironmentAsync, getGitStatus, getGitStatusAsync, getLatestVersion, getLazyBuiltinSpec, getLoaderAgentDirs, getPromptCacheTtlMs, getStorageAdapterHostModules, getToolEnv, getToolPath, getVirtualModules, gitInstallCommand, gitignoreMatcher, hasExtensionHandlers, hasFileChatRecords, hasLazyBuiltinSpec, hasQuitStoppableCommands, hasRecordedTransformedPrompt, hasTaskPromptHost, hasTransformedPrompt, heldPromptInput, heldPrompts, initialBindScope, inlineToolOutput, insertForcedOptionsBeforeTerminator, invocationExtension, invocationRuntime, isAgentRehydrateError, isAgentReleaseConfigError, isBashToolResult, isContentFilterRefusal, isEditToolResult, isFindToolResult, isForkHeader, isHeldPromptInput, isInsideInputHook, isJsonValue, isLocalOnlySessionStorage, isLsToolResult, isNativeBuiltinExtensionPath, isOfflineModeEnabled, isPowerShellToolResult, isPresentationHostInput, isProviderCredentialRejection, isReadToolResult, isRetryableAgentRehydrateError, isRetryableModelFailure, isRetryableSameModelFailure, isRetryableWorkspaceError, isSafetyRefusalFailure, isSourceBuiltinExtensionPath, isStorageImportIncompleteError, isStorageTransferError, isTaskToolError, isToolCallEventType, isTruthyEnvFlag, isUnrecognizedModelFailure, isVerbatimCompactionMessage, isWorkspaceBindingError, isWorkspaceCollectionError, isWorkspaceConfigError, isWorkspaceDriftError, isWorkspaceError, isWorkspaceGitError, isWorkspacePublicationError, isWorkspaceRestoreError, isWorkspaceSandboxError, isWorkspaceSnapshotError, isWorkspaceTimeoutError, isWriteToolResult, joinCommandSend, joinCommandTurn, killQuitStoppableCommandsNow, latestLegacyMessageTime, latestResumeTimings, legacyCompletionTarget, lifecycleScopeForOwner, llamaInferenceUrl, loadVirtualModules, loaderHostModulesTestHooks, lockSharedWithHolder, mergeExtensionWarnings, mergeResourcePaths, messageIsLlmVisible, messageStartsLlmUserTurn, migrateCompactionModelSettings, modelFailureMessage, next, nextTransformedPromptRecord, normalizeAzureSettings, normalizeLlamaServerUrl, normalizeMessageContent, normalizeModelFailureSignal, normalizeModelProvider, normalizeModelReference, normalizeProviderKeys, noteCommandAnswer, noteCommandTurnMessage, noteRestoreFetch, observeFailedProviderAccount, openEventSubscription, originalRegistrationCallback, ownedSettingsManagers, parseArgs, parseConflictBytes, parseEngineExplicitQuitCommand, parseGitVersion, parseInteractiveEngineCommand, parseInteractiveEngineMessage, parseSkillUri, partitionByCredentials, plainStatMtimeMs, powershellCandidates, prepareRegistrationCallbacks, presentTaskError, presentationHostInput, prewarmModelApi, printHelp, projectTransformedPrompt, providerAccount, providerOfModelReference, publishEvent, readConflictUrl, readFileChatOrders, readFileChatRecords, readHostInputFormRequest, readInlineCaret, readInlineDraft, readLedger, readLocalFileChunks, readPipedStdin, readTransferDirectory, reconcileRegistration, recordBlueprintStep, recordClosedStart, recordResumeTimings, recordSettingsWrite, refreshConflictFile, registerConflictBlocks, registerFactoryStartupHandler, registerInitialBindings, registerLazyBuiltin, registrationFields, rehydrateAgentRehydrateError, rehydrateTaskToolError, rehydrateWorkspaceError, rejectMalformedToolArguments, rememberEarlierCompletion, renderTodoCall, renderTodoResult, reopenedCompletionName, repairOrphanToolResults, reparentedSegments, reportDiagnostics, reportWorktreeLockProgress, repositoryKey, requestedThinkingLevelForModelSwitch, requireTimerMs, require_from_url, require_int, require_int$1, require_log, require_re, require_timestamp, require_toJS, require_trim_comparator_whitespace, require_util_flow_indent_check, require_util_map_includes, require_visit, reserveQueuedInputAdmission, resetGitProvisionStateForTest, resizeImageInProcess, resolveCompactionModel, resolveGit, resolveGitSync, resolveInlineDraftValue, resolveInstalledGit, resolveInvocationRuntime, resolveRegisteredCommands, resolveResourcePath, resolveToolConcurrency, resolvesCompletionHeader, rootKey, routeKey, routeNamesPrompt, runCallback, runCommandHandler, runInputHook, runSynchronousCallback, runWithProgress, scheduleToolExecution, selectActivePreviewPaneIndex, selectActiveTabItems, selectConfirmedIndicator, selectReadLinesFromChunks, selectReadLinesFromList, serializeAgentRehydrateError, serializeInteractiveEngineFrame, serializeInteractiveEngineMessage, serializeTodoForAgent, serializeTodoListForAgent, serializeWorkspaceError, sessionBlobHashes, sessionBlobOutput, sessionLifecycleCreation, sessionLifecycleScopes, sessionPosition, sessionScratchDir, setCallbackActivityReporter, settingsWriteOwner, shareCompletionEvidence, showLlamaUi, shownSpanMs, skillUri, splitSearchTextParts, splitSegment, startedAsFork, startupRegistrationTokens, startupSourceId, stopIndex, storeInlineToolOutputs, storeSessionBlobs, streamCutDurationMs, stripVerbatimCompactionPrefix, subagentsLazyBuiltinSpec, summarizeLegacySession, takeInlineToolOutput, takeInlineToolOutputEntry, taskClockOf, taskClockRunning, taskClocksFor, taskElapsedMs, taskPromptHost, thinkingLevelForModelSwitch, timeCheckoutRestore, timeRestorePhase, toResolvedPaths, tokenize, toolChangeSupport, toolOutputUrl, toolOutputUrlHash, trackAdmittedAgentTask, trackTranspileCacheWrite, trackWindowsDirectorySecurityWork, transferFile, transformedPromptOwner, transpileCacheWritesSettled, unpackIds, unreadablePathError, unreadableTrustSettingsDiagnostics, unwritablePathError, updateLedger, userLikeContentBlockIsLlmVisible, validateEventSource, validateSubscriptionAdmission, verbatimRecallHint, verifyWindowsDirectorySecurity, verifyWindowsDirectorySecurityAsync, waitResultTail, waitStatus, watchHeldPromptAttention, withGitProvisionSettingsForTest, withImagesBlocked, withInlineDraft, withOwnResourceAdmission, withResourceAdmission, withTranspileCacheWriteOwner, withWindowsDirectorySecurityOwner, withWorktreeLockProgress, withoutCarriedToolOutput, withoutSearchPosition, workspaceKey, writeChunksAtomically, writeLinesAtomically, writeRenderers };
|
|
19710
20038
|
|
|
19711
|
-
//# sourceMappingURL=startup-0-1-
|
|
20039
|
+
//# sourceMappingURL=startup-0-1-RTASI3HG.js.map
|
|
19712
20040
|
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
19713
20041
|
// demand that fails in a process an in-place update left running says to restart.
|
|
19714
20042
|
function __atomicOnDemandFailed(error, feature) {
|
|
19715
20043
|
return (async () => {
|
|
19716
20044
|
const root = new URL("../", import.meta.url);
|
|
19717
20045
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
19718
|
-
const key = `${root.href}#0.10.
|
|
20046
|
+
const key = `${root.href}#0.10.16-alpha.1`;
|
|
19719
20047
|
let release = releases.get(key);
|
|
19720
20048
|
if (release === undefined) {
|
|
19721
20049
|
const current = (async () => {
|
|
@@ -19743,7 +20071,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
19743
20071
|
} catch {
|
|
19744
20072
|
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
19745
20073
|
}
|
|
19746
|
-
const updatedTo = typeof installed === "string" && installed !== "0.10.
|
|
20074
|
+
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;
|
|
19747
20075
|
if (updatedTo === undefined) throw error;
|
|
19748
20076
|
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
19749
20077
|
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|