@nodaro/shared 3.31.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 -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-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__/fixtures/root-exports.baseline.json +4625 -0
- package/src/__tests__/input-field-extra-keys.test.ts +1 -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__/preview-gate-use-case.test.ts +151 -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/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 +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 +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 -1845
- package/src/json-kinds.ts +4 -0
- package/src/model-catalog.ts +36 -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 +5 -0
- package/src/preview-gate.ts +92 -14
- 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
|
@@ -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
|
+
}
|
|
@@ -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)
|
|
@@ -5,9 +5,14 @@
|
|
|
5
5
|
* add-on) is priced per STARTED 100 characters of the text actually sent,
|
|
6
6
|
* with a minimum number of units per request. The amount of one unit is a
|
|
7
7
|
* `model_pricing` row per model — `<model id>:per-100-chars`, admin-editable
|
|
8
|
-
* — and never lives here.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* — and never lives here. `speechCredits(chars, row)` is the list price of a
|
|
9
|
+
* request at a catalog row. An instance prices the WHOLE request and rounds it
|
|
10
|
+
* once, so the price it serves for one unit times the units is only an upper
|
|
11
|
+
* bound of what the request costs there. The exact charge of a
|
|
12
|
+
* request of N units is served under its own id, `speechQuoteCreditId(model,
|
|
13
|
+
* N)` (`<model>:per-100-chars:<N>u`), by the same price lookups that serve the
|
|
14
|
+
* unit row (credits.model-costs, GET /v1/credits/model-cost): a client quotes
|
|
15
|
+
* that answer rather than multiplying.
|
|
11
16
|
*
|
|
12
17
|
* Why 100 and not 1,000: the per-request error is at most one unit, and a
|
|
13
18
|
* whole number of units times a charged unit price never under-quotes the
|
|
@@ -15,7 +20,9 @@
|
|
|
15
20
|
*
|
|
16
21
|
* Decided 2026-10-06. Every name here is a published contract.
|
|
17
22
|
*/
|
|
18
|
-
import { canonicalTtsProvider } from "../tts-capabilities.js"
|
|
23
|
+
import { canonicalTtsProvider, findTtsCapabilities } from "../tts-capabilities.js"
|
|
24
|
+
import { findDialogueCapabilities } from "../dialogue-capabilities.js"
|
|
25
|
+
import { unitQuoteCreditId } from "./unit-quote.js"
|
|
19
26
|
|
|
20
27
|
/** Characters per price unit. */
|
|
21
28
|
export const SPEECH_PRICE_UNIT_CHARS = 100
|
|
@@ -49,3 +56,64 @@ export function speechPriceUnits(chars: number): number {
|
|
|
49
56
|
export function speechCredits(chars: number, perUnitCredits: number): number {
|
|
50
57
|
return speechPriceUnits(chars) * perUnitCredits
|
|
51
58
|
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The id of the exact charge of a whole request of `units` units on `modelId`:
|
|
62
|
+
* `<model>:per-100-chars:<N>u`. Never a row of its own — a price lookup prices
|
|
63
|
+
* it from the model's unit row × N as one whole, exactly as a request of that
|
|
64
|
+
* length is reserved. Served only while length pricing is on, like the unit
|
|
65
|
+
* row it is priced from.
|
|
66
|
+
*/
|
|
67
|
+
export function speechQuoteCreditId(modelId: string, units: number): string {
|
|
68
|
+
return unitQuoteCreditId(speechUnitCreditId(modelId), units)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** A `<model>:per-100-chars:<N>u` id, read back. */
|
|
72
|
+
export interface SpeechQuoteCreditIdParts {
|
|
73
|
+
/** The speech model (canonical id) the request runs as. */
|
|
74
|
+
model: string
|
|
75
|
+
/** Its `<model>:per-100-chars` unit row. */
|
|
76
|
+
unitId: string
|
|
77
|
+
/** Units priced: at least the floor, at most the model's per-request cap in started hundreds. */
|
|
78
|
+
units: number
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const SPEECH_QUOTE_ID = /^(.+):per-100-chars:(\d{1,6})u$/
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The parts of a `<model>:per-100-chars:<N>u` id, or undefined for any other id
|
|
85
|
+
* — including a model that is not a speech model under its canonical id, and a
|
|
86
|
+
* unit count no request on that model can be priced at (below the floor, or
|
|
87
|
+
* above the model's cap in started hundreds).
|
|
88
|
+
*/
|
|
89
|
+
export function parseSpeechQuoteCreditId(id: string): SpeechQuoteCreditIdParts | undefined {
|
|
90
|
+
if (typeof id !== "string") return undefined
|
|
91
|
+
const m = SPEECH_QUOTE_ID.exec(id)
|
|
92
|
+
if (!m) return undefined
|
|
93
|
+
const model = m[1]!
|
|
94
|
+
if (canonicalTtsProvider(model) !== model) return undefined
|
|
95
|
+
const caps = findTtsCapabilities(model) ?? findDialogueCapabilities(model)
|
|
96
|
+
if (!caps) return undefined
|
|
97
|
+
const units = Number(m[2])
|
|
98
|
+
if (!Number.isInteger(units) || units < SPEECH_FLOOR_UNITS || units > speechPriceUnits(caps.maxChars)) return undefined
|
|
99
|
+
return { model, unitId: speechUnitCreditId(model), units }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Whether an id is a length price of speech — a `<model>:per-100-chars` unit
|
|
104
|
+
* row or a `<model>:per-100-chars:<N>u` request quote — by its shape alone.
|
|
105
|
+
* Both are served only while the server prices speech by length.
|
|
106
|
+
*/
|
|
107
|
+
export function isSpeechLengthPriceId(id: string): boolean {
|
|
108
|
+
return typeof id === "string" && /:per-100-chars(?::\d+u)?$/.test(id)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The speech model a length price id is priced for — the id a request of
|
|
113
|
+
* that model is reserved at, so the two are priced under the same id — or
|
|
114
|
+
* undefined for any other id.
|
|
115
|
+
*/
|
|
116
|
+
export function speechLengthPriceModel(id: string): string | undefined {
|
|
117
|
+
if (!isSpeechLengthPriceId(id)) return undefined
|
|
118
|
+
return id.replace(/:per-100-chars(?::\d+u)?$/, "")
|
|
119
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The price of a whole run priced per unit, as ONE id.
|
|
3
|
+
*
|
|
4
|
+
* Some runs are charged a multiple of a one-unit price row: minutes of an
|
|
5
|
+
* Apply EDL or Speaker View render, 5-second steps of a Trim / Loop / Combine
|
|
6
|
+
* / Mask Composite result, seconds of an LTX extend or retake, started
|
|
7
|
+
* hundreds of a speech text. The server prices such a run as a whole — the
|
|
8
|
+
* row's base × the units, marked up ONCE and rounded up once — so a client
|
|
9
|
+
* that multiplies the served one-unit price (already rounded up) by the units
|
|
10
|
+
* can quote more than the run is charged.
|
|
11
|
+
*
|
|
12
|
+
* `unitQuoteCreditId(rateId, units)` names that whole price:
|
|
13
|
+
* `<rateId>:<units>u`. `POST /v1/credits/model-costs` and
|
|
14
|
+
* `GET /v1/credits/model-cost` answer it with the figure the run is charged,
|
|
15
|
+
* for a rate the server charges per unit and a unit count a run can have;
|
|
16
|
+
* any other id lands in `missing`. A client quotes that answer rather than
|
|
17
|
+
* multiplying. (A speech request's id, `<model>:per-100-chars:<N>u`, is this
|
|
18
|
+
* id on the model's per-100-characters row.)
|
|
19
|
+
*
|
|
20
|
+
* Units may be fractional — a retake window is set to the frame — and are
|
|
21
|
+
* written exactly as JavaScript prints the number, so the server reads back
|
|
22
|
+
* the same value the client priced.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** `<rateId>:<units>u` — the id of the whole price of `units` of `rateId`. */
|
|
26
|
+
export function unitQuoteCreditId(rateId: string, units: number): string {
|
|
27
|
+
return `${rateId}:${String(units)}u`
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** A `<rateId>:<units>u` id, read back. */
|
|
31
|
+
export interface UnitQuoteCreditIdParts {
|
|
32
|
+
/** The one-unit price row. */
|
|
33
|
+
rateId: string
|
|
34
|
+
/** How many of it the run is priced at (a positive number, possibly fractional). */
|
|
35
|
+
units: number
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const UNIT_QUOTE_ID = /^(.+):(\d{1,7}(?:\.\d{1,20})?)u$/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The parts of a `<rateId>:<units>u` id by its shape alone, or undefined. Which
|
|
42
|
+
* rates the server prices this way, and at how many units, is the server's to
|
|
43
|
+
* say: an id it does not price lands in `missing`.
|
|
44
|
+
*/
|
|
45
|
+
export function parseUnitQuoteCreditId(id: string): UnitQuoteCreditIdParts | undefined {
|
|
46
|
+
if (typeof id !== "string") return undefined
|
|
47
|
+
const m = UNIT_QUOTE_ID.exec(id)
|
|
48
|
+
if (!m) return undefined
|
|
49
|
+
const units = Number(m[2])
|
|
50
|
+
if (!Number.isFinite(units) || units <= 0) return undefined
|
|
51
|
+
return { rateId: m[1]!, units }
|
|
52
|
+
}
|
|
@@ -39,3 +39,18 @@ export function videoSfxCreditId(durationSec: number | null | undefined): string
|
|
|
39
39
|
const bucket = VIDEO_SFX_BUCKETS.find((b) => seconds <= b.upToSec) ?? VIDEO_SFX_BUCKETS[VIDEO_SFX_BUCKETS.length - 1]!
|
|
40
40
|
return bucket.creditId
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The price row a QUOTE names for an input video of `durationSec` seconds —
|
|
45
|
+
* every estimate before a run (the node's Run button, the workflow estimate,
|
|
46
|
+
* the server's run estimate, a listing). A known length is the row its run is
|
|
47
|
+
* charged ({@link videoSfxCreditId}). An UNKNOWN length is the last row, 300
|
|
48
|
+
* seconds (decided 2026-10-13): a run measures the clip before it reserves and
|
|
49
|
+
* refuses one over 300 s, so that row is the most any run can be charged —
|
|
50
|
+
* the quote is never below the charge, as Video Mask and Video Depth quote an
|
|
51
|
+
* unknown clip at their highest row.
|
|
52
|
+
*/
|
|
53
|
+
export function videoSfxQuoteCreditId(durationSec: number | null | undefined): string {
|
|
54
|
+
const known = typeof durationSec === "number" && Number.isFinite(durationSec) && durationSec > 0
|
|
55
|
+
return videoSfxCreditId(known ? durationSec : VIDEO_SFX_PRICING.MAX_DURATION_SEC)
|
|
56
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The price of a whole Voice Changer Pro convert, as ONE id.
|
|
3
|
+
*
|
|
4
|
+
* A convert is charged as one whole: every changed speaker's slot is priced in
|
|
5
|
+
* base credits (a recast slot by the length of its stem, a Re-speak slot by
|
|
6
|
+
* its characters on its engine's row), the slots are summed, and the sum is
|
|
7
|
+
* marked up ONCE at `voice-changer-pro`. A client that prices each slot on the
|
|
8
|
+
* served (already marked-up, already rounded) rows and adds them up cannot
|
|
9
|
+
* reach that figure: the rounding happens in a different place.
|
|
10
|
+
*
|
|
11
|
+
* `voiceChangerProQuoteCreditId(slots)` names the whole price:
|
|
12
|
+
* `voice-changer-pro:<slot>,<slot>,…`, one slot per changed speaker, where a
|
|
13
|
+
* slot is
|
|
14
|
+
*
|
|
15
|
+
* - `sts-<seconds>` — a recast (speech-to-speech) slot whose stem is that
|
|
16
|
+
* many seconds long (the speaker's last utterance end); `sts` alone when
|
|
17
|
+
* the length is unknown (priced as one minute, as the convert reserves it);
|
|
18
|
+
* - `respeak-<chars>` — a Re-speak slot on the default engine (v3) that
|
|
19
|
+
* re-speaks that many characters; `respeak` alone when the count is unknown;
|
|
20
|
+
* - `respeak-v4-<chars>` — a Re-speak slot on the v4 engine (`respeak-v4`
|
|
21
|
+
* when the count is unknown); `respeak-v3-<chars>` names v3 explicitly
|
|
22
|
+
* and is the same price as `respeak-<chars>`;
|
|
23
|
+
* - `respeak-v4t-<chars>` — a v4 slot speaking a TRANSLATION of its
|
|
24
|
+
* `<chars>` transcript characters. The convert reserves such a slot for more
|
|
25
|
+
* speech than its transcript holds (a line may be re-rendered once,
|
|
26
|
+
* shorter); the server applies that allowance, so the client sends the
|
|
27
|
+
* transcript's own count and never the arithmetic. Only v4 speaks a
|
|
28
|
+
* translation, so there is no `v3t`.
|
|
29
|
+
*
|
|
30
|
+
* `POST /v1/credits/model-costs` and `GET /v1/credits/model-cost` answer it
|
|
31
|
+
* with the figure the convert reserves; an id the server does not price
|
|
32
|
+
* (a malformed slot, more slots than a convert takes, a count out of range)
|
|
33
|
+
* lands in `missing`. Numbers are written exactly as JavaScript prints them,
|
|
34
|
+
* so the server reads back the value the client priced.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/** The id a convert is reserved (and marked up) at. */
|
|
38
|
+
export const VOICE_CHANGER_PRO_QUOTE_RATE_ID = "voice-changer-pro"
|
|
39
|
+
|
|
40
|
+
/** A Re-speak engine, as the quote names it. */
|
|
41
|
+
export type VoiceChangerProQuoteRespeakEngine = "v3" | "v4"
|
|
42
|
+
|
|
43
|
+
/** One changed speaker of a convert, as the quote prices it. */
|
|
44
|
+
export type VoiceChangerProQuoteSlot =
|
|
45
|
+
/** A recast slot: the stem's length in seconds; `null` (or not a positive number) = unknown. */
|
|
46
|
+
| { readonly kind: "sts"; readonly seconds: number | null }
|
|
47
|
+
/**
|
|
48
|
+
* A Re-speak slot: the characters of its transcript; `null` (or not a
|
|
49
|
+
* positive number) = unknown. `engine` absent = the default engine (v3).
|
|
50
|
+
* `translated` = the slot speaks the plan's target language — read only on
|
|
51
|
+
* v4, the one engine that speaks a translation (the convert route reads it
|
|
52
|
+
* the same way).
|
|
53
|
+
*/
|
|
54
|
+
| {
|
|
55
|
+
readonly kind: "respeak"
|
|
56
|
+
readonly chars: number | null
|
|
57
|
+
readonly engine?: VoiceChangerProQuoteRespeakEngine
|
|
58
|
+
readonly translated?: boolean
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** A `voice-changer-pro:<slots>` id, read back into the convert's pricing inputs (slot order kept per kind). */
|
|
62
|
+
export interface VoiceChangerProQuoteCreditIdParts {
|
|
63
|
+
/** Stem seconds per recast slot; `null` = unknown. */
|
|
64
|
+
readonly stsSlotSeconds: ReadonlyArray<number | null>
|
|
65
|
+
/** Transcript characters per Re-speak slot; `null` = unknown. */
|
|
66
|
+
readonly respeakChars: ReadonlyArray<number | null>
|
|
67
|
+
/** The engine of each Re-speak slot, index-aligned with `respeakChars`; `null` = not named (the default engine). */
|
|
68
|
+
readonly respeakEngines: ReadonlyArray<VoiceChangerProQuoteRespeakEngine | null>
|
|
69
|
+
/** Whether each Re-speak slot speaks a translation, index-aligned with `respeakChars` (only ever true on v4). */
|
|
70
|
+
readonly respeakTranslated: ReadonlyArray<boolean>
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const PREFIX = `${VOICE_CHANGER_PRO_QUOTE_RATE_ID}:`
|
|
74
|
+
const NUMBER = String.raw`\d{1,7}(?:\.\d{1,20})?`
|
|
75
|
+
const STS_SLOT = new RegExp(`^sts(?:-(${NUMBER}))?$`)
|
|
76
|
+
const RESPEAK_SLOT = new RegExp(`^respeak(?:-(v3|v4|v4t))?(?:-(${NUMBER}))?$`)
|
|
77
|
+
|
|
78
|
+
const known = (n: number | null): n is number => n !== null && Number.isFinite(n) && n > 0
|
|
79
|
+
|
|
80
|
+
/** The engine token of a Re-speak slot: none for the default engine (the id every client sent before engines were named). */
|
|
81
|
+
function respeakEngineToken(slot: { readonly engine?: VoiceChangerProQuoteRespeakEngine; readonly translated?: boolean }): string {
|
|
82
|
+
if (slot.engine !== "v4") return ""
|
|
83
|
+
return slot.translated === true ? "-v4t" : "-v4"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** `voice-changer-pro:<slot>,…` — the id of the whole price of a convert with these changed speakers. */
|
|
87
|
+
export function voiceChangerProQuoteCreditId(slots: ReadonlyArray<VoiceChangerProQuoteSlot>): string {
|
|
88
|
+
return (
|
|
89
|
+
PREFIX +
|
|
90
|
+
slots
|
|
91
|
+
.map((slot) => {
|
|
92
|
+
if (slot.kind === "sts") return known(slot.seconds) ? `sts-${String(slot.seconds)}` : "sts"
|
|
93
|
+
const head = `respeak${respeakEngineToken(slot)}`
|
|
94
|
+
return known(slot.chars) ? `${head}-${String(slot.chars)}` : head
|
|
95
|
+
})
|
|
96
|
+
.join(",")
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function measureOf(text: string | undefined): number | null | undefined {
|
|
101
|
+
if (text === undefined) return null
|
|
102
|
+
const value = Number(text)
|
|
103
|
+
return Number.isFinite(value) && value > 0 ? value : undefined
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The parts of a `voice-changer-pro:<slots>` id by its shape alone, or
|
|
108
|
+
* undefined (not such an id, an empty or malformed slot). How many slots and
|
|
109
|
+
* what counts the server prices is the server's to say: an id it does not
|
|
110
|
+
* price lands in `missing`.
|
|
111
|
+
*/
|
|
112
|
+
export function parseVoiceChangerProQuoteCreditId(id: string): VoiceChangerProQuoteCreditIdParts | undefined {
|
|
113
|
+
if (typeof id !== "string" || !id.startsWith(PREFIX)) return undefined
|
|
114
|
+
const body = id.slice(PREFIX.length)
|
|
115
|
+
if (body.length === 0) return undefined
|
|
116
|
+
const stsSlotSeconds: Array<number | null> = []
|
|
117
|
+
const respeakChars: Array<number | null> = []
|
|
118
|
+
const respeakEngines: Array<VoiceChangerProQuoteRespeakEngine | null> = []
|
|
119
|
+
const respeakTranslated: boolean[] = []
|
|
120
|
+
for (const part of body.split(",")) {
|
|
121
|
+
const sts = STS_SLOT.exec(part)
|
|
122
|
+
if (sts) {
|
|
123
|
+
const seconds = measureOf(sts[1])
|
|
124
|
+
if (seconds === undefined) return undefined
|
|
125
|
+
stsSlotSeconds.push(seconds)
|
|
126
|
+
continue
|
|
127
|
+
}
|
|
128
|
+
const respeak = RESPEAK_SLOT.exec(part)
|
|
129
|
+
if (!respeak) return undefined
|
|
130
|
+
const chars = measureOf(respeak[2])
|
|
131
|
+
if (chars === undefined) return undefined
|
|
132
|
+
const token = respeak[1]
|
|
133
|
+
respeakChars.push(chars)
|
|
134
|
+
respeakEngines.push(token === undefined ? null : token === "v3" ? "v3" : "v4")
|
|
135
|
+
respeakTranslated.push(token === "v4t")
|
|
136
|
+
}
|
|
137
|
+
return { stsSlotSeconds, respeakChars, respeakEngines, respeakTranslated }
|
|
138
|
+
}
|
|
@@ -80,6 +80,8 @@ const SCRAPER_SOURCE_TYPES = new Set(["meta-ads-scrape", "instagram-scrape"])
|
|
|
80
80
|
export const OUTPUT_PIP_EFFECTIVE_TYPES: Readonly<Record<string, Readonly<Record<string, string>>>> = Object.freeze({
|
|
81
81
|
// UGC Creator's `image`: the creator's first image, for any image input.
|
|
82
82
|
"ugc-creator": Object.freeze({ image: "upload-image" }),
|
|
83
|
+
// Site Capture's `image`: its section stills — the first on a plain wire, each or all on an Each / Bundle wire.
|
|
84
|
+
"site-capture": Object.freeze({ image: "upload-image" }),
|
|
83
85
|
// The UGC nodes' plain-text pips — the script's product category, the clips'
|
|
84
86
|
// transcript, the cards' Notes — are one text each (`combine-text`: one
|
|
85
87
|
// string, not a list): they reach text and prompt inputs, never a JSON input.
|