@bastani/atomic 0.10.4 → 0.10.5
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 +122 -0
- package/dist/_shared/compile-cache-warmup-host-RU5L7I7A.js +1 -1
- package/dist/_shared/dist-KOELCESV.js +48 -3
- package/dist/_shared/fork-row-index-UAUAQRD5.js +47 -2
- package/dist/_shared/http-YFAPTIZD.js +16 -4
- package/dist/_shared/http-YFAPTIZD.js.map +1 -1
- package/dist/_shared/lib-4PES5P4V.js +59 -14
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +1706 -258
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +317 -64
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/{mode-shared-HP7GUA7J.js → mode-shared-2QJSCUM6.js} +432 -81
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -0
- package/dist/_shared/p0-cli-BB45ZQY6.js +3482 -0
- package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -0
- package/dist/_shared/p0-cli-GUFK7TPN.js +2 -2838
- package/dist/_shared/p0-cli-GUFK7TPN.js.map +1 -1
- package/dist/_shared/{p1a-prewarm-YK3KDTLN.js → p1a-prewarm-UQY3X2UK.js} +270 -73
- package/dist/_shared/p1a-prewarm-UQY3X2UK.js.map +1 -0
- package/dist/_shared/{p1b-elig-PXQA2FYP.js → p1b-elig-ENCUPKKJ.js} +190 -121
- package/dist/_shared/p1b-elig-ENCUPKKJ.js.map +1 -0
- package/dist/_shared/p2-common-YLSYXMDQ.js +1 -3
- package/dist/_shared/p2-common-YLSYXMDQ.js.map +1 -1
- package/dist/_shared/p2-shell-TJBYQMCJ.js +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +500 -127
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +4 -4
- package/dist/_shared/sdk-WQIOHVKO.js +56 -11
- package/dist/_shared/session-data-AHTU7IS6.js +48 -3
- package/dist/_shared/session-manager-list-2BLEEZVG.js +2 -2
- package/dist/_shared/settings-startup-65YEWRV2.js.map +1 -1
- package/dist/_shared/sql-session-store-5FD3WBMZ.js +57 -12
- package/dist/_shared/{startup-0-0-X4NF3GKM.js → startup-0-0-TYUFUOJZ.js} +519 -316
- package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +1 -0
- package/dist/_shared/{startup-0-1-7QTG6VJZ.js → startup-0-1-D4LGGINF.js} +284 -81
- package/dist/_shared/startup-0-1-D4LGGINF.js.map +1 -0
- package/dist/_shared/{startup-0-2-KFDYPDJK.js → startup-0-2-SZGQIWHI.js} +483 -154
- package/dist/_shared/startup-0-2-SZGQIWHI.js.map +1 -0
- package/dist/_shared/startup-0-3-T4DVFYWX.js +340 -110
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
- package/dist/_shared/startup-0-4-HN5EB4K7.js +261 -59
- package/dist/_shared/startup-0-4-HN5EB4K7.js.map +1 -1
- package/dist/_shared/startup-0-5-OHJNE6JH.js +421 -148
- package/dist/_shared/startup-0-5-OHJNE6JH.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +62 -11
- package/dist/_shared/startup-10-0-TDQNBDDL.js.map +1 -1
- package/dist/_shared/startup-12-0-55AAXBJZ.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +12 -11
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +53 -158
- package/dist/_shared/startup-15-0-YUKGAC63.js.map +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +231 -46
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +115 -35
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-KQJBDKRU.js → startup-8-1-SJW2GMAM.js} +203 -62
- package/dist/_shared/startup-8-1-SJW2GMAM.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +55 -10
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +47 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +48 -3
- package/dist/builtin/intercom/CHANGELOG.md +42 -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 +12 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +336 -86
- package/dist/builtin/web-access/index.bundle.mjs +23 -38
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/bun/cli.js +1 -1
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/internal-intercom-broker.js +119 -4
- package/dist/bun/internal-intercom-broker.js.map +1 -1
- package/dist/bun/register-theme-validator.js +6 -0
- package/dist/bun/register-theme-validator.js.map +1 -0
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +1102 -0
- package/dist/cli/auth-cli.code.js.map +1 -0
- package/dist/cli/auth-cli.impl.js +30 -1096
- package/dist/cli/auth-cli.impl.js.map +1 -1
- package/dist/cli/auth-cli.js +11 -7
- package/dist/cli/blueprint-command.code.js +906 -0
- package/dist/cli/blueprint-command.code.js.map +1 -0
- package/dist/cli/blueprint-command.impl.js +30 -900
- package/dist/cli/blueprint-command.impl.js.map +1 -1
- package/dist/cli/blueprint-command.js +11 -7
- package/dist/cli/intercom-command.code.js +153 -0
- package/dist/cli/intercom-command.code.js.map +1 -0
- package/dist/cli/intercom-command.impl.js +33 -105
- package/dist/cli/intercom-command.impl.js.map +1 -1
- package/dist/cli/intercom-command.js +11 -7
- package/dist/cli/list-models.code.js +60 -0
- package/dist/cli/list-models.code.js.map +1 -0
- package/dist/cli/list-models.impl.js +33 -57
- package/dist/cli/list-models.impl.js.map +1 -1
- package/dist/cli/list-models.js +11 -7
- package/dist/cli/session-picker.code.js +55 -0
- package/dist/cli/session-picker.code.js.map +1 -0
- package/dist/cli/session-picker.impl.js +33 -52
- package/dist/cli/session-picker.impl.js.map +1 -1
- package/dist/cli/session-picker.js +11 -7
- package/dist/cli/startup-ui.code.js +5 -0
- package/dist/cli/startup-ui.code.js.map +1 -0
- package/dist/cli/startup-ui.impl.js +35 -4
- package/dist/cli/startup-ui.js +11 -7
- package/dist/cli/storage-command.code.js +3 -0
- package/dist/cli/storage-command.code.js.map +1 -0
- package/dist/cli/storage-command.impl.js +35 -2
- package/dist/cli/storage-command.js +11 -7
- package/dist/cli/storage-search-session.code.js +189 -0
- package/dist/cli/storage-search-session.code.js.map +1 -0
- package/dist/cli/storage-search-session.impl.js +33 -186
- package/dist/cli/storage-search-session.impl.js.map +1 -1
- package/dist/cli/storage-search-session.js +11 -7
- package/dist/cli/team-command.code.js +217 -0
- package/dist/cli/team-command.code.js.map +1 -0
- package/dist/cli/team-command.impl.js +32 -213
- package/dist/cli/team-command.impl.js.map +1 -1
- package/dist/cli/team-command.js +11 -7
- package/dist/cli.js +60 -11
- package/dist/cli.js.map +1 -1
- package/dist/config.js +1 -1
- package/dist/core/agent-session-methods.d.ts +4 -3
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +5 -0
- package/dist/core/compaction/compaction.d.ts +6 -0
- package/dist/core/compaction/model-resolver.d.ts +1 -1
- package/dist/core/debug.code.js +3 -0
- package/dist/core/debug.code.js.map +1 -0
- package/dist/core/debug.impl.js +35 -2
- package/dist/core/debug.js +11 -7
- package/dist/core/default-model-api-prewarm.d.ts +5 -0
- package/dist/core/export-html/card-projection.code.js +257 -0
- package/dist/core/export-html/card-projection.code.js.map +1 -0
- package/dist/core/export-html/card-projection.impl.js +34 -255
- package/dist/core/export-html/card-projection.impl.js.map +1 -1
- package/dist/core/export-html/card-projection.js +11 -7
- package/dist/core/export-html/index.code.js +655 -0
- package/dist/core/export-html/index.code.js.map +1 -0
- package/dist/core/export-html/index.impl.js +30 -604
- package/dist/core/export-html/index.impl.js.map +1 -1
- package/dist/core/export-html/index.js +11 -7
- package/dist/core/export-html/json-spans.code.js +3 -0
- package/dist/core/export-html/json-spans.code.js.map +1 -0
- package/dist/core/export-html/json-spans.impl.js +35 -2
- package/dist/core/export-html/json-spans.js +11 -7
- package/dist/core/export-html/oversized-render-inputs.code.js +125 -0
- package/dist/core/export-html/oversized-render-inputs.code.js.map +1 -0
- package/dist/core/export-html/oversized-render-inputs.impl.js +31 -120
- package/dist/core/export-html/oversized-render-inputs.impl.js.map +1 -1
- package/dist/core/export-html/oversized-render-inputs.js +11 -7
- package/dist/core/export-html/tool-renderer.code.js +350 -0
- package/dist/core/export-html/tool-renderer.code.js.map +1 -0
- package/dist/core/export-html/tool-renderer.impl.js +33 -347
- package/dist/core/export-html/tool-renderer.impl.js.map +1 -1
- package/dist/core/export-html/tool-renderer.js +11 -7
- package/dist/core/extensions/jiti-loader.code.js +3 -0
- package/dist/core/extensions/jiti-loader.code.js.map +1 -0
- package/dist/core/extensions/jiti-loader.impl.js +35 -2
- package/dist/core/extensions/jiti-loader.js +11 -7
- package/dist/core/extensions/jiti-static-loader.code.js +3 -0
- package/dist/core/extensions/jiti-static-loader.code.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.impl.js +35 -2
- package/dist/core/extensions/jiti-static-loader.js +11 -7
- package/dist/core/extensions/loader-host-modules.code.js +3 -0
- package/dist/core/extensions/loader-host-modules.code.js.map +1 -0
- package/dist/core/extensions/loader-host-modules.impl.js +35 -2
- package/dist/core/extensions/loader-host-modules.js +11 -7
- package/dist/core/extensions/loader-virtual-modules.d.ts +1 -6
- package/dist/core/extensions/loader-virtual-modules.js +1 -1
- package/dist/core/extensions/runner-context.js +3 -3
- package/dist/core/extensions/session-events.d.ts +4 -0
- package/dist/core/extensions/session-events.js.map +1 -1
- package/dist/core/intercom-broker-control-host.code.js +5 -0
- package/dist/core/intercom-broker-control-host.code.js.map +1 -0
- package/dist/core/intercom-broker-control-host.impl.js +35 -4
- package/dist/core/intercom-broker-control-host.js +11 -7
- package/dist/core/intercom-broker-control.code.js +63 -0
- package/dist/core/intercom-broker-control.code.js.map +1 -0
- package/dist/core/intercom-broker-control.d.ts +21 -0
- package/dist/core/intercom-broker-control.impl.js +35 -17
- package/dist/core/intercom-broker-control.impl.js.map +1 -1
- package/dist/core/intercom-broker-control.js +11 -7
- package/dist/core/package-manager-storage-adapters.code.js +3 -0
- package/dist/core/package-manager-storage-adapters.code.js.map +1 -0
- package/dist/core/package-manager-storage-adapters.impl.js +35 -2
- package/dist/core/package-manager-storage-adapters.js +11 -7
- package/dist/core/process-start-token.d.ts +8 -2
- package/dist/core/process-tree-containment.d.ts +27 -0
- package/dist/core/queued-message-delivery.d.ts +5 -2
- package/dist/core/resume/blueprint/process.d.ts +3 -1
- package/dist/core/sdk.code.js +9 -0
- package/dist/core/sdk.code.js.map +1 -0
- package/dist/core/sdk.impl.js +35 -8
- package/dist/core/sdk.js +11 -7
- package/dist/core/session-manager-core.d.ts +15 -5
- package/dist/core/session-manager-core.js +195 -38
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-list.code.js +3 -0
- package/dist/core/session-manager-list.code.js.map +1 -0
- package/dist/core/session-manager-list.impl.js +35 -2
- package/dist/core/session-manager-list.js +11 -7
- package/dist/core/session-manager-types.d.ts +20 -0
- package/dist/core/session-manager.code.js +8 -0
- package/dist/core/session-manager.code.js.map +1 -0
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.impl.js +35 -7
- package/dist/core/session-manager.js +11 -7
- package/dist/core/session-storage.code.js +3 -0
- package/dist/core/session-storage.code.js.map +1 -0
- package/dist/core/session-storage.impl.js +35 -2
- package/dist/core/session-storage.js +11 -7
- package/dist/core/storage/file-identity.d.ts +3 -0
- package/dist/core/storage/file-identity.js +296 -86
- package/dist/core/storage/file-identity.js.map +1 -1
- package/dist/core/storage/index.d.ts +1 -1
- package/dist/core/storage/index.js +52 -7
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +47 -2
- package/dist/core/storage/node-sqlite.js +49 -4
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.code.js +37 -0
- package/dist/core/storage/offline-snapshot-file.code.js.map +1 -0
- package/dist/core/storage/offline-snapshot-file.impl.js +33 -34
- package/dist/core/storage/offline-snapshot-file.impl.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.js +11 -7
- package/dist/core/storage/provider.js +52 -7
- package/dist/core/storage/selection.js +49 -4
- package/dist/core/storage/session/branch-fork-source.code.js +146 -0
- package/dist/core/storage/session/branch-fork-source.code.js.map +1 -0
- package/dist/core/storage/session/branch-fork-source.impl.js +32 -97
- package/dist/core/storage/session/branch-fork-source.impl.js.map +1 -1
- package/dist/core/storage/session/branch-fork-source.js +11 -7
- package/dist/core/storage/session/card-view.code.js +60 -0
- package/dist/core/storage/session/card-view.code.js.map +1 -0
- package/dist/core/storage/session/card-view.impl.js +34 -58
- package/dist/core/storage/session/card-view.impl.js.map +1 -1
- package/dist/core/storage/session/card-view.js +11 -7
- package/dist/core/storage/session/child-reader.code.js +139 -0
- package/dist/core/storage/session/child-reader.code.js.map +1 -0
- package/dist/core/storage/session/child-reader.d.ts +1 -0
- package/dist/core/storage/session/child-reader.impl.js +33 -91
- package/dist/core/storage/session/child-reader.impl.js.map +1 -1
- package/dist/core/storage/session/child-reader.js +11 -7
- package/dist/core/storage/session/chunked-resume-projection.code.js +3 -0
- package/dist/core/storage/session/chunked-resume-projection.code.js.map +1 -0
- package/dist/core/storage/session/chunked-resume-projection.impl.js +35 -2
- package/dist/core/storage/session/chunked-resume-projection.js +11 -7
- package/dist/core/storage/session/expanded-child-details.code.js +684 -0
- package/dist/core/storage/session/expanded-child-details.code.js.map +1 -0
- package/dist/core/storage/session/expanded-child-details.impl.js +31 -634
- package/dist/core/storage/session/expanded-child-details.impl.js.map +1 -1
- package/dist/core/storage/session/expanded-child-details.js +11 -7
- package/dist/core/storage/session/fork-row-bytes.code.js +3 -0
- package/dist/core/storage/session/fork-row-bytes.code.js.map +1 -0
- package/dist/core/storage/session/fork-row-bytes.impl.js +35 -2
- package/dist/core/storage/session/fork-row-bytes.js +11 -7
- package/dist/core/storage/session/fork-row-index.code.js +3 -0
- package/dist/core/storage/session/fork-row-index.code.js.map +1 -0
- package/dist/core/storage/session/fork-row-index.impl.js +35 -2
- package/dist/core/storage/session/fork-row-index.js +11 -7
- package/dist/core/storage/session/fork-staging.code.js +580 -0
- package/dist/core/storage/session/fork-staging.code.js.map +1 -0
- package/dist/core/storage/session/fork-staging.impl.js +30 -574
- package/dist/core/storage/session/fork-staging.impl.js.map +1 -1
- package/dist/core/storage/session/fork-staging.js +11 -7
- package/dist/core/storage/session/fork-window.code.js +522 -0
- package/dist/core/storage/session/fork-window.code.js.map +1 -0
- package/dist/core/storage/session/fork-window.impl.js +30 -471
- package/dist/core/storage/session/fork-window.impl.js.map +1 -1
- package/dist/core/storage/session/fork-window.js +11 -7
- package/dist/core/storage/session/history-pages.code.js +3 -0
- package/dist/core/storage/session/history-pages.code.js.map +1 -0
- package/dist/core/storage/session/history-pages.impl.js +35 -2
- package/dist/core/storage/session/history-pages.js +11 -7
- package/dist/core/storage/session/jsonl-entry-projection.code.js +3 -0
- package/dist/core/storage/session/jsonl-entry-projection.code.js.map +1 -0
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +35 -2
- package/dist/core/storage/session/jsonl-entry-projection.js +11 -7
- package/dist/core/storage/session/jsonl-session-store.code.js +3 -0
- package/dist/core/storage/session/jsonl-session-store.code.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.impl.js +35 -2
- package/dist/core/storage/session/jsonl-session-store.js +11 -7
- package/dist/core/storage/session/memory-session-store.code.js +3 -0
- package/dist/core/storage/session/memory-session-store.code.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.impl.js +35 -2
- package/dist/core/storage/session/memory-session-store.js +11 -7
- package/dist/core/storage/session/pinned-branch-resume.code.js +117 -0
- package/dist/core/storage/session/pinned-branch-resume.code.js.map +1 -0
- package/dist/core/storage/session/pinned-branch-resume.impl.js +33 -69
- package/dist/core/storage/session/pinned-branch-resume.impl.js.map +1 -1
- package/dist/core/storage/session/pinned-branch-resume.js +11 -7
- package/dist/core/storage/session/released-history-files.code.js +465 -0
- package/dist/core/storage/session/released-history-files.code.js.map +1 -0
- package/dist/core/storage/session/released-history-files.impl.js +32 -461
- package/dist/core/storage/session/released-history-files.impl.js.map +1 -1
- package/dist/core/storage/session/released-history-files.js +11 -7
- package/dist/core/storage/session/resident-fork-rows.code.js +57 -0
- package/dist/core/storage/session/resident-fork-rows.code.js.map +1 -0
- package/dist/core/storage/session/resident-fork-rows.impl.js +32 -53
- package/dist/core/storage/session/resident-fork-rows.impl.js.map +1 -1
- package/dist/core/storage/session/resident-fork-rows.js +11 -7
- package/dist/core/storage/session/session-resume.code.js +3 -0
- package/dist/core/storage/session/session-resume.code.js.map +1 -0
- package/dist/core/storage/session/session-resume.impl.js +35 -2
- package/dist/core/storage/session/session-resume.js +11 -7
- package/dist/core/storage/session/snapshot-cut.code.js +3 -0
- package/dist/core/storage/session/snapshot-cut.code.js.map +1 -0
- package/dist/core/storage/session/snapshot-cut.impl.js +35 -2
- package/dist/core/storage/session/snapshot-cut.js +11 -7
- package/dist/core/storage/session/snapshot-history.code.js +107 -0
- package/dist/core/storage/session/snapshot-history.code.js.map +1 -0
- package/dist/core/storage/session/snapshot-history.impl.js +34 -60
- package/dist/core/storage/session/snapshot-history.impl.js.map +1 -1
- package/dist/core/storage/session/snapshot-history.js +11 -7
- package/dist/core/storage/session/sql-session-store.code.js +3 -0
- package/dist/core/storage/session/sql-session-store.code.js.map +1 -0
- package/dist/core/storage/session/sql-session-store.impl.js +35 -2
- package/dist/core/storage/session/sql-session-store.js +11 -7
- package/dist/core/storage/session/tree-outline.code.js +3 -0
- package/dist/core/storage/session/tree-outline.code.js.map +1 -0
- package/dist/core/storage/session/tree-outline.impl.js +35 -2
- package/dist/core/storage/session/tree-outline.js +11 -7
- package/dist/core/storage/session/tree-presentation.code.js +342 -0
- package/dist/core/storage/session/tree-presentation.code.js.map +1 -0
- package/dist/core/storage/session/tree-presentation.impl.js +31 -337
- package/dist/core/storage/session/tree-presentation.impl.js.map +1 -1
- package/dist/core/storage/session/tree-presentation.js +11 -7
- package/dist/core/storage/session/types.d.ts +26 -0
- package/dist/core/storage/storage-status.code.js +3 -0
- package/dist/core/storage/storage-status.code.js.map +1 -0
- package/dist/core/storage/storage-status.impl.js +35 -2
- package/dist/core/storage/storage-status.js +11 -7
- package/dist/core/storage/team.code.js +3 -0
- package/dist/core/storage/team.code.js.map +1 -0
- package/dist/core/storage/team.impl.js +35 -2
- package/dist/core/storage/team.js +11 -7
- package/dist/core/structured-output/index.code.js +3 -0
- package/dist/core/structured-output/index.code.js.map +1 -0
- package/dist/core/structured-output/index.impl.js +35 -2
- package/dist/core/structured-output/index.js +11 -7
- package/dist/core/tasks/command-output.d.ts +4 -1
- package/dist/core/tasks/supervisor.d.ts +2 -0
- package/dist/core/tasks/task-completion-entry.code.js +254 -0
- package/dist/core/tasks/task-completion-entry.code.js.map +1 -0
- package/dist/core/tasks/task-completion-entry.impl.js +33 -251
- package/dist/core/tasks/task-completion-entry.impl.js.map +1 -1
- package/dist/core/tasks/task-completion-entry.js +11 -7
- package/dist/core/tasks/task-file-history.code.js +424 -0
- package/dist/core/tasks/task-file-history.code.js.map +1 -0
- package/dist/core/tasks/task-file-history.impl.js +32 -375
- package/dist/core/tasks/task-file-history.impl.js.map +1 -1
- package/dist/core/tasks/task-file-history.js +11 -7
- package/dist/core/tasks/{task-reference-archive.impl.js → task-reference-archive.code.js} +51 -6
- package/dist/core/tasks/{task-reference-archive.impl.js.map → task-reference-archive.code.js.map} +1 -1
- package/dist/core/tasks/task-reference-archive.js +11 -7
- package/dist/core/tasks/{task-reference-identity.impl.js → task-reference-identity.code.js} +1 -1
- package/dist/core/tasks/{task-reference-identity.impl.js.map → task-reference-identity.code.js.map} +1 -1
- package/dist/core/tasks/task-reference-identity.js +11 -7
- package/dist/core/tasks/task-reference-stream.code.js +3 -0
- package/dist/core/tasks/task-reference-stream.code.js.map +1 -0
- package/dist/core/tasks/task-reference-stream.impl.js +35 -2
- package/dist/core/tasks/task-reference-stream.js +11 -7
- package/dist/core/tasks/task-unsaved-answer.code.js +3 -0
- package/dist/core/tasks/task-unsaved-answer.code.js.map +1 -0
- package/dist/core/tasks/task-unsaved-answer.impl.js +35 -2
- package/dist/core/tasks/task-unsaved-answer.js +11 -7
- package/dist/core/tasks/task-view-source.code.js +3 -0
- package/dist/core/tasks/task-view-source.code.js.map +1 -0
- package/dist/core/tasks/task-view-source.d.ts +9 -0
- package/dist/core/tasks/task-view-source.impl.js +35 -2
- package/dist/core/tasks/task-view-source.js +12 -8
- package/dist/core/tools/read-url.code.js +1530 -0
- package/dist/core/tools/read-url.code.js.map +1 -0
- package/dist/core/tools/read-url.impl.js +30 -1524
- package/dist/core/tools/read-url.impl.js.map +1 -1
- package/dist/core/tools/read-url.js +11 -7
- package/dist/core/worktree-snapshot/blob-store.js +50 -5
- package/dist/core/worktree-snapshot/errors.code.js +6 -0
- package/dist/core/worktree-snapshot/errors.code.js.map +1 -0
- package/dist/core/worktree-snapshot/errors.impl.js +35 -5
- package/dist/core/worktree-snapshot/errors.js +11 -7
- package/dist/core/worktree-snapshot/session-index-reset.code.js +136 -0
- package/dist/core/worktree-snapshot/session-index-reset.code.js.map +1 -0
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +34 -134
- package/dist/core/worktree-snapshot/session-index-reset.impl.js.map +1 -1
- package/dist/core/worktree-snapshot/session-index-reset.js +11 -7
- package/dist/extensions/codemode/execute.code.js +618 -0
- package/dist/extensions/codemode/execute.code.js.map +1 -0
- package/dist/extensions/codemode/execute.impl.js +30 -612
- package/dist/extensions/codemode/execute.impl.js.map +1 -1
- package/dist/extensions/codemode/execute.js +11 -7
- package/dist/extensions/codemode/renderer.code.js +110 -0
- package/dist/extensions/codemode/renderer.code.js.map +1 -0
- package/dist/extensions/codemode/renderer.impl.js +33 -107
- package/dist/extensions/codemode/renderer.impl.js.map +1 -1
- package/dist/extensions/codemode/renderer.js +11 -7
- package/dist/extensions/mcp/cli.code.js +565 -0
- package/dist/extensions/mcp/cli.code.js.map +1 -0
- package/dist/extensions/mcp/cli.impl.js +32 -561
- package/dist/extensions/mcp/cli.impl.js.map +1 -1
- package/dist/extensions/mcp/cli.js +11 -7
- package/dist/extensions/mcp/cli.lazy.code.js +52 -0
- package/dist/extensions/mcp/cli.lazy.code.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.impl.js +36 -7
- package/dist/extensions/mcp/cli.lazy.impl.js.map +1 -1
- package/dist/extensions/mcp/cli.lazy.js +11 -7
- package/dist/extensions/mcp/client/transports/stdio.d.ts +2 -0
- package/dist/extensions/mcp/runtime.code.js +5 -0
- package/dist/extensions/mcp/runtime.code.js.map +1 -0
- package/dist/extensions/mcp/runtime.impl.js +35 -4
- package/dist/extensions/mcp/runtime.js +11 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/main-first-time-setup.code.js +12 -0
- package/dist/main-first-time-setup.code.js.map +1 -0
- package/dist/main-first-time-setup.impl.js +35 -11
- package/dist/main-first-time-setup.impl.js.map +1 -1
- package/dist/main-first-time-setup.js +11 -7
- package/dist/main.d.ts +1 -1
- package/dist/main.js +2 -2
- package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts +6 -1
- package/dist/modes/interactive/agent-view/contracts.d.ts +4 -0
- package/dist/modes/interactive/chat-reader-records.d.ts +1 -1
- package/dist/modes/interactive/components/stored-tree-view.code.js +338 -0
- package/dist/modes/interactive/components/stored-tree-view.code.js.map +1 -0
- package/dist/modes/interactive/components/stored-tree-view.impl.js +33 -290
- package/dist/modes/interactive/components/stored-tree-view.impl.js.map +1 -1
- package/dist/modes/interactive/components/stored-tree-view.js +11 -7
- package/dist/modes/interactive/components/task-selection-state.d.ts +8 -3
- package/dist/modes/interactive/components/task-transcript-page.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js +191 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +34 -189
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector-archive.js +11 -7
- package/dist/modes/interactive/interactive-mode-base.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-queueing.d.ts +4 -0
- package/dist/modes/interactive/interactive-render-chat.d.ts +22 -0
- package/dist/modes/interactive/interactive-startup.d.ts +2 -0
- package/dist/modes/interactive/program-status-reporter.d.ts +2 -1
- package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
- package/dist/modes/interactive/steering-queue-controller.d.ts +4 -0
- package/dist/modes/interactive/theme/theme-schema-factory.d.ts +26 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts +4 -5
- package/dist/modes/interactive-engine/engine-prewarm.d.ts +30 -5
- package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +7 -0
- package/dist/modes/interactive-engine/protocol.d.ts +32 -1
- package/dist/modes/rpc/agent-view-rpc-types.d.ts +12 -1
- package/dist/modes/rpc/agent-view-rpc-types.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +3 -1
- package/dist/modes/rpc/rpc-types.d.ts +12 -0
- package/dist/package-manager-cli.code.js +1140 -0
- package/dist/package-manager-cli.code.js.map +1 -0
- package/dist/package-manager-cli.impl.js +36 -1067
- package/dist/package-manager-cli.impl.js.map +1 -1
- package/dist/package-manager-cli.js +11 -7
- package/dist/rpc-entry.js +2 -2
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/10.js +1 -1
- package/dist/startup-stages/11.js +1 -1
- package/dist/startup-stages/12.js +1 -1
- package/dist/startup-stages/13.js +1 -0
- package/dist/startup-stages/2.js +1 -7
- package/dist/startup-stages/3.js +6 -2
- package/dist/startup-stages/4.js +2 -1
- package/dist/startup-stages/5.js +1 -7
- package/dist/startup-stages/6.js +7 -10
- package/dist/startup-stages/7.js +10 -3
- package/dist/startup-stages/8.js +3 -6
- package/dist/startup-stages/9.js +6 -1
- package/dist/startup-stages/stages.json +1 -1
- package/dist/utils/canonical-path.js +2 -0
- package/dist/utils/canonical-path.js.map +1 -1
- package/dist/utils/child-process.d.ts +41 -1
- package/dist/utils/compile-cache-warmup-host.js +63 -18
- package/dist/utils/compile-cache-warmup-host.js.map +1 -1
- package/dist/utils/credential-redaction.d.ts +50 -1
- package/dist/utils/interactive-engine-bootstrap.d.ts +2 -0
- package/dist/utils/interactive-engine-env.d.ts +2 -0
- package/dist/utils/memoize-async.d.ts +32 -0
- package/dist/utils/memoize-async.js +91 -0
- package/dist/utils/memoize-async.js.map +1 -0
- package/dist/utils/photon.js +19 -29
- package/dist/utils/photon.js.map +1 -1
- package/dist/utils/shell.d.ts +7 -4
- package/dist/utils/startup-database-spare.code.js +108 -0
- package/dist/utils/startup-database-spare.code.js.map +1 -0
- package/dist/utils/startup-database-spare.impl.js +33 -105
- package/dist/utils/startup-database-spare.impl.js.map +1 -1
- package/dist/utils/startup-database-spare.js +11 -7
- package/dist/utils/tools-manager.code.js +3 -0
- package/dist/utils/tools-manager.code.js.map +1 -0
- package/dist/utils/tools-manager.impl.js +35 -2
- package/dist/utils/tools-manager.js +11 -7
- package/dist/utils/windows-cwd.js +585 -0
- package/dist/utils/windows-cwd.js.map +1 -0
- package/docs/extensions.md +1 -1
- package/docs/getting-started/installation.md +2 -0
- package/docs/intercom/operations.md +1 -0
- package/docs/reference/cli.md +1 -1
- package/package.json +24 -24
- package/dist/_shared/mode-shared-HP7GUA7J.js.map +0 -1
- package/dist/_shared/p1a-prewarm-YK3KDTLN.js.map +0 -1
- package/dist/_shared/p1b-elig-PXQA2FYP.js.map +0 -1
- package/dist/_shared/startup-0-0-X4NF3GKM.js.map +0 -1
- package/dist/_shared/startup-0-1-7QTG6VJZ.js.map +0 -1
- package/dist/_shared/startup-0-2-KFDYPDJK.js.map +0 -1
- package/dist/_shared/startup-8-1-KQJBDKRU.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __commonJSMin, __require } from "./rolldown-runtime-BGM3D5V3.js";
|
|
2
|
-
import { APP_NAME, ENV_SESSION_DIR, VERSION, createChildProcessEnvironment, createModuleRequire, findHelperExecutable, findHelperExecutableAsync, getAgentDir, getBinDir, getProjectConfigDirs, isBunBinary, isBundledBuild, isPathWithin, loadOnDemand, markLifecycleTiming, normalizePath, processLaunch, processLaunchAsync, resolvePath, spawnLaunchedProcess, spawnLaunchedProcessSync, stripBom } from "./p0-cli-
|
|
3
|
-
import { ActivityWatchdog, Diff, JSON_RPC_ERROR_CODES, MAX_TOOL_DETACHMENT_AFTER_MS, McpAbortError, McpConnectionClosedError, NON_SECRET_HTTP_HEADERS, ROW_INTENT_META, STARTUP_DECISION_TYPED_TEXT_NOTICE, TASK_MARKS, TaskCleanupAdmissionTimeoutError, TaskEvictedError, TrustDecisionSelector, VisualLinePreview, asyncScope, chatEpoch, collectSecretsForMasking, combineUsage, computeBoxDimensions, createSourceInfo, createTypeScriptSourceSpecifierTransform, defaultModelPerProvider, defineTool, fetchWithRetry, fieldTone, flushable, formatSize, getErrnoCode, getFunctionList, getPiUserAgent, getSyntheticPathSource, getTextOutput, invalidArgText, isFlushable, isFunctionList, isJsonRpcRequest, isJsonRpcResponse, isStdoutTakenOver, isStop, isSyntheticPath, isTrustDecision, isValidThinkingLevel, linkPath, many, none, parseJsonRpcMessage, redactCredentials, redactOAuthErrorText, redactOAuthErrorTextCapped, redactWwwAuthenticateHeader, removedProviderMessage, renderBorderedBox, require_applyReviver, require_constants, require_debug, require_identifiers, require_identity, require_parse_options, require_parse_url, resolveDecisionDeadlineMs, resourceInternals, safeTrustChoiceIndex, scrubFetchError, scrubUnknownErrorData, setFunctionList, spanElapsedMs, spawnContainedProcess, str, styleFieldTone, toError, validateTimeoutOverride } from "./startup-0-0-
|
|
4
|
-
import { AgentRehydrateError, AgentReleaseConfigError, EMPTY_OUTPUT_TEXT, ExtensionInputComponent, ExtensionSelectorComponent, FirstTimeSetupComponent, LlamaClient, MULTI_SUBMIT_LABEL, MarkdownContentCache, NestedToolCallRunner, RESERVED_LABELS, SESSION_STORAGE_JOIN, SessionKeyDigests, SessionStorageSelectionSchema, SettingsSchema, StorageSelectionSchema, StringEnum as StringEnum$1, TransportEvents, WorkspaceConfigError, WrappingSelect, acceptsForkReplay, cancelReceiptStatus, chatAnswerIntent, chatNumberingFor, cleanupFailureSummary, computeFocusedOptionHasPreview, currentResourceAdmission, diffLines, discoverChatFile, errorMessage, flush, formatAnswerScalar, formatTokenSegment, genBridge, getBuiltinExtensionEntryLabel, getCommandEnv, getGitShellEnvironmentAsync, getLoaderAgentDirs, getVirtualModules, lifecycleScopeForOwner, llamaInferenceUrl, messageIsLlmVisible, next, normalizeLlamaServerUrl, normalizeMessageContent, normalizeModelFailureSignal, normalizeModelReference, normalizeProviderKeys, parseInteractiveEngineMessage, presentTaskError, readFileChatRecords, readInlineCaret, require_from_url, require_re, require_toJS, require_visit, resizeImageInProcess, resolveInlineDraftValue, runCallback, runSynchronousCallback, selectActivePreviewPaneIndex, selectActiveTabItems, selectConfirmedIndicator, sessionLifecycleCreation, stopIndex, streamCutDurationMs, tokenize, trackTranspileCacheWrite, trackWindowsDirectorySecurityWork, userLikeContentBlockIsLlmVisible, verifyWindowsDirectorySecurity, verifyWindowsDirectorySecurityAsync, waitResultTail, waitStatus, withInlineDraft, withTranspileCacheWriteOwner, withWindowsDirectorySecurityOwner } from "./startup-0-1-
|
|
2
|
+
import { APP_NAME, ENV_SESSION_DIR, VERSION, createChildProcessEnvironment, createModuleRequire, findHelperExecutable, findHelperExecutableAsync, getAgentDir, getBinDir, getProjectConfigDirs, isBunBinary, isBundledBuild, isPathWithin, loadOnDemand, markLifecycleTiming, normalizePath, processLaunch, processLaunchAsync, releaseRetainedWindowsProcessExitHandle, resolutionBaseUrl, resolvePath, resolveSafeWindowsKillCwdLexical, resolveSafeWindowsWorkingDirectoryAsync, retainWindowsProcessExitHandle, spawnLaunchedProcess, spawnLaunchedProcessSync, stripBom } from "./p0-cli-BB45ZQY6.js";
|
|
3
|
+
import { ActivityWatchdog, Diff, JSON_RPC_ERROR_CODES, MAX_TOOL_DETACHMENT_AFTER_MS, McpAbortError, McpConnectionClosedError, NON_SECRET_HTTP_HEADERS, ROW_INTENT_META, STARTUP_DECISION_TYPED_TEXT_NOTICE, TASK_MARKS, TaskCleanupAdmissionTimeoutError, TaskEvictedError, TrustDecisionSelector, VisualLinePreview, asyncScope, chatEpoch, collectSecretsForMasking, combineUsage, computeBoxDimensions, createSourceInfo, createTypeScriptSourceSpecifierTransform, defaultModelPerProvider, defineTool, fetchWithRetry, fieldTone, flushable, formatSize, getErrnoCode, getFunctionList, getPiUserAgent, getSyntheticPathSource, getTextOutput, holdProcessDescendants, holdProcessDescendantsResult, invalidArgText, isFlushable, isFunctionList, isJsonRpcRequest, isJsonRpcResponse, isStdoutTakenOver, isStop, isSyntheticPath, isTrustDecision, isValidThinkingLevel, linkPath, many, none, parseJsonRpcMessage, redactCredentials, redactOAuthErrorText, redactOAuthErrorTextCapped, redactWwwAuthenticateHeader, removedProviderMessage, renderBorderedBox, require_applyReviver, require_constants, require_debug, require_identifiers, require_identity, require_parse_options, require_parse_url, resolveDecisionDeadlineMs, resourceInternals, safeTrustChoiceIndex, scrubFetchError, scrubUnknownErrorData, setFunctionList, spanElapsedMs, spawnContainedProcess, str, styleFieldTone, toError, validateTimeoutOverride } from "./startup-0-0-TYUFUOJZ.js";
|
|
4
|
+
import { AgentRehydrateError, AgentReleaseConfigError, EMPTY_OUTPUT_TEXT, ExtensionInputComponent, ExtensionSelectorComponent, FirstTimeSetupComponent, LlamaClient, MULTI_SUBMIT_LABEL, MarkdownContentCache, NestedToolCallRunner, RESERVED_LABELS, SESSION_STORAGE_JOIN, SessionKeyDigests, SessionStorageSelectionSchema, SettingsSchema, StorageSelectionSchema, StringEnum as StringEnum$1, TransportEvents, WorkspaceConfigError, WrappingSelect, acceptsForkReplay, cancelReceiptStatus, chatAnswerIntent, chatNumberingFor, cleanupFailureSummary, computeFocusedOptionHasPreview, currentResourceAdmission, diffLines, discoverChatFile, errorMessage, flush, formatAnswerScalar, formatTokenSegment, genBridge, getBuiltinExtensionEntryLabel, getCommandEnv, getGitShellEnvironmentAsync, getLoaderAgentDirs, getVirtualModules, lifecycleScopeForOwner, llamaInferenceUrl, messageIsLlmVisible, next, normalizeLlamaServerUrl, normalizeMessageContent, normalizeModelFailureSignal, normalizeModelReference, normalizeProviderKeys, parseInteractiveEngineMessage, presentTaskError, readFileChatRecords, readInlineCaret, require_from_url, require_re, require_toJS, require_visit, resizeImageInProcess, resolveInlineDraftValue, runCallback, runSynchronousCallback, selectActivePreviewPaneIndex, selectActiveTabItems, selectConfirmedIndicator, sessionLifecycleCreation, stopIndex, streamCutDurationMs, tokenize, trackTranspileCacheWrite, trackWindowsDirectorySecurityWork, userLikeContentBlockIsLlmVisible, verifyWindowsDirectorySecurity, verifyWindowsDirectorySecurityAsync, waitResultTail, waitStatus, withInlineDraft, withTranspileCacheWriteOwner, withWindowsDirectorySecurityOwner } from "./startup-0-1-D4LGGINF.js";
|
|
5
5
|
import { KeybindingsManager as KeybindingsManager$1, clickableHintText, clickableKeyTextHint, detectTerminalThemeForAuto, graphemeAt, initTheme, keepStartupDialogDraft, parenthesizedKeyHint, setTheme, singleLineDisplayText, terminalDisplayCursor, terminalDisplayText, theme, withEarlyInputHeldForStartupDialog } from "./p2-shell-main-B2WIALFD.js";
|
|
6
6
|
import { stripJsonComments } from "./p1-shared-RG5I5LJ6.js";
|
|
7
|
-
import { findInCauseChain, guardLockRemoval, redactCredentialShapes, rehydrateErrorCause, releaseLock, releaseLockSync, renameReplacing, renameReplacingAsync, serializeErrorCause, waitForLock, waitForLockSync } from "./p1b-elig-
|
|
7
|
+
import { findInCauseChain, guardLockRemoval, nativeProcessCreationTime, nativeTerminateProcess, redactCredentialShapes, rehydrateErrorCause, releaseLock, releaseLockSync, renameReplacing, renameReplacingAsync, serializeErrorCause, waitForLock, waitForLockSync } from "./p1b-elig-ENCUPKKJ.js";
|
|
8
8
|
import { rehydrateDecisionError } from "./settings-startup-65YEWRV2.js";
|
|
9
9
|
import * as fs$1 from "node:fs/promises";
|
|
10
10
|
import { chmod, lstat, mkdir, mkdtemp, readFile, rm, stat } from "node:fs/promises";
|
|
@@ -24,20 +24,21 @@ import { Container, Input, ProcessTerminal, Spacer, Text, TuiMainScreen, decodeP
|
|
|
24
24
|
import { StorageConfigError, StoragePrefixError } from "../core/storage/errors.js";
|
|
25
25
|
import { validateStoragePrefix } from "../core/storage/prefix.js";
|
|
26
26
|
import { chmod as chmod$1, mkdir as mkdir$1, readFile as readFile$1, rm as rm$1, stat as stat$2, writeFile as writeFile$1 } from "fs/promises";
|
|
27
|
-
import { Compile } from "@bastani/atomic-ai/utils/typebox/compile";
|
|
28
|
-
import { Type as Type$1 } from "@bastani/atomic-ai/utils/typebox/index";
|
|
29
27
|
import { createHash } from "node:crypto";
|
|
30
28
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
31
29
|
import lockfile from "proper-lockfile";
|
|
32
30
|
import { stream, streamSimple } from "@bastani/atomic-ai/compat";
|
|
33
31
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
32
|
+
import { memoizeAsync } from "../utils/memoize-async.js";
|
|
34
33
|
import { runToolCall } from "@bastani/atomic-agent-core";
|
|
35
34
|
import { isProxy } from "node:util/types";
|
|
36
35
|
import { defaultSessionDatabasePathSteps, defaultSharedStoragePathSteps, runStorageSteps, runStorageStepsSync, storagePathBaseDirSteps, storageSettingsSteps } from "../core/storage/file-identity.js";
|
|
36
|
+
import { Type as Type$1 } from "@bastani/atomic-ai/utils/typebox/index";
|
|
37
37
|
import { llamaCppClassifyApi } from "@bastani/atomic-ai/api/llama-cpp-classify.lazy";
|
|
38
38
|
import { typesafeSystemOneApi } from "@bastani/atomic-ai/api/typesafe-system-one.lazy";
|
|
39
39
|
import { ModelCostSchema, ModelInputLimitsSchema, ModelInputModalitySchema, ModelPromptCacheSchema, ThinkingLevelMapSchema } from "@bastani/atomic-ai/providers/model-schema";
|
|
40
40
|
import { ProviderCompatSchema } from "@bastani/atomic-ai/providers/compat-schema";
|
|
41
|
+
import { Compile } from "@bastani/atomic-ai/utils/typebox/compile";
|
|
41
42
|
import { buildModelsDevChatModels, finalizeChatModels } from "@bastani/atomic-ai/utils/models-dev-catalog";
|
|
42
43
|
import { getProviderRetryAfterMs } from "@bastani/atomic-ai/utils/retry-hints";
|
|
43
44
|
import { anthropicAssistantReplayContent } from "@bastani/atomic-ai/api/anthropic-assistant-content";
|
|
@@ -226,6 +227,7 @@ function openStartupInput(settingsManager, title, hasUnfinishedInput, placeholde
|
|
|
226
227
|
});
|
|
227
228
|
}
|
|
228
229
|
// dist/utils/shell.js
|
|
230
|
+
const __atomicDistModuleUrl$3 = new URL("../utils/shell.js", import.meta.url).href;
|
|
229
231
|
function isLegacyWslBashPath(path) {
|
|
230
232
|
const normalized = win32$1.normalize(path).toLowerCase();
|
|
231
233
|
const systemRoot = process.env.SystemRoot;
|
|
@@ -287,14 +289,9 @@ function isReusableLookup(lookup) {
|
|
|
287
289
|
async function isReusableLookupAsync(lookup) {
|
|
288
290
|
return lookup.path === null ? Date.now() - lookup.checkedAt < MISSING_EXECUTABLE_RECHECK_MS : executableCandidateExistsAsync(lookup.path);
|
|
289
291
|
}
|
|
290
|
-
/** A lookup holds for one name and PATH: it reads only PATH's absolute directories. */
|
|
291
292
|
function lookupKey(executable) {
|
|
292
293
|
return `${executable}\0${process.env.PATH ?? ""}`;
|
|
293
294
|
}
|
|
294
|
-
/**
|
|
295
|
-
* Find an executable on PATH (cross-platform), memoized per PATH value.
|
|
296
|
-
* A missing executable is looked up again once its result is 30 seconds old.
|
|
297
|
-
*/
|
|
298
295
|
function findExecutableOnPath(executable) {
|
|
299
296
|
const key = lookupKey(executable);
|
|
300
297
|
const cached = executablePathLookups.get(key);
|
|
@@ -317,10 +314,6 @@ async function findExecutableOnPathAsync(executable) {
|
|
|
317
314
|
});
|
|
318
315
|
return path;
|
|
319
316
|
}
|
|
320
|
-
/**
|
|
321
|
-
* The shell's absolute path in PATH's absolute directories, never through Windows' search of the working directory or
|
|
322
|
-
* an empty or relative PATH entry: a shell found there would run whatever a project put in its place.
|
|
323
|
-
*/
|
|
324
317
|
const LOOKUP_OPTIONS = { exact: true };
|
|
325
318
|
function lookupExecutableOnPath(executable) {
|
|
326
319
|
return findHelperExecutable(executable, {
|
|
@@ -334,19 +327,9 @@ async function lookupExecutableOnPathAsync(executable) {
|
|
|
334
327
|
platform: process.platform
|
|
335
328
|
}) ?? null;
|
|
336
329
|
}
|
|
337
|
-
/** A configured shell given by name alone is looked up as any shell is; a path is taken as written. */
|
|
338
330
|
function isShellName(shellPath) {
|
|
339
331
|
return !/[\\/]/.test(shellPath) && !(process.platform === "win32" && shellPath.includes(":"));
|
|
340
332
|
}
|
|
341
|
-
/**
|
|
342
|
-
* Resolve shell configuration based on platform and an optional explicit shell path.
|
|
343
|
-
* Resolution order:
|
|
344
|
-
* 1. User-specified shellPath
|
|
345
|
-
* 2. On Windows: Git Bash in known locations, then bash on PATH
|
|
346
|
-
* 3. On Unix: /bin/bash, then bash on PATH, then fallback to sh
|
|
347
|
-
* A shell on PATH comes only from its absolute directories, never from Windows' search of the working directory or an
|
|
348
|
-
* empty or relative PATH entry.
|
|
349
|
-
*/
|
|
350
333
|
function getShellConfig(customShellPath) {
|
|
351
334
|
if (customShellPath) {
|
|
352
335
|
const shell = isShellName(customShellPath) ? findExecutableOnPath(customShellPath) : customShellPath;
|
|
@@ -360,14 +343,15 @@ function getShellConfig(customShellPath) {
|
|
|
360
343
|
const programFilesX86 = process.env["ProgramFiles(x86)"];
|
|
361
344
|
if (programFilesX86) paths.push(`${programFilesX86}\\Git\\bin\\bash.exe`);
|
|
362
345
|
for (const path of paths) if (executableCandidateExists(path)) return getBashShellConfig(path);
|
|
363
|
-
const
|
|
364
|
-
if (
|
|
346
|
+
const bashOnPath2 = findExecutableOnPath("bash.exe");
|
|
347
|
+
if (bashOnPath2) return getBashShellConfig(bashOnPath2);
|
|
365
348
|
throw new Error(`No bash shell found. Options:
|
|
366
349
|
1. Install Git for Windows: https://git-scm.com/download/win
|
|
367
350
|
2. Add your bash to PATH (Cygwin, MSYS2, etc.)
|
|
368
351
|
3. Set shellPath in settings.json
|
|
369
352
|
|
|
370
|
-
Searched Git Bash in
|
|
353
|
+
Searched Git Bash in:
|
|
354
|
+
${paths.map((p) => ` ${p}`).join("\n")}`);
|
|
371
355
|
}
|
|
372
356
|
if (executableCandidateExists("/bin/bash")) return getBashShellConfig("/bin/bash");
|
|
373
357
|
const bashOnPath = findExecutableOnPath("bash");
|
|
@@ -390,14 +374,15 @@ async function getShellConfigAsync(customShellPath) {
|
|
|
390
374
|
const programFilesX86 = process.env["ProgramFiles(x86)"];
|
|
391
375
|
if (programFilesX86) paths.push(`${programFilesX86}\\Git\\bin\\bash.exe`);
|
|
392
376
|
for (const path of paths) if (await executableCandidateExistsAsync(path)) return getBashShellConfig(path);
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
377
|
+
const bashOnPath2 = await findExecutableOnPathAsync("bash.exe");
|
|
378
|
+
if (bashOnPath2) return getBashShellConfig(bashOnPath2);
|
|
395
379
|
throw new Error(`No bash shell found. Options:
|
|
396
380
|
1. Install Git for Windows: https://git-scm.com/download/win
|
|
397
381
|
2. Add your bash to PATH (Cygwin, MSYS2, etc.)
|
|
398
382
|
3. Set shellPath in settings.json
|
|
399
383
|
|
|
400
|
-
Searched Git Bash in
|
|
384
|
+
Searched Git Bash in:
|
|
385
|
+
${paths.map((p) => ` ${p}`).join("\n")}`);
|
|
401
386
|
}
|
|
402
387
|
if (await executableCandidateExistsAsync("/bin/bash")) return getBashShellConfig("/bin/bash");
|
|
403
388
|
const bashOnPath = await findExecutableOnPathAsync("bash");
|
|
@@ -490,37 +475,186 @@ const PARENT_GUARDIAN_SOURCE = `
|
|
|
490
475
|
${EVAL_WORKER_BUILTIN}
|
|
491
476
|
const { parentPort, workerData } = builtin("node:worker_threads");
|
|
492
477
|
const { spawn } = builtin("node:child_process");
|
|
493
|
-
const { existsSync } = builtin("node:fs");
|
|
494
|
-
const {
|
|
478
|
+
const { existsSync, lstatSync, realpathSync, statSync } = builtin("node:fs");
|
|
479
|
+
const { tmpdir } = builtin("node:os");
|
|
480
|
+
const { join, win32 } = builtin("node:path");
|
|
495
481
|
const tracked = new Map();
|
|
496
|
-
parentPort.on("message", ({ action, pid }) => {
|
|
497
|
-
if (action === "track") tracked.set(pid, false);
|
|
498
|
-
else if (action === "exited") {
|
|
482
|
+
parentPort.on("message", ({ action, pid, created }) => {
|
|
483
|
+
if (action === "track") tracked.set(pid, { exited: false, created });
|
|
484
|
+
else if (action === "exited") { const e = tracked.get(pid); if (e) e.exited = true; }
|
|
499
485
|
else tracked.delete(pid);
|
|
500
486
|
});
|
|
501
|
-
|
|
487
|
+
let nativeAddon;
|
|
488
|
+
function loadNative() {
|
|
489
|
+
if (nativeAddon !== undefined) return nativeAddon;
|
|
490
|
+
if (!workerData.nativeWindowsHost || !workerData.resolutionBase) { nativeAddon = null; return null; }
|
|
491
|
+
try {
|
|
492
|
+
const { createRequire } = builtin("node:module");
|
|
493
|
+
nativeAddon = createRequire(workerData.resolutionBase)("@bastani/atomic-natives") || null;
|
|
494
|
+
} catch {
|
|
495
|
+
nativeAddon = null;
|
|
496
|
+
}
|
|
497
|
+
return nativeAddon;
|
|
498
|
+
}
|
|
499
|
+
function normalizeWinPath(v) {
|
|
500
|
+
if (!v || v.includes("\\0")) return undefined;
|
|
501
|
+
const s = v.replaceAll("/", "\\\\");
|
|
502
|
+
const isDrive = (p) => p.length >= 3 && ((p.charCodeAt(0) >= 65 && p.charCodeAt(0) <= 90) || (p.charCodeAt(0) >= 97 && p.charCodeAt(0) <= 122)) && p[1] === ":" && p[2] === "\\\\";
|
|
503
|
+
if (s.startsWith("\\\\\\\\?\\\\") || s.startsWith("\\\\\\\\.\\\\")) {
|
|
504
|
+
const r = s.slice(4);
|
|
505
|
+
if (r.length >= 4 && r.slice(0, 4).toLowerCase() === "unc\\\\") return normalizeWinPath("\\\\\\\\" + r.slice(4));
|
|
506
|
+
return isDrive(r) ? win32.resolve(r) : undefined;
|
|
507
|
+
}
|
|
508
|
+
if (s.startsWith("\\\\\\\\")) {
|
|
509
|
+
const r = s.slice(2);
|
|
510
|
+
const i = r.indexOf("\\\\");
|
|
511
|
+
if (i <= 0) return undefined;
|
|
512
|
+
const srv = r.slice(0, i);
|
|
513
|
+
const rest = r.slice(i + 1);
|
|
514
|
+
const j = rest.indexOf("\\\\");
|
|
515
|
+
const shr = j === -1 ? rest : rest.slice(0, j);
|
|
516
|
+
if (srv === "." || srv === ".." || !shr || shr === "." || shr === "..") return undefined;
|
|
517
|
+
return win32.resolve(s);
|
|
518
|
+
}
|
|
519
|
+
return isDrive(s) ? win32.resolve(s) : undefined;
|
|
520
|
+
}
|
|
521
|
+
function winRoot(p) {
|
|
522
|
+
const n = normalizeWinPath(p);
|
|
523
|
+
if (!n) return undefined;
|
|
524
|
+
const r = win32.parse(n).root;
|
|
525
|
+
return r.length > 1 ? (r.endsWith("\\\\") ? r : r + "\\\\") : undefined;
|
|
526
|
+
}
|
|
527
|
+
function tryReal(p) {
|
|
528
|
+
try {
|
|
529
|
+
const fn = typeof realpathSync.native === "function" ? realpathSync.native : realpathSync;
|
|
530
|
+
return normalizeWinPath(fn(p));
|
|
531
|
+
} catch {
|
|
532
|
+
try { return normalizeWinPath(realpathSync(p)); } catch { return undefined; }
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function isInsideDir(f, c) {
|
|
536
|
+
const rel = win32.relative(f.toLowerCase(), c.toLowerCase());
|
|
537
|
+
return rel !== ".." && !rel.startsWith("..\\\\") && !win32.isAbsolute(rel);
|
|
538
|
+
}
|
|
539
|
+
function toSpawnWinPath(p) {
|
|
540
|
+
if (p.startsWith("\\\\\\\\?\\\\") || p.length < 248) return p;
|
|
541
|
+
return p.startsWith("\\\\\\\\") ? "\\\\\\\\?\\\\UNC\\\\" + p.slice(2) : "\\\\\\\\?\\\\" + p;
|
|
542
|
+
}
|
|
543
|
+
function safeKillCwd(commandPath) {
|
|
544
|
+
let cwdRaw;
|
|
545
|
+
try { cwdRaw = process.cwd(); } catch {}
|
|
546
|
+
const cwdLex = cwdRaw ? normalizeWinPath(cwdRaw) : undefined;
|
|
547
|
+
const cwdProbe = cwdRaw && cwdLex ? (cwdRaw.length >= 248 && !cwdRaw.startsWith("\\\\\\\\?\\\\") ? toSpawnWinPath(cwdLex) : cwdRaw) : undefined;
|
|
548
|
+
const cwdReal = cwdProbe ? tryReal(cwdProbe) : undefined;
|
|
549
|
+
const temp = tmpdir();
|
|
550
|
+
const cmdNorm = commandPath ? normalizeWinPath(commandPath) : undefined;
|
|
551
|
+
const cmdDir = cmdNorm ? win32.dirname(cmdNorm) : undefined;
|
|
552
|
+
const cands = [process.env.SystemRoot, process.env.windir, "C:\\\\Windows", cmdDir, temp, winRoot(commandPath), winRoot(temp), winRoot(cwdReal), winRoot(cwdLex), "C:\\\\"];
|
|
553
|
+
let longOut;
|
|
554
|
+
let shortFb;
|
|
555
|
+
let anyFb;
|
|
556
|
+
for (const raw of cands) {
|
|
557
|
+
const lex = raw ? normalizeWinPath(raw) : undefined;
|
|
558
|
+
if (!lex) continue;
|
|
559
|
+
const probe = raw.length >= 248 && !raw.startsWith("\\\\\\\\?\\\\") ? toSpawnWinPath(lex) : raw;
|
|
560
|
+
try { if (!statSync(probe).isDirectory()) continue; } catch { continue; }
|
|
561
|
+
const real = tryReal(probe);
|
|
562
|
+
let unverified = false;
|
|
563
|
+
if (!real) { try { unverified = lstatSync(probe).isSymbolicLink(); } catch {} }
|
|
564
|
+
const chosen = toSpawnWinPath(real || lex);
|
|
565
|
+
const isShort = !chosen.startsWith("\\\\\\\\?\\\\") && chosen.length < 248;
|
|
566
|
+
let blocked = unverified;
|
|
567
|
+
if (!blocked && cwdLex) {
|
|
568
|
+
const f = cwdReal || cwdLex;
|
|
569
|
+
const c = real || lex;
|
|
570
|
+
const fRoot = winRoot(f);
|
|
571
|
+
const isRealRoot = fRoot && f.toLowerCase() === fRoot.toLowerCase();
|
|
572
|
+
blocked = isRealRoot ? f.toLowerCase() === c.toLowerCase() : (isInsideDir(f, c) || (!winRoot(cwdLex) || cwdLex.toLowerCase() !== winRoot(cwdLex).toLowerCase()) && isInsideDir(cwdLex, lex));
|
|
573
|
+
}
|
|
574
|
+
if (!blocked) {
|
|
575
|
+
if (isShort) return chosen;
|
|
576
|
+
if (!longOut) longOut = chosen;
|
|
577
|
+
continue;
|
|
578
|
+
}
|
|
579
|
+
if (isShort && !shortFb) shortFb = chosen;
|
|
580
|
+
if (!anyFb) anyFb = chosen;
|
|
581
|
+
}
|
|
582
|
+
return longOut || shortFb || anyFb;
|
|
583
|
+
}
|
|
584
|
+
function exitHost() {
|
|
585
|
+
// Inside a worker thread, process.exit(1) only exits the worker; SIGKILL on our own PID terminates the host process.
|
|
586
|
+
try { process.kill(process.pid, "SIGKILL"); } catch {}
|
|
587
|
+
process.exit(1);
|
|
588
|
+
}
|
|
589
|
+
function fallbackTaskkillSelf() {
|
|
590
|
+
// Same System32 hardening as killProcessTree: PATH is not trusted here, and an
|
|
591
|
+
// unconsumed async "error" from a failed spawn would take the guardian thread
|
|
592
|
+
// down and leak every detached child it exists to reap.
|
|
593
|
+
try {
|
|
594
|
+
// In a verified directory outside the project: a kill never keeps the folder Atomic ran in in use.
|
|
595
|
+
const systemRoot = process.env.SystemRoot || process.env.windir || "C:\\\\Windows";
|
|
596
|
+
const taskkillPath = join(systemRoot, "System32", "taskkill.exe");
|
|
597
|
+
const cwd = safeKillCwd(taskkillPath);
|
|
598
|
+
const child = spawn(taskkillPath, ["/F", "/T", "/PID", String(process.pid)], { ...(cwd === undefined ? {} : { cwd }), stdio: "ignore", detached: true, windowsHide: true, env: { ...process.env, AI_AGENT: workerData.aiAgent } });
|
|
599
|
+
child.once("error", exitHost);
|
|
600
|
+
child.once("exit", exitHost);
|
|
601
|
+
return;
|
|
602
|
+
} catch {}
|
|
603
|
+
exitHost();
|
|
604
|
+
}
|
|
605
|
+
function killTracked(pid, entry, native) {
|
|
502
606
|
if (process.platform === "win32") {
|
|
503
|
-
if (exited) return;
|
|
504
|
-
//
|
|
505
|
-
//
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
const systemRoot = process.env.SystemRoot || "C:\\\\Windows";
|
|
510
|
-
const child = spawn(join(systemRoot, "System32", "taskkill.exe"), ["/F", "/T", "/PID", String(pid)], { cwd: systemRoot, stdio: "ignore", detached: true, windowsHide: true, env: { ...process.env, AI_AGENT: workerData.aiAgent } });
|
|
511
|
-
child.once("error", () => {});
|
|
512
|
-
} catch {}
|
|
607
|
+
if (entry.exited) return;
|
|
608
|
+
// Only terminate a tracked Windows child when its creation time was captured and verified atomically
|
|
609
|
+
// on the opened handle; never kill an unverified bare PID that may have been reused.
|
|
610
|
+
if (native && typeof native.terminateProcessCreatedAt === "function" && typeof entry.created === "string") {
|
|
611
|
+
try { native.terminateProcessCreatedAt(pid, entry.created, true); } catch {}
|
|
612
|
+
}
|
|
513
613
|
return;
|
|
514
614
|
}
|
|
515
615
|
try { process.kill(-pid, "SIGKILL"); }
|
|
516
|
-
catch { if (!exited) { try { process.kill(pid, "SIGKILL"); } catch {} } }
|
|
616
|
+
catch { if (!entry.exited) { try { process.kill(pid, "SIGKILL"); } catch {} } }
|
|
617
|
+
}
|
|
618
|
+
function killSelf(native) {
|
|
619
|
+
if (process.platform === "win32") {
|
|
620
|
+
if (native && typeof native.holdProcessDescendants === "function") {
|
|
621
|
+
let held;
|
|
622
|
+
try { held = native.holdProcessDescendants(process.pid); } catch {}
|
|
623
|
+
// Only take the native path when endDescendants() is available so verified descendants end BEFORE self;
|
|
624
|
+
// older native binaries lacking endDescendants() would terminate self first in endAll().
|
|
625
|
+
if (held && typeof held.endDescendants === "function") {
|
|
626
|
+
try {
|
|
627
|
+
held.endDescendants();
|
|
628
|
+
held.endAll();
|
|
629
|
+
} catch {}
|
|
630
|
+
exitHost();
|
|
631
|
+
}
|
|
632
|
+
if (held) {
|
|
633
|
+
try { held.release(); } catch {}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
fallbackTaskkillSelf();
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
try { process.kill(-process.pid, "SIGKILL"); }
|
|
640
|
+
catch { try { process.kill(process.pid, "SIGKILL"); } catch {} }
|
|
641
|
+
}
|
|
642
|
+
function isParentAlive(native) {
|
|
643
|
+
if (process.platform === "win32" && native && typeof native.processCreationTime === "function") {
|
|
644
|
+
if (workerData.parentCreated === null) return false;
|
|
645
|
+
if (typeof workerData.parentCreated === "string") {
|
|
646
|
+
try { return native.processCreationTime(workerData.parentPid) === workerData.parentCreated; } catch { return false; }
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
try { process.kill(workerData.parentPid, 0); return true; } catch { return false; }
|
|
517
650
|
}
|
|
518
651
|
const timer = setInterval(() => {
|
|
519
|
-
|
|
520
|
-
|
|
652
|
+
const native = process.platform === "win32" ? loadNative() : null;
|
|
653
|
+
const parentAlive = isParentAlive(native);
|
|
521
654
|
if (parentAlive && (!workerData.stopFile || !existsSync(workerData.stopFile))) return;
|
|
522
|
-
|
|
523
|
-
|
|
655
|
+
clearInterval(timer);
|
|
656
|
+
for (const [pid, entry] of tracked) killTracked(pid, entry, native);
|
|
657
|
+
killSelf(native);
|
|
524
658
|
}, 50);
|
|
525
659
|
timer.unref?.();
|
|
526
660
|
`;
|
|
@@ -531,17 +665,21 @@ function startParentProcessGuardian(parentPid, stopFile) {
|
|
|
531
665
|
execArgv: evalWorkerExecArgv(),
|
|
532
666
|
workerData: {
|
|
533
667
|
parentPid,
|
|
668
|
+
parentCreated: captureWindowsCreationTime(parentPid),
|
|
534
669
|
stopFile,
|
|
535
|
-
aiAgent: createChildProcessEnvironment().AI_AGENT
|
|
670
|
+
aiAgent: createChildProcessEnvironment().AI_AGENT,
|
|
671
|
+
resolutionBase: resolutionBaseUrl(__atomicDistModuleUrl$3),
|
|
672
|
+
nativeWindowsHost: process.platform === "win32"
|
|
536
673
|
}
|
|
537
674
|
});
|
|
538
675
|
detachedChildGuardian = guardian;
|
|
539
|
-
for (const [pid,
|
|
676
|
+
for (const [pid, entry] of trackedDetachedChildPids) {
|
|
540
677
|
guardian.postMessage({
|
|
541
678
|
action: "track",
|
|
542
|
-
pid
|
|
679
|
+
pid,
|
|
680
|
+
created: entry.created
|
|
543
681
|
});
|
|
544
|
-
if (exited) guardian.postMessage({
|
|
682
|
+
if (entry.exited) guardian.postMessage({
|
|
545
683
|
action: "exited",
|
|
546
684
|
pid
|
|
547
685
|
});
|
|
@@ -553,21 +691,47 @@ function startParentProcessGuardian(parentPid, stopFile) {
|
|
|
553
691
|
await guardian.terminate();
|
|
554
692
|
};
|
|
555
693
|
}
|
|
556
|
-
/**
|
|
557
|
-
* Detached child processes must be tracked so they can be killed on parent
|
|
558
|
-
* shutdown signals (SIGHUP/SIGTERM).
|
|
559
|
-
*/
|
|
560
694
|
const trackedDetachedChildPids = /* @__PURE__ */ new Map();
|
|
695
|
+
function captureWindowsCreationTime(pid) {
|
|
696
|
+
if (process.platform !== "win32") return void 0;
|
|
697
|
+
return nativeProcessCreationTime?.(pid);
|
|
698
|
+
}
|
|
561
699
|
function trackDetachedChildPid(pid) {
|
|
562
|
-
|
|
700
|
+
const created = captureWindowsCreationTime(pid);
|
|
701
|
+
trackedDetachedChildPids.set(pid, {
|
|
702
|
+
exited: false,
|
|
703
|
+
created
|
|
704
|
+
});
|
|
705
|
+
detachedChildGuardian?.postMessage({
|
|
706
|
+
action: "track",
|
|
707
|
+
pid,
|
|
708
|
+
created
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
function trackDetachedChildProcess(child) {
|
|
712
|
+
const pid = child.pid;
|
|
713
|
+
if (pid === void 0) return;
|
|
714
|
+
const exited = child.exitCode !== null || child.signalCode !== null;
|
|
715
|
+
const created = exited ? null : captureWindowsCreationTime(pid);
|
|
716
|
+
trackedDetachedChildPids.set(pid, {
|
|
717
|
+
exited,
|
|
718
|
+
child,
|
|
719
|
+
created
|
|
720
|
+
});
|
|
563
721
|
detachedChildGuardian?.postMessage({
|
|
564
722
|
action: "track",
|
|
723
|
+
pid,
|
|
724
|
+
created
|
|
725
|
+
});
|
|
726
|
+
if (exited) detachedChildGuardian?.postMessage({
|
|
727
|
+
action: "exited",
|
|
565
728
|
pid
|
|
566
729
|
});
|
|
567
730
|
}
|
|
568
731
|
function markDetachedChildExited(pid) {
|
|
569
|
-
|
|
570
|
-
|
|
732
|
+
const entry = trackedDetachedChildPids.get(pid);
|
|
733
|
+
if (entry === void 0) return;
|
|
734
|
+
entry.exited = true;
|
|
571
735
|
detachedChildGuardian?.postMessage({
|
|
572
736
|
action: "exited",
|
|
573
737
|
pid
|
|
@@ -580,18 +744,7 @@ function untrackDetachedChildPid(pid) {
|
|
|
580
744
|
pid
|
|
581
745
|
});
|
|
582
746
|
}
|
|
583
|
-
/** Ends the tree of a running shell that {@link spawnShellProcess} started in a job of its own. */
|
|
584
747
|
const runningShellTrees = /* @__PURE__ */ new Set();
|
|
585
|
-
/**
|
|
586
|
-
* Starts `shell` with `args` for the bash or PowerShell tool run without a task owner, with output piped and input
|
|
587
|
-
* `stdin`. On Windows, with the native module and a full shell path, the shell starts suspended in a job of its own:
|
|
588
|
-
* {@link ShellProcess.stop} ends, while the shell runs, it and the processes below it, and then every process in the
|
|
589
|
-
* job, also those left running after the shell exited and those whose starter exited, never one by a process ID
|
|
590
|
-
* another process may have been given. A program that asks to leave the job (as Git Bash's do) leaves it, and a stop
|
|
591
|
-
* ends it only while it is below the running shell, as `taskkill /T` did. {@link ShellProcess.finish} lets go of the
|
|
592
|
-
* job, so what the command left running outlives Atomic. Otherwise it is `child_process.spawn` (detached on POSIX),
|
|
593
|
-
* stopped with {@link killProcessTree}.
|
|
594
|
-
*/
|
|
595
748
|
async function spawnShellProcess(shell, args, options) {
|
|
596
749
|
const stdio = [
|
|
597
750
|
options.stdin,
|
|
@@ -624,30 +777,44 @@ async function spawnShellProcess(shell, args, options) {
|
|
|
624
777
|
stdio: [...stdio],
|
|
625
778
|
windowsHide: true
|
|
626
779
|
});
|
|
780
|
+
retainWindowsProcessExitHandle(child);
|
|
627
781
|
const pid = child.pid;
|
|
628
|
-
|
|
782
|
+
let exited = false;
|
|
783
|
+
child.once("exit", () => {
|
|
784
|
+
exited = true;
|
|
785
|
+
if (pid !== void 0) markDetachedChildExited(pid);
|
|
786
|
+
});
|
|
787
|
+
if (pid !== void 0) trackDetachedChildProcess(child);
|
|
629
788
|
return {
|
|
630
789
|
child,
|
|
631
790
|
stop: () => {
|
|
632
|
-
|
|
791
|
+
killChildProcessTree(child, exited);
|
|
633
792
|
},
|
|
634
793
|
finish: () => {
|
|
635
|
-
|
|
794
|
+
releaseRetainedWindowsProcessExitHandle(child);
|
|
795
|
+
if (pid !== void 0) untrackDetachedChildPid(pid);
|
|
636
796
|
}
|
|
637
797
|
};
|
|
638
798
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
799
|
+
function holdDescendantsStatus(pid) {
|
|
800
|
+
if (holdProcessDescendantsResult !== void 0) return holdProcessDescendantsResult(pid);
|
|
801
|
+
const held = holdProcessDescendants?.(pid);
|
|
802
|
+
return held === void 0 ? { kind: "unavailable" } : {
|
|
803
|
+
kind: "held",
|
|
804
|
+
held
|
|
805
|
+
};
|
|
806
|
+
}
|
|
644
807
|
function killTrackedDetachedChildren(spare) {
|
|
645
808
|
for (const endTree of runningShellTrees) endTree();
|
|
646
809
|
runningShellTrees.clear();
|
|
647
|
-
for (const [pid,
|
|
810
|
+
for (const [pid, entry] of trackedDetachedChildPids) {
|
|
648
811
|
if (spare?.has(pid)) continue;
|
|
649
|
-
if (
|
|
650
|
-
else if (
|
|
812
|
+
if (entry.child !== void 0) killChildProcessTree(entry.child, entry.exited);
|
|
813
|
+
else if (!entry.exited) {
|
|
814
|
+
if (process.platform === "win32") {
|
|
815
|
+
if (typeof entry.created === "string") nativeTerminateProcess?.(pid, entry.created, true);
|
|
816
|
+
} else killProcessTree(pid);
|
|
817
|
+
} else if (process.platform !== "win32") try {
|
|
651
818
|
process.kill(-pid, "SIGKILL");
|
|
652
819
|
} catch {}
|
|
653
820
|
detachedChildGuardian?.postMessage({
|
|
@@ -657,14 +824,6 @@ function killTrackedDetachedChildren(spare) {
|
|
|
657
824
|
trackedDetachedChildPids.delete(pid);
|
|
658
825
|
}
|
|
659
826
|
}
|
|
660
|
-
/**
|
|
661
|
-
* Stops `child` and its descendants when no Job object contains them; `exited` says whether its exit was reported.
|
|
662
|
-
* Once it was, the root's pid may already name another process: on POSIX only its process group, which lives on only
|
|
663
|
-
* while its descendants do, is signalled, and on Windows nothing is killed by pid. While the root runs, its tree is
|
|
664
|
-
* killed and then the root itself through its handle, which on Windows also ends a root that taskkill could not.
|
|
665
|
-
* A child that never started (no pid) has nothing to kill: Node reports its failure as an `error` event, and on
|
|
666
|
-
* Windows its `kill()` throws.
|
|
667
|
-
*/
|
|
668
827
|
function killChildProcessTree(child, exited) {
|
|
669
828
|
const pid = child.pid;
|
|
670
829
|
if (pid === void 0) return;
|
|
@@ -673,10 +832,25 @@ function killChildProcessTree(child, exited) {
|
|
|
673
832
|
return;
|
|
674
833
|
}
|
|
675
834
|
if (process.platform === "win32") {
|
|
676
|
-
if (exited) return;
|
|
835
|
+
if (exited || child.exitCode !== null || child.signalCode !== null) return;
|
|
836
|
+
const hold = holdDescendantsStatus(pid);
|
|
837
|
+
if (hold.kind === "held") {
|
|
838
|
+
if (!hold.held.endAll() && child.exitCode === null && child.signalCode === null) try {
|
|
839
|
+
child.kill("SIGKILL");
|
|
840
|
+
} catch {}
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
if (hold.kind === "absent") {
|
|
844
|
+
if (child.exitCode === null && child.signalCode === null) try {
|
|
845
|
+
child.kill("SIGKILL");
|
|
846
|
+
} catch {}
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
677
849
|
taskkillTree(pid, () => {
|
|
678
|
-
if (child.exitCode === null && child.signalCode === null)
|
|
679
|
-
|
|
850
|
+
if (child.exitCode === null && child.signalCode === null) try {
|
|
851
|
+
child.kill("SIGKILL");
|
|
852
|
+
} catch {}
|
|
853
|
+
}, () => child.exitCode === null && child.signalCode === null);
|
|
680
854
|
return;
|
|
681
855
|
}
|
|
682
856
|
if (exited) {
|
|
@@ -688,39 +862,72 @@ function killChildProcessTree(child, exited) {
|
|
|
688
862
|
killProcessTree(pid);
|
|
689
863
|
child.kill("SIGKILL");
|
|
690
864
|
}
|
|
691
|
-
function taskkillTree(pid, settled) {
|
|
692
|
-
const systemRoot = process.env.SystemRoot || "C:\\Windows";
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
String(pid)
|
|
699
|
-
], {
|
|
700
|
-
cwd: systemRoot,
|
|
701
|
-
stdio: "ignore",
|
|
702
|
-
detached: true,
|
|
703
|
-
windowsHide: true,
|
|
704
|
-
env: createChildProcessEnvironment()
|
|
705
|
-
});
|
|
706
|
-
let done = false;
|
|
707
|
-
const finish = () => {
|
|
708
|
-
if (done) return;
|
|
709
|
-
done = true;
|
|
710
|
-
settled?.();
|
|
711
|
-
};
|
|
712
|
-
child.once("error", finish);
|
|
713
|
-
child.once("exit", finish);
|
|
714
|
-
} catch {
|
|
865
|
+
function taskkillTree(pid, settled, shouldProceed) {
|
|
866
|
+
const systemRoot = process.env.SystemRoot || process.env.windir || "C:\\Windows";
|
|
867
|
+
const taskkillPath = join$1(systemRoot, "System32", "taskkill.exe");
|
|
868
|
+
let done = false;
|
|
869
|
+
const finish = () => {
|
|
870
|
+
if (done) return;
|
|
871
|
+
done = true;
|
|
715
872
|
settled?.();
|
|
716
|
-
}
|
|
873
|
+
};
|
|
874
|
+
const attempt = (cwd, allowRetry) => {
|
|
875
|
+
if (shouldProceed !== void 0 && !shouldProceed()) {
|
|
876
|
+
finish();
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
try {
|
|
880
|
+
const child = spawn(taskkillPath, [
|
|
881
|
+
"/F",
|
|
882
|
+
"/T",
|
|
883
|
+
"/PID",
|
|
884
|
+
String(pid)
|
|
885
|
+
], {
|
|
886
|
+
...cwd === void 0 ? {} : { cwd },
|
|
887
|
+
stdio: "ignore",
|
|
888
|
+
detached: true,
|
|
889
|
+
windowsHide: true,
|
|
890
|
+
env: createChildProcessEnvironment()
|
|
891
|
+
});
|
|
892
|
+
child.once("error", (error) => {
|
|
893
|
+
if (allowRetry && error.code === "ENOENT") {
|
|
894
|
+
resolveSafeWindowsWorkingDirectoryAsync({
|
|
895
|
+
commandPath: taskkillPath,
|
|
896
|
+
preferCommandDir: true,
|
|
897
|
+
timeoutMs: 100
|
|
898
|
+
}).then((freshCwd) => {
|
|
899
|
+
if (done) return;
|
|
900
|
+
if (shouldProceed !== void 0 && !shouldProceed()) {
|
|
901
|
+
finish();
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
if (freshCwd !== void 0 && freshCwd.toLowerCase() !== (cwd ?? "").toLowerCase()) {
|
|
905
|
+
attempt(freshCwd, false);
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
finish();
|
|
909
|
+
}).catch(() => finish());
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
finish();
|
|
913
|
+
});
|
|
914
|
+
child.once("exit", finish);
|
|
915
|
+
} catch {
|
|
916
|
+
finish();
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
attempt(resolveSafeWindowsKillCwdLexical({ commandPath: taskkillPath }), true);
|
|
717
920
|
}
|
|
718
|
-
/**
|
|
719
|
-
* Kill a process and all its children (cross-platform)
|
|
720
|
-
*/
|
|
721
921
|
function killProcessTree(pid) {
|
|
722
|
-
if (process.platform === "win32")
|
|
723
|
-
|
|
922
|
+
if (process.platform === "win32") {
|
|
923
|
+
const hold = holdDescendantsStatus(pid);
|
|
924
|
+
if (hold.kind === "held") {
|
|
925
|
+
hold.held.endAll();
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
if (hold.kind === "absent") return;
|
|
929
|
+
taskkillTree(pid);
|
|
930
|
+
} else {
|
|
724
931
|
if (process.platform === "darwin") try {
|
|
725
932
|
process.kill(-pid, "SIGSTOP");
|
|
726
933
|
} catch {}
|
|
@@ -2177,6 +2384,26 @@ function taskTranscriptSource(task) {
|
|
|
2177
2384
|
};
|
|
2178
2385
|
}
|
|
2179
2386
|
const NO_STATUSES = /* @__PURE__ */ new Map();
|
|
2387
|
+
const transcriptBindListeners = /* @__PURE__ */ new WeakMap();
|
|
2388
|
+
function watchTaskTranscriptBindings(supervisor, listener) {
|
|
2389
|
+
if (supervisor == null || typeof supervisor !== "object") return () => {};
|
|
2390
|
+
let listeners = transcriptBindListeners.get(supervisor);
|
|
2391
|
+
if (listeners === void 0) {
|
|
2392
|
+
listeners = /* @__PURE__ */ new Set();
|
|
2393
|
+
transcriptBindListeners.set(supervisor, listeners);
|
|
2394
|
+
}
|
|
2395
|
+
listeners.add(listener);
|
|
2396
|
+
return () => {
|
|
2397
|
+
listeners.delete(listener);
|
|
2398
|
+
};
|
|
2399
|
+
}
|
|
2400
|
+
function notifyTranscriptBindListeners(supervisor, taskId) {
|
|
2401
|
+
const listeners = transcriptBindListeners.get(supervisor);
|
|
2402
|
+
if (listeners === void 0 || listeners.size === 0) return;
|
|
2403
|
+
for (const listener of [...listeners]) try {
|
|
2404
|
+
listener(taskId);
|
|
2405
|
+
} catch {}
|
|
2406
|
+
}
|
|
2180
2407
|
function taskExtensionStatuses(task) {
|
|
2181
2408
|
return environment.tasks.get(task)?.statuses ?? NO_STATUSES;
|
|
2182
2409
|
}
|
|
@@ -3395,6 +3622,7 @@ var TaskSupervisor = class {
|
|
|
3395
3622
|
bindTranscript: (session) => {
|
|
3396
3623
|
taskState.inherited ??= { throughId: session.getEntries().at(-1)?.id ?? null };
|
|
3397
3624
|
taskState.transcript = session;
|
|
3625
|
+
notifyTranscriptBindListeners(this, id);
|
|
3398
3626
|
},
|
|
3399
3627
|
reportActivity: (report) => mapped(this.#native.reportTaskActivity(runner.value, report), reportReceipt, reportErrors),
|
|
3400
3628
|
setExtensionStatus: (statusKey, text) => setTaskStatus(taskState, statusKey, text),
|
|
@@ -3739,14 +3967,23 @@ var TaskSupervisor = class {
|
|
|
3739
3967
|
* session entries. Only lax message entries whose content is null are cloned.
|
|
3740
3968
|
*/
|
|
3741
3969
|
function normalizeDerivedSessionEntries(entries) {
|
|
3742
|
-
|
|
3743
|
-
|
|
3970
|
+
let normalized;
|
|
3971
|
+
for (let i = 0; i < entries.length; i++) {
|
|
3972
|
+
const entry = entries[i];
|
|
3973
|
+
if (entry.type !== "message") {
|
|
3974
|
+
if (normalized) normalized.push(entry);
|
|
3975
|
+
continue;
|
|
3976
|
+
}
|
|
3744
3977
|
const message = normalizeMessageContent(entry.message);
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3978
|
+
if (message !== entry.message) {
|
|
3979
|
+
if (!normalized) normalized = entries.slice(0, i);
|
|
3980
|
+
normalized.push({
|
|
3981
|
+
...entry,
|
|
3982
|
+
message
|
|
3983
|
+
});
|
|
3984
|
+
} else if (normalized) normalized.push(entry);
|
|
3985
|
+
}
|
|
3986
|
+
return normalized ?? entries.slice();
|
|
3750
3987
|
}
|
|
3751
3988
|
// ../../node_modules/stream-chain/src/gen.js
|
|
3752
3989
|
const gen = (...fns) => genBridge(fns, false);
|
|
@@ -3887,7 +4124,20 @@ function createHostModuleBridgePlugin(modules) {
|
|
|
3887
4124
|
}
|
|
3888
4125
|
};
|
|
3889
4126
|
}
|
|
3890
|
-
|
|
4127
|
+
const installHostModuleBridgeOnce = memoizeAsync(async () => {
|
|
4128
|
+
const bun = getBunRuntime();
|
|
4129
|
+
if (!(isBunBinary || isBundledBuild) || !bun || typeof bun.plugin !== "function") return {
|
|
4130
|
+
installed: false,
|
|
4131
|
+
specifiers: []
|
|
4132
|
+
};
|
|
4133
|
+
const modules = await getVirtualModules();
|
|
4134
|
+
const specifiers = Object.keys(modules);
|
|
4135
|
+
bun.plugin(createHostModuleBridgePlugin(modules));
|
|
4136
|
+
return {
|
|
4137
|
+
installed: true,
|
|
4138
|
+
specifiers
|
|
4139
|
+
};
|
|
4140
|
+
});
|
|
3891
4141
|
/** Register live host module objects before native builtin imports. */
|
|
3892
4142
|
function installHostModuleBridge() {
|
|
3893
4143
|
const bun = getBunRuntime();
|
|
@@ -3895,18 +4145,7 @@ function installHostModuleBridge() {
|
|
|
3895
4145
|
installed: false,
|
|
3896
4146
|
specifiers: []
|
|
3897
4147
|
});
|
|
3898
|
-
|
|
3899
|
-
const specifiers = Object.keys(modules);
|
|
3900
|
-
bun.plugin(createHostModuleBridgePlugin(modules));
|
|
3901
|
-
return {
|
|
3902
|
-
installed: true,
|
|
3903
|
-
specifiers
|
|
3904
|
-
};
|
|
3905
|
-
}).catch((error) => {
|
|
3906
|
-
installPromise = null;
|
|
3907
|
-
throw error;
|
|
3908
|
-
});
|
|
3909
|
-
return installPromise;
|
|
4148
|
+
return installHostModuleBridgeOnce();
|
|
3910
4149
|
}
|
|
3911
4150
|
// dist/core/extensions/transform-graph.js
|
|
3912
4151
|
const TYPESCRIPT_FILE = /\.[cm]?tsx?$/;
|
|
@@ -4047,9 +4286,10 @@ function shared(promises, key, start) {
|
|
|
4047
4286
|
let pending = promises.get(key);
|
|
4048
4287
|
if (pending === void 0) {
|
|
4049
4288
|
const started = start();
|
|
4050
|
-
|
|
4289
|
+
const cleanup = () => {
|
|
4051
4290
|
if (promises.get(key) === started) promises.delete(key);
|
|
4052
|
-
}
|
|
4291
|
+
};
|
|
4292
|
+
started.then(cleanup, cleanup);
|
|
4053
4293
|
promises.set(key, started);
|
|
4054
4294
|
pending = started;
|
|
4055
4295
|
}
|
|
@@ -6957,7 +7197,7 @@ function createStructuredOutputTool(options) {
|
|
|
6957
7197
|
maxResultSizeChars: Infinity,
|
|
6958
7198
|
structuredOutput: true,
|
|
6959
7199
|
async execute(_toolCallId, params, signal, _onUpdate, ctx) {
|
|
6960
|
-
const { generateStructuredOutput } = await import("../core/structured-output/index.
|
|
7200
|
+
const { generateStructuredOutput } = await import("../core/structured-output/index.code.js").catch((error) => __atomicOnDemandFailed(error, "structured output"));
|
|
6961
7201
|
const value = (await generateStructuredOutput({
|
|
6962
7202
|
schema: options.schema,
|
|
6963
7203
|
instructions: params.instructions,
|
|
@@ -10822,6 +11062,44 @@ function estimateProjectedContextTokens(projection, branchEntries) {
|
|
|
10822
11062
|
};
|
|
10823
11063
|
}
|
|
10824
11064
|
/**
|
|
11065
|
+
* Direct single-pass context token estimate for plain branches (no compaction, context edit, custom message, or
|
|
11066
|
+
* branch summary). Returns `undefined` when any special entry is present or no valid assistant usage exists so the
|
|
11067
|
+
* caller falls back to full projection.
|
|
11068
|
+
*/
|
|
11069
|
+
function estimateDirectBranchContextTokens(branchEntries) {
|
|
11070
|
+
let latestPrefixTimestamp = Number.NEGATIVE_INFINITY;
|
|
11071
|
+
let messageIndex = 0;
|
|
11072
|
+
let usageInfo;
|
|
11073
|
+
for (let i = 0; i < branchEntries.length; i++) {
|
|
11074
|
+
const entry = branchEntries[i];
|
|
11075
|
+
if (entry.type === "compaction" || entry.type === "context_edit" || entry.type === "custom_message" || entry.type === "branch_summary") return;
|
|
11076
|
+
if (entry.type !== "message") continue;
|
|
11077
|
+
const message = entry.message;
|
|
11078
|
+
const usage = getAssistantUsage(message);
|
|
11079
|
+
if (usage && message.role === "assistant" && message.timestamp >= latestPrefixTimestamp && calculateContextTokens(usage, message.api) > 0) usageInfo = {
|
|
11080
|
+
usage,
|
|
11081
|
+
api: message.api,
|
|
11082
|
+
entryIndex: i,
|
|
11083
|
+
messageIndex
|
|
11084
|
+
};
|
|
11085
|
+
latestPrefixTimestamp = Math.max(latestPrefixTimestamp, message.timestamp);
|
|
11086
|
+
messageIndex += 1;
|
|
11087
|
+
}
|
|
11088
|
+
if (!usageInfo) return void 0;
|
|
11089
|
+
const usageTokens = calculateContextTokens(usageInfo.usage, usageInfo.api);
|
|
11090
|
+
let trailingTokens = 0;
|
|
11091
|
+
for (let i = usageInfo.entryIndex + 1; i < branchEntries.length; i++) {
|
|
11092
|
+
const entry = branchEntries[i];
|
|
11093
|
+
if (entry.type === "message") trailingTokens += estimateTokens(normalizeMessageContent(entry.message));
|
|
11094
|
+
}
|
|
11095
|
+
return {
|
|
11096
|
+
tokens: usageTokens + trailingTokens,
|
|
11097
|
+
usageTokens,
|
|
11098
|
+
trailingTokens,
|
|
11099
|
+
lastUsageIndex: usageInfo.messageIndex
|
|
11100
|
+
};
|
|
11101
|
+
}
|
|
11102
|
+
/**
|
|
10825
11103
|
* Check if compaction should trigger based on context usage.
|
|
10826
11104
|
*/
|
|
10827
11105
|
function shouldCompact(contextTokens, contextWindow, settings) {
|
|
@@ -11772,6 +12050,7 @@ var RpcTerminalDrain = class {
|
|
|
11772
12050
|
generation;
|
|
11773
12051
|
settlement;
|
|
11774
12052
|
claimed;
|
|
12053
|
+
timer;
|
|
11775
12054
|
/**
|
|
11776
12055
|
* Record the cause that owns this generation's terminal phase, without
|
|
11777
12056
|
* starting the wait. An explicit stop claims before it terminates the child,
|
|
@@ -11790,9 +12069,12 @@ var RpcTerminalDrain = class {
|
|
|
11790
12069
|
* `settle` receives the claimed error — whichever cause got here first — and
|
|
11791
12070
|
* runs exactly once for that generation.
|
|
11792
12071
|
*/
|
|
11793
|
-
begin(generation, drained, error, settle) {
|
|
12072
|
+
begin(generation, drained, error, settle, keepAlive = false) {
|
|
11794
12073
|
const cause = this.claim(generation, error);
|
|
11795
|
-
if (this.generation === generation && this.settlement)
|
|
12074
|
+
if (this.generation === generation && this.settlement) {
|
|
12075
|
+
if (keepAlive) this.timer?.ref?.();
|
|
12076
|
+
return this.settlement;
|
|
12077
|
+
}
|
|
11796
12078
|
this.generation = generation;
|
|
11797
12079
|
let done = false;
|
|
11798
12080
|
const completion = Promise.withResolvers();
|
|
@@ -11800,6 +12082,7 @@ var RpcTerminalDrain = class {
|
|
|
11800
12082
|
if (done) return;
|
|
11801
12083
|
done = true;
|
|
11802
12084
|
clearTimeout(timer);
|
|
12085
|
+
if (this.timer === timer) this.timer = void 0;
|
|
11803
12086
|
try {
|
|
11804
12087
|
settle(cause);
|
|
11805
12088
|
completion.resolve();
|
|
@@ -11808,7 +12091,8 @@ var RpcTerminalDrain = class {
|
|
|
11808
12091
|
}
|
|
11809
12092
|
};
|
|
11810
12093
|
const timer = setTimeout(finish, 500);
|
|
11811
|
-
timer.unref?.();
|
|
12094
|
+
if (!keepAlive) timer.unref?.();
|
|
12095
|
+
this.timer = timer;
|
|
11812
12096
|
this.settlement = completion.promise;
|
|
11813
12097
|
drained.then(finish, finish);
|
|
11814
12098
|
return this.settlement;
|
|
@@ -11843,6 +12127,51 @@ var RpcTerminalDrain = class {
|
|
|
11843
12127
|
return this.generation === generation && this.settlement ? this.settlement : Promise.resolve();
|
|
11844
12128
|
}
|
|
11845
12129
|
};
|
|
11846
|
-
export { AgentTokenMeter, AgentWakeDispatcher, COMPACTED_OUTPUT_MAX_TOKENS, COMPACTOR_COMPRESSION_RATIO, COMPACTOR_REQUEST_TIMEOUT_MS, ChatRowView, CompactorFailure, DEFAULT_AGENT_WAIT_BUDGET_MS, DEFAULT_COMPACTION_SETTINGS, DialogView, FILE_HEADERS_ONLY, FileAuthStorageBackend, InMemoryAuthStorageBackend, InteractiveEngineMonitor, JsonRpcLineReader, LLAMA_PROVIDER_ID, LONG_STREAM_CUT_ADVICE, LONG_STREAM_CUT_MS, MAX_LONG_STREAM_CUT_RETRIES, McpAuthRequiredError, McpHttpError, McpSessionExpiredError, MessageAdmissionBoundary, ModelConfig, OptionListView, PreviewBlockRenderer, QuestionnairePropsAdapter, ResumeCatalogTimeoutError, ResumeCatalogUnavailableError, ResumeError, ResumeNotFoundError, ResumePreconditionError, RpcTerminalDrain, SESSIONS_STORAGE_ENV, STORAGE_ENV, STRUCTURED_OUTPUT_TOOL_NAME, StartupDialogInputGuard, StreamableHttpTransport, TaskSupervisor, TempDirRefusedError, TodoParams, WorkingRunMeter, abortSessionWork, acquireProtectedPaths, addShellOutputPreview, agentTokenTotal, agentWakeDispatcher, applyExtensionSourceInfo, applyProviderRateLimitObservation, armSessionQuitStops, assertPrivateDirectory, assertPrivateDirectoryAsync, assertSessionOpen, assertWorkspace, asyncAuthStorageReads, automaticWaitBudgetMs, bindTaskChatPage, buildCompactorMessages, buildFallbackModel, buildQuestionnaireResponse, buildToolResult, calculateContextTokens, captureChatSnapshot, captureTaskChatFile, chatPageRequest, classifyRepository, clearNestedToolCalls, compactedOutputTokenCap, compactionMeta, configureProviderRequestBudget, createLlamaProvider, createStructuredOutputCapture, createStructuredOutputTool, createToolDefinitionFromAgentTool, createTwoFilesPatch, detectStartupTheme, discoverAppendSystemPromptFile, discoverSystemPromptFile, drainSessionReload, drainSessionWork, drainSessionWorkWithin, dropWrongTypedSettings, ensurePrivateTempDir, ensurePrivateTempDirAsync, ensureSessionTempDirAsync, ensureTempDirAsync, estimateContextTokens, estimateProjectedContextTokens, estimateTextTokens, estimateTokens, executeNestedToolCall, findExactModelReferenceMatch, findResumeError, findSourceInfoForPath, formatDimensionNote, formatKillCall, formatPatch, formatTruncationNotice, formatWorkingElapsed, formatWorkingMeta, fun, gen, getCallableTools, getDefaultSourceInfoForPath, getLastAssistantUsage, getNativeMcpToolIdentity, getPowerShellConfig, getPowerShellConfigAsync, getShellConfig, getShellConfigAsync, getShellEnvAsync, getTempRootDir, hasCallingSessionWork, hasProcessStorageSelection, hasSessionReload, importAfterEvaluation, installHostModuleBridge, invalidSettingMessage, isLongStreamCut, isPowerShellAvailable, isPowerShellAvailableAsync, isProtectedSessionTempDir, isProviderLimitFailure, isProviderRateLimit, isResumeCatalogTimeoutError, isResumeCatalogUnavailableError, isResumeError, isResumeNotFoundError, isResumePreconditionError, isRetryableResumeError, isSelectedNativeMcpTool, isTodoOperationError, isWorkspace, killChildProcessTree, killProcessTree, killSupervisedProcessTrees, killTrackedDetachedChildren, limitQuitShutdownHandlers, loadTaskOwnTranscriptEntries, loadTaskOwnTranscriptHistory, markDetachedChildExited, markNativeMcpToolDefinition, markProviderRateLimitObserved, matchesMcpDirectToolSelection, modelIdForModel, nextRetryDecision, normalizeDerivedSessionEntries, normalizeWorkingRunSnapshot, observeAccountCatalog, observeProviderRateLimits, observedTaskChatWrite, onSessionQuit, ownedSessionManagerStores, ownedSessionPermits, ownedSessionStores, prepareSourceEntries, prepareSourceEntry, previewProcessStorageSelection, previewSessionSettingSelection, processSharedStorageSelection, processSharedStorageSelectionAsync, processStorageEnvironment, processStorageEnvironmentAsync, providerAdmissionTurn, providerCooldownMs, providerIdForModel, providerLimitScope, providerRateLimitObservations, providerRateLimitSnapshot, providerRequestGate, providerRetryHint, providerUnavailableMs, rebuildKillResult, rebuildShellWaitResult, recordNestedToolCalls, recordProviderRateLimit, recordProviderRetryHint, recordProviderSuccess, recordedRepo, reduce, registerSessionRetirement, registerSessionWorkOwner, registerSourceBuiltinLoad, rehydrateResumeError, renewSessionWork, repeatsLongStreamCut, requestCompactorOutput, require_Node, require_anchors, require_directives, require_lib, require_semver, resizeImage, resolveModelReference, resolveSessionTempDirPath, restoreAnthropicReplayThinkingBlocks, retireSessionReloadGeneration, runCommand, runCommandCapture, runCommandSync, runInProgress, runWithConcurrency, sanitizeTempPathComponent, selectChatRowProps, selectDialogProps, selectMultiSelectProps, selectOptionListProps, selectPreviewPaneProps, selectProcessStorage, selectProcessStorageAsync, selectProcessStorageSteps, selectSubmitPickerProps, selectTabBarProps, serializeResumeError, sessionGenerationClosing, sessionLifetime, sessionQuitSignal, setActiveSessionTempId, setCliStorageSelection, setProviderRequestGate, shouldCompact, showFirstTimeSetup, showStartupInput, showStartupSelector, shutdownDeadline, spawnShellProcess, startParentProcessGuardian, structuredPatch, summarizeQuestions, taskChatPage, taskExtensionStatuses, taskOwnTranscriptEntries, taskTranscriptSource, trackDetachedChildPid, trackSessionReload, trackSessionWork, transformTemplate, tryAdmitProviderRequest, untilShutdownHandlerDeadline, untrackDetachedChildPid, validateProcessStorageAsync, validateQuestionnaire, wakeKeyNamespace, watchTaskExtensionStatuses, withBuiltinDiagnostics, withDiscoveredModels, withPersonalizedCatalog, withRemoteCatalog, withTaskChatRows, workspace, wrapToolDefinition };
|
|
12130
|
+
export { AgentTokenMeter, AgentWakeDispatcher, COMPACTED_OUTPUT_MAX_TOKENS, COMPACTOR_COMPRESSION_RATIO, COMPACTOR_REQUEST_TIMEOUT_MS, ChatRowView, CompactorFailure, DEFAULT_AGENT_WAIT_BUDGET_MS, DEFAULT_COMPACTION_SETTINGS, DialogView, FILE_HEADERS_ONLY, FileAuthStorageBackend, InMemoryAuthStorageBackend, InteractiveEngineMonitor, JsonRpcLineReader, LLAMA_PROVIDER_ID, LONG_STREAM_CUT_ADVICE, LONG_STREAM_CUT_MS, MAX_LONG_STREAM_CUT_RETRIES, McpAuthRequiredError, McpHttpError, McpSessionExpiredError, MessageAdmissionBoundary, ModelConfig, OptionListView, PreviewBlockRenderer, QuestionnairePropsAdapter, ResumeCatalogTimeoutError, ResumeCatalogUnavailableError, ResumeError, ResumeNotFoundError, ResumePreconditionError, RpcTerminalDrain, SESSIONS_STORAGE_ENV, STORAGE_ENV, STRUCTURED_OUTPUT_TOOL_NAME, StartupDialogInputGuard, StreamableHttpTransport, TaskSupervisor, TempDirRefusedError, TodoParams, WorkingRunMeter, abortSessionWork, acquireProtectedPaths, addShellOutputPreview, agentTokenTotal, agentWakeDispatcher, applyExtensionSourceInfo, applyProviderRateLimitObservation, armSessionQuitStops, assertPrivateDirectory, assertPrivateDirectoryAsync, assertSessionOpen, assertWorkspace, asyncAuthStorageReads, automaticWaitBudgetMs, bindTaskChatPage, buildCompactorMessages, buildFallbackModel, buildQuestionnaireResponse, buildToolResult, calculateContextTokens, captureChatSnapshot, captureTaskChatFile, chatPageRequest, classifyRepository, clearNestedToolCalls, compactedOutputTokenCap, compactionMeta, configureProviderRequestBudget, createLlamaProvider, createStructuredOutputCapture, createStructuredOutputTool, createToolDefinitionFromAgentTool, createTwoFilesPatch, detectStartupTheme, discoverAppendSystemPromptFile, discoverSystemPromptFile, drainSessionReload, drainSessionWork, drainSessionWorkWithin, dropWrongTypedSettings, ensurePrivateTempDir, ensurePrivateTempDirAsync, ensureSessionTempDirAsync, ensureTempDirAsync, estimateContextTokens, estimateDirectBranchContextTokens, estimateProjectedContextTokens, estimateTextTokens, estimateTokens, executeNestedToolCall, findExactModelReferenceMatch, findResumeError, findSourceInfoForPath, formatDimensionNote, formatKillCall, formatPatch, formatTruncationNotice, formatWorkingElapsed, formatWorkingMeta, fun, gen, getCallableTools, getDefaultSourceInfoForPath, getLastAssistantUsage, getNativeMcpToolIdentity, getPowerShellConfig, getPowerShellConfigAsync, getShellConfig, getShellConfigAsync, getShellEnvAsync, getTempRootDir, hasCallingSessionWork, hasProcessStorageSelection, hasSessionReload, importAfterEvaluation, installHostModuleBridge, invalidSettingMessage, isLongStreamCut, isPowerShellAvailable, isPowerShellAvailableAsync, isProtectedSessionTempDir, isProviderLimitFailure, isProviderRateLimit, isResumeCatalogTimeoutError, isResumeCatalogUnavailableError, isResumeError, isResumeNotFoundError, isResumePreconditionError, isRetryableResumeError, isSelectedNativeMcpTool, isTodoOperationError, isWorkspace, killChildProcessTree, killProcessTree, killSupervisedProcessTrees, killTrackedDetachedChildren, limitQuitShutdownHandlers, loadTaskOwnTranscriptEntries, loadTaskOwnTranscriptHistory, markDetachedChildExited, markNativeMcpToolDefinition, markProviderRateLimitObserved, matchesMcpDirectToolSelection, modelIdForModel, nextRetryDecision, normalizeDerivedSessionEntries, normalizeWorkingRunSnapshot, observeAccountCatalog, observeProviderRateLimits, observedTaskChatWrite, onSessionQuit, ownedSessionManagerStores, ownedSessionPermits, ownedSessionStores, prepareSourceEntries, prepareSourceEntry, previewProcessStorageSelection, previewSessionSettingSelection, processSharedStorageSelection, processSharedStorageSelectionAsync, processStorageEnvironment, processStorageEnvironmentAsync, providerAdmissionTurn, providerCooldownMs, providerIdForModel, providerLimitScope, providerRateLimitObservations, providerRateLimitSnapshot, providerRequestGate, providerRetryHint, providerUnavailableMs, rebuildKillResult, rebuildShellWaitResult, recordNestedToolCalls, recordProviderRateLimit, recordProviderRetryHint, recordProviderSuccess, recordedRepo, reduce, registerSessionRetirement, registerSessionWorkOwner, registerSourceBuiltinLoad, rehydrateResumeError, renewSessionWork, repeatsLongStreamCut, requestCompactorOutput, require_Node, require_anchors, require_directives, require_lib, require_semver, resizeImage, resolveModelReference, resolveSessionTempDirPath, restoreAnthropicReplayThinkingBlocks, retireSessionReloadGeneration, runCommand, runCommandCapture, runCommandSync, runInProgress, runWithConcurrency, sanitizeTempPathComponent, selectChatRowProps, selectDialogProps, selectMultiSelectProps, selectOptionListProps, selectPreviewPaneProps, selectProcessStorage, selectProcessStorageAsync, selectProcessStorageSteps, selectSubmitPickerProps, selectTabBarProps, serializeResumeError, sessionGenerationClosing, sessionLifetime, sessionQuitSignal, setActiveSessionTempId, setCliStorageSelection, setProviderRequestGate, shouldCompact, showFirstTimeSetup, showStartupInput, showStartupSelector, shutdownDeadline, spawnShellProcess, startParentProcessGuardian, structuredPatch, summarizeQuestions, taskChatPage, taskExtensionStatuses, taskOwnTranscriptEntries, taskTranscriptSource, trackDetachedChildPid, trackDetachedChildProcess, trackSessionReload, trackSessionWork, transformTemplate, tryAdmitProviderRequest, untilShutdownHandlerDeadline, untrackDetachedChildPid, validateProcessStorageAsync, validateQuestionnaire, wakeKeyNamespace, watchTaskExtensionStatuses, watchTaskTranscriptBindings, withBuiltinDiagnostics, withDiscoveredModels, withPersonalizedCatalog, withRemoteCatalog, withTaskChatRows, workspace, wrapToolDefinition };
|
|
11847
12131
|
|
|
11848
|
-
//# sourceMappingURL=startup-0-2-
|
|
12132
|
+
//# sourceMappingURL=startup-0-2-SZGQIWHI.js.map
|
|
12133
|
+
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
12134
|
+
// demand that fails in a process an in-place update left running says to restart.
|
|
12135
|
+
function __atomicOnDemandFailed(error, feature) {
|
|
12136
|
+
return (async () => {
|
|
12137
|
+
const root = new URL("../", import.meta.url);
|
|
12138
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
12139
|
+
const key = `${root.href}#0.10.5`;
|
|
12140
|
+
let release = releases.get(key);
|
|
12141
|
+
if (release === undefined) {
|
|
12142
|
+
const current = (async () => {
|
|
12143
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
12144
|
+
try {
|
|
12145
|
+
const held = await import(new URL(path, root).href);
|
|
12146
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
12147
|
+
} catch {
|
|
12148
|
+
// Not a file this process can load: the next.
|
|
12149
|
+
}
|
|
12150
|
+
}
|
|
12151
|
+
return undefined;
|
|
12152
|
+
})().then((found) => {
|
|
12153
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
12154
|
+
return found;
|
|
12155
|
+
});
|
|
12156
|
+
releases.set(key, current);
|
|
12157
|
+
release = current;
|
|
12158
|
+
}
|
|
12159
|
+
const running = await release;
|
|
12160
|
+
let installed;
|
|
12161
|
+
try {
|
|
12162
|
+
const { readFile } = process.getBuiltinModule("node:fs/promises");
|
|
12163
|
+
installed = JSON.parse(await readFile(new URL("../package.json", root), "utf8")).version;
|
|
12164
|
+
} catch {
|
|
12165
|
+
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
12166
|
+
}
|
|
12167
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.5" ? installed : running !== undefined && running.version !== "0.10.5" ? "0.10.5" : undefined;
|
|
12168
|
+
if (updatedTo === undefined) throw error;
|
|
12169
|
+
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
12170
|
+
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|
|
12171
|
+
cause: error,
|
|
12172
|
+
});
|
|
12173
|
+
restart.name = "UpdatedInstallError";
|
|
12174
|
+
restart[Symbol.for("atomic.on-demand-restart.v1")] = { application, updatedTo, feature };
|
|
12175
|
+
throw restart;
|
|
12176
|
+
})();
|
|
12177
|
+
}
|