/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 *
 * @plan PLAN-20251213issue490
 * Phase 6: Failover Logic Implementation
 *
 * Implements bucket failover logic for handling quota and rate limit errors
 */
/**
 * Determines if an error should trigger failover to the next bucket
 *
 * Failover triggers:
 * - 429 rate limit
 * - Quota exceeded
 * - 402 payment required
 * - Token renewal failure
 *
 * Does NOT failover:
 * - 400 bad request
 * - Other API errors
 */
export declare function shouldFailover(error: Error): boolean;
export interface NotificationLog {
    messages: string[];
}
/**
 * Logs a bucket switch notification
 */
export declare function notifyBucketSwitch(fromBucket: string, toBucket: string, log: NotificationLog): void;
export interface ProfileBucketConfig {
    provider: string;
    buckets: string[];
}
/**
 * Resolves the bucket list for a profile, prioritizing session overrides
 */
export declare function resolveBucketsForFailover(profileConfig: ProfileBucketConfig, sessionBucket?: string): string[];
export interface BucketStatus {
    bucket: string;
    error: string;
}
/**
 * Formats comprehensive error when all buckets fail
 */
export declare function formatAllBucketsExhaustedError(provider: string, bucketStatuses: BucketStatus[]): Error;
export interface MockProfile {
    provider: string;
    model: string;
    auth?: {
        type: 'oauth';
        buckets: string[];
    };
}
export interface MockTokenStore {
    getToken: (provider: string, bucket: string) => Promise<unknown>;
}
/**
 * Validates buckets exist before profile can be loaded
 */
export declare function validateProfileBucketsExist(profile: MockProfile, tokenStore: MockTokenStore): Promise<{
    valid: boolean;
    errors: string[];
}>;
export interface MockToken {
    access_token: string;
    expiry: number;
}
/**
 * Determines if a token is expired
 */
export declare function isTokenExpired(token: MockToken): boolean;
export interface MockRequest {
    prompt: string;
}
export interface MockResponse {
    content: string;
}
export type RequestExecutor = (request: MockRequest, bucket: string) => Promise<MockResponse>;
/**
 * Executes a request with automatic bucket failover on quota/rate limit errors
 */
export declare function executeWithBucketFailover(request: MockRequest, buckets: string[], executor: RequestExecutor): Promise<MockResponse>;
