@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,3 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Written by the build (scripts/in-place-update-gate.mjs): when this module's code cannot load in a process of an earlier release
|
|
2
|
+
// that an in-place update left running, the process is told to restart.
|
|
3
|
+
let module;
|
|
4
|
+
try {
|
|
5
|
+
module = await import("./index.code.js");
|
|
6
|
+
} catch (error) {
|
|
7
|
+
const root = new URL("../../", import.meta.url);
|
|
8
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
+
const key = `${root.href}#0.10.5-alpha.1`;
|
|
10
|
+
let release = releases.get(key);
|
|
11
|
+
if (release === undefined) {
|
|
12
|
+
const current = (async () => {
|
|
13
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
14
|
+
try {
|
|
15
|
+
const held = await import(new URL(path, root).href);
|
|
16
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
17
|
+
} catch {
|
|
18
|
+
// Not a file this process can load: the next.
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
})().then((found) => {
|
|
23
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
24
|
+
return found;
|
|
25
|
+
});
|
|
26
|
+
releases.set(key, current);
|
|
27
|
+
release = current;
|
|
28
|
+
}
|
|
29
|
+
const running = await release;
|
|
30
|
+
if (running === undefined || running.version === "0.10.5-alpha.1") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.5-alpha.1 while this session was running; restart it to keep using structured output.", {
|
|
32
|
+
cause: error,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export const { ClassifierDecisionError, OutputRepairExhaustedError, ProviderRequestFailure, TerminalDecisionError, decisionFailure, generateStructuredOutput, resolveDecisionModel, runDecision } = module;
|
|
3
36
|
//# sourceMappingURL=index.impl.js.map
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// that an in-place update left running, the process is told to restart.
|
|
3
3
|
let module;
|
|
4
4
|
try {
|
|
5
|
-
module = await import("./index.
|
|
5
|
+
module = await import("./index.code.js");
|
|
6
6
|
} catch (error) {
|
|
7
7
|
const root = new URL("../../", import.meta.url);
|
|
8
8
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
-
const key = `${root.href}#0.10.
|
|
9
|
+
const key = `${root.href}#0.10.5-alpha.1`;
|
|
10
10
|
let release = releases.get(key);
|
|
11
11
|
if (release === undefined) {
|
|
12
|
-
|
|
12
|
+
const current = (async () => {
|
|
13
13
|
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
14
14
|
try {
|
|
15
15
|
const held = await import(new URL(path, root).href);
|
|
@@ -19,12 +19,16 @@ try {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
return undefined;
|
|
22
|
-
})()
|
|
23
|
-
|
|
22
|
+
})().then((found) => {
|
|
23
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
24
|
+
return found;
|
|
25
|
+
});
|
|
26
|
+
releases.set(key, current);
|
|
27
|
+
release = current;
|
|
24
28
|
}
|
|
25
29
|
const running = await release;
|
|
26
|
-
if (running === undefined || running.version === "0.10.
|
|
27
|
-
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.
|
|
30
|
+
if (running === undefined || running.version === "0.10.5-alpha.1") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.5-alpha.1 while this session was running; restart it to keep using structured output.", {
|
|
28
32
|
cause: error,
|
|
29
33
|
});
|
|
30
34
|
}
|
|
@@ -9,7 +9,10 @@ export declare const COMMAND_DETAIL_TAIL_BYTES = 8192;
|
|
|
9
9
|
export declare const COMMAND_FOREGROUND_BUDGET_MS = 10000;
|
|
10
10
|
/** Compare logical output bytes to the disk budget without a 32-bit cast. */
|
|
11
11
|
export declare function commandSpoolExceedsCap(fileBytes: bigint, capBytes?: bigint): boolean;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Native completion means the process exited; only exit code 0 proves shell command success.
|
|
14
|
+
* Non-zero exits and missing exit codes (such as signal termination or an unreadable exit status) are failures.
|
|
15
|
+
*/
|
|
13
16
|
export declare function taskOutcomeStatus(result: TaskResult, kind?: "agent" | "command"): TaskResult["kind"];
|
|
14
17
|
export type OmissionSpan = {
|
|
15
18
|
start: number;
|
|
@@ -267,6 +267,8 @@ export declare function taskTranscriptSource(task: TaskLease): C.Result<{
|
|
|
267
267
|
taskId: C.TaskId;
|
|
268
268
|
inheritedThroughId?: string;
|
|
269
269
|
}, C.Failure<"UnknownTask" | "TranscriptUnavailable">>;
|
|
270
|
+
/** Viewer-only: runs `listener` whenever any task owned by `supervisor` binds a live transcript session. */
|
|
271
|
+
export declare function watchTaskTranscriptBindings(supervisor: TaskSupervisor, listener: (taskId: C.TaskId) => void): () => void;
|
|
270
272
|
/** Extension statuses written by this task's own session, by status key; empty once it ends. */
|
|
271
273
|
export declare function taskExtensionStatuses(task: TaskLease): ReadonlyMap<string, string>;
|
|
272
274
|
/** Viewer-only: runs `listener` whenever the task's extension statuses change. */
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import "../../_shared/rolldown-runtime-BGM3D5V3.js";
|
|
2
|
+
import { read, skip, stringValue } from "../../_shared/startup-0-5-OHJNE6JH.js";
|
|
3
|
+
// dist/core/tasks/task-completion-entry.js
|
|
4
|
+
function* object(first, fields) {
|
|
5
|
+
if (first.name !== "startObject") {
|
|
6
|
+
yield* skip(first);
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const limit = Math.max(...Object.keys(fields).map((key) => key.length)) + 1;
|
|
10
|
+
for (let token = yield; token.name !== "endObject"; token = yield) {
|
|
11
|
+
const key = yield* stringValue(limit);
|
|
12
|
+
const value = yield;
|
|
13
|
+
if (Object.hasOwn(fields, key)) yield* fields[key](value);
|
|
14
|
+
else yield* skip(value);
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
/** The whole value, as `JSON.parse` builds it, own `__proto__` keys included. */
|
|
19
|
+
function* value(first) {
|
|
20
|
+
switch (first.name) {
|
|
21
|
+
case "startObject": {
|
|
22
|
+
const result = {};
|
|
23
|
+
for (let token = yield; token.name !== "endObject"; token = yield) {
|
|
24
|
+
const key = yield* stringValue();
|
|
25
|
+
Object.defineProperty(result, key, {
|
|
26
|
+
value: yield* value(yield),
|
|
27
|
+
configurable: true,
|
|
28
|
+
enumerable: true,
|
|
29
|
+
writable: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
case "startArray": {
|
|
35
|
+
const result = [];
|
|
36
|
+
for (let token = yield; token.name !== "endArray"; token = yield) result.push(yield* value(token));
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
case "startString": return yield* stringValue();
|
|
40
|
+
case "numberValue": return Number(first.value);
|
|
41
|
+
case "trueValue":
|
|
42
|
+
case "falseValue":
|
|
43
|
+
case "nullValue": return first.value;
|
|
44
|
+
default: throw new SyntaxError(`Unexpected JSON token ${first.name}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function* tag(first) {
|
|
48
|
+
if (first.name === "startString") return yield* stringValue(64);
|
|
49
|
+
yield* skip(first);
|
|
50
|
+
}
|
|
51
|
+
/** Compare a saved string with `expected` as it streams, without building it. */
|
|
52
|
+
function* equals(first, expected) {
|
|
53
|
+
if (first.name !== "startString") {
|
|
54
|
+
yield* skip(first);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
let offset = 0;
|
|
58
|
+
let same = true;
|
|
59
|
+
for (let part = yield; part.name === "stringChunk"; part = yield) {
|
|
60
|
+
same &&= expected.startsWith(part.value, offset);
|
|
61
|
+
offset += part.value.length;
|
|
62
|
+
}
|
|
63
|
+
return same && offset === expected.length;
|
|
64
|
+
}
|
|
65
|
+
/** Select `fields` of the entry's message; a repeated `message` key replaces the earlier one, as in `JSON.parse`. */
|
|
66
|
+
function* message(fields, reset) {
|
|
67
|
+
yield* object(yield, { *message(token) {
|
|
68
|
+
reset();
|
|
69
|
+
yield* object(token, fields);
|
|
70
|
+
} });
|
|
71
|
+
}
|
|
72
|
+
const HEADER_READ = Symbol("header read");
|
|
73
|
+
/**
|
|
74
|
+
* The fields that decide what an entry adds to a card, in one pass that keeps none of its content. The pass ends as
|
|
75
|
+
* soon as they are known, which in a saved row is before its message content.
|
|
76
|
+
*/
|
|
77
|
+
function savedEntryHeader(chunks, throughId, idLimit) {
|
|
78
|
+
return read(chunks, (function* () {
|
|
79
|
+
let boundary = false;
|
|
80
|
+
let seenId = throughId === void 0;
|
|
81
|
+
let type;
|
|
82
|
+
let fields = {};
|
|
83
|
+
let seenCallId = false;
|
|
84
|
+
const known = () => seenId && type !== void 0 && (type !== "message" || fields.role !== void 0 && (fields.role !== "toolResult" || seenCallId));
|
|
85
|
+
try {
|
|
86
|
+
yield* object(yield, {
|
|
87
|
+
*id(token) {
|
|
88
|
+
if (throughId === void 0) yield* skip(token);
|
|
89
|
+
else boundary = yield* equals(token, throughId);
|
|
90
|
+
seenId = true;
|
|
91
|
+
if (known()) throw HEADER_READ;
|
|
92
|
+
},
|
|
93
|
+
*type(token) {
|
|
94
|
+
type = yield* tag(token);
|
|
95
|
+
if (known()) throw HEADER_READ;
|
|
96
|
+
},
|
|
97
|
+
*message(token) {
|
|
98
|
+
fields = {};
|
|
99
|
+
seenCallId = false;
|
|
100
|
+
yield* object(token, {
|
|
101
|
+
*role(role) {
|
|
102
|
+
fields.role = yield* tag(role);
|
|
103
|
+
if (known()) throw HEADER_READ;
|
|
104
|
+
},
|
|
105
|
+
*toolCallId(id) {
|
|
106
|
+
delete fields.toolCallId;
|
|
107
|
+
delete fields.longToolCallId;
|
|
108
|
+
seenCallId = true;
|
|
109
|
+
if (id.name !== "startString") yield* skip(id);
|
|
110
|
+
else {
|
|
111
|
+
const text = yield* stringValue(idLimit + 1);
|
|
112
|
+
if (text.length > idLimit) fields.longToolCallId = true;
|
|
113
|
+
else fields.toolCallId = text;
|
|
114
|
+
}
|
|
115
|
+
if (known()) throw HEADER_READ;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
} catch (error) {
|
|
121
|
+
if (error !== HEADER_READ) throw error;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
boundary,
|
|
125
|
+
...type === void 0 ? {} : { type },
|
|
126
|
+
...fields
|
|
127
|
+
};
|
|
128
|
+
})());
|
|
129
|
+
}
|
|
130
|
+
const ESCAPE = new TextEncoder().encode("\\u");
|
|
131
|
+
function indexOf(bytes, needle) {
|
|
132
|
+
search: for (let at = bytes.indexOf(needle[0]); at >= 0 && at <= bytes.length - needle.length; at = bytes.indexOf(needle[0], at + 1)) {
|
|
133
|
+
for (let i = 1; i < needle.length; i++) if (bytes[at + i] !== needle[i]) continue search;
|
|
134
|
+
return at;
|
|
135
|
+
}
|
|
136
|
+
return -1;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Whether a saved row can hold the string `text` anywhere: its bytes spell it, or escape a character somewhere.
|
|
140
|
+
* A row that can't is passed over without tokenizing it.
|
|
141
|
+
*/
|
|
142
|
+
async function savedRowMayHold(chunks, text) {
|
|
143
|
+
const needle = new TextEncoder().encode(text);
|
|
144
|
+
const overlap = Math.max(needle.length, ESCAPE.length) - 1;
|
|
145
|
+
let tail = /* @__PURE__ */ new Uint8Array(0);
|
|
146
|
+
for await (const chunk of chunks) {
|
|
147
|
+
const bytes = new Uint8Array(tail.length + chunk.length);
|
|
148
|
+
bytes.set(tail);
|
|
149
|
+
bytes.set(chunk, tail.length);
|
|
150
|
+
if (indexOf(bytes, needle) >= 0 || indexOf(bytes, ESCAPE) >= 0) return true;
|
|
151
|
+
tail = bytes.slice(Math.max(0, bytes.length - overlap));
|
|
152
|
+
}
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
/** A user message's text as a card's prompt reads it: its string, or its text blocks joined by newlines. */
|
|
156
|
+
function savedUserText(chunks) {
|
|
157
|
+
return read(chunks, (function* () {
|
|
158
|
+
let text;
|
|
159
|
+
yield* message({ *content(token) {
|
|
160
|
+
text = void 0;
|
|
161
|
+
if (token.name === "startString") {
|
|
162
|
+
text = yield* stringValue();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (token.name !== "startArray") {
|
|
166
|
+
yield* skip(token);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const parts = [];
|
|
170
|
+
for (let part = yield; part.name !== "endArray"; part = yield) {
|
|
171
|
+
let type;
|
|
172
|
+
let partText;
|
|
173
|
+
yield* object(part, {
|
|
174
|
+
*type(t) {
|
|
175
|
+
type = yield* tag(t);
|
|
176
|
+
},
|
|
177
|
+
*text(t) {
|
|
178
|
+
partText = void 0;
|
|
179
|
+
if (t.name === "startString") partText = yield* stringValue();
|
|
180
|
+
else yield* skip(t);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
if (type === "text" && partText !== void 0) parts.push(partText);
|
|
184
|
+
}
|
|
185
|
+
text = parts.join("\n");
|
|
186
|
+
} }, () => {
|
|
187
|
+
text = void 0;
|
|
188
|
+
});
|
|
189
|
+
return text;
|
|
190
|
+
})());
|
|
191
|
+
}
|
|
192
|
+
/** An assistant message's tool calls, in order: each one's ID, name and arguments. */
|
|
193
|
+
function savedToolCalls(chunks) {
|
|
194
|
+
return read(chunks, (function* () {
|
|
195
|
+
let calls = [];
|
|
196
|
+
const content = function* (token) {
|
|
197
|
+
calls = [];
|
|
198
|
+
if (token.name !== "startArray") {
|
|
199
|
+
yield* skip(token);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
for (let part = yield; part.name !== "endArray"; part = yield) {
|
|
203
|
+
let type;
|
|
204
|
+
const call = {};
|
|
205
|
+
yield* object(part, {
|
|
206
|
+
*type(t) {
|
|
207
|
+
type = yield* tag(t);
|
|
208
|
+
},
|
|
209
|
+
*id(t) {
|
|
210
|
+
call.id = yield* value(t);
|
|
211
|
+
},
|
|
212
|
+
*name(t) {
|
|
213
|
+
call.name = yield* value(t);
|
|
214
|
+
},
|
|
215
|
+
*arguments(t) {
|
|
216
|
+
call.arguments = yield* value(t);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
if (type === "toolCall") calls.push(call);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
yield* message({ content }, () => {
|
|
223
|
+
calls = [];
|
|
224
|
+
});
|
|
225
|
+
return calls;
|
|
226
|
+
})());
|
|
227
|
+
}
|
|
228
|
+
/** What a card shows of a tool result: its content, details, error flag and duration. */
|
|
229
|
+
function savedToolResult(chunks) {
|
|
230
|
+
return read(chunks, (function* () {
|
|
231
|
+
let result = { hasDetails: false };
|
|
232
|
+
yield* message({
|
|
233
|
+
*content(t) {
|
|
234
|
+
result.content = yield* value(t);
|
|
235
|
+
},
|
|
236
|
+
*details(t) {
|
|
237
|
+
result.hasDetails = true;
|
|
238
|
+
result.details = yield* value(t);
|
|
239
|
+
},
|
|
240
|
+
*isError(t) {
|
|
241
|
+
result.isError = yield* value(t);
|
|
242
|
+
},
|
|
243
|
+
*durationMs(t) {
|
|
244
|
+
result.durationMs = yield* value(t);
|
|
245
|
+
}
|
|
246
|
+
}, () => {
|
|
247
|
+
result = { hasDetails: false };
|
|
248
|
+
});
|
|
249
|
+
return result;
|
|
250
|
+
})());
|
|
251
|
+
}
|
|
252
|
+
export { savedEntryHeader, savedRowMayHold, savedToolCalls, savedToolResult, savedUserText };
|
|
253
|
+
|
|
254
|
+
//# sourceMappingURL=task-completion-entry.code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-completion-entry.code.js","names":[],"sources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B;KACA,CAAC,GAAG,GAAC;MACJ,KAAK,KAAK,OAAO,MAAM,CAAC;KACzB;KACA,CAAC,KAAK,GAAC;MACN,KAAK,OAAO,OAAO,MAAM,CAAC;KAC3B;KACA,CAAC,UAAU,GAAC;MACX,KAAK,YAAY,OAAO,MAAM,CAAC;KAChC;IACA,CAAA;IACD,IAAI,SAAS,YAAY,MAAM,KAAK,IAAI;GACzC;EACD;EACA,OAAO,QAAQ,EAAE,QAAO,SAAS;GAChC,QAAQ,CAAA;EACT,CAAC;EACD,OAAO;CACR,EAAA,CAAE,CAAE;AAEN;;AAWA,SAAgB,gBAAgB,QAAiC;CAChE,OAAO,KACN,SACC,aAAS;EACT,IAAI,SAAqG,EACxG,YAAY,MACZ;EACD,OAAO,QACN;GACC,CAAC,QAAQ,GAAC;IACT,OAAO,UAAU,OAAO,MAAM,CAAC;GAChC;GACA,CAAC,QAAQ,GAAC;IACT,OAAO,aAAa;IACpB,OAAO,UAAU,OAAO,MAAM,CAAC;GAChC;GACA,CAAC,QAAQ,GAAC;IACT,OAAO,UAAU,OAAO,MAAM,CAAC;GAChC;GACA,CAAC,WAAW,GAAC;IACZ,OAAO,aAAa,OAAO,MAAM,CAAC;GACnC;EACA,SACI;GACJ,SAAS,EAAE,YAAY,MAAK;EAC7B,CAAC;EAEF,OAAO;CACR,EAAA,CAAE,CAAE;AAEN"}
|
|
@@ -1,254 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function* value(first) {
|
|
20
|
-
switch (first.name) {
|
|
21
|
-
case "startObject": {
|
|
22
|
-
const result = {};
|
|
23
|
-
for (let token = yield; token.name !== "endObject"; token = yield) {
|
|
24
|
-
const key = yield* stringValue();
|
|
25
|
-
Object.defineProperty(result, key, {
|
|
26
|
-
value: yield* value(yield),
|
|
27
|
-
configurable: true,
|
|
28
|
-
enumerable: true,
|
|
29
|
-
writable: true
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
case "startArray": {
|
|
35
|
-
const result = [];
|
|
36
|
-
for (let token = yield; token.name !== "endArray"; token = yield) result.push(yield* value(token));
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
case "startString": return yield* stringValue();
|
|
40
|
-
case "numberValue": return Number(first.value);
|
|
41
|
-
case "trueValue":
|
|
42
|
-
case "falseValue":
|
|
43
|
-
case "nullValue": return first.value;
|
|
44
|
-
default: throw new SyntaxError(`Unexpected JSON token ${first.name}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function* tag(first) {
|
|
48
|
-
if (first.name === "startString") return yield* stringValue(64);
|
|
49
|
-
yield* skip(first);
|
|
50
|
-
}
|
|
51
|
-
/** Compare a saved string with `expected` as it streams, without building it. */
|
|
52
|
-
function* equals(first, expected) {
|
|
53
|
-
if (first.name !== "startString") {
|
|
54
|
-
yield* skip(first);
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
let offset = 0;
|
|
58
|
-
let same = true;
|
|
59
|
-
for (let part = yield; part.name === "stringChunk"; part = yield) {
|
|
60
|
-
same &&= expected.startsWith(part.value, offset);
|
|
61
|
-
offset += part.value.length;
|
|
62
|
-
}
|
|
63
|
-
return same && offset === expected.length;
|
|
64
|
-
}
|
|
65
|
-
/** Select `fields` of the entry's message; a repeated `message` key replaces the earlier one, as in `JSON.parse`. */
|
|
66
|
-
function* message(fields, reset) {
|
|
67
|
-
yield* object(yield, { *message(token) {
|
|
68
|
-
reset();
|
|
69
|
-
yield* object(token, fields);
|
|
70
|
-
} });
|
|
71
|
-
}
|
|
72
|
-
const HEADER_READ = Symbol("header read");
|
|
73
|
-
/**
|
|
74
|
-
* The fields that decide what an entry adds to a card, in one pass that keeps none of its content. The pass ends as
|
|
75
|
-
* soon as they are known, which in a saved row is before its message content.
|
|
76
|
-
*/
|
|
77
|
-
function savedEntryHeader(chunks, throughId, idLimit) {
|
|
78
|
-
return read(chunks, (function* () {
|
|
79
|
-
let boundary = false;
|
|
80
|
-
let seenId = throughId === void 0;
|
|
81
|
-
let type;
|
|
82
|
-
let fields = {};
|
|
83
|
-
let seenCallId = false;
|
|
84
|
-
const known = () => seenId && type !== void 0 && (type !== "message" || fields.role !== void 0 && (fields.role !== "toolResult" || seenCallId));
|
|
85
|
-
try {
|
|
86
|
-
yield* object(yield, {
|
|
87
|
-
*id(token) {
|
|
88
|
-
if (throughId === void 0) yield* skip(token);
|
|
89
|
-
else boundary = yield* equals(token, throughId);
|
|
90
|
-
seenId = true;
|
|
91
|
-
if (known()) throw HEADER_READ;
|
|
92
|
-
},
|
|
93
|
-
*type(token) {
|
|
94
|
-
type = yield* tag(token);
|
|
95
|
-
if (known()) throw HEADER_READ;
|
|
96
|
-
},
|
|
97
|
-
*message(token) {
|
|
98
|
-
fields = {};
|
|
99
|
-
seenCallId = false;
|
|
100
|
-
yield* object(token, {
|
|
101
|
-
*role(role) {
|
|
102
|
-
fields.role = yield* tag(role);
|
|
103
|
-
if (known()) throw HEADER_READ;
|
|
104
|
-
},
|
|
105
|
-
*toolCallId(id) {
|
|
106
|
-
delete fields.toolCallId;
|
|
107
|
-
delete fields.longToolCallId;
|
|
108
|
-
seenCallId = true;
|
|
109
|
-
if (id.name !== "startString") yield* skip(id);
|
|
110
|
-
else {
|
|
111
|
-
const text = yield* stringValue(idLimit + 1);
|
|
112
|
-
if (text.length > idLimit) fields.longToolCallId = true;
|
|
113
|
-
else fields.toolCallId = text;
|
|
114
|
-
}
|
|
115
|
-
if (known()) throw HEADER_READ;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
1
|
+
// Written by the build (scripts/in-place-update-gate.mjs): when this module's code cannot load in a process of an earlier release
|
|
2
|
+
// that an in-place update left running, the process is told to restart.
|
|
3
|
+
let module;
|
|
4
|
+
try {
|
|
5
|
+
module = await import("./task-completion-entry.code.js");
|
|
6
|
+
} catch (error) {
|
|
7
|
+
const root = new URL("../../", import.meta.url);
|
|
8
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
+
const key = `${root.href}#0.10.5-alpha.1`;
|
|
10
|
+
let release = releases.get(key);
|
|
11
|
+
if (release === undefined) {
|
|
12
|
+
const current = (async () => {
|
|
13
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
14
|
+
try {
|
|
15
|
+
const held = await import(new URL(path, root).href);
|
|
16
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
17
|
+
} catch {
|
|
18
|
+
// Not a file this process can load: the next.
|
|
118
19
|
}
|
|
119
|
-
});
|
|
120
|
-
} catch (error) {
|
|
121
|
-
if (error !== HEADER_READ) throw error;
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
boundary,
|
|
125
|
-
...type === void 0 ? {} : { type },
|
|
126
|
-
...fields
|
|
127
|
-
};
|
|
128
|
-
})());
|
|
129
|
-
}
|
|
130
|
-
const ESCAPE = new TextEncoder().encode("\\u");
|
|
131
|
-
function indexOf(bytes, needle) {
|
|
132
|
-
search: for (let at = bytes.indexOf(needle[0]); at >= 0 && at <= bytes.length - needle.length; at = bytes.indexOf(needle[0], at + 1)) {
|
|
133
|
-
for (let i = 1; i < needle.length; i++) if (bytes[at + i] !== needle[i]) continue search;
|
|
134
|
-
return at;
|
|
135
|
-
}
|
|
136
|
-
return -1;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Whether a saved row can hold the string `text` anywhere: its bytes spell it, or escape a character somewhere.
|
|
140
|
-
* A row that can't is passed over without tokenizing it.
|
|
141
|
-
*/
|
|
142
|
-
async function savedRowMayHold(chunks, text) {
|
|
143
|
-
const needle = new TextEncoder().encode(text);
|
|
144
|
-
const overlap = Math.max(needle.length, ESCAPE.length) - 1;
|
|
145
|
-
let tail = /* @__PURE__ */ new Uint8Array(0);
|
|
146
|
-
for await (const chunk of chunks) {
|
|
147
|
-
const bytes = new Uint8Array(tail.length + chunk.length);
|
|
148
|
-
bytes.set(tail);
|
|
149
|
-
bytes.set(chunk, tail.length);
|
|
150
|
-
if (indexOf(bytes, needle) >= 0 || indexOf(bytes, ESCAPE) >= 0) return true;
|
|
151
|
-
tail = bytes.slice(Math.max(0, bytes.length - overlap));
|
|
152
|
-
}
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
/** A user message's text as a card's prompt reads it: its string, or its text blocks joined by newlines. */
|
|
156
|
-
function savedUserText(chunks) {
|
|
157
|
-
return read(chunks, (function* () {
|
|
158
|
-
let text;
|
|
159
|
-
yield* message({ *content(token) {
|
|
160
|
-
text = void 0;
|
|
161
|
-
if (token.name === "startString") {
|
|
162
|
-
text = yield* stringValue();
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
if (token.name !== "startArray") {
|
|
166
|
-
yield* skip(token);
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
const parts = [];
|
|
170
|
-
for (let part = yield; part.name !== "endArray"; part = yield) {
|
|
171
|
-
let type;
|
|
172
|
-
let partText;
|
|
173
|
-
yield* object(part, {
|
|
174
|
-
*type(t) {
|
|
175
|
-
type = yield* tag(t);
|
|
176
|
-
},
|
|
177
|
-
*text(t) {
|
|
178
|
-
partText = void 0;
|
|
179
|
-
if (t.name === "startString") partText = yield* stringValue();
|
|
180
|
-
else yield* skip(t);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
if (type === "text" && partText !== void 0) parts.push(partText);
|
|
184
20
|
}
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
21
|
+
return undefined;
|
|
22
|
+
})().then((found) => {
|
|
23
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
24
|
+
return found;
|
|
188
25
|
});
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
for (let part = yield; part.name !== "endArray"; part = yield) {
|
|
203
|
-
let type;
|
|
204
|
-
const call = {};
|
|
205
|
-
yield* object(part, {
|
|
206
|
-
*type(t) {
|
|
207
|
-
type = yield* tag(t);
|
|
208
|
-
},
|
|
209
|
-
*id(t) {
|
|
210
|
-
call.id = yield* value(t);
|
|
211
|
-
},
|
|
212
|
-
*name(t) {
|
|
213
|
-
call.name = yield* value(t);
|
|
214
|
-
},
|
|
215
|
-
*arguments(t) {
|
|
216
|
-
call.arguments = yield* value(t);
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
if (type === "toolCall") calls.push(call);
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
yield* message({ content }, () => {
|
|
223
|
-
calls = [];
|
|
224
|
-
});
|
|
225
|
-
return calls;
|
|
226
|
-
})());
|
|
227
|
-
}
|
|
228
|
-
/** What a card shows of a tool result: its content, details, error flag and duration. */
|
|
229
|
-
function savedToolResult(chunks) {
|
|
230
|
-
return read(chunks, (function* () {
|
|
231
|
-
let result = { hasDetails: false };
|
|
232
|
-
yield* message({
|
|
233
|
-
*content(t) {
|
|
234
|
-
result.content = yield* value(t);
|
|
235
|
-
},
|
|
236
|
-
*details(t) {
|
|
237
|
-
result.hasDetails = true;
|
|
238
|
-
result.details = yield* value(t);
|
|
239
|
-
},
|
|
240
|
-
*isError(t) {
|
|
241
|
-
result.isError = yield* value(t);
|
|
242
|
-
},
|
|
243
|
-
*durationMs(t) {
|
|
244
|
-
result.durationMs = yield* value(t);
|
|
245
|
-
}
|
|
246
|
-
}, () => {
|
|
247
|
-
result = { hasDetails: false };
|
|
248
|
-
});
|
|
249
|
-
return result;
|
|
250
|
-
})());
|
|
251
|
-
}
|
|
252
|
-
export { savedEntryHeader, savedRowMayHold, savedToolCalls, savedToolResult, savedUserText };
|
|
253
|
-
|
|
254
|
-
//# sourceMappingURL=task-completion-entry.impl.js.map
|
|
26
|
+
releases.set(key, current);
|
|
27
|
+
release = current;
|
|
28
|
+
}
|
|
29
|
+
const running = await release;
|
|
30
|
+
if (running === undefined || running.version === "0.10.5-alpha.1") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.5-alpha.1 while this session was running; restart it to keep using /tasks.", {
|
|
32
|
+
cause: error,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export const { savedEntryHeader, savedRowMayHold, savedToolCalls, savedToolResult, savedUserText } = module;
|
|
36
|
+
//# sourceMappingURL=task-completion-entry.impl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-completion-entry.impl.js","
|
|
1
|
+
{"version":3,"file":"task-completion-entry.impl.js","sources":[],"names":[],"mappings":""}
|