import type { VideoAnalyzeOutput, VideoProductionMode } from './types.js'; import type { AssembleMediaQcReport } from './assemble/media-qc.js'; import type { StoryBibleArtifact } from './story-bible.js'; export interface BriefArtifact { title: string; intent: string; productionMode: VideoProductionMode; createdAt: string; metadata?: Record; } export interface StoryboardArtifact { projectSlug: string; productionMode: VideoProductionMode; scenes: Array<{ sceneIndex: number; description: string; scenePrompt?: { imagePrompt?: string; animationPrompt?: string; cameraMove?: 'push-in' | 'pull-out' | 'tracking' | 'crane' | 'orbit' | 'static'; styleFooter?: string; }; characters?: string[]; dialogue?: string; durationSeconds?: number; /** * Optional voice-narration preset for this scene (one of the 30 Flow v1 * voice presets). Threaded to the `veo-useapi` transport's `flow.ts --voice` * flag; `omni-flash`-only at the provider. Absent → no voice forwarded. */ voicePreset?: string; /** * Optional V2V edit source media id for this scene. Threaded to the * `veo-useapi` transport's `flow.ts --ref-video` flag; `omni-flash`-only. * Absent → no V2V reference forwarded. */ referenceVideoMediaId?: string; /** * omni-flash First-Frame (startImage / I2V) mode for this scene — gated by * `VCLAW_OMNI_FIRST_FRAME` at execution time (build-ahead; see * VideoExecutionTask.firstFrame). Absent → legacy R2V behavior. */ firstFrame?: boolean; /** Narrative color-language state for this scene = the post grade id applied at assemble. */ colorState?: string; }>; } export interface AssetManifestArtifact { projectSlug: string; assets: Array<{ id: string; kind: 'image' | 'video' | 'audio' | 'subtitle' | 'other'; path: string; sceneIndex?: number; backend?: string; /** * Optional reference role hint. A `background-plate` is a scene-context-free * environment/base reference (the banana-pro-director `base-ref` step); the * filmmaking-prompts reference map lifts it ahead of character sheets and * scene plates. Absent → treated as a scene plate when it carries a * `sceneIndex` (unchanged behavior). */ role?: 'background-plate'; }>; } export interface ReviewReportArtifact { projectSlug: string; verdict: 'pass' | 'retry' | 'fail'; generatedAt: string; findings?: string[]; metrics?: Record; } export interface PublishReportArtifact { projectSlug: string; status: 'ready' | 'published' | 'blocked'; generatedAt: string; finalOutputPath?: string; notes?: string[]; } export interface AssembleReportArtifact { projectSlug: string; generatedAt: string; status: 'complete' | 'partial' | 'dry-run' | 'failed'; brandProfile?: string | null; outputPath?: string; manifest: Array<{ kind: 'narration' | 'music' | 'title-card' | 'slide-animation' | 'rendered-clip' | 'final-video'; path: string; durationMs: number; sceneIndex?: number; sizeBytes: number; generator: string; }>; warnings?: string[]; events?: string[]; qc?: AssembleMediaQcReport; } export function createAssembleReportArtifact( input: Omit & { generatedAt?: string }, ): AssembleReportArtifact { return { ...input, generatedAt: input.generatedAt ?? new Date().toISOString(), }; } export function createBriefArtifact( input: Omit & { createdAt?: string }, ): BriefArtifact { return { ...input, createdAt: input.createdAt ?? new Date().toISOString(), }; } export function createReviewReportArtifact( input: Omit & { generatedAt?: string }, ): ReviewReportArtifact { return { ...input, generatedAt: input.generatedAt ?? new Date().toISOString(), }; } export function createPublishReportArtifact( input: Omit & { generatedAt?: string }, ): PublishReportArtifact { return { ...input, generatedAt: input.generatedAt ?? new Date().toISOString(), }; } export function createStoryboardArtifact(input: StoryboardArtifact): StoryboardArtifact { return { ...input, scenes: [...input.scenes].sort((left, right) => left.sceneIndex - right.sceneIndex), }; } export type CanonicalArtifact = | BriefArtifact | StoryboardArtifact | AssetManifestArtifact | ReviewReportArtifact | PublishReportArtifact | AssembleReportArtifact | StoryBibleArtifact | VideoAnalyzeOutput;