/** * Streaming Progress — Real-time progress during test execution. * * @example * ``` * Running tests... [████████░░] 80% (8/10) * ✓ test-1 (0.5s, $0.002) * ✓ test-2 (1.2s, $0.005) * ✗ test-3 FAILED: expected tool_called:search (0.8s) * ⏳ test-4 running... * ``` */ import type { SuiteResult } from './types'; export type TestStatus = 'pending' | 'running' | 'passed' | 'failed' | 'skipped'; export interface ProgressEntry { name: string; status: TestStatus; duration_ms?: number; cost_usd?: number; error?: string; } export interface ProgressState { total: number; completed: number; entries: ProgressEntry[]; startTime: number; } export interface ProgressOptions { /** Width of the progress bar in characters (default: 30) */ barWidth?: number; /** Show cost per test (default: true) */ showCost?: boolean; /** Show duration per test (default: true) */ showDuration?: boolean; /** Use color codes (default: true) */ color?: boolean; /** Stream to write output (default: process.stderr) */ stream?: NodeJS.WritableStream; } export type ProgressCallback = (state: ProgressState) => void; /** * Render a progress bar string. */ export declare function renderProgressBar(completed: number, total: number, width?: number): string; /** * Format a single test entry for display. */ export declare function formatEntry(entry: ProgressEntry, options?: ProgressOptions): string; /** * Format the full progress display. */ export declare function formatProgress(state: ProgressState, options?: ProgressOptions): string; /** * Track progress of test execution. */ export declare class ProgressTracker { private state; private options; private callback?; constructor(total: number, options?: ProgressOptions); /** * Register a callback for progress updates. */ onProgress(cb: ProgressCallback): void; /** * Add a pending test. */ addTest(name: string): void; /** * Mark a test as running. */ startTest(name: string): void; /** * Mark a test as passed. */ passTest(name: string, duration_ms?: number, cost_usd?: number): void; /** * Mark a test as failed. */ failTest(name: string, error?: string, duration_ms?: number, cost_usd?: number): void; /** * Mark a test as skipped. */ skipTest(name: string): void; /** * Get current progress state. */ getState(): ProgressState; /** * Render the current progress display. */ render(): string; /** * Get elapsed time in ms. */ elapsed(): number; /** * Build a summary line after completion. */ summary(): string; private completeTest; private emit; } /** * Create a ProgressTracker from suite results (for post-hoc rendering). */ export declare function fromSuiteResult(result: SuiteResult, options?: ProgressOptions): ProgressTracker; //# sourceMappingURL=progress.d.ts.map