/**
 * Circuit Breaker Registry
 *
 * Per-provider circuit breaker singletons. Activates the existing
 * SyncCircuitBreaker (previously dead code) as per-provider instances.
 *
 * @module core/sync/circuit-breaker-registry
 */
import { SyncCircuitBreaker } from '../increment/sync-circuit-breaker.js';
export class CircuitBreakerRegistry {
    constructor() {
        this.breakers = new Map();
    }
    get(provider) {
        let breaker = this.breakers.get(provider);
        if (!breaker) {
            breaker = new SyncCircuitBreaker();
            this.breakers.set(provider, breaker);
        }
        return breaker;
    }
    getAll() {
        const result = {};
        for (const [provider, breaker] of this.breakers) {
            result[provider] = breaker.getState();
        }
        return result;
    }
    reset(provider) {
        this.breakers.delete(provider);
    }
}
//# sourceMappingURL=circuit-breaker-registry.js.map