import { z } from "zod"; /** * The Render Manifest (RenderPipeline2 §6.2). * Uploaded by the AE panel on Queue Export, snapshotted verbatim into * RenderJob.manifest, handed to the worker on claim. * * `outputDir` / `outputPattern` may be the literal string "auto" — the server * generates them from the shot's exrOutput convention and the NEW version * number it decides (§6.4 E1). */ export const renderManifestSchema = z .object({ manifestVersion: z.number().int().min(1).default(1), projectCode: z.string().min(1), shotCode: z.string().regex(/^[A-Za-z0-9_-]+$/, "shotCode contains invalid characters"), shotId: z.string().min(1), aepPath: z.string().min(1), compName: z.string().min(1), rendererType: z.string().default("aerender"), aeVersionHint: z.string().optional(), outputDir: z.string().min(1), outputPattern: z.string().min(1), outputModuleTemplate: z.string().optional(), renderSettingsTemplate: z.string().optional(), frameStart: z.number().int(), frameEnd: z.number().int(), fps: z.number().positive(), width: z.number().int().positive(), height: z.number().int().positive(), expected: z .object({ colorspace: z.string().optional(), bitDepth: z.string().optional(), exrCompression: z.string().optional(), alpha: z.boolean().optional(), timecodeStart: z.string().optional(), }) .optional(), preview: z .object({ template: z.string().optional(), burnins: z.boolean().optional(), }) .optional(), }) .refine((m) => m.frameEnd >= m.frameStart, { message: "frameEnd must be >= frameStart", path: ["frameEnd"], }); export type RenderManifest = z.infer;