import type { ExecutionContext } from './ExecutionContext.ts'; import type { LogLevel } from './types.ts'; export interface RunEventBase { executionId: string; member: string; correlationId?: string; timestamp: string; } export type RunEvent = (RunEventBase & { type: 'run.started'; task: string; }) | (RunEventBase & { type: 'reasoning'; step: number; content: string; model?: string; promptTokens?: number; completionTokens?: number; stepCost?: number; contextWindow?: number; contextUtil?: number; }) | (RunEventBase & { type: 'tool.called'; step: number; name: string; args: unknown; }) | (RunEventBase & { type: 'tool.result'; step: number; name: string; output: string; durationMs: number; }) | (RunEventBase & { type: 'tool.approval'; step: number; name: string; approved: boolean; }) | (RunEventBase & { type: 'decision.recorded'; decisionId: string; outcome: string; }) | (RunEventBase & { type: 'provenance.recorded'; checksum: string; }) | (RunEventBase & { type: 'run.finished'; output: string; durationMs: number; }) | (RunEventBase & { type: 'run.failed'; error: string; durationMs: number; }) | (RunEventBase & { type: 'run.awaiting_input'; question: string; context?: string; durationMs: number; }) | (RunEventBase & { type: 'log.created'; level: LogLevel; message: string; }); export type RunEventListener = (event: RunEvent) => void; /** * In-memory publisher for execution-lifecycle events. External hosts (e.g. the * atlaslink orchestrator) subscribe here to watch a run happen instead of * tailing persisted artifacts. A pure publisher: emitters redact payloads * before constructing events, and a misbehaving subscriber never breaks the run. */ export declare class RunEventBus { private readonly listeners; subscribe(listener: RunEventListener): () => void; emit(event: RunEvent): void; get size(): number; } /** Best-effort copy of the persistence redaction guarantee for event payloads; * a failing or missing redactor drops the payload rather than the run. */ export declare function redactEventText(context: ExecutionContext, text: string): string; //# sourceMappingURL=RunEventBus.d.ts.map