import { EventEmitter } from 'node:events'; import type { CLIEvent, SystemStatusEvent, ThinkingEvent, ToolResultEvent, SystemMessageEvent, ErrorEvent, AgentLifecycleEvent } from './types.js'; import { CognitiveState, ToolCategory, RiskLevel } from './types.js'; /** * CLIEventBus — Event-driven rendering for Eden CLI * * Normalized event model. Every event has: * meta.id, meta.timestamp, meta.source, meta.sessionId, meta.agentId, meta.correlationId * type, payload * * Enables: persistence, replay, analytics, telemetry, web sync */ type VisualMode = 'quiet' | 'normal' | 'verbose' | 'debug' | 'autonomous'; declare class CLIEventBus extends EventEmitter { private history; private _mode; private maxHistory; private _overflowCount; private _totalEmitted; private _coalescingBuffer; private _coalesceWindowMs; get mode(): VisualMode; get maxEventsInMemory(): number; get overflowCount(): number; get totalEmitted(): number; get stats(): { total: number; inMemory: number; overflow: number; mode: VisualMode; }; setMode(mode: VisualMode): void; setMaxEventsInMemory(max: number): void; emitEvent(event: CLIEvent): void; private isQuietVisible; private isAutonomousVisible; getHistory(): CLIEvent[]; getRecentEvents(count?: number): CLIEvent[]; getEventsByType(type: T): Extract[]; getTimeline(): Array<{ time: string; label: string; type: string; }>; private timelineLabel; clear(): void; } export declare const cliEventBus: CLIEventBus; export declare function emitCognitiveTransition(from: CognitiveState, to: CognitiveState, reason?: string, taskId?: string): void; export declare function emitThinking(stage: string, label: string, status: ThinkingEvent['payload']['status']): void; export declare function emitToolStart(tool: string, args: Record, options?: { category?: ToolCategory; riskLevel?: RiskLevel; target?: string; streaming?: boolean; }): string; export declare function emitToolOutput(tool: string, chunk: string, isError?: boolean, isFinal?: boolean, correlationId?: string): void; export declare function emitToolResult(correlationId: string, tool: string, status: ToolResultEvent['payload']['status'], output?: string, error?: string, duration?: number, exitCode?: number, metrics?: ToolResultEvent['payload']['metrics']): void; export declare function emitProgress(current: number, total: number, label: string, unit?: string, eta?: number): void; export declare function emitUserMessage(text: string, mentions?: string[], command?: string): void; export declare function emitAgentMessage(text: string, isStreaming?: boolean, model?: string, tokensIn?: number, tokensOut?: number): void; export declare function emitSystemMessage(text: string, level?: SystemMessageEvent['payload']['level']): void; export declare function emitError(message: string, category?: ErrorEvent['payload']['category'], recoverable?: boolean, stack?: string, suggestedFix?: string, exitCode?: number): void; export declare function emitSystemStatus(status: SystemStatusEvent['payload']): void; export declare function emitAgentLifecycle(agentId: string, agentName: string, role: string, action: AgentLifecycleEvent['payload']['action'], taskId?: string): void; export declare function emitMessage(role: 'user' | 'agent' | 'system', text: string): void; export declare function emitHeader(status: Omit & { uptime?: number; }): void; export declare function setMaxEventsInMemory(max: number): void; export {}; //# sourceMappingURL=event-bus.d.ts.map