/** Raised for a document we will not send onward. The caller turns this into a clean 4xx/502. */ export declare class DocumentError extends Error { } export interface TranscodeOptions { /** Override the MarkItDown executable (default `markitdown`, or $LLM_RELAY_MARKITDOWN). */ command?: string; maxBytes?: number; timeoutMs?: number; /** Injected in tests. */ runner?: (buf: Buffer, ext: string, opts: Required>) => Promise; } /** * True if the request carries at least one `document` content block — at the top level of a * turn, or nested inside a `tool_result`. */ export declare function hasDocumentBlocks(body: unknown): boolean; export declare function clearDocumentCache(): void; /** * Replace every `document` block with a markdown `text` block. Returns a NEW body — * the caller's object is not mutated. Throws `DocumentError` if any document cannot * be converted; there is no partial success, because a request that silently lost one * of its attachments looks identical to one that never had it. */ export declare function transcodeDocuments(body: unknown, opts?: TranscodeOptions): Promise;