import type { ImageGenerationArtifact, ImageGenerationJob, ImageJobErrorCode, ImageJobState } from '@xopcai/gateway-contract'; import type { Config } from '../config/schema.js'; export interface ImageJobOptions { aspectRatio?: string; resolution?: '1K' | '2K' | '4K'; quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto'; outputFormat?: 'png' | 'jpeg' | 'webp'; background?: 'transparent' | 'opaque' | 'auto'; count: number; imageUri?: string; agentId?: string; } export interface ImageJobRow { id: string; conversation_id: string; transcript_id: string; work_id: string; parent_id: string | null; version_number: number; model_ref: string | null; request_hash: string; title: string; prompt: string; options_json: string; state: ImageJobState; artifacts_json: string; error: string | null; error_code: ImageJobErrorCode | null; next_attempt_at: number; lease_token: string | null; lease_until: number | null; created_at: number; } export declare function parseImageJobOptions(json: string): ImageJobOptions; export declare function parseImageJobArtifacts(json: string): ImageGenerationArtifact[]; export declare function publicImageJob(row: ImageJobRow): ImageGenerationJob; export declare function listImageJobs(conversationId: string, transcriptId: string): ImageGenerationJob[]; export declare function getImageJob(conversationId: string, id: string): ImageJobRow | undefined; export declare function configuredImageGenerationModelRef(cfg?: Config, agentId?: string): string | null; export interface EnqueueImageJobRequest { parentId?: string; title?: string; prompt?: string; aspectRatio?: string; resolution?: '1K' | '2K' | '4K'; quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto'; outputFormat?: 'png' | 'jpeg' | 'webp'; background?: 'transparent' | 'opaque' | 'auto'; count?: number; imageUri?: string; model?: string; agentId?: string; } export declare function enqueueImageJob(conversationId: string, transcriptId: string, toolCallId: string, request: EnqueueImageJobRequest, cfg?: Config): { error: string; job?: undefined; } | { job: ImageGenerationJob; error?: undefined; }; export declare function claimImageJob(): { row: ImageJobRow; token: `${string}-${string}-${string}-${string}-${string}`; } | undefined; export declare function updateImageJob(id: string, token: string, state: ImageJobState, options?: { modelRef?: string; artifacts?: ImageGenerationArtifact[]; error?: string; errorCode?: ImageJobErrorCode; delayMs?: number; keepLease?: boolean; }): boolean;