@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,18 +1,17 @@
|
|
|
1
1
|
import { __name } from "./rolldown-runtime-BGM3D5V3.js";
|
|
2
|
-
import { AgentSessionBusyError, SESSION_HISTORY_TOOL_NAME, TOOL_DEACTIVATION_ENTRY_TYPE, ToolDetachmentError, abandonedToolResult, assertToolPairingInvariant, awaitBlueprintReady, beginQueuedMessageDelivery, blueprintBuildPending, cancelHeldInput, createSyntheticSourceInfo, customMessageExcludesContext, drainAgentMessageQueue, earlierHeldInputs, endQueuedMessageDelivery, finishHeldInput, formatNoModelSelectedMessage, formatUnresolvedModelMessage, hasHeldInput, heldInputView, holdToolsUntilBuilt, hostInputError, isMandatoryRuntimeTool, isToolDeactivationEntryData, isTrustedMandatoryRuntimeTool, keepsDroppedQueuedMessages, legacyWorkflowSection, normalizeInterruptAbortMessage, noteQueuedMessagesDropped, parseSlashCommand, priorityHoldCounts, registerHeldInput, releaseTurnPause, settleTurnPause, stopWaiting, toolAbortGraceMs, uniquifyToolCallIds, withToolAbortGrace } from "./startup-0-0-
|
|
3
|
-
import { UNORDERED_ADMISSION, buildToolStatusReport, currentResourceAdmission, deferCommandTurn, describeToolSelection, dropDeferredCommandTurn, forkToolDeclarations, getGitStatus, getGitStatusAsync, hasTransformedPrompt, isInsideInputHook, joinCommandSend, joinCommandTurn, nextTransformedPromptRecord, noteCommandAnswer, projectTransformedPrompt, rejectMalformedToolArguments, reserveQueuedInputAdmission, resolveToolConcurrency, runCallback, runCommandHandler, runInputHook, scheduleToolExecution, sessionBlobOutput, settingsWriteOwner, toolChangeSupport, transformedPromptOwner, withOwnResourceAdmission } from "./startup-0-1-
|
|
4
|
-
import { failureDebugFields, reportDebugAsync, serializeErrorCause } from "./p1b-elig-
|
|
5
|
-
import { MessageAdmissionBoundary, assertSessionOpen, createToolDefinitionFromAgentTool, getCallableTools, isSelectedNativeMcpTool, loadTaskOwnTranscriptEntries, resolveSessionTempDirPath, sessionGenerationClosing, sessionLifetime, sessionQuitSignal, taskTranscriptSource, trackSessionWork } from "./startup-0-2-
|
|
2
|
+
import { AgentSessionBusyError, SESSION_HISTORY_TOOL_NAME, TOOL_DEACTIVATION_ENTRY_TYPE, ToolDetachmentError, abandonedToolResult, armToolAbortGraceTimer, assertToolPairingInvariant, awaitBlueprintReady, beginQueuedMessageDelivery, blueprintBuildPending, cancelHeldInput, clearToolAbortGraceTimer, createSyntheticSourceInfo, customMessageExcludesContext, drainAgentMessageQueue, earlierHeldInputs, endQueuedMessageDelivery, finishHeldInput, formatNoModelSelectedMessage, formatUnresolvedModelMessage, hasHeldInput, heldInputView, holdToolAbortGraceWhenObserved, holdToolsUntilBuilt, hostInputError, isMandatoryRuntimeTool, isToolDeactivationEntryData, isTrustedMandatoryRuntimeTool, keepsDroppedQueuedMessages, legacyWorkflowSection, normalizeInterruptAbortMessage, noteQueuedMessagesDropped, noteUserMessageOrigin, parseSlashCommand, priorityHoldCounts, registerHeldInput, releaseTurnPause, settleTurnPause, stopWaiting, toolAbortGraceMs, uniquifyToolCallIds, withToolAbortGrace } from "./startup-0-0-TYUFUOJZ.js";
|
|
3
|
+
import { UNORDERED_ADMISSION, buildToolStatusReport, createSessionHistoryToolDefinition, currentResourceAdmission, deferCommandTurn, describeToolSelection, dropDeferredCommandTurn, forkToolDeclarations, getGitStatus, getGitStatusAsync, hasTransformedPrompt, isInsideInputHook, joinCommandSend, joinCommandTurn, nextTransformedPromptRecord, noteCommandAnswer, projectTransformedPrompt, rejectMalformedToolArguments, reserveQueuedInputAdmission, resolveToolConcurrency, runCallback, runCommandHandler, runInputHook, scheduleToolExecution, sessionBlobOutput, settingsWriteOwner, toolChangeSupport, transformedPromptOwner, withOwnResourceAdmission } from "./startup-0-1-D4LGGINF.js";
|
|
4
|
+
import { failureDebugFields, reportDebugAsync, serializeErrorCause } from "./p1b-elig-ENCUPKKJ.js";
|
|
5
|
+
import { MessageAdmissionBoundary, assertSessionOpen, createToolDefinitionFromAgentTool, getCallableTools, isSelectedNativeMcpTool, loadTaskOwnTranscriptEntries, resolveSessionTempDirPath, sessionGenerationClosing, sessionLifetime, sessionQuitSignal, taskTranscriptSource, trackSessionWork } from "./startup-0-2-SZGQIWHI.js";
|
|
6
6
|
import { OwnerTaskStore, bindOwnerTaskStore, deliverToLaunchingSession, forgetChildDelivery, getLatestCompactionBoundaryEntry, processImage, wrapRegisteredTools } from "./startup-0-3-T4DVFYWX.js";
|
|
7
7
|
import { SessionDeletedError } from "./settings-startup-65YEWRV2.js";
|
|
8
8
|
import { appendFailureWroteNothing, checkedCustomMessage, clearPersistenceFailure, keepRefusedInput, noteMessageSaved, recordPersistenceFailure, rethrowUnlessReportedPersistenceFailure, writesEndWithWriter } from "./startup-8-0-34CBHPZH.js";
|
|
9
9
|
import { AgentTaskHost, TASK_HEARTBEAT_MESSAGE_TYPE, TaskCompletionOutbox, abortTurnRetries, activatesOnRegistration, applyToolLoadout, buildSessionMemoryGuideline, buildSystemPromptSections, cancelFirstPromptModel, commandOutputExcerpt, diffSystemPromptSections, expandPromptTemplate, expandSkillCommand, getSkillCatalog, isMcpToolName, isRegisteredToolAllowed, isRetiredToolName, isToolActivatable, isToolDeclarationHidden, namesSessionFolderInGuidelines, normalizeBuildSystemPromptOptions, projectToolLoadout, releasedWaitingOn, retryIsCurrent, selectedToolNames, taskCompletionMessage, workspaceSandboxDenial } from "./startup-0-5-OHJNE6JH.js";
|
|
10
10
|
import { normalizeToolResultImages, redirectOversizedToolResult } from "./startup-0-4-HN5EB4K7.js";
|
|
11
|
-
import { applyToolModifiers, createHistoryRouter, createLocalBashOperations, createLocalPowerShellOperations, createToolDefinitionsFor, defaultToolSelectionFor, notifyAgentPanelSourceHubRebound, shellCommandPrefixFor, withWorktreeRootMappings } from "./startup-8-1-
|
|
11
|
+
import { applyToolModifiers, createHistoryRouter, createLocalBashOperations, createLocalPowerShellOperations, createToolDefinitionsFor, defaultToolSelectionFor, notifyAgentPanelSourceHubRebound, shellCommandPrefixFor, withWorktreeRootMappings } from "./startup-8-1-SJW2GMAM.js";
|
|
12
12
|
import { noticeOvertookPrompt } from "./startup-10-0-TDQNBDDL.js";
|
|
13
13
|
import { ExtensionRunner, getExtensionRuntimeEventBus } from "./startup-14-0-MLX36RBG.js";
|
|
14
14
|
import { getCurrentSystemMessage, getCurrentTools, getSystemMessageText } from "@bastani/atomic-ai";
|
|
15
|
-
import { Type as Type$1 } from "@bastani/atomic-ai/utils/typebox/index";
|
|
16
15
|
import { randomUUID } from "node:crypto";
|
|
17
16
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
18
17
|
import { SessionConflictError, SessionNotFoundError } from "../core/storage/session/errors.js";
|
|
@@ -477,127 +476,6 @@ function restoreProtectedStreamingCustomMessages(session, removed) {
|
|
|
477
476
|
const removedReferences = /* @__PURE__ */ new Set([...removed.steering, ...removed.followUp]);
|
|
478
477
|
for (const entry of protectedMessages(session)) if (entry.phase === "queued" && removedReferences.has(entry.message)) session._queueAgentMessage(entry.message, entry.delivery);
|
|
479
478
|
}
|
|
480
|
-
// dist/core/tools/session-history.js
|
|
481
|
-
/** Characters one call may return; longer output is cut and says so. */
|
|
482
|
-
const MAX_OUTPUT_CHARS = 5e4;
|
|
483
|
-
const CURSOR_VALUE = /^\d+(?:\.\d+){0,3}$/;
|
|
484
|
-
const sessionHistorySchema = Type$1.Object({
|
|
485
|
-
pattern: Type$1.Optional(Type$1.String({ description: "Regular expression to search this session's history for. Keep it and set `lines` to a `?cursor=` URL to continue." })),
|
|
486
|
-
lines: Type$1.Optional(Type$1.String({ description: "An entry range of this session's history to read, such as \"120-260\", or a `?cursor=` URL to continue." }))
|
|
487
|
-
});
|
|
488
|
-
function capped(text) {
|
|
489
|
-
return text.length <= MAX_OUTPUT_CHARS ? text : `${text.slice(0, MAX_OUTPUT_CHARS)}\n[output cut at ${MAX_OUTPUT_CHARS} characters; narrow the search or the range]`;
|
|
490
|
-
}
|
|
491
|
-
function clampSpanEnd(start, end) {
|
|
492
|
-
const maxEnd = Math.min(Number.MAX_SAFE_INTEGER, start + Math.min(399, Number.MAX_SAFE_INTEGER - start));
|
|
493
|
-
return Math.min(end, maxEnd);
|
|
494
|
-
}
|
|
495
|
-
function parseEntryRange(value, label, capSpan) {
|
|
496
|
-
const match = /^(\d+)(?:\s*-\s*(\d+))?$/.exec(value.trim());
|
|
497
|
-
if (!match) throw new Error(`Invalid lines "${label}": use an entry range such as "120-260".`);
|
|
498
|
-
const start = Number(match[1]);
|
|
499
|
-
const end = match[2] === void 0 ? start : Number(match[2]);
|
|
500
|
-
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start < 1 || end < start) throw new Error(`Invalid lines "${label}": the entry range must start at 1 or later.`);
|
|
501
|
-
return {
|
|
502
|
-
start,
|
|
503
|
-
end: capSpan ? clampSpanEnd(start, end) : end
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
function parseCursorQuery(query, label) {
|
|
507
|
-
const params = new URLSearchParams(query);
|
|
508
|
-
const keys = [...params.keys()];
|
|
509
|
-
const cursor = params.get("cursor");
|
|
510
|
-
if (keys.length !== 1 || keys[0] !== "cursor" || !cursor || !CURSOR_VALUE.test(cursor)) throw new Error(`Invalid lines "${label}": only ?cursor= continuations for this session are allowed.`);
|
|
511
|
-
const parts = cursor.split(".").map((part) => Number(part));
|
|
512
|
-
const firstSeq = parts[0] ?? 0;
|
|
513
|
-
if (parts.some((part) => !Number.isSafeInteger(part) || part < 0) || firstSeq < 1) throw new Error(`Invalid lines "${label}": cursor positions must be safe positive integers.`);
|
|
514
|
-
return {
|
|
515
|
-
query: `?cursor=${cursor}`,
|
|
516
|
-
firstSeq
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
function parseTarget(baseUrl, rawLines, capSpan) {
|
|
520
|
-
const trimmed = rawLines.trim();
|
|
521
|
-
let rest = trimmed;
|
|
522
|
-
if (trimmed.startsWith("history://")) {
|
|
523
|
-
if (!trimmed.startsWith(baseUrl)) throw new Error(`Invalid lines "${rawLines}": only this session's history (${baseUrl}) is reachable.`);
|
|
524
|
-
rest = trimmed.slice(baseUrl.length);
|
|
525
|
-
if (rest === "" || rest[0] !== "?" && rest[0] !== ":") throw new Error(`Invalid lines "${rawLines}": only this session's history (${baseUrl}) is reachable.`);
|
|
526
|
-
}
|
|
527
|
-
let query = "";
|
|
528
|
-
let cursorStart = 1;
|
|
529
|
-
if (rest.startsWith("?")) {
|
|
530
|
-
const colon = rest.indexOf(":");
|
|
531
|
-
const parsedCursor = parseCursorQuery(colon >= 0 ? rest.slice(1, colon) : rest.slice(1), rawLines);
|
|
532
|
-
query = parsedCursor.query;
|
|
533
|
-
cursorStart = parsedCursor.firstSeq;
|
|
534
|
-
rest = colon >= 0 ? rest.slice(colon + 1) : "";
|
|
535
|
-
} else if (rest.startsWith(":")) rest = rest.slice(1);
|
|
536
|
-
if (rest === "" && query !== "") return capSpan ? {
|
|
537
|
-
url: `${baseUrl}${query}`,
|
|
538
|
-
range: {
|
|
539
|
-
start: cursorStart,
|
|
540
|
-
end: clampSpanEnd(cursorStart, Number.MAX_SAFE_INTEGER)
|
|
541
|
-
}
|
|
542
|
-
} : { url: `${baseUrl}${query}` };
|
|
543
|
-
return {
|
|
544
|
-
url: `${baseUrl}${query}`,
|
|
545
|
-
range: parseEntryRange(rest, rawLines, capSpan)
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
/**
|
|
549
|
-
* Read-only access to this session's own history, for an agent whose tools do not include `read` and `search`. It
|
|
550
|
-
* reaches only `history://sessions/<own id>`: no other session, file or project.
|
|
551
|
-
*/
|
|
552
|
-
function createSessionHistoryToolDefinition(name, options) {
|
|
553
|
-
return {
|
|
554
|
-
name,
|
|
555
|
-
label: "Session history",
|
|
556
|
-
description: "Search or read this session's own history after its context was cleared. When the context-cleared message tells you to `search` or `read` `history://sessions/<id>` and those tools are not available, use this tool instead: pass {\"pattern\": \"<regex>\"} to search (each match names its entry), then {\"lines\": \"N-M\"} to read a narrow entry range verbatim. Only this session's history is reachable.",
|
|
557
|
-
parameters: sessionHistorySchema,
|
|
558
|
-
promptSnippet: "Search and read this session's own history after a context clear (use in place of search/read on history://sessions/<id>)",
|
|
559
|
-
execute: async (_toolCallId, { pattern, lines }, signal) => {
|
|
560
|
-
const baseUrl = `history://sessions/${options.sessionId()}`;
|
|
561
|
-
const router = options.router();
|
|
562
|
-
if (pattern !== void 0 && pattern.trim() !== "") {
|
|
563
|
-
const target = lines !== void 0 && lines.trim() !== "" ? parseTarget(baseUrl, lines, false) : void 0;
|
|
564
|
-
const searchUrl = target ? target.url : baseUrl;
|
|
565
|
-
if (!router.search) throw new Error(`Bounded history search is unavailable for ${baseUrl}.`);
|
|
566
|
-
const found = await router.search(searchUrl, {
|
|
567
|
-
pattern,
|
|
568
|
-
ignoreCase: false,
|
|
569
|
-
literal: false,
|
|
570
|
-
contextBefore: 0,
|
|
571
|
-
contextAfter: 0,
|
|
572
|
-
...target?.range ? { ranges: [target.range] } : {},
|
|
573
|
-
...signal === void 0 ? {} : { signal }
|
|
574
|
-
});
|
|
575
|
-
return {
|
|
576
|
-
content: [{
|
|
577
|
-
type: "text",
|
|
578
|
-
text: capped(found?.trim() ? found : "No matches.")
|
|
579
|
-
}],
|
|
580
|
-
details: void 0
|
|
581
|
-
};
|
|
582
|
-
}
|
|
583
|
-
if (lines === void 0) throw new Error("Pass {\"pattern\": \"<regex>\"} to search or {\"lines\": \"N-M\"} to read.");
|
|
584
|
-
if (!router.readSelected) throw new Error(`Bounded history read is unavailable for ${baseUrl}.`);
|
|
585
|
-
const { url, range } = parseTarget(baseUrl, lines, true);
|
|
586
|
-
const transcript = await router.readSelected(url, {
|
|
587
|
-
...range ? { ranges: [range] } : {},
|
|
588
|
-
...signal === void 0 ? {} : { signal }
|
|
589
|
-
});
|
|
590
|
-
if (typeof transcript !== "string") throw new Error(`Bounded history read returned no transcript for ${baseUrl}.`);
|
|
591
|
-
return {
|
|
592
|
-
content: [{
|
|
593
|
-
type: "text",
|
|
594
|
-
text: capped(transcript)
|
|
595
|
-
}],
|
|
596
|
-
details: void 0
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
479
|
// dist/core/agent-session-tool-registry.js
|
|
602
480
|
/** Whether the branch has a clear-or-compact boundary, so a restricted agent may need its history tool. */
|
|
603
481
|
function hasClearOrCompactBoundary(session) {
|
|
@@ -649,7 +527,7 @@ function _refreshToolRegistry(options) {
|
|
|
649
527
|
execute: (...args) => withWorktreeRootMappings(this.sessionManager.getWorktreeRootMappings(), () => tool.execute(...args), this._outerWorktreeRootMappings, this.sessionManager.getWorktreePathContinuations())
|
|
650
528
|
};
|
|
651
529
|
const guarded = rejectMalformedToolArguments(scoped, () => this.agent.state.messages);
|
|
652
|
-
const scheduled = scheduleToolExecution(withToolAbortGrace(guarded), this._toolExecutionScheduler, abortError);
|
|
530
|
+
const scheduled = scheduleToolExecution(withToolAbortGrace(guarded, this), this._toolExecutionScheduler, abortError);
|
|
653
531
|
const definition = definitionRegistry.get(tool.name)?.definition;
|
|
654
532
|
const detachable = builtInQuestion ? void 0 : definition?.detachable;
|
|
655
533
|
return definition !== void 0 && (detachable === true || typeof detachable === "function") ? detachableTool(this, scheduled, (id, params, signal, onUpdate, context) => definition.execute(id, params, signal, onUpdate, context), (id, signal) => runner.createToolContext(id, signal), typeof detachable === "function" ? (params) => detachable(params) : void 0, definition.detachmentRequiresReady === true, abortError) : scheduled;
|
|
@@ -1347,7 +1225,10 @@ async function normalizeQueuedMessageImages(session, message) {
|
|
|
1347
1225
|
...normalized.images
|
|
1348
1226
|
];
|
|
1349
1227
|
}
|
|
1350
|
-
|
|
1228
|
+
function prompt(text, options) {
|
|
1229
|
+
return holdToolAbortGraceWhenObserved(this, runPrompt.call(this, text, options));
|
|
1230
|
+
}
|
|
1231
|
+
async function runPrompt(text, options) {
|
|
1351
1232
|
if (this._disposed || sessionGenerationClosing.has(this)) throw Object.assign(/* @__PURE__ */ new Error("Session is closed"), { code: "SessionClosed" });
|
|
1352
1233
|
if (subagentExecutionEnded(this)) throw subagentExecutionEndedError();
|
|
1353
1234
|
if (this._isEmittingAgentSettled && !queuesDuringAgentSettled(this, options)) {
|
|
@@ -1471,8 +1352,8 @@ async function promptInternal(text, options, fresh = false) {
|
|
|
1471
1352
|
const keepAcceptedInput = async (error) => {
|
|
1472
1353
|
if (!acceptedWhileHeld || held.cancelled || isSessionClosed(error)) return;
|
|
1473
1354
|
if (this._disposed || lifetime.aborted || sessionGenerationClosing.has(this)) return;
|
|
1474
|
-
if (held.lane === "followUp") await this._queueFollowUp(keptText, keptImages, text, keptRawText, options?.queuedMessageId);
|
|
1475
|
-
else await this._queueSteer(keptText, keptImages, text, keptRawText, options?.queuedMessageId);
|
|
1355
|
+
if (held.lane === "followUp") await this._queueFollowUp(keptText, keptImages, text, keptRawText, options?.queuedMessageId, options?.originSendId);
|
|
1356
|
+
else await this._queueSteer(keptText, keptImages, text, keptRawText, options?.queuedMessageId, options?.originSendId);
|
|
1476
1357
|
};
|
|
1477
1358
|
let reservedPreflight = false;
|
|
1478
1359
|
const releasePreflight = () => {
|
|
@@ -1519,8 +1400,8 @@ async function promptInternal(text, options, fresh = false) {
|
|
|
1519
1400
|
return;
|
|
1520
1401
|
}
|
|
1521
1402
|
if (held) stopWaiting(this, held);
|
|
1522
|
-
if (delivery === "followUp") await this._queueFollowUp(pausedText, pausedImages, text, void 0, options?.queuedMessageId);
|
|
1523
|
-
else await this._queueSteer(pausedText, pausedImages, text, void 0, options?.queuedMessageId);
|
|
1403
|
+
if (delivery === "followUp") await this._queueFollowUp(pausedText, pausedImages, text, void 0, options?.queuedMessageId, options?.originSendId);
|
|
1404
|
+
else await this._queueSteer(pausedText, pausedImages, text, void 0, options?.queuedMessageId, options?.originSendId);
|
|
1524
1405
|
preflightResult?.(true, "queued");
|
|
1525
1406
|
return;
|
|
1526
1407
|
}
|
|
@@ -1571,8 +1452,8 @@ async function promptInternal(text, options, fresh = false) {
|
|
|
1571
1452
|
return;
|
|
1572
1453
|
}
|
|
1573
1454
|
if (this._queuedMessagesPaused) {
|
|
1574
|
-
if (held.lane === "followUp") await this._queueFollowUp(expandedText, currentImages, text, currentText, options?.queuedMessageId);
|
|
1575
|
-
else await this._queueSteer(expandedText, currentImages, text, currentText, options?.queuedMessageId);
|
|
1455
|
+
if (held.lane === "followUp") await this._queueFollowUp(expandedText, currentImages, text, currentText, options?.queuedMessageId, options?.originSendId);
|
|
1456
|
+
else await this._queueSteer(expandedText, currentImages, text, currentText, options?.queuedMessageId, options?.originSendId);
|
|
1576
1457
|
preflightResult?.(true, "queued");
|
|
1577
1458
|
return;
|
|
1578
1459
|
}
|
|
@@ -1585,7 +1466,7 @@ async function promptInternal(text, options, fresh = false) {
|
|
|
1585
1466
|
}
|
|
1586
1467
|
if (busy || settling) {
|
|
1587
1468
|
if (!delivery?.streamingBehavior) throw new AgentSessionBusyError();
|
|
1588
|
-
const queued = delivery.streamingBehavior === "followUp" ? this._queueFollowUp(expandedText, currentImages, text, currentText, options?.queuedMessageId) : this._queueSteer(expandedText, currentImages, text, currentText, options?.queuedMessageId);
|
|
1469
|
+
const queued = delivery.streamingBehavior === "followUp" ? this._queueFollowUp(expandedText, currentImages, text, currentText, options?.queuedMessageId, options?.originSendId) : this._queueSteer(expandedText, currentImages, text, currentText, options?.queuedMessageId, options?.originSendId);
|
|
1589
1470
|
if (settling) deliverQueuedInputIfIdle(this, { userSubmission: true });
|
|
1590
1471
|
await queued;
|
|
1591
1472
|
preflightResult?.(true, "queued");
|
|
@@ -1638,6 +1519,7 @@ async function promptInternal(text, options, fresh = false) {
|
|
|
1638
1519
|
...currentText !== userText ? { rawText: currentText } : {},
|
|
1639
1520
|
timestamp: Date.now()
|
|
1640
1521
|
};
|
|
1522
|
+
if (options?.originSendId !== void 0) noteUserMessageOrigin(userMessage, options.originSendId);
|
|
1641
1523
|
messages.push(userMessage);
|
|
1642
1524
|
for (const msg of this._pendingNextTurnMessages) messages.push(msg);
|
|
1643
1525
|
if (result?.messages) for (const msg of result.messages) messages.push({
|
|
@@ -2551,16 +2433,21 @@ function abort(options) {
|
|
|
2551
2433
|
* or held, so the session stays open for its next message, which starts a turn as usual. Between two attempts of a
|
|
2552
2434
|
* retry nothing streams, and the interrupt cancels the retry, as Esc does in the main chat.
|
|
2553
2435
|
*/
|
|
2554
|
-
|
|
2555
|
-
if (!this.isStreaming && !this.isRetrying) return;
|
|
2436
|
+
function interruptTurnInternal() {
|
|
2437
|
+
if (!this.isStreaming && !this.isRetrying) return Promise.resolve();
|
|
2556
2438
|
this._turnInterruptedByUser = true;
|
|
2557
2439
|
this._awaitingMessageAfterInterrupt = false;
|
|
2558
2440
|
this._extensionRunner.cancelHostInput();
|
|
2559
2441
|
abortTurnRetries.call(this);
|
|
2560
2442
|
if (this._isPreparingRun === "custom" && !this.agent.state.isStreaming) this._abortPreparedRunAtStart = true;
|
|
2561
2443
|
this.agent.abort();
|
|
2562
|
-
|
|
2563
|
-
|
|
2444
|
+
return (async () => {
|
|
2445
|
+
await this.agent.waitForIdle();
|
|
2446
|
+
await this._agentEventQueue;
|
|
2447
|
+
})();
|
|
2448
|
+
}
|
|
2449
|
+
function interruptTurn() {
|
|
2450
|
+
return holdToolAbortGraceWhenObserved(this, interruptTurnInternal.call(this));
|
|
2564
2451
|
}
|
|
2565
2452
|
/**
|
|
2566
2453
|
* Pause the current turn the way Esc does in a chat of a subagent, as Esc pauses the main chat: the messages the user
|
|
@@ -2569,26 +2456,31 @@ async function interruptTurn() {
|
|
|
2569
2456
|
* after Esc, so nothing restarts the paused turn. The user's next message releases the hold and starts the next turn,
|
|
2570
2457
|
* with that message first.
|
|
2571
2458
|
*/
|
|
2572
|
-
|
|
2459
|
+
function pauseTurn() {
|
|
2573
2460
|
const open = this.isStreaming || this.isRetrying || hasOpenRun(this);
|
|
2574
2461
|
const holds = !this._queuedMessagesPaused;
|
|
2575
2462
|
if (holds) this.pauseQueuedMessages();
|
|
2576
2463
|
const taken = this.clearQueue({ preserveUnprotectedCustomMessages: true });
|
|
2577
2464
|
if (!holds) {
|
|
2578
|
-
if (this.isStreaming
|
|
2579
|
-
return
|
|
2465
|
+
if (!this.isStreaming && !this.isRetrying) return Promise.resolve(taken);
|
|
2466
|
+
return holdToolAbortGraceWhenObserved(this, (async () => {
|
|
2467
|
+
await interruptTurnInternal.call(this);
|
|
2468
|
+
return taken;
|
|
2469
|
+
})());
|
|
2580
2470
|
}
|
|
2581
2471
|
const settled = Promise.withResolvers();
|
|
2582
2472
|
this._turnPause = settled;
|
|
2583
2473
|
this._queuedMessagesPauseAbortBoundary = settled.promise;
|
|
2584
2474
|
if (!open) {
|
|
2585
2475
|
settled.resolve();
|
|
2586
|
-
return taken;
|
|
2476
|
+
return Promise.resolve(taken);
|
|
2587
2477
|
}
|
|
2588
2478
|
this._turnInterruptedByUser = true;
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2479
|
+
return holdToolAbortGraceWhenObserved(this, (async () => {
|
|
2480
|
+
await interruptTurnInternal.call(this);
|
|
2481
|
+
if (this._subagentMessageAdmission === void 0) settled.resolve();
|
|
2482
|
+
return taken;
|
|
2483
|
+
})());
|
|
2592
2484
|
}
|
|
2593
2485
|
/**
|
|
2594
2486
|
* Continue a session {@link pauseTurn} paused, as the user's send does after Esc in the main chat: once the paused run has
|
|
@@ -2630,11 +2522,11 @@ function abortCurrentGeneration() {
|
|
|
2630
2522
|
})();
|
|
2631
2523
|
if (this._queuedMessagesPaused) {
|
|
2632
2524
|
const tracked = composePauseAbortBoundaries([this._queuedMessagesPauseAbortBoundary, boundary]);
|
|
2633
|
-
if (tracked === void 0) return boundary;
|
|
2525
|
+
if (tracked === void 0) return holdToolAbortGraceWhenObserved(this, boundary);
|
|
2634
2526
|
this._queuedMessagesPauseAbortBoundary = tracked;
|
|
2635
2527
|
tracked.catch(() => {});
|
|
2636
2528
|
}
|
|
2637
|
-
return boundary;
|
|
2529
|
+
return holdToolAbortGraceWhenObserved(this, boundary);
|
|
2638
2530
|
}
|
|
2639
2531
|
// dist/core/agent-session-typed-queue.js
|
|
2640
2532
|
/** Per session, oldest first: one record per queued steering or follow-up message. */
|
|
@@ -2737,7 +2629,7 @@ function sessionRunsStarted(session) {
|
|
|
2737
2629
|
return runsStarted.get(session) ?? 0;
|
|
2738
2630
|
}
|
|
2739
2631
|
/** Queue `text` in `lane`: listed, then queued for the agent, and only then announced (#4257: listeners may act on it). */
|
|
2740
|
-
function queueUserText(session, lane, text, images, typed, rawText, receiptId = randomUUID()) {
|
|
2632
|
+
function queueUserText(session, lane, text, images, typed, rawText, receiptId = randomUUID(), originSendId) {
|
|
2741
2633
|
assertSessionOpen(session);
|
|
2742
2634
|
const content = [{
|
|
2743
2635
|
type: "text",
|
|
@@ -2750,6 +2642,7 @@ function queueUserText(session, lane, text, images, typed, rawText, receiptId =
|
|
|
2750
2642
|
...rawText !== void 0 && rawText !== text ? { rawText } : {},
|
|
2751
2643
|
timestamp: Date.now()
|
|
2752
2644
|
};
|
|
2645
|
+
if (originSendId !== void 0) noteUserMessageOrigin(message, originSendId);
|
|
2753
2646
|
if (images?.length) markQueuedMessageImages(message);
|
|
2754
2647
|
rememberLaneMessage(message, images);
|
|
2755
2648
|
(lane === "steer" ? session._steeringMessages : session._followUpMessages).push(text);
|
|
@@ -2811,14 +2704,14 @@ function withdrawQueuedMessage(session, message) {
|
|
|
2811
2704
|
* Queue a steering message (already expanded, no extension command check). `typed` is the text that was submitted,
|
|
2812
2705
|
* when an `input` hook or an expansion may have changed it; `clearQueue()` gives it back.
|
|
2813
2706
|
*/
|
|
2814
|
-
async function _queueSteer(text, images, typed, rawText, receiptId) {
|
|
2815
|
-
queueUserText(this, "steer", text, images, typed, rawText, receiptId);
|
|
2707
|
+
async function _queueSteer(text, images, typed, rawText, receiptId, originSendId) {
|
|
2708
|
+
queueUserText(this, "steer", text, images, typed, rawText, receiptId, originSendId);
|
|
2816
2709
|
}
|
|
2817
2710
|
/**
|
|
2818
2711
|
* Internal: Queue a follow-up message (already expanded, no extension command check). `typed` is as for `_queueSteer`.
|
|
2819
2712
|
*/
|
|
2820
|
-
async function _queueFollowUp(text, images, typed, rawText, receiptId) {
|
|
2821
|
-
queueUserText(this, "followUp", text, images, typed, rawText, receiptId);
|
|
2713
|
+
async function _queueFollowUp(text, images, typed, rawText, receiptId, originSendId) {
|
|
2714
|
+
queueUserText(this, "followUp", text, images, typed, rawText, receiptId, originSendId);
|
|
2822
2715
|
}
|
|
2823
2716
|
/** A run takes the queued `message` now: it leaves the list and is under way until its `message_start`. */
|
|
2824
2717
|
function takeOccurrence(session, message) {
|
|
@@ -4009,8 +3902,7 @@ function detachableTool(session, tool, execute, createContext, detachesCall, req
|
|
|
4009
3902
|
interrupted = true;
|
|
4010
3903
|
abort(signal?.reason);
|
|
4011
3904
|
graceMs = toolAbortGraceMs();
|
|
4012
|
-
graceTimer =
|
|
4013
|
-
graceTimer.unref?.();
|
|
3905
|
+
graceTimer = armToolAbortGraceTimer(session, graceMs, () => open(ABANDON));
|
|
4014
3906
|
};
|
|
4015
3907
|
if (signal?.aborted) forwardAbort();
|
|
4016
3908
|
else signal?.addEventListener("abort", forwardAbort, { once: true });
|
|
@@ -4040,7 +3932,7 @@ function detachableTool(session, tool, execute, createContext, detachesCall, req
|
|
|
4040
3932
|
} finally {
|
|
4041
3933
|
hold.gate = void 0;
|
|
4042
3934
|
clearTimeout(timer);
|
|
4043
|
-
|
|
3935
|
+
clearToolAbortGraceTimer(session, graceTimer);
|
|
4044
3936
|
readinessCallbacks.delete(operationSignal);
|
|
4045
3937
|
signal?.removeEventListener("abort", forwardAbort);
|
|
4046
3938
|
}
|
|
@@ -4450,7 +4342,10 @@ function recordWithoutContinuing(session, answers) {
|
|
|
4450
4342
|
* `onRecorded` is told the ids of the results it recorded as soon as they are saved, before the turn continues, so a
|
|
4451
4343
|
* caller that holds them elsewhere can let them go even if the continued turn never ends.
|
|
4452
4344
|
*/
|
|
4453
|
-
|
|
4345
|
+
function resumeDetachedTurn(results, onRecorded) {
|
|
4346
|
+
return holdToolAbortGraceWhenObserved(this, runResumeDetachedTurn.call(this, results, onRecorded));
|
|
4347
|
+
}
|
|
4348
|
+
async function runResumeDetachedTurn(results, onRecorded) {
|
|
4454
4349
|
const sessionId = this.sessionManager.getSessionId();
|
|
4455
4350
|
if (this._disposed || sessionGenerationClosing.has(this)) throw new ToolDetachmentError("session-closed", { sessionId });
|
|
4456
4351
|
if (this.isStreaming || this._activePromptCount > 0) throw new ToolDetachmentError("session-busy", { sessionId });
|