/** * Normalization and caps for vision images attached to tool results. * * Actions opt in by returning a well-known optional `_agentImages` field on * their result object; external MCP tools opt in by returning standard MCP * `image` content parts. Both funnel through `normalizeToolResultImages` so * the caps live in exactly one place: * * - at most {@link MAX_TOOL_RESULT_IMAGES} images per tool result, * - at most {@link MAX_TOOL_RESULT_IMAGE_BASE64_CHARS} base64 chars each. * * Dropped images become model-readable text notes instead of failing the tool * call. Accepted images become `EngineToolResultImagePart`s that live only on * the in-memory turn — the run ledger persists the string result (which * carries a compact `[image: …]` note per image), never base64 payloads. */ import type { EngineToolResultImagePart } from "./engine/types.js"; /** Well-known optional field on action results carrying result images. */ export declare const AGENT_IMAGES_FIELD = "_agentImages"; export declare const MAX_TOOL_RESULT_IMAGES = 4; /** ~2MB of base64 (≈1.5MB decoded) per image; larger becomes a text note. */ export declare const MAX_TOOL_RESULT_IMAGE_BASE64_CHARS = 2000000; export interface NormalizedToolResultImages { images: EngineToolResultImagePart[]; /** Model-readable notes for images that were dropped (oversize/invalid). */ notes: string[]; } /** * Validate and cap a raw `_agentImages`-shaped array. Never throws; anything * invalid or over-cap becomes a note the model can read. */ export declare function normalizeToolResultImages(raw: unknown): NormalizedToolResultImages; /** * Detect and strip the `_agentImages` field from an action result object. * Returns the value to stringify for the model (field removed) plus the * normalized images and drop notes. Non-objects pass through untouched. */ export declare function extractAgentImagesFromActionResult(value: unknown): { value: unknown; images: EngineToolResultImagePart[]; notes: string[]; }; /** * Compact per-image notes appended to the string result. This is what the * run ledger / journal persists — URLs survive verbatim; base64 becomes a * `[image: , …]` placeholder (never the payload). */ export declare function describeToolResultImages(images: EngineToolResultImagePart[]): string[]; //# sourceMappingURL=tool-result-images.d.ts.map