import type { AgentEngine } from '../agent/engine.js'; import type { RunOptions } from '../agent/types.js'; import type { AgentEvent } from '../types.js'; import type { ToolRegistry } from '../tool/registry.js'; import { RunRegistry, type ActiveRun, type BufferedEvent } from './run-registry.js'; import { type AgentEventAdapterOptions, type MappedAgentEvent } from '../utils/event-adapter.js'; export interface RunPersistenceAdapter { onRunStart?(run: ActiveRun): void | Promise; onEvent?(run: ActiveRun, event: BufferedEvent, source: AgentEvent): void | Promise; onFlush?(run: ActiveRun): void | Promise; onRunFinish?(run: ActiveRun, status: 'done' | 'error', error?: string): void | Promise; } export interface RunControllerOptions { registry?: RunRegistry; persistence?: RunPersistenceAdapter; eventAdapter?: AgentEventAdapterOptions; flushIntervalMs?: number; flushChars?: number; } export interface RunEngineOptions extends RunOptions { threadId: number | string; traceId?: string; toolRegistry?: ToolRegistry; } export interface RunControllerResult { run: ActiveRun; events: MappedAgentEvent[]; } export declare class RunController { readonly registry: RunRegistry; private persistence?; private eventAdapter; private flushIntervalMs; private flushChars; constructor(options?: RunControllerOptions); subscribe(threadId: number | string, callback: (event: BufferedEvent) => void): () => void; getBufferedEvents(threadId: number | string): BufferedEvent[]; run(engine: AgentEngine, options: RunEngineOptions): Promise; } //# sourceMappingURL=run-controller.d.ts.map