import type { ProviderChildHealthSnapshot } from '../../shared/snapshot.js'; import { ActiveRuntimeRun } from './active-runtime.js'; import { type RunningChildProcess } from './child-process.js'; import { ProviderControllerSlot } from './controller-slot.js'; import { type AgentRuntime, type AgentRuntimeCloseOptions, type AgentRuntimeDrainInput, type AgentRuntimeFollowupInput, type AgentRuntimeFollowupResult, type AgentRuntimeHealth, type AgentRuntimeInput, type AgentRuntimeResult } from './contract.js'; interface ControllerAgentRuntimeOptions { providerChildIdleTimeoutMs?: number; } export interface ProviderTurnController { completion: Promise; acceptStderrChunk(chunk: string): Promise; acceptStdoutChunk(chunk: string): Promise; isQuiescent?(): boolean; kill(signal?: NodeJS.Signals): void; snapshot(): ProviderChildHealthSnapshot; waitForQuiescent(signal?: AbortSignal): Promise; } export declare abstract class ControllerAgentRuntime implements AgentRuntime { private readonly options; abstract readonly env: Record | undefined; abstract readonly kind: string; protected readonly slot: ProviderControllerSlot; protected readonly activeRun: ActiveRuntimeRun; private providerChildIdleReset?; private providerChildQuiescentWait?; constructor(options?: ControllerAgentRuntimeOptions); abstract run(input: AgentRuntimeInput): Promise; abstract appendToActiveRun(input: AgentRuntimeFollowupInput): Promise; close(options?: AgentRuntimeCloseOptions): Promise; health(): AgentRuntimeHealth; requestDrain(input: AgentRuntimeDrainInput): Promise; /** * Only controllers that implement `isQuiescent` (Claude background tasks) * participate in config-reload quiescence. Others return `undefined` so the * host keeps active-item-only reload deferral. */ isProviderQuiescent(): boolean | undefined; waitForProviderQuiescent(signal?: AbortSignal): Promise; protected spawnController(spawn: { args: string[]; command: string; label: string; }, input: AgentRuntimeInput, create: (child: RunningChildProcess) => C): C; protected runTurnLifecycle(input: AgentRuntimeInput, options: { abort?(signal?: NodeJS.Signals): Promise | void; beforeFinishRun?(): void; failurePayload?(error: unknown): Promise>; label: string; startedPayload: Record; turn(): Promise; }): Promise; private cancelProviderChildIdleReset; private scheduleProviderChildIdleReset; } export {}; //# sourceMappingURL=provider-runtime.d.ts.map