import type { ContentBlock, ImageBlock } from '../types/blocks.js'; /** * Wire shape for one image attached to a WebUI `user_message`. `data` may be * a bare base64 string or a full `data:` URL (the client normally strips the * prefix, but legacy senders shipped the whole URL). */ export interface IncomingImagePayload { data: string; mediaType?: string | undefined; /** Original filename, when the image came from a file picker or drop. */ name?: string | undefined; } export declare const MAX_INCOMING_IMAGES = 8; /** * Decoded-byte cap per image. The WebUI client downscales before sending, so * anything larger than this is either a bypassed client or an abuse attempt. * Kept under the servers' WS maxPayload once base64 overhead (~4/3) and the * surrounding JSON envelope are added. */ export declare const MAX_INCOMING_IMAGE_BYTES: number; /** Validation failure on user-supplied image payloads. The message is safe to * echo back to the client verbatim. */ export declare class IncomingImageError extends Error { constructor(message: string); } /** * Validate and normalize the `images` field of a `user_message` payload into * canonical {@link ImageBlock}s. Accepts the legacy single `imageBase64` * field (a data-URL) as a trailing entry so old clients keep working. * * Throws {@link IncomingImageError} on count/size/media-type violations. */ export declare function parseIncomingImages(images?: readonly IncomingImagePayload[] | undefined, legacyImageBase64?: string | undefined): ImageBlock[]; /** * Assemble the agent input for a user message that carries images: image * blocks first (the order vision providers prefer), then the text block. */ export declare function buildUserContentBlocks(text: string, images: readonly ImageBlock[]): ContentBlock[]; //# sourceMappingURL=incoming-images.d.ts.map