/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Error thrown when authentication is required but not available */ export declare class AuthenticationRequiredError extends Error { readonly authMode: string; readonly requiredAuth?: string[]; constructor(message: string, authMode: string, requiredAuth?: string[]); } /** * @plan:PLAN-20251023-STATELESS-HARDENING.P03 * @requirement:REQ-SP4-001 * @pseudocode base-provider-runtime-guard.md lines 10-14 */ export declare class MissingProviderRuntimeError extends Error { /** * Call-site provider identifier (e.g. `BaseProvider.openai`). */ readonly providerKey: string; /** * Required runtime properties that were not supplied. */ readonly missingFields: readonly string[]; /** * Requirement tag to aid verification harnesses. */ readonly requirement: string; /** * Recommendations for callers to remediate the guard failure. */ readonly remediation: readonly string[]; /** * Structured metadata attached to the error for diagnostics. */ readonly context: { stage?: string; metadata?: Record; }; /** * @plan:PLAN-20251023-STATELESS-HARDENING.P05 * @requirement:REQ-SP4-001 * @pseudocode base-provider-fallback-removal.md lines 11-12 */ constructor({ providerKey, missingFields, requirement, remediation, stage, metadata, message, }: { providerKey: string; missingFields: string[]; requirement?: string; remediation?: string[]; stage?: string; metadata?: Record; message?: string; }); } /** * @plan:PLAN-20251023-STATELESS-HARDENING.P08 * @requirement:REQ-SP4-002 * @pseudocode provider-runtime-handling.md lines 11-12 */ export declare class ProviderRuntimeNormalizationError extends Error { readonly providerKey: string; readonly requirement: string; readonly context: { runtimeId?: string; stage?: string; metadata?: Record; }; constructor({ providerKey, message, requirement, runtimeId, stage, metadata, }: { providerKey: string; message: string; requirement?: string; runtimeId?: string; stage?: string; metadata?: Record; }); } /** * @plan:PLAN-20251023-STATELESS-HARDENING.P08 * @requirement:REQ-SP4-004 * @pseudocode logging-wrapper-adjustments.md lines 11, 15 */ export declare class ProviderRuntimeScopeError extends Error { readonly requirement: string; readonly context: { callId?: string; stage?: string; metadata?: Record; }; constructor({ message, requirement, callId, stage, metadata, }: { message: string; requirement?: string; callId?: string; stage?: string; metadata?: Record; }); } /** * Error thrown when all backends in a load balancer failover policy have failed * @plan PLAN-20251212issue488 */ export declare class LoadBalancerFailoverError extends Error { readonly profileName: string; readonly failures: ReadonlyArray<{ readonly profile: string; readonly error: Error; }>; constructor(profileName: string, failures: Array<{ profile: string; error: Error; }>); } /** * @plan PLAN-20260128issue808 * Standardized provider error hierarchy for RetryOrchestrator * * Base class for all provider errors with consistent retry/failover behavior */ export declare abstract class ProviderError extends Error { abstract readonly category: 'rate_limit' | 'quota' | 'authentication' | 'server_error' | 'network' | 'client_error'; abstract readonly isRetryable: boolean; abstract readonly shouldFailover: boolean; readonly status?: number; readonly retryAfter?: number; readonly cause?: Error; constructor(message: string, options?: { status?: number; retryAfter?: number; cause?: Error; }); } /** * Error for rate limit (429) responses * Retryable with exponential backoff, triggers bucket failover */ export declare class RateLimitError extends ProviderError { readonly category: "rate_limit"; readonly isRetryable = true; readonly shouldFailover = true; } /** * Error for quota exceeded (402 payment required) * Triggers immediate bucket failover */ export declare class QuotaError extends ProviderError { readonly category: "quota"; readonly isRetryable = true; readonly shouldFailover = true; } /** * Error for authentication failures (401/403) * Retryable once to allow token refresh, then triggers bucket failover */ export declare class AuthenticationError extends ProviderError { readonly category: "authentication"; readonly isRetryable = true; readonly shouldFailover = true; } /** * Error for server errors (5xx) * Retryable with exponential backoff, does not trigger bucket failover */ export declare class ServerError extends ProviderError { readonly category: "server_error"; readonly isRetryable = true; readonly shouldFailover = false; } /** * Error for network/transient errors (ECONNRESET, etc.) * Retryable with exponential backoff, does not trigger bucket failover */ export declare class NetworkError extends ProviderError { readonly category: "network"; readonly isRetryable = true; readonly shouldFailover = false; } /** * Error for client errors (400, 404, etc.) * Not retryable, does not trigger bucket failover */ export declare class ClientError extends ProviderError { readonly category: "client_error"; readonly isRetryable = false; readonly shouldFailover = false; } /** * @plan PLAN-20260223-ISSUE1598.P03 * @requirement REQ-1598-IC08 * @pseudocode error-reporting.md lines 3-8 */ export type BucketFailureReason = 'quota-exhausted' | 'expired-refresh-failed' | 'reauth-failed' | 'no-token' | 'skipped'; /** * Thrown when all OAuth buckets are exhausted during failover * @plan PLAN-20260128issue808 * @plan PLAN-20260223-ISSUE1598.P06 * @requirement REQ-1598-ER01, REQ-1598-ER02, REQ-1598-ER03 * @pseudocode error-reporting.md lines 10-40 */ export declare class AllBucketsExhaustedError extends Error { readonly attemptedBuckets: string[]; readonly lastError: Error; readonly bucketFailureReasons: Record; constructor(providerName: string, attemptedBuckets: string[], lastError: Error, bucketFailureReasons?: Record); }