@bastani/atomic 0.10.4-alpha.2 → 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 +238 -0
- package/dist/_shared/chunk-CDOYTDYM.js +4 -0
- package/dist/_shared/chunk-CDOYTDYM.js.map +1 -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} +528 -321
- 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 +59 -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 +46 -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/CHANGELOG.md +12 -0
- 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 +36 -0
- package/dist/cli/auth-cli.impl.js.map +1 -0
- package/dist/cli/auth-cli.js +30 -1096
- package/dist/cli/auth-cli.js.map +1 -1
- 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 +36 -0
- package/dist/cli/blueprint-command.impl.js.map +1 -0
- package/dist/cli/blueprint-command.js +30 -900
- package/dist/cli/blueprint-command.js.map +1 -1
- 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 +36 -0
- package/dist/cli/intercom-command.impl.js.map +1 -0
- package/dist/cli/intercom-command.js +33 -105
- package/dist/cli/intercom-command.js.map +1 -1
- 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 +36 -0
- package/dist/cli/list-models.impl.js.map +1 -0
- package/dist/cli/list-models.js +33 -57
- package/dist/cli/list-models.js.map +1 -1
- 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 +36 -0
- package/dist/cli/session-picker.impl.js.map +1 -0
- package/dist/cli/session-picker.js +33 -52
- package/dist/cli/session-picker.js.map +1 -1
- 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 +36 -0
- package/dist/cli/startup-ui.impl.js.map +1 -0
- package/dist/cli/startup-ui.js +35 -4
- 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 +36 -0
- package/dist/cli/storage-command.impl.js.map +1 -0
- package/dist/cli/storage-command.js +35 -2
- 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 +36 -0
- package/dist/cli/storage-search-session.impl.js.map +1 -0
- package/dist/cli/storage-search-session.js +33 -186
- package/dist/cli/storage-search-session.js.map +1 -1
- 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 +36 -0
- package/dist/cli/team-command.impl.js.map +1 -0
- package/dist/cli/team-command.js +32 -213
- package/dist/cli/team-command.js.map +1 -1
- 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 +36 -0
- package/dist/core/debug.impl.js.map +1 -0
- package/dist/core/debug.js +35 -2
- 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 +36 -0
- package/dist/core/export-html/card-projection.impl.js.map +1 -0
- package/dist/core/export-html/card-projection.js +34 -255
- package/dist/core/export-html/card-projection.js.map +1 -1
- 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 +36 -0
- package/dist/core/export-html/index.impl.js.map +1 -0
- package/dist/core/export-html/index.js +30 -604
- package/dist/core/export-html/index.js.map +1 -1
- 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 +36 -0
- package/dist/core/export-html/json-spans.impl.js.map +1 -0
- package/dist/core/export-html/json-spans.js +35 -2
- 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 +36 -0
- package/dist/core/export-html/oversized-render-inputs.impl.js.map +1 -0
- package/dist/core/export-html/oversized-render-inputs.js +31 -120
- package/dist/core/export-html/oversized-render-inputs.js.map +1 -1
- 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 +36 -0
- package/dist/core/export-html/tool-renderer.impl.js.map +1 -0
- package/dist/core/export-html/tool-renderer.js +33 -347
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- 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 +36 -0
- package/dist/core/extensions/jiti-loader.impl.js.map +1 -0
- package/dist/core/extensions/jiti-loader.js +35 -2
- 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 +36 -0
- package/dist/core/extensions/jiti-static-loader.impl.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +35 -2
- 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 +36 -0
- package/dist/core/extensions/loader-host-modules.impl.js.map +1 -0
- package/dist/core/extensions/loader-host-modules.js +35 -2
- 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 +36 -0
- package/dist/core/intercom-broker-control-host.impl.js.map +1 -0
- package/dist/core/intercom-broker-control-host.js +35 -4
- 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 +36 -0
- package/dist/core/intercom-broker-control.impl.js.map +1 -0
- package/dist/core/intercom-broker-control.js +35 -17
- package/dist/core/intercom-broker-control.js.map +1 -1
- 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 +36 -0
- package/dist/core/package-manager-storage-adapters.impl.js.map +1 -0
- package/dist/core/package-manager-storage-adapters.js +35 -2
- 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 +36 -0
- package/dist/core/sdk.impl.js.map +1 -0
- package/dist/core/sdk.js +35 -8
- 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 +36 -0
- package/dist/core/session-manager-list.impl.js.map +1 -0
- package/dist/core/session-manager-list.js +35 -2
- 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 +36 -0
- package/dist/core/session-manager.impl.js.map +1 -0
- package/dist/core/session-manager.js +35 -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 +36 -0
- package/dist/core/session-storage.impl.js.map +1 -0
- package/dist/core/session-storage.js +35 -2
- 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 +36 -0
- package/dist/core/storage/offline-snapshot-file.impl.js.map +1 -0
- package/dist/core/storage/offline-snapshot-file.js +33 -34
- package/dist/core/storage/offline-snapshot-file.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/branch-fork-source.impl.js.map +1 -0
- package/dist/core/storage/session/branch-fork-source.js +32 -97
- package/dist/core/storage/session/branch-fork-source.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/card-view.impl.js.map +1 -0
- package/dist/core/storage/session/card-view.js +34 -58
- package/dist/core/storage/session/card-view.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/child-reader.impl.js.map +1 -0
- package/dist/core/storage/session/child-reader.js +33 -91
- package/dist/core/storage/session/child-reader.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/chunked-resume-projection.impl.js.map +1 -0
- package/dist/core/storage/session/chunked-resume-projection.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/expanded-child-details.impl.js.map +1 -0
- package/dist/core/storage/session/expanded-child-details.js +31 -634
- package/dist/core/storage/session/expanded-child-details.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/fork-row-bytes.impl.js.map +1 -0
- package/dist/core/storage/session/fork-row-bytes.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/fork-row-index.impl.js.map +1 -0
- package/dist/core/storage/session/fork-row-index.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/fork-staging.impl.js.map +1 -0
- package/dist/core/storage/session/fork-staging.js +30 -574
- package/dist/core/storage/session/fork-staging.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/fork-window.impl.js.map +1 -0
- package/dist/core/storage/session/fork-window.js +30 -471
- package/dist/core/storage/session/fork-window.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/history-pages.impl.js.map +1 -0
- package/dist/core/storage/session/history-pages.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/jsonl-entry-projection.impl.js.map +1 -0
- package/dist/core/storage/session/jsonl-entry-projection.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/jsonl-session-store.impl.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/memory-session-store.impl.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/pinned-branch-resume.impl.js.map +1 -0
- package/dist/core/storage/session/pinned-branch-resume.js +33 -69
- package/dist/core/storage/session/pinned-branch-resume.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/released-history-files.impl.js.map +1 -0
- package/dist/core/storage/session/released-history-files.js +32 -461
- package/dist/core/storage/session/released-history-files.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/resident-fork-rows.impl.js.map +1 -0
- package/dist/core/storage/session/resident-fork-rows.js +32 -53
- package/dist/core/storage/session/resident-fork-rows.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/session-resume.impl.js.map +1 -0
- package/dist/core/storage/session/session-resume.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/snapshot-cut.impl.js.map +1 -0
- package/dist/core/storage/session/snapshot-cut.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/snapshot-history.impl.js.map +1 -0
- package/dist/core/storage/session/snapshot-history.js +34 -60
- package/dist/core/storage/session/snapshot-history.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/session/sql-session-store.impl.js.map +1 -0
- package/dist/core/storage/session/sql-session-store.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/tree-outline.impl.js.map +1 -0
- package/dist/core/storage/session/tree-outline.js +35 -2
- 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 +36 -0
- package/dist/core/storage/session/tree-presentation.impl.js.map +1 -0
- package/dist/core/storage/session/tree-presentation.js +31 -337
- package/dist/core/storage/session/tree-presentation.js.map +1 -1
- 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 +36 -0
- package/dist/core/storage/storage-status.impl.js.map +1 -0
- package/dist/core/storage/storage-status.js +35 -2
- 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 +36 -0
- package/dist/core/storage/team.impl.js.map +1 -0
- package/dist/core/storage/team.js +35 -2
- 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 +36 -0
- package/dist/core/structured-output/index.impl.js.map +1 -0
- package/dist/core/structured-output/index.js +35 -2
- 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 +36 -0
- package/dist/core/tasks/task-completion-entry.impl.js.map +1 -0
- package/dist/core/tasks/task-completion-entry.js +33 -251
- package/dist/core/tasks/task-completion-entry.js.map +1 -1
- 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 +36 -0
- package/dist/core/tasks/task-file-history.impl.js.map +1 -0
- package/dist/core/tasks/task-file-history.js +32 -375
- package/dist/core/tasks/task-file-history.js.map +1 -1
- package/dist/core/tasks/task-reference-archive.code.js +514 -0
- package/dist/core/tasks/task-reference-archive.code.js.map +1 -0
- package/dist/core/tasks/task-reference-archive.js +34 -467
- package/dist/core/tasks/task-reference-archive.js.map +1 -1
- package/dist/core/tasks/task-reference-identity.code.js +164 -0
- package/dist/core/tasks/task-reference-identity.code.js.map +1 -0
- package/dist/core/tasks/task-reference-identity.js +32 -160
- package/dist/core/tasks/task-reference-identity.js.map +1 -1
- 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 +36 -0
- package/dist/core/tasks/task-reference-stream.impl.js.map +1 -0
- package/dist/core/tasks/task-reference-stream.js +35 -2
- 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 +36 -0
- package/dist/core/tasks/task-unsaved-answer.impl.js.map +1 -0
- package/dist/core/tasks/task-unsaved-answer.js +35 -2
- 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 +36 -0
- package/dist/core/tasks/task-view-source.impl.js.map +1 -0
- package/dist/core/tasks/task-view-source.js +35 -2
- 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 +36 -0
- package/dist/core/tools/read-url.impl.js.map +1 -0
- package/dist/core/tools/read-url.js +30 -1524
- package/dist/core/tools/read-url.js.map +1 -1
- 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 +36 -0
- package/dist/core/worktree-snapshot/errors.impl.js.map +1 -0
- package/dist/core/worktree-snapshot/errors.js +35 -5
- 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 +36 -0
- package/dist/core/worktree-snapshot/session-index-reset.impl.js.map +1 -0
- package/dist/core/worktree-snapshot/session-index-reset.js +34 -134
- package/dist/core/worktree-snapshot/session-index-reset.js.map +1 -1
- 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 +36 -0
- package/dist/extensions/codemode/execute.impl.js.map +1 -0
- package/dist/extensions/codemode/execute.js +30 -612
- package/dist/extensions/codemode/execute.js.map +1 -1
- 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 +36 -0
- package/dist/extensions/codemode/renderer.impl.js.map +1 -0
- package/dist/extensions/codemode/renderer.js +33 -107
- package/dist/extensions/codemode/renderer.js.map +1 -1
- 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 +36 -0
- package/dist/extensions/mcp/cli.impl.js.map +1 -0
- package/dist/extensions/mcp/cli.js +32 -561
- package/dist/extensions/mcp/cli.js.map +1 -1
- 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 -0
- package/dist/extensions/mcp/cli.lazy.impl.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +36 -7
- package/dist/extensions/mcp/cli.lazy.js.map +1 -1
- 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 +36 -0
- package/dist/extensions/mcp/runtime.impl.js.map +1 -0
- package/dist/extensions/mcp/runtime.js +35 -4
- 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 +36 -0
- package/dist/main-first-time-setup.impl.js.map +1 -0
- package/dist/main-first-time-setup.js +35 -11
- package/dist/main-first-time-setup.js.map +1 -1
- 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 +36 -0
- package/dist/modes/interactive/components/stored-tree-view.impl.js.map +1 -0
- package/dist/modes/interactive/components/stored-tree-view.js +33 -290
- package/dist/modes/interactive/components/stored-tree-view.js.map +1 -1
- 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 +36 -0
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.js +34 -189
- package/dist/modes/interactive/components/user-message-selector-archive.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode-deps.js +4 -0
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -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 -0
- package/dist/package-manager-cli.impl.js.map +1 -0
- package/dist/package-manager-cli.js +36 -1067
- package/dist/package-manager-cli.js.map +1 -1
- 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 +36 -0
- package/dist/utils/startup-database-spare.impl.js.map +1 -0
- package/dist/utils/startup-database-spare.js +33 -105
- package/dist/utils/startup-database-spare.js.map +1 -1
- 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 +36 -0
- package/dist/utils/tools-manager.impl.js.map +1 -0
- package/dist/utils/tools-manager.js +35 -2
- 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 +2 -2
- 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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "../../_shared/rolldown-runtime-BGM3D5V3.js";
|
|
2
|
+
import { realpath, stat } from "node:fs/promises";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { wrapNodeSqliteDatabase } from "./node-sqlite.js";
|
|
5
|
+
import { DatabaseSync } from "node:sqlite";
|
|
6
|
+
// dist/core/storage/offline-snapshot-file.js
|
|
7
|
+
/** A dedicated connection, never a live application's facade. The relaxed space check requires exclusive access across commits. */
|
|
8
|
+
async function withOfflineSnapshotFile(file, move) {
|
|
9
|
+
const path = await realpath(file);
|
|
10
|
+
async function requireCleanWal() {
|
|
11
|
+
const wal = await stat(`${path}-wal`).catch((error) => {
|
|
12
|
+
if (error.code !== "ENOENT") throw error;
|
|
13
|
+
});
|
|
14
|
+
if (wal && wal.size > 0) throw new Error("Close all database users cleanly before offline chunk maintenance; the existing write-ahead log is not empty.");
|
|
15
|
+
}
|
|
16
|
+
await requireCleanWal();
|
|
17
|
+
const url = pathToFileURL(path);
|
|
18
|
+
url.searchParams.set("mode", "rw");
|
|
19
|
+
const raw = new DatabaseSync(url.href);
|
|
20
|
+
try {
|
|
21
|
+
raw.exec("PRAGMA busy_timeout=0; PRAGMA locking_mode=EXCLUSIVE; BEGIN EXCLUSIVE; COMMIT");
|
|
22
|
+
await requireCleanWal();
|
|
23
|
+
if (raw.prepare("PRAGMA journal_mode").get()?.journal_mode !== "wal") throw new Error("Offline chunk maintenance requires a local SQLite database already in WAL mode.");
|
|
24
|
+
if (raw.prepare("PRAGMA auto_vacuum").get()?.auto_vacuum === 1) throw new Error("Offline chunk maintenance cannot bound the log with auto_vacuum=FULL.");
|
|
25
|
+
const database = wrapNodeSqliteDatabase(raw);
|
|
26
|
+
try {
|
|
27
|
+
await move(database);
|
|
28
|
+
} finally {
|
|
29
|
+
await database.close();
|
|
30
|
+
}
|
|
31
|
+
} finally {
|
|
32
|
+
raw.close();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export { withOfflineSnapshotFile };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=offline-snapshot-file.code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-snapshot-file.code.js","names":[],"sources":["../../../src/core/storage/offline-snapshot-file.ts"],"mappings":";;;;;;;AAOA,eAAsB,wBACrB,MACA,MAAiD;CAEjD,MAAM,OAAO,MAAM,SAAS,IAAI;CAChC,eAAe,kBAAe;EAC7B,MAAM,MAAM,MAAM,KAAK,GAAG,KAAI,KAAM,CAAC,CAAC,OAAO,UAAgC;GAC5E,IAAI,MAAM,SAAS,UAAU,MAAM;EAEpC,CAAC;EACD,IAAI,OAAO,IAAI,OAAO,GACrB,MAAM,IAAI,MACT,+GAA+G;CAElH;CACA,MAAM,gBAAe;CACrB,MAAM,MAAM,cAAc,IAAI;CAC9B,IAAI,aAAa,IAAI,QAAQ,IAAI;CACjC,MAAM,MAAM,IAAI,aAAa,IAAI,IAAI;CACrC,IAAI;EAEH,IAAI,KAAK,+EAA+E;EACxF,MAAM,gBAAe;EACrB,IAAI,IAAI,QAAQ,qBAAqB,CAAC,CAAC,IAAG,CAAE,EAAE,iBAAiB,OAC9D,MAAM,IAAI,MAAM,iFAAiF;EAClG,IAAI,IAAI,QAAQ,oBAAoB,CAAC,CAAC,IAAG,CAAE,EAAE,gBAAgB,GAC5D,MAAM,IAAI,MAAM,uEAAuE;EACxF,MAAM,WAAW,uBAAuB,GAAG;EAC3C,IAAI;GACH,MAAM,KAAK,QAAQ;EACpB,UAAU;GACT,MAAM,SAAS,MAAK;EACrB;CACD,UAAU;EACT,IAAI,MAAK;CACV;AACD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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("./offline-snapshot-file.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 session storage.", {
|
|
32
|
+
cause: error,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export const { withOfflineSnapshotFile } = module;
|
|
36
|
+
//# sourceMappingURL=offline-snapshot-file.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-snapshot-file.impl.js","sources":[],"names":[],"mappings":""}
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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("./offline-snapshot-file.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;
|
|
13
25
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
await requireCleanWal();
|
|
17
|
-
const url = pathToFileURL(path);
|
|
18
|
-
url.searchParams.set("mode", "rw");
|
|
19
|
-
const raw = new DatabaseSync(url.href);
|
|
20
|
-
try {
|
|
21
|
-
raw.exec("PRAGMA busy_timeout=0; PRAGMA locking_mode=EXCLUSIVE; BEGIN EXCLUSIVE; COMMIT");
|
|
22
|
-
await requireCleanWal();
|
|
23
|
-
if (raw.prepare("PRAGMA journal_mode").get()?.journal_mode !== "wal") throw new Error("Offline chunk maintenance requires a local SQLite database already in WAL mode.");
|
|
24
|
-
if (raw.prepare("PRAGMA auto_vacuum").get()?.auto_vacuum === 1) throw new Error("Offline chunk maintenance cannot bound the log with auto_vacuum=FULL.");
|
|
25
|
-
const database = wrapNodeSqliteDatabase(raw);
|
|
26
|
-
try {
|
|
27
|
-
await move(database);
|
|
28
|
-
} finally {
|
|
29
|
-
await database.close();
|
|
30
|
-
}
|
|
31
|
-
} finally {
|
|
32
|
-
raw.close();
|
|
26
|
+
releases.set(key, current);
|
|
27
|
+
release = current;
|
|
33
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 session storage.", {
|
|
32
|
+
cause: error,
|
|
33
|
+
});
|
|
34
34
|
}
|
|
35
|
-
export { withOfflineSnapshotFile };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=offline-snapshot-file.js.map
|
|
35
|
+
export const { withOfflineSnapshotFile } = module;
|
|
36
|
+
//# sourceMappingURL=offline-snapshot-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offline-snapshot-file.js","
|
|
1
|
+
{"version":3,"file":"offline-snapshot-file.js","sources":[],"names":[],"mappings":""}
|
|
@@ -191,9 +191,9 @@ function createAdapterImports() {
|
|
|
191
191
|
export async function loadStorageAdapter(module, context, hostModules = {}) {
|
|
192
192
|
try {
|
|
193
193
|
const [{ createHostModuleJiti }, { getStorageAdapterHostModules }, { resolvePackageStorageAdapter }] = await Promise.all([
|
|
194
|
-
import("../extensions/loader-virtual-modules.js"),
|
|
195
|
-
import("../extensions/loader-host-modules.js"),
|
|
196
|
-
import("../package-manager-storage-adapters.js"),
|
|
194
|
+
import("../extensions/loader-virtual-modules.js").catch((error) => __atomicOnDemandFailed(error, "this feature")),
|
|
195
|
+
import("../extensions/loader-host-modules.code.js").catch((error) => __atomicOnDemandFailed(error, "this feature")),
|
|
196
|
+
import("../package-manager-storage-adapters.code.js").catch((error) => __atomicOnDemandFailed(error, "this feature")),
|
|
197
197
|
]);
|
|
198
198
|
const id = pathToFileURL(join(context.agentDir, "storage-adapter.js")).href;
|
|
199
199
|
const babel = await createHostModuleJiti(id, {});
|
|
@@ -317,10 +317,10 @@ export const StorageProvider = class {
|
|
|
317
317
|
databases = sharedDatabases;
|
|
318
318
|
async openSessionStore(selection, context) {
|
|
319
319
|
return this.open(selection, context, {
|
|
320
|
-
memory: async () => new (await import("./session/memory-session-store.js")).MemorySessionStore(createSessionCwdMatcherAsync, (await import("./session/released-history-files.js")).releasedHistoryFiles(context.agentDir || (await import("../../config.js")).getAgentDir())),
|
|
321
|
-
jsonl: async (dir) => (await import("./session/jsonl-session-store.js")).JsonlSessionStore.open(dir, { exactDirectory: true }),
|
|
320
|
+
memory: async () => new (await import("./session/memory-session-store.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).MemorySessionStore(createSessionCwdMatcherAsync, (await import("./session/released-history-files.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).releasedHistoryFiles(context.agentDir || (await import("../../config.js").catch((error) => __atomicOnDemandFailed(error, "this feature"))).getAgentDir())),
|
|
321
|
+
jsonl: async (dir) => (await import("./session/jsonl-session-store.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).JsonlSessionStore.open(dir, { exactDirectory: true }),
|
|
322
322
|
direct: (adapter, options, storage, adapterContext) => adapter.openSessionStore?.(options, adapterContext, storage),
|
|
323
|
-
sql: async (database, options) => (await import("./session/sql-session-store.js")).SqlSessionStore.open(database, {
|
|
323
|
+
sql: async (database, options) => (await import("./session/sql-session-store.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).SqlSessionStore.open(database, {
|
|
324
324
|
...options,
|
|
325
325
|
cwdMatcher: createSessionCwdMatcherAsync,
|
|
326
326
|
}),
|
|
@@ -436,4 +436,49 @@ export const StorageProvider = class {
|
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
};
|
|
439
|
-
//# sourceMappingURL=provider.js.map
|
|
439
|
+
//# sourceMappingURL=provider.js.map
|
|
440
|
+
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
441
|
+
// demand that fails in a process an in-place update left running says to restart.
|
|
442
|
+
function __atomicOnDemandFailed(error, feature) {
|
|
443
|
+
return (async () => {
|
|
444
|
+
const root = new URL("../../", import.meta.url);
|
|
445
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
446
|
+
const key = `${root.href}#0.10.5-alpha.1`;
|
|
447
|
+
let release = releases.get(key);
|
|
448
|
+
if (release === undefined) {
|
|
449
|
+
const current = (async () => {
|
|
450
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
451
|
+
try {
|
|
452
|
+
const held = await import(new URL(path, root).href);
|
|
453
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
454
|
+
} catch {
|
|
455
|
+
// Not a file this process can load: the next.
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return undefined;
|
|
459
|
+
})().then((found) => {
|
|
460
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
461
|
+
return found;
|
|
462
|
+
});
|
|
463
|
+
releases.set(key, current);
|
|
464
|
+
release = current;
|
|
465
|
+
}
|
|
466
|
+
const running = await release;
|
|
467
|
+
let installed;
|
|
468
|
+
try {
|
|
469
|
+
const { readFile } = process.getBuiltinModule("node:fs/promises");
|
|
470
|
+
installed = JSON.parse(await readFile(new URL("../package.json", root), "utf8")).version;
|
|
471
|
+
} catch {
|
|
472
|
+
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
473
|
+
}
|
|
474
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.5-alpha.1" ? installed : running !== undefined && running.version !== "0.10.5-alpha.1" ? "0.10.5-alpha.1" : undefined;
|
|
475
|
+
if (updatedTo === undefined) throw error;
|
|
476
|
+
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
477
|
+
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|
|
478
|
+
cause: error,
|
|
479
|
+
});
|
|
480
|
+
restart.name = "UpdatedInstallError";
|
|
481
|
+
restart[Symbol.for("atomic.on-demand-restart.v1")] = { application, updatedTo, feature };
|
|
482
|
+
throw restart;
|
|
483
|
+
})();
|
|
484
|
+
}
|
|
@@ -475,7 +475,7 @@ function parseEnvironmentTeamProfile(env) {
|
|
|
475
475
|
* nothing was changed. A failed broker restart is reported in `broker`, not thrown.
|
|
476
476
|
*/
|
|
477
477
|
export async function joinTeam(options) {
|
|
478
|
-
return (await import("./team.js")).joinTeam(options);
|
|
478
|
+
return (await import("./team.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).joinTeam(options);
|
|
479
479
|
}
|
|
480
480
|
/**
|
|
481
481
|
* Restore the individual layout: remove the global `storage` setting and the `sessions.storage` pin when they hold
|
|
@@ -484,13 +484,58 @@ export async function joinTeam(options) {
|
|
|
484
484
|
* changes nothing.
|
|
485
485
|
*/
|
|
486
486
|
export async function leaveTeam(options = {}) {
|
|
487
|
-
return (await import("./team.js")).leaveTeam(options);
|
|
487
|
+
return (await import("./team.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).leaveTeam(options);
|
|
488
488
|
}
|
|
489
489
|
/**
|
|
490
490
|
* The layout in effect for this process and working directory (`individual`, `team`, `ci` or `custom`), from the
|
|
491
491
|
* storage each domain selects. Reads only; an invalid selection rejects with its `StorageConfigError`.
|
|
492
492
|
*/
|
|
493
493
|
export async function getTeamProfile(options = {}) {
|
|
494
|
-
return (await import("./team.js")).selectTeamProfile(options);
|
|
494
|
+
return (await import("./team.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).selectTeamProfile(options);
|
|
495
|
+
}
|
|
496
|
+
//# sourceMappingURL=selection.js.map
|
|
497
|
+
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
498
|
+
// demand that fails in a process an in-place update left running says to restart.
|
|
499
|
+
function __atomicOnDemandFailed(error, feature) {
|
|
500
|
+
return (async () => {
|
|
501
|
+
const root = new URL("../../", import.meta.url);
|
|
502
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
503
|
+
const key = `${root.href}#0.10.5-alpha.1`;
|
|
504
|
+
let release = releases.get(key);
|
|
505
|
+
if (release === undefined) {
|
|
506
|
+
const current = (async () => {
|
|
507
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
508
|
+
try {
|
|
509
|
+
const held = await import(new URL(path, root).href);
|
|
510
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
511
|
+
} catch {
|
|
512
|
+
// Not a file this process can load: the next.
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
return undefined;
|
|
516
|
+
})().then((found) => {
|
|
517
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
518
|
+
return found;
|
|
519
|
+
});
|
|
520
|
+
releases.set(key, current);
|
|
521
|
+
release = current;
|
|
522
|
+
}
|
|
523
|
+
const running = await release;
|
|
524
|
+
let installed;
|
|
525
|
+
try {
|
|
526
|
+
const { readFile } = process.getBuiltinModule("node:fs/promises");
|
|
527
|
+
installed = JSON.parse(await readFile(new URL("../package.json", root), "utf8")).version;
|
|
528
|
+
} catch {
|
|
529
|
+
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
530
|
+
}
|
|
531
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.5-alpha.1" ? installed : running !== undefined && running.version !== "0.10.5-alpha.1" ? "0.10.5-alpha.1" : undefined;
|
|
532
|
+
if (updatedTo === undefined) throw error;
|
|
533
|
+
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
534
|
+
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|
|
535
|
+
cause: error,
|
|
536
|
+
});
|
|
537
|
+
restart.name = "UpdatedInstallError";
|
|
538
|
+
restart[Symbol.for("atomic.on-demand-restart.v1")] = { application, updatedTo, feature };
|
|
539
|
+
throw restart;
|
|
540
|
+
})();
|
|
495
541
|
}
|
|
496
|
-
//# sourceMappingURL=selection.js.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import "../../../_shared/rolldown-runtime-BGM3D5V3.js";
|
|
2
|
+
import { SessionEntryError } from "../../../_shared/settings-startup-65YEWRV2.js";
|
|
3
|
+
import { createLabelEntry, historyPages, readSessionHistoryChunks } from "../../../_shared/startup-8-0-34CBHPZH.js";
|
|
4
|
+
// dist/core/storage/session/branch-fork-source.js
|
|
5
|
+
async function forkRow(reader, item) {
|
|
6
|
+
if ("entry" in item) return { entry: item.entry };
|
|
7
|
+
const { forkSeedFields } = await import("./chunked-resume-projection.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"));
|
|
8
|
+
return {
|
|
9
|
+
...await forkSeedFields(() => readSessionHistoryChunks(reader, item)),
|
|
10
|
+
reference: item
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** The SDK/CLI same-store clone keeps the original append log, including abandoned branches,
|
|
14
|
+
* raw labels and recorded leaf moves. Unlike an interactive /fork it never edits structural links. */
|
|
15
|
+
function completeSessionForkStream(id, epoch, through, resident) {
|
|
16
|
+
return {
|
|
17
|
+
kind: "complete-session",
|
|
18
|
+
async *read(reader, _hasWritten, inlineSnapshot) {
|
|
19
|
+
if (resident) {
|
|
20
|
+
for (const entry of resident) yield { entry };
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
for await (const { items } of historyPages(reader, id, epoch, through, {})) for (const item of items) {
|
|
24
|
+
if ("kind" in item && inlineSnapshot) {
|
|
25
|
+
const entry = await inlineSnapshot(item);
|
|
26
|
+
if (entry) {
|
|
27
|
+
yield {
|
|
28
|
+
entry,
|
|
29
|
+
reference: item,
|
|
30
|
+
inlineSnapshot: true
|
|
31
|
+
};
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
yield await forkRow(reader, item);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** A human /fork is an archive of the complete selected path. Keep original IDs and chronological
|
|
41
|
+
* order, remove historical label operations and append each copied target's latest label as main did. */
|
|
42
|
+
function humanForkStream(id, epoch, through, leaf, leafId, labels, labelTimes) {
|
|
43
|
+
return { async *read(reader, hasWritten, inlineSnapshot) {
|
|
44
|
+
const pages = (fromSeq, toSeq) => historyPages(reader, id, epoch, through, {
|
|
45
|
+
branchLeafSeq: leaf,
|
|
46
|
+
fromSeq,
|
|
47
|
+
toSeq
|
|
48
|
+
});
|
|
49
|
+
let previous = null;
|
|
50
|
+
let found = false;
|
|
51
|
+
for await (const page of pages(1, leaf)) for (const item of page.items) {
|
|
52
|
+
const snapshot = "kind" in item ? await inlineSnapshot?.(item) : void 0;
|
|
53
|
+
const row = snapshot && "kind" in item ? {
|
|
54
|
+
entry: snapshot,
|
|
55
|
+
reference: item,
|
|
56
|
+
inlineSnapshot: true
|
|
57
|
+
} : await forkRow(reader, item);
|
|
58
|
+
const entry = row.entry;
|
|
59
|
+
if (item.seq === leaf && entry.id === leafId) found = true;
|
|
60
|
+
if (entry.type === "label") continue;
|
|
61
|
+
const edits = {};
|
|
62
|
+
if (entry.parentId !== previous) edits.parentId = previous;
|
|
63
|
+
if (entry.type === "compaction" && entry.firstKeptEntryId && !await hasWritten(entry.firstKeptEntryId)) {
|
|
64
|
+
const start = await reader.findEntrySeq?.(id, entry.firstKeptEntryId);
|
|
65
|
+
if (start !== void 0 && start < item.seq) {
|
|
66
|
+
let target = false;
|
|
67
|
+
search: for await (const earlier of pages(start, item.seq)) for (const x of earlier.items) {
|
|
68
|
+
const e = (await forkRow(reader, x)).entry;
|
|
69
|
+
if (!target) {
|
|
70
|
+
if (x.seq !== start || e.type !== "label" || e.id !== entry.firstKeptEntryId) break search;
|
|
71
|
+
target = true;
|
|
72
|
+
} else if (e.type !== "label") {
|
|
73
|
+
edits.firstKeptEntryId = e.id;
|
|
74
|
+
break search;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
previous = entry.id;
|
|
80
|
+
yield Object.keys(edits).length ? {
|
|
81
|
+
...row,
|
|
82
|
+
entry: {
|
|
83
|
+
...entry,
|
|
84
|
+
...edits
|
|
85
|
+
},
|
|
86
|
+
edits
|
|
87
|
+
} : row;
|
|
88
|
+
}
|
|
89
|
+
if (!found) throw new SessionEntryError(leafId, "missing");
|
|
90
|
+
for (const [target, label] of labels) {
|
|
91
|
+
if (!await hasWritten(target)) continue;
|
|
92
|
+
let e = createLabelEntry(target, label, /* @__PURE__ */ new Set(), previous, labelTimes.get(target));
|
|
93
|
+
while (await hasWritten(e.id)) e = createLabelEntry(target, label, /* @__PURE__ */ new Set(), previous, labelTimes.get(target));
|
|
94
|
+
previous = e.id;
|
|
95
|
+
yield { entry: e };
|
|
96
|
+
}
|
|
97
|
+
} };
|
|
98
|
+
}
|
|
99
|
+
export { completeSessionForkStream, humanForkStream };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=branch-fork-source.code.js.map
|
|
102
|
+
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
103
|
+
// demand that fails in a process an in-place update left running says to restart.
|
|
104
|
+
function __atomicOnDemandFailed(error, feature) {
|
|
105
|
+
return (async () => {
|
|
106
|
+
const root = new URL("../../../", import.meta.url);
|
|
107
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
108
|
+
const key = `${root.href}#0.10.5-alpha.1`;
|
|
109
|
+
let release = releases.get(key);
|
|
110
|
+
if (release === undefined) {
|
|
111
|
+
const current = (async () => {
|
|
112
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
113
|
+
try {
|
|
114
|
+
const held = await import(new URL(path, root).href);
|
|
115
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
116
|
+
} catch {
|
|
117
|
+
// Not a file this process can load: the next.
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
})().then((found) => {
|
|
122
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
123
|
+
return found;
|
|
124
|
+
});
|
|
125
|
+
releases.set(key, current);
|
|
126
|
+
release = current;
|
|
127
|
+
}
|
|
128
|
+
const running = await release;
|
|
129
|
+
let installed;
|
|
130
|
+
try {
|
|
131
|
+
const { readFile } = process.getBuiltinModule("node:fs/promises");
|
|
132
|
+
installed = JSON.parse(await readFile(new URL("../package.json", root), "utf8")).version;
|
|
133
|
+
} catch {
|
|
134
|
+
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
135
|
+
}
|
|
136
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.5-alpha.1" ? installed : running !== undefined && running.version !== "0.10.5-alpha.1" ? "0.10.5-alpha.1" : undefined;
|
|
137
|
+
if (updatedTo === undefined) throw error;
|
|
138
|
+
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
139
|
+
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|
|
140
|
+
cause: error,
|
|
141
|
+
});
|
|
142
|
+
restart.name = "UpdatedInstallError";
|
|
143
|
+
restart[Symbol.for("atomic.on-demand-restart.v1")] = { application, updatedTo, feature };
|
|
144
|
+
throw restart;
|
|
145
|
+
})();
|
|
146
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-fork-source.code.js","names":[],"sources":["../../../../src/core/storage/session/branch-fork-source.ts"],"mappings":";;;;AAMA,eAAe,QAAQ,QAAsB,MAAwB;CACpE,IAAI,WAAW,MAAM,OAAO,EAAE,OAAO,KAAK,MAAK;CAC/C,MAAM,EAAE,mBAAmB,MAAM,OAAO;CACxC,OAAO;EAAE,GAAI,MAAM,qBAAqB,yBAAyB,QAAQ,IAAI,CAAC;EAAI,WAAW;CAAI;AAClG;;;AAIA,SAAgB,0BACf,IACA,OACA,SACA,UAAkC;CAElC,OAAO;EACN,MAAM;EACN,OAAO,KAAK,QAAQ,aAAa,gBAAc;GAG9C,IAAI,UAAU;IACb,KAAK,MAAM,SAAS,UAAU,MAAM,EAAE,MAAK;IAC3C;GACD;GACA,WAAW,MAAM,EAAE,WAAW,aAAa,QAAQ,IAAI,OAAO,SAAS,CAAA,CAAE,GACxE,KAAK,MAAM,QAAQ,OAAO;IACzB,IAAI,UAAU,QAAQ,gBAAgB;KACrC,MAAM,QAAQ,MAAM,eAAe,IAAI;KACvC,IAAI,OAAO;MACV,MAAM;OAAE;OAAO,WAAW;OAAM,gBAAgB;MAAI;MACpD;KACD;IACD;IACA,MAAM,MAAM,QAAQ,QAAQ,IAAI;GACjC;EACF;CACA;AACF;;;AAIA,SAAgB,gBACf,IACA,OACA,SACA,MACA,QACA,QACA,YAAuC;CAEvC,OAAO,EACN,OAAO,KAAK,QAAQ,YAAY,gBAAc;EAC7C,MAAM,SAAS,SAAiB,UAC/B,aAAa,QAAQ,IAAI,OAAO,SAAS;GAAE,eAAe;GAAM;GAAS;EAAK,CAAE;EACjF,IAAI,WAA0B;EAC7B,IAAA,QAAQ;EACT,WAAW,MAAM,QAAQ,MAAM,GAAG,IAAI,GACrC,KAAK,MAAM,QAAQ,KAAK,OAAO;GAC9B,MAAM,WAAW,UAAU,OAAO,MAAM,iBAAiB,IAAI,IAAI,KAAA;GACjE,MAAM,MACL,YAAY,UAAU,OACnB;IAAE,OAAO;IAAU,WAAW;IAAM,gBAAgB;GAAI,IACxD,MAAM,QAAQ,QAAQ,IAAI;GAC9B,MAAM,QAAQ,IAAI;GAClB,IAAI,KAAK,QAAQ,QAAQ,MAAM,OAAO,QAAQ,QAAQ;GACtD,IAAI,MAAM,SAAS,SAAS;GAC5B,MAAM,QAAuC,CAAA;GAC7C,IAAI,MAAM,aAAa,UAAU,MAAM,WAAW;GAClD,IACC,MAAM,SAAS,gBACf,MAAM,oBACN,CAAE,MAAM,WAAW,MAAM,gBAAgB,GACxC;IACD,MAAM,QAAQ,MAAM,OAAO,eAAe,IAAI,MAAM,gBAAgB;IACpE,IAAI,UAAU,KAAA,KAAa,QAAQ,KAAK,KAAK;KAC5C,IAAI,SAAS;KACb,QAAQ,WAAW,MAAM,WAAW,MAAM,OAAO,KAAK,GAAG,GACxD,KAAK,MAAM,KAAK,QAAQ,OAAO;MAC9B,MAAM,KAAK,MAAM,QAAQ,QAAQ,CAAC,EAAA,CAAG;MACrC,IAAI,CAAC,QAAQ;OACZ,IAAI,EAAE,QAAQ,SAAS,EAAE,SAAS,WAAW,EAAE,OAAO,MAAM,kBAC3D,MAAM;OACP,SAAS;MACV,OAAO,IAAI,EAAE,SAAS,SAAS;OAC9B,MAAM,mBAAmB,EAAE;OAC3B,MAAM;MACP;KACD;IACF;GACD;GACA,WAAW,MAAM;GACjB,MAAM,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS;IAAE,GAAG;IAAK,OAAO;KAAE,GAAG;KAAO,GAAG;IAAK;IAAI;GAAK,IAAK;EACtF;EACD,IAAI,CAAC,OAAO,MAAM,IAAI,kBAAkB,QAAQ,SAAS;EACzD,KAAK,MAAM,CAAC,QAAQ,UAAU,QAAQ;GACrC,IAAI,CAAE,MAAM,WAAW,MAAM,GAAI;GACjC,IAAI,IAAI,iBAAiB,QAAQ,uBAAO,IAAI,IAAG,GAAI,UAAU,WAAW,IAAI,MAAM,CAAC;GACnF,OAAO,MAAM,WAAW,EAAE,EAAE,GAC3B,IAAI,iBAAiB,QAAQ,uBAAO,IAAI,IAAG,GAAI,UAAU,WAAW,IAAI,MAAM,CAAC;GAChF,WAAW,EAAE;GACb,MAAM,EAAE,OAAO,EAAC;EACjB;CACD,EACA;AACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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("./branch-fork-source.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 session storage.", {
|
|
32
|
+
cause: error,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export const { completeSessionForkStream, humanForkStream } = module;
|
|
36
|
+
//# sourceMappingURL=branch-fork-source.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-fork-source.impl.js","sources":[],"names":[],"mappings":""}
|
|
@@ -1,101 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (resident) {
|
|
20
|
-
for (const entry of resident) yield { entry };
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
for await (const { items } of historyPages(reader, id, epoch, through, {})) for (const item of items) {
|
|
24
|
-
if ("kind" in item && inlineSnapshot) {
|
|
25
|
-
const entry = await inlineSnapshot(item);
|
|
26
|
-
if (entry) {
|
|
27
|
-
yield {
|
|
28
|
-
entry,
|
|
29
|
-
reference: item,
|
|
30
|
-
inlineSnapshot: true
|
|
31
|
-
};
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
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("./branch-fork-source.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.
|
|
34
19
|
}
|
|
35
|
-
yield await forkRow(reader, item);
|
|
36
20
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* order, remove historical label operations and append each copied target's latest label as main did. */
|
|
42
|
-
function humanForkStream(id, epoch, through, leaf, leafId, labels, labelTimes) {
|
|
43
|
-
return { async *read(reader, hasWritten, inlineSnapshot) {
|
|
44
|
-
const pages = (fromSeq, toSeq) => historyPages(reader, id, epoch, through, {
|
|
45
|
-
branchLeafSeq: leaf,
|
|
46
|
-
fromSeq,
|
|
47
|
-
toSeq
|
|
21
|
+
return undefined;
|
|
22
|
+
})().then((found) => {
|
|
23
|
+
if (found === undefined && releases.get(key) === current) releases.delete(key);
|
|
24
|
+
return found;
|
|
48
25
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} : await forkRow(reader, item);
|
|
58
|
-
const entry = row.entry;
|
|
59
|
-
if (item.seq === leaf && entry.id === leafId) found = true;
|
|
60
|
-
if (entry.type === "label") continue;
|
|
61
|
-
const edits = {};
|
|
62
|
-
if (entry.parentId !== previous) edits.parentId = previous;
|
|
63
|
-
if (entry.type === "compaction" && entry.firstKeptEntryId && !await hasWritten(entry.firstKeptEntryId)) {
|
|
64
|
-
const start = await reader.findEntrySeq?.(id, entry.firstKeptEntryId);
|
|
65
|
-
if (start !== void 0 && start < item.seq) {
|
|
66
|
-
let target = false;
|
|
67
|
-
search: for await (const earlier of pages(start, item.seq)) for (const x of earlier.items) {
|
|
68
|
-
const e = (await forkRow(reader, x)).entry;
|
|
69
|
-
if (!target) {
|
|
70
|
-
if (x.seq !== start || e.type !== "label" || e.id !== entry.firstKeptEntryId) break search;
|
|
71
|
-
target = true;
|
|
72
|
-
} else if (e.type !== "label") {
|
|
73
|
-
edits.firstKeptEntryId = e.id;
|
|
74
|
-
break search;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
previous = entry.id;
|
|
80
|
-
yield Object.keys(edits).length ? {
|
|
81
|
-
...row,
|
|
82
|
-
entry: {
|
|
83
|
-
...entry,
|
|
84
|
-
...edits
|
|
85
|
-
},
|
|
86
|
-
edits
|
|
87
|
-
} : row;
|
|
88
|
-
}
|
|
89
|
-
if (!found) throw new SessionEntryError(leafId, "missing");
|
|
90
|
-
for (const [target, label] of labels) {
|
|
91
|
-
if (!await hasWritten(target)) continue;
|
|
92
|
-
let e = createLabelEntry(target, label, /* @__PURE__ */ new Set(), previous, labelTimes.get(target));
|
|
93
|
-
while (await hasWritten(e.id)) e = createLabelEntry(target, label, /* @__PURE__ */ new Set(), previous, labelTimes.get(target));
|
|
94
|
-
previous = e.id;
|
|
95
|
-
yield { entry: e };
|
|
96
|
-
}
|
|
97
|
-
} };
|
|
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 session storage.", {
|
|
32
|
+
cause: error,
|
|
33
|
+
});
|
|
98
34
|
}
|
|
99
|
-
export { completeSessionForkStream, humanForkStream };
|
|
100
|
-
|
|
101
|
-
//# sourceMappingURL=branch-fork-source.js.map
|
|
35
|
+
export const { completeSessionForkStream, humanForkStream } = module;
|
|
36
|
+
//# sourceMappingURL=branch-fork-source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch-fork-source.js","
|
|
1
|
+
{"version":3,"file":"branch-fork-source.js","sources":[],"names":[],"mappings":""}
|