@nodaro/shared 3.62.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.
Files changed (212) hide show
  1. package/dist/{chunk-6CSXMWL4.cjs → chunk-2PU3AGGS.cjs} +27 -4
  2. package/dist/chunk-2PU3AGGS.cjs.map +1 -0
  3. package/dist/{chunk-CC4V2B7S.js → chunk-34QLPTSA.js} +3 -3
  4. package/dist/{chunk-CC4V2B7S.js.map → chunk-34QLPTSA.js.map} +1 -1
  5. package/dist/{chunk-G4U3HW6W.js → chunk-3K24DWOH.js} +3 -3
  6. package/dist/{chunk-G4U3HW6W.js.map → chunk-3K24DWOH.js.map} +1 -1
  7. package/dist/{chunk-GSFB537T.js → chunk-4DVWXEB6.js} +23 -4
  8. package/dist/chunk-4DVWXEB6.js.map +1 -0
  9. package/dist/{chunk-ZES6EZC4.js → chunk-4MMZD63H.js} +3 -3
  10. package/dist/{chunk-ZES6EZC4.js.map → chunk-4MMZD63H.js.map} +1 -1
  11. package/dist/{chunk-N7OUQK7E.cjs → chunk-63H4C56Q.cjs} +8 -8
  12. package/dist/{chunk-N7OUQK7E.cjs.map → chunk-63H4C56Q.cjs.map} +1 -1
  13. package/dist/{chunk-2D5LQFV4.cjs → chunk-6BZC2ZHC.cjs} +9 -9
  14. package/dist/{chunk-2D5LQFV4.cjs.map → chunk-6BZC2ZHC.cjs.map} +1 -1
  15. package/dist/{chunk-3OYO3XCC.js → chunk-6M563QE6.js} +71 -9
  16. package/dist/chunk-6M563QE6.js.map +1 -0
  17. package/dist/{chunk-IDTKF5EX.cjs → chunk-6TGB7ECA.cjs} +7 -7
  18. package/dist/{chunk-IDTKF5EX.cjs.map → chunk-6TGB7ECA.cjs.map} +1 -1
  19. package/dist/{chunk-2HZGDZZN.cjs → chunk-6XUG4L7X.cjs} +6 -6
  20. package/dist/{chunk-2HZGDZZN.cjs.map → chunk-6XUG4L7X.cjs.map} +1 -1
  21. package/dist/{chunk-CIPPPT7E.cjs → chunk-77WU3V3J.cjs} +6 -6
  22. package/dist/{chunk-CIPPPT7E.cjs.map → chunk-77WU3V3J.cjs.map} +1 -1
  23. package/dist/{chunk-C7POAYFE.js → chunk-AE3AAJ4O.js} +3 -3
  24. package/dist/{chunk-C7POAYFE.js.map → chunk-AE3AAJ4O.js.map} +1 -1
  25. package/dist/{chunk-NGKKNSK6.js → chunk-BMJVKYVB.js} +36 -15
  26. package/dist/chunk-BMJVKYVB.js.map +1 -0
  27. package/dist/{chunk-YCXRSWCQ.js → chunk-CZ5IQB3L.js} +3 -3
  28. package/dist/{chunk-YCXRSWCQ.js.map → chunk-CZ5IQB3L.js.map} +1 -1
  29. package/dist/{chunk-E2HZTGYX.js → chunk-EPXGG27L.js} +7 -7
  30. package/dist/chunk-EPXGG27L.js.map +1 -0
  31. package/dist/{chunk-3M4BNKFJ.cjs → chunk-F6WGGYQW.cjs} +167 -3
  32. package/dist/chunk-F6WGGYQW.cjs.map +1 -0
  33. package/dist/{chunk-7FCTCWHD.js → chunk-FXGNRYQQ.js} +3 -3
  34. package/dist/{chunk-7FCTCWHD.js.map → chunk-FXGNRYQQ.js.map} +1 -1
  35. package/dist/{chunk-QWYFHQYK.cjs → chunk-GMBDLNLD.cjs} +86 -62
  36. package/dist/chunk-GMBDLNLD.cjs.map +1 -0
  37. package/dist/{chunk-KJSRPHJ2.cjs → chunk-GSKLPI3J.cjs} +100 -46
  38. package/dist/chunk-GSKLPI3J.cjs.map +1 -0
  39. package/dist/{chunk-S5TMRJMX.js → chunk-HBXF6RUU.js} +4 -4
  40. package/dist/{chunk-S5TMRJMX.js.map → chunk-HBXF6RUU.js.map} +1 -1
  41. package/dist/{chunk-S24ZBUB4.js → chunk-HWQ2SYNA.js} +6 -32
  42. package/dist/chunk-HWQ2SYNA.js.map +1 -0
  43. package/dist/{chunk-JJNNM23P.js → chunk-IY3Y462W.js} +3 -3
  44. package/dist/{chunk-JJNNM23P.js.map → chunk-IY3Y462W.js.map} +1 -1
  45. package/dist/{chunk-JZGZ26YB.js → chunk-KCZHQH2O.js} +4 -4
  46. package/dist/{chunk-JZGZ26YB.js.map → chunk-KCZHQH2O.js.map} +1 -1
  47. package/dist/{chunk-FVII3KHN.js → chunk-KMGCHV6O.js} +163 -4
  48. package/dist/chunk-KMGCHV6O.js.map +1 -0
  49. package/dist/{chunk-4ZEFP2FQ.cjs → chunk-L2TVY6XN.cjs} +4 -4
  50. package/dist/{chunk-4ZEFP2FQ.cjs.map → chunk-L2TVY6XN.cjs.map} +1 -1
  51. package/dist/{chunk-TRVWMKNE.cjs → chunk-LH72PQO2.cjs} +204 -52
  52. package/dist/chunk-LH72PQO2.cjs.map +1 -0
  53. package/dist/{chunk-HRY7KGAE.cjs → chunk-LMAQUR55.cjs} +6 -6
  54. package/dist/{chunk-HRY7KGAE.cjs.map → chunk-LMAQUR55.cjs.map} +1 -1
  55. package/dist/{chunk-MYJQELFN.cjs → chunk-M5OCFGHF.cjs} +254 -7
  56. package/dist/chunk-M5OCFGHF.cjs.map +1 -0
  57. package/dist/{chunk-I2RQB7VG.js → chunk-MD4XHED4.js} +3 -3
  58. package/dist/{chunk-I2RQB7VG.js.map → chunk-MD4XHED4.js.map} +1 -1
  59. package/dist/{chunk-6G7NN4S4.js → chunk-NIAFR5EE.js} +2 -2
  60. package/dist/chunk-NIAFR5EE.js.map +1 -0
  61. package/dist/{chunk-CF4S4N5X.js → chunk-O2QOBA6Q.js} +2 -2
  62. package/dist/{chunk-CF4S4N5X.js.map → chunk-O2QOBA6Q.js.map} +1 -1
  63. package/dist/{chunk-4GGLKRYI.cjs → chunk-O6TBB4IF.cjs} +2 -2
  64. package/dist/{chunk-4GGLKRYI.cjs.map → chunk-O6TBB4IF.cjs.map} +1 -1
  65. package/dist/{chunk-UDDVDQMF.js → chunk-OV3JTKBY.js} +166 -25
  66. package/dist/chunk-OV3JTKBY.js.map +1 -0
  67. package/dist/{chunk-5YYN5X57.js → chunk-PSKZKLDG.js} +252 -8
  68. package/dist/chunk-PSKZKLDG.js.map +1 -0
  69. package/dist/{chunk-IWWVPR3W.cjs → chunk-TM5JYSJF.cjs} +95 -19
  70. package/dist/chunk-TM5JYSJF.cjs.map +1 -0
  71. package/dist/{chunk-G3KVK7OU.cjs → chunk-V5EEQR2U.cjs} +21 -21
  72. package/dist/{chunk-G3KVK7OU.cjs.map → chunk-V5EEQR2U.cjs.map} +1 -1
  73. package/dist/{chunk-AOJ6B7K4.cjs → chunk-WZVIBAKN.cjs} +12 -12
  74. package/dist/chunk-WZVIBAKN.cjs.map +1 -0
  75. package/dist/{chunk-5M43XMRB.cjs → chunk-X5BAFW3Q.cjs} +8 -8
  76. package/dist/{chunk-5M43XMRB.cjs.map → chunk-X5BAFW3Q.cjs.map} +1 -1
  77. package/dist/{chunk-SYWR5G3T.js → chunk-XBTYGQ6Z.js} +51 -7
  78. package/dist/chunk-XBTYGQ6Z.js.map +1 -0
  79. package/dist/{chunk-AFYTX4AI.cjs → chunk-XGGZWA4A.cjs} +107 -50
  80. package/dist/chunk-XGGZWA4A.cjs.map +1 -0
  81. package/dist/{chunk-VACPZPUA.cjs → chunk-XGVJGNZW.cjs} +5 -5
  82. package/dist/{chunk-VACPZPUA.cjs.map → chunk-XGVJGNZW.cjs.map} +1 -1
  83. package/dist/{chunk-2W745U4A.cjs → chunk-Y35JQPT6.cjs} +42 -70
  84. package/dist/chunk-Y35JQPT6.cjs.map +1 -0
  85. package/dist/{chunk-KYMHFVAZ.cjs → chunk-Y4GCJJPF.cjs} +2 -2
  86. package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
  87. package/dist/{chunk-PTD6EDUU.js → chunk-YUER7TJG.js} +3 -3
  88. package/dist/{chunk-PTD6EDUU.js.map → chunk-YUER7TJG.js.map} +1 -1
  89. package/dist/{chunk-Y6X7UJSD.js → chunk-YX6TFX7H.js} +66 -14
  90. package/dist/chunk-YX6TFX7H.js.map +1 -0
  91. package/dist/{chunk-TWF2OSH4.cjs → chunk-ZPE2ZTJ4.cjs} +4 -4
  92. package/dist/{chunk-TWF2OSH4.cjs.map → chunk-ZPE2ZTJ4.cjs.map} +1 -1
  93. package/dist/entries/apps.cjs +42 -42
  94. package/dist/entries/apps.js +7 -7
  95. package/dist/entries/credits.cjs +237 -169
  96. package/dist/entries/credits.d.cts +163 -16
  97. package/dist/entries/credits.d.ts +163 -16
  98. package/dist/entries/credits.js +10 -10
  99. package/dist/entries/llm-models.cjs +77 -57
  100. package/dist/entries/llm-models.d.cts +85 -6
  101. package/dist/entries/llm-models.d.ts +85 -6
  102. package/dist/entries/llm-models.js +2 -2
  103. package/dist/entries/media.cjs +63 -63
  104. package/dist/entries/media.d.cts +8 -0
  105. package/dist/entries/media.d.ts +8 -0
  106. package/dist/entries/media.js +1 -1
  107. package/dist/entries/model-catalog.cjs +121 -105
  108. package/dist/entries/model-catalog.d.cts +48 -18
  109. package/dist/entries/model-catalog.d.ts +48 -18
  110. package/dist/entries/model-catalog.js +4 -4
  111. package/dist/entries/models.cjs +418 -322
  112. package/dist/entries/models.d.cts +71 -5
  113. package/dist/entries/models.d.ts +71 -5
  114. package/dist/entries/models.js +5 -5
  115. package/dist/entries/nodes.cjs +216 -208
  116. package/dist/entries/nodes.d.cts +22 -6
  117. package/dist/entries/nodes.d.ts +22 -6
  118. package/dist/entries/nodes.js +8 -8
  119. package/dist/entries/pipeline.cjs +152 -152
  120. package/dist/entries/pipeline.d.cts +3 -3
  121. package/dist/entries/pipeline.d.ts +3 -3
  122. package/dist/entries/pipeline.js +3 -3
  123. package/dist/entries/runtime-config.cjs +29 -29
  124. package/dist/entries/runtime-config.d.cts +10 -7
  125. package/dist/entries/runtime-config.d.ts +10 -7
  126. package/dist/entries/runtime-config.js +1 -1
  127. package/dist/entries/social.cjs +177 -177
  128. package/dist/entries/social.js +2 -2
  129. package/dist/entries/types.d.cts +8 -0
  130. package/dist/entries/types.d.ts +8 -0
  131. package/dist/entries/ugc.cjs +71 -71
  132. package/dist/entries/ugc.js +4 -4
  133. package/dist/entries/video.cjs +154 -150
  134. package/dist/entries/video.d.cts +11 -2
  135. package/dist/entries/video.d.ts +11 -2
  136. package/dist/entries/video.js +6 -6
  137. package/dist/entries/workflow.d.cts +1 -1
  138. package/dist/entries/workflow.d.ts +1 -1
  139. package/dist/index.cjs +1727 -1515
  140. package/dist/index.d.cts +8 -8
  141. package/dist/index.d.ts +8 -8
  142. package/dist/index.js +23 -23
  143. package/dist/{model-catalog-CCEcv08q.d.cts → model-catalog-C_Eo35tL.d.cts} +30 -0
  144. package/dist/{model-catalog-CCEcv08q.d.ts → model-catalog-C_Eo35tL.d.ts} +30 -0
  145. package/dist/{model-constants-Cf3zaITt.d.cts → model-constants-Bg4ccSQb.d.ts} +138 -25
  146. package/dist/{model-constants-B88p6XR0.d.ts → model-constants-DWcxOmaY.d.cts} +138 -25
  147. package/package.json +1 -1
  148. package/src/__tests__/credit-identifiers.test.ts +29 -0
  149. package/src/__tests__/extend-providers.test.ts +106 -26
  150. package/src/__tests__/gvp-supported-providers.test.ts +27 -2
  151. package/src/__tests__/lip-sync-audio-rate.test.ts +74 -0
  152. package/src/__tests__/lip-sync-levers.test.ts +31 -0
  153. package/src/__tests__/llm-models.test.ts +132 -3
  154. package/src/__tests__/llm-price-key.test.ts +152 -1
  155. package/src/__tests__/nemotron-transcribe-pricing.test.ts +61 -0
  156. package/src/__tests__/normalize-node-params.test.ts +25 -0
  157. package/src/__tests__/pixverse-v6-max-catalog.test.ts +271 -0
  158. package/src/__tests__/prompt-length-limits.test.ts +4 -0
  159. package/src/__tests__/seedance-task-type.test.ts +13 -3
  160. package/src/__tests__/transcribe-capabilities.test.ts +39 -2
  161. package/src/__tests__/transcribe-preflight.test.ts +50 -1
  162. package/src/__tests__/video-audio-capability.test.ts +35 -6
  163. package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
  164. package/src/__tests__/video-upscale-params.test.ts +62 -0
  165. package/src/catalog-projection.ts +8 -0
  166. package/src/credit-estimators/index.ts +10 -0
  167. package/src/credit-estimators/nemotron-transcribe.ts +87 -0
  168. package/src/credit-identifiers.ts +109 -35
  169. package/src/entries/credits.ts +12 -1
  170. package/src/entries/llm-models.ts +6 -0
  171. package/src/entries/model-catalog.ts +9 -0
  172. package/src/entries/models.ts +35 -0
  173. package/src/entries/nodes.ts +2 -0
  174. package/src/entries/video.ts +1 -1
  175. package/src/freecut-protocol.ts +8 -0
  176. package/src/lip-sync-levers.ts +56 -0
  177. package/src/lip-sync-pricing.ts +91 -1
  178. package/src/llm-models.ts +249 -4
  179. package/src/model-catalog.ts +250 -4
  180. package/src/model-constants.ts +277 -30
  181. package/src/model-tree.ts +2 -1
  182. package/src/nodaro-video-upscale.ts +48 -0
  183. package/src/node-default-mappings.ts +3 -0
  184. package/src/normalize-node-params.ts +49 -1
  185. package/src/runtime-config/contract.ts +10 -7
  186. package/src/seedance-draft.ts +2 -1
  187. package/src/transcribe-preflight.ts +58 -7
  188. package/src/video-duration.ts +9 -0
  189. package/src/video-ui-defaults.ts +5 -3
  190. package/src/video-upscale-params.ts +67 -0
  191. package/dist/chunk-2W745U4A.cjs.map +0 -1
  192. package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
  193. package/dist/chunk-3OYO3XCC.js.map +0 -1
  194. package/dist/chunk-5YYN5X57.js.map +0 -1
  195. package/dist/chunk-6CSXMWL4.cjs.map +0 -1
  196. package/dist/chunk-6G7NN4S4.js.map +0 -1
  197. package/dist/chunk-AFYTX4AI.cjs.map +0 -1
  198. package/dist/chunk-AOJ6B7K4.cjs.map +0 -1
  199. package/dist/chunk-E2HZTGYX.js.map +0 -1
  200. package/dist/chunk-FVII3KHN.js.map +0 -1
  201. package/dist/chunk-GSFB537T.js.map +0 -1
  202. package/dist/chunk-IWWVPR3W.cjs.map +0 -1
  203. package/dist/chunk-KJSRPHJ2.cjs.map +0 -1
  204. package/dist/chunk-KYMHFVAZ.cjs.map +0 -1
  205. package/dist/chunk-MYJQELFN.cjs.map +0 -1
  206. package/dist/chunk-NGKKNSK6.js.map +0 -1
  207. package/dist/chunk-QWYFHQYK.cjs.map +0 -1
  208. package/dist/chunk-S24ZBUB4.js.map +0 -1
  209. package/dist/chunk-SYWR5G3T.js.map +0 -1
  210. package/dist/chunk-TRVWMKNE.cjs.map +0 -1
  211. package/dist/chunk-UDDVDQMF.js.map +0 -1
  212. package/dist/chunk-Y6X7UJSD.js.map +0 -1
@@ -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
+ })
@@ -56,6 +56,7 @@ const EXPECTED_MODEL_IDS = [
56
56
  "gpt-5.2",
57
57
  "gemini-3.1-pro",
58
58
  "gemini-4-argon",
59
+ "gemini-4-carbon",
59
60
  "claude-opus-4.7",
60
61
  "gpt-5.4",
61
62
  "gpt-5.5",
@@ -66,6 +67,7 @@ const EXPECTED_MODEL_IDS = [
66
67
  "gpt-6-luna",
67
68
  "gpt-6-sol",
68
69
  "gpt-6.1-sol",
70
+ "gpt-6.1-terra",
69
71
  "grok-4.6",
70
72
  "grok-4.7",
71
73
  "claude-sonnet-5",
@@ -75,6 +77,7 @@ const EXPECTED_MODEL_IDS = [
75
77
  "claude-opus-5.5",
76
78
  "claude-fable-5",
77
79
  "kimi-k3",
80
+ "kimi-k3.1-pro",
78
81
  "deepseek-v4.1-flash",
79
82
  ]
80
83
 
@@ -120,14 +123,14 @@ describe("LLM_MODELS data integrity", () => {
120
123
  expect(new Set(ids).size).toBe(ids.length)
121
124
  })
122
125
 
123
- it("has 9 economy, 7 standard, 14 premium models", () => {
126
+ it("has 9 economy, 8 standard, 16 premium models", () => {
124
127
  const tierCounts: Record<LlmTier, number> = { economy: 0, standard: 0, premium: 0 }
125
128
  for (const model of LLM_MODELS) {
126
129
  tierCounts[model.tier]++
127
130
  }
128
131
  expect(tierCounts.economy).toBe(9)
129
- expect(tierCounts.standard).toBe(7)
130
- expect(tierCounts.premium).toBe(14)
132
+ expect(tierCounts.standard).toBe(8)
133
+ expect(tierCounts.premium).toBe(16)
131
134
  })
132
135
 
133
136
  it("all three kieFormats are represented", () => {
@@ -685,6 +688,11 @@ describe("STRUCTURED_VISION_MODELS", () => {
685
688
  "deepseek-v4.1-flash",
686
689
  // directOnly; the direct lane enforced responseJsonSchema (2026-10-17).
687
690
  "gemini-4-argon",
691
+ // 2026-11-12 — text.format json_schema enforced on KIE, vision read.
692
+ // gemini-4-carbon is NOT here: KIE did not enforce its schema, so it
693
+ // declares no structured mode (parse, validate and re-ask instead).
694
+ "gpt-6.1-terra",
695
+ "kimi-k3.1-pro",
688
696
  ].sort(),
689
697
  )
690
698
  })
@@ -1065,6 +1073,127 @@ describe("gemini-4-argon exposure", () => {
1065
1073
  })
1066
1074
  })
1067
1075
 
1076
+ // ---------------------------------------------------------------------------
1077
+ // 2026-11-12 additions: Kimi K3.1 Pro, GPT-6.1 Terra, Gemini 4 Carbon (KIE
1078
+ // lanes probed that day; Carbon's Google lane checked too)
1079
+ // ---------------------------------------------------------------------------
1080
+ describe("gemini-4-carbon exposure", () => {
1081
+ it("premium Gemini, KIE first with Google's own API as the fallback — never direct-only or direct-first", () => {
1082
+ const m = getLlmModel("gemini-4-carbon")!
1083
+ expect(m.tier).toBe("premium")
1084
+ expect(m.vendor).toBe("google")
1085
+ expect(m.kieFormat).toBe("chat-completions")
1086
+ expect(m.kieSlugOrModel).toBe("gemini-4-carbon-openai")
1087
+ expect(m.directGeminiModel).toBe("gemini-4-carbon")
1088
+ expect(m.directOnly).toBeUndefined()
1089
+ expect(m.preferDirect).toBeUndefined()
1090
+ expect(supportsAdvancedMode("gemini-4-carbon")).toBe(true)
1091
+ // Only Advanced mode moves it to Google's API — no effort does.
1092
+ expect(llmServesDirect("gemini-4-carbon")).toBe(false)
1093
+ expect(llmServesDirect("gemini-4-carbon", "high")).toBe(false)
1094
+ expect(llmServesDirect("gemini-4-carbon", undefined, true)).toBe(true)
1095
+ })
1096
+
1097
+ it("declares NO structured mode — KIE left an off-enum value in a schema field, so callers parse and re-ask", () => {
1098
+ expect(getLlmModel("gemini-4-carbon")?.structuredOutputMode).toBeUndefined()
1099
+ expect(STRUCTURED_VISION_MODELS.map((m) => m.id)).not.toContain("gemini-4-carbon")
1100
+ expect(DESCRIBE_TO_PICKER_MODELS.map((m) => m.id)).not.toContain("gemini-4-carbon")
1101
+ })
1102
+
1103
+ it("offers low / medium / high on both lanes — never `none`, which Google 400s as MINIMAL", () => {
1104
+ expect(availableReasoningEfforts("gemini-4-carbon")).toEqual(["low", "medium", "high"])
1105
+ expect(availableReasoningEfforts("gemini-4-carbon", true)).toEqual(["low", "medium", "high"])
1106
+ expect(effectiveReasoningEffort("gemini-4-carbon", "none")).toBeUndefined()
1107
+ expect(effectiveReasoningEffort("gemini-4-carbon", "max")).toBe("high")
1108
+ })
1109
+
1110
+ it("reasons by default, floored at the default 32768 on the registry's usual 16384 cap", () => {
1111
+ const m = getLlmModel("gemini-4-carbon")!
1112
+ expect(m.thinkingDefaultOn).toBe(true)
1113
+ expect(m.reasoningOutputFloor).toBeUndefined()
1114
+ expect(reasoningOutputFloor(m)).toBe(REASONING_OUTPUT_FLOOR)
1115
+ expect(m.maxOutputTokens).toBe(16384)
1116
+ })
1117
+
1118
+ it("resolves by its id and its KIE slug, and backs no feature default", () => {
1119
+ expect(getLlmModel("gemini-4-carbon-openai")?.id).toBe("gemini-4-carbon")
1120
+ expect(Object.values(LLM_FEATURE_DEFAULTS)).not.toContain("gemini-4-carbon")
1121
+ })
1122
+
1123
+ it("stays OUT of video-analysis — image-only caps until its video + audio change", () => {
1124
+ expect(getLlmModalityCaps("gemini-4-carbon")).toEqual({ image: true, video: false, audio: false })
1125
+ expect(VIDEO_ANALYSIS_LLM_MODELS).not.toContain("gemini-4-carbon")
1126
+ })
1127
+ })
1128
+
1129
+ describe("gpt-6.1-terra exposure", () => {
1130
+ it("standard GPT-6.1 on the codex responses wire with an enforced schema, KIE only", () => {
1131
+ const m = getLlmModel("gpt-6.1-terra")!
1132
+ expect(m.tier).toBe("standard")
1133
+ expect(m.vendor).toBe("openai")
1134
+ expect(m.kieFormat).toBe("responses")
1135
+ expect(m.kieSlugOrModel).toBe("gpt-6-1-terra")
1136
+ expect(m.structuredOutputMode).toBe("responses-json-schema")
1137
+ expect(m.supportsImages).toBe(true)
1138
+ expect(m.supportsTemperature).toBe(false)
1139
+ expect(m.kieCollapseStream).toBeUndefined()
1140
+ expect(supportsAdvancedMode("gpt-6.1-terra")).toBe(false)
1141
+ expect(getLlmModalityCaps("gpt-6.1-terra")).toEqual({ image: true, video: false, audio: false })
1142
+ })
1143
+
1144
+ it("offers low…max but never `none`: a `none` request clamps to Auto (nothing sent)", () => {
1145
+ expect(availableReasoningEfforts("gpt-6.1-terra")).toEqual(["low", "medium", "high", "xhigh", "max"])
1146
+ expect(effectiveReasoningEffort("gpt-6.1-terra", "none")).toBeUndefined()
1147
+ expect(effectiveReasoningEffort("gpt-6.1-terra", "medium")).toBe("medium")
1148
+ })
1149
+
1150
+ it("does not reason by default (0 reasoning tokens with no effort) — no floor on an Auto call", () => {
1151
+ expect(getLlmModel("gpt-6.1-terra")?.thinkingDefaultOn).toBeUndefined()
1152
+ })
1153
+
1154
+ it("is the default of no feature, and the GPT-5.6 Terra entry is untouched", () => {
1155
+ expect(Object.values(LLM_FEATURE_DEFAULTS)).not.toContain("gpt-6.1-terra")
1156
+ expect(getLlmModel("gpt-5.6-terra")?.reasoningEfforts).toEqual(["none", "low", "medium", "high", "xhigh", "max"])
1157
+ })
1158
+ })
1159
+
1160
+ describe("kimi-k3.1-pro exposure", () => {
1161
+ it("premium Kimi on the openai responses wire with an enforced schema, KIE only", () => {
1162
+ const m = getLlmModel("kimi-k3.1-pro")!
1163
+ expect(m.tier).toBe("premium")
1164
+ expect(m.vendor).toBe("moonshot")
1165
+ expect(m.series).toBe("Kimi")
1166
+ expect(m.kieFormat).toBe("responses")
1167
+ expect(m.kieSlugOrModel).toBe("kimi-k3-1-pro")
1168
+ expect(m.structuredOutputMode).toBe("responses-json-schema")
1169
+ expect(m.supportsTemperature).toBe(false)
1170
+ expect(supportsAdvancedMode("kimi-k3.1-pro")).toBe(false)
1171
+ expect(getLlmModalityCaps("kimi-k3.1-pro")).toEqual({ image: true, video: false, audio: false })
1172
+ })
1173
+
1174
+ it("offers KIE's low / high / max — `none` and `medium` send low, `xhigh` high", () => {
1175
+ expect(availableReasoningEfforts("kimi-k3.1-pro")).toEqual(["low", "high", "max"])
1176
+ expect(effectiveReasoningEffort("kimi-k3.1-pro", "medium")).toBe("low")
1177
+ expect(effectiveReasoningEffort("kimi-k3.1-pro", "xhigh")).toBe("high")
1178
+ // Below `low` it sends `low`, never nothing (with none sent KIE runs it at `max`).
1179
+ expect(effectiveReasoningEffort("kimi-k3.1-pro", "none")).toBe("low")
1180
+ expect(effectiveReasoningEffort("kimi-k3.1-pro", undefined)).toBeUndefined()
1181
+ })
1182
+
1183
+ it("reasons by default, so every call is floored at 32768", () => {
1184
+ const m = getLlmModel("kimi-k3.1-pro")!
1185
+ expect(m.thinkingDefaultOn).toBe(true)
1186
+ expect(reasoningOutputFloor(m)).toBe(REASONING_OUTPUT_FLOOR)
1187
+ })
1188
+
1189
+ it("never resolves to kimi-k3, and kimi-k3 keeps its own ladder", () => {
1190
+ expect(getLlmModel("kimi-k3-1-pro")?.id).toBe("kimi-k3.1-pro")
1191
+ expect(getLlmModel("kimi-k3")?.id).toBe("kimi-k3")
1192
+ expect(getLlmModel("kimi-k3")?.reasoningEfforts).toEqual(["low", "medium", "high"])
1193
+ expect(Object.values(LLM_FEATURE_DEFAULTS)).not.toContain("kimi-k3.1-pro")
1194
+ })
1195
+ })
1196
+
1068
1197
  // ---------------------------------------------------------------------------
1069
1198
  // gpt-6-astra exposure (KIE responses lane live-verified 2026-09-06 on the
1070
1199
  // streaming path: enforced text.format json_schema with strict:true, the
@@ -1,5 +1,20 @@
1
1
  import { describe, expect, it } from "vitest"
2
- import { LLM_FEATURE_DEFAULTS, LLM_FEATURE_DEFAULTS_FROM, llmDefaultsFeature, llmPriceKey } from "../entries/llm-models.js"
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,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
+ })