import { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; /** * Whether a thrown error is an HTTP 404 from the Lexware client. * * `lexwareRequest` wraps AxiosErrors as `new Error(msg, { cause: axiosError })`, * so the status is on `err.cause.response.status` — that's the reliable signal. * * The message fallback exists for errors that lost their cause, and is anchored to * the two shapes `formatError` emits. It deliberately does NOT scan for a bare * "404" anywhere in the message: that text also appears in error bodies and in * voucher/invoice numbers, and a false positive here turns a real failure into a * silent retry loop. */ export declare function isNotFound(err: unknown): boolean; /** * Retry `fn` while Lexware reports the resource as not-yet-there: a 404, or an * empty body (`null` / `""`). Both are what the API returns for the window between * a file upload and the OCR voucher draft becoming readable. * * Anything else is re-thrown immediately and un-retried — a 401 or a 500 is not * going to resolve itself, and retrying would only delay a real error by 7 seconds. * * `delayMs` is injectable so tests run without fake timers; it is indexed by * attempt and falls back to its last entry. */ export declare function withProcessingRetry(fn: () => Promise, retries?: number, delayMs?: number[]): Promise; export declare function toolError(err: unknown): CallToolResult; export declare function formatResponse(data: unknown): CallToolResult; export declare function handleToolRequest(fn: (params: any) => Promise): (params: any) => Promise<{ [x: string]: unknown; content: ({ type: "text"; text: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; } | { type: "image"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; } | { type: "audio"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; } | { uri: string; name: string; type: "resource_link"; description?: string | undefined; mimeType?: string | undefined; size?: number | undefined; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; } | { type: "resource"; resource: { uri: string; text: string; mimeType?: string | undefined; _meta?: { [x: string]: unknown; } | undefined; } | { uri: string; blob: string; mimeType?: string | undefined; _meta?: { [x: string]: unknown; } | undefined; }; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; })[]; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; structuredContent?: { [x: string]: unknown; } | undefined; isError?: boolean | undefined; }>;