@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,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The UGC wires of a language whose clips are cut from one recorded speech (the
|
|
3
|
+
* segmented lane): UGC Clips' prelude (record the speech, time its words, split
|
|
4
|
+
* it at its pauses, then ask for the clips again with the segments) and UGC
|
|
5
|
+
* Finish (lay the speech back over the rendered clips and trim the dead air,
|
|
6
|
+
* as one job over all of them). One pure implementation both engines call, as
|
|
7
|
+
* the rest of the UGC wires (`ugc-node-wires.ts`).
|
|
8
|
+
*
|
|
9
|
+
* Content-free: an answer is read only for `phase`, its three calls' `tool`
|
|
10
|
+
* and `args` (argument names, never their meaning), the `finish` call's
|
|
11
|
+
* `args`, and a finished job's clip list. Which language takes this lane, which
|
|
12
|
+
* voice speaks and what the calls say are the builder's.
|
|
13
|
+
*/
|
|
14
|
+
import {
|
|
15
|
+
UGC_FINISH_NEEDS_CLIPS_MESSAGE,
|
|
16
|
+
UGC_FINISH_NOT_READY_MESSAGE,
|
|
17
|
+
UGC_NEEDS_FINISH_MESSAGE,
|
|
18
|
+
UGC_NEWER_APP_MESSAGE,
|
|
19
|
+
UGC_NODE_MESSAGES,
|
|
20
|
+
UGC_OVER_HOLD_MESSAGE,
|
|
21
|
+
UGC_SCRIPT_LANGUAGES,
|
|
22
|
+
readUgcWire,
|
|
23
|
+
ugcPlanLengthSec,
|
|
24
|
+
ugcPlanScreenshotCount,
|
|
25
|
+
} from "./ugc-node-wires.js"
|
|
26
|
+
import type { FanOutItemMeta } from "./fan-out-meta.js"
|
|
27
|
+
|
|
28
|
+
type Obj = Record<string, unknown>
|
|
29
|
+
const isObject = (x: unknown): x is Obj => !!x && typeof x === "object" && !Array.isArray(x)
|
|
30
|
+
|
|
31
|
+
/** UGC Finish's node type. Not the plugin job it runs (`ugc-finish`): a price, a dispatch or a reconcile keyed on a type never confuses the two. */
|
|
32
|
+
export const UGC_FINISH_CLIPS_TYPE = "ugc-finish-clips"
|
|
33
|
+
|
|
34
|
+
/** The child steps of UGC Clips' prelude, in run order: each is a job of its own, keyed by its step. */
|
|
35
|
+
export const UGC_PRELUDE_STEPS = ["speech", "alignment", "split"] as const
|
|
36
|
+
export type UgcPreludeStep = (typeof UGC_PRELUDE_STEPS)[number]
|
|
37
|
+
|
|
38
|
+
/** The public route each prelude step runs on, and the node type its job is read as. */
|
|
39
|
+
export const UGC_PRELUDE_ROUTES: Readonly<Record<UgcPreludeStep, { readonly path: string; readonly jobType: string }>> = {
|
|
40
|
+
speech: { path: "/v1/text-to-speech", jobType: "text-to-speech" },
|
|
41
|
+
alignment: { path: "/v1/forced-alignment", jobType: "forced-alignment" },
|
|
42
|
+
split: { path: "/v1/ugc/segments", jobType: "ugc-segments" },
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The `/v1/ugc/clips` answer's phase: 1 = the prelude must run first, 2 = the clips; null = an answer with no phase (one call, as English). */
|
|
46
|
+
export function ugcClipsPhase(answer: Readonly<Obj>): 1 | 2 | null {
|
|
47
|
+
return answer.phase === 1 ? 1 : answer.phase === 2 ? 2 : null
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const callOf = (raw: unknown, tool: string): Obj | undefined => {
|
|
51
|
+
if (!isObject(raw) || raw.tool !== tool || !isObject(raw.args)) return undefined
|
|
52
|
+
return raw.args
|
|
53
|
+
}
|
|
54
|
+
const pick = (a: Readonly<Obj>, from: string, to: string): Obj => (a[from] !== undefined && a[from] !== null ? { [to]: a[from] } : {})
|
|
55
|
+
|
|
56
|
+
/** What the prelude runs: the speech's route body, and the two that need the step before them. */
|
|
57
|
+
export interface UgcPrelude {
|
|
58
|
+
readonly speech: Obj
|
|
59
|
+
readonly alignment: (audioUrl: string) => Obj
|
|
60
|
+
readonly split: (audioUrl: string, alignment: unknown) => Obj
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A phase-1 answer's three calls (`speech`, `align`, `split`, MCP argument names) → the REST bodies of
|
|
65
|
+
* the public routes their MCP tools dispatch to: `generate_speech` → `/v1/text-to-speech` (text, voice,
|
|
66
|
+
* voice type, model as provider, language code, as the verb maps them), `forced_alignment` →
|
|
67
|
+
* `/v1/forced-alignment` (the transcript, with the speech's audio), `ugc_split_speech` →
|
|
68
|
+
* `/v1/ugc/segments` (the plan, with the speech's audio and its word timings). A call that is missing
|
|
69
|
+
* or names another tool → the newer-app sentence: the app never guesses.
|
|
70
|
+
*/
|
|
71
|
+
export function ugcPrelude(answer: Readonly<Obj>): UgcPrelude | { readonly error: string } {
|
|
72
|
+
const speech = callOf(answer.speech, "generate_speech")
|
|
73
|
+
const align = callOf(answer.align, "forced_alignment")
|
|
74
|
+
const split = callOf(answer.split, "ugc_split_speech")
|
|
75
|
+
if (!speech || !align || !split || typeof speech.text !== "string" || !isObject(split.plan)) return { error: UGC_NEWER_APP_MESSAGE }
|
|
76
|
+
return {
|
|
77
|
+
speech: {
|
|
78
|
+
text: speech.text,
|
|
79
|
+
...pick(speech, "voice_id", "voice"),
|
|
80
|
+
...pick(speech, "voice_type", "voiceType"),
|
|
81
|
+
...pick(speech, "model", "provider"),
|
|
82
|
+
...pick(speech, "language_code", "languageCode"),
|
|
83
|
+
},
|
|
84
|
+
alignment: (audioUrl) => ({ ...pick(align, "transcript", "transcript"), audioUrl }),
|
|
85
|
+
split: (audioUrl, alignment) => ({ plan: split.plan, audioUrl, alignment }),
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** The finished speech job's audio, its word timings and its segments, as their jobs write them. */
|
|
90
|
+
export function ugcPreludeOutput(step: UgcPreludeStep, output: Readonly<Obj> | undefined): { value: unknown } | { error: string } {
|
|
91
|
+
const value = step === "speech" ? output?.audioUrl : step === "alignment" ? output?.alignment : output?.segments
|
|
92
|
+
const ok = step === "speech" ? typeof value === "string" && value !== "" : Array.isArray(value) && value.length > 0
|
|
93
|
+
return ok ? { value } : { error: UGC_NEWER_APP_MESSAGE }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** The second `/v1/ugc/clips` call: the first call's body with the segments the split returned. */
|
|
97
|
+
export function ugcClipsPhase2Body(body: Readonly<Obj>, segments: readonly unknown[]): Obj {
|
|
98
|
+
return { ...body, segments: [...segments] }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ── The hold check once the speech is split ──────────────────────────────────
|
|
102
|
+
|
|
103
|
+
/** The estimate input of a video cut from one recorded speech, as the hold check names it (`runEstimate`). */
|
|
104
|
+
export interface UgcRunEstimateInput {
|
|
105
|
+
readonly targetDurationSec: number
|
|
106
|
+
readonly screenshotCount: number
|
|
107
|
+
readonly source: "sampled"
|
|
108
|
+
readonly language: string
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The estimate input of the video a UGC Clips run belongs to, read from the plan the node was sent: its
|
|
113
|
+
* length, its screenshot cards and its language — the reading a kept plan is priced with. Read on a
|
|
114
|
+
* phase-1 answer, before the prelude spends anything, so a plan the check cannot read refuses the run
|
|
115
|
+
* while nothing is paid. The creator's source prices no clip, so it is not read. A plan without a length,
|
|
116
|
+
* or without a language this lane takes → the newer-app sentence: the check never guesses.
|
|
117
|
+
*/
|
|
118
|
+
export function ugcRunEstimateInput(plan: unknown): { runEstimate: UgcRunEstimateInput } | { error: string } {
|
|
119
|
+
const targetDurationSec = ugcPlanLengthSec(plan)
|
|
120
|
+
const language = planOf(plan)?.language
|
|
121
|
+
if (targetDurationSec === undefined || typeof language !== "string" || language === "en" || !(UGC_SCRIPT_LANGUAGES as readonly unknown[]).includes(language)) {
|
|
122
|
+
return { error: UGC_NEWER_APP_MESSAGE }
|
|
123
|
+
}
|
|
124
|
+
return { runEstimate: { targetDurationSec, screenshotCount: ugcPlanScreenshotCount(plan) ?? 0, source: "sampled", language } }
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The quote that checks a video cut from one recorded speech before any of its clips renders: the clips
|
|
129
|
+
* the second `/v1/ugc/clips` call handed on, priced as the UGC Clips quote prices them (`tickets`,
|
|
130
|
+
* `hasCards`, `finishes`), with `runEstimate` (`ugcRunEstimateInput`). The route then also answers
|
|
131
|
+
* `runHold`, the most the video's estimate holds for the clips and the steps after them, which the run's
|
|
132
|
+
* balance was checked against before it started (`ugcRenderHoldVerdict`). No clips → the newer-app sentence.
|
|
133
|
+
*/
|
|
134
|
+
export function ugcRenderHoldBody(input: { runEstimate: UgcRunEstimateInput; tickets: unknown; hasCards: boolean; finishes: boolean }): { path: "/v1/ugc/quote"; body: Obj } | { error: string } {
|
|
135
|
+
if (!Array.isArray(input.tickets) || input.tickets.length === 0) return { error: UGC_NEWER_APP_MESSAGE }
|
|
136
|
+
return {
|
|
137
|
+
path: "/v1/ugc/quote",
|
|
138
|
+
body: {
|
|
139
|
+
tickets: [...input.tickets],
|
|
140
|
+
hasCards: input.hasCards,
|
|
141
|
+
...(input.finishes ? { finishes: true } : {}),
|
|
142
|
+
runEstimate: { ...input.runEstimate },
|
|
143
|
+
},
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** A plan, or its wire (a JSON string), as an object; undefined for anything else. */
|
|
148
|
+
function planOf(plan: unknown): Obj | undefined {
|
|
149
|
+
if (typeof plan !== "string") return isObject(plan) ? plan : undefined
|
|
150
|
+
try {
|
|
151
|
+
const parsed: unknown = JSON.parse(plan)
|
|
152
|
+
return isObject(parsed) ? parsed : undefined
|
|
153
|
+
} catch {
|
|
154
|
+
return undefined
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const isCredits = (x: unknown): x is number => typeof x === "number" && Number.isFinite(x) && x >= 0
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The hold check's answer → go on, or stop before any clip renders: the clips and the steps after them
|
|
162
|
+
* (`ceiling`, each clip at its hold) over what the run was checked for (`runHold`) → the over-hold
|
|
163
|
+
* sentence. An answer without both figures stops too (the newer-app sentence): a clip never renders
|
|
164
|
+
* on a figure nobody checked.
|
|
165
|
+
*/
|
|
166
|
+
export function ugcRenderHoldVerdict(answer: unknown): { readonly ok: true } | { readonly error: string } {
|
|
167
|
+
if (!isObject(answer) || !isCredits(answer.ceiling) || !isCredits(answer.runHold)) return { error: UGC_NEWER_APP_MESSAGE }
|
|
168
|
+
return answer.ceiling > answer.runHold ? { error: UGC_OVER_HOLD_MESSAGE } : { ok: true }
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// ── UGC Finish ───────────────────────────────────────────────────────────────
|
|
172
|
+
|
|
173
|
+
/** What UGC Finish does with the clips it was handed. */
|
|
174
|
+
export type UgcFinishPlan =
|
|
175
|
+
/** No finish call on the plan (English): the clips go on as they came, no call, no job. */
|
|
176
|
+
| { readonly kind: "pass"; readonly clips: readonly string[] }
|
|
177
|
+
/** The finish job's body: the segments with their room, one roll per clip, in order. */
|
|
178
|
+
| { readonly kind: "job"; readonly path: "/v1/ugc/finish"; readonly body: Obj }
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* UGC Finish's input → what it does. The `plan` input is UGC Clips' Script (sized) output; a plan
|
|
182
|
+
* carrying `finish` (the segmented lane) asks for the finish job over the clips, in order; any other
|
|
183
|
+
* plan passes the clips through. Clips are the fan-in list (`inputs.inputs`), in clip order.
|
|
184
|
+
*/
|
|
185
|
+
export function ugcFinishPlan(input: { planOutWire: unknown; clipUrls: readonly unknown[] }): UgcFinishPlan | { readonly error: string } {
|
|
186
|
+
const clips = input.clipUrls.filter((u): u is string => typeof u === "string" && u !== "")
|
|
187
|
+
if (clips.length === 0) return { error: UGC_FINISH_NEEDS_CLIPS_MESSAGE }
|
|
188
|
+
const read = readUgcWire(input.planOutWire, UGC_NODE_MESSAGES.needsPlanOut)
|
|
189
|
+
if ("error" in read) return read
|
|
190
|
+
const finish = read.value.finish
|
|
191
|
+
if (finish === undefined) return { kind: "pass", clips }
|
|
192
|
+
if (!isObject(finish) || !Array.isArray(finish.segments) || finish.segments.length === 0) return { error: UGC_NEWER_APP_MESSAGE }
|
|
193
|
+
if (finish.segments.length !== clips.length) return { error: UGC_NEWER_APP_MESSAGE }
|
|
194
|
+
return {
|
|
195
|
+
kind: "job",
|
|
196
|
+
path: "/v1/ugc/finish",
|
|
197
|
+
body: { segments: finish.segments, clips: clips.map((url, i) => ({ clip: i + 1, rolls: [url] })) },
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** A finished clip, as UGC Finish hands it on: its URL and the notes its downstream nodes read. */
|
|
202
|
+
export interface UgcFinishedClip { readonly url: string; readonly meta: FanOutItemMeta }
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* A finished `ugc-finish` job → the finished clips in clip order, each with its real length. `ready: false`
|
|
206
|
+
* (a clip that does not follow its speech) → the not-ready sentence: the node fails, never hands on a
|
|
207
|
+
* partial list. A dry finish's warning rides every clip's notes.
|
|
208
|
+
*/
|
|
209
|
+
export function ugcFinishOutputs(output: Readonly<Obj> | undefined): { clips: UgcFinishedClip[] } | { error: string } {
|
|
210
|
+
if (!output) return { error: UGC_NEWER_APP_MESSAGE }
|
|
211
|
+
if (output.ready === false) return { error: UGC_FINISH_NOT_READY_MESSAGE }
|
|
212
|
+
if (output.ready !== true || !Array.isArray(output.clips) || output.clips.length === 0) return { error: UGC_NEWER_APP_MESSAGE }
|
|
213
|
+
const warnings = Array.isArray(output.warnings)
|
|
214
|
+
? output.warnings.flatMap((w) => (isObject(w) && typeof w.code === "string" ? [w.code] : typeof w === "string" ? [w] : []))
|
|
215
|
+
: []
|
|
216
|
+
const rows = [...output.clips].filter(isObject).sort((a, b) => Number(a.clip) - Number(b.clip))
|
|
217
|
+
if (rows.length !== output.clips.length || rows.some((r, i) => r.clip !== i + 1 || typeof r.url !== "string" || r.url === "")) return { error: UGC_NEWER_APP_MESSAGE }
|
|
218
|
+
return {
|
|
219
|
+
clips: rows.map((r) => ({
|
|
220
|
+
url: r.url as string,
|
|
221
|
+
meta: { warnings, durationSec: typeof r.sec === "number" && Number.isFinite(r.sec) && r.sec > 0 ? r.sec : null },
|
|
222
|
+
})),
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Whether a UGC Finish reads this UGC Clips node's Script (sized) output: the graph can finish a video
|
|
228
|
+
* whose clips are cut from one recorded speech. Read before the prelude spends anything.
|
|
229
|
+
*/
|
|
230
|
+
export function ugcFinishWired(
|
|
231
|
+
edges: ReadonlyArray<{ readonly source?: string; readonly target?: string; readonly sourceHandle?: string | null; readonly targetHandle?: string | null }>,
|
|
232
|
+
nodes: ReadonlyArray<{ readonly id?: string; readonly type?: string | null }>,
|
|
233
|
+
clipsId: string,
|
|
234
|
+
): boolean {
|
|
235
|
+
const finishIds = new Set(nodes.filter((n) => n.type === UGC_FINISH_CLIPS_TYPE && typeof n.id === "string").map((n) => n.id as string))
|
|
236
|
+
return edges.some((e) => e.source === clipsId && e.sourceHandle === "plan-out" && e.target !== undefined && finishIds.has(e.target) && (e.targetHandle ?? "") === "plan")
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** UGC Clips' refusal before its prelude: the sentence when no UGC Finish reads its Script (sized) output, else null. */
|
|
240
|
+
export function ugcLaneNeedsFinish(
|
|
241
|
+
edges: Parameters<typeof ugcFinishWired>[0],
|
|
242
|
+
nodes: Parameters<typeof ugcFinishWired>[1],
|
|
243
|
+
clipsId: string,
|
|
244
|
+
): string | null {
|
|
245
|
+
return ugcFinishWired(edges, nodes, clipsId) ? null : UGC_NEEDS_FINISH_MESSAGE
|
|
246
|
+
}
|
package/src/ugc-node-wires.ts
CHANGED
|
@@ -42,6 +42,21 @@ const NEEDS_PLAN = "Connect the Script output of UGC Script."
|
|
|
42
42
|
const NEEDS_TICKET = "Connect the Clips output of UGC Clips."
|
|
43
43
|
const NEEDS_VIDEO = "Connect the joined video."
|
|
44
44
|
const NEEDS_TRANSCRIPT = "Connect the Transcript output of UGC Clips."
|
|
45
|
+
/**
|
|
46
|
+
* A run of a video whose clips are cut from one recorded speech, on a graph with no UGC Finish on this UGC
|
|
47
|
+
* Clips' Script (sized) output: refused before anything is spent.
|
|
48
|
+
*/
|
|
49
|
+
export const UGC_NEEDS_FINISH_MESSAGE = "Add a UGC Finish node after UGC Clip, and connect UGC Clips' Script (sized) output to it."
|
|
50
|
+
/** UGC Finish with nothing on its clips input. */
|
|
51
|
+
export const UGC_FINISH_NEEDS_CLIPS_MESSAGE = "Connect the Video output of UGC Clip."
|
|
52
|
+
/** UGC Finish's job answered that a clip does not follow its speech (each clip checks itself first, so this is rare). */
|
|
53
|
+
export const UGC_FINISH_NOT_READY_MESSAGE = "A clip did not follow its speech. Re-render it from the UGC Clip node and run again."
|
|
54
|
+
/**
|
|
55
|
+
* A video cut from one recorded speech whose clips, priced once the speech is split, would hold more
|
|
56
|
+
* than the run was checked for before it started: the run stops at UGC Clips, before any clip renders.
|
|
57
|
+
*/
|
|
58
|
+
export const UGC_OVER_HOLD_MESSAGE =
|
|
59
|
+
"The clips for this recording would cost more than this run was checked for, so none was rendered. Run UGC Clips again to record the speech again."
|
|
45
60
|
|
|
46
61
|
/**
|
|
47
62
|
* Every fixed sentence a UGC node fails with, by id: the English both engines write on the node.
|
|
@@ -65,6 +80,10 @@ export const UGC_NODE_MESSAGES = Object.freeze({
|
|
|
65
80
|
needsTicket: NEEDS_TICKET,
|
|
66
81
|
needsVideo: NEEDS_VIDEO,
|
|
67
82
|
needsTranscript: NEEDS_TRANSCRIPT,
|
|
83
|
+
needsFinish: UGC_NEEDS_FINISH_MESSAGE,
|
|
84
|
+
finishNeedsClips: UGC_FINISH_NEEDS_CLIPS_MESSAGE,
|
|
85
|
+
finishNotReady: UGC_FINISH_NOT_READY_MESSAGE,
|
|
86
|
+
overHold: UGC_OVER_HOLD_MESSAGE,
|
|
68
87
|
} as const)
|
|
69
88
|
|
|
70
89
|
/** The id of a fixed sentence a UGC node fails with (`UGC_NODE_MESSAGES`). */
|
|
@@ -82,6 +101,7 @@ export const UGC_PRIMARY_HANDLE: Readonly<Record<string, string>> = {
|
|
|
82
101
|
"ugc-clips": "clips",
|
|
83
102
|
"ugc-clip": "video-out",
|
|
84
103
|
"ugc-cards": "layerPlan",
|
|
104
|
+
"ugc-finish-clips": "video-out",
|
|
85
105
|
}
|
|
86
106
|
|
|
87
107
|
/** A UGC node's outputs: handle id → the value that handle carries (a JSON string, text or a URL). */
|
|
@@ -378,17 +398,22 @@ export function ugcCreatorPick(candidates: unknown, index: number):
|
|
|
378
398
|
|
|
379
399
|
// ── UGC Script ───────────────────────────────────────────────────────────────
|
|
380
400
|
|
|
401
|
+
/** The languages a UGC script can be written in: the node's choice (`UgcScriptData.language`). */
|
|
402
|
+
export const UGC_SCRIPT_LANGUAGES = ["en", "he"] as const
|
|
403
|
+
export type UgcScriptLanguage = (typeof UGC_SCRIPT_LANGUAGES)[number]
|
|
404
|
+
|
|
381
405
|
/**
|
|
382
406
|
* The `/v1/ugc/script` body: the product name or website (required), the screenshot slots
|
|
383
407
|
* in card order with the empty ones dropped, the product image when set, the target length
|
|
384
|
-
* (`UGC_SCRIPT_DEFAULT_TARGET_SEC` when the node holds no number), and
|
|
385
|
-
*
|
|
408
|
+
* (`UGC_SCRIPT_DEFAULT_TARGET_SEC` when the node holds no number), and the language (the
|
|
409
|
+
* node's choice; English when it holds none or one this app does not know).
|
|
386
410
|
*/
|
|
387
411
|
export function ugcScriptBody(input: {
|
|
388
412
|
site?: string
|
|
389
413
|
screenshots: ReadonlyArray<string | undefined>
|
|
390
414
|
productImage?: string
|
|
391
415
|
targetDurationSec?: number
|
|
416
|
+
language?: unknown
|
|
392
417
|
}): { body: Record<string, unknown> } | { error: string } {
|
|
393
418
|
const site = filled(input.site)?.trim()
|
|
394
419
|
if (!site) return { error: NEEDS_SITE }
|
|
@@ -399,7 +424,7 @@ export function ugcScriptBody(input: {
|
|
|
399
424
|
screenshots: input.screenshots.filter((s): s is string => filled(s) !== undefined),
|
|
400
425
|
...(productImage ? { productImage } : {}),
|
|
401
426
|
targetDurationSec: typeof input.targetDurationSec === "number" ? input.targetDurationSec : UGC_SCRIPT_DEFAULT_TARGET_SEC,
|
|
402
|
-
language: "en",
|
|
427
|
+
language: (UGC_SCRIPT_LANGUAGES as readonly unknown[]).includes(input.language) ? input.language : "en",
|
|
403
428
|
},
|
|
404
429
|
}
|
|
405
430
|
}
|
|
@@ -480,12 +505,13 @@ export function ugcClipsBody(input: { planWire: unknown; creatorWire: unknown; v
|
|
|
480
505
|
|
|
481
506
|
/**
|
|
482
507
|
* The `/v1/ugc/clips` answer → the tickets (one per clip, as JSON strings), `clips` (the
|
|
483
|
-
* first), `plan-out` (`{ v: 1, plan, transcribeArgs }` for UGC Cards), `transcript`,
|
|
484
|
-
*
|
|
508
|
+
* first), `plan-out` (`{ v: 1, plan, transcribeArgs }` for UGC Cards), `transcript`, whether
|
|
509
|
+
* the plan has cards, and whether the clips go through UGC Finish's job (`finishes`: the plan-out
|
|
510
|
+
* carries a finish call, which is what UGC Finish reads to run it). An answer with errors → "The script needs changes: …" with each
|
|
485
511
|
* error and its fix; an answer without the parts UGC Cards needs fails here, before any clip
|
|
486
512
|
* is paid for.
|
|
487
513
|
*/
|
|
488
|
-
export function ugcClipsOutputs(answer: Record<string, unknown>): { outputs: UgcOutputs; tickets: string[]; hasCards: boolean } | { error: string } {
|
|
514
|
+
export function ugcClipsOutputs(answer: Record<string, unknown>): { outputs: UgcOutputs; tickets: string[]; hasCards: boolean; finishes: boolean } | { error: string } {
|
|
489
515
|
const errors = Array.isArray(answer.errors) ? answer.errors : []
|
|
490
516
|
if (errors.length > 0) {
|
|
491
517
|
const said = errors.flatMap((e) => (isObject(e) ? [filled(e.message), filled(e.fix)] : [])).filter((s): s is string => s !== undefined)
|
|
@@ -498,10 +524,14 @@ export function ugcClipsOutputs(answer: Record<string, unknown>): { outputs: Ugc
|
|
|
498
524
|
const wires = tickets.map((t) => JSON.stringify(t))
|
|
499
525
|
// The speech check's arguments ride to UGC Cards' transcription unread (an answer without them: none).
|
|
500
526
|
const transcribeArgs = isObject(speechCheckCall) && isObject(speechCheckCall.args) ? speechCheckCall.args : {}
|
|
527
|
+
// A video cut from one recorded speech (the segmented lane) also hands UGC Finish its finish call's
|
|
528
|
+
// arguments (the segments with their room), opaque; any other answer's plan-out is unchanged.
|
|
529
|
+
const finish = isObject(answer.finish) && isObject(answer.finish.args) ? { finish: answer.finish.args } : {}
|
|
501
530
|
return {
|
|
502
|
-
outputs: { clips: wires[0]!, "plan-out": JSON.stringify({ v: 1, plan: sizedPlan, transcribeArgs }), transcript },
|
|
531
|
+
outputs: { clips: wires[0]!, "plan-out": JSON.stringify({ v: 1, plan: sizedPlan, transcribeArgs, ...finish }), transcript },
|
|
503
532
|
tickets: wires,
|
|
504
533
|
hasCards: answer.hasCards === true,
|
|
534
|
+
finishes: "finish" in finish,
|
|
505
535
|
}
|
|
506
536
|
}
|
|
507
537
|
|
package/src/ugc-run-state.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** The
|
|
2
|
-
export const UGC_NODE_TYPES: ReadonlySet<string> = new Set(["ugc-creator", "ugc-script", "ugc-clips", "ugc-clip", "ugc-cards"])
|
|
1
|
+
/** The UGC node types (Cloud only; served by a private plugin). */
|
|
2
|
+
export const UGC_NODE_TYPES: ReadonlySet<string> = new Set(["ugc-creator", "ugc-script", "ugc-clips", "ugc-clip", "ugc-cards", "ugc-finish-clips"])
|
|
3
3
|
|
|
4
4
|
/** UGC Creator: the node-data key that holds a round's passing candidates until the person picks one (run state). */
|
|
5
5
|
export const UGC_CREATOR_CANDIDATES_KEY = "candidates"
|
|
@@ -33,6 +33,7 @@ export const UGC_NODE_RUN_STATE_KEYS: Readonly<Record<string, readonly string[]>
|
|
|
33
33
|
"generatedVideoUrl", "generatedResults", "activeResultIndex",
|
|
34
34
|
],
|
|
35
35
|
"ugc-cards": ["result", "ugcOutputs", "generatedText", "text"],
|
|
36
|
+
"ugc-finish-clips": ["ugcOutputs", "__listResults", "__listResultMeta", "generatedVideoUrl", "generatedResults", "activeResultIndex"],
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/**
|
|
@@ -44,10 +45,11 @@ export const UGC_NODE_RUN_STATE_KEYS: Readonly<Record<string, readonly string[]>
|
|
|
44
45
|
*/
|
|
45
46
|
export const UGC_OVERRIDABLE_FIELDS: Readonly<Record<string, readonly string[]>> = {
|
|
46
47
|
"ugc-creator": ["source", "gender", "photoUrl"],
|
|
47
|
-
"ugc-script": ["targetDurationSec"],
|
|
48
|
+
"ugc-script": ["targetDurationSec", "language"],
|
|
48
49
|
"ugc-clips": [],
|
|
49
50
|
"ugc-clip": [],
|
|
50
51
|
"ugc-cards": [],
|
|
52
|
+
"ugc-finish-clips": [],
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
const KEEP_RESULT_TYPES: ReadonlySet<string> = new Set(["ugc-creator", "ugc-script"])
|
|
@@ -116,46 +116,48 @@ export const VIDEO_ANALYSIS_WINDOW = { LEN: WINDOW_LEN, STRIDE: WINDOW_STRIDE, O
|
|
|
116
116
|
// the 8_482 → 8_706 round, the legacy `gemini-3-flash` family moves too.
|
|
117
117
|
// Output of the plugin's `scripts/gen-va-buckets.mjs`, pasted verbatim.
|
|
118
118
|
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
// the
|
|
124
|
-
//
|
|
119
|
+
// RESET 2026-10-14 to the DEPLOYED schedule (migration 357, the 9_082 pin). A
|
|
120
|
+
// 2026-09-06 regeneration (the 9_434 pin) moved these rows up by 1–5 credits
|
|
121
|
+
// but shipped no migration, so for five weeks every estimate, doc and tool
|
|
122
|
+
// description quoted a price no run was charged. This table is what
|
|
123
|
+
// `model_pricing` holds, not the generator's latest output: a regeneration
|
|
124
|
+
// lands TOGETHER with the migration that seeds it —
|
|
125
|
+
// `backend/src/ee/billing/__tests__/static-costs-match-migrations.test.ts`
|
|
126
|
+
// fails the build on any row that differs from its latest migration.
|
|
125
127
|
export const VIDEO_ANALYSIS_BUCKET_CREDITS: Record<string, number> = {
|
|
126
128
|
// Current fast tier (VIDEO_ANALYSIS_TIERS.fast; it was also the fast model
|
|
127
129
|
// before 2026-07).
|
|
128
130
|
"video-analysis:gemini-3-flash:60s": 181,
|
|
129
|
-
"video-analysis:gemini-3-flash:180s":
|
|
130
|
-
"video-analysis:gemini-3-flash:360s":
|
|
131
|
-
"video-analysis:gemini-3-flash:600s":
|
|
131
|
+
"video-analysis:gemini-3-flash:180s": 185,
|
|
132
|
+
"video-analysis:gemini-3-flash:360s": 515,
|
|
133
|
+
"video-analysis:gemini-3-flash:600s": 848,
|
|
132
134
|
// Legacy fast-tier model (backed the fast tier 2026-07 → 2026-07-29) — kept
|
|
133
135
|
// for stored raw-id configs; still ≤ pro per bucket.
|
|
134
|
-
"video-analysis:gemini-3.6-flash:60s":
|
|
136
|
+
"video-analysis:gemini-3.6-flash:60s": 204,
|
|
135
137
|
"video-analysis:gemini-3.6-flash:180s": 219,
|
|
136
|
-
"video-analysis:gemini-3.6-flash:360s":
|
|
137
|
-
"video-analysis:gemini-3.6-flash:600s":
|
|
138
|
-
"video-analysis:gemini-3.1-pro:60s":
|
|
139
|
-
"video-analysis:gemini-3.1-pro:180s":
|
|
140
|
-
"video-analysis:gemini-3.1-pro:360s":
|
|
141
|
-
"video-analysis:gemini-3.1-pro:600s":
|
|
138
|
+
"video-analysis:gemini-3.6-flash:360s": 602,
|
|
139
|
+
"video-analysis:gemini-3.6-flash:600s": 992,
|
|
140
|
+
"video-analysis:gemini-3.1-pro:60s": 216,
|
|
141
|
+
"video-analysis:gemini-3.1-pro:180s": 232,
|
|
142
|
+
"video-analysis:gemini-3.1-pro:360s": 640,
|
|
143
|
+
"video-analysis:gemini-3.1-pro:600s": 1056,
|
|
142
144
|
// Mixed tiers (`mixed` + `mixed-fast`) share ONE credit family — they are
|
|
143
145
|
// variants of the same engine plan (plan internals live in the private
|
|
144
146
|
// analysis plugin). Admin-tunable via model_pricing like every other row.
|
|
145
147
|
"video-analysis:mixed:60s": 270,
|
|
146
|
-
"video-analysis:mixed:180s":
|
|
147
|
-
"video-analysis:mixed:360s":
|
|
148
|
-
"video-analysis:mixed:600s":
|
|
148
|
+
"video-analysis:mixed:180s": 291,
|
|
149
|
+
"video-analysis:mixed:360s": 729,
|
|
150
|
+
"video-analysis:mixed:600s": 1177,
|
|
149
151
|
// SMART — the accuracy tier, and since the 2026-08-03 re-plan a multi-roll
|
|
150
152
|
// plan like the others, always refined (`selectionMode` does not apply
|
|
151
153
|
// here — smart always refines; it never offers a cheaper "choose" path).
|
|
152
154
|
// Priced above the economy tiers because it genuinely costs more to run;
|
|
153
155
|
// the only tier whose accuracy is validated against a hand-counted edit
|
|
154
156
|
// list, re-validated at the current plan before this schedule shipped.
|
|
155
|
-
"video-analysis:smart:60s":
|
|
156
|
-
"video-analysis:smart:180s":
|
|
157
|
-
"video-analysis:smart:360s":
|
|
158
|
-
"video-analysis:smart:600s":
|
|
157
|
+
"video-analysis:smart:60s": 413,
|
|
158
|
+
"video-analysis:smart:180s": 503,
|
|
159
|
+
"video-analysis:smart:360s": 1267,
|
|
160
|
+
"video-analysis:smart:600s": 2076,
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
/**
|
|
@@ -226,13 +228,13 @@ export function videoAnalysisNumWindows(bucketSec: number): number {
|
|
|
226
228
|
*/
|
|
227
229
|
export const VIDEO_AUDIT_BUCKET_CREDITS: Record<string, number> = {
|
|
228
230
|
"video-audit:60s": 215,
|
|
229
|
-
"video-audit:180s":
|
|
230
|
-
"video-audit:360s":
|
|
231
|
-
"video-audit:600s":
|
|
231
|
+
"video-audit:180s": 290,
|
|
232
|
+
"video-audit:360s": 663,
|
|
233
|
+
"video-audit:600s": 1073,
|
|
232
234
|
"video-audit:auto:60s": 396,
|
|
233
|
-
"video-audit:auto:180s":
|
|
234
|
-
"video-audit:auto:360s":
|
|
235
|
-
"video-audit:auto:600s":
|
|
235
|
+
"video-audit:auto:180s": 475,
|
|
236
|
+
"video-audit:auto:360s": 1178,
|
|
237
|
+
"video-audit:auto:600s": 1921,
|
|
236
238
|
}
|
|
237
239
|
|
|
238
240
|
/**
|