/**
 * @fileoverview Cycle metrics tracker for respawn controller.
 *
 * Extracted from respawn-controller.ts for modularity. Tracks per-cycle metrics
 * and maintains aggregate statistics across all tracked cycles.
 *
 * @module respawn-metrics
 */
import type { RespawnCycleMetrics, RespawnAggregateMetrics, CycleOutcome } from './types.js';
/**
 * Tracks respawn cycle metrics and maintains aggregate statistics.
 *
 * Each respawn cycle is tracked from start to completion, recording timing,
 * steps completed, and outcome. Aggregate metrics provide a rolling view
 * of system health across recent cycles.
 */
export declare class RespawnCycleMetricsTracker {
    /** Current cycle being tracked */
    private currentCycleMetrics;
    /** Recent cycle metrics (rolling window for aggregate calculation) */
    private recentCycleMetrics;
    /** Aggregate metrics across all tracked cycles */
    private aggregateMetrics;
    /**
     * Start tracking metrics for a new cycle.
     * Called when a respawn cycle begins.
     *
     * @param sessionId - The session this cycle belongs to
     * @param cycleNumber - The cycle number within the session
     * @param idleReason - What triggered idle detection
     * @param idleDetectionStartTime - Timestamp when idle detection started
     * @param lastTokenCount - Token count at start of cycle
     * @param adaptiveCompletionConfirmMs - Completion confirm timeout used
     */
    startCycle(sessionId: string, cycleNumber: number, idleReason: string, idleDetectionStartTime: number, lastTokenCount: number, adaptiveCompletionConfirmMs: number): void;
    /**
     * Record a completed step in the current cycle.
     * @param step - Name of the step (e.g., 'update', 'clear', 'init')
     */
    recordStep(step: string): void;
    /**
     * Mark that /clear was skipped in the current cycle.
     */
    markClearSkipped(): void;
    /**
     * Get the current in-progress cycle metrics (for external inspection).
     * @returns The current cycle metrics, or null if no cycle is in progress
     */
    getCurrentCycle(): Partial<RespawnCycleMetrics> | null;
    /**
     * Complete the current cycle metrics with outcome.
     * Adds to recent metrics and updates aggregates.
     *
     * @param outcome - Outcome of the cycle
     * @param lastTokenCount - Token count at end of cycle
     * @param errorMessage - Optional error message if outcome is 'error'
     * @returns The completed cycle metrics, or null if no cycle was in progress
     */
    completeCycle(outcome: CycleOutcome, lastTokenCount: number, errorMessage?: string): RespawnCycleMetrics | null;
    /**
     * Get aggregate metrics for monitoring.
     * @returns Copy of aggregate metrics
     */
    getAggregate(): RespawnAggregateMetrics;
    /**
     * Get recent cycle metrics for analysis.
     * @param limit - Maximum number of metrics to return (default: 20)
     * @returns Recent cycle metrics, newest first
     */
    getRecent(limit?: number): RespawnCycleMetrics[];
    /**
     * Reset all metrics state.
     */
    reset(): void;
    /**
     * Update aggregate metrics with a new cycle's data.
     * @param metrics - The completed cycle metrics
     */
    private updateAggregateMetrics;
}
//# sourceMappingURL=respawn-metrics.d.ts.map