/**
 * @fileoverview Run Summary Tracker for Codeman sessions
 *
 * Tracks significant events during a session's lifetime to provide users
 * with a consolidated "what happened while I was away" view.
 *
 * Features:
 * - Event timeline with severity levels
 * - Aggregated statistics (respawn cycles, tokens, active time, etc.)
 * - State stuck detection (warning when state doesn't change for extended periods)
 * - Token milestone tracking (every 50k tokens)
 *
 * @module run-summary
 */
import { RunSummary, RunSummaryEvent, RunSummaryEventType, RunSummaryEventSeverity } from './types.js';
/**
 * Tracks events and statistics for a session's run summary.
 *
 * @example
 * ```typescript
 * const tracker = new RunSummaryTracker('session-123', 'My Session');
 *
 * // Record events
 * tracker.addEvent('session_started', 'info', 'Session started');
 * tracker.addEvent('idle_detected', 'success', 'Claude is idle');
 *
 * // Get the summary
 * const summary = tracker.getSummary();
 * ```
 */
export declare class RunSummaryTracker {
    private sessionId;
    private sessionName;
    private startedAt;
    private lastUpdatedAt;
    private events;
    private stats;
    private currentState;
    private stateEnteredAt;
    private stateStuckCheckTimer;
    private stateStuckWarned;
    private lastTokenMilestone;
    private isCurrentlyActive;
    private lastStatusChangeAt;
    private inRespawnCycle;
    constructor(sessionId: string, sessionName?: string);
    /**
     * Add an event to the timeline.
     */
    addEvent(type: RunSummaryEventType, severity: RunSummaryEventSeverity, title: string, details?: string, metadata?: Record<string, unknown>): RunSummaryEvent;
    /**
     * Record a state change (for respawn controller states).
     */
    recordStateChange(newState: string, details?: string): void;
    /**
     * Record when Claude becomes idle.
     */
    recordIdle(): void;
    /**
     * Record when Claude starts working.
     */
    recordWorking(): void;
    /**
     * Record token usage update.
     */
    recordTokens(inputTokens: number, outputTokens: number): void;
    /**
     * Record an AI idle check result.
     */
    recordAiCheckResult(verdict: string, confidence?: number): void;
    /**
     * Record an auto-compact event.
     */
    recordAutoCompact(tokens: number, threshold: number): void;
    /**
     * Record an auto-clear event.
     */
    recordAutoClear(tokens: number, threshold: number): void;
    /**
     * Record a Ralph completion detection.
     */
    recordRalphCompletion(phrase: string): void;
    /**
     * Record a hook event from Claude Code.
     */
    recordHookEvent(eventType: string, data?: Record<string, unknown>): void;
    /**
     * Record an error.
     */
    recordError(title: string, details?: string, metadata?: Record<string, unknown>): void;
    /**
     * Record a warning.
     */
    recordWarning(title: string, details?: string, metadata?: Record<string, unknown>): void;
    /**
     * Record session started.
     */
    recordSessionStarted(mode: string, workingDir: string): void;
    /**
     * Record session stopped.
     */
    recordSessionStopped(): void;
    /**
     * Get the complete run summary.
     */
    getSummary(): RunSummary;
    /**
     * Get recent events (for SSE updates).
     */
    getRecentEvents(count?: number): RunSummaryEvent[];
    /**
     * Update session name.
     */
    setSessionName(name: string): void;
    /**
     * Stop tracking and clean up.
     */
    stop(): void;
    private startStateStuckDetection;
    private formatTokens;
    private formatDuration;
}
//# sourceMappingURL=run-summary.d.ts.map