import type { ModelOptionsMetadata } from './model-options'; /** Define generation categories for media including image, video, speech, avatar, and transcription */ export type GenerationType = 'image' | 'video' | 'speech' | 'avatar' | 'transcription'; /** Define possible states representing the progress of a generation process */ export type GenerationStatus = 'pending' | 'running' | 'succeeded' | 'failed'; /** Define possible status values for a media model's availability and accessibility */ export type MediaModelStatus = 'available' | 'limited' | 'unavailable'; /** Define the structure for a generation entity including its metadata and creation details */ export interface Generation { id: string; type: string; prompt: string; result: string | null; model: string | null; cost: number | null; createdAt: Date | null; metadata: Record | null; } /** Describe a catalog media model and its optional wire-level option metadata. */ export interface MediaModelOption { id: string; name: string; provider?: string; type: GenerationType; status: MediaModelStatus; reason?: string; options?: ModelOptionsMetadata; } /** Represent media model catalog with default values, model options, and optional error message */ export interface MediaModelCatalogResponse { defaults: Record; models: Record; error?: string; } /** Provide an array of supported generation types for media and content processing */ export declare const GENERATION_TYPES: readonly GenerationType[]; /** Resolve whether a string value matches a valid GenerationType */ export declare function isGenerationType(value: string): value is GenerationType; /** Define the minimum number of images required for processing or validation */ export declare const MIN_IMAGE_COUNT = 1; /** Define the maximum number of images allowed for upload or display */ export declare const MAX_IMAGE_COUNT = 8; /** Resolve a human-readable relative time string from a given date or return an empty string if null */ export declare function relativeTime(date: Date | null): string; /** Resolve the output directory path based on the specified generation type */ export declare function outputPathFor(type: GenerationType): string; /** Resolve the vault path string from a Generation object or return null if unavailable */ export declare function generationVaultPath(generation: Generation): string | null; /** DEPRECATED (orphaned since #449 deleted its consumer) — resolve selected models by applying catalog defaults. * @deprecated Orphaned since its consumer (the pre-revamp ComposerHero) was deleted in #449; * the composer re-derives the guard over curated models inline. Kept for external consumers; * removal is a breaking change. */ export declare function selectedModelsWithDefaults(current: Partial>, catalog: MediaModelCatalogResponse): Partial>; /** Resolve the preferred model ID for a given generation type from the media model catalog */ export declare function preferredModelId(type: GenerationType, catalog: MediaModelCatalogResponse | null): string | undefined; /** True when a model list offers nothing sendable: no models, or every model unavailable. */ export declare function laneUnavailable(models: readonly MediaModelOption[]): boolean; /** DEPRECATED (the composer renders availability in the pill/menu/lane states since #463) — resolve the status message for a media model. * @deprecated The composer no longer renders an availability status line (#463) — availability is * carried by the model pill, the menu rows, and the lane-down notice. Kept only for external * consumers; removal is a breaking change. */ export declare function modelMessage(model: MediaModelOption | undefined, loading: boolean, count: number): string | null; /** Define fields required to configure and request various types of media generation */ export interface GenerationRequestFields { workspaceId: string; clientRequestId: string; type: GenerationType; model: string; prompt: string; image: { size?: string; quality?: string; count: number; }; video: { duration?: string | number; resolution?: string; aspectRatio?: string; referenceImageUrl?: string; audio?: boolean; mode?: string; }; speech: { voice?: string; speed?: number; }; avatar?: { audioUrl: string; imageUrl: string; avatarId: string; }; transcription?: { audioUrl: string; language: string; responseFormat: string; temperature: string; }; } /** Build the request body object for a generation operation from provided fields */ export declare function buildGenerationRequestBody(fields: GenerationRequestFields): Record; /** Resolve the current status of a generation based on its metadata and result fields */ export declare function generationStatus(generation: Generation): GenerationStatus; /** Resolve and return the first user-safe error message from generation metadata or null if none exist */ export declare function generationError(generation: Generation): string | null; /** Resolve a unique merge key from a generation using batch slot or client request ID */ export declare function generationMergeKey(generation: Generation): string | null; /** Merge a new generation into the current list by replacing or prepending it based on matching keys */ export declare function mergeLiveGeneration(current: Generation[], generation: Generation): Generation[]; /** Merge two Generation arrays prioritizing live entries and matching by merge keys or IDs */ export declare function mergeLoaderAndLive(loader: Generation[], live: Generation[]): Generation[]; /** Determine if a generation ID indicates a local generation */ export declare function isLocalGeneration(generation: Generation): boolean; /** Resolve and return the latest batch of generations grouped and sorted by client request ID and output index */ export declare function latestBatchOf(generations: Generation[]): Generation[]; /** Resolve a user-safe generation message by filtering sensitive or error-related content */ export declare function userSafeGenerationMessage(message?: string): string; /** Generate content optimistically based on input parameters and optional model and output details */ export declare function optimisticGeneration({ type, prompt, model, clientRequestId, outputIndex, outputCount, }: { type: GenerationType; prompt: string; model?: string; clientRequestId: string; outputIndex?: number; outputCount?: number; }, aspectRatio?: number): Generation; /** Mark a generation as failed with updated status and error information */ export declare function failedOptimisticGeneration(generation: Generation): Generation; /** Normalize a value to a finite integer within the allowed image count range */ export declare function normalizeImageCount(value: unknown): number; /** Resolve a generation's batch identity, preferring the server batch id. */ export declare function generationBatchKey(generation: Generation): string; /** Resolve the stored media asset id, when present. */ export declare function generationAssetId(generation: Generation): string | null; /** Select and order all outputs belonging to a generation batch. */ export declare function generationsInBatch(generations: readonly Generation[], batchKey: string): Generation[]; /** Resolve the best available aspect ratio for a generation row. */ export declare function generationAspectRatio(generation: Generation): number; /** Resolve a requested lane's aspect ratio from its selected options. */ export declare function aspectRatioFromOptions(type: GenerationType, options: { size?: string; aspectRatio?: string; }): number | undefined; /** Choose the default vault folder shared by a homogeneous media selection. */ export declare function defaultVaultPathFor(generations: readonly Generation[]): string; /** Normalize a user-entered relative vault folder or reject an unsafe path. */ export declare function normalizeVaultPath(input: string): string | null; /** Append a page while preserving the first row seen for each id. */ export declare function mergeGenerationPages(prev: readonly Generation[], next: readonly Generation[]): Generation[]; /** Resolve only the human-readable media specification fields a row carries. */ export declare function generationSpecSegments(generation: Generation): string[];