import { STT, LLM, TTS } from './providers.js'; /** Default seconds a failing provider is skipped before being retried. */ export declare const DEFAULT_TEMPORARY_DISABLE_SEC = 60; /** Default number of failed attempts after which a provider is disabled for the session. */ export declare const DEFAULT_PERMANENT_DISABLE_AFTER_ATTEMPTS = 3; /** Default seconds between background health checks of a disabled provider. */ export declare const DEFAULT_RECOVERY_CHECK_INTERVAL_SEC = 300; /** Failover tuning options shared by all fallback providers. */ export type FallbackOptions = { /** Seconds to skip a failing provider before retrying. Defaults to {@link DEFAULT_TEMPORARY_DISABLE_SEC}. */ temporaryDisableSec?: number; /** Failed attempts after which a provider is disabled for the session. Defaults to {@link DEFAULT_PERMANENT_DISABLE_AFTER_ATTEMPTS}. */ permanentDisableAfterAttempts?: number; /** Seconds between health checks of a disabled provider. Defaults to {@link DEFAULT_RECOVERY_CHECK_INTERVAL_SEC}. */ recoveryCheckIntervalSec?: number; /** * Latency ceiling in ms for the active provider. When exceeded for * `consecutiveLatencyHits` turns in a row, the chain fails over. Omitted/0 = disabled. */ latencyThresholdMs?: number | null; /** Consecutive turns over `latencyThresholdMs` before failing over. Defaults to 3. */ consecutiveLatencyHits?: number; /** Additional provider-specific options, passed through unchanged. */ [key: string]: any; }; declare class FallbackSTTImpl extends STT { _providerName: string; providers: STT[]; protected _primary: STT | null; protected _temporaryDisableSec: number; protected _permanentDisableAfterAttempts: number; protected _recoveryCheckIntervalSec: number; protected _latencyThresholdMs: number | null; protected _consecutiveLatencyHits: number; constructor(providers: STT[], opts?: FallbackOptions); getRuntimeConfig(): Record; } /** A speech-to-text provider that fails over across an ordered list of {@link STT} providers. */ export type FallbackSTT = FallbackSTTImpl; /** * Create an {@link STT} provider that tries each provider in order, failing over * to the next when one is unavailable. * @param providers - Providers in priority order; the first is the primary. * @param opts - Failover tuning. See {@link FallbackOptions}. */ export declare const FallbackSTT: (providers: STT[], opts?: FallbackOptions) => FallbackSTT; declare class FallbackLLMImpl extends LLM { _providerName: string; providers: LLM[]; protected _primary: LLM | null; protected _temporaryDisableSec: number; protected _permanentDisableAfterAttempts: number; protected _recoveryCheckIntervalSec: number; protected _latencyThresholdMs: number | null; protected _consecutiveLatencyHits: number; constructor(providers: LLM[], opts?: FallbackOptions); getRuntimeConfig(): Record; } /** An LLM provider that fails over across an ordered list of {@link LLM} providers. */ export type FallbackLLM = FallbackLLMImpl; /** * Create an {@link LLM} provider that tries each provider in order, failing over * to the next when one is unavailable. The primary's `temperature` and * `max_output_tokens` settings carry through. * @param providers - Providers in priority order; the first is the primary. * @param opts - Failover tuning. See {@link FallbackOptions}. */ export declare const FallbackLLM: (providers: LLM[], opts?: FallbackOptions) => FallbackLLM; declare class FallbackTTSImpl extends TTS { _providerName: string; providers: TTS[]; protected _primary: TTS | null; protected _temporaryDisableSec: number; protected _permanentDisableAfterAttempts: number; protected _recoveryCheckIntervalSec: number; protected _latencyThresholdMs: number | null; protected _consecutiveLatencyHits: number; constructor(providers: TTS[], opts?: FallbackOptions); getRuntimeConfig(): Record; } /** A text-to-speech provider that fails over across an ordered list of {@link TTS} providers. */ export type FallbackTTS = FallbackTTSImpl; /** * Create a {@link TTS} provider that tries each provider in order, failing over * to the next when one is unavailable. * @param providers - Providers in priority order; the first is the primary. * @param opts - Failover tuning. See {@link FallbackOptions}. */ export declare const FallbackTTS: (providers: TTS[], opts?: FallbackOptions) => FallbackTTS; export {};