/** * Error handling utilities for the Mastra Code TUI. * Parses API errors and provides user-friendly messages. */ export interface ParsedError { /** User-friendly error message */ message: string; /** Extra diagnostic detail to surface to the user */ detail?: string; /** Request URL involved in the failure, when available */ requestUrl?: string; /** Error type for categorization */ type: ErrorType; /** Whether this error is retryable */ retryable: boolean; /** Suggested retry delay in ms (if retryable) */ retryDelay?: number; /** Original error for debugging */ originalError: Error; } export type ErrorType = 'rate_limit' | 'auth' | 'network' | 'timeout' | 'invalid_request' | 'server_error' | 'model_not_found' | 'context_length' | 'content_filter' | 'unknown'; export declare function parseError(error: unknown): ParsedError; /** * Sleep for a given number of milliseconds. */ export declare function sleep(ms: number): Promise; /** * Retry a function with exponential backoff. */ export declare function withRetry(fn: () => Promise, options?: { maxRetries?: number; initialDelay?: number; maxDelay?: number; onRetry?: (error: ParsedError, attempt: number) => void; }): Promise; //# sourceMappingURL=errors.d.ts.map