@nodaro/shared 3.30.0 → 3.32.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-2NIQO2J3.cjs +54 -0
- package/dist/chunk-2NIQO2J3.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-3CUFITU7.js +1905 -0
- package/dist/chunk-3CUFITU7.js.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-5AUSSJIM.cjs +3372 -0
- package/dist/chunk-5AUSSJIM.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-5THUHJ3E.js +46 -0
- package/dist/chunk-5THUHJ3E.js.map +1 -0
- package/dist/chunk-5U7VLG43.js +141 -0
- package/dist/chunk-5U7VLG43.js.map +1 -0
- package/dist/chunk-6DAWSVX2.cjs +103 -0
- package/dist/chunk-6DAWSVX2.cjs.map +1 -0
- package/dist/chunk-6DKDOWBL.js +1567 -0
- package/dist/chunk-6DKDOWBL.js.map +1 -0
- package/dist/chunk-6IJOPRZP.cjs +197 -0
- package/dist/chunk-6IJOPRZP.cjs.map +1 -0
- package/dist/chunk-7G7G42KS.js +86 -0
- package/dist/chunk-7G7G42KS.js.map +1 -0
- package/dist/chunk-AINCI23X.js +2171 -0
- package/dist/chunk-AINCI23X.js.map +1 -0
- package/dist/chunk-AROWPFO2.js +773 -0
- package/dist/chunk-AROWPFO2.js.map +1 -0
- package/dist/chunk-AVQK77G6.cjs +2000 -0
- package/dist/chunk-AVQK77G6.cjs.map +1 -0
- package/dist/chunk-C57NEO3X.js +3327 -0
- package/dist/chunk-C57NEO3X.js.map +1 -0
- package/dist/chunk-CK3GK34R.js +1381 -0
- package/dist/chunk-CK3GK34R.js.map +1 -0
- package/dist/chunk-E2TGXG6X.cjs +1770 -0
- package/dist/chunk-E2TGXG6X.cjs.map +1 -0
- package/dist/chunk-EK362Q45.cjs +38 -0
- package/dist/chunk-EK362Q45.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-G6IIVKMO.js +26 -0
- package/dist/chunk-G6IIVKMO.js.map +1 -0
- package/dist/chunk-HGC5JNVA.cjs +1503 -0
- package/dist/chunk-HGC5JNVA.cjs.map +1 -0
- package/dist/chunk-HSHCCBIV.js +255 -0
- package/dist/chunk-HSHCCBIV.js.map +1 -0
- package/dist/chunk-IEBZHTPE.js +254 -0
- package/dist/chunk-IEBZHTPE.js.map +1 -0
- package/dist/chunk-ISJDAFKS.js +1604 -0
- package/dist/chunk-ISJDAFKS.js.map +1 -0
- package/dist/chunk-J6KHW2E5.cjs +1963 -0
- package/dist/chunk-J6KHW2E5.cjs.map +1 -0
- package/dist/chunk-J7BMO73N.cjs +114 -0
- package/dist/chunk-J7BMO73N.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-JSNV5O2F.cjs +34 -0
- package/dist/chunk-JSNV5O2F.cjs.map +1 -0
- package/dist/chunk-JWA5SGCS.js +203 -0
- package/dist/chunk-JWA5SGCS.js.map +1 -0
- package/dist/chunk-JX5YZ4DH.cjs +430 -0
- package/dist/chunk-JX5YZ4DH.cjs.map +1 -0
- package/dist/chunk-KHCBJ7KD.js +42 -0
- package/dist/chunk-KHCBJ7KD.js.map +1 -0
- package/dist/chunk-KU6S7IYV.cjs +210 -0
- package/dist/chunk-KU6S7IYV.cjs.map +1 -0
- package/dist/chunk-LKAIXWK3.js +181 -0
- package/dist/chunk-LKAIXWK3.js.map +1 -0
- package/dist/chunk-LPW3XNC2.js +471 -0
- package/dist/chunk-LPW3XNC2.js.map +1 -0
- package/dist/chunk-M36G6SRP.js +447 -0
- package/dist/chunk-M36G6SRP.js.map +1 -0
- package/dist/chunk-MRXGWL42.cjs +4 -0
- package/dist/chunk-MRXGWL42.cjs.map +1 -0
- package/dist/chunk-NB72XWXQ.cjs +54 -0
- package/dist/chunk-NB72XWXQ.cjs.map +1 -0
- package/dist/chunk-NEJ2PV4C.cjs +211 -0
- package/dist/chunk-NEJ2PV4C.cjs.map +1 -0
- package/dist/chunk-NT6IJH4L.cjs +273 -0
- package/dist/chunk-NT6IJH4L.cjs.map +1 -0
- package/dist/chunk-O5MP52U2.cjs +526 -0
- package/dist/chunk-O5MP52U2.cjs.map +1 -0
- package/dist/chunk-O7PUQLJ3.cjs +818 -0
- package/dist/chunk-O7PUQLJ3.cjs.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-Q4CDQ2KO.js +21 -0
- package/dist/chunk-Q4CDQ2KO.js.map +1 -0
- package/dist/chunk-QELDJGDK.cjs +1714 -0
- package/dist/chunk-QELDJGDK.cjs.map +1 -0
- package/dist/chunk-QJRP44ZO.js +769 -0
- package/dist/chunk-QJRP44ZO.js.map +1 -0
- package/dist/chunk-QNGNOU4Z.js +29 -0
- package/dist/chunk-QNGNOU4Z.js.map +1 -0
- package/dist/chunk-RJL7RCEM.cjs +159 -0
- package/dist/chunk-RJL7RCEM.cjs.map +1 -0
- package/dist/chunk-RN3RMBJZ.js +1164 -0
- package/dist/chunk-RN3RMBJZ.js.map +1 -0
- package/dist/chunk-S5DMKUWK.cjs +1273 -0
- package/dist/chunk-S5DMKUWK.cjs.map +1 -0
- package/dist/chunk-SES6GDBQ.cjs +624 -0
- package/dist/chunk-SES6GDBQ.cjs.map +1 -0
- package/dist/chunk-TNPDV7I4.cjs +2346 -0
- package/dist/chunk-TNPDV7I4.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-ULXI7A6Q.cjs +1047 -0
- package/dist/chunk-ULXI7A6Q.cjs.map +1 -0
- package/dist/chunk-VIWSWVAW.js +1782 -0
- package/dist/chunk-VIWSWVAW.js.map +1 -0
- package/dist/chunk-VWGNPMJZ.cjs +19 -0
- package/dist/chunk-VWGNPMJZ.cjs.map +1 -0
- package/dist/chunk-WDIBOWAA.js +1054 -0
- package/dist/chunk-WDIBOWAA.js.map +1 -0
- package/dist/chunk-WNG7HRVA.cjs +25 -0
- package/dist/chunk-WNG7HRVA.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-XAMC4S53.js +17 -0
- package/dist/chunk-XAMC4S53.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-YHRG7UOC.js +31 -0
- package/dist/chunk-YHRG7UOC.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-Z4AZW6FY.js +920 -0
- package/dist/chunk-Z4AZW6FY.js.map +1 -0
- package/dist/chunk-ZDFHA2EC.js +572 -0
- package/dist/chunk-ZDFHA2EC.js.map +1 -0
- package/dist/chunk-ZNZDQAXN.js +175 -0
- package/dist/chunk-ZNZDQAXN.js.map +1 -0
- package/dist/chunk-ZRL2UFTH.cjs +1073 -0
- package/dist/chunk-ZRL2UFTH.cjs.map +1 -0
- package/dist/chunk-ZT77RY6R.js +404 -0
- package/dist/chunk-ZT77RY6R.js.map +1 -0
- package/dist/entries/apps.cjs +155 -0
- package/dist/entries/apps.cjs.map +1 -0
- package/dist/entries/apps.d.cts +283 -0
- package/dist/entries/apps.d.ts +283 -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 +592 -0
- package/dist/entries/credits.cjs.map +1 -0
- package/dist/entries/credits.d.cts +1429 -0
- package/dist/entries/credits.d.ts +1429 -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 +247 -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 +1733 -0
- package/dist/entries/workflow.d.ts +1733 -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 +7731 -26444
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -23733
- package/dist/index.d.ts +32 -23733
- package/dist/index.js +40 -24641
- package/dist/index.js.map +1 -1
- package/dist/model-catalog-flJYaa-g.d.cts +561 -0
- package/dist/model-catalog-flJYaa-g.d.ts +561 -0
- package/dist/presentation-types-0ENOCjoj.d.cts +61 -0
- package/dist/presentation-types-0ENOCjoj.d.ts +61 -0
- package/dist/presentation-utils-BIqiCzSA.d.cts +90 -0
- package/dist/presentation-utils-BdiObtwq.d.ts +90 -0
- package/dist/scene-node-types-DjenYFLO.d.cts +1949 -0
- package/dist/scene-node-types-DjenYFLO.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__/entity-image-handle.test.ts +61 -1
- package/src/__tests__/fixtures/root-exports.baseline.json +4625 -0
- package/src/__tests__/input-field-extra-keys.test.ts +1 -0
- package/src/__tests__/json-kinds.test.ts +10 -0
- package/src/__tests__/model-seed-capability.test.ts +34 -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-preset-extract.test.ts +8 -0
- package/src/__tests__/node-run-routes.test.ts +63 -0
- package/src/__tests__/node-runtime-keys.test.ts +70 -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 +14 -0
- package/src/__tests__/preview-gate-use-case.test.ts +151 -0
- package/src/__tests__/producer-types.test.ts +15 -0
- package/src/__tests__/run-continuation.test.ts +7 -1
- package/src/__tests__/seedance-draft.test.ts +74 -0
- package/src/__tests__/site-capture-node.test.ts +58 -0
- package/src/__tests__/ugc-clip-saved-list.test.ts +19 -0
- package/src/__tests__/ugc-lane-wires.test.ts +228 -0
- package/src/__tests__/ugc-node-wires.test.ts +606 -0
- package/src/__tests__/ugc-run-state.test.ts +85 -7
- 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/__tests__/workflow-export-strip.test.ts +14 -0
- package/src/add-captions-plan.ts +9 -3
- package/src/caption-edge-dash.ts +33 -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/entity-image-handle.ts +50 -1
- 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 +104 -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 +89 -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 -1838
- package/src/json-kinds.ts +13 -0
- package/src/model-catalog.ts +97 -36
- package/src/model-constants.ts +3 -0
- package/src/node-mappable-fields.ts +1 -0
- package/src/node-preset-export.ts +2 -2
- package/src/node-preset-extract.ts +6 -4
- package/src/node-run-routes.ts +78 -0
- package/src/node-runtime-keys.ts +50 -1
- package/src/normalize-node-params.ts +30 -0
- package/src/presentation-utils.ts +8 -0
- package/src/preview-gate.ts +92 -14
- package/src/producer-types.ts +26 -2
- package/src/run-continuation.ts +21 -0
- package/src/seedance-draft.ts +64 -0
- package/src/site-capture-node.ts +82 -0
- package/src/social-post.ts +13 -0
- package/src/ugc-lane-wires.ts +246 -0
- package/src/ugc-node-wires.ts +653 -0
- package/src/ugc-run-state.ts +65 -8
- package/src/video-analysis-pricing.ts +31 -29
- package/src/workflow-export.ts +3 -1
|
@@ -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
|
+
}
|