@nodaro/shared 3.31.0 → 3.33.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/README.md +17 -0
- package/dist/chunk-23FJQTEA.js +1604 -0
- package/dist/chunk-23FJQTEA.js.map +1 -0
- package/dist/chunk-2NIQO2J3.cjs +54 -0
- package/dist/chunk-2NIQO2J3.cjs.map +1 -0
- package/dist/chunk-2NQLSLSN.cjs +19 -0
- package/dist/chunk-2NQLSLSN.cjs.map +1 -0
- package/dist/chunk-2OJIVO7R.cjs +32 -0
- package/dist/chunk-2OJIVO7R.cjs.map +1 -0
- package/dist/chunk-2RF4Z7KG.cjs +803 -0
- package/dist/chunk-2RF4Z7KG.cjs.map +1 -0
- package/dist/chunk-3RYKIUAE.js +86 -0
- package/dist/chunk-3RYKIUAE.js.map +1 -0
- package/dist/chunk-44I73CQS.cjs +194 -0
- package/dist/chunk-44I73CQS.cjs.map +1 -0
- package/dist/chunk-5PC6JBGJ.cjs +1419 -0
- package/dist/chunk-5PC6JBGJ.cjs.map +1 -0
- package/dist/chunk-5RU2HCW2.js +30 -0
- package/dist/chunk-5RU2HCW2.js.map +1 -0
- package/dist/chunk-5RYLK3MQ.js +267 -0
- package/dist/chunk-5RYLK3MQ.js.map +1 -0
- package/dist/chunk-5THUHJ3E.js +46 -0
- package/dist/chunk-5THUHJ3E.js.map +1 -0
- package/dist/chunk-6DAWSVX2.cjs +103 -0
- package/dist/chunk-6DAWSVX2.cjs.map +1 -0
- package/dist/chunk-6WZ2VN7V.js +920 -0
- package/dist/chunk-6WZ2VN7V.js.map +1 -0
- package/dist/chunk-7G7G42KS.js +86 -0
- package/dist/chunk-7G7G42KS.js.map +1 -0
- package/dist/chunk-7Z5LUTGU.js +1567 -0
- package/dist/chunk-7Z5LUTGU.js.map +1 -0
- package/dist/chunk-AINCI23X.js +2171 -0
- package/dist/chunk-AINCI23X.js.map +1 -0
- package/dist/chunk-BG5D5CZ6.js +1922 -0
- package/dist/chunk-BG5D5CZ6.js.map +1 -0
- package/dist/chunk-CK3GK34R.js +1381 -0
- package/dist/chunk-CK3GK34R.js.map +1 -0
- package/dist/chunk-CUH22J4D.js +17 -0
- package/dist/chunk-CUH22J4D.js.map +1 -0
- package/dist/chunk-D26ENTN2.cjs +1770 -0
- package/dist/chunk-D26ENTN2.cjs.map +1 -0
- package/dist/chunk-D6GNRSCV.cjs +2017 -0
- package/dist/chunk-D6GNRSCV.cjs.map +1 -0
- package/dist/chunk-FBV5DF6D.js +95 -0
- package/dist/chunk-FBV5DF6D.js.map +1 -0
- package/dist/chunk-FG4E7MTG.cjs +4 -0
- package/dist/chunk-FG4E7MTG.cjs.map +1 -0
- package/dist/chunk-FT5CF6IA.js +42 -0
- package/dist/chunk-FT5CF6IA.js.map +1 -0
- package/dist/chunk-G6IIVKMO.js +26 -0
- package/dist/chunk-G6IIVKMO.js.map +1 -0
- package/dist/chunk-HC7VKIV5.cjs +430 -0
- package/dist/chunk-HC7VKIV5.cjs.map +1 -0
- package/dist/chunk-HGC5JNVA.cjs +1503 -0
- package/dist/chunk-HGC5JNVA.cjs.map +1 -0
- package/dist/chunk-HKFMXNVQ.cjs +1273 -0
- package/dist/chunk-HKFMXNVQ.cjs.map +1 -0
- package/dist/chunk-HRXEZ3SX.cjs +526 -0
- package/dist/chunk-HRXEZ3SX.cjs.map +1 -0
- package/dist/chunk-HSHCCBIV.js +255 -0
- package/dist/chunk-HSHCCBIV.js.map +1 -0
- package/dist/chunk-HUR6ZJ7S.cjs +159 -0
- package/dist/chunk-HUR6ZJ7S.cjs.map +1 -0
- package/dist/chunk-J7BMO73N.cjs +114 -0
- package/dist/chunk-J7BMO73N.cjs.map +1 -0
- package/dist/chunk-JFS3NWZ5.cjs +1714 -0
- package/dist/chunk-JFS3NWZ5.cjs.map +1 -0
- package/dist/chunk-JL4C5VJ7.cjs +488 -0
- package/dist/chunk-JL4C5VJ7.cjs.map +1 -0
- package/dist/chunk-JSGIEF6Z.cjs +1087 -0
- package/dist/chunk-JSGIEF6Z.cjs.map +1 -0
- package/dist/chunk-JWA5SGCS.js +203 -0
- package/dist/chunk-JWA5SGCS.js.map +1 -0
- package/dist/chunk-K3LLGRK7.cjs +3545 -0
- package/dist/chunk-K3LLGRK7.cjs.map +1 -0
- package/dist/chunk-KU6S7IYV.cjs +210 -0
- package/dist/chunk-KU6S7IYV.cjs.map +1 -0
- package/dist/chunk-M36G6SRP.js +447 -0
- package/dist/chunk-M36G6SRP.js.map +1 -0
- package/dist/chunk-M7GQBRZU.cjs +1963 -0
- package/dist/chunk-M7GQBRZU.cjs.map +1 -0
- package/dist/chunk-MRXGWL42.cjs +4 -0
- package/dist/chunk-MRXGWL42.cjs.map +1 -0
- package/dist/chunk-NEJ2PV4C.cjs +211 -0
- package/dist/chunk-NEJ2PV4C.cjs.map +1 -0
- package/dist/chunk-OTATNBMD.js +141 -0
- package/dist/chunk-OTATNBMD.js.map +1 -0
- package/dist/chunk-OZSACQ2V.js +471 -0
- package/dist/chunk-OZSACQ2V.js.map +1 -0
- package/dist/chunk-PHZ23DP3.js +1782 -0
- package/dist/chunk-PHZ23DP3.js.map +1 -0
- package/dist/chunk-PQHS255G.js +1369 -0
- package/dist/chunk-PQHS255G.js.map +1 -0
- package/dist/chunk-PRYE7AZQ.cjs +1227 -0
- package/dist/chunk-PRYE7AZQ.cjs.map +1 -0
- package/dist/chunk-PVJBAPYJ.js +404 -0
- package/dist/chunk-PVJBAPYJ.js.map +1 -0
- package/dist/chunk-PXFQVLBX.js +776 -0
- package/dist/chunk-PXFQVLBX.js.map +1 -0
- package/dist/chunk-QA3MVQ32.js +21 -0
- package/dist/chunk-QA3MVQ32.js.map +1 -0
- package/dist/chunk-QJRP44ZO.js +769 -0
- package/dist/chunk-QJRP44ZO.js.map +1 -0
- package/dist/chunk-SAW5OK36.cjs +54 -0
- package/dist/chunk-SAW5OK36.cjs.map +1 -0
- package/dist/chunk-SES6GDBQ.cjs +624 -0
- package/dist/chunk-SES6GDBQ.cjs.map +1 -0
- package/dist/chunk-SFW3UB2P.js +31 -0
- package/dist/chunk-SFW3UB2P.js.map +1 -0
- package/dist/chunk-TNPDV7I4.cjs +2346 -0
- package/dist/chunk-TNPDV7I4.cjs.map +1 -0
- package/dist/chunk-TU33KYKW.cjs +25 -0
- package/dist/chunk-TU33KYKW.cjs.map +1 -0
- package/dist/chunk-TZBIY5C3.js +187 -0
- package/dist/chunk-TZBIY5C3.js.map +1 -0
- package/dist/chunk-TZE673G6.js +3 -0
- package/dist/chunk-TZE673G6.js.map +1 -0
- package/dist/chunk-UCFWI6D4.js +29 -0
- package/dist/chunk-UCFWI6D4.js.map +1 -0
- package/dist/chunk-UTQSSKSG.js +1164 -0
- package/dist/chunk-UTQSSKSG.js.map +1 -0
- package/dist/chunk-VA42637J.cjs +287 -0
- package/dist/chunk-VA42637J.cjs.map +1 -0
- package/dist/chunk-VNQRI2RO.cjs +1047 -0
- package/dist/chunk-VNQRI2RO.cjs.map +1 -0
- package/dist/chunk-VXPLKQWY.cjs +821 -0
- package/dist/chunk-VXPLKQWY.cjs.map +1 -0
- package/dist/chunk-WD6HJRBG.cjs +197 -0
- package/dist/chunk-WD6HJRBG.cjs.map +1 -0
- package/dist/chunk-WDIBOWAA.js +1054 -0
- package/dist/chunk-WDIBOWAA.js.map +1 -0
- package/dist/chunk-WKOIGLQX.cjs +38 -0
- package/dist/chunk-WKOIGLQX.cjs.map +1 -0
- package/dist/chunk-WNVQ3SMB.cjs +96 -0
- package/dist/chunk-WNVQ3SMB.cjs.map +1 -0
- package/dist/chunk-WRSWH7US.cjs +285 -0
- package/dist/chunk-WRSWH7US.cjs.map +1 -0
- package/dist/chunk-XGFTL5XY.js +181 -0
- package/dist/chunk-XGFTL5XY.js.map +1 -0
- package/dist/chunk-XNISPHTZ.js +1039 -0
- package/dist/chunk-XNISPHTZ.js.map +1 -0
- package/dist/chunk-Y2PM3FFL.js +3 -0
- package/dist/chunk-Y2PM3FFL.js.map +1 -0
- package/dist/chunk-YBPBK5KI.js +1030 -0
- package/dist/chunk-YBPBK5KI.js.map +1 -0
- package/dist/chunk-YWNYGYI7.cjs +31 -0
- package/dist/chunk-YWNYGYI7.cjs.map +1 -0
- package/dist/chunk-YYV35XOS.js +122 -0
- package/dist/chunk-YYV35XOS.js.map +1 -0
- package/dist/chunk-Z2OL5AJD.cjs +133 -0
- package/dist/chunk-Z2OL5AJD.cjs.map +1 -0
- package/dist/chunk-ZDFHA2EC.js +572 -0
- package/dist/chunk-ZDFHA2EC.js.map +1 -0
- package/dist/chunk-ZL7UM6PU.cjs +34 -0
- package/dist/chunk-ZL7UM6PU.cjs.map +1 -0
- package/dist/chunk-ZNZDQAXN.js +175 -0
- package/dist/chunk-ZNZDQAXN.js.map +1 -0
- package/dist/chunk-ZO5PBBFX.js +3497 -0
- package/dist/chunk-ZO5PBBFX.js.map +1 -0
- package/dist/chunk-ZRL2UFTH.cjs +1073 -0
- package/dist/chunk-ZRL2UFTH.cjs.map +1 -0
- package/dist/entries/apps.cjs +155 -0
- package/dist/entries/apps.cjs.map +1 -0
- package/dist/entries/apps.d.cts +292 -0
- package/dist/entries/apps.d.ts +292 -0
- package/dist/entries/apps.js +10 -0
- package/dist/entries/apps.js.map +1 -0
- package/dist/entries/captions.cjs +124 -0
- package/dist/entries/captions.cjs.map +1 -0
- package/dist/entries/captions.d.cts +354 -0
- package/dist/entries/captions.d.ts +354 -0
- package/dist/entries/captions.js +3 -0
- package/dist/entries/captions.js.map +1 -0
- package/dist/entries/catalogs.cjs +165 -0
- package/dist/entries/catalogs.cjs.map +1 -0
- package/dist/entries/catalogs.d.cts +385 -0
- package/dist/entries/catalogs.d.ts +385 -0
- package/dist/entries/catalogs.js +4 -0
- package/dist/entries/catalogs.js.map +1 -0
- package/dist/entries/credits.cjs +596 -0
- package/dist/entries/credits.cjs.map +1 -0
- package/dist/entries/credits.d.cts +1460 -0
- package/dist/entries/credits.d.ts +1460 -0
- package/dist/entries/credits.js +11 -0
- package/dist/entries/credits.js.map +1 -0
- package/dist/entries/edl.cjs +409 -0
- package/dist/entries/edl.cjs.map +1 -0
- package/dist/entries/edl.d.cts +1199 -0
- package/dist/entries/edl.d.ts +1199 -0
- package/dist/entries/edl.js +4 -0
- package/dist/entries/edl.js.map +1 -0
- package/dist/entries/entities.cjs +530 -0
- package/dist/entries/entities.cjs.map +1 -0
- package/dist/entries/entities.d.cts +1371 -0
- package/dist/entries/entities.d.ts +1371 -0
- package/dist/entries/entities.js +5 -0
- package/dist/entries/entities.js.map +1 -0
- package/dist/entries/i18n.cjs +48 -0
- package/dist/entries/i18n.cjs.map +1 -0
- package/dist/entries/i18n.d.cts +69 -0
- package/dist/entries/i18n.d.ts +69 -0
- package/dist/entries/i18n.js +3 -0
- package/dist/entries/i18n.js.map +1 -0
- package/dist/entries/llm-models.cjs +177 -0
- package/dist/entries/llm-models.cjs.map +1 -0
- package/dist/entries/llm-models.d.cts +435 -0
- package/dist/entries/llm-models.d.ts +435 -0
- package/dist/entries/llm-models.js +4 -0
- package/dist/entries/llm-models.js.map +1 -0
- package/dist/entries/media.cjs +335 -0
- package/dist/entries/media.cjs.map +1 -0
- package/dist/entries/media.d.cts +518 -0
- package/dist/entries/media.d.ts +518 -0
- package/dist/entries/media.js +6 -0
- package/dist/entries/media.js.map +1 -0
- package/dist/entries/model-catalog.cjs +259 -0
- package/dist/entries/model-catalog.cjs.map +1 -0
- package/dist/entries/model-catalog.d.cts +202 -0
- package/dist/entries/model-catalog.d.ts +202 -0
- package/dist/entries/model-catalog.js +6 -0
- package/dist/entries/model-catalog.js.map +1 -0
- package/dist/entries/models.cjs +833 -0
- package/dist/entries/models.cjs.map +1 -0
- package/dist/entries/models.d.cts +287 -0
- package/dist/entries/models.d.ts +287 -0
- package/dist/entries/models.js +8 -0
- package/dist/entries/models.js.map +1 -0
- package/dist/entries/nodes.cjs +789 -0
- package/dist/entries/nodes.cjs.map +1 -0
- package/dist/entries/nodes.d.cts +1600 -0
- package/dist/entries/nodes.d.ts +1600 -0
- package/dist/entries/nodes.js +16 -0
- package/dist/entries/nodes.js.map +1 -0
- package/dist/entries/organizations.cjs +80 -0
- package/dist/entries/organizations.cjs.map +1 -0
- package/dist/entries/organizations.d.cts +466 -0
- package/dist/entries/organizations.d.ts +466 -0
- package/dist/entries/organizations.js +3 -0
- package/dist/entries/organizations.js.map +1 -0
- package/dist/entries/pipeline.cjs +594 -0
- package/dist/entries/pipeline.cjs.map +1 -0
- package/dist/entries/pipeline.d.cts +2617 -0
- package/dist/entries/pipeline.d.ts +2617 -0
- package/dist/entries/pipeline.js +5 -0
- package/dist/entries/pipeline.js.map +1 -0
- package/dist/entries/scene3d.cjs +704 -0
- package/dist/entries/scene3d.cjs.map +1 -0
- package/dist/entries/scene3d.d.cts +4284 -0
- package/dist/entries/scene3d.d.ts +4284 -0
- package/dist/entries/scene3d.js +3 -0
- package/dist/entries/scene3d.js.map +1 -0
- package/dist/entries/social.cjs +714 -0
- package/dist/entries/social.cjs.map +1 -0
- package/dist/entries/social.d.cts +1366 -0
- package/dist/entries/social.d.ts +1366 -0
- package/dist/entries/social.js +5 -0
- package/dist/entries/social.js.map +1 -0
- package/dist/entries/types.cjs +13 -0
- package/dist/entries/types.cjs.map +1 -0
- package/dist/entries/types.d.cts +162 -0
- package/dist/entries/types.d.ts +162 -0
- package/dist/entries/types.js +4 -0
- package/dist/entries/types.js.map +1 -0
- package/dist/entries/ugc.cjs +279 -0
- package/dist/entries/ugc.cjs.map +1 -0
- package/dist/entries/ugc.d.cts +575 -0
- package/dist/entries/ugc.d.ts +575 -0
- package/dist/entries/ugc.js +6 -0
- package/dist/entries/ugc.js.map +1 -0
- package/dist/entries/video.cjs +549 -0
- package/dist/entries/video.cjs.map +1 -0
- package/dist/entries/video.d.cts +1791 -0
- package/dist/entries/video.d.ts +1791 -0
- package/dist/entries/video.js +8 -0
- package/dist/entries/video.js.map +1 -0
- package/dist/entries/workflow.cjs +574 -0
- package/dist/entries/workflow.cjs.map +1 -0
- package/dist/entries/workflow.d.cts +1743 -0
- package/dist/entries/workflow.d.ts +1743 -0
- package/dist/entries/workflow.js +5 -0
- package/dist/entries/workflow.js.map +1 -0
- package/dist/fan-out-meta-Bu6VyXcZ.d.cts +19 -0
- package/dist/fan-out-meta-Bu6VyXcZ.d.ts +19 -0
- package/dist/gemini-omni-voices-zeRXxSbZ.d.cts +174 -0
- package/dist/gemini-omni-voices-zeRXxSbZ.d.ts +174 -0
- package/dist/image-overlay-layers-CyBfRhxJ.d.cts +208 -0
- package/dist/image-overlay-layers-CyBfRhxJ.d.ts +208 -0
- package/dist/index.cjs +7747 -27084
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -24198
- package/dist/index.d.ts +32 -24198
- package/dist/index.js +40 -25220
- package/dist/index.js.map +1 -1
- package/dist/model-catalog-V-ZNzRSd.d.cts +651 -0
- package/dist/model-catalog-V-ZNzRSd.d.ts +651 -0
- package/dist/presentation-types-0ENOCjoj.d.cts +61 -0
- package/dist/presentation-types-0ENOCjoj.d.ts +61 -0
- package/dist/presentation-utils-D0kxsWf9.d.cts +92 -0
- package/dist/presentation-utils-pZwlEAzo.d.ts +92 -0
- package/dist/scene-node-types-C3kl_zyK.d.cts +1949 -0
- package/dist/scene-node-types-C3kl_zyK.d.ts +1949 -0
- package/dist/supported-fonts-CRoF1gOy.d.cts +16 -0
- package/dist/supported-fonts-CRoF1gOy.d.ts +16 -0
- package/dist/types-BRlFPEru.d.cts +511 -0
- package/dist/types-BRlFPEru.d.ts +511 -0
- package/dist/types-DffyGSy5.d.cts +67 -0
- package/dist/types-DffyGSy5.d.ts +67 -0
- package/package.json +102 -1
- package/src/__tests__/add-captions-plan.test.ts +6 -2
- package/src/__tests__/caption-edge-dash.test.ts +23 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +4625 -0
- package/src/__tests__/input-field-extra-keys.test.ts +1 -0
- package/src/__tests__/model-makers.test.ts +76 -0
- package/src/__tests__/no-internal-imports.test.ts +1 -1
- package/src/__tests__/node-aspect-ratio.test.ts +25 -0
- package/src/__tests__/node-runtime-keys.test.ts +9 -0
- package/src/__tests__/package-entries.test.ts +50 -0
- package/src/__tests__/pitch-tempo-pricing.test.ts +21 -0
- package/src/__tests__/presentation-utils.test.ts +15 -0
- package/src/__tests__/preview-gate-use-case.test.ts +151 -0
- package/src/__tests__/private-host.test.ts +53 -0
- package/src/__tests__/run-continuation.test.ts +7 -1
- package/src/__tests__/site-capture-node.test.ts +58 -0
- package/src/__tests__/ugc-lane-wires.test.ts +228 -0
- package/src/__tests__/ugc-node-wires.test.ts +9 -3
- package/src/__tests__/ugc-run-state.test.ts +5 -4
- package/src/__tests__/video-analysis-catalog-sync.test.ts +1 -1
- package/src/__tests__/video-analysis-pricing.test.ts +6 -6
- package/src/__tests__/voice-changer-pro-quote.test.ts +79 -0
- package/src/add-captions-plan.ts +9 -3
- package/src/caption-edge-dash.ts +33 -0
- package/src/component-types.ts +9 -0
- package/src/credit-estimators/index.ts +22 -1
- package/src/credit-estimators/pitch-tempo.ts +15 -1
- package/src/credit-estimators/speech.ts +72 -4
- package/src/credit-estimators/unit-quote.ts +52 -0
- package/src/credit-estimators/video-sfx.ts +15 -0
- package/src/credit-estimators/voice-changer-pro-quote.ts +138 -0
- package/src/credit-identifiers.ts +62 -17
- package/src/entity-image-handle.ts +2 -0
- package/src/entries/apps.ts +63 -0
- package/src/entries/captions.ts +34 -0
- package/src/entries/catalogs.ts +65 -0
- package/src/entries/credits.ts +105 -0
- package/src/entries/edl.ts +42 -0
- package/src/entries/entities.ts +144 -0
- package/src/entries/i18n.ts +31 -0
- package/src/entries/llm-models.ts +63 -0
- package/src/entries/media.ts +36 -0
- package/src/entries/model-catalog.ts +95 -0
- package/src/entries/models.ts +266 -0
- package/src/entries/nodes.ts +245 -0
- package/src/entries/organizations.ts +9 -0
- package/src/entries/pipeline.ts +43 -0
- package/src/entries/scene3d.ts +27 -0
- package/src/entries/social.ts +297 -0
- package/src/entries/types.ts +26 -0
- package/src/entries/ugc.ts +14 -0
- package/src/entries/video.ts +59 -0
- package/src/entries/workflow.ts +172 -0
- package/src/fan-out-rows.ts +2 -0
- package/src/index.ts +25 -1845
- package/src/json-kinds.ts +4 -0
- package/src/model-catalog.ts +243 -34
- package/src/node-mappable-fields.ts +1 -0
- package/src/node-run-routes.ts +2 -0
- package/src/node-runtime-keys.ts +8 -0
- package/src/normalize-node-params.ts +30 -0
- package/src/presentation-utils.ts +12 -0
- package/src/preview-gate.ts +92 -14
- package/src/private-host.ts +89 -59
- package/src/producer-types.ts +16 -2
- package/src/run-continuation.ts +21 -0
- package/src/site-capture-node.ts +82 -0
- package/src/ugc-lane-wires.ts +246 -0
- package/src/ugc-node-wires.ts +37 -7
- package/src/ugc-run-state.ts +5 -3
- package/src/video-analysis-pricing.ts +31 -29
|
@@ -0,0 +1,1791 @@
|
|
|
1
|
+
import { c as GeminiOmniVoicePresetId } from '../gemini-omni-voices-zeRXxSbZ.js';
|
|
2
|
+
import { h as OverlayAnchor } from '../image-overlay-layers-CyBfRhxJ.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Character references — the dedicated IDENTITY input of a video model, as
|
|
7
|
+
* opposed to a loose reference image.
|
|
8
|
+
*
|
|
9
|
+
* Gemini Omni treats `image_urls` as "reference images for characters, scenes,
|
|
10
|
+
* styles, or storyboard guidance": a portrait sent there steers the clip but
|
|
11
|
+
* the face drifts. Its separate `character_ids` input is the one that keeps a
|
|
12
|
+
* real person's face, and it takes ids minted from a portrait by a create
|
|
13
|
+
* call. The PUBLIC shape below is provider-neutral — a portrait and a
|
|
14
|
+
* description — and the provider layer mints (and caches) whatever ids its
|
|
15
|
+
* upstream needs. Nothing upstream-shaped ever appears in the API.
|
|
16
|
+
*
|
|
17
|
+
* WHICH models take them is data, never a name list: a positive `characters`
|
|
18
|
+
* cap on `VIDEO_REF_LIMITS_BY_PROVIDER`.
|
|
19
|
+
*/
|
|
20
|
+
interface VideoCharacterVoice {
|
|
21
|
+
/** The base voice — one of `GEMINI_OMNI_VOICE_PRESETS`. */
|
|
22
|
+
preset: GeminiOmniVoicePresetId;
|
|
23
|
+
/** Free-text timbre / pace / emotion for the persona. Optional. */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** One example line the persona says (≤ 120 chars). Optional. */
|
|
26
|
+
exampleLine?: string;
|
|
27
|
+
}
|
|
28
|
+
interface VideoCharacterReference {
|
|
29
|
+
/** Portrait of the person (public URL). Index 0 of the upstream image set. */
|
|
30
|
+
imageUrl: string;
|
|
31
|
+
/** Optional full-body image; costs a second input unit. */
|
|
32
|
+
bodyImageUrl?: string;
|
|
33
|
+
/** Who this is: appearance, identity, style, clothing. Required by the upstream. */
|
|
34
|
+
description: string;
|
|
35
|
+
/** Optional display name. */
|
|
36
|
+
name?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Pin a voice persona to this character so it keeps ONE voice across clips
|
|
39
|
+
* (the model otherwise improvises a voice per generation). Only models with a
|
|
40
|
+
* positive `voices` cap take it.
|
|
41
|
+
*/
|
|
42
|
+
voice?: VideoCharacterVoice;
|
|
43
|
+
}
|
|
44
|
+
/** Zod `.max()` ceiling for the wire field — the widest cap any provider declares. */
|
|
45
|
+
declare const VIDEO_CHARACTER_REFS_WIRE_MAX: number;
|
|
46
|
+
/** Longest `description` / `name` a client may send (route Zod reads these). */
|
|
47
|
+
declare const VIDEO_CHARACTER_DESCRIPTION_MAX = 2000;
|
|
48
|
+
declare const VIDEO_CHARACTER_NAME_MAX = 100;
|
|
49
|
+
/** Longest voice `description` / `exampleLine` a client may send. The upstream
|
|
50
|
+
* allows far more description (20000); we cap the PUBLIC field at the same
|
|
51
|
+
* ceiling as a character description so policy text and prompts stay bounded. */
|
|
52
|
+
declare const VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX = 2000;
|
|
53
|
+
declare const VIDEO_CHARACTER_VOICE_EXAMPLE_MAX = 120;
|
|
54
|
+
/** How many character references the provider takes; 0 = none (or unknown). */
|
|
55
|
+
declare function videoCharacterRefCap(provider: string | undefined): number;
|
|
56
|
+
/** How many DISTINCT voice personas the provider takes per request; 0 = none. */
|
|
57
|
+
declare function videoCharacterVoiceCap(provider: string | undefined): number;
|
|
58
|
+
/**
|
|
59
|
+
* Identity of a voice persona — what makes two voices "the same voice". The
|
|
60
|
+
* persona is minted per (preset, description, example line) AND the character's
|
|
61
|
+
* name (the label it is created under), so the name is part of the identity:
|
|
62
|
+
* this count must equal the number of personas the provider will actually mint,
|
|
63
|
+
* or the cap would be checked against a different number than what ships.
|
|
64
|
+
*/
|
|
65
|
+
declare function videoCharacterVoiceKey(ref: Pick<VideoCharacterReference, "voice" | "name">): string | null;
|
|
66
|
+
/** How many distinct voice personas a set of references asks for. */
|
|
67
|
+
declare function videoCharacterDistinctVoices(characterReferences: readonly Pick<VideoCharacterReference, "voice" | "name">[] | undefined): number;
|
|
68
|
+
/** Every provider that declares a character-reference cap, in declaration order. */
|
|
69
|
+
declare function videoCharacterRefProviders(): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Input units a set of character references draws from the provider's shared
|
|
72
|
+
* input budget: 1 per character, 2 when a body image is supplied (the upstream
|
|
73
|
+
* counts a dual-image character as two slots).
|
|
74
|
+
*/
|
|
75
|
+
declare function videoCharacterRefUnits(characterReferences: readonly Pick<VideoCharacterReference, "bodyImageUrl">[] | undefined): number;
|
|
76
|
+
interface VideoCharacterRefProblem {
|
|
77
|
+
code: "character_references_unsupported" | "character_references_over_limit" | "character_references_with_start_frame" | "character_references_with_end_frame" | "character_references_quota" | "character_voice_unsupported" | "character_voices_over_limit";
|
|
78
|
+
message: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Voice-persona rule: the provider must take voices at all, and the DISTINCT
|
|
82
|
+
* voices must fit its cap (Gemini Omni: 3 `audio_ids` per task). Two characters
|
|
83
|
+
* with an identical voice AND name count once. `cap` overrides the provider's declared cap
|
|
84
|
+
* (tests; a future model with a different limit declares it as data instead).
|
|
85
|
+
*/
|
|
86
|
+
declare function videoCharacterVoiceProblem(args: {
|
|
87
|
+
provider: string | undefined;
|
|
88
|
+
characterReferences: readonly VideoCharacterReference[] | undefined;
|
|
89
|
+
cap?: number;
|
|
90
|
+
}): VideoCharacterRefProblem | null;
|
|
91
|
+
/**
|
|
92
|
+
* The one validation both video routes (and the provider backstop) run. Returns
|
|
93
|
+
* the first problem as a friendly 400 body, or null when the request is fine.
|
|
94
|
+
*
|
|
95
|
+
* The shared budget: for a model that declares `characters`, its `images` cap
|
|
96
|
+
* IS the total input budget (images + 2×videos + character units ≤ images cap —
|
|
97
|
+
* 7 for Gemini Omni). Callers pass the ASSEMBLED image count, after any
|
|
98
|
+
* `connectedReferences` expansion, so the budget is measured on what ships.
|
|
99
|
+
*/
|
|
100
|
+
declare function videoCharacterRefProblem(args: {
|
|
101
|
+
provider: string | undefined;
|
|
102
|
+
characterReferences: readonly VideoCharacterReference[] | undefined;
|
|
103
|
+
/** Reference images that will ship (assembled, flat). */
|
|
104
|
+
imageCount: number;
|
|
105
|
+
/** Source / reference videos that will ship. */
|
|
106
|
+
videoCount: number;
|
|
107
|
+
/** True when the request carries a start frame (`imageUrl`). */
|
|
108
|
+
hasStartFrame: boolean;
|
|
109
|
+
/** True when the request carries an end frame (`endFrameUrl`). */
|
|
110
|
+
hasEndFrame?: boolean;
|
|
111
|
+
}): VideoCharacterRefProblem | null;
|
|
112
|
+
|
|
113
|
+
/** Read a video node's duration (in seconds) from its data shape.
|
|
114
|
+
* Tries `generatedResults[activeResultIndex].duration` (post-execution
|
|
115
|
+
* metadata) first, then `data.duration` (configured at design time on
|
|
116
|
+
* generate-video / image-to-video / text-to-video nodes). Returns
|
|
117
|
+
* undefined when neither is set — callers should fall back to a sensible
|
|
118
|
+
* default (e.g. 8s).
|
|
119
|
+
*
|
|
120
|
+
* Lives in `@nodaro/shared` so frontend (store walks) and backend
|
|
121
|
+
* (orchestrator input-resolver) can use one source of truth. */
|
|
122
|
+
declare function extractVideoDurationFromNode(data: Record<string, unknown> | undefined): number | undefined;
|
|
123
|
+
/** Duration (seconds) of an edit-plan SOURCE node's media, for the reserve
|
|
124
|
+
* bucket. Extends {@link extractVideoDurationFromNode} with the AUDIO lane:
|
|
125
|
+
* `upload-audio` (and URL-imported audio) write their length to
|
|
126
|
+
* `metadata.durationSeconds` ONLY — never `generatedResults[].duration` /
|
|
127
|
+
* `data.duration` — so a podcast's audio master would otherwise resolve to
|
|
128
|
+
* undefined and reserve the 180-minute ceiling (a ~6× overbill). A
|
|
129
|
+
* `reference-audio` node records its extracted file's length in the same field,
|
|
130
|
+
* stamped with `metadata.mediaUrl` (see the binding check below).
|
|
131
|
+
*
|
|
132
|
+
* Deliberately a NEW function, not a change to `extractVideoDurationFromNode`,
|
|
133
|
+
* so no other node's duration read shifts — this fallback is edit-plan-scoped. */
|
|
134
|
+
declare function editPlanSourceDurationSec(data: Record<string, unknown> | undefined): number | undefined;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* The Video URL node (`youtube-video`) and the social-video import path —
|
|
138
|
+
* structural vocabulary shared by the canvas, the orchestrator and the
|
|
139
|
+
* download routes. Host names and a node-output rule only; no prompt content.
|
|
140
|
+
*
|
|
141
|
+
* ONE list, three readers:
|
|
142
|
+
* - the backend's yt-dlp routes (`lib/url-validator.ts` re-exports these),
|
|
143
|
+
* where the list IS the SSRF gate — yt-dlp does its own DNS + HTTP, so
|
|
144
|
+
* nothing but this exact-suffix match stands between a pasted link and an
|
|
145
|
+
* internal address;
|
|
146
|
+
* - the editor, which decides from the same list whether a pasted link is
|
|
147
|
+
* one it should download (it must never offer a host the server refuses,
|
|
148
|
+
* nor sit on one the server accepts);
|
|
149
|
+
* - both workflow engines, which read a node's output through
|
|
150
|
+
* `resolveVideoLinkOutput`.
|
|
151
|
+
*
|
|
152
|
+
* ⚠️ Adding a host here ADMITS it to a server-side fetch. It is a security
|
|
153
|
+
* decision, not a UI one — only fixed, reputable domains whose DNS an attacker
|
|
154
|
+
* cannot control.
|
|
155
|
+
*/
|
|
156
|
+
declare const SOCIAL_VIDEO_HOSTS: readonly ["youtube.com", "youtu.be", "tiktok.com", "instagram.com", "twitter.com", "x.com", "facebook.com", "fb.watch", "fb.com"];
|
|
157
|
+
/** YouTube-only subset (the metadata probe and the client ladder are YouTube-only). */
|
|
158
|
+
declare const YOUTUBE_HOSTS: readonly ["youtube.com", "youtu.be"];
|
|
159
|
+
/** Instagram-only subset (the download path's proxy failover is Instagram-scoped). */
|
|
160
|
+
declare const INSTAGRAM_HOSTS: readonly ["instagram.com"];
|
|
161
|
+
/**
|
|
162
|
+
* Exact registrable-domain match against an allowlist: the domain itself or a
|
|
163
|
+
* true subdomain (`www.youtube.com`, `m.youtu.be`). A host that merely
|
|
164
|
+
* CONTAINS an allowlisted name (`evilyoutube.com`, `youtube.com.attacker.example`,
|
|
165
|
+
* or `netflix.com` for `x.com`) does not match.
|
|
166
|
+
*/
|
|
167
|
+
declare function hostnameMatchesAllowlist(hostname: string, domains: readonly string[]): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* True when the RAW link carries a character that URL parsers read differently:
|
|
170
|
+
* a backslash or an ASCII control character.
|
|
171
|
+
*
|
|
172
|
+
* Every check in this file parses the WHATWG way (Node, the browser), where a
|
|
173
|
+
* backslash in an http(s) URL is a slash — `https://tiktok.com\@10.0.0.1/x` has
|
|
174
|
+
* host `tiktok.com`. A parser that ends the authority at `/` alone reads the
|
|
175
|
+
* same string as a user name at host `10.0.0.1`. The download tools are handed
|
|
176
|
+
* the raw string and do their own parsing, DNS and HTTP, so a link the two
|
|
177
|
+
* readings can disagree on is refused outright rather than reasoned about. Tabs
|
|
178
|
+
* and newlines are dropped silently by one parser and kept by another — same
|
|
179
|
+
* answer. No real video link contains any of these.
|
|
180
|
+
*/
|
|
181
|
+
declare function hasUrlParserHazard(url: string): boolean;
|
|
182
|
+
/** True for an http(s) URL whose host is on the allowlist. Never throws. */
|
|
183
|
+
declare function isSocialVideoUrl(url: string, domains?: readonly string[]): boolean;
|
|
184
|
+
type VideoLinkPlatform = "youtube" | "facebook" | "tiktok" | "instagram" | "twitter" | "unknown";
|
|
185
|
+
/** Which supported platform a link belongs to — by exact host, never by substring. */
|
|
186
|
+
declare function detectVideoLinkPlatform(url: string): VideoLinkPlatform;
|
|
187
|
+
/**
|
|
188
|
+
* Node types that can use a Video URL node WITHOUT its downloaded file, because
|
|
189
|
+
* they never read the video: `suno-cover` and `transcribe` take the node's
|
|
190
|
+
* separately-fetched audio track (`downloadedAudioUrl`), `dubbing` hands the
|
|
191
|
+
* page link to a provider that fetches it itself, and `content-recipe` cites the
|
|
192
|
+
* post's page link on its `link` input (`videoLinkPageUrl`, both resolvers) —
|
|
193
|
+
* a Video URL can reach it on no other input. A run whose only consumers of a
|
|
194
|
+
* link are these must not be made to download — or to choose a part of — a
|
|
195
|
+
* video nobody will look at. Structural vocabulary: it mirrors those
|
|
196
|
+
* server-side readers; add a type here only together with its reader.
|
|
197
|
+
*/
|
|
198
|
+
declare const VIDEO_LINK_TOLERANT_CONSUMER_TYPES: ReadonlySet<string>;
|
|
199
|
+
/**
|
|
200
|
+
* The tolerant consumers that DO read something fetched from the link — the
|
|
201
|
+
* separately-fetched audio track (`downloadedAudioUrl`): Transcribe and Suno
|
|
202
|
+
* Cover. The rest of the tolerant set (Dubbing, Content Recipe) read only the
|
|
203
|
+
* page link and need nothing fetched. A subset of the tolerant set by
|
|
204
|
+
* construction (guard test).
|
|
205
|
+
*/
|
|
206
|
+
declare const VIDEO_LINK_AUDIO_CONSUMER_TYPES: ReadonlySet<string>;
|
|
207
|
+
/**
|
|
208
|
+
* What a run must FETCH for a Video URL node holding a post link:
|
|
209
|
+
* - `file`: some node in the run watches the video — download the video;
|
|
210
|
+
* - `audio`: every reader is tolerant and at least one takes the audio track —
|
|
211
|
+
* fetch the track only, never the video (and never ask for a part of it);
|
|
212
|
+
* - `none`: every reader takes the page link alone — fetch nothing.
|
|
213
|
+
*/
|
|
214
|
+
type VideoLinkNeed = "file" | "audio" | "none";
|
|
215
|
+
/** The need of a node read by consumers of these types. No consumer reads nothing. */
|
|
216
|
+
declare function videoLinkNeedOf(consumerTypes: Iterable<string>): VideoLinkNeed;
|
|
217
|
+
/** The node shape the graph readers need — open on purpose, both engines' nodes fit. */
|
|
218
|
+
interface VideoLinkGraphNode {
|
|
219
|
+
readonly id: string;
|
|
220
|
+
readonly type?: string;
|
|
221
|
+
readonly data?: unknown;
|
|
222
|
+
}
|
|
223
|
+
interface VideoLinkGraphEdge {
|
|
224
|
+
readonly source: string;
|
|
225
|
+
readonly target: string;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* The need of every Video URL node that feeds the run, by node id — ONE reading
|
|
229
|
+
* of the graph for the editor's pre-run gate, the app runner's card and the
|
|
230
|
+
* server's pre-run fetch, so the three cannot disagree on what a run needs.
|
|
231
|
+
*
|
|
232
|
+
* `scopeIds` are the nodes about to run (`null` = every node: an app runs its
|
|
233
|
+
* whole graph). The run is those nodes plus everything they read from, at any
|
|
234
|
+
* depth; a link that feeds nothing in it is absent (a long video parked on the
|
|
235
|
+
* canvas must never block an unrelated run). Skipped nodes are not part of the
|
|
236
|
+
* run and pull nothing in.
|
|
237
|
+
*/
|
|
238
|
+
declare function videoLinkRunNeeds(scopeIds: readonly string[] | null, nodes: readonly VideoLinkGraphNode[], edges: readonly VideoLinkGraphEdge[]): Map<string, VideoLinkNeed>;
|
|
239
|
+
/**
|
|
240
|
+
* The fields of a Video URL node's data that decide what it emits. Open-ended
|
|
241
|
+
* on purpose: both engines hand over the node's whole `data` bag, and a closed
|
|
242
|
+
* shape with only optional members would refuse it as having nothing in common.
|
|
243
|
+
*/
|
|
244
|
+
interface VideoLinkNodeFields {
|
|
245
|
+
readonly youtubeUrl?: unknown;
|
|
246
|
+
readonly downloadedVideoUrl?: unknown;
|
|
247
|
+
readonly downloadedFromUrl?: unknown;
|
|
248
|
+
readonly [key: string]: unknown;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The stored file that belongs to the node's CURRENT link, or undefined.
|
|
252
|
+
*
|
|
253
|
+
* `downloadedFromUrl` binds a file to the link it came from. The editor clears
|
|
254
|
+
* the file whenever the link is edited, but a link can also change where no
|
|
255
|
+
* editor is looking — an agent or an import rewriting the workflow JSON — and
|
|
256
|
+
* without the binding the node would go on emitting the PREVIOUS video, which
|
|
257
|
+
* is worse than emitting none. A node saved before the field existed has no
|
|
258
|
+
* binding and is trusted as it always was.
|
|
259
|
+
*/
|
|
260
|
+
declare function videoLinkDownloadedFile(data: VideoLinkNodeFields): string | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* What a Video URL node emits on its `video` handle: the downloaded file when
|
|
263
|
+
* one matches the link, else the link itself. The fallback is load-bearing — a
|
|
264
|
+
* DIRECT file link (`https://cdn…/clip.mp4`) is a legitimate value of the URL
|
|
265
|
+
* field and is never downloaded, so it must pass through.
|
|
266
|
+
*/
|
|
267
|
+
declare function resolveVideoLinkOutput(data: VideoLinkNodeFields): string | undefined;
|
|
268
|
+
/**
|
|
269
|
+
* The page link a Video URL node was given (the post's own address), never
|
|
270
|
+
* the downloaded file. Read by consumers that CITE a post rather than watch
|
|
271
|
+
* it — Content Recipe's "Source post" input stores it as the recipe's source.
|
|
272
|
+
*/
|
|
273
|
+
declare function videoLinkPageUrl(data: VideoLinkNodeFields): string | undefined;
|
|
274
|
+
/**
|
|
275
|
+
* True when the node holds a social link with no file for it yet — the state
|
|
276
|
+
* in which its output is a web PAGE, which no video consumer can read.
|
|
277
|
+
*/
|
|
278
|
+
declare function videoLinkNeedsDownload(data: VideoLinkNodeFields): boolean;
|
|
279
|
+
/**
|
|
280
|
+
* File extensions accepted as DIRECT video-file links (pathname suffix match).
|
|
281
|
+
* Mirrors save-to-storage's video auto-detect set.
|
|
282
|
+
*/
|
|
283
|
+
declare const DIRECT_VIDEO_EXTENSIONS: readonly [".mp4", ".webm", ".mov", ".avi"];
|
|
284
|
+
/**
|
|
285
|
+
* True for a DIRECT video-file link: http(s) whose PATHNAME ends in a video
|
|
286
|
+
* extension — `https://cdn.nodaro.ai/uploads/videos/<id>.mp4` and any other
|
|
287
|
+
* cdn-style link. Query and fragment are ignored (signed CDN links keep the
|
|
288
|
+
* extension in the path); an extension that appears only in the query does
|
|
289
|
+
* not qualify. Host-agnostic BY DESIGN, which is exactly why admission is not
|
|
290
|
+
* sufficient on its own: the download route pre-resolves these hosts before it
|
|
291
|
+
* fetches (`resolvesOnlyToPublicAddresses`), and every other reader goes
|
|
292
|
+
* through the SSRF-guarded fetch.
|
|
293
|
+
*
|
|
294
|
+
* A link carrying a backslash or a control character is refused first
|
|
295
|
+
* (`hasUrlParserHazard`): the route pre-resolves the WHATWG host, and the
|
|
296
|
+
* download tool would fetch whatever host ITS parser reads.
|
|
297
|
+
*/
|
|
298
|
+
declare function isDirectVideoFileUrl(url: string): boolean;
|
|
299
|
+
/**
|
|
300
|
+
* A YouTube video shorter than this downloads whole the moment the link lands;
|
|
301
|
+
* a longer one (or one whose length could not be read) waits for a part to be
|
|
302
|
+
* chosen. The same 4 minutes Recast and Studio use — a two-hour talk nobody
|
|
303
|
+
* asked for never gets fetched by accident. One number for the canvas node, the
|
|
304
|
+
* app runner's card and the server's pre-run fetch.
|
|
305
|
+
*/
|
|
306
|
+
declare const AUTO_DOWNLOAD_MAX_SEC = 240;
|
|
307
|
+
/** YouTube's quality cap ("up to N rows"). Other hosts have no ladder worth capping. */
|
|
308
|
+
declare const YOUTUBE_MAX_HEIGHT = 1080;
|
|
309
|
+
/** The longest link an app input accepts. A real video link is a few hundred characters. */
|
|
310
|
+
declare const MAX_VIDEO_LINK_INPUT_CHARS = 2048;
|
|
311
|
+
type VideoLinkInputProblem = "empty" | "invalid";
|
|
312
|
+
/**
|
|
313
|
+
* The ONE rule for what a Video URL app input may hold — the canvas node's own
|
|
314
|
+
* (decided 2026-10-08): a link to a supported social host (downloaded before
|
|
315
|
+
* the nodes that need the file run), or any other http(s) link (passed through
|
|
316
|
+
* as it is, never downloaded; the nodes that read it fetch it through the
|
|
317
|
+
* SSRF-guarded fetch). The app runner's card, the run-request lock and MCP
|
|
318
|
+
* `get_app_inputs` all read it, so a link the card accepts is a link the
|
|
319
|
+
* server accepts, and the reverse.
|
|
320
|
+
*
|
|
321
|
+
* Structural only: the server layers its SSRF guard on top (`safeUrlSchema`),
|
|
322
|
+
* and the card refuses a literal local / private host. A link carrying a
|
|
323
|
+
* backslash or a control character is refused (`hasUrlParserHazard`).
|
|
324
|
+
* `null` = fine; leading and trailing spaces are not a problem (the card trims
|
|
325
|
+
* before it sends).
|
|
326
|
+
*/
|
|
327
|
+
declare function videoLinkInputProblem(value: unknown): VideoLinkInputProblem | null;
|
|
328
|
+
/**
|
|
329
|
+
* The fields of a Video URL node's data that belong to ONE link: the file and
|
|
330
|
+
* audio track fetched from it, the progress of that fetch, and what was read
|
|
331
|
+
* from the link (its id, title, picture, length). Every one of them describes
|
|
332
|
+
* the link it was made for.
|
|
333
|
+
*
|
|
334
|
+
* A run-time override that swaps the link (`dropStaleVideoLinkFields`) drops
|
|
335
|
+
* these first, because the creator's published node carries all of them and a
|
|
336
|
+
* shallow merge would leave them standing under the caller's link — the audio
|
|
337
|
+
* track in particular has no binding to its link (`downloadedAudioUrl` is read
|
|
338
|
+
* straight off the node by Transcribe and Suno Cover), so a caller's episode
|
|
339
|
+
* would be transcribed from the creator's sample. The editor's own
|
|
340
|
+
* link-change reset (`CLEARED_DOWNLOAD` in `lib/video-link-ingest.ts`) is
|
|
341
|
+
* guarded to be inside this list.
|
|
342
|
+
*/
|
|
343
|
+
declare const VIDEO_LINK_DERIVED_FIELDS: readonly ["videoId", "title", "thumbnailUrl", "downloadedVideoUrl", "downloadedThumbnailUrl", "downloadedFromUrl", "downloadedSection", "downloadStatus", "downloadError", "downloadErrorCode", "downloadId", "downloadIdUrl", "downloadMode", "downloadAllowSilent", "downloadPercent", "downloadPhase", "sectionStartSec", "sectionEndSec", "needsRangeChoice", "videoDurationSec", "downloadedAudioUrl", "audioDownloadStatus", "audioDownloadError"];
|
|
344
|
+
/**
|
|
345
|
+
* The saved Video URL node data without what belonged to its previous link,
|
|
346
|
+
* when `incoming` (the run's override for the node) points it at a different
|
|
347
|
+
* one. A field the override brings itself is kept (the merge applies it after
|
|
348
|
+
* this). Returns the SAME object when the link is not being changed; never
|
|
349
|
+
* mutates.
|
|
350
|
+
*/
|
|
351
|
+
declare function dropStaleVideoLinkFields(data: Record<string, unknown>, incoming: Record<string, unknown>): Record<string, unknown>;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Video Overlay — timed image layers over a video. The wire contract of the
|
|
355
|
+
* `video-overlay` node, `POST /v1/video-overlay`, the `overlay_images` MCP
|
|
356
|
+
* verb, `client.media.videoOverlay` and `nodaro media video-overlay`, defined
|
|
357
|
+
* ONCE:
|
|
358
|
+
* - every numeric bound (the route schema, the validator — which refuses a
|
|
359
|
+
* present box / look field outside `VIDEO_OVERLAY_BOUNDS`, so the DAG path
|
|
360
|
+
* that never meets the route schema is bounded too — both engine
|
|
361
|
+
* assemblies and the canvas read these — never a second copy);
|
|
362
|
+
* - the placement presets, stored as data in the custom box vocabulary: a
|
|
363
|
+
* `preset` is a TAG, the box is the truth — the worker and the preview
|
|
364
|
+
* never switch on the tag;
|
|
365
|
+
* - `expandVideoOverlayLayer` / `expandVideoOverlayPresets`: the one
|
|
366
|
+
* normaliser every write boundary calls;
|
|
367
|
+
* - `resolveVideoOverlayGeometry`: the one placement function the canvas
|
|
368
|
+
* preview and the ffmpeg worker both call;
|
|
369
|
+
* - `assembleVideoOverlayRequest`: the one node-data → request assembly both
|
|
370
|
+
* workflow engines call;
|
|
371
|
+
* - `videoOverlayCompositionKey` (+ `videoOverlaySlotSources`): the freshness
|
|
372
|
+
* key a run stamps on its result (`resultCompositionKey`) — the canvas
|
|
373
|
+
* single-node Run (which sends it with the request, bounded by
|
|
374
|
+
* `VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH`) and the DAG payload compute
|
|
375
|
+
* it with this one function, and the node compares it against the key of
|
|
376
|
+
* its current settings;
|
|
377
|
+
* - `validateVideoOverlayRequest`: what a schema cannot express, at every
|
|
378
|
+
* engine entry. It returns a CODE, never English: `formatVideoOverlayError`
|
|
379
|
+
* renders the route / worker text, the canvas renders the code through its
|
|
380
|
+
* dictionaries.
|
|
381
|
+
* Wire contract only — no prompt content, no I/O.
|
|
382
|
+
*/
|
|
383
|
+
|
|
384
|
+
/** Engine + MCP contract: layers per request. */
|
|
385
|
+
declare const VIDEO_OVERLAY_MAX_LAYERS = 20;
|
|
386
|
+
/** Ceiling for `start` / `end`, seconds. */
|
|
387
|
+
declare const VIDEO_OVERLAY_MAX_TIME_SEC = 3600;
|
|
388
|
+
/**
|
|
389
|
+
* The canvas layer handles, index-aligned with `layers[]` (overlay → layers[0]
|
|
390
|
+
* … overlay12 → layers[11]). Slots 13 and up exist in data only, via `imageUrl`.
|
|
391
|
+
* The same ids Image Overlay renders.
|
|
392
|
+
*/
|
|
393
|
+
declare const VIDEO_OVERLAY_HANDLE_IDS: readonly ["overlay", "overlay2", "overlay3", "overlay4", "overlay5", "overlay6", "overlay7", "overlay8", "overlay9", "overlay10", "overlay11", "overlay12"];
|
|
394
|
+
declare const VIDEO_OVERLAY_PRESET_IDS: readonly ["card", "corner-badge", "full-frame"];
|
|
395
|
+
type VideoOverlayPresetId = (typeof VIDEO_OVERLAY_PRESET_IDS)[number];
|
|
396
|
+
declare const VIDEO_OVERLAY_CORNERS: readonly ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
397
|
+
type VideoOverlayCorner = (typeof VIDEO_OVERLAY_CORNERS)[number];
|
|
398
|
+
declare const VIDEO_OVERLAY_FITS: readonly ["contain", "cover"];
|
|
399
|
+
type VideoOverlayFit = (typeof VIDEO_OVERLAY_FITS)[number];
|
|
400
|
+
/** Target aspects; absent = the base's own size and fps. */
|
|
401
|
+
declare const VIDEO_OVERLAY_OUTPUT_ASPECTS: readonly ["16:9", "9:16", "1:1", "4:5"];
|
|
402
|
+
type VideoOverlayOutputAspect = (typeof VIDEO_OVERLAY_OUTPUT_ASPECTS)[number];
|
|
403
|
+
/**
|
|
404
|
+
* Reserved input id for a JSON layer plan. Payload: `VideoOverlayLayer[]` — the
|
|
405
|
+
* same shape as the node's `layers[]`, a `preset` tag allowed and expanded at
|
|
406
|
+
* the boundary. It has a pip on the node; both input resolvers route an edge on
|
|
407
|
+
* it into `inputs.layerPlan`, which `assembleVideoOverlayRequest` reads (plan
|
|
408
|
+
* layers first, then the handle layers).
|
|
409
|
+
*/
|
|
410
|
+
declare const VIDEO_OVERLAY_LAYER_PLAN_HANDLE = "layerPlan";
|
|
411
|
+
/** Box and look bounds. */
|
|
412
|
+
declare const VIDEO_OVERLAY_BOUNDS: {
|
|
413
|
+
readonly x: readonly [-100, 100];
|
|
414
|
+
readonly y: readonly [-100, 100];
|
|
415
|
+
readonly width: readonly [1, 100];
|
|
416
|
+
readonly height: readonly [1, 100];
|
|
417
|
+
readonly opacity: readonly [0, 1];
|
|
418
|
+
readonly zIndex: readonly [0, 100];
|
|
419
|
+
};
|
|
420
|
+
/** Σ downloaded layer bytes per job. */
|
|
421
|
+
declare const VIDEO_OVERLAY_MAX_TOTAL_LAYER_BYTES: number;
|
|
422
|
+
/** Fade + scale ramp, seconds each way (clamped to half of a short layer). */
|
|
423
|
+
declare const VIDEO_OVERLAY_ANIMATION_SEC = 0.15;
|
|
424
|
+
/** The scale a layer grows from and shrinks back to during the ramp. */
|
|
425
|
+
declare const VIDEO_OVERLAY_ANIMATION_MIN_SCALE = 0.96;
|
|
426
|
+
/** Corner-badge width and inset, % of the output canvas. */
|
|
427
|
+
declare const VIDEO_OVERLAY_BADGE_WIDTH = 18;
|
|
428
|
+
declare const VIDEO_OVERLAY_BADGE_INSET = 4;
|
|
429
|
+
/** Pad colour for `baseFit: "contain"` when none is given. */
|
|
430
|
+
declare const VIDEO_OVERLAY_DEFAULT_BACKGROUND = "#000000";
|
|
431
|
+
/** The six box fields — exactly what a preset writes. */
|
|
432
|
+
declare const VIDEO_OVERLAY_BOX_FIELDS: readonly ["anchor", "x", "y", "width", "height", "fit"];
|
|
433
|
+
declare const VIDEO_OVERLAY_WARNING_CODES: readonly ["clipped", "skipped", "animated_first_frame", "audio_reencoded"];
|
|
434
|
+
type VideoOverlayWarningCode = (typeof VIDEO_OVERLAY_WARNING_CODES)[number];
|
|
435
|
+
declare const VIDEO_OVERLAY_ERROR_CODES: readonly ["no_layers", "too_many_layers", "incomplete_box", "layer_without_image", "time_out_of_range", "end_before_start", "fit_without_aspect", "field_out_of_bounds", "invalid_layer_plan"];
|
|
436
|
+
type VideoOverlayErrorCode = (typeof VIDEO_OVERLAY_ERROR_CODES)[number];
|
|
437
|
+
interface VideoOverlayBox {
|
|
438
|
+
readonly anchor: OverlayAnchor;
|
|
439
|
+
readonly x: number;
|
|
440
|
+
readonly y: number;
|
|
441
|
+
readonly width: number;
|
|
442
|
+
readonly height?: number;
|
|
443
|
+
readonly fit: VideoOverlayFit;
|
|
444
|
+
}
|
|
445
|
+
/** A layer as stored and enqueued — complete: every box and look field present. */
|
|
446
|
+
interface VideoOverlayLayer {
|
|
447
|
+
/**
|
|
448
|
+
* Used when the layer's canvas handle is not wired (MCP, template, layers
|
|
449
|
+
* 13 and up). Wiring the handle CLEARS it — on the canvas by the one `layers[]`
|
|
450
|
+
* writer (D3), on JSON-written workflows by the write-boundary pass (D10) —
|
|
451
|
+
* and the run-time merge is still `wired ?? imageUrl` everywhere.
|
|
452
|
+
*/
|
|
453
|
+
imageUrl?: string;
|
|
454
|
+
/** 1-based canvas slot (overlay = 1 … overlay12 = 12; 13 and up handle-less), stamped by both engine assemblies. Messages prefer it. */
|
|
455
|
+
slot?: number;
|
|
456
|
+
/** 1-based entry of a wired layer plan, stamped by the assembly. Messages prefer it. */
|
|
457
|
+
planLayer?: number;
|
|
458
|
+
/** Seconds, 0..3600, stored ms-precise; rendered on the base's frame grid (±1 frame). */
|
|
459
|
+
start: number;
|
|
460
|
+
/** Seconds, 0..3600, > start; absent = until the video ends. */
|
|
461
|
+
end?: number;
|
|
462
|
+
/** A TAG only — the box below is the truth. */
|
|
463
|
+
preset?: VideoOverlayPresetId;
|
|
464
|
+
/** corner-badge only; default bottom-right. */
|
|
465
|
+
corner?: VideoOverlayCorner;
|
|
466
|
+
anchor: OverlayAnchor;
|
|
467
|
+
/** Offset from the anchor, % of the output canvas width (−100..100; negative on a right anchor = inward). */
|
|
468
|
+
x: number;
|
|
469
|
+
/** Offset from the anchor, % of the output canvas height. */
|
|
470
|
+
y: number;
|
|
471
|
+
/** % of the output canvas width (1..100). */
|
|
472
|
+
width: number;
|
|
473
|
+
/** % of the output canvas height (1..100); absent = follows the image's aspect. */
|
|
474
|
+
height?: number;
|
|
475
|
+
fit: VideoOverlayFit;
|
|
476
|
+
/** 0..1 */
|
|
477
|
+
opacity: number;
|
|
478
|
+
/** Fade + slight scale in and out, 0.15 s each way. */
|
|
479
|
+
animate: boolean;
|
|
480
|
+
/** Integer 0..100; absent = its position (slot − 1: layer 1 lowest). */
|
|
481
|
+
zIndex?: number;
|
|
482
|
+
}
|
|
483
|
+
/** A layer as a WRITER may send it (workflow JSON, a template, the canvas): every field optional; `null` means absent. */
|
|
484
|
+
type VideoOverlayLayerInput = {
|
|
485
|
+
[K in keyof VideoOverlayLayer]?: VideoOverlayLayer[K] | null;
|
|
486
|
+
};
|
|
487
|
+
/** 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). */
|
|
488
|
+
type VideoOverlayLayerSpec = {
|
|
489
|
+
imageUrl: string;
|
|
490
|
+
start: number;
|
|
491
|
+
} & Partial<Omit<VideoOverlayLayer, "imageUrl" | "start">>;
|
|
492
|
+
/** The `POST /v1/video-overlay` body. */
|
|
493
|
+
interface VideoOverlayRequest {
|
|
494
|
+
videoUrl: string;
|
|
495
|
+
/** 1..20 */
|
|
496
|
+
layers: VideoOverlayLayerSpec[];
|
|
497
|
+
outputAspect?: VideoOverlayOutputAspect;
|
|
498
|
+
/** Only with `outputAspect`; default cover. */
|
|
499
|
+
baseFit?: VideoOverlayFit;
|
|
500
|
+
/** `#rrggbb`, only with `outputAspect` (drawn under `contain`); default `#000000`. */
|
|
501
|
+
backgroundColor?: string;
|
|
502
|
+
}
|
|
503
|
+
/** A request whose layers went through `expandVideoOverlayPresets`. */
|
|
504
|
+
interface ExpandedVideoOverlayRequest extends Omit<VideoOverlayRequest, "layers"> {
|
|
505
|
+
layers: VideoOverlayLayer[];
|
|
506
|
+
/** Set by the assembly when a wired layer plan could not be read; `validateVideoOverlayRequest` reports it first. */
|
|
507
|
+
planError?: "invalid_layer_plan";
|
|
508
|
+
}
|
|
509
|
+
/** `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. */
|
|
510
|
+
interface VideoOverlayWarning {
|
|
511
|
+
readonly layer?: number;
|
|
512
|
+
readonly slot?: number;
|
|
513
|
+
/** Set instead of `slot` when the layer came from the layer plan. */
|
|
514
|
+
readonly planLayer?: number;
|
|
515
|
+
readonly code: VideoOverlayWarningCode;
|
|
516
|
+
readonly detail: string;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Placement presets as DATA in the custom vocabulary. `card` sits centred, 4 %
|
|
520
|
+
* above centre, contain into 78 % × 60 % of the frame; `full-frame` covers the
|
|
521
|
+
* frame; `corner-badge` is 18 % wide, 4 % in from its corner.
|
|
522
|
+
*/
|
|
523
|
+
declare const VIDEO_OVERLAY_PRESETS: {
|
|
524
|
+
readonly card: VideoOverlayBox;
|
|
525
|
+
readonly "full-frame": VideoOverlayBox;
|
|
526
|
+
readonly "corner-badge": Readonly<Record<VideoOverlayCorner, VideoOverlayBox>>;
|
|
527
|
+
};
|
|
528
|
+
/** D2 — what a wired slot with no settings runs (and previews) with: the bottom-right corner badge, from 0 to the end. */
|
|
529
|
+
declare const DEFAULT_VIDEO_OVERLAY_LAYER: VideoOverlayLayer;
|
|
530
|
+
declare function isVideoOverlayPresetId(v: unknown): v is VideoOverlayPresetId;
|
|
531
|
+
declare function isVideoOverlayCorner(v: unknown): v is VideoOverlayCorner;
|
|
532
|
+
declare function isVideoOverlayOutputAspect(v: unknown): v is VideoOverlayOutputAspect;
|
|
533
|
+
/** 1-based slot of a layer handle id (`overlay` → 1 … `overlay12` → 12); 0 for anything else. */
|
|
534
|
+
declare function videoOverlaySlotOfHandle(handle: string | null | undefined): number;
|
|
535
|
+
declare function videoOverlayPresetBox(preset: VideoOverlayPresetId, corner?: VideoOverlayCorner | null): VideoOverlayBox;
|
|
536
|
+
/**
|
|
537
|
+
* The ONE normaliser (spec §3.3), called at every write boundary.
|
|
538
|
+
* - `preset` + no box field → the preset's box is copied in, the tag stays.
|
|
539
|
+
* - `preset` + explicit box fields → explicit fields win, the preset fills
|
|
540
|
+
* what is absent; the tag is cleared only when an explicit field DIFFERS
|
|
541
|
+
* from the preset's box (a field the preset does not set — `height` on a
|
|
542
|
+
* corner badge — differs when present).
|
|
543
|
+
* - no `preset` + no box field → the corner badge of the layer's own `corner`
|
|
544
|
+
* (bottom-right when none), the D2 default filling tag / corner / trailing
|
|
545
|
+
* fields, the layer's own fields winning (D8): `{}` → the full default.
|
|
546
|
+
* - no `preset` + a PARTIAL box (not anchor AND width) → returned untouched;
|
|
547
|
+
* the validator answers `incomplete_box`.
|
|
548
|
+
* Trailing defaults x 0, y 0, fit contain, opacity 1, animate true are filled
|
|
549
|
+
* here and nowhere else. `null` reads as absent. Returned BY REFERENCE when
|
|
550
|
+
* nothing changes; idempotent, tag included.
|
|
551
|
+
*/
|
|
552
|
+
declare function expandVideoOverlayLayer(raw: VideoOverlayLayerInput | null | undefined): VideoOverlayLayer;
|
|
553
|
+
/** `expandVideoOverlayLayer` over an array; the SAME array when no layer changed. */
|
|
554
|
+
declare function expandVideoOverlayPresets(layers: ReadonlyArray<VideoOverlayLayerInput | null | undefined>): VideoOverlayLayer[];
|
|
555
|
+
/** 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. */
|
|
556
|
+
declare function applyVideoOverlayPreset(layer: VideoOverlayLayerInput | null | undefined, preset: VideoOverlayPresetId, corner?: VideoOverlayCorner): VideoOverlayLayer;
|
|
557
|
+
/** The panel's "Custom": the tag is cleared, the box kept. */
|
|
558
|
+
declare function toCustomVideoOverlayLayer(layer: VideoOverlayLayerInput | null | undefined): VideoOverlayLayer;
|
|
559
|
+
/**
|
|
560
|
+
* D10 — delete `imageUrl` from every layer whose canvas handle is wired
|
|
561
|
+
* (`wiredSlots`: 1-based). Pure over `layers` (the route has no edges, so this
|
|
562
|
+
* is a sibling of the expansion, not part of it). Slots 13 and up have no handle
|
|
563
|
+
* and are never touched. The input array by reference when nothing changes.
|
|
564
|
+
*/
|
|
565
|
+
declare function clearWiredVideoOverlayImageUrls<T extends VideoOverlayLayerInput | null | undefined>(layers: readonly T[], wiredSlots: ReadonlySet<number>): readonly T[];
|
|
566
|
+
interface NodeLike {
|
|
567
|
+
id?: unknown;
|
|
568
|
+
type?: unknown;
|
|
569
|
+
data?: unknown;
|
|
570
|
+
}
|
|
571
|
+
interface EdgeLike {
|
|
572
|
+
target?: unknown;
|
|
573
|
+
targetHandle?: unknown;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* The workflow-JSON write-boundary pass (spec §3.3, D10), beside
|
|
577
|
+
* `normalizeNodeModelParams`: for every `video-overlay` node, clear the
|
|
578
|
+
* `imageUrl` of each layer whose handle the WRITTEN edges wire, then expand
|
|
579
|
+
* presets. Runs on every write, so an edge-only write still clears. A `null`
|
|
580
|
+
* (or missing) slot STAYS `null`: "no settings" is stored as such, wired or
|
|
581
|
+
* not — the default corner badge is synthesised only where a wired slot is
|
|
582
|
+
* run or drawn (the two engine assemblies and the stage, D2), so the panel,
|
|
583
|
+
* the reorder and the tail trim see the same empty slot whichever writer
|
|
584
|
+
* stored it. (`{}` is not `null`: it is an explicit empty layer, and the
|
|
585
|
+
* expansion turns it into the full default — spec §3.3.) Nodes and the array
|
|
586
|
+
* are returned by reference when nothing changes.
|
|
587
|
+
*/
|
|
588
|
+
declare function normalizeVideoOverlayNodes<T extends NodeLike>(nodes: readonly T[], edges: ReadonlyArray<EdgeLike> | null | undefined): T[];
|
|
589
|
+
/** What `videoOverlayRenderOrder` reads from a layer. */
|
|
590
|
+
interface VideoOverlayOrderable {
|
|
591
|
+
readonly zIndex?: number | null;
|
|
592
|
+
/** 1-based canvas slot (stamped by both engine assemblies). */
|
|
593
|
+
readonly slot?: number | null;
|
|
594
|
+
/** 1-based layer-plan entry. Plan layers sit BELOW every slot layer (handle layers draw above the plan), unless they set a `zIndex`. */
|
|
595
|
+
readonly planLayer?: number | null;
|
|
596
|
+
/** 0-based index in the request's `layers[]` (the worker's graph layers carry it). */
|
|
597
|
+
readonly index?: number | null;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Render order, bottom to top, as positions in `layers`: an explicit zIndex
|
|
601
|
+
* wins; a layer without one sits at its OWN position — `slot − 1` when it has
|
|
602
|
+
* a slot, else its request `index`, else its position in the array given —
|
|
603
|
+
* never at its position in whatever (compacted) array it happens to be passed
|
|
604
|
+
* in. The stage passes every slot; the worker passes the request minus empty
|
|
605
|
+
* slots and minus layers skipped for starting after the end — both must agree
|
|
606
|
+
* (spec: the preview and the run use the same numbers). Ties keep array order
|
|
607
|
+
* (layer 1 lowest).
|
|
608
|
+
*/
|
|
609
|
+
declare function videoOverlayRenderOrder(layers: ReadonlyArray<VideoOverlayOrderable | null | undefined>): number[];
|
|
610
|
+
interface VideoOverlayRect {
|
|
611
|
+
readonly left: number;
|
|
612
|
+
readonly top: number;
|
|
613
|
+
readonly width: number;
|
|
614
|
+
readonly height: number;
|
|
615
|
+
}
|
|
616
|
+
interface VideoOverlayCanvas {
|
|
617
|
+
readonly w: number;
|
|
618
|
+
readonly h: number;
|
|
619
|
+
}
|
|
620
|
+
interface VideoOverlayGeometry {
|
|
621
|
+
readonly box: VideoOverlayRect;
|
|
622
|
+
readonly drawn: VideoOverlayRect;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* The output canvas: `ASPECT_RATIO_DIMENSIONS[outputAspect]` when a target
|
|
626
|
+
* aspect is set; otherwise the base's DISPLAY size (rotation already applied by
|
|
627
|
+
* the caller's probe) with the sample aspect ratio resolved and both sides
|
|
628
|
+
* rounded down to even — `trunc(iw*sar/2)*2 × trunc(ih/2)*2`, what the ffmpeg
|
|
629
|
+
* base chain produces. null when neither is known.
|
|
630
|
+
*/
|
|
631
|
+
declare function videoOverlayCanvas(display: {
|
|
632
|
+
readonly width: number;
|
|
633
|
+
readonly height: number;
|
|
634
|
+
readonly sar?: number;
|
|
635
|
+
} | null | undefined, outputAspect?: string | null): VideoOverlayCanvas | null;
|
|
636
|
+
/**
|
|
637
|
+
* Spec §3.4. `width%` → px of the canvas width; height follows the image's
|
|
638
|
+
* aspect unless `height%` is set; nine anchors; x/y are additive offsets in %
|
|
639
|
+
* of the canvas. An aspect-following box taller than the canvas is fitted
|
|
640
|
+
* inside it (both sides scaled, aspect kept) — so `drawn` never exceeds the
|
|
641
|
+
* canvas, which is what bounds the sharp pre-fit at one canvas of RGBA. `fit`:
|
|
642
|
+
* contain → the image scaled inside the box, centred; cover → the box itself.
|
|
643
|
+
* The only post-processing is rounding `drawn` DOWN to even, floored at 2 × 2.
|
|
644
|
+
* Differences from Image Overlay's copies (on purpose): no 8192 edge shrink,
|
|
645
|
+
* the canvas clamp, the even rounding.
|
|
646
|
+
*/
|
|
647
|
+
declare function resolveVideoOverlayGeometry(canvas: VideoOverlayCanvas, layer: Pick<VideoOverlayLayer, "anchor" | "x" | "y" | "width" | "height" | "fit">, imageAspect: number): VideoOverlayGeometry;
|
|
648
|
+
interface VideoOverlayIssue {
|
|
649
|
+
readonly ok: false;
|
|
650
|
+
readonly code: VideoOverlayErrorCode;
|
|
651
|
+
/** 0-based index into the validated `layers[]`. */
|
|
652
|
+
readonly layer?: number;
|
|
653
|
+
readonly slot?: number;
|
|
654
|
+
readonly planLayer?: number;
|
|
655
|
+
readonly params: Readonly<Record<string, string | number>>;
|
|
656
|
+
}
|
|
657
|
+
type VideoOverlayValidation = {
|
|
658
|
+
readonly ok: true;
|
|
659
|
+
} | VideoOverlayIssue;
|
|
660
|
+
interface VideoOverlayValidationInput {
|
|
661
|
+
readonly layers?: ReadonlyArray<VideoOverlayLayerInput | null | undefined> | null;
|
|
662
|
+
readonly outputAspect?: string | null;
|
|
663
|
+
readonly baseFit?: string | null;
|
|
664
|
+
readonly backgroundColor?: string | null;
|
|
665
|
+
/** From `assembleVideoOverlayRequest`: the wired layer plan was unreadable. */
|
|
666
|
+
readonly planError?: "invalid_layer_plan";
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Can `resolveVideoOverlayGeometry` place this layer? True when its box is what
|
|
670
|
+
* the validator's box checks require: `anchor` one of the nine anchors, `width`
|
|
671
|
+
* a finite number, and every present box / look field in range
|
|
672
|
+
* (`VIDEO_OVERLAY_BOUNDS`, enums). A partial box saved from workflow JSON
|
|
673
|
+
* (`{ imageUrl, start, width }`, `anchor: null`) is stored as written — the
|
|
674
|
+
* expansion leaves it for the validator's `incomplete_box` — so any reader
|
|
675
|
+
* that DRAWS a stored layer (the canvas stage) must skip one that fails this;
|
|
676
|
+
* the geometry would throw on it.
|
|
677
|
+
*/
|
|
678
|
+
declare function hasDrawableVideoOverlayBox(layer: unknown): boolean;
|
|
679
|
+
/**
|
|
680
|
+
* Spec §3.5 — what a schema cannot express, and what the DAG path skips. Run
|
|
681
|
+
* at every engine entry: the route (`.superRefine`, before the expansion), the
|
|
682
|
+
* canvas single-node run, payload-builder and the worker (after it) — the
|
|
683
|
+
* verdict is the same on either side of the expansion (no code reads an
|
|
684
|
+
* expanded field). Also refuses a PRESENT box / look field outside
|
|
685
|
+
* `VIDEO_OVERLAY_BOUNDS` or its enum / type (`field_out_of_bounds`, spec §4.4's
|
|
686
|
+
* "out-of-bounds box/opacity/zIndex" row — on the DAG path this validator is
|
|
687
|
+
* the only check). A non-object `layers[]` entry reads as an empty layer. The
|
|
688
|
+
* FIRST failure, as a code.
|
|
689
|
+
*/
|
|
690
|
+
declare function validateVideoOverlayRequest(body: VideoOverlayValidationInput): VideoOverlayValidation;
|
|
691
|
+
/** `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. */
|
|
692
|
+
declare function videoOverlayLayerLabel(ref: {
|
|
693
|
+
readonly layer?: number;
|
|
694
|
+
readonly slot?: number;
|
|
695
|
+
readonly planLayer?: number;
|
|
696
|
+
}): string;
|
|
697
|
+
/** The ONE English rendering of a verdict — the route's 400 text and the worker's error message. */
|
|
698
|
+
declare function formatVideoOverlayError(issue: VideoOverlayIssue): string;
|
|
699
|
+
/** The wired `layerPlan` value (a JSON string or an array) → its layers, or `invalid_layer_plan`. */
|
|
700
|
+
declare function parseVideoOverlayLayerPlan(raw: unknown): {
|
|
701
|
+
layers: VideoOverlayLayerInput[];
|
|
702
|
+
} | {
|
|
703
|
+
error: "invalid_layer_plan";
|
|
704
|
+
};
|
|
705
|
+
/** The node-data fields the assembly reads. */
|
|
706
|
+
interface VideoOverlayNodeFields {
|
|
707
|
+
readonly layers?: ReadonlyArray<VideoOverlayLayerInput | null | undefined> | null;
|
|
708
|
+
readonly outputAspect?: string | null;
|
|
709
|
+
readonly baseFit?: string | null;
|
|
710
|
+
readonly backgroundColor?: string | null;
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* The ONE node → request assembly, called by the canvas single-node run AND
|
|
714
|
+
* payload-builder (so both engines refuse identically). Per slot i over
|
|
715
|
+
* max(wired handles (≤ 12), stored layers) — every stored slot, so more than
|
|
716
|
+
* 20 layers that render reach the validator's `too_many_layers` instead of
|
|
717
|
+
* being dropped: the image is the wired handle's,
|
|
718
|
+
* else the layer's own `imageUrl`; a slot with neither is dropped; a slot with
|
|
719
|
+
* no settings is the default layer (D2 — a `null` / missing / `{}` entry);
|
|
720
|
+
* `slot = i + 1` is stamped; the layer is expanded. `baseFit` /
|
|
721
|
+
* `backgroundColor` ride as stored, WITH or WITHOUT an `outputAspect`: the
|
|
722
|
+
* validator — not this assembly — refuses them without one
|
|
723
|
+
* (`fit_without_aspect`, spec §3.5), so a JSON-written node carrying a fit
|
|
724
|
+
* and no aspect is refused on both engines instead of silently rendering.
|
|
725
|
+
* (The canvas never builds that request: its two aspect writers clear both
|
|
726
|
+
* fields with the aspect.) A value the route's schema would reject — an
|
|
727
|
+
* unknown aspect or fit, a colour that is not `#rrggbb` — is dropped here.
|
|
728
|
+
*
|
|
729
|
+
* A wired layer plan (`planLayers`, a JSON string or an array) contributes its
|
|
730
|
+
* layers FIRST, then the slot layers: plan layers carry `planLayer` (1-based)
|
|
731
|
+
* and never a `slot`, and a plan layer's image is only its own `imageUrl` —
|
|
732
|
+
* never the index-aligned handle's (R18). An unreadable plan sets `planError`,
|
|
733
|
+
* which the validator reports before anything else.
|
|
734
|
+
*/
|
|
735
|
+
declare function assembleVideoOverlayRequest(input: {
|
|
736
|
+
readonly videoUrl: string;
|
|
737
|
+
readonly data: VideoOverlayNodeFields;
|
|
738
|
+
readonly wiredImageUrls: ReadonlyArray<string | null | undefined>;
|
|
739
|
+
/** The wired `layerPlan` value (string or array); absent when nothing is wired. */
|
|
740
|
+
readonly planLayers?: unknown;
|
|
741
|
+
}): ExpandedVideoOverlayRequest;
|
|
742
|
+
/**
|
|
743
|
+
* Slot i's image: the wired handle's, else the layer's own `imageUrl` — the
|
|
744
|
+
* one source rule the stage, the panel, the canvas executor and the DAG
|
|
745
|
+
* payload share (the render's merge is the same `wired ?? imageUrl`, spec
|
|
746
|
+
* §3.5). Every stored slot, past 20 too: the limit is the layer COUNT, not
|
|
747
|
+
* the slot (layers 1–4 removed from a 24-layer node leave 20 at slots 5–24).
|
|
748
|
+
* Only the wired list is capped, at the 12 handles.
|
|
749
|
+
*/
|
|
750
|
+
declare function videoOverlaySlotSources(layers: ReadonlyArray<VideoOverlayLayerInput | null | undefined> | null | undefined, wiredImageUrls: ReadonlyArray<string | null | undefined>): Array<string | undefined>;
|
|
751
|
+
/** Everything that decides what a Video Overlay run paints. */
|
|
752
|
+
interface VideoOverlayComposition {
|
|
753
|
+
/** The resolved base video URL. */
|
|
754
|
+
readonly baseUrl?: string | null;
|
|
755
|
+
/** The image each slot draws, by slot index (`videoOverlaySlotSources`). */
|
|
756
|
+
readonly sources: ReadonlyArray<string | null | undefined>;
|
|
757
|
+
/** The node's stored settings — never the expanded request. */
|
|
758
|
+
readonly data: VideoOverlayNodeFields;
|
|
759
|
+
/** The wired `layerPlan` value (string or array); absent when nothing is wired. */
|
|
760
|
+
readonly planLayers?: unknown;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* The longest `resultCompositionKey` the REST route accepts. The canvas sends
|
|
764
|
+
* its key with a single-node Run so the job's output_data carries it (a result
|
|
765
|
+
* that lands after a page reload reads fresh); the route stores it opaquely and
|
|
766
|
+
* reads it for nothing else. A full 20-layer composition with long signed URLs
|
|
767
|
+
* fits well inside; a canvas key past it is not sent.
|
|
768
|
+
*/
|
|
769
|
+
declare const VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH = 65536;
|
|
770
|
+
/**
|
|
771
|
+
* The composition key a run stamps on its result (`resultCompositionKey`): the
|
|
772
|
+
* base, every slot's image, the layers, the output aspect, the fit and the pad
|
|
773
|
+
* colour. A later change to any of them marks the result "Result (old)".
|
|
774
|
+
* Canonical — independent of object key order, of absent vs undefined vs null
|
|
775
|
+
* fields, and of trailing empty slots — so the canvas (the node and its
|
|
776
|
+
* single-node Run) and the DAG payload give one key for one composition.
|
|
777
|
+
*/
|
|
778
|
+
declare function videoOverlayCompositionKey(c: VideoOverlayComposition): string;
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Video-analysis node — shared data contract.
|
|
782
|
+
*
|
|
783
|
+
* Single source of truth for the video-analysis node: the backend worker, the
|
|
784
|
+
* frontend, and a future generator all import from here. Two schema layers:
|
|
785
|
+
* - `windowAnalysisSchema` — what the LLM emits per analysis window
|
|
786
|
+
* (strict-JSON footer). `scenes` has NO min (a quiet window returning zero
|
|
787
|
+
* scenes is a VALID result). Model-emitted `oversized`/`slotRefs` are
|
|
788
|
+
* STRIPPED here — they are validator-computed later (z.object drops unknown
|
|
789
|
+
* keys by default).
|
|
790
|
+
* - `videoAnalysisResultSchema` — the merged, validator-computed result across
|
|
791
|
+
* all windows; requires >=1 scene overall.
|
|
792
|
+
*
|
|
793
|
+
* Entity slots are referenced in scene `visual` text via `{slot:<id>}` tokens
|
|
794
|
+
* (`SLOT_TOKEN_RE`) — a grammar distinct from `NODE_REF_PATTERN` and the
|
|
795
|
+
* `{image:N}` reference tokens. Unresolved tokens UNWRAP to their literal id
|
|
796
|
+
* text, never delete (spec invariant), so a downstream prompt never carries a
|
|
797
|
+
* dangling `{slot:…}` placeholder.
|
|
798
|
+
*/
|
|
799
|
+
|
|
800
|
+
declare const VIDEO_ANALYSIS_MAX_SCENE_SEC = 8;
|
|
801
|
+
/**
|
|
802
|
+
* Camera VIEWPOINT — where the camera is relative to the subject. The axis
|
|
803
|
+
* `shotType` does not carry, and the one the analyzer had been improvising.
|
|
804
|
+
*
|
|
805
|
+
* Two failures this fixes, both from real jobs:
|
|
806
|
+
*
|
|
807
|
+
* 1. `shotType` is framing SIZE (Wide … Extreme Close-Up), so a true angle had
|
|
808
|
+
* nowhere to go and landed in the MOVEMENT field instead:
|
|
809
|
+
* `"camera": "low angle static"`. That loses the angle to anything reading
|
|
810
|
+
* `camera` and pollutes the movement vocabulary.
|
|
811
|
+
* 2. The relational viewpoints — `Over-the-Shoulder`, `POV` — were conventions
|
|
812
|
+
* inside the `shotType` list, competing with the sizes for one slot. So an
|
|
813
|
+
* over-the-shoulder MEDIUM had to pick one and threw the other away. They
|
|
814
|
+
* belong here, leaving `shotType` free to state the size: an OTS medium is
|
|
815
|
+
* `shotType: "Medium"` + `angle: "over-the-shoulder"`, which is strictly more
|
|
816
|
+
* than either field could carry alone.
|
|
817
|
+
*
|
|
818
|
+
* A closed enum rather than free text precisely because improvisation is the
|
|
819
|
+
* failure being fixed. Absent means EYE-LEVEL — the overwhelming default, so
|
|
820
|
+
* omitting it costs nothing on most shots (the same "absence is the default"
|
|
821
|
+
* shape as `transitionOut` and appearance variations).
|
|
822
|
+
*
|
|
823
|
+
* `from-behind` and `over-the-shoulder` also carry real meaning downstream: a
|
|
824
|
+
* face is not visible in either, which is what auto-cast needs to know before
|
|
825
|
+
* choosing one as an identity reference.
|
|
826
|
+
*/
|
|
827
|
+
declare const VIDEO_ANALYSIS_SHOT_ANGLES: readonly ["eye-level", "low", "high", "overhead", "worms-eye", "dutch", "over-the-shoulder", "pov", "profile", "from-behind"];
|
|
828
|
+
type VideoAnalysisShotAngle = (typeof VIDEO_ANALYSIS_SHOT_ANGLES)[number];
|
|
829
|
+
/** Viewpoints in which the subject's FACE is not visible — so a frame shot this
|
|
830
|
+
* way is a poor identity reference however good its framing otherwise is. */
|
|
831
|
+
declare const VIDEO_ANALYSIS_FACELESS_ANGLES: ReadonlySet<string>;
|
|
832
|
+
/**
|
|
833
|
+
* Effects applied to the PICTURE of a shot. An array — a shot can be grainy and
|
|
834
|
+
* vignetted at once — and absent when the image is clean, which is most shots.
|
|
835
|
+
*
|
|
836
|
+
* Scoped deliberately to things done to the IMAGE, and NOT to compositing that
|
|
837
|
+
* asserts what is in the shot (picture-in-picture, split screen). That line
|
|
838
|
+
* matters: a real job invented `{slot:creator} overlay talking to camera` across
|
|
839
|
+
* nine scenes for a man who is never seen, so a field for "there is an inset of a
|
|
840
|
+
* person here" would hand that fabrication a legitimate home. An effect is
|
|
841
|
+
* verifiable in the pixels; a claim about who is inset is not.
|
|
842
|
+
*
|
|
843
|
+
* `dissolve` and `fade` are NOT here either — they are edits BETWEEN shots and
|
|
844
|
+
* belong to `transitionOut`.
|
|
845
|
+
*/
|
|
846
|
+
declare const VIDEO_ANALYSIS_VISUAL_EFFECTS: readonly ["blur", "pixelate", "glitch", "grain", "vignette", "flash", "distortion", "double-exposure"];
|
|
847
|
+
type VideoAnalysisVisualEffect = (typeof VIDEO_ANALYSIS_VISUAL_EFFECTS)[number];
|
|
848
|
+
/**
|
|
849
|
+
* Visible edit INTO the next shot.
|
|
850
|
+
*
|
|
851
|
+
* `dissolve` (a cross-fade from one image to the other) is distinct from `fade`
|
|
852
|
+
* (through black or white). Collapsing both onto `fade` — as this enum did — makes
|
|
853
|
+
* a recreation render the wrong edit, and the two look nothing alike.
|
|
854
|
+
*
|
|
855
|
+
* ABSENT means NOTHING ASSERTED (since v2): the analyser emits a value only
|
|
856
|
+
* when it can see the device; an unknown or uncertain edit is left out so the
|
|
857
|
+
* video model chooses. `cut` is itself an assertion (an instant change between
|
|
858
|
+
* two clearly different shots), never a default.
|
|
859
|
+
*/
|
|
860
|
+
declare const VIDEO_ANALYSIS_TRANSITIONS: readonly ["cut", "fade", "dissolve", "wipe", "whip", "zoom", "slide", "white-flash", "digital-glitch", "morph", "match", "jump"];
|
|
861
|
+
type VideoAnalysisTransition = (typeof VIDEO_ANALYSIS_TRANSITIONS)[number];
|
|
862
|
+
/**
|
|
863
|
+
* What burned-in text IS (2026-08-28, recast shot craft). Decides render-vs-omit
|
|
864
|
+
* downstream: a `subtitle` is a transcription of the piece's own speech — a
|
|
865
|
+
* recreation re-speaks it and must not render it — while a `title`, `caption`,
|
|
866
|
+
* `lower-third` or `logo` is picture content. Absent when a scene carries no
|
|
867
|
+
* text. A new KEY on the scene: strip-mode readers drop it harmlessly.
|
|
868
|
+
*/
|
|
869
|
+
declare const VIDEO_ANALYSIS_TEXT_KINDS: readonly ["title", "caption", "lower-third", "subtitle", "logo", "other"];
|
|
870
|
+
type VideoAnalysisTextKind = (typeof VIDEO_ANALYSIS_TEXT_KINDS)[number];
|
|
871
|
+
/** How the CLIP opens (clip-level, not per scene — a window's first scene is
|
|
872
|
+
* not the clip's). Absent ⇒ a hard open. Only `fade` today. */
|
|
873
|
+
declare const VIDEO_ANALYSIS_CLIP_TRANSITIONS_IN: readonly ["fade"];
|
|
874
|
+
type VideoAnalysisClipTransitionIn = (typeof VIDEO_ANALYSIS_CLIP_TRANSITIONS_IN)[number];
|
|
875
|
+
/**
|
|
876
|
+
* Time manipulation — slow motion, ramps, timelapse, freeze, reverse.
|
|
877
|
+
*
|
|
878
|
+
* Previously unrepresentable anywhere in the schema, so a recreation rendered
|
|
879
|
+
* every shot at normal speed no matter what the footage did. It is a first-class
|
|
880
|
+
* lever in every video model and a real editing decision in most action footage.
|
|
881
|
+
*
|
|
882
|
+
* `"normal"` is deliberately NOT a member: absence is normal speed, so there is
|
|
883
|
+
* exactly one way to say "nothing unusual here" and the field costs nothing on
|
|
884
|
+
* the majority of shots.
|
|
885
|
+
*/
|
|
886
|
+
declare const VIDEO_ANALYSIS_SPEED_EFFECTS: readonly ["slow-motion", "ramp-in", "ramp-out", "timelapse", "freeze", "reverse"];
|
|
887
|
+
/** CHRONICLE TIME (2026-08-17): the STORY clock, per scene, as read from the
|
|
888
|
+
* pictures — light, sky, practicals. "ambiguous" is the honest answer for a
|
|
889
|
+
* windowless interior; guessing day is exactly the kind of tidy inference
|
|
890
|
+
* the analysis doctrine forbids. */
|
|
891
|
+
declare const VIDEO_ANALYSIS_TIMES_OF_DAY: readonly ["dawn", "day", "dusk", "night", "ambiguous"];
|
|
892
|
+
/** STORY JUMP since the PREVIOUS scene in the list: how much narrative time
|
|
893
|
+
* passed across the cut, judged from evidence (wardrobe change, aged
|
|
894
|
+
* subjects, season, a title card), not from the cut itself. Time outranks
|
|
895
|
+
* location for continuity judgements (same person, new place, continuous
|
|
896
|
+
* time ⇒ same outfit; same place, years later ⇒ anything may differ), which
|
|
897
|
+
* is why this is a structured field and not prose. "unclear" is the honest
|
|
898
|
+
* default; the FIRST scene of a clip is "continuous" by convention. */
|
|
899
|
+
declare const VIDEO_ANALYSIS_STORY_JUMPS: readonly ["continuous", "same-day", "another-day", "years-later", "unclear"];
|
|
900
|
+
type VideoAnalysisSpeedEffect = (typeof VIDEO_ANALYSIS_SPEED_EFFECTS)[number];
|
|
901
|
+
/**
|
|
902
|
+
* The CLIP-LEVEL look — one source of truth for the properties that belong to
|
|
903
|
+
* the whole piece rather than any one shot.
|
|
904
|
+
*
|
|
905
|
+
* Colour grade, camera format and lens character were previously only ever prose
|
|
906
|
+
* inside each scene's `visual`, which meant a 43-scene analysis re-decided the
|
|
907
|
+
* grade forty-three independent times with nothing holding them consistent. That
|
|
908
|
+
* is the same drift problem entity slots solve for people: state it once, apply it
|
|
909
|
+
* everywhere. A recreation reads this alongside every scene.
|
|
910
|
+
*
|
|
911
|
+
* Every field optional — an analyzer that cannot read the format should say
|
|
912
|
+
* nothing rather than guess, and a per-scene deviation still belongs in that
|
|
913
|
+
* scene's `visual` prose.
|
|
914
|
+
*/
|
|
915
|
+
declare const clipLookSchema: z.ZodObject<{
|
|
916
|
+
style: z.ZodOptional<z.ZodString>;
|
|
917
|
+
styleId: z.ZodOptional<z.ZodString>;
|
|
918
|
+
grade: z.ZodOptional<z.ZodString>;
|
|
919
|
+
format: z.ZodOptional<z.ZodString>;
|
|
920
|
+
lens: z.ZodOptional<z.ZodString>;
|
|
921
|
+
lighting: z.ZodOptional<z.ZodString>;
|
|
922
|
+
genre: z.ZodOptional<z.ZodString>;
|
|
923
|
+
influence: z.ZodOptional<z.ZodString>;
|
|
924
|
+
}, z.core.$strip>;
|
|
925
|
+
type ClipLook = z.infer<typeof clipLookSchema>;
|
|
926
|
+
declare const VIDEO_ANALYSIS_ENTITY_SOURCES: readonly ["wired-character", "wired-object", "wired-location", "wired-creature"];
|
|
927
|
+
type VideoAnalysisEntitySource = (typeof VIDEO_ANALYSIS_ENTITY_SOURCES)[number];
|
|
928
|
+
/** Matches {slot:<id>} tokens. Distinct from NODE_REF_PATTERN / {image:N} grammars. */
|
|
929
|
+
declare const SLOT_TOKEN_RE: RegExp;
|
|
930
|
+
/**
|
|
931
|
+
* Appearance variations (cast-variations spec, 2026-07-24): a slot's canonical
|
|
932
|
+
* `description` IS its default look; `variations` enumerates NON-default looks
|
|
933
|
+
* only (dream vs reality, flashback, disguise…). `"default"` is a reserved
|
|
934
|
+
* variationId — used in scene bindings / ledger keys / routing for unbound
|
|
935
|
+
* scenes, never inside `variations[]`. The closed slug vocabulary is
|
|
936
|
+
* doctrine-enforced (the schema pins only the id charset, like `role`);
|
|
937
|
+
* `alt-1`/`alt-2` are the escape hatches.
|
|
938
|
+
*/
|
|
939
|
+
declare const VIDEO_ANALYSIS_VARIATION_SLUGS: readonly ["dream", "flashback", "disguise", "costume", "transformation", "era", "alt-1", "alt-2"];
|
|
940
|
+
/** Max NON-default looks per slot. The window layer REJECTS past the cap (schema-forced retry); the cross-window merge FOLDS at the cap. */
|
|
941
|
+
declare const VIDEO_ANALYSIS_MAX_VARIATIONS = 4;
|
|
942
|
+
declare const VIDEO_ANALYSIS_DEFAULT_VARIATION = "default";
|
|
943
|
+
declare const slotVariationSchema: z.ZodObject<{
|
|
944
|
+
variationId: z.ZodString;
|
|
945
|
+
label: z.ZodString;
|
|
946
|
+
description: z.ZodString;
|
|
947
|
+
refImageUrl: z.ZodOptional<z.ZodString>;
|
|
948
|
+
}, z.core.$strip>;
|
|
949
|
+
type SlotVariation = z.infer<typeof slotVariationSchema>;
|
|
950
|
+
declare const entitySlotSchema: z.ZodObject<{
|
|
951
|
+
slotId: z.ZodString;
|
|
952
|
+
label: z.ZodString;
|
|
953
|
+
source: z.ZodEnum<{
|
|
954
|
+
"wired-character": "wired-character";
|
|
955
|
+
"wired-object": "wired-object";
|
|
956
|
+
"wired-creature": "wired-creature";
|
|
957
|
+
"wired-location": "wired-location";
|
|
958
|
+
}>;
|
|
959
|
+
role: z.ZodString;
|
|
960
|
+
description: z.ZodString;
|
|
961
|
+
refImageUrl: z.ZodOptional<z.ZodString>;
|
|
962
|
+
refRejectedReason: z.ZodOptional<z.ZodString>;
|
|
963
|
+
variations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
964
|
+
variationId: z.ZodString;
|
|
965
|
+
label: z.ZodString;
|
|
966
|
+
description: z.ZodString;
|
|
967
|
+
refImageUrl: z.ZodOptional<z.ZodString>;
|
|
968
|
+
}, z.core.$strip>>>;
|
|
969
|
+
owner: z.ZodOptional<z.ZodObject<{
|
|
970
|
+
slotId: z.ZodString;
|
|
971
|
+
relation: z.ZodString;
|
|
972
|
+
}, z.core.$strip>>;
|
|
973
|
+
}, z.core.$strip>;
|
|
974
|
+
type EntitySlot = z.infer<typeof entitySlotSchema>;
|
|
975
|
+
type EntitySlotOwner = NonNullable<EntitySlot["owner"]>;
|
|
976
|
+
/**
|
|
977
|
+
* The sound LAYER vocabulary — what kind of thing this layer is.
|
|
978
|
+
*
|
|
979
|
+
* `ambience` is deliberately its own member rather than a flavour of `sfx`:
|
|
980
|
+
* they are different layers of a real mix and they are recreated by different
|
|
981
|
+
* means — ambience is the continuous bed a scene sits in (room tone, distant
|
|
982
|
+
* traffic, wind), an sfx is a discrete hit (a door slam, a gunshot). Folded
|
|
983
|
+
* together, a scene's bed and its one-off noises arrive indistinguishable and
|
|
984
|
+
* anything recreating the mix has to guess which it was told.
|
|
985
|
+
*
|
|
986
|
+
* Exported so a consumer keying its own document by these modes imports the
|
|
987
|
+
* vocabulary instead of restating it — the same reason every other closed
|
|
988
|
+
* vocabulary in this file is a const.
|
|
989
|
+
*/
|
|
990
|
+
declare const VIDEO_ANALYSIS_AUDIO_MODES: readonly ["speech", "music", "sfx", "ambience"];
|
|
991
|
+
type VideoAnalysisAudioMode = (typeof VIDEO_ANALYSIS_AUDIO_MODES)[number];
|
|
992
|
+
/**
|
|
993
|
+
* One concurrent sound layer in a scene. Real footage stacks sound (music bed
|
|
994
|
+
* under dialogue over ambient room tone), so a scene carries an ARRAY of these
|
|
995
|
+
* — an empty array means genuine silence. `content`: speech = verbatim words;
|
|
996
|
+
* music/sfx/ambience = gen-ready description. `voice` is speech-only
|
|
997
|
+
* voice-casting.
|
|
998
|
+
*/
|
|
999
|
+
declare const audioLayerSchema: z.ZodObject<{
|
|
1000
|
+
mode: z.ZodEnum<{
|
|
1001
|
+
music: "music";
|
|
1002
|
+
sfx: "sfx";
|
|
1003
|
+
speech: "speech";
|
|
1004
|
+
ambience: "ambience";
|
|
1005
|
+
}>;
|
|
1006
|
+
content: z.ZodString;
|
|
1007
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
1008
|
+
speakerSlot: z.ZodOptional<z.ZodString>;
|
|
1009
|
+
speaker: z.ZodOptional<z.ZodString>;
|
|
1010
|
+
}, z.core.$strip>;
|
|
1011
|
+
type AudioLayer = z.infer<typeof audioLayerSchema>;
|
|
1012
|
+
declare const windowSceneSchema: z.ZodObject<{
|
|
1013
|
+
startSec: z.ZodNumber;
|
|
1014
|
+
endSec: z.ZodNumber;
|
|
1015
|
+
label: z.ZodString;
|
|
1016
|
+
shotType: z.ZodString;
|
|
1017
|
+
camera: z.ZodString;
|
|
1018
|
+
angle: z.ZodOptional<z.ZodEnum<{
|
|
1019
|
+
"eye-level": "eye-level";
|
|
1020
|
+
high: "high";
|
|
1021
|
+
low: "low";
|
|
1022
|
+
pov: "pov";
|
|
1023
|
+
dutch: "dutch";
|
|
1024
|
+
profile: "profile";
|
|
1025
|
+
overhead: "overhead";
|
|
1026
|
+
"worms-eye": "worms-eye";
|
|
1027
|
+
"over-the-shoulder": "over-the-shoulder";
|
|
1028
|
+
"from-behind": "from-behind";
|
|
1029
|
+
}>>;
|
|
1030
|
+
speed: z.ZodOptional<z.ZodEnum<{
|
|
1031
|
+
reverse: "reverse";
|
|
1032
|
+
"slow-motion": "slow-motion";
|
|
1033
|
+
"ramp-in": "ramp-in";
|
|
1034
|
+
"ramp-out": "ramp-out";
|
|
1035
|
+
timelapse: "timelapse";
|
|
1036
|
+
freeze: "freeze";
|
|
1037
|
+
}>>;
|
|
1038
|
+
timeOfDay: z.ZodOptional<z.ZodEnum<{
|
|
1039
|
+
night: "night";
|
|
1040
|
+
dawn: "dawn";
|
|
1041
|
+
dusk: "dusk";
|
|
1042
|
+
day: "day";
|
|
1043
|
+
ambiguous: "ambiguous";
|
|
1044
|
+
}>>;
|
|
1045
|
+
storyJump: z.ZodOptional<z.ZodEnum<{
|
|
1046
|
+
continuous: "continuous";
|
|
1047
|
+
"same-day": "same-day";
|
|
1048
|
+
"another-day": "another-day";
|
|
1049
|
+
"years-later": "years-later";
|
|
1050
|
+
unclear: "unclear";
|
|
1051
|
+
}>>;
|
|
1052
|
+
visual: z.ZodString;
|
|
1053
|
+
onScreenText: z.ZodOptional<z.ZodString>;
|
|
1054
|
+
onScreenTextKind: z.ZodOptional<z.ZodEnum<{
|
|
1055
|
+
other: "other";
|
|
1056
|
+
logo: "logo";
|
|
1057
|
+
title: "title";
|
|
1058
|
+
subtitle: "subtitle";
|
|
1059
|
+
caption: "caption";
|
|
1060
|
+
"lower-third": "lower-third";
|
|
1061
|
+
}>>;
|
|
1062
|
+
effects: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1063
|
+
blur: "blur";
|
|
1064
|
+
pixelate: "pixelate";
|
|
1065
|
+
glitch: "glitch";
|
|
1066
|
+
grain: "grain";
|
|
1067
|
+
vignette: "vignette";
|
|
1068
|
+
flash: "flash";
|
|
1069
|
+
distortion: "distortion";
|
|
1070
|
+
"double-exposure": "double-exposure";
|
|
1071
|
+
}>>>;
|
|
1072
|
+
transitionOut: z.ZodOptional<z.ZodEnum<{
|
|
1073
|
+
match: "match";
|
|
1074
|
+
cut: "cut";
|
|
1075
|
+
fade: "fade";
|
|
1076
|
+
dissolve: "dissolve";
|
|
1077
|
+
wipe: "wipe";
|
|
1078
|
+
zoom: "zoom";
|
|
1079
|
+
whip: "whip";
|
|
1080
|
+
slide: "slide";
|
|
1081
|
+
"white-flash": "white-flash";
|
|
1082
|
+
"digital-glitch": "digital-glitch";
|
|
1083
|
+
morph: "morph";
|
|
1084
|
+
jump: "jump";
|
|
1085
|
+
}>>;
|
|
1086
|
+
transition: z.ZodOptional<z.ZodString>;
|
|
1087
|
+
audio: z.ZodArray<z.ZodObject<{
|
|
1088
|
+
mode: z.ZodEnum<{
|
|
1089
|
+
music: "music";
|
|
1090
|
+
sfx: "sfx";
|
|
1091
|
+
speech: "speech";
|
|
1092
|
+
ambience: "ambience";
|
|
1093
|
+
}>;
|
|
1094
|
+
content: z.ZodString;
|
|
1095
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
1096
|
+
speakerSlot: z.ZodOptional<z.ZodString>;
|
|
1097
|
+
speaker: z.ZodOptional<z.ZodString>;
|
|
1098
|
+
}, z.core.$strip>>;
|
|
1099
|
+
slotVariations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1100
|
+
}, z.core.$strip>;
|
|
1101
|
+
type WindowScene = z.infer<typeof windowSceneSchema>;
|
|
1102
|
+
/** What the MODEL emits per window (strict-JSON footer schema). scenes has NO min. */
|
|
1103
|
+
declare const windowAnalysisSchema: z.ZodObject<{
|
|
1104
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1105
|
+
look: z.ZodOptional<z.ZodObject<{
|
|
1106
|
+
style: z.ZodOptional<z.ZodString>;
|
|
1107
|
+
styleId: z.ZodOptional<z.ZodString>;
|
|
1108
|
+
grade: z.ZodOptional<z.ZodString>;
|
|
1109
|
+
format: z.ZodOptional<z.ZodString>;
|
|
1110
|
+
lens: z.ZodOptional<z.ZodString>;
|
|
1111
|
+
lighting: z.ZodOptional<z.ZodString>;
|
|
1112
|
+
genre: z.ZodOptional<z.ZodString>;
|
|
1113
|
+
influence: z.ZodOptional<z.ZodString>;
|
|
1114
|
+
}, z.core.$strip>>;
|
|
1115
|
+
transitionIn: z.ZodOptional<z.ZodEnum<{
|
|
1116
|
+
fade: "fade";
|
|
1117
|
+
}>>;
|
|
1118
|
+
slots: z.ZodArray<z.ZodObject<{
|
|
1119
|
+
slotId: z.ZodString;
|
|
1120
|
+
label: z.ZodString;
|
|
1121
|
+
source: z.ZodEnum<{
|
|
1122
|
+
"wired-character": "wired-character";
|
|
1123
|
+
"wired-object": "wired-object";
|
|
1124
|
+
"wired-creature": "wired-creature";
|
|
1125
|
+
"wired-location": "wired-location";
|
|
1126
|
+
}>;
|
|
1127
|
+
role: z.ZodString;
|
|
1128
|
+
description: z.ZodString;
|
|
1129
|
+
refImageUrl: z.ZodOptional<z.ZodString>;
|
|
1130
|
+
refRejectedReason: z.ZodOptional<z.ZodString>;
|
|
1131
|
+
variations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1132
|
+
variationId: z.ZodString;
|
|
1133
|
+
label: z.ZodString;
|
|
1134
|
+
description: z.ZodString;
|
|
1135
|
+
refImageUrl: z.ZodOptional<z.ZodString>;
|
|
1136
|
+
}, z.core.$strip>>>;
|
|
1137
|
+
owner: z.ZodOptional<z.ZodObject<{
|
|
1138
|
+
slotId: z.ZodString;
|
|
1139
|
+
relation: z.ZodString;
|
|
1140
|
+
}, z.core.$strip>>;
|
|
1141
|
+
}, z.core.$strip>>;
|
|
1142
|
+
scenes: z.ZodArray<z.ZodObject<{
|
|
1143
|
+
startSec: z.ZodNumber;
|
|
1144
|
+
endSec: z.ZodNumber;
|
|
1145
|
+
label: z.ZodString;
|
|
1146
|
+
shotType: z.ZodString;
|
|
1147
|
+
camera: z.ZodString;
|
|
1148
|
+
angle: z.ZodOptional<z.ZodEnum<{
|
|
1149
|
+
"eye-level": "eye-level";
|
|
1150
|
+
high: "high";
|
|
1151
|
+
low: "low";
|
|
1152
|
+
pov: "pov";
|
|
1153
|
+
dutch: "dutch";
|
|
1154
|
+
profile: "profile";
|
|
1155
|
+
overhead: "overhead";
|
|
1156
|
+
"worms-eye": "worms-eye";
|
|
1157
|
+
"over-the-shoulder": "over-the-shoulder";
|
|
1158
|
+
"from-behind": "from-behind";
|
|
1159
|
+
}>>;
|
|
1160
|
+
speed: z.ZodOptional<z.ZodEnum<{
|
|
1161
|
+
reverse: "reverse";
|
|
1162
|
+
"slow-motion": "slow-motion";
|
|
1163
|
+
"ramp-in": "ramp-in";
|
|
1164
|
+
"ramp-out": "ramp-out";
|
|
1165
|
+
timelapse: "timelapse";
|
|
1166
|
+
freeze: "freeze";
|
|
1167
|
+
}>>;
|
|
1168
|
+
timeOfDay: z.ZodOptional<z.ZodEnum<{
|
|
1169
|
+
night: "night";
|
|
1170
|
+
dawn: "dawn";
|
|
1171
|
+
dusk: "dusk";
|
|
1172
|
+
day: "day";
|
|
1173
|
+
ambiguous: "ambiguous";
|
|
1174
|
+
}>>;
|
|
1175
|
+
storyJump: z.ZodOptional<z.ZodEnum<{
|
|
1176
|
+
continuous: "continuous";
|
|
1177
|
+
"same-day": "same-day";
|
|
1178
|
+
"another-day": "another-day";
|
|
1179
|
+
"years-later": "years-later";
|
|
1180
|
+
unclear: "unclear";
|
|
1181
|
+
}>>;
|
|
1182
|
+
visual: z.ZodString;
|
|
1183
|
+
onScreenText: z.ZodOptional<z.ZodString>;
|
|
1184
|
+
onScreenTextKind: z.ZodOptional<z.ZodEnum<{
|
|
1185
|
+
other: "other";
|
|
1186
|
+
logo: "logo";
|
|
1187
|
+
title: "title";
|
|
1188
|
+
subtitle: "subtitle";
|
|
1189
|
+
caption: "caption";
|
|
1190
|
+
"lower-third": "lower-third";
|
|
1191
|
+
}>>;
|
|
1192
|
+
effects: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1193
|
+
blur: "blur";
|
|
1194
|
+
pixelate: "pixelate";
|
|
1195
|
+
glitch: "glitch";
|
|
1196
|
+
grain: "grain";
|
|
1197
|
+
vignette: "vignette";
|
|
1198
|
+
flash: "flash";
|
|
1199
|
+
distortion: "distortion";
|
|
1200
|
+
"double-exposure": "double-exposure";
|
|
1201
|
+
}>>>;
|
|
1202
|
+
transitionOut: z.ZodOptional<z.ZodEnum<{
|
|
1203
|
+
match: "match";
|
|
1204
|
+
cut: "cut";
|
|
1205
|
+
fade: "fade";
|
|
1206
|
+
dissolve: "dissolve";
|
|
1207
|
+
wipe: "wipe";
|
|
1208
|
+
zoom: "zoom";
|
|
1209
|
+
whip: "whip";
|
|
1210
|
+
slide: "slide";
|
|
1211
|
+
"white-flash": "white-flash";
|
|
1212
|
+
"digital-glitch": "digital-glitch";
|
|
1213
|
+
morph: "morph";
|
|
1214
|
+
jump: "jump";
|
|
1215
|
+
}>>;
|
|
1216
|
+
transition: z.ZodOptional<z.ZodString>;
|
|
1217
|
+
audio: z.ZodArray<z.ZodObject<{
|
|
1218
|
+
mode: z.ZodEnum<{
|
|
1219
|
+
music: "music";
|
|
1220
|
+
sfx: "sfx";
|
|
1221
|
+
speech: "speech";
|
|
1222
|
+
ambience: "ambience";
|
|
1223
|
+
}>;
|
|
1224
|
+
content: z.ZodString;
|
|
1225
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
1226
|
+
speakerSlot: z.ZodOptional<z.ZodString>;
|
|
1227
|
+
speaker: z.ZodOptional<z.ZodString>;
|
|
1228
|
+
}, z.core.$strip>>;
|
|
1229
|
+
slotVariations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1230
|
+
}, z.core.$strip>>;
|
|
1231
|
+
}, z.core.$strip>;
|
|
1232
|
+
type WindowAnalysis = z.infer<typeof windowAnalysisSchema>;
|
|
1233
|
+
declare const analyzedSceneSchema: z.ZodObject<{
|
|
1234
|
+
startSec: z.ZodNumber;
|
|
1235
|
+
endSec: z.ZodNumber;
|
|
1236
|
+
label: z.ZodString;
|
|
1237
|
+
shotType: z.ZodString;
|
|
1238
|
+
camera: z.ZodString;
|
|
1239
|
+
angle: z.ZodOptional<z.ZodEnum<{
|
|
1240
|
+
"eye-level": "eye-level";
|
|
1241
|
+
high: "high";
|
|
1242
|
+
low: "low";
|
|
1243
|
+
pov: "pov";
|
|
1244
|
+
dutch: "dutch";
|
|
1245
|
+
profile: "profile";
|
|
1246
|
+
overhead: "overhead";
|
|
1247
|
+
"worms-eye": "worms-eye";
|
|
1248
|
+
"over-the-shoulder": "over-the-shoulder";
|
|
1249
|
+
"from-behind": "from-behind";
|
|
1250
|
+
}>>;
|
|
1251
|
+
speed: z.ZodOptional<z.ZodEnum<{
|
|
1252
|
+
reverse: "reverse";
|
|
1253
|
+
"slow-motion": "slow-motion";
|
|
1254
|
+
"ramp-in": "ramp-in";
|
|
1255
|
+
"ramp-out": "ramp-out";
|
|
1256
|
+
timelapse: "timelapse";
|
|
1257
|
+
freeze: "freeze";
|
|
1258
|
+
}>>;
|
|
1259
|
+
timeOfDay: z.ZodOptional<z.ZodEnum<{
|
|
1260
|
+
night: "night";
|
|
1261
|
+
dawn: "dawn";
|
|
1262
|
+
dusk: "dusk";
|
|
1263
|
+
day: "day";
|
|
1264
|
+
ambiguous: "ambiguous";
|
|
1265
|
+
}>>;
|
|
1266
|
+
storyJump: z.ZodOptional<z.ZodEnum<{
|
|
1267
|
+
continuous: "continuous";
|
|
1268
|
+
"same-day": "same-day";
|
|
1269
|
+
"another-day": "another-day";
|
|
1270
|
+
"years-later": "years-later";
|
|
1271
|
+
unclear: "unclear";
|
|
1272
|
+
}>>;
|
|
1273
|
+
visual: z.ZodString;
|
|
1274
|
+
onScreenText: z.ZodOptional<z.ZodString>;
|
|
1275
|
+
onScreenTextKind: z.ZodOptional<z.ZodEnum<{
|
|
1276
|
+
other: "other";
|
|
1277
|
+
logo: "logo";
|
|
1278
|
+
title: "title";
|
|
1279
|
+
subtitle: "subtitle";
|
|
1280
|
+
caption: "caption";
|
|
1281
|
+
"lower-third": "lower-third";
|
|
1282
|
+
}>>;
|
|
1283
|
+
effects: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1284
|
+
blur: "blur";
|
|
1285
|
+
pixelate: "pixelate";
|
|
1286
|
+
glitch: "glitch";
|
|
1287
|
+
grain: "grain";
|
|
1288
|
+
vignette: "vignette";
|
|
1289
|
+
flash: "flash";
|
|
1290
|
+
distortion: "distortion";
|
|
1291
|
+
"double-exposure": "double-exposure";
|
|
1292
|
+
}>>>;
|
|
1293
|
+
transitionOut: z.ZodOptional<z.ZodEnum<{
|
|
1294
|
+
match: "match";
|
|
1295
|
+
cut: "cut";
|
|
1296
|
+
fade: "fade";
|
|
1297
|
+
dissolve: "dissolve";
|
|
1298
|
+
wipe: "wipe";
|
|
1299
|
+
zoom: "zoom";
|
|
1300
|
+
whip: "whip";
|
|
1301
|
+
slide: "slide";
|
|
1302
|
+
"white-flash": "white-flash";
|
|
1303
|
+
"digital-glitch": "digital-glitch";
|
|
1304
|
+
morph: "morph";
|
|
1305
|
+
jump: "jump";
|
|
1306
|
+
}>>;
|
|
1307
|
+
transition: z.ZodOptional<z.ZodString>;
|
|
1308
|
+
audio: z.ZodArray<z.ZodObject<{
|
|
1309
|
+
mode: z.ZodEnum<{
|
|
1310
|
+
music: "music";
|
|
1311
|
+
sfx: "sfx";
|
|
1312
|
+
speech: "speech";
|
|
1313
|
+
ambience: "ambience";
|
|
1314
|
+
}>;
|
|
1315
|
+
content: z.ZodString;
|
|
1316
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
1317
|
+
speakerSlot: z.ZodOptional<z.ZodString>;
|
|
1318
|
+
speaker: z.ZodOptional<z.ZodString>;
|
|
1319
|
+
}, z.core.$strip>>;
|
|
1320
|
+
slotVariations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1321
|
+
sceneNumber: z.ZodNumber;
|
|
1322
|
+
visualResolved: z.ZodString;
|
|
1323
|
+
oversized: z.ZodOptional<z.ZodBoolean>;
|
|
1324
|
+
slotRefs: z.ZodArray<z.ZodString>;
|
|
1325
|
+
}, z.core.$strip>;
|
|
1326
|
+
type AnalyzedScene = z.infer<typeof analyzedSceneSchema>;
|
|
1327
|
+
declare const videoAnalysisResultSchema: z.ZodObject<{
|
|
1328
|
+
meta: z.ZodObject<{
|
|
1329
|
+
durationSec: z.ZodNumber;
|
|
1330
|
+
width: z.ZodNumber;
|
|
1331
|
+
height: z.ZodNumber;
|
|
1332
|
+
aspectRatio: z.ZodString;
|
|
1333
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1334
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1335
|
+
}, z.core.$strip>;
|
|
1336
|
+
look: z.ZodOptional<z.ZodObject<{
|
|
1337
|
+
style: z.ZodOptional<z.ZodString>;
|
|
1338
|
+
styleId: z.ZodOptional<z.ZodString>;
|
|
1339
|
+
grade: z.ZodOptional<z.ZodString>;
|
|
1340
|
+
format: z.ZodOptional<z.ZodString>;
|
|
1341
|
+
lens: z.ZodOptional<z.ZodString>;
|
|
1342
|
+
lighting: z.ZodOptional<z.ZodString>;
|
|
1343
|
+
genre: z.ZodOptional<z.ZodString>;
|
|
1344
|
+
influence: z.ZodOptional<z.ZodString>;
|
|
1345
|
+
}, z.core.$strip>>;
|
|
1346
|
+
transitionIn: z.ZodOptional<z.ZodEnum<{
|
|
1347
|
+
fade: "fade";
|
|
1348
|
+
}>>;
|
|
1349
|
+
slots: z.ZodArray<z.ZodObject<{
|
|
1350
|
+
slotId: z.ZodString;
|
|
1351
|
+
label: z.ZodString;
|
|
1352
|
+
source: z.ZodEnum<{
|
|
1353
|
+
"wired-character": "wired-character";
|
|
1354
|
+
"wired-object": "wired-object";
|
|
1355
|
+
"wired-creature": "wired-creature";
|
|
1356
|
+
"wired-location": "wired-location";
|
|
1357
|
+
}>;
|
|
1358
|
+
role: z.ZodString;
|
|
1359
|
+
description: z.ZodString;
|
|
1360
|
+
refImageUrl: z.ZodOptional<z.ZodString>;
|
|
1361
|
+
refRejectedReason: z.ZodOptional<z.ZodString>;
|
|
1362
|
+
variations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1363
|
+
variationId: z.ZodString;
|
|
1364
|
+
label: z.ZodString;
|
|
1365
|
+
description: z.ZodString;
|
|
1366
|
+
refImageUrl: z.ZodOptional<z.ZodString>;
|
|
1367
|
+
}, z.core.$strip>>>;
|
|
1368
|
+
owner: z.ZodOptional<z.ZodObject<{
|
|
1369
|
+
slotId: z.ZodString;
|
|
1370
|
+
relation: z.ZodString;
|
|
1371
|
+
}, z.core.$strip>>;
|
|
1372
|
+
}, z.core.$strip>>;
|
|
1373
|
+
scenes: z.ZodArray<z.ZodObject<{
|
|
1374
|
+
startSec: z.ZodNumber;
|
|
1375
|
+
endSec: z.ZodNumber;
|
|
1376
|
+
label: z.ZodString;
|
|
1377
|
+
shotType: z.ZodString;
|
|
1378
|
+
camera: z.ZodString;
|
|
1379
|
+
angle: z.ZodOptional<z.ZodEnum<{
|
|
1380
|
+
"eye-level": "eye-level";
|
|
1381
|
+
high: "high";
|
|
1382
|
+
low: "low";
|
|
1383
|
+
pov: "pov";
|
|
1384
|
+
dutch: "dutch";
|
|
1385
|
+
profile: "profile";
|
|
1386
|
+
overhead: "overhead";
|
|
1387
|
+
"worms-eye": "worms-eye";
|
|
1388
|
+
"over-the-shoulder": "over-the-shoulder";
|
|
1389
|
+
"from-behind": "from-behind";
|
|
1390
|
+
}>>;
|
|
1391
|
+
speed: z.ZodOptional<z.ZodEnum<{
|
|
1392
|
+
reverse: "reverse";
|
|
1393
|
+
"slow-motion": "slow-motion";
|
|
1394
|
+
"ramp-in": "ramp-in";
|
|
1395
|
+
"ramp-out": "ramp-out";
|
|
1396
|
+
timelapse: "timelapse";
|
|
1397
|
+
freeze: "freeze";
|
|
1398
|
+
}>>;
|
|
1399
|
+
timeOfDay: z.ZodOptional<z.ZodEnum<{
|
|
1400
|
+
night: "night";
|
|
1401
|
+
dawn: "dawn";
|
|
1402
|
+
dusk: "dusk";
|
|
1403
|
+
day: "day";
|
|
1404
|
+
ambiguous: "ambiguous";
|
|
1405
|
+
}>>;
|
|
1406
|
+
storyJump: z.ZodOptional<z.ZodEnum<{
|
|
1407
|
+
continuous: "continuous";
|
|
1408
|
+
"same-day": "same-day";
|
|
1409
|
+
"another-day": "another-day";
|
|
1410
|
+
"years-later": "years-later";
|
|
1411
|
+
unclear: "unclear";
|
|
1412
|
+
}>>;
|
|
1413
|
+
visual: z.ZodString;
|
|
1414
|
+
onScreenText: z.ZodOptional<z.ZodString>;
|
|
1415
|
+
onScreenTextKind: z.ZodOptional<z.ZodEnum<{
|
|
1416
|
+
other: "other";
|
|
1417
|
+
logo: "logo";
|
|
1418
|
+
title: "title";
|
|
1419
|
+
subtitle: "subtitle";
|
|
1420
|
+
caption: "caption";
|
|
1421
|
+
"lower-third": "lower-third";
|
|
1422
|
+
}>>;
|
|
1423
|
+
effects: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1424
|
+
blur: "blur";
|
|
1425
|
+
pixelate: "pixelate";
|
|
1426
|
+
glitch: "glitch";
|
|
1427
|
+
grain: "grain";
|
|
1428
|
+
vignette: "vignette";
|
|
1429
|
+
flash: "flash";
|
|
1430
|
+
distortion: "distortion";
|
|
1431
|
+
"double-exposure": "double-exposure";
|
|
1432
|
+
}>>>;
|
|
1433
|
+
transitionOut: z.ZodOptional<z.ZodEnum<{
|
|
1434
|
+
match: "match";
|
|
1435
|
+
cut: "cut";
|
|
1436
|
+
fade: "fade";
|
|
1437
|
+
dissolve: "dissolve";
|
|
1438
|
+
wipe: "wipe";
|
|
1439
|
+
zoom: "zoom";
|
|
1440
|
+
whip: "whip";
|
|
1441
|
+
slide: "slide";
|
|
1442
|
+
"white-flash": "white-flash";
|
|
1443
|
+
"digital-glitch": "digital-glitch";
|
|
1444
|
+
morph: "morph";
|
|
1445
|
+
jump: "jump";
|
|
1446
|
+
}>>;
|
|
1447
|
+
transition: z.ZodOptional<z.ZodString>;
|
|
1448
|
+
audio: z.ZodArray<z.ZodObject<{
|
|
1449
|
+
mode: z.ZodEnum<{
|
|
1450
|
+
music: "music";
|
|
1451
|
+
sfx: "sfx";
|
|
1452
|
+
speech: "speech";
|
|
1453
|
+
ambience: "ambience";
|
|
1454
|
+
}>;
|
|
1455
|
+
content: z.ZodString;
|
|
1456
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
1457
|
+
speakerSlot: z.ZodOptional<z.ZodString>;
|
|
1458
|
+
speaker: z.ZodOptional<z.ZodString>;
|
|
1459
|
+
}, z.core.$strip>>;
|
|
1460
|
+
slotVariations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1461
|
+
sceneNumber: z.ZodNumber;
|
|
1462
|
+
visualResolved: z.ZodString;
|
|
1463
|
+
oversized: z.ZodOptional<z.ZodBoolean>;
|
|
1464
|
+
slotRefs: z.ZodArray<z.ZodString>;
|
|
1465
|
+
}, z.core.$strip>>;
|
|
1466
|
+
variationFolds: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1467
|
+
slotId: z.ZodString;
|
|
1468
|
+
variationId: z.ZodString;
|
|
1469
|
+
label: z.ZodString;
|
|
1470
|
+
}, z.core.$strip>>>;
|
|
1471
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1472
|
+
}, z.core.$strip>;
|
|
1473
|
+
type VideoAnalysisResult = z.infer<typeof videoAnalysisResultSchema>;
|
|
1474
|
+
declare function deriveSlotRefs(visual: string): string[];
|
|
1475
|
+
declare function rewriteSlotTokens(visual: string, renames: Record<string, string>): string;
|
|
1476
|
+
/** Unresolved tokens unwrap to their literal id text — never deleted (spec invariant). */
|
|
1477
|
+
declare function unwrapUnresolvedTokens(text: string, validIds: Set<string>): {
|
|
1478
|
+
text: string;
|
|
1479
|
+
unresolved: string[];
|
|
1480
|
+
};
|
|
1481
|
+
/**
|
|
1482
|
+
* Rewrite a scene's `slotVariations` after cross-window slot/variation
|
|
1483
|
+
* unification: slot keys map through `slotRenames`, then each variation value
|
|
1484
|
+
* maps through `variationRenames[<new slotId>]`. Absent renames pass through.
|
|
1485
|
+
*/
|
|
1486
|
+
declare function rewriteSceneBindings(sv: Record<string, string> | undefined, slotRenames: Record<string, string>, variationRenames?: Record<string, Record<string, string>>): Record<string, string> | undefined;
|
|
1487
|
+
/**
|
|
1488
|
+
* Drop bindings whose (slotId, variationId) no longer exists after a merge —
|
|
1489
|
+
* the unwrap-rule mirror: never persist a dangling binding, and report what
|
|
1490
|
+
* was dropped so the caller can warn. `"default"` is always valid for a known
|
|
1491
|
+
* slot. `kept` is undefined when nothing survives (no `{}` materialization).
|
|
1492
|
+
*/
|
|
1493
|
+
declare function dropUnknownBindings(sv: Record<string, string> | undefined, validBySlot: Map<string, Set<string>>): {
|
|
1494
|
+
kept?: Record<string, string>;
|
|
1495
|
+
dropped: Array<{
|
|
1496
|
+
slotId: string;
|
|
1497
|
+
variationId: string;
|
|
1498
|
+
}>;
|
|
1499
|
+
};
|
|
1500
|
+
/**
|
|
1501
|
+
* Rewrite speech attribution after cross-window slot unification — the
|
|
1502
|
+
* `rewriteSceneBindings` counterpart for the `audio` channel. Slot unification
|
|
1503
|
+
* renames a loser id to its survivor and rewrites `{slot:…}` tokens and
|
|
1504
|
+
* variation bindings; an un-rewritten `speakerSlot` would be left pointing at an
|
|
1505
|
+
* id that no longer exists. Copy-on-write: returns the input array untouched
|
|
1506
|
+
* when no layer names a renamed slot.
|
|
1507
|
+
*/
|
|
1508
|
+
declare function rewriteSpeakerSlots(audio: AudioLayer[], slotRenames: Record<string, string>): AudioLayer[];
|
|
1509
|
+
/**
|
|
1510
|
+
* Strip attribution that no scene can honour — the `dropUnknownBindings` mirror
|
|
1511
|
+
* for the `audio` channel. Two cases, both model sloppiness rather than errors
|
|
1512
|
+
* worth failing a roll over:
|
|
1513
|
+
* - a `speakerSlot` on any non-`speech` layer (nobody is speaking)
|
|
1514
|
+
* - a `speakerSlot` naming a slot that is not in the final list
|
|
1515
|
+
*
|
|
1516
|
+
* MUST run AFTER the orphan-slot sweep, and attribution must NEVER count as a
|
|
1517
|
+
* slot reference for that sweep: a slot reachable only as a speaker is a voice
|
|
1518
|
+
* with no body — precisely the invented-narrator entity doctrine §5 forbids. The
|
|
1519
|
+
* two passes compose to remove both the phantom slot and the dangling
|
|
1520
|
+
* attribution pointing at it.
|
|
1521
|
+
*/
|
|
1522
|
+
declare function dropUnknownSpeakers(audio: AudioLayer[], validSlotIds: Set<string>): {
|
|
1523
|
+
audio: AudioLayer[];
|
|
1524
|
+
dropped: string[];
|
|
1525
|
+
};
|
|
1526
|
+
/**
|
|
1527
|
+
* Fold each window's reading of the clip look into one, FIELD BY FIELD: the first
|
|
1528
|
+
* window that had something to say about a field wins it.
|
|
1529
|
+
*
|
|
1530
|
+
* Per-field rather than first-window-wins-everything because the windows see
|
|
1531
|
+
* different footage — an opening window may read the grade confidently while only
|
|
1532
|
+
* a later one contains the shot that reveals the format. Mirrors how `language` is
|
|
1533
|
+
* resolved across windows rather than taken from window 0.
|
|
1534
|
+
*
|
|
1535
|
+
* Returns undefined when no window said anything, so an analysis with nothing to
|
|
1536
|
+
* report omits the field rather than shipping an empty object.
|
|
1537
|
+
*/
|
|
1538
|
+
declare function mergeClipLook(looks: ReadonlyArray<ClipLook | undefined>): ClipLook | undefined;
|
|
1539
|
+
/** Substitute {slot:x}: castMap binding wins, else the slot's description, else literal id. */
|
|
1540
|
+
declare function renderAnalyzedScene(scene: {
|
|
1541
|
+
visual: string;
|
|
1542
|
+
}, slots: EntitySlot[], castMap?: Record<string, string>): string;
|
|
1543
|
+
declare function isOversizedScene(startSec: number, endSec: number): boolean;
|
|
1544
|
+
declare function aspectRatioFromDims(w: number, h: number): string;
|
|
1545
|
+
/**
|
|
1546
|
+
* MUSIC-VIDEO INFERENCE (2026-08-17): is this clip a music video — one whose
|
|
1547
|
+
* soundtrack IS the content, to be taken as-is with no stem separation?
|
|
1548
|
+
*
|
|
1549
|
+
* Lives in SHARED because two sides must agree BYTE-FOR-BYTE on the answer:
|
|
1550
|
+
* the recast route derives `music.mode` from it server-side, and the client
|
|
1551
|
+
* both prices the original-audio prep and GUARDS on the server's derived mode
|
|
1552
|
+
* at generate time — two hand-written copies of this heuristic would drift
|
|
1553
|
+
* into that guard firing on honest runs. Deterministic, throw-proof on any
|
|
1554
|
+
* malformed analysis (absent fields ⇒ false).
|
|
1555
|
+
*
|
|
1556
|
+
* The rule is conservative toward FALSE (a false positive keeps unwanted
|
|
1557
|
+
* dialogue in the render; a false negative merely runs the separation, which
|
|
1558
|
+
* was yesterday's default): at least 4 scenes, at least 80% of scenes carry a
|
|
1559
|
+
* music layer, and at least one music layer carries sung-vocal evidence that
|
|
1560
|
+
* is not negated ("instrumental", "no vocals").
|
|
1561
|
+
*
|
|
1562
|
+
* An EXPLICIT analyze-time flag always wins — callers use
|
|
1563
|
+
* `flag === true || inferMusicVideo(analysis)` and never let a cached false
|
|
1564
|
+
* suppress the inference (the flag can only ever be set true; false means
|
|
1565
|
+
* "unset", not "denied").
|
|
1566
|
+
*/
|
|
1567
|
+
declare function inferMusicVideo(analysis: {
|
|
1568
|
+
scenes?: ReadonlyArray<{
|
|
1569
|
+
audio?: ReadonlyArray<{
|
|
1570
|
+
mode?: string;
|
|
1571
|
+
content?: string;
|
|
1572
|
+
}>;
|
|
1573
|
+
}>;
|
|
1574
|
+
} | undefined | null): boolean;
|
|
1575
|
+
/**
|
|
1576
|
+
* The analysis with its server-derived fields removed — the form an LLM is
|
|
1577
|
+
* handed when the analysis IS the brief (Nodaro Studio's Director and its
|
|
1578
|
+
* job-id loader). Drops `warnings` and `variationFolds` at the top and
|
|
1579
|
+
* `visualResolved`, `slotRefs`, `oversized` on every scene; keeps
|
|
1580
|
+
* `refImageUrl` (a downstream cast image) and everything else. Never mutates;
|
|
1581
|
+
* a non-object input comes back as-is.
|
|
1582
|
+
*
|
|
1583
|
+
* ONE strip list, shared by the worker that composes the brief server-side
|
|
1584
|
+
* (`llm-structured` jobs with a `videoUrl`) and the client that loads a
|
|
1585
|
+
* finished analysis into a textarea, so the two can never drift.
|
|
1586
|
+
*/
|
|
1587
|
+
declare function stripDerivedAnalysisFields(json: unknown): unknown;
|
|
1588
|
+
|
|
1589
|
+
/**
|
|
1590
|
+
* UI-default fills for the unified video nodes — the ONE source of truth shared
|
|
1591
|
+
* by the backend DAG payload builder, the config-panel fail-safe snaps and the
|
|
1592
|
+
* node's hover/run strip.
|
|
1593
|
+
*
|
|
1594
|
+
* Several config panels RENDER a default without persisting it to node data, so
|
|
1595
|
+
* an untouched node submits `aspectRatio` / `resolution` undefined and the
|
|
1596
|
+
* enqueued job row (and the /v1/jobs echo) then disagrees with what actually
|
|
1597
|
+
* renders. Worse, the panels' generic snap writes `resolutions[0]` for a stale
|
|
1598
|
+
* value, which is the CHEAPEST tier under the repo's ascending-resolution
|
|
1599
|
+
* convention — not necessarily the tier the model renders and bills.
|
|
1600
|
+
*
|
|
1601
|
+
* These helpers were local to `backend/src/services/workflow-engine/payload-builder.ts`
|
|
1602
|
+
* until the Wan 3.0 launch gave the platform its first provider whose declared
|
|
1603
|
+
* billing default differs from `resolutions[0]`; three surfaces then had to
|
|
1604
|
+
* agree, so they live here.
|
|
1605
|
+
*
|
|
1606
|
+
* The resolution fill is per-family ON PURPOSE. Wan 3.0 reads its DECLARED
|
|
1607
|
+
* billing default (PRICING_DEFAULT_RESOLUTION = 720p) because its catalog list
|
|
1608
|
+
* is ascending, so an index-0 fill would write 480p — a tier both `runWan3`
|
|
1609
|
+
* (which renders 720P) and the credit identifier (which bills the 720p row)
|
|
1610
|
+
* disagree with. The Seedance family keeps its historical first-catalog-tier
|
|
1611
|
+
* fill, deliberately: switching it to PRICING_DEFAULT_RESOLUTION would reprice
|
|
1612
|
+
* live seedance-2-5 runs, whose declared default (720p) differs from the 480p
|
|
1613
|
+
* this has always filled. That 480p-fill vs 720p-billing-default divergence on
|
|
1614
|
+
* seedance-2-5 is a KNOWN pre-existing gap, out of scope here — do not "align"
|
|
1615
|
+
* the branches without repricing it deliberately.
|
|
1616
|
+
*/
|
|
1617
|
+
/** `adaptive` is the aspect default for Seedance 2, MiniMax H3 and Wan 3.0. */
|
|
1618
|
+
declare function uiAspectRatioFill(provider: string): string | undefined;
|
|
1619
|
+
/** See the file docstring — per-family on purpose; never a generic
|
|
1620
|
+
* PRICING_DEFAULT_RESOLUTION read (that would reprice seedance-2-5). */
|
|
1621
|
+
declare function uiResolutionFill(provider: string): string | undefined;
|
|
1622
|
+
/**
|
|
1623
|
+
* Duration the node RENDERS and BILLS when `data.duration` is unset, for the
|
|
1624
|
+
* families whose credit identifier declares a duration fallback that is NOT
|
|
1625
|
+
* `durations[0]`. Wan 3.0's bare identifier is the 5s tier while its ladder
|
|
1626
|
+
* starts at 2s; the Gemini Omni family's is the 8s tier while its ladder starts
|
|
1627
|
+
* at 4s. Everyone else falls back to the first listed duration, so this returns
|
|
1628
|
+
* undefined and the caller keeps `durations[0]`.
|
|
1629
|
+
*/
|
|
1630
|
+
declare function uiDurationFill(provider: string): number | undefined;
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* Real output canvases per (video model, resolution, aspect ratio).
|
|
1634
|
+
*
|
|
1635
|
+
* Every entry is a pixel size read off a finished render with ffprobe — the
|
|
1636
|
+
* geometry a model hands back, never a rate or a price. None of it is
|
|
1637
|
+
* arithmetic either, because the providers do not follow arithmetic:
|
|
1638
|
+
*
|
|
1639
|
+
* - minimax-h3 at 768P returns 768x1344 (0.5714) for a 9:16 request,
|
|
1640
|
+
* - seedance-2 at 480p 16:9 returns 864x496 (1.742) while seedance-2-5
|
|
1641
|
+
* returns 854x480 (1.778) for the same request,
|
|
1642
|
+
* - grok returns 736x400 (1.84), seedance 1.0 at 1080p 1:1 returns 1440x1440.
|
|
1643
|
+
*
|
|
1644
|
+
* A formula would get all four wrong, which is why `resolveOutputCanvas`
|
|
1645
|
+
* answers `undefined` for anything not measured: callers must then leave the
|
|
1646
|
+
* frame alone rather than invent geometry (see `computeFrameFitPlan`).
|
|
1647
|
+
*
|
|
1648
|
+
* HOW TO EXTEND: run `node tools/harvest-output-canvas.mjs` (it pages the admin
|
|
1649
|
+
* jobs API, groups completed video jobs by provider/resolution/aspect and probes
|
|
1650
|
+
* real outputs) and paste new rows here. Take rows from REFERENCE or
|
|
1651
|
+
* TEXT-TO-VIDEO jobs only: in frame mode the adaptive models (the seedance and
|
|
1652
|
+
* wan families) size the output from the INPUT image, so those rows describe the
|
|
1653
|
+
* input that was sent, not the canvas the model would choose on its own.
|
|
1654
|
+
*
|
|
1655
|
+
* Seeded 2026-09-16 from 3000 completed production jobs.
|
|
1656
|
+
*/
|
|
1657
|
+
/** `[width, height]` in pixels. */
|
|
1658
|
+
type VideoOutputCanvas = readonly [number, number];
|
|
1659
|
+
/** provider → resolution (lower-cased) → aspect token → canvas. */
|
|
1660
|
+
declare const VIDEO_OUTPUT_CANVAS: Readonly<Record<string, Readonly<Record<string, Readonly<Record<string, VideoOutputCanvas>>>>>>;
|
|
1661
|
+
/**
|
|
1662
|
+
* The canvas a model renders for this request, or `undefined` when we have never
|
|
1663
|
+
* measured that combination. `undefined` means "leave the frame alone".
|
|
1664
|
+
*
|
|
1665
|
+
* Resolution matching is case-insensitive (`768P`, `2K`, `720p` all appear in
|
|
1666
|
+
* the wild). An aspect of `adaptive` / `Auto` has no canvas of its own — the
|
|
1667
|
+
* caller resolves it to a concrete ratio first (`resolveFrameFitAspect`).
|
|
1668
|
+
*/
|
|
1669
|
+
declare function resolveOutputCanvas(provider: string | undefined, resolution: string | undefined, aspect: string | undefined): VideoOutputCanvas | undefined;
|
|
1670
|
+
/** Every measured combination, for tests and for the harvest script's diff. */
|
|
1671
|
+
declare function measuredCanvasCombinations(): Array<{
|
|
1672
|
+
provider: string;
|
|
1673
|
+
resolution: string;
|
|
1674
|
+
aspect: string;
|
|
1675
|
+
canvas: VideoOutputCanvas;
|
|
1676
|
+
}>;
|
|
1677
|
+
|
|
1678
|
+
/** How much of the frame we are allowed to reshape. */
|
|
1679
|
+
declare const FRAME_FITS: readonly ["original", "ratio", "resolution"];
|
|
1680
|
+
type FrameFit = (typeof FRAME_FITS)[number];
|
|
1681
|
+
/** `resolution` — the measured canvas — is the default everywhere. */
|
|
1682
|
+
declare const DEFAULT_FRAME_FIT: FrameFit;
|
|
1683
|
+
/** How the frame is handed to the model. */
|
|
1684
|
+
declare const FRAME_DELIVERIES: readonly ["auto", "frame", "reference"];
|
|
1685
|
+
type FrameDelivery = (typeof FRAME_DELIVERIES)[number];
|
|
1686
|
+
declare const DEFAULT_FRAME_DELIVERY: FrameDelivery;
|
|
1687
|
+
/**
|
|
1688
|
+
* Stretching an image to a ratio it is nowhere near would squash the subject,
|
|
1689
|
+
* so past this gap the frame is centre-cropped to the target ratio FIRST and
|
|
1690
|
+
* only then resized. 5% covers every "1K image into a 720p canvas" case we
|
|
1691
|
+
* measured (940x1672 into 9:16 is a 0.05% gap) while refusing to squash a
|
|
1692
|
+
* square photo into 9:16 (a 78% gap).
|
|
1693
|
+
*/
|
|
1694
|
+
declare const FRAME_FIT_STRETCH_TOLERANCE = 0.05;
|
|
1695
|
+
/**
|
|
1696
|
+
* Models whose frame mode is measurably worse than reference delivery.
|
|
1697
|
+
*
|
|
1698
|
+
* The Seedance 2.0 family crop-zooms the frame 2% and drifts 11-26% darker
|
|
1699
|
+
* within six frames in frame mode; delivered as a reference with the opening-
|
|
1700
|
+
* frame sentence, the same models hold a flat look from frame 0 and keep the
|
|
1701
|
+
* image's true geometry. Every OTHER model measured (Seedance 2.5, Gemini Omni
|
|
1702
|
+
* video + flash, Veo 3.1, Wan 3.0, Minimax H3) reproduces the opening frame
|
|
1703
|
+
* better in frame mode, so the default stays `frame` for anything absent here.
|
|
1704
|
+
*/
|
|
1705
|
+
declare const FRAME_DELIVERY_BY_PROVIDER: Readonly<Record<string, Exclude<FrameDelivery, "auto">>>;
|
|
1706
|
+
/** `"16:9"` → 1.777…; anything unparseable → `undefined`. */
|
|
1707
|
+
declare function parseAspectToken(token: string | undefined): number | undefined;
|
|
1708
|
+
/**
|
|
1709
|
+
* The aspect the fit should target.
|
|
1710
|
+
*
|
|
1711
|
+
* An explicit ratio is used as-is. `adaptive` / `Auto` (and an absent value,
|
|
1712
|
+
* which the seedance family sends as adaptive whenever a frame is present) has
|
|
1713
|
+
* no shape of its own: the provider will follow the IMAGE, so we snap the
|
|
1714
|
+
* image's own ratio to the nearest one the model lists and target that. A model
|
|
1715
|
+
* with no declared ratio list and an open token gives `undefined` — no fit.
|
|
1716
|
+
*/
|
|
1717
|
+
declare function resolveFrameFitAspect(args: {
|
|
1718
|
+
provider: string | undefined;
|
|
1719
|
+
requestedAspect: string | undefined;
|
|
1720
|
+
sourceWidth: number;
|
|
1721
|
+
sourceHeight: number;
|
|
1722
|
+
}): string | undefined;
|
|
1723
|
+
/** What `prepareVideoFrames` should do to one frame. `null` = nothing. */
|
|
1724
|
+
interface FrameFitPlan {
|
|
1725
|
+
/** Final pixel size to produce. */
|
|
1726
|
+
readonly width: number;
|
|
1727
|
+
readonly height: number;
|
|
1728
|
+
/** Centre-crop applied BEFORE the resize (only past the stretch tolerance). */
|
|
1729
|
+
readonly crop?: {
|
|
1730
|
+
readonly left: number;
|
|
1731
|
+
readonly top: number;
|
|
1732
|
+
readonly width: number;
|
|
1733
|
+
readonly height: number;
|
|
1734
|
+
};
|
|
1735
|
+
/** Why the plan exists — carried into logs and job output for traceability. */
|
|
1736
|
+
readonly reason: "resolution" | "ratio";
|
|
1737
|
+
}
|
|
1738
|
+
/**
|
|
1739
|
+
* The smallest change that makes `width x height` exactly `aspect`: keep the
|
|
1740
|
+
* longer side, move the shorter one. Rounding to even can leave a sub-pixel
|
|
1741
|
+
* residue, which is why the caller compares ratios with a tolerance rather than
|
|
1742
|
+
* for equality.
|
|
1743
|
+
*/
|
|
1744
|
+
declare function minimalRatioDimensions(width: number, height: number, aspect: number): {
|
|
1745
|
+
width: number;
|
|
1746
|
+
height: number;
|
|
1747
|
+
};
|
|
1748
|
+
/**
|
|
1749
|
+
* The centre-crop that turns `width x height` into exactly `aspect`, dropping
|
|
1750
|
+
* the overhang on the long axis.
|
|
1751
|
+
*/
|
|
1752
|
+
declare function centreCropToAspect(width: number, height: number, aspect: number): {
|
|
1753
|
+
left: number;
|
|
1754
|
+
top: number;
|
|
1755
|
+
width: number;
|
|
1756
|
+
height: number;
|
|
1757
|
+
};
|
|
1758
|
+
/**
|
|
1759
|
+
* Turn a request into a concrete plan for ONE frame, or `null` when the frame
|
|
1760
|
+
* should be sent untouched.
|
|
1761
|
+
*
|
|
1762
|
+
* Degradation ladder — a missing measurement must never invent geometry:
|
|
1763
|
+
* `resolution` with no measured canvas → behaves as `ratio`
|
|
1764
|
+
* `ratio` with no resolvable aspect → no fit
|
|
1765
|
+
* any fit whose target equals the source (within a pixel) → no fit
|
|
1766
|
+
*/
|
|
1767
|
+
declare function computeFrameFitPlan(args: {
|
|
1768
|
+
fit: FrameFit;
|
|
1769
|
+
provider: string | undefined;
|
|
1770
|
+
resolution: string | undefined;
|
|
1771
|
+
/** The aspect as the request carries it: a ratio, `adaptive`/`Auto`, or absent. */
|
|
1772
|
+
aspect: string | undefined;
|
|
1773
|
+
sourceWidth: number;
|
|
1774
|
+
sourceHeight: number;
|
|
1775
|
+
/** Overrides the measured table (tests, and a caller that already looked up). */
|
|
1776
|
+
canvas?: VideoOutputCanvas;
|
|
1777
|
+
tolerance?: number;
|
|
1778
|
+
}): FrameFitPlan | null;
|
|
1779
|
+
/**
|
|
1780
|
+
* Frame or reference? `auto` reads the per-provider default measured above.
|
|
1781
|
+
* Reference delivery is only possible on models that accept reference images —
|
|
1782
|
+
* on the others `reference` collapses back to `frame` rather than dropping the
|
|
1783
|
+
* frame on the floor.
|
|
1784
|
+
*/
|
|
1785
|
+
declare function resolveFrameDelivery(args: {
|
|
1786
|
+
provider: string | undefined;
|
|
1787
|
+
requested: FrameDelivery | undefined;
|
|
1788
|
+
supportsReferenceImages: boolean;
|
|
1789
|
+
}): Exclude<FrameDelivery, "auto">;
|
|
1790
|
+
|
|
1791
|
+
export { AUTO_DOWNLOAD_MAX_SEC, type AnalyzedScene, type AudioLayer, type ClipLook, DEFAULT_FRAME_DELIVERY, DEFAULT_FRAME_FIT, DEFAULT_VIDEO_OVERLAY_LAYER, DIRECT_VIDEO_EXTENSIONS, type EntitySlot, type EntitySlotOwner, type ExpandedVideoOverlayRequest, FRAME_DELIVERIES, FRAME_DELIVERY_BY_PROVIDER, FRAME_FITS, FRAME_FIT_STRETCH_TOLERANCE, type FrameDelivery, type FrameFit, type FrameFitPlan, INSTAGRAM_HOSTS, MAX_VIDEO_LINK_INPUT_CHARS, SLOT_TOKEN_RE, SOCIAL_VIDEO_HOSTS, type SlotVariation, VIDEO_ANALYSIS_AUDIO_MODES, VIDEO_ANALYSIS_CLIP_TRANSITIONS_IN, VIDEO_ANALYSIS_DEFAULT_VARIATION, VIDEO_ANALYSIS_ENTITY_SOURCES, VIDEO_ANALYSIS_FACELESS_ANGLES, VIDEO_ANALYSIS_MAX_SCENE_SEC, VIDEO_ANALYSIS_MAX_VARIATIONS, VIDEO_ANALYSIS_SHOT_ANGLES, VIDEO_ANALYSIS_SPEED_EFFECTS, VIDEO_ANALYSIS_STORY_JUMPS, VIDEO_ANALYSIS_TEXT_KINDS, VIDEO_ANALYSIS_TIMES_OF_DAY, VIDEO_ANALYSIS_TRANSITIONS, VIDEO_ANALYSIS_VARIATION_SLUGS, VIDEO_ANALYSIS_VISUAL_EFFECTS, VIDEO_CHARACTER_DESCRIPTION_MAX, VIDEO_CHARACTER_NAME_MAX, VIDEO_CHARACTER_REFS_WIRE_MAX, VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX, VIDEO_CHARACTER_VOICE_EXAMPLE_MAX, VIDEO_LINK_AUDIO_CONSUMER_TYPES, VIDEO_LINK_DERIVED_FIELDS, VIDEO_LINK_TOLERANT_CONSUMER_TYPES, VIDEO_OUTPUT_CANVAS, VIDEO_OVERLAY_ANIMATION_MIN_SCALE, VIDEO_OVERLAY_ANIMATION_SEC, VIDEO_OVERLAY_BADGE_INSET, VIDEO_OVERLAY_BADGE_WIDTH, VIDEO_OVERLAY_BOUNDS, VIDEO_OVERLAY_BOX_FIELDS, VIDEO_OVERLAY_CORNERS, VIDEO_OVERLAY_DEFAULT_BACKGROUND, VIDEO_OVERLAY_ERROR_CODES, VIDEO_OVERLAY_FITS, VIDEO_OVERLAY_HANDLE_IDS, VIDEO_OVERLAY_LAYER_PLAN_HANDLE, VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH, VIDEO_OVERLAY_MAX_LAYERS, VIDEO_OVERLAY_MAX_TIME_SEC, VIDEO_OVERLAY_MAX_TOTAL_LAYER_BYTES, VIDEO_OVERLAY_OUTPUT_ASPECTS, VIDEO_OVERLAY_PRESETS, VIDEO_OVERLAY_PRESET_IDS, VIDEO_OVERLAY_WARNING_CODES, type VideoAnalysisAudioMode, type VideoAnalysisClipTransitionIn, type VideoAnalysisEntitySource, type VideoAnalysisResult, type VideoAnalysisShotAngle, type VideoAnalysisSpeedEffect, type VideoAnalysisTextKind, type VideoAnalysisTransition, type VideoAnalysisVisualEffect, type VideoCharacterRefProblem, type VideoCharacterReference, type VideoCharacterVoice, type VideoLinkGraphEdge, type VideoLinkGraphNode, type VideoLinkInputProblem, type VideoLinkNeed, type VideoLinkNodeFields, type VideoLinkPlatform, type VideoOutputCanvas, type VideoOverlayBox, type VideoOverlayCanvas, type VideoOverlayComposition, type VideoOverlayCorner, type VideoOverlayErrorCode, type VideoOverlayFit, type VideoOverlayGeometry, type VideoOverlayIssue, type VideoOverlayLayer, type VideoOverlayLayerInput, type VideoOverlayLayerSpec, type VideoOverlayNodeFields, type VideoOverlayOrderable, type VideoOverlayOutputAspect, type VideoOverlayPresetId, type VideoOverlayRect, type VideoOverlayRequest, type VideoOverlayValidation, type VideoOverlayValidationInput, type VideoOverlayWarning, type VideoOverlayWarningCode, type WindowAnalysis, type WindowScene, YOUTUBE_HOSTS, YOUTUBE_MAX_HEIGHT, analyzedSceneSchema, applyVideoOverlayPreset, aspectRatioFromDims, assembleVideoOverlayRequest, centreCropToAspect, clearWiredVideoOverlayImageUrls, clipLookSchema, computeFrameFitPlan, deriveSlotRefs, detectVideoLinkPlatform, dropStaleVideoLinkFields, dropUnknownBindings, dropUnknownSpeakers, editPlanSourceDurationSec, entitySlotSchema, expandVideoOverlayLayer, expandVideoOverlayPresets, extractVideoDurationFromNode, formatVideoOverlayError, hasDrawableVideoOverlayBox, hasUrlParserHazard, hostnameMatchesAllowlist, inferMusicVideo, isDirectVideoFileUrl, isOversizedScene, isSocialVideoUrl, isVideoOverlayCorner, isVideoOverlayOutputAspect, isVideoOverlayPresetId, measuredCanvasCombinations, mergeClipLook, minimalRatioDimensions, normalizeVideoOverlayNodes, parseAspectToken, parseVideoOverlayLayerPlan, renderAnalyzedScene, resolveFrameDelivery, resolveFrameFitAspect, resolveOutputCanvas, resolveVideoLinkOutput, resolveVideoOverlayGeometry, rewriteSceneBindings, rewriteSlotTokens, rewriteSpeakerSlots, slotVariationSchema, stripDerivedAnalysisFields, toCustomVideoOverlayLayer, uiAspectRatioFill, uiDurationFill, uiResolutionFill, unwrapUnresolvedTokens, validateVideoOverlayRequest, videoAnalysisResultSchema, videoCharacterDistinctVoices, videoCharacterRefCap, videoCharacterRefProblem, videoCharacterRefProviders, videoCharacterRefUnits, videoCharacterVoiceCap, videoCharacterVoiceKey, videoCharacterVoiceProblem, videoLinkDownloadedFile, videoLinkInputProblem, videoLinkNeedOf, videoLinkNeedsDownload, videoLinkPageUrl, videoLinkRunNeeds, videoOverlayCanvas, videoOverlayCompositionKey, videoOverlayLayerLabel, videoOverlayPresetBox, videoOverlayRenderOrder, videoOverlaySlotOfHandle, videoOverlaySlotSources, windowAnalysisSchema };
|