@nodaro/shared 3.41.0 → 3.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-FVZMFDRO.js → chunk-2JJTZCZ5.js} +4 -4
- package/dist/{chunk-FVZMFDRO.js.map → chunk-2JJTZCZ5.js.map} +1 -1
- package/dist/{chunk-BWQRAQUD.cjs → chunk-4EEPHWWF.cjs} +43 -43
- package/dist/{chunk-BWQRAQUD.cjs.map → chunk-4EEPHWWF.cjs.map} +1 -1
- package/dist/{chunk-GXTWKAJF.js → chunk-5RBJBUIR.js} +3 -3
- package/dist/{chunk-GXTWKAJF.js.map → chunk-5RBJBUIR.js.map} +1 -1
- package/dist/{chunk-4IWVZR44.cjs → chunk-6BVYKKSF.cjs} +5 -5
- package/dist/{chunk-4IWVZR44.cjs.map → chunk-6BVYKKSF.cjs.map} +1 -1
- package/dist/{chunk-ZXIP5T5V.js → chunk-6KAEQ3GU.js} +3 -3
- package/dist/{chunk-ZXIP5T5V.js.map → chunk-6KAEQ3GU.js.map} +1 -1
- package/dist/{chunk-ZAOBNW6Y.cjs → chunk-6SFJOTRF.cjs} +12 -20
- package/dist/chunk-6SFJOTRF.cjs.map +1 -0
- package/dist/{chunk-IKCFSNNH.cjs → chunk-ASB4U75K.cjs} +21 -21
- package/dist/{chunk-IKCFSNNH.cjs.map → chunk-ASB4U75K.cjs.map} +1 -1
- package/dist/{chunk-X7IRSO4L.js → chunk-B4FQY5P7.js} +3 -3
- package/dist/{chunk-X7IRSO4L.js.map → chunk-B4FQY5P7.js.map} +1 -1
- package/dist/{chunk-ADYPAGQF.cjs → chunk-BHL6P3O5.cjs} +9 -26
- package/dist/chunk-BHL6P3O5.cjs.map +1 -0
- package/dist/{chunk-5CKTBGB6.js → chunk-GBKDNDEM.js} +9 -26
- package/dist/chunk-GBKDNDEM.js.map +1 -0
- package/dist/{chunk-BOUEGYGI.cjs → chunk-II2LEEDH.cjs} +33 -37
- package/dist/chunk-II2LEEDH.cjs.map +1 -0
- package/dist/{chunk-LOTL72UI.js → chunk-KLKWAVQO.js} +4 -5
- package/dist/chunk-KLKWAVQO.js.map +1 -0
- package/dist/{chunk-LOWOJN65.js → chunk-KZGGUDAB.js} +45 -7
- package/dist/chunk-KZGGUDAB.js.map +1 -0
- package/dist/{chunk-A4NDZBSJ.js → chunk-MVJX7N6H.js} +14 -20
- package/dist/chunk-MVJX7N6H.js.map +1 -0
- package/dist/{chunk-2BJADMEX.js → chunk-O5XJDHAL.js} +3 -3
- package/dist/{chunk-2BJADMEX.js.map → chunk-O5XJDHAL.js.map} +1 -1
- package/dist/{chunk-YEET2QGF.cjs → chunk-OVLY5XO4.cjs} +4 -4
- package/dist/{chunk-YEET2QGF.cjs.map → chunk-OVLY5XO4.cjs.map} +1 -1
- package/dist/{chunk-GNY2S63W.js → chunk-PEVJKGGC.js} +4 -4
- package/dist/{chunk-GNY2S63W.js.map → chunk-PEVJKGGC.js.map} +1 -1
- package/dist/{chunk-YEZ2YUKK.js → chunk-QG6UYOLZ.js} +3 -3
- package/dist/{chunk-YEZ2YUKK.js.map → chunk-QG6UYOLZ.js.map} +1 -1
- package/dist/{chunk-TGZJXCLL.cjs → chunk-QHODM5TS.cjs} +46 -6
- package/dist/chunk-QHODM5TS.cjs.map +1 -0
- package/dist/{chunk-YX5FW7ON.js → chunk-R6MULOGA.js} +4 -12
- package/dist/chunk-R6MULOGA.js.map +1 -0
- package/dist/{chunk-RLVZ3RLE.cjs → chunk-RPS35CNO.cjs} +8 -8
- package/dist/{chunk-RLVZ3RLE.cjs.map → chunk-RPS35CNO.cjs.map} +1 -1
- package/dist/{chunk-MLB6YNLS.js → chunk-RQKSILMF.js} +4 -4
- package/dist/{chunk-MLB6YNLS.js.map → chunk-RQKSILMF.js.map} +1 -1
- package/dist/{chunk-VNC5DNIQ.cjs → chunk-RYDJ5BLT.cjs} +11 -13
- package/dist/chunk-RYDJ5BLT.cjs.map +1 -0
- package/dist/{chunk-VSDJCJKP.cjs → chunk-S32Z2JMC.cjs} +46 -45
- package/dist/chunk-S32Z2JMC.cjs.map +1 -0
- package/dist/{chunk-TUUEQ2WR.cjs → chunk-SHWZPCZU.cjs} +8 -8
- package/dist/{chunk-TUUEQ2WR.cjs.map → chunk-SHWZPCZU.cjs.map} +1 -1
- package/dist/{chunk-PYDZ7ZGH.js → chunk-U2CCL5YF.js} +3 -3
- package/dist/{chunk-PYDZ7ZGH.js.map → chunk-U2CCL5YF.js.map} +1 -1
- package/dist/{chunk-4LKEOIOT.cjs → chunk-UYGTZJGT.cjs} +6 -6
- package/dist/{chunk-4LKEOIOT.cjs.map → chunk-UYGTZJGT.cjs.map} +1 -1
- package/dist/{chunk-CWQC6IGE.js → chunk-V5TSXS5A.js} +100 -6
- package/dist/chunk-V5TSXS5A.js.map +1 -0
- package/dist/{chunk-E4MLBJKG.js → chunk-VNAMNWRX.js} +8 -8
- package/dist/{chunk-E4MLBJKG.js.map → chunk-VNAMNWRX.js.map} +1 -1
- package/dist/{chunk-5J5L26IZ.js → chunk-WE5ZENCO.js} +5 -7
- package/dist/chunk-WE5ZENCO.js.map +1 -0
- package/dist/{chunk-N2KG5AMQ.cjs → chunk-WXMLMN5Y.cjs} +4 -4
- package/dist/{chunk-N2KG5AMQ.cjs.map → chunk-WXMLMN5Y.cjs.map} +1 -1
- package/dist/{chunk-SYUY7GNT.js → chunk-XANN72AJ.js} +7 -6
- package/dist/chunk-XANN72AJ.js.map +1 -0
- package/dist/{chunk-JN3V33AN.cjs → chunk-XKLFXNE7.cjs} +6 -6
- package/dist/{chunk-JN3V33AN.cjs.map → chunk-XKLFXNE7.cjs.map} +1 -1
- package/dist/{chunk-DC5EYYVX.cjs → chunk-XUBZO6QA.cjs} +154 -39
- package/dist/chunk-XUBZO6QA.cjs.map +1 -0
- package/dist/chunk-Y4JG3ZAA.cjs +27 -0
- package/dist/{chunk-XOZIHGR5.cjs.map → chunk-Y4JG3ZAA.cjs.map} +1 -1
- package/dist/{chunk-DJIRIBKX.cjs → chunk-Z5W7W24Z.cjs} +5 -6
- package/dist/chunk-Z5W7W24Z.cjs.map +1 -0
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/credits.cjs +150 -150
- package/dist/entries/credits.d.cts +1 -1
- package/dist/entries/credits.d.ts +1 -1
- package/dist/entries/credits.js +7 -7
- package/dist/entries/llm-models.d.cts +1 -1
- package/dist/entries/llm-models.d.ts +1 -1
- package/dist/entries/media.cjs +56 -48
- package/dist/entries/media.d.cts +65 -3
- package/dist/entries/media.d.ts +65 -3
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +66 -66
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +336 -244
- package/dist/entries/models.d.cts +125 -8
- package/dist/entries/models.d.ts +125 -8
- package/dist/entries/models.js +4 -4
- package/dist/entries/nodes.cjs +206 -206
- package/dist/entries/nodes.js +8 -8
- package/dist/entries/pipeline.cjs +149 -149
- package/dist/entries/pipeline.d.cts +10 -14
- package/dist/entries/pipeline.d.ts +10 -14
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +117 -117
- package/dist/entries/video.js +4 -4
- package/dist/index.cjs +1169 -1069
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -18
- package/dist/{model-constants-B5ka4TQr.d.cts → model-constants-BL-Ae0OU.d.cts} +24 -7
- package/dist/{model-constants-B5ka4TQr.d.ts → model-constants-BL-Ae0OU.d.ts} +24 -7
- package/package.json +1 -1
- package/src/__tests__/cast-swap-limits.test.ts +43 -0
- package/src/__tests__/credit-identifiers.test.ts +13 -32
- package/src/__tests__/pricing-default-duration.test.ts +0 -2
- package/src/__tests__/retired-video-provider.test.ts +42 -0
- package/src/__tests__/topaz-video.test.ts +72 -0
- package/src/__tests__/video-audio-capability.test.ts +4 -13
- package/src/__tests__/video-mask.test.ts +31 -0
- package/src/__tests__/video-mode-aliases.test.ts +10 -1
- package/src/cast-swap-limits.ts +74 -0
- package/src/credit-identifiers.ts +4 -1
- package/src/entries/models.ts +33 -1
- package/src/film-pricing.ts +0 -1
- package/src/model-catalog.ts +7 -24
- package/src/model-constants.ts +29 -15
- package/src/pipeline-types.ts +4 -2
- package/src/provider-directive-defaults.ts +0 -1
- package/src/topaz-video.ts +141 -0
- package/src/video-mask.ts +69 -2
- package/src/video-output-canvas.ts +0 -8
- package/dist/chunk-5CKTBGB6.js.map +0 -1
- package/dist/chunk-5J5L26IZ.js.map +0 -1
- package/dist/chunk-A4NDZBSJ.js.map +0 -1
- package/dist/chunk-ADYPAGQF.cjs.map +0 -1
- package/dist/chunk-BOUEGYGI.cjs.map +0 -1
- package/dist/chunk-CWQC6IGE.js.map +0 -1
- package/dist/chunk-DC5EYYVX.cjs.map +0 -1
- package/dist/chunk-DJIRIBKX.cjs.map +0 -1
- package/dist/chunk-LOTL72UI.js.map +0 -1
- package/dist/chunk-LOWOJN65.js.map +0 -1
- package/dist/chunk-SYUY7GNT.js.map +0 -1
- package/dist/chunk-TGZJXCLL.cjs.map +0 -1
- package/dist/chunk-VNC5DNIQ.cjs.map +0 -1
- package/dist/chunk-VSDJCJKP.cjs.map +0 -1
- package/dist/chunk-XOZIHGR5.cjs +0 -27
- package/dist/chunk-YX5FW7ON.js.map +0 -1
- package/dist/chunk-ZAOBNW6Y.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/video-character-refs.ts","../src/video-duration.ts","../src/video-overlay.ts","../src/video-analysis.ts","../src/video-output-canvas.ts","../src/video-frame-fit.ts"],"names":["used"],"mappings":";;;;;;AAqDO,IAAM,gCAAgC,IAAA,CAAK,GAAA;AAAA,EAChD,CAAA;AAAA,EACA,GAAG,MAAA,CAAO,MAAA,CAAO,4BAA4B,CAAA,CAAE,IAAI,CAAC,CAAA,KAAM,CAAA,EAAG,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,CAAC,CAAA,EAAG,MAAA,EAAQ,MAAA,CAAO,CAAC,CAAA,EAAE,GACtC,sBAAA;AAAA,IACE,IAAA,GAAO,KAAK,KAAA,GAAQ,WAAA;AAAA,IACpB,IAAA,GAAO,KAAK,MAAA,GAAS,YAAA;AAAA,IACrB;AAAA,GACF;AAEJ,EAAA,MAAM,YAAY,MAAA,CAAO,KAAA,KAAU,eAAe,MAAA,CAAO,MAAA,KAAW,gBAAgB,CAAC,IAAA;AACrF,EAAA,IAAI,WAAW,OAAO,IAAA;AAEtB,EAAA,OAAO;AAAA,IACL,OAAO,MAAA,CAAO,KAAA;AAAA,IACd,QAAQ,MAAA,CAAO,MAAA;AAAA,IACf,GAAI,IAAA,GAAO,EAAE,IAAA,KAAS,EAAC;AAAA,IACvB,MAAA,EAAQ,SAAS,YAAA,GAAe;AAAA,GAClC;AACF;AAQO,SAAS,qBAAqB,IAAA,EAIF;AACjC,EAAA,MAAM,SAAA,GAAY,KAAK,SAAA,IAAa,sBAAA;AACpC,EAAA,MAAM,MAAA,GAAS,SAAA,KAAc,MAAA,GACxB,IAAA,CAAK,QAAA,GAAW,2BAA2B,IAAA,CAAK,QAAQ,CAAA,IAAK,OAAA,GAAU,OAAA,GACxE,SAAA;AACJ,EAAA,IAAI,MAAA,KAAW,WAAA,IAAe,CAAC,IAAA,CAAK,yBAAyB,OAAO,OAAA;AACpE,EAAA,OAAO,MAAA;AACT","file":"chunk-R6MULOGA.js","sourcesContent":["import { VIDEO_REF_LIMITS_BY_PROVIDER } from \"./model-constants.js\"\nimport type { ConnectedReference } from \"./types.js\"\nimport type { GeminiOmniVoicePresetId } from \"./gemini-omni-voices.js\"\n\n/**\n * Character references — the dedicated IDENTITY input of a video model, as\n * opposed to a loose reference image.\n *\n * Gemini Omni treats `image_urls` as \"reference images for characters, scenes,\n * styles, or storyboard guidance\": a portrait sent there steers the clip but\n * the face drifts. Its separate `character_ids` input is the one that keeps a\n * real person's face, and it takes ids minted from a portrait by a create\n * call. The PUBLIC shape below is provider-neutral — a portrait and a\n * description — and the provider layer mints (and caches) whatever ids its\n * upstream needs. Nothing upstream-shaped ever appears in the API.\n *\n * WHICH models take them is data, never a name list: a positive `characters`\n * cap on `VIDEO_REF_LIMITS_BY_PROVIDER`.\n */\nexport interface VideoCharacterVoice {\n /** The base voice — one of `GEMINI_OMNI_VOICE_PRESETS`. */\n preset: GeminiOmniVoicePresetId\n /** Free-text timbre / pace / emotion for the persona. Optional. */\n description?: string\n /** One example line the persona says (≤ 120 chars). Optional. */\n exampleLine?: string\n}\n\nexport interface VideoCharacterReference {\n /** Portrait of the person (public URL). Index 0 of the upstream image set. */\n imageUrl: string\n /** Optional full-body image; costs a second input unit. */\n bodyImageUrl?: string\n /**\n * More views of the same person, after the portrait and body image. Read by\n * models whose subject takes several images (Kling 4.0: 2-4 per subject, the\n * portrait first); ignored elsewhere. At most\n * {@link VIDEO_CHARACTER_EXTRA_IMAGES_MAX}.\n */\n extraImageUrls?: string[]\n /** Who this is: appearance, identity, style, clothing. Required by the upstream. */\n description: string\n /** Optional display name. */\n name?: string\n /**\n * Pin a voice persona to this character so it keeps ONE voice across clips\n * (the model otherwise improvises a voice per generation). Only models with a\n * positive `voices` cap take it.\n */\n voice?: VideoCharacterVoice\n}\n\n/** Zod `.max()` ceiling for the wire field — the widest cap any provider declares. */\nexport const VIDEO_CHARACTER_REFS_WIRE_MAX = Math.max(\n 0,\n ...Object.values(VIDEO_REF_LIMITS_BY_PROVIDER).map((l) => l?.characters ?? 0),\n)\n\n/** Most `extraImageUrls` a character reference may carry (Kling 4.0's subject takes 4 images: the portrait + 3). */\nexport const VIDEO_CHARACTER_EXTRA_IMAGES_MAX = 3\n\n/** Longest `description` / `name` a client may send (route Zod reads these). */\nexport const VIDEO_CHARACTER_DESCRIPTION_MAX = 2000\nexport const VIDEO_CHARACTER_NAME_MAX = 100\n/** Longest voice `description` / `exampleLine` a client may send. The upstream\n * allows far more description (20000); we cap the PUBLIC field at the same\n * ceiling as a character description so policy text and prompts stay bounded. */\nexport const VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX = 2000\nexport const VIDEO_CHARACTER_VOICE_EXAMPLE_MAX = 120\n\n/** How many character references the provider takes; 0 = none (or unknown). */\nexport function videoCharacterRefCap(provider: string | undefined): number {\n return provider ? (VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.characters ?? 0) : 0\n}\n\n/** How many DISTINCT voice personas the provider takes per request; 0 = none. */\nexport function videoCharacterVoiceCap(provider: string | undefined): number {\n return provider ? (VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.voices ?? 0) : 0\n}\n\n/**\n * Identity of a voice persona — what makes two voices \"the same voice\". The\n * persona is minted per (preset, description, example line) AND the character's\n * name (the label it is created under), so the name is part of the identity:\n * this count must equal the number of personas the provider will actually mint,\n * or the cap would be checked against a different number than what ships.\n */\nexport function videoCharacterVoiceKey(ref: Pick<VideoCharacterReference, \"voice\" | \"name\">): string | null {\n const voice = ref.voice\n if (!voice) return null\n return JSON.stringify([voice.preset, voice.description?.trim() ?? \"\", voice.exampleLine?.trim() ?? \"\", ref.name?.trim() ?? \"\"])\n}\n\n/** How many distinct voice personas a set of references asks for. */\nexport function videoCharacterDistinctVoices(\n characterReferences: readonly Pick<VideoCharacterReference, \"voice\" | \"name\">[] | undefined,\n): number {\n const keys = new Set<string>()\n for (const c of characterReferences ?? []) {\n const key = videoCharacterVoiceKey(c)\n if (key) keys.add(key)\n }\n return keys.size\n}\n\n/** Every provider that declares a character-reference cap, in declaration order. */\nexport function videoCharacterRefProviders(): string[] {\n return Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER)\n .filter(([, l]) => (l?.characters ?? 0) > 0)\n .map(([id]) => id)\n}\n\n/**\n * Input units a set of character references draws from the provider's shared\n * input budget: 1 per character, 2 when a body image is supplied (the upstream\n * counts a dual-image character as two slots).\n */\nexport function videoCharacterRefUnits(\n characterReferences: readonly Pick<VideoCharacterReference, \"bodyImageUrl\">[] | undefined,\n): number {\n let units = 0\n for (const c of characterReferences ?? []) units += c.bodyImageUrl ? 2 : 1\n return units\n}\n\nexport interface VideoCharacterRefProblem {\n code:\n | \"character_references_unsupported\"\n | \"character_references_over_limit\"\n | \"character_references_with_start_frame\"\n | \"character_references_with_end_frame\"\n | \"character_references_quota\"\n | \"character_voice_unsupported\"\n | \"character_voices_over_limit\"\n message: string\n}\n\n/**\n * Voice-persona rule: the provider must take voices at all, and the DISTINCT\n * voices must fit its cap (Gemini Omni: 3 `audio_ids` per task). Two characters\n * with an identical voice AND name count once. `cap` overrides the provider's declared cap\n * (tests; a future model with a different limit declares it as data instead).\n */\nexport function videoCharacterVoiceProblem(args: {\n provider: string | undefined\n characterReferences: readonly VideoCharacterReference[] | undefined\n cap?: number\n}): VideoCharacterRefProblem | null {\n const distinct = videoCharacterDistinctVoices(args.characterReferences)\n if (distinct === 0) return null\n const cap = args.cap ?? videoCharacterVoiceCap(args.provider)\n if (cap === 0) {\n return {\n code: \"character_voice_unsupported\",\n message:\n `A character voice is not supported by ${args.provider ?? \"the selected model\"}. ` +\n \"Drop the voice, or pick a model that takes characterReferences.\",\n }\n }\n if (distinct > cap) {\n return {\n code: \"character_voices_over_limit\",\n message: `${args.provider} accepts at most ${cap} distinct character voices per video; got ${distinct}. Give some characters the same voice, or drop some.`,\n }\n }\n return null\n}\n\n/**\n * The one validation both video routes (and the provider backstop) run. Returns\n * the first problem as a friendly 400 body, or null when the request is fine.\n *\n * The shared budget: for a model that declares `characters`, its `images` cap\n * IS the total input budget (images + 2×videos + character units ≤ images cap —\n * 7 for Gemini Omni). Callers pass the ASSEMBLED image count, after any\n * `connectedReferences` expansion, so the budget is measured on what ships.\n */\nexport function videoCharacterRefProblem(args: {\n provider: string | undefined\n characterReferences: readonly VideoCharacterReference[] | undefined\n /** Reference images that will ship (assembled, flat). */\n imageCount: number\n /** Source / reference videos that will ship. */\n videoCount: number\n /** True when the request carries a start frame (`imageUrl`). */\n hasStartFrame: boolean\n /** True when the request carries an end frame (`endFrameUrl`). */\n hasEndFrame?: boolean\n /** Reference audio clips that will ship (counted by a `materials` budget). */\n audioCount?: number\n}): VideoCharacterRefProblem | null {\n const { provider, characterReferences } = args\n if (!characterReferences || characterReferences.length === 0) return null\n\n const cap = videoCharacterRefCap(provider)\n if (cap === 0) {\n return {\n code: \"character_references_unsupported\",\n message:\n `characterReferences is not supported by ${provider ?? \"the selected model\"}. ` +\n `Models that take them: ${videoCharacterRefProviders().join(\", \")}. ` +\n \"Otherwise send the portrait as a reference image instead.\",\n }\n }\n if (characterReferences.length > cap) {\n return {\n code: \"character_references_over_limit\",\n message: `${provider} accepts at most ${cap} character references; got ${characterReferences.length}.`,\n }\n }\n // A provider that counts every material against ONE budget (Kling 4.0: 15\n // images + videos + subjects + voices) takes characters beside a start frame\n // (the frame joins the reference images) — the Gemini Omni unit rules below\n // do not apply to it.\n const materials = VIDEO_REF_LIMITS_BY_PROVIDER[provider as string]?.materials\n if (materials !== undefined) {\n const used =\n args.imageCount + (args.hasStartFrame ? 1 : 0) + args.videoCount + characterReferences.length + (args.audioCount ?? 0)\n if (used > materials) {\n return {\n code: \"character_references_quota\",\n message:\n `${provider} takes at most ${materials} materials in all — reference images (a start frame counts as one), ` +\n `reference videos, characters and voices. This request uses ${used}. Remove some.`,\n }\n }\n return videoCharacterVoiceProblem({ provider, characterReferences })\n }\n // A NODARO limit, not an upstream exclusivity: Gemini Omni's start frame is\n // sent as the first entry of `image_urls` (never as `first_frame_url`), so\n // the upstream would take it beside `character_ids`. We reject the pair\n // because the frame / identity roles are not yet bound in the prompt\n // (and the frame would need to be budgeted against the shared input quota).\n if (args.hasStartFrame) {\n return {\n code: \"character_references_with_start_frame\",\n message:\n `${provider} does not yet support combining characterReferences with a start frame (imageUrl) — ` +\n \"the frame and the characters would compete for the same input slots without a defined role. \" +\n \"Drop the start frame (the character's portrait carries the face), or drop characterReferences.\",\n }\n }\n // Gemini Omni has no end-frame input; without this the frame would be dropped\n // silently once characters make a frame-less request look \"referenced\".\n if (args.hasEndFrame) {\n return {\n code: \"character_references_with_end_frame\",\n message:\n `${provider} does not use an end frame (endFrameUrl) together with characterReferences. ` +\n \"Drop the end frame, or drop characterReferences.\",\n }\n }\n const budget = VIDEO_REF_LIMITS_BY_PROVIDER[provider as string]?.images ?? 7\n const used = args.imageCount + args.videoCount * 2 + videoCharacterRefUnits(characterReferences)\n if (used > budget) {\n return {\n code: \"character_references_quota\",\n message:\n `${provider} takes at most ${budget} input units: reference images count 1, each reference video 2, ` +\n `each character 1 (2 with a body image). This request uses ${used}. Remove some reference images or characters.`,\n }\n }\n return videoCharacterVoiceProblem({ provider, characterReferences })\n}\n\n/**\n * One provider-neutral character reference per wired Character node, for a\n * model that takes wired characters as NAMED SUBJECTS (catalog feature\n * `character-subjects`, Kling 4.0). Input: the wired-character entries both\n * engines already expand (`expandWiredCharacterRefs` server-side, the editor's\n * twin) — the canonical portrait and every variant, grouped here by character.\n * The portrait leads; up to {@link VIDEO_CHARACTER_EXTRA_IMAGES_MAX} more views\n * follow in expansion order. The name is the character's own; the description\n * its canonical description, else its description. A character with a single\n * image still yields a reference — the provider decides (Kling keeps it a\n * reference image).\n */\nexport function characterReferencesFromWired(refs: readonly ConnectedReference[]): VideoCharacterReference[] {\n const bySlug = new Map<string, { name: string; description?: string; urls: string[] }>()\n for (const r of refs) {\n if (r.source !== \"wired-character\" || !r.characterSlug || !r.url) continue\n let entry = bySlug.get(r.characterSlug)\n if (!entry) {\n entry = { name: r.defaultName.split(\" / \")[0]!.trim() || r.characterSlug, urls: [] }\n bySlug.set(r.characterSlug, entry)\n }\n const description = (r.characterCanonicalDescription ?? r.description)?.trim()\n if (!entry.description && description) entry.description = description\n if (entry.urls.includes(r.url)) continue\n // The canonical portrait leads whatever order the variants arrived in.\n if (!r.variantSlug) entry.urls.unshift(r.url)\n else entry.urls.push(r.url)\n }\n return [...bySlug.values()].map((c) => ({\n imageUrl: c.urls[0]!,\n ...(c.urls.length > 1 ? { extraImageUrls: c.urls.slice(1, 1 + VIDEO_CHARACTER_EXTRA_IMAGES_MAX) } : {}),\n description: (c.description ?? c.name).slice(0, VIDEO_CHARACTER_DESCRIPTION_MAX),\n name: c.name.slice(0, VIDEO_CHARACTER_NAME_MAX),\n }))\n}\n","/** Read a video node's duration (in seconds) from its data shape.\n * Tries `generatedResults[activeResultIndex].duration` (post-execution\n * metadata) first, then `data.duration` (configured at design time on\n * generate-video / image-to-video / text-to-video nodes). Returns\n * undefined when neither is set — callers should fall back to a sensible\n * default (e.g. 8s).\n *\n * Lives in `@nodaro/shared` so frontend (store walks) and backend\n * (orchestrator input-resolver) can use one source of truth. */\nexport function extractVideoDurationFromNode(\n data: Record<string, unknown> | undefined,\n): number | undefined {\n if (!data) return undefined\n const results = data.generatedResults as Array<{ duration?: number }> | undefined\n const idx = (data.activeResultIndex as number | undefined) ?? 0\n const fromResult = results?.[idx]?.duration\n if (typeof fromResult === \"number\" && Number.isFinite(fromResult) && fromResult > 0) {\n return fromResult\n }\n const fromConfig = data.duration\n if (typeof fromConfig === \"number\" && Number.isFinite(fromConfig) && fromConfig > 0) {\n return fromConfig\n }\n return undefined\n}\n\n/** Duration (seconds) of an edit-plan SOURCE node's media, for the reserve\n * bucket. Extends {@link extractVideoDurationFromNode} with the AUDIO lane:\n * `upload-audio` (and URL-imported audio) write their length to\n * `metadata.durationSeconds` ONLY — never `generatedResults[].duration` /\n * `data.duration` — so a podcast's audio master would otherwise resolve to\n * undefined and reserve the 180-minute ceiling (a ~6× overbill). A\n * `reference-audio` node records its extracted file's length in the same field,\n * stamped with `metadata.mediaUrl` (see the binding check below).\n *\n * Deliberately a NEW function, not a change to `extractVideoDurationFromNode`,\n * so no other node's duration read shifts — this fallback is edit-plan-scoped. */\nexport function editPlanSourceDurationSec(\n data: Record<string, unknown> | undefined,\n): number | undefined {\n const fromVideo = extractVideoDurationFromNode(data)\n if (fromVideo !== undefined) return fromVideo\n const meta = data?.metadata as { durationSeconds?: unknown; mediaUrl?: unknown } | undefined\n // A length stamped with the media it was measured from is trusted ONLY while\n // that media is still the node's. This is the read-side invariant that makes a\n // stale length impossible whoever changed the url — a copilot patch, an MCP\n // workflow-JSON write, an import, a run-time input override, or code not yet\n // written: a mismatch reads as \"unknown\", and every caller then falls to its\n // safe side (the transcript clock, the reserve-time probe, the ceiling bucket)\n // instead of under-bucketing a longer file. An UNSTAMPED length (upload-audio,\n // nodes saved before the stamp existed) is trusted as it always was.\n if (typeof meta?.mediaUrl === \"string\" && meta.mediaUrl !== data?.extractedAudioUrl && meta.mediaUrl !== data?.url) {\n return undefined\n }\n const d = meta?.durationSeconds\n return typeof d === \"number\" && Number.isFinite(d) && d > 0 ? d : undefined\n}\n","/**\n * Video Overlay — timed image layers over a video. The wire contract of the\n * `video-overlay` node, `POST /v1/video-overlay`, the `overlay_images` MCP\n * verb, `client.media.videoOverlay` and `nodaro media video-overlay`, defined\n * ONCE:\n * - every numeric bound (the route schema, the validator — which refuses a\n * present box / look field outside `VIDEO_OVERLAY_BOUNDS`, so the DAG path\n * that never meets the route schema is bounded too — both engine\n * assemblies and the canvas read these — never a second copy);\n * - the placement presets, stored as data in the custom box vocabulary: a\n * `preset` is a TAG, the box is the truth — the worker and the preview\n * never switch on the tag;\n * - `expandVideoOverlayLayer` / `expandVideoOverlayPresets`: the one\n * normaliser every write boundary calls;\n * - `resolveVideoOverlayGeometry`: the one placement function the canvas\n * preview and the ffmpeg worker both call;\n * - `assembleVideoOverlayRequest`: the one node-data → request assembly both\n * workflow engines call;\n * - `videoOverlayCompositionKey` (+ `videoOverlaySlotSources`): the freshness\n * key a run stamps on its result (`resultCompositionKey`) — the canvas\n * single-node Run (which sends it with the request, bounded by\n * `VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH`) and the DAG payload compute\n * it with this one function, and the node compares it against the key of\n * its current settings;\n * - `validateVideoOverlayRequest`: what a schema cannot express, at every\n * engine entry. It returns a CODE, never English: `formatVideoOverlayError`\n * renders the route / worker text, the canvas renders the code through its\n * dictionaries.\n * Wire contract only — no prompt content, no I/O.\n */\nimport { OVERLAY_ANCHORS, type OverlayAnchor } from \"./image-overlay-layers.js\"\nimport { ASPECT_RATIO_DIMENSIONS } from \"./model-constants.js\"\n\n/** Engine + MCP contract: layers per request. */\nexport const VIDEO_OVERLAY_MAX_LAYERS = 20\n/** Ceiling for `start` / `end`, seconds. */\nexport const VIDEO_OVERLAY_MAX_TIME_SEC = 3600\n/**\n * The canvas layer handles, index-aligned with `layers[]` (overlay → layers[0]\n * … overlay12 → layers[11]). Slots 13 and up exist in data only, via `imageUrl`.\n * The same ids Image Overlay renders.\n */\nexport const VIDEO_OVERLAY_HANDLE_IDS = [\n \"overlay\", \"overlay2\", \"overlay3\", \"overlay4\", \"overlay5\", \"overlay6\",\n \"overlay7\", \"overlay8\", \"overlay9\", \"overlay10\", \"overlay11\", \"overlay12\",\n] as const\nexport const VIDEO_OVERLAY_PRESET_IDS = [\"card\", \"corner-badge\", \"full-frame\"] as const\nexport type VideoOverlayPresetId = (typeof VIDEO_OVERLAY_PRESET_IDS)[number]\nexport const VIDEO_OVERLAY_CORNERS = [\"top-left\", \"top-right\", \"bottom-left\", \"bottom-right\"] as const\nexport type VideoOverlayCorner = (typeof VIDEO_OVERLAY_CORNERS)[number]\nexport const VIDEO_OVERLAY_FITS = [\"contain\", \"cover\"] as const\nexport type VideoOverlayFit = (typeof VIDEO_OVERLAY_FITS)[number]\n/** Target aspects; absent = the base's own size and fps. */\nexport const VIDEO_OVERLAY_OUTPUT_ASPECTS = [\"16:9\", \"9:16\", \"1:1\", \"4:5\"] as const\nexport type VideoOverlayOutputAspect = (typeof VIDEO_OVERLAY_OUTPUT_ASPECTS)[number]\n/**\n * Reserved input id for a JSON layer plan. Payload: `VideoOverlayLayer[]` — the\n * same shape as the node's `layers[]`, a `preset` tag allowed and expanded at\n * the boundary. It has a pip on the node; both input resolvers route an edge on\n * it into `inputs.layerPlan`, which `assembleVideoOverlayRequest` reads (plan\n * layers first, then the handle layers).\n */\nexport const VIDEO_OVERLAY_LAYER_PLAN_HANDLE = \"layerPlan\"\n/** Box and look bounds. */\nexport const VIDEO_OVERLAY_BOUNDS = {\n x: [-100, 100],\n y: [-100, 100],\n width: [1, 100],\n height: [1, 100],\n opacity: [0, 1],\n zIndex: [0, 100],\n} as const\n/** Σ downloaded layer bytes per job. */\nexport const VIDEO_OVERLAY_MAX_TOTAL_LAYER_BYTES = 100 * 1024 * 1024\n/** Fade + scale ramp, seconds each way (clamped to half of a short layer). */\nexport const VIDEO_OVERLAY_ANIMATION_SEC = 0.15\n/** The scale a layer grows from and shrinks back to during the ramp. */\nexport const VIDEO_OVERLAY_ANIMATION_MIN_SCALE = 0.96\n/** Corner-badge width and inset, % of the output canvas. */\nexport const VIDEO_OVERLAY_BADGE_WIDTH = 18\nexport const VIDEO_OVERLAY_BADGE_INSET = 4\n/** Pad colour for `baseFit: \"contain\"` when none is given. */\nexport const VIDEO_OVERLAY_DEFAULT_BACKGROUND = \"#000000\"\n/** The six box fields — exactly what a preset writes. */\nexport const VIDEO_OVERLAY_BOX_FIELDS = [\"anchor\", \"x\", \"y\", \"width\", \"height\", \"fit\"] as const\nexport const VIDEO_OVERLAY_WARNING_CODES = [\"clipped\", \"skipped\", \"animated_first_frame\", \"audio_reencoded\"] as const\nexport type VideoOverlayWarningCode = (typeof VIDEO_OVERLAY_WARNING_CODES)[number]\nexport const VIDEO_OVERLAY_ERROR_CODES = [\n \"no_layers\", \"too_many_layers\", \"incomplete_box\", \"layer_without_image\",\n \"time_out_of_range\", \"end_before_start\", \"fit_without_aspect\", \"field_out_of_bounds\", \"invalid_layer_plan\",\n] as const\nexport type VideoOverlayErrorCode = (typeof VIDEO_OVERLAY_ERROR_CODES)[number]\n\nexport interface VideoOverlayBox {\n readonly anchor: OverlayAnchor\n readonly x: number\n readonly y: number\n readonly width: number\n readonly height?: number\n readonly fit: VideoOverlayFit\n}\n\n/** A layer as stored and enqueued — complete: every box and look field present. */\nexport interface VideoOverlayLayer {\n /**\n * Used when the layer's canvas handle is not wired (MCP, template, layers\n * 13 and up). Wiring the handle CLEARS it — on the canvas by the one `layers[]`\n * writer (D3), on JSON-written workflows by the write-boundary pass (D10) —\n * and the run-time merge is still `wired ?? imageUrl` everywhere.\n */\n imageUrl?: string\n /** 1-based canvas slot (overlay = 1 … overlay12 = 12; 13 and up handle-less), stamped by both engine assemblies. Messages prefer it. */\n slot?: number\n /** 1-based entry of a wired layer plan, stamped by the assembly. Messages prefer it. */\n planLayer?: number\n /** Seconds, 0..3600, stored ms-precise; rendered on the base's frame grid (±1 frame). */\n start: number\n /** Seconds, 0..3600, > start; absent = until the video ends. */\n end?: number\n /** A TAG only — the box below is the truth. */\n preset?: VideoOverlayPresetId\n /** corner-badge only; default bottom-right. */\n corner?: VideoOverlayCorner\n anchor: OverlayAnchor\n /** Offset from the anchor, % of the output canvas width (−100..100; negative on a right anchor = inward). */\n x: number\n /** Offset from the anchor, % of the output canvas height. */\n y: number\n /** % of the output canvas width (1..100). */\n width: number\n /** % of the output canvas height (1..100); absent = follows the image's aspect. */\n height?: number\n fit: VideoOverlayFit\n /** 0..1 */\n opacity: number\n /** Fade + slight scale in and out, 0.15 s each way. */\n animate: boolean\n /** Integer 0..100; absent = its position (slot − 1: layer 1 lowest). */\n zIndex?: number\n}\n\n/** A layer as a WRITER may send it (workflow JSON, a template, the canvas): every field optional; `null` means absent. */\nexport type VideoOverlayLayerInput = { [K in keyof VideoOverlayLayer]?: VideoOverlayLayer[K] | null }\n\n/** A layer on the REST / SDK wire: image and start required; the box may be a preset, explicit fields, or nothing (→ the corner-badge default). */\nexport type VideoOverlayLayerSpec = { imageUrl: string; start: number } & Partial<Omit<VideoOverlayLayer, \"imageUrl\" | \"start\">>\n\n/** The `POST /v1/video-overlay` body. */\nexport interface VideoOverlayRequest {\n videoUrl: string\n /** 1..20 */\n layers: VideoOverlayLayerSpec[]\n outputAspect?: VideoOverlayOutputAspect\n /** Only with `outputAspect`; default cover. */\n baseFit?: VideoOverlayFit\n /** `#rrggbb`, only with `outputAspect` (drawn under `contain`); default `#000000`. */\n backgroundColor?: string\n}\n\n/** A request whose layers went through `expandVideoOverlayPresets`. */\nexport interface ExpandedVideoOverlayRequest extends Omit<VideoOverlayRequest, \"layers\"> {\n layers: VideoOverlayLayer[]\n /** Set by the assembly when a wired layer plan could not be read; `validateVideoOverlayRequest` reports it first. */\n planError?: \"invalid_layer_plan\"\n}\n\n/** `output_data.warnings[]`: `layer` = 0-based index of the request's layers (absent for a render-wide warning such as `audio_reencoded`), `slot` when known. */\nexport interface VideoOverlayWarning {\n readonly layer?: number\n readonly slot?: number\n /** Set instead of `slot` when the layer came from the layer plan. */\n readonly planLayer?: number\n readonly code: VideoOverlayWarningCode\n readonly detail: string\n}\n\nconst badge = (anchor: VideoOverlayCorner, sx: 1 | -1, sy: 1 | -1): VideoOverlayBox => ({\n anchor,\n x: sx * VIDEO_OVERLAY_BADGE_INSET,\n y: sy * VIDEO_OVERLAY_BADGE_INSET,\n width: VIDEO_OVERLAY_BADGE_WIDTH,\n fit: \"contain\",\n})\n\n/**\n * Placement presets as DATA in the custom vocabulary. `card` sits centred, 4 %\n * above centre, contain into 78 % × 60 % of the frame; `full-frame` covers the\n * frame; `corner-badge` is 18 % wide, 4 % in from its corner.\n */\nexport const VIDEO_OVERLAY_PRESETS: {\n readonly card: VideoOverlayBox\n readonly \"full-frame\": VideoOverlayBox\n readonly \"corner-badge\": Readonly<Record<VideoOverlayCorner, VideoOverlayBox>>\n} = {\n card: { anchor: \"center\", x: 0, y: -4, width: 78, height: 60, fit: \"contain\" },\n \"full-frame\": { anchor: \"center\", x: 0, y: 0, width: 100, height: 100, fit: \"cover\" },\n \"corner-badge\": {\n \"bottom-right\": badge(\"bottom-right\", -1, -1),\n \"bottom-left\": badge(\"bottom-left\", 1, -1),\n \"top-right\": badge(\"top-right\", -1, 1),\n \"top-left\": badge(\"top-left\", 1, 1),\n },\n}\n\n/** D2 — what a wired slot with no settings runs (and previews) with: the bottom-right corner badge, from 0 to the end. */\nexport const DEFAULT_VIDEO_OVERLAY_LAYER: VideoOverlayLayer = Object.freeze({\n start: 0,\n preset: \"corner-badge\" as const,\n corner: \"bottom-right\" as const,\n ...VIDEO_OVERLAY_PRESETS[\"corner-badge\"][\"bottom-right\"],\n opacity: 1,\n animate: true,\n})\n\nconst HEX6 = /^#[0-9a-fA-F]{6}$/\n\nexport function isVideoOverlayPresetId(v: unknown): v is VideoOverlayPresetId {\n return typeof v === \"string\" && (VIDEO_OVERLAY_PRESET_IDS as readonly string[]).includes(v)\n}\nexport function isVideoOverlayCorner(v: unknown): v is VideoOverlayCorner {\n return typeof v === \"string\" && (VIDEO_OVERLAY_CORNERS as readonly string[]).includes(v)\n}\nexport function isVideoOverlayOutputAspect(v: unknown): v is VideoOverlayOutputAspect {\n return typeof v === \"string\" && (VIDEO_OVERLAY_OUTPUT_ASPECTS as readonly string[]).includes(v)\n}\nfunction isFit(v: unknown): v is VideoOverlayFit {\n return v === \"contain\" || v === \"cover\"\n}\n\n/**\n * A `layers[]` entry as a layer, or null when it is not a plain object. Layer\n * arrays reach this module from untrusted workflow JSON (the MCP write sites\n * type nodes as `record<string, unknown>`), so a bare string / number / array\n * entry is read as an ABSENT layer — never spread, never `in`-probed.\n */\nfunction asLayer(v: unknown): VideoOverlayLayerInput | null {\n return v !== null && typeof v === \"object\" && !Array.isArray(v) ? (v as VideoOverlayLayerInput) : null\n}\n\n/** 1-based slot of a layer handle id (`overlay` → 1 … `overlay12` → 12); 0 for anything else. */\nexport function videoOverlaySlotOfHandle(handle: string | null | undefined): number {\n return (VIDEO_OVERLAY_HANDLE_IDS as readonly string[]).indexOf(handle ?? \"\") + 1\n}\n\nexport function videoOverlayPresetBox(preset: VideoOverlayPresetId, corner?: VideoOverlayCorner | null): VideoOverlayBox {\n return preset === \"corner-badge\"\n ? VIDEO_OVERLAY_PRESETS[\"corner-badge\"][isVideoOverlayCorner(corner) ? corner : \"bottom-right\"]\n : VIDEO_OVERLAY_PRESETS[preset]\n}\n\nconst TRAILING_DEFAULTS = { x: 0, y: 0, fit: \"contain\", opacity: 1, animate: true } as const\n\nfunction usable(key: string, value: unknown): boolean {\n if (value === null || value === undefined) return false\n if (key === \"preset\") return isVideoOverlayPresetId(value)\n if (key === \"corner\") return isVideoOverlayCorner(value)\n return true\n}\n\n/** `null` / `undefined` / an unknown preset or corner → absent. By reference when nothing is dropped. */\nfunction clean(raw: VideoOverlayLayerInput): Partial<VideoOverlayLayer> {\n const entries = Object.entries(raw)\n if (entries.every(([k, v]) => usable(k, v))) return raw as Partial<VideoOverlayLayer>\n return Object.fromEntries(entries.filter(([k, v]) => usable(k, v))) as Partial<VideoOverlayLayer>\n}\n\nfunction sameShallow(a: Readonly<Record<string, unknown>>, b: unknown): boolean {\n if (!b || typeof b !== \"object\") return false\n const ka = Object.keys(a)\n const kb = Object.keys(b)\n return ka.length === kb.length && ka.every((k) => a[k] === (b as Record<string, unknown>)[k])\n}\n\n/**\n * The ONE normaliser (spec §3.3), called at every write boundary.\n * - `preset` + no box field → the preset's box is copied in, the tag stays.\n * - `preset` + explicit box fields → explicit fields win, the preset fills\n * what is absent; the tag is cleared only when an explicit field DIFFERS\n * from the preset's box (a field the preset does not set — `height` on a\n * corner badge — differs when present).\n * - no `preset` + no box field → the corner badge of the layer's own `corner`\n * (bottom-right when none), the D2 default filling tag / corner / trailing\n * fields, the layer's own fields winning (D8): `{}` → the full default.\n * - no `preset` + a PARTIAL box (not anchor AND width) → returned untouched;\n * the validator answers `incomplete_box`.\n * Trailing defaults x 0, y 0, fit contain, opacity 1, animate true are filled\n * here and nowhere else. `null` reads as absent. Returned BY REFERENCE when\n * nothing changes; idempotent, tag included.\n */\nexport function expandVideoOverlayLayer(raw: VideoOverlayLayerInput | null | undefined): VideoOverlayLayer {\n const obj = asLayer(raw)\n const layer = obj ? clean(obj) : {}\n const present = VIDEO_OVERLAY_BOX_FIELDS.filter((f) => layer[f] !== undefined)\n let out: Record<string, unknown>\n if (isVideoOverlayPresetId(layer.preset)) {\n const box = videoOverlayPresetBox(layer.preset, layer.corner)\n out = { ...box, ...layer }\n if (present.some((f) => layer[f] !== box[f])) delete out.preset\n } else if (present.length === 0) {\n out = { ...DEFAULT_VIDEO_OVERLAY_LAYER, ...videoOverlayPresetBox(\"corner-badge\", layer.corner), ...layer }\n } else if (layer.anchor === undefined || layer.width === undefined) {\n return raw as VideoOverlayLayer\n } else {\n out = { ...layer }\n }\n for (const [k, v] of Object.entries(TRAILING_DEFAULTS)) if (out[k] === undefined) out[k] = v\n return sameShallow(out, raw) ? (raw as VideoOverlayLayer) : (out as unknown as VideoOverlayLayer)\n}\n\n/** `expandVideoOverlayLayer` over an array; the SAME array when no layer changed. */\nexport function expandVideoOverlayPresets(layers: ReadonlyArray<VideoOverlayLayerInput | null | undefined>): VideoOverlayLayer[] {\n let changed = false\n const out = layers.map((l) => {\n const e = expandVideoOverlayLayer(l)\n if (e !== l) changed = true\n return e\n })\n return changed ? out : (layers as VideoOverlayLayer[])\n}\n\n/** The panel's preset click: REPLACE the six box fields with the preset's (dropping any it does not set), set the tag (+ corner), expand. */\nexport function applyVideoOverlayPreset(\n layer: VideoOverlayLayerInput | null | undefined,\n preset: VideoOverlayPresetId,\n corner?: VideoOverlayCorner,\n): VideoOverlayLayer {\n const base: Record<string, unknown> = { ...expandVideoOverlayLayer(layer) }\n for (const f of VIDEO_OVERLAY_BOX_FIELDS) delete base[f]\n delete base.preset\n const nextCorner = preset === \"corner-badge\" ? (corner ?? (isVideoOverlayCorner(base.corner) ? base.corner : \"bottom-right\")) : undefined\n return expandVideoOverlayLayer({\n ...base,\n ...videoOverlayPresetBox(preset, nextCorner),\n preset,\n ...(nextCorner ? { corner: nextCorner } : {}),\n } as VideoOverlayLayerInput)\n}\n\n/** The panel's \"Custom\": the tag is cleared, the box kept. */\nexport function toCustomVideoOverlayLayer(layer: VideoOverlayLayerInput | null | undefined): VideoOverlayLayer {\n const { preset: _tag, ...rest } = expandVideoOverlayLayer(layer)\n return rest as VideoOverlayLayer\n}\n\n/**\n * D10 — delete `imageUrl` from every layer whose canvas handle is wired\n * (`wiredSlots`: 1-based). Pure over `layers` (the route has no edges, so this\n * is a sibling of the expansion, not part of it). Slots 13 and up have no handle\n * and are never touched. The input array by reference when nothing changes.\n */\nexport function clearWiredVideoOverlayImageUrls<T extends VideoOverlayLayerInput | null | undefined>(\n layers: readonly T[],\n wiredSlots: ReadonlySet<number>,\n): readonly T[] {\n let out: T[] | null = null\n for (const slot of wiredSlots) {\n if (!Number.isInteger(slot) || slot < 1 || slot > VIDEO_OVERLAY_HANDLE_IDS.length) continue\n const layer = layers[slot - 1]\n if (!asLayer(layer) || !(\"imageUrl\" in (layer as object))) continue\n out ??= [...layers]\n const { imageUrl: _cleared, ...rest } = layer as VideoOverlayLayerInput\n out[slot - 1] = rest as T\n }\n return out ?? layers\n}\n\ninterface NodeLike {\n id?: unknown\n type?: unknown\n data?: unknown\n}\ninterface EdgeLike {\n target?: unknown\n targetHandle?: unknown\n}\n\n/**\n * The workflow-JSON write-boundary pass (spec §3.3, D10), beside\n * `normalizeNodeModelParams`: for every `video-overlay` node, clear the\n * `imageUrl` of each layer whose handle the WRITTEN edges wire, then expand\n * presets. Runs on every write, so an edge-only write still clears. A `null`\n * (or missing) slot STAYS `null`: \"no settings\" is stored as such, wired or\n * not — the default corner badge is synthesised only where a wired slot is\n * run or drawn (the two engine assemblies and the stage, D2), so the panel,\n * the reorder and the tail trim see the same empty slot whichever writer\n * stored it. (`{}` is not `null`: it is an explicit empty layer, and the\n * expansion turns it into the full default — spec §3.3.) Nodes and the array\n * are returned by reference when nothing changes.\n */\nexport function normalizeVideoOverlayNodes<T extends NodeLike>(nodes: readonly T[], edges: ReadonlyArray<EdgeLike> | null | undefined): T[] {\n let changed = false\n const out = nodes.map((node) => {\n if (node.type !== \"video-overlay\") return node\n const data = node.data\n if (!data || typeof data !== \"object\" || Array.isArray(data)) return node\n const d = data as Record<string, unknown>\n if (!Array.isArray(d.layers)) return node\n const layers = d.layers as Array<VideoOverlayLayerInput | null>\n const wired = new Set<number>()\n for (const e of edges ?? []) {\n if (e.target !== node.id) continue\n const slot = videoOverlaySlotOfHandle(typeof e.targetHandle === \"string\" ? e.targetHandle : undefined)\n if (slot > 0) wired.add(slot)\n }\n const cleared = clearWiredVideoOverlayImageUrls(layers, wired)\n let layersChanged = cleared !== layers\n const next = cleared.map((l) => {\n // null / missing stays as stored; a non-object entry is left untouched so\n // the validator sees it (it reads as an absent layer everywhere).\n if (!asLayer(l)) return l\n const e = expandVideoOverlayLayer(l)\n if (e !== l) layersChanged = true\n return e\n })\n if (!layersChanged) return node\n changed = true\n return { ...node, data: { ...d, layers: next } }\n })\n return changed ? out : (nodes as T[])\n}\n\n/** What `videoOverlayRenderOrder` reads from a layer. */\nexport interface VideoOverlayOrderable {\n readonly zIndex?: number | null\n /** 1-based canvas slot (stamped by both engine assemblies). */\n readonly slot?: number | null\n /** 1-based layer-plan entry. Plan layers sit BELOW every slot layer (handle layers draw above the plan), unless they set a `zIndex`. */\n readonly planLayer?: number | null\n /** 0-based index in the request's `layers[]` (the worker's graph layers carry it). */\n readonly index?: number | null\n}\n\n/** A plan layer's default position sits this far below layer 1's (slot 1 = 0), so the whole plan renders under the slot layers. */\nconst PLAN_LAYER_Z_BASE = 1000\nconst isSlot = (v: unknown): v is number => typeof v === \"number\" && Number.isInteger(v) && v >= 1\nconst isIndex = (v: unknown): v is number => typeof v === \"number\" && Number.isInteger(v) && v >= 0\n\n/**\n * Render order, bottom to top, as positions in `layers`: an explicit zIndex\n * wins; a layer without one sits at its OWN position — `slot − 1` when it has\n * a slot, else its request `index`, else its position in the array given —\n * never at its position in whatever (compacted) array it happens to be passed\n * in. The stage passes every slot; the worker passes the request minus empty\n * slots and minus layers skipped for starting after the end — both must agree\n * (spec: the preview and the run use the same numbers). Ties keep array order\n * (layer 1 lowest).\n */\nexport function videoOverlayRenderOrder(layers: ReadonlyArray<VideoOverlayOrderable | null | undefined>): number[] {\n return layers\n .map((l, i) => {\n const own = isSlot(l?.planLayer) ? l.planLayer - 1 - PLAN_LAYER_Z_BASE : isSlot(l?.slot) ? l.slot - 1 : isIndex(l?.index) ? l.index : i\n return { i, z: typeof l?.zIndex === \"number\" && Number.isFinite(l.zIndex) ? l.zIndex : own }\n })\n .sort((a, b) => a.z - b.z || a.i - b.i)\n .map((e) => e.i)\n}\n\nexport interface VideoOverlayRect {\n readonly left: number\n readonly top: number\n readonly width: number\n readonly height: number\n}\nexport interface VideoOverlayCanvas {\n readonly w: number\n readonly h: number\n}\nexport interface VideoOverlayGeometry {\n readonly box: VideoOverlayRect\n readonly drawn: VideoOverlayRect\n}\n\nconst evenFloor = (n: number): number => Math.max(2, Math.floor(n / 2) * 2)\n\n/**\n * The output canvas: `ASPECT_RATIO_DIMENSIONS[outputAspect]` when a target\n * aspect is set; otherwise the base's DISPLAY size (rotation already applied by\n * the caller's probe) with the sample aspect ratio resolved and both sides\n * rounded down to even — `trunc(iw*sar/2)*2 × trunc(ih/2)*2`, what the ffmpeg\n * base chain produces. null when neither is known.\n */\nexport function videoOverlayCanvas(\n display: { readonly width: number; readonly height: number; readonly sar?: number } | null | undefined,\n outputAspect?: string | null,\n): VideoOverlayCanvas | null {\n if (isVideoOverlayOutputAspect(outputAspect)) {\n const d = ASPECT_RATIO_DIMENSIONS[outputAspect]!\n return { w: d.width, h: d.height }\n }\n if (!display || !(display.width > 0) || !(display.height > 0)) return null\n const sar = typeof display.sar === \"number\" && Number.isFinite(display.sar) && display.sar > 0 ? display.sar : 1\n return { w: evenFloor(display.width * sar), h: evenFloor(display.height) }\n}\n\nfunction anchorFactors(anchor: OverlayAnchor): readonly [number, number] {\n const h = anchor.endsWith(\"left\") ? 0 : anchor.endsWith(\"right\") ? 1 : 0.5\n const v = anchor.startsWith(\"top\") ? 0 : anchor.startsWith(\"bottom\") ? 1 : 0.5\n return [h, v]\n}\n\n/**\n * Spec §3.4. `width%` → px of the canvas width; height follows the image's\n * aspect unless `height%` is set; nine anchors; x/y are additive offsets in %\n * of the canvas. An aspect-following box taller than the canvas is fitted\n * inside it (both sides scaled, aspect kept) — so `drawn` never exceeds the\n * canvas, which is what bounds the sharp pre-fit at one canvas of RGBA. `fit`:\n * contain → the image scaled inside the box, centred; cover → the box itself.\n * The only post-processing is rounding `drawn` DOWN to even, floored at 2 × 2.\n * Differences from Image Overlay's copies (on purpose): no 8192 edge shrink,\n * the canvas clamp, the even rounding.\n */\nexport function resolveVideoOverlayGeometry(\n canvas: VideoOverlayCanvas,\n layer: Pick<VideoOverlayLayer, \"anchor\" | \"x\" | \"y\" | \"width\" | \"height\" | \"fit\">,\n imageAspect: number,\n): VideoOverlayGeometry {\n const aspect = Number.isFinite(imageAspect) && imageAspect > 0 ? imageAspect : 1\n let bw = Math.max(1, Math.round((layer.width / 100) * canvas.w))\n let bh = layer.height !== undefined ? Math.max(1, Math.round((layer.height / 100) * canvas.h)) : Math.max(1, Math.round(bw / aspect))\n if (layer.height === undefined && bh > canvas.h) {\n bw = Math.max(1, Math.round(bw * (canvas.h / bh)))\n bh = canvas.h\n }\n const [ax, ay] = anchorFactors(layer.anchor)\n const left = Math.round(ax * (canvas.w - bw) + (layer.x / 100) * canvas.w)\n const top = Math.round(ay * (canvas.h - bh) + (layer.y / 100) * canvas.h)\n let dw: number\n let dh: number\n if (layer.fit === \"cover\") {\n dw = bw\n dh = bh\n } else if (bw / bh > aspect) {\n dh = bh\n dw = bh * aspect\n } else {\n dw = bw\n dh = bw / aspect\n }\n const width = evenFloor(dw)\n const height = evenFloor(dh)\n return {\n box: { left, top, width: bw, height: bh },\n drawn: { left: left + Math.floor((bw - width) / 2), top: top + Math.floor((bh - height) / 2), width, height },\n }\n}\n\nexport interface VideoOverlayIssue {\n readonly ok: false\n readonly code: VideoOverlayErrorCode\n /** 0-based index into the validated `layers[]`. */\n readonly layer?: number\n readonly slot?: number\n readonly planLayer?: number\n readonly params: Readonly<Record<string, string | number>>\n}\nexport type VideoOverlayValidation = { readonly ok: true } | VideoOverlayIssue\n\nexport interface VideoOverlayValidationInput {\n readonly layers?: ReadonlyArray<VideoOverlayLayerInput | null | undefined> | null\n readonly outputAspect?: string | null\n readonly baseFit?: string | null\n readonly backgroundColor?: string | null\n /** From `assembleVideoOverlayRequest`: the wired layer plan was unreadable. */\n readonly planError?: \"invalid_layer_plan\"\n}\n\nconst inTimeRange = (v: unknown): v is number =>\n typeof v === \"number\" && Number.isFinite(v) && v >= 0 && v <= VIDEO_OVERLAY_MAX_TIME_SEC\n\ntype BoundedField = keyof typeof VIDEO_OVERLAY_BOUNDS\nconst BOUNDED_FIELDS = Object.keys(VIDEO_OVERLAY_BOUNDS) as BoundedField[]\n\n/**\n * The first present (non-null) box / look field outside its domain, with the\n * domain as a symbolic `allowed` string; null when every present field is in\n * range. Only PRESENT fields are checked, so the verdict is the same before and\n * after the expansion (it fills in-range defaults only). This is what keeps a\n * JSON-written layer (MCP `update_workflow_json`, copilot, templates) from\n * reaching the geometry with an unbounded box — `drawn ≤ canvas` (§3.4) holds\n * only for boxes inside these bounds.\n */\nfunction outOfBounds(l: VideoOverlayLayerInput): { field: string; allowed: string } | null {\n for (const f of BOUNDED_FIELDS) {\n const v = l[f]\n if (v === undefined || v === null) continue\n const [min, max] = VIDEO_OVERLAY_BOUNDS[f]\n const integer = f === \"zIndex\"\n if (typeof v !== \"number\" || !Number.isFinite(v) || v < min || v > max || (integer && !Number.isInteger(v))) {\n return { field: f, allowed: `${integer ? \"integers \" : \"\"}${min}..${max}` }\n }\n }\n if (l.anchor != null && !(OVERLAY_ANCHORS as readonly unknown[]).includes(l.anchor)) {\n return { field: \"anchor\", allowed: OVERLAY_ANCHORS.join(\", \") }\n }\n if (l.fit != null && !isFit(l.fit)) return { field: \"fit\", allowed: VIDEO_OVERLAY_FITS.join(\", \") }\n if (l.animate != null && typeof l.animate !== \"boolean\") return { field: \"animate\", allowed: \"true, false\" }\n return null\n}\n\n/**\n * Can `resolveVideoOverlayGeometry` place this layer? True when its box is what\n * the validator's box checks require: `anchor` one of the nine anchors, `width`\n * a finite number, and every present box / look field in range\n * (`VIDEO_OVERLAY_BOUNDS`, enums). A partial box saved from workflow JSON\n * (`{ imageUrl, start, width }`, `anchor: null`) is stored as written — the\n * expansion leaves it for the validator's `incomplete_box` — so any reader\n * that DRAWS a stored layer (the canvas stage) must skip one that fails this;\n * the geometry would throw on it.\n */\nexport function hasDrawableVideoOverlayBox(layer: unknown): boolean {\n const l = asLayer(layer)\n if (!l) return false\n if (!(OVERLAY_ANCHORS as readonly unknown[]).includes(l.anchor)) return false\n if (typeof l.width !== \"number\" || !Number.isFinite(l.width)) return false\n return outOfBounds(l) === null\n}\n\n/**\n * Spec §3.5 — what a schema cannot express, and what the DAG path skips. Run\n * at every engine entry: the route (`.superRefine`, before the expansion), the\n * canvas single-node run, payload-builder and the worker (after it) — the\n * verdict is the same on either side of the expansion (no code reads an\n * expanded field). Also refuses a PRESENT box / look field outside\n * `VIDEO_OVERLAY_BOUNDS` or its enum / type (`field_out_of_bounds`, spec §4.4's\n * \"out-of-bounds box/opacity/zIndex\" row — on the DAG path this validator is\n * the only check). A non-object `layers[]` entry reads as an empty layer. The\n * FIRST failure, as a code.\n */\nexport function validateVideoOverlayRequest(body: VideoOverlayValidationInput): VideoOverlayValidation {\n if (body.planError) return { ok: false, code: \"invalid_layer_plan\", params: {} }\n const layers = Array.isArray(body.layers) ? body.layers : []\n if (layers.length === 0) return { ok: false, code: \"no_layers\", params: {} }\n if (layers.length > VIDEO_OVERLAY_MAX_LAYERS) {\n return { ok: false, code: \"too_many_layers\", params: { max: VIDEO_OVERLAY_MAX_LAYERS, count: layers.length } }\n }\n for (let i = 0; i < layers.length; i++) {\n const l: VideoOverlayLayerInput = asLayer(layers[i]) ?? {}\n const at = (code: VideoOverlayErrorCode, params: Record<string, string | number> = {}): VideoOverlayIssue => ({\n ok: false,\n code,\n layer: i,\n ...(typeof l.slot === \"number\" ? { slot: l.slot } : {}),\n ...(typeof l.planLayer === \"number\" ? { planLayer: l.planLayer } : {}),\n params,\n })\n const boxFields = VIDEO_OVERLAY_BOX_FIELDS.filter((f) => l[f] !== undefined && l[f] !== null)\n if (!isVideoOverlayPresetId(l.preset) && boxFields.length > 0 && (l.anchor == null || l.width == null)) return at(\"incomplete_box\")\n const bad = outOfBounds(l)\n if (bad) return at(\"field_out_of_bounds\", bad)\n if (typeof l.imageUrl !== \"string\" || l.imageUrl.length === 0) return at(\"layer_without_image\")\n if (!inTimeRange(l.start)) return at(\"time_out_of_range\", { field: \"start\", max: VIDEO_OVERLAY_MAX_TIME_SEC })\n if (l.end !== undefined && l.end !== null) {\n if (!inTimeRange(l.end)) return at(\"time_out_of_range\", { field: \"end\", max: VIDEO_OVERLAY_MAX_TIME_SEC })\n if (!(l.end > l.start)) return at(\"end_before_start\", { start: l.start, end: l.end })\n }\n }\n if (!isVideoOverlayOutputAspect(body.outputAspect) && (body.baseFit != null || body.backgroundColor != null)) {\n return { ok: false, code: \"fit_without_aspect\", params: {} }\n }\n return { ok: true }\n}\n\nconst MESSAGES: { readonly [C in VideoOverlayErrorCode]: (p: Readonly<Record<string, string | number>>) => string } = {\n no_layers: () => \"At least 1 layer is required\",\n too_many_layers: (p) => `At most ${p.max} layers (got ${p.count})`,\n incomplete_box: () => \"anchor and width are required without a preset\",\n layer_without_image: () => \"no image — connect one to the layer's handle or set imageUrl\",\n time_out_of_range: (p) => `${p.field} must be between 0 and ${p.max} s`,\n end_before_start: (p) => `end (${p.end} s) must be after start (${p.start} s)`,\n fit_without_aspect: () => \"baseFit and backgroundColor need an outputAspect\",\n field_out_of_bounds: (p) => `${p.field} is out of range (allowed: ${p.allowed})`,\n invalid_layer_plan: () => \"the layer plan must be a list of layers\",\n}\n\nconst PLAN_LAYER_WITHOUT_IMAGE = \"no image — set imageUrl on this layer in the plan.\"\n\n/** `Plan layer <n>` for a layer-plan entry, `Layer <slot>` when the layer came from the canvas, else `layers[<index>]`; \"\" for a request-wide failure. */\nexport function videoOverlayLayerLabel(ref: { readonly layer?: number; readonly slot?: number; readonly planLayer?: number }): string {\n if (typeof ref.planLayer === \"number\") return `Plan layer ${ref.planLayer}`\n return typeof ref.slot === \"number\" ? `Layer ${ref.slot}` : typeof ref.layer === \"number\" ? `layers[${ref.layer}]` : \"\"\n}\n\n/** The ONE English rendering of a verdict — the route's 400 text and the worker's error message. */\nexport function formatVideoOverlayError(issue: VideoOverlayIssue): string {\n const label = videoOverlayLayerLabel(issue)\n // A plan layer has no handle to connect — its image can only come from its own imageUrl.\n const text = issue.code === \"layer_without_image\" && typeof issue.planLayer === \"number\" ? PLAN_LAYER_WITHOUT_IMAGE : MESSAGES[issue.code](issue.params)\n return label ? `${label}: ${text}` : text\n}\n\n/** The wired `layerPlan` value (a JSON string or an array) → its layers, or `invalid_layer_plan`. */\nexport function parseVideoOverlayLayerPlan(raw: unknown): { layers: VideoOverlayLayerInput[] } | { error: \"invalid_layer_plan\" } {\n let value: unknown = raw\n if (typeof raw === \"string\") {\n try {\n value = JSON.parse(raw)\n } catch {\n return { error: \"invalid_layer_plan\" }\n }\n }\n if (!Array.isArray(value) || !value.every((l) => l !== null && typeof l === \"object\" && !Array.isArray(l))) {\n return { error: \"invalid_layer_plan\" }\n }\n return { layers: value as VideoOverlayLayerInput[] }\n}\n\n/** The node-data fields the assembly reads. */\nexport interface VideoOverlayNodeFields {\n readonly layers?: ReadonlyArray<VideoOverlayLayerInput | null | undefined> | null\n readonly outputAspect?: string | null\n readonly baseFit?: string | null\n readonly backgroundColor?: string | null\n}\n\n/**\n * The ONE node → request assembly, called by the canvas single-node run AND\n * payload-builder (so both engines refuse identically). Per slot i over\n * max(wired handles (≤ 12), stored layers) — every stored slot, so more than\n * 20 layers that render reach the validator's `too_many_layers` instead of\n * being dropped: the image is the wired handle's,\n * else the layer's own `imageUrl`; a slot with neither is dropped; a slot with\n * no settings is the default layer (D2 — a `null` / missing / `{}` entry);\n * `slot = i + 1` is stamped; the layer is expanded. `baseFit` /\n * `backgroundColor` ride as stored, WITH or WITHOUT an `outputAspect`: the\n * validator — not this assembly — refuses them without one\n * (`fit_without_aspect`, spec §3.5), so a JSON-written node carrying a fit\n * and no aspect is refused on both engines instead of silently rendering.\n * (The canvas never builds that request: its two aspect writers clear both\n * fields with the aspect.) A value the route's schema would reject — an\n * unknown aspect or fit, a colour that is not `#rrggbb` — is dropped here.\n *\n * A wired layer plan (`planLayers`, a JSON string or an array) contributes its\n * layers FIRST, then the slot layers: plan layers carry `planLayer` (1-based)\n * and never a `slot`, and a plan layer's image is only its own `imageUrl` —\n * never the index-aligned handle's (R18). An unreadable plan sets `planError`,\n * which the validator reports before anything else.\n */\nexport function assembleVideoOverlayRequest(input: {\n readonly videoUrl: string\n readonly data: VideoOverlayNodeFields\n readonly wiredImageUrls: ReadonlyArray<string | null | undefined>\n /** The wired `layerPlan` value (string or array); absent when nothing is wired. */\n readonly planLayers?: unknown\n}): ExpandedVideoOverlayRequest {\n const stored = Array.isArray(input.data.layers) ? input.data.layers : []\n const wired = input.wiredImageUrls.slice(0, VIDEO_OVERLAY_HANDLE_IDS.length)\n // Every stored slot, never capped at VIDEO_OVERLAY_MAX_LAYERS: a JSON-written\n // node with 21+ layers must reach the validator's `too_many_layers` on both\n // engines (spec §3.5) — capping here would silently drop layers 21+. Only the\n // wired list is capped (12 handles).\n const slots = Math.max(wired.length, stored.length)\n const layers: VideoOverlayLayer[] = []\n for (let i = 0; i < slots; i++) {\n const raw = asLayer(stored[i])\n const wiredUrl = wired[i]\n const own = raw?.imageUrl\n const image = typeof wiredUrl === \"string\" && wiredUrl.length > 0 ? wiredUrl : typeof own === \"string\" && own.length > 0 ? own : undefined\n if (!image) continue\n layers.push(expandVideoOverlayLayer({ ...(raw ?? {}), imageUrl: image, slot: i + 1 }))\n }\n const outputAspect = isVideoOverlayOutputAspect(input.data.outputAspect) ? input.data.outputAspect : undefined\n const baseFit = isFit(input.data.baseFit) ? input.data.baseFit : undefined\n const backgroundColor =\n typeof input.data.backgroundColor === \"string\" && HEX6.test(input.data.backgroundColor) ? input.data.backgroundColor : undefined\n const rest = {\n ...(outputAspect ? { outputAspect } : {}),\n ...(baseFit ? { baseFit } : {}),\n ...(backgroundColor ? { backgroundColor } : {}),\n }\n if (input.planLayers === undefined) return { videoUrl: input.videoUrl, layers, ...rest }\n const plan = parseVideoOverlayLayerPlan(input.planLayers)\n if (\"error\" in plan) return { videoUrl: input.videoUrl, layers, ...rest, planError: plan.error }\n const planned = expandVideoOverlayPresets(plan.layers).map((l, i) => {\n const { slot: _slot, ...own } = l\n return { ...own, planLayer: i + 1 }\n })\n return { videoUrl: input.videoUrl, layers: [...planned, ...layers], ...rest }\n}\n\n/**\n * Slot i's image: the wired handle's, else the layer's own `imageUrl` — the\n * one source rule the stage, the panel, the canvas executor and the DAG\n * payload share (the render's merge is the same `wired ?? imageUrl`, spec\n * §3.5). Every stored slot, past 20 too: the limit is the layer COUNT, not\n * the slot (layers 1–4 removed from a 24-layer node leave 20 at slots 5–24).\n * Only the wired list is capped, at the 12 handles.\n */\nexport function videoOverlaySlotSources(\n layers: ReadonlyArray<VideoOverlayLayerInput | null | undefined> | null | undefined,\n wiredImageUrls: ReadonlyArray<string | null | undefined>,\n): Array<string | undefined> {\n const stored = Array.isArray(layers) ? layers : []\n const wired = wiredImageUrls.slice(0, VIDEO_OVERLAY_HANDLE_IDS.length)\n return Array.from({ length: Math.max(stored.length, wired.length) }, (_, i) => {\n const w = wired[i]\n if (typeof w === \"string\" && w.length > 0) return w\n const own = asLayer(stored[i])?.imageUrl\n return typeof own === \"string\" && own.length > 0 ? own : undefined\n })\n}\n\n/** Everything that decides what a Video Overlay run paints. */\nexport interface VideoOverlayComposition {\n /** The resolved base video URL. */\n readonly baseUrl?: string | null\n /** The image each slot draws, by slot index (`videoOverlaySlotSources`). */\n readonly sources: ReadonlyArray<string | null | undefined>\n /** The node's stored settings — never the expanded request. */\n readonly data: VideoOverlayNodeFields\n /** The wired `layerPlan` value (string or array); absent when nothing is wired. */\n readonly planLayers?: unknown\n}\n\n/**\n * A value with every object's keys sorted and every null / undefined object\n * field dropped (the assembly reads both as absent); array positions are kept.\n * A jsonb round-trip re-orders object keys, so a node read back from the DB\n * (a schedule / webhook / app run) and the same node in the editor (insertion\n * order) must give one key.\n */\nfunction canonicalValue(v: unknown): unknown {\n if (Array.isArray(v)) return v.map((x) => (x === undefined ? null : canonicalValue(x)))\n if (v !== null && typeof v === \"object\") {\n const out: Record<string, unknown> = {}\n for (const k of Object.keys(v).sort()) {\n const x = (v as Record<string, unknown>)[k]\n if (x !== undefined && x !== null) out[k] = canonicalValue(x)\n }\n return out\n }\n return v\n}\n\n/**\n * The longest `resultCompositionKey` the REST route accepts. The canvas sends\n * its key with a single-node Run so the job's output_data carries it (a result\n * that lands after a page reload reads fresh); the route stores it opaquely and\n * reads it for nothing else. A full 20-layer composition with long signed URLs\n * fits well inside; a canvas key past it is not sent.\n */\nexport const VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH = 65_536\n\n/**\n * The composition key a run stamps on its result (`resultCompositionKey`): the\n * base, every slot's image, the layers, the output aspect, the fit and the pad\n * colour. A later change to any of them marks the result \"Result (old)\".\n * Canonical — independent of object key order, of absent vs undefined vs null\n * fields, and of trailing empty slots — so the canvas (the node and its\n * single-node Run) and the DAG payload give one key for one composition.\n */\nexport function videoOverlayCompositionKey(c: VideoOverlayComposition): string {\n const sources = c.sources.map((s) => (typeof s === \"string\" && s.length > 0 ? s : null))\n while (sources.length > 0 && sources[sources.length - 1] === null) sources.pop()\n const parts: unknown[] = [\n c.baseUrl || null,\n sources,\n Array.isArray(c.data.layers) ? c.data.layers : [],\n c.data.outputAspect ?? null,\n c.data.baseFit ?? null,\n c.data.backgroundColor ?? null,\n ]\n // Appended only when a plan is wired, so a node with no plan keeps today's key.\n // The PARSED plan is hashed: a JSON string and its array give one key.\n if (c.planLayers !== undefined) {\n const plan = parseVideoOverlayLayerPlan(c.planLayers)\n parts.push(\"error\" in plan ? \"invalid\" : plan.layers)\n }\n return JSON.stringify(canonicalValue(parts))\n}\n","/**\n * Video-analysis node — shared data contract.\n *\n * Single source of truth for the video-analysis node: the backend worker, the\n * frontend, and a future generator all import from here. Two schema layers:\n * - `windowAnalysisSchema` — what the LLM emits per analysis window\n * (strict-JSON footer). `scenes` has NO min (a quiet window returning zero\n * scenes is a VALID result). Model-emitted `oversized`/`slotRefs` are\n * STRIPPED here — they are validator-computed later (z.object drops unknown\n * keys by default).\n * - `videoAnalysisResultSchema` — the merged, validator-computed result across\n * all windows; requires >=1 scene overall.\n *\n * Entity slots are referenced in scene `visual` text via `{slot:<id>}` tokens\n * (`SLOT_TOKEN_RE`) — a grammar distinct from `NODE_REF_PATTERN` and the\n * `{image:N}` reference tokens. Unresolved tokens UNWRAP to their literal id\n * text, never delete (spec invariant), so a downstream prompt never carries a\n * dangling `{slot:…}` placeholder.\n */\nimport { z } from \"zod\"\n\nexport const VIDEO_ANALYSIS_MAX_SCENE_SEC = 8\n\n/**\n * Camera VIEWPOINT — where the camera is relative to the subject. The axis\n * `shotType` does not carry, and the one the analyzer had been improvising.\n *\n * Two failures this fixes, both from real jobs:\n *\n * 1. `shotType` is framing SIZE (Wide … Extreme Close-Up), so a true angle had\n * nowhere to go and landed in the MOVEMENT field instead:\n * `\"camera\": \"low angle static\"`. That loses the angle to anything reading\n * `camera` and pollutes the movement vocabulary.\n * 2. The relational viewpoints — `Over-the-Shoulder`, `POV` — were conventions\n * inside the `shotType` list, competing with the sizes for one slot. So an\n * over-the-shoulder MEDIUM had to pick one and threw the other away. They\n * belong here, leaving `shotType` free to state the size: an OTS medium is\n * `shotType: \"Medium\"` + `angle: \"over-the-shoulder\"`, which is strictly more\n * than either field could carry alone.\n *\n * A closed enum rather than free text precisely because improvisation is the\n * failure being fixed. Absent means EYE-LEVEL — the overwhelming default, so\n * omitting it costs nothing on most shots (the same \"absence is the default\"\n * shape as `transitionOut` and appearance variations).\n *\n * `from-behind` and `over-the-shoulder` also carry real meaning downstream: a\n * face is not visible in either, which is what auto-cast needs to know before\n * choosing one as an identity reference.\n */\nexport const VIDEO_ANALYSIS_SHOT_ANGLES = [\n // Vertical placement and roll — the classical \"angles\".\n \"eye-level\", \"low\", \"high\", \"overhead\", \"worms-eye\", \"dutch\",\n // Relational viewpoints — where the camera sits with respect to the subject.\n \"over-the-shoulder\", \"pov\", \"profile\", \"from-behind\",\n] as const\nexport type VideoAnalysisShotAngle = (typeof VIDEO_ANALYSIS_SHOT_ANGLES)[number]\n\n/** Viewpoints in which the subject's FACE is not visible — so a frame shot this\n * way is a poor identity reference however good its framing otherwise is. */\nexport const VIDEO_ANALYSIS_FACELESS_ANGLES: ReadonlySet<string> = new Set([\"over-the-shoulder\", \"from-behind\"])\n\n/**\n * Effects applied to the PICTURE of a shot. An array — a shot can be grainy and\n * vignetted at once — and absent when the image is clean, which is most shots.\n *\n * Scoped deliberately to things done to the IMAGE, and NOT to compositing that\n * asserts what is in the shot (picture-in-picture, split screen). That line\n * matters: a real job invented `{slot:creator} overlay talking to camera` across\n * nine scenes for a man who is never seen, so a field for \"there is an inset of a\n * person here\" would hand that fabrication a legitimate home. An effect is\n * verifiable in the pixels; a claim about who is inset is not.\n *\n * `dissolve` and `fade` are NOT here either — they are edits BETWEEN shots and\n * belong to `transitionOut`.\n */\nexport const VIDEO_ANALYSIS_VISUAL_EFFECTS = [\n \"blur\", \"pixelate\", \"glitch\", \"grain\", \"vignette\", \"flash\", \"distortion\", \"double-exposure\",\n] as const\nexport type VideoAnalysisVisualEffect = (typeof VIDEO_ANALYSIS_VISUAL_EFFECTS)[number]\n\n/**\n * Visible edit INTO the next shot.\n *\n * `dissolve` (a cross-fade from one image to the other) is distinct from `fade`\n * (through black or white). Collapsing both onto `fade` — as this enum did — makes\n * a recreation render the wrong edit, and the two look nothing alike.\n *\n * ABSENT means NOTHING ASSERTED (since v2): the analyser emits a value only\n * when it can see the device; an unknown or uncertain edit is left out so the\n * video model chooses. `cut` is itself an assertion (an instant change between\n * two clearly different shots), never a default.\n */\nexport const VIDEO_ANALYSIS_TRANSITIONS = [\n \"cut\", \"fade\", \"dissolve\", \"wipe\", \"whip\",\n // v2 (2026-08-30, recast shot craft rev 1.5 Appendix F): the common edits a\n // creator actually cuts with. `white-flash` / `digital-glitch` are spelled\n // out because `flash` / `glitch` already name in-shot EFFECTS (the axis test\n // below) — a device is the edit BETWEEN two shots, an effect is on one shot.\n \"zoom\", \"slide\", \"white-flash\", \"digital-glitch\", \"morph\", \"match\", \"jump\",\n] as const\nexport type VideoAnalysisTransition = (typeof VIDEO_ANALYSIS_TRANSITIONS)[number]\n\n/**\n * What burned-in text IS (2026-08-28, recast shot craft). Decides render-vs-omit\n * downstream: a `subtitle` is a transcription of the piece's own speech — a\n * recreation re-speaks it and must not render it — while a `title`, `caption`,\n * `lower-third` or `logo` is picture content. Absent when a scene carries no\n * text. A new KEY on the scene: strip-mode readers drop it harmlessly.\n */\nexport const VIDEO_ANALYSIS_TEXT_KINDS = [\"title\", \"caption\", \"lower-third\", \"subtitle\", \"logo\", \"other\"] as const\nexport type VideoAnalysisTextKind = (typeof VIDEO_ANALYSIS_TEXT_KINDS)[number]\n\n/** How the CLIP opens (clip-level, not per scene — a window's first scene is\n * not the clip's). Absent ⇒ a hard open. Only `fade` today. */\nexport const VIDEO_ANALYSIS_CLIP_TRANSITIONS_IN = [\"fade\"] as const\nexport type VideoAnalysisClipTransitionIn = (typeof VIDEO_ANALYSIS_CLIP_TRANSITIONS_IN)[number]\n\n/**\n * Time manipulation — slow motion, ramps, timelapse, freeze, reverse.\n *\n * Previously unrepresentable anywhere in the schema, so a recreation rendered\n * every shot at normal speed no matter what the footage did. It is a first-class\n * lever in every video model and a real editing decision in most action footage.\n *\n * `\"normal\"` is deliberately NOT a member: absence is normal speed, so there is\n * exactly one way to say \"nothing unusual here\" and the field costs nothing on\n * the majority of shots.\n */\nexport const VIDEO_ANALYSIS_SPEED_EFFECTS = [\"slow-motion\", \"ramp-in\", \"ramp-out\", \"timelapse\", \"freeze\", \"reverse\"] as const\n\n/** CHRONICLE TIME (2026-08-17): the STORY clock, per scene, as read from the\n * pictures — light, sky, practicals. \"ambiguous\" is the honest answer for a\n * windowless interior; guessing day is exactly the kind of tidy inference\n * the analysis doctrine forbids. */\nexport const VIDEO_ANALYSIS_TIMES_OF_DAY = [\"dawn\", \"day\", \"dusk\", \"night\", \"ambiguous\"] as const\n\n/** STORY JUMP since the PREVIOUS scene in the list: how much narrative time\n * passed across the cut, judged from evidence (wardrobe change, aged\n * subjects, season, a title card), not from the cut itself. Time outranks\n * location for continuity judgements (same person, new place, continuous\n * time ⇒ same outfit; same place, years later ⇒ anything may differ), which\n * is why this is a structured field and not prose. \"unclear\" is the honest\n * default; the FIRST scene of a clip is \"continuous\" by convention. */\nexport const VIDEO_ANALYSIS_STORY_JUMPS = [\"continuous\", \"same-day\", \"another-day\", \"years-later\", \"unclear\"] as const\nexport type VideoAnalysisSpeedEffect = (typeof VIDEO_ANALYSIS_SPEED_EFFECTS)[number]\n\n/**\n * The CLIP-LEVEL look — one source of truth for the properties that belong to\n * the whole piece rather than any one shot.\n *\n * Colour grade, camera format and lens character were previously only ever prose\n * inside each scene's `visual`, which meant a 43-scene analysis re-decided the\n * grade forty-three independent times with nothing holding them consistent. That\n * is the same drift problem entity slots solve for people: state it once, apply it\n * everywhere. A recreation reads this alongside every scene.\n *\n * Every field optional — an analyzer that cannot read the format should say\n * nothing rather than guess, and a per-scene deviation still belongs in that\n * scene's `visual` prose.\n */\nexport const clipLookSchema = z.object({\n /**\n * The rendering MEDIUM — \"live-action photoreal\", \"2D anime\", \"stop-motion\n * claymation\", \"3D render\", \"oil painting\", \"pixel art\".\n *\n * The most consequential field in this object, and orthogonal to every other\n * one: two shots with identical grade, lens, lighting and framing still look\n * nothing alike when one is live action and the other is an oil painting. Get\n * this wrong and a recreation renders the whole piece in the wrong medium,\n * which no amount of correct grade or lighting can rescue.\n *\n * Mirrors the product's Style picker, whose catalog defines exactly this axis\n * and states its independence from lighting, colour-look, atmosphere and lens.\n * A clip that genuinely changes medium partway (live action with an animated\n * insert) states the deviation in that scene's `visual`, as with `lighting`.\n */\n style: z.string().optional(),\n /**\n * The Style picker CATALOG ID the prose in `style` corresponds to — the\n * analyzer's PICK (\"pixar-3d\" beside \"3D stylized animation\"), not a second\n * description of it.\n *\n * Worth strictly more than the prose it accompanies: an id addresses the\n * catalog, so a recreation renders the same medium the product's own Style\n * picker would render, instead of re-interpreting a sentence. Absent when the\n * analyzer read a medium it could not place in the catalog — `style` then\n * carries the whole answer, as it always did.\n *\n * A free `string` here on purpose. The PRODUCER validates it against the\n * catalog (the analyzer plugin's wire schema is an enum generated from\n * `STYLES`, so an invented id never leaves it), while this package must not\n * carry the catalog itself. A closed enum here would only add a second copy\n * of the vocabulary to drift out of date — and, worse, would REJECT a\n * catalog entry newer than the installed `@nodaro/shared`, which is exactly\n * the analysis a consumer most wants to read.\n */\n styleId: z.string().optional(),\n /** Colour grade / palette — \"muted teal-and-orange, crushed blacks\". */\n grade: z.string().optional(),\n /** Camera or film FORMAT and stock — \"anamorphic digital\", \"16mm film grain\". */\n format: z.string().optional(),\n /** Lens character — \"wide-angle, shallow depth of field throughout\". */\n lens: z.string().optional(),\n /** Overall lighting style — \"hard single-source daylight, deep shadow\". */\n lighting: z.string().optional(),\n /** What KIND of piece this is — \"cinematic trailer\", \"talking-head vlog\". */\n genre: z.string().optional(),\n /**\n * The visual INFLUENCE the piece clearly evokes — a cinematographer, director,\n * photographer or named aesthetic (\"shot like Deakins\", \"Wes Anderson\n * symmetry\", \"80s Kodachrome editorial\").\n *\n * The highest-leverage field here by a distance: a couple of words transfer a\n * whole aesthetic that would otherwise take a paragraph of grade, lens and\n * lighting prose to approximate — which is exactly why the product already\n * exposes it as a curated picker (\"Photographer / Artist\") whose catalog ships\n * `in the style of …` prompt hints. The analyzer had no way to read it back.\n *\n * Deliberately conservative: OMIT unless the footage genuinely evokes a\n * well-known, nameable style. A confident misattribution is worse than silence,\n * because it drags an entire wrong aesthetic into every regenerated shot — so\n * describing the look in `grade`/`lighting` always beats guessing a name.\n */\n influence: z.string().optional(),\n})\nexport type ClipLook = z.infer<typeof clipLookSchema>\nexport const VIDEO_ANALYSIS_ENTITY_SOURCES = [\"wired-character\", \"wired-object\", \"wired-location\", \"wired-creature\"] as const\nexport type VideoAnalysisEntitySource = (typeof VIDEO_ANALYSIS_ENTITY_SOURCES)[number]\n/** Matches {slot:<id>} tokens. Distinct from NODE_REF_PATTERN / {image:N} grammars. */\nexport const SLOT_TOKEN_RE = /\\{slot:([a-z0-9-]+)\\}/g\n\n/**\n * Appearance variations (cast-variations spec, 2026-07-24): a slot's canonical\n * `description` IS its default look; `variations` enumerates NON-default looks\n * only (dream vs reality, flashback, disguise…). `\"default\"` is a reserved\n * variationId — used in scene bindings / ledger keys / routing for unbound\n * scenes, never inside `variations[]`. The closed slug vocabulary is\n * doctrine-enforced (the schema pins only the id charset, like `role`);\n * `alt-1`/`alt-2` are the escape hatches.\n */\nexport const VIDEO_ANALYSIS_VARIATION_SLUGS = [\"dream\", \"flashback\", \"disguise\", \"costume\", \"transformation\", \"era\", \"alt-1\", \"alt-2\"] as const\n/** Max NON-default looks per slot. The window layer REJECTS past the cap (schema-forced retry); the cross-window merge FOLDS at the cap. */\nexport const VIDEO_ANALYSIS_MAX_VARIATIONS = 4\nexport const VIDEO_ANALYSIS_DEFAULT_VARIATION = \"default\"\n\nexport const slotVariationSchema = z.object({\n variationId: z.string().min(1).regex(/^[a-z0-9-]+$/)\n .refine((id) => id !== VIDEO_ANALYSIS_DEFAULT_VARIATION, { message: `\"${VIDEO_ANALYSIS_DEFAULT_VARIATION}\" is reserved for the slot's canonical look` }),\n label: z.string().min(1),\n /** Full STANDALONE casting-sheet look restating the slot's invariant identity\n * core (face, build, age) — the manifest substitutes it wholesale, so a\n * wardrobe-only delta would silently delete identity from the prompt. */\n description: z.string().min(1),\n /** Per-variation identity reference (auto-cast frame or user sheet). In the\n * schema from day one: every strip-mode round-trip must carry it. */\n refImageUrl: z.string().url().optional(),\n})\nexport type SlotVariation = z.infer<typeof slotVariationSchema>\n\nexport const entitySlotSchema = z.object({\n slotId: z.string().min(1).regex(/^[a-z0-9-]+$/),\n label: z.string().min(1),\n source: z.enum(VIDEO_ANALYSIS_ENTITY_SOURCES),\n role: z.string().min(1),\n description: z.string().min(1),\n /** Auto-cast visual reference — a hosted frame from the analyzed footage\n * where this entity is clearly visible. Optional/additive: producers may\n * omit it; consumers use it as an identity reference for recreation. */\n refImageUrl: z.string().url().optional(),\n /**\n * Why `refImageUrl` is ABSENT, when the analyzer's vision pass actively\n * refused every candidate frame rather than merely failing to produce one.\n *\n * Present only alongside a missing `refImageUrl`, and only for a real refusal\n * — never for a technical failure, so its presence always carries meaning. The\n * important case reads like \"the shots bound to this slot show someone else —\n * cast as X, but on screen: Y\", which is the analyzer telling you the casting\n * description and the footage disagree. A consumer should treat that as a\n * reason to review the slot before spending on regeneration, since a wrong\n * identity propagates into every regenerated shot.\n */\n refRejectedReason: z.string().optional(),\n /** NON-default looks only; present only when at least one exists. */\n variations: z.array(slotVariationSchema).max(VIDEO_ANALYSIS_MAX_VARIATIONS).optional(),\n /**\n * WHOSE THIS OBJECT IS (2026-09-17). An object slot that is worn, held,\n * carried, driven or ridden by a cast person or creature names that slot\n * here, with the relation as a short passive phrase ending in \"by\" (\"worn\n * by\", \"held by\", \"driven by\"). The link says the object slot IS the one on\n * that person — not a second one: a recast that saw \"Man in Blue Silk\n * Shirt\" AND \"Blue Silk Shirt\" as unrelated slots rendered two shirts.\n * Object slots only; a free-standing prop, the product on a table, a place\n * or a person never carries it. Optional/additive: producers may omit it.\n */\n owner: z.object({\n slotId: z.string().min(1).regex(/^[a-z0-9-]+$/),\n relation: z.string().min(1),\n }).optional(),\n})\nexport type EntitySlot = z.infer<typeof entitySlotSchema>\nexport type EntitySlotOwner = NonNullable<EntitySlot[\"owner\"]>\n\n/**\n * The sound LAYER vocabulary — what kind of thing this layer is.\n *\n * `ambience` is deliberately its own member rather than a flavour of `sfx`:\n * they are different layers of a real mix and they are recreated by different\n * means — ambience is the continuous bed a scene sits in (room tone, distant\n * traffic, wind), an sfx is a discrete hit (a door slam, a gunshot). Folded\n * together, a scene's bed and its one-off noises arrive indistinguishable and\n * anything recreating the mix has to guess which it was told.\n *\n * Exported so a consumer keying its own document by these modes imports the\n * vocabulary instead of restating it — the same reason every other closed\n * vocabulary in this file is a const.\n */\nexport const VIDEO_ANALYSIS_AUDIO_MODES = [\"speech\", \"music\", \"sfx\", \"ambience\"] as const\nexport type VideoAnalysisAudioMode = (typeof VIDEO_ANALYSIS_AUDIO_MODES)[number]\n\n/**\n * One concurrent sound layer in a scene. Real footage stacks sound (music bed\n * under dialogue over ambient room tone), so a scene carries an ARRAY of these\n * — an empty array means genuine silence. `content`: speech = verbatim words;\n * music/sfx/ambience = gen-ready description. `voice` is speech-only\n * voice-casting.\n */\nconst audioLayerSchema = z.object({\n mode: z.enum(VIDEO_ANALYSIS_AUDIO_MODES),\n content: z.string().min(1),\n voice: z.string().optional(),\n /**\n * SPEECH ONLY — `slotId` of the on-screen speaker saying these words.\n *\n * `voice` casts a voice (\"male, proud triumphant shouting\"); this says WHO it\n * belongs to, so a recreation can route the line to the right character\n * instead of guessing. Usually one person speaks per scene and the guess is\n * right, which is exactly why the cases with two speakers over one cut fail\n * silently without this field.\n *\n * Optional by design and deliberately NOT refined against `mode` here: the\n * window schema is the enforced decode grammar, and rejecting a whole roll\n * because the model tagged a music layer would be a hair-trigger failure. A\n * speaker on a non-speech layer, or one naming a slot that no longer exists,\n * is stripped structurally by `dropUnknownSpeakers` — the same\n * unwrap/drop/sweep philosophy the slot-token and binding channels use.\n *\n * An unseen narrator gets NO speaker: a voice with no body is never a slot\n * (doctrine §5), so attribution here would resurrect the phantom-entity\n * defect that `stripOrphanSlots` exists to kill.\n */\n speakerSlot: z.string().optional(),\n /**\n * SPEECH ONLY — WHO says these words, by NAME.\n *\n * The second of two ways to name a speaker, and the one for documents that\n * have no slots: `speakerSlot` addresses an `EntitySlot` of THIS analysis by\n * id, while `speaker` is the plain cast name a production keys its own cast\n * by (\"Jack Mercer\"). A layer may legitimately carry both — the id for the\n * analysis it came from, the name for the document it is going into — and a\n * consumer that understands only one reads the one it understands.\n *\n * Optional, and not refined against `mode`, for the same reason\n * `speakerSlot` is not: the window schema is the enforced decode grammar and\n * must not throw away a whole roll over one mis-tagged field.\n *\n * NOT swept by `dropUnknownSpeakers`. That function is the SLOT channel's\n * sanitizer — it judges an id against the surviving slot list, and a name has\n * no id space to be unknown in. The asymmetry is deliberate and pinned by\n * test; whoever owns the name's vocabulary sanitizes the name.\n *\n * The residual that leaves: a layer can keep a `speaker` naming someone\n * `stripOrphanSlots` already pruned as a phantom, where the same claim spelled\n * `speakerSlot` would have been dropped — the invented-narrator defect, in the\n * one spelling the sweep cannot see. LATENT today, since nothing in this\n * repo emits `speaker`; the day the analyzer does, that sweep is what has to\n * grow, not this field.\n */\n speaker: z.string().optional(),\n})\nexport type AudioLayer = z.infer<typeof audioLayerSchema>\n\nconst windowSceneBase = z.object({\n startSec: z.number().min(0),\n endSec: z.number().min(0),\n label: z.string().min(1),\n shotType: z.string().min(1),\n camera: z.string(),\n /** Camera VIEWPOINT. Absent ⇒ eye-level. Keeps `camera` to pure MOVEMENT and\n * frees `shotType` to state the SIZE even on an over-the-shoulder or POV. */\n angle: z.enum(VIDEO_ANALYSIS_SHOT_ANGLES).optional(),\n /** Time manipulation. Absent ⇒ normal speed. */\n speed: z.enum(VIDEO_ANALYSIS_SPEED_EFFECTS).optional(),\n /** CHRONICLE TIME (2026-08-17) — see the consts' docstrings. Both optional:\n * absent on every pre-2.6.0 analysis, and legitimately absent when the\n * analyser cannot read the clock. Enum + optional keeps the window decode\n * grammar congruence-safe (no ints, no maxItems). */\n timeOfDay: z.enum(VIDEO_ANALYSIS_TIMES_OF_DAY).optional(),\n storyJump: z.enum(VIDEO_ANALYSIS_STORY_JUMPS).optional(),\n visual: z.string().min(1),\n /**\n * Text burned into the PICTURE of this shot — titles, captions, lower-thirds,\n * subtitles — verbatim, in its original script. Absent when the frame carries\n * none.\n *\n * Doctrine already asks for on-screen text inside `visual` prose, but a\n * recreation needs to know discretely whether to RENDER text at all, and\n * `translateOnScreenTextToEnglish` had no structured field to land in. It is\n * also the signal the auto-cast frame judge reads: picture text belonging to an\n * earlier scene's speech means the shot is replayed footage under a voice-over.\n */\n onScreenText: z.string().optional(),\n /** What the on-screen text IS. Meaningful only when `onScreenText` is non-empty. */\n onScreenTextKind: z.enum(VIDEO_ANALYSIS_TEXT_KINDS).optional(),\n /** Effects on this shot's PICTURE. Absent ⇒ a clean image. */\n effects: z.array(z.enum(VIDEO_ANALYSIS_VISUAL_EFFECTS)).optional(),\n transitionOut: z.enum(VIDEO_ANALYSIS_TRANSITIONS).optional(),\n // Round 4 (2026-08-30, recast shot craft rev 1.5 Appendix F.8): the edit into\n // the next scene in the analyser's OWN WORDS — a few words of what it saw\n // (\"fast blurred pan left\", \"fade to black\", \"zoom-blur warp into the tunnel\")\n // — or absent when the take continues through the change or no edit is seen\n // (nothing asserted: the video model decides from story and refs). The closed\n // `transitionOut` vocabulary above is LEGACY from here on: kept so stored\n // blueprints still parse, never emitted again. Readers take\n // `transition ?? transitionOut`.\n transition: z.string().trim().min(1).max(120).optional(),\n // Array of concurrent layers (music + speech + sfx together); [] = silence.\n audio: z.array(audioLayerSchema),\n /** slotId → variationId for slots wearing a NON-default look in this scene\n * (only slots referenced in the scene; absent key ⇒ the default look).\n * Rides windowSceneBase so BOTH the window layer and analyzedSceneSchema\n * inherit it — the out-of-band binding channel (no in-text markers, D6). */\n slotVariations: z.record(z.string(), z.string()).optional(),\n})\n// .strip() (default) drops model-emitted oversized/slotRefs — validator-computed only.\nconst windowSceneSchema = windowSceneBase.refine((s) => s.endSec > s.startSec, { message: \"endSec must be > startSec\" })\nexport type WindowScene = z.infer<typeof windowSceneSchema>\n\n/** What the MODEL emits per window (strict-JSON footer schema). scenes has NO min. */\nexport const windowAnalysisSchema = z.object({\n language: z.string().optional(),\n /** The clip-level look as read from THIS window. Merge folds the windows\n * field-by-field (first non-empty wins), like `language`. */\n look: clipLookSchema.optional(),\n /** The clip opens with a fade-in. Folded from window 0 only. */\n transitionIn: z.enum(VIDEO_ANALYSIS_CLIP_TRANSITIONS_IN).optional(),\n slots: z.array(entitySlotSchema),\n scenes: z.array(windowSceneSchema),\n})\nexport type WindowAnalysis = z.infer<typeof windowAnalysisSchema>\n\nexport const analyzedSceneSchema = windowSceneBase.extend({\n sceneNumber: z.number().int().min(1),\n visualResolved: z.string().min(1),\n oversized: z.boolean().optional(),\n slotRefs: z.array(z.string()),\n}).refine((s) => s.endSec > s.startSec, { message: \"endSec must be > startSec\" })\nexport type AnalyzedScene = z.infer<typeof analyzedSceneSchema>\n\nexport const videoAnalysisResultSchema = z.object({\n meta: z.object({\n durationSec: z.number().positive(),\n width: z.number().int().positive(),\n height: z.number().int().positive(),\n aspectRatio: z.string(),\n title: z.string().optional(),\n language: z.string().optional(),\n }),\n /** Clip-level look, merged across windows. Deliberately a sibling of `meta`\n * rather than a member: `meta` is probed fact (ffprobe dimensions, probed\n * duration), while this is the model's reading of the photography. */\n look: clipLookSchema.optional(),\n /** The clip opens with a fade-in. Folded from window 0 only. */\n transitionIn: z.enum(VIDEO_ANALYSIS_CLIP_TRANSITIONS_IN).optional(),\n slots: z.array(entitySlotSchema),\n scenes: z.array(analyzedSceneSchema).min(1),\n /** CAST VARIATIONS (§4 cap handling): looks the analyzer's merge FOLDED into\n * the default at VIDEO_ANALYSIS_MAX_VARIATIONS — recorded, never silent. In\n * the wire schema so strip-mode consumers (the recast client's validated\n * blueprint view) keep it: the §6 \"folded into default look\" note is the\n * user's only pre-pay defense against a wrong split. */\n variationFolds: z.array(z.object({\n slotId: z.string(),\n variationId: z.string(),\n label: z.string(),\n })).optional(),\n /**\n * Analyzer diagnostics for THIS result — things the analysis noticed about\n * itself that a reader should know before spending on regeneration.\n *\n * Added because there was previously no channel for them at all: the merge\n * layer has always produced a warnings list and the auto-cast pass has always\n * had findings, and every one of them died in a `console.warn` inside a worker\n * the user cannot see. So a run could quietly drop a duplicated line, fold a\n * cast look, or conclude a character is not the person their own description\n * names, and the result looked indistinguishable from a clean one.\n *\n * Prose, not codes, and deliberately so — these are read by a human deciding\n * whether to re-run, not branched on. Absent when there is nothing to report.\n */\n warnings: z.array(z.string()).optional(),\n})\nexport type VideoAnalysisResult = z.infer<typeof videoAnalysisResultSchema>\n\nexport function deriveSlotRefs(visual: string): string[] {\n const out: string[] = []\n for (const m of visual.matchAll(SLOT_TOKEN_RE)) if (!out.includes(m[1])) out.push(m[1])\n return out\n}\n\nexport function rewriteSlotTokens(visual: string, renames: Record<string, string>): string {\n return visual.replace(SLOT_TOKEN_RE, (whole, id: string) => (renames[id] ? `{slot:${renames[id]}}` : whole))\n}\n\n/** Unresolved tokens unwrap to their literal id text — never deleted (spec invariant). */\nexport function unwrapUnresolvedTokens(text: string, validIds: Set<string>): { text: string; unresolved: string[] } {\n const unresolved: string[] = []\n const out = text.replace(SLOT_TOKEN_RE, (whole, id: string) => {\n if (validIds.has(id)) return whole\n if (!unresolved.includes(id)) unresolved.push(id)\n return id\n })\n return { text: out, unresolved }\n}\n\n/**\n * Rewrite a scene's `slotVariations` after cross-window slot/variation\n * unification: slot keys map through `slotRenames`, then each variation value\n * maps through `variationRenames[<new slotId>]`. Absent renames pass through.\n */\nexport function rewriteSceneBindings(\n sv: Record<string, string> | undefined,\n slotRenames: Record<string, string>,\n variationRenames?: Record<string, Record<string, string>>,\n): Record<string, string> | undefined {\n if (!sv) return undefined\n const out: Record<string, string> = {}\n for (const [slotId, variationId] of Object.entries(sv)) {\n const newSlot = slotRenames[slotId] ?? slotId\n out[newSlot] = variationRenames?.[newSlot]?.[variationId] ?? variationId\n }\n return out\n}\n\n/**\n * Drop bindings whose (slotId, variationId) no longer exists after a merge —\n * the unwrap-rule mirror: never persist a dangling binding, and report what\n * was dropped so the caller can warn. `\"default\"` is always valid for a known\n * slot. `kept` is undefined when nothing survives (no `{}` materialization).\n */\nexport function dropUnknownBindings(\n sv: Record<string, string> | undefined,\n validBySlot: Map<string, Set<string>>,\n): { kept?: Record<string, string>; dropped: Array<{ slotId: string; variationId: string }> } {\n if (!sv) return { dropped: [] }\n const kept: Record<string, string> = {}\n const dropped: Array<{ slotId: string; variationId: string }> = []\n for (const [slotId, variationId] of Object.entries(sv)) {\n const valid = validBySlot.get(slotId)\n if (valid && (variationId === VIDEO_ANALYSIS_DEFAULT_VARIATION || valid.has(variationId))) kept[slotId] = variationId\n else dropped.push({ slotId, variationId })\n }\n return { kept: Object.keys(kept).length > 0 ? kept : undefined, dropped }\n}\n\n/**\n * Rewrite speech attribution after cross-window slot unification — the\n * `rewriteSceneBindings` counterpart for the `audio` channel. Slot unification\n * renames a loser id to its survivor and rewrites `{slot:…}` tokens and\n * variation bindings; an un-rewritten `speakerSlot` would be left pointing at an\n * id that no longer exists. Copy-on-write: returns the input array untouched\n * when no layer names a renamed slot.\n */\nexport function rewriteSpeakerSlots(audio: AudioLayer[], slotRenames: Record<string, string>): AudioLayer[] {\n if (!audio.some((a) => a.speakerSlot !== undefined && slotRenames[a.speakerSlot])) return audio\n return audio.map((a) => {\n const to = a.speakerSlot !== undefined ? slotRenames[a.speakerSlot] : undefined\n return to ? { ...a, speakerSlot: to } : a\n })\n}\n\n/**\n * Strip attribution that no scene can honour — the `dropUnknownBindings` mirror\n * for the `audio` channel. Two cases, both model sloppiness rather than errors\n * worth failing a roll over:\n * - a `speakerSlot` on any non-`speech` layer (nobody is speaking)\n * - a `speakerSlot` naming a slot that is not in the final list\n *\n * MUST run AFTER the orphan-slot sweep, and attribution must NEVER count as a\n * slot reference for that sweep: a slot reachable only as a speaker is a voice\n * with no body — precisely the invented-narrator entity doctrine §5 forbids. The\n * two passes compose to remove both the phantom slot and the dangling\n * attribution pointing at it.\n */\nexport function dropUnknownSpeakers(\n audio: AudioLayer[],\n validSlotIds: Set<string>,\n): { audio: AudioLayer[]; dropped: string[] } {\n const dropped: string[] = []\n const out = audio.map((a) => {\n if (a.speakerSlot === undefined) return a\n if (a.mode === \"speech\" && validSlotIds.has(a.speakerSlot)) return a\n dropped.push(a.speakerSlot)\n const { speakerSlot: _drop, ...rest } = a\n return rest\n })\n return { audio: dropped.length > 0 ? out : audio, dropped }\n}\n\n/**\n * Fold each window's reading of the clip look into one, FIELD BY FIELD: the first\n * window that had something to say about a field wins it.\n *\n * Per-field rather than first-window-wins-everything because the windows see\n * different footage — an opening window may read the grade confidently while only\n * a later one contains the shot that reveals the format. Mirrors how `language` is\n * resolved across windows rather than taken from window 0.\n *\n * Returns undefined when no window said anything, so an analysis with nothing to\n * report omits the field rather than shipping an empty object.\n */\nexport function mergeClipLook(looks: ReadonlyArray<ClipLook | undefined>): ClipLook | undefined {\n const out: Record<string, string> = {}\n for (const look of looks) {\n for (const [k, v] of Object.entries(look ?? {})) {\n if (typeof v === \"string\" && v.trim() && !out[k]) out[k] = v.trim()\n }\n }\n return Object.keys(out).length > 0 ? (out as ClipLook) : undefined\n}\n\n/** Substitute {slot:x}: castMap binding wins, else the slot's description, else literal id. */\nexport function renderAnalyzedScene(scene: { visual: string }, slots: EntitySlot[], castMap?: Record<string, string>): string {\n const byId = new Map(slots.map((s) => [s.slotId, s]))\n return scene.visual.replace(SLOT_TOKEN_RE, (_whole, id: string) => castMap?.[id] ?? byId.get(id)?.description ?? id)\n}\n\n/**\n * Float slack for the oversize comparison.\n *\n * Scene boundaries arrive as decimal seconds and the duration is derived by\n * SUBTRACTING two of them, which does not land on the cap exactly: a real job\n * produced a 12.67 → 20.67 scene whose computed length is 8.000000000000002,\n * so a scene sitting precisely ON the 8s cap was flagged oversized and carried\n * a `oversized: true` defect marker downstream for no reason.\n *\n * A microsecond is orders of magnitude below any boundary precision the\n * analyzer can actually resolve (windows land on ~0.01s at best), so this can\n * never mask a genuinely oversized scene — the smallest real overshoot is\n * still ~10000x larger than the tolerance.\n */\nconst OVERSIZE_TOLERANCE_SEC = 1e-6\n\nexport function isOversizedScene(startSec: number, endSec: number): boolean {\n return endSec - startSec > VIDEO_ANALYSIS_MAX_SCENE_SEC + OVERSIZE_TOLERANCE_SEC\n}\n\nconst STANDARD_RATIOS: Array<[string, number]> = [\n [\"16:9\", 16 / 9], [\"9:16\", 9 / 16], [\"1:1\", 1], [\"4:3\", 4 / 3], [\"3:4\", 3 / 4], [\"21:9\", 21 / 9],\n]\nexport function aspectRatioFromDims(w: number, h: number): string {\n const r = w / h\n for (const [label, v] of STANDARD_RATIOS) if (Math.abs(r - v) / v < 0.03) return label\n const gcd = (a: number, b: number): number => (b === 0 ? a : gcd(b, a % b))\n const g = gcd(Math.round(w), Math.round(h))\n return `${Math.round(w) / g}:${Math.round(h) / g}`\n}\n\n/** Sung-vocal evidence in a music layer's gen-ready description. Word-bounded\n * and deliberately WITHOUT bare \"song\"/\"music\" (an instrumental bed is\n * routinely described as a \"pop song\"). Quoted text of some length inside a\n * music layer counts too — analysers quote lyrics. */\nconst MUSIC_VOCAL_RE = /\\b(?:lyrics?|sung|sings?|singing|vocals?|chorus|verse|rap(?:ping|ped)?|a cappella)\\b/i\nconst MUSIC_VOCAL_QUOTE_RE = /[\"\\u201c][^\"\\u201d]{6,}[\"\\u201d]/\n/** Negated-vocal phrasing — a layer matching this contributes NO vocal\n * evidence (it does not veto other layers). */\nconst MUSIC_NO_VOCAL_RE = /\\b(?:no|without|non)[- ](?:vocals?|lyrics?|singing)\\b|\\binstrumental\\b|\\bwordless\\b/i\n\n/**\n * MUSIC-VIDEO INFERENCE (2026-08-17): is this clip a music video — one whose\n * soundtrack IS the content, to be taken as-is with no stem separation?\n *\n * Lives in SHARED because two sides must agree BYTE-FOR-BYTE on the answer:\n * the recast route derives `music.mode` from it server-side, and the client\n * both prices the original-audio prep and GUARDS on the server's derived mode\n * at generate time — two hand-written copies of this heuristic would drift\n * into that guard firing on honest runs. Deterministic, throw-proof on any\n * malformed analysis (absent fields ⇒ false).\n *\n * The rule is conservative toward FALSE (a false positive keeps unwanted\n * dialogue in the render; a false negative merely runs the separation, which\n * was yesterday's default): at least 4 scenes, at least 80% of scenes carry a\n * music layer, and at least one music layer carries sung-vocal evidence that\n * is not negated (\"instrumental\", \"no vocals\").\n *\n * An EXPLICIT analyze-time flag always wins — callers use\n * `flag === true || inferMusicVideo(analysis)` and never let a cached false\n * suppress the inference (the flag can only ever be set true; false means\n * \"unset\", not \"denied\").\n */\nexport function inferMusicVideo(analysis: {\n scenes?: ReadonlyArray<{ audio?: ReadonlyArray<{ mode?: string; content?: string }> }>\n} | undefined | null): boolean {\n const scenes = analysis?.scenes ?? []\n if (scenes.length < 4) return false\n const musicLayers = (sc: (typeof scenes)[number]) => (sc.audio ?? []).filter((a) => a?.mode === \"music\")\n const withMusic = scenes.filter((sc) => musicLayers(sc).length > 0).length\n if (withMusic / scenes.length < 0.8) return false\n return scenes.some((sc) =>\n musicLayers(sc).some((a) => {\n const content = typeof a.content === \"string\" ? a.content : \"\"\n if (MUSIC_NO_VOCAL_RE.test(content)) return false\n return MUSIC_VOCAL_RE.test(content) || MUSIC_VOCAL_QUOTE_RE.test(content)\n }),\n )\n}\n\n// ---------------------------------------------------------------------------\n// The analysis as a BRIEF — the compact projection an LLM is handed\n// ---------------------------------------------------------------------------\n\n/** Top-level keys the analyzer derives AFTER the model's pass (merge\n * diagnostics, folded cast looks). A reader drafting FROM the analysis — a\n * production plan, a script — needs none of them. */\nconst DERIVED_ANALYSIS_TOP_KEYS: ReadonlySet<string> = new Set([\"warnings\", \"variationFolds\"])\n\n/** Per-scene keys the validator computes from `visual` and the slot list. */\nconst DERIVED_ANALYSIS_SCENE_KEYS: ReadonlySet<string> = new Set([\"visualResolved\", \"slotRefs\", \"oversized\"])\n\nconst asRecord = (v: unknown): Record<string, unknown> | null =>\n typeof v === \"object\" && v !== null && !Array.isArray(v) ? (v as Record<string, unknown>) : null\n\n/**\n * The analysis with its server-derived fields removed — the form an LLM is\n * handed when the analysis IS the brief (Nodaro Studio's Director and its\n * job-id loader). Drops `warnings` and `variationFolds` at the top and\n * `visualResolved`, `slotRefs`, `oversized` on every scene; keeps\n * `refImageUrl` (a downstream cast image) and everything else. Never mutates;\n * a non-object input comes back as-is.\n *\n * ONE strip list, shared by the worker that composes the brief server-side\n * (`llm-structured` jobs with a `videoUrl`) and the client that loads a\n * finished analysis into a textarea, so the two can never drift.\n */\nexport function stripDerivedAnalysisFields(json: unknown): unknown {\n const doc = asRecord(json)\n if (!doc) return json\n const out: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(doc)) {\n if (DERIVED_ANALYSIS_TOP_KEYS.has(key)) continue\n out[key] =\n key === \"scenes\" && Array.isArray(value)\n ? value.map((scene) => {\n const s = asRecord(scene)\n if (!s) return scene\n return Object.fromEntries(Object.entries(s).filter(([k]) => !DERIVED_ANALYSIS_SCENE_KEYS.has(k)))\n })\n : value\n }\n return out\n}\n","/**\n * Real output canvases per (video model, resolution, aspect ratio).\n *\n * Every entry is a pixel size read off a finished render with ffprobe — the\n * geometry a model hands back, never a rate or a price. None of it is\n * arithmetic either, because the providers do not follow arithmetic:\n *\n * - minimax-h3 at 768P returns 768x1344 (0.5714) for a 9:16 request,\n * - seedance-2 at 480p 16:9 returns 864x496 (1.742) while seedance-2-5\n * returns 854x480 (1.778) for the same request,\n * - grok returns 736x400 (1.84), seedance 1.0 at 1080p 1:1 returns 1440x1440.\n *\n * A formula would get all four wrong, which is why `resolveOutputCanvas`\n * answers `undefined` for anything not measured: callers must then leave the\n * frame alone rather than invent geometry (see `computeFrameFitPlan`).\n *\n * HOW TO EXTEND: run `node tools/harvest-output-canvas.mjs` (it pages the admin\n * jobs API, groups completed video jobs by provider/resolution/aspect and probes\n * real outputs) and paste new rows here. Take rows from REFERENCE or\n * TEXT-TO-VIDEO jobs only: in frame mode the adaptive models (the seedance and\n * wan families) size the output from the INPUT image, so those rows describe the\n * input that was sent, not the canvas the model would choose on its own.\n *\n * Seeded 2026-09-16 from 3000 completed production jobs.\n */\n\n/** `[width, height]` in pixels. */\nexport type VideoOutputCanvas = readonly [number, number]\n\n/** provider → resolution (lower-cased) → aspect token → canvas. */\nexport const VIDEO_OUTPUT_CANVAS: Readonly<\n Record<string, Readonly<Record<string, Readonly<Record<string, VideoOutputCanvas>>>>>\n> = {\n \"seedance-2-5\": {\n \"480p\": { \"16:9\": [854, 480], \"9:16\": [480, 854] },\n \"720p\": { \"16:9\": [1280, 720], \"9:16\": [720, 1280], \"1:1\": [960, 960] },\n \"1080p\": { \"16:9\": [1920, 1080] },\n },\n // The 2.0 family is NOT the same as 2.5 at 480p — 864x496 vs 854x480.\n \"seedance-2\": {\n \"480p\": { \"16:9\": [864, 496], \"9:16\": [496, 864] },\n \"720p\": { \"16:9\": [1280, 720], \"9:16\": [720, 1280] },\n },\n \"seedance-2-fast\": {\n \"480p\": { \"16:9\": [864, 496], \"9:16\": [496, 864] },\n \"720p\": { \"16:9\": [1280, 720], \"9:16\": [720, 1280] },\n },\n \"seedance-2-mini\": {\n \"480p\": { \"16:9\": [864, 496], \"9:16\": [496, 864] },\n \"720p\": { \"16:9\": [1280, 720], \"9:16\": [720, 1280] },\n },\n \"gemini-omni-video\": {\n \"720p\": { \"16:9\": [1280, 720], \"9:16\": [720, 1280] },\n \"1080p\": { \"16:9\": [1920, 1080] },\n },\n \"gemini-omni-flash\": {\n \"720p\": { \"16:9\": [1280, 720], \"9:16\": [720, 1280] },\n },\n \"veo3.1\": {\n \"720p\": { \"9:16\": [720, 1280] },\n \"1080p\": { \"16:9\": [1920, 1080] },\n },\n \"wan-3\": {\n \"480p\": { \"16:9\": [832, 480] },\n \"720p\": { \"16:9\": [1280, 720], \"9:16\": [720, 1280] },\n },\n \"wan-3-prime\": {\n \"720p\": { \"16:9\": [1280, 720] },\n },\n // 768P's \"9:16\" is 0.5714, not 0.5625 — the single clearest reason this table\n // exists.\n \"minimax-h3\": {\n \"768p\": { \"9:16\": [768, 1344] },\n \"2k\": { \"16:9\": [2560, 1440], \"9:16\": [1440, 2560] },\n },\n}\n\n/**\n * The canvas a model renders for this request, or `undefined` when we have never\n * measured that combination. `undefined` means \"leave the frame alone\".\n *\n * Resolution matching is case-insensitive (`768P`, `2K`, `720p` all appear in\n * the wild). An aspect of `adaptive` / `Auto` has no canvas of its own — the\n * caller resolves it to a concrete ratio first (`resolveFrameFitAspect`).\n */\nexport function resolveOutputCanvas(\n provider: string | undefined,\n resolution: string | undefined,\n aspect: string | undefined,\n): VideoOutputCanvas | undefined {\n if (!provider || !resolution || !aspect) return undefined\n return VIDEO_OUTPUT_CANVAS[provider]?.[resolution.toLowerCase()]?.[aspect]\n}\n\n/** Every measured combination, for tests and for the harvest script's diff. */\nexport function measuredCanvasCombinations(): Array<{\n provider: string\n resolution: string\n aspect: string\n canvas: VideoOutputCanvas\n}> {\n const out: Array<{ provider: string; resolution: string; aspect: string; canvas: VideoOutputCanvas }> = []\n for (const [provider, byResolution] of Object.entries(VIDEO_OUTPUT_CANVAS)) {\n for (const [resolution, byAspect] of Object.entries(byResolution)) {\n for (const [aspect, canvas] of Object.entries(byAspect)) {\n out.push({ provider, resolution, aspect, canvas })\n }\n }\n }\n return out\n}\n","/**\n * START/END FRAME FIT — the pure geometry half.\n *\n * WHY THIS EXISTS (measured on ~40 production renders, 2026-09-16):\n * a start frame whose pixel size is not the model's own output canvas gets\n * reshaped by the provider, and Seedance 2.5 does it VISIBLY — frame 0 is the\n * user's image verbatim, then from frame 1 the generated frames are rescaled\n * ~2% on ONE axis (x1.000 y1.02). Five of ten runs with a 940x1672 image\n * snapped; three of three with the same image resized to 720x1280 did not.\n *\n * So: reshape the frame ourselves, to the size the model was going to render\n * anyway. The canvas comes from measurement (`video-output-canvas.ts`), never\n * from arithmetic, and when a combination has never been measured the fit\n * DEGRADES rather than guesses.\n *\n * This module is pure — no I/O, no sharp, no network. `prepareVideoFrames` in\n * the backend does the pixels and the upload.\n */\nimport { getModel } from \"./model-catalog.js\"\nimport { resolveOutputCanvas, type VideoOutputCanvas } from \"./video-output-canvas.js\"\n\n/** How much of the frame we are allowed to reshape. */\nexport const FRAME_FITS = [\"original\", \"ratio\", \"resolution\"] as const\nexport type FrameFit = (typeof FRAME_FITS)[number]\n\n/** `resolution` — the measured canvas — is the default everywhere. */\nexport const DEFAULT_FRAME_FIT: FrameFit = \"resolution\"\n\n/** How the frame is handed to the model. */\nexport const FRAME_DELIVERIES = [\"auto\", \"frame\", \"reference\"] as const\nexport type FrameDelivery = (typeof FRAME_DELIVERIES)[number]\n\nexport const DEFAULT_FRAME_DELIVERY: FrameDelivery = \"auto\"\n\n/**\n * Stretching an image to a ratio it is nowhere near would squash the subject,\n * so past this gap the frame is centre-cropped to the target ratio FIRST and\n * only then resized. 5% covers every \"1K image into a 720p canvas\" case we\n * measured (940x1672 into 9:16 is a 0.05% gap) while refusing to squash a\n * square photo into 9:16 (a 78% gap).\n */\nexport const FRAME_FIT_STRETCH_TOLERANCE = 0.05\n\n/**\n * Models whose frame mode is measurably worse than reference delivery.\n *\n * The Seedance 2.0 family crop-zooms the frame 2% and drifts 11-26% darker\n * within six frames in frame mode; delivered as a reference with the opening-\n * frame sentence, the same models hold a flat look from frame 0 and keep the\n * image's true geometry. Every OTHER model measured (Seedance 2.5, Gemini Omni\n * video + flash, Veo 3.1, Wan 3.0, Minimax H3) reproduces the opening frame\n * better in frame mode, so the default stays `frame` for anything absent here.\n */\nexport const FRAME_DELIVERY_BY_PROVIDER: Readonly<Record<string, Exclude<FrameDelivery, \"auto\">>> = {\n \"seedance-2\": \"reference\",\n \"seedance-2-fast\": \"reference\",\n \"seedance-2-mini\": \"reference\",\n}\n\n/** Aspect tokens that name no concrete shape — the model picks. */\nconst OPEN_ASPECT_TOKENS = new Set([\"adaptive\", \"auto\"])\n\n/** `\"16:9\"` → 1.777…; anything unparseable → `undefined`. */\nexport function parseAspectToken(token: string | undefined): number | undefined {\n if (!token) return undefined\n const m = /^(\\d+(?:\\.\\d+)?)\\s*[:x/]\\s*(\\d+(?:\\.\\d+)?)$/.exec(token.trim())\n if (!m) return undefined\n const w = Number(m[1]); const h = Number(m[2])\n if (!(w > 0) || !(h > 0)) return undefined\n return w / h\n}\n\n/**\n * The aspect the fit should target.\n *\n * An explicit ratio is used as-is. `adaptive` / `Auto` (and an absent value,\n * which the seedance family sends as adaptive whenever a frame is present) has\n * no shape of its own: the provider will follow the IMAGE, so we snap the\n * image's own ratio to the nearest one the model lists and target that. A model\n * with no declared ratio list and an open token gives `undefined` — no fit.\n */\nexport function resolveFrameFitAspect(args: {\n provider: string | undefined\n requestedAspect: string | undefined\n sourceWidth: number\n sourceHeight: number\n}): string | undefined {\n const requested = args.requestedAspect?.trim()\n if (requested && !OPEN_ASPECT_TOKENS.has(requested.toLowerCase())) return requested\n const ratios = args.provider ? getModel(args.provider)?.aspectRatios : undefined\n if (!ratios?.length || !(args.sourceWidth > 0) || !(args.sourceHeight > 0)) return undefined\n const source = args.sourceWidth / args.sourceHeight\n let best: { token: string; gap: number } | undefined\n for (const token of ratios) {\n const value = parseAspectToken(token)\n if (value === undefined) continue // skips \"adaptive\"/\"Auto\" members\n const gap = Math.abs(Math.log(value / source))\n if (!best || gap < best.gap) best = { token, gap }\n }\n return best?.token\n}\n\n/** What `prepareVideoFrames` should do to one frame. `null` = nothing. */\nexport interface FrameFitPlan {\n /** Final pixel size to produce. */\n readonly width: number\n readonly height: number\n /** Centre-crop applied BEFORE the resize (only past the stretch tolerance). */\n readonly crop?: { readonly left: number; readonly top: number; readonly width: number; readonly height: number }\n /** Why the plan exists — carried into logs and job output for traceability. */\n readonly reason: \"resolution\" | \"ratio\"\n}\n\n/** Round to an even number ≥ 2 — odd dimensions break yuv420p encoders. */\nfunction even(value: number): number {\n return Math.max(2, Math.round(value / 2) * 2)\n}\n\n/**\n * The smallest change that makes `width x height` exactly `aspect`: keep the\n * longer side, move the shorter one. Rounding to even can leave a sub-pixel\n * residue, which is why the caller compares ratios with a tolerance rather than\n * for equality.\n */\nexport function minimalRatioDimensions(width: number, height: number, aspect: number): { width: number; height: number } {\n const current = width / height\n if (current > aspect) {\n // too wide → bring the height up (keep the long side, the width)\n return { width: even(width), height: even(width / aspect) }\n }\n return { width: even(height * aspect), height: even(height) }\n}\n\n/**\n * The centre-crop that turns `width x height` into exactly `aspect`, dropping\n * the overhang on the long axis.\n */\nexport function centreCropToAspect(width: number, height: number, aspect: number): { left: number; top: number; width: number; height: number } {\n const current = width / height\n if (current > aspect) {\n const w = even(height * aspect)\n return { left: Math.max(0, Math.round((width - w) / 2)), top: 0, width: Math.min(width, w), height }\n }\n const h = even(width / aspect)\n return { left: 0, top: Math.max(0, Math.round((height - h) / 2)), width, height: Math.min(height, h) }\n}\n\n/**\n * Turn a request into a concrete plan for ONE frame, or `null` when the frame\n * should be sent untouched.\n *\n * Degradation ladder — a missing measurement must never invent geometry:\n * `resolution` with no measured canvas → behaves as `ratio`\n * `ratio` with no resolvable aspect → no fit\n * any fit whose target equals the source (within a pixel) → no fit\n */\nexport function computeFrameFitPlan(args: {\n fit: FrameFit\n provider: string | undefined\n resolution: string | undefined\n /** The aspect as the request carries it: a ratio, `adaptive`/`Auto`, or absent. */\n aspect: string | undefined\n sourceWidth: number\n sourceHeight: number\n /** Overrides the measured table (tests, and a caller that already looked up). */\n canvas?: VideoOutputCanvas\n tolerance?: number\n}): FrameFitPlan | null {\n const { fit, sourceWidth, sourceHeight } = args\n if (fit === \"original\") return null\n if (!(sourceWidth > 0) || !(sourceHeight > 0)) return null\n\n const aspectToken = resolveFrameFitAspect({\n provider: args.provider,\n requestedAspect: args.aspect,\n sourceWidth,\n sourceHeight,\n })\n\n const canvas = fit === \"resolution\"\n ? args.canvas ?? resolveOutputCanvas(args.provider, args.resolution, aspectToken)\n : undefined\n\n const targetAspect = canvas ? canvas[0] / canvas[1] : parseAspectToken(aspectToken)\n if (targetAspect === undefined || !(targetAspect > 0)) return null\n\n const sourceAspect = sourceWidth / sourceHeight\n const gap = Math.abs(sourceAspect - targetAspect) / targetAspect\n const tolerance = args.tolerance ?? FRAME_FIT_STRETCH_TOLERANCE\n const crop = gap > tolerance ? centreCropToAspect(sourceWidth, sourceHeight, targetAspect) : undefined\n\n const target = canvas\n ? { width: canvas[0], height: canvas[1] }\n : minimalRatioDimensions(\n crop ? crop.width : sourceWidth,\n crop ? crop.height : sourceHeight,\n targetAspect,\n )\n\n const unchanged = target.width === sourceWidth && target.height === sourceHeight && !crop\n if (unchanged) return null\n\n return {\n width: target.width,\n height: target.height,\n ...(crop ? { crop } : {}),\n reason: canvas ? \"resolution\" : \"ratio\",\n }\n}\n\n/**\n * Frame or reference? `auto` reads the per-provider default measured above.\n * Reference delivery is only possible on models that accept reference images —\n * on the others `reference` collapses back to `frame` rather than dropping the\n * frame on the floor.\n */\nexport function resolveFrameDelivery(args: {\n provider: string | undefined\n requested: FrameDelivery | undefined\n supportsReferenceImages: boolean\n}): Exclude<FrameDelivery, \"auto\"> {\n const requested = args.requested ?? DEFAULT_FRAME_DELIVERY\n const wanted = requested === \"auto\"\n ? (args.provider ? FRAME_DELIVERY_BY_PROVIDER[args.provider] ?? \"frame\" : \"frame\")\n : requested\n if (wanted === \"reference\" && !args.supportsReferenceImages) return \"frame\"\n return wanted\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkWXMLMN5Y_cjs = require('./chunk-WXMLMN5Y.cjs');
|
|
4
4
|
var chunkNEJ2PV4C_cjs = require('./chunk-NEJ2PV4C.cjs');
|
|
5
5
|
var chunk5PCI6M44_cjs = require('./chunk-5PCI6M44.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkS32Z2JMC_cjs = require('./chunk-S32Z2JMC.cjs');
|
|
7
7
|
|
|
8
8
|
// src/producer-types.ts
|
|
9
9
|
var VIDEO_PRODUCER_TYPES = chunk5PCI6M44_cjs.composeUnitSet("VIDEO_PRODUCER_TYPES", [
|
|
@@ -241,7 +241,7 @@ var FAN_OUT_EACH_HANDLES = chunk5PCI6M44_cjs.composeUnitRecord("FAN_OUT_EACH_HAN
|
|
|
241
241
|
// handle of such a member would fan out. Its one run writes the tickets as
|
|
242
242
|
// its list (`listResults`, the editor's `__listResults`). The pip an edge
|
|
243
243
|
// with no handle reads is the UGC wires' own (UGC_PRIMARY_HANDLE).
|
|
244
|
-
"ugc-clips": { each: ["clips"], primary:
|
|
244
|
+
"ugc-clips": { each: ["clips"], primary: chunkWXMLMN5Y_cjs.UGC_PRIMARY_HANDLE["ugc-clips"] }
|
|
245
245
|
// A node unit declares its row in unit.json (contract.fanOutEach); it is added after these.
|
|
246
246
|
}, chunk5PCI6M44_cjs.unitFanOutEach());
|
|
247
247
|
var FAN_OUT_ALL_OR_NOTHING_TYPES = /* @__PURE__ */ new Set(["ugc-clip"]);
|
|
@@ -335,7 +335,7 @@ var descriptor = (d) => Object.freeze({ ...d, creditIds: Object.freeze([...d.cre
|
|
|
335
335
|
var RENDER_NODE_TYPES = Object.freeze({
|
|
336
336
|
"apply-edl": descriptor({
|
|
337
337
|
mediumOf: outputSettingMedium,
|
|
338
|
-
creditId: (quality) =>
|
|
338
|
+
creditId: (quality) => chunkS32Z2JMC_cjs.applyEdlCreditId(quality),
|
|
339
339
|
creditIds: ["apply-edl", "apply-edl:proxy"],
|
|
340
340
|
clockMapFrom: "input",
|
|
341
341
|
ownerOnlyListing: true,
|
|
@@ -350,8 +350,8 @@ var RENDER_NODE_TYPES = Object.freeze({
|
|
|
350
350
|
// `transcript` pip (decided 2026-10-08) — what a caption step reads.
|
|
351
351
|
"speaker-view": descriptor({
|
|
352
352
|
mediumOf: () => "video",
|
|
353
|
-
creditId: (quality, _output, priceTier) =>
|
|
354
|
-
creditIds:
|
|
353
|
+
creditId: (quality, _output, priceTier) => chunkS32Z2JMC_cjs.speakerViewCreditId(quality, priceTier),
|
|
354
|
+
creditIds: chunkS32Z2JMC_cjs.SPEAKER_VIEW_CREDIT_IDS,
|
|
355
355
|
clockMapFrom: "output-json",
|
|
356
356
|
ownerOnlyListing: true,
|
|
357
357
|
latestBatch: true,
|
|
@@ -807,5 +807,5 @@ exports.renderTranscriptOutputOf = renderTranscriptOutputOf;
|
|
|
807
807
|
exports.rendersLatestBatch = rendersLatestBatch;
|
|
808
808
|
exports.rendersTranscriptJson = rendersTranscriptJson;
|
|
809
809
|
exports.validateNoNestedGroups = validateNoNestedGroups;
|
|
810
|
-
//# sourceMappingURL=chunk-
|
|
811
|
-
//# sourceMappingURL=chunk-
|
|
810
|
+
//# sourceMappingURL=chunk-RPS35CNO.cjs.map
|
|
811
|
+
//# sourceMappingURL=chunk-RPS35CNO.cjs.map
|