export declare class TransientLlmError extends Error { readonly retryReason: "transient"; readonly status?: number; constructor(args: { message: string; status?: number; }); } export declare class RateLimitLlmError extends Error { readonly retryReason: "rate_limit"; readonly status?: number; constructor(args: { message: string; status?: number; }); } /** * Persistent provider budget exhaustion — OpenAI `insufficient_quota`, * surfaced as a 429 whose body carries that code/type. Distinct from * the transient {@link RateLimitLlmError} throttle: the framework reads * the `quota_exhausted` tag, which is absent from every default * `retryOn`, so the stage fails fast on attempt 1 and reports the * distinct `LLM_QUOTA_EXHAUSTED` code. Carries the same optional * `status` as the sibling error family for caller observability. */ export declare class QuotaExhaustedLlmError extends Error { readonly retryReason: "quota_exhausted"; readonly status?: number; constructor(args: { message: string; status?: number; }); } /** * Thrown when the OpenAI Responses API rejects our request because * the model's output failed strict-mode JSON-Schema enforcement on * the OpenAI side (typical 400/422 errors). Tagged `transient` so * the framework's default retry policy retries — a single re-roll * often produces conforming output. (The framework's separate * `OUTPUT_SCHEMA_INVALID` path catches output that passes the * provider but fails our local TypeBox check; this class is the * provider-side analogue.) */ export declare class SchemaValidationLlmError extends Error { readonly retryReason: "transient"; readonly status?: number; constructor(args: { message: string; status?: number; }); } export declare class NonRetryableLlmError extends Error { readonly status?: number; constructor(args: { message: string; status?: number; }); } export declare class ToolLoopExhaustedError extends Error { readonly rounds: number; constructor(args: { message: string; rounds: number; }); } /** * Thrown by {@link retrieveResponse} (and the background poll loop) when * a stored response is not found (HTTP 404). This typically means the * ~10-minute retention window has elapsed. Callers should clear the * stored id, settle the associated stage as failed, and surface a retry * prompt. * * Extends {@link NonRetryableLlmError} so it inherits the fail-fast * disposition: a 404 is deterministic — re-fetching the same aged-out id * will 404 again — so the framework must not burn a retry. Inheriting the * base (which carries **no** `retryReason` tag) means `llmStage` * classifies it as `non_retryable`, exactly as the prior generic * `NonRetryableLlmError` did when a 404 surfaced mid-poll — so this is a * strictly more specific, behavior-preserving subclass. Callers that * `instanceof NonRetryableLlmError` still match; callers wanting the * aged-out signal specifically can `instanceof ResponseNotFoundError`. */ export declare class ResponseNotFoundError extends NonRetryableLlmError { readonly responseId: string; constructor(args: { responseId: string; }); } /** * Route an HTTP status family (plus an optional structured provider * error code) into the framework-recognized error class. See the * status→class mapping at the head of the OpenAI provider for the * rationale behind each branch. */ export declare function classifyHttpError(status: number, message: string, providerErrorCode?: string): Error; export declare function formatIncompleteMessage(reason: string): string; //# sourceMappingURL=errors.d.ts.map