@bastani/atomic 0.10.19-alpha.1 → 0.10.20-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 +82 -0
- package/dist/_shared/adapter-open-DXXV6ATH.js +22 -0
- package/dist/_shared/adapter-open-DXXV6ATH.js.map +1 -0
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-JXBZ3H27.js +439 -217
- package/dist/_shared/mode-interactive-sdk-JXBZ3H27.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +19 -11
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +9 -9
- package/dist/_shared/p0-cli-BB45ZQY6.js +2 -2
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-BHX35EPK.js → sdk-5ZFNDXUJ.js} +119 -40
- package/dist/_shared/sdk-5ZFNDXUJ.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +5 -4
- package/dist/_shared/session-data-AHTU7IS6.js.map +1 -1
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/settings-startup-HXQLSUWM.js.map +1 -1
- package/dist/_shared/{startup-0-0-4EDVBK5P.js → startup-0-0-FPPQF42L.js} +69 -26
- package/dist/_shared/startup-0-0-FPPQF42L.js.map +1 -0
- package/dist/_shared/{startup-0-1-H5IXVRXQ.js → startup-0-1-Q7GBLBEL.js} +158 -37
- package/dist/_shared/startup-0-1-Q7GBLBEL.js.map +1 -0
- package/dist/_shared/{startup-0-2-YZZOC22D.js → startup-0-2-JNYN24UI.js} +40 -6
- package/dist/_shared/startup-0-2-JNYN24UI.js.map +1 -0
- package/dist/_shared/startup-0-3-DE2NCS6A.js +26 -41
- package/dist/_shared/startup-0-3-DE2NCS6A.js.map +1 -1
- package/dist/_shared/{startup-0-4-ZMJV547D.js → startup-0-4-ZZXFKE55.js} +85 -19
- package/dist/_shared/startup-0-4-ZZXFKE55.js.map +1 -0
- package/dist/_shared/{startup-0-5-HZX3ZPTP.js → startup-0-5-WN2IYA25.js} +112 -15
- package/dist/_shared/startup-0-5-WN2IYA25.js.map +1 -0
- package/dist/_shared/{startup-10-0-TDQNBDDL.js → startup-10-0-O6DAT7U4.js} +65 -117
- package/dist/_shared/startup-10-0-O6DAT7U4.js.map +1 -0
- package/dist/_shared/startup-12-0-55AAXBJZ.js +2 -2
- package/dist/_shared/startup-14-0-MLX36RBG.js +8 -5
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/{startup-15-0-YUKGAC63.js → startup-15-0-E7RYG5YF.js} +8 -8
- package/dist/_shared/{startup-15-0-YUKGAC63.js.map → startup-15-0-E7RYG5YF.js.map} +1 -1
- package/dist/_shared/startup-15-1-WQZBOTMZ.js +73 -28
- package/dist/_shared/startup-15-1-WQZBOTMZ.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +31 -21
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/startup-8-1-QZMXUGHI.js +34 -24
- package/dist/_shared/startup-8-1-QZMXUGHI.js.map +1 -1
- package/dist/_shared/storage-command-7MGXLJGZ.js +9 -5
- package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
- package/dist/_shared/{storage-status-K7PX2RXA.js → storage-status-T6FUXRIM.js} +7 -23
- package/dist/_shared/{storage-status-K7PX2RXA.js.map → storage-status-T6FUXRIM.js.map} +1 -1
- package/dist/_shared/task-reference-stream-JWMUZSJX.js +1 -1
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/team-DOQKICG2.js +3 -2
- package/dist/_shared/team-DOQKICG2.js.map +1 -1
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/binary-self-update.js +47 -18
- package/dist/binary-self-update.js.map +1 -1
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +15 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +5 -5
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +3 -3
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.js +3 -3
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +2 -2
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +2 -2
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +2 -2
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +3 -3
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/agent-session-runtime.d.ts +2 -1
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.code.js +1 -1
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +44 -41
- package/dist/core/export-html/index.code.js.map +1 -1
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.code.js +1 -1
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/template.js +12 -25
- package/dist/core/export-html/tool-renderer.code.js +1 -1
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/context-types.d.ts +3 -0
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +2 -2
- package/dist/core/extensions/runner-context.d.ts +1 -0
- package/dist/core/extensions/runner-context.js +17 -1
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runtime-types.d.ts +1 -0
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/model-registry.js +2 -2
- package/dist/core/model-runtime-streaming.d.ts +3 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/sdk.code.js +3 -3
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.d.ts +4 -0
- package/dist/core/session-manager-core.js +46 -18
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-history.d.ts +1 -1
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.code.js +2 -2
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/settings-manager.js +1 -1
- package/dist/core/storage/adapter-open.js +3 -0
- package/dist/core/storage/adapter-open.js.map +1 -0
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/prefix.js +1 -0
- package/dist/core/storage/prefix.js.map +1 -1
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +7 -7
- package/dist/core/storage/session/child-reader.code.js.map +1 -1
- package/dist/core/storage/session/child-reader.d.ts +1 -0
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.code.js +1 -1
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +3 -3
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.code.js +2 -2
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +5 -4
- package/dist/core/storage/session/fork-window.code.js.map +1 -1
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.code.js +3 -3
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +3 -3
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +3 -17
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.code.js +1 -1
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/session/types.d.ts +2 -0
- package/dist/core/storage/session/usage-observations.d.ts +27 -0
- package/dist/core/storage/session/usage-observations.js +3 -0
- package/dist/core/storage/session/usage-observations.js.map +1 -0
- package/dist/core/storage/storage-status.code.js +1 -1
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.code.js +1 -1
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/subscription-usage-identity.d.ts +9 -0
- package/dist/core/subscription-usage-observations.d.ts +15 -0
- package/dist/core/subscription-usage-storage.js +3 -0
- package/dist/core/subscription-usage-storage.js.map +1 -0
- package/dist/core/subscription-usage.d.ts +20 -3
- package/dist/core/tasks/task-completion-entry.code.js +1 -1
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +3 -3
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +4 -4
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.code.js +1 -1
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.code.js +2 -2
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- package/dist/core/worktree-snapshot/errors.code.js +3 -3
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.code.js +2 -2
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +2 -2
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +3 -3
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/main-first-time-setup.code.js +2 -2
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.code.js +1 -1
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +1 -0
- package/dist/modes/interactive-engine/protocol.d.ts +4 -0
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +5 -0
- package/dist/package-manager-cli.code.js +6 -6
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/10.js +1 -1
- package/dist/startup-stages/4.js +1 -1
- package/dist/startup-stages/6.js +1 -1
- package/dist/startup-stages/7.js +1 -1
- package/dist/startup-stages/8.js +1 -1
- package/dist/utils/startup-database-spare.code.js +3 -3
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/changelog.mdx +31 -3
- package/docs/extensions/api-reference.md +6 -0
- package/docs/getting-started/installation.md +3 -3
- package/docs/guides/subscription-usage.md +28 -82
- package/docs/reference/cli.md +4 -2
- package/docs/rpc/protocol.md +30 -2
- package/docs/sdk/reference.md +26 -1
- package/docs/sessions.md +3 -1
- package/docs/slash-commands.md +1 -1
- package/docs/usage.md +1 -1
- package/package.json +8 -8
- package/dist/_shared/sdk-BHX35EPK.js.map +0 -1
- package/dist/_shared/startup-0-0-4EDVBK5P.js.map +0 -1
- package/dist/_shared/startup-0-1-H5IXVRXQ.js.map +0 -1
- package/dist/_shared/startup-0-2-YZZOC22D.js.map +0 -1
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +0 -1
- package/dist/_shared/startup-0-5-HZX3ZPTP.js.map +0 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import "./rolldown-runtime-BGM3D5V3.js";
|
|
2
2
|
import { APP_NAME, ENV_DEBUG, ENV_OFFLINE, ENV_SESSION_DIR, ENV_SKIP_VERSION_CHECK, ENV_STARTUP_BENCHMARK, VERSION, canonicalizePathAsync as canonicalizePathAsync$1, getAgentDir, getEnvValue, getPackageDir, inheritsDebugSetting, markLifecycleTiming, onDebugSettingChange, readInteractiveEngineBootstrap, resolvePath, setDebugSetting, setEnvValue, takeInteractiveEngineBootstrapArg } from "./p0-cli-BB45ZQY6.js";
|
|
3
|
-
import { CompactionCancelledError, CompactionStateError, CompactorFailure, EngineSessionStats, ExtensionStartupError, HostListenerFailures, INTERACTIVE_MODEL_REFRESH_TIMEOUT_MS, InteractiveEngineResourceReadinessError, MissingSessionCwdError, NativeModuleUnavailableError, QueuedDeliveryView, STALE_EXTENSION_CONTEXT_MESSAGE, SessionIntercomPolicy, TOOL_RESULTS_SUBDIR, VERBATIM_COMPACTION_STRATEGY, allToolNames, applyBashSessionEnvironment, assertSessionCwdExists, assignMissingToolCallIds, asyncScope, bindChatReceipt, blueprintBuildPending, blueprintBuildSettled, blueprintBuildsRunning, buildBoundaryText, buildBoundaryTextWithLocation, captureHerdrEnvironment, carryDroppedQueuedMessages, chatRecordSavesSettled, cleanupWindowsSelfUpdateQuarantine, completeStartup, createSyntheticSourceInfo, customMessageExcludesContext, deduplicateDiagnostics, deferDeprecationWarnings, endQueuedMessageDelivery, findMissingSessionCwdIssue, findMissingSessionCwdIssueAsync, formatCodexProviderError, formatNoModelSelectedMessage, formatNoModelsAvailableMessage, getBuiltinPackageLocations, getBuiltinPackagePaths, getDefaultCacheRetention, getToolListError, handlePackageCommandParseOutcome, heldInputView, holdToolsUntilOwnerBuilt, hostInputError, hostNoticeForEvent, interactiveQuitOf, isExtensionLoadError, isMandatoryRuntimeTool, isSingleGenericAbortTextContent, isToolModifier, isTrustedMandatoryRuntimeTool, isUnknownModel, loadShownDeprecationNotices, mergeSessionTrustDecisions, modelCallUsage, nativeModuleProblem, nativeModuleUnavailable, noteQueueUpdateDeliveries, noteQueuedMessagesDropped, noteUserMessageOrigin, notifySessionProviderRequestDispatched, observeToolExecutionTiming, parsePackageCommand, pendingProjectResourcesTrusted, projectTrustedBeforeExtensions, recordStartupThinkingLevel, refreshConfig, registerStartupRollback, releaseToolAbortGraceTimers, releaseUnownedPaneRegistration, replacementAbortContent, restoreStdout, retryStatusUpdate, rollbackStartup, sanitizeOpenAIResponsesPayload, saveChatRecord, savedConversationThinkingLevel, scrubPreCompactionAssistantUsage, serializeConversationForCompaction, serializeSessionMutation, sessionIntercomFacade, shareBlueprintBuild, shouldRunFirstTimeSetup, sleep, snapshotBashSessionEnvironment, startEventLoopMonitor, startupCleanupFailureMessage, startupProjectTrust, stopBlueprintBuilds, takeOverStdout, trackChatRecordSave, uniquifyToolCallIds, validateIntercomSessionOptions, waitForEventLoopMonitorReady, warnDeprecation, watchFirstProjectTrustHandler, writeRawStdout } from "./startup-0-0-
|
|
4
|
-
import { AgentRehydrateError, CacheWarmer, EngineHealthController, RemoteModelCatalog, RemoteQueuePause, TRANSPILE_CACHE_WRITE_WAIT_MS, ToolExecutionScheduler, acceptsForkReplay, assertSettingsWrites, captureForkReplayPair, claimInteractiveBind, collectSettingsDiagnostics, convertToLlm, convertToLlmWithForkBoundaries, currentResourceAdmission, deferMessagesInterleavedWithToolBatch, drainProcessStdio, drainWindowsDirectorySecurityReads, forkReplayFilter, getClientIdentity, isForkHeader, isLocalOnlySessionStorage, isTruthyEnvFlag, isVerbatimCompactionMessage, lifecycleScopeForOwner, migrateCompactionModelSettings, normalizeMessageContent, normalizeModelFailureSignal, noteCommandTurnMessage, ownedSettingsManagers, parseArgs, prewarmModelApi, printHelp, readPipedStdin, recordClosedStart, recordResumeTimings, repairOrphanToolResults, reportDiagnostics, resolveCompactionModel, serializeWorkspaceError, sessionLifecycleCreation, sessionLifecycleScopes, transpileCacheWritesSettled, unreadableTrustSettingsDiagnostics, withImagesBlocked, withWindowsDirectorySecurityOwner } from "./startup-0-1-
|
|
3
|
+
import { CompactionCancelledError, CompactionStateError, CompactorFailure, EngineSessionStats, ExtensionStartupError, HostListenerFailures, INTERACTIVE_MODEL_REFRESH_TIMEOUT_MS, InteractiveEngineResourceReadinessError, MissingSessionCwdError, NativeModuleUnavailableError, QueuedDeliveryView, STALE_EXTENSION_CONTEXT_MESSAGE, SessionIntercomPolicy, TOOL_RESULTS_SUBDIR, VERBATIM_COMPACTION_STRATEGY, allToolNames, applyBashSessionEnvironment, assertSessionCwdExists, assignMissingToolCallIds, asyncScope, bindChatReceipt, blueprintBuildPending, blueprintBuildSettled, blueprintBuildsRunning, buildBoundaryText, buildBoundaryTextWithLocation, captureHerdrEnvironment, carryDroppedQueuedMessages, chatRecordSavesSettled, cleanupWindowsSelfUpdateQuarantine, completeStartup, createSyntheticSourceInfo, customMessageExcludesContext, deduplicateDiagnostics, deferDeprecationWarnings, endQueuedMessageDelivery, findMissingSessionCwdIssue, findMissingSessionCwdIssueAsync, formatCodexProviderError, formatNoModelSelectedMessage, formatNoModelsAvailableMessage, getBuiltinPackageLocations, getBuiltinPackagePaths, getDefaultCacheRetention, getToolListError, handlePackageCommandParseOutcome, heldInputView, holdToolsUntilOwnerBuilt, hostInputError, hostNoticeForEvent, interactiveQuitOf, isExtensionLoadError, isMandatoryRuntimeTool, isSingleGenericAbortTextContent, isToolModifier, isTrustedMandatoryRuntimeTool, isUnknownModel, loadShownDeprecationNotices, mergeSessionTrustDecisions, modelCallUsage, nativeModuleProblem, nativeModuleUnavailable, noteQueueUpdateDeliveries, noteQueuedMessagesDropped, noteUserMessageOrigin, notifySessionProviderRequestDispatched, observeToolExecutionTiming, parsePackageCommand, pendingProjectResourcesTrusted, projectTrustedBeforeExtensions, recordStartupThinkingLevel, refreshConfig, registerStartupRollback, releaseToolAbortGraceTimers, releaseUnownedPaneRegistration, replacementAbortContent, restoreStdout, retryStatusUpdate, rollbackStartup, sanitizeOpenAIResponsesPayload, saveChatRecord, savedConversationThinkingLevel, scrubPreCompactionAssistantUsage, serializeConversationForCompaction, serializeSessionMutation, sessionIntercomFacade, shareBlueprintBuild, shouldRunFirstTimeSetup, sleep, snapshotBashSessionEnvironment, startEventLoopMonitor, startupCleanupFailureMessage, startupProjectTrust, stopBlueprintBuilds, takeOverStdout, trackChatRecordSave, uniquifyToolCallIds, validateIntercomSessionOptions, waitForEventLoopMonitorReady, warnDeprecation, watchFirstProjectTrustHandler, writeRawStdout } from "./startup-0-0-FPPQF42L.js";
|
|
4
|
+
import { AgentRehydrateError, CacheWarmer, EngineHealthController, RemoteModelCatalog, RemoteQueuePause, TRANSPILE_CACHE_WRITE_WAIT_MS, ToolExecutionScheduler, acceptsForkReplay, assertSettingsWrites, captureForkReplayPair, claimInteractiveBind, collectSettingsDiagnostics, convertToLlm, convertToLlmWithForkBoundaries, currentResourceAdmission, deferMessagesInterleavedWithToolBatch, drainProcessStdio, drainWindowsDirectorySecurityReads, forkReplayFilter, getClientIdentity, isForkHeader, isLocalOnlySessionStorage, isTruthyEnvFlag, isVerbatimCompactionMessage, lifecycleScopeForOwner, migrateCompactionModelSettings, normalizeMessageContent, normalizeModelFailureSignal, noteCommandTurnMessage, ownedSettingsManagers, parseArgs, prewarmModelApi, printHelp, readPipedStdin, recordClosedStart, recordResumeTimings, repairOrphanToolResults, reportDiagnostics, resolveCompactionModel, serializeWorkspaceError, sessionLifecycleCreation, sessionLifecycleScopes, setUsageObservationStore, transpileCacheWritesSettled, unreadableTrustSettingsDiagnostics, usageObservationStore, withHistoryLoadObserver, withImagesBlocked, withWindowsDirectorySecurityOwner } from "./startup-0-1-Q7GBLBEL.js";
|
|
5
5
|
import { endTimingSpan, initTheme, printTimings, resetTimings, startEarlyInputCapture, startTimingSpan, stopThemeWatcher, time } from "./p2-shell-main-B2WIALFD.js";
|
|
6
6
|
import { ProjectTrustStore, hasErrorIdentity, hasProjectTrustInputs, hasProjectTrustInputsAsync, redactCredentialShapes, rehydrateErrorCause, reportDebugAsync, serializeErrorCause } from "./p1b-elig-BY2G5BUE.js";
|
|
7
7
|
import { shouldUseFullscreenTui } from "./p1-elig-shell-WWRO3L2R.js";
|
|
8
|
-
import { MessageAdmissionBoundary, abortSessionWork, acquireProtectedPaths, armSessionQuitStops, assertSessionOpen, buildCompactorMessages, calculateContextTokens, clearNestedToolCalls, drainSessionReload, drainSessionWork, drainSessionWorkWithin, estimateContextTokens, estimateProjectedContextTokens, estimateTextTokens, estimateTokens, executeNestedToolCall, getCallableTools, getShellEnvAsync, hasCallingSessionWork, hasProcessStorageSelection, hasSessionReload, isPowerShellAvailable, isPowerShellAvailableAsync, isSelectedNativeMcpTool, limitQuitShutdownHandlers, ownedSessionManagerStores, ownedSessionPermits, ownedSessionStores, processSharedStorageSelection, recordNestedToolCalls, registerSessionRetirement, registerSessionWorkOwner, renewSessionWork, requestCompactorOutput, resolveSessionTempDirPath, restoreAnthropicReplayThinkingBlocks, retireSessionReloadGeneration, selectProcessStorage, sessionGenerationClosing, sessionLifetime, setActiveSessionTempId, setCliStorageSelection, shouldCompact, shutdownDeadline, trackSessionReload, trackSessionWork, untilShutdownHandlerDeadline, validateProcessStorageAsync } from "./startup-0-2-
|
|
8
|
+
import { MessageAdmissionBoundary, abortSessionWork, acquireProtectedPaths, armSessionQuitStops, assertSessionOpen, buildCompactorMessages, calculateContextTokens, clearNestedToolCalls, drainSessionReload, drainSessionWork, drainSessionWorkWithin, estimateContextTokens, estimateProjectedContextTokens, estimateTextTokens, estimateTokens, executeNestedToolCall, getCallableTools, getShellEnvAsync, hasCallingSessionWork, hasProcessStorageSelection, hasSessionReload, isPowerShellAvailable, isPowerShellAvailableAsync, isSelectedNativeMcpTool, limitQuitShutdownHandlers, ownedSessionManagerStores, ownedSessionPermits, ownedSessionStores, processSharedStorageSelection, recordNestedToolCalls, registerSessionRetirement, registerSessionWorkOwner, renewSessionWork, requestCompactorOutput, resolveSessionTempDirPath, restoreAnthropicReplayThinkingBlocks, retireSessionReloadGeneration, selectProcessStorage, sessionGenerationClosing, sessionLifetime, setActiveSessionTempId, setCliStorageSelection, shouldCompact, shutdownDeadline, trackSessionReload, trackSessionWork, untilShutdownHandlerDeadline, validateProcessStorageAsync } from "./startup-0-2-JNYN24UI.js";
|
|
9
9
|
import { ChildTaskWaits, RESUME_CATALOG_TIMEOUT_MS, buildSessionProjection, createChildCommandTaskOwner, createProjectTrustContext, getLatestCompactionBoundaryEntry, ignoredProjectSettingsWarning, prepareSessionOpenMarkers, providerAdmissionTimeout, resolveModelScopeWithDiagnostics, resolveWorktreeSnapshotSettings, resumeFailureMessage, resumeLookupError, scheduleSessionTempCleanup, startInteractiveEngineLiveness, withResumeLookupDeadline } from "./startup-0-3-DE2NCS6A.js";
|
|
10
10
|
import { SESSION_HISTORY_SCAN_ENTRIES, SessionAlreadyOpenError, SessionEntryError, isRpcRequestAcceptedFailure, isRpcTransportFailure, markRpcTransportFailure, rpcTransportError } from "./settings-startup-HXQLSUWM.js";
|
|
11
11
|
import { JsonlSessionStore, agentSessionPersistenceFailureMethods, agentSessionReleaseMethods, clearPersistenceFailure, enableReleaseWhenIdle, getLatestSessionSummary, notReopenable, noteMessageSaved, onSessionClose, parseReleaseWhenIdle, recordPersistenceFailure, repeatsShownUnsavedInput, rethrowUnlessReportedPersistenceFailure, sessionClosing } from "./startup-8-0-34CBHPZH.js";
|
|
12
|
-
import { ModelRuntime, WORKSPACE_WRITE_TOOL_NAMES, activatesOnRegistration, agentSessionModelsMethods, agentSessionRetryMethods, assertSessionManagerInWorktreeAsync, bindSessionWorkspace, buildSessionOptions, buildSystemPrompt, computeDeferExtensions, computeInteractiveEngineResourceDeferral, computeStartupInputCaptureEnabled, computeStartupTrustPromptPossible, createToolNameMatcher, deferFirstPromptModel, engineExtensionsCanDecide, ensureRetryPromise, extensionsCanDecideProjectTrust, findInitialModel, formatScopedModelList, getModelFastRoute, getSkillCatalog, isRegisteredToolAllowed, isToolActivatable, isToolDeclarationHidden, loginIsolatedApiKeyProvider, loginIsolatedOAuthProvider, loginRuntimeOAuthProvider, markRuntimeStreamFunction, mergeHeaders, pendingTaskCompletionIntents, rateLimitGuidance, recordSessionWorkspace, resolveDeferredStartupModel, resolveRestoredModelReference, retryIsCurrent, sessionAccountCheckpoint, startupErrorHandlerTokens, streamWithFastRoute, uncachedCopilotModelHint, unresolvedFallbackModelDiagnostics, withFastRouteStreamOptions, workspaceSessionCwdAsync } from "./startup-0-5-
|
|
13
|
-
import { autoDetectCompactionQuery, executeBashWithOperations, formatModelLabel, prepareCompactionBoundary } from "./startup-0-4-
|
|
12
|
+
import { ModelRuntime, WORKSPACE_WRITE_TOOL_NAMES, activatesOnRegistration, agentSessionModelsMethods, agentSessionRetryMethods, assertSessionManagerInWorktreeAsync, bindSessionWorkspace, buildSessionOptions, buildSystemPrompt, computeDeferExtensions, computeInteractiveEngineResourceDeferral, computeStartupInputCaptureEnabled, computeStartupTrustPromptPossible, createToolNameMatcher, deferFirstPromptModel, engineExtensionsCanDecide, ensureRetryPromise, extensionsCanDecideProjectTrust, findInitialModel, formatScopedModelList, getModelFastRoute, getSkillCatalog, isRegisteredToolAllowed, isToolActivatable, isToolDeclarationHidden, loginIsolatedApiKeyProvider, loginIsolatedOAuthProvider, loginRuntimeOAuthProvider, markRuntimeStreamFunction, mergeHeaders, pendingTaskCompletionIntents, rateLimitGuidance, recordSessionWorkspace, resolveDeferredStartupModel, resolveRestoredModelReference, retryIsCurrent, sessionAccountCheckpoint, startupErrorHandlerTokens, streamWithFastRoute, uncachedCopilotModelHint, unresolvedFallbackModelDiagnostics, withFastRouteStreamOptions, workspaceSessionCwdAsync } from "./startup-0-5-WN2IYA25.js";
|
|
13
|
+
import { autoDetectCompactionQuery, executeBashWithOperations, formatModelLabel, prepareCompactionBoundary } from "./startup-0-4-ZZXFKE55.js";
|
|
14
14
|
import { ENGINE_SHUTDOWN_GRACE_MS, RpcClient, SessionWorktreeSnapshotRecorder, SettingsManager, agentSessionSummaryMethods, agentSessionTreeMethods, applyToolModifiers, buildInteractiveEngineArgs, canIsolateSessionStore, cancelSessionSubscriptions, continueSessionWhereItWorked, createLocalBashOperations, createLocalPowerShellOperations, currentWorktreeRestoreNotices, currentWorktreeRootMappings, defaultToolSelectionFor, findUnansweredToolCall, hasSubagentCaptures, inheritChildSessionOptionsWithDefaults, isPlainRuntimeMetadataCommand, notifyAgentPanelSourceHubRebound, parentHistoryNotices, pathExists, prepareInitialMessage, prepareSessionResume, projectSettingsChooseSessionStorage, registerHostStoragePackages, releaseSessionWorktrees, removeSavedModelRoutingSettings, removeSavedModelRoutingSettingsAsync, resolveAppMode, resolveCliPaths, resolveExcludedToolsForAppMode, resolveSessionStore, resumeStoreDir, runMigrations, runMigrationsAsync, savedProjectTrustAsync, sessionResumeOptions, shellCommandPrefixFor, shouldStartRpcCatalogRefresh, showDeprecationWarnings, subscribeSession, takeEngineSessionStorageArg, toPrintOutputMode } from "./startup-8-1-QZMXUGHI.js";
|
|
15
|
-
import { abortCurrentGeneration, activatesAfterRecordedLoadout, agentSessionCustomMessageCommitMethods, agentSessionDetachedToolMethods, agentSessionMessageQueueMethods, agentSessionPromptMethods, agentSessionStateMethods, agentSessionTaskMethods, agentSessionToolHooksMethods, agentSessionToolRegistryMethods, awaitedToolTurnEntryId, bindChildTaskNotices, blueprintSubject, childCommandTaskHost, dismissProtectedStreamingCustomMessage, forgetQueuedMessageReceipt, holdsTurnsForDetachedResults, installQueuedMessageTaking, isDetachedToolCall, isProtectedStreamingCustomMessage, isSubagentChildSession, markProtectedStreamingCustomMessageConsumed, markProtectedStreamingCustomMessagePersistenceFailed, normalizeQueuedMessageImages, openChildCommandTaskHost, pendingProtectedStreamingCustomMessages, pendingResumeUpdate, persistProtectedStreamingCustomMessage, prepareProtectedStreamingCustomMessagesForDisposal, preservesInitialToolLoadout, queueRunStarted, queuedMessageReceiptId, recordExplicitToolDeactivations, recordedToolLoadout, recoverProtectedStreamingCustomMessages, releaseDetachedCallHolds, replaceSessionTaskOwner, requeueQueuedMessagesNotStarted, retryConsumedProtectedStreamingCustomMessages, startQueuedMessage, withoutDetachedPlaceholders } from "./startup-15-0-
|
|
16
|
-
import { SessionManager, SessionSelectorConflictError, agentSessionExportMethods, createResumeProgress, openCliSession, openSessionInCurrentCwdOrExit, promptForDirtyCheckout, promptForMissingSessionCwd, recordPromptOrder, refreshSessionStorage, sessionStorageWouldMove, startupResumeDiagnostics, validateForkFlags, validateImportFlags, validateSessionIdFlags } from "./startup-10-0-
|
|
15
|
+
import { abortCurrentGeneration, activatesAfterRecordedLoadout, agentSessionCustomMessageCommitMethods, agentSessionDetachedToolMethods, agentSessionMessageQueueMethods, agentSessionPromptMethods, agentSessionStateMethods, agentSessionTaskMethods, agentSessionToolHooksMethods, agentSessionToolRegistryMethods, awaitedToolTurnEntryId, bindChildTaskNotices, blueprintSubject, childCommandTaskHost, dismissProtectedStreamingCustomMessage, forgetQueuedMessageReceipt, holdsTurnsForDetachedResults, installQueuedMessageTaking, isDetachedToolCall, isProtectedStreamingCustomMessage, isSubagentChildSession, markProtectedStreamingCustomMessageConsumed, markProtectedStreamingCustomMessagePersistenceFailed, normalizeQueuedMessageImages, openChildCommandTaskHost, pauseQueuedMessages, pendingProtectedStreamingCustomMessages, pendingResumeUpdate, persistProtectedStreamingCustomMessage, prepareProtectedStreamingCustomMessagesForDisposal, preservesInitialToolLoadout, queueRunStarted, queuedMessageReceiptId, recordExplicitToolDeactivations, recordedToolLoadout, recoverProtectedStreamingCustomMessages, releaseDetachedCallHolds, replaceSessionTaskOwner, requeueQueuedMessagesNotStarted, retryConsumedProtectedStreamingCustomMessages, startQueuedMessage, withoutDetachedPlaceholders } from "./startup-15-0-E7RYG5YF.js";
|
|
16
|
+
import { SessionManager, SessionSelectorConflictError, agentSessionExportMethods, createResumeProgress, openCliSession, openSessionInCurrentCwdOrExit, promptForDirtyCheckout, promptForMissingSessionCwd, recordPromptOrder, refreshSessionStorage, sessionStorageWouldMove, startupResumeDiagnostics, validateForkFlags, validateImportFlags, validateSessionIdFlags } from "./startup-10-0-O6DAT7U4.js";
|
|
17
17
|
import { captureInteractiveEngineStartupEnv, discardPrewarmedEngine, interactiveEngineClientOptions, interactiveEngineStartupEnv, isInteractiveEngineChild } from "./p1a-prewarm-XIU57JHF.js";
|
|
18
18
|
import { builtInExtensions, factoryAcquisitions, factoryRollbackError, recordFactoryAcquisitions, rollbackFactoryAcquisitions } from "./startup-12-0-55AAXBJZ.js";
|
|
19
19
|
import { DefaultResourceLoader, ExtensionRunner, canCloneDefaultResourceDiscovery, canPrepareDeferredStartupCompletion, emitSessionShutdownEvent, formatBorrowedExtensionSourceTrustPrompt, getDeferredInitialSettingsSnapshot, isMandatoryResourceLoader, isolateMandatoryResourceLoader, limitMandatoryIntercomToTool, mandatoryLoaderCoversBuiltins, prepareDefaultResourceLoaderReload, prepareDeferredStartupCompletion, resolveProjectTrusted, stockResourceDiscovery, withBuiltinResourceLoader, withMandatoryResourceLoader } from "./startup-14-0-MLX36RBG.js";
|
|
@@ -661,10 +661,11 @@ function isSessionQuitting(session) {
|
|
|
661
661
|
return sessionClosures.get(session)?.quitting === true;
|
|
662
662
|
}
|
|
663
663
|
/** Shared terminal boundary for direct SDK disposal and runtime replacement. */
|
|
664
|
-
function closeAgentSession(session,
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
664
|
+
function closeAgentSession(session, request, beforeInvalidate) {
|
|
665
|
+
const event = request ?? {
|
|
666
|
+
type: "session_shutdown",
|
|
667
|
+
reason: "quit"
|
|
668
|
+
};
|
|
668
669
|
const reason = event.reason;
|
|
669
670
|
const handoff = reason !== "quit" && hasCallingSessionWork(session);
|
|
670
671
|
const existing = sessionClosures.get(session);
|
|
@@ -696,7 +697,10 @@ function closeAgentSession(session, event = {
|
|
|
696
697
|
});
|
|
697
698
|
await attempt("event subscriptions", () => cancelSessionSubscriptions(session));
|
|
698
699
|
await attempt("shell abort", () => abortBash.call(session));
|
|
699
|
-
await attempt("abort", () =>
|
|
700
|
+
await attempt("abort", () => {
|
|
701
|
+
if (request?.reason === "quit") pauseQueuedMessages.call(session);
|
|
702
|
+
return abortCurrentGeneration.call(session);
|
|
703
|
+
});
|
|
700
704
|
releaseToolAbortGraceTimers(session);
|
|
701
705
|
await attempt("reload rollback", () => drainSessionReload(session));
|
|
702
706
|
await attempt("tasks", () => session.closeSessionTasks());
|
|
@@ -3173,6 +3177,10 @@ function _bindExtensionCore(runner, publication, startupToolNames, startupLoadou
|
|
|
3173
3177
|
else this._extensionShutdownHandler?.();
|
|
3174
3178
|
},
|
|
3175
3179
|
getContextUsage: () => this.getContextUsage(),
|
|
3180
|
+
getSubscriptionUsage: async (options) => {
|
|
3181
|
+
const { loadSubscriptionUsage } = await import("../core/subscription-usage.js").catch((error) => __atomicOnDemandFailed(error, "this feature"));
|
|
3182
|
+
return loadSubscriptionUsage(this.modelRuntime, this.model?.provider, options);
|
|
3183
|
+
},
|
|
3176
3184
|
compact: (options) => {
|
|
3177
3185
|
const compact = async () => {
|
|
3178
3186
|
try {
|
|
@@ -4781,10 +4789,11 @@ var AgentSessionRuntime = class {
|
|
|
4781
4789
|
* (a checkout whose snapshot record it lacks, #4744), which the caller queues once the switch succeeds; a mirror of
|
|
4782
4790
|
* a resume another process prepared gets that process's notices instead, so it has none.
|
|
4783
4791
|
*/
|
|
4784
|
-
async resumeWorktree(sessionManager, sessionDirectory, entryPoint = "switch-session") {
|
|
4792
|
+
async resumeWorktree(sessionManager, sessionDirectory, entryPoint = "switch-session", onProgress) {
|
|
4785
4793
|
const prepared = await prepareSessionResume(sessionManager, {
|
|
4786
4794
|
...this.resumeOptions(entryPoint),
|
|
4787
|
-
sessionDirectory
|
|
4795
|
+
sessionDirectory,
|
|
4796
|
+
onProgress
|
|
4788
4797
|
});
|
|
4789
4798
|
if (prepared.status !== "ready") return {
|
|
4790
4799
|
sessionManager,
|
|
@@ -4828,10 +4837,13 @@ var AgentSessionRuntime = class {
|
|
|
4828
4837
|
this.assertOpen();
|
|
4829
4838
|
if (beforeResult.cancelled) return beforeResult;
|
|
4830
4839
|
const previousSessionId = this.session.sessionId;
|
|
4831
|
-
const
|
|
4840
|
+
const onProgress = options?.onProgress;
|
|
4841
|
+
const openHistory = () => this.boundedSessionLookup(this.session.sessionManager.openSessionById(sessionId, options?.cwdOverride, options?.sessionDirectory, { history: options?.history }), sessionId);
|
|
4842
|
+
onProgress?.("Reading session history");
|
|
4843
|
+
const opened = await (onProgress ? withHistoryLoadObserver((entries) => onProgress(`Reading ${entries.toLocaleString()} history entries`), openHistory) : openHistory());
|
|
4832
4844
|
if (options?.startedSession === HOST_STARTED_SESSION) opened.markSessionStarted();
|
|
4833
4845
|
else if (options?.startedSession instanceof SessionManager) await options.startedSession.handOverStartedSession(opened);
|
|
4834
|
-
const { sessionManager, unrecorded } = await this.resumeWorktree(opened, options?.sessionDirectory);
|
|
4846
|
+
const { sessionManager, unrecorded } = await this.resumeWorktree(opened, options?.sessionDirectory, "switch-session", onProgress);
|
|
4835
4847
|
const missingCwd = await findMissingSessionCwdIssueAsync(sessionManager, this.cwd);
|
|
4836
4848
|
if (missingCwd !== void 0) throw new MissingSessionCwdError(missingCwd);
|
|
4837
4849
|
const runtimeOptions = {
|
|
@@ -4845,6 +4857,7 @@ var AgentSessionRuntime = class {
|
|
|
4845
4857
|
},
|
|
4846
4858
|
projectTrustContext: (options?.projectTrustContextFactory ?? this.projectTrustContextFactory)?.(sessionManager.getCwd())
|
|
4847
4859
|
};
|
|
4860
|
+
onProgress?.("Preparing session");
|
|
4848
4861
|
await this.settleActiveResponseBeforeTeardown();
|
|
4849
4862
|
this.assertOpen();
|
|
4850
4863
|
const complete = await this.createRuntime.prepareResume?.(runtimeOptions);
|
|
@@ -4889,9 +4902,10 @@ var AgentSessionRuntime = class {
|
|
|
4889
4902
|
if (position === "at") targetLeafId = selectedEntry.id;
|
|
4890
4903
|
else {
|
|
4891
4904
|
if (selectedEntry.type !== "message" || selectedEntry.message.role !== "user") throw new SessionEntryError(entryId, "not-forkable");
|
|
4892
|
-
targetLeafId = selectedEntry
|
|
4905
|
+
targetLeafId = await this.session.sessionManager.readParentId(selectedEntry);
|
|
4893
4906
|
selectedText = extractUserMessageText(selectedEntry.message.content);
|
|
4894
4907
|
}
|
|
4908
|
+
this.assertOpen();
|
|
4895
4909
|
const previousSessionId = this.session.sessionId;
|
|
4896
4910
|
const sessionManager = await this.session.sessionManager.openSessionById(previousSessionId, this.session.sessionManager.getCwd());
|
|
4897
4911
|
if (!targetLeafId) await sessionManager.newSession({ parentSession: previousSessionId });
|
|
@@ -5317,6 +5331,7 @@ async function constructAgentSession(options, deferStart, persistInitialState, a
|
|
|
5317
5331
|
if (store !== options.sessionStore) acquisition.store = store;
|
|
5318
5332
|
sessionManager = await SessionManager.create(store, cwd);
|
|
5319
5333
|
}
|
|
5334
|
+
setUsageObservationStore(modelRuntime, usageObservationStore(sessionManager.getSessionStore()));
|
|
5320
5335
|
if (workspace !== void 0 && persistInitialState) await recordSessionWorkspace(sessionManager, workspace);
|
|
5321
5336
|
if (!resourceLoader) {
|
|
5322
5337
|
resourceLoader = new DefaultResourceLoader({
|
|
@@ -6430,8 +6445,18 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
6430
6445
|
this.patchSession(session);
|
|
6431
6446
|
return session;
|
|
6432
6447
|
}
|
|
6433
|
-
listUsageAccounts() {
|
|
6434
|
-
return this.client.
|
|
6448
|
+
async listUsageAccounts() {
|
|
6449
|
+
return (await this.client.requestInternal({
|
|
6450
|
+
type: "list_usage_accounts",
|
|
6451
|
+
subscriptionsOnly: true
|
|
6452
|
+
})).accounts;
|
|
6453
|
+
}
|
|
6454
|
+
async observedUsage() {
|
|
6455
|
+
return (await this.client.requestInternal({
|
|
6456
|
+
type: "get_usage",
|
|
6457
|
+
observedOnly: true,
|
|
6458
|
+
subscriptionsOnly: true
|
|
6459
|
+
})).accounts;
|
|
6435
6460
|
}
|
|
6436
6461
|
async loadAccountUsage(provider, refresh) {
|
|
6437
6462
|
const [usage] = await this.client.getUsage(provider, refresh);
|
|
@@ -7118,15 +7143,25 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
7118
7143
|
}
|
|
7119
7144
|
async switchSession(sessionId, options) {
|
|
7120
7145
|
const settledBefore = this.settledEngineSession;
|
|
7146
|
+
const onProgress = options?.onProgress;
|
|
7147
|
+
let requestId;
|
|
7148
|
+
const stopProgress = onProgress && this.client.onInteractiveEngineMessage((event) => {
|
|
7149
|
+
if (event.type === "engine_session_load_progress" && event.requestId === requestId) onProgress(event.message);
|
|
7150
|
+
});
|
|
7121
7151
|
this.hostSwitchInFlight += 1;
|
|
7122
7152
|
try {
|
|
7123
|
-
const
|
|
7153
|
+
const started = options?.startedSession instanceof SessionManager && options.startedSession.getSessionId() === sessionId && options.startedSession.takeStartedSession();
|
|
7154
|
+
const result = started || onProgress ? await this.client.requestInternal({
|
|
7124
7155
|
type: "switch_session",
|
|
7125
7156
|
sessionId,
|
|
7126
7157
|
cwdOverride: options?.cwdOverride,
|
|
7127
7158
|
sessionDirectory: options?.sessionDirectory,
|
|
7128
|
-
startedSession:
|
|
7159
|
+
startedSession: started || void 0,
|
|
7160
|
+
reportLoadProgress: onProgress ? true : void 0
|
|
7161
|
+
}, (id) => {
|
|
7162
|
+
requestId = id;
|
|
7129
7163
|
}) : await this.client.switchSession(sessionId, options?.cwdOverride, options?.sessionDirectory);
|
|
7164
|
+
requestId = void 0;
|
|
7130
7165
|
if (!result.cancelled) {
|
|
7131
7166
|
this.discardHeldHostEvents();
|
|
7132
7167
|
this.queueResumeNotices(result.notices ?? []);
|
|
@@ -7135,6 +7170,7 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
7135
7170
|
const targetSessionDirectory = settled?.sessionLocation ? dirname(settled.sessionLocation) : options?.sessionDirectory;
|
|
7136
7171
|
const targetCwdOverride = settled?.cwd ?? options?.cwdOverride;
|
|
7137
7172
|
const applied = this.recordFallbackHostSwitch(settledBefore, targetSessionId, settled?.sessionLocation, targetCwdOverride);
|
|
7173
|
+
onProgress?.("Opening transcript");
|
|
7138
7174
|
await super.switchSession(targetSessionId, {
|
|
7139
7175
|
cwdOverride: targetCwdOverride,
|
|
7140
7176
|
sessionDirectory: targetSessionDirectory,
|
|
@@ -7146,6 +7182,7 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
7146
7182
|
}
|
|
7147
7183
|
return { cancelled: result.cancelled };
|
|
7148
7184
|
} finally {
|
|
7185
|
+
stopProgress?.();
|
|
7149
7186
|
this.hostSwitchInFlight -= 1;
|
|
7150
7187
|
if (!this.disposed && this.hostSwitchInFlight === 0 && this.hasPendingMirrorSync()) this.scheduleMirrorSync();
|
|
7151
7188
|
}
|
|
@@ -8649,12 +8686,13 @@ async function main(argv, options) {
|
|
|
8649
8686
|
};
|
|
8650
8687
|
if (usageCommand) {
|
|
8651
8688
|
try {
|
|
8652
|
-
const [{ modelRuntime }, { loadSubscriptionUsage }, { formatUsageReport }] = await Promise.all([
|
|
8689
|
+
const [{ modelRuntime }, { loadSubscriptionUsage }, { formatUsageReport }, { withSelectedUsageStore }] = await Promise.all([
|
|
8653
8690
|
loadMetadata(),
|
|
8654
8691
|
import("../core/subscription-usage.js").catch((error) => __atomicOnDemandFailed(error, "this feature")),
|
|
8655
|
-
import("../cli/usage-command.js").catch((error) => __atomicOnDemandFailed(error, "this feature"))
|
|
8692
|
+
import("../cli/usage-command.js").catch((error) => __atomicOnDemandFailed(error, "this feature")),
|
|
8693
|
+
import("../core/subscription-usage-storage.js").catch((error) => __atomicOnDemandFailed(error, "this feature"))
|
|
8656
8694
|
]);
|
|
8657
|
-
const report = await loadSubscriptionUsage(modelRuntime, startupSettingsManager.getDefaultProvider());
|
|
8695
|
+
const report = await withSelectedUsageStore(cwd, agentDir, startupSettingsManager.getSettings(), void 0, (store) => loadSubscriptionUsage(modelRuntime, startupSettingsManager.getDefaultProvider(), { store }));
|
|
8658
8696
|
writeRawStdout(args.includes("--json") ? `${JSON.stringify(report)}\n` : formatUsageReport(report));
|
|
8659
8697
|
} catch {
|
|
8660
8698
|
process.stderr.write("Could not read subscription accounts.\n");
|
|
@@ -9161,7 +9199,8 @@ async function main(argv, options) {
|
|
|
9161
9199
|
};
|
|
9162
9200
|
let sessionManager;
|
|
9163
9201
|
let worktreeRestoreDiagnostics = [];
|
|
9164
|
-
const
|
|
9202
|
+
const createSessionStartupProgress = () => createResumeProgress(appMode, engineEnv.child === "1", process.stderr, startupSettingsManager.getThemeSetting());
|
|
9203
|
+
const startupProgress = createSessionStartupProgress();
|
|
9165
9204
|
const stopAnnouncingWaits = appMode !== "interactive" && engineEnv.child !== "1" ? (await import("../modes/print-mode.js").catch((error) => __atomicOnDemandFailed(error, "this feature"))).announceBlueprintBuildWaits(appMode !== "print") : void 0;
|
|
9166
9205
|
try {
|
|
9167
9206
|
const opened = await openCliSession(parsed, cwd, startupSettingsManager, {
|
|
@@ -9199,7 +9238,13 @@ async function main(argv, options) {
|
|
|
9199
9238
|
if (missingSessionCwdIssue) {
|
|
9200
9239
|
if (appMode === "interactive") {
|
|
9201
9240
|
const choice = await promptForMissingSessionCwd(missingSessionCwdIssue, startupSettingsManager);
|
|
9202
|
-
|
|
9241
|
+
const progress = createSessionStartupProgress();
|
|
9242
|
+
if (choice !== void 0) progress?.phase(choice === "fork" ? "Forking saved session" : "Reading session history");
|
|
9243
|
+
try {
|
|
9244
|
+
sessionManager = await openSessionInCurrentCwdOrExit(sessionManager, missingSessionCwdIssue, choice, progress);
|
|
9245
|
+
} finally {
|
|
9246
|
+
progress?.done();
|
|
9247
|
+
}
|
|
9203
9248
|
} else if (engineEnv.child === "1" && engineEnv.sessionCwdOverride !== void 0) sessionManager = await sessionManager.openSessionById(sessionManager.getSessionId(), engineEnv.sessionCwdOverride, void 0, { history: "tail" });
|
|
9204
9249
|
else {
|
|
9205
9250
|
console.error(chalk.red(new MissingSessionCwdError(missingSessionCwdIssue).message));
|
|
@@ -9388,7 +9433,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
9388
9433
|
return (async () => {
|
|
9389
9434
|
const root = new URL("../", import.meta.url);
|
|
9390
9435
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9391
|
-
const key = `${root.href}#0.10.
|
|
9436
|
+
const key = `${root.href}#0.10.20-alpha.1`;
|
|
9392
9437
|
let release = releases.get(key);
|
|
9393
9438
|
if (release === undefined) {
|
|
9394
9439
|
const current = (async () => {
|
|
@@ -9416,7 +9461,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
9416
9461
|
} catch {
|
|
9417
9462
|
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
9418
9463
|
}
|
|
9419
|
-
const updatedTo = typeof installed === "string" && installed !== "0.10.
|
|
9464
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.20-alpha.1" ? installed : running !== undefined && running.version !== "0.10.20-alpha.1" ? "0.10.20-alpha.1" : undefined;
|
|
9420
9465
|
if (updatedTo === undefined) throw error;
|
|
9421
9466
|
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
9422
9467
|
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|