import { ErrorCategory, type VoiceErrorPacket } from "./packets.js"; /** * Categorize an error from the STT provider. * * Heuristic: * - HTTP 429 → RateLimit (recoverable) * - Network errors (ECONNRESET, ETIMEDOUT, ENOTFOUND) → NetworkTimeout (recoverable) * - HTTP 401/403 → Authentication (fatal) * - HTTP 400/422 → InvalidInput (fatal) * - HTTP 402 → ResourceExhausted (fatal) * - Everything else → InternalFault (fatal) */ export declare function categorizeSttError(err: unknown): ErrorCategory; /** * Categorize an error from the TTS provider. * Same heuristic as STT — TTS providers have similar error patterns. */ export declare function categorizeTtsError(err: unknown): ErrorCategory; /** * Categorize an error from the LLM provider. * * Additional LLM-specific heuristics: * - "context length exceeded" → InvalidInput (fatal) * - "content filter" / "safety" → InvalidInput (fatal) */ export declare function categorizeLlmError(err: unknown): ErrorCategory; /** * Returns true if the error category is recoverable (retry with backoff). */ export declare function isRecoverable(category: ErrorCategory): boolean; /** * Returns true if the error packet represents a fatal error. */ export declare function isFatalError(pkt: VoiceErrorPacket): boolean; //# sourceMappingURL=error-handler.d.ts.map