import type { ProviderContext } from '../api/provider-types.js'; export declare class RateLimitCooldownError extends Error { statusCode: number; code: string; retryable: boolean; details?: Record; constructor(message: string, waitMs?: number); } export declare class RateLimitBackoffManager { private readonly schedule; private readonly seriesBlacklistDurationMs; private readonly buckets; private readonly seriesBlacklist; constructor(schedule?: number[], seriesBlacklistDurationMs?: number); /** * 根据外部传入的冷却时间(例如上游返回的 quotaResetDelay)直接对整个系列做一次性降温。 * 这用于 Gemini / Gemini CLI / antigravity 这类按模型系列限流的场景, * 避免在明确知道冷却窗口后仍然多次命中真实 429。 */ applySeriesCooldown(providerKey?: string, model?: string, cooldownMs?: number): void; shouldThrottle(providerKey?: string, model?: string): { blocked: boolean; reason?: string; waitMs?: number; }; record429(providerKey?: string, model?: string): { cooldownMs: number; consecutive: number; seriesBlacklisted: boolean; }; reset(providerKey?: string, model?: string): void; buildThrottleError(context: Pick): RateLimitCooldownError | null; private buildBucketKey; private buildSeriesKey; private resolveSeries; }