/** * Exploration Events - Event emitter for real-time exploration updates * * Provides event-driven updates for dashboard and monitoring */ import { EventEmitter } from 'events'; import type { ContainerStats, Decision, Exploration, Insight, WorktreeExploration } from '../types/exploration.types.js'; export interface ContainerStatsEvent extends ExplorationEvent { data: { stats: ContainerStats; }; worktree_index: number; } export interface DecisionEvent extends ExplorationEvent { data: { decision: Decision; }; } export interface ExplorationEvent { data: unknown; exploration_id: string; timestamp: string; type: ExplorationEventType; } export type ExplorationEventType = 'container:created' | 'container:stats' | 'container:stopped' | 'decision:proposed' | 'decision:resolved' | 'decision:voted' | 'exploration:completed' | 'exploration:created' | 'exploration:failed' | 'exploration:started' | 'exploration:stopped' | 'insight:published' | 'merge:completed' | 'merge:failed' | 'merge:started' | 'worktree:completed' | 'worktree:created' | 'worktree:failed' | 'worktree:progress' | 'worktree:started'; export interface InsightEvent extends ExplorationEvent { data: { insight: Insight; }; } export interface ProgressEvent extends ExplorationEvent { data: { current_stage: string; percentage: number; stages_completed: string[]; }; worktree_index: number; } export interface WorktreeEvent extends ExplorationEvent { data: { [key: string]: unknown; worktree: WorktreeExploration; }; worktree_index: number; } /** * Global event emitter for exploration events */ declare class ExplorationEventEmitter extends EventEmitter { private static instance; private constructor(); static getInstance(): ExplorationEventEmitter; /** * Emit exploration created event */ emitExplorationCreated(exploration: Exploration): void; /** * Emit exploration started event */ emitExplorationStarted(exploration: Exploration): void; /** * Emit exploration completed event */ emitExplorationCompleted(exploration: Exploration): void; /** * Emit exploration failed event */ emitExplorationFailed(exploration: Exploration, error: Error): void; /** * Emit exploration stopped event */ emitExplorationStopped(exploration: Exploration): void; /** * Emit worktree created event */ emitWorktreeCreated(explorationId: string, worktree: WorktreeExploration): void; /** * Emit worktree started event */ emitWorktreeStarted(explorationId: string, worktree: WorktreeExploration): void; /** * Emit worktree progress event */ emitWorktreeProgress(explorationId: string, worktreeIndex: number, percentage: number, currentStage: string, stagesCompleted: string[]): void; /** * Emit worktree completed event */ emitWorktreeCompleted(explorationId: string, worktree: WorktreeExploration): void; /** * Emit worktree failed event */ emitWorktreeFailed(explorationId: string, worktree: WorktreeExploration, error: string): void; /** * Emit container created event */ emitContainerCreated(explorationId: string, worktreeIndex: number, containerId: string): void; /** * Emit container stats event */ emitContainerStats(explorationId: string, worktreeIndex: number, stats: ContainerStats): void; /** * Emit container stopped event */ emitContainerStopped(explorationId: string, worktreeIndex: number): void; /** * Emit insight published event */ emitInsightPublished(explorationId: string, insight: Insight): void; /** * Emit decision proposed event */ emitDecisionProposed(explorationId: string, decision: Decision): void; /** * Emit decision voted event */ emitDecisionVoted(explorationId: string, decision: Decision, worktreeId: string): void; /** * Emit decision resolved event */ emitDecisionResolved(explorationId: string, decision: Decision): void; /** * Emit merge started event */ emitMergeStarted(explorationId: string, worktreeIndex: number, strategy: string): void; /** * Emit merge completed event */ emitMergeCompleted(explorationId: string, worktreeIndex: number, mergeCommit: string): void; /** * Emit merge failed event */ emitMergeFailed(explorationId: string, worktreeIndex: number, error: string): void; } /** * Get global exploration event emitter */ export declare function getExplorationEvents(): ExplorationEventEmitter; export {}; //# sourceMappingURL=exploration-events.d.ts.map