@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,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The UGC wires of a video whose clips are cut from one recorded speech: UGC Clips' prelude, the
|
|
3
|
+
* script's language, the Script (sized) output that carries the finish call, and UGC Finish. The
|
|
4
|
+
* URLs and texts are placeholders; nothing here reads what a call says.
|
|
5
|
+
*/
|
|
6
|
+
import { describe, expect, it } from "vitest"
|
|
7
|
+
import {
|
|
8
|
+
FAN_IN_TARGETS,
|
|
9
|
+
UGC_FINISH_CLIPS_TYPE,
|
|
10
|
+
UGC_NODE_MESSAGES,
|
|
11
|
+
UGC_NODE_TYPES,
|
|
12
|
+
UGC_OVERRIDABLE_FIELDS,
|
|
13
|
+
UGC_PRELUDE_ROUTES,
|
|
14
|
+
UGC_PRIMARY_HANDLE,
|
|
15
|
+
VIDEO_PRODUCER_TYPES,
|
|
16
|
+
defaultEdgeOutputMode,
|
|
17
|
+
getInputFieldExtraKeys,
|
|
18
|
+
isFanInEdge,
|
|
19
|
+
isFanInNodeType,
|
|
20
|
+
ugcClipsOutputs,
|
|
21
|
+
ugcClipsPhase,
|
|
22
|
+
ugcClipsPhase2Body,
|
|
23
|
+
ugcFinishOutputs,
|
|
24
|
+
ugcFinishPlan,
|
|
25
|
+
ugcFinishWired,
|
|
26
|
+
ugcLaneNeedsFinish,
|
|
27
|
+
ugcPrelude,
|
|
28
|
+
ugcPreludeOutput,
|
|
29
|
+
ugcRenderHoldBody,
|
|
30
|
+
ugcRenderHoldVerdict,
|
|
31
|
+
ugcRunEstimateInput,
|
|
32
|
+
ugcScriptBody,
|
|
33
|
+
} from "../index.js"
|
|
34
|
+
|
|
35
|
+
const PHASE1 = {
|
|
36
|
+
errors: [],
|
|
37
|
+
lane: "segmented-reference",
|
|
38
|
+
phase: 1,
|
|
39
|
+
speech: { tool: "generate_speech", args: { text: "one two three", model: "speech-model", language_code: "xx", voice_id: "voice-1", voice_type: "library" } },
|
|
40
|
+
align: { tool: "forced_alignment", args: { transcript: "one two three" } },
|
|
41
|
+
split: { tool: "ugc_split_speech", args: { plan: { v: 1, hook: "one" } } },
|
|
42
|
+
}
|
|
43
|
+
const SEGMENTS = [{ index: 1, text: "one two" }, { index: 2, text: "three" }]
|
|
44
|
+
const PHASE2 = {
|
|
45
|
+
errors: [],
|
|
46
|
+
phase: 2,
|
|
47
|
+
tickets: [{ v: 1, index: 0, durationSec: 7 }, { v: 1, index: 1, durationSec: 7 }],
|
|
48
|
+
sizedPlan: { hook: "one", clipBreaks: [], clipDurations: [14] },
|
|
49
|
+
transcript: "one two three",
|
|
50
|
+
hasCards: false,
|
|
51
|
+
speechCheckCall: { tool: "transcribe", args: { language: "xx" } },
|
|
52
|
+
finish: { tool: "ugc_finish_clips", args: { segments: SEGMENTS } },
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
describe("the script's language", () => {
|
|
56
|
+
it("the node's choice goes to the script route; none, or one this app does not know, is English", () => {
|
|
57
|
+
const body = (language: unknown) => (ugcScriptBody({ site: "Acme", screenshots: [], language }) as { body: Record<string, unknown> }).body.language
|
|
58
|
+
expect(body("he")).toBe("he")
|
|
59
|
+
expect(body("en")).toBe("en")
|
|
60
|
+
expect(body(undefined)).toBe("en")
|
|
61
|
+
expect(body("fr")).toBe("en")
|
|
62
|
+
})
|
|
63
|
+
it("is an overridable field and an extra app-input key, together", () => {
|
|
64
|
+
expect(UGC_OVERRIDABLE_FIELDS["ugc-script"]).toContain("language")
|
|
65
|
+
expect(getInputFieldExtraKeys("ugc-script")).toEqual([{ key: "language", type: "select" }])
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
describe("UGC Clips' prelude", () => {
|
|
70
|
+
it("reads an answer's phase: 1 runs the prelude, 2 the clips, none is one call", () => {
|
|
71
|
+
expect(ugcClipsPhase(PHASE1)).toBe(1)
|
|
72
|
+
expect(ugcClipsPhase(PHASE2)).toBe(2)
|
|
73
|
+
expect(ugcClipsPhase({ tickets: [] })).toBeNull()
|
|
74
|
+
})
|
|
75
|
+
it("maps the three calls to the routes their MCP tools dispatch to, argument by argument", () => {
|
|
76
|
+
const p = ugcPrelude(PHASE1)
|
|
77
|
+
if ("error" in p) throw new Error(p.error)
|
|
78
|
+
expect(p.speech).toEqual({ text: "one two three", voice: "voice-1", voiceType: "library", provider: "speech-model", languageCode: "xx" })
|
|
79
|
+
expect(p.alignment("https://cdn.example/s.mp3")).toEqual({ transcript: "one two three", audioUrl: "https://cdn.example/s.mp3" })
|
|
80
|
+
expect(p.split("https://cdn.example/s.mp3", [{ word: "one", start: 0, end: 1 }])).toEqual({
|
|
81
|
+
plan: { v: 1, hook: "one" }, audioUrl: "https://cdn.example/s.mp3", alignment: [{ word: "one", start: 0, end: 1 }],
|
|
82
|
+
})
|
|
83
|
+
expect(UGC_PRELUDE_ROUTES).toEqual({
|
|
84
|
+
speech: { path: "/v1/text-to-speech", jobType: "text-to-speech" },
|
|
85
|
+
alignment: { path: "/v1/forced-alignment", jobType: "forced-alignment" },
|
|
86
|
+
split: { path: "/v1/ugc/segments", jobType: "ugc-segments" },
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
it("an answer missing a call, or naming another tool, is the newer-app sentence", () => {
|
|
90
|
+
expect(ugcPrelude({ ...PHASE1, align: undefined })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
91
|
+
expect(ugcPrelude({ ...PHASE1, speech: { tool: "generate_dialogue", args: { text: "x" } } })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
92
|
+
expect(ugcPrelude({ ...PHASE1, split: { tool: "ugc_split_speech", args: {} } })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
93
|
+
})
|
|
94
|
+
it("reads each step's job output: the speech's audio, the word timings, the segments", () => {
|
|
95
|
+
expect(ugcPreludeOutput("speech", { audioUrl: "https://cdn.example/s.mp3" })).toEqual({ value: "https://cdn.example/s.mp3" })
|
|
96
|
+
expect(ugcPreludeOutput("alignment", { alignment: [{ word: "a" }] })).toEqual({ value: [{ word: "a" }] })
|
|
97
|
+
expect(ugcPreludeOutput("split", { segments: SEGMENTS })).toEqual({ value: SEGMENTS })
|
|
98
|
+
for (const [step, out] of [["speech", {}], ["alignment", { alignment: [] }], ["split", undefined]] as const) {
|
|
99
|
+
expect(ugcPreludeOutput(step, out as never)).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
it("the second call is the first call's body with the segments", () => {
|
|
103
|
+
expect(ugcClipsPhase2Body({ plan: { v: 1 }, surface: "canvas", userId: "u" }, SEGMENTS)).toEqual({ plan: { v: 1 }, surface: "canvas", userId: "u", segments: SEGMENTS })
|
|
104
|
+
})
|
|
105
|
+
it("the phase-2 answer's Script (sized) output carries the finish call's arguments; an answer without one is unchanged", () => {
|
|
106
|
+
const read = ugcClipsOutputs(PHASE2)
|
|
107
|
+
if ("error" in read) throw new Error(read.error)
|
|
108
|
+
expect(JSON.parse(read.outputs["plan-out"]!)).toEqual({ v: 1, plan: PHASE2.sizedPlan, transcribeArgs: { language: "xx" }, finish: { segments: SEGMENTS } })
|
|
109
|
+
const { finish: _f, phase: _p, ...english } = PHASE2
|
|
110
|
+
const en = ugcClipsOutputs(english)
|
|
111
|
+
if ("error" in en) throw new Error(en.error)
|
|
112
|
+
expect(JSON.parse(en.outputs["plan-out"]!)).toEqual({ v: 1, plan: PHASE2.sizedPlan, transcribeArgs: { language: "xx" } })
|
|
113
|
+
})
|
|
114
|
+
it("says the clips go through UGC Finish's job exactly when its plan-out carries the finish call (the quote prices it then)", () => {
|
|
115
|
+
const read = ugcClipsOutputs(PHASE2)
|
|
116
|
+
if ("error" in read) throw new Error(read.error)
|
|
117
|
+
expect(read.finishes).toBe(true)
|
|
118
|
+
expect("finish" in JSON.parse(read.outputs["plan-out"]!)).toBe(true)
|
|
119
|
+
const { finish: _f, phase: _p, ...english } = PHASE2
|
|
120
|
+
const en = ugcClipsOutputs(english)
|
|
121
|
+
if ("error" in en) throw new Error(en.error)
|
|
122
|
+
expect(en.finishes).toBe(false)
|
|
123
|
+
// A finish with no arguments is not carried, so it is not priced either.
|
|
124
|
+
const bare = ugcClipsOutputs({ ...PHASE2, finish: { tool: "ugc_finish_clips" } })
|
|
125
|
+
if ("error" in bare) throw new Error(bare.error)
|
|
126
|
+
expect([bare.finishes, "finish" in JSON.parse(bare.outputs["plan-out"]!)]).toEqual([false, false])
|
|
127
|
+
})
|
|
128
|
+
it("is refused before anything is spent when no UGC Finish reads this UGC Clips' Script (sized) output", () => {
|
|
129
|
+
const nodes = [{ id: "clips", type: "ugc-clips" }, { id: "fin", type: UGC_FINISH_CLIPS_TYPE }, { id: "join", type: "combine-videos" }]
|
|
130
|
+
const wired = [{ source: "clips", target: "fin", sourceHandle: "plan-out", targetHandle: "plan" }]
|
|
131
|
+
expect(ugcFinishWired(wired, nodes, "clips")).toBe(true)
|
|
132
|
+
expect(ugcLaneNeedsFinish(wired, nodes, "clips")).toBeNull()
|
|
133
|
+
// Another UGC Clips' finish, another output, or no UGC Finish at all: refused.
|
|
134
|
+
expect(ugcLaneNeedsFinish(wired, nodes, "other")).toBe(UGC_NODE_MESSAGES.needsFinish)
|
|
135
|
+
expect(ugcLaneNeedsFinish([{ ...wired[0]!, sourceHandle: "transcript" }], nodes, "clips")).toBe(UGC_NODE_MESSAGES.needsFinish)
|
|
136
|
+
expect(ugcLaneNeedsFinish([{ ...wired[0]!, target: "join" }], nodes, "clips")).toBe(UGC_NODE_MESSAGES.needsFinish)
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
describe("UGC Finish", () => {
|
|
141
|
+
const PLAN_OUT_EN = JSON.stringify({ v: 1, plan: { hook: "h" }, transcribeArgs: {} })
|
|
142
|
+
const PLAN_OUT_LANE = JSON.stringify({ v: 1, plan: { hook: "h" }, transcribeArgs: {}, finish: { segments: SEGMENTS } })
|
|
143
|
+
const CLIPS = ["https://cdn.example/1.mp4", "https://cdn.example/2.mp4"]
|
|
144
|
+
|
|
145
|
+
it("is a registered UGC node, a video producer, and folds its clips into one run (never fanned out)", () => {
|
|
146
|
+
expect(UGC_NODE_TYPES.has(UGC_FINISH_CLIPS_TYPE)).toBe(true)
|
|
147
|
+
expect(VIDEO_PRODUCER_TYPES.has(UGC_FINISH_CLIPS_TYPE)).toBe(true)
|
|
148
|
+
expect(FAN_IN_TARGETS[UGC_FINISH_CLIPS_TYPE]).toEqual(["clips"])
|
|
149
|
+
expect(isFanInNodeType(UGC_FINISH_CLIPS_TYPE)).toBe(true)
|
|
150
|
+
expect(isFanInEdge(UGC_FINISH_CLIPS_TYPE, "clips")).toBe(true)
|
|
151
|
+
expect(isFanInEdge(UGC_FINISH_CLIPS_TYPE, "plan")).toBe(false)
|
|
152
|
+
expect(UGC_PRIMARY_HANDLE[UGC_FINISH_CLIPS_TYPE]).toBe("video-out")
|
|
153
|
+
// Its output is one value per edge by default; a Bundle edge hands on the whole list.
|
|
154
|
+
expect(defaultEdgeOutputMode(UGC_FINISH_CLIPS_TYPE, "video-out")).toBe("last")
|
|
155
|
+
})
|
|
156
|
+
it("English (no finish call on the plan): the clips pass through as they came — no call, no job", () => {
|
|
157
|
+
expect(ugcFinishPlan({ planOutWire: PLAN_OUT_EN, clipUrls: CLIPS })).toEqual({ kind: "pass", clips: CLIPS })
|
|
158
|
+
})
|
|
159
|
+
it("the segmented lane: the finish job's body — the segments as they came, one roll per clip, in order", () => {
|
|
160
|
+
expect(ugcFinishPlan({ planOutWire: PLAN_OUT_LANE, clipUrls: CLIPS })).toEqual({
|
|
161
|
+
kind: "job", path: "/v1/ugc/finish",
|
|
162
|
+
body: { segments: SEGMENTS, clips: [{ clip: 1, rolls: [CLIPS[0]] }, { clip: 2, rolls: [CLIPS[1]] }] },
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
it("refuses before any call: no clips, no plan, or a clip count that is not the segment count", () => {
|
|
166
|
+
expect(ugcFinishPlan({ planOutWire: PLAN_OUT_LANE, clipUrls: [] })).toEqual({ error: UGC_NODE_MESSAGES.finishNeedsClips })
|
|
167
|
+
expect(ugcFinishPlan({ planOutWire: undefined, clipUrls: CLIPS })).toEqual({ error: UGC_NODE_MESSAGES.needsPlanOut })
|
|
168
|
+
expect(ugcFinishPlan({ planOutWire: PLAN_OUT_LANE, clipUrls: CLIPS.slice(0, 1) })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
169
|
+
})
|
|
170
|
+
it("a finished job → the clips in clip order with their real length; a dry finish's warning rides every clip", () => {
|
|
171
|
+
const out = ugcFinishOutputs({
|
|
172
|
+
ready: true,
|
|
173
|
+
clips: [{ clip: 2, url: "https://cdn.example/f2.mp4", sec: 5.2 }, { clip: 1, url: "https://cdn.example/f1.mp4", sec: 6.1 }],
|
|
174
|
+
warnings: [{ code: "ACOUSTICS_SKIPPED", cause: null, reason: "r" }],
|
|
175
|
+
})
|
|
176
|
+
expect(out).toEqual({
|
|
177
|
+
clips: [
|
|
178
|
+
{ url: "https://cdn.example/f1.mp4", meta: { warnings: ["ACOUSTICS_SKIPPED"], durationSec: 6.1 } },
|
|
179
|
+
{ url: "https://cdn.example/f2.mp4", meta: { warnings: ["ACOUSTICS_SKIPPED"], durationSec: 5.2 } },
|
|
180
|
+
],
|
|
181
|
+
})
|
|
182
|
+
})
|
|
183
|
+
it("ready: false fails with its sentence; a clip list with a gap is never handed on", () => {
|
|
184
|
+
expect(ugcFinishOutputs({ ready: false, reroll: [2], failed: [] })).toEqual({ error: UGC_NODE_MESSAGES.finishNotReady })
|
|
185
|
+
expect(ugcFinishOutputs({ ready: true, clips: [{ clip: 1, url: "u1" }, { clip: 3, url: "u3" }] })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
186
|
+
expect(ugcFinishOutputs(undefined)).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
describe("the hold check once the speech is split", () => {
|
|
191
|
+
const T = { v: 1, index: 0, durationSec: 7, video: { tool: "generate_video", args: {} } }
|
|
192
|
+
const PLAN = { v: 1, hook: "h", language: "he", targetDurationSec: 20, beats: [{ screenshot: { slot: 1 } }, { screenshot: { slot: 2 } }, { screenshot: "x" }, "not a beat"] }
|
|
193
|
+
const INPUT = { targetDurationSec: 20, screenshotCount: 2, source: "sampled", language: "he" } as const
|
|
194
|
+
|
|
195
|
+
it("reads the video's estimate input from the plan UGC Clips was sent (or its wire): length, screenshot cards, language", () => {
|
|
196
|
+
expect(ugcRunEstimateInput(PLAN)).toEqual({ runEstimate: INPUT })
|
|
197
|
+
expect(ugcRunEstimateInput(JSON.stringify(PLAN))).toEqual({ runEstimate: INPUT })
|
|
198
|
+
// A plan with no beats has no cards to count.
|
|
199
|
+
const { beats: _b, ...noBeats } = PLAN
|
|
200
|
+
expect(ugcRunEstimateInput(noBeats)).toEqual({ runEstimate: { ...INPUT, screenshotCount: 0 } })
|
|
201
|
+
})
|
|
202
|
+
it("never guesses: a plan with no length, an English or unknown language, or no plan → the newer-app sentence", () => {
|
|
203
|
+
const { targetDurationSec: _t, ...noLength } = PLAN
|
|
204
|
+
for (const plan of [noLength, { ...PLAN, targetDurationSec: 2 }, { ...PLAN, language: "en" }, { ...PLAN, language: "xx" }, { ...PLAN, language: undefined }, undefined, "not json"]) {
|
|
205
|
+
expect(ugcRunEstimateInput(plan), JSON.stringify(plan)).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
206
|
+
}
|
|
207
|
+
})
|
|
208
|
+
it("asks the quote for the clips handed on, with that input", () => {
|
|
209
|
+
expect(ugcRenderHoldBody({ runEstimate: INPUT, tickets: [T], hasCards: true, finishes: true })).toEqual({
|
|
210
|
+
path: "/v1/ugc/quote",
|
|
211
|
+
body: { tickets: [T], hasCards: true, finishes: true, runEstimate: INPUT },
|
|
212
|
+
})
|
|
213
|
+
// No finish call → no `finishes` key.
|
|
214
|
+
expect(ugcRenderHoldBody({ runEstimate: INPUT, tickets: [T], hasCards: false, finishes: false })).toEqual({
|
|
215
|
+
path: "/v1/ugc/quote",
|
|
216
|
+
body: { tickets: [T], hasCards: false, runEstimate: INPUT },
|
|
217
|
+
})
|
|
218
|
+
for (const tickets of [[], undefined, "x"]) expect(ugcRenderHoldBody({ runEstimate: INPUT, tickets, hasCards: false, finishes: true })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
219
|
+
})
|
|
220
|
+
it("goes on at or under what the run was checked for; over it, the over-hold sentence; without both figures, the newer-app sentence", () => {
|
|
221
|
+
expect(ugcRenderHoldVerdict({ ceiling: 2400, runHold: 2400 })).toEqual({ ok: true })
|
|
222
|
+
expect(ugcRenderHoldVerdict({ ceiling: 0, runHold: 1 })).toEqual({ ok: true })
|
|
223
|
+
expect(ugcRenderHoldVerdict({ ceiling: 2401, runHold: 2400 })).toEqual({ error: UGC_NODE_MESSAGES.overHold })
|
|
224
|
+
for (const answer of [undefined, null, [], {}, { ceiling: 1 }, { runHold: 1 }, { ceiling: "1", runHold: 2 }, { ceiling: 1, runHold: Number.NaN }, { ceiling: -1, runHold: 2 }]) {
|
|
225
|
+
expect(ugcRenderHoldVerdict(answer), JSON.stringify(answer)).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
})
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ugcAwaitsPick, ugcCreatorBody, ugcCreatorCallsToRender, ugcCreatorCandidate, ugcCreatorCandidates, ugcCreatorOutputs, ugcCreatorPick, ugcFailure,
|
|
7
7
|
ugcKeptOutputs, ugcPipValue, ugcScriptBody, ugcScriptOutputs, ugcScriptResult, type UgcCreatorCandidateCalls,
|
|
8
8
|
} from "../ugc-node-wires.js"
|
|
9
|
+
import { ugcFinishOutputs, ugcFinishPlan, ugcLaneNeedsFinish, ugcRenderHoldVerdict } from "../ugc-lane-wires.js"
|
|
9
10
|
|
|
10
11
|
const ticket = (i: number) => ({ v: 1, index: i, durationSec: 12, video: { tool: "t", args: {} } })
|
|
11
12
|
|
|
@@ -159,9 +160,9 @@ describe("UGC wires: the module surface", () => {
|
|
|
159
160
|
expect(shared.UGC_SCRIPT_DEFAULT_TARGET_SEC).toBe(UGC_SCRIPT_DEFAULT_TARGET_SEC)
|
|
160
161
|
expect(shared.UGC_PRIMARY_HANDLE).toBe(UGC_PRIMARY_HANDLE)
|
|
161
162
|
})
|
|
162
|
-
it("names a primary handle for exactly the
|
|
163
|
+
it("names a primary handle for exactly the UGC types", () => {
|
|
163
164
|
expect(Object.keys(UGC_PRIMARY_HANDLE).sort()).toEqual([...UGC_NODE_TYPES].sort())
|
|
164
|
-
expect(UGC_PRIMARY_HANDLE).toEqual({ "ugc-creator": "creator", "ugc-script": "plan", "ugc-clips": "clips", "ugc-clip": "video-out", "ugc-cards": "layerPlan" })
|
|
165
|
+
expect(UGC_PRIMARY_HANDLE).toEqual({ "ugc-creator": "creator", "ugc-script": "plan", "ugc-clips": "clips", "ugc-clip": "video-out", "ugc-cards": "layerPlan", "ugc-finish-clips": "video-out" })
|
|
165
166
|
})
|
|
166
167
|
it("lists the eight screenshot slots in card order", () => {
|
|
167
168
|
expect(UGC_SCREENSHOT_HANDLES).toEqual(["screenshot", "screenshot2", "screenshot3", "screenshot4", "screenshot5", "screenshot6", "screenshot7", "screenshot8"])
|
|
@@ -331,12 +332,13 @@ describe("ugcClipsBody / ugcClipsOutputs: the remaining rules", () => {
|
|
|
331
332
|
expect(ugcClipsOutputs({ ...ok, transcript: undefined })).toEqual({ error: UGC_NEWER_APP_MESSAGE })
|
|
332
333
|
expect(ugcClipsOutputs({ errors: [{}] })).toEqual({ error: UGC_NEWER_APP_MESSAGE })
|
|
333
334
|
})
|
|
334
|
-
it("hands on the first ticket, the plan-out, the transcript
|
|
335
|
+
it("hands on the first ticket, the plan-out, the transcript, whether there are cards and whether the clips go through UGC Finish's job", () => {
|
|
335
336
|
const ok = ugcClipsOutputs({ errors: [], tickets: [ticket(0), ticket(1)], sizedPlan: { p: 1 }, transcript: "a b", hasCards: true })
|
|
336
337
|
expect(ok).toEqual({
|
|
337
338
|
outputs: { clips: JSON.stringify(ticket(0)), "plan-out": JSON.stringify({ v: 1, plan: { p: 1 }, transcribeArgs: {} }), transcript: "a b" },
|
|
338
339
|
tickets: [JSON.stringify(ticket(0)), JSON.stringify(ticket(1))],
|
|
339
340
|
hasCards: true,
|
|
341
|
+
finishes: false,
|
|
340
342
|
})
|
|
341
343
|
const none = ugcClipsOutputs({ tickets: [ticket(0)], sizedPlan: {}, transcript: "a", speechCheckCall: { tool: "transcribe", args: null } })
|
|
342
344
|
expect("hasCards" in none && none.hasCards).toBe(false)
|
|
@@ -585,6 +587,10 @@ describe("UGC_NODE_MESSAGES: every fixed sentence a UGC node fails with, by id",
|
|
|
585
587
|
needsTicket: ugcClipBody({ ticketWire: undefined }),
|
|
586
588
|
needsVideo: ugcCardsJobs({ planOutWire: PLAN_OUT, transcript: "a" }),
|
|
587
589
|
needsTranscript: ugcCardsJobs({ planOutWire: PLAN_OUT, videoUrl: "https://cdn.example/v.mp4" }),
|
|
590
|
+
needsFinish: ugcLaneNeedsFinish([], [], "clips"),
|
|
591
|
+
finishNeedsClips: ugcFinishPlan({ planOutWire: PLAN_OUT, clipUrls: [] }),
|
|
592
|
+
finishNotReady: ugcFinishOutputs({ ready: false, reroll: [1], failed: [] }),
|
|
593
|
+
overHold: ugcRenderHoldVerdict({ ceiling: 2, runHold: 1 }),
|
|
588
594
|
}
|
|
589
595
|
for (const [id, answer] of Object.entries(answers)) {
|
|
590
596
|
const said = typeof answer === "string" ? answer : (answer as { error?: unknown }).error
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "../ugc-run-state.js"
|
|
7
7
|
|
|
8
8
|
describe("UGC run state", () => {
|
|
9
|
-
it("covers exactly the
|
|
10
|
-
const five = ["ugc-cards", "ugc-clip", "ugc-clips", "ugc-creator", "ugc-script"]
|
|
9
|
+
it("covers exactly the six UGC types", () => {
|
|
10
|
+
const five = ["ugc-cards", "ugc-clip", "ugc-clips", "ugc-creator", "ugc-finish-clips", "ugc-script"]
|
|
11
11
|
expect([...UGC_NODE_TYPES].sort()).toEqual(five)
|
|
12
12
|
expect(Object.keys(UGC_NODE_RUN_STATE_KEYS).sort()).toEqual(five)
|
|
13
13
|
expect(Object.keys(UGC_OVERRIDABLE_FIELDS).sort()).toEqual(five)
|
|
@@ -90,8 +90,9 @@ describe("UGC run state", () => {
|
|
|
90
90
|
{ nodeId: "script", nodeType: "ugc-script", field: "keepResult" },
|
|
91
91
|
{ nodeId: "clip", nodeType: "ugc-clip", field: "rerender" },
|
|
92
92
|
])
|
|
93
|
-
//
|
|
94
|
-
expect(findUgcLockedFields(nodes, { script: { language: "he" } })).toEqual([
|
|
93
|
+
// The script's language is a choice a run may set; a future field is refused without anyone listing it.
|
|
94
|
+
expect(findUgcLockedFields(nodes, { script: { language: "he" } })).toEqual([])
|
|
95
|
+
expect(findUgcLockedFields(nodes, { script: { voice: "x" } })).toEqual([{ nodeId: "script", nodeType: "ugc-script", field: "voice" }])
|
|
95
96
|
})
|
|
96
97
|
|
|
97
98
|
it("ignores non-UGC nodes and missing inputs", () => {
|
|
@@ -164,7 +164,7 @@ describe("bare video-analysis node-type credit id", () => {
|
|
|
164
164
|
// that prompt again, moving the pin 8_482 -> 8_706, and 357 wrote 2076:
|
|
165
165
|
// the transition vocabulary v2 doctrine (twelve named values; absent =
|
|
166
166
|
// nothing asserted) grew it once more, moving the pin 8_706 -> 9_082.
|
|
167
|
-
expect(ceiling).toBe(
|
|
167
|
+
expect(ceiling).toBe(2076)
|
|
168
168
|
})
|
|
169
169
|
|
|
170
170
|
it("the bare id still bounds the default tier at the ceiling bucket", () => {
|
|
@@ -194,10 +194,10 @@ describe("video-audit-pricing", () => {
|
|
|
194
194
|
it("videoAuditCreditsForBucket: table lookup by resolved bucket + family, snapping a raw duration onto the ladder", () => {
|
|
195
195
|
expect(videoAuditCreditsForBucket(60, false)).toBe(215)
|
|
196
196
|
expect(videoAuditCreditsForBucket(60, true)).toBe(396)
|
|
197
|
-
expect(videoAuditCreditsForBucket(180, false)).toBe(
|
|
198
|
-
expect(videoAuditCreditsForBucket(360, false)).toBe(
|
|
199
|
-
expect(videoAuditCreditsForBucket(600, false)).toBe(
|
|
200
|
-
expect(videoAuditCreditsForBucket(600, true)).toBe(
|
|
197
|
+
expect(videoAuditCreditsForBucket(180, false)).toBe(290)
|
|
198
|
+
expect(videoAuditCreditsForBucket(360, false)).toBe(663)
|
|
199
|
+
expect(videoAuditCreditsForBucket(600, false)).toBe(1073)
|
|
200
|
+
expect(videoAuditCreditsForBucket(600, true)).toBe(1921)
|
|
201
201
|
// Not just exact ladder values — a raw duration snaps up to its bucket.
|
|
202
202
|
expect(videoAuditCreditsForBucket(70, false)).toBe(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:180s"])
|
|
203
203
|
expect(videoAuditCreditsForBucket(9999, true)).toBe(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:auto:600s"])
|
|
@@ -238,8 +238,8 @@ describe("video-audit-pricing", () => {
|
|
|
238
238
|
// 600s bucket here, same convention as VIDEO_ANALYSIS_BUCKET_CREDITS).
|
|
239
239
|
expect(Object.keys(VIDEO_AUDIT_BUCKET_CREDITS)).toHaveLength(8)
|
|
240
240
|
// Bare-id values quoted in the task/catalog must equal each family's 600s ceiling.
|
|
241
|
-
expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:600s"]).toBe(
|
|
242
|
-
expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:auto:600s"]).toBe(
|
|
241
|
+
expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:600s"]).toBe(1073)
|
|
242
|
+
expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:auto:600s"]).toBe(1921)
|
|
243
243
|
})
|
|
244
244
|
|
|
245
245
|
it("auto family = base family + the gemini-3-flash (legacy fast tier) row at the same bucket, exactly — single-source, never hand-added", () => {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { parseVoiceChangerProQuoteCreditId, voiceChangerProQuoteCreditId } from "../credit-estimators/voice-changer-pro-quote.js"
|
|
3
|
+
|
|
4
|
+
describe("the whole-convert quote id", () => {
|
|
5
|
+
it("writes one slot per changed speaker, a missing measure as the bare kind", () => {
|
|
6
|
+
expect(
|
|
7
|
+
voiceChangerProQuoteCreditId([
|
|
8
|
+
{ kind: "sts", seconds: 26.76 },
|
|
9
|
+
{ kind: "respeak", chars: 1200 },
|
|
10
|
+
{ kind: "sts", seconds: null },
|
|
11
|
+
{ kind: "respeak", chars: 0 },
|
|
12
|
+
]),
|
|
13
|
+
).toBe("voice-changer-pro:sts-26.76,respeak-1200,sts,respeak")
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it("reads back exactly what it wrote, per kind and in order", () => {
|
|
17
|
+
const id = voiceChangerProQuoteCreditId([
|
|
18
|
+
{ kind: "respeak", chars: 87 },
|
|
19
|
+
{ kind: "sts", seconds: 2 + 1 / 3 },
|
|
20
|
+
{ kind: "sts", seconds: null },
|
|
21
|
+
{ kind: "respeak", chars: null },
|
|
22
|
+
])
|
|
23
|
+
expect(parseVoiceChangerProQuoteCreditId(id)).toEqual({
|
|
24
|
+
stsSlotSeconds: [2 + 1 / 3, null],
|
|
25
|
+
respeakChars: [87, null],
|
|
26
|
+
respeakEngines: [null, null],
|
|
27
|
+
respeakTranslated: [false, false],
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it("names a v4 slot's engine, and a translated v4 slot as such; v3 keeps the id it always had", () => {
|
|
32
|
+
expect(
|
|
33
|
+
voiceChangerProQuoteCreditId([
|
|
34
|
+
{ kind: "respeak", chars: 1200, engine: "v4" },
|
|
35
|
+
{ kind: "respeak", chars: 1200, engine: "v4", translated: true },
|
|
36
|
+
{ kind: "respeak", chars: 1200, engine: "v3" },
|
|
37
|
+
{ kind: "respeak", chars: null, engine: "v4", translated: true },
|
|
38
|
+
{ kind: "respeak", chars: null, engine: "v4" },
|
|
39
|
+
]),
|
|
40
|
+
).toBe("voice-changer-pro:respeak-v4-1200,respeak-v4t-1200,respeak-1200,respeak-v4t,respeak-v4")
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it("never writes a translated v3 slot: only v4 speaks a translation, as the convert route reads it", () => {
|
|
44
|
+
expect(voiceChangerProQuoteCreditId([{ kind: "respeak", chars: 500, engine: "v3", translated: true }])).toBe(
|
|
45
|
+
"voice-changer-pro:respeak-500",
|
|
46
|
+
)
|
|
47
|
+
expect(voiceChangerProQuoteCreditId([{ kind: "respeak", chars: 500, translated: true }])).toBe("voice-changer-pro:respeak-500")
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it("reads each Re-speak slot's engine and translation back, index-aligned with its characters", () => {
|
|
51
|
+
expect(parseVoiceChangerProQuoteCreditId("voice-changer-pro:respeak-v4t-900,sts-12,respeak-v3-40,respeak,respeak-v4")).toEqual({
|
|
52
|
+
stsSlotSeconds: [12],
|
|
53
|
+
respeakChars: [900, 40, null, null],
|
|
54
|
+
respeakEngines: ["v4", "v3", null, "v4"],
|
|
55
|
+
respeakTranslated: [true, false, false, false],
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it.each([
|
|
60
|
+
"voice-changer-pro",
|
|
61
|
+
"voice-changer-pro:",
|
|
62
|
+
"voice-changer-pro-respeak:sts-10",
|
|
63
|
+
"voice-changer-pro:sts-0",
|
|
64
|
+
"voice-changer-pro:sts--3",
|
|
65
|
+
"voice-changer-pro:sts-1e3",
|
|
66
|
+
"voice-changer-pro:sts-10,",
|
|
67
|
+
"voice-changer-pro:lipsync-3",
|
|
68
|
+
"voice-changer-pro:3u",
|
|
69
|
+
"voice-changer-pro:respeak-v3t-100",
|
|
70
|
+
"voice-changer-pro:respeak-v5-100",
|
|
71
|
+
"voice-changer-pro:respeak-v4-",
|
|
72
|
+
"voice-changer-pro:respeak-v4-0",
|
|
73
|
+
"voice-changer-pro:respeak:v4-100",
|
|
74
|
+
"voice-changer-pro:sts-v4-10",
|
|
75
|
+
"voice-changer-pro:respeak-100-v4",
|
|
76
|
+
])("is not %s", (id) => {
|
|
77
|
+
expect(parseVoiceChangerProQuoteCreditId(id)).toBeUndefined()
|
|
78
|
+
})
|
|
79
|
+
})
|
package/src/add-captions-plan.ts
CHANGED
|
@@ -39,10 +39,16 @@ export function styleCaptionPlan(
|
|
|
39
39
|
const parsed = parseCaptionPlan(raw)
|
|
40
40
|
if ("error" in parsed) return { error: parsed.error }
|
|
41
41
|
const bodyLevers = captionPlanBodyLevers(nodeData, styler.leverKeys)
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const styled = styler.segmentsFor(parsed.plan, bodyLevers ? { bodyLevers } : undefined).segments
|
|
43
|
+
// The PARSED segments go on, never the helper's raw ones: the route's schema
|
|
44
|
+
// fills each word entry's defaults (`timestampMs` / `confidence` → null), and a
|
|
45
|
+
// DAG payload never passes the route, so returning the raw list sent a server
|
|
46
|
+
// run word entries the add-captions route itself would have completed.
|
|
47
|
+
const segments: Record<string, unknown>[] = []
|
|
48
|
+
for (let i = 0; i < styled.length; i++) {
|
|
49
|
+
const r = captionSegmentInputSchema.safeParse(styled[i])
|
|
45
50
|
if (!r.success) return { error: `Caption plan: segment ${i + 1}: ${r.error.issues[0]?.message ?? "invalid"}.` }
|
|
51
|
+
segments.push(r.data)
|
|
46
52
|
}
|
|
47
53
|
const overlap = findSegmentOverlap(segments as { startMs: number; endMs: number }[])
|
|
48
54
|
if (overlap) return { error: `Caption plan: ${overlap}.` }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A caption line never starts or ends on a lone dash.
|
|
3
|
+
*
|
|
4
|
+
* A speech engine times a dash written between two spaces ("Nodaro — every model")
|
|
5
|
+
* as a token of its own, and forced alignment keeps it. Inside a line the dash
|
|
6
|
+
* reads as written; at a line's edge — the line breaks right after it, or the
|
|
7
|
+
* next line opens with it — it reads as a stray mark. The display drops such a
|
|
8
|
+
* token from the edge of the line it lands on; the words keep their own timings.
|
|
9
|
+
*
|
|
10
|
+
* One rule for every place that breaks captions into lines: the render's line
|
|
11
|
+
* grouping (word-timed captions) and the wrap of a static text block.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** Dash characters only: hyphen-minus, the Unicode hyphens and dashes (U+2010–U+2015), minus, the Hebrew maqaf, and their small/full-width forms. */
|
|
15
|
+
const BARE_DASH = /^[-‐-―−־﹘﹣-]+$/u
|
|
16
|
+
|
|
17
|
+
/** True when the token, trimmed, is nothing but dash characters ("—", "–", "-"). A hyphenated word ("ה-AI", "re-run") is not. */
|
|
18
|
+
export function isBareDashToken(text: string): boolean {
|
|
19
|
+
return BARE_DASH.test(text.trim())
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The items with every lone-dash token at either end removed (a copy; the input
|
|
24
|
+
* is never mutated). A line holding nothing but dashes comes back empty — the
|
|
25
|
+
* caller drops it rather than show it.
|
|
26
|
+
*/
|
|
27
|
+
export function trimEdgeDashTokens<T>(items: readonly T[], textOf: (item: T) => string): T[] {
|
|
28
|
+
let start = 0
|
|
29
|
+
let end = items.length
|
|
30
|
+
while (start < end && isBareDashToken(textOf(items[start]!))) start++
|
|
31
|
+
while (end > start && isBareDashToken(textOf(items[end - 1]!))) end--
|
|
32
|
+
return items.slice(start, end)
|
|
33
|
+
}
|
package/src/component-types.ts
CHANGED
|
@@ -18,6 +18,15 @@ export interface ExposedSetting {
|
|
|
18
18
|
/** Full option list with labels for select fields (preferred over allowedValues). */
|
|
19
19
|
options?: Array<{ value: string; label: string }>
|
|
20
20
|
defaultValue: unknown
|
|
21
|
+
/**
|
|
22
|
+
* Set when the setting is one of the node's quick settings (the editor's bottom-bar levers): the node type,
|
|
23
|
+
* so the consuming workflow can render the same control, and the node's own lever values its choices depend
|
|
24
|
+
* on (its model, Draft, …), so the control offers what that model takes. Never prompts or results.
|
|
25
|
+
*/
|
|
26
|
+
quick?: {
|
|
27
|
+
nodeType: string
|
|
28
|
+
context?: Record<string, string | number | boolean>
|
|
29
|
+
}
|
|
21
30
|
}
|
|
22
31
|
|
|
23
32
|
export interface ComponentMetadata {
|
|
@@ -14,7 +14,7 @@ export {
|
|
|
14
14
|
imageOverlayCredits,
|
|
15
15
|
} from "./image-overlay.js"
|
|
16
16
|
|
|
17
|
-
export { VIDEO_SFX_PRICING, videoSfxCreditId } from "./video-sfx.js"
|
|
17
|
+
export { VIDEO_SFX_PRICING, videoSfxCreditId, videoSfxQuoteCreditId } from "./video-sfx.js"
|
|
18
18
|
|
|
19
19
|
export {
|
|
20
20
|
TEXT_TO_AUDIO_PRICING,
|
|
@@ -49,13 +49,34 @@ export {
|
|
|
49
49
|
speechUnitCreditId,
|
|
50
50
|
speechPriceUnits,
|
|
51
51
|
speechCredits,
|
|
52
|
+
speechQuoteCreditId,
|
|
53
|
+
parseSpeechQuoteCreditId,
|
|
54
|
+
isSpeechLengthPriceId,
|
|
55
|
+
speechLengthPriceModel,
|
|
56
|
+
type SpeechQuoteCreditIdParts,
|
|
52
57
|
} from "./speech.js"
|
|
53
58
|
|
|
59
|
+
export {
|
|
60
|
+
unitQuoteCreditId,
|
|
61
|
+
parseUnitQuoteCreditId,
|
|
62
|
+
type UnitQuoteCreditIdParts,
|
|
63
|
+
} from "./unit-quote.js"
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
VOICE_CHANGER_PRO_QUOTE_RATE_ID,
|
|
67
|
+
voiceChangerProQuoteCreditId,
|
|
68
|
+
parseVoiceChangerProQuoteCreditId,
|
|
69
|
+
type VoiceChangerProQuoteSlot,
|
|
70
|
+
type VoiceChangerProQuoteCreditIdParts,
|
|
71
|
+
type VoiceChangerProQuoteRespeakEngine,
|
|
72
|
+
} from "./voice-changer-pro-quote.js"
|
|
73
|
+
|
|
54
74
|
export {
|
|
55
75
|
PITCH_TEMPO_PRICING,
|
|
56
76
|
PITCH_TEMPO_LIMITS,
|
|
57
77
|
pitchTempoStartedMinutes,
|
|
58
78
|
pitchTempoCreditId,
|
|
79
|
+
pitchTempoQuoteCreditId,
|
|
59
80
|
parsePitchTempoCreditId,
|
|
60
81
|
pitchTempoBaseCredits,
|
|
61
82
|
semitonesToPitchRatio,
|
|
@@ -36,7 +36,8 @@ export const PITCH_TEMPO_LIMITS = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Started minutes of an input of `durationSec` seconds: ceil(sec / 60), at
|
|
38
38
|
* least 1, at most 30. An unknown or non-positive length counts as one minute
|
|
39
|
-
*
|
|
39
|
+
* here; a quote of an unknown length names 30 instead
|
|
40
|
+
* ({@link pitchTempoQuoteCreditId}), and a run always measures.
|
|
40
41
|
*/
|
|
41
42
|
export function pitchTempoStartedMinutes(durationSec: number | null | undefined): number {
|
|
42
43
|
if (typeof durationSec !== "number" || !Number.isFinite(durationSec) || durationSec <= 0) return 1
|
|
@@ -48,6 +49,19 @@ export function pitchTempoCreditId(durationSec: number | null | undefined): stri
|
|
|
48
49
|
return `pitch-tempo:${pitchTempoStartedMinutes(durationSec)}m`
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
/**
|
|
53
|
+
* The id a QUOTE names for an input of `durationSec` seconds — every estimate
|
|
54
|
+
* before a run. A known length is the id its run reserves
|
|
55
|
+
* ({@link pitchTempoCreditId}). An UNKNOWN length is the 30-minute id
|
|
56
|
+
* (decided 2026-10-13): a run measures the file before it reserves and refuses
|
|
57
|
+
* one it cannot measure or one over 30 minutes, so 30 minutes is the most any
|
|
58
|
+
* run can be charged and the quote is never below the charge.
|
|
59
|
+
*/
|
|
60
|
+
export function pitchTempoQuoteCreditId(durationSec: number | null | undefined): string {
|
|
61
|
+
const known = typeof durationSec === "number" && Number.isFinite(durationSec) && durationSec > 0
|
|
62
|
+
return pitchTempoCreditId(known ? durationSec : PITCH_TEMPO_PRICING.MAX_DURATION_SEC)
|
|
63
|
+
}
|
|
64
|
+
|
|
51
65
|
/** The minutes of a `pitch-tempo:<N>m` id (1 ≤ N ≤ 30), or `undefined` for any other id. */
|
|
52
66
|
export function parsePitchTempoCreditId(id: string): { minutes: number } | undefined {
|
|
53
67
|
const m = /^pitch-tempo:(\d+)m$/.exec(id)
|