@bastani/atomic 0.10.4-alpha.2 → 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 +238 -0
- package/dist/_shared/chunk-CDOYTDYM.js +4 -0
- package/dist/_shared/chunk-CDOYTDYM.js.map +1 -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} +528 -321
- 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 +59 -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 +46 -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/CHANGELOG.md +12 -0
- 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 +36 -0
- package/dist/cli/auth-cli.impl.js.map +1 -0
- package/dist/cli/auth-cli.js +30 -1096
- package/dist/cli/auth-cli.js.map +1 -1
- 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 +36 -0
- package/dist/cli/blueprint-command.impl.js.map +1 -0
- package/dist/cli/blueprint-command.js +30 -900
- package/dist/cli/blueprint-command.js.map +1 -1
- 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 +36 -0
- package/dist/cli/intercom-command.impl.js.map +1 -0
- package/dist/cli/intercom-command.js +33 -105
- package/dist/cli/intercom-command.js.map +1 -1
- 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 +36 -0
- package/dist/cli/list-models.impl.js.map +1 -0
- package/dist/cli/list-models.js +33 -57
- package/dist/cli/list-models.js.map +1 -1
- 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 +36 -0
- package/dist/cli/session-picker.impl.js.map +1 -0
- package/dist/cli/session-picker.js +33 -52
- package/dist/cli/session-picker.js.map +1 -1
- 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 +36 -0
- package/dist/cli/startup-ui.impl.js.map +1 -0
- package/dist/cli/startup-ui.js +35 -4
- 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 +36 -0
- package/dist/cli/storage-command.impl.js.map +1 -0
- package/dist/cli/storage-command.js +35 -2
- 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 +36 -0
- package/dist/cli/storage-search-session.impl.js.map +1 -0
- package/dist/cli/storage-search-session.js +33 -186
- package/dist/cli/storage-search-session.js.map +1 -1
- 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 +36 -0
- package/dist/cli/team-command.impl.js.map +1 -0
- package/dist/cli/team-command.js +32 -213
- package/dist/cli/team-command.js.map +1 -1
- 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 +36 -0
- package/dist/core/debug.impl.js.map +1 -0
- package/dist/core/debug.js +35 -2
- 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 +36 -0
- package/dist/core/export-html/card-projection.impl.js.map +1 -0
- package/dist/core/export-html/card-projection.js +34 -255
- package/dist/core/export-html/card-projection.js.map +1 -1
- 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 +36 -0
- package/dist/core/export-html/index.impl.js.map +1 -0
- package/dist/core/export-html/index.js +30 -604
- package/dist/core/export-html/index.js.map +1 -1
- 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 +36 -0
- package/dist/core/export-html/json-spans.impl.js.map +1 -0
- package/dist/core/export-html/json-spans.js +35 -2
- 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 +36 -0
- package/dist/core/export-html/oversized-render-inputs.impl.js.map +1 -0
- package/dist/core/export-html/oversized-render-inputs.js +31 -120
- package/dist/core/export-html/oversized-render-inputs.js.map +1 -1
- 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 +36 -0
- package/dist/core/export-html/tool-renderer.impl.js.map +1 -0
- package/dist/core/export-html/tool-renderer.js +33 -347
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- 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 +36 -0
- package/dist/core/extensions/jiti-loader.impl.js.map +1 -0
- package/dist/core/extensions/jiti-loader.js +35 -2
- 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 +36 -0
- package/dist/core/extensions/jiti-static-loader.impl.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +35 -2
- 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 +36 -0
- package/dist/core/extensions/loader-host-modules.impl.js.map +1 -0
- package/dist/core/extensions/loader-host-modules.js +35 -2
- 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 +36 -0
- package/dist/core/intercom-broker-control-host.impl.js.map +1 -0
- package/dist/core/intercom-broker-control-host.js +35 -4
- 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 +36 -0
- package/dist/core/intercom-broker-control.impl.js.map +1 -0
- package/dist/core/intercom-broker-control.js +35 -17
- package/dist/core/intercom-broker-control.js.map +1 -1
- 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 +36 -0
- package/dist/core/package-manager-storage-adapters.impl.js.map +1 -0
- package/dist/core/package-manager-storage-adapters.js +35 -2
- 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 +36 -0
- package/dist/core/sdk.impl.js.map +1 -0
- package/dist/core/sdk.js +35 -8
- 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 +36 -0
- package/dist/core/session-manager-list.impl.js.map +1 -0
- package/dist/core/session-manager-list.js +35 -2
- 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 +36 -0
- package/dist/core/session-manager.impl.js.map +1 -0
- package/dist/core/session-manager.js +35 -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 +36 -0
- package/dist/core/session-storage.impl.js.map +1 -0
- package/dist/core/session-storage.js +35 -2
- 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 +36 -0
- package/dist/core/storage/offline-snapshot-file.impl.js.map +1 -0
- package/dist/core/storage/offline-snapshot-file.js +33 -34
- package/dist/core/storage/offline-snapshot-file.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/branch-fork-source.impl.js.map +1 -0
- package/dist/core/storage/session/branch-fork-source.js +32 -97
- package/dist/core/storage/session/branch-fork-source.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/card-view.impl.js.map +1 -0
- package/dist/core/storage/session/card-view.js +34 -58
- package/dist/core/storage/session/card-view.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/child-reader.impl.js.map +1 -0
- package/dist/core/storage/session/child-reader.js +33 -91
- package/dist/core/storage/session/child-reader.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/chunked-resume-projection.impl.js.map +1 -0
- package/dist/core/storage/session/chunked-resume-projection.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/expanded-child-details.impl.js.map +1 -0
- package/dist/core/storage/session/expanded-child-details.js +31 -634
- package/dist/core/storage/session/expanded-child-details.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/fork-row-bytes.impl.js.map +1 -0
- package/dist/core/storage/session/fork-row-bytes.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/fork-row-index.impl.js.map +1 -0
- package/dist/core/storage/session/fork-row-index.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/fork-staging.impl.js.map +1 -0
- package/dist/core/storage/session/fork-staging.js +30 -574
- package/dist/core/storage/session/fork-staging.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/fork-window.impl.js.map +1 -0
- package/dist/core/storage/session/fork-window.js +30 -471
- package/dist/core/storage/session/fork-window.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/history-pages.impl.js.map +1 -0
- package/dist/core/storage/session/history-pages.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/jsonl-entry-projection.impl.js.map +1 -0
- package/dist/core/storage/session/jsonl-entry-projection.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/jsonl-session-store.impl.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/memory-session-store.impl.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/pinned-branch-resume.impl.js.map +1 -0
- package/dist/core/storage/session/pinned-branch-resume.js +33 -69
- package/dist/core/storage/session/pinned-branch-resume.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/released-history-files.impl.js.map +1 -0
- package/dist/core/storage/session/released-history-files.js +32 -461
- package/dist/core/storage/session/released-history-files.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/resident-fork-rows.impl.js.map +1 -0
- package/dist/core/storage/session/resident-fork-rows.js +32 -53
- package/dist/core/storage/session/resident-fork-rows.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/session-resume.impl.js.map +1 -0
- package/dist/core/storage/session/session-resume.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/snapshot-cut.impl.js.map +1 -0
- package/dist/core/storage/session/snapshot-cut.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/snapshot-history.impl.js.map +1 -0
- package/dist/core/storage/session/snapshot-history.js +34 -60
- package/dist/core/storage/session/snapshot-history.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/sql-session-store.impl.js.map +1 -0
- package/dist/core/storage/session/sql-session-store.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/tree-outline.impl.js.map +1 -0
- package/dist/core/storage/session/tree-outline.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/tree-presentation.impl.js.map +1 -0
- package/dist/core/storage/session/tree-presentation.js +31 -337
- package/dist/core/storage/session/tree-presentation.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/storage-status.impl.js.map +1 -0
- package/dist/core/storage/storage-status.js +35 -2
- 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 +36 -0
- package/dist/core/storage/team.impl.js.map +1 -0
- package/dist/core/storage/team.js +35 -2
- 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 +36 -0
- package/dist/core/structured-output/index.impl.js.map +1 -0
- package/dist/core/structured-output/index.js +35 -2
- 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 +36 -0
- package/dist/core/tasks/task-completion-entry.impl.js.map +1 -0
- package/dist/core/tasks/task-completion-entry.js +33 -251
- package/dist/core/tasks/task-completion-entry.js.map +1 -1
- 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 +36 -0
- package/dist/core/tasks/task-file-history.impl.js.map +1 -0
- package/dist/core/tasks/task-file-history.js +32 -375
- package/dist/core/tasks/task-file-history.js.map +1 -1
- package/dist/core/tasks/task-reference-archive.code.js +514 -0
- package/dist/core/tasks/task-reference-archive.code.js.map +1 -0
- package/dist/core/tasks/task-reference-archive.js +34 -467
- package/dist/core/tasks/task-reference-archive.js.map +1 -1
- package/dist/core/tasks/task-reference-identity.code.js +164 -0
- package/dist/core/tasks/task-reference-identity.code.js.map +1 -0
- package/dist/core/tasks/task-reference-identity.js +32 -160
- package/dist/core/tasks/task-reference-identity.js.map +1 -1
- 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 +36 -0
- package/dist/core/tasks/task-reference-stream.impl.js.map +1 -0
- package/dist/core/tasks/task-reference-stream.js +35 -2
- 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 +36 -0
- package/dist/core/tasks/task-unsaved-answer.impl.js.map +1 -0
- package/dist/core/tasks/task-unsaved-answer.js +35 -2
- 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 +36 -0
- package/dist/core/tasks/task-view-source.impl.js.map +1 -0
- package/dist/core/tasks/task-view-source.js +35 -2
- 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 +36 -0
- package/dist/core/tools/read-url.impl.js.map +1 -0
- package/dist/core/tools/read-url.js +30 -1524
- package/dist/core/tools/read-url.js.map +1 -1
- 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 +36 -0
- package/dist/core/worktree-snapshot/errors.impl.js.map +1 -0
- package/dist/core/worktree-snapshot/errors.js +35 -5
- 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 +36 -0
- package/dist/core/worktree-snapshot/session-index-reset.impl.js.map +1 -0
- package/dist/core/worktree-snapshot/session-index-reset.js +34 -134
- package/dist/core/worktree-snapshot/session-index-reset.js.map +1 -1
- 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 +36 -0
- package/dist/extensions/codemode/execute.impl.js.map +1 -0
- package/dist/extensions/codemode/execute.js +30 -612
- package/dist/extensions/codemode/execute.js.map +1 -1
- 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 +36 -0
- package/dist/extensions/codemode/renderer.impl.js.map +1 -0
- package/dist/extensions/codemode/renderer.js +33 -107
- package/dist/extensions/codemode/renderer.js.map +1 -1
- 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 +36 -0
- package/dist/extensions/mcp/cli.impl.js.map +1 -0
- package/dist/extensions/mcp/cli.js +32 -561
- package/dist/extensions/mcp/cli.js.map +1 -1
- 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 -0
- package/dist/extensions/mcp/cli.lazy.impl.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +36 -7
- package/dist/extensions/mcp/cli.lazy.js.map +1 -1
- 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 +36 -0
- package/dist/extensions/mcp/runtime.impl.js.map +1 -0
- package/dist/extensions/mcp/runtime.js +35 -4
- 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 +36 -0
- package/dist/main-first-time-setup.impl.js.map +1 -0
- package/dist/main-first-time-setup.js +35 -11
- package/dist/main-first-time-setup.js.map +1 -1
- 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 +36 -0
- package/dist/modes/interactive/components/stored-tree-view.impl.js.map +1 -0
- package/dist/modes/interactive/components/stored-tree-view.js +33 -290
- package/dist/modes/interactive/components/stored-tree-view.js.map +1 -1
- 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 +36 -0
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.js +34 -189
- package/dist/modes/interactive/components/user-message-selector-archive.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode-deps.js +4 -0
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -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 -0
- package/dist/package-manager-cli.impl.js.map +1 -0
- package/dist/package-manager-cli.js +36 -1067
- package/dist/package-manager-cli.js.map +1 -1
- 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 +36 -0
- package/dist/utils/startup-database-spare.impl.js.map +1 -0
- package/dist/utils/startup-database-spare.js +33 -105
- package/dist/utils/startup-database-spare.js.map +1 -1
- 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 +36 -0
- package/dist/utils/tools-manager.impl.js.map +1 -0
- package/dist/utils/tools-manager.js +35 -2
- 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 +2 -2
- 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) {
|
|
@@ -6534,13 +6592,17 @@ function parseSlashCommand(text) {
|
|
|
6534
6592
|
args: text.slice(separator.index + separator[0].length)
|
|
6535
6593
|
};
|
|
6536
6594
|
}
|
|
6537
|
-
/**
|
|
6595
|
+
/**
|
|
6596
|
+
* The terminal and command registry use the same ordered names; descriptions belong to the application. A name without
|
|
6597
|
+
* a description here gets none, and never fails this module: a process updated in place can load this module against
|
|
6598
|
+
* the earlier release's list of names it already holds (`test/unit/slash-commands.test.ts` checks that every name of
|
|
6599
|
+
* this release has one).
|
|
6600
|
+
*/
|
|
6538
6601
|
function commandList(names, commands) {
|
|
6539
6602
|
const byName = new Map(commands.map((command) => [command.name, command]));
|
|
6540
|
-
return names.map((name) => {
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
return command;
|
|
6603
|
+
return names.map((name) => byName.get(name) ?? {
|
|
6604
|
+
name,
|
|
6605
|
+
description: ""
|
|
6544
6606
|
});
|
|
6545
6607
|
}
|
|
6546
6608
|
const BUILTIN_SLASH_COMMANDS = commandList(CORE_COMMAND_NAMES, [
|
|
@@ -7093,13 +7155,13 @@ function noteSnapshotGeneration(store, snapshot, load, row, key) {
|
|
|
7093
7155
|
}
|
|
7094
7156
|
// dist/core/tasks/transcript-origin.js
|
|
7095
7157
|
/** Provenance belongs to this page, not to an arbitrary SDK message reused in a different task. */
|
|
7096
|
-
const origins = /* @__PURE__ */ new WeakMap();
|
|
7158
|
+
const origins$1 = /* @__PURE__ */ new WeakMap();
|
|
7097
7159
|
const rendered = /* @__PURE__ */ new WeakMap();
|
|
7098
7160
|
function bindSavedTaskOrigins(messages, keys) {
|
|
7099
|
-
origins.set(messages, keys);
|
|
7161
|
+
origins$1.set(messages, keys);
|
|
7100
7162
|
}
|
|
7101
7163
|
function savedTaskRows(messages) {
|
|
7102
|
-
const keys = origins.get(messages);
|
|
7164
|
+
const keys = origins$1.get(messages);
|
|
7103
7165
|
if (!keys) return void 0;
|
|
7104
7166
|
return (entry, message, part) => {
|
|
7105
7167
|
const key = keys.get(message);
|
|
@@ -7960,7 +8022,9 @@ function defineTool(tool) {
|
|
|
7960
8022
|
return tool;
|
|
7961
8023
|
}
|
|
7962
8024
|
// dist/extensions/mcp/client/oauth/redact.js
|
|
7963
|
-
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 });
|
|
7964
8028
|
/** Minimum length for unlabelled literal secret scrubbing so 1-3 character strings (e.g. HTTP status codes) are never over-redacted. */
|
|
7965
8029
|
const MIN_LITERAL_SECRET_LENGTH = 4;
|
|
7966
8030
|
function buildAhoCorasick(patterns) {
|
|
@@ -8014,9 +8078,6 @@ function scanMaxMatchLengths(text, automaton) {
|
|
|
8014
8078
|
}
|
|
8015
8079
|
return result;
|
|
8016
8080
|
}
|
|
8017
|
-
function isHexCharCode(code) {
|
|
8018
|
-
return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102;
|
|
8019
|
-
}
|
|
8020
8081
|
function upperHexChar(code) {
|
|
8021
8082
|
return String.fromCharCode(code >= 97 && code <= 102 ? code - 32 : code);
|
|
8022
8083
|
}
|
|
@@ -8029,7 +8090,7 @@ function normalizePercentHex(text) {
|
|
|
8029
8090
|
let out = "";
|
|
8030
8091
|
let copied = 0;
|
|
8031
8092
|
let i = 0;
|
|
8032
|
-
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))) {
|
|
8033
8094
|
const c1 = text.charCodeAt(i + 1);
|
|
8034
8095
|
const c2 = text.charCodeAt(i + 2);
|
|
8035
8096
|
if (c1 >= 97 && c1 <= 102 || c2 >= 97 && c2 <= 102) {
|
|
@@ -8249,7 +8310,7 @@ function maskSegmentWithCapInfo(segment, rawAc, pctAc, cap) {
|
|
|
8249
8310
|
outLen += chunk.length;
|
|
8250
8311
|
}
|
|
8251
8312
|
parts.push(REDACTED);
|
|
8252
|
-
outLen +=
|
|
8313
|
+
outLen += REDACTED.length;
|
|
8253
8314
|
if (prefixEnd === -1 && interval.end >= limit) prefixEnd = outLen;
|
|
8254
8315
|
cursor = interval.end;
|
|
8255
8316
|
}
|
|
@@ -8342,8 +8403,8 @@ var SecretMaskRegistry = class {
|
|
|
8342
8403
|
if (i + 1 < segments.length) {
|
|
8343
8404
|
if (prefixEnd === -1 && origOffset >= limit) prefixEnd = outLen;
|
|
8344
8405
|
parts.push(REDACTED);
|
|
8345
|
-
outLen +=
|
|
8346
|
-
origOffset +=
|
|
8406
|
+
outLen += REDACTED.length;
|
|
8407
|
+
origOffset += REDACTED.length;
|
|
8347
8408
|
if (prefixEnd === -1 && origOffset >= limit) prefixEnd = outLen;
|
|
8348
8409
|
}
|
|
8349
8410
|
}
|
|
@@ -8381,12 +8442,9 @@ function extractAuthorizationSecrets(headerValue) {
|
|
|
8381
8442
|
if (!trimmed) return [];
|
|
8382
8443
|
const results = [trimmed];
|
|
8383
8444
|
let sep = -1;
|
|
8384
|
-
for (let i = 0; i < trimmed.length; i++) {
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
sep = i;
|
|
8388
|
-
break;
|
|
8389
|
-
}
|
|
8445
|
+
for (let i = 0; i < trimmed.length; i++) if (isHorizontalWsCode(trimmed.charCodeAt(i))) {
|
|
8446
|
+
sep = i;
|
|
8447
|
+
break;
|
|
8390
8448
|
}
|
|
8391
8449
|
if (sep > 0) {
|
|
8392
8450
|
const scheme = trimmed.slice(0, sep).toLowerCase();
|
|
@@ -8619,11 +8677,11 @@ function isEnvTemplatePlaceholder(value) {
|
|
|
8619
8677
|
const trimmed = value.trim();
|
|
8620
8678
|
if (trimmed.length < 2) return false;
|
|
8621
8679
|
if (trimmed.startsWith("${") && trimmed.endsWith("}")) return true;
|
|
8622
|
-
if (
|
|
8680
|
+
if (matchesAsciiCaseInsensitiveAt(trimmed, "$env:", 0)) return true;
|
|
8623
8681
|
if (trimmed.charCodeAt(0) === 36) {
|
|
8624
8682
|
const first = trimmed.charCodeAt(1);
|
|
8625
|
-
if (!(first
|
|
8626
|
-
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;
|
|
8627
8685
|
return true;
|
|
8628
8686
|
}
|
|
8629
8687
|
return false;
|
|
@@ -8742,8 +8800,8 @@ function isBenignKebabOrSnakeSlug(value) {
|
|
|
8742
8800
|
function isSecretValueForMasking(value) {
|
|
8743
8801
|
const trimmed = value.trim();
|
|
8744
8802
|
if (trimmed.length < 8) return false;
|
|
8745
|
-
if (
|
|
8746
|
-
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;
|
|
8747
8805
|
if (trimmed.includes(" ") || trimmed.includes("\n")) return false;
|
|
8748
8806
|
if (isHexToken(trimmed)) return true;
|
|
8749
8807
|
let hasUpper = false;
|
|
@@ -8791,8 +8849,8 @@ function collectSecretsForMasking(input) {
|
|
|
8791
8849
|
function isLikelySecretForDisplay(value) {
|
|
8792
8850
|
const trimmed = value.trim();
|
|
8793
8851
|
if (trimmed.length < 8) return false;
|
|
8794
|
-
if (
|
|
8795
|
-
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;
|
|
8796
8854
|
if (isEnvTemplatePlaceholder(trimmed)) return false;
|
|
8797
8855
|
if (trimmed.includes(" ") || trimmed.includes("\n")) return false;
|
|
8798
8856
|
if (isDateOrTimestamp(trimmed) || isVersionString(trimmed) || isSimplePath(trimmed) || isBenignKebabOrSnakeSlug(trimmed)) return false;
|
|
@@ -8957,63 +9015,14 @@ function redactAuthorizationUrlForDisplay(input, secrets = []) {
|
|
|
8957
9015
|
}
|
|
8958
9016
|
return changed ? url.href : raw;
|
|
8959
9017
|
}
|
|
8960
|
-
function isAsciiAlphaNumOrUnderscore(code) {
|
|
8961
|
-
return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95;
|
|
8962
|
-
}
|
|
8963
9018
|
function isTokenStopChar(code) {
|
|
8964
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;
|
|
8965
9020
|
}
|
|
8966
|
-
function isBase64CredentialChar(code) {
|
|
8967
|
-
return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 43 || code === 47 || code === 61 || code === 95 || code === 45;
|
|
8968
|
-
}
|
|
8969
|
-
function isValidStandardBase64(value) {
|
|
8970
|
-
if (value.length < 4 || value.length % 4 !== 0) return false;
|
|
8971
|
-
let pad = 0;
|
|
8972
|
-
for (let i = value.length - 1; i >= 0 && value.charCodeAt(i) === 61; i--) pad++;
|
|
8973
|
-
if (pad > 2) return false;
|
|
8974
|
-
const end = value.length - pad;
|
|
8975
|
-
for (let i = 0; i < end; i++) {
|
|
8976
|
-
const c = value.charCodeAt(i);
|
|
8977
|
-
if (!(c >= 65 && c <= 90 || c >= 97 && c <= 122 || c >= 48 && c <= 57 || c === 43 || c === 47)) return false;
|
|
8978
|
-
}
|
|
8979
|
-
return true;
|
|
8980
|
-
}
|
|
8981
|
-
function looksLikeBase64Credential(value) {
|
|
8982
|
-
if (value.length < 4) return false;
|
|
8983
|
-
let hasUpper = false;
|
|
8984
|
-
let hasLower = false;
|
|
8985
|
-
let hasDigit = false;
|
|
8986
|
-
let hasSymbol = false;
|
|
8987
|
-
for (let i = 0; i < value.length; i++) {
|
|
8988
|
-
const c = value.charCodeAt(i);
|
|
8989
|
-
if (c >= 65 && c <= 90) hasUpper = true;
|
|
8990
|
-
else if (c >= 97 && c <= 122) hasLower = true;
|
|
8991
|
-
else if (c >= 48 && c <= 57) hasDigit = true;
|
|
8992
|
-
else hasSymbol = true;
|
|
8993
|
-
}
|
|
8994
|
-
if (hasSymbol) return true;
|
|
8995
|
-
if (value.length >= 8 && (hasUpper && hasLower || hasDigit)) return true;
|
|
8996
|
-
return false;
|
|
8997
|
-
}
|
|
8998
|
-
/**
|
|
8999
|
-
* Unbounded one-sided check for RFC 7617 `Basic <base64(id:secret)>`:
|
|
9000
|
-
* every valid RFC 7617 `Basic` credential has length >= 4, multiple of 4, valid Base64, and decodes to bytes
|
|
9001
|
-
* containing `:` (0x3a). Falls back to `looksLikeBase64Credential` for non-colon opaque tokens.
|
|
9002
|
-
* Leaves ordinary prose ("Basic auth", "Basic mode", "Basic text") untouched.
|
|
9003
|
-
*/
|
|
9004
|
-
function isBasicAuthPayload(value) {
|
|
9005
|
-
if (value.length < 4) return false;
|
|
9006
|
-
if (isValidStandardBase64(value) && Buffer.from(value, "base64").includes(58)) return true;
|
|
9007
|
-
return looksLikeBase64Credential(value);
|
|
9008
|
-
}
|
|
9009
9021
|
function isSignedInteger(value) {
|
|
9010
9022
|
if (value.length === 0) return false;
|
|
9011
9023
|
let i = value.charCodeAt(0) === 45 ? 1 : 0;
|
|
9012
9024
|
if (i === value.length) return false;
|
|
9013
|
-
for (; i < value.length; i++)
|
|
9014
|
-
const c = value.charCodeAt(i);
|
|
9015
|
-
if (c < 48 || c > 57) return false;
|
|
9016
|
-
}
|
|
9025
|
+
for (; i < value.length; i++) if (!isAsciiDigitCode(value.charCodeAt(i))) return false;
|
|
9017
9026
|
return true;
|
|
9018
9027
|
}
|
|
9019
9028
|
function isPosixOrSystemErrorCode(value) {
|
|
@@ -9087,30 +9096,17 @@ const BEARER_PROSE_WORDS = /* @__PURE__ */ new Set([
|
|
|
9087
9096
|
"grant",
|
|
9088
9097
|
"flow"
|
|
9089
9098
|
]);
|
|
9090
|
-
function matchesAsciiInsensitive(text, offset, lowerKeyword) {
|
|
9091
|
-
if (offset < 0 || offset + lowerKeyword.length > text.length) return false;
|
|
9092
|
-
for (let i = 0; i < lowerKeyword.length; i++) {
|
|
9093
|
-
let c = text.charCodeAt(offset + i);
|
|
9094
|
-
if (c >= 65 && c <= 90) c += 32;
|
|
9095
|
-
if (c !== lowerKeyword.charCodeAt(i)) return false;
|
|
9096
|
-
}
|
|
9097
|
-
return true;
|
|
9098
|
-
}
|
|
9099
|
-
function skipHorizontalWs(text, pos) {
|
|
9100
|
-
while (pos < text.length && (text.charCodeAt(pos) === 32 || text.charCodeAt(pos) === 9)) pos++;
|
|
9101
|
-
return pos;
|
|
9102
|
-
}
|
|
9103
9099
|
function isAuthorizationPrefixContext(text, kwStart) {
|
|
9104
9100
|
let pos = kwStart;
|
|
9105
|
-
while (pos > 0 && (text.charCodeAt(pos - 1)
|
|
9101
|
+
while (pos > 0 && isHorizontalWsCode(text.charCodeAt(pos - 1))) pos--;
|
|
9106
9102
|
if (pos === 0) return false;
|
|
9107
9103
|
const sep = text.charCodeAt(pos - 1);
|
|
9108
9104
|
if (sep !== 58 && sep !== 61) return false;
|
|
9109
9105
|
pos--;
|
|
9110
|
-
while (pos > 0 && (text.charCodeAt(pos - 1)
|
|
9106
|
+
while (pos > 0 && isHorizontalWsCode(text.charCodeAt(pos - 1))) pos--;
|
|
9111
9107
|
if (pos > 0 && (text.charCodeAt(pos - 1) === 34 || text.charCodeAt(pos - 1) === 39)) pos--;
|
|
9112
|
-
if (pos >= 13 &&
|
|
9113
|
-
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;
|
|
9114
9110
|
return false;
|
|
9115
9111
|
}
|
|
9116
9112
|
function scanQuotedOrTokenValueEnd(text, start) {
|
|
@@ -9214,117 +9210,48 @@ function isWwwAuthenticateChallengeParam(text, start) {
|
|
|
9214
9210
|
return KNOWN_CHALLENGE_PARAMS.has(text.slice(start, eq).toLowerCase());
|
|
9215
9211
|
}
|
|
9216
9212
|
/**
|
|
9217
|
-
* Strip ANSI CSI/OSC sequences into `plain`, recording for each index of `plain` its index in `text`
|
|
9218
|
-
* (plus `text.length` sentinel at the end). Chunked linear single pass, zero regular expressions.
|
|
9219
|
-
*/
|
|
9220
|
-
function stripAnsiWithOrigin(text) {
|
|
9221
|
-
if (!text.includes("\x1B")) return {
|
|
9222
|
-
plain: text,
|
|
9223
|
-
origin: void 0
|
|
9224
|
-
};
|
|
9225
|
-
const chunks = [];
|
|
9226
|
-
const origin = new Int32Array(text.length + 1);
|
|
9227
|
-
let plainLen = 0;
|
|
9228
|
-
let copied = 0;
|
|
9229
|
-
let i = 0;
|
|
9230
|
-
const flush = (end) => {
|
|
9231
|
-
if (end <= copied) return;
|
|
9232
|
-
chunks.push(text.slice(copied, end));
|
|
9233
|
-
for (let k = copied; k < end; k++) origin[plainLen++] = k;
|
|
9234
|
-
copied = end;
|
|
9235
|
-
};
|
|
9236
|
-
while (i < text.length) {
|
|
9237
|
-
const esc = text.indexOf("\x1B", i);
|
|
9238
|
-
if (esc === -1) {
|
|
9239
|
-
flush(text.length);
|
|
9240
|
-
break;
|
|
9241
|
-
}
|
|
9242
|
-
if (esc + 1 < text.length) {
|
|
9243
|
-
const next = text.charCodeAt(esc + 1);
|
|
9244
|
-
if (next === 91) {
|
|
9245
|
-
let j = esc + 2;
|
|
9246
|
-
while (j < text.length && text.charCodeAt(j) >= 48 && text.charCodeAt(j) <= 63) j++;
|
|
9247
|
-
while (j < text.length && text.charCodeAt(j) >= 32 && text.charCodeAt(j) <= 47) j++;
|
|
9248
|
-
if (j < text.length && text.charCodeAt(j) >= 64 && text.charCodeAt(j) <= 126) {
|
|
9249
|
-
flush(esc);
|
|
9250
|
-
copied = j + 1;
|
|
9251
|
-
i = j + 1;
|
|
9252
|
-
continue;
|
|
9253
|
-
}
|
|
9254
|
-
} else if (next === 93) {
|
|
9255
|
-
let j = esc + 2;
|
|
9256
|
-
let matched = false;
|
|
9257
|
-
while (j < text.length) {
|
|
9258
|
-
const c = text.charCodeAt(j);
|
|
9259
|
-
if (c === 7) {
|
|
9260
|
-
flush(esc);
|
|
9261
|
-
copied = j + 1;
|
|
9262
|
-
i = j + 1;
|
|
9263
|
-
matched = true;
|
|
9264
|
-
break;
|
|
9265
|
-
}
|
|
9266
|
-
if (c === 27) {
|
|
9267
|
-
if (j + 1 < text.length && text.charCodeAt(j + 1) === 92) {
|
|
9268
|
-
flush(esc);
|
|
9269
|
-
copied = j + 2;
|
|
9270
|
-
i = j + 2;
|
|
9271
|
-
matched = true;
|
|
9272
|
-
}
|
|
9273
|
-
break;
|
|
9274
|
-
}
|
|
9275
|
-
j++;
|
|
9276
|
-
}
|
|
9277
|
-
if (matched) continue;
|
|
9278
|
-
}
|
|
9279
|
-
}
|
|
9280
|
-
i = esc + 1;
|
|
9281
|
-
}
|
|
9282
|
-
if (copied < text.length) flush(text.length);
|
|
9283
|
-
origin[plainLen] = text.length;
|
|
9284
|
-
return {
|
|
9285
|
-
plain: chunks.join(""),
|
|
9286
|
-
origin
|
|
9287
|
-
};
|
|
9288
|
-
}
|
|
9289
|
-
/**
|
|
9290
9213
|
* Single-pass linear-time secondary net for OAuth/HTTP credential shapes:
|
|
9291
9214
|
* - `Bearer <token>` (SP/HTAB, arbitrary opaque token chars incl. `!`, `$`, `%`, `:`; preserves prose & WWW-Authenticate challenges)
|
|
9292
|
-
* - standalone or assigned `Basic <base64>` (SP/HTAB;
|
|
9215
|
+
* - standalone or assigned `Basic <base64>` (SP/HTAB; shared `scanBasicAuthEndAt` with `includeOpaqueTokens: true`)
|
|
9293
9216
|
* - `code_verifier` / `code-verifier` / `codeVerifier` (form, JSON, escaped `\"...\"`, ANSI-styled)
|
|
9294
9217
|
* - `code=<secret>` (excluding integers, POSIX/Node `E...` error codes, and standard OAuth error codes)
|
|
9295
9218
|
* - sensitive URL query parameter values (`?api_key=...`, `&token=...`, etc.)
|
|
9296
|
-
* - long-
|
|
9219
|
+
* - long-input `password=<token>` linear fallback (covers >2KB multi-line bodies and preserves `&` parameter boundaries)
|
|
9297
9220
|
*/
|
|
9298
9221
|
function redactOAuthStructuredCredentials(text) {
|
|
9299
9222
|
if (!text) return text;
|
|
9300
9223
|
const { plain, origin } = stripAnsiWithOrigin(text);
|
|
9301
9224
|
const mapStart = (index) => origin === void 0 ? index : origin[index];
|
|
9302
9225
|
const mapEnd = (index) => origin === void 0 ? index : origin[index - 1] + 1;
|
|
9303
|
-
const
|
|
9304
|
-
let
|
|
9226
|
+
const ranges = [];
|
|
9227
|
+
let lastRangeEnd = 0;
|
|
9305
9228
|
let i = 0;
|
|
9306
9229
|
const longInput = plain.length > 2048;
|
|
9307
|
-
const
|
|
9230
|
+
const addRange = (plainFrom, plainTo) => {
|
|
9308
9231
|
if (plainTo <= plainFrom) return;
|
|
9309
9232
|
const origFrom = mapStart(plainFrom);
|
|
9310
9233
|
const origTo = mapEnd(plainTo);
|
|
9311
|
-
if (origFrom <
|
|
9234
|
+
if (origFrom < lastRangeEnd) return;
|
|
9312
9235
|
if (plain.slice(plainFrom, plainTo) === REDACTED) return;
|
|
9313
|
-
|
|
9314
|
-
|
|
9236
|
+
ranges.push({
|
|
9237
|
+
start: origFrom,
|
|
9238
|
+
end: origTo
|
|
9239
|
+
});
|
|
9240
|
+
lastRangeEnd = origTo;
|
|
9315
9241
|
};
|
|
9316
9242
|
while (i < plain.length) {
|
|
9317
|
-
|
|
9318
|
-
|
|
9243
|
+
const ch = plain.charCodeAt(i);
|
|
9244
|
+
if (ch === 91 && plain.startsWith(REDACTED, i)) {
|
|
9245
|
+
i += REDACTED.length;
|
|
9319
9246
|
continue;
|
|
9320
9247
|
}
|
|
9321
|
-
const prevWord = i > 0 &&
|
|
9322
|
-
if (!prevWord &&
|
|
9248
|
+
const prevWord = i > 0 && isAsciiWordCode(plain.charCodeAt(i - 1));
|
|
9249
|
+
if (!prevWord && (ch === 66 || ch === 98) && matchesAsciiCaseInsensitiveAt(plain, "bearer", i)) {
|
|
9323
9250
|
const afterKw = i + 6;
|
|
9324
9251
|
const valStart = skipHorizontalWs(plain, afterKw);
|
|
9325
9252
|
if (valStart > afterKw && valStart < plain.length && !isWwwAuthenticateChallengeParam(plain, valStart)) {
|
|
9326
9253
|
if (plain.startsWith(REDACTED, valStart)) {
|
|
9327
|
-
i = valStart +
|
|
9254
|
+
i = valStart + REDACTED.length;
|
|
9328
9255
|
continue;
|
|
9329
9256
|
}
|
|
9330
9257
|
let valEnd = valStart;
|
|
@@ -9333,34 +9260,24 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9333
9260
|
const candidate = plain.slice(valStart, valEnd);
|
|
9334
9261
|
const isPlainProse = !isAuthorizationPrefixContext(plain, i) && BEARER_PROSE_WORDS.has(candidate.toLowerCase());
|
|
9335
9262
|
if (valEnd > valStart && !isPlainProse) {
|
|
9336
|
-
|
|
9263
|
+
addRange(i, valEnd);
|
|
9337
9264
|
i = valEnd;
|
|
9338
9265
|
continue;
|
|
9339
9266
|
}
|
|
9340
9267
|
}
|
|
9341
9268
|
}
|
|
9342
|
-
if (!prevWord &&
|
|
9343
|
-
const
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
continue;
|
|
9349
|
-
}
|
|
9350
|
-
let valEnd = valStart;
|
|
9351
|
-
while (valEnd < plain.length && isBase64CredentialChar(plain.charCodeAt(valEnd))) valEnd++;
|
|
9352
|
-
const candidate = plain.slice(valStart, valEnd);
|
|
9353
|
-
if ((valEnd === plain.length || !isAsciiAlphaNumOrUnderscore(plain.charCodeAt(valEnd))) && isBasicAuthPayload(candidate)) {
|
|
9354
|
-
emitReplacement(i, valEnd);
|
|
9355
|
-
i = valEnd;
|
|
9356
|
-
continue;
|
|
9357
|
-
}
|
|
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;
|
|
9358
9275
|
}
|
|
9359
9276
|
}
|
|
9360
|
-
if (!prevWord) {
|
|
9277
|
+
if (!prevWord && (ch === 67 || ch === 99)) {
|
|
9361
9278
|
let kvLen = 0;
|
|
9362
|
-
if (
|
|
9363
|
-
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;
|
|
9364
9281
|
if (kvLen > 0) {
|
|
9365
9282
|
let pos = i + kvLen;
|
|
9366
9283
|
while (pos < plain.length && plain.charCodeAt(pos) === 92) pos++;
|
|
@@ -9371,7 +9288,7 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9371
9288
|
if (pos < plain.length && !plain.startsWith(REDACTED, pos)) {
|
|
9372
9289
|
const valEnd = scanQuotedOrTokenValueEnd(plain, pos);
|
|
9373
9290
|
if (valEnd > pos) {
|
|
9374
|
-
|
|
9291
|
+
addRange(pos, valEnd);
|
|
9375
9292
|
i = valEnd;
|
|
9376
9293
|
continue;
|
|
9377
9294
|
}
|
|
@@ -9379,21 +9296,21 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9379
9296
|
}
|
|
9380
9297
|
}
|
|
9381
9298
|
}
|
|
9382
|
-
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) {
|
|
9383
9300
|
const valStart = i + 5;
|
|
9384
9301
|
if (valStart < plain.length && !plain.startsWith(REDACTED, valStart)) {
|
|
9385
9302
|
const valEnd = scanQuotedOrTokenValueEnd(plain, valStart);
|
|
9386
9303
|
const val = plain.slice(valStart, valEnd);
|
|
9387
9304
|
if (val.length > 0 && !isSignedInteger(val) && !isPosixOrSystemErrorCode(val) && !KNOWN_OAUTH_ERROR_CODES.has(val.toLowerCase())) {
|
|
9388
|
-
|
|
9305
|
+
addRange(valStart, valEnd);
|
|
9389
9306
|
i = valEnd;
|
|
9390
9307
|
continue;
|
|
9391
9308
|
}
|
|
9392
9309
|
}
|
|
9393
9310
|
}
|
|
9394
|
-
if (
|
|
9311
|
+
if (ch === 63 || ch === 38) {
|
|
9395
9312
|
let nameEnd = i + 1;
|
|
9396
|
-
while (nameEnd < plain.length && (
|
|
9313
|
+
while (nameEnd < plain.length && (isAsciiWordCode(plain.charCodeAt(nameEnd)) || plain.charCodeAt(nameEnd) === 45)) nameEnd++;
|
|
9397
9314
|
if (nameEnd > i + 1 && nameEnd < plain.length && plain.charCodeAt(nameEnd) === 61) {
|
|
9398
9315
|
const paramName = plain.slice(i + 1, nameEnd).toLowerCase();
|
|
9399
9316
|
if (SENSITIVE_QUERY_PARAM_NAMES.has(paramName)) {
|
|
@@ -9403,7 +9320,7 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9403
9320
|
while (valEnd < plain.length && !isTokenStopChar(plain.charCodeAt(valEnd)) && plain.charCodeAt(valEnd) !== 38 && plain.charCodeAt(valEnd) !== 35) valEnd++;
|
|
9404
9321
|
const val = plain.slice(valStart, valEnd);
|
|
9405
9322
|
if (val.length > 0 && !(paramName === "code" && (isSignedInteger(val) || isPosixOrSystemErrorCode(val) || KNOWN_OAUTH_ERROR_CODES.has(val.toLowerCase())))) {
|
|
9406
|
-
|
|
9323
|
+
addRange(valStart, valEnd);
|
|
9407
9324
|
i = valEnd;
|
|
9408
9325
|
continue;
|
|
9409
9326
|
}
|
|
@@ -9411,17 +9328,17 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9411
9328
|
}
|
|
9412
9329
|
}
|
|
9413
9330
|
}
|
|
9414
|
-
if (longInput && !prevWord) {
|
|
9331
|
+
if (longInput && !prevWord && (ch === 80 || ch === 112)) {
|
|
9415
9332
|
let pwdLen = 0;
|
|
9416
|
-
if (
|
|
9417
|
-
else if (
|
|
9418
|
-
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;
|
|
9419
9336
|
if (pwdLen > 0 && i + pwdLen < plain.length && plain.charCodeAt(i + pwdLen) === 61) {
|
|
9420
9337
|
const valStart = i + pwdLen + 1;
|
|
9421
9338
|
if (valStart < plain.length && !plain.startsWith(REDACTED, valStart)) {
|
|
9422
9339
|
const valEnd = scanQuotedOrTokenValueEnd(plain, valStart);
|
|
9423
9340
|
if (valEnd > valStart) {
|
|
9424
|
-
|
|
9341
|
+
addRange(valStart, valEnd);
|
|
9425
9342
|
i = valEnd;
|
|
9426
9343
|
continue;
|
|
9427
9344
|
}
|
|
@@ -9430,9 +9347,7 @@ function redactOAuthStructuredCredentials(text) {
|
|
|
9430
9347
|
}
|
|
9431
9348
|
i++;
|
|
9432
9349
|
}
|
|
9433
|
-
|
|
9434
|
-
parts.push(text.slice(copied));
|
|
9435
|
-
return parts.join("");
|
|
9350
|
+
return applyRedactionRanges(text, ranges, MCP_APPLY_RANGE_OPTIONS);
|
|
9436
9351
|
}
|
|
9437
9352
|
function chooseFreshPlaceholderPrefix(text) {
|
|
9438
9353
|
for (;;) {
|
|
@@ -9451,7 +9366,7 @@ function redactRemainingCredentialShapes(text) {
|
|
|
9451
9366
|
const protectedSpans = [];
|
|
9452
9367
|
let i = 0;
|
|
9453
9368
|
while (i < text.length) {
|
|
9454
|
-
if (!(i > 0 &&
|
|
9369
|
+
if (!(i > 0 && isAsciiWordCode(text.charCodeAt(i - 1))) && matchesAsciiCaseInsensitiveAt(text, "bearer", i)) {
|
|
9455
9370
|
const afterKw = i + 6;
|
|
9456
9371
|
const valStart = skipHorizontalWs(text, afterKw);
|
|
9457
9372
|
if (valStart > afterKw && valStart < text.length) {
|
|
@@ -9537,8 +9452,8 @@ function clipRedactedPrefix(redactedHead, redactedFull) {
|
|
|
9537
9452
|
let lcp = 0;
|
|
9538
9453
|
const minLen = Math.min(redactedHead.length, redactedFull.length);
|
|
9539
9454
|
while (lcp < minLen && redactedHead.charCodeAt(lcp) === redactedFull.charCodeAt(lcp)) lcp++;
|
|
9540
|
-
const searchStart = Math.max(0, lcp -
|
|
9541
|
-
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);
|
|
9542
9457
|
return redactedHead.slice(0, lcp);
|
|
9543
9458
|
}
|
|
9544
9459
|
/**
|
|
@@ -13864,16 +13779,11 @@ function withMupdfDiagnostics(message) {
|
|
|
13864
13779
|
mupdfDiagnostics = [];
|
|
13865
13780
|
return `${message} (mupdf: ${detail})`;
|
|
13866
13781
|
}
|
|
13867
|
-
|
|
13782
|
+
const getMarkit = memoizeAsync(async () => {
|
|
13868
13783
|
captureMupdfDiagnostics();
|
|
13869
|
-
const
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
return instance;
|
|
13873
|
-
});
|
|
13874
|
-
markit = () => promise;
|
|
13875
|
-
return promise;
|
|
13876
|
-
};
|
|
13784
|
+
const { Markit } = await loadOnDemand("document conversion", () => import("./dist-KOELCESV.js").catch((error) => __atomicOnDemandFailed(error, "this feature")));
|
|
13785
|
+
return new Markit();
|
|
13786
|
+
});
|
|
13877
13787
|
function normalizeExtension(extension) {
|
|
13878
13788
|
const trimmed = extension.trim().toLowerCase();
|
|
13879
13789
|
return trimmed ? trimmed.startsWith(".") ? trimmed : `.${trimmed}` : ".bin";
|
|
@@ -13888,7 +13798,7 @@ function abortError() {
|
|
|
13888
13798
|
}
|
|
13889
13799
|
async function runMarkitConversion(task, signal) {
|
|
13890
13800
|
if (signal?.aborted) throw abortError();
|
|
13891
|
-
const instance = await
|
|
13801
|
+
const instance = await getMarkit();
|
|
13892
13802
|
mupdfDiagnostics = [];
|
|
13893
13803
|
if (!signal) return task(instance);
|
|
13894
13804
|
return await new Promise((resolve, reject) => {
|
|
@@ -14082,6 +13992,129 @@ function getLockPath(todosDir, id) {
|
|
|
14082
13992
|
const DEFAULT_TOOL_ABORT_GRACE_MS = 1e4;
|
|
14083
13993
|
/** The longest delay a timer takes; a larger value would fire at once. */
|
|
14084
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
|
+
}
|
|
14085
14118
|
/** `ATOMIC_TOOL_ABORT_GRACE_MS` when it is a whole number of milliseconds, otherwise the default. */
|
|
14086
14119
|
function toolAbortGraceMs(env = process.env) {
|
|
14087
14120
|
const value = env.ATOMIC_TOOL_ABORT_GRACE_MS?.trim();
|
|
@@ -14106,7 +14139,7 @@ function abandonedToolResult(toolName, graceMs) {
|
|
|
14106
14139
|
* `tool`, whose calls answer at most a grace period after their turn is interrupted (#5486). A call still running then
|
|
14107
14140
|
* gets {@link abandonedToolResult}, so the turn can end. A call that stops within the grace keeps its own result.
|
|
14108
14141
|
*/
|
|
14109
|
-
function withToolAbortGrace(tool) {
|
|
14142
|
+
function withToolAbortGrace(tool, owner) {
|
|
14110
14143
|
return {
|
|
14111
14144
|
...tool,
|
|
14112
14145
|
execute: (toolCallId, params, signal, onUpdate, ...rest) => {
|
|
@@ -14117,15 +14150,16 @@ function withToolAbortGrace(tool) {
|
|
|
14117
14150
|
return Promise.reject(error);
|
|
14118
14151
|
}
|
|
14119
14152
|
if (signal === void 0) return running;
|
|
14120
|
-
|
|
14153
|
+
const timerOwner = owner ?? signal;
|
|
14154
|
+
const guarded = new Promise((resolve, reject) => {
|
|
14121
14155
|
let timer;
|
|
14122
14156
|
const startGrace = () => {
|
|
14123
14157
|
const graceMs = toolAbortGraceMs();
|
|
14124
|
-
timer =
|
|
14125
|
-
timer.unref?.();
|
|
14158
|
+
timer = armToolAbortGraceTimer(timerOwner, graceMs, () => resolve(abandonedToolResult(tool.name, graceMs)));
|
|
14126
14159
|
};
|
|
14127
14160
|
const settle = () => {
|
|
14128
|
-
|
|
14161
|
+
clearToolAbortGraceTimer(timerOwner, timer);
|
|
14162
|
+
timer = void 0;
|
|
14129
14163
|
signal.removeEventListener("abort", startGrace);
|
|
14130
14164
|
};
|
|
14131
14165
|
if (signal.aborted) startGrace();
|
|
@@ -14138,6 +14172,7 @@ function withToolAbortGrace(tool) {
|
|
|
14138
14172
|
reject(error);
|
|
14139
14173
|
});
|
|
14140
14174
|
});
|
|
14175
|
+
return owner === void 0 ? holdToolAbortGraceWhenObserved(signal, guarded) : guarded;
|
|
14141
14176
|
}
|
|
14142
14177
|
};
|
|
14143
14178
|
}
|
|
@@ -14211,6 +14246,26 @@ function releaseTurnPause(session) {
|
|
|
14211
14246
|
session._turnPauseRelease = tracked;
|
|
14212
14247
|
return tracked;
|
|
14213
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
|
+
}
|
|
14214
14269
|
// dist/core/chat-receipts.js
|
|
14215
14270
|
const key = Symbol.for("atomic.chat-display-receipts.v1");
|
|
14216
14271
|
const writesKey = Symbol.for("atomic.chat-display-writes.v1");
|
|
@@ -14416,9 +14471,10 @@ var QueuedDeliveryRelay = class {
|
|
|
14416
14471
|
retired = /* @__PURE__ */ new WeakSet();
|
|
14417
14472
|
/**
|
|
14418
14473
|
* The change to send with `event`, which `session` sends now; undefined when there is none to send with it. `message`
|
|
14419
|
-
* 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.
|
|
14420
14476
|
*/
|
|
14421
|
-
note(session, event, message) {
|
|
14477
|
+
note(session, event, message, origin) {
|
|
14422
14478
|
const dropped = event.type === "agent_end" ? takeQueuedMessagesDroppedAt(event) ?? [] : [];
|
|
14423
14479
|
if (event.type === "tool_execution_update" || this.retired.has(session)) return void 0;
|
|
14424
14480
|
const start = this.head;
|
|
@@ -14433,9 +14489,10 @@ var QueuedDeliveryRelay = class {
|
|
|
14433
14489
|
this.head = 0;
|
|
14434
14490
|
}
|
|
14435
14491
|
for (const delivery of taken) this.told.push(delivery);
|
|
14436
|
-
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;
|
|
14437
14493
|
return {
|
|
14438
14494
|
...message === void 0 ? {} : { message },
|
|
14495
|
+
...origin === void 0 ? {} : { origin },
|
|
14439
14496
|
...ended > 0 ? { ended } : {},
|
|
14440
14497
|
...taken.length > 0 ? { taken: taken.map(({ lane, text, receipt }) => ({
|
|
14441
14498
|
lane,
|
|
@@ -14557,9 +14614,10 @@ function takeQueuedDeliveryChange(event) {
|
|
|
14557
14614
|
/** `value` as a change in deliveries, as an engine writes one; undefined for anything else. */
|
|
14558
14615
|
function parseQueuedDeliveryChange(value) {
|
|
14559
14616
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
|
|
14560
|
-
const { ended, taken, dropped, message } = value;
|
|
14617
|
+
const { ended, taken, dropped, message, origin } = value;
|
|
14561
14618
|
if (ended !== void 0 && !(typeof ended === "number" && Number.isSafeInteger(ended) && ended >= 0)) return void 0;
|
|
14562
14619
|
if (message !== void 0 && typeof message !== "string") return void 0;
|
|
14620
|
+
if (origin !== void 0 && typeof origin !== "string") return void 0;
|
|
14563
14621
|
const entries = parseQueuedDeliveryEntries(taken);
|
|
14564
14622
|
const droppedEntries = parseQueuedDeliveryEntries(dropped);
|
|
14565
14623
|
if (entries === void 0 || droppedEntries === void 0) return void 0;
|
|
@@ -14567,7 +14625,8 @@ function parseQueuedDeliveryChange(value) {
|
|
|
14567
14625
|
...typeof ended === "number" && ended > 0 ? { ended } : {},
|
|
14568
14626
|
...entries.length > 0 ? { taken: entries } : {},
|
|
14569
14627
|
...droppedEntries.length > 0 ? { dropped: droppedEntries } : {},
|
|
14570
|
-
...message === void 0 ? {} : { message }
|
|
14628
|
+
...message === void 0 ? {} : { message },
|
|
14629
|
+
...origin === void 0 ? {} : { origin }
|
|
14571
14630
|
};
|
|
14572
14631
|
}
|
|
14573
14632
|
/** `value`, absent or a list of messages with their lanes, as an engine writes one; undefined for anything else. */
|
|
@@ -16871,6 +16930,52 @@ function sameRecord(a, b) {
|
|
|
16871
16930
|
function resourceInternals(loader) {
|
|
16872
16931
|
return loader;
|
|
16873
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
|
+
}
|
|
16874
16979
|
// dist/extensions/herdr/environment.js
|
|
16875
16980
|
function captureHerdrEnvironment(env) {
|
|
16876
16981
|
if (env.HERDR_ENV !== "1" || !env.HERDR_BIN_PATH || !env.HERDR_PANE_ID || !env.HERDR_SOCKET_PATH) return void 0;
|
|
@@ -17325,6 +17430,35 @@ function modelCallUsage(event) {
|
|
|
17325
17430
|
default: return;
|
|
17326
17431
|
}
|
|
17327
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
|
+
}
|
|
17328
17462
|
// dist/core/storage/adapter-open.js
|
|
17329
17463
|
/**
|
|
17330
17464
|
* Opening an adapter selection's database the way the storage provider does, for the checks that run before a
|
|
@@ -18068,6 +18202,46 @@ async function claimPaneReporting(environment, identity, options = {}) {
|
|
|
18068
18202
|
function matchesActivity(previous, activity) {
|
|
18069
18203
|
return activity.state === previous?.state && activity.reason === previous?.reason && activity.message === previous?.message;
|
|
18070
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
|
+
}
|
|
18071
18245
|
function reportPaneActivity(owner, activity, skipUnchanged = false) {
|
|
18072
18246
|
if (owner.status !== "active" || owners.get(owner.environment.paneId) !== owner) {
|
|
18073
18247
|
diagnostic(owner, { kind: "stale_owner" });
|
|
@@ -18080,30 +18254,7 @@ function reportPaneActivity(owner, activity, skipUnchanged = false) {
|
|
|
18080
18254
|
skipUnchanged: skipUnchanged && !pendingExplicitRefresh
|
|
18081
18255
|
};
|
|
18082
18256
|
if (owner.flight) return;
|
|
18083
|
-
owner
|
|
18084
|
-
while (owner.pending && owner.status === "active") {
|
|
18085
|
-
const { activity: next, skipUnchanged } = owner.pending;
|
|
18086
|
-
owner.pending = void 0;
|
|
18087
|
-
if (skipUnchanged && matchesActivity(owner.lastDeliveredActivity, next)) continue;
|
|
18088
|
-
allocateSequence(owner);
|
|
18089
|
-
const resume = owner.identitySent || owner.resumeUnsupported ? void 0 : acceptedResume(owner.identity.resume);
|
|
18090
|
-
let failure = await executeHerdr(owner.environment, reportArgv(owner, next, resume), owner.options.timeoutMs);
|
|
18091
|
-
if (resume && failure?.kind === "protocol_rejected") {
|
|
18092
|
-
allocateSequence(owner);
|
|
18093
|
-
failure = await executeHerdr(owner.environment, reportArgv(owner, next), owner.options.timeoutMs);
|
|
18094
|
-
if (!failure) owner.resumeUnsupported = true;
|
|
18095
|
-
}
|
|
18096
|
-
if (failure) {
|
|
18097
|
-
diagnostic(owner, failure);
|
|
18098
|
-
owner.lastDeliveredActivity = void 0;
|
|
18099
|
-
} else {
|
|
18100
|
-
owner.identitySent = true;
|
|
18101
|
-
owner.lastDeliveredActivity = next;
|
|
18102
|
-
}
|
|
18103
|
-
}
|
|
18104
|
-
})().finally(() => {
|
|
18105
|
-
owner.flight = void 0;
|
|
18106
|
-
});
|
|
18257
|
+
startFlight(owner);
|
|
18107
18258
|
}
|
|
18108
18259
|
/** Fence and drain a local reporter without unregistering the still-running agent. */
|
|
18109
18260
|
function retirePaneReporting(owner) {
|
|
@@ -18726,6 +18877,7 @@ const LONG_LIVED_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
18726
18877
|
"navigate_tree",
|
|
18727
18878
|
"invoke_shortcut",
|
|
18728
18879
|
"start_pending_recovery",
|
|
18880
|
+
"start_pending_recovery_restore",
|
|
18729
18881
|
"agent_view_prompt",
|
|
18730
18882
|
"agent_view_resume",
|
|
18731
18883
|
"agent_view_pause"
|
|
@@ -19051,6 +19203,61 @@ function quarantineWindowsNativeDependencies(packageDir) {
|
|
|
19051
19203
|
copyFileSync(quarantinePath, loadedFile);
|
|
19052
19204
|
}
|
|
19053
19205
|
}
|
|
19054
|
-
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 };
|
|
19055
19217
|
|
|
19056
|
-
//# 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
|
+
}
|