import { type Model } from "@gajae-code/ai/core"; import * as z from "zod/v4"; import { type ModelRegistry } from "../config/model-registry"; import { type ModelRoleSettings } from "../config/model-resolver"; import type { CustomTool } from "../extensibility/custom-tools/types"; export declare function redactImageProviderText(value: unknown, activeApiKey?: string): string; type ImageProvider = "alibaba" | "antigravity" | "gemini" | "openai" | "openai-codex" | "openrouter"; export declare class UnsupportedImageProviderError extends Error { readonly provider: string; readonly modelId: string; readonly api: Model["api"]; readonly code: "unsupported_image_provider"; constructor(provider: string, modelId: string, api: Model["api"]); } declare const responseModalitySchema: z.ZodEnum<{ IMAGE: "IMAGE"; TEXT: "TEXT"; }>; export declare const imageGenSchema: z.ZodObject<{ subject: z.ZodString; action: z.ZodOptional; scene: z.ZodOptional; composition: z.ZodOptional; lighting: z.ZodOptional; style: z.ZodOptional; text: z.ZodOptional; changes: z.ZodOptional>; aspect_ratio: z.ZodOptional>; image_size: z.ZodOptional>; input: z.ZodOptional; data: z.ZodOptional; mime_type: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strict>; export type ImageGenParams = z.infer; export type GeminiResponseModality = z.infer; interface GeminiSafetyRating { category?: string; probability?: string; } interface GeminiPromptFeedback { blockReason?: string; safetyRatings?: GeminiSafetyRating[]; } interface GeminiUsageMetadata { promptTokenCount?: number; candidatesTokenCount?: number; totalTokenCount?: number; } interface OpenAIResponsesUsage { input_tokens?: number; output_tokens?: number; total_tokens?: number; } type ImageUsageMetadata = GeminiUsageMetadata | OpenAIResponsesUsage; interface AlibabaImageContentPart { type?: string; text?: string; image?: string; } interface AlibabaImageResponse { code?: string; message?: string; output?: { choices?: Array<{ message?: { content?: AlibabaImageContentPart[]; }; }>; }; } /** Map the tool's image_size values onto wan2.7's 1K/2K size classes. */ export declare function resolveAlibabaImageSize(imageSize: string | undefined): string | undefined; /** * Build the Bailian multimodal-generation request body for wan2.7 image * generation/editing. Input images ride along as data URLs; generation-only * calls send just the prompt text. The sync endpoint returns OSS URLs inline. */ export declare function buildAlibabaImageRequest(model: string, promptText: string, inputImages: InlineImageData[], imageSize: string | undefined): { model: string; input: { messages: Array<{ role: "user"; content: Array<{ text: string; } | { image: string; }>; }>; }; parameters: { n: number; watermark: boolean; size?: string; }; }; /** Collect OSS image URLs and any text parts from a Bailian image response. */ export declare function collectAlibabaImageResult(response: AlibabaImageResponse): { imageUrls: string[]; responseText?: string; }; interface ImageGenToolDetails { provider: ImageProvider; model: string; imageCount: number; imagePaths: string[]; images: InlineImageData[]; responseText?: string; promptFeedback?: GeminiPromptFeedback; revisedPrompt?: string; usage?: ImageUsageMetadata; } interface InlineImageData { data: string; mimeType: string; } /** Provider → default image model mapping for fallbacks */ export declare const IMAGE_PROVIDER_DEFAULTS: Record; /** * Resolve the image-generation model from the `modelRoles.image` settings entry. * Returns the resolved Model (with provider identity) or undefined when no * image role is configured / no matching model is available. */ export declare function resolveImageRoleModel(settings: ModelRoleSettings, modelRegistry: ModelRegistry, options?: { sessionId?: string; credentialSessionId?: string; }): Model | undefined; /** Resolve the effective image model for a configured provider */ export declare function resolveImageModel(provider: string, modelOverride: string | null): string; /** Test seam: the Google image key fallback as resolved from trusted env. */ export declare function googleImageApiKeyFromEnvForTest(): string | undefined; export declare function isOpenAIHostedImageModel(model: Model | undefined): boolean; /** Test seam: the image-request base URL as resolved from trusted env. */ export declare function getOpenAIImageBaseUrlForTest(model: Model, authCredentialType?: "api_key" | "oauth"): string; export declare const imageGenTool: CustomTool; export declare function getImageGenTools(modelRegistry?: ModelRegistry, settings?: ModelRoleSettings): Promise>>; export declare function getImageGenToolsWithRegistry(modelRegistry: ModelRegistry, settings: ModelRoleSettings): Promise>>; export {};