/** * Test Failure Monitor - Real-time monitoring of test output for early abort * * Detects test failures as they stream and can trigger early abort to allow * the AI to pivot and replan instead of waiting for a broken test suite to finish. */ export interface TestMonitorConfig { /** Number of test failures before triggering early abort (default: 3) */ failureThreshold: number; /** Whether to abort on first compilation error (default: true) */ abortOnCompileError: boolean; /** Minimum time (ms) to wait before considering abort (default: 5000) */ minRunTime: number; /** Maximum consecutive failures before abort (default: 2) */ maxConsecutiveFailures: number; } export interface TestMonitorState { failedTests: string[]; passedTests: number; totalTests: number; hasCompileError: boolean; consecutiveFailures: number; shouldAbort: boolean; abortReason: string | null; suggestions: string[]; } export declare class TestFailureMonitor { private config; private state; private startTime; private recentLines; private readonly MAX_RECENT_LINES; constructor(config?: Partial); private createInitialState; /** * Process a line of test output in real-time * Returns true if we should abort */ processLine(line: string): boolean; private checkAbortConditions; private generateSuggestions; /** * Get the current monitoring state */ getState(): TestMonitorState; /** * Get recent output lines for context */ getRecentOutput(): string; /** * Format abort message for AI consumption */ formatAbortMessage(): string; /** * Reset the monitor for a new test run */ reset(): void; } /** * Detect if a command is likely a test command */ export declare function isTestCommand(command: string): boolean; /** * Create a test monitor with sensible defaults based on command */ export declare function createTestMonitor(command: string): TestFailureMonitor | null; //# sourceMappingURL=testFailureMonitor.d.ts.map