export type AuthType = 'api_key' | 'oauth'; export type PoolStrategy = 'fill_first' | 'round_robin' | 'random' | 'least_used'; export type CredentialStatus = 'ok' | 'exhausted'; export interface PooledCredential { provider: string; id: string; label?: string; authType: AuthType; priority: number; source: string; accessToken: string; refreshToken?: string; lastStatus: CredentialStatus; lastStatusAt: number; lastErrorCode?: number; expiresAt?: number; requestCount: number; extra: Record; } export interface CredentialStats { id: string; label?: string; source: string; requestCount: number; lastStatus: CredentialStatus; lastStatusAt: number; isExhausted: boolean; exhaustedUntil?: number; } declare const EXHAUSTED_TTL_429_SECONDS = 3600; declare const EXHAUSTED_TTL_DEFAULT_SECONDS = 3600; export declare class CredentialPool { private provider; private entries; private currentIndex; private leaseCounts; private strategy; constructor(provider: string, entries: PooledCredential[], strategy?: PoolStrategy); get providerName(): string; get size(): number; select(): PooledCredential | null; markFailed(credentialId: string, statusCode?: number): void; markRateLimited(credentialId: string, retryAfterSeconds?: number): void; markSuccess(credentialId: string): void; acquireLease(credentialId: string, maxConcurrent?: number): string | null; releaseLease(credentialId: string): void; resetStatuses(): void; addEntry(entry: PooledCredential): void; removeEntry(credentialId: string): boolean; getStats(): CredentialStats[]; getEntry(credentialId: string): PooledCredential | null; private availableEntries; private isExhausted; } export declare function createCredential(provider: string, apiKey: string, opts?: Partial>): PooledCredential; export declare function loadPoolFromEnv(provider: string): CredentialPool; export { EXHAUSTED_TTL_429_SECONDS, EXHAUSTED_TTL_DEFAULT_SECONDS }; //# sourceMappingURL=credential-pool.d.ts.map