import type { ProjectEntity } from "./preproduction-workspace.ts"; export type VideoUnitStatus = "idle" | "analyzing" | "ready" | "stale" | "error"; export type VideoPromptMode = "description" | "full-prompt"; export type VideoUnitImageStatus = "missing" | "generating" | "ready" | "stale" | "error"; export interface VideoUnitGeneratedImage { relativePath: string; model: string; prompt: string; inputFingerprint: string; contextFingerprint?: string; createdAt: string; } export interface VideoUnitSource { relativePath: string; startOffset: number; endOffset: number; text: string; textHash: string; } export interface VideoUnitStoryboard { description: string; fullPrompt: string; promptMode: VideoPromptMode; useAsVideoReference: boolean; imageStatus: VideoUnitImageStatus; image?: VideoUnitGeneratedImage; imageVersions?: import("./image-versions.ts").ImageVersion[]; currentImageId?: string; imageAttemptId?: string; imageMessage?: string; } export interface VideoUnitKeyframe { id: string; offsetSeconds: number; description: string; fullPrompt: string; promptMode: VideoPromptMode; useAsVideoReference: boolean; imageStatus: VideoUnitImageStatus; image?: VideoUnitGeneratedImage; imageVersions?: import("./image-versions.ts").ImageVersion[]; currentImageId?: string; imageAttemptId?: string; imageMessage?: string; } export interface VideoUnitDependency { unitId: string; } export interface StudioVideoUnit { id: string; order: number; startSeconds: number; durationSeconds: number; source: VideoUnitSource; description: string; manuscript: string; dependency?: VideoUnitDependency; /** Inactive independent opening retained for reversible link changes. */ suspendedOpening?: { keyframe?: VideoUnitKeyframe; marker?: string; prefix?: string; }; /** Unlink without a restorable opening leaves time zero pending in the image plan. */ openingRequired?: boolean; storyboard: VideoUnitStoryboard; keyframes: VideoUnitKeyframe[]; entityRefs: string[]; referenceImageCount: number; } export interface VideoUnitInput { id?: string; durationSeconds: number; source: { startOffset: number; endOffset: number; }; description: string; manuscript: string; dependency?: VideoUnitDependency; storyboard: Partial & Pick; keyframes: Array & Pick>; entityRefs?: string[]; } /** Source-linked manuscript submitted before any picture prompts exist. */ export type VideoUnitOutlineInput = Omit; /** Persisted planning inputs may omit products that have not been authored yet. */ export type VideoUnitProgressInput = VideoUnitOutlineInput & Partial>; /** Supplied keyframes replace the list; omitted Storyboard fields retain their saved values. */ export type VideoUnitPatch = Partial> & { dependency?: VideoUnitDependency | null; storyboard?: Partial; }; /** * Count complete planning products independently of generated images. * @param units Validated persisted Units. * @returns Product counts and whether every Unit in a nonempty plan has all required planning products. */ export declare function videoUnitProgress(units: readonly StudioVideoUnit[]): { total: number; manuscripts: number; storyboards: number; keyframeUnits: number; complete: boolean; }; export interface VideoUnitValidationOptions { maxReferenceImages: number; /** Replacement writers require anchors; legacy incremental edits retain their existing format. */ requireManuscriptMarkers?: boolean; /** Owner-provided Units awaiting an independent opening after unlink. */ pendingOpenings?: ReadonlySet; } export interface VideoUnitValidationResult { units: StudioVideoUnit[]; issues: string[]; } /** Validate and normalize a source-linked plan before it becomes project state. */ export declare function validateVideoUnits(inputs: readonly VideoUnitInput[], sourceText: string, sourceTextPath: string, entities: readonly ProjectEntity[], options: VideoUnitValidationOptions): VideoUnitValidationResult; /** Validate authored content while allowing absent Storyboards and keyframes. */ export declare function validateVideoUnitProgress(inputs: readonly VideoUnitProgressInput[], sourceText: string, sourceTextPath: string, entities: readonly ProjectEntity[], options: VideoUnitValidationOptions): VideoUnitValidationResult; /** Return whether every active entity already has an effective main or bound-library image. */ export declare function projectImagesReady(entities: readonly ProjectEntity[]): boolean;