import { type LLMProviders } from '../LLMService.typedefs'; export interface LLMGatewayErrorContext { promptName: string; provider?: LLMProviders; model?: string; cause?: unknown; } /** * Base class for every error the v2 client throws. Carries the prompt name plus * the resolved provider/model so callers can attribute a failure to one * operation without inspecting the cause chain. */ export declare class LLMGatewayError extends Error { readonly promptName: string; readonly provider: LLMProviders | undefined; readonly model: string | undefined; constructor(message: string, context: LLMGatewayErrorContext); } /** * Upstream provider failure. `retryable` is true when the v2 retry policy may * re-attempt the request (timeouts, 5xx, rate limits); false for deterministic * provider rejections (malformed request, auth). */ export declare class LLMProviderError extends LLMGatewayError { readonly retryable: boolean; readonly status: number | null; constructor(message: string, context: LLMGatewayErrorContext & { retryable: boolean; status?: number | null; }); } /** * The model returned text that failed schema validation after the internal * JSON-fixer retry. `rawText` is the unparsed completion and `parseDetails` * the validator message, so a caller can attempt its own recovery. */ export declare class LLMSchemaValidationError extends LLMGatewayError { readonly rawText: string; readonly parseDetails: string; constructor(message: string, context: LLMGatewayErrorContext & { rawText: string; parseDetails: string; }); } /** * The call was aborted via its `AbortSignal` before completion. */ export declare class LLMAbortedError extends LLMGatewayError { } /** * Configuration could not be resolved into a usable call: live config and the * fallback snapshot are both unusable, or per-call overrides were passed to a * production-mode client. */ export declare class LLMConfigError extends LLMGatewayError { } export declare function isLLMGatewayError(error: unknown): error is LLMGatewayError; export declare function toErrorMessage(error: unknown): string;