/** * Debug Tools - Runtime debugging and inspection utilities */ import { EventEmitter } from 'events'; import { WebSocket } from 'ws'; /** * Debug event types */ export declare enum DebugEventType { TASK_TRACE = "task_trace", TERMINAL_TRACE = "terminal_trace", CONTEXT_TRACE = "context_trace", QUEUE_TRACE = "queue_trace", WORKFLOW_TRACE = "workflow_trace", ERROR_TRACE = "error_trace", PERFORMANCE_TRACE = "performance_trace", NETWORK_TRACE = "network_trace" } /** * Debug event */ export interface DebugEvent { id: string; type: DebugEventType; timestamp: Date; component: string; action: string; data: any; metadata?: { taskId?: string; terminalId?: string; projectId?: string; duration?: number; error?: string; stack?: string; }; } /** * Debug filter */ export interface DebugFilter { types?: DebugEventType[]; components?: string[]; taskIds?: string[]; terminalIds?: string[]; projectIds?: string[]; minTimestamp?: Date; maxTimestamp?: Date; } /** * Debug session */ export interface DebugSession { id: string; name: string; startTime: Date; filters: DebugFilter; events: DebugEvent[]; active: boolean; client?: WebSocket; } /** * Breakpoint */ export interface Breakpoint { id: string; component: string; action: string; condition?: string; hitCount: number; enabled: boolean; callback?: (event: DebugEvent) => void; } /** * Debug Tools */ export declare class DebugTools extends EventEmitter { private logger; private events; private sessions; private breakpoints; private recording; private maxEvents; private performanceMarks; constructor(maxEvents?: number); /** * Start recording debug events */ startRecording(): void; /** * Stop recording debug events */ stopRecording(): void; /** * Record a debug event */ recordEvent(type: DebugEventType, component: string, action: string, data: any, metadata?: any): void; /** * Sanitize data for storage */ private sanitizeData; /** * Get object depth */ private getObjectDepth; /** * Check breakpoints */ private checkBreakpoints; /** * Send event to active sessions */ private sendToSessions; /** * Check if event matches filter */ private matchesFilter; /** * Create debug session */ createSession(name: string, filters?: DebugFilter): DebugSession; /** * Attach WebSocket client to session */ attachClient(sessionId: string, client: WebSocket): void; /** * Destroy session */ destroySession(sessionId: string): void; /** * Set breakpoint */ setBreakpoint(component: string, action: string, condition?: string, callback?: (event: DebugEvent) => void): Breakpoint; /** * Remove breakpoint */ removeBreakpoint(breakpointId: string): void; /** * Enable/disable breakpoint */ toggleBreakpoint(breakpointId: string, enabled: boolean): void; /** * Clear all breakpoints */ clearBreakpoints(): void; /** * Start performance measurement */ startPerformanceMark(markId: string): void; /** * End performance measurement */ endPerformanceMark(markId: string): number | null; /** * Get events with filter */ getEvents(filter?: DebugFilter): DebugEvent[]; /** * Get event statistics */ getEventStatistics(): any; /** * Export events */ exportEvents(format?: 'json' | 'csv'): string; /** * Import events */ importEvents(data: string, format?: 'json' | 'csv'): void; /** * Clear events */ clearEvents(): void; /** * Get active sessions */ getActiveSessions(): DebugSession[]; /** * Get breakpoints */ getBreakpoints(): Breakpoint[]; /** * Generate IDs */ private generateEventId; private generateSessionId; private generateBreakpointId; /** * Destroy debug tools */ destroy(): void; } //# sourceMappingURL=debug-tools.d.ts.map