/** * Rate limit reason classification and backoff calculation utilities. * Ported from opencode-antigravity-auth plugin for consistency. */ export type RateLimitReason = "QUOTA_EXHAUSTED" | "RATE_LIMIT_EXCEEDED" | "MODEL_CAPACITY_EXHAUSTED" | "SERVER_ERROR" | "UNKNOWN"; /** * Classify a rate-limit error message into a reason category. * Priority order: MODEL_CAPACITY > RATE_LIMIT > QUOTA > SERVER_ERROR > UNKNOWN. * * "resource exhausted" maps to MODEL_CAPACITY (transient, short wait) * "quota exceeded" maps to QUOTA_EXHAUSTED (long wait, switch account) */ export declare function parseRateLimitReason(errorMessage: string): RateLimitReason; /** * Calculate backoff delay in ms for a given rate limit reason. * MODEL_CAPACITY gets jitter to prevent thundering herd. */ export declare function calculateRateLimitBackoffMs(reason: RateLimitReason): number; export declare function isUsageLimitError(errorMessage: string): boolean;