@bastani/atomic 0.9.32-alpha.1 → 0.9.33-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 +13 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +12 -0
- package/dist/builtin/workflows/builtin/{chunk-bnz4knhy.js → chunk-0d0pd4fz.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-v4scsq3y.js → chunk-119gt64q.js} +54 -16
- package/dist/builtin/workflows/builtin/{chunk-9ywkdsa9.js → chunk-s7y3hw0n.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-dx5sjaxe.js → chunk-y68758re.js} +1 -1
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.js +3 -3
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +78 -20
- package/dist/builtin/workflows/src/index.js +53 -15
- package/dist/modes/interactive/interactive-agent-events.js +9 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +1 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +14 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
- package/dist/modes/interactive/program-status-reporter.js +92 -1
- package/dist/modes/interactive/program-status-reporter.js.map +1 -1
- package/dist/modes/interactive-engine/engine-workflow-activity.d.ts +23 -0
- package/dist/modes/interactive-engine/engine-workflow-activity.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-workflow-activity.js +80 -0
- package/dist/modes/interactive-engine/engine-workflow-activity.js.map +1 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +8 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +31 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +3 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +4 -0
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +6 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +63 -0
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +7 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +24 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts +5 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +10 -1
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/docs/terminal-setup.md +6 -4
- package/docs/workflows/operations.md +1 -1
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isolated-runtime.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/isolated-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAY,kBAAkB,EAAc,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAyC,MAAM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CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;gBAC5B,MAAM;YACP,KAAK,wBAAwB;gBAC5B,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC;gBACxB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC;gBAChD,MAAM;YACP,KAAK,sBAAsB;gBAC1B,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC;gBACpC,MAAM;QACR,CAAC;IACF,CAAC;CACD","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport type { AuthInteraction } from \"@bastani/pi-ai\";\nimport { type Api, clampThinkingLevel, type Model } from \"@bastani/pi-ai/compat\";\nimport type { AgentSession, CompactionReason } from \"../../core/agent-session.js\";\nimport { AgentSessionRuntime, type CreateAgentSessionRuntimeFactory } from \"../../core/agent-session-runtime.ts\";\nimport type { ModelMutationOptions, PromptOptions } from \"../../core/agent-session-types.js\";\nimport type { ResourceOverlap } from \"../../core/diagnostics.ts\";\nimport { SessionManager } from \"../../core/session-manager.ts\";\nimport type { ToolStatusReport } from \"../../core/tool-status.js\";\nimport { captureHerdrEnvironment } from \"../../extensions/herdr/environment.js\";\nimport { releaseUnownedPaneRegistration } from \"../../extensions/herdr/pane-owner.js\";\nimport { sleep } from \"../../utils/sleep.ts\";\nimport type { JsonAgentSessionEvent } from \"../json-event.ts\";\nimport type { RpcClient } from \"../rpc/rpc-client.ts\";\nimport { isRpcTransportFailure, markRpcTransportFailure, rpcTransportError } from \"../rpc/rpc-transport-error.ts\";\nimport type {\n\tRpcAutocompleteItem,\n\tRpcEvent,\n\tRpcExtensionUIRequest,\n\tRpcExtensionUIResponse,\n\tRpcModelCatalog,\n\tRpcResourceExtension,\n\tRpcSlashCommand,\n} from \"../rpc/rpc-types.ts\";\nimport type { ActivityWatchdogDiagnostic } from \"./activity-watchdog.ts\";\nimport type { InteractiveEngineGenerationEndedListener } from \"./engine-generation.ts\";\nimport { type EngineDiagnosticListener, EngineHealthController } from \"./engine-health.ts\";\nimport { EngineSessionStats } from \"./engine-session-stats.js\";\nimport {\n\ttype AtomicOAuthLoginCallbacks,\n\tloginIsolatedApiKeyProvider,\n\tloginIsolatedOAuthProvider,\n} from \"./isolated-auth.ts\";\nimport type { EngineKeybindingState, InteractiveEngineCommand, InteractiveEngineMessage } from \"./protocol.ts\";\nimport { RemoteCommandCatalog, type RemoteCommandsListener } from \"./remote-command-catalog.ts\";\nimport { RemoteModelCatalog } from \"./remote-model-catalog.ts\";\nimport { RemoteQueuePause } from \"./remote-queue-pause.js\";\nimport { InteractiveEngineResourceReadinessError } from \"./resource-readiness-error.ts\";\n\ntype ResourceExtensionsListener = (extensions: readonly RpcResourceExtension[]) => void;\ntype QueueSnapshot = { steering: string[]; followUp: string[] };\n\nfunction applyPersistedModelDefault(session: AgentSession, model: Model<Api>, alreadyInScope: boolean): void {\n\tsession.settingsManager.setDefaultModelAndProvider(model.provider, model.id);\n\tif (alreadyInScope || session.scopedModels.length === 0) return;\n\tconst enabledModels = session.settingsManager.getEnabledModels();\n\tif (!enabledModels?.length) return;\n\tconst modelReference = `${model.provider}/${model.id}`;\n\tif (enabledModels.some((pattern) => pattern.toLowerCase() === modelReference.toLowerCase())) return;\n\tsession.settingsManager.setEnabledModels([...enabledModels, modelReference]);\n}\n\nfunction thinkingPersistTarget(result: {\n\tprovider?: string;\n\tmodelId?: string;\n}): { provider: string; modelId: string } | undefined {\n\tif (!result.provider || !result.modelId) return undefined;\n\treturn { provider: result.provider, modelId: result.modelId };\n}\n\nfunction applyPersistedThinkingDefault(\n\tsession: AgentSession,\n\tlevel: AgentSession[\"thinkingLevel\"],\n\ttarget?: { provider: string; modelId: string },\n): void {\n\tif (target) {\n\t\tsession.settingsManager.setModelThinkingLevel(target.provider, target.modelId, level);\n\t}\n\tsession.settingsManager.setDefaultThinkingLevel(level);\n}\n\ntype PendingQueueClear = {\n\tsnapshot: QueueSnapshot;\n\tqueueUpdateGeneration: number;\n\tcount: number;\n\tsucceeded: boolean;\n};\n\n/**\n * Owns Atomic's local interactive host facade and child-process engine.\n *\n * This runtime is deliberately not a RemoteSession adapter. Its JSONL RPC,\n * rendering, custom UI, and recovery lifecycle stay separate from pi-client's\n * protocol lease lifecycle.\n */\nexport class IsolatedInteractiveRuntime extends AgentSessionRuntime {\n\tprivate readonly client: RpcClient;\n\tprivate readonly patchedSessions = new WeakSet<AgentSession>();\n\tprivate streaming = false;\n\tprivate compacting = false;\n\tprivate compactionReason: CompactionReason | undefined;\n\tprivate readonly activeBashRequestIds = new Map<string | symbol, string>();\n\tprivate steeringMessages: string[] = [];\n\tprivate followUpMessages: string[] = [];\n\t/** Bumped by every authoritative queue_update. */\n\tprivate queueUpdateGeneration = 0;\n\t/** Bumped by local thinking mutations and thinking_level_changed events. */\n\tprivate thinkingEpoch = 0;\n\t/** Clears started before the next queue_update share one rollback snapshot. */\n\tprivate pendingQueueClear: PendingQueueClear | undefined;\n\tprivate engineCallbackActive = false;\n\tprivate readonly queuePause: RemoteQueuePause;\n\tprivate readonly sessionStats: EngineSessionStats;\n\tprivate autoCompactionEnabled = true;\n\tprivate autoRetryEnabled = true;\n\tprivate remoteSessionName: string | undefined;\n\tprivate remoteSessionFile: string | undefined;\n\tprivate readonly health: EngineHealthController;\n\tprivate readonly remoteCommands: RemoteCommandCatalog;\n\tprivate disposed = false;\n\tprivate disposePromise: Promise<void> | undefined;\n\tprivate readonly remoteModelCatalog: RemoteModelCatalog;\n\tprivate resourceOverlaps: ResourceOverlap[] = [];\n\tprivate readonly resourceExtensionsListeners: ResourceExtensionsListener[] = [];\n\tprivate resourceExtensions: RpcResourceExtension[] = [];\n\tprivate resourcesInitializedGeneration = 0;\n\tprivate resourceInitialization: { generation: number; promise: Promise<void> } | undefined;\n\tprivate readonly retiredResourceGenerations = new Set<number>();\n\tprivate readonly reportedResourceFailureGenerations = new Set<number>();\n\tprivate initializationTail: Promise<void> | undefined;\n\tprivate engineRecoveryFailure: Error | undefined;\n\tprivate promptCancellationEpoch = 0;\n\n\tconstructor(localRuntime: AgentSessionRuntime, createRuntime: CreateAgentSessionRuntimeFactory, client: RpcClient) {\n\t\tsuper(\n\t\t\tlocalRuntime.session,\n\t\t\tlocalRuntime.services,\n\t\t\tcreateRuntime,\n\t\t\t[...localRuntime.diagnostics],\n\t\t\tlocalRuntime.modelFallbackMessage,\n\t\t\tlocalRuntime.modelFallbackReason,\n\t\t);\n\t\tthis.client = client;\n\t\tthis.remoteCommands = new RemoteCommandCatalog(client);\n\t\tthis.remoteModelCatalog = new RemoteModelCatalog(client);\n\t\tthis.queuePause = new RemoteQueuePause(client);\n\t\tthis.sessionStats = new EngineSessionStats(client);\n\t\tthis.health = new EngineHealthController({\n\t\t\tstop: () => this.client.stop(),\n\t\t\trestart: async () => {\n\t\t\t\tthis.engineRecoveryFailure = undefined;\n\t\t\t\ttry {\n\t\t\t\t\tawait this.client.restart(this.remoteSessionFile);\n\t\t\t\t\tawait this.initializeFromEngine();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst failure = markRpcTransportFailure(error);\n\t\t\t\t\tthis.engineRecoveryFailure = failure;\n\t\t\t\t\tthrow failure;\n\t\t\t\t}\n\t\t\t},\n\t\t\tclearActivity: () => {\n\t\t\t\tthis.streaming = false;\n\t\t\t\tthis.compacting = false;\n\t\t\t\tthis.compactionReason = undefined;\n\t\t\t\tthis.pendingQueueClear = undefined;\n\t\t\t\tthis.engineCallbackActive = false;\n\t\t\t\tthis.health.markCooperativeAbortSettled();\n\t\t\t},\n\t\t});\n\t\tthis.client.onEvent((event) => this.observeEvent(event));\n\t\tthis.client.onGenerationEnded((event) => {\n\t\t\tthis.retiredResourceGenerations.add(event.generation);\n\t\t\tif (event.generation === this.client.getGeneration()) this.updateResourceExtensions([]);\n\t\t\tthis.health.handleGenerationEnded(event);\n\t\t});\n\t\t// Production RpcClient instances expose engine lifecycle messages. Keep the\n\t\t// subscription optional so focused runtime test doubles that exercise only\n\t\t// session/model/bash behavior do not need to implement unrelated transport\n\t\t// surfaces.\n\t\tthis.client.onInteractiveEngineMessage?.((message) => {\n\t\t\tif (message.type !== \"engine_resources_ready\" && message.type !== \"engine_resources_failed\") return;\n\t\t\tconst observedGeneration = this.client.getGeneration();\n\t\t\tvoid this.waitUntilResourcesReady().catch((error: Error) => {\n\t\t\t\tconst generation =\n\t\t\t\t\terror instanceof InteractiveEngineResourceReadinessError ? error.generation : observedGeneration;\n\t\t\t\tif (this.reportedResourceFailureGenerations.has(generation)) return;\n\t\t\t\tthis.reportedResourceFailureGenerations.add(generation);\n\t\t\t\tthis.emitDiagnostic({\n\t\t\t\t\tactivity: undefined,\n\t\t\t\t\telapsedMs: 0,\n\t\t\t\t\tlevel: \"unresponsive\",\n\t\t\t\t\tmessage: error.message,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\n\toverride get session(): AgentSession {\n\t\tconst session = super.session;\n\t\tthis.patchSession(session);\n\t\treturn session;\n\t}\n\tasync openTaskInspector(taskId?: string): Promise<void> {\n\t\tawait this.client.requestInternal({ type: \"open_task_inspector\", ...(taskId ? { taskId } : {}) });\n\t}\n\t/** The engine owns extensions and tools; the host session has neither. */\n\tasync getToolStatus(): Promise<ToolStatusReport> {\n\t\treturn this.client.requestInternal<ToolStatusReport>({ type: \"get_tools\" });\n\t}\n\tasync initializeFromEngine(generation = this.client.getGeneration?.()): Promise<void> {\n\t\tconst run = this.initializationTail\n\t\t\t? this.initializationTail.then(() => this.initializeFromEngineGeneration(generation))\n\t\t\t: this.initializeFromEngineGeneration(generation);\n\t\tthis.initializationTail = run.catch(() => {});\n\t\treturn run;\n\t}\n\n\tprivate async settleEngineResync(): Promise<void> {\n\t\tawait this.initializationTail;\n\t}\n\n\tprivate async initializeFromEngineGeneration(generation: number | undefined): Promise<void> {\n\t\tif (this.disposed || (generation !== undefined && !this.isCurrentResourceGeneration(generation))) return;\n\t\ttry {\n\t\t\tthis.sessionStats.reset();\n\t\t\tconst state = await this.client.getState();\n\t\t\tconst catalog = await this.client.requestInternal<RpcModelCatalog>({\n\t\t\t\ttype: \"get_available_models\",\n\t\t\t\tallowPartialResources: true,\n\t\t\t});\n\t\t\tif (generation !== undefined && !this.isCurrentResourceGeneration(generation)) return;\n\t\t\tif (state.sessionFile && super.session.sessionManager.getSessionFile() !== state.sessionFile) {\n\t\t\t\tawait super.switchSession(state.sessionFile);\n\t\t\t\tif (generation !== undefined && !this.isCurrentResourceGeneration(generation)) return;\n\t\t\t}\n\t\t\tconst session = super.session;\n\t\t\tif (\n\t\t\t\tstate.projectTrusted !== undefined &&\n\t\t\t\tsession.settingsManager.isProjectTrusted() !== state.projectTrusted\n\t\t\t) {\n\t\t\t\t// The child owns trust hooks/decisions. The host only mirrors their result.\n\t\t\t\tsession.settingsManager.setProjectTrusted(state.projectTrusted);\n\t\t\t\tawait session.settingsManager.reload();\n\t\t\t\tawait session.resourceLoader.reload();\n\t\t\t\tif (generation !== undefined && !this.isCurrentResourceGeneration(generation)) return;\n\t\t\t}\n\t\t\tthis.remoteModelCatalog.apply(catalog);\n\t\t\tthis.remoteModelCatalog.patch(session);\n\t\t\t(session.agent.state as { model?: Model<Api> }).model = state.model;\n\t\t\tsession.agent.state.thinkingLevel = state.thinkingLevel;\n\t\t\tsession.agent.steeringMode = state.steeringMode;\n\t\t\tsession.agent.followUpMode = state.followUpMode;\n\t\t\tthis.autoCompactionEnabled = state.autoCompactionEnabled;\n\t\t\tthis.resourceOverlaps = state.resourceOverlaps ?? [];\n\t\t\tthis.updateResourceExtensions(state.resourceExtensions ?? []);\n\t\t\tthis.remoteSessionName = state.sessionName;\n\t\t\tthis.remoteSessionFile = state.sessionFile;\n\t\t\tthis.streaming = state.isStreaming;\n\t\t\tthis.compacting = state.isCompacting;\n\t\t\tthis.compactionReason = state.isCompacting ? state.compactionReason : undefined;\n\t\t\tthis.queuePause.synchronize(state.queuedMessagesPaused === true);\n\t\t\tthis.replaceModelFallback(state.modelFallbackMessage, state.modelFallbackReason);\n\t\t\tthis.refreshSessionView();\n\t\t\tthis.engineCallbackActive = false;\n\t\t\tthis.health.clearUnresponsive();\n\t\t\tthis.health.markCooperativeAbortSettled();\n\t\t\t// Non-blocking refresh so isolated autocomplete lists engine-only extension\n\t\t\t// commands after bind/restart/reload/new/resume/fork. See RemoteCommandCatalog.\n\t\t\tthis.remoteCommands.refresh();\n\t\t} catch (error) {\n\t\t\tif (this.disposed && isRpcTransportFailure(error)) return;\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\toverride async loginOAuthProvider(provider: string, callbacks: AtomicOAuthLoginCallbacks) {\n\t\treturn loginIsolatedOAuthProvider(super.session, this.client, this.remoteModelCatalog, provider, callbacks);\n\t}\n\n\toverride async loginApiKeyProvider(provider: string, interaction: AuthInteraction) {\n\t\treturn loginIsolatedApiKeyProvider(super.session, this.client, this.remoteModelCatalog, provider, interaction);\n\t}\n\n\toverride async logoutProvider(provider: string) {\n\t\tconst result = await this.client.logoutProvider(provider);\n\t\tthis.remoteModelCatalog.applyModels({ models: result.models, scopedModels: result.scopedModels ?? [] });\n\t\tawait super.session.modelRuntime.reloadCredentials({ refreshAvailability: false });\n\t\tsuper.session.modelRuntime.applyExternalProviderAuthStatus(provider, result.authStatus);\n\t\tsuper.session.refreshCurrentModelFromRegistry();\n\t\treturn result;\n\t}\n\n\tonDiagnostic(listener: EngineDiagnosticListener): () => void {\n\t\treturn this.health.onDiagnostic(listener);\n\t}\n\n\t/** Fires when fresh engine session stats arrive, so the host can repaint its footer. */\n\tonSessionStatsChanged(listener: () => void): () => void {\n\t\treturn this.sessionStats.onChange(listener);\n\t}\n\n\tonEngineMessage(listener: (message: InteractiveEngineMessage) => void): () => void {\n\t\treturn this.client.onInteractiveEngineMessage(listener);\n\t}\n\tonKeybindingState(listener: (state: EngineKeybindingState) => void): () => void {\n\t\treturn this.client.onInteractiveEngineKeybindingState(listener);\n\t}\n\n\tsendEngineCommand(command: InteractiveEngineCommand): void {\n\t\tthis.client.sendInteractiveEngineCommand(command);\n\t}\n\n\t/** Report a native host trust dialog to the extension runner in this engine generation. */\n\tasync withProjectTrustPrompt<T>(\n\t\tkind: \"select\" | \"confirm\" | \"input\",\n\t\ttitle: string,\n\t\trun: () => Promise<T>,\n\t): Promise<T> {\n\t\tconst generation = this.client.getGeneration();\n\t\tconst componentId = randomUUID();\n\t\tconst notify = (command: InteractiveEngineCommand) => {\n\t\t\tif (this.disposed || generation !== this.client.getGeneration()) return;\n\t\t\ttry {\n\t\t\t\tthis.sendEngineCommand(command);\n\t\t\t} catch {\n\t\t\t\t// Status notification failure must not prevent a host-owned trust decision.\n\t\t\t}\n\t\t};\n\t\tnotify({ type: \"engine_project_trust_start\", componentId, kind, title });\n\t\ttry {\n\t\t\treturn await run();\n\t\t} finally {\n\t\t\tnotify({ type: \"engine_project_trust_end\", componentId });\n\t\t}\n\t}\n\n\tgetRemoteCommands(): readonly RpcSlashCommand[] {\n\t\treturn this.remoteCommands.getCommands();\n\t}\n\tonRemoteCommandsChanged(listener: RemoteCommandsListener): () => void {\n\t\treturn this.remoteCommands.onChange(listener);\n\t}\n\tgetRemoteCommandCompletions(commandName: string, argumentPrefix: string): Promise<RpcAutocompleteItem[] | null> {\n\t\treturn this.client.getCommandCompletions(commandName, argumentPrefix);\n\t}\n\n\tasync invokeRemoteShortcut(key: string): Promise<void> {\n\t\tawait this.client.requestInternal<void>({ type: \"invoke_shortcut\", key });\n\t}\n\n\tasync waitUntilBound(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.client.waitForInteractiveEngineBound();\n\t\t} catch (error) {\n\t\t\tif (this.disposed && isRpcTransportFailure(error)) return;\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync waitUntilProjectTrustSettled(): Promise<void> {\n\t\tawait this.client.waitForInteractiveEngineProjectTrust();\n\t\tawait this.initializeFromEngine();\n\t}\n\tasync waitUntilResourcesReady(): Promise<void> {\n\t\twhile (true) {\n\t\t\tthis.throwIfUnavailable();\n\t\t\tconst generation = this.client.getGeneration();\n\t\t\tif (this.retiredResourceGenerations.has(generation)) {\n\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait this.client.waitForInteractiveEngineResources();\n\t\t\t} catch (error) {\n\t\t\t\tthis.throwIfUnavailable();\n\t\t\t\tif (!this.isCurrentResourceGeneration(generation)) {\n\t\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (isRpcTransportFailure(error)) throw error;\n\t\t\t\tthrow new InteractiveEngineResourceReadinessError(\n\t\t\t\t\tgeneration,\n\t\t\t\t\terror instanceof Error ? error : new Error(String(error)),\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!this.isCurrentResourceGeneration(generation)) {\n\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (this.resourcesInitializedGeneration === generation) return;\n\n\t\t\tlet initialization = this.resourceInitialization;\n\t\t\tif (initialization?.generation !== generation) {\n\t\t\t\tconst promise = this.initializeFromEngine(generation).finally(() => {\n\t\t\t\t\tif (this.resourceInitialization?.generation === generation) this.resourceInitialization = undefined;\n\t\t\t\t});\n\t\t\t\tinitialization = { generation, promise };\n\t\t\t\tthis.resourceInitialization = initialization;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait initialization.promise;\n\t\t\t} catch (error) {\n\t\t\t\tthis.throwIfUnavailable();\n\t\t\t\tif (!this.isCurrentResourceGeneration(generation)) {\n\t\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tthis.throwIfUnavailable();\n\t\t\tif (!this.isCurrentResourceGeneration(generation)) {\n\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.resourcesInitializedGeneration = generation;\n\t\t\treturn;\n\t\t}\n\t}\n\n\tprivate isCurrentResourceGeneration(generation: number): boolean {\n\t\treturn generation === this.client.getGeneration() && !this.retiredResourceGenerations.has(generation);\n\t}\n\n\tprivate async waitForReplacementGeneration(generation: number): Promise<void> {\n\t\twhile (generation === this.client.getGeneration()) {\n\t\t\tthis.throwIfUnavailable();\n\t\t\tawait sleep(1);\n\t\t}\n\t}\n\n\tprivate throwIfUnavailable(): void {\n\t\tif (this.disposed) throw rpcTransportError(\"Interactive engine runtime is disposed\");\n\t\tif (this.engineRecoveryFailure) throw this.engineRecoveryFailure;\n\t}\n\tgetEnginePid(): number | undefined {\n\t\treturn this.client.getEnginePid();\n\t}\n\tgetEngineGeneration(): number {\n\t\treturn this.client.getGeneration();\n\t}\n\tisRecovering(): boolean {\n\t\treturn this.health.isRecovering();\n\t}\n\t/** Subscribe to host-local engine generation death (see engine-generation.ts). */\n\tonGenerationEnded(listener: InteractiveEngineGenerationEndedListener): () => void {\n\t\treturn this.client.onGenerationEnded(listener);\n\t}\n\t/**\n\t * A heartbeat proves the child's event loop is turning again, so a stall the\n\t * watchdog already reported must stop arming the Ctrl+C escape hatch. Fed by a\n\t * dedicated client callback rather than a generic engine-message subscriber,\n\t * which would consume buffered startup custom-UI messages.\n\t */\n\tnoteEngineHeartbeat(): void {\n\t\tthis.health.clearUnresponsive();\n\t}\n\t/** True only when the engine is provably not answering (see EngineHealthController). */\n\tneedsExplicitTermination(): boolean {\n\t\treturn this.health.needsExplicitTermination();\n\t}\n\t/** Explicit user-driven engine termination and recovery (Ctrl+C escape hatch). */\n\tterminateAndRecover(): Promise<void> {\n\t\treturn this.health.terminate();\n\t}\n\tgetResourceOverlaps(): readonly ResourceOverlap[] {\n\t\treturn this.resourceOverlaps;\n\t}\n\tgetResourceExtensions(): readonly RpcResourceExtension[] {\n\t\treturn this.resourceExtensions;\n\t}\n\tonResourceExtensionsChanged(listener: ResourceExtensionsListener): () => void {\n\t\tthis.resourceExtensionsListeners.push(listener);\n\t\treturn () => {\n\t\t\tconst index = this.resourceExtensionsListeners.indexOf(listener);\n\t\t\tif (index !== -1) this.resourceExtensionsListeners.splice(index, 1);\n\t\t};\n\t}\n\tprivate updateResourceExtensions(extensions: readonly RpcResourceExtension[]): void {\n\t\tthis.resourceExtensions = [...extensions];\n\t\tfor (const listener of [...this.resourceExtensionsListeners]) listener(this.resourceExtensions);\n\t}\n\tasync synchronize(): Promise<void> {\n\t\tconst generation = this.client.getGeneration();\n\t\tconst state = await this.client.getState();\n\t\tif (!this.isCurrentResourceGeneration(generation)) return;\n\t\tthis.remoteSessionFile = state.sessionFile;\n\t\tthis.remoteSessionName = state.sessionName;\n\t\tthis.resourceOverlaps = state.resourceOverlaps ?? [];\n\t\tthis.updateResourceExtensions(state.resourceExtensions ?? []);\n\t}\n\n\tsetEngineCallbackActive(active: boolean): void {\n\t\tthis.engineCallbackActive = active;\n\t}\n\n\tinterruptBlockedCallback(): boolean {\n\t\tif (!this.engineCallbackActive) return false;\n\t\tthis.dispatchBestEffort(\"interrupt\", this.session.abort());\n\t\treturn true;\n\t}\n\n\tsetExtensionUIHandler(\n\t\thandler: (request: RpcExtensionUIRequest) => Promise<RpcExtensionUIResponse | undefined>,\n\t): () => void {\n\t\treturn this.client.onExtensionUIRequest((request) => {\n\t\t\tvoid handler(request)\n\t\t\t\t.then(async (response) => {\n\t\t\t\t\tif (response) await this.client.respondExtensionUI(response);\n\t\t\t\t})\n\t\t\t\t.catch((error: Error) => {\n\t\t\t\t\tthis.emitDiagnostic({\n\t\t\t\t\t\tactivity: undefined,\n\t\t\t\t\t\telapsedMs: 0,\n\t\t\t\t\t\tlevel: \"unresponsive\",\n\t\t\t\t\t\tmessage: `Interactive engine UI bridge failed: ${error.message}`,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t});\n\t}\n\n\temitDiagnostic(diagnostic: ActivityWatchdogDiagnostic): void {\n\t\tif (diagnostic.source !== \"stderr\") this.engineCallbackActive = true;\n\t\tthis.health.publish(diagnostic);\n\t}\n\n\toverride async switchSession(\n\t\tsessionPath: string,\n\t\toptions?: Parameters<AgentSessionRuntime[\"switchSession\"]>[1],\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst result = await this.client.switchSession(sessionPath, options?.cwdOverride);\n\t\tif (!result.cancelled) {\n\t\t\tawait super.switchSession(sessionPath, { cwdOverride: options?.cwdOverride });\n\t\t\tawait this.initializeFromEngine();\n\t\t\tif (options?.withSession) await options.withSession(this.session.createReplacedSessionContext());\n\t\t}\n\t\treturn result;\n\t}\n\n\toverride async newSession(options?: { parentSession?: string }): Promise<{ cancelled: boolean }> {\n\t\tconst result = await this.client.newSession(options?.parentSession);\n\t\tif (result.cancelled) return result;\n\t\tconst state = await this.client.getState();\n\t\tif (state.sessionFile) await super.switchSession(state.sessionFile);\n\t\telse this.resetUnpersistedSessionView();\n\t\tawait this.initializeFromEngine();\n\t\treturn result;\n\t}\n\n\toverride async importFromJsonl(inputPath: string, cwdOverride?: string): Promise<{ cancelled: boolean }> {\n\t\tconst result = await this.client.requestInternal<{ cancelled: boolean }>({\n\t\t\ttype: \"import_session\",\n\t\t\tinputPath,\n\t\t\tcwdOverride,\n\t\t});\n\t\tif (result.cancelled) return result;\n\t\tconst state = await this.client.getState();\n\t\tif (state.sessionFile) await super.switchSession(state.sessionFile);\n\t\tawait this.initializeFromEngine();\n\t\treturn result;\n\t}\n\n\toverride async fork(\n\t\tentryId: string,\n\t\toptions?: { position?: \"before\" | \"at\" },\n\t): Promise<{ cancelled: boolean; selectedText?: string }> {\n\t\tlet selectedText: string | undefined;\n\t\tlet cancelled: boolean;\n\t\tif (options?.position === \"at\") {\n\t\t\tcancelled = (await this.client.clone()).cancelled;\n\t\t} else {\n\t\t\tconst result = await this.client.fork(entryId);\n\t\t\tcancelled = result.cancelled;\n\t\t\tselectedText = result.text;\n\t\t}\n\t\tif (cancelled) return { cancelled: true };\n\t\tconst state = await this.client.getState();\n\t\tif (state.sessionFile) await super.switchSession(state.sessionFile);\n\t\tawait this.initializeFromEngine();\n\t\treturn { cancelled: false, selectedText };\n\t}\n\n\t/**\n\t * The child engine already settled (and persisted) its own turn before it\n\t * reported the replacement, and the host facade's `abort()` is `abortAndRecover()`\n\t * — an unbounded cooperative round trip. Re-entering it during teardown would\n\t * hang session replacement on an unresponsive or dead engine, which is exactly\n\t * what engine recovery exists to survive.\n\t */\n\tprotected override async settleActiveResponseBeforeTeardown(): Promise<void> {}\n\n\toverride dispose(options?: { fromSignal?: boolean }): Promise<void> {\n\t\tif (this.disposePromise) return this.disposePromise;\n\t\tthis.disposed = true;\n\t\tthis.disposePromise = (async () => {\n\t\t\t// A quit the user asked for must reach the engine before it is stopped: the stop\n\t\t\t// is a SIGTERM, which the engine cannot tell from this process being signalled.\n\t\t\t// Optional like the other transport surfaces focused test doubles omit.\n\t\t\tconst unrecordedQuit = !options?.fromSignal && (await this.client.announceExplicitQuit?.()) === false;\n\t\t\t// EngineHealthController owns the first client stop and joins recovery.\n\t\t\tawait this.health.shutdown();\n\t\t\t// A replacement may have spawned while shutdown joined recovery; the\n\t\t\t// idempotent trailing stop closes that child before disposal returns.\n\t\t\tawait this.client.stop();\n\t\t\tif (unrecordedQuit) {\n\t\t\t\t// No engine child recorded the quit, so none released Herdr's registration, and a replacement started\n\t\t\t\t// during recovery may have registered again. Every child is stopped now; this host loads no Herdr reporter.\n\t\t\t\tconst herdr = captureHerdrEnvironment(process.env);\n\t\t\t\tif (herdr) await releaseUnownedPaneRegistration(herdr);\n\t\t\t}\n\t\t\tawait super.dispose(options);\n\t\t})();\n\t\treturn this.disposePromise;\n\t}\n\n\tprivate patchSession(session: AgentSession): void {\n\t\tif (this.patchedSessions.has(session)) return;\n\t\tthis.patchedSessions.add(session);\n\t\tthis.patchSessionManager(session.sessionManager);\n\t\tthis.sessionStats.track(session);\n\t\tObject.defineProperties(session, {\n\t\t\tisStreaming: { configurable: true, get: () => this.streaming },\n\t\t\tisCompacting: { configurable: true, get: () => this.compacting },\n\t\t\tcompactionReason: { configurable: true, get: () => this.compactionReason },\n\t\t\tisBashRunning: { configurable: true, get: () => this.activeBashRequestIds.size > 0 },\n\t\t\tsessionName: { configurable: true, get: () => this.remoteSessionName },\n\t\t\tsessionFile: { configurable: true, get: () => this.remoteSessionFile },\n\t\t\tautoCompactionEnabled: { configurable: true, get: () => this.autoCompactionEnabled },\n\t\t\tautoRetryEnabled: { configurable: true, get: () => this.autoRetryEnabled },\n\t\t\tqueuedMessagesPaused: { configurable: true, get: () => this.queuePause.isPaused },\n\t\t\tsubscribe: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (listener: (event: JsonAgentSessionEvent) => void) => this.client.onEvent(listener),\n\t\t\t},\n\t\t\tprompt: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (text: string, options?: PromptOptions) => {\n\t\t\t\t\tconst cancellationEpoch = this.promptCancellationEpoch;\n\t\t\t\t\tawait this.waitUntilResourcesReady();\n\t\t\t\t\tif (cancellationEpoch !== this.promptCancellationEpoch) return;\n\t\t\t\t\tconst disposition = await this.client.prompt(text, options?.images, options?.streamingBehavior);\n\t\t\t\t\toptions?.preflightResult?.(true, disposition);\n\t\t\t\t},\n\t\t\t},\n\t\t\tsteer: { configurable: true, value: (text: string) => this.client.steer(text) },\n\t\t\tfollowUp: { configurable: true, value: (text: string) => this.client.followUp(text) },\n\t\t\tabort: { configurable: true, value: () => this.abortAndRecover() },\n\t\t\texecuteBash: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (\n\t\t\t\t\tcommand: string,\n\t\t\t\t\tonChunk?: Parameters<AgentSession[\"executeBash\"]>[1],\n\t\t\t\t\toptions?: Parameters<AgentSession[\"executeBash\"]>[2],\n\t\t\t\t) => {\n\t\t\t\t\tconst key = options?.id ?? Symbol(\"isolated-bash-request\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn await this.client.userBashWithUpdates(command, (delta, channel) => onChunk?.(delta, channel), {\n\t\t\t\t\t\t\texcludeFromContext: options?.excludeFromContext,\n\t\t\t\t\t\t\tonRequestId: (requestId) => this.activeBashRequestIds.set(key, requestId),\n\t\t\t\t\t\t});\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tthis.activeBashRequestIds.delete(key);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\trecordBashResult: { configurable: true, value: () => {} },\n\t\t\tabortBash: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (id?: string) => {\n\t\t\t\t\tif (id === undefined) this.dispatchBestEffort(\"abort bash\", this.client.abortBash());\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst requestId = this.activeBashRequestIds.get(id);\n\t\t\t\t\t\tif (requestId) this.dispatchBestEffort(\"abort bash\", this.client.abortBash(requestId));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\tcompact: { configurable: true, value: () => this.client.compact() },\n\t\t\tabortCompaction: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: () =>\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"abort compaction\",\n\t\t\t\t\t\tthis.client.requestInternal<void>({ type: \"abort_compaction\" }),\n\t\t\t\t\t),\n\t\t\t},\n\t\t\tabortRetry: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: () => {\n\t\t\t\t\tconst retry = this.client.abortRetry?.();\n\t\t\t\t\tif (retry !== undefined) {\n\t\t\t\t\t\tthis.dispatchBestEffort(\"abort retry\", retry);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof this.client.requestInternal === \"function\") {\n\t\t\t\t\t\tthis.dispatchBestEffort(\"abort retry\", this.client.requestInternal<void>({ type: \"abort_retry\" }));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\tnavigateTree: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (targetId: string, options?: Parameters<AgentSession[\"navigateTree\"]>[1]) => {\n\t\t\t\t\tconst result = await this.client.requestInternal<Awaited<ReturnType<AgentSession[\"navigateTree\"]>>>({\n\t\t\t\t\t\ttype: \"navigate_tree\",\n\t\t\t\t\t\ttargetId,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.cancelled && !result.aborted) {\n\t\t\t\t\t\tthis.sessionStats.reset();\n\t\t\t\t\t\tthis.sessionStats.refresh();\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t},\n\t\t\t},\n\t\t\treload: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async () => {\n\t\t\t\t\tawait this.client.requestInternal<void>({ type: \"reload\" });\n\t\t\t\t\tawait this.initializeFromEngine();\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetSessionName: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (name: string) => {\n\t\t\t\t\tthis.remoteSessionName = name;\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"set session name\",\n\t\t\t\t\t\tthis.client.setSessionName(name).then(() => this.refreshSessionView()),\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t},\n\t\t\tgetSteeringMessages: { configurable: true, value: () => [...this.steeringMessages] },\n\t\t\tgetFollowUpMessages: { configurable: true, value: () => [...this.followUpMessages] },\n\t\t\tclearQueue: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: () => {\n\t\t\t\t\tconst queued: QueueSnapshot = {\n\t\t\t\t\t\tsteering: [...this.steeringMessages],\n\t\t\t\t\t\tfollowUp: [...this.followUpMessages],\n\t\t\t\t\t};\n\t\t\t\t\tconst pendingClear = this.pendingQueueClear ?? {\n\t\t\t\t\t\tsnapshot: queued,\n\t\t\t\t\t\tqueueUpdateGeneration: this.queueUpdateGeneration,\n\t\t\t\t\t\tcount: 0,\n\t\t\t\t\t\tsucceeded: false,\n\t\t\t\t\t};\n\t\t\t\t\tthis.pendingQueueClear = pendingClear;\n\t\t\t\t\tpendingClear.count += 1;\n\t\t\t\t\tthis.steeringMessages = [];\n\t\t\t\t\tthis.followUpMessages = [];\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"clear queue\",\n\t\t\t\t\t\tthis.client.requestInternal({ type: \"clear_queue\" }).then(\n\t\t\t\t\t\t\t() => this.settleQueueClear(pendingClear, true),\n\t\t\t\t\t\t\t(error: Error) => {\n\t\t\t\t\t\t\t\tthis.settleQueueClear(pendingClear, false);\n\t\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn queued;\n\t\t\t\t},\n\t\t\t},\n\t\t\tpauseQueuedMessages: { configurable: true, value: () => this.queuePause.pause() },\n\t\t\tresumeQueuedMessages: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (beforeRelease?: () => void) => this.queuePause.resume(beforeRelease),\n\t\t\t},\n\t\t\tsetModel: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (model: Model<Api>, options?: ModelMutationOptions) => {\n\t\t\t\t\tawait this.settleEngineResync();\n\t\t\t\t\tconst selected = await this.client.setModel(model.provider, model.id, options);\n\t\t\t\t\tconst nextModel = session.modelRuntime.getModel(selected.provider, selected.id) ?? model;\n\t\t\t\t\tsession.agent.state.model = nextModel;\n\t\t\t\t\tthis.resolveModelFallback();\n\t\t\t\t\tif (options?.persist === true) await this.syncPersistedModelCatalog(session, nextModel);\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetThinkingLevel: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (level: AgentSession[\"thinkingLevel\"], options?: ModelMutationOptions) => {\n\t\t\t\t\tconst availableLevels = session.getAvailableThinkingLevels();\n\t\t\t\t\tconst effectiveLevel = availableLevels.includes(level)\n\t\t\t\t\t\t? level\n\t\t\t\t\t\t: session.model\n\t\t\t\t\t\t\t? clampThinkingLevel(session.model, level)\n\t\t\t\t\t\t\t: \"off\";\n\t\t\t\t\tsession.agent.state.thinkingLevel = effectiveLevel;\n\t\t\t\t\tconst epoch = ++this.thinkingEpoch;\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"set thinking level\",\n\t\t\t\t\t\tthis.client.setThinkingLevelAck(level, options).then((result) => {\n\t\t\t\t\t\t\tthis.applyThinkingAck(session, epoch, result, options?.persist === true);\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t},\n\t\t\tcycleModel: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (direction?: \"forward\" | \"backward\", options?: ModelMutationOptions) => {\n\t\t\t\t\tawait this.settleEngineResync();\n\t\t\t\t\tconst previousModel = session.model;\n\t\t\t\t\tconst result = await this.client.cycleModel(direction, options);\n\t\t\t\t\tif (!result) return undefined;\n\t\t\t\t\tconst model = session.modelRuntime.getModel(result.model.provider, result.model.id) ?? result.model;\n\t\t\t\t\tsession.agent.state.model = model;\n\t\t\t\t\tsession.agent.state.thinkingLevel = result.thinkingLevel;\n\t\t\t\t\tthis.resolveModelFallbackAfterExplicitModelSelection(previousModel, model);\n\t\t\t\t\tif (options?.persist === true) await this.syncPersistedModelCatalog(session, model);\n\t\t\t\t\treturn { ...result, model };\n\t\t\t\t},\n\t\t\t},\n\t\t\tcycleThinkingLevel: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (options?: ModelMutationOptions) => {\n\t\t\t\t\tconst levels = session.getAvailableThinkingLevels();\n\t\t\t\t\tif (levels.length <= 1) return undefined;\n\t\t\t\t\tconst current = levels.indexOf(session.thinkingLevel);\n\t\t\t\t\tconst level = levels[(current + 1) % levels.length]!;\n\t\t\t\t\tsession.agent.state.thinkingLevel = level;\n\t\t\t\t\tconst epoch = ++this.thinkingEpoch;\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"cycle thinking level\",\n\t\t\t\t\t\tthis.client.setThinkingLevelAck(level, options).then((result) => {\n\t\t\t\t\t\t\tthis.applyThinkingAck(session, epoch, result, options?.persist === true);\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\treturn level;\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetSteeringMode: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (mode: \"all\" | \"one-at-a-time\") => {\n\t\t\t\t\tsession.agent.steeringMode = mode;\n\t\t\t\t\tthis.dispatchBestEffort(\"set steering mode\", this.client.setSteeringMode(mode));\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetFollowUpMode: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (mode: \"all\" | \"one-at-a-time\") => {\n\t\t\t\t\tsession.agent.followUpMode = mode;\n\t\t\t\t\tthis.dispatchBestEffort(\"set follow-up mode\", this.client.setFollowUpMode(mode));\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetAutoCompactionEnabled: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (enabled: boolean) => {\n\t\t\t\t\tthis.autoCompactionEnabled = enabled;\n\t\t\t\t\tthis.dispatchBestEffort(\"set auto compaction\", this.client.setAutoCompaction(enabled));\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetAutoRetryEnabled: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (enabled: boolean) => {\n\t\t\t\t\tthis.autoRetryEnabled = enabled;\n\t\t\t\t\tthis.dispatchBestEffort(\"set auto retry\", this.client.setAutoRetry(enabled));\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Cooperative interrupt. Requests the engine's own abort and waits for it —\n\t * no timeout, no termination, no restart. A genuinely wedged engine is the\n\t * user's call to terminate with Ctrl+C (see terminateAndRecover), never an\n\t * automatic consequence of pressing Escape.\n\t */\n\tprivate async abortAndRecover(): Promise<void> {\n\t\tthis.promptCancellationEpoch += 1;\n\t\tawait this.queuePause.settleBeforeAbort();\n\t\tthis.health.markCooperativeAbortStarted();\n\t\ttry {\n\t\t\tawait this.client.abort();\n\t\t} finally {\n\t\t\tthis.health.markCooperativeAbortSettled();\n\t\t\tthis.engineCallbackActive = false;\n\t\t}\n\t}\n\n\tprivate applyThinkingAck(\n\t\tsession: AgentSession,\n\t\tepoch: number,\n\t\tresult: { level: AgentSession[\"thinkingLevel\"]; provider?: string; modelId?: string },\n\t\tpersist: boolean,\n\t): void {\n\t\tif (persist) {\n\t\t\tapplyPersistedThinkingDefault(session, result.level, thinkingPersistTarget(result));\n\t\t}\n\t\tif (epoch === this.thinkingEpoch) {\n\t\t\tsession.agent.state.thinkingLevel = result.level;\n\t\t}\n\t}\n\n\tprivate dispatchBestEffort(label: string, operation: Promise<unknown>): void {\n\t\tvoid operation.catch((error: Error) => {\n\t\t\tif (this.health.isRecovering()) return;\n\t\t\tthis.emitDiagnostic({\n\t\t\t\tactivity: undefined,\n\t\t\t\telapsedMs: 0,\n\t\t\t\tlevel: \"unresponsive\",\n\t\t\t\tmessage: `Interactive engine ${label} failed: ${error.message}`,\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate settleQueueClear(pendingClear: PendingQueueClear, succeeded: boolean): void {\n\t\tif (this.pendingQueueClear !== pendingClear) return;\n\n\t\tpendingClear.count -= 1;\n\t\tpendingClear.succeeded ||= succeeded;\n\t\tif (pendingClear.count > 0) return;\n\n\t\tthis.pendingQueueClear = undefined;\n\t\tif (pendingClear.succeeded || this.queueUpdateGeneration !== pendingClear.queueUpdateGeneration) return;\n\n\t\tthis.steeringMessages = [...pendingClear.snapshot.steering];\n\t\tthis.followUpMessages = [...pendingClear.snapshot.followUp];\n\t}\n\n\tprivate resetUnpersistedSessionView(): void {\n\t\tconst session = super.session;\n\t\tconst manager = SessionManager.create(session.sessionManager.getCwd(), session.sessionManager.getSessionDir());\n\t\tObject.defineProperty(session, \"sessionManager\", { configurable: true, value: manager });\n\t\tthis.patchSessionManager(manager);\n\t\tsession.agent.state.messages = [];\n\t}\n\n\tprivate patchSessionManager(manager: SessionManager): void {\n\t\tObject.defineProperty(manager, \"appendLabelChange\", {\n\t\t\tconfigurable: true,\n\t\t\tvalue: (entryId: string, label?: string) => {\n\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\"set label\",\n\t\t\t\t\tthis.client\n\t\t\t\t\t\t.requestInternal<void>({ type: \"set_label\", entryId, label })\n\t\t\t\t\t\t.then(() => this.refreshSessionView()),\n\t\t\t\t);\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate async syncPersistedModelCatalog(session: AgentSession, model: Model<Api>): Promise<void> {\n\t\tconst alreadyInScope = session.scopedModels.some(\n\t\t\t(scoped) => scoped.model.provider === model.provider && scoped.model.id === model.id,\n\t\t);\n\t\tconst catalog = await this.client.requestInternal<RpcModelCatalog>({ type: \"get_available_models\" });\n\t\tthis.remoteModelCatalog.apply(catalog);\n\t\tapplyPersistedModelDefault(session, model, alreadyInScope);\n\t\tconst state = await this.client.getState();\n\t\tif (state.model?.provider === model.provider && state.model.id === model.id) {\n\t\t\tapplyPersistedThinkingDefault(session, state.thinkingLevel, { provider: model.provider, modelId: model.id });\n\t\t}\n\t}\n\n\tprivate refreshSessionView(): void {\n\t\tconst session = super.session;\n\t\tconst sessionFile = session.sessionFile;\n\t\tif (!sessionFile) return;\n\t\tconst currentManager = session.sessionManager;\n\t\tconst refreshed = SessionManager.open(sessionFile, currentManager.getSessionDir(), currentManager.getCwd());\n\t\tObject.defineProperty(session, \"sessionManager\", { configurable: true, value: refreshed });\n\t\tthis.patchSessionManager(refreshed);\n\t\tsession.agent.state.messages = refreshed.buildSessionContext().messages;\n\t}\n\n\tprivate observeEvent(event: RpcEvent): void {\n\t\tconst session = super.session;\n\t\tswitch (event.type) {\n\t\t\tcase \"agent_start\":\n\t\t\t\tthis.streaming = true;\n\t\t\t\tbreak;\n\t\t\tcase \"agent_end\":\n\t\t\t\tthis.streaming = false;\n\t\t\t\tthis.refreshSessionView();\n\t\t\t\tbreak;\n\t\t\tcase \"compaction_start\":\n\t\t\t\tthis.compacting = true;\n\t\t\t\tthis.compactionReason = event.reason;\n\t\t\t\tbreak;\n\t\t\tcase \"compaction_end\":\n\t\t\t\tthis.compacting = false;\n\t\t\t\tthis.compactionReason = undefined;\n\t\t\t\tif (!event.aborted && event.errorMessage === undefined) this.sessionStats.refresh();\n\t\t\t\tbreak;\n\t\t\tcase \"message_end\":\n\t\t\t\tthis.sessionStats.refresh();\n\t\t\t\tbreak;\n\t\t\tcase \"queue_update\":\n\t\t\t\tthis.queueUpdateGeneration += 1;\n\t\t\t\tthis.pendingQueueClear = undefined;\n\t\t\t\tthis.steeringMessages = [...event.steering];\n\t\t\t\tthis.followUpMessages = [...event.followUp];\n\t\t\t\tbreak;\n\t\t\tcase \"model_changed\":\n\t\t\t\tsession.agent.state.model = event.model;\n\t\t\t\tthis.sessionStats.refresh();\n\t\t\t\tbreak;\n\t\t\tcase \"thinking_level_changed\":\n\t\t\t\tthis.thinkingEpoch += 1;\n\t\t\t\tsession.agent.state.thinkingLevel = event.level;\n\t\t\t\tbreak;\n\t\t\tcase \"session_info_changed\":\n\t\t\t\tthis.remoteSessionName = event.name;\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"isolated-runtime.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/isolated-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAY,kBAAkB,EAAc,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAyC,MAAM,qCAAqC,CAAC;AAIjH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAYlH,OAAO,EAAiC,sBAAsB,EAAE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BAAsB;gBAC1B,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC;gBACpC,MAAM;QACR,CAAC;IACF,CAAC;CACD","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport type { AuthInteraction } from \"@bastani/pi-ai\";\nimport { type Api, clampThinkingLevel, type Model } from \"@bastani/pi-ai/compat\";\nimport type { AgentSession, CompactionReason } from \"../../core/agent-session.js\";\nimport { AgentSessionRuntime, type CreateAgentSessionRuntimeFactory } from \"../../core/agent-session-runtime.ts\";\nimport type { ModelMutationOptions, PromptOptions } from \"../../core/agent-session-types.js\";\nimport type { ResourceOverlap } from \"../../core/diagnostics.ts\";\nimport type { WorkflowActivityFrame } from \"../../core/extensions/workflow-events.js\";\nimport { SessionManager } from \"../../core/session-manager.ts\";\nimport type { ToolStatusReport } from \"../../core/tool-status.js\";\nimport { captureHerdrEnvironment } from \"../../extensions/herdr/environment.js\";\nimport { releaseUnownedPaneRegistration } from \"../../extensions/herdr/pane-owner.js\";\nimport { sleep } from \"../../utils/sleep.ts\";\nimport type { JsonAgentSessionEvent } from \"../json-event.ts\";\nimport type { RpcClient } from \"../rpc/rpc-client.ts\";\nimport { isRpcTransportFailure, markRpcTransportFailure, rpcTransportError } from \"../rpc/rpc-transport-error.ts\";\nimport type {\n\tRpcAutocompleteItem,\n\tRpcEvent,\n\tRpcExtensionUIRequest,\n\tRpcExtensionUIResponse,\n\tRpcModelCatalog,\n\tRpcResourceExtension,\n\tRpcSlashCommand,\n} from \"../rpc/rpc-types.ts\";\nimport type { ActivityWatchdogDiagnostic } from \"./activity-watchdog.ts\";\nimport type { InteractiveEngineGenerationEndedListener } from \"./engine-generation.ts\";\nimport { type EngineDiagnosticListener, EngineHealthController } from \"./engine-health.ts\";\nimport { EngineSessionStats } from \"./engine-session-stats.js\";\nimport {\n\ttype AtomicOAuthLoginCallbacks,\n\tloginIsolatedApiKeyProvider,\n\tloginIsolatedOAuthProvider,\n} from \"./isolated-auth.ts\";\nimport type { EngineKeybindingState, InteractiveEngineCommand, InteractiveEngineMessage } from \"./protocol.ts\";\nimport { RemoteCommandCatalog, type RemoteCommandsListener } from \"./remote-command-catalog.ts\";\nimport { RemoteModelCatalog } from \"./remote-model-catalog.ts\";\nimport { RemoteQueuePause } from \"./remote-queue-pause.js\";\nimport { InteractiveEngineResourceReadinessError } from \"./resource-readiness-error.ts\";\n\ntype ResourceExtensionsListener = (extensions: readonly RpcResourceExtension[]) => void;\ntype QueueSnapshot = { steering: string[]; followUp: string[] };\n\nfunction applyPersistedModelDefault(session: AgentSession, model: Model<Api>, alreadyInScope: boolean): void {\n\tsession.settingsManager.setDefaultModelAndProvider(model.provider, model.id);\n\tif (alreadyInScope || session.scopedModels.length === 0) return;\n\tconst enabledModels = session.settingsManager.getEnabledModels();\n\tif (!enabledModels?.length) return;\n\tconst modelReference = `${model.provider}/${model.id}`;\n\tif (enabledModels.some((pattern) => pattern.toLowerCase() === modelReference.toLowerCase())) return;\n\tsession.settingsManager.setEnabledModels([...enabledModels, modelReference]);\n}\n\nfunction thinkingPersistTarget(result: {\n\tprovider?: string;\n\tmodelId?: string;\n}): { provider: string; modelId: string } | undefined {\n\tif (!result.provider || !result.modelId) return undefined;\n\treturn { provider: result.provider, modelId: result.modelId };\n}\n\nfunction applyPersistedThinkingDefault(\n\tsession: AgentSession,\n\tlevel: AgentSession[\"thinkingLevel\"],\n\ttarget?: { provider: string; modelId: string },\n): void {\n\tif (target) {\n\t\tsession.settingsManager.setModelThinkingLevel(target.provider, target.modelId, level);\n\t}\n\tsession.settingsManager.setDefaultThinkingLevel(level);\n}\n\ntype PendingQueueClear = {\n\tsnapshot: QueueSnapshot;\n\tqueueUpdateGeneration: number;\n\tcount: number;\n\tsucceeded: boolean;\n};\n\n/**\n * Owns Atomic's local interactive host facade and child-process engine.\n *\n * This runtime is deliberately not a RemoteSession adapter. Its JSONL RPC,\n * rendering, custom UI, and recovery lifecycle stay separate from pi-client's\n * protocol lease lifecycle.\n */\nexport class IsolatedInteractiveRuntime extends AgentSessionRuntime {\n\tprivate readonly client: RpcClient;\n\tprivate readonly patchedSessions = new WeakSet<AgentSession>();\n\tprivate streaming = false;\n\tprivate compacting = false;\n\tprivate compactionReason: CompactionReason | undefined;\n\tprivate readonly activeBashRequestIds = new Map<string | symbol, string>();\n\tprivate steeringMessages: string[] = [];\n\tprivate followUpMessages: string[] = [];\n\t/** Bumped by every authoritative queue_update. */\n\tprivate queueUpdateGeneration = 0;\n\t/** Bumped by local thinking mutations and thinking_level_changed events. */\n\tprivate thinkingEpoch = 0;\n\t/** Clears started before the next queue_update share one rollback snapshot. */\n\tprivate pendingQueueClear: PendingQueueClear | undefined;\n\tprivate engineCallbackActive = false;\n\tprivate readonly queuePause: RemoteQueuePause;\n\tprivate readonly sessionStats: EngineSessionStats;\n\tprivate autoCompactionEnabled = true;\n\tprivate autoRetryEnabled = true;\n\tprivate remoteSessionName: string | undefined;\n\tprivate remoteSessionFile: string | undefined;\n\tprivate readonly health: EngineHealthController;\n\tprivate readonly remoteCommands: RemoteCommandCatalog;\n\tprivate disposed = false;\n\tprivate disposePromise: Promise<void> | undefined;\n\tprivate readonly remoteModelCatalog: RemoteModelCatalog;\n\tprivate resourceOverlaps: ResourceOverlap[] = [];\n\tprivate readonly resourceExtensionsListeners: ResourceExtensionsListener[] = [];\n\tprivate resourceExtensions: RpcResourceExtension[] = [];\n\tprivate resourcesInitializedGeneration = 0;\n\tprivate resourceInitialization: { generation: number; promise: Promise<void> } | undefined;\n\tprivate readonly retiredResourceGenerations = new Set<number>();\n\tprivate readonly reportedResourceFailureGenerations = new Set<number>();\n\tprivate initializationTail: Promise<void> | undefined;\n\tprivate engineRecoveryFailure: Error | undefined;\n\tprivate promptCancellationEpoch = 0;\n\n\tconstructor(localRuntime: AgentSessionRuntime, createRuntime: CreateAgentSessionRuntimeFactory, client: RpcClient) {\n\t\tsuper(\n\t\t\tlocalRuntime.session,\n\t\t\tlocalRuntime.services,\n\t\t\tcreateRuntime,\n\t\t\t[...localRuntime.diagnostics],\n\t\t\tlocalRuntime.modelFallbackMessage,\n\t\t\tlocalRuntime.modelFallbackReason,\n\t\t);\n\t\tthis.client = client;\n\t\tthis.remoteCommands = new RemoteCommandCatalog(client);\n\t\tthis.remoteModelCatalog = new RemoteModelCatalog(client);\n\t\tthis.queuePause = new RemoteQueuePause(client);\n\t\tthis.sessionStats = new EngineSessionStats(client);\n\t\tthis.health = new EngineHealthController({\n\t\t\tstop: () => this.client.stop(),\n\t\t\trestart: async () => {\n\t\t\t\tthis.engineRecoveryFailure = undefined;\n\t\t\t\ttry {\n\t\t\t\t\tawait this.client.restart(this.remoteSessionFile);\n\t\t\t\t\tawait this.initializeFromEngine();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst failure = markRpcTransportFailure(error);\n\t\t\t\t\tthis.engineRecoveryFailure = failure;\n\t\t\t\t\tthrow failure;\n\t\t\t\t}\n\t\t\t},\n\t\t\tclearActivity: () => {\n\t\t\t\tthis.streaming = false;\n\t\t\t\tthis.compacting = false;\n\t\t\t\tthis.compactionReason = undefined;\n\t\t\t\tthis.pendingQueueClear = undefined;\n\t\t\t\tthis.engineCallbackActive = false;\n\t\t\t\tthis.health.markCooperativeAbortSettled();\n\t\t\t},\n\t\t});\n\t\tthis.client.onEvent((event) => this.observeEvent(event));\n\t\tthis.client.onGenerationEnded((event) => {\n\t\t\tthis.retiredResourceGenerations.add(event.generation);\n\t\t\tif (event.generation === this.client.getGeneration()) this.updateResourceExtensions([]);\n\t\t\tthis.health.handleGenerationEnded(event);\n\t\t});\n\t\t// Production RpcClient instances expose engine lifecycle messages. Keep the\n\t\t// subscription optional so focused runtime test doubles that exercise only\n\t\t// session/model/bash behavior do not need to implement unrelated transport\n\t\t// surfaces.\n\t\tthis.client.onInteractiveEngineMessage?.((message) => {\n\t\t\tif (message.type !== \"engine_resources_ready\" && message.type !== \"engine_resources_failed\") return;\n\t\t\tconst observedGeneration = this.client.getGeneration();\n\t\t\tvoid this.waitUntilResourcesReady().catch((error: Error) => {\n\t\t\t\tconst generation =\n\t\t\t\t\terror instanceof InteractiveEngineResourceReadinessError ? error.generation : observedGeneration;\n\t\t\t\tif (this.reportedResourceFailureGenerations.has(generation)) return;\n\t\t\t\tthis.reportedResourceFailureGenerations.add(generation);\n\t\t\t\tthis.emitDiagnostic({\n\t\t\t\t\tactivity: undefined,\n\t\t\t\t\telapsedMs: 0,\n\t\t\t\t\tlevel: \"unresponsive\",\n\t\t\t\t\tmessage: error.message,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\n\toverride get session(): AgentSession {\n\t\tconst session = super.session;\n\t\tthis.patchSession(session);\n\t\treturn session;\n\t}\n\tasync openTaskInspector(taskId?: string): Promise<void> {\n\t\tawait this.client.requestInternal({ type: \"open_task_inspector\", ...(taskId ? { taskId } : {}) });\n\t}\n\t/** The engine owns extensions and tools; the host session has neither. */\n\tasync getToolStatus(): Promise<ToolStatusReport> {\n\t\treturn this.client.requestInternal<ToolStatusReport>({ type: \"get_tools\" });\n\t}\n\tasync initializeFromEngine(generation = this.client.getGeneration?.()): Promise<void> {\n\t\tconst run = this.initializationTail\n\t\t\t? this.initializationTail.then(() => this.initializeFromEngineGeneration(generation))\n\t\t\t: this.initializeFromEngineGeneration(generation);\n\t\tthis.initializationTail = run.catch(() => {});\n\t\treturn run;\n\t}\n\n\tprivate async settleEngineResync(): Promise<void> {\n\t\tawait this.initializationTail;\n\t}\n\n\tprivate async initializeFromEngineGeneration(generation: number | undefined): Promise<void> {\n\t\tif (this.disposed || (generation !== undefined && !this.isCurrentResourceGeneration(generation))) return;\n\t\ttry {\n\t\t\tthis.sessionStats.reset();\n\t\t\tconst state = await this.client.getState();\n\t\t\tconst catalog = await this.client.requestInternal<RpcModelCatalog>({\n\t\t\t\ttype: \"get_available_models\",\n\t\t\t\tallowPartialResources: true,\n\t\t\t});\n\t\t\tif (generation !== undefined && !this.isCurrentResourceGeneration(generation)) return;\n\t\t\tif (state.sessionFile && super.session.sessionManager.getSessionFile() !== state.sessionFile) {\n\t\t\t\tawait super.switchSession(state.sessionFile);\n\t\t\t\tif (generation !== undefined && !this.isCurrentResourceGeneration(generation)) return;\n\t\t\t}\n\t\t\tconst session = super.session;\n\t\t\tif (\n\t\t\t\tstate.projectTrusted !== undefined &&\n\t\t\t\tsession.settingsManager.isProjectTrusted() !== state.projectTrusted\n\t\t\t) {\n\t\t\t\t// The child owns trust hooks/decisions. The host only mirrors their result.\n\t\t\t\tsession.settingsManager.setProjectTrusted(state.projectTrusted);\n\t\t\t\tawait session.settingsManager.reload();\n\t\t\t\tawait session.resourceLoader.reload();\n\t\t\t\tif (generation !== undefined && !this.isCurrentResourceGeneration(generation)) return;\n\t\t\t}\n\t\t\tthis.remoteModelCatalog.apply(catalog);\n\t\t\tthis.remoteModelCatalog.patch(session);\n\t\t\t(session.agent.state as { model?: Model<Api> }).model = state.model;\n\t\t\tsession.agent.state.thinkingLevel = state.thinkingLevel;\n\t\t\tsession.agent.steeringMode = state.steeringMode;\n\t\t\tsession.agent.followUpMode = state.followUpMode;\n\t\t\tthis.autoCompactionEnabled = state.autoCompactionEnabled;\n\t\t\tthis.resourceOverlaps = state.resourceOverlaps ?? [];\n\t\t\tthis.updateResourceExtensions(state.resourceExtensions ?? []);\n\t\t\tthis.remoteSessionName = state.sessionName;\n\t\t\tthis.remoteSessionFile = state.sessionFile;\n\t\t\tthis.streaming = state.isStreaming;\n\t\t\tthis.compacting = state.isCompacting;\n\t\t\tthis.compactionReason = state.isCompacting ? state.compactionReason : undefined;\n\t\t\tthis.queuePause.synchronize(state.queuedMessagesPaused === true);\n\t\t\tthis.replaceModelFallback(state.modelFallbackMessage, state.modelFallbackReason);\n\t\t\tthis.refreshSessionView();\n\t\t\tthis.engineCallbackActive = false;\n\t\t\tthis.health.clearUnresponsive();\n\t\t\tthis.health.markCooperativeAbortSettled();\n\t\t\t// Non-blocking refresh so isolated autocomplete lists engine-only extension\n\t\t\t// commands after bind/restart/reload/new/resume/fork. See RemoteCommandCatalog.\n\t\t\tthis.remoteCommands.refresh();\n\t\t} catch (error) {\n\t\t\tif (this.disposed && isRpcTransportFailure(error)) return;\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\toverride async loginOAuthProvider(provider: string, callbacks: AtomicOAuthLoginCallbacks) {\n\t\treturn loginIsolatedOAuthProvider(super.session, this.client, this.remoteModelCatalog, provider, callbacks);\n\t}\n\n\toverride async loginApiKeyProvider(provider: string, interaction: AuthInteraction) {\n\t\treturn loginIsolatedApiKeyProvider(super.session, this.client, this.remoteModelCatalog, provider, interaction);\n\t}\n\n\toverride async logoutProvider(provider: string) {\n\t\tconst result = await this.client.logoutProvider(provider);\n\t\tthis.remoteModelCatalog.applyModels({ models: result.models, scopedModels: result.scopedModels ?? [] });\n\t\tawait super.session.modelRuntime.reloadCredentials({ refreshAvailability: false });\n\t\tsuper.session.modelRuntime.applyExternalProviderAuthStatus(provider, result.authStatus);\n\t\tsuper.session.refreshCurrentModelFromRegistry();\n\t\treturn result;\n\t}\n\n\tonDiagnostic(listener: EngineDiagnosticListener): () => void {\n\t\treturn this.health.onDiagnostic(listener);\n\t}\n\n\t/** Fires when fresh engine session stats arrive, so the host can repaint its footer. */\n\tonSessionStatsChanged(listener: () => void): () => void {\n\t\treturn this.sessionStats.onChange(listener);\n\t}\n\n\tonEngineMessage(listener: (message: InteractiveEngineMessage) => void): () => void {\n\t\treturn this.client.onInteractiveEngineMessage(listener);\n\t}\n\t/** Workflow activity of the engine child, starting from its current snapshot. */\n\tonWorkflowActivity(listener: (frame: WorkflowActivityFrame) => void): () => void {\n\t\treturn this.client.onInteractiveEngineWorkflowActivity(listener);\n\t}\n\tonKeybindingState(listener: (state: EngineKeybindingState) => void): () => void {\n\t\treturn this.client.onInteractiveEngineKeybindingState(listener);\n\t}\n\n\tsendEngineCommand(command: InteractiveEngineCommand): void {\n\t\tthis.client.sendInteractiveEngineCommand(command);\n\t}\n\n\t/** Report a native host trust dialog to the extension runner in this engine generation. */\n\tasync withProjectTrustPrompt<T>(\n\t\tkind: \"select\" | \"confirm\" | \"input\",\n\t\ttitle: string,\n\t\trun: () => Promise<T>,\n\t): Promise<T> {\n\t\tconst generation = this.client.getGeneration();\n\t\tconst componentId = randomUUID();\n\t\tconst notify = (command: InteractiveEngineCommand) => {\n\t\t\tif (this.disposed || generation !== this.client.getGeneration()) return;\n\t\t\ttry {\n\t\t\t\tthis.sendEngineCommand(command);\n\t\t\t} catch {\n\t\t\t\t// Status notification failure must not prevent a host-owned trust decision.\n\t\t\t}\n\t\t};\n\t\tnotify({ type: \"engine_project_trust_start\", componentId, kind, title });\n\t\ttry {\n\t\t\treturn await run();\n\t\t} finally {\n\t\t\tnotify({ type: \"engine_project_trust_end\", componentId });\n\t\t}\n\t}\n\n\tgetRemoteCommands(): readonly RpcSlashCommand[] {\n\t\treturn this.remoteCommands.getCommands();\n\t}\n\tonRemoteCommandsChanged(listener: RemoteCommandsListener): () => void {\n\t\treturn this.remoteCommands.onChange(listener);\n\t}\n\tgetRemoteCommandCompletions(commandName: string, argumentPrefix: string): Promise<RpcAutocompleteItem[] | null> {\n\t\treturn this.client.getCommandCompletions(commandName, argumentPrefix);\n\t}\n\n\tasync invokeRemoteShortcut(key: string): Promise<void> {\n\t\tawait this.client.requestInternal<void>({ type: \"invoke_shortcut\", key });\n\t}\n\n\tasync waitUntilBound(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.client.waitForInteractiveEngineBound();\n\t\t} catch (error) {\n\t\t\tif (this.disposed && isRpcTransportFailure(error)) return;\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync waitUntilProjectTrustSettled(): Promise<void> {\n\t\tawait this.client.waitForInteractiveEngineProjectTrust();\n\t\tawait this.initializeFromEngine();\n\t}\n\tasync waitUntilResourcesReady(): Promise<void> {\n\t\twhile (true) {\n\t\t\tthis.throwIfUnavailable();\n\t\t\tconst generation = this.client.getGeneration();\n\t\t\tif (this.retiredResourceGenerations.has(generation)) {\n\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait this.client.waitForInteractiveEngineResources();\n\t\t\t} catch (error) {\n\t\t\t\tthis.throwIfUnavailable();\n\t\t\t\tif (!this.isCurrentResourceGeneration(generation)) {\n\t\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (isRpcTransportFailure(error)) throw error;\n\t\t\t\tthrow new InteractiveEngineResourceReadinessError(\n\t\t\t\t\tgeneration,\n\t\t\t\t\terror instanceof Error ? error : new Error(String(error)),\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!this.isCurrentResourceGeneration(generation)) {\n\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (this.resourcesInitializedGeneration === generation) return;\n\n\t\t\tlet initialization = this.resourceInitialization;\n\t\t\tif (initialization?.generation !== generation) {\n\t\t\t\tconst promise = this.initializeFromEngine(generation).finally(() => {\n\t\t\t\t\tif (this.resourceInitialization?.generation === generation) this.resourceInitialization = undefined;\n\t\t\t\t});\n\t\t\t\tinitialization = { generation, promise };\n\t\t\t\tthis.resourceInitialization = initialization;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait initialization.promise;\n\t\t\t} catch (error) {\n\t\t\t\tthis.throwIfUnavailable();\n\t\t\t\tif (!this.isCurrentResourceGeneration(generation)) {\n\t\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tthis.throwIfUnavailable();\n\t\t\tif (!this.isCurrentResourceGeneration(generation)) {\n\t\t\t\tawait this.waitForReplacementGeneration(generation);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.resourcesInitializedGeneration = generation;\n\t\t\treturn;\n\t\t}\n\t}\n\n\tprivate isCurrentResourceGeneration(generation: number): boolean {\n\t\treturn generation === this.client.getGeneration() && !this.retiredResourceGenerations.has(generation);\n\t}\n\n\tprivate async waitForReplacementGeneration(generation: number): Promise<void> {\n\t\twhile (generation === this.client.getGeneration()) {\n\t\t\tthis.throwIfUnavailable();\n\t\t\tawait sleep(1);\n\t\t}\n\t}\n\n\tprivate throwIfUnavailable(): void {\n\t\tif (this.disposed) throw rpcTransportError(\"Interactive engine runtime is disposed\");\n\t\tif (this.engineRecoveryFailure) throw this.engineRecoveryFailure;\n\t}\n\tgetEnginePid(): number | undefined {\n\t\treturn this.client.getEnginePid();\n\t}\n\tgetEngineGeneration(): number {\n\t\treturn this.client.getGeneration();\n\t}\n\tisRecovering(): boolean {\n\t\treturn this.health.isRecovering();\n\t}\n\t/** Subscribe to host-local engine generation death (see engine-generation.ts). */\n\tonGenerationEnded(listener: InteractiveEngineGenerationEndedListener): () => void {\n\t\treturn this.client.onGenerationEnded(listener);\n\t}\n\t/**\n\t * A heartbeat proves the child's event loop is turning again, so a stall the\n\t * watchdog already reported must stop arming the Ctrl+C escape hatch. Fed by a\n\t * dedicated client callback rather than a generic engine-message subscriber,\n\t * which would consume buffered startup custom-UI messages.\n\t */\n\tnoteEngineHeartbeat(): void {\n\t\tthis.health.clearUnresponsive();\n\t}\n\t/** True only when the engine is provably not answering (see EngineHealthController). */\n\tneedsExplicitTermination(): boolean {\n\t\treturn this.health.needsExplicitTermination();\n\t}\n\t/** Explicit user-driven engine termination and recovery (Ctrl+C escape hatch). */\n\tterminateAndRecover(): Promise<void> {\n\t\treturn this.health.terminate();\n\t}\n\tgetResourceOverlaps(): readonly ResourceOverlap[] {\n\t\treturn this.resourceOverlaps;\n\t}\n\tgetResourceExtensions(): readonly RpcResourceExtension[] {\n\t\treturn this.resourceExtensions;\n\t}\n\tonResourceExtensionsChanged(listener: ResourceExtensionsListener): () => void {\n\t\tthis.resourceExtensionsListeners.push(listener);\n\t\treturn () => {\n\t\t\tconst index = this.resourceExtensionsListeners.indexOf(listener);\n\t\t\tif (index !== -1) this.resourceExtensionsListeners.splice(index, 1);\n\t\t};\n\t}\n\tprivate updateResourceExtensions(extensions: readonly RpcResourceExtension[]): void {\n\t\tthis.resourceExtensions = [...extensions];\n\t\tfor (const listener of [...this.resourceExtensionsListeners]) listener(this.resourceExtensions);\n\t}\n\tasync synchronize(): Promise<void> {\n\t\tconst generation = this.client.getGeneration();\n\t\tconst state = await this.client.getState();\n\t\tif (!this.isCurrentResourceGeneration(generation)) return;\n\t\tthis.remoteSessionFile = state.sessionFile;\n\t\tthis.remoteSessionName = state.sessionName;\n\t\tthis.resourceOverlaps = state.resourceOverlaps ?? [];\n\t\tthis.updateResourceExtensions(state.resourceExtensions ?? []);\n\t}\n\n\tsetEngineCallbackActive(active: boolean): void {\n\t\tthis.engineCallbackActive = active;\n\t}\n\n\tinterruptBlockedCallback(): boolean {\n\t\tif (!this.engineCallbackActive) return false;\n\t\tthis.dispatchBestEffort(\"interrupt\", this.session.abort());\n\t\treturn true;\n\t}\n\n\tsetExtensionUIHandler(\n\t\thandler: (request: RpcExtensionUIRequest) => Promise<RpcExtensionUIResponse | undefined>,\n\t): () => void {\n\t\treturn this.client.onExtensionUIRequest((request) => {\n\t\t\tvoid handler(request)\n\t\t\t\t.then(async (response) => {\n\t\t\t\t\tif (response) await this.client.respondExtensionUI(response);\n\t\t\t\t})\n\t\t\t\t.catch((error: Error) => {\n\t\t\t\t\tthis.emitDiagnostic({\n\t\t\t\t\t\tactivity: undefined,\n\t\t\t\t\t\telapsedMs: 0,\n\t\t\t\t\t\tlevel: \"unresponsive\",\n\t\t\t\t\t\tmessage: `Interactive engine UI bridge failed: ${error.message}`,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t});\n\t}\n\n\temitDiagnostic(diagnostic: ActivityWatchdogDiagnostic): void {\n\t\tif (diagnostic.source !== \"stderr\") this.engineCallbackActive = true;\n\t\tthis.health.publish(diagnostic);\n\t}\n\n\toverride async switchSession(\n\t\tsessionPath: string,\n\t\toptions?: Parameters<AgentSessionRuntime[\"switchSession\"]>[1],\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst result = await this.client.switchSession(sessionPath, options?.cwdOverride);\n\t\tif (!result.cancelled) {\n\t\t\tawait super.switchSession(sessionPath, { cwdOverride: options?.cwdOverride });\n\t\t\tawait this.initializeFromEngine();\n\t\t\tif (options?.withSession) await options.withSession(this.session.createReplacedSessionContext());\n\t\t}\n\t\treturn result;\n\t}\n\n\toverride async newSession(options?: { parentSession?: string }): Promise<{ cancelled: boolean }> {\n\t\tconst result = await this.client.newSession(options?.parentSession);\n\t\tif (result.cancelled) return result;\n\t\tconst state = await this.client.getState();\n\t\tif (state.sessionFile) await super.switchSession(state.sessionFile);\n\t\telse this.resetUnpersistedSessionView();\n\t\tawait this.initializeFromEngine();\n\t\treturn result;\n\t}\n\n\toverride async importFromJsonl(inputPath: string, cwdOverride?: string): Promise<{ cancelled: boolean }> {\n\t\tconst result = await this.client.requestInternal<{ cancelled: boolean }>({\n\t\t\ttype: \"import_session\",\n\t\t\tinputPath,\n\t\t\tcwdOverride,\n\t\t});\n\t\tif (result.cancelled) return result;\n\t\tconst state = await this.client.getState();\n\t\tif (state.sessionFile) await super.switchSession(state.sessionFile);\n\t\tawait this.initializeFromEngine();\n\t\treturn result;\n\t}\n\n\toverride async fork(\n\t\tentryId: string,\n\t\toptions?: { position?: \"before\" | \"at\" },\n\t): Promise<{ cancelled: boolean; selectedText?: string }> {\n\t\tlet selectedText: string | undefined;\n\t\tlet cancelled: boolean;\n\t\tif (options?.position === \"at\") {\n\t\t\tcancelled = (await this.client.clone()).cancelled;\n\t\t} else {\n\t\t\tconst result = await this.client.fork(entryId);\n\t\t\tcancelled = result.cancelled;\n\t\t\tselectedText = result.text;\n\t\t}\n\t\tif (cancelled) return { cancelled: true };\n\t\tconst state = await this.client.getState();\n\t\tif (state.sessionFile) await super.switchSession(state.sessionFile);\n\t\tawait this.initializeFromEngine();\n\t\treturn { cancelled: false, selectedText };\n\t}\n\n\t/**\n\t * The child engine already settled (and persisted) its own turn before it\n\t * reported the replacement, and the host facade's `abort()` is `abortAndRecover()`\n\t * — an unbounded cooperative round trip. Re-entering it during teardown would\n\t * hang session replacement on an unresponsive or dead engine, which is exactly\n\t * what engine recovery exists to survive.\n\t */\n\tprotected override async settleActiveResponseBeforeTeardown(): Promise<void> {}\n\n\toverride dispose(options?: { fromSignal?: boolean }): Promise<void> {\n\t\tif (this.disposePromise) return this.disposePromise;\n\t\tthis.disposed = true;\n\t\tthis.disposePromise = (async () => {\n\t\t\t// A quit the user asked for must reach the engine before it is stopped: the stop\n\t\t\t// is a SIGTERM, which the engine cannot tell from this process being signalled.\n\t\t\t// Optional like the other transport surfaces focused test doubles omit.\n\t\t\tconst unrecordedQuit = !options?.fromSignal && (await this.client.announceExplicitQuit?.()) === false;\n\t\t\t// EngineHealthController owns the first client stop and joins recovery.\n\t\t\tawait this.health.shutdown();\n\t\t\t// A replacement may have spawned while shutdown joined recovery; the\n\t\t\t// idempotent trailing stop closes that child before disposal returns.\n\t\t\tawait this.client.stop();\n\t\t\tif (unrecordedQuit) {\n\t\t\t\t// No engine child recorded the quit, so none released Herdr's registration, and a replacement started\n\t\t\t\t// during recovery may have registered again. Every child is stopped now; this host loads no Herdr reporter.\n\t\t\t\tconst herdr = captureHerdrEnvironment(process.env);\n\t\t\t\tif (herdr) await releaseUnownedPaneRegistration(herdr);\n\t\t\t}\n\t\t\tawait super.dispose(options);\n\t\t})();\n\t\treturn this.disposePromise;\n\t}\n\n\tprivate patchSession(session: AgentSession): void {\n\t\tif (this.patchedSessions.has(session)) return;\n\t\tthis.patchedSessions.add(session);\n\t\tthis.patchSessionManager(session.sessionManager);\n\t\tthis.sessionStats.track(session);\n\t\tObject.defineProperties(session, {\n\t\t\tisStreaming: { configurable: true, get: () => this.streaming },\n\t\t\tisCompacting: { configurable: true, get: () => this.compacting },\n\t\t\tcompactionReason: { configurable: true, get: () => this.compactionReason },\n\t\t\tisBashRunning: { configurable: true, get: () => this.activeBashRequestIds.size > 0 },\n\t\t\tsessionName: { configurable: true, get: () => this.remoteSessionName },\n\t\t\tsessionFile: { configurable: true, get: () => this.remoteSessionFile },\n\t\t\tautoCompactionEnabled: { configurable: true, get: () => this.autoCompactionEnabled },\n\t\t\tautoRetryEnabled: { configurable: true, get: () => this.autoRetryEnabled },\n\t\t\tqueuedMessagesPaused: { configurable: true, get: () => this.queuePause.isPaused },\n\t\t\tsubscribe: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (listener: (event: JsonAgentSessionEvent) => void) => this.client.onEvent(listener),\n\t\t\t},\n\t\t\tprompt: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (text: string, options?: PromptOptions) => {\n\t\t\t\t\tconst cancellationEpoch = this.promptCancellationEpoch;\n\t\t\t\t\tawait this.waitUntilResourcesReady();\n\t\t\t\t\tif (cancellationEpoch !== this.promptCancellationEpoch) return;\n\t\t\t\t\tconst disposition = await this.client.prompt(text, options?.images, options?.streamingBehavior);\n\t\t\t\t\toptions?.preflightResult?.(true, disposition);\n\t\t\t\t},\n\t\t\t},\n\t\t\tsteer: { configurable: true, value: (text: string) => this.client.steer(text) },\n\t\t\tfollowUp: { configurable: true, value: (text: string) => this.client.followUp(text) },\n\t\t\tabort: { configurable: true, value: () => this.abortAndRecover() },\n\t\t\texecuteBash: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (\n\t\t\t\t\tcommand: string,\n\t\t\t\t\tonChunk?: Parameters<AgentSession[\"executeBash\"]>[1],\n\t\t\t\t\toptions?: Parameters<AgentSession[\"executeBash\"]>[2],\n\t\t\t\t) => {\n\t\t\t\t\tconst key = options?.id ?? Symbol(\"isolated-bash-request\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn await this.client.userBashWithUpdates(command, (delta, channel) => onChunk?.(delta, channel), {\n\t\t\t\t\t\t\texcludeFromContext: options?.excludeFromContext,\n\t\t\t\t\t\t\tonRequestId: (requestId) => this.activeBashRequestIds.set(key, requestId),\n\t\t\t\t\t\t});\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tthis.activeBashRequestIds.delete(key);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\trecordBashResult: { configurable: true, value: () => {} },\n\t\t\tabortBash: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (id?: string) => {\n\t\t\t\t\tif (id === undefined) this.dispatchBestEffort(\"abort bash\", this.client.abortBash());\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst requestId = this.activeBashRequestIds.get(id);\n\t\t\t\t\t\tif (requestId) this.dispatchBestEffort(\"abort bash\", this.client.abortBash(requestId));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\tcompact: { configurable: true, value: () => this.client.compact() },\n\t\t\tabortCompaction: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: () =>\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"abort compaction\",\n\t\t\t\t\t\tthis.client.requestInternal<void>({ type: \"abort_compaction\" }),\n\t\t\t\t\t),\n\t\t\t},\n\t\t\tabortRetry: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: () => {\n\t\t\t\t\tconst retry = this.client.abortRetry?.();\n\t\t\t\t\tif (retry !== undefined) {\n\t\t\t\t\t\tthis.dispatchBestEffort(\"abort retry\", retry);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof this.client.requestInternal === \"function\") {\n\t\t\t\t\t\tthis.dispatchBestEffort(\"abort retry\", this.client.requestInternal<void>({ type: \"abort_retry\" }));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\tnavigateTree: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (targetId: string, options?: Parameters<AgentSession[\"navigateTree\"]>[1]) => {\n\t\t\t\t\tconst result = await this.client.requestInternal<Awaited<ReturnType<AgentSession[\"navigateTree\"]>>>({\n\t\t\t\t\t\ttype: \"navigate_tree\",\n\t\t\t\t\t\ttargetId,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.cancelled && !result.aborted) {\n\t\t\t\t\t\tthis.sessionStats.reset();\n\t\t\t\t\t\tthis.sessionStats.refresh();\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t},\n\t\t\t},\n\t\t\treload: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async () => {\n\t\t\t\t\tawait this.client.requestInternal<void>({ type: \"reload\" });\n\t\t\t\t\tawait this.initializeFromEngine();\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetSessionName: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (name: string) => {\n\t\t\t\t\tthis.remoteSessionName = name;\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"set session name\",\n\t\t\t\t\t\tthis.client.setSessionName(name).then(() => this.refreshSessionView()),\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t},\n\t\t\tgetSteeringMessages: { configurable: true, value: () => [...this.steeringMessages] },\n\t\t\tgetFollowUpMessages: { configurable: true, value: () => [...this.followUpMessages] },\n\t\t\tclearQueue: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: () => {\n\t\t\t\t\tconst queued: QueueSnapshot = {\n\t\t\t\t\t\tsteering: [...this.steeringMessages],\n\t\t\t\t\t\tfollowUp: [...this.followUpMessages],\n\t\t\t\t\t};\n\t\t\t\t\tconst pendingClear = this.pendingQueueClear ?? {\n\t\t\t\t\t\tsnapshot: queued,\n\t\t\t\t\t\tqueueUpdateGeneration: this.queueUpdateGeneration,\n\t\t\t\t\t\tcount: 0,\n\t\t\t\t\t\tsucceeded: false,\n\t\t\t\t\t};\n\t\t\t\t\tthis.pendingQueueClear = pendingClear;\n\t\t\t\t\tpendingClear.count += 1;\n\t\t\t\t\tthis.steeringMessages = [];\n\t\t\t\t\tthis.followUpMessages = [];\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"clear queue\",\n\t\t\t\t\t\tthis.client.requestInternal({ type: \"clear_queue\" }).then(\n\t\t\t\t\t\t\t() => this.settleQueueClear(pendingClear, true),\n\t\t\t\t\t\t\t(error: Error) => {\n\t\t\t\t\t\t\t\tthis.settleQueueClear(pendingClear, false);\n\t\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn queued;\n\t\t\t\t},\n\t\t\t},\n\t\t\tpauseQueuedMessages: { configurable: true, value: () => this.queuePause.pause() },\n\t\t\tresumeQueuedMessages: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (beforeRelease?: () => void) => this.queuePause.resume(beforeRelease),\n\t\t\t},\n\t\t\tsetModel: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (model: Model<Api>, options?: ModelMutationOptions) => {\n\t\t\t\t\tawait this.settleEngineResync();\n\t\t\t\t\tconst selected = await this.client.setModel(model.provider, model.id, options);\n\t\t\t\t\tconst nextModel = session.modelRuntime.getModel(selected.provider, selected.id) ?? model;\n\t\t\t\t\tsession.agent.state.model = nextModel;\n\t\t\t\t\tthis.resolveModelFallback();\n\t\t\t\t\tif (options?.persist === true) await this.syncPersistedModelCatalog(session, nextModel);\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetThinkingLevel: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (level: AgentSession[\"thinkingLevel\"], options?: ModelMutationOptions) => {\n\t\t\t\t\tconst availableLevels = session.getAvailableThinkingLevels();\n\t\t\t\t\tconst effectiveLevel = availableLevels.includes(level)\n\t\t\t\t\t\t? level\n\t\t\t\t\t\t: session.model\n\t\t\t\t\t\t\t? clampThinkingLevel(session.model, level)\n\t\t\t\t\t\t\t: \"off\";\n\t\t\t\t\tsession.agent.state.thinkingLevel = effectiveLevel;\n\t\t\t\t\tconst epoch = ++this.thinkingEpoch;\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"set thinking level\",\n\t\t\t\t\t\tthis.client.setThinkingLevelAck(level, options).then((result) => {\n\t\t\t\t\t\t\tthis.applyThinkingAck(session, epoch, result, options?.persist === true);\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t},\n\t\t\tcycleModel: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: async (direction?: \"forward\" | \"backward\", options?: ModelMutationOptions) => {\n\t\t\t\t\tawait this.settleEngineResync();\n\t\t\t\t\tconst previousModel = session.model;\n\t\t\t\t\tconst result = await this.client.cycleModel(direction, options);\n\t\t\t\t\tif (!result) return undefined;\n\t\t\t\t\tconst model = session.modelRuntime.getModel(result.model.provider, result.model.id) ?? result.model;\n\t\t\t\t\tsession.agent.state.model = model;\n\t\t\t\t\tsession.agent.state.thinkingLevel = result.thinkingLevel;\n\t\t\t\t\tthis.resolveModelFallbackAfterExplicitModelSelection(previousModel, model);\n\t\t\t\t\tif (options?.persist === true) await this.syncPersistedModelCatalog(session, model);\n\t\t\t\t\treturn { ...result, model };\n\t\t\t\t},\n\t\t\t},\n\t\t\tcycleThinkingLevel: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (options?: ModelMutationOptions) => {\n\t\t\t\t\tconst levels = session.getAvailableThinkingLevels();\n\t\t\t\t\tif (levels.length <= 1) return undefined;\n\t\t\t\t\tconst current = levels.indexOf(session.thinkingLevel);\n\t\t\t\t\tconst level = levels[(current + 1) % levels.length]!;\n\t\t\t\t\tsession.agent.state.thinkingLevel = level;\n\t\t\t\t\tconst epoch = ++this.thinkingEpoch;\n\t\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\t\"cycle thinking level\",\n\t\t\t\t\t\tthis.client.setThinkingLevelAck(level, options).then((result) => {\n\t\t\t\t\t\t\tthis.applyThinkingAck(session, epoch, result, options?.persist === true);\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\treturn level;\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetSteeringMode: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (mode: \"all\" | \"one-at-a-time\") => {\n\t\t\t\t\tsession.agent.steeringMode = mode;\n\t\t\t\t\tthis.dispatchBestEffort(\"set steering mode\", this.client.setSteeringMode(mode));\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetFollowUpMode: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (mode: \"all\" | \"one-at-a-time\") => {\n\t\t\t\t\tsession.agent.followUpMode = mode;\n\t\t\t\t\tthis.dispatchBestEffort(\"set follow-up mode\", this.client.setFollowUpMode(mode));\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetAutoCompactionEnabled: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (enabled: boolean) => {\n\t\t\t\t\tthis.autoCompactionEnabled = enabled;\n\t\t\t\t\tthis.dispatchBestEffort(\"set auto compaction\", this.client.setAutoCompaction(enabled));\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetAutoRetryEnabled: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: (enabled: boolean) => {\n\t\t\t\t\tthis.autoRetryEnabled = enabled;\n\t\t\t\t\tthis.dispatchBestEffort(\"set auto retry\", this.client.setAutoRetry(enabled));\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Cooperative interrupt. Requests the engine's own abort and waits for it —\n\t * no timeout, no termination, no restart. A genuinely wedged engine is the\n\t * user's call to terminate with Ctrl+C (see terminateAndRecover), never an\n\t * automatic consequence of pressing Escape.\n\t */\n\tprivate async abortAndRecover(): Promise<void> {\n\t\tthis.promptCancellationEpoch += 1;\n\t\tawait this.queuePause.settleBeforeAbort();\n\t\tthis.health.markCooperativeAbortStarted();\n\t\ttry {\n\t\t\tawait this.client.abort();\n\t\t} finally {\n\t\t\tthis.health.markCooperativeAbortSettled();\n\t\t\tthis.engineCallbackActive = false;\n\t\t}\n\t}\n\n\tprivate applyThinkingAck(\n\t\tsession: AgentSession,\n\t\tepoch: number,\n\t\tresult: { level: AgentSession[\"thinkingLevel\"]; provider?: string; modelId?: string },\n\t\tpersist: boolean,\n\t): void {\n\t\tif (persist) {\n\t\t\tapplyPersistedThinkingDefault(session, result.level, thinkingPersistTarget(result));\n\t\t}\n\t\tif (epoch === this.thinkingEpoch) {\n\t\t\tsession.agent.state.thinkingLevel = result.level;\n\t\t}\n\t}\n\n\tprivate dispatchBestEffort(label: string, operation: Promise<unknown>): void {\n\t\tvoid operation.catch((error: Error) => {\n\t\t\tif (this.health.isRecovering()) return;\n\t\t\tthis.emitDiagnostic({\n\t\t\t\tactivity: undefined,\n\t\t\t\telapsedMs: 0,\n\t\t\t\tlevel: \"unresponsive\",\n\t\t\t\tmessage: `Interactive engine ${label} failed: ${error.message}`,\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate settleQueueClear(pendingClear: PendingQueueClear, succeeded: boolean): void {\n\t\tif (this.pendingQueueClear !== pendingClear) return;\n\n\t\tpendingClear.count -= 1;\n\t\tpendingClear.succeeded ||= succeeded;\n\t\tif (pendingClear.count > 0) return;\n\n\t\tthis.pendingQueueClear = undefined;\n\t\tif (pendingClear.succeeded || this.queueUpdateGeneration !== pendingClear.queueUpdateGeneration) return;\n\n\t\tthis.steeringMessages = [...pendingClear.snapshot.steering];\n\t\tthis.followUpMessages = [...pendingClear.snapshot.followUp];\n\t}\n\n\tprivate resetUnpersistedSessionView(): void {\n\t\tconst session = super.session;\n\t\tconst manager = SessionManager.create(session.sessionManager.getCwd(), session.sessionManager.getSessionDir());\n\t\tObject.defineProperty(session, \"sessionManager\", { configurable: true, value: manager });\n\t\tthis.patchSessionManager(manager);\n\t\tsession.agent.state.messages = [];\n\t}\n\n\tprivate patchSessionManager(manager: SessionManager): void {\n\t\tObject.defineProperty(manager, \"appendLabelChange\", {\n\t\t\tconfigurable: true,\n\t\t\tvalue: (entryId: string, label?: string) => {\n\t\t\t\tthis.dispatchBestEffort(\n\t\t\t\t\t\"set label\",\n\t\t\t\t\tthis.client\n\t\t\t\t\t\t.requestInternal<void>({ type: \"set_label\", entryId, label })\n\t\t\t\t\t\t.then(() => this.refreshSessionView()),\n\t\t\t\t);\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate async syncPersistedModelCatalog(session: AgentSession, model: Model<Api>): Promise<void> {\n\t\tconst alreadyInScope = session.scopedModels.some(\n\t\t\t(scoped) => scoped.model.provider === model.provider && scoped.model.id === model.id,\n\t\t);\n\t\tconst catalog = await this.client.requestInternal<RpcModelCatalog>({ type: \"get_available_models\" });\n\t\tthis.remoteModelCatalog.apply(catalog);\n\t\tapplyPersistedModelDefault(session, model, alreadyInScope);\n\t\tconst state = await this.client.getState();\n\t\tif (state.model?.provider === model.provider && state.model.id === model.id) {\n\t\t\tapplyPersistedThinkingDefault(session, state.thinkingLevel, { provider: model.provider, modelId: model.id });\n\t\t}\n\t}\n\n\tprivate refreshSessionView(): void {\n\t\tconst session = super.session;\n\t\tconst sessionFile = session.sessionFile;\n\t\tif (!sessionFile) return;\n\t\tconst currentManager = session.sessionManager;\n\t\tconst refreshed = SessionManager.open(sessionFile, currentManager.getSessionDir(), currentManager.getCwd());\n\t\tObject.defineProperty(session, \"sessionManager\", { configurable: true, value: refreshed });\n\t\tthis.patchSessionManager(refreshed);\n\t\tsession.agent.state.messages = refreshed.buildSessionContext().messages;\n\t}\n\n\tprivate observeEvent(event: RpcEvent): void {\n\t\tconst session = super.session;\n\t\tswitch (event.type) {\n\t\t\tcase \"agent_start\":\n\t\t\t\tthis.streaming = true;\n\t\t\t\tbreak;\n\t\t\tcase \"agent_end\":\n\t\t\t\tthis.streaming = false;\n\t\t\t\tthis.refreshSessionView();\n\t\t\t\tbreak;\n\t\t\tcase \"compaction_start\":\n\t\t\t\tthis.compacting = true;\n\t\t\t\tthis.compactionReason = event.reason;\n\t\t\t\tbreak;\n\t\t\tcase \"compaction_end\":\n\t\t\t\tthis.compacting = false;\n\t\t\t\tthis.compactionReason = undefined;\n\t\t\t\tif (!event.aborted && event.errorMessage === undefined) this.sessionStats.refresh();\n\t\t\t\tbreak;\n\t\t\tcase \"message_end\":\n\t\t\t\tthis.sessionStats.refresh();\n\t\t\t\tbreak;\n\t\t\tcase \"queue_update\":\n\t\t\t\tthis.queueUpdateGeneration += 1;\n\t\t\t\tthis.pendingQueueClear = undefined;\n\t\t\t\tthis.steeringMessages = [...event.steering];\n\t\t\t\tthis.followUpMessages = [...event.followUp];\n\t\t\t\tbreak;\n\t\t\tcase \"model_changed\":\n\t\t\t\tsession.agent.state.model = event.model;\n\t\t\t\tthis.sessionStats.refresh();\n\t\t\t\tbreak;\n\t\t\tcase \"thinking_level_changed\":\n\t\t\t\tthis.thinkingEpoch += 1;\n\t\t\t\tsession.agent.state.thinkingLevel = event.level;\n\t\t\t\tbreak;\n\t\t\tcase \"session_info_changed\":\n\t\t\t\tthis.remoteSessionName = event.name;\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CallbackActivity } from "../../core/callback-activity.ts";
|
|
2
2
|
import type { HostInputFormField, HostSessionPickerRow, WidgetScrollRequest, WidgetScrollState } from "../../core/extensions/ui-types.js";
|
|
3
|
+
import type { WorkflowActivityFrame } from "../../core/extensions/workflow-events.js";
|
|
3
4
|
import type { KeyId } from "../../core/keybindings.ts";
|
|
4
5
|
/**
|
|
5
6
|
* Version 4 separates minimal session binding from optional resource readiness.
|
|
@@ -81,6 +82,11 @@ export type InteractiveEngineMessage = {
|
|
|
81
82
|
type: "engine_activity_finished";
|
|
82
83
|
activityId: string;
|
|
83
84
|
}
|
|
85
|
+
/** Workflow activity the host reports as terminal program status. Roots carry no graph. */
|
|
86
|
+
| {
|
|
87
|
+
type: "engine_workflow_activity";
|
|
88
|
+
frame: WorkflowActivityFrame;
|
|
89
|
+
}
|
|
84
90
|
/**
|
|
85
91
|
* The child took ownership of a correlated RPC request: it has parsed the
|
|
86
92
|
* command and is about to run it. Emitted and flushed BEFORE any handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive-engine/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAwB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EACX,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,IAAI,CAAC;AAErD,MAAM,WAAW,UAAU;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,EAAE,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpF,MAAM,WAAW,0BAA0B;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnF,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAA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wB,GAAG,wBAAwB,GAAG,yBAAyB,GACtF,MAAM,CAER;AAED,eAAO,MAAM,iCAAiC,wCAAkC,CAAC"}
|
|
@@ -33,6 +33,65 @@ function isCallbackActivity(value) {
|
|
|
33
33
|
typeof value.name === "string" &&
|
|
34
34
|
typeof value.startedAt === "number");
|
|
35
35
|
}
|
|
36
|
+
const WORKFLOW_ACTIVITY_STATES = ["working", "idle", "blocked"];
|
|
37
|
+
const WORKFLOW_ACTIVITY_REASONS = [
|
|
38
|
+
"executing",
|
|
39
|
+
"automatic_continuation",
|
|
40
|
+
"retrying",
|
|
41
|
+
"stopping",
|
|
42
|
+
"awaiting_input",
|
|
43
|
+
"manual_intervention",
|
|
44
|
+
"paused",
|
|
45
|
+
"quiescent",
|
|
46
|
+
];
|
|
47
|
+
function parseWorkflowRoot(value) {
|
|
48
|
+
if (!isJsonObject(value) ||
|
|
49
|
+
typeof value.rootRunId !== "string" ||
|
|
50
|
+
typeof value.ownerSessionId !== "string" ||
|
|
51
|
+
typeof value.state !== "string" ||
|
|
52
|
+
!WORKFLOW_ACTIVITY_STATES.includes(value.state) ||
|
|
53
|
+
typeof value.reason !== "string" ||
|
|
54
|
+
!WORKFLOW_ACTIVITY_REASONS.includes(value.reason) ||
|
|
55
|
+
typeof value.activeExecutionCount !== "number" ||
|
|
56
|
+
typeof value.actionableBlockCount !== "number" ||
|
|
57
|
+
typeof value.needsAttention !== "boolean")
|
|
58
|
+
return undefined;
|
|
59
|
+
return {
|
|
60
|
+
rootRunId: value.rootRunId,
|
|
61
|
+
ownerSessionId: value.ownerSessionId,
|
|
62
|
+
state: value.state,
|
|
63
|
+
reason: value.reason,
|
|
64
|
+
activeExecutionCount: value.activeExecutionCount,
|
|
65
|
+
actionableBlockCount: value.actionableBlockCount,
|
|
66
|
+
needsAttention: value.needsAttention,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function parseWorkflowActivityFrame(value) {
|
|
70
|
+
if (value === undefined || !isJsonObject(value) || !isJsonObject(value.cursor))
|
|
71
|
+
return undefined;
|
|
72
|
+
const { epoch, revision } = value.cursor;
|
|
73
|
+
if (typeof epoch !== "string" || typeof revision !== "number")
|
|
74
|
+
return undefined;
|
|
75
|
+
const cursor = { epoch, revision };
|
|
76
|
+
if (value.kind === "removed") {
|
|
77
|
+
return typeof value.rootRunId === "string" ? { kind: "removed", cursor, rootRunId: value.rootRunId } : undefined;
|
|
78
|
+
}
|
|
79
|
+
if (value.kind === "changed") {
|
|
80
|
+
const root = value.root === undefined ? undefined : parseWorkflowRoot(value.root);
|
|
81
|
+
return root ? { kind: "changed", cursor, root } : undefined;
|
|
82
|
+
}
|
|
83
|
+
if (value.kind !== "snapshot")
|
|
84
|
+
return undefined;
|
|
85
|
+
if (value.availability === "recovering" || value.availability === "unavailable") {
|
|
86
|
+
return { kind: "snapshot", cursor, availability: value.availability };
|
|
87
|
+
}
|
|
88
|
+
if (value.availability !== "ready" || !Array.isArray(value.roots))
|
|
89
|
+
return undefined;
|
|
90
|
+
const roots = value.roots.map(parseWorkflowRoot);
|
|
91
|
+
return roots.every((root) => root !== undefined)
|
|
92
|
+
? { kind: "snapshot", cursor, availability: "ready", roots }
|
|
93
|
+
: undefined;
|
|
94
|
+
}
|
|
36
95
|
function parseEngineTerminalControl(value) {
|
|
37
96
|
if (value === undefined || !isJsonObject(value) || value.kind !== "autowrap" || typeof value.enabled !== "boolean") {
|
|
38
97
|
return undefined;
|
|
@@ -206,6 +265,10 @@ export function parseInteractiveEngineMessage(line) {
|
|
|
206
265
|
return isCallbackActivity(value.activity) ? { type: value.type, activity: value.activity } : undefined;
|
|
207
266
|
case "engine_activity_finished":
|
|
208
267
|
return typeof value.activityId === "string" ? { type: value.type, activityId: value.activityId } : undefined;
|
|
268
|
+
case "engine_workflow_activity": {
|
|
269
|
+
const frame = parseWorkflowActivityFrame(value.frame);
|
|
270
|
+
return frame ? { type: value.type, frame } : undefined;
|
|
271
|
+
}
|
|
209
272
|
case "engine_request_accepted":
|
|
210
273
|
return typeof value.requestId === "string" && typeof value.command === "string"
|
|
211
274
|
? { type: value.type, requestId: value.requestId, command: value.command }
|