@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
|
@@ -19,6 +19,8 @@ export interface ProcessExit {
|
|
|
19
19
|
readonly elapsedMs: number;
|
|
20
20
|
/** Why the process could not be started, when it could not. */
|
|
21
21
|
readonly spawnError?: Error;
|
|
22
|
+
/** Set when the process ran and exited, but its exit status could not be determined. */
|
|
23
|
+
readonly exitError?: Error;
|
|
22
24
|
}
|
|
23
25
|
export interface LoggedProcessOptions {
|
|
24
26
|
readonly timeoutMs: number;
|
|
@@ -28,7 +30,7 @@ export interface LoggedProcessOptions {
|
|
|
28
30
|
* Told of each process a step starts (`running` true) and of its end, for the build that runs the step: a build records
|
|
29
31
|
* them so a later process can stop them when this one dies without stopping them (#4748).
|
|
30
32
|
*/
|
|
31
|
-
export declare const stepProcessWatcher: import("../../async-scope.ts").AsyncScope<(pid: number, running: boolean) => void>;
|
|
33
|
+
export declare const stepProcessWatcher: import("../../async-scope.ts").AsyncScope<(pid: number, running: boolean, stillRunning?: () => boolean) => void>;
|
|
32
34
|
export declare const stepStartingWatcher: import("../../async-scope.ts").AsyncScope<() => void>;
|
|
33
35
|
export declare function buildProcessStarting(): void;
|
|
34
36
|
/** Whether a process started on `platform` leads its own process group, which is how stopping it stops its children. */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../_shared/rolldown-runtime-BGM3D5V3.js";
|
|
2
|
+
import { withFileMutationQueue } from "../_shared/startup-0-0-TYUFUOJZ.js";
|
|
3
|
+
import { isPowerShellToolResult, withResourceAdmission } from "../_shared/startup-0-1-D4LGGINF.js";
|
|
4
|
+
import { STRUCTURED_OUTPUT_TOOL_NAME, createStructuredOutputCapture, createStructuredOutputTool, getPowerShellConfig } from "../_shared/startup-0-2-SZGQIWHI.js";
|
|
5
|
+
import { createKillTool } from "../_shared/startup-0-5-OHJNE6JH.js";
|
|
6
|
+
import { BASH_SHELL_PRESENTATION, createBashTool, createCodingTools, createEditTool, createFindTool, createLocalPowerShellOperations, createLsTool, createPowerShellTool, createPowerShellToolDefinition, createReadOnlyTools, createReadTool, createSearchTool, createWriteTool } from "../_shared/startup-8-1-SJW2GMAM.js";
|
|
7
|
+
import { AgentSessionRuntime, HOST_STARTED_SESSION, SessionImportFileNotFoundError, createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createUnstartedAgentSession } from "../_shared/startup-15-1-4S7FLMNG.js";
|
|
8
|
+
export { AgentSessionRuntime, BASH_SHELL_PRESENTATION, HOST_STARTED_SESSION, STRUCTURED_OUTPUT_TOOL_NAME, SessionImportFileNotFoundError, createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashTool, createCodingTools, createEditTool, createFindTool, createKillTool, createLocalPowerShellOperations, createLsTool, createPowerShellTool, createPowerShellToolDefinition, createReadOnlyTools, createReadTool, createSearchTool, createStructuredOutputCapture, createStructuredOutputTool, createUnstartedAgentSession, createWriteTool, getPowerShellConfig, isPowerShellToolResult, withFileMutationQueue, withResourceAdmission };
|
|
9
|
+
//# sourceMappingURL=sdk.code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.code.js","sources":[],"names":[],"mappings":""}
|
package/dist/core/sdk.impl.js
CHANGED
|
@@ -1,9 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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("./sdk.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`;
|
|
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") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.5 while this session was running; restart it to keep using this feature.", {
|
|
32
|
+
cause: error,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export const { AgentSessionRuntime, BASH_SHELL_PRESENTATION, HOST_STARTED_SESSION, STRUCTURED_OUTPUT_TOOL_NAME, SessionImportFileNotFoundError, createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashTool, createCodingTools, createEditTool, createFindTool, createKillTool, createLocalPowerShellOperations, createLsTool, createPowerShellTool, createPowerShellToolDefinition, createReadOnlyTools, createReadTool, createSearchTool, createStructuredOutputCapture, createStructuredOutputTool, createUnstartedAgentSession, createWriteTool, getPowerShellConfig, isPowerShellToolResult, withFileMutationQueue, withResourceAdmission } = module;
|
|
9
36
|
//# sourceMappingURL=sdk.impl.js.map
|
package/dist/core/sdk.js
CHANGED
|
@@ -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("./sdk.
|
|
5
|
+
module = await import("./sdk.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`;
|
|
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") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.5 while this session was running; restart it to keep using this feature.", {
|
|
28
32
|
cause: error,
|
|
29
33
|
});
|
|
30
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ImageContent, Message, TextContent, Usage } from "@bastani/atomic-ai/compat";
|
|
2
2
|
import type { VerbatimCompactionDetails } from "./compaction/compaction-types.js";
|
|
3
3
|
import type { BashExecutionMessage, CustomMessage } from "./messages.ts";
|
|
4
|
-
import type { ContextEditEntry, FileEntry, ModelChangeEntry, ModelFallbackRecord, NewSessionOptions, SessionContext, SessionEntry, SessionHeader, SessionInfo, SessionListProgress, SessionNameState, SessionOpenOptions, SessionProjection, SessionTreeNode, ThinkingLevelChangeEntry, UsageEntry, WorktreeRestoreHostWarning } from "./session-manager-types.ts";
|
|
4
|
+
import type { ContextEditEntry, FileEntry, LatestBranchSettings, ModelChangeEntry, ModelFallbackRecord, NewSessionOptions, SessionContext, SessionEntry, SessionHeader, SessionInfo, SessionListProgress, SessionNameState, SessionOpenOptions, SessionProjection, SessionTreeNode, ThinkingLevelChangeEntry, UsageEntry, WorktreeRestoreHostWarning } from "./session-manager-types.ts";
|
|
5
5
|
import { type ChatRecordOwner, type SessionChatRecords } from "./storage/session/chat-records.js";
|
|
6
6
|
import { SessionConflictError, type SessionJsonValue } from "./storage/session/errors.js";
|
|
7
7
|
import { SessionKeyDigests } from "./storage/session/key-digests.js";
|
|
@@ -56,6 +56,7 @@ export declare class SessionManager {
|
|
|
56
56
|
private historyIndex;
|
|
57
57
|
private historyStartSeq;
|
|
58
58
|
private answerWindowStart;
|
|
59
|
+
private branchSettingsVouchedFrom;
|
|
59
60
|
private priorAnswer?;
|
|
60
61
|
private childArchive;
|
|
61
62
|
private archiveOnlyEpoch;
|
|
@@ -160,10 +161,9 @@ export declare class SessionManager {
|
|
|
160
161
|
};
|
|
161
162
|
/**
|
|
162
163
|
* @internal The latest model change and the latest thinking-level change on the active branch after position
|
|
163
|
-
* `afterSeq`, each with its position; one the branch has none of after it is absent. Answered
|
|
164
|
-
* from the store.
|
|
165
|
-
*
|
|
166
|
-
* state of the resume index). A subagent's restore relies on that to continue on the model and level it last ran.
|
|
164
|
+
* `afterSeq`, each with its position; one the branch has none of after it (or does not hold) is absent. Answered
|
|
165
|
+
* from memory, never from the store. Kept in the 0.10.4 shape for compatibility; prefer
|
|
166
|
+
* {@link getLatestBranchSettingsWithProvenance} when callers must distinguish confirmed absence from `"not-held"`.
|
|
167
167
|
*/
|
|
168
168
|
getLatestBranchSettings(afterSeq?: number): {
|
|
169
169
|
readonly model?: {
|
|
@@ -175,6 +175,16 @@ export declare class SessionManager {
|
|
|
175
175
|
readonly seq: number;
|
|
176
176
|
};
|
|
177
177
|
};
|
|
178
|
+
/**
|
|
179
|
+
* @internal The latest model change and the latest thinking-level change on the active branch after position
|
|
180
|
+
* `afterSeq`, each reported as `"found"` (with its entry and position), `"none"` (confirmed absent after `afterSeq`),
|
|
181
|
+
* or `"not-held"` (partial history or a resume plan explicitly omitted entries that could carry a change after
|
|
182
|
+
* `afterSeq`). Answered from memory, never from the store. A session opened through Atomic's resume plan retains
|
|
183
|
+
* both axes (`setting:` state + `SessionResume.retainedSettings`), so normal full and tail resumes never report
|
|
184
|
+
* `"not-held"`; older or custom stores that omit `retainedSettings` preserve pre-existing behavior.
|
|
185
|
+
*/
|
|
186
|
+
getLatestBranchSettingsWithProvenance(afterSeq?: number): LatestBranchSettings;
|
|
187
|
+
private latestBranchSettingsWithProvenance;
|
|
178
188
|
getOmittedHistoryTotals(): SessionHistoryTotals | undefined;
|
|
179
189
|
/**
|
|
180
190
|
* @internal Marks the session this manager has open, and each one it switches to, as open in this process until
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../_shared/rolldown-runtime-BGM3D5V3.js";
|
|
2
|
-
import { createSessionCwdMatcherAsync, getAgentDir, normalizePath, pathsEqual, resolvePath } from "../_shared/p0-cli-
|
|
3
|
-
import { TOOL_DEACTIVATION_ENTRY_TYPE, chatEpoch, classifiedWorkflowMetadata, forkScope, forkStoreRelation, getDefaultSessionDirPath, yieldToEventLoop } from "../_shared/startup-0-0-
|
|
4
|
-
import { ChildCatalog, SessionKeyDigests, TOOL_OUTPUT_ENTRY_TYPE, WorkspaceConfigError, assertSessionBlobStore, assertSessionNotOpenElsewhere, carriedTransformedPrompt, carryCompletionEvidence, convertToLlm, copySessionBlobs, holdSessionOpenMarker, sessionBlobHashes, shareCompletionEvidence, storeInlineToolOutputs, storeSessionBlobs, takeInlineToolOutput, takeInlineToolOutputEntry, writeChunksAtomically } from "../_shared/startup-0-1-
|
|
5
|
-
import "../_shared/startup-0-2-
|
|
2
|
+
import { createSessionCwdMatcherAsync, getAgentDir, normalizePath, pathsEqual, resolvePath } from "../_shared/p0-cli-BB45ZQY6.js";
|
|
3
|
+
import { TOOL_DEACTIVATION_ENTRY_TYPE, chatEpoch, classifiedWorkflowMetadata, forkScope, forkStoreRelation, getDefaultSessionDirPath, yieldToEventLoop } from "../_shared/startup-0-0-TYUFUOJZ.js";
|
|
4
|
+
import { ChildCatalog, SessionKeyDigests, TOOL_OUTPUT_ENTRY_TYPE, WorkspaceConfigError, assertSessionBlobStore, assertSessionNotOpenElsewhere, carriedTransformedPrompt, carryCompletionEvidence, convertToLlm, copySessionBlobs, holdSessionOpenMarker, sessionBlobHashes, shareCompletionEvidence, storeInlineToolOutputs, storeSessionBlobs, takeInlineToolOutput, takeInlineToolOutputEntry, writeChunksAtomically } from "../_shared/startup-0-1-D4LGGINF.js";
|
|
5
|
+
import "../_shared/startup-0-2-SZGQIWHI.js";
|
|
6
6
|
import { LEAF_MOVE_ENTRY_TYPE, applyContextEdit, buildContextEntries, buildSessionIndex, buildSessionProjection, buildSessionTree, collectContextEdits, getBranchPath, getLatestCompactionBoundaryEntry, isLeafMoveEntry } from "../_shared/startup-0-3-T4DVFYWX.js";
|
|
7
7
|
import { SESSION_HISTORY_SCAN_ENTRIES, SessionDeletedError, SessionEntryError } from "../_shared/settings-startup-65YEWRV2.js";
|
|
8
8
|
import { EMPTY_SESSION_HISTORY_TOTALS, JsonlSessionStore, MemorySessionStore, addEntryToHistoryTotals, appendFailureWroteNothing, archivedAnswerAt, assertValidSessionId, bindSessionFile, createBranchSummaryEntry, createCompactionEntry, createContextEditEntry, createCustomEntry, createCustomMessageEntry, createLabelEntry, createMessageEntry, createModelChangeEntry, createSessionFilePath, createSessionHeader, createSessionId, createSessionInfoEntry, createSessionSummaryEntry, createThinkingLevelChangeEntry, createWorktreeSnapshotEntry, earlierTranscriptCursor, findInSessionHistory, findWorktreeSnapshotRecords, firstHistoryCursor, generateId, getEntriesWithoutHeader, getLatestSessionName, historyChunks, historyPages, isExtensionCustomState, lastBranchAnswer, markPrivateMemorySessionStore, readSessionRange, recoveryWitnessesOf, savedWindowAnswer, sessionResumeOf, storeSnapshotIndex, updateWorkflowStarts, validateSessionEntryStructure, validateSessionFileEntries, withForkFileWindow, witnessedIn, worktreeSnapshotPages } from "../_shared/startup-8-0-34CBHPZH.js";
|
|
9
|
-
import { adoptInlineSnapshotBlobs, deleteSessionWithSnapshotRefs } from "../_shared/startup-8-1-
|
|
9
|
+
import { adoptInlineSnapshotBlobs, deleteSessionWithSnapshotRefs } from "../_shared/startup-8-1-SJW2GMAM.js";
|
|
10
10
|
import { listProjectSessions, resolveParentSessionPaths } from "../_shared/session-manager-list-2BLEEZVG.js";
|
|
11
11
|
import { realpath, stat } from "node:fs/promises";
|
|
12
12
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
@@ -48,7 +48,7 @@ async function includeNamedForkOutputs(entries, store, sessionId, leaf, epoch, t
|
|
|
48
48
|
id: item.entry.id,
|
|
49
49
|
parentId: item.entry.parentId,
|
|
50
50
|
hash: hashOf(item.entry)
|
|
51
|
-
} : await (await import("./storage/session/chunked-resume-projection.
|
|
51
|
+
} : await (await import("./storage/session/chunked-resume-projection.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).chunkedForkLink(() => historyChunks(store, sessionId, epoch, item, {}));
|
|
52
52
|
if (links.id !== void 0 && positions.has(links.id)) positions.set(links.id, item.seq);
|
|
53
53
|
const ancestor = links.id === next;
|
|
54
54
|
if (!ancestor && scope === "branch") continue;
|
|
@@ -561,10 +561,10 @@ async function exactDirectoryRelation(source, target) {
|
|
|
561
561
|
/** How many times one append reads the store's new tail and tries again before its failure stands (#4970). */
|
|
562
562
|
const MAX_APPEND_RECONCILES = 3;
|
|
563
563
|
async function resolveSessionStore(cwd) {
|
|
564
|
-
return (await import("./session-storage.
|
|
564
|
+
return (await import("./session-storage.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).resolveSessionStore(cwd);
|
|
565
565
|
}
|
|
566
566
|
async function withPriorAnswer(store, resume) {
|
|
567
|
-
const selected = resume.deferredChildren ? await (await import("./storage/session/child-reader.
|
|
567
|
+
const selected = resume.deferredChildren ? await (await import("./storage/session/child-reader.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).resolveDeferredChildren(store, resume) : resume;
|
|
568
568
|
return Object.hasOwn(resume, "priorAnswer") ? selected : {
|
|
569
569
|
...selected,
|
|
570
570
|
priorAnswer: await savedWindowAnswer(store, selected)
|
|
@@ -572,7 +572,7 @@ async function withPriorAnswer(store, resume) {
|
|
|
572
572
|
}
|
|
573
573
|
async function readStoredSession(store, sessionId, options) {
|
|
574
574
|
if (options?.history === "full") return { snapshot: await store.load(sessionId) };
|
|
575
|
-
if (!store.readResume || !store.readRange) return { resume: await (await import("./storage/session/snapshot-history.
|
|
575
|
+
if (!store.readResume || !store.readRange) return { resume: await (await import("./storage/session/snapshot-history.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).snapshotWindow(store, sessionId, options?.leafId, void 0, void 0, isProxy) };
|
|
576
576
|
return { resume: await withPriorAnswer(store, await store.readResume(sessionId, options?.leafId, { deferChildRecords: true })) };
|
|
577
577
|
}
|
|
578
578
|
async function openSessionFileWindow(path, cwd, options) {
|
|
@@ -636,7 +636,7 @@ function exportedSessionStream(source, outputs, finish) {
|
|
|
636
636
|
return {
|
|
637
637
|
kind: "complete-session",
|
|
638
638
|
async *read() {
|
|
639
|
-
const { forkSeedFields } = await import("./storage/session/chunked-resume-projection.
|
|
639
|
+
const { forkSeedFields } = await import("./storage/session/chunked-resume-projection.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"));
|
|
640
640
|
for await (const { items } of historyPages(history, id, file.epoch, file.lastSeq, { pageEntries: SESSION_HISTORY_SCAN_ENTRIES })) for (const item of items) {
|
|
641
641
|
let row = "entry" in item ? { entry: item.entry } : file.legacy ? { entry: await readExportedEntry(source, item.seq) } : {
|
|
642
642
|
...await forkSeedFields(() => historyChunks(history, id, file.epoch, item, {})),
|
|
@@ -666,6 +666,37 @@ function physicalForkHeader(manager) {
|
|
|
666
666
|
const read = prototype && !isProxy(prototype) && Object.getOwnPropertyDescriptor(prototype, forkGeneration)?.value;
|
|
667
667
|
return typeof read === "function" ? read.call(manager) : void 0;
|
|
668
668
|
}
|
|
669
|
+
/** Whether `branch` is a gap-free active path all the way from a root entry (`parentId === null`) to `leafId`. */
|
|
670
|
+
function isRootCompleteBranch(branch, leafId) {
|
|
671
|
+
if (leafId === null || branch.length === 0) return false;
|
|
672
|
+
if (branch[0].parentId !== null || branch.at(-1).id !== leafId) return false;
|
|
673
|
+
for (let index = 1; index < branch.length; index++) if (branch[index].parentId !== branch[index - 1].id) return false;
|
|
674
|
+
return true;
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Lowest sequence position from which a reopened manager can vouch for one setting axis (`model_change` or
|
|
678
|
+
* `thinking_level_change`): `1` means the entire active branch is covered (either via full history, an older/custom
|
|
679
|
+
* store omitting `retainedSettings`, confirmed absence, or a verified retained setting before the window); `tailFrom`
|
|
680
|
+
* covers the contiguous active-branch tail; `lastSeq + 1` fails closed when the store explicitly reports `not-held` or
|
|
681
|
+
* contradicts the returned entries.
|
|
682
|
+
*/
|
|
683
|
+
function vouchedFromForResumeAxis(entryType, retained, path, leafId, hasFullHistory, lastSeq, tailFrom) {
|
|
684
|
+
if (leafId === null) return 1;
|
|
685
|
+
if (hasFullHistory && retained?.status !== "not-held") return 1;
|
|
686
|
+
if (retained === void 0) return 1;
|
|
687
|
+
if (retained.status === "not-held") return lastSeq + 1;
|
|
688
|
+
if (retained.status === "none") return path.some(({ entry }) => entry.type === entryType) ? lastSeq + 1 : 1;
|
|
689
|
+
const { seq } = retained;
|
|
690
|
+
if (!Number.isSafeInteger(seq) || seq < 1 || seq > lastSeq) return lastSeq + 1;
|
|
691
|
+
let matched = false;
|
|
692
|
+
for (const held of path) {
|
|
693
|
+
if (held.entry.type !== entryType) continue;
|
|
694
|
+
if (held.seq > seq) return lastSeq + 1;
|
|
695
|
+
if (held.seq === seq) matched = true;
|
|
696
|
+
}
|
|
697
|
+
if (!matched) return lastSeq + 1;
|
|
698
|
+
return seq < tailFrom ? 1 : tailFrom;
|
|
699
|
+
}
|
|
669
700
|
/** An in-memory session tree whose mutations await the backing store. */
|
|
670
701
|
var SessionManager = class SessionManager {
|
|
671
702
|
sessionId = "";
|
|
@@ -698,6 +729,10 @@ var SessionManager = class SessionManager {
|
|
|
698
729
|
historyIndex = new SessionHistoryIndex();
|
|
699
730
|
historyStartSeq = 1;
|
|
700
731
|
answerWindowStart = 1;
|
|
732
|
+
branchSettingsVouchedFrom = {
|
|
733
|
+
model: 1,
|
|
734
|
+
thinkingLevel: 1
|
|
735
|
+
};
|
|
701
736
|
priorAnswer;
|
|
702
737
|
childArchive = new ChildCatalog();
|
|
703
738
|
archiveOnlyEpoch = false;
|
|
@@ -784,6 +819,11 @@ var SessionManager = class SessionManager {
|
|
|
784
819
|
const path = [...state.filter((e) => e.onBranch), ...resume.branch].sort((a, b) => a.seq - b.seq);
|
|
785
820
|
this.branchLinks = new Map(path.slice(1).map((held, i) => [held.entry.id, path[i].entry.id]));
|
|
786
821
|
this.leafId = resume.leafId;
|
|
822
|
+
const tailFrom = this.hasFullHistory() ? 1 : resume.branch[0]?.seq ?? resume.lastSeq + 1;
|
|
823
|
+
this.branchSettingsVouchedFrom = {
|
|
824
|
+
model: vouchedFromForResumeAxis("model_change", resume.retainedSettings?.model, path, resume.leafId, this.hasFullHistory(), resume.lastSeq, tailFrom),
|
|
825
|
+
thinkingLevel: vouchedFromForResumeAxis("thinking_level_change", resume.retainedSettings?.thinkingLevel, path, resume.leafId, this.hasFullHistory(), resume.lastSeq, tailFrom)
|
|
826
|
+
};
|
|
787
827
|
Object.assign(this.byId, { preferFullIds: !this.hasFullHistory() });
|
|
788
828
|
}
|
|
789
829
|
restoreHistory(header, entries, lastSeq, location, partial) {
|
|
@@ -798,6 +838,10 @@ var SessionManager = class SessionManager {
|
|
|
798
838
|
this.appendHalt = void 0;
|
|
799
839
|
this.historyStartSeq = partial?.fromSeq ?? 1;
|
|
800
840
|
this.answerWindowStart = 1;
|
|
841
|
+
this.branchSettingsVouchedFrom = {
|
|
842
|
+
model: 1,
|
|
843
|
+
thinkingLevel: 1
|
|
844
|
+
};
|
|
801
845
|
this.priorAnswer = void 0;
|
|
802
846
|
this.entrySeqs = new Map(entries.map((entry, i) => [entry.id, i + 1]));
|
|
803
847
|
this.lastEntryId = entries.at(-1)?.id ?? null;
|
|
@@ -876,6 +920,10 @@ var SessionManager = class SessionManager {
|
|
|
876
920
|
this.fileEntries = [this.fileEntries[0], ...ordered.map(([, entry]) => entry)];
|
|
877
921
|
this.entrySeqs = new Map(ordered.map(([seq, entry]) => [entry.id, seq]));
|
|
878
922
|
this.historyStartSeq = 1;
|
|
923
|
+
this.branchSettingsVouchedFrom = {
|
|
924
|
+
model: 1,
|
|
925
|
+
thinkingLevel: 1
|
|
926
|
+
};
|
|
879
927
|
this.omittedTotals = void 0;
|
|
880
928
|
this.branchLinks = void 0;
|
|
881
929
|
this._buildIndex();
|
|
@@ -1039,7 +1087,7 @@ var SessionManager = class SessionManager {
|
|
|
1039
1087
|
if (typeof data?.runId === "string") ids.push(data.runId);
|
|
1040
1088
|
}
|
|
1041
1089
|
} else {
|
|
1042
|
-
const { readChunkedWorkflowRunId } = await import("./storage/session/chunked-resume-projection.
|
|
1090
|
+
const { readChunkedWorkflowRunId } = await import("./storage/session/chunked-resume-projection.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"));
|
|
1043
1091
|
const id = await readChunkedWorkflowRunId(historyChunks(store, sessionId, historyEpoch, item, {}));
|
|
1044
1092
|
if (id !== void 0) ids.push(id);
|
|
1045
1093
|
}
|
|
@@ -1073,32 +1121,71 @@ var SessionManager = class SessionManager {
|
|
|
1073
1121
|
}
|
|
1074
1122
|
/**
|
|
1075
1123
|
* @internal The latest model change and the latest thinking-level change on the active branch after position
|
|
1076
|
-
* `afterSeq`, each with its position; one the branch has none of after it is absent. Answered
|
|
1077
|
-
* from the store.
|
|
1078
|
-
*
|
|
1079
|
-
* state of the resume index). A subagent's restore relies on that to continue on the model and level it last ran.
|
|
1124
|
+
* `afterSeq`, each with its position; one the branch has none of after it (or does not hold) is absent. Answered
|
|
1125
|
+
* from memory, never from the store. Kept in the 0.10.4 shape for compatibility; prefer
|
|
1126
|
+
* {@link getLatestBranchSettingsWithProvenance} when callers must distinguish confirmed absence from `"not-held"`.
|
|
1080
1127
|
*/
|
|
1081
1128
|
getLatestBranchSettings(afterSeq = 0) {
|
|
1082
|
-
|
|
1083
|
-
|
|
1129
|
+
const { model, thinkingLevel } = this.latestBranchSettingsWithProvenance(afterSeq);
|
|
1130
|
+
return {
|
|
1131
|
+
...model.status === "found" ? { model: {
|
|
1132
|
+
entry: model.entry,
|
|
1133
|
+
seq: model.seq
|
|
1134
|
+
} } : {},
|
|
1135
|
+
...thinkingLevel.status === "found" ? { thinkingLevel: {
|
|
1136
|
+
entry: thinkingLevel.entry,
|
|
1137
|
+
seq: thinkingLevel.seq
|
|
1138
|
+
} } : {}
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* @internal The latest model change and the latest thinking-level change on the active branch after position
|
|
1143
|
+
* `afterSeq`, each reported as `"found"` (with its entry and position), `"none"` (confirmed absent after `afterSeq`),
|
|
1144
|
+
* or `"not-held"` (partial history or a resume plan explicitly omitted entries that could carry a change after
|
|
1145
|
+
* `afterSeq`). Answered from memory, never from the store. A session opened through Atomic's resume plan retains
|
|
1146
|
+
* both axes (`setting:` state + `SessionResume.retainedSettings`), so normal full and tail resumes never report
|
|
1147
|
+
* `"not-held"`; older or custom stores that omit `retainedSettings` preserve pre-existing behavior.
|
|
1148
|
+
*/
|
|
1149
|
+
getLatestBranchSettingsWithProvenance(afterSeq = 0) {
|
|
1150
|
+
return this.latestBranchSettingsWithProvenance(afterSeq);
|
|
1151
|
+
}
|
|
1152
|
+
latestBranchSettingsWithProvenance(afterSeq) {
|
|
1153
|
+
if (this.leafId === null) return {
|
|
1154
|
+
model: { status: "none" },
|
|
1155
|
+
thinkingLevel: { status: "none" }
|
|
1156
|
+
};
|
|
1084
1157
|
const branch = this.getBranch();
|
|
1085
|
-
|
|
1158
|
+
const leafSeq = this.entrySeqs.get(this.leafId);
|
|
1159
|
+
const rootComplete = (this.branchSettingsVouchedFrom.model > 1 || this.branchSettingsVouchedFrom.thinkingLevel > 1) && isRootCompleteBranch(branch, this.leafId);
|
|
1160
|
+
let modelEntry;
|
|
1161
|
+
let thinkingEntry;
|
|
1162
|
+
for (let index = branch.length - 1; index >= 0 && (modelEntry === void 0 || thinkingEntry === void 0); index--) {
|
|
1086
1163
|
const entry = branch[index];
|
|
1087
1164
|
const seq = this.entrySeqs.get(entry.id);
|
|
1088
1165
|
if (seq === void 0) continue;
|
|
1089
1166
|
if (seq <= afterSeq) break;
|
|
1090
|
-
if (entry.type === "model_change")
|
|
1167
|
+
if (entry.type === "model_change") modelEntry ??= {
|
|
1091
1168
|
entry,
|
|
1092
1169
|
seq
|
|
1093
1170
|
};
|
|
1094
|
-
else if (entry.type === "thinking_level_change")
|
|
1171
|
+
else if (entry.type === "thinking_level_change") thinkingEntry ??= {
|
|
1095
1172
|
entry,
|
|
1096
1173
|
seq
|
|
1097
1174
|
};
|
|
1098
1175
|
}
|
|
1176
|
+
const classify = (found, vouchedFrom) => {
|
|
1177
|
+
if (found !== void 0) return found.seq >= vouchedFrom || rootComplete ? {
|
|
1178
|
+
status: "found",
|
|
1179
|
+
entry: found.entry,
|
|
1180
|
+
seq: found.seq
|
|
1181
|
+
} : { status: "not-held" };
|
|
1182
|
+
if (leafSeq !== void 0 && afterSeq >= leafSeq) return { status: "none" };
|
|
1183
|
+
if (vouchedFrom <= 1 || afterSeq + 1 >= vouchedFrom || rootComplete) return { status: "none" };
|
|
1184
|
+
return { status: "not-held" };
|
|
1185
|
+
};
|
|
1099
1186
|
return {
|
|
1100
|
-
|
|
1101
|
-
|
|
1187
|
+
model: classify(modelEntry, this.branchSettingsVouchedFrom.model),
|
|
1188
|
+
thinkingLevel: classify(thinkingEntry, this.branchSettingsVouchedFrom.thinkingLevel)
|
|
1102
1189
|
};
|
|
1103
1190
|
}
|
|
1104
1191
|
getOmittedHistoryTotals() {
|
|
@@ -1139,6 +1226,10 @@ var SessionManager = class SessionManager {
|
|
|
1139
1226
|
this.childArchive = new ChildCatalog();
|
|
1140
1227
|
this.historyStartSeq = 1;
|
|
1141
1228
|
this.answerWindowStart = 1;
|
|
1229
|
+
this.branchSettingsVouchedFrom = {
|
|
1230
|
+
model: 1,
|
|
1231
|
+
thinkingLevel: 1
|
|
1232
|
+
};
|
|
1142
1233
|
this.priorAnswer = void 0;
|
|
1143
1234
|
this.omittedTotals = void 0;
|
|
1144
1235
|
this.branchLinks = void 0;
|
|
@@ -1283,7 +1374,7 @@ var SessionManager = class SessionManager {
|
|
|
1283
1374
|
async legacyForkEntries() {
|
|
1284
1375
|
const snap = await this.store.load(this.sessionId);
|
|
1285
1376
|
if (snap.header.id !== this.sessionId) throw new SessionIdMismatchError(this.sessionId, snap.header.id);
|
|
1286
|
-
const { assertSnapshotCut } = await import("./storage/session/snapshot-cut.
|
|
1377
|
+
const { assertSnapshotCut } = await import("./storage/session/snapshot-cut.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"));
|
|
1287
1378
|
assertSnapshotCut(snap, this.archiveOnlyEpoch || snap.epoch !== void 0 ? this.historyEpoch : void 0, this.lastSeq);
|
|
1288
1379
|
if (this.lastSeq > 0 && snap.entries[this.lastSeq - 1]?.id !== this.lastEntryId) throw new SessionConflictError(this.sessionId, this.lastSeq, snap.lastSeq);
|
|
1289
1380
|
return snap.entries.slice(0, this.lastSeq);
|
|
@@ -1460,6 +1551,26 @@ var SessionManager = class SessionManager {
|
|
|
1460
1551
|
this.priorAnswer = retiringAnswer ?? this.priorAnswer;
|
|
1461
1552
|
this.answerWindowStart = start;
|
|
1462
1553
|
const path = current.filter((entry) => keep.has(entry.id));
|
|
1554
|
+
const rootComplete = isRootCompleteBranch(current, leaf);
|
|
1555
|
+
const updateVouched = (entryType, previous) => {
|
|
1556
|
+
const effectivePrev = rootComplete ? 1 : previous;
|
|
1557
|
+
let latestSeq = 0;
|
|
1558
|
+
for (let index = current.length - 1; index >= 0; index--) {
|
|
1559
|
+
const entry = current[index];
|
|
1560
|
+
if (entry.type !== entryType) continue;
|
|
1561
|
+
const seq = this.entrySeqs.get(entry.id);
|
|
1562
|
+
if (seq !== void 0 && seq >= effectivePrev) {
|
|
1563
|
+
latestSeq = seq;
|
|
1564
|
+
break;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
if (latestSeq > 0 && !path.some((entry) => this.entrySeqs.get(entry.id) === latestSeq)) return this.lastSeq + 1;
|
|
1568
|
+
return latestSeq >= start ? Math.max(effectivePrev, start) : effectivePrev;
|
|
1569
|
+
};
|
|
1570
|
+
const nextBranchSettingsVouchedFrom = {
|
|
1571
|
+
model: updateVouched("model_change", this.branchSettingsVouchedFrom.model),
|
|
1572
|
+
thinkingLevel: updateVouched("thinking_level_change", this.branchSettingsVouchedFrom.thinkingLevel)
|
|
1573
|
+
};
|
|
1463
1574
|
const retained = [this.fileEntries[0]];
|
|
1464
1575
|
let totals = this.omittedTotals ?? EMPTY_SESSION_HISTORY_TOTALS;
|
|
1465
1576
|
for (const [i, entry] of entries.entries()) if (keep.has(entry.id)) {
|
|
@@ -1482,6 +1593,7 @@ var SessionManager = class SessionManager {
|
|
|
1482
1593
|
if (keep.size < this.lastSeq) {
|
|
1483
1594
|
this.historyStartSeq = Math.max(2, start);
|
|
1484
1595
|
this.omittedTotals = totals;
|
|
1596
|
+
this.branchSettingsVouchedFrom = nextBranchSettingsVouchedFrom;
|
|
1485
1597
|
}
|
|
1486
1598
|
this.branchLinks = new Map(path.slice(1).map((entry, i) => [entry.id, path[i].id]));
|
|
1487
1599
|
this._buildIndex();
|
|
@@ -1756,7 +1868,7 @@ var SessionManager = class SessionManager {
|
|
|
1756
1868
|
if (!item) throw new SessionEntryError(targetId, "inactive");
|
|
1757
1869
|
if ("entry" in item) targetRole = item.entry.type === "message" ? item.entry.message.role : item.entry.type === "custom_message" ? "custom" : void 0;
|
|
1758
1870
|
else {
|
|
1759
|
-
const hint = await (await import("./storage/session/chunked-resume-projection.
|
|
1871
|
+
const hint = await (await import("./storage/session/chunked-resume-projection.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).chunkedAnswerHeader(this.readHistoryChunks(item));
|
|
1760
1872
|
targetRole = hint.type === "message" ? hint.role : hint.type === "custom_message" ? "custom" : void 0;
|
|
1761
1873
|
}
|
|
1762
1874
|
}
|
|
@@ -2090,7 +2202,7 @@ var SessionManager = class SessionManager {
|
|
|
2090
2202
|
pivot,
|
|
2091
2203
|
epoch: historyEpoch
|
|
2092
2204
|
};
|
|
2093
|
-
return store.readBranchSpan ? store.readBranchSpan(sessionId, cut) : import("./storage/session/snapshot-history.
|
|
2205
|
+
return store.readBranchSpan ? store.readBranchSpan(sessionId, cut) : import("./storage/session/snapshot-history.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage")).then(({ snapshotBranchSpan }) => snapshotBranchSpan(store, sessionId, cut));
|
|
2094
2206
|
};
|
|
2095
2207
|
let common = 0;
|
|
2096
2208
|
for (let pivot = Math.min(old, target); pivot > 0;) {
|
|
@@ -2110,7 +2222,7 @@ var SessionManager = class SessionManager {
|
|
|
2110
2222
|
toSeq: old
|
|
2111
2223
|
})) for (const item of items) {
|
|
2112
2224
|
if (item.seq === common && !("entry" in item)) {
|
|
2113
|
-
commonAncestorId = (await (await import("./storage/session/chunked-resume-projection.
|
|
2225
|
+
commonAncestorId = (await (await import("./storage/session/chunked-resume-projection.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).chunkedAnswerHeader(historyChunks(store, sessionId, historyEpoch, item, {}))).id;
|
|
2114
2226
|
continue;
|
|
2115
2227
|
}
|
|
2116
2228
|
const entry = "entry" in item ? item.entry : (await readSessionRange(store, sessionId, item.seq, item.seq, historyEpoch)).entries[0];
|
|
@@ -2133,7 +2245,7 @@ var SessionManager = class SessionManager {
|
|
|
2133
2245
|
through: lastSeq,
|
|
2134
2246
|
held,
|
|
2135
2247
|
async *outline(signal) {
|
|
2136
|
-
const { treeOutlineEntry, treeOutlinePages } = await import("./storage/session/tree-outline.
|
|
2248
|
+
const { treeOutlineEntry, treeOutlinePages } = await import("./storage/session/tree-outline.code.js").catch((error) => __atomicOnDemandFailed(error, "/tree"));
|
|
2137
2249
|
for await (const page of treeOutlinePages(store, sessionId, historyEpoch, lastSeq, signal)) yield page.map((row) => {
|
|
2138
2250
|
const local = held.get(row.seq);
|
|
2139
2251
|
return local ? treeOutlineEntry(row.seq, local) : row;
|
|
@@ -2186,7 +2298,7 @@ var SessionManager = class SessionManager {
|
|
|
2186
2298
|
if (from >= 0 && (!boundary || from >= path.indexOf(boundary)) && !path.slice(from + 1).some((entry) => entry.type === "context_edit")) return void 0;
|
|
2187
2299
|
}
|
|
2188
2300
|
if (!this.store.readResume || !this.store.readRange) {
|
|
2189
|
-
const target = await (await import("./storage/session/snapshot-history.
|
|
2301
|
+
const target = await (await import("./storage/session/snapshot-history.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).snapshotWindow(this.store, this.sessionId, id, this.lastSeq, this.historyEpoch);
|
|
2190
2302
|
if (target.leafId !== id) throw new SessionEntryError(id, "missing");
|
|
2191
2303
|
return target;
|
|
2192
2304
|
}
|
|
@@ -2196,7 +2308,7 @@ var SessionManager = class SessionManager {
|
|
|
2196
2308
|
resume = await this.store.readResume(this.sessionId, id, { deferChildRecords: true });
|
|
2197
2309
|
if (resume.lastSeq > this.lastSeq && (this.historyEpoch === void 0 || resume.epoch === this.historyEpoch)) {
|
|
2198
2310
|
if (this.store.readEntrySizes && this.store.readEntryChunk) {
|
|
2199
|
-
const { pinnedBranchResume } = await import("./storage/session/pinned-branch-resume.
|
|
2311
|
+
const { pinnedBranchResume } = await import("./storage/session/pinned-branch-resume.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"));
|
|
2200
2312
|
resume = await pinnedBranchResume(this.store, this.recordHeader(), this.historyEpoch ?? resume.epoch, this.lastSeq, id);
|
|
2201
2313
|
} else {
|
|
2202
2314
|
const snapshot = await this.store.load(this.sessionId);
|
|
@@ -2269,7 +2381,7 @@ var SessionManager = class SessionManager {
|
|
|
2269
2381
|
}
|
|
2270
2382
|
const leaf = await this.findEntrySeq(leafId);
|
|
2271
2383
|
if (leaf === void 0) throw new SessionEntryError(leafId, "missing");
|
|
2272
|
-
const { humanForkStream } = await import("./storage/session/branch-fork-source.
|
|
2384
|
+
const { humanForkStream } = await import("./storage/session/branch-fork-source.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"));
|
|
2273
2385
|
const seed = humanForkStream(this.sessionId, this.historyEpoch, this.lastSeq, leaf, leafId, this.labelsById, this.labelTimestampsById);
|
|
2274
2386
|
const record = this.recordHeader(createSessionHeader(createSessionId(), this.cwd, (/* @__PURE__ */ new Date()).toISOString(), this.sessionId));
|
|
2275
2387
|
const store = await this.storeForNewSession();
|
|
@@ -2344,7 +2456,7 @@ var SessionManager = class SessionManager {
|
|
|
2344
2456
|
static capturedFork(store, sessionId, cwd, sessionDir, epoch, watermark, leafId) {
|
|
2345
2457
|
return async () => {
|
|
2346
2458
|
const bounded = store.readForkWindow;
|
|
2347
|
-
const window = bounded ? await bounded.call(store, sessionId, leafId, { archivedReceipts: true }) : (await import("./storage/session/fork-window.
|
|
2459
|
+
const window = bounded ? await bounded.call(store, sessionId, leafId, { archivedReceipts: true }) : (await import("./storage/session/fork-window.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).fullForkWindow(await store.load(sessionId), leafId);
|
|
2348
2460
|
if (!window || !leafId) throw new SessionEntryError(leafId, "missing");
|
|
2349
2461
|
if (window.header.id !== sessionId) throw new SessionIdMismatchError(sessionId, window.header.id);
|
|
2350
2462
|
if (epoch !== void 0 && window.epoch !== void 0 && window.epoch !== epoch || watermark !== void 0 && window.lastSeq < watermark) throw new SessionConflictError(sessionId, watermark ?? 0, window.lastSeq);
|
|
@@ -2359,7 +2471,7 @@ var SessionManager = class SessionManager {
|
|
|
2359
2471
|
source.labelsById = labels.labelsById;
|
|
2360
2472
|
source.labelTimestampsById = labels.labelTimestampsById;
|
|
2361
2473
|
const receipts = /* @__PURE__ */ new Map();
|
|
2362
|
-
const entries = bounded ? await includeNamedForkOutputs(forkContextPath(window.entries, sessionId, (await import("./storage/session/fork-window.
|
|
2474
|
+
const entries = bounded ? await includeNamedForkOutputs(forkContextPath(window.entries, sessionId, (await import("./storage/session/fork-window.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).forkDisplayEvidence(window.entries)), store, sessionId, leafId, window.epoch, watermark ?? window.lastSeq, "branch", receipts) : window.entries;
|
|
2363
2475
|
await source.installFork(leafId, entries, receipts, !!bounded);
|
|
2364
2476
|
return source;
|
|
2365
2477
|
};
|
|
@@ -2395,13 +2507,13 @@ var SessionManager = class SessionManager {
|
|
|
2395
2507
|
const held = this.hasFullHistory() && this.fileEntries.length === through + 1 ? this.fileEntries.slice() : void 0;
|
|
2396
2508
|
const relation = await resolveForkStoreRelation(source, store);
|
|
2397
2509
|
const a = forkScope(source);
|
|
2398
|
-
const captured = relation !== "different" && held && a && forkScope(store) && store.readEntrySizes ? await (await import("./storage/session/resident-fork-rows.
|
|
2510
|
+
const captured = relation !== "different" && held && a && forkScope(store) && store.readEntrySizes ? await (await import("./storage/session/resident-fork-rows.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).residentForkRows(held, through) : void 0;
|
|
2399
2511
|
const manager = new SessionManager(store, cwd, directory, {
|
|
2400
2512
|
...options,
|
|
2401
2513
|
parentSession: sessionId
|
|
2402
2514
|
});
|
|
2403
2515
|
const receipts = /* @__PURE__ */ new Map();
|
|
2404
|
-
const data = relation === "different" ? await this.forkWindow(this.getBranch(), this.getLeafId(), "session", receipts) : !source.readEntrySizes || !source.readRange || !source.readEntryChunk ? await this.legacyForkEntries() : (await import("./storage/session/branch-fork-source.
|
|
2516
|
+
const data = relation === "different" ? await this.forkWindow(this.getBranch(), this.getLeafId(), "session", receipts) : !source.readEntrySizes || !source.readRange || !source.readEntryChunk ? await this.legacyForkEntries() : (await import("./storage/session/branch-fork-source.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).completeSessionForkStream(sessionId, epoch, through, captured);
|
|
2405
2517
|
if (relation === "different") manager.markForkOrigin(source);
|
|
2406
2518
|
const hashes = "read" in data ? [] : sessionBlobHashes(source, data);
|
|
2407
2519
|
assertSessionBlobStore(store, manager.sessionId, hashes.length);
|
|
@@ -2417,7 +2529,7 @@ var SessionManager = class SessionManager {
|
|
|
2417
2529
|
const head = await store.readEntrySizes(manager.sessionId, 1, 0);
|
|
2418
2530
|
if (head.epoch !== created.epoch) throw new SessionConflictError(manager.sessionId, created.lastSeq, head.lastSeq);
|
|
2419
2531
|
if (head.lastSeq === created.lastSeq) {
|
|
2420
|
-
const { windowFromSnapshot } = await import("./storage/session/snapshot-history.
|
|
2532
|
+
const { windowFromSnapshot } = await import("./storage/session/snapshot-history.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"));
|
|
2421
2533
|
manager.restoreOpened({ resume: windowFromSnapshot({
|
|
2422
2534
|
header: manager.recordHeader(),
|
|
2423
2535
|
entries: captured,
|
|
@@ -2429,7 +2541,7 @@ var SessionManager = class SessionManager {
|
|
|
2429
2541
|
}
|
|
2430
2542
|
}
|
|
2431
2543
|
const opened = await readStoredSession(store, manager.sessionId, void 0);
|
|
2432
|
-
const stamp = opened.resume.archiveOnlyEpoch && !("read" in data) ? (await import("./storage/session/snapshot-cut.
|
|
2544
|
+
const stamp = opened.resume.archiveOnlyEpoch && !("read" in data) ? (await import("./storage/session/snapshot-cut.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).snapshotStamp({
|
|
2433
2545
|
header: manager.recordHeader(),
|
|
2434
2546
|
entries: data,
|
|
2435
2547
|
lastSeq: created.lastSeq
|
|
@@ -2692,10 +2804,55 @@ var SessionManager = class SessionManager {
|
|
|
2692
2804
|
if (!supplied) await store.close();
|
|
2693
2805
|
}
|
|
2694
2806
|
}
|
|
2695
|
-
const { listAllSessions } = await import("./session-manager-list.
|
|
2807
|
+
const { listAllSessions } = await import("./session-manager-list.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"));
|
|
2696
2808
|
return listAllSessions(directoryOrProgress, typeof progressOrSignal === "function" ? progressOrSignal : void 0, options !== void 0 && "includeInternal" in options && options.includeInternal === true, options && "aborted" in options ? options : options?.signal ?? (typeof progressOrSignal === "object" ? progressOrSignal : void 0));
|
|
2697
2809
|
}
|
|
2698
2810
|
};
|
|
2699
2811
|
export { SessionManager, appendOwnedSubagentChildRecord, physicalForkHeader };
|
|
2700
2812
|
|
|
2701
|
-
//# sourceMappingURL=session-manager-core.js.map
|
|
2813
|
+
//# sourceMappingURL=session-manager-core.js.map
|
|
2814
|
+
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
2815
|
+
// demand that fails in a process an in-place update left running says to restart.
|
|
2816
|
+
function __atomicOnDemandFailed(error, feature) {
|
|
2817
|
+
return (async () => {
|
|
2818
|
+
const root = new URL("../", import.meta.url);
|
|
2819
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
2820
|
+
const key = `${root.href}#0.10.5`;
|
|
2821
|
+
let release = releases.get(key);
|
|
2822
|
+
if (release === undefined) {
|
|
2823
|
+
const current = (async () => {
|
|
2824
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
2825
|
+
try {
|
|
2826
|
+
const held = await import(new URL(path, root).href);
|
|
2827
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
2828
|
+
} catch {
|
|
2829
|
+
// Not a file this process can load: the next.
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
return undefined;
|
|
2833
|
+
})().then((found) => {
|
|
2834
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
2835
|
+
return found;
|
|
2836
|
+
});
|
|
2837
|
+
releases.set(key, current);
|
|
2838
|
+
release = current;
|
|
2839
|
+
}
|
|
2840
|
+
const running = await release;
|
|
2841
|
+
let installed;
|
|
2842
|
+
try {
|
|
2843
|
+
const { readFile } = process.getBuiltinModule("node:fs/promises");
|
|
2844
|
+
installed = JSON.parse(await readFile(new URL("../package.json", root), "utf8")).version;
|
|
2845
|
+
} catch {
|
|
2846
|
+
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
2847
|
+
}
|
|
2848
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.5" ? installed : running !== undefined && running.version !== "0.10.5" ? "0.10.5" : undefined;
|
|
2849
|
+
if (updatedTo === undefined) throw error;
|
|
2850
|
+
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
2851
|
+
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|
|
2852
|
+
cause: error,
|
|
2853
|
+
});
|
|
2854
|
+
restart.name = "UpdatedInstallError";
|
|
2855
|
+
restart[Symbol.for("atomic.on-demand-restart.v1")] = { application, updatedTo, feature };
|
|
2856
|
+
throw restart;
|
|
2857
|
+
})();
|
|
2858
|
+
}
|