@nodaro/shared 3.61.0 → 3.63.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/dist/{chunk-4KYLNTR7.cjs → chunk-2PU3AGGS.cjs} +27 -4
- package/dist/chunk-2PU3AGGS.cjs.map +1 -0
- package/dist/{chunk-43TGSZRJ.js → chunk-2QKF7M2Z.js} +3 -3
- package/dist/{chunk-43TGSZRJ.js.map → chunk-2QKF7M2Z.js.map} +1 -1
- package/dist/{chunk-B6BG3LV2.js → chunk-34QLPTSA.js} +3 -3
- package/dist/{chunk-B6BG3LV2.js.map → chunk-34QLPTSA.js.map} +1 -1
- package/dist/chunk-3K24DWOH.js +453 -0
- package/dist/chunk-3K24DWOH.js.map +1 -0
- package/dist/{chunk-IRQ3SPX7.js → chunk-4DVWXEB6.js} +23 -4
- package/dist/chunk-4DVWXEB6.js.map +1 -0
- package/dist/{chunk-ZES6EZC4.js → chunk-4MMZD63H.js} +3 -3
- package/dist/{chunk-ZES6EZC4.js.map → chunk-4MMZD63H.js.map} +1 -1
- package/dist/{chunk-MQZRQ5LM.cjs → chunk-63H4C56Q.cjs} +8 -8
- package/dist/{chunk-MQZRQ5LM.cjs.map → chunk-63H4C56Q.cjs.map} +1 -1
- package/dist/{chunk-IVXSNW2B.cjs → chunk-6BZC2ZHC.cjs} +18 -332
- package/dist/chunk-6BZC2ZHC.cjs.map +1 -0
- package/dist/{chunk-M3SXUUWC.cjs → chunk-6FQBKI2A.cjs} +4 -11
- package/dist/chunk-6FQBKI2A.cjs.map +1 -0
- package/dist/{chunk-673E4KYC.js → chunk-6M563QE6.js} +134 -8
- package/dist/chunk-6M563QE6.js.map +1 -0
- package/dist/chunk-6TGB7ECA.cjs +48 -0
- package/dist/chunk-6TGB7ECA.cjs.map +1 -0
- package/dist/{chunk-XUJC6GHE.cjs → chunk-6XUG4L7X.cjs} +6 -6
- package/dist/{chunk-XUJC6GHE.cjs.map → chunk-6XUG4L7X.cjs.map} +1 -1
- package/dist/{chunk-XZKFZMRT.cjs → chunk-77WU3V3J.cjs} +6 -6
- package/dist/{chunk-XZKFZMRT.cjs.map → chunk-77WU3V3J.cjs.map} +1 -1
- package/dist/{chunk-ZFJN23V4.cjs → chunk-A2PX5IRC.cjs} +4 -4
- package/dist/{chunk-ZFJN23V4.cjs.map → chunk-A2PX5IRC.cjs.map} +1 -1
- package/dist/{chunk-ZDBPQBAA.js → chunk-AE3AAJ4O.js} +3 -3
- package/dist/{chunk-ZDBPQBAA.js.map → chunk-AE3AAJ4O.js.map} +1 -1
- package/dist/chunk-ALRXY4QH.cjs +13 -0
- package/dist/chunk-ALRXY4QH.cjs.map +1 -0
- package/dist/{chunk-UARGJ5IZ.js → chunk-BMJVKYVB.js} +56 -12
- package/dist/chunk-BMJVKYVB.js.map +1 -0
- package/dist/{chunk-6XVHYD5R.js → chunk-CLAKSLXF.js} +4 -9
- package/dist/chunk-CLAKSLXF.js.map +1 -0
- package/dist/chunk-CTANEPMY.js +61 -0
- package/dist/chunk-CTANEPMY.js.map +1 -0
- package/dist/chunk-CZ5IQB3L.js +42 -0
- package/dist/chunk-CZ5IQB3L.js.map +1 -0
- package/dist/{chunk-WGKAOUEQ.cjs → chunk-D34K455O.cjs} +3 -2
- package/dist/chunk-D34K455O.cjs.map +1 -0
- package/dist/chunk-EPXGG27L.js +331 -0
- package/dist/chunk-EPXGG27L.js.map +1 -0
- package/dist/{chunk-3M4BNKFJ.cjs → chunk-F6WGGYQW.cjs} +167 -3
- package/dist/chunk-F6WGGYQW.cjs.map +1 -0
- package/dist/{chunk-7FCTCWHD.js → chunk-FXGNRYQQ.js} +3 -3
- package/dist/{chunk-7FCTCWHD.js.map → chunk-FXGNRYQQ.js.map} +1 -1
- package/dist/{chunk-ZNM2LW3D.cjs → chunk-GMBDLNLD.cjs} +105 -56
- package/dist/chunk-GMBDLNLD.cjs.map +1 -0
- package/dist/{chunk-NJVOJXBS.cjs → chunk-GSKLPI3J.cjs} +104 -49
- package/dist/chunk-GSKLPI3J.cjs.map +1 -0
- package/dist/{chunk-EWS2VFO4.js → chunk-HBXF6RUU.js} +4 -4
- package/dist/{chunk-EWS2VFO4.js.map → chunk-HBXF6RUU.js.map} +1 -1
- package/dist/{chunk-MOMFX32D.js → chunk-HWQ2SYNA.js} +194 -325
- package/dist/chunk-HWQ2SYNA.js.map +1 -0
- package/dist/{chunk-SCMTN57Y.js → chunk-IY3Y462W.js} +3 -3
- package/dist/{chunk-SCMTN57Y.js.map → chunk-IY3Y462W.js.map} +1 -1
- package/dist/{chunk-ZZGQRRN7.js → chunk-KCZHQH2O.js} +6 -306
- package/dist/chunk-KCZHQH2O.js.map +1 -0
- package/dist/{chunk-XROE3CAS.cjs → chunk-KHH54GRP.cjs} +120 -79
- package/dist/chunk-KHH54GRP.cjs.map +1 -0
- package/dist/{chunk-FVVD6XY2.js → chunk-KL6GAYTT.js} +13 -4
- package/dist/chunk-KL6GAYTT.js.map +1 -0
- package/dist/{chunk-FVII3KHN.js → chunk-KMGCHV6O.js} +163 -4
- package/dist/chunk-KMGCHV6O.js.map +1 -0
- package/dist/{chunk-FMXFHJWX.cjs → chunk-L2TVY6XN.cjs} +4 -4
- package/dist/{chunk-FMXFHJWX.cjs.map → chunk-L2TVY6XN.cjs.map} +1 -1
- package/dist/{chunk-FQXRYPCX.cjs → chunk-LH72PQO2.cjs} +505 -68
- package/dist/chunk-LH72PQO2.cjs.map +1 -0
- package/dist/chunk-LMAQUR55.cjs +506 -0
- package/dist/chunk-LMAQUR55.cjs.map +1 -0
- package/dist/{chunk-F5YEMSNK.cjs → chunk-M5OCFGHF.cjs} +571 -30
- package/dist/chunk-M5OCFGHF.cjs.map +1 -0
- package/dist/{chunk-VOWJCUMR.js → chunk-MD4XHED4.js} +3 -3
- package/dist/{chunk-VOWJCUMR.js.map → chunk-MD4XHED4.js.map} +1 -1
- package/dist/chunk-N5HH46JF.cjs +68 -0
- package/dist/chunk-N5HH46JF.cjs.map +1 -0
- package/dist/{chunk-G4XWVWRI.js → chunk-NIAFR5EE.js} +5 -4
- package/dist/chunk-NIAFR5EE.js.map +1 -0
- package/dist/{chunk-CF4S4N5X.js → chunk-O2QOBA6Q.js} +2 -2
- package/dist/{chunk-CF4S4N5X.js.map → chunk-O2QOBA6Q.js.map} +1 -1
- package/dist/{chunk-4GGLKRYI.cjs → chunk-O6TBB4IF.cjs} +2 -2
- package/dist/{chunk-4GGLKRYI.cjs.map → chunk-O6TBB4IF.cjs.map} +1 -1
- package/dist/{chunk-SWVGHAYO.js → chunk-O7RZRUMZ.js} +110 -74
- package/dist/chunk-O7RZRUMZ.js.map +1 -0
- package/dist/{chunk-LLOIAGFB.js → chunk-OV3JTKBY.js} +449 -51
- package/dist/chunk-OV3JTKBY.js.map +1 -0
- package/dist/{chunk-A3FHTSLB.js → chunk-PSKZKLDG.js} +550 -31
- package/dist/chunk-PSKZKLDG.js.map +1 -0
- package/dist/{chunk-VB2ARGQ6.js → chunk-RGNHHIMN.js} +3 -3
- package/dist/chunk-RGNHHIMN.js.map +1 -0
- package/dist/chunk-SMOO5FAH.js +10 -0
- package/dist/chunk-SMOO5FAH.js.map +1 -0
- package/dist/{chunk-5XRRENHD.cjs → chunk-TM5JYSJF.cjs} +170 -17
- package/dist/chunk-TM5JYSJF.cjs.map +1 -0
- package/dist/{chunk-PONP5J5E.cjs → chunk-V24EPI5N.cjs} +13 -3
- package/dist/chunk-V24EPI5N.cjs.map +1 -0
- package/dist/{chunk-RQ4F3AJH.cjs → chunk-V5EEQR2U.cjs} +21 -21
- package/dist/{chunk-RQ4F3AJH.cjs.map → chunk-V5EEQR2U.cjs.map} +1 -1
- package/dist/chunk-WZVIBAKN.cjs +351 -0
- package/dist/chunk-WZVIBAKN.cjs.map +1 -0
- package/dist/{chunk-5M43XMRB.cjs → chunk-X5BAFW3Q.cjs} +8 -8
- package/dist/{chunk-5M43XMRB.cjs.map → chunk-X5BAFW3Q.cjs.map} +1 -1
- package/dist/{chunk-RUHKBEFF.js → chunk-XBTYGQ6Z.js} +63 -10
- package/dist/chunk-XBTYGQ6Z.js.map +1 -0
- package/dist/{chunk-JHTT2V4A.cjs → chunk-XGGZWA4A.cjs} +118 -52
- package/dist/chunk-XGGZWA4A.cjs.map +1 -0
- package/dist/{chunk-5I4T4QR5.cjs → chunk-XGVJGNZW.cjs} +5 -5
- package/dist/{chunk-5I4T4QR5.cjs.map → chunk-XGVJGNZW.cjs.map} +1 -1
- package/dist/{chunk-7ARKVJTN.cjs → chunk-Y35JQPT6.cjs} +228 -383
- package/dist/chunk-Y35JQPT6.cjs.map +1 -0
- package/dist/{chunk-AFQFGZN7.cjs → chunk-Y4GCJJPF.cjs} +8 -6
- package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
- package/dist/{chunk-C77F4ZTL.js → chunk-YUER7TJG.js} +3 -3
- package/dist/{chunk-C77F4ZTL.js.map → chunk-YUER7TJG.js.map} +1 -1
- package/dist/{chunk-HGI2VKIV.js → chunk-YX6TFX7H.js} +67 -14
- package/dist/chunk-YX6TFX7H.js.map +1 -0
- package/dist/{chunk-TWF2OSH4.cjs → chunk-ZPE2ZTJ4.cjs} +4 -4
- package/dist/{chunk-TWF2OSH4.cjs.map → chunk-ZPE2ZTJ4.cjs.map} +1 -1
- package/dist/entries/apps.cjs +44 -44
- package/dist/entries/apps.js +9 -9
- package/dist/entries/credits.cjs +286 -153
- package/dist/entries/credits.d.cts +254 -5
- package/dist/entries/credits.d.ts +254 -5
- package/dist/entries/credits.js +14 -9
- package/dist/entries/entities.cjs +188 -143
- package/dist/entries/entities.d.cts +122 -1
- package/dist/entries/entities.d.ts +122 -1
- package/dist/entries/entities.js +2 -1
- package/dist/entries/llm-models.cjs +77 -57
- package/dist/entries/llm-models.d.cts +85 -5
- package/dist/entries/llm-models.d.ts +85 -5
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +92 -87
- package/dist/entries/media.d.cts +19 -1
- package/dist/entries/media.d.ts +19 -1
- package/dist/entries/media.js +3 -2
- package/dist/entries/model-catalog.cjs +211 -103
- package/dist/entries/model-catalog.d.cts +135 -19
- package/dist/entries/model-catalog.d.ts +135 -19
- package/dist/entries/model-catalog.js +5 -5
- package/dist/entries/models.cjs +504 -295
- package/dist/entries/models.d.cts +71 -4
- package/dist/entries/models.d.ts +71 -4
- package/dist/entries/models.js +7 -6
- package/dist/entries/nodes.cjs +249 -233
- package/dist/entries/nodes.d.cts +35 -6
- package/dist/entries/nodes.d.ts +35 -6
- package/dist/entries/nodes.js +10 -10
- package/dist/entries/pipeline.cjs +152 -152
- package/dist/entries/pipeline.d.cts +3 -2
- package/dist/entries/pipeline.d.ts +3 -2
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/runtime-config.cjs +29 -29
- package/dist/entries/runtime-config.d.cts +10 -7
- package/dist/entries/runtime-config.d.ts +10 -7
- package/dist/entries/runtime-config.js +1 -1
- package/dist/entries/social.cjs +177 -177
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +8 -0
- package/dist/entries/types.d.ts +8 -0
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +316 -208
- package/dist/entries/video.d.cts +490 -99
- package/dist/entries/video.d.ts +490 -99
- package/dist/entries/video.js +8 -4
- package/dist/entries/workflow.cjs +102 -102
- package/dist/entries/workflow.d.cts +5 -4
- package/dist/entries/workflow.d.ts +5 -4
- package/dist/entries/workflow.js +2 -2
- package/dist/{gpt-image-2-6-BeZdT-pW.d.cts → gpt-image-2-6-jIRQBRag.d.cts} +6 -0
- package/dist/{gpt-image-2-6-BeZdT-pW.d.ts → gpt-image-2-6-jIRQBRag.d.ts} +6 -0
- package/dist/index.cjs +2727 -2092
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +30 -27
- package/dist/{model-catalog-BgSvskgY.d.ts → model-catalog-C_Eo35tL.d.cts} +158 -14
- package/dist/{model-catalog-BgSvskgY.d.cts → model-catalog-C_Eo35tL.d.ts} +158 -14
- package/dist/{model-constants-DHd9jwQ7.d.cts → model-constants-Bg4ccSQb.d.ts} +427 -34
- package/dist/{model-constants-DHd9jwQ7.d.ts → model-constants-DWcxOmaY.d.cts} +427 -34
- package/package.json +1 -1
- package/src/__tests__/credit-identifiers.test.ts +29 -0
- package/src/__tests__/extend-providers.test.ts +194 -0
- package/src/__tests__/fixtures/mask-composite-quote-parity.json +118 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +68 -0
- package/src/__tests__/gpt-image-2-6-formats.test.ts +4 -1
- package/src/__tests__/grok-video-15-catalog.test.ts +189 -0
- package/src/__tests__/gvp-supported-providers.test.ts +32 -4
- package/src/__tests__/lip-sync-audio-rate.test.ts +74 -0
- package/src/__tests__/lip-sync-levers.test.ts +31 -0
- package/src/__tests__/llm-models.test.ts +132 -3
- package/src/__tests__/llm-price-key.test.ts +152 -1
- package/src/__tests__/minimax-h3-image.test.ts +140 -0
- package/src/__tests__/model-makers.test.ts +49 -11
- package/src/__tests__/model-tree.test.ts +13 -0
- package/src/__tests__/nemotron-transcribe-pricing.test.ts +61 -0
- package/src/__tests__/normalize-node-params.test.ts +25 -0
- package/src/__tests__/pixverse-v6-max-catalog.test.ts +271 -0
- package/src/__tests__/prompt-length-limits.test.ts +4 -0
- package/src/__tests__/retired-video-provider.test.ts +15 -5
- package/src/__tests__/seedance-25-catalog-modes.test.ts +1 -1
- package/src/__tests__/seedance-task-type.test.ts +188 -0
- package/src/__tests__/seedream-5-5.test.ts +117 -0
- package/src/__tests__/transcribe-capabilities.test.ts +39 -2
- package/src/__tests__/transcribe-preflight.test.ts +50 -1
- package/src/__tests__/unit-contract-compose.test.ts +27 -1
- package/src/__tests__/unit-contracts.test.ts +20 -6
- package/src/__tests__/upscale-factors.test.ts +107 -0
- package/src/__tests__/video-audio-capability.test.ts +35 -6
- package/src/__tests__/video-character-refs.test.ts +20 -2
- package/src/__tests__/video-collapse-parity.test.ts +19 -0
- package/src/__tests__/video-overlay-geometry.test.ts +68 -0
- package/src/__tests__/video-overlay-layer-plan.test.ts +3 -4
- package/src/__tests__/video-overlay-layouts.test.ts +529 -0
- package/src/__tests__/video-overlay-pricing.test.ts +61 -0
- package/src/__tests__/video-overlay-validate.test.ts +128 -0
- package/src/__tests__/video-overlay-wired-kind.test.ts +207 -0
- package/src/__tests__/video-overlay.test.ts +280 -194
- package/src/__tests__/video-ref-limits.test.ts +2 -1
- package/src/__tests__/video-reference-only.test.ts +6 -2
- package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
- package/src/__tests__/video-start-frame-only.test.ts +98 -0
- package/src/__tests__/video-upscale-params.test.ts +62 -0
- package/src/__tests__/wired-character-names.test.ts +220 -0
- package/src/catalog-projection.ts +8 -0
- package/src/credit-estimators/index.ts +18 -0
- package/src/credit-estimators/nemotron-transcribe.ts +87 -0
- package/src/credit-estimators/video-overlay.ts +70 -0
- package/src/credit-identifiers.ts +183 -16
- package/src/entity-image-url.ts +21 -0
- package/src/entries/credits.ts +26 -1
- package/src/entries/entities.ts +14 -0
- package/src/entries/llm-models.ts +6 -0
- package/src/entries/model-catalog.ts +44 -1
- package/src/entries/models.ts +69 -0
- package/src/entries/nodes.ts +4 -0
- package/src/entries/video.ts +7 -1
- package/src/freecut-protocol.ts +8 -0
- package/src/generated/unit-contracts.ts +8 -1
- package/src/gpt-image-2-6.ts +6 -0
- package/src/input-image-pricing.ts +76 -0
- package/src/lip-sync-levers.ts +56 -0
- package/src/lip-sync-pricing.ts +91 -1
- package/src/llm-models.ts +249 -4
- package/src/mask-composite.ts +11 -0
- package/src/minimax-h3-image.ts +61 -0
- package/src/model-catalog.ts +604 -40
- package/src/model-constants.ts +860 -55
- package/src/model-tree.ts +2 -1
- package/src/nodaro-video-upscale.ts +48 -0
- package/src/node-default-mappings.ts +15 -2
- package/src/node-execution-state.ts +4 -3
- package/src/normalize-node-params.ts +49 -1
- package/src/producer-types.ts +23 -1
- package/src/runtime-config/contract.ts +10 -7
- package/src/seedance-draft.ts +2 -1
- package/src/seedance-task-type.ts +37 -0
- package/src/seedream-5-5.ts +45 -0
- package/src/transcribe-preflight.ts +58 -7
- package/src/unit-contract-compose.ts +4 -1
- package/src/upscale-factors.ts +111 -0
- package/src/video-character-refs.ts +7 -4
- package/src/video-duration.ts +9 -0
- package/src/video-overlay-geometry.ts +99 -0
- package/src/video-overlay-input.ts +25 -0
- package/src/video-overlay-layout-ids.ts +48 -0
- package/src/video-overlay-layouts.ts +315 -0
- package/src/video-overlay-validate.ts +223 -0
- package/src/video-overlay-video-layers.ts +304 -0
- package/src/video-overlay.ts +165 -297
- package/src/video-ui-defaults.ts +11 -7
- package/src/video-upscale-params.ts +67 -0
- package/src/wired-character-names.ts +202 -0
- package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
- package/dist/chunk-4KYLNTR7.cjs.map +0 -1
- package/dist/chunk-5XRRENHD.cjs.map +0 -1
- package/dist/chunk-673E4KYC.js.map +0 -1
- package/dist/chunk-6XVHYD5R.js.map +0 -1
- package/dist/chunk-7ARKVJTN.cjs.map +0 -1
- package/dist/chunk-7WGKP3EU.js +0 -23
- package/dist/chunk-7WGKP3EU.js.map +0 -1
- package/dist/chunk-A3FHTSLB.js.map +0 -1
- package/dist/chunk-AFQFGZN7.cjs.map +0 -1
- package/dist/chunk-F5YEMSNK.cjs.map +0 -1
- package/dist/chunk-FQXRYPCX.cjs.map +0 -1
- package/dist/chunk-FVII3KHN.js.map +0 -1
- package/dist/chunk-FVVD6XY2.js.map +0 -1
- package/dist/chunk-G4XWVWRI.js.map +0 -1
- package/dist/chunk-HGI2VKIV.js.map +0 -1
- package/dist/chunk-IRQ3SPX7.js.map +0 -1
- package/dist/chunk-IVXSNW2B.cjs.map +0 -1
- package/dist/chunk-JHTT2V4A.cjs.map +0 -1
- package/dist/chunk-KHZAQGRP.js +0 -17
- package/dist/chunk-KHZAQGRP.js.map +0 -1
- package/dist/chunk-LLOIAGFB.js.map +0 -1
- package/dist/chunk-M3SXUUWC.cjs.map +0 -1
- package/dist/chunk-MOMFX32D.js.map +0 -1
- package/dist/chunk-NCOGGRRP.cjs +0 -27
- package/dist/chunk-NCOGGRRP.cjs.map +0 -1
- package/dist/chunk-NJVOJXBS.cjs.map +0 -1
- package/dist/chunk-PONP5J5E.cjs.map +0 -1
- package/dist/chunk-RUHKBEFF.js.map +0 -1
- package/dist/chunk-SWVGHAYO.js.map +0 -1
- package/dist/chunk-UARGJ5IZ.js.map +0 -1
- package/dist/chunk-VB2ARGQ6.js.map +0 -1
- package/dist/chunk-WGKAOUEQ.cjs.map +0 -1
- package/dist/chunk-XROE3CAS.cjs.map +0 -1
- package/dist/chunk-ZLDFPVVI.cjs +0 -19
- package/dist/chunk-ZLDFPVVI.cjs.map +0 -1
- package/dist/chunk-ZNM2LW3D.cjs.map +0 -1
- package/dist/chunk-ZZGQRRN7.js.map +0 -1
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest"
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
LLM_FEATURE_DEFAULTS,
|
|
4
|
+
LLM_FEATURE_DEFAULTS_FROM,
|
|
5
|
+
LLM_MODELS,
|
|
6
|
+
LLM_REASONING_EFFORTS,
|
|
7
|
+
STRUCTURED_VISION_MODELS,
|
|
8
|
+
defaultReasoningEffort,
|
|
9
|
+
effectiveReasoningEffort,
|
|
10
|
+
getLlmModel,
|
|
11
|
+
llmDefaultsFeature,
|
|
12
|
+
llmPriceKey,
|
|
13
|
+
llmSendsSchema,
|
|
14
|
+
llmServesDirect,
|
|
15
|
+
parseLlmPriceKeyModel,
|
|
16
|
+
structuredWireMode,
|
|
17
|
+
} from "../entries/llm-models.js"
|
|
3
18
|
|
|
4
19
|
// The key a client asks `POST /v1/credits/model-costs` for a metered LLM
|
|
5
20
|
// call's price with: `<feature>:<model>`, plus `:direct` when the call is
|
|
@@ -53,3 +68,139 @@ describe("llmPriceKey", () => {
|
|
|
53
68
|
expect(() => llmPriceKey("llm-chat", "")).toThrow(TypeError)
|
|
54
69
|
})
|
|
55
70
|
})
|
|
71
|
+
|
|
72
|
+
// A model whose price depends on the effort a call sends (`effortPriced`)
|
|
73
|
+
// names that effort in its key — no model does today (GPT-6.1 Terra did for
|
|
74
|
+
// part of 2026-11-12), so every key is exactly what it was before the suffix
|
|
75
|
+
// existed. The mechanism is exercised on a stand-in: Terra flagged for the
|
|
76
|
+
// length of one test.
|
|
77
|
+
describe("llmPriceKey: the effort, on a model whose price depends on it (`effortPriced`)", () => {
|
|
78
|
+
/** The key as it was built before effort-priced models existed. */
|
|
79
|
+
const keyBefore = (feature: string, modelId: string, effort?: string, advanced?: boolean) => {
|
|
80
|
+
const e = effort ?? defaultReasoningEffort(llmDefaultsFeature(feature), modelId)
|
|
81
|
+
return llmServesDirect(modelId, e, advanced) ? `${feature}:${modelId}:direct` : `${feature}:${modelId}`
|
|
82
|
+
}
|
|
83
|
+
/** Run `fn` with `modelId` flagged `effortPriced`, then put the registry back. */
|
|
84
|
+
const whileEffortPriced = (modelId: string, fn: () => void) => {
|
|
85
|
+
const model = getLlmModel(modelId) as { effortPriced?: true }
|
|
86
|
+
const before = model.effortPriced
|
|
87
|
+
model.effortPriced = true
|
|
88
|
+
try {
|
|
89
|
+
fn()
|
|
90
|
+
} finally {
|
|
91
|
+
if (before === undefined) delete model.effortPriced
|
|
92
|
+
else model.effortPriced = before
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
it("no model is effort-priced today", () => {
|
|
97
|
+
expect(LLM_MODELS.filter((m) => m.effortPriced).map((m) => m.id)).toEqual([])
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it("every model's key is unchanged, at every effort, with Advanced mode on or off", () => {
|
|
101
|
+
for (const m of LLM_MODELS) {
|
|
102
|
+
for (const feature of ["llm-chat", "ai-writer", "describe-to-picker", "text-to-picker"]) {
|
|
103
|
+
for (const effort of [undefined, ...LLM_REASONING_EFFORTS]) {
|
|
104
|
+
for (const advanced of [false, true]) {
|
|
105
|
+
expect(llmPriceKey(feature, m.id, effort, advanced), `${feature} ${m.id} ${effort} ${advanced}`).toBe(keyBefore(feature, m.id, effort, advanced))
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it("GPT-6.1 Terra's key is the bare key at every effort", () => {
|
|
113
|
+
for (const effort of [undefined, ...LLM_REASONING_EFFORTS]) {
|
|
114
|
+
expect(llmPriceKey("llm-chat", "gpt-6.1-terra", effort), String(effort)).toBe("llm-chat:gpt-6.1-terra")
|
|
115
|
+
expect(llmPriceKey("ai-writer", "gpt-6.1-terra", effort), String(effort)).toBe("ai-writer:gpt-6.1-terra")
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
it("an effort-priced model's key names the effort its call sends: none at Auto (or a level it does not offer), the level otherwise", () => {
|
|
120
|
+
whileEffortPriced("gpt-6.1-terra", () => {
|
|
121
|
+
expect(llmPriceKey("llm-chat", "gpt-6.1-terra")).toBe("llm-chat:gpt-6.1-terra")
|
|
122
|
+
expect(llmPriceKey("llm-chat", "gpt-6.1-terra", "none")).toBe("llm-chat:gpt-6.1-terra")
|
|
123
|
+
expect(llmPriceKey("llm-chat", "gpt-6.1-terra", "high")).toBe("llm-chat:gpt-6.1-terra:effort-high")
|
|
124
|
+
expect(llmPriceKey("ai-writer", "gpt-6.1-terra", "max", true)).toBe("ai-writer:gpt-6.1-terra:effort-max")
|
|
125
|
+
expect(parseLlmPriceKeyModel("gpt-6.1-terra:effort-high")).toEqual({ modelId: "gpt-6.1-terra", reasoningEffort: "high" })
|
|
126
|
+
// A level it does not offer, and both suffixes at once, are no key.
|
|
127
|
+
expect(parseLlmPriceKeyModel("gpt-6.1-terra:effort-none")).toBeNull()
|
|
128
|
+
expect(parseLlmPriceKeyModel("gpt-6.1-terra:effort-high:direct")).toBeNull()
|
|
129
|
+
expect(parseLlmPriceKeyModel("gpt-6.1-terra:direct:effort-high")).toBeNull()
|
|
130
|
+
})
|
|
131
|
+
expect(getLlmModel("gpt-6.1-terra")?.effortPriced).toBeUndefined()
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it("parseLlmPriceKeyModel reads back exactly the keys llmPriceKey builds", () => {
|
|
135
|
+
expect(parseLlmPriceKeyModel("gpt-6.1-terra")).toEqual({ modelId: "gpt-6.1-terra" })
|
|
136
|
+
expect(parseLlmPriceKeyModel("claude-opus-5.5:direct")).toEqual({ modelId: "claude-opus-5.5", lane: "direct" })
|
|
137
|
+
for (const m of LLM_MODELS) {
|
|
138
|
+
for (const effort of [undefined, ...LLM_REASONING_EFFORTS]) {
|
|
139
|
+
for (const advanced of [false, true]) {
|
|
140
|
+
const key = llmPriceKey("llm-chat", m.id, effort, advanced)
|
|
141
|
+
expect(parseLlmPriceKeyModel(key.slice("llm-chat:".length))?.modelId, key).toBe(m.id)
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it("parseLlmPriceKeyModel refuses what no key carries", () => {
|
|
148
|
+
// An effort on a model whose price does not depend on it — Terra's included now.
|
|
149
|
+
expect(parseLlmPriceKeyModel("gpt-6.1-terra:effort-high")).toBeNull()
|
|
150
|
+
expect(parseLlmPriceKeyModel("gpt-6.1-sol:effort-high")).toBeNull()
|
|
151
|
+
expect(parseLlmPriceKeyModel("claude-opus-5.5:effort-high")).toBeNull()
|
|
152
|
+
// Unknown models, borrowed slugs, other suffixes.
|
|
153
|
+
expect(parseLlmPriceKeyModel("no-such-model")).toBeNull()
|
|
154
|
+
expect(parseLlmPriceKeyModel("gpt-6-1-terra")).toBeNull()
|
|
155
|
+
expect(parseLlmPriceKeyModel("gpt-6.1-terra:premium")).toBeNull()
|
|
156
|
+
})
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
describe("effortBelowLowestSendsLowest (Kimi K3 and K3.1 Pro)", () => {
|
|
160
|
+
it("a request below the lowest level sends the lowest level; Auto still sends nothing", () => {
|
|
161
|
+
for (const id of ["kimi-k3", "kimi-k3.1-pro"]) {
|
|
162
|
+
expect(getLlmModel(id)?.effortBelowLowestSendsLowest, id).toBe(true)
|
|
163
|
+
expect(effectiveReasoningEffort(id, "none"), id).toBe("low")
|
|
164
|
+
expect(effectiveReasoningEffort(id, undefined), id).toBeUndefined()
|
|
165
|
+
expect(effectiveReasoningEffort(id, "low"), id).toBe("low")
|
|
166
|
+
}
|
|
167
|
+
// The clamp above the lowest level is unchanged.
|
|
168
|
+
expect(effectiveReasoningEffort("kimi-k3.1-pro", "medium")).toBe("low")
|
|
169
|
+
expect(effectiveReasoningEffort("kimi-k3.1-pro", "xhigh")).toBe("high")
|
|
170
|
+
expect(effectiveReasoningEffort("kimi-k3", "medium")).toBe("medium")
|
|
171
|
+
expect(effectiveReasoningEffort("kimi-k3", "max")).toBe("high")
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
it("only the two Kimi models declare it — every other model still drops a request below its lowest level", () => {
|
|
175
|
+
expect(LLM_MODELS.filter((m) => m.effortBelowLowestSendsLowest).map((m) => m.id).sort()).toEqual(["kimi-k3", "kimi-k3.1-pro"])
|
|
176
|
+
expect(effectiveReasoningEffort("gpt-6.1-sol", "none")).toBeUndefined()
|
|
177
|
+
expect(effectiveReasoningEffort("gpt-6.1-terra", "none")).toBeUndefined()
|
|
178
|
+
expect(effectiveReasoningEffort("gemini-4-carbon", "none")).toBeUndefined()
|
|
179
|
+
})
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
describe("structured output: a trusted mode vs a schema hint", () => {
|
|
183
|
+
it("Gemini 4 Carbon sends its schema as a hint, never as a trusted mode", () => {
|
|
184
|
+
const carbon = getLlmModel("gemini-4-carbon")!
|
|
185
|
+
expect(carbon.structuredOutputMode).toBeUndefined()
|
|
186
|
+
expect(carbon.structuredOutputHint).toBe("kie-response-format")
|
|
187
|
+
expect(structuredWireMode(carbon)).toBe("kie-response-format")
|
|
188
|
+
expect(STRUCTURED_VISION_MODELS.map((m) => m.id)).not.toContain("gemini-4-carbon")
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
it("a hint is never set beside a trusted mode; a trusted model's wire mode is its mode", () => {
|
|
192
|
+
for (const m of LLM_MODELS) {
|
|
193
|
+
expect(m.structuredOutputMode !== undefined && m.structuredOutputHint !== undefined, m.id).toBe(false)
|
|
194
|
+
if (m.structuredOutputMode) expect(structuredWireMode(m), m.id).toBe(m.structuredOutputMode)
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
it("llmSendsSchema: a model that sends its schema (trusted or hinted) counts it; one that sends none does not", () => {
|
|
199
|
+
expect(llmSendsSchema("gemini-4-carbon")).toBe(true)
|
|
200
|
+
expect(llmSendsSchema("gpt-6.1-terra")).toBe(true)
|
|
201
|
+
expect(llmSendsSchema("gpt-5.2")).toBe(false)
|
|
202
|
+
// Unset model = the feature's default; an unknown model counts it.
|
|
203
|
+
expect(llmSendsSchema(undefined, "llm-chat")).toBe(llmSendsSchema(LLM_FEATURE_DEFAULTS["llm-chat"]))
|
|
204
|
+
expect(llmSendsSchema("no-such-model")).toBe(true)
|
|
205
|
+
})
|
|
206
|
+
})
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest"
|
|
2
|
+
import { buildCreditModelIdentifier, resolveNormalizedImageGen } from "../credit-identifiers.js"
|
|
3
|
+
import { MODEL_CATALOG, defaultResolutionFor, normalizeModelInput } from "../model-catalog.js"
|
|
4
|
+
import {
|
|
5
|
+
MINIMAX_H3_IMAGE_I2I,
|
|
6
|
+
MINIMAX_H3_IMAGE_T2I,
|
|
7
|
+
isMinimaxH3Image,
|
|
8
|
+
minimaxH3ImageCreditId,
|
|
9
|
+
} from "../minimax-h3-image.js"
|
|
10
|
+
import { isPricedPerInputImage, pricedEstimatedImages, pricedSentImages } from "../input-image-pricing.js"
|
|
11
|
+
import {
|
|
12
|
+
IMAGE_GEN_PROVIDERS,
|
|
13
|
+
IMAGE_I2I_PROVIDERS,
|
|
14
|
+
MINIMAX_H3_PROVIDERS,
|
|
15
|
+
REF_IMAGE_MAX_LIMITS,
|
|
16
|
+
T2I_TO_I2I_VARIANT,
|
|
17
|
+
imageReferenceLimit,
|
|
18
|
+
isMinimaxH3Provider,
|
|
19
|
+
requestImageLimit,
|
|
20
|
+
} from "../model-constants.js"
|
|
21
|
+
|
|
22
|
+
const T2I = MINIMAX_H3_IMAGE_T2I
|
|
23
|
+
const I2I = MINIMAX_H3_IMAGE_I2I
|
|
24
|
+
|
|
25
|
+
describe("MiniMax H3 Image ids", () => {
|
|
26
|
+
it("is an image model on both lists, and never the H3 video model", () => {
|
|
27
|
+
expect(IMAGE_GEN_PROVIDERS).toContain(T2I)
|
|
28
|
+
expect(IMAGE_I2I_PROVIDERS).toContain(I2I)
|
|
29
|
+
for (const id of [T2I, I2I]) {
|
|
30
|
+
expect(MODEL_CATALOG[id]!.kind).toBe("image")
|
|
31
|
+
expect(MINIMAX_H3_PROVIDERS.has(id)).toBe(false)
|
|
32
|
+
expect(isMinimaxH3Provider(id)).toBe(false)
|
|
33
|
+
}
|
|
34
|
+
expect(isMinimaxH3Image("minimax-h3")).toBe(false)
|
|
35
|
+
expect(isPricedPerInputImage("minimax-h3")).toBe(false)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it("references move a prompt to the edit id, up to sixteen of them", () => {
|
|
39
|
+
expect(T2I_TO_I2I_VARIANT[T2I]).toBe(I2I)
|
|
40
|
+
expect(REF_IMAGE_MAX_LIMITS[I2I]).toBe(16)
|
|
41
|
+
expect(imageReferenceLimit(T2I)).toBe(16)
|
|
42
|
+
expect(requestImageLimit(T2I)).toBe(16)
|
|
43
|
+
expect(requestImageLimit(I2I)).toBe(16)
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
describe("MiniMax H3 Image catalog entries", () => {
|
|
48
|
+
it("offer ten ratios and auto, auto last so a first-listed fallback lands on a real ratio", () => {
|
|
49
|
+
for (const id of [T2I, I2I]) {
|
|
50
|
+
const ratios = MODEL_CATALOG[id]!.aspectRatios!
|
|
51
|
+
expect(ratios).toHaveLength(11)
|
|
52
|
+
expect(ratios[0]).not.toBe("auto")
|
|
53
|
+
expect(ratios[ratios.length - 1]).toBe("auto")
|
|
54
|
+
expect([...ratios].sort()).toEqual(["1:1", "16:9", "21:9", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "auto"].sort())
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it("render 1K, 2K and 4K at every ratio, 2K by default", () => {
|
|
59
|
+
for (const id of [T2I, I2I]) {
|
|
60
|
+
const entry = MODEL_CATALOG[id]!
|
|
61
|
+
expect(entry.resolutions).toEqual(["1K", "2K", "4K"])
|
|
62
|
+
expect(entry.resolutionsByAspectRatio).toBeUndefined()
|
|
63
|
+
expect(defaultResolutionFor(id)).toBe("2K")
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it("write PNG by default or JPEG, and nothing else", () => {
|
|
68
|
+
for (const id of [T2I, I2I]) {
|
|
69
|
+
expect(MODEL_CATALOG[id]!.outputFormats).toEqual(["png", "jpeg"])
|
|
70
|
+
expect(normalizeModelInput(id, { outputFormat: "webp" }).outputFormat).toBe("png")
|
|
71
|
+
expect(normalizeModelInput(id, { outputFormat: "jpeg" }).outputFormat).toBe("jpeg")
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it("take a seed and no quality, background or mask", () => {
|
|
76
|
+
for (const id of [T2I, I2I]) {
|
|
77
|
+
const entry = MODEL_CATALOG[id]!
|
|
78
|
+
expect(entry.noSeed).toBeUndefined()
|
|
79
|
+
expect(entry.qualities).toBeUndefined()
|
|
80
|
+
expect(entry.backgrounds).toBeUndefined()
|
|
81
|
+
expect(entry.features ?? []).not.toContain("mask")
|
|
82
|
+
expect(entry.autoAspectFromSourceImage).toBeUndefined()
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
describe("MiniMax H3 Image price ids", () => {
|
|
88
|
+
it("a prompt is priced by its size, 2K when none or an unknown one is named", () => {
|
|
89
|
+
expect(buildCreditModelIdentifier(T2I)).toBe("minimax-h3-image:2K")
|
|
90
|
+
expect(buildCreditModelIdentifier(T2I, undefined, "1K")).toBe("minimax-h3-image:1K")
|
|
91
|
+
expect(buildCreditModelIdentifier(T2I, undefined, "4K")).toBe("minimax-h3-image:4K")
|
|
92
|
+
expect(buildCreditModelIdentifier(T2I, undefined, "4k")).toBe("minimax-h3-image:4K")
|
|
93
|
+
expect(buildCreditModelIdentifier(T2I, undefined, "2 MP")).toBe("minimax-h3-image:2K")
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it("a quality another model takes changes nothing", () => {
|
|
97
|
+
expect(buildCreditModelIdentifier(T2I, "high", "1K")).toBe("minimax-h3-image:1K")
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it("an edit is priced by its size and its reference images, one to sixteen", () => {
|
|
101
|
+
expect(buildCreditModelIdentifier(I2I, undefined, "4K", undefined, undefined, 3)).toBe("minimax-h3-image-i2i:4K:3ref")
|
|
102
|
+
expect(buildCreditModelIdentifier(I2I, undefined, undefined, undefined, undefined, 0)).toBe("minimax-h3-image-i2i:2K:1ref")
|
|
103
|
+
expect(buildCreditModelIdentifier(I2I, undefined, "1K", undefined, undefined, 40)).toBe("minimax-h3-image-i2i:1K:16ref")
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
it("the text-to-image id sent images is priced as the edit it runs as", () => {
|
|
107
|
+
expect(minimaxH3ImageCreditId(T2I, "1K", 2)).toBe("minimax-h3-image-i2i:1K:2ref")
|
|
108
|
+
expect(buildCreditModelIdentifier(T2I, undefined, "4K", undefined, undefined, 1)).toBe("minimax-h3-image-i2i:4K:1ref")
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
it("the route and workflow snap price the size they send, with the swap or without", () => {
|
|
112
|
+
const swapped = resolveNormalizedImageGen({ provider: T2I, resolution: "4K", aspectRatio: "16:9", refCount: 2, swapToI2i: true })
|
|
113
|
+
expect(swapped.modelId).toBe(I2I)
|
|
114
|
+
expect(swapped.identifier).toBe("minimax-h3-image-i2i:4K:2ref")
|
|
115
|
+
const entity = resolveNormalizedImageGen({ provider: T2I, refCount: 1, swapToI2i: false })
|
|
116
|
+
expect(entity.modelId).toBe(T2I)
|
|
117
|
+
expect(entity.identifier).toBe("minimax-h3-image-i2i:2K:1ref")
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
describe("MiniMax H3 Image: the images a run sends", () => {
|
|
122
|
+
const BASE = "https://cdn.example.com/base.png"
|
|
123
|
+
const REF = "https://cdn.example.com/ref.png"
|
|
124
|
+
|
|
125
|
+
it("counts the base of an edit, once", () => {
|
|
126
|
+
expect(pricedSentImages(T2I, [], BASE)).toBe(1)
|
|
127
|
+
expect(pricedSentImages(T2I, [REF], BASE)).toBe(2)
|
|
128
|
+
expect(pricedSentImages(T2I, [BASE, REF], BASE)).toBe(2)
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
it("leaves every other model on its references alone", () => {
|
|
132
|
+
expect(pricedSentImages("seedream-5-flash", [REF], BASE)).toBe(1)
|
|
133
|
+
expect(pricedSentImages("minimax-h3", [REF], BASE)).toBe(1)
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
it("an estimate counts the node's images, the wired ones and an edit's own source", () => {
|
|
137
|
+
expect(pricedEstimatedImages(T2I, { referenceImageUrls: [REF] }, 2)).toBe(3)
|
|
138
|
+
expect(pricedEstimatedImages(I2I, {}, 0)).toBe(1)
|
|
139
|
+
})
|
|
140
|
+
})
|
|
@@ -1,19 +1,50 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest"
|
|
2
|
-
import { MODEL_CATALOG, MODEL_MAKERS, isModelMakerId, modelMakerOf } from "../model-catalog.js"
|
|
2
|
+
import { MODEL_CATALOG, MODEL_MAKERS, isModelMakerId, modelMakerOf, type ModelCatalogEntry, type ModelCatalogEntryFields } from "../model-catalog.js"
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Every catalog model names the company that made it (`maker`), served on
|
|
6
6
|
* `GET /v1/models` as `maker: { id, name }` and used to pick the maker's mark
|
|
7
|
-
* (`logoUrl`)
|
|
8
|
-
*
|
|
7
|
+
* (`logoUrl`) — unless it is marked `ownLabel: true` (offered under the
|
|
8
|
+
* deployment's own label, decided 2026-11-11), which names none and may carry
|
|
9
|
+
* none. `ModelCatalogEntry` requires exactly one of the two, so a new model
|
|
10
|
+
* without either does not compile; these cases also cover entries built at run
|
|
9
11
|
* time and keep the registry and the catalog in step.
|
|
10
12
|
*/
|
|
13
|
+
|
|
14
|
+
/** What is wrong with who each entry is offered under: no maker and no `ownLabel`, an unknown maker, or a maker on an own-label model. */
|
|
15
|
+
function offeredUnderProblems(entries: ReadonlyArray<{ id: string; maker?: unknown; ownLabel?: unknown }>): string[] {
|
|
16
|
+
return entries.flatMap((m) => {
|
|
17
|
+
if (m.ownLabel === true) return m.maker === undefined ? [] : [`${m.id}: marked ownLabel but names maker ${String(m.maker)}`]
|
|
18
|
+
if (m.ownLabel !== undefined) return [`${m.id}: ownLabel must be true or absent, not ${String(m.ownLabel)}`]
|
|
19
|
+
return isModelMakerId(m.maker) ? [] : [`${m.id}: names no maker from the registry (${String(m.maker)})`]
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
11
23
|
describe("model makers", () => {
|
|
12
|
-
it("every catalog model names a maker from the registry", () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
it("every catalog model names a maker from the registry, unless it is offered under the deployment's own label", () => {
|
|
25
|
+
expect(offeredUnderProblems(Object.values(MODEL_CATALOG))).toEqual([])
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it("the guard refuses a model with no maker that is not marked ownLabel", () => {
|
|
29
|
+
expect(offeredUnderProblems([{ id: "x" }])).toEqual(["x: names no maker from the registry (undefined)"])
|
|
30
|
+
expect(offeredUnderProblems([{ id: "x", maker: "acme" }])).toEqual(["x: names no maker from the registry (acme)"])
|
|
31
|
+
expect(offeredUnderProblems([{ id: "x", ownLabel: false }])).toEqual(["x: ownLabel must be true or absent, not false"])
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it("the guard refuses a model marked ownLabel that names a maker", () => {
|
|
35
|
+
expect(offeredUnderProblems([{ id: "x", ownLabel: true, maker: "google" }])).toEqual(["x: marked ownLabel but names maker google"])
|
|
36
|
+
expect(offeredUnderProblems([{ id: "x", ownLabel: true }])).toEqual([])
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it("the type requires exactly one of maker and ownLabel", () => {
|
|
40
|
+
const fields = {} as ModelCatalogEntryFields
|
|
41
|
+
const withMaker: ModelCatalogEntry = { ...fields, maker: "google" }
|
|
42
|
+
const ownLabel: ModelCatalogEntry = { ...fields, ownLabel: true }
|
|
43
|
+
// @ts-expect-error — neither
|
|
44
|
+
const neither: ModelCatalogEntry = { ...fields }
|
|
45
|
+
// @ts-expect-error — both
|
|
46
|
+
const both: ModelCatalogEntry = { ...fields, ownLabel: true, maker: "google" }
|
|
47
|
+
expect([withMaker, ownLabel, neither, both]).toHaveLength(4)
|
|
17
48
|
})
|
|
18
49
|
|
|
19
50
|
// `series` is the product line ("Kling", "Flux") — required on every entry,
|
|
@@ -27,7 +58,7 @@ describe("model makers", () => {
|
|
|
27
58
|
})
|
|
28
59
|
|
|
29
60
|
it("every registered maker makes at least one catalog model", () => {
|
|
30
|
-
const used = new Set<string>(Object.values(MODEL_CATALOG).
|
|
61
|
+
const used = new Set<string>(Object.values(MODEL_CATALOG).flatMap((m) => (m.maker === undefined ? [] : [m.maker])))
|
|
31
62
|
expect(Object.keys(MODEL_MAKERS).filter((id) => !used.has(id))).toEqual([])
|
|
32
63
|
})
|
|
33
64
|
|
|
@@ -41,11 +72,12 @@ describe("model makers", () => {
|
|
|
41
72
|
it("all the models of one family come from one maker", () => {
|
|
42
73
|
// `family` is the vendor / lab grouping clients filter on; a family whose
|
|
43
74
|
// models name two makers is almost always a copied entry that kept the
|
|
44
|
-
// other company's maker.
|
|
75
|
+
// other company's maker. An own-label model counts as its own "maker", so
|
|
76
|
+
// a family is never half own-label.
|
|
45
77
|
const makersByFamily = new Map<string, Set<string>>()
|
|
46
78
|
for (const m of Object.values(MODEL_CATALOG)) {
|
|
47
79
|
const makers = makersByFamily.get(m.family) ?? new Set<string>()
|
|
48
|
-
makers.add(m.maker)
|
|
80
|
+
makers.add(m.maker ?? "(own label)")
|
|
49
81
|
makersByFamily.set(m.family, makers)
|
|
50
82
|
}
|
|
51
83
|
const split = [...makersByFamily]
|
|
@@ -69,6 +101,12 @@ describe("model makers", () => {
|
|
|
69
101
|
expect(modelMakerOf(MODEL_CATALOG["seedance-2"]!)).toEqual({ id: "bytedance", name: "ByteDance" })
|
|
70
102
|
})
|
|
71
103
|
|
|
104
|
+
it("modelMakerOf serves no maker for a model offered under the deployment's own label", () => {
|
|
105
|
+
expect(modelMakerOf({ ownLabel: true })).toBeUndefined()
|
|
106
|
+
// Even one built at run time (or by a JavaScript caller) that also names a maker.
|
|
107
|
+
expect(modelMakerOf({ ownLabel: true, maker: "google" } as unknown as Pick<ModelCatalogEntry, "maker" | "ownLabel">)).toBeUndefined()
|
|
108
|
+
})
|
|
109
|
+
|
|
72
110
|
it("modelMakerOf never throws: an entry built at run time without a known maker has none", () => {
|
|
73
111
|
expect(modelMakerOf({ maker: "acme" as never })).toBeUndefined()
|
|
74
112
|
expect(modelMakerOf({ maker: undefined as never })).toBeUndefined()
|
|
@@ -69,6 +69,19 @@ describe("buildModelTree", () => {
|
|
|
69
69
|
expect(flux?.models.some((m) => m.label.toLowerCase().includes("kontext"))).toBe(true)
|
|
70
70
|
expect(tree.some((l) => l.series.toLowerCase().includes("kontext"))).toBe(false)
|
|
71
71
|
})
|
|
72
|
+
it("keeps the Hailuo line the video line it was, and MiniMax H3 Image in a line of its own", () => {
|
|
73
|
+
const hailuo = tree.filter((l) => l.series === "Hailuo")
|
|
74
|
+
expect(hailuo).toHaveLength(1)
|
|
75
|
+
expect(hailuo[0]!.kind).toBe("video")
|
|
76
|
+
// The members the line had before MiniMax H3 Image was added: no image model joins it.
|
|
77
|
+
expect(hailuo[0]!.models.map((m) => m.id).sort()).toEqual(
|
|
78
|
+
["hailuo-2.3", "hailuo-2.3-pro", "hailuo-avatar", "hailuo-standard", "minimax", "minimax-h3"],
|
|
79
|
+
)
|
|
80
|
+
const image = tree.filter((l) => l.series === "MiniMax Image")
|
|
81
|
+
expect(image).toHaveLength(1)
|
|
82
|
+
expect(image[0]!.kind).toBe("image")
|
|
83
|
+
expect(image[0]!.models.map((m) => m.id).sort()).toEqual(["minimax-h3-image", "minimax-h3-image-i2i"])
|
|
84
|
+
})
|
|
72
85
|
})
|
|
73
86
|
|
|
74
87
|
describe("searchModelVariants", () => {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest"
|
|
2
|
+
import {
|
|
3
|
+
NEMOTRON_TRANSCRIBE_ID,
|
|
4
|
+
NEMOTRON_TRANSCRIBE_PRICING,
|
|
5
|
+
nemotronTranscribeBaseCredits,
|
|
6
|
+
nemotronTranscribeCreditId,
|
|
7
|
+
nemotronTranscribeQuoteCreditId,
|
|
8
|
+
nemotronTranscribeStartedMinutes,
|
|
9
|
+
parseNemotronTranscribeCreditId,
|
|
10
|
+
} from "../credit-estimators/nemotron-transcribe.js"
|
|
11
|
+
import { MODEL_CATALOG } from "../model-catalog.js"
|
|
12
|
+
|
|
13
|
+
const RATE = NEMOTRON_TRANSCRIBE_PRICING.CREDITS_PER_RATE_DEFAULT
|
|
14
|
+
|
|
15
|
+
describe("Nemotron 3.5 Transcribe pricing (per started minute, decided 2026-11-12)", () => {
|
|
16
|
+
// 0.75 base credits a minute: the four-minute row (3) × minutes ÷ 4, rounded up once.
|
|
17
|
+
it.each([
|
|
18
|
+
[45, 1],
|
|
19
|
+
[60, 1],
|
|
20
|
+
[61, 2], // 2 started minutes → 1.5 → 2
|
|
21
|
+
[180, 3], // 3 minutes → 2.25 → 3
|
|
22
|
+
[600, 8], // 10 minutes → 7.5 → 8
|
|
23
|
+
[3600, 45], // 60 minutes → 45
|
|
24
|
+
])("%ss of audio has a base of %s credits at the launch rate", (sec, credits) => {
|
|
25
|
+
expect(nemotronTranscribeBaseCredits(RATE, nemotronTranscribeStartedMinutes(sec))).toBe(credits)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it("is 0.75 credits a minute at the launch rate", () => {
|
|
29
|
+
expect(RATE / NEMOTRON_TRANSCRIBE_PRICING.RATE_MINUTES).toBe(0.75)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it("counts an unknown or non-positive length as one minute, and caps at 60", () => {
|
|
33
|
+
expect(nemotronTranscribeStartedMinutes(undefined)).toBe(1)
|
|
34
|
+
expect(nemotronTranscribeStartedMinutes(0)).toBe(1)
|
|
35
|
+
expect(nemotronTranscribeStartedMinutes(Number.NaN)).toBe(1)
|
|
36
|
+
expect(nemotronTranscribeStartedMinutes(3600.2)).toBe(60)
|
|
37
|
+
expect(nemotronTranscribeStartedMinutes(99_999)).toBe(60)
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it("builds and parses the per-minute id", () => {
|
|
41
|
+
expect(nemotronTranscribeCreditId(190)).toBe("nemotron-3-5-transcribe:4m")
|
|
42
|
+
expect(parseNemotronTranscribeCreditId("nemotron-3-5-transcribe:4m")).toEqual({ minutes: 4 })
|
|
43
|
+
expect(parseNemotronTranscribeCreditId("nemotron-3-5-transcribe:60m")).toEqual({ minutes: 60 })
|
|
44
|
+
expect(parseNemotronTranscribeCreditId("nemotron-3-5-transcribe:61m")).toBeUndefined()
|
|
45
|
+
expect(parseNemotronTranscribeCreditId("nemotron-3-5-transcribe:0m")).toBeUndefined()
|
|
46
|
+
expect(parseNemotronTranscribeCreditId("nemotron-3-5-transcribe")).toBeUndefined()
|
|
47
|
+
expect(parseNemotronTranscribeCreditId(NEMOTRON_TRANSCRIBE_PRICING.RATE_CREDIT_ID)).toBeUndefined()
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it("quotes an unknown length at 60 minutes, the most a run is charged", () => {
|
|
51
|
+
expect(nemotronTranscribeQuoteCreditId(undefined)).toBe("nemotron-3-5-transcribe:60m")
|
|
52
|
+
expect(nemotronTranscribeQuoteCreditId(null)).toBe("nemotron-3-5-transcribe:60m")
|
|
53
|
+
expect(nemotronTranscribeQuoteCreditId(125)).toBe("nemotron-3-5-transcribe:3m")
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it("lists the four-minute rate row in the catalog at the launch rate", () => {
|
|
57
|
+
const entry = MODEL_CATALOG[NEMOTRON_TRANSCRIBE_ID as keyof typeof MODEL_CATALOG] as unknown as { pricing: Array<{ identifier: string; credits: number }>; maker?: string }
|
|
58
|
+
expect(entry.pricing).toEqual([expect.objectContaining({ identifier: NEMOTRON_TRANSCRIBE_PRICING.RATE_CREDIT_ID, credits: RATE })])
|
|
59
|
+
expect(entry.maker).toBe("nvidia")
|
|
60
|
+
})
|
|
61
|
+
})
|
|
@@ -129,3 +129,28 @@ describe("normalizeNodeModelParams", () => {
|
|
|
129
129
|
expect(second.adjustments).toEqual([])
|
|
130
130
|
})
|
|
131
131
|
})
|
|
132
|
+
|
|
133
|
+
describe("normalizeNodeModelParams — Motion Transfer (decided 2026-11-12)", () => {
|
|
134
|
+
it("a Wan Animate node at a size it does not have is written at 720p, the size it runs at", () => {
|
|
135
|
+
const { nodes, adjustments } = normalizeNodeModelParams([
|
|
136
|
+
{ id: "m1", type: "motion-transfer", data: { provider: "wan-animate-move", resolution: "1080p", prompt: "dance" } },
|
|
137
|
+
])
|
|
138
|
+
expect(nodes[0]!.data).toEqual({ provider: "wan-animate-move", resolution: "720p", prompt: "dance" })
|
|
139
|
+
expect(adjustments.map(({ nodeId, provider, field, from, to }) => ({ nodeId, provider, field, from, to }))).toEqual([
|
|
140
|
+
{ nodeId: "m1", provider: "wan-animate-move", field: "resolution", from: "1080p", to: "720p" },
|
|
141
|
+
])
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
it("leaves a Wan Animate size it has, an unset size, and every Kling node as it came", () => {
|
|
145
|
+
const input = [
|
|
146
|
+
{ id: "a", type: "motion-transfer", data: { provider: "wan-animate-replace", resolution: "580p" } },
|
|
147
|
+
{ id: "b", type: "motion-transfer", data: { provider: "wan-animate-replace" } },
|
|
148
|
+
{ id: "c", type: "motion-transfer", data: { provider: "kling", resolution: "480p" } },
|
|
149
|
+
{ id: "d", type: "motion-transfer", data: { resolution: "580p" } },
|
|
150
|
+
{ id: "e", type: "motion-transfer", data: { provider: "kling-3.0", resolution: "1080p" } },
|
|
151
|
+
]
|
|
152
|
+
const { nodes, adjustments } = normalizeNodeModelParams(input)
|
|
153
|
+
expect(adjustments).toEqual([])
|
|
154
|
+
nodes.forEach((n, i) => expect(n).toBe(input[i]))
|
|
155
|
+
})
|
|
156
|
+
})
|