@bastani/atomic 0.10.4 → 0.10.5-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 +44 -0
- package/dist/_shared/compile-cache-warmup-host-RU5L7I7A.js +1 -1
- package/dist/_shared/dist-KOELCESV.js +48 -3
- package/dist/_shared/fork-row-index-UAUAQRD5.js +47 -2
- package/dist/_shared/http-YFAPTIZD.js +16 -4
- package/dist/_shared/http-YFAPTIZD.js.map +1 -1
- package/dist/_shared/lib-4PES5P4V.js +59 -14
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +1706 -258
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +317 -64
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/{mode-shared-HP7GUA7J.js → mode-shared-2QJSCUM6.js} +432 -81
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -0
- package/dist/_shared/p0-cli-BB45ZQY6.js +3482 -0
- package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -0
- package/dist/_shared/p0-cli-GUFK7TPN.js +2 -2838
- package/dist/_shared/p0-cli-GUFK7TPN.js.map +1 -1
- package/dist/_shared/{p1a-prewarm-YK3KDTLN.js → p1a-prewarm-UQY3X2UK.js} +270 -73
- package/dist/_shared/p1a-prewarm-UQY3X2UK.js.map +1 -0
- package/dist/_shared/{p1b-elig-PXQA2FYP.js → p1b-elig-ENCUPKKJ.js} +190 -121
- package/dist/_shared/p1b-elig-ENCUPKKJ.js.map +1 -0
- package/dist/_shared/p2-common-YLSYXMDQ.js +1 -3
- package/dist/_shared/p2-common-YLSYXMDQ.js.map +1 -1
- package/dist/_shared/p2-shell-TJBYQMCJ.js +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +500 -127
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +4 -4
- package/dist/_shared/sdk-WQIOHVKO.js +56 -11
- package/dist/_shared/session-data-AHTU7IS6.js +48 -3
- package/dist/_shared/session-manager-list-2BLEEZVG.js +2 -2
- package/dist/_shared/settings-startup-65YEWRV2.js.map +1 -1
- package/dist/_shared/sql-session-store-5FD3WBMZ.js +57 -12
- package/dist/_shared/{startup-0-0-X4NF3GKM.js → startup-0-0-TYUFUOJZ.js} +519 -316
- package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +1 -0
- package/dist/_shared/{startup-0-1-7QTG6VJZ.js → startup-0-1-D4LGGINF.js} +284 -81
- package/dist/_shared/startup-0-1-D4LGGINF.js.map +1 -0
- package/dist/_shared/{startup-0-2-KFDYPDJK.js → startup-0-2-SZGQIWHI.js} +483 -154
- package/dist/_shared/startup-0-2-SZGQIWHI.js.map +1 -0
- package/dist/_shared/startup-0-3-T4DVFYWX.js +340 -110
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
- package/dist/_shared/startup-0-4-HN5EB4K7.js +261 -59
- package/dist/_shared/startup-0-4-HN5EB4K7.js.map +1 -1
- package/dist/_shared/startup-0-5-OHJNE6JH.js +421 -148
- package/dist/_shared/startup-0-5-OHJNE6JH.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +62 -11
- 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 +12 -11
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +53 -158
- package/dist/_shared/startup-15-0-YUKGAC63.js.map +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +231 -46
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +115 -35
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-KQJBDKRU.js → startup-8-1-SJW2GMAM.js} +203 -62
- package/dist/_shared/startup-8-1-SJW2GMAM.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +55 -10
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +47 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +48 -3
- package/dist/builtin/intercom/CHANGELOG.md +21 -0
- package/dist/builtin/intercom/README.md +0 -1
- package/dist/builtin/intercom/broker/broker-instance.ts +13 -57
- package/dist/builtin/intercom/broker/broker-process.ts +30 -10
- package/dist/builtin/intercom/broker/broker-routing.ts +12 -2
- package/dist/builtin/intercom/broker/broker.bundle.mjs +2557 -498
- package/dist/builtin/intercom/broker/broker.ts +164 -55
- package/dist/builtin/intercom/broker/client.ts +36 -16
- package/dist/builtin/intercom/broker/control.ts +83 -20
- package/dist/builtin/intercom/broker/durable-ended-queue.ts +65 -19
- package/dist/builtin/intercom/broker/host-command-environment.ts +7 -2
- package/dist/builtin/intercom/broker/multinode-router.ts +1675 -387
- package/dist/builtin/intercom/broker/multinode-state-store.ts +10 -0
- package/dist/builtin/intercom/broker/paths.ts +68 -6
- package/dist/builtin/intercom/broker/pending-send-registry.ts +5 -0
- package/dist/builtin/intercom/broker/registration-bounds.ts +38 -0
- package/dist/builtin/intercom/broker/retiring-broker-check.ts +178 -0
- package/dist/builtin/intercom/broker/return-paths.ts +268 -7
- package/dist/builtin/intercom/broker/send-handler.ts +253 -28
- package/dist/builtin/intercom/broker/send-order-gate.ts +410 -0
- package/dist/builtin/intercom/broker/spawn.ts +950 -202
- package/dist/builtin/intercom/broker/sql-lease-store.ts +37 -0
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +7 -0
- package/dist/builtin/intercom/broker/windows-cwd.ts +546 -0
- package/dist/builtin/intercom/index.bundle.mjs +3506 -2328
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/retry-policy.ts +4 -0
- package/dist/builtin/intercom/types.ts +2 -0
- 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 +336 -86
- package/dist/builtin/web-access/index.bundle.mjs +23 -38
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/bun/cli.js +1 -1
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/internal-intercom-broker.js +119 -4
- package/dist/bun/internal-intercom-broker.js.map +1 -1
- package/dist/bun/register-theme-validator.js +6 -0
- package/dist/bun/register-theme-validator.js.map +1 -0
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +1102 -0
- package/dist/cli/auth-cli.code.js.map +1 -0
- package/dist/cli/auth-cli.impl.js +30 -1096
- package/dist/cli/auth-cli.impl.js.map +1 -1
- package/dist/cli/auth-cli.js +11 -7
- package/dist/cli/blueprint-command.code.js +906 -0
- package/dist/cli/blueprint-command.code.js.map +1 -0
- package/dist/cli/blueprint-command.impl.js +30 -900
- package/dist/cli/blueprint-command.impl.js.map +1 -1
- package/dist/cli/blueprint-command.js +11 -7
- package/dist/cli/intercom-command.code.js +153 -0
- package/dist/cli/intercom-command.code.js.map +1 -0
- package/dist/cli/intercom-command.impl.js +33 -105
- package/dist/cli/intercom-command.impl.js.map +1 -1
- package/dist/cli/intercom-command.js +11 -7
- package/dist/cli/list-models.code.js +60 -0
- package/dist/cli/list-models.code.js.map +1 -0
- package/dist/cli/list-models.impl.js +33 -57
- package/dist/cli/list-models.impl.js.map +1 -1
- package/dist/cli/list-models.js +11 -7
- package/dist/cli/session-picker.code.js +55 -0
- package/dist/cli/session-picker.code.js.map +1 -0
- package/dist/cli/session-picker.impl.js +33 -52
- package/dist/cli/session-picker.impl.js.map +1 -1
- package/dist/cli/session-picker.js +11 -7
- package/dist/cli/startup-ui.code.js +5 -0
- package/dist/cli/startup-ui.code.js.map +1 -0
- package/dist/cli/startup-ui.impl.js +35 -4
- package/dist/cli/startup-ui.js +11 -7
- package/dist/cli/storage-command.code.js +3 -0
- package/dist/cli/storage-command.code.js.map +1 -0
- package/dist/cli/storage-command.impl.js +35 -2
- package/dist/cli/storage-command.js +11 -7
- package/dist/cli/storage-search-session.code.js +189 -0
- package/dist/cli/storage-search-session.code.js.map +1 -0
- package/dist/cli/storage-search-session.impl.js +33 -186
- package/dist/cli/storage-search-session.impl.js.map +1 -1
- package/dist/cli/storage-search-session.js +11 -7
- package/dist/cli/team-command.code.js +217 -0
- package/dist/cli/team-command.code.js.map +1 -0
- package/dist/cli/team-command.impl.js +32 -213
- package/dist/cli/team-command.impl.js.map +1 -1
- package/dist/cli/team-command.js +11 -7
- package/dist/cli.js +60 -11
- package/dist/cli.js.map +1 -1
- package/dist/config.js +1 -1
- package/dist/core/agent-session-methods.d.ts +4 -3
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +5 -0
- package/dist/core/compaction/compaction.d.ts +6 -0
- package/dist/core/compaction/model-resolver.d.ts +1 -1
- package/dist/core/debug.code.js +3 -0
- package/dist/core/debug.code.js.map +1 -0
- package/dist/core/debug.impl.js +35 -2
- package/dist/core/debug.js +11 -7
- package/dist/core/default-model-api-prewarm.d.ts +5 -0
- package/dist/core/export-html/card-projection.code.js +257 -0
- package/dist/core/export-html/card-projection.code.js.map +1 -0
- package/dist/core/export-html/card-projection.impl.js +34 -255
- package/dist/core/export-html/card-projection.impl.js.map +1 -1
- package/dist/core/export-html/card-projection.js +11 -7
- package/dist/core/export-html/index.code.js +655 -0
- package/dist/core/export-html/index.code.js.map +1 -0
- package/dist/core/export-html/index.impl.js +30 -604
- package/dist/core/export-html/index.impl.js.map +1 -1
- package/dist/core/export-html/index.js +11 -7
- package/dist/core/export-html/json-spans.code.js +3 -0
- package/dist/core/export-html/json-spans.code.js.map +1 -0
- package/dist/core/export-html/json-spans.impl.js +35 -2
- package/dist/core/export-html/json-spans.js +11 -7
- package/dist/core/export-html/oversized-render-inputs.code.js +125 -0
- package/dist/core/export-html/oversized-render-inputs.code.js.map +1 -0
- package/dist/core/export-html/oversized-render-inputs.impl.js +31 -120
- package/dist/core/export-html/oversized-render-inputs.impl.js.map +1 -1
- package/dist/core/export-html/oversized-render-inputs.js +11 -7
- package/dist/core/export-html/tool-renderer.code.js +350 -0
- package/dist/core/export-html/tool-renderer.code.js.map +1 -0
- package/dist/core/export-html/tool-renderer.impl.js +33 -347
- package/dist/core/export-html/tool-renderer.impl.js.map +1 -1
- package/dist/core/export-html/tool-renderer.js +11 -7
- package/dist/core/extensions/jiti-loader.code.js +3 -0
- package/dist/core/extensions/jiti-loader.code.js.map +1 -0
- package/dist/core/extensions/jiti-loader.impl.js +35 -2
- package/dist/core/extensions/jiti-loader.js +11 -7
- package/dist/core/extensions/jiti-static-loader.code.js +3 -0
- package/dist/core/extensions/jiti-static-loader.code.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.impl.js +35 -2
- package/dist/core/extensions/jiti-static-loader.js +11 -7
- package/dist/core/extensions/loader-host-modules.code.js +3 -0
- package/dist/core/extensions/loader-host-modules.code.js.map +1 -0
- package/dist/core/extensions/loader-host-modules.impl.js +35 -2
- package/dist/core/extensions/loader-host-modules.js +11 -7
- package/dist/core/extensions/loader-virtual-modules.d.ts +1 -6
- package/dist/core/extensions/loader-virtual-modules.js +1 -1
- package/dist/core/extensions/runner-context.js +3 -3
- package/dist/core/extensions/session-events.d.ts +4 -0
- package/dist/core/extensions/session-events.js.map +1 -1
- package/dist/core/intercom-broker-control-host.code.js +5 -0
- package/dist/core/intercom-broker-control-host.code.js.map +1 -0
- package/dist/core/intercom-broker-control-host.impl.js +35 -4
- package/dist/core/intercom-broker-control-host.js +11 -7
- package/dist/core/intercom-broker-control.code.js +63 -0
- package/dist/core/intercom-broker-control.code.js.map +1 -0
- package/dist/core/intercom-broker-control.d.ts +21 -0
- package/dist/core/intercom-broker-control.impl.js +35 -17
- package/dist/core/intercom-broker-control.impl.js.map +1 -1
- package/dist/core/intercom-broker-control.js +11 -7
- package/dist/core/package-manager-storage-adapters.code.js +3 -0
- package/dist/core/package-manager-storage-adapters.code.js.map +1 -0
- package/dist/core/package-manager-storage-adapters.impl.js +35 -2
- package/dist/core/package-manager-storage-adapters.js +11 -7
- package/dist/core/process-start-token.d.ts +8 -2
- package/dist/core/process-tree-containment.d.ts +27 -0
- package/dist/core/queued-message-delivery.d.ts +5 -2
- package/dist/core/resume/blueprint/process.d.ts +3 -1
- package/dist/core/sdk.code.js +9 -0
- package/dist/core/sdk.code.js.map +1 -0
- package/dist/core/sdk.impl.js +35 -8
- package/dist/core/sdk.js +11 -7
- package/dist/core/session-manager-core.d.ts +15 -5
- package/dist/core/session-manager-core.js +195 -38
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-list.code.js +3 -0
- package/dist/core/session-manager-list.code.js.map +1 -0
- package/dist/core/session-manager-list.impl.js +35 -2
- package/dist/core/session-manager-list.js +11 -7
- package/dist/core/session-manager-types.d.ts +20 -0
- package/dist/core/session-manager.code.js +8 -0
- package/dist/core/session-manager.code.js.map +1 -0
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.impl.js +35 -7
- package/dist/core/session-manager.js +11 -7
- package/dist/core/session-storage.code.js +3 -0
- package/dist/core/session-storage.code.js.map +1 -0
- package/dist/core/session-storage.impl.js +35 -2
- package/dist/core/session-storage.js +11 -7
- package/dist/core/storage/file-identity.d.ts +3 -0
- package/dist/core/storage/file-identity.js +296 -86
- package/dist/core/storage/file-identity.js.map +1 -1
- package/dist/core/storage/index.d.ts +1 -1
- package/dist/core/storage/index.js +52 -7
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +47 -2
- package/dist/core/storage/node-sqlite.js +49 -4
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.code.js +37 -0
- package/dist/core/storage/offline-snapshot-file.code.js.map +1 -0
- package/dist/core/storage/offline-snapshot-file.impl.js +33 -34
- package/dist/core/storage/offline-snapshot-file.impl.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.js +11 -7
- package/dist/core/storage/provider.js +52 -7
- package/dist/core/storage/selection.js +49 -4
- package/dist/core/storage/session/branch-fork-source.code.js +146 -0
- package/dist/core/storage/session/branch-fork-source.code.js.map +1 -0
- package/dist/core/storage/session/branch-fork-source.impl.js +32 -97
- package/dist/core/storage/session/branch-fork-source.impl.js.map +1 -1
- package/dist/core/storage/session/branch-fork-source.js +11 -7
- package/dist/core/storage/session/card-view.code.js +60 -0
- package/dist/core/storage/session/card-view.code.js.map +1 -0
- package/dist/core/storage/session/card-view.impl.js +34 -58
- package/dist/core/storage/session/card-view.impl.js.map +1 -1
- package/dist/core/storage/session/card-view.js +11 -7
- package/dist/core/storage/session/child-reader.code.js +139 -0
- package/dist/core/storage/session/child-reader.code.js.map +1 -0
- package/dist/core/storage/session/child-reader.d.ts +1 -0
- package/dist/core/storage/session/child-reader.impl.js +33 -91
- package/dist/core/storage/session/child-reader.impl.js.map +1 -1
- package/dist/core/storage/session/child-reader.js +11 -7
- package/dist/core/storage/session/chunked-resume-projection.code.js +3 -0
- package/dist/core/storage/session/chunked-resume-projection.code.js.map +1 -0
- package/dist/core/storage/session/chunked-resume-projection.impl.js +35 -2
- package/dist/core/storage/session/chunked-resume-projection.js +11 -7
- package/dist/core/storage/session/expanded-child-details.code.js +684 -0
- package/dist/core/storage/session/expanded-child-details.code.js.map +1 -0
- package/dist/core/storage/session/expanded-child-details.impl.js +31 -634
- package/dist/core/storage/session/expanded-child-details.impl.js.map +1 -1
- package/dist/core/storage/session/expanded-child-details.js +11 -7
- package/dist/core/storage/session/fork-row-bytes.code.js +3 -0
- package/dist/core/storage/session/fork-row-bytes.code.js.map +1 -0
- package/dist/core/storage/session/fork-row-bytes.impl.js +35 -2
- package/dist/core/storage/session/fork-row-bytes.js +11 -7
- package/dist/core/storage/session/fork-row-index.code.js +3 -0
- package/dist/core/storage/session/fork-row-index.code.js.map +1 -0
- package/dist/core/storage/session/fork-row-index.impl.js +35 -2
- package/dist/core/storage/session/fork-row-index.js +11 -7
- package/dist/core/storage/session/fork-staging.code.js +580 -0
- package/dist/core/storage/session/fork-staging.code.js.map +1 -0
- package/dist/core/storage/session/fork-staging.impl.js +30 -574
- package/dist/core/storage/session/fork-staging.impl.js.map +1 -1
- package/dist/core/storage/session/fork-staging.js +11 -7
- package/dist/core/storage/session/fork-window.code.js +522 -0
- package/dist/core/storage/session/fork-window.code.js.map +1 -0
- package/dist/core/storage/session/fork-window.impl.js +30 -471
- package/dist/core/storage/session/fork-window.impl.js.map +1 -1
- package/dist/core/storage/session/fork-window.js +11 -7
- package/dist/core/storage/session/history-pages.code.js +3 -0
- package/dist/core/storage/session/history-pages.code.js.map +1 -0
- package/dist/core/storage/session/history-pages.impl.js +35 -2
- package/dist/core/storage/session/history-pages.js +11 -7
- package/dist/core/storage/session/jsonl-entry-projection.code.js +3 -0
- package/dist/core/storage/session/jsonl-entry-projection.code.js.map +1 -0
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +35 -2
- package/dist/core/storage/session/jsonl-entry-projection.js +11 -7
- package/dist/core/storage/session/jsonl-session-store.code.js +3 -0
- package/dist/core/storage/session/jsonl-session-store.code.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.impl.js +35 -2
- package/dist/core/storage/session/jsonl-session-store.js +11 -7
- package/dist/core/storage/session/memory-session-store.code.js +3 -0
- package/dist/core/storage/session/memory-session-store.code.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.impl.js +35 -2
- package/dist/core/storage/session/memory-session-store.js +11 -7
- package/dist/core/storage/session/pinned-branch-resume.code.js +117 -0
- package/dist/core/storage/session/pinned-branch-resume.code.js.map +1 -0
- package/dist/core/storage/session/pinned-branch-resume.impl.js +33 -69
- package/dist/core/storage/session/pinned-branch-resume.impl.js.map +1 -1
- package/dist/core/storage/session/pinned-branch-resume.js +11 -7
- package/dist/core/storage/session/released-history-files.code.js +465 -0
- package/dist/core/storage/session/released-history-files.code.js.map +1 -0
- package/dist/core/storage/session/released-history-files.impl.js +32 -461
- package/dist/core/storage/session/released-history-files.impl.js.map +1 -1
- package/dist/core/storage/session/released-history-files.js +11 -7
- package/dist/core/storage/session/resident-fork-rows.code.js +57 -0
- package/dist/core/storage/session/resident-fork-rows.code.js.map +1 -0
- package/dist/core/storage/session/resident-fork-rows.impl.js +32 -53
- package/dist/core/storage/session/resident-fork-rows.impl.js.map +1 -1
- package/dist/core/storage/session/resident-fork-rows.js +11 -7
- package/dist/core/storage/session/session-resume.code.js +3 -0
- package/dist/core/storage/session/session-resume.code.js.map +1 -0
- package/dist/core/storage/session/session-resume.impl.js +35 -2
- package/dist/core/storage/session/session-resume.js +11 -7
- package/dist/core/storage/session/snapshot-cut.code.js +3 -0
- package/dist/core/storage/session/snapshot-cut.code.js.map +1 -0
- package/dist/core/storage/session/snapshot-cut.impl.js +35 -2
- package/dist/core/storage/session/snapshot-cut.js +11 -7
- package/dist/core/storage/session/snapshot-history.code.js +107 -0
- package/dist/core/storage/session/snapshot-history.code.js.map +1 -0
- package/dist/core/storage/session/snapshot-history.impl.js +34 -60
- package/dist/core/storage/session/snapshot-history.impl.js.map +1 -1
- package/dist/core/storage/session/snapshot-history.js +11 -7
- package/dist/core/storage/session/sql-session-store.code.js +3 -0
- package/dist/core/storage/session/sql-session-store.code.js.map +1 -0
- package/dist/core/storage/session/sql-session-store.impl.js +35 -2
- package/dist/core/storage/session/sql-session-store.js +11 -7
- package/dist/core/storage/session/tree-outline.code.js +3 -0
- package/dist/core/storage/session/tree-outline.code.js.map +1 -0
- package/dist/core/storage/session/tree-outline.impl.js +35 -2
- package/dist/core/storage/session/tree-outline.js +11 -7
- package/dist/core/storage/session/tree-presentation.code.js +342 -0
- package/dist/core/storage/session/tree-presentation.code.js.map +1 -0
- package/dist/core/storage/session/tree-presentation.impl.js +31 -337
- package/dist/core/storage/session/tree-presentation.impl.js.map +1 -1
- package/dist/core/storage/session/tree-presentation.js +11 -7
- package/dist/core/storage/session/types.d.ts +26 -0
- package/dist/core/storage/storage-status.code.js +3 -0
- package/dist/core/storage/storage-status.code.js.map +1 -0
- package/dist/core/storage/storage-status.impl.js +35 -2
- package/dist/core/storage/storage-status.js +11 -7
- package/dist/core/storage/team.code.js +3 -0
- package/dist/core/storage/team.code.js.map +1 -0
- package/dist/core/storage/team.impl.js +35 -2
- package/dist/core/storage/team.js +11 -7
- package/dist/core/structured-output/index.code.js +3 -0
- package/dist/core/structured-output/index.code.js.map +1 -0
- package/dist/core/structured-output/index.impl.js +35 -2
- package/dist/core/structured-output/index.js +11 -7
- package/dist/core/tasks/command-output.d.ts +4 -1
- package/dist/core/tasks/supervisor.d.ts +2 -0
- package/dist/core/tasks/task-completion-entry.code.js +254 -0
- package/dist/core/tasks/task-completion-entry.code.js.map +1 -0
- package/dist/core/tasks/task-completion-entry.impl.js +33 -251
- package/dist/core/tasks/task-completion-entry.impl.js.map +1 -1
- package/dist/core/tasks/task-completion-entry.js +11 -7
- package/dist/core/tasks/task-file-history.code.js +424 -0
- package/dist/core/tasks/task-file-history.code.js.map +1 -0
- package/dist/core/tasks/task-file-history.impl.js +32 -375
- package/dist/core/tasks/task-file-history.impl.js.map +1 -1
- package/dist/core/tasks/task-file-history.js +11 -7
- package/dist/core/tasks/{task-reference-archive.impl.js → task-reference-archive.code.js} +51 -6
- package/dist/core/tasks/{task-reference-archive.impl.js.map → task-reference-archive.code.js.map} +1 -1
- package/dist/core/tasks/task-reference-archive.js +11 -7
- package/dist/core/tasks/{task-reference-identity.impl.js → task-reference-identity.code.js} +1 -1
- package/dist/core/tasks/{task-reference-identity.impl.js.map → task-reference-identity.code.js.map} +1 -1
- package/dist/core/tasks/task-reference-identity.js +11 -7
- package/dist/core/tasks/task-reference-stream.code.js +3 -0
- package/dist/core/tasks/task-reference-stream.code.js.map +1 -0
- package/dist/core/tasks/task-reference-stream.impl.js +35 -2
- package/dist/core/tasks/task-reference-stream.js +11 -7
- package/dist/core/tasks/task-unsaved-answer.code.js +3 -0
- package/dist/core/tasks/task-unsaved-answer.code.js.map +1 -0
- package/dist/core/tasks/task-unsaved-answer.impl.js +35 -2
- package/dist/core/tasks/task-unsaved-answer.js +11 -7
- package/dist/core/tasks/task-view-source.code.js +3 -0
- package/dist/core/tasks/task-view-source.code.js.map +1 -0
- package/dist/core/tasks/task-view-source.d.ts +9 -0
- package/dist/core/tasks/task-view-source.impl.js +35 -2
- package/dist/core/tasks/task-view-source.js +12 -8
- package/dist/core/tools/read-url.code.js +1530 -0
- package/dist/core/tools/read-url.code.js.map +1 -0
- package/dist/core/tools/read-url.impl.js +30 -1524
- package/dist/core/tools/read-url.impl.js.map +1 -1
- package/dist/core/tools/read-url.js +11 -7
- package/dist/core/worktree-snapshot/blob-store.js +50 -5
- package/dist/core/worktree-snapshot/errors.code.js +6 -0
- package/dist/core/worktree-snapshot/errors.code.js.map +1 -0
- package/dist/core/worktree-snapshot/errors.impl.js +35 -5
- package/dist/core/worktree-snapshot/errors.js +11 -7
- package/dist/core/worktree-snapshot/session-index-reset.code.js +136 -0
- package/dist/core/worktree-snapshot/session-index-reset.code.js.map +1 -0
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +34 -134
- package/dist/core/worktree-snapshot/session-index-reset.impl.js.map +1 -1
- package/dist/core/worktree-snapshot/session-index-reset.js +11 -7
- package/dist/extensions/codemode/execute.code.js +618 -0
- package/dist/extensions/codemode/execute.code.js.map +1 -0
- package/dist/extensions/codemode/execute.impl.js +30 -612
- package/dist/extensions/codemode/execute.impl.js.map +1 -1
- package/dist/extensions/codemode/execute.js +11 -7
- package/dist/extensions/codemode/renderer.code.js +110 -0
- package/dist/extensions/codemode/renderer.code.js.map +1 -0
- package/dist/extensions/codemode/renderer.impl.js +33 -107
- package/dist/extensions/codemode/renderer.impl.js.map +1 -1
- package/dist/extensions/codemode/renderer.js +11 -7
- package/dist/extensions/mcp/cli.code.js +565 -0
- package/dist/extensions/mcp/cli.code.js.map +1 -0
- package/dist/extensions/mcp/cli.impl.js +32 -561
- package/dist/extensions/mcp/cli.impl.js.map +1 -1
- package/dist/extensions/mcp/cli.js +11 -7
- package/dist/extensions/mcp/cli.lazy.code.js +52 -0
- package/dist/extensions/mcp/cli.lazy.code.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.impl.js +36 -7
- package/dist/extensions/mcp/cli.lazy.impl.js.map +1 -1
- package/dist/extensions/mcp/cli.lazy.js +11 -7
- package/dist/extensions/mcp/client/transports/stdio.d.ts +2 -0
- package/dist/extensions/mcp/runtime.code.js +5 -0
- package/dist/extensions/mcp/runtime.code.js.map +1 -0
- package/dist/extensions/mcp/runtime.impl.js +35 -4
- package/dist/extensions/mcp/runtime.js +11 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/main-first-time-setup.code.js +12 -0
- package/dist/main-first-time-setup.code.js.map +1 -0
- package/dist/main-first-time-setup.impl.js +35 -11
- package/dist/main-first-time-setup.impl.js.map +1 -1
- package/dist/main-first-time-setup.js +11 -7
- package/dist/main.d.ts +1 -1
- package/dist/main.js +2 -2
- package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts +6 -1
- package/dist/modes/interactive/agent-view/contracts.d.ts +4 -0
- package/dist/modes/interactive/chat-reader-records.d.ts +1 -1
- package/dist/modes/interactive/components/stored-tree-view.code.js +338 -0
- package/dist/modes/interactive/components/stored-tree-view.code.js.map +1 -0
- package/dist/modes/interactive/components/stored-tree-view.impl.js +33 -290
- package/dist/modes/interactive/components/stored-tree-view.impl.js.map +1 -1
- package/dist/modes/interactive/components/stored-tree-view.js +11 -7
- package/dist/modes/interactive/components/task-selection-state.d.ts +8 -3
- package/dist/modes/interactive/components/task-transcript-page.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js +191 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +34 -189
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector-archive.js +11 -7
- package/dist/modes/interactive/interactive-mode-base.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-queueing.d.ts +4 -0
- package/dist/modes/interactive/interactive-render-chat.d.ts +22 -0
- package/dist/modes/interactive/interactive-startup.d.ts +2 -0
- package/dist/modes/interactive/program-status-reporter.d.ts +2 -1
- package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
- package/dist/modes/interactive/steering-queue-controller.d.ts +4 -0
- package/dist/modes/interactive/theme/theme-schema-factory.d.ts +26 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts +4 -5
- package/dist/modes/interactive-engine/engine-prewarm.d.ts +30 -5
- package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +7 -0
- package/dist/modes/interactive-engine/protocol.d.ts +32 -1
- package/dist/modes/rpc/agent-view-rpc-types.d.ts +12 -1
- package/dist/modes/rpc/agent-view-rpc-types.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +3 -1
- package/dist/modes/rpc/rpc-types.d.ts +12 -0
- package/dist/package-manager-cli.code.js +1140 -0
- package/dist/package-manager-cli.code.js.map +1 -0
- package/dist/package-manager-cli.impl.js +36 -1067
- package/dist/package-manager-cli.impl.js.map +1 -1
- package/dist/package-manager-cli.js +11 -7
- package/dist/rpc-entry.js +2 -2
- 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 +1 -7
- package/dist/startup-stages/3.js +6 -2
- package/dist/startup-stages/4.js +2 -1
- package/dist/startup-stages/5.js +1 -7
- package/dist/startup-stages/6.js +7 -10
- package/dist/startup-stages/7.js +10 -3
- package/dist/startup-stages/8.js +3 -6
- package/dist/startup-stages/9.js +6 -1
- package/dist/startup-stages/stages.json +1 -1
- package/dist/utils/canonical-path.js +2 -0
- package/dist/utils/canonical-path.js.map +1 -1
- package/dist/utils/child-process.d.ts +41 -1
- package/dist/utils/compile-cache-warmup-host.js +63 -18
- package/dist/utils/compile-cache-warmup-host.js.map +1 -1
- package/dist/utils/credential-redaction.d.ts +50 -1
- package/dist/utils/interactive-engine-bootstrap.d.ts +2 -0
- package/dist/utils/interactive-engine-env.d.ts +2 -0
- package/dist/utils/memoize-async.d.ts +32 -0
- package/dist/utils/memoize-async.js +91 -0
- package/dist/utils/memoize-async.js.map +1 -0
- package/dist/utils/photon.js +19 -29
- package/dist/utils/photon.js.map +1 -1
- package/dist/utils/shell.d.ts +7 -4
- package/dist/utils/startup-database-spare.code.js +108 -0
- package/dist/utils/startup-database-spare.code.js.map +1 -0
- package/dist/utils/startup-database-spare.impl.js +33 -105
- package/dist/utils/startup-database-spare.impl.js.map +1 -1
- package/dist/utils/startup-database-spare.js +11 -7
- package/dist/utils/tools-manager.code.js +3 -0
- package/dist/utils/tools-manager.code.js.map +1 -0
- package/dist/utils/tools-manager.impl.js +35 -2
- package/dist/utils/tools-manager.js +11 -7
- package/dist/utils/windows-cwd.js +585 -0
- package/dist/utils/windows-cwd.js.map +1 -0
- package/docs/extensions.md +1 -1
- package/docs/getting-started/installation.md +2 -0
- package/docs/intercom/operations.md +1 -0
- package/docs/reference/cli.md +1 -1
- package/package.json +24 -24
- package/dist/_shared/mode-shared-HP7GUA7J.js.map +0 -1
- package/dist/_shared/p1a-prewarm-YK3KDTLN.js.map +0 -1
- package/dist/_shared/p1b-elig-PXQA2FYP.js.map +0 -1
- package/dist/_shared/startup-0-0-X4NF3GKM.js.map +0 -1
- package/dist/_shared/startup-0-1-7QTG6VJZ.js.map +0 -1
- package/dist/_shared/startup-0-2-KFDYPDJK.js.map +0 -1
- package/dist/_shared/startup-8-1-KQJBDKRU.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __commonJSMin, __name, __require } from "./rolldown-runtime-BGM3D5V3.js";
|
|
2
|
-
import { APP_NAME, CONFIG_DIR_NAME, DiagnosticWriter, ENV_AGENT_DIR, ENV_TELEMETRY, NATIVES_VERSION, canonicalizePath, canonicalizePathAsync, createModuleRequire, detectInstallChangeAsync, getAgentDir, getCwdRelativePath, getDocsPath, getEnvValue, getPackageDir, getPathComparisonKey, getSettingsPath, isBunBinary, isBunRuntime, loadOnDemand, moduleDirFromMetaUrl, normalizePath as normalizePath$1, pathsEqual, requiredEntriesForBuiltin, resolvePath, shortenHomePath, stripBom } from "./p0-cli-
|
|
2
|
+
import { APP_NAME, CONFIG_DIR_NAME, DiagnosticWriter, ENV_AGENT_DIR, ENV_TELEMETRY, NATIVES_VERSION, canonicalizePath as canonicalizePath$1, canonicalizePathAsync as canonicalizePathAsync$1, createModuleRequire, detectInstallChangeAsync, getAgentDir, getCwdRelativePath, getDocsPath, getEnvValue, getPackageDir, getPathComparisonKey, getSettingsPath, isBunBinary, isBunRuntime, isChildProcessExitStatusUnknownError, loadOnDemand, markNativeContainedChild, moduleDirFromMetaUrl, normalizePath as normalizePath$1, pathsEqual, requiredEntriesForBuiltin, resolvePath, shortenHomePath, stripBom } from "./p0-cli-BB45ZQY6.js";
|
|
3
3
|
import { clickableKeyTextHint, getGlobalTheme, navActionText, navFirstKeyText, renderNavHintLine, renderNavKeyOverlay, slashCommandHint, terminalDisplayText, theme } from "./p2-shell-main-B2WIALFD.js";
|
|
4
|
-
import { PROJECT_TRUST_DISTRUST_LABEL, PROJECT_TRUST_SESSION_DISTRUST_LABEL, findInCauseChain as findInCauseChain$1, hasErrorIdentity, lockHolderPath, prepareTakeoverMutex, processMayRun, processMayRunAsync, processStartToken, processStartTokenAsync, putBack, putBackAsync, readProcessStartToken, redactCredentialShapes, redactUrlCredentials, rehydrateErrorCause, releaseLock, removeAside, removeAsideAsync, removeLeftoverHolderFiles, removeLeftoverHolderFilesAsync, renameReplacing, renameReplacingAsync, serializeErrorCause, takeTakeoverMutex, takeTakeoverMutexAsync } from "./p1b-elig-
|
|
4
|
+
import { PROJECT_TRUST_DISTRUST_LABEL, PROJECT_TRUST_SESSION_DISTRUST_LABEL, REDACTED_PLACEHOLDER, applyRedactionRanges, findInCauseChain as findInCauseChain$1, hasErrorIdentity, isAsciiDigitCode, isAsciiHexCode, isAsciiLetterCode, isAsciiWordCode, isHorizontalWsCode, lockHolderPath, matchesAsciiCaseInsensitiveAt, prepareTakeoverMutex, processMayRun, processMayRunAsync, processStartToken, processStartTokenAsync, putBack, putBackAsync, readProcessStartToken, redactCredentialShapes, redactUrlCredentials, rehydrateErrorCause, releaseLock, removeAside, removeAsideAsync, removeLeftoverHolderFiles, removeLeftoverHolderFilesAsync, renameReplacing, renameReplacingAsync, scanBasicAuthEndAt, serializeErrorCause, skipHorizontalWs, stripAnsiWithOrigin, takeTakeoverMutex, takeTakeoverMutexAsync } from "./p1b-elig-ENCUPKKJ.js";
|
|
5
5
|
import { DecisionTimeoutError, SessionAlreadyOpenError } from "./settings-startup-65YEWRV2.js";
|
|
6
6
|
import { SETTINGS_DEFAULTS } from "./p2-common-YLSYXMDQ.js";
|
|
7
7
|
import { isBuiltin } from "node:module";
|
|
@@ -13,6 +13,7 @@ import * as path$2 from "node:path";
|
|
|
13
13
|
import path, { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, parse, relative as relative$1, resolve as resolve$1, sep as sep$1, toNamespacedPath } from "node:path";
|
|
14
14
|
import { pathToFileURL } from "node:url";
|
|
15
15
|
import { execFile, spawn } from "node:child_process";
|
|
16
|
+
import { canonicalizePathAsync } from "../utils/canonical-path.js";
|
|
16
17
|
import { pathExists } from "../utils/path-exists.js";
|
|
17
18
|
import * as fs$1 from "node:fs";
|
|
18
19
|
import { appendFileSync, chmodSync as chmodSync$1, closeSync as closeSync$1, copyFileSync, existsSync as existsSync$1, fsyncSync, linkSync, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, openSync as openSync$1, readFileSync as readFileSync$1, readlinkSync as readlinkSync$1, realpathSync as realpathSync$1, renameSync as renameSync$1, rmSync as rmSync$1, statSync as statSync$1, unlinkSync, write, writeFileSync as writeFileSync$1, writeSync } from "node:fs";
|
|
@@ -32,6 +33,7 @@ import { createServer } from "node:net";
|
|
|
32
33
|
import { Readable, Writable } from "node:stream";
|
|
33
34
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
34
35
|
import { adapterOpenContext, loadStorageAdapter, resolveAdapterOptions } from "../core/storage/provider.js";
|
|
36
|
+
import { memoizeAsync } from "../utils/memoize-async.js";
|
|
35
37
|
import { isUtf8 } from "node:buffer";
|
|
36
38
|
import { isNativeError, isPromise } from "node:util/types";
|
|
37
39
|
import { BUNDLED_COMMAND_NAMES, CORE_COMMAND_NAMES } from "@bastani/atomic-tui/dist/builtin-command-names.js";
|
|
@@ -1083,8 +1085,90 @@ var TrustDecisionSelector = class extends Container {
|
|
|
1083
1085
|
this.notice.setText(theme.fg("warning", this.noticeText));
|
|
1084
1086
|
}
|
|
1085
1087
|
};
|
|
1088
|
+
// dist/core/process-tree-containment.js
|
|
1089
|
+
const __atomicDistModuleUrl$5 = new URL("../core/process-tree-containment.js", import.meta.url).href;
|
|
1090
|
+
const NATIVE_WINDOWS_HOST = process.platform === "win32";
|
|
1091
|
+
let nativeContain;
|
|
1092
|
+
let nativeContainAllowingBreakaway;
|
|
1093
|
+
function containFunction() {
|
|
1094
|
+
if (!NATIVE_WINDOWS_HOST) return null;
|
|
1095
|
+
if (nativeContain === void 0) try {
|
|
1096
|
+
nativeContain = createModuleRequire(__atomicDistModuleUrl$5)("@bastani/atomic-natives").containProcessTree ?? null;
|
|
1097
|
+
} catch {
|
|
1098
|
+
nativeContain = null;
|
|
1099
|
+
}
|
|
1100
|
+
return nativeContain;
|
|
1101
|
+
}
|
|
1102
|
+
function containAllowingBreakawayFunction() {
|
|
1103
|
+
if (!NATIVE_WINDOWS_HOST) return null;
|
|
1104
|
+
if (nativeContainAllowingBreakaway === void 0) try {
|
|
1105
|
+
nativeContainAllowingBreakaway = createModuleRequire(__atomicDistModuleUrl$5)("@bastani/atomic-natives").containProcessTreeAllowingBreakaway ?? null;
|
|
1106
|
+
} catch {
|
|
1107
|
+
nativeContainAllowingBreakaway = null;
|
|
1108
|
+
}
|
|
1109
|
+
return nativeContainAllowingBreakaway;
|
|
1110
|
+
}
|
|
1111
|
+
function containProcessTree(pid) {
|
|
1112
|
+
if (process.platform !== "win32") return void 0;
|
|
1113
|
+
try {
|
|
1114
|
+
return containFunction()?.(pid) ?? void 0;
|
|
1115
|
+
} catch {
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
function containProcessTreeAllowingBreakaway(pid) {
|
|
1120
|
+
if (process.platform !== "win32") return void 0;
|
|
1121
|
+
try {
|
|
1122
|
+
return containAllowingBreakawayFunction()?.(pid) ?? void 0;
|
|
1123
|
+
} catch {
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
let nativeHoldDescendants;
|
|
1128
|
+
function holdDescendantsFunction() {
|
|
1129
|
+
if (!NATIVE_WINDOWS_HOST) return null;
|
|
1130
|
+
if (nativeHoldDescendants === void 0) try {
|
|
1131
|
+
nativeHoldDescendants = createModuleRequire(__atomicDistModuleUrl$5)("@bastani/atomic-natives").holdProcessDescendants ?? null;
|
|
1132
|
+
} catch {
|
|
1133
|
+
nativeHoldDescendants = null;
|
|
1134
|
+
}
|
|
1135
|
+
return nativeHoldDescendants;
|
|
1136
|
+
}
|
|
1137
|
+
function hasNativeProcessHold() {
|
|
1138
|
+
return process.platform === "win32" && holdDescendantsFunction() !== null;
|
|
1139
|
+
}
|
|
1140
|
+
function holdProcessDescendantsResult(pid) {
|
|
1141
|
+
if (process.platform !== "win32") return { kind: "unavailable" };
|
|
1142
|
+
const hold = holdDescendantsFunction();
|
|
1143
|
+
if (hold === null) return { kind: "unavailable" };
|
|
1144
|
+
try {
|
|
1145
|
+
const held = hold(pid);
|
|
1146
|
+
return held === null ? { kind: "absent" } : {
|
|
1147
|
+
kind: "held",
|
|
1148
|
+
held
|
|
1149
|
+
};
|
|
1150
|
+
} catch {
|
|
1151
|
+
return { kind: "unavailable" };
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
function holdProcessDescendants(pid) {
|
|
1155
|
+
const result = holdProcessDescendantsResult(pid);
|
|
1156
|
+
return result.kind === "held" ? result.held : void 0;
|
|
1157
|
+
}
|
|
1158
|
+
async function processTreeEnded(tree, timeoutMs) {
|
|
1159
|
+
const deadline = Date.now() + timeoutMs;
|
|
1160
|
+
for (;;) {
|
|
1161
|
+
try {
|
|
1162
|
+
if (tree.activeProcesses() === 0) return;
|
|
1163
|
+
} catch {
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
if (Date.now() >= deadline) return;
|
|
1167
|
+
await setTimeout$1(5);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1086
1170
|
// dist/utils/host-spawn.js
|
|
1087
|
-
const __atomicDistModuleUrl$
|
|
1171
|
+
const __atomicDistModuleUrl$4 = new URL("../utils/host-spawn.js", import.meta.url).href;
|
|
1088
1172
|
const HOST_SPAWN_ENV = "ATOMIC_HOST_SPAWN";
|
|
1089
1173
|
function chooseHostSpawnBackend({ platform, nativeAvailable, override }) {
|
|
1090
1174
|
if (override === "child-process") return "child-process";
|
|
@@ -1093,7 +1177,7 @@ function chooseHostSpawnBackend({ platform, nativeAvailable, override }) {
|
|
|
1093
1177
|
let nativeStart;
|
|
1094
1178
|
function loadNativeStart() {
|
|
1095
1179
|
if (nativeStart === void 0) try {
|
|
1096
|
-
nativeStart = createModuleRequire(__atomicDistModuleUrl$
|
|
1180
|
+
nativeStart = createModuleRequire(__atomicDistModuleUrl$4)("@bastani/atomic-natives").startHostProcess ?? null;
|
|
1097
1181
|
} catch {
|
|
1098
1182
|
nativeStart = null;
|
|
1099
1183
|
}
|
|
@@ -1415,6 +1499,10 @@ var ContainedProcess = class extends EventEmitter {
|
|
|
1415
1499
|
#exited = false;
|
|
1416
1500
|
#openOutputs = 0;
|
|
1417
1501
|
#closed = false;
|
|
1502
|
+
constructor() {
|
|
1503
|
+
super();
|
|
1504
|
+
markNativeContainedChild(this);
|
|
1505
|
+
}
|
|
1418
1506
|
/** The native module's events: only the exit, held until `spawn` was emitted. */
|
|
1419
1507
|
event(event) {
|
|
1420
1508
|
if (event.kind !== "exit") return;
|
|
@@ -2805,51 +2893,6 @@ function yieldTurn() {
|
|
|
2805
2893
|
else setTimeout(resolve, 0);
|
|
2806
2894
|
});
|
|
2807
2895
|
}
|
|
2808
|
-
// dist/core/process-tree-containment.js
|
|
2809
|
-
const __atomicDistModuleUrl$4 = new URL("../core/process-tree-containment.js", import.meta.url).href;
|
|
2810
|
-
let nativeContain;
|
|
2811
|
-
function containFunction() {
|
|
2812
|
-
if (nativeContain === void 0) try {
|
|
2813
|
-
nativeContain = createModuleRequire(__atomicDistModuleUrl$4)("@bastani/atomic-natives").containProcessTree ?? null;
|
|
2814
|
-
} catch {
|
|
2815
|
-
nativeContain = null;
|
|
2816
|
-
}
|
|
2817
|
-
return nativeContain;
|
|
2818
|
-
}
|
|
2819
|
-
function containProcessTree(pid) {
|
|
2820
|
-
if (process.platform !== "win32") return void 0;
|
|
2821
|
-
try {
|
|
2822
|
-
return containFunction()?.(pid) ?? void 0;
|
|
2823
|
-
} catch {
|
|
2824
|
-
return;
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
let nativeHoldDescendants;
|
|
2828
|
-
function holdProcessDescendants(pid) {
|
|
2829
|
-
if (process.platform !== "win32") return void 0;
|
|
2830
|
-
if (nativeHoldDescendants === void 0) try {
|
|
2831
|
-
nativeHoldDescendants = createModuleRequire(__atomicDistModuleUrl$4)("@bastani/atomic-natives").holdProcessDescendants ?? null;
|
|
2832
|
-
} catch {
|
|
2833
|
-
nativeHoldDescendants = null;
|
|
2834
|
-
}
|
|
2835
|
-
try {
|
|
2836
|
-
return nativeHoldDescendants?.(pid) ?? void 0;
|
|
2837
|
-
} catch {
|
|
2838
|
-
return;
|
|
2839
|
-
}
|
|
2840
|
-
}
|
|
2841
|
-
async function processTreeEnded(tree, timeoutMs) {
|
|
2842
|
-
const deadline = Date.now() + timeoutMs;
|
|
2843
|
-
for (;;) {
|
|
2844
|
-
try {
|
|
2845
|
-
if (tree.activeProcesses() === 0) return;
|
|
2846
|
-
} catch {
|
|
2847
|
-
return;
|
|
2848
|
-
}
|
|
2849
|
-
if (Date.now() >= deadline) return;
|
|
2850
|
-
await setTimeout$1(5);
|
|
2851
|
-
}
|
|
2852
|
-
}
|
|
2853
2896
|
// dist/utils/physical-path.js
|
|
2854
2897
|
/** Matches the Linux limit on symbolic links followed while resolving one path. */
|
|
2855
2898
|
const MAX_SYMLINK_HOPS = 40;
|
|
@@ -3528,7 +3571,7 @@ var BlueprintInvalidError = class extends BlueprintError {
|
|
|
3528
3571
|
var BlueprintStepFailedError = class extends BlueprintError {
|
|
3529
3572
|
name = "BlueprintStepFailedError";
|
|
3530
3573
|
constructor(fields, cause) {
|
|
3531
|
-
const outcome = fields.signal !== null ? `was stopped by ${fields.signal}` : fields.exitStatus === null ? "could not be started" : `exited with status ${fields.exitStatus}`;
|
|
3574
|
+
const outcome = fields.signal !== null ? `was stopped by ${fields.signal}` : fields.exitStatus === null ? isChildProcessExitStatusUnknownError(cause) ? "ended with an unknown exit status" : "could not be started" : `exited with status ${fields.exitStatus}`;
|
|
3532
3575
|
super("blueprint-step-failed", `The ${fields.section} step "${fields.step}" of the ${fields.scope} blueprint ${fields.blueprint} ${outcome}`, fields.logPath === null ? "Make the build directory under the agent directory writable, then the next build runs the step again." : `Check the build log ${fields.logPath} for the exact error, then fix the environment and the blueprint; the next build runs it again.`, { ...fields }, cause);
|
|
3533
3576
|
}
|
|
3534
3577
|
};
|
|
@@ -5402,6 +5445,15 @@ function validQuestionnaire(value, params) {
|
|
|
5402
5445
|
async function yieldToEventLoop() {
|
|
5403
5446
|
await setImmediate$1();
|
|
5404
5447
|
}
|
|
5448
|
+
/**
|
|
5449
|
+
* Yield until the next timer turn so libuv finishes the current poll/check cycle,
|
|
5450
|
+
* updates its clock, flushes any already-scheduled 0 ms timers, and polls I/O before continuing.
|
|
5451
|
+
*/
|
|
5452
|
+
async function yieldToTimerTurn() {
|
|
5453
|
+
await new Promise((resolve) => {
|
|
5454
|
+
setTimeout(resolve, 0);
|
|
5455
|
+
});
|
|
5456
|
+
}
|
|
5405
5457
|
async function yieldToEventLoopIfSlow(startedAt, thresholdMs = 16) {
|
|
5406
5458
|
if (Date.now() - startedAt >= thresholdMs) await yieldToEventLoop();
|
|
5407
5459
|
}
|
|
@@ -5586,10 +5638,10 @@ function isSyntheticPath(path) {
|
|
|
5586
5638
|
}
|
|
5587
5639
|
/** Key for deduplicating resource paths: synthetic paths as-is, file paths via realpath and platform casing. */
|
|
5588
5640
|
function getResourcePathKey(path) {
|
|
5589
|
-
return isSyntheticPath(path) ? path : getPathComparisonKey(canonicalizePath(path));
|
|
5641
|
+
return isSyntheticPath(path) ? path : getPathComparisonKey(canonicalizePath$1(path));
|
|
5590
5642
|
}
|
|
5591
5643
|
async function getResourcePathKeyAsync(path) {
|
|
5592
|
-
return isSyntheticPath(path) ? path : getPathComparisonKey(await canonicalizePathAsync(path));
|
|
5644
|
+
return isSyntheticPath(path) ? path : getPathComparisonKey(await canonicalizePathAsync$1(path));
|
|
5593
5645
|
}
|
|
5594
5646
|
function createSourceInfo(path, metadata) {
|
|
5595
5647
|
return {
|
|
@@ -5701,6 +5753,9 @@ function readManifestExtensionPaths(packageDir) {
|
|
|
5701
5753
|
return [];
|
|
5702
5754
|
}
|
|
5703
5755
|
}
|
|
5756
|
+
function hasAllBuiltinPackages(roots) {
|
|
5757
|
+
return BUILTIN_PACKAGES.every((descriptor) => (roots.get(descriptor)?.length ?? 0) > 0);
|
|
5758
|
+
}
|
|
5704
5759
|
function discoverBuiltinPackages() {
|
|
5705
5760
|
const packageDir = getPackageDir();
|
|
5706
5761
|
const known = builtinPackageDiscoveries.get(packageDir);
|
|
@@ -5711,7 +5766,7 @@ function discoverBuiltinPackages() {
|
|
|
5711
5766
|
roots,
|
|
5712
5767
|
mandatoryExtensionPaths: mandatoryRoots(roots).flatMap(readManifestExtensionPaths)
|
|
5713
5768
|
};
|
|
5714
|
-
builtinPackageDiscoveries.set(packageDir, discovery);
|
|
5769
|
+
if (hasAllBuiltinPackages(roots)) builtinPackageDiscoveries.set(packageDir, discovery);
|
|
5715
5770
|
return discovery;
|
|
5716
5771
|
}
|
|
5717
5772
|
async function preloadBuiltinPackages() {
|
|
@@ -5724,7 +5779,7 @@ async function preloadBuiltinPackages() {
|
|
|
5724
5779
|
return [descriptor, candidates.filter((_path, index) => verified[index])];
|
|
5725
5780
|
})));
|
|
5726
5781
|
const manifests = await Promise.all(mandatoryRoots(roots).map(async (root) => manifestExtensionPathsOf(root, await readFile(join$1(root, "package.json"), "utf-8").catch(() => ""))));
|
|
5727
|
-
if (!builtinPackageDiscoveries.has(packageDir)) builtinPackageDiscoveries.set(packageDir, {
|
|
5782
|
+
if (!builtinPackageDiscoveries.has(packageDir) && hasAllBuiltinPackages(roots)) builtinPackageDiscoveries.set(packageDir, {
|
|
5728
5783
|
roots,
|
|
5729
5784
|
mandatoryExtensionPaths: manifests.flat()
|
|
5730
5785
|
});
|
|
@@ -5854,9 +5909,12 @@ const CURRENT_SESSION_VERSION = 4;
|
|
|
5854
5909
|
const COMMAND_DETAIL_TAIL_BYTES = 8192;
|
|
5855
5910
|
/** Observation expiry releases the caller, never the command process. */
|
|
5856
5911
|
const COMMAND_FOREGROUND_BUDGET_MS = 1e4;
|
|
5857
|
-
/**
|
|
5912
|
+
/**
|
|
5913
|
+
* Native completion means the process exited; only exit code 0 proves shell command success.
|
|
5914
|
+
* Non-zero exits and missing exit codes (such as signal termination or an unreadable exit status) are failures.
|
|
5915
|
+
*/
|
|
5858
5916
|
function taskOutcomeStatus(result, kind) {
|
|
5859
|
-
return kind === "command" && result.kind === "completed" && result.exitCode !==
|
|
5917
|
+
return kind === "command" && result.kind === "completed" && result.exitCode !== 0 ? "failed" : result.kind;
|
|
5860
5918
|
}
|
|
5861
5919
|
/** Never join bytes across a retained-output gap as if they were contiguous. */
|
|
5862
5920
|
function taskOutputBytes(page, omissions) {
|
|
@@ -7097,13 +7155,13 @@ function noteSnapshotGeneration(store, snapshot, load, row, key) {
|
|
|
7097
7155
|
}
|
|
7098
7156
|
// dist/core/tasks/transcript-origin.js
|
|
7099
7157
|
/** Provenance belongs to this page, not to an arbitrary SDK message reused in a different task. */
|
|
7100
|
-
const origins = /* @__PURE__ */ new WeakMap();
|
|
7158
|
+
const origins$1 = /* @__PURE__ */ new WeakMap();
|
|
7101
7159
|
const rendered = /* @__PURE__ */ new WeakMap();
|
|
7102
7160
|
function bindSavedTaskOrigins(messages, keys) {
|
|
7103
|
-
origins.set(messages, keys);
|
|
7161
|
+
origins$1.set(messages, keys);
|
|
7104
7162
|
}
|
|
7105
7163
|
function savedTaskRows(messages) {
|
|
7106
|
-
const keys = origins.get(messages);
|
|
7164
|
+
const keys = origins$1.get(messages);
|
|
7107
7165
|
if (!keys) return void 0;
|
|
7108
7166
|
return (entry, message, part) => {
|
|
7109
7167
|
const key = keys.get(message);
|
|
@@ -7964,7 +8022,9 @@ function defineTool(tool) {
|
|
|
7964
8022
|
return tool;
|
|
7965
8023
|
}
|
|
7966
8024
|
// dist/extensions/mcp/client/oauth/redact.js
|
|
7967
|
-
const REDACTED =
|
|
8025
|
+
const REDACTED = REDACTED_PLACEHOLDER;
|
|
8026
|
+
const MCP_BASIC_AUTH_OPTIONS = Object.freeze({ includeOpaqueTokens: true });
|
|
8027
|
+
const MCP_APPLY_RANGE_OPTIONS = Object.freeze({ preserveAnsi: false });
|
|
7968
8028
|
/** Minimum length for unlabelled literal secret scrubbing so 1-3 character strings (e.g. HTTP status codes) are never over-redacted. */
|
|
7969
8029
|
const MIN_LITERAL_SECRET_LENGTH = 4;
|
|
7970
8030
|
function buildAhoCorasick(patterns) {
|
|
@@ -8018,9 +8078,6 @@ function scanMaxMatchLengths(text, automaton) {
|
|
|
8018
8078
|
}
|
|
8019
8079
|
return result;
|
|
8020
8080
|
}
|
|
8021
|
-
function isHexCharCode(code) {
|
|
8022
|
-
return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102;
|
|
8023
|
-
}
|
|
8024
8081
|
function upperHexChar(code) {
|
|
8025
8082
|
return String.fromCharCode(code >= 97 && code <= 102 ? code - 32 : code);
|
|
8026
8083
|
}
|
|
@@ -8033,7 +8090,7 @@ function normalizePercentHex(text) {
|
|
|
8033
8090
|
let out = "";
|
|
8034
8091
|
let copied = 0;
|
|
8035
8092
|
let i = 0;
|
|
8036
|
-
while (i < text.length) if (text.charCodeAt(i) === 37 && i + 2 < text.length &&
|
|
8093
|
+
while (i < text.length) if (text.charCodeAt(i) === 37 && i + 2 < text.length && isAsciiHexCode(text.charCodeAt(i + 1)) && isAsciiHexCode(text.charCodeAt(i + 2))) {
|
|
8037
8094
|
const c1 = text.charCodeAt(i + 1);
|
|
8038
8095
|
const c2 = text.charCodeAt(i + 2);
|
|
8039
8096
|
if (c1 >= 97 && c1 <= 102 || c2 >= 97 && c2 <= 102) {
|
|
@@ -8253,7 +8310,7 @@ function maskSegmentWithCapInfo(segment, rawAc, pctAc, cap) {
|
|
|
8253
8310
|
outLen += chunk.length;
|
|
8254
8311
|
}
|
|
8255
8312
|
parts.push(REDACTED);
|
|
8256
|
-
outLen +=
|
|
8313
|
+
outLen += REDACTED.length;
|
|
8257
8314
|
if (prefixEnd === -1 && interval.end >= limit) prefixEnd = outLen;
|
|
8258
8315
|
cursor = interval.end;
|
|
8259
8316
|
}
|
|
@@ -8346,8 +8403,8 @@ var SecretMaskRegistry = class {
|
|
|
8346
8403
|
if (i + 1 < segments.length) {
|
|
8347
8404
|
if (prefixEnd === -1 && origOffset >= limit) prefixEnd = outLen;
|
|
8348
8405
|
parts.push(REDACTED);
|
|
8349
|
-
outLen +=
|
|
8350
|
-
origOffset +=
|
|
8406
|
+
outLen += REDACTED.length;
|
|
8407
|
+
origOffset += REDACTED.length;
|
|
8351
8408
|
if (prefixEnd === -1 && origOffset >= limit) prefixEnd = outLen;
|
|
8352
8409
|
}
|
|
8353
8410
|
}
|
|
@@ -8385,12 +8442,9 @@ function extractAuthorizationSecrets(headerValue) {
|
|
|
8385
8442
|
if (!trimmed) return [];
|
|
8386
8443
|
const results = [trimmed];
|
|
8387
8444
|
let sep = -1;
|
|
8388
|
-
for (let i = 0; i < trimmed.length; i++) {
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
sep = i;
|
|
8392
|
-
break;
|
|
8393
|
-
}
|
|
8445
|
+
for (let i = 0; i < trimmed.length; i++) if (isHorizontalWsCode(trimmed.charCodeAt(i))) {
|
|
8446
|
+
sep = i;
|
|
8447
|
+
break;
|
|
8394
8448
|
}
|
|
8395
8449
|
if (sep > 0) {
|
|
8396
8450
|
const scheme = trimmed.slice(0, sep).toLowerCase();
|
|
@@ -8623,11 +8677,11 @@ function isEnvTemplatePlaceholder(value) {
|
|
|
8623
8677
|
const trimmed = value.trim();
|
|
8624
8678
|
if (trimmed.length < 2) return false;
|
|
8625
8679
|
if (trimmed.startsWith("${") && trimmed.endsWith("}")) return true;
|
|
8626
|
-
if (
|
|
8680
|
+
if (matchesAsciiCaseInsensitiveAt(trimmed, "$env:", 0)) return true;
|
|
8627
8681
|
if (trimmed.charCodeAt(0) === 36) {
|
|
8628
8682
|
const first = trimmed.charCodeAt(1);
|
|
8629
|
-
if (!(first
|
|
8630
|
-
for (let i = 2; i < trimmed.length; i++) if (!
|
|
8683
|
+
if (!(isAsciiLetterCode(first) || first === 95)) return false;
|
|
8684
|
+
for (let i = 2; i < trimmed.length; i++) if (!isAsciiWordCode(trimmed.charCodeAt(i))) return false;
|
|
8631
8685
|
return true;
|
|
8632
8686
|
}
|
|
8633
8687
|
return false;
|
|
@@ -8746,8 +8800,8 @@ function isBenignKebabOrSnakeSlug(value) {
|
|
|
8746
8800
|
function isSecretValueForMasking(value) {
|
|
8747
8801
|
const trimmed = value.trim();
|
|
8748
8802
|
if (trimmed.length < 8) return false;
|
|
8749
|
-
if (
|
|
8750
|
-
if (
|
|
8803
|
+
if (matchesAsciiCaseInsensitiveAt(trimmed, "bearer ", 0) || matchesAsciiCaseInsensitiveAt(trimmed, "bearer ", 0)) return true;
|
|
8804
|
+
if (matchesAsciiCaseInsensitiveAt(trimmed, "basic ", 0) || matchesAsciiCaseInsensitiveAt(trimmed, "basic ", 0)) return true;
|
|
8751
8805
|
if (trimmed.includes(" ") || trimmed.includes("\n")) return false;
|
|
8752
8806
|
if (isHexToken(trimmed)) return true;
|
|
8753
8807
|
let hasUpper = false;
|
|
@@ -8795,8 +8849,8 @@ function collectSecretsForMasking(input) {
|
|
|
8795
8849
|
function isLikelySecretForDisplay(value) {
|
|
8796
8850
|
const trimmed = value.trim();
|
|
8797
8851
|
if (trimmed.length < 8) return false;
|
|
8798
|
-
if (
|
|
8799
|
-
if (
|
|
8852
|
+
if (matchesAsciiCaseInsensitiveAt(trimmed, "bearer ", 0) || matchesAsciiCaseInsensitiveAt(trimmed, "bearer ", 0)) return true;
|
|
8853
|
+
if (matchesAsciiCaseInsensitiveAt(trimmed, "basic ", 0) || matchesAsciiCaseInsensitiveAt(trimmed, "basic ", 0)) return true;
|
|
8800
8854
|
if (isEnvTemplatePlaceholder(trimmed)) return false;
|
|
8801
8855
|
if (trimmed.includes(" ") || trimmed.includes("\n")) return false;
|
|
8802
8856
|
if (isDateOrTimestamp(trimmed) || isVersionString(trimmed) || isSimplePath(trimmed) || isBenignKebabOrSnakeSlug(trimmed)) return false;
|
|
@@ -8961,63 +9015,14 @@ function redactAuthorizationUrlForDisplay(input, secrets = []) {
|
|
|
8961
9015
|
}
|
|
8962
9016
|
return changed ? url.href : raw;
|
|
8963
9017
|
}
|
|
8964
|
-
function isAsciiAlphaNumOrUnderscore(code) {
|
|
8965
|
-
return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95;
|
|
8966
|
-
}
|
|
8967
9018
|
function isTokenStopChar(code) {
|
|
8968
9019
|
return code <= 32 || code === 34 || code === 39 || code === 40 || code === 41 || code === 44 || code === 59 || code === 60 || code === 62 || code === 96 || code === 125 || code === 93;
|
|
8969
9020
|
}
|
|
8970
|
-
function isBase64CredentialChar(code) {
|
|
8971
|
-
return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 43 || code === 47 || code === 61 || code === 95 || code === 45;
|
|
8972
|
-
}
|
|
8973
|
-
function isValidStandardBase64(value) {
|
|
8974
|
-
if (value.length < 4 || value.length % 4 !== 0) return false;
|
|
8975
|
-
let pad = 0;
|
|
8976
|
-
for (let i = value.length - 1; i >= 0 && value.charCodeAt(i) === 61; i--) pad++;
|
|
8977
|
-
if (pad > 2) return false;
|
|
8978
|
-
const end = value.length - pad;
|
|
8979
|
-
for (let i = 0; i < end; i++) {
|
|
8980
|
-
const c = value.charCodeAt(i);
|
|
8981
|
-
if (!(c >= 65 && c <= 90 || c >= 97 && c <= 122 || c >= 48 && c <= 57 || c === 43 || c === 47)) return false;
|
|
8982
|
-
}
|
|
8983
|
-
return true;
|
|
8984
|
-
}
|
|
8985
|
-
function looksLikeBase64Credential(value) {
|
|
8986
|
-
if (value.length < 4) return false;
|
|
8987
|
-
let hasUpper = false;
|
|
8988
|
-
let hasLower = false;
|
|
8989
|
-
let hasDigit = false;
|
|
8990
|
-
let hasSymbol = false;
|
|
8991
|
-
for (let i = 0; i < value.length; i++) {
|
|
8992
|
-
const c = value.charCodeAt(i);
|
|
8993
|
-
if (c >= 65 && c <= 90) hasUpper = true;
|
|
8994
|
-
else if (c >= 97 && c <= 122) hasLower = true;
|
|
8995
|
-
else if (c >= 48 && c <= 57) hasDigit = true;
|
|
8996
|
-
else hasSymbol = true;
|
|
8997
|
-
}
|
|
8998
|
-
if (hasSymbol) return true;
|
|
8999
|
-
if (value.length >= 8 && (hasUpper && hasLower || hasDigit)) return true;
|
|
9000
|
-
return false;
|
|
9001
|
-
}
|
|
9002
|
-
/**
|
|
9003
|
-
* Unbounded one-sided check for RFC 7617 `Basic <base64(id:secret)>`:
|
|
9004
|
-
* every valid RFC 7617 `Basic` credential has length >= 4, multiple of 4, valid Base64, and decodes to bytes
|
|
9005
|
-
* containing `:` (0x3a). Falls back to `looksLikeBase64Credential` for non-colon opaque tokens.
|
|
9006
|
-
* Leaves ordinary prose ("Basic auth", "Basic mode", "Basic text") untouched.
|
|
9007
|
-
*/
|
|
9008
|
-
function isBasicAuthPayload(value) {
|
|
9009
|
-
if (value.length < 4) return false;
|
|
9010
|
-
if (isValidStandardBase64(value) && Buffer.from(value, "base64").includes(58)) return true;
|
|
9011
|
-
return looksLikeBase64Credential(value);
|
|
9012
|
-
}
|
|
9013
9021
|
function isSignedInteger(value) {
|
|
9014
9022
|
if (value.length === 0) return false;
|
|
9015
9023
|
let i = value.charCodeAt(0) === 45 ? 1 : 0;
|
|
9016
9024
|
if (i === value.length) return false;
|
|
9017
|
-
for (; i < value.length; i++)
|
|
9018
|
-
const c = value.charCodeAt(i);
|
|
9019
|
-
if (c < 48 || c > 57) return false;
|
|
9020
|
-
}
|
|
9025
|
+
for (; i < value.length; i++) if (!isAsciiDigitCode(value.charCodeAt(i))) return false;
|
|
9021
9026
|
return true;
|
|
9022
9027
|
}
|
|
9023
9028
|
function isPosixOrSystemErrorCode(value) {
|
|
@@ -9091,30 +9096,17 @@ const BEARER_PROSE_WORDS = /* @__PURE__ */ new Set([
|
|
|
9091
9096
|
"grant",
|
|
9092
9097
|
"flow"
|
|
9093
9098
|
]);
|
|
9094
|
-
function matchesAsciiInsensitive(text, offset, lowerKeyword) {
|
|
9095
|
-
if (offset < 0 || offset + lowerKeyword.length > text.length) return false;
|
|
9096
|
-
for (let i = 0; i < lowerKeyword.length; i++) {
|
|
9097
|
-
let c = text.charCodeAt(offset + i);
|
|
9098
|
-
if (c >= 65 && c <= 90) c += 32;
|
|
9099
|
-
if (c !== lowerKeyword.charCodeAt(i)) return false;
|
|
9100
|
-
}
|
|
9101
|
-
return true;
|
|
9102
|
-
}
|
|
9103
|
-
function skipHorizontalWs(text, pos) {
|
|
9104
|
-
while (pos < text.length && (text.charCodeAt(pos) === 32 || text.charCodeAt(pos) === 9)) pos++;
|
|
9105
|
-
return pos;
|
|
9106
|
-
}
|
|
9107
9099
|
function isAuthorizationPrefixContext(text, kwStart) {
|
|
9108
9100
|
let pos = kwStart;
|
|
9109
|
-
while (pos > 0 && (text.charCodeAt(pos - 1)
|
|
9101
|
+
while (pos > 0 && isHorizontalWsCode(text.charCodeAt(pos - 1))) pos--;
|
|
9110
9102
|
if (pos === 0) return false;
|
|
9111
9103
|
const sep = text.charCodeAt(pos - 1);
|
|
9112
9104
|
if (sep !== 58 && sep !== 61) return false;
|
|
9113
9105
|
pos--;
|
|
9114
|
-
while (pos > 0 && (text.charCodeAt(pos - 1)
|
|
9106
|
+
while (pos > 0 && isHorizontalWsCode(text.charCodeAt(pos - 1))) pos--;
|
|
9115
9107
|
if (pos > 0 && (text.charCodeAt(pos - 1) === 34 || text.charCodeAt(pos - 1) === 39)) pos--;
|
|
9116
|
-
if (pos >= 13 &&
|
|
9117
|
-
if (pos >= 4 &&
|
|
9108
|
+
if (pos >= 13 && matchesAsciiCaseInsensitiveAt(text, "authorization", pos - 13)) return true;
|
|
9109
|
+
if (pos >= 4 && matchesAsciiCaseInsensitiveAt(text, "auth", pos - 4)) return true;
|
|
9118
9110
|
return false;
|
|
9119
9111
|
}
|
|
9120
9112
|
function scanQuotedOrTokenValueEnd(text, start) {
|
|
@@ -9218,117 +9210,48 @@ function isWwwAuthenticateChallengeParam(text, start) {
|
|
|
9218
9210
|
return KNOWN_CHALLENGE_PARAMS.has(text.slice(start, eq).toLowerCase());
|
|
9219
9211
|
}
|
|
9220
9212
|
/**
|
|
9221
|
-
* Strip ANSI CSI/OSC sequences into `plain`, recording for each index of `plain` its index in `text`
|
|
9222
|
-
* (plus `text.length` sentinel at the end). Chunked linear single pass, zero regular expressions.
|
|
9223
|
-
*/
|
|
9224
|
-
function stripAnsiWithOrigin(text) {
|
|
9225
|
-
if (!text.includes("\x1B")) return {
|
|
9226
|
-
plain: text,
|
|
9227
|
-
origin: void 0
|
|
9228
|
-
};
|
|
9229
|
-
const chunks = [];
|
|
9230
|
-
const origin = new Int32Array(text.length + 1);
|
|
9231
|
-
let plainLen = 0;
|
|
9232
|
-
let copied = 0;
|
|
9233
|
-
let i = 0;
|
|
9234
|
-
const flush = (end) => {
|
|
9235
|
-
if (end <= copied) return;
|
|
9236
|
-
chunks.push(text.slice(copied, end));
|
|
9237
|
-
for (let k = copied; k < end; k++) origin[plainLen++] = k;
|
|
9238
|
-
copied = end;
|
|
9239
|
-
};
|
|
9240
|
-
while (i < text.length) {
|
|
9241
|
-
const esc = text.indexOf("\x1B", i);
|
|
9242
|
-
if (esc === -1) {
|
|
9243
|
-
flush(text.length);
|
|
9244
|
-
break;
|
|
9245
|
-
}
|
|
9246
|
-
if (esc + 1 < text.length) {
|
|
9247
|
-
const next = text.charCodeAt(esc + 1);
|
|
9248
|
-
if (next === 91) {
|
|
9249
|
-
let j = esc + 2;
|
|
9250
|
-
while (j < text.length && text.charCodeAt(j) >= 48 && text.charCodeAt(j) <= 63) j++;
|
|
9251
|
-
while (j < text.length && text.charCodeAt(j) >= 32 && text.charCodeAt(j) <= 47) j++;
|
|
9252
|
-
if (j < text.length && text.charCodeAt(j) >= 64 && text.charCodeAt(j) <= 126) {
|
|
9253
|
-
flush(esc);
|
|
9254
|
-
copied = j + 1;
|
|
9255
|
-
i = j + 1;
|
|
9256
|
-
continue;
|
|
9257
|
-
}
|
|
9258
|
-
} else if (next === 93) {
|
|
9259
|
-
let j = esc + 2;
|
|
9260
|
-
let matched = false;
|
|
9261
|
-
while (j < text.length) {
|
|
9262
|
-
const c = text.charCodeAt(j);
|
|
9263
|
-
if (c === 7) {
|
|
9264
|
-
flush(esc);
|
|
9265
|
-
copied = j + 1;
|
|
9266
|
-
i = j + 1;
|
|
9267
|
-
matched = true;
|
|
9268
|
-
break;
|
|
9269
|
-
}
|
|
9270
|
-
if (c === 27) {
|
|
9271
|
-
if (j + 1 < text.length && text.charCodeAt(j + 1) === 92) {
|
|
9272
|
-
flush(esc);
|
|
9273
|
-
copied = j + 2;
|
|
9274
|
-
i = j + 2;
|
|
9275
|
-
matched = true;
|
|
9276
|
-
}
|
|
9277
|
-
break;
|
|
9278
|
-
}
|
|
9279
|
-
j++;
|
|
9280
|
-
}
|
|
9281
|
-
if (matched) continue;
|
|
9282
|
-
}
|
|
9283
|
-
}
|
|
9284
|
-
i = esc + 1;
|
|
9285
|
-
}
|
|
9286
|
-
if (copied < text.length) flush(text.length);
|
|
9287
|
-
origin[plainLen] = text.length;
|
|
9288
|
-
return {
|
|
9289
|
-
plain: chunks.join(""),
|
|
9290
|
-
origin
|
|
9291
|
-
};
|
|
9292
|
-
}
|
|
9293
|
-
/**
|
|
9294
9213
|
* Single-pass linear-time secondary net for OAuth/HTTP credential shapes:
|
|
9295
9214
|
* - `Bearer <token>` (SP/HTAB, arbitrary opaque token chars incl. `!`, `$`, `%`, `:`; preserves prose & WWW-Authenticate challenges)
|
|
9296
|
-
* - standalone or assigned `Basic <base64>` (SP/HTAB;
|
|
9215
|
+
* - standalone or assigned `Basic <base64>` (SP/HTAB; shared `scanBasicAuthEndAt` with `includeOpaqueTokens: true`)
|
|
9297
9216
|
* - `code_verifier` / `code-verifier` / `codeVerifier` (form, JSON, escaped `\"...\"`, ANSI-styled)
|
|
9298
9217
|
* - `code=<secret>` (excluding integers, POSIX/Node `E...` error codes, and standard OAuth error codes)
|
|
9299
9218
|
* - sensitive URL query parameter values (`?api_key=...`, `&token=...`, etc.)
|
|
9300
|
-
* - long-
|
|
9219
|
+
* - long-input `password=<token>` linear fallback (covers >2KB multi-line bodies and preserves `&` parameter boundaries)
|
|
9301
9220
|
*/
|
|
9302
9221
|
function redactOAuthStructuredCredentials(text) {
|
|
9303
9222
|
if (!text) return text;
|
|
9304
9223
|
const { plain, origin } = stripAnsiWithOrigin(text);
|
|
9305
9224
|
const mapStart = (index) => origin === void 0 ? index : origin[index];
|
|
9306
9225
|
const mapEnd = (index) => origin === void 0 ? index : origin[index - 1] + 1;
|
|
9307
|
-
const
|
|
9308
|
-
let
|
|
9226
|
+
const ranges = [];
|
|
9227
|
+
let lastRangeEnd = 0;
|
|
9309
9228
|
let i = 0;
|
|
9310
9229
|
const longInput = plain.length > 2048;
|
|
9311
|
-
const
|
|
9230
|
+
const addRange = (plainFrom, plainTo) => {
|
|
9312
9231
|
if (plainTo <= plainFrom) return;
|
|
9313
9232
|
const origFrom = mapStart(plainFrom);
|
|
9314
9233
|
const origTo = mapEnd(plainTo);
|
|
9315
|
-
if (origFrom <
|
|
9234
|
+
if (origFrom < lastRangeEnd) return;
|
|
9316
9235
|
if (plain.slice(plainFrom, plainTo) === REDACTED) return;
|
|
9317
|
-
|
|
9318
|
-
|
|
9236
|
+
ranges.push({
|
|
9237
|
+
start: origFrom,
|
|
9238
|
+
end: origTo
|
|
9239
|
+
});
|
|
9240
|
+
lastRangeEnd = origTo;
|
|
9319
9241
|
};
|
|
9320
9242
|
while (i < plain.length) {
|
|
9321
|
-
|
|
9322
|
-
|
|
9243
|
+
const ch = plain.charCodeAt(i);
|
|
9244
|
+
if (ch === 91 && plain.startsWith(REDACTED, i)) {
|
|
9245
|
+
i += REDACTED.length;
|
|
9323
9246
|
continue;
|
|
9324
9247
|
}
|
|
9325
|
-
const prevWord = i > 0 &&
|
|
9326
|
-
if (!prevWord &&
|
|
9248
|
+
const prevWord = i > 0 && isAsciiWordCode(plain.charCodeAt(i - 1));
|
|
9249
|
+
if (!prevWord && (ch === 66 || ch === 98) && matchesAsciiCaseInsensitiveAt(plain, "bearer", i)) {
|
|
9327
9250
|
const afterKw = i + 6;
|
|
9328
9251
|
const valStart = skipHorizontalWs(plain, afterKw);
|
|
9329
9252
|
if (valStart > afterKw && valStart < plain.length && !isWwwAuthenticateChallengeParam(plain, valStart)) {
|
|
9330
9253
|
if (plain.startsWith(REDACTED, valStart)) {
|
|
9331
|
-
i = valStart +
|
|
9254
|
+
i = valStart + REDACTED.length;
|
|
9332
9255
|
continue;
|
|
9333
9256
|
}
|
|
9334
9257
|
let valEnd = valStart;
|
|
@@ -9337,34 +9260,24 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9337
9260
|
const candidate = plain.slice(valStart, valEnd);
|
|
9338
9261
|
const isPlainProse = !isAuthorizationPrefixContext(plain, i) && BEARER_PROSE_WORDS.has(candidate.toLowerCase());
|
|
9339
9262
|
if (valEnd > valStart && !isPlainProse) {
|
|
9340
|
-
|
|
9263
|
+
addRange(i, valEnd);
|
|
9341
9264
|
i = valEnd;
|
|
9342
9265
|
continue;
|
|
9343
9266
|
}
|
|
9344
9267
|
}
|
|
9345
9268
|
}
|
|
9346
|
-
if (!prevWord &&
|
|
9347
|
-
const
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
continue;
|
|
9353
|
-
}
|
|
9354
|
-
let valEnd = valStart;
|
|
9355
|
-
while (valEnd < plain.length && isBase64CredentialChar(plain.charCodeAt(valEnd))) valEnd++;
|
|
9356
|
-
const candidate = plain.slice(valStart, valEnd);
|
|
9357
|
-
if ((valEnd === plain.length || !isAsciiAlphaNumOrUnderscore(plain.charCodeAt(valEnd))) && isBasicAuthPayload(candidate)) {
|
|
9358
|
-
emitReplacement(i, valEnd);
|
|
9359
|
-
i = valEnd;
|
|
9360
|
-
continue;
|
|
9361
|
-
}
|
|
9269
|
+
if (!prevWord && (ch === 66 || ch === 98)) {
|
|
9270
|
+
const basicEnd = scanBasicAuthEndAt(plain, i, MCP_BASIC_AUTH_OPTIONS);
|
|
9271
|
+
if (basicEnd !== -1) {
|
|
9272
|
+
addRange(i, basicEnd);
|
|
9273
|
+
i = basicEnd;
|
|
9274
|
+
continue;
|
|
9362
9275
|
}
|
|
9363
9276
|
}
|
|
9364
|
-
if (!prevWord) {
|
|
9277
|
+
if (!prevWord && (ch === 67 || ch === 99)) {
|
|
9365
9278
|
let kvLen = 0;
|
|
9366
|
-
if (
|
|
9367
|
-
else if (
|
|
9279
|
+
if (matchesAsciiCaseInsensitiveAt(plain, "code_verifier", i) || matchesAsciiCaseInsensitiveAt(plain, "code-verifier", i)) kvLen = 13;
|
|
9280
|
+
else if (matchesAsciiCaseInsensitiveAt(plain, "codeverifier", i)) kvLen = 12;
|
|
9368
9281
|
if (kvLen > 0) {
|
|
9369
9282
|
let pos = i + kvLen;
|
|
9370
9283
|
while (pos < plain.length && plain.charCodeAt(pos) === 92) pos++;
|
|
@@ -9375,7 +9288,7 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9375
9288
|
if (pos < plain.length && !plain.startsWith(REDACTED, pos)) {
|
|
9376
9289
|
const valEnd = scanQuotedOrTokenValueEnd(plain, pos);
|
|
9377
9290
|
if (valEnd > pos) {
|
|
9378
|
-
|
|
9291
|
+
addRange(pos, valEnd);
|
|
9379
9292
|
i = valEnd;
|
|
9380
9293
|
continue;
|
|
9381
9294
|
}
|
|
@@ -9383,21 +9296,21 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9383
9296
|
}
|
|
9384
9297
|
}
|
|
9385
9298
|
}
|
|
9386
|
-
if (!prevWord && !(i > 0 && plain.charCodeAt(i - 1) === 45) &&
|
|
9299
|
+
if (!prevWord && (ch === 67 || ch === 99) && !(i > 0 && plain.charCodeAt(i - 1) === 45) && matchesAsciiCaseInsensitiveAt(plain, "code", i) && i + 4 < plain.length && plain.charCodeAt(i + 4) === 61) {
|
|
9387
9300
|
const valStart = i + 5;
|
|
9388
9301
|
if (valStart < plain.length && !plain.startsWith(REDACTED, valStart)) {
|
|
9389
9302
|
const valEnd = scanQuotedOrTokenValueEnd(plain, valStart);
|
|
9390
9303
|
const val = plain.slice(valStart, valEnd);
|
|
9391
9304
|
if (val.length > 0 && !isSignedInteger(val) && !isPosixOrSystemErrorCode(val) && !KNOWN_OAUTH_ERROR_CODES.has(val.toLowerCase())) {
|
|
9392
|
-
|
|
9305
|
+
addRange(valStart, valEnd);
|
|
9393
9306
|
i = valEnd;
|
|
9394
9307
|
continue;
|
|
9395
9308
|
}
|
|
9396
9309
|
}
|
|
9397
9310
|
}
|
|
9398
|
-
if (
|
|
9311
|
+
if (ch === 63 || ch === 38) {
|
|
9399
9312
|
let nameEnd = i + 1;
|
|
9400
|
-
while (nameEnd < plain.length && (
|
|
9313
|
+
while (nameEnd < plain.length && (isAsciiWordCode(plain.charCodeAt(nameEnd)) || plain.charCodeAt(nameEnd) === 45)) nameEnd++;
|
|
9401
9314
|
if (nameEnd > i + 1 && nameEnd < plain.length && plain.charCodeAt(nameEnd) === 61) {
|
|
9402
9315
|
const paramName = plain.slice(i + 1, nameEnd).toLowerCase();
|
|
9403
9316
|
if (SENSITIVE_QUERY_PARAM_NAMES.has(paramName)) {
|
|
@@ -9407,7 +9320,7 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9407
9320
|
while (valEnd < plain.length && !isTokenStopChar(plain.charCodeAt(valEnd)) && plain.charCodeAt(valEnd) !== 38 && plain.charCodeAt(valEnd) !== 35) valEnd++;
|
|
9408
9321
|
const val = plain.slice(valStart, valEnd);
|
|
9409
9322
|
if (val.length > 0 && !(paramName === "code" && (isSignedInteger(val) || isPosixOrSystemErrorCode(val) || KNOWN_OAUTH_ERROR_CODES.has(val.toLowerCase())))) {
|
|
9410
|
-
|
|
9323
|
+
addRange(valStart, valEnd);
|
|
9411
9324
|
i = valEnd;
|
|
9412
9325
|
continue;
|
|
9413
9326
|
}
|
|
@@ -9415,17 +9328,17 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9415
9328
|
}
|
|
9416
9329
|
}
|
|
9417
9330
|
}
|
|
9418
|
-
if (longInput && !prevWord) {
|
|
9331
|
+
if (longInput && !prevWord && (ch === 80 || ch === 112)) {
|
|
9419
9332
|
let pwdLen = 0;
|
|
9420
|
-
if (
|
|
9421
|
-
else if (
|
|
9422
|
-
else if (
|
|
9333
|
+
if (matchesAsciiCaseInsensitiveAt(plain, "password", i)) pwdLen = 8;
|
|
9334
|
+
else if (matchesAsciiCaseInsensitiveAt(plain, "passwd", i)) pwdLen = 6;
|
|
9335
|
+
else if (matchesAsciiCaseInsensitiveAt(plain, "pwd", i)) pwdLen = 3;
|
|
9423
9336
|
if (pwdLen > 0 && i + pwdLen < plain.length && plain.charCodeAt(i + pwdLen) === 61) {
|
|
9424
9337
|
const valStart = i + pwdLen + 1;
|
|
9425
9338
|
if (valStart < plain.length && !plain.startsWith(REDACTED, valStart)) {
|
|
9426
9339
|
const valEnd = scanQuotedOrTokenValueEnd(plain, valStart);
|
|
9427
9340
|
if (valEnd > valStart) {
|
|
9428
|
-
|
|
9341
|
+
addRange(valStart, valEnd);
|
|
9429
9342
|
i = valEnd;
|
|
9430
9343
|
continue;
|
|
9431
9344
|
}
|
|
@@ -9434,9 +9347,7 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9434
9347
|
}
|
|
9435
9348
|
i++;
|
|
9436
9349
|
}
|
|
9437
|
-
|
|
9438
|
-
parts.push(text.slice(copied));
|
|
9439
|
-
return parts.join("");
|
|
9350
|
+
return applyRedactionRanges(text, ranges, MCP_APPLY_RANGE_OPTIONS);
|
|
9440
9351
|
}
|
|
9441
9352
|
function chooseFreshPlaceholderPrefix(text) {
|
|
9442
9353
|
for (;;) {
|
|
@@ -9455,7 +9366,7 @@ function redactRemainingCredentialShapes(text) {
|
|
|
9455
9366
|
const protectedSpans = [];
|
|
9456
9367
|
let i = 0;
|
|
9457
9368
|
while (i < text.length) {
|
|
9458
|
-
if (!(i > 0 &&
|
|
9369
|
+
if (!(i > 0 && isAsciiWordCode(text.charCodeAt(i - 1))) && matchesAsciiCaseInsensitiveAt(text, "bearer", i)) {
|
|
9459
9370
|
const afterKw = i + 6;
|
|
9460
9371
|
const valStart = skipHorizontalWs(text, afterKw);
|
|
9461
9372
|
if (valStart > afterKw && valStart < text.length) {
|
|
@@ -9541,8 +9452,8 @@ function clipRedactedPrefix(redactedHead, redactedFull) {
|
|
|
9541
9452
|
let lcp = 0;
|
|
9542
9453
|
const minLen = Math.min(redactedHead.length, redactedFull.length);
|
|
9543
9454
|
while (lcp < minLen && redactedHead.charCodeAt(lcp) === redactedFull.charCodeAt(lcp)) lcp++;
|
|
9544
|
-
const searchStart = Math.max(0, lcp -
|
|
9545
|
-
for (let j = searchStart; j <= lcp; j++) if (redactedFull.startsWith(REDACTED, j)) return redactedFull.slice(0, j +
|
|
9455
|
+
const searchStart = Math.max(0, lcp - REDACTED.length + 1);
|
|
9456
|
+
for (let j = searchStart; j <= lcp; j++) if (redactedFull.startsWith(REDACTED, j)) return redactedFull.slice(0, j + REDACTED.length);
|
|
9546
9457
|
return redactedHead.slice(0, lcp);
|
|
9547
9458
|
}
|
|
9548
9459
|
/**
|
|
@@ -13868,16 +13779,11 @@ function withMupdfDiagnostics(message) {
|
|
|
13868
13779
|
mupdfDiagnostics = [];
|
|
13869
13780
|
return `${message} (mupdf: ${detail})`;
|
|
13870
13781
|
}
|
|
13871
|
-
|
|
13782
|
+
const getMarkit = memoizeAsync(async () => {
|
|
13872
13783
|
captureMupdfDiagnostics();
|
|
13873
|
-
const
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
return instance;
|
|
13877
|
-
});
|
|
13878
|
-
markit = () => promise;
|
|
13879
|
-
return promise;
|
|
13880
|
-
};
|
|
13784
|
+
const { Markit } = await loadOnDemand("document conversion", () => import("./dist-KOELCESV.js").catch((error) => __atomicOnDemandFailed(error, "this feature")));
|
|
13785
|
+
return new Markit();
|
|
13786
|
+
});
|
|
13881
13787
|
function normalizeExtension(extension) {
|
|
13882
13788
|
const trimmed = extension.trim().toLowerCase();
|
|
13883
13789
|
return trimmed ? trimmed.startsWith(".") ? trimmed : `.${trimmed}` : ".bin";
|
|
@@ -13892,7 +13798,7 @@ function abortError() {
|
|
|
13892
13798
|
}
|
|
13893
13799
|
async function runMarkitConversion(task, signal) {
|
|
13894
13800
|
if (signal?.aborted) throw abortError();
|
|
13895
|
-
const instance = await
|
|
13801
|
+
const instance = await getMarkit();
|
|
13896
13802
|
mupdfDiagnostics = [];
|
|
13897
13803
|
if (!signal) return task(instance);
|
|
13898
13804
|
return await new Promise((resolve, reject) => {
|
|
@@ -14086,6 +13992,129 @@ function getLockPath(todosDir, id) {
|
|
|
14086
13992
|
const DEFAULT_TOOL_ABORT_GRACE_MS = 1e4;
|
|
14087
13993
|
/** The longest delay a timer takes; a larger value would fire at once. */
|
|
14088
13994
|
const MAX_TIMER_MS = 2147483647;
|
|
13995
|
+
const graceOwners = /* @__PURE__ */ new WeakMap();
|
|
13996
|
+
function graceOwnerState(owner) {
|
|
13997
|
+
let state = graceOwners.get(owner);
|
|
13998
|
+
if (state === void 0) {
|
|
13999
|
+
state = {
|
|
14000
|
+
timers: /* @__PURE__ */ new Set(),
|
|
14001
|
+
keepAliveHolders: 0,
|
|
14002
|
+
released: false
|
|
14003
|
+
};
|
|
14004
|
+
graceOwners.set(owner, state);
|
|
14005
|
+
}
|
|
14006
|
+
return state;
|
|
14007
|
+
}
|
|
14008
|
+
function pruneGraceOwner(owner, state) {
|
|
14009
|
+
if (state.timers.size === 0 && state.keepAliveHolders === 0 && !state.released) graceOwners.delete(owner);
|
|
14010
|
+
}
|
|
14011
|
+
function acquireGraceKeepAlive(owner) {
|
|
14012
|
+
const state = graceOwnerState(owner);
|
|
14013
|
+
state.keepAliveHolders += 1;
|
|
14014
|
+
if (!state.released) for (const timer of state.timers) timer.ref?.();
|
|
14015
|
+
let released = false;
|
|
14016
|
+
return () => {
|
|
14017
|
+
if (released) return;
|
|
14018
|
+
released = true;
|
|
14019
|
+
state.keepAliveHolders = Math.max(0, state.keepAliveHolders - 1);
|
|
14020
|
+
if (state.keepAliveHolders === 0) {
|
|
14021
|
+
for (const timer of state.timers) timer.unref?.();
|
|
14022
|
+
pruneGraceOwner(owner, state);
|
|
14023
|
+
}
|
|
14024
|
+
};
|
|
14025
|
+
}
|
|
14026
|
+
var ObservedGracePromise = class ObservedGracePromise extends Promise {
|
|
14027
|
+
static get [Symbol.species]() {
|
|
14028
|
+
return Promise;
|
|
14029
|
+
}
|
|
14030
|
+
#onObserve;
|
|
14031
|
+
constructor(executor, onObserve) {
|
|
14032
|
+
super(executor);
|
|
14033
|
+
this.#onObserve = onObserve;
|
|
14034
|
+
}
|
|
14035
|
+
then(onfulfilled, onrejected) {
|
|
14036
|
+
const observe = this.#onObserve;
|
|
14037
|
+
const next = super.then(onfulfilled, onrejected);
|
|
14038
|
+
if (typeof onfulfilled === "function") {
|
|
14039
|
+
this.#onObserve = void 0;
|
|
14040
|
+
observe?.();
|
|
14041
|
+
return next;
|
|
14042
|
+
}
|
|
14043
|
+
if (observe === void 0) return next;
|
|
14044
|
+
return new ObservedGracePromise((resolve, reject) => {
|
|
14045
|
+
next.then(resolve, reject);
|
|
14046
|
+
}, observe);
|
|
14047
|
+
}
|
|
14048
|
+
};
|
|
14049
|
+
/**
|
|
14050
|
+
* Wrap `promise` so that observing its settlement (`await`, `.then(fn)`, `.finally(fn)`, `Promise.all`/`Promise.race`,
|
|
14051
|
+
* or `await p.catch(...)`) keeps active and subsequently armed abort-grace timers for `owner` ref'd until `promise`
|
|
14052
|
+
* settles. An unobserved call (such as `void session.prompt()`, `void session.prompt().catch(() => {})`, or `void
|
|
14053
|
+
* session.abort()`) leaves those timers unref'd so the process can exit immediately.
|
|
14054
|
+
*/
|
|
14055
|
+
function holdToolAbortGraceWhenObserved(owner, promise) {
|
|
14056
|
+
let settled = false;
|
|
14057
|
+
let observed = false;
|
|
14058
|
+
let release;
|
|
14059
|
+
const done = () => {
|
|
14060
|
+
settled = true;
|
|
14061
|
+
const releaseNow = release;
|
|
14062
|
+
release = void 0;
|
|
14063
|
+
releaseNow?.();
|
|
14064
|
+
};
|
|
14065
|
+
const observe = () => {
|
|
14066
|
+
if (observed || settled) return;
|
|
14067
|
+
observed = true;
|
|
14068
|
+
release = acquireGraceKeepAlive(owner);
|
|
14069
|
+
};
|
|
14070
|
+
return new ObservedGracePromise((resolve, reject) => {
|
|
14071
|
+
promise.then((value) => {
|
|
14072
|
+
done();
|
|
14073
|
+
resolve(value);
|
|
14074
|
+
}, (error) => {
|
|
14075
|
+
done();
|
|
14076
|
+
reject(error);
|
|
14077
|
+
});
|
|
14078
|
+
}, observe);
|
|
14079
|
+
}
|
|
14080
|
+
/**
|
|
14081
|
+
* Arm an abort-grace timer tracked under `owner` (typically an `AgentSession`, across every signal its tools run under).
|
|
14082
|
+
* The timer starts unref'd unless an observed abort caller is actively awaiting settlement for `owner`, and is unref'd
|
|
14083
|
+
* again once no awaited caller remains or {@link releaseToolAbortGraceTimers} runs during disposal.
|
|
14084
|
+
*/
|
|
14085
|
+
function armToolAbortGraceTimer(owner, graceMs, onExpire) {
|
|
14086
|
+
const state = owner === void 0 ? void 0 : graceOwnerState(owner);
|
|
14087
|
+
const timer = setTimeout(() => {
|
|
14088
|
+
if (owner !== void 0 && state !== void 0) {
|
|
14089
|
+
state.timers.delete(timer);
|
|
14090
|
+
pruneGraceOwner(owner, state);
|
|
14091
|
+
}
|
|
14092
|
+
onExpire();
|
|
14093
|
+
}, graceMs);
|
|
14094
|
+
if (state !== void 0) {
|
|
14095
|
+
state.timers.add(timer);
|
|
14096
|
+
if (state.released || state.keepAliveHolders === 0) timer.unref?.();
|
|
14097
|
+
} else timer.unref?.();
|
|
14098
|
+
return timer;
|
|
14099
|
+
}
|
|
14100
|
+
/** Clear an abort-grace timer armed through {@link armToolAbortGraceTimer}. */
|
|
14101
|
+
function clearToolAbortGraceTimer(owner, timer) {
|
|
14102
|
+
if (timer === void 0) return;
|
|
14103
|
+
clearTimeout(timer);
|
|
14104
|
+
if (owner === void 0) return;
|
|
14105
|
+
const state = graceOwners.get(owner);
|
|
14106
|
+
if (state === void 0) return;
|
|
14107
|
+
state.timers.delete(timer);
|
|
14108
|
+
pruneGraceOwner(owner, state);
|
|
14109
|
+
}
|
|
14110
|
+
/** Unref all active and future abort-grace timers for `owner` once disposal has moved past its abort step. */
|
|
14111
|
+
function releaseToolAbortGraceTimers(owner) {
|
|
14112
|
+
if (owner === void 0) return;
|
|
14113
|
+
const state = graceOwnerState(owner);
|
|
14114
|
+
state.released = true;
|
|
14115
|
+
for (const timer of state.timers) timer.unref?.();
|
|
14116
|
+
state.timers.clear();
|
|
14117
|
+
}
|
|
14089
14118
|
/** `ATOMIC_TOOL_ABORT_GRACE_MS` when it is a whole number of milliseconds, otherwise the default. */
|
|
14090
14119
|
function toolAbortGraceMs(env = process.env) {
|
|
14091
14120
|
const value = env.ATOMIC_TOOL_ABORT_GRACE_MS?.trim();
|
|
@@ -14110,7 +14139,7 @@ function abandonedToolResult(toolName, graceMs) {
|
|
|
14110
14139
|
* `tool`, whose calls answer at most a grace period after their turn is interrupted (#5486). A call still running then
|
|
14111
14140
|
* gets {@link abandonedToolResult}, so the turn can end. A call that stops within the grace keeps its own result.
|
|
14112
14141
|
*/
|
|
14113
|
-
function withToolAbortGrace(tool) {
|
|
14142
|
+
function withToolAbortGrace(tool, owner) {
|
|
14114
14143
|
return {
|
|
14115
14144
|
...tool,
|
|
14116
14145
|
execute: (toolCallId, params, signal, onUpdate, ...rest) => {
|
|
@@ -14121,15 +14150,16 @@ function withToolAbortGrace(tool) {
|
|
|
14121
14150
|
return Promise.reject(error);
|
|
14122
14151
|
}
|
|
14123
14152
|
if (signal === void 0) return running;
|
|
14124
|
-
|
|
14153
|
+
const timerOwner = owner ?? signal;
|
|
14154
|
+
const guarded = new Promise((resolve, reject) => {
|
|
14125
14155
|
let timer;
|
|
14126
14156
|
const startGrace = () => {
|
|
14127
14157
|
const graceMs = toolAbortGraceMs();
|
|
14128
|
-
timer =
|
|
14129
|
-
timer.unref?.();
|
|
14158
|
+
timer = armToolAbortGraceTimer(timerOwner, graceMs, () => resolve(abandonedToolResult(tool.name, graceMs)));
|
|
14130
14159
|
};
|
|
14131
14160
|
const settle = () => {
|
|
14132
|
-
|
|
14161
|
+
clearToolAbortGraceTimer(timerOwner, timer);
|
|
14162
|
+
timer = void 0;
|
|
14133
14163
|
signal.removeEventListener("abort", startGrace);
|
|
14134
14164
|
};
|
|
14135
14165
|
if (signal.aborted) startGrace();
|
|
@@ -14142,6 +14172,7 @@ function withToolAbortGrace(tool) {
|
|
|
14142
14172
|
reject(error);
|
|
14143
14173
|
});
|
|
14144
14174
|
});
|
|
14175
|
+
return owner === void 0 ? holdToolAbortGraceWhenObserved(signal, guarded) : guarded;
|
|
14145
14176
|
}
|
|
14146
14177
|
};
|
|
14147
14178
|
}
|
|
@@ -14215,6 +14246,26 @@ function releaseTurnPause(session) {
|
|
|
14215
14246
|
session._turnPauseRelease = tracked;
|
|
14216
14247
|
return tracked;
|
|
14217
14248
|
}
|
|
14249
|
+
// dist/core/user-message-origin.js
|
|
14250
|
+
/**
|
|
14251
|
+
* Ephemeral origin send identity for a live user message, linking a host prompt submission to the
|
|
14252
|
+
* `message_start` event the session emits for it (whether directly or after queueing).
|
|
14253
|
+
*
|
|
14254
|
+
* Kept off public message/event objects and never persisted to session storage. The shared weak map
|
|
14255
|
+
* works across two first-party module instances in the same process.
|
|
14256
|
+
*/
|
|
14257
|
+
const ORIGIN_KEY = Symbol.for("atomic.user-message-origin.v1");
|
|
14258
|
+
const globalScope = globalThis;
|
|
14259
|
+
globalScope[ORIGIN_KEY] ??= /* @__PURE__ */ new WeakMap();
|
|
14260
|
+
const origins = globalScope[ORIGIN_KEY];
|
|
14261
|
+
/** Record that `message` originated from host prompt send `originSendId`. */
|
|
14262
|
+
function noteUserMessageOrigin(message, originSendId) {
|
|
14263
|
+
origins.set(message, originSendId);
|
|
14264
|
+
}
|
|
14265
|
+
/** The host prompt send id `message` originated from; undefined when untagged or from an older engine. */
|
|
14266
|
+
function userMessageOrigin(message) {
|
|
14267
|
+
return origins.get(message);
|
|
14268
|
+
}
|
|
14218
14269
|
// dist/core/chat-receipts.js
|
|
14219
14270
|
const key = Symbol.for("atomic.chat-display-receipts.v1");
|
|
14220
14271
|
const writesKey = Symbol.for("atomic.chat-display-writes.v1");
|
|
@@ -14420,9 +14471,10 @@ var QueuedDeliveryRelay = class {
|
|
|
14420
14471
|
retired = /* @__PURE__ */ new WeakSet();
|
|
14421
14472
|
/**
|
|
14422
14473
|
* The change to send with `event`, which `session` sends now; undefined when there is none to send with it. `message`
|
|
14423
|
-
* is the receipt id of the queued user message `event` starts or saves
|
|
14474
|
+
* is the receipt id of the queued user message `event` starts or saves; `origin` is the host prompt send id that
|
|
14475
|
+
* originated the user message `event` starts.
|
|
14424
14476
|
*/
|
|
14425
|
-
note(session, event, message) {
|
|
14477
|
+
note(session, event, message, origin) {
|
|
14426
14478
|
const dropped = event.type === "agent_end" ? takeQueuedMessagesDroppedAt(event) ?? [] : [];
|
|
14427
14479
|
if (event.type === "tool_execution_update" || this.retired.has(session)) return void 0;
|
|
14428
14480
|
const start = this.head;
|
|
@@ -14437,9 +14489,10 @@ var QueuedDeliveryRelay = class {
|
|
|
14437
14489
|
this.head = 0;
|
|
14438
14490
|
}
|
|
14439
14491
|
for (const delivery of taken) this.told.push(delivery);
|
|
14440
|
-
if (ended === 0 && taken.length === 0 && dropped.length === 0 && message === void 0) return void 0;
|
|
14492
|
+
if (ended === 0 && taken.length === 0 && dropped.length === 0 && message === void 0 && origin === void 0) return void 0;
|
|
14441
14493
|
return {
|
|
14442
14494
|
...message === void 0 ? {} : { message },
|
|
14495
|
+
...origin === void 0 ? {} : { origin },
|
|
14443
14496
|
...ended > 0 ? { ended } : {},
|
|
14444
14497
|
...taken.length > 0 ? { taken: taken.map(({ lane, text, receipt }) => ({
|
|
14445
14498
|
lane,
|
|
@@ -14561,9 +14614,10 @@ function takeQueuedDeliveryChange(event) {
|
|
|
14561
14614
|
/** `value` as a change in deliveries, as an engine writes one; undefined for anything else. */
|
|
14562
14615
|
function parseQueuedDeliveryChange(value) {
|
|
14563
14616
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
|
|
14564
|
-
const { ended, taken, dropped, message } = value;
|
|
14617
|
+
const { ended, taken, dropped, message, origin } = value;
|
|
14565
14618
|
if (ended !== void 0 && !(typeof ended === "number" && Number.isSafeInteger(ended) && ended >= 0)) return void 0;
|
|
14566
14619
|
if (message !== void 0 && typeof message !== "string") return void 0;
|
|
14620
|
+
if (origin !== void 0 && typeof origin !== "string") return void 0;
|
|
14567
14621
|
const entries = parseQueuedDeliveryEntries(taken);
|
|
14568
14622
|
const droppedEntries = parseQueuedDeliveryEntries(dropped);
|
|
14569
14623
|
if (entries === void 0 || droppedEntries === void 0) return void 0;
|
|
@@ -14571,7 +14625,8 @@ function parseQueuedDeliveryChange(value) {
|
|
|
14571
14625
|
...typeof ended === "number" && ended > 0 ? { ended } : {},
|
|
14572
14626
|
...entries.length > 0 ? { taken: entries } : {},
|
|
14573
14627
|
...droppedEntries.length > 0 ? { dropped: droppedEntries } : {},
|
|
14574
|
-
...message === void 0 ? {} : { message }
|
|
14628
|
+
...message === void 0 ? {} : { message },
|
|
14629
|
+
...origin === void 0 ? {} : { origin }
|
|
14575
14630
|
};
|
|
14576
14631
|
}
|
|
14577
14632
|
/** `value`, absent or a list of messages with their lanes, as an engine writes one; undefined for anything else. */
|
|
@@ -16875,6 +16930,52 @@ function sameRecord(a, b) {
|
|
|
16875
16930
|
function resourceInternals(loader) {
|
|
16876
16931
|
return loader;
|
|
16877
16932
|
}
|
|
16933
|
+
// dist/utils/batched-canonical-path.js
|
|
16934
|
+
function canBatchCanonicalLeaf(path, parent, leaf) {
|
|
16935
|
+
return path.length > 0 && parent !== path && leaf.length > 0 && leaf !== "." && leaf !== ".." && !path.endsWith("/") && !path.endsWith("\\");
|
|
16936
|
+
}
|
|
16937
|
+
/**
|
|
16938
|
+
* Returns a memoized per-batch async canonicalizer that resolves shared ancestor directories once via
|
|
16939
|
+
* `canonicalizePathAsync` (non-native `fs.realpath`) and verifies non-symlink leaves with a single `lstat`.
|
|
16940
|
+
* Any root, empty, relative-dot, trailing-slash, missing, or symlink leaf falls back to `canonicalizePathAsync`,
|
|
16941
|
+
* preserving exact `canonicalizePath` spelling on POSIX and Windows (including 8.3 short paths and junctions).
|
|
16942
|
+
*/
|
|
16943
|
+
function createBatchedCanonicalizePathAsync() {
|
|
16944
|
+
const dirCache = /* @__PURE__ */ new Map();
|
|
16945
|
+
const resolveDir = (dir) => {
|
|
16946
|
+
let pending = dirCache.get(dir);
|
|
16947
|
+
if (pending === void 0) {
|
|
16948
|
+
const parent = dirname$1(dir);
|
|
16949
|
+
const leaf = basename$1(dir);
|
|
16950
|
+
if (!canBatchCanonicalLeaf(dir, parent, leaf)) pending = canonicalizePathAsync(dir);
|
|
16951
|
+
else pending = (async () => {
|
|
16952
|
+
const realParent = await resolveDir(parent);
|
|
16953
|
+
const candidate = join$1(realParent, leaf);
|
|
16954
|
+
try {
|
|
16955
|
+
if (!(await lstat(candidate)).isSymbolicLink()) return candidate;
|
|
16956
|
+
} catch {
|
|
16957
|
+
return canonicalizePathAsync(dir);
|
|
16958
|
+
}
|
|
16959
|
+
return canonicalizePathAsync(dir);
|
|
16960
|
+
})();
|
|
16961
|
+
dirCache.set(dir, pending);
|
|
16962
|
+
}
|
|
16963
|
+
return pending;
|
|
16964
|
+
};
|
|
16965
|
+
return async (path) => {
|
|
16966
|
+
const parent = dirname$1(path);
|
|
16967
|
+
const leaf = basename$1(path);
|
|
16968
|
+
if (!canBatchCanonicalLeaf(path, parent, leaf)) return canonicalizePathAsync(path);
|
|
16969
|
+
const realParent = await resolveDir(parent);
|
|
16970
|
+
const candidate = join$1(realParent, leaf);
|
|
16971
|
+
try {
|
|
16972
|
+
if (!(await lstat(candidate)).isSymbolicLink()) return candidate;
|
|
16973
|
+
} catch {
|
|
16974
|
+
return canonicalizePathAsync(path);
|
|
16975
|
+
}
|
|
16976
|
+
return canonicalizePathAsync(path);
|
|
16977
|
+
};
|
|
16978
|
+
}
|
|
16878
16979
|
// dist/extensions/herdr/environment.js
|
|
16879
16980
|
function captureHerdrEnvironment(env) {
|
|
16880
16981
|
if (env.HERDR_ENV !== "1" || !env.HERDR_BIN_PATH || !env.HERDR_PANE_ID || !env.HERDR_SOCKET_PATH) return void 0;
|
|
@@ -17329,6 +17430,35 @@ function modelCallUsage(event) {
|
|
|
17329
17430
|
default: return;
|
|
17330
17431
|
}
|
|
17331
17432
|
}
|
|
17433
|
+
// dist/core/provider-request-dispatch.js
|
|
17434
|
+
/**
|
|
17435
|
+
* Session-scoped notification fired right as a provider request reaches the
|
|
17436
|
+
* `before-provider-request` dispatch boundary (after deferred startup, hooks,
|
|
17437
|
+
* OAuth refresh, model discovery, and lazy API loading have completed).
|
|
17438
|
+
*/
|
|
17439
|
+
const listenersBySession = /* @__PURE__ */ new WeakMap();
|
|
17440
|
+
/** Subscribes to provider-request dispatch notifications for `session`; returns an unsubscribe function. */
|
|
17441
|
+
function onSessionProviderRequestDispatched(session, listener) {
|
|
17442
|
+
let listeners = listenersBySession.get(session);
|
|
17443
|
+
if (!listeners) {
|
|
17444
|
+
listeners = /* @__PURE__ */ new Set();
|
|
17445
|
+
listenersBySession.set(session, listeners);
|
|
17446
|
+
}
|
|
17447
|
+
listeners.add(listener);
|
|
17448
|
+
return () => {
|
|
17449
|
+
listeners.delete(listener);
|
|
17450
|
+
if (listeners.size === 0 && listenersBySession.get(session) === listeners) listenersBySession.delete(session);
|
|
17451
|
+
};
|
|
17452
|
+
}
|
|
17453
|
+
/** Notifies listeners registered for `session` that a provider request has reached dispatch. */
|
|
17454
|
+
function notifySessionProviderRequestDispatched(session) {
|
|
17455
|
+
if (!session) return;
|
|
17456
|
+
const listeners = listenersBySession.get(session);
|
|
17457
|
+
if (!listeners || listeners.size === 0) return;
|
|
17458
|
+
for (const listener of [...listeners]) try {
|
|
17459
|
+
listener();
|
|
17460
|
+
} catch {}
|
|
17461
|
+
}
|
|
17332
17462
|
// dist/core/storage/adapter-open.js
|
|
17333
17463
|
/**
|
|
17334
17464
|
* Opening an adapter selection's database the way the storage provider does, for the checks that run before a
|
|
@@ -18072,6 +18202,46 @@ async function claimPaneReporting(environment, identity, options = {}) {
|
|
|
18072
18202
|
function matchesActivity(previous, activity) {
|
|
18073
18203
|
return activity.state === previous?.state && activity.reason === previous?.reason && activity.message === previous?.message;
|
|
18074
18204
|
}
|
|
18205
|
+
function startFlight(owner) {
|
|
18206
|
+
let threw = false;
|
|
18207
|
+
const flight = (async () => {
|
|
18208
|
+
try {
|
|
18209
|
+
while (owner.pending && owner.status === "active") {
|
|
18210
|
+
const { activity: next, skipUnchanged } = owner.pending;
|
|
18211
|
+
owner.pending = void 0;
|
|
18212
|
+
if (skipUnchanged && matchesActivity(owner.lastDeliveredActivity, next)) continue;
|
|
18213
|
+
allocateSequence(owner);
|
|
18214
|
+
const resume = owner.identitySent || owner.resumeUnsupported ? void 0 : acceptedResume(owner.identity.resume);
|
|
18215
|
+
let failure = await executeHerdr(owner.environment, reportArgv(owner, next, resume), owner.options.timeoutMs);
|
|
18216
|
+
if (resume && failure?.kind === "protocol_rejected") {
|
|
18217
|
+
allocateSequence(owner);
|
|
18218
|
+
failure = await executeHerdr(owner.environment, reportArgv(owner, next), owner.options.timeoutMs);
|
|
18219
|
+
if (!failure) owner.resumeUnsupported = true;
|
|
18220
|
+
}
|
|
18221
|
+
if (failure) {
|
|
18222
|
+
diagnostic(owner, failure);
|
|
18223
|
+
owner.lastDeliveredActivity = void 0;
|
|
18224
|
+
} else {
|
|
18225
|
+
owner.identitySent = true;
|
|
18226
|
+
owner.lastDeliveredActivity = next;
|
|
18227
|
+
}
|
|
18228
|
+
}
|
|
18229
|
+
} catch (error) {
|
|
18230
|
+
threw = true;
|
|
18231
|
+
throw error;
|
|
18232
|
+
}
|
|
18233
|
+
})().finally(() => {
|
|
18234
|
+
if (owner.flight !== flight) return;
|
|
18235
|
+
owner.flight = void 0;
|
|
18236
|
+
if (threw) {
|
|
18237
|
+
owner.pending = void 0;
|
|
18238
|
+
return;
|
|
18239
|
+
}
|
|
18240
|
+
if (owner.pending && owner.status === "active") return startFlight(owner);
|
|
18241
|
+
});
|
|
18242
|
+
owner.flight = flight;
|
|
18243
|
+
return flight;
|
|
18244
|
+
}
|
|
18075
18245
|
function reportPaneActivity(owner, activity, skipUnchanged = false) {
|
|
18076
18246
|
if (owner.status !== "active" || owners.get(owner.environment.paneId) !== owner) {
|
|
18077
18247
|
diagnostic(owner, { kind: "stale_owner" });
|
|
@@ -18084,30 +18254,7 @@ function reportPaneActivity(owner, activity, skipUnchanged = false) {
|
|
|
18084
18254
|
skipUnchanged: skipUnchanged && !pendingExplicitRefresh
|
|
18085
18255
|
};
|
|
18086
18256
|
if (owner.flight) return;
|
|
18087
|
-
owner
|
|
18088
|
-
while (owner.pending && owner.status === "active") {
|
|
18089
|
-
const { activity: next, skipUnchanged } = owner.pending;
|
|
18090
|
-
owner.pending = void 0;
|
|
18091
|
-
if (skipUnchanged && matchesActivity(owner.lastDeliveredActivity, next)) continue;
|
|
18092
|
-
allocateSequence(owner);
|
|
18093
|
-
const resume = owner.identitySent || owner.resumeUnsupported ? void 0 : acceptedResume(owner.identity.resume);
|
|
18094
|
-
let failure = await executeHerdr(owner.environment, reportArgv(owner, next, resume), owner.options.timeoutMs);
|
|
18095
|
-
if (resume && failure?.kind === "protocol_rejected") {
|
|
18096
|
-
allocateSequence(owner);
|
|
18097
|
-
failure = await executeHerdr(owner.environment, reportArgv(owner, next), owner.options.timeoutMs);
|
|
18098
|
-
if (!failure) owner.resumeUnsupported = true;
|
|
18099
|
-
}
|
|
18100
|
-
if (failure) {
|
|
18101
|
-
diagnostic(owner, failure);
|
|
18102
|
-
owner.lastDeliveredActivity = void 0;
|
|
18103
|
-
} else {
|
|
18104
|
-
owner.identitySent = true;
|
|
18105
|
-
owner.lastDeliveredActivity = next;
|
|
18106
|
-
}
|
|
18107
|
-
}
|
|
18108
|
-
})().finally(() => {
|
|
18109
|
-
owner.flight = void 0;
|
|
18110
|
-
});
|
|
18257
|
+
startFlight(owner);
|
|
18111
18258
|
}
|
|
18112
18259
|
/** Fence and drain a local reporter without unregistering the still-running agent. */
|
|
18113
18260
|
function retirePaneReporting(owner) {
|
|
@@ -18730,6 +18877,7 @@ const LONG_LIVED_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
18730
18877
|
"navigate_tree",
|
|
18731
18878
|
"invoke_shortcut",
|
|
18732
18879
|
"start_pending_recovery",
|
|
18880
|
+
"start_pending_recovery_restore",
|
|
18733
18881
|
"agent_view_prompt",
|
|
18734
18882
|
"agent_view_resume",
|
|
18735
18883
|
"agent_view_pause"
|
|
@@ -19055,6 +19203,61 @@ function quarantineWindowsNativeDependencies(packageDir) {
|
|
|
19055
19203
|
copyFileSync(quarantinePath, loadedFile);
|
|
19056
19204
|
}
|
|
19057
19205
|
}
|
|
19058
|
-
export { ActivityWatchdog, AgentSessionBusyError, BLUEPRINT_CONTEXT_TYPE, BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, BUILTIN_SLASH_COMMANDS, BUNDLED_EXTENSION_SLASH_COMMANDS, BlueprintBuildFailedError, BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, CACHE_WARMING_MODES, COMMAND_DETAIL_TAIL_BYTES, COMMAND_FOREGROUND_BUDGET_MS, CONTINUE_AFTER_FAILURE, CURRENT_SESSION_VERSION, CountdownTimer, DEFAULT_BUILTIN_SELECTION_EXTRA_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_MAX_RESULT_SIZE_CHARS, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_THINKING_LEVEL, Diff, DynamicBorder, ENGINE_UNRESPONSIVE_MS, EditInputError, EditMatchError, EditTargetError, EditToolError, EngineSessionStats, EntryTypeReader, EventSourceError, ExtensionStartupError, FILE_KINDS, FILE_PATTERNS, FINISHED_TASK_RETENTION, FORKED_PACKAGE_NAMES, FORKED_PACKAGE_WORKSPACE_DIRS, FileToolAbortedError, FramedSelector, GIT_LOCAL_ENV_VARS, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionError, GitProvisionTimeoutError, GitUnavailableError, HOST, HOST_NOTICE_TYPE, HostInputBridge, HostListenerFailures, INTERACTIVE_MODEL_REFRESH_TIMEOUT_MS, InteractiveEngineResourceReadinessError, IntercomPolicyError, JSON_RPC_ERROR_CODES, JsonTextChecker, LATEST_PROTOCOL_VERSION, LONG_LIVED_COMMANDS, LlamaServerError, LlamaServerRequestError, LlamaServerUnreachableError, MAX_COMMAND_TIMEOUT_SECONDS, MAX_INTERCOM_REACHABLE_GROUPS, MAX_PERSISTED_OUTPUT_BYTES, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, Minimatch, MissingSessionCwdError, NETWORK_TIMEOUT_MS, NON_SECRET_HTTP_HEADERS, NO_QUEUED_MESSAGES, NativeModuleUnavailableError, PERSISTED_OUTPUT_CLOSING_TAG, PERSISTED_OUTPUT_TAG, PERSISTED_OUTPUT_TRUNCATION_MARKER, PLAIN_SELECTOR_STYLE, POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS, PREVIEW_SIZE_BYTES, QueuedDeliveryRelay, QueuedDeliveryView, RESOURCE_TYPES, RESTART_CANCELLED_MESSAGE, ROW_INTENT_META, RawStdoutWriteError, SESSION_HISTORY_TOOL_NAME, STALE_EXTENSION_CONTEXT_MARKER, STALE_EXTENSION_CONTEXT_MESSAGE, STARTUP_DECISION_TYPED_TEXT_NOTICE, SUPPORTED_PROTOCOL_VERSIONS, Selector, SelectorState, SessionIntercomPolicy, ShellTimeoutError, ShellToolError, SqliteSelectorConnection, Stop, SubscriptionChildUnavailableError, SubscriptionClosedError, SubscriptionConfigError, SubscriptionError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, SubscriptionSetupError, SubscriptionSubscriberUnavailableError, SubscriptionTimeoutError, TASK_MARKS, THINKING_LEVELS, TOOL_DEACTIVATION_ENTRY_TYPE, TOOL_RESULTS_SUBDIR, TYPEBOX_SUBPATHS, TaskCleanupAdmissionTimeoutError, TaskCleanupError, TaskEvictedError, TaskMessageError, TaskMessageTimeoutError, ToolDetachmentError, TrustDecisionSelector, VALID_THINKING_LEVELS, VERBATIM_COMPACTION_STRATEGY, VisualLinePreview, WriteSelectorError, abandonedToolResult, abortFailure, abortSymbol, activeToolExecutionStarts, addHistoryUsageToTotals, addUsageToTotals, allToolNames, announceBlueprintBuildWaiting, announceHistoryLoad, applyBashSessionEnvironment, applyExifOrientation, applySessionSummaryEntries, areExperimentalFeaturesEnabled, assertSessionCwdExists, assertToolPairingInvariant, assignMissingToolCallIds, asyncScope, attachCleanupCause, attachGitCleanupFailure, attachJsonlLineReader, attachLineReader, attachSessionClaim, awaitBlueprintReady, backgroundTaskScope, beginQueuedMessageDelivery, belongsToSession, bindChatEpoch, bindChatReceipt, bindReleasedTaskOwner, bindSavedReadLines, bindSavedTaskOrigins, bindSavedTaskRowKey, bindTaskResumer, blueprintBuildPending, blueprintBuildSettled, blueprintBuildShared, blueprintBuildsRunning, blueprintBuildsSettled, blueprintDigest, boundedChatRecord, buildBoundaryText, buildBoundaryTextWithLocation, cancelHeldInput, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, carryDroppedQueuedMessages, carryRowSource, chatEpoch, chatPosition, chatReceipt, chatReceiptWrite, chatRecordSavesSettled, claimPaneReporting, claimSession, classifiedWorkflowMetadata, cleanupWindowsSelfUpdateQuarantine, clearAssignmentIfClosed, clearFunctionList, clearLockHolder, clearLockHolderAsync, collectDeclaredDisplaySecrets, collectSecretsForMasking, combineMany, combineManyMut, combineUsage, compactTemplate, compactUrl, completeStartup, computeBoxDimensions, confinedIntercomChildGroup, containProcessTree, conventionDirsForResource, convertBufferWithMarkit, convertFileWithMarkit, copyHostQuestionnaire, createConversationRegion, createEventBus, createGitEnvironment, createOwnedAbortController, createSourceInfo, createStagedEventBus, createSyntheticSourceInfo, createTypeScriptSourceSpecifierTransform, createUsageTotals, createWakeDispatcher, customMessageExcludesContext, decodeChatOrder, decodeChatRecord, deduplicateDiagnostics, defaultModelPerProvider, defaultToolNamesFor, deferDeprecationWarnings, defineTool, deserializeSubscriptionError, deserializeToolDetachmentError, detectSupportedImageMimeTypeFromFile, displayTodoId, drainAgentMessageQueue, earlierHeldInputs, emitProgress, encodeChatOrder, endQueuedMessageDelivery, entryLines, expandSearchUrl, experimentalToolSamplingProperty, extractHeaderSecrets, fListSymbol, fetchWithRetry, fieldTone, filterSearchOutputByLineRange, final, finalSymbol, finalValue, findBlueprintError, findGitProvisionError, findLegacyWorkflowFiles, findLlamaServerError, findMissingSessionCwdIssue, findMissingSessionCwdIssueAsync, findPreferredAvailableModel, findSubscriptionError, findTaskEvictedError, findTaskMessageError, findToolDetachmentError, finishHeldInput, firstChatOrders, flushRawStdout, flushSymbol, flushable, forkScope, forkStoreRelation, forkedPackageExportAliases, formatCodexProviderError, formatMissingSessionCwdPrompt, formatNoApiKeyFoundMessage, formatNoModelSelectedMessage, formatNoModelsAvailableMessage, formatReadLineRange, formatSelectedLines, formatSize, formatTimeoutSeconds, formatTodoId, formatTokenCount, formatToolCallWithArgs, formatUnresolvedModelMessage, frozenClocks, getAllBuiltinPackageLocations, getBuiltinPackageLocations, getBuiltinPackagePaths, getDefaultCacheRetention, getDefaultSessionDir, getDefaultSessionDirAsync, getDefaultSessionDirPath, getEngineSessionStats, getErrnoCode, getFinalValue, getFunctionList, getHostQuestionnaire, getLockPath, getMandatoryBuiltinExtensionPaths, getManifestFromPackageJson, getManyValues, getMissingSessionCwdOptions, getPiUserAgent, getProviderLoginHelp, getResourcePathKey, getResourcePathKeyAsync, getSyntheticPathSource, getTextOutput, getTodoPath, getTodoStatus, getTodoTitle, getTodosDir, getTodosDirLabel, getToolExecutionStartedAt, getToolListError, handOverBuildTimings, handlePackageCommandParseOutcome, hasHeldInput, hasHistoryLoadObserver, heldInputView, historySnapshotFor, holdDeprecationWarnings, holdProcessDescendants, holdToolsUntilBuilt, holdToolsUntilOwnerBuilt, holderRuns, hostInputError, hostNoticeForEvent, inheritForkScope, interactiveQuitOf, invalidArgText, invalidateNativeSearchCache, isAgentSessionBusyError, isBlueprintBuildFailedError, isBlueprintError, isBlueprintInvalidError, isBlueprintStepFailedError, isBlueprintStepTimedOutError, isBlueprintUsesUnsupportedError, isClassifiedWorkflowSession, isCodexTokenInvalidationError, isEditInputError, isEditMatchError, isEditTargetError, isEditToolError, isEventSourceError, isExtensionLoadError, isExtensionStartupFailure, isFileToolAbortedError, isFinalValue, isFlushable, isFunctionList, isGitProvisionConfigError, isGitProvisionError, isGitProvisionTimeoutError, isGitUnavailableError, isInstallTelemetryEnabled, isInteractiveEngineResourceReadinessError, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isLlamaServerError, isLlamaServerRequestError, isLlamaServerUnreachableError, isManagedToolDownloadError, isManagedToolError, isManagedToolTimeoutError, isMandatoryRuntimeTool, isMany, isMissingSessionCwdError, isObject, isPathInside, isReadResourceSelector, isReadableUrlPath, isRetryableGitProvisionError, isRetryableLlamaServerError, isRetryableManagedToolError, isRetryableSubscriptionError, isRetryableTaskError, isRetryableTaskMessageError, isSensitiveKeyNameForMasking, isSerializedMissingSessionCwdError, isShellTimeoutError, isShellToolError, isSingleGenericAbortTextContent, isStaleExtensionContextError, isStdoutTakenOver, isStop, isSubscriptionChildUnavailableError, isSubscriptionClosedError, isSubscriptionConfigError, isSubscriptionError, isSubscriptionEventError, isSubscriptionHandlerError, isSubscriptionRecordError, isSubscriptionSetupError, isSubscriptionSubscriberUnavailableError, isSubscriptionTimeoutError, isSyntheticPath, isTaskCleanupAdmissionTimeoutError, isTaskCleanupError, isTaskEvictedError, isTaskMessageError, isTaskMessageTimeoutError, isTodoClosed, isToolDeactivationEntryData, isToolDetachmentError, isToolModifier, isTransientExtensionStartupFailure, isTrustDecision, isTrustedMandatoryRuntimeTool, isUnknownModel, isValidThinkingLevel, isWriteSelectorError, keepDroppedQueuedMessages, keepsDroppedQueuedMessages, keptTaskHint, keptTaskId, leadingAndTrailingWs, leadingWs, legacyWorkflowFilePaths, legacyWorkflowFilePatterns, legacyWorkflowSection, linkPath, literalPathLike, loadConfig, loadNativeSearchBinding, loadShownDeprecationNotices, loadedConfig, lockShared, longerRunAdvice, longestCommonPrefix, longestCommonSuffix, many, manySymbol, markEventLoopShutdown, markEventLoopStartupComplete, markTrustedMandatoryRuntimeExtension, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, mergeSessionTrustDecisions, minimatch, modelCallUsage, nativeForkReader, nativeModuleProblem, nativeModuleUnavailable, noOpUIContext, none, normalizeDisplayText, normalizeInterruptAbortMessage, normalizeMany, normalizePathLikeInput, normalizeTodoId, noteQueueUpdateDeliveries, noteQueuedMessagesDropped, noteRowSource, noteSavedSeq, noteSnapshotGeneration, observeArchiveLoad, observeHistoryLoads, observeReferenceCut, observeToolExecutionTiming, omitLegacyThinkingSections, onBlueprintBuildFinished, onBlueprintBuildWaiting, openAdapterSelectionDatabase, operationSignal, originalHistoryNote, outputExtensionLoadErrors, parseJsonRpcMessage, parsePackageCommand, parseSlashCommand, parseTranscriptFrameLayout, pendingProjectResourcesTrusted, placeTranscriptFrame, prepareLockTakeover, prepareSessionClaim, priorityHoldCounts, processTreeEnded, projectTrustHandlerRegistered, projectTrustWarningVisible, projectTrustedBeforeExtensions, providerOfModelReference, quarantineWindowsNativeDependencies, queueUpdateDeliveries, queuedMessagesUnderWay, queuedReceiptsUnderWay, queuedTextsUnderWay, quitAsInteractiveApp, raceWithAbortSignal, rawStdoutWriteFailed, readLedger, readLines, readPiManifestFile, readTaskOutputTail, receiveChatReceipt, recordLockHolder, recordLockHolderAsync, recordStartupThinkingLevel, redactAuthorizationUrlForDisplay, redactCredentials, redactOAuthErrorText, redactOAuthErrorTextCapped, redactUrlForDisplay, redactUrlForTransportDisplay, redactWwwAuthenticateHeader, referenceMetadataRead, refreshConfig, registerArchiveLoad, registerCanonicalEventBus, registerForkScope, registerHeldInput, registerHistorySnapshot, registerStartupRollback, rehydrateBlueprintError, rehydrateEditToolError, rehydrateGitProvisionError, rehydrateLlamaServerError, rehydrateMissingSessionCwdError, rehydrateShellToolError, rehydrateTaskCleanupError, rehydrateTaskEvictedError, rehydrateTaskMessageError, rehydrateWriteSelectorError, releaseDeprecationWarnings, releasePaneReporting, releaseTurnPause, releaseUnownedPaneRegistration, removePrefix, removeSuffix, removedProviderMessage, renderBlueprintContext, renderBorderedBox, renderToolPath, repairCollapsedScheme, replacePrefix, replaceSuffix, replaceTabs, replacementAbortContent, reportContained, reportPaneActivity, repositoryKey, require_applyReviver, require_constants, require_debug, require_errors, require_identifiers, require_identity, require_ignore, require_line_counter, require_parse_options, require_parse_url, require_resolve_end, require_resolve_props, require_sha256, require_stringifyComment, require_stringifyNumber, require_util_contains_newline, resolveDecisionDeadlineMs, resolvePhysicalPath, resolvePhysicalPathAsync, resolveSchemaRef, resourceInternals, restoreStdout, retirePaneReporting, retryStatusUpdate, rollbackStartup, rootKey, rowSource, rowTone, safeTrustChoiceIndex, sanitizeMcpServers, sanitizeOpenAIResponsesPayload, saveChatRecord, savedConversationThinkingLevel, savedReadLines, savedRowKey, savedRowSpan, savedSeqOf, savedTaskRowKey, savedTaskRows, scopedBackgroundTasks, scrubFetchError, scrubPreCompactionAssistantUsage, scrubUnknownErrorData, searchPosition, segment, selectExactReadRanges, selectReadRanges, selectorHintEntries, sentinelsToAppend, serializeBlueprintError, serializeConversationForCompaction, serializeFileToolError, serializeJsonLine, serializeMissingSessionCwdError, serializeRetainedTranscript, serializeSessionMutation, serializeSubscriptionError, sessionIntercomFacade, sessionTasks, sessionWaitsToRetry, setDeprecationWarningSink, setFunctionList, setMarkitDiagnosticSink, settingsFileNoticeKey, settingsInternals, settleTurnPause, sha256Hex, shareBlueprintBuild, sharedClockNow, sharedWakeDispatcher, shortenPath, shouldRenderEngineDiagnosticAsChatError, shouldRunFirstTimeSetup, sleep, sliceHead, sliceTail, snapshotBashSessionEnvironment, sortTodos, spanElapsedMs, spawnContainedProcess, spawnHostProcess, splitLineRangeSelector, splitPathLikeGlob, splitReadLineSelector, splitTodosByAssignment, sqliteSessionResumeArgs, startEventLoopMonitor, startToolTimer, startupCleanupFailureMessage, startupProjectTrust, stop, stopBlueprintBuilds, stopErrorSymbol, stopWaiting, str, stringEntries, stripFenceMarkers, stripUrlUserinfoAndHash, styleFieldTone, summarizeSession, takeOverDeadHolder, takeOverDeadHolderAsync, takeOverStdout, takeQueuedDeliveryChange, takeQueuedMessagesDroppedAt, taskMark, taskOutcomeStatus, taskOutputText, taskResumer, taskSessionKey, taskStoppedForResume, themeSelectorStyle, thisProcess, timestamp, toError, toMany, toolAbortGraceMs, toolTimerText, trackChatRecordSave, trailingWs, transcriptHeaderLines, transcriptLayoutOf, truncateHead, truncateLine, truncateMiddle, truncateTail, truncateToVisualLines, uniquifyToolCallIds, updateLedger, usageCostBreakdown, validQuestionnaire, validateGuidanceFields, validateIntercomSessionOptions, validateTimeoutOverride, validateTodoId, waitForEventLoopMonitorReady, waitForRawStdoutBackpressure, warnDeprecation, watchFirstProjectTrustHandler, watchReferenceCut, whenAborted, windowsTemporaryFiles, withCleanup, withFileMutationQueue, withInstallLock, withLegacyPackageNames, withProgress, withQueuedDeliveryChange, withResolvingFileMutationQueue, withToolAbortGrace, withinDecisionDeadline, workspaceKey, writeOutputFile, writeRawStdout, writeRawStdoutControl, writeRawStdoutOnce, yieldToEventLoop, yieldToEventLoopIfSlow, yieldTurn };
|
|
19206
|
+
/**
|
|
19207
|
+
* Whether package-manager stderr on Windows indicates a file/directory lock (`EBUSY` / `EPERM` on `rename`, `unlink`,
|
|
19208
|
+
* `rmdir`, or `rm`), such as an earlier Intercom broker holding a directory handle on `dist\builtin\intercom`.
|
|
19209
|
+
*/
|
|
19210
|
+
function isWindowsInstallDirectoryLockError(output) {
|
|
19211
|
+
if (!output) return false;
|
|
19212
|
+
const lower = output.toLowerCase();
|
|
19213
|
+
if (!(lower.includes("code ebusy") || lower.includes("ebusy:") || lower.includes("errno -4082") || lower.includes("code eperm") || lower.includes("eperm:") || lower.includes("errno -4048"))) return false;
|
|
19214
|
+
return lower.includes("syscall rename") || lower.includes("syscall unlink") || lower.includes("syscall rmdir") || lower.includes("syscall rm") || lower.includes("syscall copyfile") || lower.includes(", rename ") || lower.includes(", unlink ") || lower.includes(", rmdir ") || lower.includes(", rm ") || lower.includes(", copyfile ") || lower.includes("resource busy or locked");
|
|
19215
|
+
}
|
|
19216
|
+
export { ActivityWatchdog, AgentSessionBusyError, BLUEPRINT_CONTEXT_TYPE, BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, BUILTIN_SLASH_COMMANDS, BUNDLED_EXTENSION_SLASH_COMMANDS, BlueprintBuildFailedError, BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, CACHE_WARMING_MODES, COMMAND_DETAIL_TAIL_BYTES, COMMAND_FOREGROUND_BUDGET_MS, CONTINUE_AFTER_FAILURE, CURRENT_SESSION_VERSION, CountdownTimer, DEFAULT_BUILTIN_SELECTION_EXTRA_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_MAX_RESULT_SIZE_CHARS, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_THINKING_LEVEL, Diff, DynamicBorder, ENGINE_UNRESPONSIVE_MS, EditInputError, EditMatchError, EditTargetError, EditToolError, EngineSessionStats, EntryTypeReader, EventSourceError, ExtensionStartupError, FILE_KINDS, FILE_PATTERNS, FINISHED_TASK_RETENTION, FORKED_PACKAGE_NAMES, FORKED_PACKAGE_WORKSPACE_DIRS, FileToolAbortedError, FramedSelector, GIT_LOCAL_ENV_VARS, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionError, GitProvisionTimeoutError, GitUnavailableError, HOST, HOST_NOTICE_TYPE, HostInputBridge, HostListenerFailures, INTERACTIVE_MODEL_REFRESH_TIMEOUT_MS, InteractiveEngineResourceReadinessError, IntercomPolicyError, JSON_RPC_ERROR_CODES, JsonTextChecker, LATEST_PROTOCOL_VERSION, LONG_LIVED_COMMANDS, LlamaServerError, LlamaServerRequestError, LlamaServerUnreachableError, MAX_COMMAND_TIMEOUT_SECONDS, MAX_INTERCOM_REACHABLE_GROUPS, MAX_PERSISTED_OUTPUT_BYTES, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, Minimatch, MissingSessionCwdError, NETWORK_TIMEOUT_MS, NON_SECRET_HTTP_HEADERS, NO_QUEUED_MESSAGES, NativeModuleUnavailableError, PERSISTED_OUTPUT_CLOSING_TAG, PERSISTED_OUTPUT_TAG, PERSISTED_OUTPUT_TRUNCATION_MARKER, PLAIN_SELECTOR_STYLE, POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS, PREVIEW_SIZE_BYTES, QueuedDeliveryRelay, QueuedDeliveryView, RESOURCE_TYPES, RESTART_CANCELLED_MESSAGE, ROW_INTENT_META, RawStdoutWriteError, SESSION_HISTORY_TOOL_NAME, STALE_EXTENSION_CONTEXT_MARKER, STALE_EXTENSION_CONTEXT_MESSAGE, STARTUP_DECISION_TYPED_TEXT_NOTICE, SUPPORTED_PROTOCOL_VERSIONS, Selector, SelectorState, SessionIntercomPolicy, ShellTimeoutError, ShellToolError, SqliteSelectorConnection, Stop, SubscriptionChildUnavailableError, SubscriptionClosedError, SubscriptionConfigError, SubscriptionError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, SubscriptionSetupError, SubscriptionSubscriberUnavailableError, SubscriptionTimeoutError, TASK_MARKS, THINKING_LEVELS, TOOL_DEACTIVATION_ENTRY_TYPE, TOOL_RESULTS_SUBDIR, TYPEBOX_SUBPATHS, TaskCleanupAdmissionTimeoutError, TaskCleanupError, TaskEvictedError, TaskMessageError, TaskMessageTimeoutError, ToolDetachmentError, TrustDecisionSelector, VALID_THINKING_LEVELS, VERBATIM_COMPACTION_STRATEGY, VisualLinePreview, WriteSelectorError, abandonedToolResult, abortFailure, abortSymbol, activeToolExecutionStarts, addHistoryUsageToTotals, addUsageToTotals, allToolNames, announceBlueprintBuildWaiting, announceHistoryLoad, applyBashSessionEnvironment, applyExifOrientation, applySessionSummaryEntries, areExperimentalFeaturesEnabled, armToolAbortGraceTimer, assertSessionCwdExists, assertToolPairingInvariant, assignMissingToolCallIds, asyncScope, attachCleanupCause, attachGitCleanupFailure, attachJsonlLineReader, attachLineReader, attachSessionClaim, awaitBlueprintReady, backgroundTaskScope, beginQueuedMessageDelivery, belongsToSession, bindChatEpoch, bindChatReceipt, bindReleasedTaskOwner, bindSavedReadLines, bindSavedTaskOrigins, bindSavedTaskRowKey, bindTaskResumer, blueprintBuildPending, blueprintBuildSettled, blueprintBuildShared, blueprintBuildsRunning, blueprintBuildsSettled, blueprintDigest, boundedChatRecord, buildBoundaryText, buildBoundaryTextWithLocation, cancelHeldInput, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, carryDroppedQueuedMessages, carryRowSource, chatEpoch, chatPosition, chatReceipt, chatReceiptWrite, chatRecordSavesSettled, claimPaneReporting, claimSession, classifiedWorkflowMetadata, cleanupWindowsSelfUpdateQuarantine, clearAssignmentIfClosed, clearFunctionList, clearLockHolder, clearLockHolderAsync, clearToolAbortGraceTimer, collectDeclaredDisplaySecrets, collectSecretsForMasking, combineMany, combineManyMut, combineUsage, compactTemplate, compactUrl, completeStartup, computeBoxDimensions, confinedIntercomChildGroup, containProcessTree, containProcessTreeAllowingBreakaway, conventionDirsForResource, convertBufferWithMarkit, convertFileWithMarkit, copyHostQuestionnaire, createBatchedCanonicalizePathAsync, createConversationRegion, createEventBus, createGitEnvironment, createOwnedAbortController, createSourceInfo, createStagedEventBus, createSyntheticSourceInfo, createTypeScriptSourceSpecifierTransform, createUsageTotals, createWakeDispatcher, customMessageExcludesContext, decodeChatOrder, decodeChatRecord, deduplicateDiagnostics, defaultModelPerProvider, defaultToolNamesFor, deferDeprecationWarnings, defineTool, deserializeSubscriptionError, deserializeToolDetachmentError, detectSupportedImageMimeTypeFromFile, displayTodoId, drainAgentMessageQueue, earlierHeldInputs, emitProgress, encodeChatOrder, endQueuedMessageDelivery, entryLines, expandSearchUrl, experimentalToolSamplingProperty, extractHeaderSecrets, fListSymbol, fetchWithRetry, fieldTone, filterSearchOutputByLineRange, final, finalSymbol, finalValue, findBlueprintError, findGitProvisionError, findLegacyWorkflowFiles, findLlamaServerError, findMissingSessionCwdIssue, findMissingSessionCwdIssueAsync, findPreferredAvailableModel, findSubscriptionError, findTaskEvictedError, findTaskMessageError, findToolDetachmentError, finishHeldInput, firstChatOrders, flushRawStdout, flushSymbol, flushable, forkScope, forkStoreRelation, forkedPackageExportAliases, formatCodexProviderError, formatMissingSessionCwdPrompt, formatNoApiKeyFoundMessage, formatNoModelSelectedMessage, formatNoModelsAvailableMessage, formatReadLineRange, formatSelectedLines, formatSize, formatTimeoutSeconds, formatTodoId, formatTokenCount, formatToolCallWithArgs, formatUnresolvedModelMessage, frozenClocks, getAllBuiltinPackageLocations, getBuiltinPackageLocations, getBuiltinPackagePaths, getDefaultCacheRetention, getDefaultSessionDir, getDefaultSessionDirAsync, getDefaultSessionDirPath, getEngineSessionStats, getErrnoCode, getFinalValue, getFunctionList, getHostQuestionnaire, getLockPath, getMandatoryBuiltinExtensionPaths, getManifestFromPackageJson, getManyValues, getMissingSessionCwdOptions, getPiUserAgent, getProviderLoginHelp, getResourcePathKey, getResourcePathKeyAsync, getSyntheticPathSource, getTextOutput, getTodoPath, getTodoStatus, getTodoTitle, getTodosDir, getTodosDirLabel, getToolExecutionStartedAt, getToolListError, handOverBuildTimings, handlePackageCommandParseOutcome, hasHeldInput, hasHistoryLoadObserver, hasNativeProcessHold, heldInputView, historySnapshotFor, holdDeprecationWarnings, holdProcessDescendants, holdProcessDescendantsResult, holdToolAbortGraceWhenObserved, holdToolsUntilBuilt, holdToolsUntilOwnerBuilt, holderRuns, hostInputError, hostNoticeForEvent, inheritForkScope, interactiveQuitOf, invalidArgText, invalidateNativeSearchCache, isAgentSessionBusyError, isBlueprintBuildFailedError, isBlueprintError, isBlueprintInvalidError, isBlueprintStepFailedError, isBlueprintStepTimedOutError, isBlueprintUsesUnsupportedError, isClassifiedWorkflowSession, isCodexTokenInvalidationError, isEditInputError, isEditMatchError, isEditTargetError, isEditToolError, isEventSourceError, isExtensionLoadError, isExtensionStartupFailure, isFileToolAbortedError, isFinalValue, isFlushable, isFunctionList, isGitProvisionConfigError, isGitProvisionError, isGitProvisionTimeoutError, isGitUnavailableError, isInstallTelemetryEnabled, isInteractiveEngineResourceReadinessError, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isLlamaServerError, isLlamaServerRequestError, isLlamaServerUnreachableError, isManagedToolDownloadError, isManagedToolError, isManagedToolTimeoutError, isMandatoryRuntimeTool, isMany, isMissingSessionCwdError, isObject, isPathInside, isReadResourceSelector, isReadableUrlPath, isRetryableGitProvisionError, isRetryableLlamaServerError, isRetryableManagedToolError, isRetryableSubscriptionError, isRetryableTaskError, isRetryableTaskMessageError, isSensitiveKeyNameForMasking, isSerializedMissingSessionCwdError, isShellTimeoutError, isShellToolError, isSingleGenericAbortTextContent, isStaleExtensionContextError, isStdoutTakenOver, isStop, isSubscriptionChildUnavailableError, isSubscriptionClosedError, isSubscriptionConfigError, isSubscriptionError, isSubscriptionEventError, isSubscriptionHandlerError, isSubscriptionRecordError, isSubscriptionSetupError, isSubscriptionSubscriberUnavailableError, isSubscriptionTimeoutError, isSyntheticPath, isTaskCleanupAdmissionTimeoutError, isTaskCleanupError, isTaskEvictedError, isTaskMessageError, isTaskMessageTimeoutError, isTodoClosed, isToolDeactivationEntryData, isToolDetachmentError, isToolModifier, isTransientExtensionStartupFailure, isTrustDecision, isTrustedMandatoryRuntimeTool, isUnknownModel, isValidThinkingLevel, isWindowsInstallDirectoryLockError, isWriteSelectorError, keepDroppedQueuedMessages, keepsDroppedQueuedMessages, keptTaskHint, keptTaskId, leadingAndTrailingWs, leadingWs, legacyWorkflowFilePaths, legacyWorkflowFilePatterns, legacyWorkflowSection, linkPath, literalPathLike, loadConfig, loadNativeSearchBinding, loadShownDeprecationNotices, loadedConfig, lockShared, longerRunAdvice, longestCommonPrefix, longestCommonSuffix, many, manySymbol, markEventLoopShutdown, markEventLoopStartupComplete, markTrustedMandatoryRuntimeExtension, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, mergeSessionTrustDecisions, minimatch, modelCallUsage, nativeForkReader, nativeModuleProblem, nativeModuleUnavailable, noOpUIContext, none, normalizeDisplayText, normalizeInterruptAbortMessage, normalizeMany, normalizePathLikeInput, normalizeTodoId, noteQueueUpdateDeliveries, noteQueuedMessagesDropped, noteRowSource, noteSavedSeq, noteSnapshotGeneration, noteUserMessageOrigin, notifySessionProviderRequestDispatched, observeArchiveLoad, observeHistoryLoads, observeReferenceCut, observeToolExecutionTiming, omitLegacyThinkingSections, onBlueprintBuildFinished, onBlueprintBuildWaiting, onSessionProviderRequestDispatched, openAdapterSelectionDatabase, operationSignal, originalHistoryNote, outputExtensionLoadErrors, parseJsonRpcMessage, parsePackageCommand, parseSlashCommand, parseTranscriptFrameLayout, pendingProjectResourcesTrusted, placeTranscriptFrame, prepareLockTakeover, prepareSessionClaim, priorityHoldCounts, processTreeEnded, projectTrustHandlerRegistered, projectTrustWarningVisible, projectTrustedBeforeExtensions, providerOfModelReference, quarantineWindowsNativeDependencies, queueUpdateDeliveries, queuedMessagesUnderWay, queuedReceiptsUnderWay, queuedTextsUnderWay, quitAsInteractiveApp, raceWithAbortSignal, rawStdoutWriteFailed, readLedger, readLines, readPiManifestFile, readTaskOutputTail, receiveChatReceipt, recordLockHolder, recordLockHolderAsync, recordStartupThinkingLevel, redactAuthorizationUrlForDisplay, redactCredentials, redactOAuthErrorText, redactOAuthErrorTextCapped, redactUrlForDisplay, redactUrlForTransportDisplay, redactWwwAuthenticateHeader, referenceMetadataRead, refreshConfig, registerArchiveLoad, registerCanonicalEventBus, registerForkScope, registerHeldInput, registerHistorySnapshot, registerStartupRollback, rehydrateBlueprintError, rehydrateEditToolError, rehydrateGitProvisionError, rehydrateLlamaServerError, rehydrateMissingSessionCwdError, rehydrateShellToolError, rehydrateTaskCleanupError, rehydrateTaskEvictedError, rehydrateTaskMessageError, rehydrateWriteSelectorError, releaseDeprecationWarnings, releasePaneReporting, releaseToolAbortGraceTimers, releaseTurnPause, releaseUnownedPaneRegistration, removePrefix, removeSuffix, removedProviderMessage, renderBlueprintContext, renderBorderedBox, renderToolPath, repairCollapsedScheme, replacePrefix, replaceSuffix, replaceTabs, replacementAbortContent, reportContained, reportPaneActivity, repositoryKey, require_applyReviver, require_constants, require_debug, require_errors, require_identifiers, require_identity, require_ignore, require_line_counter, require_parse_options, require_parse_url, require_resolve_end, require_resolve_props, require_sha256, require_stringifyComment, require_stringifyNumber, require_util_contains_newline, resolveDecisionDeadlineMs, resolvePhysicalPath, resolvePhysicalPathAsync, resolveSchemaRef, resourceInternals, restoreStdout, retirePaneReporting, retryStatusUpdate, rollbackStartup, rootKey, rowSource, rowTone, safeTrustChoiceIndex, sanitizeMcpServers, sanitizeOpenAIResponsesPayload, saveChatRecord, savedConversationThinkingLevel, savedReadLines, savedRowKey, savedRowSpan, savedSeqOf, savedTaskRowKey, savedTaskRows, scopedBackgroundTasks, scrubFetchError, scrubPreCompactionAssistantUsage, scrubUnknownErrorData, searchPosition, segment, selectExactReadRanges, selectReadRanges, selectorHintEntries, sentinelsToAppend, serializeBlueprintError, serializeConversationForCompaction, serializeFileToolError, serializeJsonLine, serializeMissingSessionCwdError, serializeRetainedTranscript, serializeSessionMutation, serializeSubscriptionError, sessionIntercomFacade, sessionTasks, sessionWaitsToRetry, setDeprecationWarningSink, setFunctionList, setMarkitDiagnosticSink, settingsFileNoticeKey, settingsInternals, settleTurnPause, sha256Hex, shareBlueprintBuild, sharedClockNow, sharedWakeDispatcher, shortenPath, shouldRenderEngineDiagnosticAsChatError, shouldRunFirstTimeSetup, sleep, sliceHead, sliceTail, snapshotBashSessionEnvironment, sortTodos, spanElapsedMs, spawnContainedProcess, spawnHostProcess, splitLineRangeSelector, splitPathLikeGlob, splitReadLineSelector, splitTodosByAssignment, sqliteSessionResumeArgs, startEventLoopMonitor, startToolTimer, startupCleanupFailureMessage, startupProjectTrust, stop, stopBlueprintBuilds, stopErrorSymbol, stopWaiting, str, stringEntries, stripFenceMarkers, stripUrlUserinfoAndHash, styleFieldTone, summarizeSession, takeOverDeadHolder, takeOverDeadHolderAsync, takeOverStdout, takeQueuedDeliveryChange, takeQueuedMessagesDroppedAt, taskMark, taskOutcomeStatus, taskOutputText, taskResumer, taskSessionKey, taskStoppedForResume, themeSelectorStyle, thisProcess, timestamp, toError, toMany, toolAbortGraceMs, toolTimerText, trackChatRecordSave, trailingWs, transcriptHeaderLines, transcriptLayoutOf, truncateHead, truncateLine, truncateMiddle, truncateTail, truncateToVisualLines, uniquifyToolCallIds, updateLedger, usageCostBreakdown, userMessageOrigin, validQuestionnaire, validateGuidanceFields, validateIntercomSessionOptions, validateTimeoutOverride, validateTodoId, waitForEventLoopMonitorReady, waitForRawStdoutBackpressure, warnDeprecation, watchFirstProjectTrustHandler, watchReferenceCut, whenAborted, windowsTemporaryFiles, withCleanup, withFileMutationQueue, withInstallLock, withLegacyPackageNames, withProgress, withQueuedDeliveryChange, withResolvingFileMutationQueue, withToolAbortGrace, withinDecisionDeadline, workspaceKey, writeOutputFile, writeRawStdout, writeRawStdoutControl, writeRawStdoutOnce, yieldToEventLoop, yieldToEventLoopIfSlow, yieldToTimerTurn, yieldTurn };
|
|
19059
19217
|
|
|
19060
|
-
//# sourceMappingURL=startup-0-0-
|
|
19218
|
+
//# sourceMappingURL=startup-0-0-TYUFUOJZ.js.map
|
|
19219
|
+
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
19220
|
+
// demand that fails in a process an in-place update left running says to restart.
|
|
19221
|
+
function __atomicOnDemandFailed(error, feature) {
|
|
19222
|
+
return (async () => {
|
|
19223
|
+
const root = new URL("../", import.meta.url);
|
|
19224
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
19225
|
+
const key = `${root.href}#0.10.5-alpha.1`;
|
|
19226
|
+
let release = releases.get(key);
|
|
19227
|
+
if (release === undefined) {
|
|
19228
|
+
const current = (async () => {
|
|
19229
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
19230
|
+
try {
|
|
19231
|
+
const held = await import(new URL(path, root).href);
|
|
19232
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
19233
|
+
} catch {
|
|
19234
|
+
// Not a file this process can load: the next.
|
|
19235
|
+
}
|
|
19236
|
+
}
|
|
19237
|
+
return undefined;
|
|
19238
|
+
})().then((found) => {
|
|
19239
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
19240
|
+
return found;
|
|
19241
|
+
});
|
|
19242
|
+
releases.set(key, current);
|
|
19243
|
+
release = current;
|
|
19244
|
+
}
|
|
19245
|
+
const running = await release;
|
|
19246
|
+
let installed;
|
|
19247
|
+
try {
|
|
19248
|
+
const { readFile } = process.getBuiltinModule("node:fs/promises");
|
|
19249
|
+
installed = JSON.parse(await readFile(new URL("../package.json", root), "utf8")).version;
|
|
19250
|
+
} catch {
|
|
19251
|
+
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
19252
|
+
}
|
|
19253
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.5-alpha.1" ? installed : running !== undefined && running.version !== "0.10.5-alpha.1" ? "0.10.5-alpha.1" : undefined;
|
|
19254
|
+
if (updatedTo === undefined) throw error;
|
|
19255
|
+
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
19256
|
+
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|
|
19257
|
+
cause: error,
|
|
19258
|
+
});
|
|
19259
|
+
restart.name = "UpdatedInstallError";
|
|
19260
|
+
restart[Symbol.for("atomic.on-demand-restart.v1")] = { application, updatedTo, feature };
|
|
19261
|
+
throw restart;
|
|
19262
|
+
})();
|
|
19263
|
+
}
|