/**
 * CircuitBreaker -- Prevents cascading agent failures.
 * OWASP ASI08 remediation.
 *
 * States:
 *   CLOSED  - Normal operation. Failures tracked but below threshold.
 *   OPEN    - Agent suspended. All operations blocked.
 *   HALF    - Probationary. One test cycle allowed.
 *
 * @connexum/ai-governance
 */
export type CircuitState = 'CLOSED' | 'OPEN' | 'HALF_OPEN';
export interface CircuitBreakerConfig {
    /** Path to store circuit breaker state */
    stateDir: string;
    /** Agent name */
    agentName: string;
    /** Consecutive failures before OPEN (default: 3) */
    failureThreshold?: number;
    /** Milliseconds before trying HALF_OPEN (default: 600000 = 10 min) */
    halfOpenAfterMs?: number;
}
export interface CircuitBreakerState {
    state: CircuitState;
    consecutiveFailures: number;
    lastFailure: string | null;
    lastSuccess: string | null;
    openedAt: string | null;
    totalFailures: number;
    totalSuccesses: number;
}
export declare class CircuitBreaker {
    private stateFile;
    private failureThreshold;
    private halfOpenAfterMs;
    private agentName;
    constructor(config: CircuitBreakerConfig);
    /**
     * Check if the agent is allowed to execute.
     */
    allowExecution(): boolean;
    /**
     * Record a successful operation.
     */
    recordSuccess(): void;
    /**
     * Record a failed operation.
     */
    recordFailure(reason?: string): void;
    /**
     * Get current state (read-only).
     */
    getState(): CircuitBreakerState;
    /**
     * Manually reset circuit breaker to CLOSED.
     * Only for human operator use.
     */
    reset(): void;
    private loadState;
    private saveState;
}
//# sourceMappingURL=circuit-breaker.d.ts.map