import { z } from 'zod'; export interface UploadSource { filePath?: string; contentBase64?: string; fileName?: string; contentType?: string; } export interface ResolvedUpload { buffer: Buffer; fileName: string; contentType: string; } /** * Build an upload tool's input schema: the caller's own params (e.g. the voucher * `id`) first, so they keep their leading position in the emitted `required[]`, * then the shared source params, then the two cross-field rules. * * Zod 4 folds `.refine()` into the schema itself rather than wrapping it in a * ZodEffects, so the returned object still exposes `.shape` and still converts * to a flat JSON Schema for `tools/list`. */ export declare function uploadInputSchema(extra: Shape): z.ZodObject; contentBase64: z.ZodOptional; fileName: z.ZodOptional; contentType: z.ZodOptional; } extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>; /** * Turn a validated upload input into the (buffer, fileName, contentType) triple * `lexwareUpload` takes. * * The filePath branch resolves symlinks and probes readability BEFORE reading, so * a bad path fails with a message naming the path and the OS error instead of a * bare ENOENT from deep inside the read. Both failures chain the original error as * `cause` — the errno, syscall and path stay recoverable for a caller that inspects * it, while the message stays readable. * * Oversized payloads are rejected before their bytes are ever loaded. */ export declare function resolveUpload(params: UploadSource): ResolvedUpload;