import type { SuperagentToolCall } from '../types'; /** * Screenshot-style results are an array of `image_url` content blocks (or the * JSON string thereof) — port of the web tools-ui `extractImageUrl`. */ export declare function extractImageUrl(results: unknown): string | null; /** * Stock image the backend persists into `tool_call.results` for a failed or * cancelled generate_image — a reloaded card must read it as a failure, not a * real image. Keep in sync with FALLBACK_IMAGE_URL in * backend/app/user_apps/builder/chat/image_placeholder_replacement.py. */ export declare const FALLBACK_IMAGE_URL = "https://static.wixstatic.com/media/12d367_4f26ccd17f8f4e3a8958306ea08c2332~mv2.png"; /** * Coerce a generated-image result into a plain URL string. `results` can be a * URL string, a `{ url }` object, a JSON-encoded form of either, or an array * of `image_url` blocks — port of the web normalizeImageUrl. */ export declare function normalizeImageUrl(value: unknown): string | null; /** The `label` arg, tolerating a still-streaming arguments string. */ export declare function getMediaLabel(toolCall: SuperagentToolCall): string; export type GeneratedImageStatus = 'generating' | 'ready' | 'failed'; export type GeneratedImageItem = { id: string; /** Title from the tool args; empty until it streams in. */ label: string; /** Resolved image URL once ready, otherwise null. */ url: string | null; status: GeneratedImageStatus; }; export type GeneratedImagesResult = { items: GeneratedImageItem[]; readyCount: number; total: number; allDone: boolean; }; /** * Turn a batch of generate_image calls into render-ready items — port of the * web useGeneratedImages, minus its `imagePreviewUrls` socket map: the tool * returns a pending generation-state object instantly. The web swaps it live * via the image_ready socket; natively the completed state arrives with the * next message refresh. Until then the item stays `generating`. */ export declare function getGeneratedImages(toolCalls: SuperagentToolCall[]): GeneratedImagesResult; /** * Header copy for a generated-images batch — same shapes as the web * useGeneratedImagesHeader: a single image reads plainly, two or more get live * `ready/total` progress, and partial failures are called out explicitly. */ export declare function getGeneratedImagesHeader({ allDone, readyCount, total }: GeneratedImagesResult): string; export type ScreenshotState = { phase: 'ready' | 'running' | 'error' | 'taken'; imageUrl: string | null; }; /** * State machine of the web Browserbase screenshot card: once the image_url * result lands the row is 'ready'; a settled call without an image is a plain * 'taken' success row; otherwise the row keeps spinning (status can flip to * success before results land — web parity). */ export declare function getScreenshotState(toolCall: SuperagentToolCall): ScreenshotState; //# sourceMappingURL=mediaWidgetUtils.d.ts.map