@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
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model catalog — single source of truth for what each Nodaro-exposed model
|
|
3
|
+
* is, who made it, what it's good for, and which knobs it accepts.
|
|
4
|
+
*
|
|
5
|
+
* Consumed by:
|
|
6
|
+
* - Backend MCP `list_models` tool (renders the nested per-kind / per-family
|
|
7
|
+
* response so Claude can pick the right model for a user's intent)
|
|
8
|
+
* - (future) Frontend config panels — today they read parallel registries
|
|
9
|
+
* in `frontend/src/components/editor/config-panels/model-options.ts`; a
|
|
10
|
+
* follow-up will migrate them to import from here.
|
|
11
|
+
*
|
|
12
|
+
* Authoring rules:
|
|
13
|
+
* - Keep `description` to one line (≤120 chars). It's what Claude reads to
|
|
14
|
+
* decide which model to use.
|
|
15
|
+
* - `useCases` is a small set of short tags (1-3 words) — verbs/nouns Claude
|
|
16
|
+
* can match against user intent ("typography", "character", "fast",
|
|
17
|
+
* "cinematic"). Stay consistent across entries: don't write "text" in one
|
|
18
|
+
* and "typography" in another.
|
|
19
|
+
* - `aspectRatios` / `resolutions` / `qualities` only appear when the model
|
|
20
|
+
* actually exposes that lever (e.g., Nano Banana base has no `resolution`).
|
|
21
|
+
* - `durations` is in seconds.
|
|
22
|
+
* - `pricing[0]` is ALWAYS the default variant (the bare id without a
|
|
23
|
+
* composite suffix like `:4K` or `:high`).
|
|
24
|
+
* - Costs are sourced from `STATIC_CREDIT_COSTS` (see backend
|
|
25
|
+
* `src/billing/credits.ts`). Keep them in sync if the table changes.
|
|
26
|
+
* - After editing `MODEL_CATALOG` or `MODEL_RECOMMENDATIONS`, run
|
|
27
|
+
* `npm run gen:skills` (from `backend/`) to refresh the public
|
|
28
|
+
* `docs/choosing-models.md` guide. CI (`gen:skills:check`) fails on drift.
|
|
29
|
+
*/
|
|
30
|
+
type ModelKind = "image" | "video" | "audio";
|
|
31
|
+
type ModelMode = "t2i" | "i2i" | "edit" | "upscale" | "remove-bg" | "i2v" | "t2v" | "v2v" | "extend" | "motion-transfer" | "lip-sync" | "video-upscale" | "video-depth" | "tts" | "music" | "sfx" | "stt" | "voice-design" | "voice-changer" | "isolation" | "dubbing" | "forced-alignment" | "dialogue" | "video-analysis" | "video-audit";
|
|
32
|
+
interface PriceVariant {
|
|
33
|
+
/** Composite identifier as it appears in `STATIC_CREDIT_COSTS`. */
|
|
34
|
+
identifier: string;
|
|
35
|
+
/** The catalog's list price in credits. `GET /v1/models` and the MCP
|
|
36
|
+
* `list_models` tool serve the price a run is charged on the instance,
|
|
37
|
+
* which may differ. */
|
|
38
|
+
credits: number;
|
|
39
|
+
/** Short human-readable note describing this variant ("1K default", "4K", "with audio"). */
|
|
40
|
+
note?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The note on every speech model's `<model>:per-100-chars` pricing row. The
|
|
44
|
+
* row is a rate: one started 100 characters of the text sent, at least 8 units
|
|
45
|
+
* per request (`credit-estimators/speech.ts`). A request's total is rounded
|
|
46
|
+
* once, so its units × the listed figure is an upper bound of what it costs;
|
|
47
|
+
* the exact price of N units is the `<model>:per-100-chars:<N>u` id. An
|
|
48
|
+
* instance serves the row only while it prices speech by length; a client that
|
|
49
|
+
* does not see it quotes the flat row. (The ids are literals on the entries — this file cannot import
|
|
50
|
+
* the speech estimator without a cycle through tts-capabilities.ts; the
|
|
51
|
+
* pricing-coverage tests pin each literal to `speechUnitCreditId(id)`.)
|
|
52
|
+
*/
|
|
53
|
+
declare const SPEECH_UNIT_PRICE_NOTE = "per started 100 characters, at least 8 units \u2014 where length pricing is on; a request costs at most its units \u00D7 this";
|
|
54
|
+
/** A voice-setting lever a speech model honours. */
|
|
55
|
+
type TtsSettingLever = "stability" | "similarity" | "style" | "speed" | "speakerBoost";
|
|
56
|
+
/**
|
|
57
|
+
* What a speech model (text-to-speech or dialogue) accepts. The ONE source for
|
|
58
|
+
* every "does this model do X" decision — tag stripping, which voice settings
|
|
59
|
+
* are sent and shown, the language picker, the per-request character cap. Never
|
|
60
|
+
* compare a provider id by hand; read the sheet through the helpers in
|
|
61
|
+
* `tts-capabilities.ts` (the text-to-speech lane) or `dialogue-capabilities.ts`
|
|
62
|
+
* (the dialogue lane). Each lane's helpers answer only for its own models.
|
|
63
|
+
*/
|
|
64
|
+
interface TtsCapabilities {
|
|
65
|
+
/** Inline `[audio tags]` are performed. false ⇒ strip them before sending (the model reads them aloud). */
|
|
66
|
+
audioTags: boolean;
|
|
67
|
+
/** SSML `<break time="…"/>` tags are honoured. */
|
|
68
|
+
ssmlBreaks: boolean;
|
|
69
|
+
/** Voice settings the model honours. A lever not listed is never sent and never shown. */
|
|
70
|
+
levers: readonly TtsSettingLever[];
|
|
71
|
+
/**
|
|
72
|
+
* The stability values THIS PLATFORM accepts for the model, when it offers
|
|
73
|
+
* steps instead of a 0–1 range (ascending). Absent ⇒ any value from 0 to 1.
|
|
74
|
+
* A product choice, not a vendor limit: ElevenLabs takes other values too on
|
|
75
|
+
* some models; the steps are what our routes validate and our pickers offer.
|
|
76
|
+
*/
|
|
77
|
+
stabilitySteps?: readonly number[];
|
|
78
|
+
/** The request may carry a language code. false ⇒ the field is omitted. */
|
|
79
|
+
languageCode: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The model answers the `/with-timestamps` form of its endpoint with
|
|
82
|
+
* character timings (and, for dialogue, per-line `voice_segments`). When true
|
|
83
|
+
* the platform ALWAYS renders dialogue through it and the job output carries a
|
|
84
|
+
* `transcript` (decided 2026-10-06); when false the plain endpoint is used
|
|
85
|
+
* and the request is byte-identical to before the field existed.
|
|
86
|
+
*/
|
|
87
|
+
timestamps: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The model conditions a request on the text spoken before and after it
|
|
90
|
+
* (`previous_text` / `next_text`), for continuous intonation across clips
|
|
91
|
+
* produced separately. false ⇒ the fields are never sent: a model that does
|
|
92
|
+
* not take them rejects the request (eleven_v3: 400), which would fail a paid
|
|
93
|
+
* job. Values from live calls, never assumed (phase 6 plan, Task 0).
|
|
94
|
+
*/
|
|
95
|
+
stitching: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Per-request character cap (the total across lines for a dialogue model).
|
|
98
|
+
* `getMaxTtsChars` reads it by exact id and answers {@link TTS_TEXT_MAX}'s 5,000 for
|
|
99
|
+
* the legacy alias and for ids with no sheet, while the sheet lookups answer
|
|
100
|
+
* with the cap of the model such a request actually runs as (turbo's 40,000).
|
|
101
|
+
*/
|
|
102
|
+
maxChars: number;
|
|
103
|
+
/** Languages offered in pickers (ISO 639-1; `fil` has no two-letter code). A curated list, not the vendor's full one. */
|
|
104
|
+
languages: readonly string[];
|
|
105
|
+
}
|
|
106
|
+
interface ModelCatalogEntry {
|
|
107
|
+
id: string;
|
|
108
|
+
kind: ModelKind;
|
|
109
|
+
/**
|
|
110
|
+
* Operations this model supports. Many video models (minimax, veo3,
|
|
111
|
+
* seedance) support BOTH i2v AND t2v under the same id — the route handler
|
|
112
|
+
* picks which KIE endpoint to hit based on whether an image was supplied.
|
|
113
|
+
* For those, list both modes here so MCP filters and frontend pickers see
|
|
114
|
+
* the model in either context.
|
|
115
|
+
*/
|
|
116
|
+
modes: readonly ModelMode[];
|
|
117
|
+
/** Vendor / lab that produced the model. Used for UI grouping. */
|
|
118
|
+
family: string;
|
|
119
|
+
/** Display name (NOT the id — the id is the API enum value). */
|
|
120
|
+
label: string;
|
|
121
|
+
/**
|
|
122
|
+
* Model LINE for the add-node Models tab — the brand-agnostic product line a
|
|
123
|
+
* user thinks in ("Nano Banana", "Flux", "VEO", "Kling", "ElevenLabs").
|
|
124
|
+
* Distinct from `family` (the lab: Google covers Nano Banana + Imagen + VEO).
|
|
125
|
+
* REQUIRED for every node-creatable model; a completeness guard in
|
|
126
|
+
* `@nodaro/shared` (model-tree.test.ts) fails if one is missing.
|
|
127
|
+
*/
|
|
128
|
+
series?: string;
|
|
129
|
+
/**
|
|
130
|
+
* The value written into the creating node's data field when this model is
|
|
131
|
+
* picked from the Models tab, for models whose catalog id differs from the
|
|
132
|
+
* stored value. Only `suno-generate` diverges today (id `suno-v5` → `data.model`
|
|
133
|
+
* "V5"). Omit when the id IS the stored value (the common case).
|
|
134
|
+
*/
|
|
135
|
+
dataValue?: string;
|
|
136
|
+
/** One-liner. Visible to Claude in MCP `list_models` output. */
|
|
137
|
+
description: string;
|
|
138
|
+
/** Short tags Claude matches against user intent. */
|
|
139
|
+
useCases: readonly string[];
|
|
140
|
+
/**
|
|
141
|
+
* Capabilities flags: "reference-image", "end-frame", "audio", etc.
|
|
142
|
+
*
|
|
143
|
+
* `"video-reference"` (video models only) means the model accepts a
|
|
144
|
+
* reference VIDEO as a CONDITIONING clip — the r2v transport that
|
|
145
|
+
* `resolveSeedance2Inputs` builds and that KIE receives as
|
|
146
|
+
* `reference_video_urls`. It is what generate-video-pro's `extend` render
|
|
147
|
+
* method needs (a continuation tail off the previous segment), and
|
|
148
|
+
* `GVP_EXTEND_PROVIDERS` derives from it.
|
|
149
|
+
*
|
|
150
|
+
* It is deliberately NOT set on `gemini-omni-video`: that model's
|
|
151
|
+
* `video_list` input is a V2V SOURCE clip with a trim window, an
|
|
152
|
+
* auto-determined duration and flat per-generation pricing (see
|
|
153
|
+
* `runGeminiOmni` in `backend/src/providers/kie/video.ts`) — a different
|
|
154
|
+
* transport, not a continuation reference.
|
|
155
|
+
*/
|
|
156
|
+
features?: readonly string[];
|
|
157
|
+
aspectRatios?: readonly string[];
|
|
158
|
+
resolutions?: readonly string[];
|
|
159
|
+
/**
|
|
160
|
+
* What this model actually RENDERS for a resolution outside `resolutions`.
|
|
161
|
+
*
|
|
162
|
+
* Most providers honour whatever band they are sent, so an off-list value is
|
|
163
|
+
* best snapped to the NEAREST supported one — a 4k request on a 1080p-max
|
|
164
|
+
* model renders 1080p. A few instead COLLAPSE anything unrecognised to a
|
|
165
|
+
* fixed default (MiniMax H3 → 2K, Wan 3.0 → 720p), and for those the nearest
|
|
166
|
+
* band is the wrong answer in the most expensive direction: snapping a stale
|
|
167
|
+
* "720p" to H3's cheap 768P would send a value the provider ignores, so we
|
|
168
|
+
* would bill the 768P tier against a 2K render, and `commit_credits` never
|
|
169
|
+
* collects the shortfall.
|
|
170
|
+
*
|
|
171
|
+
* Declare it in the catalog's own spelling. `normalizeVideoRequestParams`
|
|
172
|
+
* uses it in place of the nearest-band snap; `video-collapse-parity.test.ts`
|
|
173
|
+
* pins each declaration to what the provider normalizer actually returns, so
|
|
174
|
+
* the two cannot drift.
|
|
175
|
+
*/
|
|
176
|
+
unlistedResolutionRendersAs?: string;
|
|
177
|
+
qualities?: readonly string[];
|
|
178
|
+
durations?: readonly number[];
|
|
179
|
+
/**
|
|
180
|
+
* The length (seconds) this model renders when the request names no duration
|
|
181
|
+
* — a capability fact, and the length an unset duration is CHARGED at
|
|
182
|
+
* (`pricedOutputDurationSec`). A member of `durations`. REQUIRED on every
|
|
183
|
+
* video model priced by length (`pricing-default-duration-sync.test.ts`), and
|
|
184
|
+
* where the KIE config pins `extraParams.duration` it must equal that pin.
|
|
185
|
+
*/
|
|
186
|
+
defaultDuration?: number;
|
|
187
|
+
/**
|
|
188
|
+
* The model accepts an AUTO duration (`duration: -1`, see
|
|
189
|
+
* `VIDEO_DURATION_AUTO`): it picks the clip length itself — the source clip's
|
|
190
|
+
* length on a video edit, a length within `durations` otherwise. A capability,
|
|
191
|
+
* not a member of `durations` (which stay real seconds). Runs are reserved at
|
|
192
|
+
* the longest clip and settled on the delivered one.
|
|
193
|
+
*/
|
|
194
|
+
autoDuration?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* The model takes NO seed: its provider schema has none, so a seed the
|
|
197
|
+
* request carries is dropped before the provider call and repeat runs vary.
|
|
198
|
+
* Absent means a seed is forwarded as usual. Read through
|
|
199
|
+
* {@link modelTakesSeed} — the editor hides its Seed field off it and clears
|
|
200
|
+
* a stale `data.seed` when the provider switches. Pinned to the KIE configs'
|
|
201
|
+
* `omitSeed` in both directions by `seed-capability-parity.test.ts`.
|
|
202
|
+
*/
|
|
203
|
+
noSeed?: boolean;
|
|
204
|
+
pricing: readonly PriceVariant[];
|
|
205
|
+
/** Editorial highlight — "best in tier". Surfaces in MCP output as a ⭐. */
|
|
206
|
+
featured?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Per-model overrides for the global value label decorations (e.g. Hailuo
|
|
209
|
+
* 2.3 Pro labels its 1080P resolution as "1080P (6s max)" because the
|
|
210
|
+
* model caps long durations at lower resolution). Falls back to
|
|
211
|
+
* `MODEL_VALUE_LABELS` for values not listed here.
|
|
212
|
+
*/
|
|
213
|
+
valueLabels?: Record<string, string>;
|
|
214
|
+
/**
|
|
215
|
+
* Hide from MCP `list_models` output and tool model enums. Used for legacy
|
|
216
|
+
* model versions superseded by newer entries — they remain in the catalog
|
|
217
|
+
* (and accessible via direct API / frontend pickers for back-compat) but
|
|
218
|
+
* stop showing up in Claude.ai's model picker, which keeps the surface
|
|
219
|
+
* tight and steers the agent to the current generation.
|
|
220
|
+
*
|
|
221
|
+
* Frontend pickers ignore this flag.
|
|
222
|
+
*/
|
|
223
|
+
mcpHidden?: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* The provider's safety filter is known to be non-deterministic on this
|
|
226
|
+
* model — the platform retries a blocked request once; `fallback` names
|
|
227
|
+
* the catalog model to offer when it blocks again.
|
|
228
|
+
*/
|
|
229
|
+
safetyFilter?: {
|
|
230
|
+
stochastic: true;
|
|
231
|
+
fallback?: string;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Capability sheet of a speech model. REQUIRED on every entry whose `modes`
|
|
235
|
+
* include "tts" or "dialogue" — `tts-capabilities.test.ts` fails otherwise.
|
|
236
|
+
*/
|
|
237
|
+
tts?: TtsCapabilities;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Editorial recommendations — short "best for X" picks Claude can echo back
|
|
241
|
+
* to the user when they don't know which model to use. Surfaces as a "Quick
|
|
242
|
+
* recommendations" footer in MCP `list_models` output.
|
|
243
|
+
*/
|
|
244
|
+
interface ModelRecommendation {
|
|
245
|
+
intent: string;
|
|
246
|
+
modelIds: readonly string[];
|
|
247
|
+
note: string;
|
|
248
|
+
}
|
|
249
|
+
declare const MODEL_RECOMMENDATIONS: readonly ModelRecommendation[];
|
|
250
|
+
declare const MODEL_CATALOG: Record<string, ModelCatalogEntry>;
|
|
251
|
+
/**
|
|
252
|
+
* Lookup helpers for MCP and the future frontend migration.
|
|
253
|
+
*/
|
|
254
|
+
declare function listModels(filter?: {
|
|
255
|
+
kind?: ModelKind;
|
|
256
|
+
mode?: ModelMode;
|
|
257
|
+
family?: string;
|
|
258
|
+
}): ModelCatalogEntry[];
|
|
259
|
+
/**
|
|
260
|
+
* Group entries by family, returning a stable order.
|
|
261
|
+
* Returns Array<{ family: string; models: ModelCatalogEntry[] }>.
|
|
262
|
+
*/
|
|
263
|
+
declare function groupByFamily(entries: ModelCatalogEntry[]): Array<{
|
|
264
|
+
family: string;
|
|
265
|
+
models: ModelCatalogEntry[];
|
|
266
|
+
}>;
|
|
267
|
+
declare const MODEL_KINDS: readonly ["image", "video", "audio"];
|
|
268
|
+
/**
|
|
269
|
+
* The Image / Video / Audio envelope every model-discovery surface renders
|
|
270
|
+
* (`GET /v1/models`, MCP `list_models`): each model is filed under ITS OWN
|
|
271
|
+
* kind, then by vendor family within that kind — so a vendor that ships more
|
|
272
|
+
* than one kind (Google: Imagen + VEO, ByteDance: Seedream + Seedance, …)
|
|
273
|
+
* appears once per kind it actually ships.
|
|
274
|
+
*
|
|
275
|
+
* This is the ONE grouping both surfaces call. Grouping by family first and
|
|
276
|
+
* letting the family's first model pick the section filed every VEO, Seedance,
|
|
277
|
+
* Wan and ByteDance video model under "image" whenever the call carried no
|
|
278
|
+
* `kind` filter (#1332) — an explicit `kind` pre-filtered the list and hid it.
|
|
279
|
+
* Empty sections are omitted; section order is fixed image → video → audio.
|
|
280
|
+
*/
|
|
281
|
+
declare function groupByKindAndFamily(entries: ModelCatalogEntry[]): Array<{
|
|
282
|
+
kind: ModelKind;
|
|
283
|
+
families: Array<{
|
|
284
|
+
family: string;
|
|
285
|
+
models: ModelCatalogEntry[];
|
|
286
|
+
}>;
|
|
287
|
+
}>;
|
|
288
|
+
declare function getModel(id: string): ModelCatalogEntry | undefined;
|
|
289
|
+
type ValidationField = "aspectRatio" | "resolution" | "quality" | "duration";
|
|
290
|
+
interface ModelValidationIssue {
|
|
291
|
+
field: ValidationField;
|
|
292
|
+
message: string;
|
|
293
|
+
allowed: readonly (string | number)[] | null;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Validate that the user's lever values are supported by the chosen model.
|
|
297
|
+
*
|
|
298
|
+
* Returns null on success or the FIRST issue found. We surface a single issue
|
|
299
|
+
* rather than collecting all so the agent doesn't get a wall of complaints —
|
|
300
|
+
* fix one thing, retry. Order: aspectRatio → resolution → quality → duration.
|
|
301
|
+
*
|
|
302
|
+
* Semantics:
|
|
303
|
+
* - If the field is undefined, it's never an issue.
|
|
304
|
+
* - If the catalog entry doesn't list a corresponding lever (e.g. base
|
|
305
|
+
* nano-banana has no `resolutions`), passing that field IS an issue —
|
|
306
|
+
* silently dropping it has caused two bugs already.
|
|
307
|
+
* - If the value is in the allow list, it's valid.
|
|
308
|
+
*
|
|
309
|
+
* Unknown model ids are NOT flagged here — the route handler / Zod model
|
|
310
|
+
* enum is the right gate for that. We just skip validation.
|
|
311
|
+
*/
|
|
312
|
+
declare function validateModelInput(modelId: string, input: {
|
|
313
|
+
aspectRatio?: string;
|
|
314
|
+
resolution?: string;
|
|
315
|
+
quality?: string;
|
|
316
|
+
duration?: number;
|
|
317
|
+
}): ModelValidationIssue | null;
|
|
318
|
+
/**
|
|
319
|
+
* The resolution a Flux 2 model should land on when its stored value is absent
|
|
320
|
+
* or invalid. Flux 2 exposes ascending megapixel options ("0.5 MP"…"4 MP"), so
|
|
321
|
+
* snapping to `options[0]` would silently downgrade every node to the cheapest
|
|
322
|
+
* tier; each variant has a sensible mid default instead. Returns undefined for
|
|
323
|
+
* every non-Flux-2 model (they snap to `options[0]` normally).
|
|
324
|
+
*/
|
|
325
|
+
declare function defaultResolutionFor(modelId: string): string | undefined;
|
|
326
|
+
/** One correction `normalizeModelInput` made, for disclosure to the user. */
|
|
327
|
+
interface ModelInputAdjustment {
|
|
328
|
+
field: "aspectRatio" | "resolution" | "quality" | "duration";
|
|
329
|
+
/** The value that was asked for. */
|
|
330
|
+
from: string | number;
|
|
331
|
+
/** What it became — `undefined` means the lever was dropped entirely. */
|
|
332
|
+
to: string | number | undefined;
|
|
333
|
+
reason: string;
|
|
334
|
+
}
|
|
335
|
+
interface NormalizedModelInput {
|
|
336
|
+
aspectRatio?: string;
|
|
337
|
+
resolution?: string;
|
|
338
|
+
quality?: string;
|
|
339
|
+
duration?: number;
|
|
340
|
+
/** Empty when the input was already valid. */
|
|
341
|
+
adjustments: ModelInputAdjustment[];
|
|
342
|
+
}
|
|
343
|
+
/** A source image's pixel size as it is DISPLAYED (EXIF orientation applied). */
|
|
344
|
+
interface SourceImageSize {
|
|
345
|
+
width: number;
|
|
346
|
+
height: number;
|
|
347
|
+
}
|
|
348
|
+
/** What a request knows beyond its own levers. */
|
|
349
|
+
interface ModelInputContext {
|
|
350
|
+
/**
|
|
351
|
+
* The image an image-to-image or edit request transforms. Only read to
|
|
352
|
+
* resolve "auto" on a model without a native auto; absent or unusable means
|
|
353
|
+
* the size is unknown and "auto" snaps the way it always has.
|
|
354
|
+
*/
|
|
355
|
+
sourceImage?: SourceImageSize;
|
|
356
|
+
}
|
|
357
|
+
/** True for the "auto" aspect token in any case or padding. */
|
|
358
|
+
declare function isAutoAspectToken(value: unknown): boolean;
|
|
359
|
+
/**
|
|
360
|
+
* The ratio in `ratios` nearest a `sourceWidth` x `sourceHeight` image:
|
|
361
|
+
* minimises |ln(w/h) - ln(rw/rh)|, so a portrait and its landscape mirror are
|
|
362
|
+
* equally far from a square. Entries that are not ratios ("auto", "adaptive",
|
|
363
|
+
* "match_input_image") are skipped, and a tie goes to the ratio listed first
|
|
364
|
+
* (`ASPECT_TIE_EPSILON`). `undefined` for unusable dimensions or a list
|
|
365
|
+
* without a single ratio.
|
|
366
|
+
*/
|
|
367
|
+
declare function nearestCatalogAspectRatio(sourceWidth: number, sourceHeight: number, ratios: readonly string[]): string | undefined;
|
|
368
|
+
/**
|
|
369
|
+
* True when `aspectRatio` is "auto" and `modelId`'s catalog ratio list does not
|
|
370
|
+
* carry "auto" — the one case where the source image's size decides the ratio.
|
|
371
|
+
* A caller that has to fetch the size asks this first, so a request that will
|
|
372
|
+
* not use it never pays for the read.
|
|
373
|
+
*/
|
|
374
|
+
declare function autoAspectNeedsSourceImage(modelId: string | undefined, aspectRatio: unknown): boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Coerce a model's parameters into a combination the model actually accepts.
|
|
377
|
+
*
|
|
378
|
+
* The correcting twin of `validateModelInput`. Validation is right when a
|
|
379
|
+
* human/agent is composing a single call and can retry (MCP verbs do this).
|
|
380
|
+
* It is the WRONG answer at a persistence or execution boundary: rejecting
|
|
381
|
+
* there turns a fixable typo into a failed run — and a failed run takes every
|
|
382
|
+
* already-generated, already-billed sibling node down with it. Incident
|
|
383
|
+
* 2026-08-09: one node carrying `gpt-image` + `16:9` (a pair the config panel
|
|
384
|
+
* cannot produce, written straight into workflow JSON by a non-UI author)
|
|
385
|
+
* aborted a run whose five other nodes had already produced images.
|
|
386
|
+
*
|
|
387
|
+
* Rules, mirroring the config panels' provider-change snap:
|
|
388
|
+
* - Model has no such lever → drop the value (sending it 400s upstream).
|
|
389
|
+
* - "auto" on a model whose list lacks it, with a known `context.sourceImage`
|
|
390
|
+
* → the listed ratio nearest the source's shape (`nearestCatalogAspectRatio`).
|
|
391
|
+
* "auto" asks to keep the source photo's shape; the first listed ratio
|
|
392
|
+
* would reframe every source of another shape.
|
|
393
|
+
* - Value outside the model's allow-list → snap to the model's default
|
|
394
|
+
* (`defaultResolutionFor`) or the first valid option.
|
|
395
|
+
* - Then apply cross-field constraints that only hold for certain models.
|
|
396
|
+
*
|
|
397
|
+
* Unknown model ids pass through untouched — the route's Zod model enum is the
|
|
398
|
+
* right gate for those, exactly as in `validateModelInput`.
|
|
399
|
+
*
|
|
400
|
+
* Every correction is reported in `adjustments` so callers can disclose what
|
|
401
|
+
* changed rather than silently handing back something else.
|
|
402
|
+
*/
|
|
403
|
+
declare function normalizeModelInput(modelId: string, input: {
|
|
404
|
+
aspectRatio?: string;
|
|
405
|
+
resolution?: string;
|
|
406
|
+
quality?: string;
|
|
407
|
+
duration?: number;
|
|
408
|
+
}, context?: ModelInputContext): NormalizedModelInput;
|
|
409
|
+
/**
|
|
410
|
+
* `ratio` as `modelId` renders it: the catalog's own spelling when the model
|
|
411
|
+
* lists it (any case), else the nearest ratio it lists (log space — a portrait
|
|
412
|
+
* request stays portrait). "auto" / "adaptive", an empty token, a model without
|
|
413
|
+
* a ratio list and an unknown model pass through unchanged. The ONE fitting
|
|
414
|
+
* rule: the video lane's normalizer applies it, and so does a node's Settings
|
|
415
|
+
* input for a wired Aspect Ratio (settings-input.ts), image models included.
|
|
416
|
+
*/
|
|
417
|
+
declare function fitAspectRatioToModel(modelId: string, ratio: string): string;
|
|
418
|
+
interface NormalizedVideoRequest {
|
|
419
|
+
aspectRatio?: string;
|
|
420
|
+
resolution?: string;
|
|
421
|
+
adjustments: ModelInputAdjustment[];
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* The video lane's LIMITED normalizer: `aspectRatio` + `resolution` only, and
|
|
425
|
+
* only when the catalog actually declares the option list.
|
|
426
|
+
*
|
|
427
|
+
* Three deliberate differences from `normalizeModelInput`:
|
|
428
|
+
* 1. It never DROPS a lever. `normalizeModelInput` removes a value whose list
|
|
429
|
+
* the catalog doesn't declare; on the video lane `resolution` is a pricing
|
|
430
|
+
* input, so dropping it would lower the reserved tier and `commit_credits`
|
|
431
|
+
* never collects an upward delta — a params fix would become a money bug.
|
|
432
|
+
* 2. "Auto" / "adaptive" pass through (see PASSTHROUGH_ASPECT_TOKENS).
|
|
433
|
+
* 3. It snaps to the NEAREST option, not to `allowed[0]`. `normalizeModelInput`
|
|
434
|
+
* would turn a portrait 9:21 into landscape 16:9 and a 4k request into the
|
|
435
|
+
* cheapest 480p; nearest matches what the provider adapters and the MCP
|
|
436
|
+
* normalizer already do, so all three give ONE answer. Its snap policy is
|
|
437
|
+
* deliberately left alone — it is shared with the image lane and the
|
|
438
|
+
* copilot, and PR 4 defers changing it.
|
|
439
|
+
*
|
|
440
|
+
* `duration` is deliberately NOT normalized here: the LTX bands make duration
|
|
441
|
+
* legality resolution-dependent, which a flat catalog list can't express, and
|
|
442
|
+
* `buildVideoCreditModelIdentifier` already snaps duration onto a seeded tier.
|
|
443
|
+
* Carrying THAT tier to the wire is `pricedVideoSelection`'s job
|
|
444
|
+
* (`credit-identifiers.ts`), which runs after this one, once resolution is known.
|
|
445
|
+
*
|
|
446
|
+
* An OMITTED lever stays omitted here — filling it is a pricing decision, not a
|
|
447
|
+
* catalog one, and likewise belongs to `pricedVideoSelection`.
|
|
448
|
+
*
|
|
449
|
+
* Case is canonicalised to the catalog's own spelling — the credit identifiers
|
|
450
|
+
* key their tables case-SENSITIVELY (LTX_DURATION_TIERS), so this is the single
|
|
451
|
+
* place a "4K" becomes "4k", and it runs before every identifier site.
|
|
452
|
+
*
|
|
453
|
+
* Pure — so the credit-identifier preHandler, `computeCredits`, the reservation
|
|
454
|
+
* site and the payload build can all call it and cannot disagree (spec §4).
|
|
455
|
+
*/
|
|
456
|
+
declare function normalizeVideoRequestParams(modelId: string, input: {
|
|
457
|
+
aspectRatio?: string;
|
|
458
|
+
resolution?: string;
|
|
459
|
+
draft?: boolean;
|
|
460
|
+
}): NormalizedVideoRequest;
|
|
461
|
+
interface LabeledOption {
|
|
462
|
+
value: string;
|
|
463
|
+
label: string;
|
|
464
|
+
}
|
|
465
|
+
/** Return `{value, label}[]` for the model's aspect ratios, or `null` if none. */
|
|
466
|
+
declare function getAspectRatioOptions(modelId: string): LabeledOption[] | null;
|
|
467
|
+
/** Return `{value, label}[]` for the model's resolution lever, or `null` if none. */
|
|
468
|
+
declare function getResolutionOptions(modelId: string): LabeledOption[] | null;
|
|
469
|
+
/** Return `{value, label}[]` for the model's quality lever, or `null` if none. */
|
|
470
|
+
declare function getQualityOptions(modelId: string): LabeledOption[] | null;
|
|
471
|
+
/** Return the model's allowed durations (in seconds), or `null` if none. */
|
|
472
|
+
declare function getDurationsForModel(modelId: string): number[] | null;
|
|
473
|
+
/**
|
|
474
|
+
* Min/max credits across all pricing variants — used by the frontend's
|
|
475
|
+
* "5–8 cr" range badge in the model dropdown. `null` for models with a
|
|
476
|
+
* single price point.
|
|
477
|
+
*/
|
|
478
|
+
declare function getCreditRange(modelId: string): {
|
|
479
|
+
min: number;
|
|
480
|
+
max: number;
|
|
481
|
+
} | null;
|
|
482
|
+
/** Whether the model declares a given capability flag in its `features` array. */
|
|
483
|
+
declare function hasFeature(modelId: string, feature: string): boolean;
|
|
484
|
+
/**
|
|
485
|
+
* Whether a seed on this model does anything — false only for a catalog entry
|
|
486
|
+
* that declares `noSeed`. An unknown or missing id answers true, so a surface
|
|
487
|
+
* never hides a Seed field for a model it knows nothing about.
|
|
488
|
+
*/
|
|
489
|
+
declare function modelTakesSeed(modelId: string | undefined): boolean;
|
|
490
|
+
/**
|
|
491
|
+
* All ids in the catalog whose `features` includes the given flag. Used by
|
|
492
|
+
* frontend to build PROVIDERS_WITH_END_FRAME / PROVIDERS_WITH_REFERENCES
|
|
493
|
+
* lists derived from the catalog.
|
|
494
|
+
*/
|
|
495
|
+
declare function modelsWithFeature(feature: string): string[];
|
|
496
|
+
/**
|
|
497
|
+
* Map of `{modelId: durations[]}` for every catalog entry whose `modes`
|
|
498
|
+
* includes the given mode. Used to derive KIE_VIDEO_DURATIONS (mode i2v)
|
|
499
|
+
* and KIE_T2V_DURATIONS (mode t2v) on the frontend.
|
|
500
|
+
*/
|
|
501
|
+
declare function durationsByMode(mode: ModelMode): Record<string, number[]>;
|
|
502
|
+
/**
|
|
503
|
+
* Map of `{modelId: LabeledOption[]}` for every catalog entry of the given
|
|
504
|
+
* kind that exposes a resolution lever. Used to derive
|
|
505
|
+
* IMAGE_RESOLUTION_OPTIONS / VIDEO_RESOLUTION_OPTIONS on the frontend.
|
|
506
|
+
*/
|
|
507
|
+
declare function resolutionOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
508
|
+
/**
|
|
509
|
+
* Map of `{modelId: LabeledOption[]}` for every catalog entry of the given
|
|
510
|
+
* kind that exposes an aspect_ratio lever.
|
|
511
|
+
*/
|
|
512
|
+
declare function aspectRatioOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
513
|
+
/** Same shape as `aspectRatioOptionsByKind` but for `qualities`. */
|
|
514
|
+
declare function qualityOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
515
|
+
/** One shaped model row for a picker — capabilities derived from the catalog. */
|
|
516
|
+
interface ModelMenuOption {
|
|
517
|
+
/** Catalog id (the API enum value). */
|
|
518
|
+
id: string;
|
|
519
|
+
/** Human-readable display name from the catalog. */
|
|
520
|
+
label: string;
|
|
521
|
+
/** Resolution levers, `[]` when the model exposes none. */
|
|
522
|
+
resolutions: LabeledOption[];
|
|
523
|
+
/** Aspect-ratio levers, `[]` when the model exposes none. */
|
|
524
|
+
aspectRatios: LabeledOption[];
|
|
525
|
+
/** Duration levers in seconds (union of i2v+t2v modes); `[]` for image / fixed-duration models. */
|
|
526
|
+
durations: {
|
|
527
|
+
value: number;
|
|
528
|
+
label: string;
|
|
529
|
+
}[];
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Build shaped picker rows for one catalog `kind` from a caller-supplied id
|
|
533
|
+
* allowlist (the curation — which ids, in what order, stays the caller's). Every
|
|
534
|
+
* CAPABILITY is derived from the catalog accessors, never hardcoded, so the menu
|
|
535
|
+
* can't drift as the catalog evolves. Ids absent from the catalog or of the
|
|
536
|
+
* wrong kind are skipped (so a stale allowlist entry drops out cleanly). Pure;
|
|
537
|
+
* returns fresh arrays (never aliases the accessor maps).
|
|
538
|
+
*/
|
|
539
|
+
declare function buildModelMenu(kind: ModelKind, allowlist: readonly string[]): ModelMenuOption[];
|
|
540
|
+
/** All `{modelId: {min, max}}` entries that have variable pricing (>1 variant). */
|
|
541
|
+
declare function creditRangesAll(): Record<string, {
|
|
542
|
+
min: number;
|
|
543
|
+
max: number;
|
|
544
|
+
}>;
|
|
545
|
+
/**
|
|
546
|
+
* Tuple of model ids for a given kind + one or more modes. Built for use as
|
|
547
|
+
* a Zod `z.enum()` argument so MCP tool input schemas stay in sync with the
|
|
548
|
+
* catalog without manual maintenance.
|
|
549
|
+
*
|
|
550
|
+
* Filters out `mcpHidden: true` entries by default — pass `includeHidden`
|
|
551
|
+
* to surface legacy versions (used internally by validators that still need
|
|
552
|
+
* to recognize older ids forwarded by direct API callers).
|
|
553
|
+
*
|
|
554
|
+
* Pass `kind: null` to skip the kind filter — useful for cross-kind ids
|
|
555
|
+
* like "grok" (catalog kind=image, modes include both t2i and t2v).
|
|
556
|
+
*/
|
|
557
|
+
declare function modelIdsByKindMode(kind: ModelKind | null, modes: readonly ModelMode[], opts?: {
|
|
558
|
+
includeHidden?: boolean;
|
|
559
|
+
}): [string, ...string[]];
|
|
560
|
+
|
|
561
|
+
export { groupByFamily as A, groupByKindAndFamily as B, hasFeature as C, isAutoAspectToken as D, listModels as E, modelIdsByKindMode as F, modelTakesSeed as G, modelsWithFeature as H, nearestCatalogAspectRatio as I, normalizeModelInput as J, normalizeVideoRequestParams as K, type LabeledOption as L, MODEL_CATALOG as M, type NormalizedModelInput as N, qualityOptionsByKind as O, type PriceVariant as P, resolutionOptionsByKind as Q, validateModelInput as R, SPEECH_UNIT_PRICE_NOTE as S, type TtsCapabilities as T, type ValidationField as V, MODEL_KINDS as a, MODEL_RECOMMENDATIONS as b, type ModelCatalogEntry as c, type ModelInputAdjustment as d, type ModelInputContext as e, type ModelKind as f, type ModelMenuOption as g, type ModelMode as h, type ModelRecommendation as i, type ModelValidationIssue as j, type NormalizedVideoRequest as k, type SourceImageSize as l, type TtsSettingLever as m, aspectRatioOptionsByKind as n, autoAspectNeedsSourceImage as o, buildModelMenu as p, creditRangesAll as q, defaultResolutionFor as r, durationsByMode as s, fitAspectRatioToModel as t, getAspectRatioOptions as u, getCreditRange as v, getDurationsForModel as w, getModel as x, getQualityOptions as y, getResolutionOptions as z };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface ExposableField {
|
|
2
|
+
readonly key: string;
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly type: "select" | "slider" | "toggle" | "text" | "aspect-ratio" | "color";
|
|
5
|
+
readonly options?: ReadonlyArray<{
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}>;
|
|
9
|
+
readonly min?: number;
|
|
10
|
+
readonly max?: number;
|
|
11
|
+
readonly step?: number;
|
|
12
|
+
readonly defaultValue?: unknown;
|
|
13
|
+
}
|
|
14
|
+
interface ExposableOutput {
|
|
15
|
+
readonly key: string;
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly outputType: "image" | "video" | "audio" | "text" | "data";
|
|
18
|
+
}
|
|
19
|
+
type PresentationItem = {
|
|
20
|
+
type: "node";
|
|
21
|
+
nodeId: string;
|
|
22
|
+
/**
|
|
23
|
+
* For a node exposed whole whose input is text (a Text node): the most
|
|
24
|
+
* characters the app user may enter — the same limit a `field` item carries
|
|
25
|
+
* (a whole number, at least 1; ignored on a node that is not a text input).
|
|
26
|
+
* Enforced when the app runs, and it caps the price a speech node fed by
|
|
27
|
+
* this input is advertised at.
|
|
28
|
+
*/
|
|
29
|
+
maxLength?: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "field";
|
|
32
|
+
id: string;
|
|
33
|
+
nodeId: string;
|
|
34
|
+
field: string;
|
|
35
|
+
allowedValues?: Array<string | number | boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* For a text input: the most characters the app user may enter (a whole
|
|
38
|
+
* number, at least 1). Enforced when the app runs, and it caps the price a
|
|
39
|
+
* speech node fed by this input is advertised at — without it, an exposed
|
|
40
|
+
* speech text is priced at the model's per-request cap.
|
|
41
|
+
*/
|
|
42
|
+
maxLength?: number;
|
|
43
|
+
} | {
|
|
44
|
+
type: "output";
|
|
45
|
+
id: string;
|
|
46
|
+
nodeId: string;
|
|
47
|
+
outputKey: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: "richtext";
|
|
50
|
+
id: string;
|
|
51
|
+
content: string;
|
|
52
|
+
} | {
|
|
53
|
+
type: "group";
|
|
54
|
+
id: string;
|
|
55
|
+
title: string;
|
|
56
|
+
items: PresentationItem[];
|
|
57
|
+
showTitle?: boolean;
|
|
58
|
+
showBackground?: boolean;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type { ExposableField as E, PresentationItem as P, ExposableOutput as a };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface ExposableField {
|
|
2
|
+
readonly key: string;
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly type: "select" | "slider" | "toggle" | "text" | "aspect-ratio" | "color";
|
|
5
|
+
readonly options?: ReadonlyArray<{
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}>;
|
|
9
|
+
readonly min?: number;
|
|
10
|
+
readonly max?: number;
|
|
11
|
+
readonly step?: number;
|
|
12
|
+
readonly defaultValue?: unknown;
|
|
13
|
+
}
|
|
14
|
+
interface ExposableOutput {
|
|
15
|
+
readonly key: string;
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly outputType: "image" | "video" | "audio" | "text" | "data";
|
|
18
|
+
}
|
|
19
|
+
type PresentationItem = {
|
|
20
|
+
type: "node";
|
|
21
|
+
nodeId: string;
|
|
22
|
+
/**
|
|
23
|
+
* For a node exposed whole whose input is text (a Text node): the most
|
|
24
|
+
* characters the app user may enter — the same limit a `field` item carries
|
|
25
|
+
* (a whole number, at least 1; ignored on a node that is not a text input).
|
|
26
|
+
* Enforced when the app runs, and it caps the price a speech node fed by
|
|
27
|
+
* this input is advertised at.
|
|
28
|
+
*/
|
|
29
|
+
maxLength?: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "field";
|
|
32
|
+
id: string;
|
|
33
|
+
nodeId: string;
|
|
34
|
+
field: string;
|
|
35
|
+
allowedValues?: Array<string | number | boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* For a text input: the most characters the app user may enter (a whole
|
|
38
|
+
* number, at least 1). Enforced when the app runs, and it caps the price a
|
|
39
|
+
* speech node fed by this input is advertised at — without it, an exposed
|
|
40
|
+
* speech text is priced at the model's per-request cap.
|
|
41
|
+
*/
|
|
42
|
+
maxLength?: number;
|
|
43
|
+
} | {
|
|
44
|
+
type: "output";
|
|
45
|
+
id: string;
|
|
46
|
+
nodeId: string;
|
|
47
|
+
outputKey: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: "richtext";
|
|
50
|
+
id: string;
|
|
51
|
+
content: string;
|
|
52
|
+
} | {
|
|
53
|
+
type: "group";
|
|
54
|
+
id: string;
|
|
55
|
+
title: string;
|
|
56
|
+
items: PresentationItem[];
|
|
57
|
+
showTitle?: boolean;
|
|
58
|
+
showBackground?: boolean;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type { ExposableField as E, PresentationItem as P, ExposableOutput as a };
|