@nodaro/shared 3.62.0 → 3.64.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.
Files changed (264) hide show
  1. package/dist/{chunk-C7POAYFE.js → chunk-36VWLB4J.js} +3 -3
  2. package/dist/{chunk-C7POAYFE.js.map → chunk-36VWLB4J.js.map} +1 -1
  3. package/dist/{chunk-S24ZBUB4.js → chunk-3AYM47GW.js} +6 -32
  4. package/dist/chunk-3AYM47GW.js.map +1 -0
  5. package/dist/{chunk-YCXRSWCQ.js → chunk-3KTWYYCN.js} +8 -5
  6. package/dist/chunk-3KTWYYCN.js.map +1 -0
  7. package/dist/{chunk-ZES6EZC4.js → chunk-4IUE2JB7.js} +3 -3
  8. package/dist/{chunk-ZES6EZC4.js.map → chunk-4IUE2JB7.js.map} +1 -1
  9. package/dist/{chunk-MYJQELFN.cjs → chunk-5OBTGNUQ.cjs} +547 -29
  10. package/dist/chunk-5OBTGNUQ.cjs.map +1 -0
  11. package/dist/{chunk-TWF2OSH4.cjs → chunk-67CMMTLN.cjs} +4 -4
  12. package/dist/{chunk-TWF2OSH4.cjs.map → chunk-67CMMTLN.cjs.map} +1 -1
  13. package/dist/{chunk-WRSWH7US.cjs → chunk-6BRWPJPP.cjs} +17 -2
  14. package/dist/chunk-6BRWPJPP.cjs.map +1 -0
  15. package/dist/{chunk-S5TMRJMX.js → chunk-6YIV37V7.js} +4 -4
  16. package/dist/{chunk-S5TMRJMX.js.map → chunk-6YIV37V7.js.map} +1 -1
  17. package/dist/{chunk-3M4BNKFJ.cjs → chunk-7AJGUI7L.cjs} +202 -16
  18. package/dist/chunk-7AJGUI7L.cjs.map +1 -0
  19. package/dist/{chunk-JZGZ26YB.js → chunk-7KQ6W5DS.js} +4 -4
  20. package/dist/{chunk-JZGZ26YB.js.map → chunk-7KQ6W5DS.js.map} +1 -1
  21. package/dist/{chunk-IWWVPR3W.cjs → chunk-ACZZHHFZ.cjs} +149 -34
  22. package/dist/chunk-ACZZHHFZ.cjs.map +1 -0
  23. package/dist/{chunk-2W745U4A.cjs → chunk-AZNZ5WNZ.cjs} +42 -70
  24. package/dist/chunk-AZNZ5WNZ.cjs.map +1 -0
  25. package/dist/{chunk-HSHCCBIV.js → chunk-BQYCZLMF.js} +16 -3
  26. package/dist/chunk-BQYCZLMF.js.map +1 -0
  27. package/dist/chunk-CHS2SIP6.cjs +504 -0
  28. package/dist/chunk-CHS2SIP6.cjs.map +1 -0
  29. package/dist/{chunk-CIPPPT7E.cjs → chunk-CHTZZRAL.cjs} +6 -6
  30. package/dist/{chunk-CIPPPT7E.cjs.map → chunk-CHTZZRAL.cjs.map} +1 -1
  31. package/dist/{chunk-AOJ6B7K4.cjs → chunk-D4KWNDPH.cjs} +12 -12
  32. package/dist/chunk-D4KWNDPH.cjs.map +1 -0
  33. package/dist/{chunk-5YYN5X57.js → chunk-DZ4IOP3Q.js} +536 -30
  34. package/dist/chunk-DZ4IOP3Q.js.map +1 -0
  35. package/dist/{chunk-VACPZPUA.cjs → chunk-EXEVT6D2.cjs} +15 -5
  36. package/dist/chunk-EXEVT6D2.cjs.map +1 -0
  37. package/dist/{chunk-5M43XMRB.cjs → chunk-FHGRKQVZ.cjs} +8 -8
  38. package/dist/{chunk-5M43XMRB.cjs.map → chunk-FHGRKQVZ.cjs.map} +1 -1
  39. package/dist/{chunk-KJSRPHJ2.cjs → chunk-GTWUS6MQ.cjs} +165 -54
  40. package/dist/chunk-GTWUS6MQ.cjs.map +1 -0
  41. package/dist/{chunk-Q6IES3U2.js → chunk-H5KHWTAE.js} +5 -2
  42. package/dist/chunk-H5KHWTAE.js.map +1 -0
  43. package/dist/{chunk-G3KVK7OU.cjs → chunk-HDPJNNMF.cjs} +21 -21
  44. package/dist/{chunk-G3KVK7OU.cjs.map → chunk-HDPJNNMF.cjs.map} +1 -1
  45. package/dist/{chunk-3OYO3XCC.js → chunk-IYSOVS7O.js} +118 -24
  46. package/dist/chunk-IYSOVS7O.js.map +1 -0
  47. package/dist/{chunk-AFYTX4AI.cjs → chunk-J6B7J73J.cjs} +110 -50
  48. package/dist/chunk-J6B7J73J.cjs.map +1 -0
  49. package/dist/{chunk-I2RQB7VG.js → chunk-KB2SQAR3.js} +3 -3
  50. package/dist/{chunk-I2RQB7VG.js.map → chunk-KB2SQAR3.js.map} +1 -1
  51. package/dist/{chunk-BLJUCPMV.cjs → chunk-KSHAAPQF.cjs} +5 -2
  52. package/dist/chunk-KSHAAPQF.cjs.map +1 -0
  53. package/dist/{chunk-6G7NN4S4.js → chunk-NIAFR5EE.js} +2 -2
  54. package/dist/chunk-NIAFR5EE.js.map +1 -0
  55. package/dist/{chunk-CF4S4N5X.js → chunk-O2QOBA6Q.js} +2 -2
  56. package/dist/{chunk-CF4S4N5X.js.map → chunk-O2QOBA6Q.js.map} +1 -1
  57. package/dist/{chunk-IDTKF5EX.cjs → chunk-O4RPXBDZ.cjs} +12 -8
  58. package/dist/chunk-O4RPXBDZ.cjs.map +1 -0
  59. package/dist/{chunk-4GGLKRYI.cjs → chunk-O6TBB4IF.cjs} +2 -2
  60. package/dist/{chunk-4GGLKRYI.cjs.map → chunk-O6TBB4IF.cjs.map} +1 -1
  61. package/dist/{chunk-PTD6EDUU.js → chunk-OBOOHG3N.js} +13 -4
  62. package/dist/chunk-OBOOHG3N.js.map +1 -0
  63. package/dist/{chunk-2D5LQFV4.cjs → chunk-OOZW2MM6.cjs} +9 -9
  64. package/dist/{chunk-2D5LQFV4.cjs.map → chunk-OOZW2MM6.cjs.map} +1 -1
  65. package/dist/{chunk-A2PX5IRC.cjs → chunk-PERUFUVH.cjs} +13 -13
  66. package/dist/{chunk-A2PX5IRC.cjs.map → chunk-PERUFUVH.cjs.map} +1 -1
  67. package/dist/{chunk-G4U3HW6W.js → chunk-PJJAZQVZ.js} +3 -3
  68. package/dist/{chunk-G4U3HW6W.js.map → chunk-PJJAZQVZ.js.map} +1 -1
  69. package/dist/{chunk-E2HZTGYX.js → chunk-Q2Y4JHF7.js} +7 -7
  70. package/dist/chunk-Q2Y4JHF7.js.map +1 -0
  71. package/dist/{chunk-FVII3KHN.js → chunk-QYU7J5EQ.js} +198 -17
  72. package/dist/chunk-QYU7J5EQ.js.map +1 -0
  73. package/dist/{chunk-JJNNM23P.js → chunk-S3UGLZSF.js} +3 -3
  74. package/dist/{chunk-JJNNM23P.js.map → chunk-S3UGLZSF.js.map} +1 -1
  75. package/dist/{chunk-CC4V2B7S.js → chunk-SHH2T4CR.js} +3 -3
  76. package/dist/{chunk-CC4V2B7S.js.map → chunk-SHH2T4CR.js.map} +1 -1
  77. package/dist/{chunk-4ZEFP2FQ.cjs → chunk-SPAHI7DY.cjs} +4 -4
  78. package/dist/{chunk-4ZEFP2FQ.cjs.map → chunk-SPAHI7DY.cjs.map} +1 -1
  79. package/dist/{chunk-Y6X7UJSD.js → chunk-SXHHLZ22.js} +122 -15
  80. package/dist/chunk-SXHHLZ22.js.map +1 -0
  81. package/dist/{chunk-HRY7KGAE.cjs → chunk-T2OVDF2M.cjs} +6 -6
  82. package/dist/{chunk-HRY7KGAE.cjs.map → chunk-T2OVDF2M.cjs.map} +1 -1
  83. package/dist/{chunk-2QKF7M2Z.js → chunk-TAPBDT47.js} +3 -3
  84. package/dist/{chunk-2QKF7M2Z.js.map → chunk-TAPBDT47.js.map} +1 -1
  85. package/dist/{chunk-NGKKNSK6.js → chunk-TPQJKS7D.js} +139 -16
  86. package/dist/chunk-TPQJKS7D.js.map +1 -0
  87. package/dist/{chunk-N7OUQK7E.cjs → chunk-TQW3R44P.cjs} +8 -8
  88. package/dist/{chunk-N7OUQK7E.cjs.map → chunk-TQW3R44P.cjs.map} +1 -1
  89. package/dist/{chunk-GSFB537T.js → chunk-TTGZ2L3O.js} +23 -4
  90. package/dist/chunk-TTGZ2L3O.js.map +1 -0
  91. package/dist/{chunk-SYWR5G3T.js → chunk-VPTA4Z7G.js} +54 -7
  92. package/dist/chunk-VPTA4Z7G.js.map +1 -0
  93. package/dist/{chunk-2HZGDZZN.cjs → chunk-VZ6TE23U.cjs} +6 -6
  94. package/dist/{chunk-2HZGDZZN.cjs.map → chunk-VZ6TE23U.cjs.map} +1 -1
  95. package/dist/{chunk-TRVWMKNE.cjs → chunk-W6VJAUGM.cjs} +285 -64
  96. package/dist/chunk-W6VJAUGM.cjs.map +1 -0
  97. package/dist/{chunk-UDDVDQMF.js → chunk-W7KHHNZR.js} +235 -37
  98. package/dist/chunk-W7KHHNZR.js.map +1 -0
  99. package/dist/{chunk-KYMHFVAZ.cjs → chunk-Y4GCJJPF.cjs} +2 -2
  100. package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
  101. package/dist/{chunk-6CSXMWL4.cjs → chunk-YQV53HRR.cjs} +27 -4
  102. package/dist/chunk-YQV53HRR.cjs.map +1 -0
  103. package/dist/{chunk-7FCTCWHD.js → chunk-ZI3QDUHO.js} +3 -3
  104. package/dist/{chunk-7FCTCWHD.js.map → chunk-ZI3QDUHO.js.map} +1 -1
  105. package/dist/entries/apps.cjs +43 -42
  106. package/dist/entries/apps.js +8 -7
  107. package/dist/entries/captions.cjs +38 -30
  108. package/dist/entries/captions.d.cts +47 -1
  109. package/dist/entries/captions.d.ts +47 -1
  110. package/dist/entries/captions.js +1 -1
  111. package/dist/entries/credits.cjs +354 -174
  112. package/dist/entries/credits.d.cts +378 -27
  113. package/dist/entries/credits.d.ts +378 -27
  114. package/dist/entries/credits.js +11 -11
  115. package/dist/entries/llm-models.cjs +77 -57
  116. package/dist/entries/llm-models.d.cts +108 -7
  117. package/dist/entries/llm-models.d.ts +108 -7
  118. package/dist/entries/llm-models.js +2 -2
  119. package/dist/entries/media.cjs +63 -63
  120. package/dist/entries/media.d.cts +8 -0
  121. package/dist/entries/media.d.ts +8 -0
  122. package/dist/entries/media.js +1 -1
  123. package/dist/entries/model-catalog.cjs +161 -105
  124. package/dist/entries/model-catalog.d.cts +109 -22
  125. package/dist/entries/model-catalog.d.ts +109 -22
  126. package/dist/entries/model-catalog.js +4 -4
  127. package/dist/entries/models.cjs +466 -322
  128. package/dist/entries/models.d.cts +71 -5
  129. package/dist/entries/models.d.ts +71 -5
  130. package/dist/entries/models.js +5 -5
  131. package/dist/entries/nodes.cjs +226 -209
  132. package/dist/entries/nodes.d.cts +66 -7
  133. package/dist/entries/nodes.d.ts +66 -7
  134. package/dist/entries/nodes.js +10 -9
  135. package/dist/entries/pipeline.cjs +156 -152
  136. package/dist/entries/pipeline.d.cts +14 -4
  137. package/dist/entries/pipeline.d.ts +14 -4
  138. package/dist/entries/pipeline.js +3 -3
  139. package/dist/entries/runtime-config.cjs +29 -29
  140. package/dist/entries/runtime-config.d.cts +10 -7
  141. package/dist/entries/runtime-config.d.ts +10 -7
  142. package/dist/entries/runtime-config.js +1 -1
  143. package/dist/entries/social.cjs +177 -177
  144. package/dist/entries/social.js +2 -2
  145. package/dist/entries/types.d.cts +8 -0
  146. package/dist/entries/types.d.ts +8 -0
  147. package/dist/entries/ugc.cjs +71 -71
  148. package/dist/entries/ugc.js +4 -4
  149. package/dist/entries/video.cjs +154 -150
  150. package/dist/entries/video.d.cts +11 -2
  151. package/dist/entries/video.d.ts +11 -2
  152. package/dist/entries/video.js +6 -6
  153. package/dist/entries/workflow.cjs +150 -150
  154. package/dist/entries/workflow.d.cts +1 -1
  155. package/dist/entries/workflow.d.ts +1 -1
  156. package/dist/entries/workflow.js +2 -2
  157. package/dist/index.cjs +2136 -1704
  158. package/dist/index.d.cts +10 -10
  159. package/dist/index.d.ts +10 -10
  160. package/dist/index.js +27 -27
  161. package/dist/{model-catalog-CCEcv08q.d.ts → model-catalog-Cf9fkEUp.d.cts} +45 -2
  162. package/dist/{model-catalog-CCEcv08q.d.cts → model-catalog-Cf9fkEUp.d.ts} +45 -2
  163. package/dist/{model-constants-B88p6XR0.d.ts → model-constants-BxjiWVQ9.d.ts} +215 -32
  164. package/dist/{model-constants-Cf3zaITt.d.cts → model-constants-C_Nyft_i.d.cts} +215 -32
  165. package/package.json +1 -1
  166. package/src/__tests__/add-captions-nemotron-pricing.test.ts +111 -0
  167. package/src/__tests__/credit-identifiers.test.ts +29 -0
  168. package/src/__tests__/extend-providers.test.ts +359 -39
  169. package/src/__tests__/fixtures/mask-composite-quote-parity.json +1 -1
  170. package/src/__tests__/fixtures/measured-input-quote-parity.json +1435 -0
  171. package/src/__tests__/fixtures/planned-length-quote-parity.json +1866 -0
  172. package/src/__tests__/fixtures/video-utility-quote-parity.json +2343 -0
  173. package/src/__tests__/flux-3-klein.test.ts +203 -0
  174. package/src/__tests__/gpt-image-2-6-formats.test.ts +3 -1
  175. package/src/__tests__/gvp-supported-providers.test.ts +27 -2
  176. package/src/__tests__/lip-sync-audio-rate.test.ts +74 -0
  177. package/src/__tests__/lip-sync-levers.test.ts +31 -0
  178. package/src/__tests__/llm-models.test.ts +139 -12
  179. package/src/__tests__/llm-price-key.test.ts +164 -1
  180. package/src/__tests__/model-makers.test.ts +3 -0
  181. package/src/__tests__/nemotron-transcribe-pricing.test.ts +61 -0
  182. package/src/__tests__/node-runtime-keys.test.ts +7 -0
  183. package/src/__tests__/normalize-node-params.test.ts +172 -1
  184. package/src/__tests__/pixverse-v6-max-catalog.test.ts +271 -0
  185. package/src/__tests__/prompt-length-limits.test.ts +4 -0
  186. package/src/__tests__/retired-lip-sync-providers.test.ts +43 -0
  187. package/src/__tests__/seedance-extend-source-credit-id.test.ts +89 -0
  188. package/src/__tests__/seedance-task-type.test.ts +13 -3
  189. package/src/__tests__/sequence-execution.test.ts +22 -1
  190. package/src/__tests__/suno-credit-type.test.ts +21 -2
  191. package/src/__tests__/transcribe-capabilities.test.ts +41 -2
  192. package/src/__tests__/transcribe-preflight.test.ts +50 -1
  193. package/src/__tests__/video-analysis-catalog-sync.test.ts +4 -2
  194. package/src/__tests__/video-analysis-pricing.test.ts +10 -9
  195. package/src/__tests__/video-audio-capability.test.ts +35 -6
  196. package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
  197. package/src/__tests__/video-upscale-params.test.ts +62 -0
  198. package/src/caption-styles.ts +62 -0
  199. package/src/catalog-projection.ts +8 -0
  200. package/src/credit-estimators/add-captions-nemotron.ts +73 -0
  201. package/src/credit-estimators/index.ts +20 -0
  202. package/src/credit-estimators/nemotron-transcribe.ts +87 -0
  203. package/src/credit-identifiers.ts +351 -41
  204. package/src/entries/captions.ts +2 -0
  205. package/src/entries/credits.ts +37 -2
  206. package/src/entries/llm-models.ts +6 -0
  207. package/src/entries/model-catalog.ts +22 -0
  208. package/src/entries/models.ts +50 -0
  209. package/src/entries/nodes.ts +4 -0
  210. package/src/entries/pipeline.ts +1 -1
  211. package/src/entries/video.ts +1 -1
  212. package/src/flux-3-klein.ts +69 -0
  213. package/src/freecut-protocol.ts +8 -0
  214. package/src/input-image-pricing.ts +23 -6
  215. package/src/lip-sync-levers.ts +56 -0
  216. package/src/lip-sync-pricing.ts +91 -1
  217. package/src/llm-models.ts +305 -16
  218. package/src/model-catalog.ts +529 -28
  219. package/src/model-constants.ts +417 -41
  220. package/src/model-tree.ts +2 -1
  221. package/src/nodaro-video-upscale.ts +48 -0
  222. package/src/node-default-mappings.ts +6 -0
  223. package/src/node-runtime-keys.ts +3 -0
  224. package/src/normalize-node-params.ts +172 -3
  225. package/src/runtime-config/contract.ts +10 -7
  226. package/src/seedance-draft.ts +2 -1
  227. package/src/seedance-extend-rate.ts +116 -0
  228. package/src/sequence-execution.ts +24 -0
  229. package/src/transcribe-preflight.ts +81 -7
  230. package/src/video-analysis-pricing.ts +28 -15
  231. package/src/video-duration.ts +9 -0
  232. package/src/video-ui-defaults.ts +5 -3
  233. package/src/video-upscale-params.ts +67 -0
  234. package/dist/chunk-2W745U4A.cjs.map +0 -1
  235. package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
  236. package/dist/chunk-3OYO3XCC.js.map +0 -1
  237. package/dist/chunk-5YYN5X57.js.map +0 -1
  238. package/dist/chunk-6CSXMWL4.cjs.map +0 -1
  239. package/dist/chunk-6G7NN4S4.js.map +0 -1
  240. package/dist/chunk-AFYTX4AI.cjs.map +0 -1
  241. package/dist/chunk-AOJ6B7K4.cjs.map +0 -1
  242. package/dist/chunk-BLJUCPMV.cjs.map +0 -1
  243. package/dist/chunk-E2HZTGYX.js.map +0 -1
  244. package/dist/chunk-FVII3KHN.js.map +0 -1
  245. package/dist/chunk-GSFB537T.js.map +0 -1
  246. package/dist/chunk-HSHCCBIV.js.map +0 -1
  247. package/dist/chunk-IDTKF5EX.cjs.map +0 -1
  248. package/dist/chunk-IWWVPR3W.cjs.map +0 -1
  249. package/dist/chunk-KJSRPHJ2.cjs.map +0 -1
  250. package/dist/chunk-KYMHFVAZ.cjs.map +0 -1
  251. package/dist/chunk-MYJQELFN.cjs.map +0 -1
  252. package/dist/chunk-NGKKNSK6.js.map +0 -1
  253. package/dist/chunk-PTD6EDUU.js.map +0 -1
  254. package/dist/chunk-Q6IES3U2.js.map +0 -1
  255. package/dist/chunk-QWYFHQYK.cjs +0 -357
  256. package/dist/chunk-QWYFHQYK.cjs.map +0 -1
  257. package/dist/chunk-S24ZBUB4.js.map +0 -1
  258. package/dist/chunk-SYWR5G3T.js.map +0 -1
  259. package/dist/chunk-TRVWMKNE.cjs.map +0 -1
  260. package/dist/chunk-UDDVDQMF.js.map +0 -1
  261. package/dist/chunk-VACPZPUA.cjs.map +0 -1
  262. package/dist/chunk-WRSWH7US.cjs.map +0 -1
  263. package/dist/chunk-Y6X7UJSD.js.map +0 -1
  264. package/dist/chunk-YCXRSWCQ.js.map +0 -1
@@ -0,0 +1,203 @@
1
+ import { describe, expect, it } from "vitest"
2
+ import { MODEL_CATALOG, MODEL_MAKERS, defaultResolutionFor, normalizeModelInput } from "../model-catalog.js"
3
+ import { buildCreditModelIdentifier, resolveNormalizedImageGen } from "../credit-identifiers.js"
4
+ import {
5
+ IMAGE_ASPECT_RATIO_VALUES,
6
+ IMAGE_GEN_PROVIDERS,
7
+ IMAGE_I2I_PROVIDERS,
8
+ MODELS_WITH_REFERENCE_IMAGE_SUPPORT,
9
+ SEED_SUPPORT,
10
+ T2I_TO_I2I_VARIANT,
11
+ VARIABLE_PRICING_MODELS,
12
+ getMaxImagePromptChars,
13
+ getMinImagePromptChars,
14
+ imageReferenceLimit,
15
+ requestImageLimit,
16
+ } from "../model-constants.js"
17
+ import { isPricedPerInputImage, priceReadsInputImages, pricedEstimatedImages, pricedSentImages } from "../input-image-pricing.js"
18
+ import { isFlux2Model } from "../flux2-pricing.js"
19
+ import { mapQuality } from "../node-default-mappings.js"
20
+ import {
21
+ FLUX_3_KLEIN_DEFAULT_RESOLUTION,
22
+ FLUX_3_KLEIN_I2I,
23
+ FLUX_3_KLEIN_T2I,
24
+ flux3KleinCreditId,
25
+ flux3KleinResolution,
26
+ isFlux3Klein,
27
+ isFlux3KleinI2i,
28
+ } from "../flux-3-klein.js"
29
+
30
+ const T2I = FLUX_3_KLEIN_T2I
31
+ const I2I = FLUX_3_KLEIN_I2I
32
+ const NINE = ["1:1", "4:3", "3:4", "3:2", "2:3", "16:9", "9:16", "21:9", "9:21"]
33
+
34
+ describe("FLUX 3 Klein in the catalog", () => {
35
+ it("two ids, Black Forest Labs' own, in the Flux line, beside and apart from FLUX 2 Klein", () => {
36
+ for (const id of [T2I, I2I]) {
37
+ const m = MODEL_CATALOG[id]!
38
+ expect(m.kind).toBe("image")
39
+ expect(m.maker).toBe("black-forest-labs")
40
+ expect(MODEL_MAKERS["black-forest-labs"].name).toBe("Black Forest Labs")
41
+ expect(m.series).toBe("Flux")
42
+ expect(isFlux2Model(id)).toBe(false)
43
+ }
44
+ expect(MODEL_CATALOG[T2I]!.modes).toEqual(["t2i"])
45
+ expect(MODEL_CATALOG[I2I]!.modes).toEqual(["i2i"])
46
+ expect(MODEL_CATALOG["flux-2-klein"]).toBeDefined()
47
+ expect(isFlux3Klein("flux-2-klein")).toBe(false)
48
+ expect(isFlux3KleinI2i(T2I)).toBe(false)
49
+ expect(isFlux3KleinI2i(I2I)).toBe(true)
50
+ })
51
+
52
+ it("takes 1K, 2K and 4K, 1K when none is named", () => {
53
+ for (const id of [T2I, I2I]) {
54
+ expect(MODEL_CATALOG[id]!.resolutions).toEqual(["1K", "2K", "4K"])
55
+ expect(MODEL_CATALOG[id]!.defaultResolution).toBeUndefined()
56
+ expect(defaultResolutionFor(id)).toBeUndefined()
57
+ }
58
+ expect(FLUX_3_KLEIN_DEFAULT_RESOLUTION).toBe("1K")
59
+ expect(flux3KleinResolution(undefined)).toBe("1K")
60
+ expect(flux3KleinResolution("2k")).toBe("2K")
61
+ expect(flux3KleinResolution(" 4K ")).toBe("4K")
62
+ expect(flux3KleinResolution("1.5K")).toBe("1K")
63
+ expect(flux3KleinResolution("2 MP")).toBe("1K")
64
+ })
65
+
66
+ it("text to image lists the nine ratios, 1:1 first and no auto; the edit adds auto last", () => {
67
+ expect(MODEL_CATALOG[T2I]!.aspectRatios).toEqual(NINE)
68
+ expect(MODEL_CATALOG[I2I]!.aspectRatios).toEqual([...NINE, "auto"])
69
+ for (const ratio of [...NINE, "auto"]) expect(IMAGE_ASPECT_RATIO_VALUES).toContain(ratio)
70
+ // A provider schema with a closed list: the Scene and surround lanes check the ratio.
71
+ expect(MODEL_CATALOG[T2I]!.strictAspectRatios).toBe(true)
72
+ expect(MODEL_CATALOG[I2I]!.strictAspectRatios).toBe(true)
73
+ // The schema says the edit's auto takes the first image's shape; unmeasured, so not overridden.
74
+ expect(MODEL_CATALOG[I2I]!.autoAspectFromSourceImage).toBeUndefined()
75
+ })
76
+
77
+ it("auto on text to image becomes a real ratio, the edit keeps its own", () => {
78
+ expect(normalizeModelInput(T2I, { aspectRatio: "auto" }).aspectRatio).toBe("1:1")
79
+ const portrait = normalizeModelInput(T2I, { aspectRatio: "auto" }, { sourceImage: { width: 768, height: 1024 } })
80
+ expect(portrait.aspectRatio).toBe("3:4")
81
+ expect(normalizeModelInput(I2I, { aspectRatio: "auto" }).aspectRatio).toBe("auto")
82
+ expect(normalizeModelInput(T2I, { aspectRatio: "9:21" }).aspectRatio).toBe("9:21")
83
+ })
84
+
85
+ it("a size it does not list snaps to 1K before anything is priced", () => {
86
+ expect(normalizeModelInput(T2I, { resolution: "1.5K" }).resolution).toBe("1K")
87
+ expect(normalizeModelInput(I2I, { resolution: "2 MP" }).resolution).toBe("1K")
88
+ expect(normalizeModelInput(T2I, { resolution: "4K" }).resolution).toBe("4K")
89
+ })
90
+
91
+ it("writes PNG (the default) or JPEG; offers no background or quality", () => {
92
+ for (const id of [T2I, I2I]) {
93
+ const m = MODEL_CATALOG[id]!
94
+ expect(m.outputFormats).toEqual(["png", "jpeg"])
95
+ expect(m.backgrounds).toBeUndefined()
96
+ expect(m.qualities).toBeUndefined()
97
+ expect(normalizeModelInput(id, { outputFormat: "jpg" }).outputFormat).toBe("jpeg")
98
+ // WebP, which the provider also writes, is not offered: it snaps to PNG.
99
+ expect(normalizeModelInput(id, { outputFormat: "webp" }).outputFormat).toBe("png")
100
+ }
101
+ })
102
+
103
+ it("the catalog's price rows: the bare id and one per size, the same on both ids", () => {
104
+ const rows = (id: string) => Object.fromEntries(MODEL_CATALOG[id]!.pricing.map((r) => [r.identifier, r.credits]))
105
+ expect(rows(T2I)).toEqual({ "flux-3-klein": 4, "flux-3-klein:1K": 4, "flux-3-klein:2K": 7, "flux-3-klein:4K": 17 })
106
+ expect(rows(I2I)).toEqual({ "flux-3-klein-i2i": 4, "flux-3-klein-i2i:1K": 4, "flux-3-klein-i2i:2K": 7, "flux-3-klein-i2i:4K": 17 })
107
+ expect(MODEL_CATALOG[T2I]!.pricing[0]!.identifier).toBe(T2I)
108
+ expect(MODEL_CATALOG[I2I]!.pricing[0]!.identifier).toBe(I2I)
109
+ })
110
+ })
111
+
112
+ describe("FLUX 3 Klein price ids", () => {
113
+ it("one id per size, 1K for none or a size it does not list", () => {
114
+ expect(buildCreditModelIdentifier(T2I)).toBe("flux-3-klein:1K")
115
+ expect(buildCreditModelIdentifier(T2I, undefined, "1K")).toBe("flux-3-klein:1K")
116
+ expect(buildCreditModelIdentifier(T2I, undefined, "2K")).toBe("flux-3-klein:2K")
117
+ expect(buildCreditModelIdentifier(T2I, undefined, "4K")).toBe("flux-3-klein:4K")
118
+ expect(buildCreditModelIdentifier(T2I, undefined, "1.5K")).toBe("flux-3-klein:1K")
119
+ expect(buildCreditModelIdentifier(I2I, undefined, "4K")).toBe("flux-3-klein-i2i:4K")
120
+ expect(buildCreditModelIdentifier(I2I)).toBe("flux-3-klein-i2i:1K")
121
+ })
122
+
123
+ it("a quality never reaches the id", () => {
124
+ expect(buildCreditModelIdentifier(T2I, "high", "2K")).toBe("flux-3-klein:2K")
125
+ })
126
+
127
+ it("images move the text-to-image id onto the edit id; their count never shows", () => {
128
+ expect(buildCreditModelIdentifier(T2I, undefined, "2K", undefined, undefined, 3)).toBe("flux-3-klein-i2i:2K")
129
+ for (const n of [0, 1, 10, 20]) {
130
+ expect(buildCreditModelIdentifier(I2I, undefined, "4K", undefined, undefined, n)).toBe("flux-3-klein-i2i:4K")
131
+ }
132
+ expect(flux3KleinCreditId(T2I, "2K", Number.NaN)).toBe("flux-3-klein:2K")
133
+ })
134
+
135
+ it("is priced by size, not per input image", () => {
136
+ expect(isPricedPerInputImage(T2I)).toBe(false)
137
+ expect(isPricedPerInputImage(I2I)).toBe(false)
138
+ expect(VARIABLE_PRICING_MODELS[T2I]).toBe("resolution")
139
+ expect(VARIABLE_PRICING_MODELS[I2I]).toBe("resolution")
140
+ })
141
+
142
+ it("counts every image a run sends, a base image included, so the id priced is the edit it runs", () => {
143
+ expect(priceReadsInputImages(T2I)).toBe(true)
144
+ expect(priceReadsInputImages(I2I)).toBe(true)
145
+ expect(pricedSentImages(T2I, [], "https://base.png")).toBe(1)
146
+ expect(pricedSentImages(T2I, ["https://a.png"], "https://base.png")).toBe(2)
147
+ expect(pricedSentImages(T2I, ["https://base.png"], "https://base.png")).toBe(1)
148
+ expect(buildCreditModelIdentifier(T2I, undefined, "2K", undefined, undefined, pricedSentImages(T2I, [], "https://base.png"))).toBe("flux-3-klein-i2i:2K")
149
+ expect(pricedEstimatedImages(T2I, {}, 2)).toBe(2)
150
+ // FLUX 2 Klein and the models not priced by their images count as before.
151
+ expect(priceReadsInputImages("flux-2-klein")).toBe(false)
152
+ expect(pricedSentImages("flux-2-klein", ["https://a.png"], "https://base.png")).toBe(1)
153
+ expect(pricedSentImages("nano-banana-pro", ["https://a.png"], "https://base.png")).toBe(1)
154
+ })
155
+
156
+ it("a Generate Image run with references is snapped and priced on the edit", () => {
157
+ const n = resolveNormalizedImageGen({ provider: T2I, aspectRatio: "auto", resolution: "2K", refCount: 2, swapToI2i: true })
158
+ expect(n.modelId).toBe(I2I)
159
+ expect(n.aspectRatio).toBe("auto")
160
+ expect(n.identifier).toBe("flux-3-klein-i2i:2K")
161
+ const t2i = resolveNormalizedImageGen({ provider: T2I, aspectRatio: "auto", refCount: 0, swapToI2i: true })
162
+ expect(t2i.modelId).toBe(T2I)
163
+ expect(t2i.aspectRatio).toBe("1:1")
164
+ expect(t2i.identifier).toBe("flux-3-klein:1K")
165
+ })
166
+ })
167
+
168
+ describe("FLUX 3 Klein's place in the shared lists", () => {
169
+ it("joins the route vocabularies, the reference-image models and the seed models", () => {
170
+ expect(IMAGE_GEN_PROVIDERS).toContain(T2I)
171
+ expect(IMAGE_I2I_PROVIDERS).toContain(I2I)
172
+ expect(MODELS_WITH_REFERENCE_IMAGE_SUPPORT.has(T2I)).toBe(true)
173
+ expect(MODELS_WITH_REFERENCE_IMAGE_SUPPORT.has(I2I)).toBe(true)
174
+ expect(SEED_SUPPORT.has(T2I)).toBe(true)
175
+ expect(SEED_SUPPORT.has(I2I)).toBe(true)
176
+ })
177
+
178
+ it("references swap text to image onto the edit, which takes up to 10", () => {
179
+ expect(T2I_TO_I2I_VARIANT[T2I]).toBe(I2I)
180
+ expect(imageReferenceLimit(T2I)).toBe(10)
181
+ expect(imageReferenceLimit(I2I)).toBe(10)
182
+ expect(requestImageLimit(T2I)).toBe(10)
183
+ expect(requestImageLimit(I2I)).toBe(10)
184
+ // FLUX 2 Klein's limits are its own.
185
+ expect(imageReferenceLimit("flux-2-klein")).toBe(1)
186
+ expect(requestImageLimit("flux-2-klein")).toBe(14)
187
+ })
188
+
189
+ it("prompts of 1 to 5000 characters: the default cap, no minimum", () => {
190
+ expect(getMaxImagePromptChars(T2I)).toBe(5000)
191
+ expect(getMaxImagePromptChars(I2I)).toBe(5000)
192
+ expect(getMinImagePromptChars(T2I)).toBe(0)
193
+ expect(getMinImagePromptChars(I2I)).toBe(0)
194
+ })
195
+
196
+ it("an admin's quality level maps onto its sizes", () => {
197
+ for (const id of [T2I, I2I]) {
198
+ expect(mapQuality(id, "low")).toEqual({ field: "resolution", value: "1K" })
199
+ expect(mapQuality(id, "mid")).toEqual({ field: "resolution", value: "2K" })
200
+ expect(mapQuality(id, "high")).toEqual({ field: "resolution", value: "4K" })
201
+ }
202
+ })
203
+ })
@@ -21,11 +21,13 @@ describe("which models write which files", () => {
21
21
 
22
22
  it("a menu offers a format only on a model that writes more than one", () => {
23
23
  const formats = outputFormatOptionsByKind("image")
24
- expect(Object.keys(formats).sort()).toEqual(["gpt-image-2-6-economy", "gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i", "minimax-h3-image", "minimax-h3-image-i2i", "seedream-5-5", "seedream-5-5-i2i"])
24
+ expect(Object.keys(formats).sort()).toEqual(["flux-3-klein", "flux-3-klein-i2i", "gpt-image-2-6-economy", "gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i", "minimax-h3-image", "minimax-h3-image-i2i", "seedream-5-5", "seedream-5-5-i2i"])
25
25
  expect(formats[FLARE]!.map((o) => o.value)).toEqual(["png", "jpeg", "webp", "gif", "svg"])
26
26
  expect(formats["minimax-h3-image"]!.map((o) => o.value)).toEqual(["png", "jpeg"])
27
27
  expect(formats["minimax-h3-image-i2i"]!.map((o) => o.value)).toEqual(["png", "jpeg"])
28
28
  expect(formats["seedream-5-5"]!.map((o) => o.value)).toEqual(["png", "jpeg"])
29
+ expect(formats["flux-3-klein"]!.map((o) => o.value)).toEqual(["png", "jpeg"])
30
+ expect(formats["flux-3-klein-i2i"]!.map((o) => o.value)).toEqual(["png", "jpeg"])
29
31
  expect(Object.keys(svgLevelOptionsByKind("image")).sort()).toEqual(["gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i"])
30
32
  expect(svgLevelOptionsByKind("image")[FLARE]!.map((o) => o.label)).toEqual(["SVG Standard", "SVG Detailed", "SVG Max"])
31
33
  })
@@ -68,9 +68,30 @@ describe("GVP_SUPPORTED_PROVIDERS", () => {
68
68
  "wan-3-prime",
69
69
  "happyhorse-ref2v",
70
70
  "vidu-q4",
71
+ // Admitted by its explicit catalog opt-in, `gvpWithoutReferences` (decided
72
+ // 2026-11-12): a start frame and no reference images.
73
+ "pixverse-v6-max",
71
74
  ])
72
75
  })
73
76
 
77
+ it("the reference-image bar admits nothing new: the explicit opt-in adds exactly pixverse-v6-max", () => {
78
+ const optedIn = Object.values(MODEL_CATALOG).filter((m) => m.gvpWithoutReferences === true).map((m) => m.id)
79
+ expect(optedIn).toEqual(["pixverse-v6-max"])
80
+ const byCapability = GVP_SUPPORTED_PROVIDERS.filter((p) => MODEL_CATALOG[p]?.features?.includes("reference-image") === true)
81
+ expect(GVP_SUPPORTED_PROVIDERS.filter((p) => !byCapability.includes(p))).toEqual(["pixverse-v6-max"])
82
+ // The opt-in is never redundant: a model that takes reference images needs none.
83
+ for (const id of optedIn) {
84
+ expect(MODEL_CATALOG[id]!.features ?? [], id).not.toContain("reference-image")
85
+ // Keyframes only and no end anchor: it takes neither a reference video nor an end frame.
86
+ expect(supportsExtendRender(id), id).toBe(false)
87
+ expect(supportsEndAnchor(id), id).toBe(false)
88
+ }
89
+ // The start-frame-only models the bar keeps out stay out.
90
+ for (const id of ["wan-i2v", "hailuo-2.3-pro", "hailuo-2.3", "bytedance-pro", "bytedance-pro-fast", "kling-turbo", "minimax"]) {
91
+ expect(isGvpSupportedProvider(id), id).toBe(false)
92
+ }
93
+ })
94
+
74
95
  it("lists the default SKU first (dropdowns render this order)", () => {
75
96
  expect(GVP_SUPPORTED_PROVIDERS[0]).toBe(GVP_DEFAULT_PROVIDER)
76
97
  })
@@ -81,7 +102,8 @@ describe("GVP_SUPPORTED_PROVIDERS", () => {
81
102
  expect(m, `${p} must be in the catalog`).toBeDefined()
82
103
  expect(m!.kind).toBe("video")
83
104
  expect(m!.modes as readonly string[]).toContain("i2v")
84
- expect(m!.features ?? [], `${p} must accept reference images`).toContain("reference-image")
105
+ // Reference images, or the explicit opt-in for a model that has none.
106
+ if (m!.gvpWithoutReferences !== true) expect(m!.features ?? [], `${p} must accept reference images`).toContain("reference-image")
85
107
  // Segmentable: a model with no declared durations cannot be split, and a
86
108
  // silent 4-15s fallback would send lengths the provider rejects.
87
109
  expect(segmentDurationsFor(p).length, `${p} must declare durations`).toBeGreaterThan(0)
@@ -107,7 +129,10 @@ describe("GVP_SUPPORTED_PROVIDERS", () => {
107
129
  !VIDEO_PROVIDERS_WITHOUT_DISPATCH.has(id) &&
108
130
  !MODEL_CATALOG[id]?.features?.includes("keyframes"),
109
131
  )
110
- expect([...GVP_SUPPORTED_PROVIDERS].sort()).toEqual(withRefLimits.sort())
132
+ // A model opted in without reference images has no forwarding path by design.
133
+ const optedIn = GVP_SUPPORTED_PROVIDERS.filter((p) => MODEL_CATALOG[p]?.gvpWithoutReferences === true)
134
+ expect(optedIn.every((p) => VIDEO_REF_LIMITS_BY_PROVIDER[p] === undefined)).toBe(true)
135
+ expect(GVP_SUPPORTED_PROVIDERS.filter((p) => !optedIn.includes(p)).sort()).toEqual(withRefLimits.sort())
111
136
  })
112
137
 
113
138
  /**
@@ -0,0 +1,74 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import {
3
+ LIP_SYNC_AUDIO_RATES,
4
+ LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS,
5
+ OMNIHUMAN_2_0_PER_SECOND_CREDIT_ID,
6
+ buildLipSyncCreditId,
7
+ getLipSyncMaxAudioSeconds,
8
+ isPerSecondLipSyncProvider,
9
+ lipSyncAudioRateOf,
10
+ lipSyncBilledSeconds,
11
+ lipSyncEstimateSeconds,
12
+ lipSyncFifteenSecondCreditId,
13
+ } from "../lip-sync-pricing.js"
14
+ import { LIP_SYNC_PROVIDERS } from "../model-constants.js"
15
+ import { MODEL_CATALOG } from "../model-catalog.js"
16
+
17
+ const rate = LIP_SYNC_AUDIO_RATES["omnihuman-2-0"]!
18
+
19
+ describe("OmniHuman 2.0 — charged per second of its audio at one rate (decided 2026-11-11)", () => {
20
+ it("is a lip-sync model beside 1.5, with its one-second row", () => {
21
+ expect(LIP_SYNC_PROVIDERS).toContain("omnihuman-2-0")
22
+ expect(LIP_SYNC_PROVIDERS).toContain("omnihuman-1-5")
23
+ expect(lipSyncAudioRateOf("omnihuman-2-0")).toEqual({ rateId: OMNIHUMAN_2_0_PER_SECOND_CREDIT_ID, minSeconds: 4, maxSeconds: 300 })
24
+ expect(OMNIHUMAN_2_0_PER_SECOND_CREDIT_ID).toBe("omnihuman-2-0:per-second")
25
+ })
26
+
27
+ it("is never bucketed: no caller that branches on the bucket set can give it :15s/:30s ids", () => {
28
+ expect(isPerSecondLipSyncProvider("omnihuman-2-0")).toBe(false)
29
+ expect(buildLipSyncCreditId("omnihuman-2-0", 10)).toBe("omnihuman-2-0")
30
+ for (const provider of Object.keys(LIP_SYNC_AUDIO_RATES)) expect(isPerSecondLipSyncProvider(provider), provider).toBe(false)
31
+ })
32
+
33
+ it("takes up to 300 s of audio (refused past it, never trimmed to the 15 s default cap)", () => {
34
+ expect(getLipSyncMaxAudioSeconds("omnihuman-2-0")).toBe(300)
35
+ })
36
+
37
+ it.each([
38
+ [3.2, 4],
39
+ [0.4, 4],
40
+ [4, 4],
41
+ [10, 10],
42
+ [10.04, 11],
43
+ [15, 15],
44
+ [59.999, 60],
45
+ [60, 60],
46
+ [300, 300],
47
+ ])("audio of %s s is billed %s s (rounded up, at least 4)", (sec, billed) => {
48
+ expect(lipSyncBilledSeconds(rate, sec)).toBe(billed)
49
+ })
50
+
51
+ it("an estimate quotes the billed seconds when the length is known, else the maximum (or the caller's default)", () => {
52
+ expect(lipSyncEstimateSeconds(rate, 10.04)).toBe(11)
53
+ expect(lipSyncEstimateSeconds(rate, 2)).toBe(4)
54
+ expect(lipSyncEstimateSeconds(rate, 900)).toBe(300)
55
+ expect(lipSyncEstimateSeconds(rate, undefined)).toBe(300)
56
+ expect(lipSyncEstimateSeconds(rate, undefined, LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS)).toBe(15)
57
+ })
58
+
59
+ it("a menu prices it from its 15-second quote; bucketed models keep their :15s row; flat models have none", () => {
60
+ expect(lipSyncFifteenSecondCreditId("omnihuman-2-0")).toBe("omnihuman-2-0:per-second:15u")
61
+ expect(lipSyncFifteenSecondCreditId("omnihuman-1-5")).toBe("omnihuman-1-5:15s")
62
+ expect(lipSyncFifteenSecondCreditId("kling-avatar")).toBe("kling-avatar:15s")
63
+ expect(lipSyncFifteenSecondCreditId("infinitalk")).toBeUndefined()
64
+ })
65
+
66
+ it("the catalog lists its one row and none of 1.5's levers", () => {
67
+ const entry = MODEL_CATALOG["omnihuman-2-0"]!
68
+ expect(entry.modes).toEqual(["lip-sync"])
69
+ expect(entry.pricing.map((p) => p.identifier)).toEqual([OMNIHUMAN_2_0_PER_SECOND_CREDIT_ID])
70
+ expect(entry.resolutions).toBeUndefined()
71
+ // 1.5 is unchanged.
72
+ expect(MODEL_CATALOG["omnihuman-1-5"]!.resolutions).toEqual(["720p", "1080p"])
73
+ })
74
+ })
@@ -0,0 +1,31 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { LIP_SYNC_PROVIDERS } from "../model-constants.js"
3
+ import { lipSyncLeverClearPatch, lipSyncLeversNotTaken, lipSyncTakesLever, withoutLipSyncLeversNotTaken } from "../lip-sync-levers.js"
4
+
5
+ describe("Lip Sync levers a model does not take", () => {
6
+ it("OmniHuman 2.0 takes no resolution, fast mode or seed", () => {
7
+ expect(lipSyncLeversNotTaken("omnihuman-2-0")).toEqual(["resolution", "fastMode", "seed"])
8
+ expect(lipSyncTakesLever("omnihuman-2-0", "resolution")).toBe(false)
9
+ })
10
+
11
+ it("a node switched from 1.5 to 2.0 loses 1.5's 1080p, fast mode and seed", () => {
12
+ const from15 = { provider: "omnihuman-1-5", resolution: "1080p", fastMode: true, seed: 42, prompt: "smile" }
13
+ expect(lipSyncLeverClearPatch("omnihuman-2-0", from15)).toEqual({ resolution: undefined, fastMode: undefined, seed: undefined })
14
+ expect(withoutLipSyncLeversNotTaken("omnihuman-2-0", from15)).toEqual({ provider: "omnihuman-1-5", resolution: undefined, fastMode: undefined, seed: undefined, prompt: "smile" })
15
+ })
16
+
17
+ it("nothing to clear: an empty patch, and the same object back", () => {
18
+ const clean = { provider: "omnihuman-2-0", prompt: "x" }
19
+ expect(lipSyncLeverClearPatch("omnihuman-2-0", clean)).toEqual({})
20
+ expect(withoutLipSyncLeversNotTaken("omnihuman-2-0", clean)).toBe(clean)
21
+ })
22
+
23
+ it("every other model keeps every lever exactly as it was (kling, infinitalk, 1.5, the rest)", () => {
24
+ const data = { resolution: "1080p", fastMode: true, seed: 7 }
25
+ for (const provider of LIP_SYNC_PROVIDERS.filter((p) => p !== "omnihuman-2-0")) {
26
+ expect(lipSyncLeversNotTaken(provider), provider).toEqual([])
27
+ expect(withoutLipSyncLeversNotTaken(provider, data), provider).toBe(data)
28
+ }
29
+ expect(lipSyncLeversNotTaken(undefined)).toEqual([])
30
+ })
31
+ })
@@ -14,6 +14,7 @@ import {
14
14
  getLlmTier,
15
15
  getLlmModalityCaps,
16
16
  VIDEO_ANALYSIS_LLM_MODELS,
17
+ VIDEO_ANALYSIS_TIERS,
17
18
  buildLlmCreditIdentifier,
18
19
  resolveLlmCreditId,
19
20
  motionGraphicsFeature,
@@ -56,6 +57,7 @@ const EXPECTED_MODEL_IDS = [
56
57
  "gpt-5.2",
57
58
  "gemini-3.1-pro",
58
59
  "gemini-4-argon",
60
+ "gemini-4-carbon",
59
61
  "claude-opus-4.7",
60
62
  "gpt-5.4",
61
63
  "gpt-5.5",
@@ -66,6 +68,7 @@ const EXPECTED_MODEL_IDS = [
66
68
  "gpt-6-luna",
67
69
  "gpt-6-sol",
68
70
  "gpt-6.1-sol",
71
+ "gpt-6.1-terra",
69
72
  "grok-4.6",
70
73
  "grok-4.7",
71
74
  "claude-sonnet-5",
@@ -75,6 +78,7 @@ const EXPECTED_MODEL_IDS = [
75
78
  "claude-opus-5.5",
76
79
  "claude-fable-5",
77
80
  "kimi-k3",
81
+ "kimi-k3.1-pro",
78
82
  "deepseek-v4.1-flash",
79
83
  ]
80
84
 
@@ -120,14 +124,14 @@ describe("LLM_MODELS data integrity", () => {
120
124
  expect(new Set(ids).size).toBe(ids.length)
121
125
  })
122
126
 
123
- it("has 9 economy, 7 standard, 14 premium models", () => {
127
+ it("has 9 economy, 8 standard, 16 premium models", () => {
124
128
  const tierCounts: Record<LlmTier, number> = { economy: 0, standard: 0, premium: 0 }
125
129
  for (const model of LLM_MODELS) {
126
130
  tierCounts[model.tier]++
127
131
  }
128
132
  expect(tierCounts.economy).toBe(9)
129
- expect(tierCounts.standard).toBe(7)
130
- expect(tierCounts.premium).toBe(14)
133
+ expect(tierCounts.standard).toBe(8)
134
+ expect(tierCounts.premium).toBe(16)
131
135
  })
132
136
 
133
137
  it("all three kieFormats are represented", () => {
@@ -685,6 +689,11 @@ describe("STRUCTURED_VISION_MODELS", () => {
685
689
  "deepseek-v4.1-flash",
686
690
  // directOnly; the direct lane enforced responseJsonSchema (2026-10-17).
687
691
  "gemini-4-argon",
692
+ // 2026-11-12 — text.format json_schema enforced on KIE, vision read.
693
+ // gemini-4-carbon is NOT here: KIE did not enforce its schema, so it
694
+ // declares no structured mode (parse, validate and re-ask instead).
695
+ "gpt-6.1-terra",
696
+ "kimi-k3.1-pro",
688
697
  ].sort(),
689
698
  )
690
699
  })
@@ -1000,15 +1009,12 @@ describe("gemini-3.8-flash exposure", () => {
1000
1009
  expect(getLlmModel("gemini-3-8-flash-openai")?.id).toBe("gemini-3.8-flash")
1001
1010
  })
1002
1011
 
1003
- it("stays OUT of video-analysis — image-only modality caps by decision, not omission", () => {
1004
- // Google's own 3.8 lane understands video (agentic video via the
1005
- // Interactions API), so full caps here would auto-enroll it in
1006
- // VIDEO_ANALYSIS_LLM_MODELS and force a VA tier + pricing decision that is
1007
- // deliberately deferred until the 3.8-vs-3.7 analysis A/B concludes.
1008
- // If this goes red, someone flipped the caps — only valid TOGETHER with
1009
- // that VA-side decision.
1010
- expect(getLlmModalityCaps("gemini-3.8-flash")).toEqual({ image: true, video: false, audio: false })
1011
- expect(VIDEO_ANALYSIS_LLM_MODELS).not.toContain("gemini-3.8-flash")
1012
+ it("backs the video-analysis fast tier — full video + audio caps (decided 2026-11-13)", () => {
1013
+ // Full caps are what enrol it in VIDEO_ANALYSIS_LLM_MODELS; the fast tier
1014
+ // moved here when KIE dropped gemini-3-flash's channel.
1015
+ expect(getLlmModalityCaps("gemini-3.8-flash")).toEqual({ image: true, video: true, audio: true })
1016
+ expect(VIDEO_ANALYSIS_LLM_MODELS).toContain("gemini-3.8-flash")
1017
+ expect(VIDEO_ANALYSIS_TIERS.fast).toBe("gemini-3.8-flash")
1012
1018
  })
1013
1019
  })
1014
1020
 
@@ -1065,6 +1071,127 @@ describe("gemini-4-argon exposure", () => {
1065
1071
  })
1066
1072
  })
1067
1073
 
1074
+ // ---------------------------------------------------------------------------
1075
+ // 2026-11-12 additions: Kimi K3.1 Pro, GPT-6.1 Terra, Gemini 4 Carbon (KIE
1076
+ // lanes probed that day; Carbon's Google lane checked too)
1077
+ // ---------------------------------------------------------------------------
1078
+ describe("gemini-4-carbon exposure", () => {
1079
+ it("premium Gemini, KIE first with Google's own API as the fallback — never direct-only or direct-first", () => {
1080
+ const m = getLlmModel("gemini-4-carbon")!
1081
+ expect(m.tier).toBe("premium")
1082
+ expect(m.vendor).toBe("google")
1083
+ expect(m.kieFormat).toBe("chat-completions")
1084
+ expect(m.kieSlugOrModel).toBe("gemini-4-carbon-openai")
1085
+ expect(m.directGeminiModel).toBe("gemini-4-carbon")
1086
+ expect(m.directOnly).toBeUndefined()
1087
+ expect(m.preferDirect).toBeUndefined()
1088
+ expect(supportsAdvancedMode("gemini-4-carbon")).toBe(true)
1089
+ // Only Advanced mode moves it to Google's API — no effort does.
1090
+ expect(llmServesDirect("gemini-4-carbon")).toBe(false)
1091
+ expect(llmServesDirect("gemini-4-carbon", "high")).toBe(false)
1092
+ expect(llmServesDirect("gemini-4-carbon", undefined, true)).toBe(true)
1093
+ })
1094
+
1095
+ it("declares NO structured mode — KIE left an off-enum value in a schema field, so callers parse and re-ask", () => {
1096
+ expect(getLlmModel("gemini-4-carbon")?.structuredOutputMode).toBeUndefined()
1097
+ expect(STRUCTURED_VISION_MODELS.map((m) => m.id)).not.toContain("gemini-4-carbon")
1098
+ expect(DESCRIBE_TO_PICKER_MODELS.map((m) => m.id)).not.toContain("gemini-4-carbon")
1099
+ })
1100
+
1101
+ it("offers low / medium / high on both lanes — never `none`, which Google 400s as MINIMAL", () => {
1102
+ expect(availableReasoningEfforts("gemini-4-carbon")).toEqual(["low", "medium", "high"])
1103
+ expect(availableReasoningEfforts("gemini-4-carbon", true)).toEqual(["low", "medium", "high"])
1104
+ expect(effectiveReasoningEffort("gemini-4-carbon", "none")).toBeUndefined()
1105
+ expect(effectiveReasoningEffort("gemini-4-carbon", "max")).toBe("high")
1106
+ })
1107
+
1108
+ it("reasons by default, floored at the default 32768 on the registry's usual 16384 cap", () => {
1109
+ const m = getLlmModel("gemini-4-carbon")!
1110
+ expect(m.thinkingDefaultOn).toBe(true)
1111
+ expect(m.reasoningOutputFloor).toBeUndefined()
1112
+ expect(reasoningOutputFloor(m)).toBe(REASONING_OUTPUT_FLOOR)
1113
+ expect(m.maxOutputTokens).toBe(16384)
1114
+ })
1115
+
1116
+ it("resolves by its id and its KIE slug, and backs no feature default", () => {
1117
+ expect(getLlmModel("gemini-4-carbon-openai")?.id).toBe("gemini-4-carbon")
1118
+ expect(Object.values(LLM_FEATURE_DEFAULTS)).not.toContain("gemini-4-carbon")
1119
+ })
1120
+
1121
+ it("stays OUT of video-analysis — image-only caps until its video + audio change", () => {
1122
+ expect(getLlmModalityCaps("gemini-4-carbon")).toEqual({ image: true, video: false, audio: false })
1123
+ expect(VIDEO_ANALYSIS_LLM_MODELS).not.toContain("gemini-4-carbon")
1124
+ })
1125
+ })
1126
+
1127
+ describe("gpt-6.1-terra exposure", () => {
1128
+ it("standard GPT-6.1 on the codex responses wire with an enforced schema, KIE only", () => {
1129
+ const m = getLlmModel("gpt-6.1-terra")!
1130
+ expect(m.tier).toBe("standard")
1131
+ expect(m.vendor).toBe("openai")
1132
+ expect(m.kieFormat).toBe("responses")
1133
+ expect(m.kieSlugOrModel).toBe("gpt-6-1-terra")
1134
+ expect(m.structuredOutputMode).toBe("responses-json-schema")
1135
+ expect(m.supportsImages).toBe(true)
1136
+ expect(m.supportsTemperature).toBe(false)
1137
+ expect(m.kieCollapseStream).toBeUndefined()
1138
+ expect(supportsAdvancedMode("gpt-6.1-terra")).toBe(false)
1139
+ expect(getLlmModalityCaps("gpt-6.1-terra")).toEqual({ image: true, video: false, audio: false })
1140
+ })
1141
+
1142
+ it("offers low…max but never `none`: a `none` request clamps to Auto (nothing sent)", () => {
1143
+ expect(availableReasoningEfforts("gpt-6.1-terra")).toEqual(["low", "medium", "high", "xhigh", "max"])
1144
+ expect(effectiveReasoningEffort("gpt-6.1-terra", "none")).toBeUndefined()
1145
+ expect(effectiveReasoningEffort("gpt-6.1-terra", "medium")).toBe("medium")
1146
+ })
1147
+
1148
+ it("does not reason by default (0 reasoning tokens with no effort) — no floor on an Auto call", () => {
1149
+ expect(getLlmModel("gpt-6.1-terra")?.thinkingDefaultOn).toBeUndefined()
1150
+ })
1151
+
1152
+ it("is the default of no feature, and the GPT-5.6 Terra entry is untouched", () => {
1153
+ expect(Object.values(LLM_FEATURE_DEFAULTS)).not.toContain("gpt-6.1-terra")
1154
+ expect(getLlmModel("gpt-5.6-terra")?.reasoningEfforts).toEqual(["none", "low", "medium", "high", "xhigh", "max"])
1155
+ })
1156
+ })
1157
+
1158
+ describe("kimi-k3.1-pro exposure", () => {
1159
+ it("premium Kimi on the openai responses wire with an enforced schema, KIE only", () => {
1160
+ const m = getLlmModel("kimi-k3.1-pro")!
1161
+ expect(m.tier).toBe("premium")
1162
+ expect(m.vendor).toBe("moonshot")
1163
+ expect(m.series).toBe("Kimi")
1164
+ expect(m.kieFormat).toBe("responses")
1165
+ expect(m.kieSlugOrModel).toBe("kimi-k3-1-pro")
1166
+ expect(m.structuredOutputMode).toBe("responses-json-schema")
1167
+ expect(m.supportsTemperature).toBe(false)
1168
+ expect(supportsAdvancedMode("kimi-k3.1-pro")).toBe(false)
1169
+ expect(getLlmModalityCaps("kimi-k3.1-pro")).toEqual({ image: true, video: false, audio: false })
1170
+ })
1171
+
1172
+ it("offers KIE's low / high / max — `none` and `medium` send low, `xhigh` high", () => {
1173
+ expect(availableReasoningEfforts("kimi-k3.1-pro")).toEqual(["low", "high", "max"])
1174
+ expect(effectiveReasoningEffort("kimi-k3.1-pro", "medium")).toBe("low")
1175
+ expect(effectiveReasoningEffort("kimi-k3.1-pro", "xhigh")).toBe("high")
1176
+ // Below `low` it sends `low`, never nothing (with none sent KIE runs it at `max`).
1177
+ expect(effectiveReasoningEffort("kimi-k3.1-pro", "none")).toBe("low")
1178
+ expect(effectiveReasoningEffort("kimi-k3.1-pro", undefined)).toBeUndefined()
1179
+ })
1180
+
1181
+ it("reasons by default, so every call is floored at 32768", () => {
1182
+ const m = getLlmModel("kimi-k3.1-pro")!
1183
+ expect(m.thinkingDefaultOn).toBe(true)
1184
+ expect(reasoningOutputFloor(m)).toBe(REASONING_OUTPUT_FLOOR)
1185
+ })
1186
+
1187
+ it("never resolves to kimi-k3, and kimi-k3 keeps its own ladder", () => {
1188
+ expect(getLlmModel("kimi-k3-1-pro")?.id).toBe("kimi-k3.1-pro")
1189
+ expect(getLlmModel("kimi-k3")?.id).toBe("kimi-k3")
1190
+ expect(getLlmModel("kimi-k3")?.reasoningEfforts).toEqual(["low", "medium", "high"])
1191
+ expect(Object.values(LLM_FEATURE_DEFAULTS)).not.toContain("kimi-k3.1-pro")
1192
+ })
1193
+ })
1194
+
1068
1195
  // ---------------------------------------------------------------------------
1069
1196
  // gpt-6-astra exposure (KIE responses lane live-verified 2026-09-06 on the
1070
1197
  // streaming path: enforced text.format json_schema with strict:true, the