@bastani/atomic 0.10.4 → 0.10.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/_shared/compile-cache-warmup-host-RU5L7I7A.js +1 -1
- package/dist/_shared/dist-KOELCESV.js +48 -3
- package/dist/_shared/fork-row-index-UAUAQRD5.js +47 -2
- package/dist/_shared/http-YFAPTIZD.js +16 -4
- package/dist/_shared/http-YFAPTIZD.js.map +1 -1
- package/dist/_shared/lib-4PES5P4V.js +59 -14
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +1706 -258
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +317 -64
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/{mode-shared-HP7GUA7J.js → mode-shared-2QJSCUM6.js} +432 -81
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -0
- package/dist/_shared/p0-cli-BB45ZQY6.js +3482 -0
- package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -0
- package/dist/_shared/p0-cli-GUFK7TPN.js +2 -2838
- package/dist/_shared/p0-cli-GUFK7TPN.js.map +1 -1
- package/dist/_shared/{p1a-prewarm-YK3KDTLN.js → p1a-prewarm-UQY3X2UK.js} +270 -73
- package/dist/_shared/p1a-prewarm-UQY3X2UK.js.map +1 -0
- package/dist/_shared/{p1b-elig-PXQA2FYP.js → p1b-elig-ENCUPKKJ.js} +190 -121
- package/dist/_shared/p1b-elig-ENCUPKKJ.js.map +1 -0
- package/dist/_shared/p2-common-YLSYXMDQ.js +1 -3
- package/dist/_shared/p2-common-YLSYXMDQ.js.map +1 -1
- package/dist/_shared/p2-shell-TJBYQMCJ.js +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +500 -127
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +4 -4
- package/dist/_shared/sdk-WQIOHVKO.js +56 -11
- package/dist/_shared/session-data-AHTU7IS6.js +48 -3
- package/dist/_shared/session-manager-list-2BLEEZVG.js +2 -2
- package/dist/_shared/settings-startup-65YEWRV2.js.map +1 -1
- package/dist/_shared/sql-session-store-5FD3WBMZ.js +57 -12
- package/dist/_shared/{startup-0-0-X4NF3GKM.js → startup-0-0-TYUFUOJZ.js} +519 -316
- package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +1 -0
- package/dist/_shared/{startup-0-1-7QTG6VJZ.js → startup-0-1-D4LGGINF.js} +284 -81
- package/dist/_shared/startup-0-1-D4LGGINF.js.map +1 -0
- package/dist/_shared/{startup-0-2-KFDYPDJK.js → startup-0-2-SZGQIWHI.js} +483 -154
- package/dist/_shared/startup-0-2-SZGQIWHI.js.map +1 -0
- package/dist/_shared/startup-0-3-T4DVFYWX.js +340 -110
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
- package/dist/_shared/startup-0-4-HN5EB4K7.js +261 -59
- package/dist/_shared/startup-0-4-HN5EB4K7.js.map +1 -1
- package/dist/_shared/startup-0-5-OHJNE6JH.js +421 -148
- package/dist/_shared/startup-0-5-OHJNE6JH.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +62 -11
- package/dist/_shared/startup-10-0-TDQNBDDL.js.map +1 -1
- package/dist/_shared/startup-12-0-55AAXBJZ.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +12 -11
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +53 -158
- package/dist/_shared/startup-15-0-YUKGAC63.js.map +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +231 -46
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +115 -35
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-KQJBDKRU.js → startup-8-1-SJW2GMAM.js} +203 -62
- package/dist/_shared/startup-8-1-SJW2GMAM.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +55 -10
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +47 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +48 -3
- package/dist/builtin/intercom/CHANGELOG.md +21 -0
- package/dist/builtin/intercom/README.md +0 -1
- package/dist/builtin/intercom/broker/broker-instance.ts +13 -57
- package/dist/builtin/intercom/broker/broker-process.ts +30 -10
- package/dist/builtin/intercom/broker/broker-routing.ts +12 -2
- package/dist/builtin/intercom/broker/broker.bundle.mjs +2557 -498
- package/dist/builtin/intercom/broker/broker.ts +164 -55
- package/dist/builtin/intercom/broker/client.ts +36 -16
- package/dist/builtin/intercom/broker/control.ts +83 -20
- package/dist/builtin/intercom/broker/durable-ended-queue.ts +65 -19
- package/dist/builtin/intercom/broker/host-command-environment.ts +7 -2
- package/dist/builtin/intercom/broker/multinode-router.ts +1675 -387
- package/dist/builtin/intercom/broker/multinode-state-store.ts +10 -0
- package/dist/builtin/intercom/broker/paths.ts +68 -6
- package/dist/builtin/intercom/broker/pending-send-registry.ts +5 -0
- package/dist/builtin/intercom/broker/registration-bounds.ts +38 -0
- package/dist/builtin/intercom/broker/retiring-broker-check.ts +178 -0
- package/dist/builtin/intercom/broker/return-paths.ts +268 -7
- package/dist/builtin/intercom/broker/send-handler.ts +253 -28
- package/dist/builtin/intercom/broker/send-order-gate.ts +410 -0
- package/dist/builtin/intercom/broker/spawn.ts +950 -202
- package/dist/builtin/intercom/broker/sql-lease-store.ts +37 -0
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +7 -0
- package/dist/builtin/intercom/broker/windows-cwd.ts +546 -0
- package/dist/builtin/intercom/index.bundle.mjs +3506 -2328
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/retry-policy.ts +4 -0
- package/dist/builtin/intercom/types.ts +2 -0
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +336 -86
- package/dist/builtin/web-access/index.bundle.mjs +23 -38
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/bun/cli.js +1 -1
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/internal-intercom-broker.js +119 -4
- package/dist/bun/internal-intercom-broker.js.map +1 -1
- package/dist/bun/register-theme-validator.js +6 -0
- package/dist/bun/register-theme-validator.js.map +1 -0
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +1102 -0
- package/dist/cli/auth-cli.code.js.map +1 -0
- package/dist/cli/auth-cli.impl.js +30 -1096
- package/dist/cli/auth-cli.impl.js.map +1 -1
- package/dist/cli/auth-cli.js +11 -7
- package/dist/cli/blueprint-command.code.js +906 -0
- package/dist/cli/blueprint-command.code.js.map +1 -0
- package/dist/cli/blueprint-command.impl.js +30 -900
- package/dist/cli/blueprint-command.impl.js.map +1 -1
- package/dist/cli/blueprint-command.js +11 -7
- package/dist/cli/intercom-command.code.js +153 -0
- package/dist/cli/intercom-command.code.js.map +1 -0
- package/dist/cli/intercom-command.impl.js +33 -105
- package/dist/cli/intercom-command.impl.js.map +1 -1
- package/dist/cli/intercom-command.js +11 -7
- package/dist/cli/list-models.code.js +60 -0
- package/dist/cli/list-models.code.js.map +1 -0
- package/dist/cli/list-models.impl.js +33 -57
- package/dist/cli/list-models.impl.js.map +1 -1
- package/dist/cli/list-models.js +11 -7
- package/dist/cli/session-picker.code.js +55 -0
- package/dist/cli/session-picker.code.js.map +1 -0
- package/dist/cli/session-picker.impl.js +33 -52
- package/dist/cli/session-picker.impl.js.map +1 -1
- package/dist/cli/session-picker.js +11 -7
- package/dist/cli/startup-ui.code.js +5 -0
- package/dist/cli/startup-ui.code.js.map +1 -0
- package/dist/cli/startup-ui.impl.js +35 -4
- package/dist/cli/startup-ui.js +11 -7
- package/dist/cli/storage-command.code.js +3 -0
- package/dist/cli/storage-command.code.js.map +1 -0
- package/dist/cli/storage-command.impl.js +35 -2
- package/dist/cli/storage-command.js +11 -7
- package/dist/cli/storage-search-session.code.js +189 -0
- package/dist/cli/storage-search-session.code.js.map +1 -0
- package/dist/cli/storage-search-session.impl.js +33 -186
- package/dist/cli/storage-search-session.impl.js.map +1 -1
- package/dist/cli/storage-search-session.js +11 -7
- package/dist/cli/team-command.code.js +217 -0
- package/dist/cli/team-command.code.js.map +1 -0
- package/dist/cli/team-command.impl.js +32 -213
- package/dist/cli/team-command.impl.js.map +1 -1
- package/dist/cli/team-command.js +11 -7
- package/dist/cli.js +60 -11
- package/dist/cli.js.map +1 -1
- package/dist/config.js +1 -1
- package/dist/core/agent-session-methods.d.ts +4 -3
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +5 -0
- package/dist/core/compaction/compaction.d.ts +6 -0
- package/dist/core/compaction/model-resolver.d.ts +1 -1
- package/dist/core/debug.code.js +3 -0
- package/dist/core/debug.code.js.map +1 -0
- package/dist/core/debug.impl.js +35 -2
- package/dist/core/debug.js +11 -7
- package/dist/core/default-model-api-prewarm.d.ts +5 -0
- package/dist/core/export-html/card-projection.code.js +257 -0
- package/dist/core/export-html/card-projection.code.js.map +1 -0
- package/dist/core/export-html/card-projection.impl.js +34 -255
- package/dist/core/export-html/card-projection.impl.js.map +1 -1
- package/dist/core/export-html/card-projection.js +11 -7
- package/dist/core/export-html/index.code.js +655 -0
- package/dist/core/export-html/index.code.js.map +1 -0
- package/dist/core/export-html/index.impl.js +30 -604
- package/dist/core/export-html/index.impl.js.map +1 -1
- package/dist/core/export-html/index.js +11 -7
- package/dist/core/export-html/json-spans.code.js +3 -0
- package/dist/core/export-html/json-spans.code.js.map +1 -0
- package/dist/core/export-html/json-spans.impl.js +35 -2
- package/dist/core/export-html/json-spans.js +11 -7
- package/dist/core/export-html/oversized-render-inputs.code.js +125 -0
- package/dist/core/export-html/oversized-render-inputs.code.js.map +1 -0
- package/dist/core/export-html/oversized-render-inputs.impl.js +31 -120
- package/dist/core/export-html/oversized-render-inputs.impl.js.map +1 -1
- package/dist/core/export-html/oversized-render-inputs.js +11 -7
- package/dist/core/export-html/tool-renderer.code.js +350 -0
- package/dist/core/export-html/tool-renderer.code.js.map +1 -0
- package/dist/core/export-html/tool-renderer.impl.js +33 -347
- package/dist/core/export-html/tool-renderer.impl.js.map +1 -1
- package/dist/core/export-html/tool-renderer.js +11 -7
- package/dist/core/extensions/jiti-loader.code.js +3 -0
- package/dist/core/extensions/jiti-loader.code.js.map +1 -0
- package/dist/core/extensions/jiti-loader.impl.js +35 -2
- package/dist/core/extensions/jiti-loader.js +11 -7
- package/dist/core/extensions/jiti-static-loader.code.js +3 -0
- package/dist/core/extensions/jiti-static-loader.code.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.impl.js +35 -2
- package/dist/core/extensions/jiti-static-loader.js +11 -7
- package/dist/core/extensions/loader-host-modules.code.js +3 -0
- package/dist/core/extensions/loader-host-modules.code.js.map +1 -0
- package/dist/core/extensions/loader-host-modules.impl.js +35 -2
- package/dist/core/extensions/loader-host-modules.js +11 -7
- package/dist/core/extensions/loader-virtual-modules.d.ts +1 -6
- package/dist/core/extensions/loader-virtual-modules.js +1 -1
- package/dist/core/extensions/runner-context.js +3 -3
- package/dist/core/extensions/session-events.d.ts +4 -0
- package/dist/core/extensions/session-events.js.map +1 -1
- package/dist/core/intercom-broker-control-host.code.js +5 -0
- package/dist/core/intercom-broker-control-host.code.js.map +1 -0
- package/dist/core/intercom-broker-control-host.impl.js +35 -4
- package/dist/core/intercom-broker-control-host.js +11 -7
- package/dist/core/intercom-broker-control.code.js +63 -0
- package/dist/core/intercom-broker-control.code.js.map +1 -0
- package/dist/core/intercom-broker-control.d.ts +21 -0
- package/dist/core/intercom-broker-control.impl.js +35 -17
- package/dist/core/intercom-broker-control.impl.js.map +1 -1
- package/dist/core/intercom-broker-control.js +11 -7
- package/dist/core/package-manager-storage-adapters.code.js +3 -0
- package/dist/core/package-manager-storage-adapters.code.js.map +1 -0
- package/dist/core/package-manager-storage-adapters.impl.js +35 -2
- package/dist/core/package-manager-storage-adapters.js +11 -7
- package/dist/core/process-start-token.d.ts +8 -2
- package/dist/core/process-tree-containment.d.ts +27 -0
- package/dist/core/queued-message-delivery.d.ts +5 -2
- package/dist/core/resume/blueprint/process.d.ts +3 -1
- package/dist/core/sdk.code.js +9 -0
- package/dist/core/sdk.code.js.map +1 -0
- package/dist/core/sdk.impl.js +35 -8
- package/dist/core/sdk.js +11 -7
- package/dist/core/session-manager-core.d.ts +15 -5
- package/dist/core/session-manager-core.js +195 -38
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-list.code.js +3 -0
- package/dist/core/session-manager-list.code.js.map +1 -0
- package/dist/core/session-manager-list.impl.js +35 -2
- package/dist/core/session-manager-list.js +11 -7
- package/dist/core/session-manager-types.d.ts +20 -0
- package/dist/core/session-manager.code.js +8 -0
- package/dist/core/session-manager.code.js.map +1 -0
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.impl.js +35 -7
- package/dist/core/session-manager.js +11 -7
- package/dist/core/session-storage.code.js +3 -0
- package/dist/core/session-storage.code.js.map +1 -0
- package/dist/core/session-storage.impl.js +35 -2
- package/dist/core/session-storage.js +11 -7
- package/dist/core/storage/file-identity.d.ts +3 -0
- package/dist/core/storage/file-identity.js +296 -86
- package/dist/core/storage/file-identity.js.map +1 -1
- package/dist/core/storage/index.d.ts +1 -1
- package/dist/core/storage/index.js +52 -7
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +47 -2
- package/dist/core/storage/node-sqlite.js +49 -4
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.code.js +37 -0
- package/dist/core/storage/offline-snapshot-file.code.js.map +1 -0
- package/dist/core/storage/offline-snapshot-file.impl.js +33 -34
- package/dist/core/storage/offline-snapshot-file.impl.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.js +11 -7
- package/dist/core/storage/provider.js +52 -7
- package/dist/core/storage/selection.js +49 -4
- package/dist/core/storage/session/branch-fork-source.code.js +146 -0
- package/dist/core/storage/session/branch-fork-source.code.js.map +1 -0
- package/dist/core/storage/session/branch-fork-source.impl.js +32 -97
- package/dist/core/storage/session/branch-fork-source.impl.js.map +1 -1
- package/dist/core/storage/session/branch-fork-source.js +11 -7
- package/dist/core/storage/session/card-view.code.js +60 -0
- package/dist/core/storage/session/card-view.code.js.map +1 -0
- package/dist/core/storage/session/card-view.impl.js +34 -58
- package/dist/core/storage/session/card-view.impl.js.map +1 -1
- package/dist/core/storage/session/card-view.js +11 -7
- package/dist/core/storage/session/child-reader.code.js +139 -0
- package/dist/core/storage/session/child-reader.code.js.map +1 -0
- package/dist/core/storage/session/child-reader.d.ts +1 -0
- package/dist/core/storage/session/child-reader.impl.js +33 -91
- package/dist/core/storage/session/child-reader.impl.js.map +1 -1
- package/dist/core/storage/session/child-reader.js +11 -7
- package/dist/core/storage/session/chunked-resume-projection.code.js +3 -0
- package/dist/core/storage/session/chunked-resume-projection.code.js.map +1 -0
- package/dist/core/storage/session/chunked-resume-projection.impl.js +35 -2
- package/dist/core/storage/session/chunked-resume-projection.js +11 -7
- package/dist/core/storage/session/expanded-child-details.code.js +684 -0
- package/dist/core/storage/session/expanded-child-details.code.js.map +1 -0
- package/dist/core/storage/session/expanded-child-details.impl.js +31 -634
- package/dist/core/storage/session/expanded-child-details.impl.js.map +1 -1
- package/dist/core/storage/session/expanded-child-details.js +11 -7
- package/dist/core/storage/session/fork-row-bytes.code.js +3 -0
- package/dist/core/storage/session/fork-row-bytes.code.js.map +1 -0
- package/dist/core/storage/session/fork-row-bytes.impl.js +35 -2
- package/dist/core/storage/session/fork-row-bytes.js +11 -7
- package/dist/core/storage/session/fork-row-index.code.js +3 -0
- package/dist/core/storage/session/fork-row-index.code.js.map +1 -0
- package/dist/core/storage/session/fork-row-index.impl.js +35 -2
- package/dist/core/storage/session/fork-row-index.js +11 -7
- package/dist/core/storage/session/fork-staging.code.js +580 -0
- package/dist/core/storage/session/fork-staging.code.js.map +1 -0
- package/dist/core/storage/session/fork-staging.impl.js +30 -574
- package/dist/core/storage/session/fork-staging.impl.js.map +1 -1
- package/dist/core/storage/session/fork-staging.js +11 -7
- package/dist/core/storage/session/fork-window.code.js +522 -0
- package/dist/core/storage/session/fork-window.code.js.map +1 -0
- package/dist/core/storage/session/fork-window.impl.js +30 -471
- package/dist/core/storage/session/fork-window.impl.js.map +1 -1
- package/dist/core/storage/session/fork-window.js +11 -7
- package/dist/core/storage/session/history-pages.code.js +3 -0
- package/dist/core/storage/session/history-pages.code.js.map +1 -0
- package/dist/core/storage/session/history-pages.impl.js +35 -2
- package/dist/core/storage/session/history-pages.js +11 -7
- package/dist/core/storage/session/jsonl-entry-projection.code.js +3 -0
- package/dist/core/storage/session/jsonl-entry-projection.code.js.map +1 -0
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +35 -2
- package/dist/core/storage/session/jsonl-entry-projection.js +11 -7
- package/dist/core/storage/session/jsonl-session-store.code.js +3 -0
- package/dist/core/storage/session/jsonl-session-store.code.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.impl.js +35 -2
- package/dist/core/storage/session/jsonl-session-store.js +11 -7
- package/dist/core/storage/session/memory-session-store.code.js +3 -0
- package/dist/core/storage/session/memory-session-store.code.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.impl.js +35 -2
- package/dist/core/storage/session/memory-session-store.js +11 -7
- package/dist/core/storage/session/pinned-branch-resume.code.js +117 -0
- package/dist/core/storage/session/pinned-branch-resume.code.js.map +1 -0
- package/dist/core/storage/session/pinned-branch-resume.impl.js +33 -69
- package/dist/core/storage/session/pinned-branch-resume.impl.js.map +1 -1
- package/dist/core/storage/session/pinned-branch-resume.js +11 -7
- package/dist/core/storage/session/released-history-files.code.js +465 -0
- package/dist/core/storage/session/released-history-files.code.js.map +1 -0
- package/dist/core/storage/session/released-history-files.impl.js +32 -461
- package/dist/core/storage/session/released-history-files.impl.js.map +1 -1
- package/dist/core/storage/session/released-history-files.js +11 -7
- package/dist/core/storage/session/resident-fork-rows.code.js +57 -0
- package/dist/core/storage/session/resident-fork-rows.code.js.map +1 -0
- package/dist/core/storage/session/resident-fork-rows.impl.js +32 -53
- package/dist/core/storage/session/resident-fork-rows.impl.js.map +1 -1
- package/dist/core/storage/session/resident-fork-rows.js +11 -7
- package/dist/core/storage/session/session-resume.code.js +3 -0
- package/dist/core/storage/session/session-resume.code.js.map +1 -0
- package/dist/core/storage/session/session-resume.impl.js +35 -2
- package/dist/core/storage/session/session-resume.js +11 -7
- package/dist/core/storage/session/snapshot-cut.code.js +3 -0
- package/dist/core/storage/session/snapshot-cut.code.js.map +1 -0
- package/dist/core/storage/session/snapshot-cut.impl.js +35 -2
- package/dist/core/storage/session/snapshot-cut.js +11 -7
- package/dist/core/storage/session/snapshot-history.code.js +107 -0
- package/dist/core/storage/session/snapshot-history.code.js.map +1 -0
- package/dist/core/storage/session/snapshot-history.impl.js +34 -60
- package/dist/core/storage/session/snapshot-history.impl.js.map +1 -1
- package/dist/core/storage/session/snapshot-history.js +11 -7
- package/dist/core/storage/session/sql-session-store.code.js +3 -0
- package/dist/core/storage/session/sql-session-store.code.js.map +1 -0
- package/dist/core/storage/session/sql-session-store.impl.js +35 -2
- package/dist/core/storage/session/sql-session-store.js +11 -7
- package/dist/core/storage/session/tree-outline.code.js +3 -0
- package/dist/core/storage/session/tree-outline.code.js.map +1 -0
- package/dist/core/storage/session/tree-outline.impl.js +35 -2
- package/dist/core/storage/session/tree-outline.js +11 -7
- package/dist/core/storage/session/tree-presentation.code.js +342 -0
- package/dist/core/storage/session/tree-presentation.code.js.map +1 -0
- package/dist/core/storage/session/tree-presentation.impl.js +31 -337
- package/dist/core/storage/session/tree-presentation.impl.js.map +1 -1
- package/dist/core/storage/session/tree-presentation.js +11 -7
- package/dist/core/storage/session/types.d.ts +26 -0
- package/dist/core/storage/storage-status.code.js +3 -0
- package/dist/core/storage/storage-status.code.js.map +1 -0
- package/dist/core/storage/storage-status.impl.js +35 -2
- package/dist/core/storage/storage-status.js +11 -7
- package/dist/core/storage/team.code.js +3 -0
- package/dist/core/storage/team.code.js.map +1 -0
- package/dist/core/storage/team.impl.js +35 -2
- package/dist/core/storage/team.js +11 -7
- package/dist/core/structured-output/index.code.js +3 -0
- package/dist/core/structured-output/index.code.js.map +1 -0
- package/dist/core/structured-output/index.impl.js +35 -2
- package/dist/core/structured-output/index.js +11 -7
- package/dist/core/tasks/command-output.d.ts +4 -1
- package/dist/core/tasks/supervisor.d.ts +2 -0
- package/dist/core/tasks/task-completion-entry.code.js +254 -0
- package/dist/core/tasks/task-completion-entry.code.js.map +1 -0
- package/dist/core/tasks/task-completion-entry.impl.js +33 -251
- package/dist/core/tasks/task-completion-entry.impl.js.map +1 -1
- package/dist/core/tasks/task-completion-entry.js +11 -7
- package/dist/core/tasks/task-file-history.code.js +424 -0
- package/dist/core/tasks/task-file-history.code.js.map +1 -0
- package/dist/core/tasks/task-file-history.impl.js +32 -375
- package/dist/core/tasks/task-file-history.impl.js.map +1 -1
- package/dist/core/tasks/task-file-history.js +11 -7
- package/dist/core/tasks/{task-reference-archive.impl.js → task-reference-archive.code.js} +51 -6
- package/dist/core/tasks/{task-reference-archive.impl.js.map → task-reference-archive.code.js.map} +1 -1
- package/dist/core/tasks/task-reference-archive.js +11 -7
- package/dist/core/tasks/{task-reference-identity.impl.js → task-reference-identity.code.js} +1 -1
- package/dist/core/tasks/{task-reference-identity.impl.js.map → task-reference-identity.code.js.map} +1 -1
- package/dist/core/tasks/task-reference-identity.js +11 -7
- package/dist/core/tasks/task-reference-stream.code.js +3 -0
- package/dist/core/tasks/task-reference-stream.code.js.map +1 -0
- package/dist/core/tasks/task-reference-stream.impl.js +35 -2
- package/dist/core/tasks/task-reference-stream.js +11 -7
- package/dist/core/tasks/task-unsaved-answer.code.js +3 -0
- package/dist/core/tasks/task-unsaved-answer.code.js.map +1 -0
- package/dist/core/tasks/task-unsaved-answer.impl.js +35 -2
- package/dist/core/tasks/task-unsaved-answer.js +11 -7
- package/dist/core/tasks/task-view-source.code.js +3 -0
- package/dist/core/tasks/task-view-source.code.js.map +1 -0
- package/dist/core/tasks/task-view-source.d.ts +9 -0
- package/dist/core/tasks/task-view-source.impl.js +35 -2
- package/dist/core/tasks/task-view-source.js +12 -8
- package/dist/core/tools/read-url.code.js +1530 -0
- package/dist/core/tools/read-url.code.js.map +1 -0
- package/dist/core/tools/read-url.impl.js +30 -1524
- package/dist/core/tools/read-url.impl.js.map +1 -1
- package/dist/core/tools/read-url.js +11 -7
- package/dist/core/worktree-snapshot/blob-store.js +50 -5
- package/dist/core/worktree-snapshot/errors.code.js +6 -0
- package/dist/core/worktree-snapshot/errors.code.js.map +1 -0
- package/dist/core/worktree-snapshot/errors.impl.js +35 -5
- package/dist/core/worktree-snapshot/errors.js +11 -7
- package/dist/core/worktree-snapshot/session-index-reset.code.js +136 -0
- package/dist/core/worktree-snapshot/session-index-reset.code.js.map +1 -0
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +34 -134
- package/dist/core/worktree-snapshot/session-index-reset.impl.js.map +1 -1
- package/dist/core/worktree-snapshot/session-index-reset.js +11 -7
- package/dist/extensions/codemode/execute.code.js +618 -0
- package/dist/extensions/codemode/execute.code.js.map +1 -0
- package/dist/extensions/codemode/execute.impl.js +30 -612
- package/dist/extensions/codemode/execute.impl.js.map +1 -1
- package/dist/extensions/codemode/execute.js +11 -7
- package/dist/extensions/codemode/renderer.code.js +110 -0
- package/dist/extensions/codemode/renderer.code.js.map +1 -0
- package/dist/extensions/codemode/renderer.impl.js +33 -107
- package/dist/extensions/codemode/renderer.impl.js.map +1 -1
- package/dist/extensions/codemode/renderer.js +11 -7
- package/dist/extensions/mcp/cli.code.js +565 -0
- package/dist/extensions/mcp/cli.code.js.map +1 -0
- package/dist/extensions/mcp/cli.impl.js +32 -561
- package/dist/extensions/mcp/cli.impl.js.map +1 -1
- package/dist/extensions/mcp/cli.js +11 -7
- package/dist/extensions/mcp/cli.lazy.code.js +52 -0
- package/dist/extensions/mcp/cli.lazy.code.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.impl.js +36 -7
- package/dist/extensions/mcp/cli.lazy.impl.js.map +1 -1
- package/dist/extensions/mcp/cli.lazy.js +11 -7
- package/dist/extensions/mcp/client/transports/stdio.d.ts +2 -0
- package/dist/extensions/mcp/runtime.code.js +5 -0
- package/dist/extensions/mcp/runtime.code.js.map +1 -0
- package/dist/extensions/mcp/runtime.impl.js +35 -4
- package/dist/extensions/mcp/runtime.js +11 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/main-first-time-setup.code.js +12 -0
- package/dist/main-first-time-setup.code.js.map +1 -0
- package/dist/main-first-time-setup.impl.js +35 -11
- package/dist/main-first-time-setup.impl.js.map +1 -1
- package/dist/main-first-time-setup.js +11 -7
- package/dist/main.d.ts +1 -1
- package/dist/main.js +2 -2
- package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts +6 -1
- package/dist/modes/interactive/agent-view/contracts.d.ts +4 -0
- package/dist/modes/interactive/chat-reader-records.d.ts +1 -1
- package/dist/modes/interactive/components/stored-tree-view.code.js +338 -0
- package/dist/modes/interactive/components/stored-tree-view.code.js.map +1 -0
- package/dist/modes/interactive/components/stored-tree-view.impl.js +33 -290
- package/dist/modes/interactive/components/stored-tree-view.impl.js.map +1 -1
- package/dist/modes/interactive/components/stored-tree-view.js +11 -7
- package/dist/modes/interactive/components/task-selection-state.d.ts +8 -3
- package/dist/modes/interactive/components/task-transcript-page.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js +191 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +34 -189
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector-archive.js +11 -7
- package/dist/modes/interactive/interactive-mode-base.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-queueing.d.ts +4 -0
- package/dist/modes/interactive/interactive-render-chat.d.ts +22 -0
- package/dist/modes/interactive/interactive-startup.d.ts +2 -0
- package/dist/modes/interactive/program-status-reporter.d.ts +2 -1
- package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
- package/dist/modes/interactive/steering-queue-controller.d.ts +4 -0
- package/dist/modes/interactive/theme/theme-schema-factory.d.ts +26 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts +4 -5
- package/dist/modes/interactive-engine/engine-prewarm.d.ts +30 -5
- package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +7 -0
- package/dist/modes/interactive-engine/protocol.d.ts +32 -1
- package/dist/modes/rpc/agent-view-rpc-types.d.ts +12 -1
- package/dist/modes/rpc/agent-view-rpc-types.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +3 -1
- package/dist/modes/rpc/rpc-types.d.ts +12 -0
- package/dist/package-manager-cli.code.js +1140 -0
- package/dist/package-manager-cli.code.js.map +1 -0
- package/dist/package-manager-cli.impl.js +36 -1067
- package/dist/package-manager-cli.impl.js.map +1 -1
- package/dist/package-manager-cli.js +11 -7
- package/dist/rpc-entry.js +2 -2
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/10.js +1 -1
- package/dist/startup-stages/11.js +1 -1
- package/dist/startup-stages/12.js +1 -1
- package/dist/startup-stages/13.js +1 -0
- package/dist/startup-stages/2.js +1 -7
- package/dist/startup-stages/3.js +6 -2
- package/dist/startup-stages/4.js +2 -1
- package/dist/startup-stages/5.js +1 -7
- package/dist/startup-stages/6.js +7 -10
- package/dist/startup-stages/7.js +10 -3
- package/dist/startup-stages/8.js +3 -6
- package/dist/startup-stages/9.js +6 -1
- package/dist/startup-stages/stages.json +1 -1
- package/dist/utils/canonical-path.js +2 -0
- package/dist/utils/canonical-path.js.map +1 -1
- package/dist/utils/child-process.d.ts +41 -1
- package/dist/utils/compile-cache-warmup-host.js +63 -18
- package/dist/utils/compile-cache-warmup-host.js.map +1 -1
- package/dist/utils/credential-redaction.d.ts +50 -1
- package/dist/utils/interactive-engine-bootstrap.d.ts +2 -0
- package/dist/utils/interactive-engine-env.d.ts +2 -0
- package/dist/utils/memoize-async.d.ts +32 -0
- package/dist/utils/memoize-async.js +91 -0
- package/dist/utils/memoize-async.js.map +1 -0
- package/dist/utils/photon.js +19 -29
- package/dist/utils/photon.js.map +1 -1
- package/dist/utils/shell.d.ts +7 -4
- package/dist/utils/startup-database-spare.code.js +108 -0
- package/dist/utils/startup-database-spare.code.js.map +1 -0
- package/dist/utils/startup-database-spare.impl.js +33 -105
- package/dist/utils/startup-database-spare.impl.js.map +1 -1
- package/dist/utils/startup-database-spare.js +11 -7
- package/dist/utils/tools-manager.code.js +3 -0
- package/dist/utils/tools-manager.code.js.map +1 -0
- package/dist/utils/tools-manager.impl.js +35 -2
- package/dist/utils/tools-manager.js +11 -7
- package/dist/utils/windows-cwd.js +585 -0
- package/dist/utils/windows-cwd.js.map +1 -0
- package/docs/extensions.md +1 -1
- package/docs/getting-started/installation.md +2 -0
- package/docs/intercom/operations.md +1 -0
- package/docs/reference/cli.md +1 -1
- package/package.json +24 -24
- package/dist/_shared/mode-shared-HP7GUA7J.js.map +0 -1
- package/dist/_shared/p1a-prewarm-YK3KDTLN.js.map +0 -1
- package/dist/_shared/p1b-elig-PXQA2FYP.js.map +0 -1
- package/dist/_shared/startup-0-0-X4NF3GKM.js.map +0 -1
- package/dist/_shared/startup-0-1-7QTG6VJZ.js.map +0 -1
- package/dist/_shared/startup-0-2-KFDYPDJK.js.map +0 -1
- package/dist/_shared/startup-8-1-KQJBDKRU.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { __commonJSMin, __toESM } from "./rolldown-runtime-BGM3D5V3.js";
|
|
2
|
-
import { CONFIG_DIR_NAME, createChildProcessEnvironment, findHelperExecutableAsync, getAgentConfigPaths, getAgentDir, getAgentDirs, getDocsPath, getProjectConfigDirs, getProjectConfigPaths, helperLaunchAsync, missingHelperOptions, normalizePath, require_cross_spawn, resolvePath, stripBom, waitForChildProcess } from "./p0-cli-
|
|
3
|
-
import { MAX_PERSISTED_OUTPUT_BYTES, McpConnectionClosedError, PERSISTED_OUTPUT_TRUNCATION_MARKER, STALE_EXTENSION_CONTEXT_MESSAGE, Stop, TOOL_RESULTS_SUBDIR, abortSymbol, asyncScope, bindReleasedTaskOwner, clearFunctionList, collectSecretsForMasking, combineMany, combineManyMut, containProcessTree, displayTodoId, fListSymbol, final, finalSymbol, finalValue, flushSymbol, flushable, getErrnoCode, getFinalValue, getFunctionList, getLockPath, getManyValues, hostInputError, isFinalValue, isFlushable, isFunctionList, isGitUnavailableError, isJsonRpcResponse, isLlamaServerUnreachableError, isMany, isStop, isValidThinkingLevel, many, manySymbol, minimatch, none, normalizeMany, observeArchiveLoad, processTreeEnded, providerOfModelReference, redactOAuthErrorText, removedProviderMessage, require_identity, resolveSchemaRef, scopedBackgroundTasks, scrubUnknownErrorData, serializeRetainedTranscript, sessionTasks, setDeprecationWarningSink, setFunctionList, spawnHostProcess, stop, stopErrorSymbol, str, toMany, writeRawStdoutControl } from "./startup-0-0-
|
|
4
|
-
import { LlamaClient, ReopenedCompletionHeaders, TransportEvents, WorkspaceConfigError, bindTaskClock, bodyWidths, columnWidths, convertImageBytesToPng, convertToLlm, createBranchSummaryMessage, createCustomMessage, createManagedTaskClocks, createVerbatimCompactionMessage, decideLayout, formatBytes, formatTokenSegment, isLocalOnlySessionStorage, isWorkspaceError, normalizeAzureSettings, normalizeLlamaServerUrl, normalizeMessageContent, normalizeModelReference, normalizeProviderKeys, require_toJS, require_visit, runWithProgress, serializeInteractiveEngineMessage, setCallbackActivityReporter, showLlamaUi, taskClockOf, taskClockRunning, taskClocksFor, unreadablePathError } from "./startup-0-1-
|
|
1
|
+
import { __commonJSMin, __name, __toESM } from "./rolldown-runtime-BGM3D5V3.js";
|
|
2
|
+
import { CONFIG_DIR_NAME, createChildProcessEnvironment, findHelperExecutableAsync, getAgentConfigPaths, getAgentDir, getAgentDirs, getDocsPath, getProjectConfigDirs, getProjectConfigPaths, helperLaunchAsync, isChildProcessExitStatusUnknownError, missingHelperOptions, normalizePath, require_cross_spawn, resolvePath, resolveSafeWindowsWorkingDirectoryAsync, stripBom, waitForChildProcess } from "./p0-cli-BB45ZQY6.js";
|
|
3
|
+
import { MAX_PERSISTED_OUTPUT_BYTES, McpConnectionClosedError, PERSISTED_OUTPUT_TRUNCATION_MARKER, STALE_EXTENSION_CONTEXT_MESSAGE, Stop, TOOL_RESULTS_SUBDIR, abortSymbol, asyncScope, bindReleasedTaskOwner, clearFunctionList, collectSecretsForMasking, combineMany, combineManyMut, containProcessTree, containProcessTreeAllowingBreakaway, displayTodoId, fListSymbol, final, finalSymbol, finalValue, flushSymbol, flushable, getErrnoCode, getFinalValue, getFunctionList, getLockPath, getManyValues, hasNativeProcessHold as hasNativeProcessHold$1, holdProcessDescendants, holdProcessDescendantsResult, hostInputError, isFinalValue, isFlushable, isFunctionList, isGitUnavailableError, isJsonRpcResponse, isLlamaServerUnreachableError, isMany, isStop, isValidThinkingLevel, many, manySymbol, minimatch, none, normalizeMany, observeArchiveLoad, processTreeEnded, providerOfModelReference, redactOAuthErrorText, removedProviderMessage, require_identity, resolveSchemaRef, scopedBackgroundTasks, scrubUnknownErrorData, serializeRetainedTranscript, sessionTasks, setDeprecationWarningSink, setFunctionList, spawnHostProcess, stop, stopErrorSymbol, str, toMany, writeRawStdoutControl } from "./startup-0-0-TYUFUOJZ.js";
|
|
4
|
+
import { LlamaClient, ReopenedCompletionHeaders, TransportEvents, WorkspaceConfigError, bindTaskClock, bodyWidths, columnWidths, convertImageBytesToPng, convertToLlm, createBranchSummaryMessage, createCustomMessage, createManagedTaskClocks, createVerbatimCompactionMessage, decideLayout, formatBytes, formatTokenSegment, isLocalOnlySessionStorage, isWorkspaceError, normalizeAzureSettings, normalizeLlamaServerUrl, normalizeMessageContent, normalizeModelReference, normalizeProviderKeys, require_toJS, require_visit, runWithProgress, serializeInteractiveEngineMessage, setCallbackActivityReporter, showLlamaUi, taskClockOf, taskClockRunning, taskClocksFor, unreadablePathError } from "./startup-0-1-D4LGGINF.js";
|
|
5
5
|
import { ansi256ToHex, fgAnsi, hexToRgb, singleLineDisplayText, theme } from "./p2-shell-main-B2WIALFD.js";
|
|
6
6
|
import { parseJsonFileContent, stripJsonComments } from "./p1-shared-RG5I5LJ6.js";
|
|
7
|
-
import { failureDebugFields, reportDebug, reportDebugAsync } from "./p1b-elig-
|
|
8
|
-
import { FileAuthStorageBackend, JsonRpcLineReader, LLAMA_PROVIDER_ID, ResumeCatalogTimeoutError, ResumeCatalogUnavailableError, ResumeNotFoundError, buildFallbackModel, captureChatSnapshot, createLlamaProvider, drainSessionWork, ensurePrivateTempDirAsync, ensureTempDirAsync, formatDimensionNote, formatWorkingElapsed, formatWorkingMeta, fun, gen, getShellConfig, getShellConfigAsync, getShellEnvAsync, getTempRootDir, hasCallingSessionWork, isProtectedSessionTempDir, isProviderLimitFailure, isProviderRateLimit, isResumeError, isTodoOperationError, killChildProcessTree, killProcessTree as killProcessTree$1, markDetachedChildExited, markProviderRateLimitObserved, normalizeDerivedSessionEntries, normalizeWorkingRunSnapshot, onSessionQuit, providerAdmissionTurn, providerLimitScope, providerRequestGate, recordProviderRateLimit, recordProviderRetryHint, recordProviderSuccess, require_Node, require_anchors, require_lib, require_semver, resizeImage, resolveModelReference, sessionLifetime, showStartupInput, showStartupSelector, startParentProcessGuardian, taskTranscriptSource, trackDetachedChildPid, trackSessionWork, tryAdmitProviderRequest, untrackDetachedChildPid, withBuiltinDiagnostics, wrapToolDefinition } from "./startup-0-2-
|
|
7
|
+
import { failureDebugFields, reportDebug, reportDebugAsync } from "./p1b-elig-ENCUPKKJ.js";
|
|
8
|
+
import { FileAuthStorageBackend, JsonRpcLineReader, LLAMA_PROVIDER_ID, ResumeCatalogTimeoutError, ResumeCatalogUnavailableError, ResumeNotFoundError, buildFallbackModel, captureChatSnapshot, createLlamaProvider, drainSessionWork, ensurePrivateTempDirAsync, ensureTempDirAsync, formatDimensionNote, formatWorkingElapsed, formatWorkingMeta, fun, gen, getShellConfig, getShellConfigAsync, getShellEnvAsync, getTempRootDir, hasCallingSessionWork, isProtectedSessionTempDir, isProviderLimitFailure, isProviderRateLimit, isResumeError, isTodoOperationError, killChildProcessTree, killProcessTree as killProcessTree$1, markDetachedChildExited, markProviderRateLimitObserved, normalizeDerivedSessionEntries, normalizeWorkingRunSnapshot, onSessionQuit, providerAdmissionTurn, providerLimitScope, providerRequestGate, recordProviderRateLimit, recordProviderRetryHint, recordProviderSuccess, require_Node, require_anchors, require_lib, require_semver, resizeImage, resolveModelReference, sessionLifetime, showStartupInput, showStartupSelector, startParentProcessGuardian, taskTranscriptSource, trackDetachedChildPid, trackSessionWork, tryAdmitProviderRequest, untrackDetachedChildPid, withBuiltinDiagnostics, wrapToolDefinition } from "./startup-0-2-SZGQIWHI.js";
|
|
9
9
|
import { findDecisionError, serializeDecisionError } from "./settings-startup-65YEWRV2.js";
|
|
10
10
|
import { SETTINGS_DEFAULTS } from "./p2-common-YLSYXMDQ.js";
|
|
11
|
-
import { interactiveEngineStartupEnv } from "./p1a-prewarm-
|
|
11
|
+
import { interactiveEngineStartupEnv } from "./p1a-prewarm-UQY3X2UK.js";
|
|
12
12
|
import fs, { lstat, mkdir, open, readFile, readdir, realpath, rename, rm, stat, unlink } from "node:fs/promises";
|
|
13
13
|
import { homedir } from "node:os";
|
|
14
14
|
import { dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
@@ -20,13 +20,14 @@ import { normalizeProviderId } from "@bastani/atomic-ai";
|
|
|
20
20
|
import { Loader, Text, stripTerminalSequences, truncateToWidth, visibleWidth } from "@bastani/atomic-tui";
|
|
21
21
|
import chalk from "chalk";
|
|
22
22
|
import { StorageUnavailableError, isRetryableStorageError } from "../core/storage/errors.js";
|
|
23
|
-
import { Type as Type$1 } from "@bastani/atomic-ai/utils/typebox/index";
|
|
24
23
|
import { createHash } from "node:crypto";
|
|
25
24
|
import { promisify } from "node:util";
|
|
26
25
|
import { modelsAreEqual } from "@bastani/atomic-ai/compat";
|
|
27
26
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
27
|
+
import { memoizeAsync } from "../utils/memoize-async.js";
|
|
28
28
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
29
29
|
import { isProxy } from "node:util/types";
|
|
30
|
+
import { Type as Type$1 } from "@bastani/atomic-ai/utils/typebox/index";
|
|
30
31
|
import process$1 from "node:process";
|
|
31
32
|
import { renderToolOutputType, renderToolSample, toCodemodeIdentifier } from "@bastani/atomic-codemode/declarations";
|
|
32
33
|
import { CODEMODE_SOURCE_GRAMMAR } from "@bastani/atomic-codemode/source";
|
|
@@ -327,15 +328,17 @@ async function runLoggedProcess(run, log, options) {
|
|
|
327
328
|
return new Promise((resolveExit, reject) => {
|
|
328
329
|
const tree = child.pid === void 0 ? void 0 : containProcessTree(child.pid);
|
|
329
330
|
const watch = stepProcessWatcher.getStore();
|
|
330
|
-
if (child.pid !== void 0) watch?.(child.pid, true);
|
|
331
|
+
if (child.pid !== void 0) watch?.(child.pid, true, () => child.exitCode === null && child.signalCode === null);
|
|
331
332
|
let timedOut = false;
|
|
332
333
|
let stopped = false;
|
|
333
334
|
let treeTerminated = false;
|
|
334
335
|
let warnedAboutDescendants = false;
|
|
335
336
|
let writeError;
|
|
336
337
|
let copying = Promise.resolve();
|
|
338
|
+
const waitAbort = new AbortController();
|
|
337
339
|
const stop = () => {
|
|
338
340
|
stopped = true;
|
|
341
|
+
waitAbort.abort();
|
|
339
342
|
if (!treeTerminated) treeTerminated = tree?.terminate() === true;
|
|
340
343
|
if (treeTerminated || child.pid === void 0) return;
|
|
341
344
|
const exited = child.exitCode !== null || child.signalCode !== null;
|
|
@@ -397,7 +400,7 @@ async function runLoggedProcess(run, log, options) {
|
|
|
397
400
|
spawnError: error
|
|
398
401
|
});
|
|
399
402
|
};
|
|
400
|
-
const ended = async (exitStatus, exitSignal) => {
|
|
403
|
+
const ended = async (exitStatus, exitSignal, exitError) => {
|
|
401
404
|
clearTimeout(timer);
|
|
402
405
|
options.signal?.removeEventListener("abort", onAbort);
|
|
403
406
|
await settleTree(tree, stopped);
|
|
@@ -415,10 +418,17 @@ async function runLoggedProcess(run, log, options) {
|
|
|
415
418
|
exitStatus,
|
|
416
419
|
signal: exitSignal,
|
|
417
420
|
timedOut,
|
|
418
|
-
elapsedMs: elapsedMs()
|
|
421
|
+
elapsedMs: elapsedMs(),
|
|
422
|
+
...exitError === void 0 ? {} : { exitError }
|
|
419
423
|
});
|
|
420
424
|
};
|
|
421
|
-
if (copiesOutput) waitForChildProcess(child).then((exitStatus) => ended(exitStatus, child.signalCode),
|
|
425
|
+
if (copiesOutput) waitForChildProcess(child, { signal: waitAbort.signal }).then((exitStatus) => ended(exitStatus, child.signalCode), (error) => {
|
|
426
|
+
if (isChildProcessExitStatusUnknownError(error)) {
|
|
427
|
+
ended(null, child.signalCode, timedOut || options.signal?.aborted ? void 0 : error);
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
onSpawnError(error);
|
|
431
|
+
});
|
|
422
432
|
else {
|
|
423
433
|
child.once("error", onSpawnError);
|
|
424
434
|
child.once("close", ended);
|
|
@@ -2181,12 +2191,7 @@ function boundaryCoveredIndex(path, boundary, boundaryIndex) {
|
|
|
2181
2191
|
const covered = path.findIndex((entry, index) => index < boundaryIndex && entry.id === boundary.coveredThroughEntryId);
|
|
2182
2192
|
return covered >= 0 ? covered : boundaryIndex - 1;
|
|
2183
2193
|
}
|
|
2184
|
-
|
|
2185
|
-
function buildContextEntries(entries, leafId, byId = new Map(entries.map((entry) => [entry.id, entry])), branch) {
|
|
2186
|
-
if (leafId === null) return [];
|
|
2187
|
-
const leaf = leafId ? byId.get(leafId) : entries[entries.length - 1];
|
|
2188
|
-
if (!leaf) return [];
|
|
2189
|
-
const path = normalizeDerivedSessionEntries(branch ?? getBranchPath(leaf.id, byId));
|
|
2194
|
+
function contextEntriesFromPath(path) {
|
|
2190
2195
|
const boundary = getLatestCompactionBoundaryEntry(path);
|
|
2191
2196
|
if (!boundary) return path;
|
|
2192
2197
|
const boundaryIndex = path.findIndex((entry) => entry.id === boundary.id);
|
|
@@ -2198,6 +2203,13 @@ function buildContextEntries(entries, leafId, byId = new Map(entries.map((entry)
|
|
|
2198
2203
|
...path.slice(boundaryIndex + 1)
|
|
2199
2204
|
];
|
|
2200
2205
|
}
|
|
2206
|
+
/** Return the active branch entries after applying the latest compaction boundary. */
|
|
2207
|
+
function buildContextEntries(entries, leafId, byId = new Map(entries.map((entry) => [entry.id, entry])), branch) {
|
|
2208
|
+
if (leafId === null) return [];
|
|
2209
|
+
const leaf = leafId ? byId.get(leafId) : entries[entries.length - 1];
|
|
2210
|
+
if (!leaf) return [];
|
|
2211
|
+
return contextEntriesFromPath(normalizeDerivedSessionEntries(branch ?? getBranchPath(leaf.id, byId)));
|
|
2212
|
+
}
|
|
2201
2213
|
/**
|
|
2202
2214
|
* Build provenance-preserving, compaction-aware model context.
|
|
2203
2215
|
*
|
|
@@ -2233,7 +2245,7 @@ function buildSessionProjection(entries, leafId, byId, sessionId, branch, purpos
|
|
|
2233
2245
|
const walked = branch ?? getBranchPath(leaf.id, byId);
|
|
2234
2246
|
const path = normalizeDerivedSessionEntries(walked);
|
|
2235
2247
|
const { thinkingLevel, model } = getSessionContextSettings(path);
|
|
2236
|
-
const contextEntries =
|
|
2248
|
+
const contextEntries = contextEntriesFromPath(path);
|
|
2237
2249
|
const edits = collectContextEdits(contextEntries);
|
|
2238
2250
|
const headers = new ReopenedCompletionHeaders(() => ({
|
|
2239
2251
|
entries: path,
|
|
@@ -2624,42 +2636,97 @@ const USE_PROCESS_GROUPS = process$1.platform !== "win32";
|
|
|
2624
2636
|
/** Process groups of running servers, killed if the host exits without closing them. */
|
|
2625
2637
|
const liveProcessGroups = /* @__PURE__ */ new Set();
|
|
2626
2638
|
let exitHookInstalled = false;
|
|
2639
|
+
function spawnWindowsTaskkill(child, pid, signal, cwd, onSettled) {
|
|
2640
|
+
if (child.exitCode !== null || child.signalCode !== null) {
|
|
2641
|
+
onSettled?.();
|
|
2642
|
+
return;
|
|
2643
|
+
}
|
|
2644
|
+
const systemRoot = process$1.env.SystemRoot || process$1.env.windir || "C:\\Windows";
|
|
2645
|
+
try {
|
|
2646
|
+
const kill = spawn(join(systemRoot, "System32", "taskkill.exe"), [
|
|
2647
|
+
"/pid",
|
|
2648
|
+
String(pid),
|
|
2649
|
+
"/T",
|
|
2650
|
+
"/F"
|
|
2651
|
+
], {
|
|
2652
|
+
...cwd === void 0 ? {} : { cwd },
|
|
2653
|
+
stdio: "ignore",
|
|
2654
|
+
windowsHide: true
|
|
2655
|
+
});
|
|
2656
|
+
return new Promise((resolve) => {
|
|
2657
|
+
let settled = false;
|
|
2658
|
+
const finish = (fallback) => {
|
|
2659
|
+
if (settled) return;
|
|
2660
|
+
settled = true;
|
|
2661
|
+
onSettled?.();
|
|
2662
|
+
if (fallback && child.exitCode === null && child.signalCode === null) try {
|
|
2663
|
+
child.kill(signal);
|
|
2664
|
+
} catch {}
|
|
2665
|
+
resolve();
|
|
2666
|
+
};
|
|
2667
|
+
kill.once("error", () => finish(true));
|
|
2668
|
+
kill.once("exit", (code) => finish(code !== 0));
|
|
2669
|
+
});
|
|
2670
|
+
} catch {}
|
|
2671
|
+
onSettled?.();
|
|
2672
|
+
try {
|
|
2673
|
+
child.kill(signal);
|
|
2674
|
+
} catch {}
|
|
2675
|
+
}
|
|
2676
|
+
function holdDescendantsStatus$1(pid) {
|
|
2677
|
+
if (holdProcessDescendantsResult !== void 0) return holdProcessDescendantsResult(pid);
|
|
2678
|
+
const held = holdProcessDescendants?.(pid);
|
|
2679
|
+
return held === void 0 ? { kind: "unavailable" } : {
|
|
2680
|
+
kind: "held",
|
|
2681
|
+
held
|
|
2682
|
+
};
|
|
2683
|
+
}
|
|
2684
|
+
__name(holdDescendantsStatus$1, "holdDescendantsStatus");
|
|
2685
|
+
function hasNativeProcessHold() {
|
|
2686
|
+
return hasNativeProcessHold$1?.() ?? false;
|
|
2687
|
+
}
|
|
2688
|
+
function treeRunning$1(tree) {
|
|
2689
|
+
try {
|
|
2690
|
+
return tree !== void 0 && tree.activeProcesses() > 0;
|
|
2691
|
+
} catch {
|
|
2692
|
+
return false;
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
__name(treeRunning$1, "treeRunning");
|
|
2627
2696
|
/**
|
|
2628
|
-
* Ends `child` and the processes it started. On Windows
|
|
2629
|
-
*
|
|
2630
|
-
*
|
|
2697
|
+
* Ends `child` and the processes it started. On Windows with the native module, uses handle-verified
|
|
2698
|
+
* `holdProcessDescendantsResult` + the breakaway-allowing Job object (never spawning bare-PID `taskkill`).
|
|
2699
|
+
* Only when the native module is unavailable and the child handle is still live does it fall back to
|
|
2700
|
+
* `spawnWindowsTaskkill` in a verified safe working directory.
|
|
2631
2701
|
*/
|
|
2632
|
-
function killProcessTree(child, signal, onSettled) {
|
|
2702
|
+
function killProcessTree(child, signal, onSettled, windowsKillCwd, windowsTree) {
|
|
2633
2703
|
const pid = child.pid;
|
|
2634
2704
|
if (process$1.platform === "win32" && pid !== void 0) {
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
kill.once("exit", (code) => finish(code !== 0));
|
|
2661
|
-
});
|
|
2662
|
-
} catch {}
|
|
2705
|
+
const live = child.exitCode === null && child.signalCode === null;
|
|
2706
|
+
let hold = { kind: "unavailable" };
|
|
2707
|
+
let holdEnded = false;
|
|
2708
|
+
if (live) {
|
|
2709
|
+
hold = holdDescendantsStatus$1(pid);
|
|
2710
|
+
holdEnded = hold.kind === "held" && hold.held.endAll();
|
|
2711
|
+
}
|
|
2712
|
+
if (windowsTree !== void 0 && !windowsTree.treeTerminated && windowsTree.tree !== void 0) windowsTree.treeTerminated = windowsTree.tree.terminate() === true;
|
|
2713
|
+
if (windowsTree?.treeTerminated || holdEnded) {
|
|
2714
|
+
onSettled?.();
|
|
2715
|
+
return;
|
|
2716
|
+
}
|
|
2717
|
+
if (!live) {
|
|
2718
|
+
onSettled?.();
|
|
2719
|
+
return;
|
|
2720
|
+
}
|
|
2721
|
+
if (hold.kind !== "unavailable") {
|
|
2722
|
+
onSettled?.();
|
|
2723
|
+
if (child.exitCode === null && child.signalCode === null) try {
|
|
2724
|
+
child.kill(signal);
|
|
2725
|
+
} catch {}
|
|
2726
|
+
return;
|
|
2727
|
+
}
|
|
2728
|
+
if (windowsKillCwd !== void 0 && !windowsKillCwd.done && windowsKillCwd.pending !== void 0) return windowsKillCwd.pending.then((safeCwd) => spawnWindowsTaskkill(child, pid, signal, safeCwd, onSettled));
|
|
2729
|
+
return spawnWindowsTaskkill(child, pid, signal, windowsKillCwd?.value, onSettled);
|
|
2663
2730
|
}
|
|
2664
2731
|
if (USE_PROCESS_GROUPS && pid !== void 0) try {
|
|
2665
2732
|
process$1.kill(-pid, signal);
|
|
@@ -2835,11 +2902,15 @@ const NON_SECRET_STDIO_ENV_VARS = /* @__PURE__ */ new Set([
|
|
|
2835
2902
|
var StdioTransport = class extends TransportEvents {
|
|
2836
2903
|
options;
|
|
2837
2904
|
child;
|
|
2905
|
+
processTree;
|
|
2838
2906
|
lines;
|
|
2839
2907
|
started = false;
|
|
2840
2908
|
closed = false;
|
|
2841
2909
|
/** Ends a lookup of the server's program that `close()` cuts short. */
|
|
2842
2910
|
lookup = new AbortController();
|
|
2911
|
+
killCwdOptions() {
|
|
2912
|
+
return { protectedDirs: [this.options.projectCwd, this.options.cwd] };
|
|
2913
|
+
}
|
|
2843
2914
|
constructor(options) {
|
|
2844
2915
|
super();
|
|
2845
2916
|
this.options = Object.freeze({
|
|
@@ -2932,6 +3003,7 @@ var StdioTransport = class extends TransportEvents {
|
|
|
2932
3003
|
});
|
|
2933
3004
|
this.child = child;
|
|
2934
3005
|
const pid = child.pid;
|
|
3006
|
+
if (process$1.platform === "win32" && pid !== void 0) this.processTree = containProcessTreeAllowingBreakaway?.(pid);
|
|
2935
3007
|
if (USE_PROCESS_GROUPS && pid !== void 0) {
|
|
2936
3008
|
installExitHook();
|
|
2937
3009
|
liveProcessGroups.add(pid);
|
|
@@ -2956,6 +3028,8 @@ var StdioTransport = class extends TransportEvents {
|
|
|
2956
3028
|
};
|
|
2957
3029
|
const onError = (error) => {
|
|
2958
3030
|
child.off("spawn", onSpawn);
|
|
3031
|
+
this.processTree?.close();
|
|
3032
|
+
this.processTree = void 0;
|
|
2959
3033
|
reject(error);
|
|
2960
3034
|
};
|
|
2961
3035
|
child.once("spawn", onSpawn);
|
|
@@ -2978,50 +3052,117 @@ var StdioTransport = class extends TransportEvents {
|
|
|
2978
3052
|
this.closed = true;
|
|
2979
3053
|
this.lookup.abort();
|
|
2980
3054
|
const child = this.child;
|
|
3055
|
+
const tree = this.processTree;
|
|
3056
|
+
this.processTree = void 0;
|
|
3057
|
+
const closeTimeoutMs = this.options.closeTimeoutMs ?? DEFAULT_CLOSE_TIMEOUT_MS;
|
|
2981
3058
|
if (!child) {
|
|
3059
|
+
tree?.release();
|
|
3060
|
+
tree?.close();
|
|
2982
3061
|
this.emitClose();
|
|
2983
3062
|
return;
|
|
2984
3063
|
}
|
|
2985
|
-
if (
|
|
3064
|
+
if (process$1.platform === "win32" && (child.exitCode !== null || child.signalCode !== null)) {
|
|
2986
3065
|
child.stdin?.end();
|
|
3066
|
+
tree?.release();
|
|
3067
|
+
tree?.close();
|
|
2987
3068
|
return;
|
|
2988
3069
|
}
|
|
2989
|
-
const closeTimeoutMs = this.options.closeTimeoutMs ?? DEFAULT_CLOSE_TIMEOUT_MS;
|
|
2990
3070
|
/** The kill commands this close started that are still running, waited for once the server has closed. */
|
|
2991
3071
|
const kills = /* @__PURE__ */ new Set();
|
|
3072
|
+
const closeAbort = new AbortController();
|
|
3073
|
+
const windowsTreeState = {
|
|
3074
|
+
tree,
|
|
3075
|
+
treeTerminated: false
|
|
3076
|
+
};
|
|
3077
|
+
let forcedKill = false;
|
|
3078
|
+
let treeReleased = false;
|
|
3079
|
+
const releaseTree = () => {
|
|
3080
|
+
if (treeReleased || tree === void 0) return;
|
|
3081
|
+
treeReleased = true;
|
|
3082
|
+
tree.release();
|
|
3083
|
+
};
|
|
3084
|
+
const windowsKillCwd = {
|
|
3085
|
+
done: true,
|
|
3086
|
+
value: void 0,
|
|
3087
|
+
pending: void 0
|
|
3088
|
+
};
|
|
3089
|
+
const startWindowsKillCwd = () => {
|
|
3090
|
+
if (process$1.platform !== "win32") return;
|
|
3091
|
+
if (tree !== void 0 || hasNativeProcessHold()) return;
|
|
3092
|
+
const systemRoot = process$1.env.SystemRoot || process$1.env.windir || "C:\\Windows";
|
|
3093
|
+
const taskkillPath = join(systemRoot, "System32", "taskkill.exe");
|
|
3094
|
+
const budgetMs = Math.min(100, Math.max(20, closeTimeoutMs));
|
|
3095
|
+
windowsKillCwd.done = false;
|
|
3096
|
+
windowsKillCwd.pending = resolveSafeWindowsWorkingDirectoryAsync({
|
|
3097
|
+
...this.killCwdOptions(),
|
|
3098
|
+
commandPath: taskkillPath,
|
|
3099
|
+
preferCommandDir: true,
|
|
3100
|
+
timeoutMs: budgetMs,
|
|
3101
|
+
signal: closeAbort.signal
|
|
3102
|
+
}).then((safeCwd) => {
|
|
3103
|
+
windowsKillCwd.done = true;
|
|
3104
|
+
windowsKillCwd.value = safeCwd;
|
|
3105
|
+
return safeCwd;
|
|
3106
|
+
}, () => {
|
|
3107
|
+
windowsKillCwd.done = true;
|
|
3108
|
+
windowsKillCwd.value = void 0;
|
|
3109
|
+
});
|
|
3110
|
+
};
|
|
2992
3111
|
const kill = (signal) => {
|
|
2993
3112
|
let settled = false;
|
|
2994
|
-
|
|
3113
|
+
let pending;
|
|
3114
|
+
pending = killProcessTree(child, signal, () => {
|
|
2995
3115
|
settled = true;
|
|
2996
3116
|
if (pending !== void 0) kills.delete(pending);
|
|
2997
|
-
});
|
|
3117
|
+
}, windowsKillCwd, windowsTreeState);
|
|
2998
3118
|
if (pending !== void 0 && !settled) kills.add(pending);
|
|
2999
3119
|
};
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3120
|
+
try {
|
|
3121
|
+
await new Promise((resolve) => {
|
|
3122
|
+
const timers = [];
|
|
3123
|
+
let childClosed = false;
|
|
3124
|
+
child.once("close", () => {
|
|
3125
|
+
childClosed = true;
|
|
3126
|
+
closeAbort.abort();
|
|
3127
|
+
for (const timer of timers) clearTimeout(timer);
|
|
3128
|
+
if (process$1.platform !== "win32") kill("SIGTERM");
|
|
3129
|
+
else if (forcedKill) {
|
|
3130
|
+
if (tree === void 0 || treeRunning$1(tree)) kill("SIGTERM");
|
|
3131
|
+
} else releaseTree();
|
|
3132
|
+
const needsTreeDrain = forcedKill && tree !== void 0 && treeRunning$1(tree);
|
|
3133
|
+
if (kills.size === 0 && !needsTreeDrain) {
|
|
3134
|
+
resolve();
|
|
3135
|
+
return;
|
|
3136
|
+
}
|
|
3137
|
+
const waits = [...kills];
|
|
3138
|
+
if (needsTreeDrain) waits.push(processTreeEnded(tree, closeTimeoutMs));
|
|
3139
|
+
const bound = setTimeout(resolve, closeTimeoutMs);
|
|
3140
|
+
Promise.all(waits).then(() => {
|
|
3141
|
+
clearTimeout(bound);
|
|
3142
|
+
resolve();
|
|
3143
|
+
});
|
|
3013
3144
|
});
|
|
3145
|
+
const grace = Math.min(STDIN_CLOSE_GRACE_MS, closeTimeoutMs);
|
|
3146
|
+
timers.push(setTimeout(() => {
|
|
3147
|
+
forcedKill = true;
|
|
3148
|
+
kill("SIGTERM");
|
|
3149
|
+
}, grace));
|
|
3150
|
+
timers.push(setTimeout(() => {
|
|
3151
|
+
forcedKill = true;
|
|
3152
|
+
kill("SIGKILL");
|
|
3153
|
+
}, grace + closeTimeoutMs));
|
|
3154
|
+
timers.push(setTimeout(() => {
|
|
3155
|
+
child.stdin?.destroy();
|
|
3156
|
+
child.stdout?.destroy();
|
|
3157
|
+
child.stderr?.destroy();
|
|
3158
|
+
}, grace + closeTimeoutMs + PIPE_RELEASE_AFTER_KILL_MS));
|
|
3159
|
+
child.stdin?.end();
|
|
3160
|
+
if (!childClosed) startWindowsKillCwd();
|
|
3014
3161
|
});
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
child.stdin?.destroy();
|
|
3020
|
-
child.stdout?.destroy();
|
|
3021
|
-
child.stderr?.destroy();
|
|
3022
|
-
}, grace + closeTimeoutMs + PIPE_RELEASE_AFTER_KILL_MS));
|
|
3023
|
-
child.stdin?.end();
|
|
3024
|
-
});
|
|
3162
|
+
} finally {
|
|
3163
|
+
if (!forcedKill) releaseTree();
|
|
3164
|
+
tree?.close();
|
|
3165
|
+
}
|
|
3025
3166
|
}
|
|
3026
3167
|
};
|
|
3027
3168
|
// dist/core/tools/bash-leading-cd.js
|
|
@@ -3598,29 +3739,67 @@ var ChildTaskWaits = class {
|
|
|
3598
3739
|
const WORKSPACE_PROCESS_STOP_GRACE_MS = 5e3;
|
|
3599
3740
|
/** How often a stopped run looks again whether the rest of its process group has exited. */
|
|
3600
3741
|
const GROUP_EXIT_POLL_MS = 50;
|
|
3742
|
+
/** How often a stopped Windows run checks whether its contained Job object has drained. */
|
|
3743
|
+
const TREE_EXIT_POLL_MS = 5;
|
|
3601
3744
|
const MAX_TIMER_DELAY_MS = 2147483647;
|
|
3602
3745
|
/** On POSIX each process runs in its own process group, so stopping it also stops what it started. */
|
|
3603
3746
|
const OWN_PROCESS_GROUP = process.platform !== "win32";
|
|
3604
3747
|
function errnoCode(error) {
|
|
3605
3748
|
return error.code;
|
|
3606
3749
|
}
|
|
3750
|
+
function holdDescendantsStatus(pid) {
|
|
3751
|
+
if (holdProcessDescendantsResult !== void 0) return holdProcessDescendantsResult(pid);
|
|
3752
|
+
const held = holdProcessDescendants?.(pid);
|
|
3753
|
+
return held === void 0 ? { kind: "unavailable" } : {
|
|
3754
|
+
kind: "held",
|
|
3755
|
+
held
|
|
3756
|
+
};
|
|
3757
|
+
}
|
|
3758
|
+
function treeRunning(tree) {
|
|
3759
|
+
try {
|
|
3760
|
+
return tree !== void 0 && tree.activeProcesses() > 0;
|
|
3761
|
+
} catch {
|
|
3762
|
+
return false;
|
|
3763
|
+
}
|
|
3764
|
+
}
|
|
3765
|
+
function stopWindowsTree(child, tree, state) {
|
|
3766
|
+
const pid = child.pid;
|
|
3767
|
+
const live = pid !== void 0 && child.exitCode === null && child.signalCode === null;
|
|
3768
|
+
let hold = { kind: "unavailable" };
|
|
3769
|
+
let holdEnded = false;
|
|
3770
|
+
if (live) {
|
|
3771
|
+
hold = holdDescendantsStatus(pid);
|
|
3772
|
+
holdEnded = hold.kind === "held" && hold.held.endAll();
|
|
3773
|
+
}
|
|
3774
|
+
if (!state.treeTerminated && tree !== void 0) state.treeTerminated = tree.terminate() === true;
|
|
3775
|
+
if (state.treeTerminated || holdEnded || !live) return;
|
|
3776
|
+
if (hold.kind === "unavailable") {
|
|
3777
|
+
if (killChildProcessTree !== void 0) killChildProcessTree(child, false);
|
|
3778
|
+
else killProcessTree$1(pid);
|
|
3779
|
+
return;
|
|
3780
|
+
}
|
|
3781
|
+
try {
|
|
3782
|
+
child.kill("SIGKILL");
|
|
3783
|
+
} catch {}
|
|
3784
|
+
}
|
|
3607
3785
|
/**
|
|
3608
3786
|
* Ask a process and the processes it started to stop. On POSIX its group gets SIGTERM, which git catches to remove a
|
|
3609
|
-
* half-added worktree; Windows has no such signal, so
|
|
3787
|
+
* half-added worktree; Windows has no such signal, so its tree is ended through its Job object and native handles, and
|
|
3788
|
+
* a later bind repairs what is left.
|
|
3610
3789
|
*/
|
|
3611
|
-
function terminate(child) {
|
|
3612
|
-
if (child.pid === void 0) return;
|
|
3790
|
+
function terminate(child, tree, state) {
|
|
3613
3791
|
if (!OWN_PROCESS_GROUP) {
|
|
3614
|
-
|
|
3792
|
+
stopWindowsTree(child, tree, state);
|
|
3615
3793
|
return;
|
|
3616
3794
|
}
|
|
3795
|
+
if (child.pid === void 0) return;
|
|
3617
3796
|
try {
|
|
3618
3797
|
process.kill(-child.pid, "SIGTERM");
|
|
3619
3798
|
} catch (error) {
|
|
3620
3799
|
if (errnoCode(error) !== "ESRCH") child.kill("SIGTERM");
|
|
3621
3800
|
}
|
|
3622
3801
|
}
|
|
3623
|
-
/** Whether a process of the group `pid` leads still runs
|
|
3802
|
+
/** Whether a process of the group `pid` leads still runs on POSIX. */
|
|
3624
3803
|
function groupRunning(pid) {
|
|
3625
3804
|
if (!OWN_PROCESS_GROUP) return false;
|
|
3626
3805
|
try {
|
|
@@ -3648,27 +3827,50 @@ function runWorkspaceProcess(run) {
|
|
|
3648
3827
|
],
|
|
3649
3828
|
detached: OWN_PROCESS_GROUP
|
|
3650
3829
|
});
|
|
3830
|
+
const tree = !OWN_PROCESS_GROUP && child.pid !== void 0 ? containProcessTreeAllowingBreakaway?.(child.pid) : void 0;
|
|
3651
3831
|
const stdout = [];
|
|
3652
3832
|
const stderr = [];
|
|
3653
3833
|
let escalation;
|
|
3654
3834
|
let groupPoll;
|
|
3835
|
+
let settled = false;
|
|
3836
|
+
const stopState = { treeTerminated: false };
|
|
3655
3837
|
/** Set once the process is being stopped: how the call fails once it has exited, or after the grace. */
|
|
3656
3838
|
let stopped;
|
|
3657
3839
|
const settle = (finish) => {
|
|
3840
|
+
if (settled) return;
|
|
3841
|
+
settled = true;
|
|
3658
3842
|
clearTimeout(timer);
|
|
3659
3843
|
clearTimeout(escalation);
|
|
3660
3844
|
clearTimeout(groupPoll);
|
|
3661
3845
|
run.signal?.removeEventListener("abort", onAbort);
|
|
3846
|
+
if (stopped === void 0) tree?.release();
|
|
3847
|
+
tree?.close();
|
|
3662
3848
|
finish();
|
|
3663
3849
|
};
|
|
3850
|
+
/**
|
|
3851
|
+
* A stopped run fails once its process and every process of its group (or Windows Job object) are gone. A helper
|
|
3852
|
+
* that ignores SIGTERM and let go of the output streams keeps the group, so the grace's kill stays armed for it.
|
|
3853
|
+
*/
|
|
3854
|
+
const settleWhenStopped = () => {
|
|
3855
|
+
if (settled || stopped === void 0) return;
|
|
3856
|
+
if (child.exitCode === null && child.signalCode === null) return;
|
|
3857
|
+
clearTimeout(groupPoll);
|
|
3858
|
+
if (OWN_PROCESS_GROUP ? child.pid !== void 0 && groupRunning(child.pid) : treeRunning(tree)) groupPoll = setTimeout(settleWhenStopped, OWN_PROCESS_GROUP ? GROUP_EXIT_POLL_MS : TREE_EXIT_POLL_MS);
|
|
3859
|
+
else settle(stopped);
|
|
3860
|
+
};
|
|
3664
3861
|
const stop = (failure) => {
|
|
3665
3862
|
if (stopped !== void 0) return;
|
|
3666
3863
|
stopped = failure;
|
|
3667
|
-
terminate(child);
|
|
3864
|
+
terminate(child, tree, stopState);
|
|
3668
3865
|
escalation = setTimeout(() => {
|
|
3669
|
-
|
|
3866
|
+
if (!OWN_PROCESS_GROUP) stopWindowsTree(child, tree, stopState);
|
|
3867
|
+
else if (child.pid !== void 0) {
|
|
3868
|
+
if (killChildProcessTree !== void 0) killChildProcessTree(child, child.exitCode !== null || child.signalCode !== null);
|
|
3869
|
+
else killProcessTree$1(child.pid);
|
|
3870
|
+
}
|
|
3670
3871
|
settle(failure);
|
|
3671
3872
|
}, WORKSPACE_PROCESS_STOP_GRACE_MS);
|
|
3873
|
+
if (child.exitCode !== null || child.signalCode !== null) settleWhenStopped();
|
|
3672
3874
|
};
|
|
3673
3875
|
const onAbort = () => stop(() => reject(run.signal.reason));
|
|
3674
3876
|
let timer;
|
|
@@ -3697,16 +3899,6 @@ function runWorkspaceProcess(run) {
|
|
|
3697
3899
|
});
|
|
3698
3900
|
});
|
|
3699
3901
|
});
|
|
3700
|
-
/**
|
|
3701
|
-
* A stopped run fails once its process and every process of its group are gone. A helper that ignores SIGTERM and
|
|
3702
|
-
* let go of the output streams keeps the group, so the grace's group kill stays armed for it.
|
|
3703
|
-
*/
|
|
3704
|
-
const settleWhenStopped = () => {
|
|
3705
|
-
if (child.exitCode === null && child.signalCode === null) return;
|
|
3706
|
-
clearTimeout(groupPoll);
|
|
3707
|
-
if (groupRunning(child.pid)) groupPoll = setTimeout(settleWhenStopped, GROUP_EXIT_POLL_MS);
|
|
3708
|
-
else settle(stopped);
|
|
3709
|
-
};
|
|
3710
3902
|
child.on("exit", () => {
|
|
3711
3903
|
if (stopped !== void 0) settleWhenStopped();
|
|
3712
3904
|
});
|
|
@@ -3933,19 +4125,10 @@ function prepareLoadout(loadout, options) {
|
|
|
3933
4125
|
hiddenDeclarations: only ? callable.filter((tool) => loadout.getExposure(tool.name) === "direct").map((tool) => tool.name) : []
|
|
3934
4126
|
};
|
|
3935
4127
|
}
|
|
3936
|
-
|
|
3937
|
-
let loadingCodemodeRenderers;
|
|
4128
|
+
const codemodeRenderers = memoizeAsync(() => import("../extensions/codemode/renderer.code.js").catch((error) => __atomicOnDemandFailed(error, "codemode")).then((mod) => mod.codemodeRenderers));
|
|
3938
4129
|
/** Load the rich codemode result renderer (syntax highlighter + nested ToolBlock group) on first use. */
|
|
3939
4130
|
function loadCodemodeRenderers() {
|
|
3940
|
-
|
|
3941
|
-
loadingCodemodeRenderers ??= import("../extensions/codemode/renderer.impl.js").then((mod) => {
|
|
3942
|
-
loadedCodemodeRenderers = mod.codemodeRenderers;
|
|
3943
|
-
return mod.codemodeRenderers;
|
|
3944
|
-
}, (error) => {
|
|
3945
|
-
loadingCodemodeRenderers = void 0;
|
|
3946
|
-
throw error;
|
|
3947
|
-
});
|
|
3948
|
-
return loadingCodemodeRenderers;
|
|
4131
|
+
return codemodeRenderers();
|
|
3949
4132
|
}
|
|
3950
4133
|
var LightweightCodemodeCall = class {
|
|
3951
4134
|
code;
|
|
@@ -3979,15 +4162,17 @@ function createCodemodeToolDefinition(options = {}) {
|
|
|
3979
4162
|
variants: { openai_lark: CODEMODE_SOURCE_GRAMMAR }
|
|
3980
4163
|
},
|
|
3981
4164
|
execute: async (id, input, signal, update, ctx) => {
|
|
3982
|
-
const [{ executeCodemode }] = await Promise.all([import("../extensions/codemode/execute.
|
|
4165
|
+
const [{ executeCodemode }] = await Promise.all([import("../extensions/codemode/execute.code.js").catch((error) => __atomicOnDemandFailed(error, "codemode")), ctx?.hasUI ? loadCodemodeRenderers().catch(() => void 0) : Promise.resolve(void 0)]);
|
|
3983
4166
|
return executeCodemode(id, input, signal, update, ctx, options);
|
|
3984
4167
|
},
|
|
3985
4168
|
renderCall(args, theme, context) {
|
|
3986
|
-
|
|
4169
|
+
const loaded = codemodeRenderers.peek();
|
|
4170
|
+
if (loaded?.renderCall) return loaded.renderCall(args, theme, context);
|
|
3987
4171
|
return new LightweightCodemodeCall(str(args?.code), theme);
|
|
3988
4172
|
},
|
|
3989
4173
|
renderResult(result, renderOptions, theme, context) {
|
|
3990
|
-
|
|
4174
|
+
const loaded = codemodeRenderers.peek();
|
|
4175
|
+
if (loaded?.renderResult) return loaded.renderResult(result, renderOptions, theme, context);
|
|
3991
4176
|
loadCodemodeRenderers().catch(() => void 0);
|
|
3992
4177
|
const text = result.content.find((block) => block.type === "text")?.text ?? "";
|
|
3993
4178
|
return new Text(theme.fg(context.isError ? "error" : "toolOutput", text), 0, 0);
|
|
@@ -5681,4 +5866,49 @@ function startInteractiveEngineLiveness(write) {
|
|
|
5681
5866
|
}
|
|
5682
5867
|
export { AtomicWorkedStatusComponent, AtomicWorkingLoader, AtomicWorkingStatusComponent, CODEMODE_DOCS_PATH, CODEMODE_STORE_ENTRY_TYPE, CODEMODE_TOOL_NAME, ChildTaskWaits, DEFAULT_WORKING_MESSAGE, DEFAULT_WORKTREE_SNAPSHOT_SETTINGS, ENVIRONMENT_INPUT_FILES, FileModelsStore, InMemoryCodingAgentModelsStore, LEAF_MOVE_ENTRY_TYPE, OwnerTaskStore, PersistedOutputFile, PreviewPane, RESUME_CATALOG_TIMEOUT_MS, StdioTransport, admitProviderStream, appendToLog, applyContextEdit, assertExtensionAction, assistantRetryAttempt, atomicWorkingFrame, atomicWorkingGlyph, bindExtensionWork, bindOwnerTaskStore, buildContextEntries, buildProcessStarting, buildSessionContext, buildSessionIndex, buildSessionProjection, buildSessionTree, capPersistedText, clearConfigValueCache, collectContextEdits, completeUtf8PrefixLength, computeEnvironmentHash, containsConfiguredValue, createChildCommandTaskOwner, createCodemodeDescription, createCodemodeTool, createCodemodeToolDefinition, createProjectTrustContext, deliverToLaunchingSession, drainExtensionWork, extensionSessionSignal, extensionWorkOpen, fallbackKey, finishLlamaAfterQuit, forgetChildDelivery, getBaseDirForScope, getBaseDirsForScope, getBranchPath, getCodemodeCallableTools, getConfigValueEnvVarNames, getGitInstallPath, getGitInstallRoot, getHomeDir, getInstalledGitInstallPath, getLatestCompactionBoundaryEntry, getNpmInstallRoot, getOwnerTaskSession, getOwnerTaskStore, getSessionLeafId, ignoredProjectSettingsWarning, inExtensionCleanup, isCommandConfigValue, isConfigValueConfigured, isLeafMoveEntry, isLegacyEnvVarNameConfigValue, isResumeFailure, isRetiredExtensionCleanup, isTaskTurnInterrupted, llamaExtension, loadArchiveSnapshot, loadCodemodeRenderers, logTail, migrateAzureProvider, migrateAzureProviderAsync, onExtensionSessionQuit, openStepLog, parseGitUrl, processImage, require_Alias, require_Scalar, require_compare, require_compare_build, require_inc, require_major, require_minor, require_parse, require_patch, resolveCliModel, resolveConfigValue, resolveConfigValueAsync, resolveConfigValueOrThrowAsync, resolveFallbackModel, resolveFallbackModelWithoutCredentials, resolveHeadersOrThrow, resolveHeadersOrThrowAsync, resolveManagerPath, resolveModelScopeFromModels, resolveModelScopeWithDiagnostics, resolvePathFromBase, resolveWorktreeSnapshotSettings, resumeExtensionWork, resumeFailureMessage, resumeLookupError, resumeNotFoundError, revokeExtensionAuthority, runExtensionCleanup, runLoggedProcess, runWorkspaceProcess, scheduleSessionTempCleanup, sealExtensionWork, sessionEntryToContextMessages, sessionEntryToDisplayMessages, setTaskTurnInterrupted, sha256Hex, snapshotBlob, splitFallbackModel, startElapsedMs, startInteractiveEngineLiveness, stepProcessWatcher, stepStartingWatcher, stripLeadingCdCommandAsync, taskResumedTurns, toCodemodeDeclaration, trackExtensionWork, waitFor, watchAtomicWorkingClock, watchOwnerTaskStoreBinding, withResumeLookupDeadline, withTodoLock, workingMessageColumns, wrapRegisteredTool, wrapRegisteredTools };
|
|
5683
5868
|
|
|
5684
|
-
//# sourceMappingURL=startup-0-3-T4DVFYWX.js.map
|
|
5869
|
+
//# sourceMappingURL=startup-0-3-T4DVFYWX.js.map
|
|
5870
|
+
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
5871
|
+
// demand that fails in a process an in-place update left running says to restart.
|
|
5872
|
+
function __atomicOnDemandFailed(error, feature) {
|
|
5873
|
+
return (async () => {
|
|
5874
|
+
const root = new URL("../", import.meta.url);
|
|
5875
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
5876
|
+
const key = `${root.href}#0.10.5-alpha.1`;
|
|
5877
|
+
let release = releases.get(key);
|
|
5878
|
+
if (release === undefined) {
|
|
5879
|
+
const current = (async () => {
|
|
5880
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
5881
|
+
try {
|
|
5882
|
+
const held = await import(new URL(path, root).href);
|
|
5883
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
5884
|
+
} catch {
|
|
5885
|
+
// Not a file this process can load: the next.
|
|
5886
|
+
}
|
|
5887
|
+
}
|
|
5888
|
+
return undefined;
|
|
5889
|
+
})().then((found) => {
|
|
5890
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
5891
|
+
return found;
|
|
5892
|
+
});
|
|
5893
|
+
releases.set(key, current);
|
|
5894
|
+
release = current;
|
|
5895
|
+
}
|
|
5896
|
+
const running = await release;
|
|
5897
|
+
let installed;
|
|
5898
|
+
try {
|
|
5899
|
+
const { readFile } = process.getBuiltinModule("node:fs/promises");
|
|
5900
|
+
installed = JSON.parse(await readFile(new URL("../package.json", root), "utf8")).version;
|
|
5901
|
+
} catch {
|
|
5902
|
+
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
5903
|
+
}
|
|
5904
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.5-alpha.1" ? installed : running !== undefined && running.version !== "0.10.5-alpha.1" ? "0.10.5-alpha.1" : undefined;
|
|
5905
|
+
if (updatedTo === undefined) throw error;
|
|
5906
|
+
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
5907
|
+
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|
|
5908
|
+
cause: error,
|
|
5909
|
+
});
|
|
5910
|
+
restart.name = "UpdatedInstallError";
|
|
5911
|
+
restart[Symbol.for("atomic.on-demand-restart.v1")] = { application, updatedTo, feature };
|
|
5912
|
+
throw restart;
|
|
5913
|
+
})();
|
|
5914
|
+
}
|