import type { ChildProcess } from 'node:child_process'; import type { SupportedRuntime } from './workflow-executor.js'; export type LifecycleState = 'spawned' | 'active' | 'idle' | 'completed' | 'failed' | 'timed-out'; export type LifecycleEvent = { state: LifecycleState; timestamp: number; elapsedMs: number; exitCode?: number; detail?: string; }; export type LifecycleWatcherCallbacks = { onStateChange?: (event: LifecycleEvent) => void; onOutput?: (chunk: string) => void; }; export type LifecycleWatcher = { readonly runtime: SupportedRuntime; start(child: ChildProcess, callbacks: LifecycleWatcherCallbacks): void; getState(): LifecycleState; getElapsedMs(): number; dispose(): void; }; export declare class ClaudeLifecycleWatcher implements LifecycleWatcher { private static readonly IDLE_THRESHOLD_MS; readonly runtime: SupportedRuntime; private core; private idleTimer; private lastOutputMs; start(child: ChildProcess, callbacks: LifecycleWatcherCallbacks): void; getState(): LifecycleState; getElapsedMs(): number; dispose(): void; private scheduleIdleCheck; private clearIdleTimer; } export declare class CodexLifecycleWatcher implements LifecycleWatcher { readonly runtime: SupportedRuntime; private core; start(child: ChildProcess, callbacks: LifecycleWatcherCallbacks): void; getState(): LifecycleState; getElapsedMs(): number; dispose(): void; } export declare function createLifecycleWatcher(runtime: SupportedRuntime): LifecycleWatcher;