/** Truncate an upstream error body to a safe length for logging. */ export declare function previewBody(body: string): string; /** Base class for any Jina-related error. */ export declare class JinaError extends Error { constructor(message: string); } /** 401/403 — operator must rotate or refill the API key. */ export declare class JinaAuthError extends JinaError { constructor(status: number, bodyPreview: string); } /** 429 — Jina backed off; transient. */ export declare class JinaRateLimitError extends JinaError { constructor(bodyPreview: string); } /** Any other non-OK HTTP response. */ export declare class JinaApiError extends JinaError { readonly status: number; constructor(status: number, bodyPreview: string); } /** Network failure, abort, timeout. `cause` carries the original error. */ export declare class JinaNetworkError extends JinaError { constructor(reason: string, cause?: unknown); } /** * Classify an HTTP status code into the appropriate Jina error class. * Centralized so every endpoint wrapper produces consistent errors. */ export declare function errorForStatus(status: number, bodyPreview: string): JinaError; /** * Build a privacy-safe one-line description of any thrown value, suitable * for `logger.error(...)` in the hook handler. * * IMPORTANT: this MUST NOT include the upstream body preview that * `JinaError.message` carries — that preview can echo the user query or * chunks if Jina's error path mirrors the request. We expose only the * error CLASS and (when applicable) the HTTP status code. */ export declare function summarizeJinaError(err: unknown): string;