/** * Unified Error Handling System for CLI Providers * * Provides consistent error classification, user-friendly messages, and debugging support * across all AI providers (Claude, Codex, Cursor) */ export declare enum ErrorType { AUTHENTICATION = "authentication", BILLING = "billing", RATE_LIMIT = "rate_limit", NETWORK = "network", TIMEOUT = "timeout", VALIDATION = "validation", PERMISSION = "permission", CLI_NOT_FOUND = "cli_not_found", CLI_NOT_INSTALLED = "cli_not_installed", MODEL_NOT_SUPPORTED = "model_not_supported", INVALID_REQUEST = "invalid_request", SERVER_ERROR = "server_error", UNKNOWN = "unknown" } export declare enum ErrorSeverity { LOW = "low", MEDIUM = "medium", HIGH = "high", CRITICAL = "critical" } export interface ErrorClassification { type: ErrorType; severity: ErrorSeverity; userMessage: string; technicalMessage: string; suggestedAction?: string; retryable: boolean; provider?: string; context?: Record; } export interface ErrorPattern { type: ErrorType; severity: ErrorSeverity; patterns: RegExp[]; userMessage: string; suggestedAction?: string; retryable: boolean; } /** * Classify an error into a specific type with user-friendly message */ export declare function classifyError(error: unknown, provider?: string, context?: Record): ErrorClassification; /** * Get a user-friendly error message */ export declare function getUserFriendlyErrorMessage(error: unknown, provider?: string): string; /** * Check if an error is retryable */ export declare function isRetryableError(error: unknown): boolean; /** * Check if an error is authentication-related */ export declare function isAuthenticationError(error: unknown): boolean; /** * Check if an error is billing-related */ export declare function isBillingError(error: unknown): boolean; /** * Check if an error is rate limit related */ export declare function isRateLimitError(error: unknown): boolean; /** * Create a standardized error response */ export declare function createErrorResponse(error: unknown, provider?: string, context?: Record): { success: false; error: string; errorType: ErrorType; severity: ErrorSeverity; retryable: boolean; suggestedAction?: string; }; /** * Log error with full context */ export declare function logError(error: unknown, provider?: string, operation?: string, additionalContext?: Record): void; /** * Provider-specific error handlers */ export declare const ProviderErrorHandler: { claude: { classify: (error: unknown) => ErrorClassification; getUserMessage: (error: unknown) => string; isAuth: (error: unknown) => boolean; isBilling: (error: unknown) => boolean; isRateLimit: (error: unknown) => boolean; }; codex: { classify: (error: unknown) => ErrorClassification; getUserMessage: (error: unknown) => string; isAuth: (error: unknown) => boolean; isBilling: (error: unknown) => boolean; isRateLimit: (error: unknown) => boolean; }; cursor: { classify: (error: unknown) => ErrorClassification; getUserMessage: (error: unknown) => string; isAuth: (error: unknown) => boolean; isBilling: (error: unknown) => boolean; isRateLimit: (error: unknown) => boolean; }; }; /** * Create a retry handler for retryable errors */ export declare function createRetryHandler(maxRetries?: number, baseDelay?: number): (operation: () => Promise, shouldRetry?: (error: unknown) => boolean) => Promise; //# sourceMappingURL=error-handler.d.ts.map