/** * The end-to-end "prompt in, files on disk out" flow, shared by the standalone * MCP server (src/index.ts) and by embedders that use this package as a library. * * Keeping this here rather than in the tool handler means input validation, * the MIME allowlist, the 20 MB input cap and the output naming scheme all stay * in one place instead of being reimplemented per host. */ import type { ImageRegistry } from "./providers/registry.js"; import type { Background } from "./providers/types.js"; export type Resolution = "1K" | "2K" | "4K"; export type AspectRatio = "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "9:16" | "16:9" | "21:9"; export type GenerationMode = "image" | "image_and_text"; export type Thinking = "none" | "auto"; export declare const RESOLUTIONS: Resolution[]; export declare const ASPECT_RATIOS: AspectRatio[]; export declare const BACKGROUNDS: Background[]; export interface GenerateImageOptions { /** Registry to resolve `model` against. */ registry: ImageRegistry; prompt: string; /** Friendly model name (e.g. "gpt-image-2"). */ model: string; resolution?: Resolution; aspectRatio?: AspectRatio; /** Google models only; ignored elsewhere. */ mode?: GenerationMode; /** Google models only; ignored elsewhere. */ thinking?: Thinking; /** * What the image sits on. Defaults to "auto". * * "transparent" only reaches providers that declare * `supportsTransparentBackground` (OpenAI gpt-image models); any other model * is rejected rather than quietly handed back an opaque image. */ background?: Background; /** * Where to write the generated files. Relative paths resolve against * `outputBaseDir` when one is set, otherwise against process.cwd(). */ outputDir?: string; /** * Sandbox root. When set, output and input paths must stay inside it * (symlinks are resolved and re-checked). Pass `null` — the default — for no * path restriction, which is the right choice when the caller already * controls which paths reach this function. */ outputBaseDir?: string | null; /** Paths of images to send alongside the prompt. */ inputImages?: string[]; } export interface GenerateImageOutcome { /** The provider-level model id that actually ran. */ model: string; /** Absolute paths of the files written. */ savedFiles: string[]; /** Text returned alongside the image (Google models in image_and_text mode). */ description?: string; settings: { resolution: Resolution; aspectRatio: AspectRatio; mode: GenerationMode; background: Background; }; } /** * Read, validate and buffer the input images for a request. Shared with the * video flow so both enforce the same allowlist and size cap. */ export declare function readInputImages(inputImages: string[], outputBaseDir: string | null): Promise<{ buffers: Buffer[]; mimeTypes: string[]; }>; /** Generate images and write them to disk, returning the paths written. */ export declare function generateImageToDisk(options: GenerateImageOptions): Promise; //# sourceMappingURL=generate.d.ts.map