@bastani/atomic 0.10.17 → 0.10.18-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 +22 -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-7KXUFI2F.js +6 -6
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +16 -4
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +16 -9
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/p0-cli-BB45ZQY6.js +1 -0
- package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -1
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +4 -3
- package/dist/_shared/p1a-prewarm-XIU57JHF.js.map +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +2 -2
- package/dist/_shared/sdk-OHKMDJ74.js +11 -7
- package/dist/_shared/sdk-OHKMDJ74.js.map +1 -1
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/{startup-0-0-ERMIDHQT.js → startup-0-0-OV6RAEAP.js} +338 -75
- package/dist/_shared/startup-0-0-OV6RAEAP.js.map +1 -0
- package/dist/_shared/{startup-0-1-RTASI3HG.js → startup-0-1-EZAJI6RE.js} +82 -5
- package/dist/_shared/startup-0-1-EZAJI6RE.js.map +1 -0
- package/dist/_shared/startup-0-2-YZZOC22D.js +4 -4
- package/dist/_shared/startup-0-3-DE2NCS6A.js +4 -4
- package/dist/_shared/startup-0-4-ZMJV547D.js +10 -6
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -1
- package/dist/_shared/startup-0-5-HZX3ZPTP.js +41 -10
- package/dist/_shared/startup-0-5-HZX3ZPTP.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
- package/dist/_shared/startup-10-0-TDQNBDDL.js.map +1 -1
- package/dist/_shared/startup-12-0-55AAXBJZ.js +1 -1
- package/dist/_shared/startup-14-0-MLX36RBG.js +2 -2
- package/dist/_shared/startup-15-0-YUKGAC63.js +2 -2
- package/dist/_shared/startup-15-1-4S7FLMNG.js +261 -75
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +23 -8
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/startup-8-1-LZFXSD3Z.js +328 -19
- package/dist/_shared/startup-8-1-LZFXSD3Z.js.map +1 -1
- package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
- package/dist/_shared/storage-status-K7PX2RXA.js +2 -2
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/team-DOQKICG2.js +1 -1
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- 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/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 +2 -2
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +1 -1
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +2 -2
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.js +2 -2
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +1 -1
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- 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 +2 -2
- 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.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- 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/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 +1 -1
- package/dist/core/extensions/runner-context.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/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/sdk.code.js +2 -2
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-append-recovery.d.ts +3 -3
- package/dist/core/session-manager-core.d.ts +1 -1
- package/dist/core/session-manager-core.js +14 -13
- package/dist/core/session-manager-core.js.map +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 +1 -1
- 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/storage/errors.d.ts +8 -5
- package/dist/core/storage/errors.js +5 -3
- package/dist/core/storage/errors.js.map +1 -1
- 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/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 +3 -3
- 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.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 +2 -2
- 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 +1 -1
- 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 +3 -3
- 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.d.ts +1 -0
- 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.d.ts +1 -0
- 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 +2 -2
- 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/session-summary.d.ts +9 -1
- 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.d.ts +1 -0
- 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.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/session/types.d.ts +1 -0
- package/dist/core/storage/sqlite-facade.js +6 -1
- package/dist/core/storage/sqlite-facade.js.map +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.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- 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 +3 -3
- package/dist/core/tasks/task-reference-archive.js +3 -3
- 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/history-session.d.ts +1 -1
- package/dist/core/tools/output-accumulator.d.ts +3 -0
- 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 +2 -2
- 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 +1 -1
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +1 -1
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +1 -1
- 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.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.js +2 -2
- package/dist/main-first-time-setup.code.js +1 -1
- 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.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/interactive/interactive-mode-helpers.d.ts +8 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +21 -0
- package/dist/modes/interactive-engine/protocol.d.ts +6 -0
- package/dist/modes/rpc/rpc-client.d.ts +2 -0
- package/dist/package-manager-cli.code.js +4 -4
- 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/4.js +1 -1
- package/dist/startup-stages/6.js +1 -1
- package/dist/utils/interactive-engine-bootstrap.d.ts +2 -0
- package/dist/utils/interactive-engine-env.d.ts +2 -0
- package/dist/utils/startup-database-spare.code.js +2 -2
- 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 +1 -1
- package/docs/guides/resume-on-any-machine.md +1 -1
- package/docs/reference/cli.md +1 -1
- package/docs/sdk.md +2 -1
- package/docs/sessions.md +5 -2
- package/docs/settings.md +1 -0
- package/docs/storage/custom-adapters.md +1 -1
- package/docs/storage/postgres/pgbouncer.md +3 -1
- package/docs/storage/postgres.md +41 -7
- package/docs/storage.md +4 -2
- package/docs/tools.md +1 -0
- package/package.json +8 -8
- package/dist/_shared/startup-0-0-ERMIDHQT.js.map +0 -1
- package/dist/_shared/startup-0-1-RTASI3HG.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
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-OV6RAEAP.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, transpileCacheWritesSettled, unreadableTrustSettingsDiagnostics, withImagesBlocked, withWindowsDirectorySecurityOwner } from "./startup-0-1-EZAJI6RE.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";
|
|
@@ -5684,10 +5684,18 @@ async function constructAgentSession(options, deferStart, persistInitialState, a
|
|
|
5684
5684
|
if (persistInitialState) {
|
|
5685
5685
|
if (hasExistingSession) {
|
|
5686
5686
|
if (!hasThinkingEntry) await sessionManager.appendThinkingLevelChange(thinkingLevel);
|
|
5687
|
-
} else
|
|
5688
|
-
|
|
5689
|
-
modelId
|
|
5690
|
-
|
|
5687
|
+
} else {
|
|
5688
|
+
const savedModel = existingSession.model;
|
|
5689
|
+
const matchesSavedModel = model !== void 0 && savedModel !== null && savedModel !== void 0 && normalizeProviderId(savedModel.provider) === normalizeProviderId(model.provider) && savedModel.modelId === model.id;
|
|
5690
|
+
const modelToRecord = model !== void 0 && !matchesSavedModel ? model : void 0;
|
|
5691
|
+
const needsThinking = !hasThinkingEntry || existingSession.thinkingLevel !== thinkingLevel;
|
|
5692
|
+
if (modelToRecord !== void 0 && needsThinking) await sessionManager.appendStartState({
|
|
5693
|
+
provider: modelToRecord.provider,
|
|
5694
|
+
modelId: modelToRecord.id
|
|
5695
|
+
}, thinkingLevel);
|
|
5696
|
+
else if (modelToRecord !== void 0) await sessionManager.appendModelChange(modelToRecord.provider, modelToRecord.id);
|
|
5697
|
+
else if (needsThinking) await sessionManager.appendThinkingLevelChange(thinkingLevel);
|
|
5698
|
+
}
|
|
5691
5699
|
}
|
|
5692
5700
|
await refreshConfig();
|
|
5693
5701
|
prepareSessionOpenMarkers();
|
|
@@ -6119,6 +6127,9 @@ function userMessageText(content) {
|
|
|
6119
6127
|
if (typeof content === "string") return content;
|
|
6120
6128
|
return content.flatMap((part) => part.type === "text" && typeof part.text === "string" ? [part.text] : []).join("");
|
|
6121
6129
|
}
|
|
6130
|
+
function isNewerEngineSession(curGen, curSeq, nextGen, nextSeq) {
|
|
6131
|
+
return nextGen > curGen || nextGen === curGen && nextSeq > curSeq;
|
|
6132
|
+
}
|
|
6122
6133
|
var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
6123
6134
|
client;
|
|
6124
6135
|
/** The host session's listeners, which get the engine's events through one ordered subscription. */
|
|
@@ -6211,6 +6222,13 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
6211
6222
|
remoteSessionName;
|
|
6212
6223
|
remoteSessionId;
|
|
6213
6224
|
remoteSessionFile;
|
|
6225
|
+
settledEngineSession;
|
|
6226
|
+
hostMirrorOrder = {
|
|
6227
|
+
generation: 0,
|
|
6228
|
+
seq: 0
|
|
6229
|
+
};
|
|
6230
|
+
hostSwitchInFlight = 0;
|
|
6231
|
+
mirrorSyncTail = Promise.resolve();
|
|
6214
6232
|
health;
|
|
6215
6233
|
remoteCommands;
|
|
6216
6234
|
/** The first engine child's start, while it may still be in flight; settles once it announced readiness or failed to. */
|
|
@@ -6257,11 +6275,20 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
6257
6275
|
this.engineRecoveryFailure = void 0;
|
|
6258
6276
|
try {
|
|
6259
6277
|
const manager = super.session.sessionManager;
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6278
|
+
const settled = this.settledEngineSession;
|
|
6279
|
+
const restartSessionId = manager.isPersisted() ? settled?.sessionId ?? manager.getSessionId() : void 0;
|
|
6280
|
+
const restartCwd = settled?.cwd ?? manager.getCwd();
|
|
6281
|
+
const restartSessionLocation = settled?.sessionLocation ?? manager.getSessionFile();
|
|
6282
|
+
const restartSessionDir = restartSessionLocation ? dirname(restartSessionLocation) : manager.getSessionDir() || void 0;
|
|
6283
|
+
await this.client.restart(restartSessionId, {
|
|
6284
|
+
cwd: restartCwd,
|
|
6285
|
+
sessionDirectory: restartSessionDir,
|
|
6263
6286
|
trustDecisions: this.knownTrust
|
|
6264
6287
|
});
|
|
6288
|
+
if (restartSessionId !== void 0) {
|
|
6289
|
+
const nextGeneration = this.client.getGeneration?.() ?? (settled?.generation ?? 0) + 1;
|
|
6290
|
+
this.recordSettledEngineSession(nextGeneration, 0, restartSessionId, restartSessionLocation, restartCwd);
|
|
6291
|
+
}
|
|
6265
6292
|
replacementReady();
|
|
6266
6293
|
await this.initializeFromEngine();
|
|
6267
6294
|
} catch (error) {
|
|
@@ -6374,6 +6401,11 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
6374
6401
|
this.hostExtensionUIReset?.();
|
|
6375
6402
|
return;
|
|
6376
6403
|
}
|
|
6404
|
+
if (message.type === "engine_session_changed") {
|
|
6405
|
+
const generation = this.client.getGeneration?.() ?? 0;
|
|
6406
|
+
if (this.recordSettledEngineSession(generation, message.seq, message.sessionId, message.sessionLocation, message.cwd) && !this.disposed && this.hostSwitchInFlight === 0) this.scheduleMirrorSync();
|
|
6407
|
+
return;
|
|
6408
|
+
}
|
|
6377
6409
|
if (message.type !== "engine_resources_ready" && message.type !== "engine_resources_failed") return;
|
|
6378
6410
|
const observedGeneration = this.client.getGeneration();
|
|
6379
6411
|
this.waitUntilResourcesReady().catch((error) => {
|
|
@@ -6483,6 +6515,82 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
6483
6515
|
if (this.initializationTail === tail) this.initializationTail = void 0;
|
|
6484
6516
|
});
|
|
6485
6517
|
}
|
|
6518
|
+
getSettledResumeTarget() {
|
|
6519
|
+
const settled = this.settledEngineSession;
|
|
6520
|
+
if (!settled) return void 0;
|
|
6521
|
+
return {
|
|
6522
|
+
sessionId: settled.sessionId,
|
|
6523
|
+
...settled.sessionLocation === void 0 ? {} : { sessionLocation: settled.sessionLocation }
|
|
6524
|
+
};
|
|
6525
|
+
}
|
|
6526
|
+
recordSettledEngineSession(generation, seq, sessionId, sessionLocation, cwd) {
|
|
6527
|
+
const current = this.settledEngineSession;
|
|
6528
|
+
if (current !== void 0 && !isNewerEngineSession(current.generation, current.seq, generation, seq)) return false;
|
|
6529
|
+
this.settledEngineSession = {
|
|
6530
|
+
generation,
|
|
6531
|
+
seq,
|
|
6532
|
+
sessionId,
|
|
6533
|
+
...sessionLocation === void 0 ? {} : { sessionLocation },
|
|
6534
|
+
...cwd === void 0 ? {} : { cwd }
|
|
6535
|
+
};
|
|
6536
|
+
this.remoteSessionId = sessionId;
|
|
6537
|
+
if (sessionLocation !== void 0) this.remoteSessionFile = sessionLocation;
|
|
6538
|
+
return true;
|
|
6539
|
+
}
|
|
6540
|
+
recordFallbackHostSwitch(settledBefore, sessionId, sessionLocation, cwd) {
|
|
6541
|
+
if (this.settledEngineSession !== settledBefore && this.settledEngineSession !== void 0) return this.settledEngineSession;
|
|
6542
|
+
const generation = this.client.getGeneration?.() ?? settledBefore?.generation ?? 0;
|
|
6543
|
+
const recorded = {
|
|
6544
|
+
generation,
|
|
6545
|
+
seq: settledBefore?.generation === generation ? settledBefore.seq : 0,
|
|
6546
|
+
sessionId,
|
|
6547
|
+
...sessionLocation === void 0 ? {} : { sessionLocation },
|
|
6548
|
+
...cwd === void 0 ? {} : { cwd }
|
|
6549
|
+
};
|
|
6550
|
+
this.settledEngineSession = recorded;
|
|
6551
|
+
this.remoteSessionId = sessionId;
|
|
6552
|
+
if (sessionLocation !== void 0) this.remoteSessionFile = sessionLocation;
|
|
6553
|
+
return recorded;
|
|
6554
|
+
}
|
|
6555
|
+
advanceHostMirrorOrder(generation, seq) {
|
|
6556
|
+
if (isNewerEngineSession(this.hostMirrorOrder.generation, this.hostMirrorOrder.seq, generation, seq)) this.hostMirrorOrder = {
|
|
6557
|
+
generation,
|
|
6558
|
+
seq
|
|
6559
|
+
};
|
|
6560
|
+
}
|
|
6561
|
+
hasPendingMirrorSync() {
|
|
6562
|
+
const target = this.settledEngineSession;
|
|
6563
|
+
return target !== void 0 && isNewerEngineSession(this.hostMirrorOrder.generation, this.hostMirrorOrder.seq, target.generation, target.seq);
|
|
6564
|
+
}
|
|
6565
|
+
scheduleMirrorSync() {
|
|
6566
|
+
const run = async () => {
|
|
6567
|
+
for (;;) {
|
|
6568
|
+
if (this.disposed || this.hostSwitchInFlight > 0) return;
|
|
6569
|
+
const target = this.settledEngineSession;
|
|
6570
|
+
if (!target || !isNewerEngineSession(this.hostMirrorOrder.generation, this.hostMirrorOrder.seq, target.generation, target.seq)) return;
|
|
6571
|
+
const currentGeneration = this.client.getGeneration?.();
|
|
6572
|
+
if (currentGeneration !== void 0 && target.generation < currentGeneration) return;
|
|
6573
|
+
if (super.session.sessionManager.isPersisted()) try {
|
|
6574
|
+
await super.switchSession(target.sessionId, {
|
|
6575
|
+
...target.cwd !== void 0 ? { cwdOverride: target.cwd } : {},
|
|
6576
|
+
sessionDirectory: target.sessionLocation ? dirname(target.sessionLocation) : void 0,
|
|
6577
|
+
history: "tail"
|
|
6578
|
+
});
|
|
6579
|
+
} catch {
|
|
6580
|
+
if (this.disposed) return;
|
|
6581
|
+
return;
|
|
6582
|
+
}
|
|
6583
|
+
else await this.resetUnpersistedSessionView();
|
|
6584
|
+
if (this.disposed) return;
|
|
6585
|
+
this.advanceHostMirrorOrder(target.generation, target.seq);
|
|
6586
|
+
if (this.hasPendingMirrorSync()) continue;
|
|
6587
|
+
await this.initializeFromEngine().catch(() => {});
|
|
6588
|
+
return;
|
|
6589
|
+
}
|
|
6590
|
+
};
|
|
6591
|
+
const next = this.mirrorSyncTail.then(run, run);
|
|
6592
|
+
this.mirrorSyncTail = next;
|
|
6593
|
+
}
|
|
6486
6594
|
/** Keep a live engine's report as soon as it arrives, before the caller waits on other engine or session work. */
|
|
6487
6595
|
async getEngineState() {
|
|
6488
6596
|
const generation = this.client.getGeneration?.();
|
|
@@ -6500,6 +6608,7 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
6500
6608
|
const streamingEpoch = this.streamingEpoch;
|
|
6501
6609
|
const thinkingEpoch = this.thinkingEpoch;
|
|
6502
6610
|
const scope = this.remoteModelCatalog.getScopeSnapshot();
|
|
6611
|
+
const settledBefore = this.settledEngineSession;
|
|
6503
6612
|
const state = await this.getEngineState();
|
|
6504
6613
|
if (generation !== void 0 && !this.isCurrentResourceGeneration(generation)) return;
|
|
6505
6614
|
const catalog = await this.client.requestInternal({
|
|
@@ -6507,13 +6616,25 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
6507
6616
|
allowPartialResources: true
|
|
6508
6617
|
});
|
|
6509
6618
|
if (generation !== void 0 && !this.isCurrentResourceGeneration(generation)) return;
|
|
6619
|
+
if (this.settledEngineSession !== settledBefore) {
|
|
6620
|
+
if (!this.disposed && this.hostSwitchInFlight === 0 && this.hasPendingMirrorSync()) this.scheduleMirrorSync();
|
|
6621
|
+
return;
|
|
6622
|
+
}
|
|
6623
|
+
const observedGeneration = generation ?? this.client.getGeneration?.() ?? 0;
|
|
6510
6624
|
if (super.session.sessionManager.isPersisted() && state.sessionId !== super.session.sessionId || state.sessionLocation && await canonicalizePathAsync$1(dirname(state.sessionLocation)) !== await canonicalizePathAsync$1(super.session.sessionManager.getSessionDir())) {
|
|
6511
6625
|
await super.switchSession(state.sessionId, {
|
|
6512
6626
|
sessionDirectory: state.sessionLocation ? dirname(state.sessionLocation) : void 0,
|
|
6513
6627
|
history: "tail"
|
|
6514
6628
|
});
|
|
6515
6629
|
if (generation !== void 0 && !this.isCurrentResourceGeneration(generation)) return;
|
|
6630
|
+
if (this.settledEngineSession !== settledBefore) {
|
|
6631
|
+
if (!this.disposed && this.hostSwitchInFlight === 0 && this.hasPendingMirrorSync()) this.scheduleMirrorSync();
|
|
6632
|
+
return;
|
|
6633
|
+
}
|
|
6516
6634
|
}
|
|
6635
|
+
if (super.session.sessionManager.isPersisted()) this.recordSettledEngineSession(observedGeneration, 0, state.sessionId, state.sessionLocation, super.session.sessionManager.getCwd());
|
|
6636
|
+
if (this.settledEngineSession?.generation === observedGeneration) this.advanceHostMirrorOrder(observedGeneration, this.settledEngineSession.seq);
|
|
6637
|
+
else this.advanceHostMirrorOrder(observedGeneration, 0);
|
|
6517
6638
|
const session = super.session;
|
|
6518
6639
|
const trustBefore = [session.settingsManager.isProjectTrusted(), this.engineProjectTrustReported];
|
|
6519
6640
|
const followsRestrictedCatalog = this.restrictedStartupCatalogs.has(session);
|
|
@@ -6988,78 +7109,138 @@ var IsolatedInteractiveRuntime = class extends AgentSessionRuntime {
|
|
|
6988
7109
|
}));
|
|
6989
7110
|
}
|
|
6990
7111
|
async switchSession(sessionId, options) {
|
|
6991
|
-
const
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
}) : await this.client.switchSession(sessionId, options?.cwdOverride, options?.sessionDirectory);
|
|
6998
|
-
if (!result.cancelled) {
|
|
6999
|
-
this.discardHeldHostEvents();
|
|
7000
|
-
this.queueResumeNotices(result.notices ?? []);
|
|
7001
|
-
await super.switchSession(sessionId, {
|
|
7112
|
+
const settledBefore = this.settledEngineSession;
|
|
7113
|
+
this.hostSwitchInFlight += 1;
|
|
7114
|
+
try {
|
|
7115
|
+
const result = options?.startedSession instanceof SessionManager && options.startedSession.getSessionId() === sessionId && options.startedSession.takeStartedSession() ? await this.client.requestInternal({
|
|
7116
|
+
type: "switch_session",
|
|
7117
|
+
sessionId,
|
|
7002
7118
|
cwdOverride: options?.cwdOverride,
|
|
7003
7119
|
sessionDirectory: options?.sessionDirectory,
|
|
7004
|
-
|
|
7005
|
-
});
|
|
7006
|
-
|
|
7007
|
-
|
|
7120
|
+
startedSession: true
|
|
7121
|
+
}) : await this.client.switchSession(sessionId, options?.cwdOverride, options?.sessionDirectory);
|
|
7122
|
+
if (!result.cancelled) {
|
|
7123
|
+
this.discardHeldHostEvents();
|
|
7124
|
+
this.queueResumeNotices(result.notices ?? []);
|
|
7125
|
+
const settled = this.settledEngineSession !== settledBefore ? this.settledEngineSession : void 0;
|
|
7126
|
+
const targetSessionId = settled?.sessionId ?? sessionId;
|
|
7127
|
+
const targetSessionDirectory = settled?.sessionLocation ? dirname(settled.sessionLocation) : options?.sessionDirectory;
|
|
7128
|
+
const targetCwdOverride = settled?.cwd ?? options?.cwdOverride;
|
|
7129
|
+
const applied = this.recordFallbackHostSwitch(settledBefore, targetSessionId, settled?.sessionLocation, targetCwdOverride);
|
|
7130
|
+
await super.switchSession(targetSessionId, {
|
|
7131
|
+
cwdOverride: targetCwdOverride,
|
|
7132
|
+
sessionDirectory: targetSessionDirectory,
|
|
7133
|
+
history: options?.history
|
|
7134
|
+
});
|
|
7135
|
+
this.advanceHostMirrorOrder(applied.generation, applied.seq);
|
|
7136
|
+
await this.initializeFromEngine();
|
|
7137
|
+
if (options?.withSession) await options.withSession(this.session.createReplacedSessionContext());
|
|
7138
|
+
}
|
|
7139
|
+
return { cancelled: result.cancelled };
|
|
7140
|
+
} finally {
|
|
7141
|
+
this.hostSwitchInFlight -= 1;
|
|
7142
|
+
if (!this.disposed && this.hostSwitchInFlight === 0 && this.hasPendingMirrorSync()) this.scheduleMirrorSync();
|
|
7008
7143
|
}
|
|
7009
|
-
return { cancelled: result.cancelled };
|
|
7010
7144
|
}
|
|
7011
7145
|
async newSession(options) {
|
|
7012
|
-
const
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7146
|
+
const settledBefore = this.settledEngineSession;
|
|
7147
|
+
this.hostSwitchInFlight += 1;
|
|
7148
|
+
try {
|
|
7149
|
+
const result = await this.client.newSession(options?.parentSession);
|
|
7150
|
+
if (result.cancelled) return result;
|
|
7151
|
+
this.discardHeldHostEvents();
|
|
7152
|
+
const state = await this.getEngineState();
|
|
7153
|
+
const settled = this.settledEngineSession !== settledBefore ? this.settledEngineSession : void 0;
|
|
7154
|
+
const targetSessionId = settled?.sessionId ?? state.sessionId;
|
|
7155
|
+
const targetSessionLocation = settled?.sessionLocation ?? state.sessionLocation;
|
|
7156
|
+
if (super.session.sessionManager.isPersisted()) {
|
|
7157
|
+
const applied = this.recordFallbackHostSwitch(settledBefore, targetSessionId, targetSessionLocation, settled?.cwd);
|
|
7158
|
+
await super.switchSession(targetSessionId, {
|
|
7159
|
+
...settled?.cwd !== void 0 ? { cwdOverride: settled.cwd } : {},
|
|
7160
|
+
sessionDirectory: targetSessionLocation ? dirname(targetSessionLocation) : void 0,
|
|
7161
|
+
history: "tail"
|
|
7162
|
+
});
|
|
7163
|
+
this.advanceHostMirrorOrder(applied.generation, applied.seq);
|
|
7164
|
+
} else {
|
|
7165
|
+
await this.resetUnpersistedSessionView();
|
|
7166
|
+
if (settled) this.advanceHostMirrorOrder(settled.generation, settled.seq);
|
|
7167
|
+
}
|
|
7168
|
+
await this.initializeFromEngine();
|
|
7169
|
+
return result;
|
|
7170
|
+
} finally {
|
|
7171
|
+
this.hostSwitchInFlight -= 1;
|
|
7172
|
+
if (!this.disposed && this.hostSwitchInFlight === 0 && this.hasPendingMirrorSync()) this.scheduleMirrorSync();
|
|
7173
|
+
}
|
|
7023
7174
|
}
|
|
7024
7175
|
async importFromJsonl(inputPath, cwdOverride) {
|
|
7025
|
-
const
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7176
|
+
const settledBefore = this.settledEngineSession;
|
|
7177
|
+
this.hostSwitchInFlight += 1;
|
|
7178
|
+
try {
|
|
7179
|
+
const result = await this.client.requestInternal({
|
|
7180
|
+
type: "import_session",
|
|
7181
|
+
inputPath,
|
|
7182
|
+
cwdOverride
|
|
7183
|
+
});
|
|
7184
|
+
if (result.cancelled) return { cancelled: true };
|
|
7185
|
+
this.discardHeldHostEvents();
|
|
7186
|
+
this.queueResumeNotices(result.notices ?? []);
|
|
7187
|
+
const state = await this.getEngineState();
|
|
7188
|
+
const settled = this.settledEngineSession !== settledBefore ? this.settledEngineSession : void 0;
|
|
7189
|
+
const targetSessionId = settled?.sessionId ?? state.sessionId;
|
|
7190
|
+
const targetSessionLocation = settled?.sessionLocation ?? state.sessionLocation;
|
|
7191
|
+
const targetCwdOverride = settled?.cwd ?? cwdOverride;
|
|
7192
|
+
if (super.session.sessionManager.isPersisted()) {
|
|
7193
|
+
const applied = this.recordFallbackHostSwitch(settledBefore, targetSessionId, targetSessionLocation, targetCwdOverride);
|
|
7194
|
+
await super.switchSession(targetSessionId, {
|
|
7195
|
+
cwdOverride: targetCwdOverride,
|
|
7196
|
+
sessionDirectory: targetSessionLocation ? dirname(targetSessionLocation) : void 0,
|
|
7197
|
+
history: "tail"
|
|
7198
|
+
});
|
|
7199
|
+
this.advanceHostMirrorOrder(applied.generation, applied.seq);
|
|
7200
|
+
} else if (settled) this.advanceHostMirrorOrder(settled.generation, settled.seq);
|
|
7201
|
+
await this.initializeFromEngine();
|
|
7202
|
+
return { cancelled: false };
|
|
7203
|
+
} finally {
|
|
7204
|
+
this.hostSwitchInFlight -= 1;
|
|
7205
|
+
if (!this.disposed && this.hostSwitchInFlight === 0 && this.hasPendingMirrorSync()) this.scheduleMirrorSync();
|
|
7206
|
+
}
|
|
7041
7207
|
}
|
|
7042
7208
|
async fork(entryId, options) {
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
cancelled =
|
|
7049
|
-
|
|
7209
|
+
const settledBefore = this.settledEngineSession;
|
|
7210
|
+
this.hostSwitchInFlight += 1;
|
|
7211
|
+
try {
|
|
7212
|
+
let selectedText;
|
|
7213
|
+
let cancelled;
|
|
7214
|
+
if (options?.position === "at") cancelled = (await this.client.clone()).cancelled;
|
|
7215
|
+
else {
|
|
7216
|
+
const result = await this.client.fork(entryId);
|
|
7217
|
+
cancelled = result.cancelled;
|
|
7218
|
+
selectedText = result.text;
|
|
7219
|
+
}
|
|
7220
|
+
if (cancelled) return { cancelled: true };
|
|
7221
|
+
this.discardHeldHostEvents();
|
|
7222
|
+
const state = await this.getEngineState();
|
|
7223
|
+
const settled = this.settledEngineSession !== settledBefore ? this.settledEngineSession : void 0;
|
|
7224
|
+
const targetSessionId = settled?.sessionId ?? state.sessionId;
|
|
7225
|
+
const targetSessionLocation = settled?.sessionLocation ?? state.sessionLocation;
|
|
7226
|
+
if (super.session.sessionManager.isPersisted()) {
|
|
7227
|
+
const applied = this.recordFallbackHostSwitch(settledBefore, targetSessionId, targetSessionLocation, settled?.cwd);
|
|
7228
|
+
await super.switchSession(targetSessionId, {
|
|
7229
|
+
...settled?.cwd !== void 0 ? { cwdOverride: settled.cwd } : {},
|
|
7230
|
+
sessionDirectory: targetSessionLocation ? dirname(targetSessionLocation) : void 0,
|
|
7231
|
+
history: "tail"
|
|
7232
|
+
});
|
|
7233
|
+
this.advanceHostMirrorOrder(applied.generation, applied.seq);
|
|
7234
|
+
} else if (settled) this.advanceHostMirrorOrder(settled.generation, settled.seq);
|
|
7235
|
+
await this.initializeFromEngine();
|
|
7236
|
+
return {
|
|
7237
|
+
cancelled: false,
|
|
7238
|
+
selectedText
|
|
7239
|
+
};
|
|
7240
|
+
} finally {
|
|
7241
|
+
this.hostSwitchInFlight -= 1;
|
|
7242
|
+
if (!this.disposed && this.hostSwitchInFlight === 0 && this.hasPendingMirrorSync()) this.scheduleMirrorSync();
|
|
7050
7243
|
}
|
|
7051
|
-
if (cancelled) return { cancelled: true };
|
|
7052
|
-
this.discardHeldHostEvents();
|
|
7053
|
-
const state = await this.getEngineState();
|
|
7054
|
-
if (super.session.sessionManager.isPersisted()) await super.switchSession(state.sessionId, {
|
|
7055
|
-
sessionDirectory: state.sessionLocation ? dirname(state.sessionLocation) : void 0,
|
|
7056
|
-
history: "tail"
|
|
7057
|
-
});
|
|
7058
|
-
await this.initializeFromEngine();
|
|
7059
|
-
return {
|
|
7060
|
-
cancelled: false,
|
|
7061
|
-
selectedText
|
|
7062
|
-
};
|
|
7063
7244
|
}
|
|
7064
7245
|
/**
|
|
7065
7246
|
* The child engine already settled (and persisted) its own turn before it
|
|
@@ -8102,6 +8283,8 @@ function startInteractiveEngine(options, holdOutput) {
|
|
|
8102
8283
|
let isolatedRuntime;
|
|
8103
8284
|
const pendingDiagnostics = [];
|
|
8104
8285
|
let callbackActive = false;
|
|
8286
|
+
const storedHeaderCwd = options.sessionManager.getHeader()?.cwd;
|
|
8287
|
+
const sessionCwdOverride = storedHeaderCwd !== void 0 && storedHeaderCwd !== options.sessionManager.getCwd() ? options.sessionManager.getCwd() : void 0;
|
|
8105
8288
|
const client = new RpcClient({
|
|
8106
8289
|
...interactiveEngineClientOptions(options.sessionManager.getCwd()),
|
|
8107
8290
|
args: buildInteractiveEngineArgs(options.parsed, options.sessionManager, options.resources),
|
|
@@ -8114,6 +8297,7 @@ function startInteractiveEngine(options, holdOutput) {
|
|
|
8114
8297
|
onHeartbeat: () => isolatedRuntime?.noteEngineHeartbeat(),
|
|
8115
8298
|
...options.parsed.apiKey ? { apiKey: options.parsed.apiKey } : {},
|
|
8116
8299
|
...options.sessionManager.isPersisted() && options.sessionManager.startedSession() ? { startedSessionId: options.sessionManager.getSessionId() } : {},
|
|
8300
|
+
...sessionCwdOverride !== void 0 ? { sessionCwdOverride } : {},
|
|
8117
8301
|
...options.startupExtensionCheck ? { startupExtensionCheck: options.startupExtensionCheck } : {}
|
|
8118
8302
|
}
|
|
8119
8303
|
});
|
|
@@ -8798,9 +8982,10 @@ async function main(argv, options) {
|
|
|
8798
8982
|
id: savedModel.modelId
|
|
8799
8983
|
})}. Using ${finalModel.provider}/${finalModel.id}`
|
|
8800
8984
|
});
|
|
8985
|
+
const matchesSavedModel = savedModel !== null && savedModel !== void 0 && normalizeProviderId(savedModel.provider) === normalizeProviderId(finalModel.provider) && savedModel.modelId === finalModel.id;
|
|
8801
8986
|
runtime.replaceModelFallback();
|
|
8802
8987
|
created.session.agent.state.model = finalModel;
|
|
8803
|
-
await sessionManager.appendModelChange(finalModel.provider, finalModel.id);
|
|
8988
|
+
if (!matchesSavedModel) await sessionManager.appendModelChange(finalModel.provider, finalModel.id);
|
|
8804
8989
|
const continuedThinkingLevel = existingSession.messages.length > 0 ? savedThinkingLevel ?? settingsManager.getDefaultThinkingLevel() ?? "medium" : void 0;
|
|
8805
8990
|
await created.session.setThinkingLevel(finalSelection.options.thinkingLevel ?? continuedThinkingLevel ?? settingsManager.getModelThinkingLevel(finalModel.provider, finalModel.id) ?? settingsManager.getDefaultThinkingLevel() ?? "medium");
|
|
8806
8991
|
} else {
|
|
@@ -8973,7 +9158,8 @@ async function main(argv, options) {
|
|
|
8973
9158
|
if (appMode === "interactive") {
|
|
8974
9159
|
const choice = await promptForMissingSessionCwd(missingSessionCwdIssue, startupSettingsManager);
|
|
8975
9160
|
sessionManager = await openSessionInCurrentCwdOrExit(sessionManager, missingSessionCwdIssue, choice);
|
|
8976
|
-
} else {
|
|
9161
|
+
} else if (engineEnv.child === "1" && engineEnv.sessionCwdOverride !== void 0) sessionManager = await sessionManager.openSessionById(sessionManager.getSessionId(), engineEnv.sessionCwdOverride, void 0, { history: "tail" });
|
|
9162
|
+
else {
|
|
8977
9163
|
console.error(chalk.red(new MissingSessionCwdError(missingSessionCwdIssue).message));
|
|
8978
9164
|
process.exit(1);
|
|
8979
9165
|
}
|
|
@@ -9160,7 +9346,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
9160
9346
|
return (async () => {
|
|
9161
9347
|
const root = new URL("../", import.meta.url);
|
|
9162
9348
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9163
|
-
const key = `${root.href}#0.10.
|
|
9349
|
+
const key = `${root.href}#0.10.18-alpha.1`;
|
|
9164
9350
|
let release = releases.get(key);
|
|
9165
9351
|
if (release === undefined) {
|
|
9166
9352
|
const current = (async () => {
|
|
@@ -9188,7 +9374,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
9188
9374
|
} catch {
|
|
9189
9375
|
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
9190
9376
|
}
|
|
9191
|
-
const updatedTo = typeof installed === "string" && installed !== "0.10.
|
|
9377
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.18-alpha.1" ? installed : running !== undefined && running.version !== "0.10.18-alpha.1" ? "0.10.18-alpha.1" : undefined;
|
|
9192
9378
|
if (updatedTo === undefined) throw error;
|
|
9193
9379
|
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
9194
9380
|
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|