@nodaro/shared 3.68.0 → 3.70.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 (205) hide show
  1. package/dist/{chunk-5IZHECUP.js → chunk-2VOXSVIE.js} +3 -3
  2. package/dist/{chunk-5IZHECUP.js.map → chunk-2VOXSVIE.js.map} +1 -1
  3. package/dist/{chunk-OXBU5AGH.js → chunk-42ICEVUN.js} +3 -3
  4. package/dist/{chunk-OXBU5AGH.js.map → chunk-42ICEVUN.js.map} +1 -1
  5. package/dist/{chunk-EFYWV2V5.cjs → chunk-4U7QAUV3.cjs} +73 -73
  6. package/dist/{chunk-EFYWV2V5.cjs.map → chunk-4U7QAUV3.cjs.map} +1 -1
  7. package/dist/{chunk-OFQ6CU6S.js → chunk-52JNQG4K.js} +3 -3
  8. package/dist/{chunk-OFQ6CU6S.js.map → chunk-52JNQG4K.js.map} +1 -1
  9. package/dist/{chunk-PERUFUVH.cjs → chunk-5B337MCI.cjs} +15 -15
  10. package/dist/{chunk-PERUFUVH.cjs.map → chunk-5B337MCI.cjs.map} +1 -1
  11. package/dist/{chunk-66QSUUB4.cjs → chunk-5DRSENY3.cjs} +24 -24
  12. package/dist/{chunk-66QSUUB4.cjs.map → chunk-5DRSENY3.cjs.map} +1 -1
  13. package/dist/{chunk-3YWZ5SOZ.js → chunk-BIQ7COJP.js} +5 -5
  14. package/dist/{chunk-3YWZ5SOZ.js.map → chunk-BIQ7COJP.js.map} +1 -1
  15. package/dist/{chunk-4XR66IWF.cjs → chunk-BLGZW3UF.cjs} +64 -23
  16. package/dist/chunk-BLGZW3UF.cjs.map +1 -0
  17. package/dist/{chunk-KSHAAPQF.cjs → chunk-BOCHNFDU.cjs} +4 -4
  18. package/dist/chunk-BOCHNFDU.cjs.map +1 -0
  19. package/dist/{chunk-Z77M7Q2R.js → chunk-C2UHX7OF.js} +3 -3
  20. package/dist/{chunk-Z77M7Q2R.js.map → chunk-C2UHX7OF.js.map} +1 -1
  21. package/dist/{chunk-Q2LEJXLZ.cjs → chunk-C32IL6RD.cjs} +2 -2
  22. package/dist/{chunk-Q2LEJXLZ.cjs.map → chunk-C32IL6RD.cjs.map} +1 -1
  23. package/dist/{chunk-5NVGKXJV.cjs → chunk-CV2BEK52.cjs} +111 -3
  24. package/dist/chunk-CV2BEK52.cjs.map +1 -0
  25. package/dist/{chunk-G2G7XGFU.cjs → chunk-DOY47F7S.cjs} +7 -7
  26. package/dist/{chunk-G2G7XGFU.cjs.map → chunk-DOY47F7S.cjs.map} +1 -1
  27. package/dist/{chunk-5GG4CG4Y.js → chunk-EWNDK4FV.js} +3 -3
  28. package/dist/{chunk-5GG4CG4Y.js.map → chunk-EWNDK4FV.js.map} +1 -1
  29. package/dist/{chunk-T4GIHHXY.cjs → chunk-FMQ43SJP.cjs} +6 -6
  30. package/dist/{chunk-T4GIHHXY.cjs.map → chunk-FMQ43SJP.cjs.map} +1 -1
  31. package/dist/{chunk-IWUW3YPM.cjs → chunk-FWPGRC4X.cjs} +5 -5
  32. package/dist/{chunk-IWUW3YPM.cjs.map → chunk-FWPGRC4X.cjs.map} +1 -1
  33. package/dist/{chunk-37ZSFS6A.cjs → chunk-GC77W57T.cjs} +18 -18
  34. package/dist/{chunk-37ZSFS6A.cjs.map → chunk-GC77W57T.cjs.map} +1 -1
  35. package/dist/{chunk-BNR5FKL5.js → chunk-H2E4QXEZ.js} +3 -3
  36. package/dist/{chunk-BNR5FKL5.js.map → chunk-H2E4QXEZ.js.map} +1 -1
  37. package/dist/{chunk-GF7ZA26H.js → chunk-HA2PVTER.js} +5 -5
  38. package/dist/{chunk-GF7ZA26H.js.map → chunk-HA2PVTER.js.map} +1 -1
  39. package/dist/{chunk-M5QY464F.cjs → chunk-HBRDKHIW.cjs} +21 -21
  40. package/dist/{chunk-M5QY464F.cjs.map → chunk-HBRDKHIW.cjs.map} +1 -1
  41. package/dist/{chunk-E62W5I6A.cjs → chunk-HWBLZSM3.cjs} +109 -7
  42. package/dist/chunk-HWBLZSM3.cjs.map +1 -0
  43. package/dist/{chunk-5LWYX4GV.js → chunk-IKN54UGB.js} +3 -3
  44. package/dist/{chunk-5LWYX4GV.js.map → chunk-IKN54UGB.js.map} +1 -1
  45. package/dist/{chunk-UVUHVY7F.js → chunk-JCYTTTM2.js} +2 -2
  46. package/dist/{chunk-UVUHVY7F.js.map → chunk-JCYTTTM2.js.map} +1 -1
  47. package/dist/{chunk-PJAJCFLP.cjs → chunk-JEUZNHLL.cjs} +168 -44
  48. package/dist/chunk-JEUZNHLL.cjs.map +1 -0
  49. package/dist/{chunk-TAPBDT47.js → chunk-JVYDKXGY.js} +4 -4
  50. package/dist/{chunk-TAPBDT47.js.map → chunk-JVYDKXGY.js.map} +1 -1
  51. package/dist/{chunk-V6OXSXIX.js → chunk-K3YGI5IW.js} +107 -4
  52. package/dist/chunk-K3YGI5IW.js.map +1 -0
  53. package/dist/{chunk-SCDE676D.js → chunk-KKFFQUMM.js} +65 -23
  54. package/dist/chunk-KKFFQUMM.js.map +1 -0
  55. package/dist/{chunk-BHL7TAQO.js → chunk-LTBM2KMY.js} +43 -10
  56. package/dist/chunk-LTBM2KMY.js.map +1 -0
  57. package/dist/{chunk-BMDOPJBP.cjs → chunk-MZ772ZXA.cjs} +17 -17
  58. package/dist/{chunk-BMDOPJBP.cjs.map → chunk-MZ772ZXA.cjs.map} +1 -1
  59. package/dist/{chunk-SW5ZD7BO.js → chunk-NS34PZ2S.js} +3 -3
  60. package/dist/{chunk-SW5ZD7BO.js.map → chunk-NS34PZ2S.js.map} +1 -1
  61. package/dist/{chunk-6Q4BS6AR.js → chunk-NT3ZFUNJ.js} +31 -3
  62. package/dist/chunk-NT3ZFUNJ.js.map +1 -0
  63. package/dist/{chunk-VBP4DH37.js → chunk-O53P2D4V.js} +130 -15
  64. package/dist/chunk-O53P2D4V.js.map +1 -0
  65. package/dist/{chunk-AT53ZQUC.js → chunk-OW5AXH2Y.js} +51 -7
  66. package/dist/chunk-OW5AXH2Y.js.map +1 -0
  67. package/dist/{chunk-F6XIH3TZ.cjs → chunk-OZHE77T3.cjs} +9 -9
  68. package/dist/{chunk-F6XIH3TZ.cjs.map → chunk-OZHE77T3.cjs.map} +1 -1
  69. package/dist/{chunk-5J2LIQYU.js → chunk-PKWRAMVB.js} +6 -6
  70. package/dist/{chunk-5J2LIQYU.js.map → chunk-PKWRAMVB.js.map} +1 -1
  71. package/dist/{chunk-BCY3A62O.cjs → chunk-POZBRZUM.cjs} +75 -60
  72. package/dist/chunk-POZBRZUM.cjs.map +1 -0
  73. package/dist/{chunk-X2YHKP4D.cjs → chunk-PWIKUOLB.cjs} +8 -8
  74. package/dist/{chunk-X2YHKP4D.cjs.map → chunk-PWIKUOLB.cjs.map} +1 -1
  75. package/dist/{chunk-OXTF4Y3P.cjs → chunk-PYYYBINP.cjs} +6 -6
  76. package/dist/{chunk-OXTF4Y3P.cjs.map → chunk-PYYYBINP.cjs.map} +1 -1
  77. package/dist/{chunk-WZG6GZIL.cjs → chunk-QCGSL4CJ.cjs} +4 -4
  78. package/dist/{chunk-WZG6GZIL.cjs.map → chunk-QCGSL4CJ.cjs.map} +1 -1
  79. package/dist/{chunk-XEPKONJC.js → chunk-QCVQVKCI.js} +3 -3
  80. package/dist/{chunk-XEPKONJC.js.map → chunk-QCVQVKCI.js.map} +1 -1
  81. package/dist/{chunk-3L7GMQ4M.cjs → chunk-QCZYYAPZ.cjs} +54 -49
  82. package/dist/chunk-QCZYYAPZ.cjs.map +1 -0
  83. package/dist/{chunk-GNLA5NTT.cjs → chunk-QV32JI4L.cjs} +4 -4
  84. package/dist/{chunk-GNLA5NTT.cjs.map → chunk-QV32JI4L.cjs.map} +1 -1
  85. package/dist/{chunk-3QJ3UR5Z.js → chunk-QVAUBB2T.js} +11 -11
  86. package/dist/{chunk-3QJ3UR5Z.js.map → chunk-QVAUBB2T.js.map} +1 -1
  87. package/dist/{chunk-MVXZP6VB.js → chunk-R22UHRR6.js} +109 -7
  88. package/dist/chunk-R22UHRR6.js.map +1 -0
  89. package/dist/{chunk-KL6GAYTT.js → chunk-S6DXSQCV.js} +5 -3
  90. package/dist/chunk-S6DXSQCV.js.map +1 -0
  91. package/dist/{chunk-V24EPI5N.cjs → chunk-U4DIGIC3.cjs} +5 -3
  92. package/dist/chunk-U4DIGIC3.cjs.map +1 -0
  93. package/dist/{chunk-H5KHWTAE.js → chunk-UY6QZX7H.js} +4 -4
  94. package/dist/chunk-UY6QZX7H.js.map +1 -0
  95. package/dist/{chunk-XNJDAW3M.js → chunk-V6TC2NDG.js} +31 -17
  96. package/dist/chunk-V6TC2NDG.js.map +1 -0
  97. package/dist/{chunk-DBD4BCGH.cjs → chunk-VDFQKLDG.cjs} +33 -2
  98. package/dist/chunk-VDFQKLDG.cjs.map +1 -0
  99. package/dist/{chunk-PGDR7CO3.cjs → chunk-WHV7MDNC.cjs} +70 -11
  100. package/dist/chunk-WHV7MDNC.cjs.map +1 -0
  101. package/dist/{chunk-HTDKEYMY.cjs → chunk-XBHDXURR.cjs} +139 -91
  102. package/dist/chunk-XBHDXURR.cjs.map +1 -0
  103. package/dist/{chunk-PAUWEWTY.js → chunk-YLDY23N2.js} +12 -7
  104. package/dist/chunk-YLDY23N2.js.map +1 -0
  105. package/dist/entries/apps.cjs +43 -43
  106. package/dist/entries/apps.js +8 -8
  107. package/dist/entries/credits.cjs +282 -226
  108. package/dist/entries/credits.d.cts +167 -66
  109. package/dist/entries/credits.d.ts +167 -66
  110. package/dist/entries/credits.js +11 -11
  111. package/dist/entries/llm-models.cjs +88 -68
  112. package/dist/entries/llm-models.d.cts +73 -6
  113. package/dist/entries/llm-models.d.ts +73 -6
  114. package/dist/entries/llm-models.js +2 -2
  115. package/dist/entries/media.cjs +87 -87
  116. package/dist/entries/media.js +1 -1
  117. package/dist/entries/model-catalog.cjs +133 -133
  118. package/dist/entries/model-catalog.js +4 -4
  119. package/dist/entries/models.cjs +458 -406
  120. package/dist/entries/models.d.cts +64 -29
  121. package/dist/entries/models.d.ts +64 -29
  122. package/dist/entries/models.js +7 -7
  123. package/dist/entries/nodes.cjs +215 -215
  124. package/dist/entries/nodes.js +11 -11
  125. package/dist/entries/pipeline.cjs +153 -153
  126. package/dist/entries/pipeline.d.cts +1 -1
  127. package/dist/entries/pipeline.d.ts +1 -1
  128. package/dist/entries/pipeline.js +3 -3
  129. package/dist/entries/social.cjs +237 -177
  130. package/dist/entries/social.d.cts +183 -6
  131. package/dist/entries/social.d.ts +183 -6
  132. package/dist/entries/social.js +2 -2
  133. package/dist/entries/ugc.cjs +71 -71
  134. package/dist/entries/ugc.js +4 -4
  135. package/dist/entries/video.cjs +153 -153
  136. package/dist/entries/video.d.cts +2 -1
  137. package/dist/entries/video.d.ts +2 -1
  138. package/dist/entries/video.js +7 -7
  139. package/dist/entries/workflow.cjs +152 -152
  140. package/dist/entries/workflow.js +4 -4
  141. package/dist/index.cjs +2034 -1846
  142. package/dist/index.d.cts +5 -5
  143. package/dist/index.d.ts +5 -5
  144. package/dist/index.js +26 -26
  145. package/dist/{model-constants-DZ3tPGFO.d.ts → model-constants-B5DNHIP8.d.ts} +156 -12
  146. package/dist/{model-constants-BstsUup6.d.cts → model-constants-CQr_d3Kw.d.cts} +156 -12
  147. package/package.json +1 -1
  148. package/src/__tests__/cast-swap-limits.test.ts +54 -20
  149. package/src/__tests__/competitors.test.ts +64 -0
  150. package/src/__tests__/extend-providers.test.ts +43 -6
  151. package/src/__tests__/fixtures/measured-input-quote-parity.json +537 -1
  152. package/src/__tests__/fixtures/planned-length-quote-parity.json +46 -1
  153. package/src/__tests__/fixtures/probed-node-quote-parity.json +132 -0
  154. package/src/__tests__/fixtures/video-utility-quote-parity.json +112 -1
  155. package/src/__tests__/gemini-omni-extend.test.ts +110 -0
  156. package/src/__tests__/gvp-supported-providers.test.ts +3 -0
  157. package/src/__tests__/lip-sync-pricing.test.ts +29 -2
  158. package/src/__tests__/llm-models.test.ts +163 -6
  159. package/src/__tests__/llm-price-key.test.ts +2 -0
  160. package/src/__tests__/seedance-2-5-flash-catalog.test.ts +194 -0
  161. package/src/__tests__/suno-separate.test.ts +32 -0
  162. package/src/__tests__/video-character-refs.test.ts +48 -0
  163. package/src/cast-swap-limits.ts +43 -25
  164. package/src/competitors.ts +80 -8
  165. package/src/credit-identifiers.ts +51 -32
  166. package/src/entries/credits.ts +19 -0
  167. package/src/entries/llm-models.ts +6 -0
  168. package/src/entries/models.ts +15 -0
  169. package/src/entries/social.ts +33 -0
  170. package/src/gemini-omni-extend-quote.ts +76 -0
  171. package/src/generated/unit-contracts.ts +1 -0
  172. package/src/lip-sync-pricing.ts +26 -1
  173. package/src/llm-models.ts +176 -5
  174. package/src/model-catalog.ts +107 -5
  175. package/src/model-constants.ts +274 -11
  176. package/src/node-default-mappings.ts +2 -0
  177. package/src/node-runtime-keys.ts +2 -2
  178. package/src/seedance-extend-rate.ts +83 -20
  179. package/src/seedance-lip-sync.ts +68 -0
  180. package/src/suno-separate.ts +51 -0
  181. package/src/topics.ts +162 -0
  182. package/src/video-character-refs.ts +26 -6
  183. package/src/video-face-mesh.ts +1 -1
  184. package/dist/chunk-3L7GMQ4M.cjs.map +0 -1
  185. package/dist/chunk-4XR66IWF.cjs.map +0 -1
  186. package/dist/chunk-5NVGKXJV.cjs.map +0 -1
  187. package/dist/chunk-6Q4BS6AR.js.map +0 -1
  188. package/dist/chunk-AT53ZQUC.js.map +0 -1
  189. package/dist/chunk-BCY3A62O.cjs.map +0 -1
  190. package/dist/chunk-BHL7TAQO.js.map +0 -1
  191. package/dist/chunk-DBD4BCGH.cjs.map +0 -1
  192. package/dist/chunk-E62W5I6A.cjs.map +0 -1
  193. package/dist/chunk-H5KHWTAE.js.map +0 -1
  194. package/dist/chunk-HTDKEYMY.cjs.map +0 -1
  195. package/dist/chunk-KL6GAYTT.js.map +0 -1
  196. package/dist/chunk-KSHAAPQF.cjs.map +0 -1
  197. package/dist/chunk-MVXZP6VB.js.map +0 -1
  198. package/dist/chunk-PAUWEWTY.js.map +0 -1
  199. package/dist/chunk-PGDR7CO3.cjs.map +0 -1
  200. package/dist/chunk-PJAJCFLP.cjs.map +0 -1
  201. package/dist/chunk-SCDE676D.js.map +0 -1
  202. package/dist/chunk-V24EPI5N.cjs.map +0 -1
  203. package/dist/chunk-V6OXSXIX.js.map +0 -1
  204. package/dist/chunk-VBP4DH37.js.map +0 -1
  205. package/dist/chunk-XNJDAW3M.js.map +0 -1
@@ -15,7 +15,12 @@ import {
15
15
  getLlmModalityCaps,
16
16
  VIDEO_ANALYSIS_LLM_MODELS,
17
17
  VIDEO_ANALYSIS_TIERS,
18
+ VIDEO_ANALYSIS_LEGACY_MODELS,
18
19
  resolveVideoAnalysisModel,
20
+ LLM_NODE_ONLY_MEDIA_MODELS,
21
+ readsMediaOnLlmNodesOnly,
22
+ readsVideoOutsideLlmNodes,
23
+ readsAudioOutsideLlmNodes,
19
24
  buildLlmCreditIdentifier,
20
25
  resolveLlmCreditId,
21
26
  motionGraphicsFeature,
@@ -41,6 +46,7 @@ import {
41
46
  LLM_REFERENCE_FILES_MAX_PAGES,
42
47
  LLM_REFERENCE_FILE_MIME_TYPES,
43
48
  llmAcceptsFiles,
49
+ llmFileWire,
44
50
  } from "../llm-models.js"
45
51
  import type { LlmModelDef, LlmTier, LlmFeature } from "../llm-models.js"
46
52
  import { PIPELINE_ACCEPTED_SCRIPT_LLMS, PIPELINE_LEGACY_PINNED_SCRIPT_LLMS, PIPELINE_PINNABLE_SCRIPT_LLMS, PipelineConfigSchema } from "../pipeline-types.js"
@@ -66,6 +72,7 @@ const EXPECTED_MODEL_IDS = [
66
72
  "gemini-3.1-pro",
67
73
  "gemini-4-argon",
68
74
  "gemini-4-carbon",
75
+ "gemini-4-hydrogen",
69
76
  "claude-opus-4.7",
70
77
  "gpt-5.4",
71
78
  "gpt-5.5",
@@ -132,14 +139,14 @@ describe("LLM_MODELS data integrity", () => {
132
139
  expect(new Set(ids).size).toBe(ids.length)
133
140
  })
134
141
 
135
- it("has 9 economy, 8 standard, 16 premium models", () => {
142
+ it("has 9 economy, 8 standard, 17 premium models", () => {
136
143
  const tierCounts: Record<LlmTier, number> = { economy: 0, standard: 0, premium: 0 }
137
144
  for (const model of LLM_MODELS) {
138
145
  tierCounts[model.tier]++
139
146
  }
140
147
  expect(tierCounts.economy).toBe(9)
141
148
  expect(tierCounts.standard).toBe(8)
142
- expect(tierCounts.premium).toBe(16)
149
+ expect(tierCounts.premium).toBe(17)
143
150
  })
144
151
 
145
152
  it("all three kieFormats are represented", () => {
@@ -1136,6 +1143,122 @@ describe("gemini-4-carbon exposure", () => {
1136
1143
  })
1137
1144
  })
1138
1145
 
1146
+ // ---------------------------------------------------------------------------
1147
+ // 2026-11-16 addition: Gemini 4 Hydrogen (KIE lane and Google lane probed that
1148
+ // day). Carbon's lane shape, with an xhigh level on both lanes.
1149
+ // ---------------------------------------------------------------------------
1150
+ describe("gemini-4-hydrogen exposure", () => {
1151
+ it("premium Gemini, KIE first with Google's own API as the fallback — never direct-only or direct-first", () => {
1152
+ const m = getLlmModel("gemini-4-hydrogen")!
1153
+ expect(m.displayName).toBe("Gemini 4 Hydrogen")
1154
+ expect(m.series).toBe("Gemini")
1155
+ expect(m.tier).toBe("premium")
1156
+ expect(m.vendor).toBe("google")
1157
+ expect(m.kieFormat).toBe("chat-completions")
1158
+ expect(m.kieSlugOrModel).toBe("gemini-4-hydrogen-openai")
1159
+ expect(m.directGeminiModel).toBe("gemini-4-hydrogen")
1160
+ expect(m.directOnly).toBeUndefined()
1161
+ expect(m.preferDirect).toBeUndefined()
1162
+ expect(supportsAdvancedMode("gemini-4-hydrogen")).toBe(true)
1163
+ // Only Advanced mode moves it to Google's API — no effort does.
1164
+ expect(llmServesDirect("gemini-4-hydrogen")).toBe(false)
1165
+ expect(llmServesDirect("gemini-4-hydrogen", "xhigh")).toBe(false)
1166
+ expect(llmServesDirect("gemini-4-hydrogen", undefined, true)).toBe(true)
1167
+ })
1168
+
1169
+ it("declares NO trusted structured mode, only the response_format hint — callers parse and re-ask", () => {
1170
+ const m = getLlmModel("gemini-4-hydrogen")!
1171
+ expect(m.structuredOutputMode).toBeUndefined()
1172
+ expect(m.structuredOutputHint).toBe("kie-response-format")
1173
+ expect(STRUCTURED_VISION_MODELS.map((x) => x.id)).not.toContain("gemini-4-hydrogen")
1174
+ expect(DESCRIBE_TO_PICKER_MODELS.map((x) => x.id)).not.toContain("gemini-4-hydrogen")
1175
+ })
1176
+
1177
+ it("offers low / medium / high / xhigh on both lanes — `none` runs at Auto, `max` clamps to xhigh", () => {
1178
+ expect(availableReasoningEfforts("gemini-4-hydrogen")).toEqual(["low", "medium", "high", "xhigh"])
1179
+ expect(availableReasoningEfforts("gemini-4-hydrogen", true)).toEqual(["low", "medium", "high", "xhigh"])
1180
+ for (const advanced of [false, true]) {
1181
+ expect(effectiveReasoningEffort("gemini-4-hydrogen", "none", advanced)).toBeUndefined()
1182
+ expect(effectiveReasoningEffort("gemini-4-hydrogen", "max", advanced)).toBe("xhigh")
1183
+ expect(effectiveReasoningEffort("gemini-4-hydrogen", "xhigh", advanced)).toBe("xhigh")
1184
+ expect(effectiveReasoningEffort("gemini-4-hydrogen", "medium", advanced)).toBe("medium")
1185
+ }
1186
+ expect(getLlmModel("gemini-4-hydrogen")?.effortBelowLowestSendsLowest).toBeUndefined()
1187
+ })
1188
+
1189
+ it("takes XHIGH on Google's API (`directXhighThinking`)", () => {
1190
+ expect(getLlmModel("gemini-4-hydrogen")?.directXhighThinking).toBe(true)
1191
+ })
1192
+
1193
+ it("reasons by default, floored at the default 32768 on the registry's usual 16384 cap", () => {
1194
+ const m = getLlmModel("gemini-4-hydrogen")!
1195
+ expect(m.thinkingDefaultOn).toBe(true)
1196
+ expect(m.reasoningOutputFloor).toBeUndefined()
1197
+ expect(reasoningOutputFloor(m)).toBe(REASONING_OUTPUT_FLOOR)
1198
+ expect(m.maxOutputTokens).toBe(16384)
1199
+ })
1200
+
1201
+ it("resolves by its id and its KIE slug, and backs no feature default", () => {
1202
+ expect(getLlmModel("gemini-4-hydrogen-openai")?.id).toBe("gemini-4-hydrogen")
1203
+ expect(Object.values(LLM_FEATURE_DEFAULTS)).not.toContain("gemini-4-hydrogen")
1204
+ expect(getLlmTier("gemini-4-hydrogen")).toBe("premium")
1205
+ })
1206
+
1207
+ it("reads images, video, audio and PDF files on the LLM nodes (decided 2026-11-16 and 2026-11-17)", () => {
1208
+ expect(getLlmModalityCaps("gemini-4-hydrogen")).toEqual({ image: true, video: true, audio: true, file: true })
1209
+ expect(llmAcceptsFiles("gemini-4-hydrogen")).toBe(true)
1210
+ // The shape probed on its aggregator lane (2026-11-17), and an inline part on Google's own API.
1211
+ expect(llmFileWire("gemini-4-hydrogen")).toEqual({ kie: "image-url", direct: "inline-data" })
1212
+ })
1213
+
1214
+ it("the file cap enrols it in nothing outside the LLM nodes", () => {
1215
+ expect(VIDEO_ANALYSIS_LLM_MODELS).not.toContain("gemini-4-hydrogen")
1216
+ expect(readsVideoOutsideLlmNodes("gemini-4-hydrogen")).toBe(false)
1217
+ expect(readsAudioOutsideLlmNodes("gemini-4-hydrogen")).toBe(false)
1218
+ })
1219
+
1220
+ it("its media caps are for the LLM nodes only: no Video Analysis list, tier, legacy row or passthrough", () => {
1221
+ expect(LLM_NODE_ONLY_MEDIA_MODELS).toEqual(["gemini-4-hydrogen"])
1222
+ expect(readsMediaOnLlmNodesOnly("gemini-4-hydrogen")).toBe(true)
1223
+ expect(readsMediaOnLlmNodesOnly("gemini-4-carbon")).toBe(false)
1224
+ expect(readsMediaOnLlmNodesOnly(undefined)).toBe(false)
1225
+ expect(VIDEO_ANALYSIS_LLM_MODELS).not.toContain("gemini-4-hydrogen")
1226
+ expect(Object.values(VIDEO_ANALYSIS_TIERS)).not.toContain("gemini-4-hydrogen")
1227
+ expect(Object.keys(VIDEO_ANALYSIS_LEGACY_MODELS)).not.toContain("gemini-4-hydrogen")
1228
+ // A stored raw `llmModel: "gemini-4-hydrogen"` on a Video Analysis node is
1229
+ // not passed through: it resolves like any unknown value.
1230
+ expect(resolveVideoAnalysisModel("gemini-4-hydrogen")).toBe(resolveVideoAnalysisModel("not-a-model"))
1231
+ })
1232
+
1233
+ it("reads no video or audio outside the LLM nodes (readsVideoOutsideLlmNodes / readsAudioOutsideLlmNodes); Carbon does", () => {
1234
+ expect(readsVideoOutsideLlmNodes("gemini-4-hydrogen")).toBe(false)
1235
+ expect(readsAudioOutsideLlmNodes("gemini-4-hydrogen")).toBe(false)
1236
+ expect(readsVideoOutsideLlmNodes("gemini-4-carbon")).toBe(true)
1237
+ expect(readsAudioOutsideLlmNodes("gemini-4-carbon")).toBe(true)
1238
+ expect(readsVideoOutsideLlmNodes("gemini-4-argon")).toBe(false)
1239
+ expect(readsVideoOutsideLlmNodes(undefined)).toBe(false)
1240
+ // The Video Analysis list is exactly the models that read both outside the LLM nodes.
1241
+ expect(VIDEO_ANALYSIS_LLM_MODELS).toEqual(LLM_MODELS.filter((m) => readsVideoOutsideLlmNodes(m.id) && readsAudioOutsideLlmNodes(m.id)).map((m) => m.id))
1242
+ })
1243
+
1244
+ it("every LLM-node-only media model really reads video and audio (else the list is stale)", () => {
1245
+ for (const id of LLM_NODE_ONLY_MEDIA_MODELS) {
1246
+ expect(getLlmModalityCaps(id), id).toMatchObject({ video: true, audio: true })
1247
+ }
1248
+ })
1249
+ })
1250
+
1251
+ describe("directXhighThinking is declared only where the direct lane can send it", () => {
1252
+ it("sits only on a model with a Google lane and an xhigh level on that lane's ladder", () => {
1253
+ const declared = LLM_MODELS.filter((m) => m.directXhighThinking)
1254
+ expect(declared.map((m) => m.id)).toEqual(["gemini-4-hydrogen"])
1255
+ for (const m of declared) {
1256
+ expect(m.directGeminiModel, m.id).toBeTruthy()
1257
+ expect(availableReasoningEfforts(m.id, true), m.id).toContain("xhigh")
1258
+ }
1259
+ })
1260
+ })
1261
+
1139
1262
  describe("gpt-6.1-terra exposure", () => {
1140
1263
  it("standard GPT-6.1 on the codex responses wire with an enforced schema, KIE only", () => {
1141
1264
  const m = getLlmModel("gpt-6.1-terra")!
@@ -1169,10 +1292,11 @@ describe("gpt-6.1-terra exposure", () => {
1169
1292
  })
1170
1293
 
1171
1294
  describe("the `file` modality cap (documents, decided 2026-11-13)", () => {
1172
- it("is declared on GPT-6.1 Terra alone, and never derived for another model", () => {
1173
- expect(LLM_FILE_MODELS.map((m) => m.id)).toEqual(["gpt-6.1-terra"])
1174
- expect(Object.entries(LLM_MODALITY_CAPS).filter(([, c]) => c.file).map(([id]) => id)).toEqual(["gpt-6.1-terra"])
1175
- for (const m of LLM_MODELS) expect(llmAcceptsFiles(m.id), m.id).toBe(m.id === "gpt-6.1-terra")
1295
+ it("is declared on GPT-6.1 Terra and Gemini 4 Hydrogen, and never derived for another model", () => {
1296
+ const readers = ["gemini-4-hydrogen", "gpt-6.1-terra"]
1297
+ expect(LLM_FILE_MODELS.map((m) => m.id)).toEqual(readers)
1298
+ expect(Object.entries(LLM_MODALITY_CAPS).filter(([, c]) => c.file).map(([id]) => id).sort()).toEqual(readers)
1299
+ for (const m of LLM_MODELS) expect(llmAcceptsFiles(m.id), m.id).toBe(readers.includes(m.id))
1176
1300
  expect(llmAcceptsFiles(undefined)).toBe(false)
1177
1301
  expect(llmAcceptsFiles("no-such-model")).toBe(false)
1178
1302
  // Its siblings on the same endpoint do not read files here.
@@ -1180,6 +1304,39 @@ describe("the `file` modality cap (documents, decided 2026-11-13)", () => {
1180
1304
  expect(llmAcceptsFiles("gpt-5.6-terra")).toBe(false)
1181
1305
  })
1182
1306
 
1307
+ // Every declaration, by model. A shape is never derived from a model's
1308
+ // dialect: a new model gets a row here only with its own probe, whose date
1309
+ // goes on its registry entry.
1310
+ const FILE_WIRES: Record<string, unknown> = {
1311
+ // Probed 2026-11-13: an inline `input_file` part on the responses dialect.
1312
+ "gpt-6.1-terra": { kie: "input-file" },
1313
+ // Probed 2026-11-17 on both lanes: an `image_url` part on the aggregator's
1314
+ // chat-completions dialect, an inline part on Google's own API.
1315
+ "gemini-4-hydrogen": { kie: "image-url", direct: "inline-data" },
1316
+ }
1317
+
1318
+ it("a model reads files exactly when it is listed with how each of its lanes is sent one (`fileWire`)", () => {
1319
+ for (const m of LLM_MODELS) {
1320
+ expect(m.fileWire, m.id).toEqual(FILE_WIRES[m.id])
1321
+ expect(llmAcceptsFiles(m.id), m.id).toBe(m.id in FILE_WIRES)
1322
+ expect(llmFileWire(m.id), m.id).toEqual(FILE_WIRES[m.id])
1323
+ }
1324
+ expect(Object.keys(FILE_WIRES).sort()).toEqual(LLM_FILE_MODELS.map((m) => m.id).sort())
1325
+ // A sibling on the same dialect has no shape of its own.
1326
+ for (const id of ["gemini-4-carbon", "gemini-4-argon", "gemini-3.8-flash", "gpt-6.1-sol", "gpt-5.6-terra"]) expect(llmFileWire(id), id).toBeUndefined()
1327
+ expect(llmFileWire(undefined)).toBeUndefined()
1328
+ })
1329
+
1330
+ it("a declared shape fits the lanes its model has", () => {
1331
+ for (const m of LLM_FILE_MODELS) {
1332
+ // The aggregator's shape is one its dialect can carry.
1333
+ expect(m.kieFormat, m.id).toBe(m.fileWire!.kie === "input-file" ? "responses" : "chat-completions")
1334
+ // A direct Google lane is declared a shape, and only a model with one has it.
1335
+ expect(Boolean(m.fileWire!.direct), m.id).toBe(Boolean(m.directGeminiModel))
1336
+ expect(m.directFallbackModel, m.id).toBeUndefined()
1337
+ }
1338
+ })
1339
+
1183
1340
  it("PDF only, up to 5 files, 6 MB in all and 100 pages in all", () => {
1184
1341
  expect(LLM_REFERENCE_FILE_MIME_TYPES).toEqual(["application/pdf"])
1185
1342
  expect(LLM_REFERENCE_FILES_MAX).toBe(5)
@@ -176,6 +176,7 @@ describe("effortBelowLowestSendsLowest (Kimi K3 and K3.1 Pro)", () => {
176
176
  expect(effectiveReasoningEffort("gpt-6.1-sol", "none")).toBeUndefined()
177
177
  expect(effectiveReasoningEffort("gpt-6.1-terra", "none")).toBeUndefined()
178
178
  expect(effectiveReasoningEffort("gemini-4-carbon", "none")).toBeUndefined()
179
+ expect(effectiveReasoningEffort("gemini-4-hydrogen", "none")).toBeUndefined()
179
180
  })
180
181
  })
181
182
 
@@ -209,6 +210,7 @@ describe("structured output: a trusted mode vs a schema hint", () => {
209
210
 
210
211
  it("llmSendsSchema: a model that sends its schema (trusted or hinted) counts it; one that sends none does not", () => {
211
212
  expect(llmSendsSchema("gemini-4-carbon")).toBe(true)
213
+ expect(llmSendsSchema("gemini-4-hydrogen")).toBe(true)
212
214
  expect(llmSendsSchema("gpt-6.1-terra")).toBe(true)
213
215
  expect(llmSendsSchema("gpt-5.2")).toBe(false)
214
216
  // Unset model = the feature's default; an unknown model counts it.
@@ -0,0 +1,194 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { MODEL_CATALOG, normalizeVideoRequestParams } from "../model-catalog.js"
3
+ import {
4
+ EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS,
5
+ FRAME_MODE_ADAPTIVE_ONLY_ASPECT,
6
+ IMAGE_TO_VIDEO_PROVIDERS,
7
+ LIP_SYNC_PROVIDERS,
8
+ NATIVE_ADAPTIVE_ASPECT,
9
+ PRICING_DEFAULT_RESOLUTION,
10
+ PROMPT_HARD_CEILING,
11
+ SEEDANCE_2_5_FLASH_REF_LIMITS,
12
+ SEEDANCE_LIP_SYNC_PROVIDERS,
13
+ TEXT_TO_VIDEO_PROVIDERS,
14
+ VIDEO_DURATION_TIERS,
15
+ VIDEO_REF_AUDIO_RULES,
16
+ VIDEO_REF_LIMITS_BY_PROVIDER,
17
+ VIDEO_REF_VIDEO_DURATION_LIMITS,
18
+ VIDEO_TO_VIDEO_NODE_PROVIDERS,
19
+ billsReferenceVideoSeconds,
20
+ checkRefAudioRules,
21
+ getMaxVideoPromptChars,
22
+ isEditVideoProProvider,
23
+ isSeedance2Provider,
24
+ isSeedanceVideoEditProvider,
25
+ editVideoProProviderRefusal,
26
+ seedance2AudioLimitSec,
27
+ trimVideoReferencesToLimits,
28
+ videoReferencesOverLimitProblem,
29
+ supportsAutoVideoDuration,
30
+ } from "../model-constants.js"
31
+ import { SEEDANCE_DRAFT_MODELS, isSeedanceDraftCapable } from "../seedance-draft.js"
32
+ import { buildVideoCreditModelIdentifier } from "../credit-identifiers.js"
33
+
34
+ const ID = "seedance-2-5-flash"
35
+
36
+ /**
37
+ * Seedance 2.5 Flash — the fast tier of Seedance 2.5, from its own KIE schema
38
+ * (docs.kie.ai/market/bytedance/seedance-2-5-flash). Its id EXTENDS
39
+ * `seedance-2-5`, so every family set and prefix match is pinned here: it
40
+ * shares the family's behaviour, never 2.5's own facts (1080p, 30/10/10
41
+ * references, the 30000-char prompt, draft and the HD finalize).
42
+ */
43
+ describe("seedance-2-5-flash catalog", () => {
44
+ it("is a ByteDance video model beside Seedance 2.5, with its own label", () => {
45
+ const m = MODEL_CATALOG[ID]!
46
+ expect(m.kind).toBe("video")
47
+ expect(m.label).toBe("Seedance 2.5 Flash")
48
+ expect(m.maker).toBe("bytedance")
49
+ expect(m.modes).toEqual(["i2v", "t2v", "v2v"])
50
+ expect(m.noSeed).toBe(true)
51
+ expect(m.referenceTaskTypes).toEqual(["reference", "edit", "extend"])
52
+ })
53
+
54
+ it("is 480p/720p only — never Seedance 2.5's 1080p — and defaults to 720p for pricing", () => {
55
+ expect(MODEL_CATALOG[ID]!.resolutions).toEqual(["480p", "720p"])
56
+ expect(PRICING_DEFAULT_RESOLUTION[ID]).toBe("720p")
57
+ // A stale 1080p (copied from a 2.5 node) is moved before it is priced or sent.
58
+ expect(normalizeVideoRequestParams(ID, { resolution: "1080p" }).resolution).toBe("720p")
59
+ })
60
+
61
+ it("runs 4-30s, one price tier per second, and takes Auto length", () => {
62
+ const d = MODEL_CATALOG[ID]!.durations!
63
+ expect(d[0]).toBe(4)
64
+ expect(d[d.length - 1]).toBe(30)
65
+ expect(d).toHaveLength(27)
66
+ expect(MODEL_CATALOG[ID]!.defaultDuration).toBe(8)
67
+ expect(VIDEO_DURATION_TIERS[ID]).toHaveLength(27)
68
+ expect(supportsAutoVideoDuration(ID)).toBe(true)
69
+ })
70
+
71
+ it("takes 10 images / 5 videos / 5 audio references — not 2.5's 30/10/10, not the 2.0 family's 9/3/3", () => {
72
+ expect(SEEDANCE_2_5_FLASH_REF_LIMITS).toEqual({ images: 10, videos: 5, audio: 5 })
73
+ expect(VIDEO_REF_LIMITS_BY_PROVIDER[ID]).toEqual({ images: 10, videos: 5, audio: 5, requestRefusesOverLimit: true })
74
+ expect(VIDEO_REF_VIDEO_DURATION_LIMITS[ID]).toEqual({ minSec: 2, maxSec: 30, maxTotalSec: 30 })
75
+ expect(seedance2AudioLimitSec(ID)).toBe(30)
76
+ })
77
+
78
+ it("converts reference audio that is not WAV or MP3 (never refused for its format), and refuses a clip outside 2-30s or more than 30s together", () => {
79
+ expect(VIDEO_REF_AUDIO_RULES[ID]).toEqual({ formats: ["wav", "mp3"], convertsTo: "mp3", minSec: 2, maxSec: 30, maxTotalSec: 30 })
80
+ expect(VIDEO_REF_AUDIO_RULES["seedance-2-5"]).toBeUndefined()
81
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 5 }])).toEqual({ ok: true })
82
+ expect(checkRefAudioRules(ID, [{ formatNames: ["wav"], durationSec: 5 }])).toEqual({ ok: true })
83
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mov", "mp4", "m4a"], durationSec: 5 }])).toEqual({ ok: true })
84
+ expect(checkRefAudioRules(ID, [{ formatNames: ["ogg"], durationSec: 5 }])).toEqual({ ok: true })
85
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 1.5 }])).toMatchObject({ ok: false, code: "audio_too_short" })
86
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 31 }])).toMatchObject({ ok: false, code: "audio_too_long" })
87
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 20 }, { formatNames: ["m4a"], durationSec: 11 }])).toMatchObject({ ok: false, code: "audio_total_too_long" })
88
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 15 }, { formatNames: ["m4a"], durationSec: 15 }])).toEqual({ ok: true })
89
+ // A rule without the conversion still refuses the format (Vidu Q4).
90
+ expect(checkRefAudioRules("vidu-q4", [{ formatNames: ["wav"], durationSec: 5 }])).toMatchObject({ ok: false, code: "audio_format_unsupported" })
91
+ })
92
+
93
+ it("forces adaptive aspect on frame requests (documented for Flash)", () => {
94
+ expect(FRAME_MODE_ADAPTIVE_ONLY_ASPECT.has(ID)).toBe(true)
95
+ expect(NATIVE_ADAPTIVE_ASPECT[ID]).toBe("adaptive")
96
+ })
97
+
98
+ it("keeps its own 20480-char prompt limit, under the route ceiling", () => {
99
+ expect(getMaxVideoPromptChars(ID)).toBe(20480)
100
+ expect(getMaxVideoPromptChars("seedance-2-5")).toBe(30000)
101
+ expect(PROMPT_HARD_CEILING).toBeGreaterThanOrEqual(20480)
102
+ })
103
+ })
104
+
105
+ describe("seedance-2-5-flash — the family it joins, and what it never inherits", () => {
106
+ it("joins the Seedance 2 family, reference-video billing, the edit lane and the lip-sync menu", () => {
107
+ expect(isSeedance2Provider(ID)).toBe(true)
108
+ expect(billsReferenceVideoSeconds(ID)).toBe(true)
109
+ expect(isSeedanceVideoEditProvider(ID)).toBe(true)
110
+ expect((VIDEO_TO_VIDEO_NODE_PROVIDERS as readonly string[]).includes(ID)).toBe(true)
111
+ expect((LIP_SYNC_PROVIDERS as readonly string[]).includes(ID)).toBe(true)
112
+ expect(SEEDANCE_LIP_SYNC_PROVIDERS.has(ID)).toBe(true)
113
+ })
114
+
115
+ it("is on both route provider lists (it runs from text and from a frame)", () => {
116
+ expect((TEXT_TO_VIDEO_PROVIDERS as readonly string[]).includes(ID)).toBe(true)
117
+ expect((IMAGE_TO_VIDEO_PROVIDERS as readonly string[]).includes(ID)).toBe(true)
118
+ })
119
+
120
+ it("has no draft mode and no HD finalize", () => {
121
+ expect(isSeedanceDraftCapable(ID)).toBe(false)
122
+ expect(SEEDANCE_DRAFT_MODELS as readonly string[]).not.toContain(ID)
123
+ // A draft flag on a Flash request is ignored: priced and sent at the resolution asked.
124
+ expect(normalizeVideoRequestParams(ID, { resolution: "720p", draft: true }).resolution).toBe("720p")
125
+ })
126
+
127
+ it("is held back from Edit Video Pro (a separate decision); the rest of the family is not", () => {
128
+ expect(EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS.has(ID)).toBe(true)
129
+ expect(isEditVideoProProvider(ID)).toBe(false)
130
+ for (const p of ["seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5"]) {
131
+ expect(isEditVideoProProvider(p), p).toBe(true)
132
+ }
133
+ })
134
+ })
135
+
136
+ describe("seedance-2-5-flash pricing identifiers", () => {
137
+ const build = (duration?: number, resolution?: string, hasVideoRef?: boolean) =>
138
+ buildVideoCreditModelIdentifier(ID, duration, undefined, undefined, undefined, resolution, hasVideoRef)
139
+
140
+ it("prices its own rows, never Seedance 2.5's", () => {
141
+ expect(build(8, "720p")).toBe("seedance-2-5-flash:8s:720p")
142
+ expect(build(23, "480p")).toBe("seedance-2-5-flash:23s:480p")
143
+ expect(build(8, "720p", true)).toBe("seedance-2-5-flash:8s:720p-ref")
144
+ })
145
+
146
+ it("prices an omitted resolution at 720p and clamps 1080p / 4k to 720p — no 1080p row exists", () => {
147
+ expect(build(8)).toBe("seedance-2-5-flash:8s:720p")
148
+ expect(build(8, "1080p")).toBe("seedance-2-5-flash:8s:720p")
149
+ expect(build(8, "4k", true)).toBe("seedance-2-5-flash:8s:720p-ref")
150
+ })
151
+
152
+ it("resolves every duration x resolution x ref-mode to its own id (108 in all)", () => {
153
+ const seen = new Set<string>()
154
+ for (const d of MODEL_CATALOG[ID]!.durations!) {
155
+ for (const res of ["480p", "720p"]) {
156
+ for (const ref of [false, true]) {
157
+ const id = build(d, res, ref)
158
+ expect(id).toBe(`${ID}:${d}s:${res}${ref ? "-ref" : ""}`)
159
+ seen.add(id)
160
+ }
161
+ }
162
+ }
163
+ expect(seen.size).toBe(108)
164
+ })
165
+ })
166
+
167
+ describe("seedance-2-5-flash — too many references (decided 2026-11-16)", () => {
168
+ it("a direct request over 10 / 5 / 5 is refused with the limit named; a frame counts toward the images once a reference is sent", () => {
169
+ expect(videoReferencesOverLimitProblem(ID, { images: 10, videos: 5, audio: 5 })).toBeUndefined()
170
+ expect(videoReferencesOverLimitProblem(ID, { images: 11, videos: 0, audio: 0 })).toMatch(/at most 10 reference images; this request sends 11\. Remove 1\./)
171
+ expect(videoReferencesOverLimitProblem(ID, { images: 0, videos: 6, audio: 0 })).toMatch(/at most 5 reference videos/)
172
+ expect(videoReferencesOverLimitProblem(ID, { images: 0, videos: 0, audio: 6 })).toMatch(/at most 5 reference audio clips/)
173
+ expect(videoReferencesOverLimitProblem(ID, { images: 10, videos: 0, audio: 0, frames: 1 })).toMatch(/sends 11/)
174
+ // Frames alone (no reference) are frames, not references.
175
+ expect(videoReferencesOverLimitProblem(ID, { images: 0, videos: 0, audio: 0, frames: 2 })).toBeUndefined()
176
+ })
177
+
178
+ it("every other model keeps the provider's trim (nothing refused here)", () => {
179
+ for (const p of ["seedance-2", "seedance-2-5", "kling-4", "wan-3"]) {
180
+ expect(videoReferencesOverLimitProblem(p, { images: 99, videos: 99, audio: 99 }), p).toBeUndefined()
181
+ }
182
+ })
183
+
184
+ it("the editor's Run sends the first references up to the caps, less the frames that join the images", () => {
185
+ const n = (k: number) => Array.from({ length: k }, (_, i) => `u${i}`)
186
+ expect(trimVideoReferencesToLimits(ID, { images: n(12), videos: n(7), audio: n(6), frames: 1 })).toEqual({ images: n(9), videos: n(5), audio: n(5) })
187
+ expect(trimVideoReferencesToLimits("seedance-2-5", { images: n(40), videos: n(12) })).toEqual({ images: n(40), videos: n(12), audio: undefined })
188
+ })
189
+
190
+ it("Edit Video Pro refuses Flash with one sentence, and offers the rest of the family", () => {
191
+ expect(editVideoProProviderRefusal(ID)).toBe("seedance-2-5-flash is not offered on Edit Video Pro. Pick another Edit Video Pro model.")
192
+ for (const p of ["seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5"]) expect(editVideoProProviderRefusal(p), p).toBeUndefined()
193
+ })
194
+ })
@@ -10,6 +10,9 @@ import {
10
10
  sunoSeparateCreditId,
11
11
  sunoSeparateHandleUrl,
12
12
  sunoSeparatePrimaryUrl,
13
+ SUNO_SEPARATE_ID_FIELDS,
14
+ sunoSeparateHandleField,
15
+ sunoSeparateHandleIds,
13
16
  } from "../entries/models.js"
14
17
 
15
18
  describe("sunoSeparateCreditId", () => {
@@ -76,3 +79,32 @@ it("sunoSeparatePrimaryUrl", () => {
76
79
  expect(sunoSeparatePrimaryUrl({ isolatedUrl: "I", withoutUrl: "W" })).toBe("I")
77
80
  expect(sunoSeparatePrimaryUrl({ drumsUrl: "D" })).toBe("D")
78
81
  })
82
+
83
+ describe("sunoSeparateHandleIds — the Suno ids of the stem behind a handle", () => {
84
+ const out = {
85
+ sunoTaskId: "sep-task",
86
+ vocalUrl: "https://cdn/v.mp3",
87
+ instrumentalUrl: "https://cdn/i.mp3",
88
+ isolatedUrl: "https://cdn/x.mp3",
89
+ withoutUrl: "https://cdn/w.mp3",
90
+ sunoStemIds: { vocalUrl: "id-v", instrumentalUrl: "id-i", isolatedUrl: "id-x", withoutUrl: "id-w" },
91
+ }
92
+
93
+ it.each([
94
+ ["vocals", "id-v"], ["vocal-out", "id-v"], ["instrumental", "id-i"], ["instrumental-out", "id-i"],
95
+ ["isolated", "id-x"], ["without", "id-w"], [undefined, "id-v"],
96
+ ])("%s → %s", (handle, audioId) => {
97
+ expect(sunoSeparateHandleIds(out, handle)).toStrictEqual({ taskId: "sep-task", audioId })
98
+ })
99
+
100
+ it("no task id, no stem ids (a Demucs or cloud run, an older output), or no id for that stem: none", () => {
101
+ expect(sunoSeparateHandleIds({ ...out, sunoTaskId: undefined }, "vocals")).toBeUndefined()
102
+ expect(sunoSeparateHandleIds({ ...out, sunoStemIds: undefined }, "vocals")).toBeUndefined()
103
+ expect(sunoSeparateHandleIds({ ...out, sunoStemIds: { vocalUrl: "id-v" } }, "instrumental")).toBeUndefined()
104
+ })
105
+
106
+ it("the primary handle follows the primary stem", () => {
107
+ expect(sunoSeparateHandleField({ drumsUrl: "https://cdn/d.mp3" }, undefined)).toBe("drumsUrl")
108
+ expect(SUNO_SEPARATE_ID_FIELDS).toEqual(["sunoTaskId", "sunoStemIds"])
109
+ })
110
+ })
@@ -25,6 +25,7 @@ describe("character reference capability (data-driven)", () => {
25
25
  it("both Gemini Omni SKUs declare a 3-character cap, Kling 4.0 and Kling 4.0 Flash a 7-subject cap; nothing else does", () => {
26
26
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-video"]?.characters).toBe(3)
27
27
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-flash"]?.characters).toBe(3)
28
+ expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-flash-1-2"]?.characters).toBe(2)
28
29
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4"]?.characters).toBe(7)
29
30
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4-flash"]?.characters).toBe(7)
30
31
  const others = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER)
@@ -114,6 +115,53 @@ describe("videoCharacterRefProblem", () => {
114
115
  expect(over?.message).toContain("7")
115
116
  })
116
117
 
118
+ describe("Gemini Omni Flash 1.2 (characters outside the image budget, decided 2026-11-17)", () => {
119
+ const omni12 = { ...base, provider: "gemini-omni-flash-1-2" }
120
+
121
+ it("is the only model whose characters sit outside its budget, and it takes no voices", () => {
122
+ const outside = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER).filter(([, l]) => l?.charactersOutsideImageBudget).map(([id]) => id)
123
+ expect(outside).toEqual(["gemini-omni-flash-1-2"])
124
+ expect(videoCharacterRefCap("gemini-omni-flash-1-2")).toBe(2)
125
+ expect(videoCharacterVoiceCap("gemini-omni-flash-1-2")).toBe(0)
126
+ })
127
+
128
+ it("takes 1 or 2 characters beside a full image list and a source video — they count toward no quota", () => {
129
+ expect(videoCharacterRefProblem({ ...omni12, characterReferences: [portrait()] })).toBeNull()
130
+ expect(videoCharacterRefProblem({ ...omni12, imageCount: 6, characterReferences: [portrait(), portrait()] })).toBeNull()
131
+ const withBody = portrait({ bodyImageUrl: "https://cdn.example/b.png" })
132
+ expect(videoCharacterRefProblem({ ...omni12, imageCount: 5, videoCount: 1, characterReferences: [withBody, withBody] })).toBeNull()
133
+ })
134
+
135
+ it("a third character is over its limit, as on 1.1", () => {
136
+ const p = videoCharacterRefProblem({ ...omni12, characterReferences: [portrait(), portrait(), portrait()] })
137
+ expect(p?.code).toBe("character_references_over_limit")
138
+ expect(p?.message).toContain("at most 2")
139
+ })
140
+
141
+ it("a start or end frame beside characters is refused with the same codes as 1.1, worded as what the platform does, not a budget", () => {
142
+ const start = videoCharacterRefProblem({ ...omni12, hasStartFrame: true, characterReferences: [portrait()] })
143
+ expect(start?.code).toBe("character_references_with_start_frame")
144
+ expect(start?.message).not.toContain("compete for the same input slots")
145
+ expect(start?.message).toContain("imageUrl")
146
+ const end = videoCharacterRefProblem({ ...omni12, hasEndFrame: true, characterReferences: [portrait()] })
147
+ expect(end?.code).toBe("character_references_with_end_frame")
148
+ })
149
+
150
+ it("a pinned voice is refused, naming the models that take one", () => {
151
+ const p = videoCharacterRefProblem({ ...omni12, characterReferences: [portrait({ voice: { preset: "kore" } })] })
152
+ expect(p?.code).toBe("character_voice_unsupported")
153
+ expect(p?.message).toContain("gemini-omni-video, gemini-omni-flash.")
154
+ expect(p?.message).toMatch(/takes one: gemini-omni-video, gemini-omni-flash\.$/)
155
+ })
156
+
157
+ it("1.1 keeps its 7-unit budget and its own start-frame sentence", () => {
158
+ const p = videoCharacterRefProblem({ ...base, provider: "gemini-omni-flash", imageCount: 5, characterReferences: [portrait(), portrait(), portrait()] })
159
+ expect(p?.code).toBe("character_references_quota")
160
+ const start = videoCharacterRefProblem({ ...base, provider: "gemini-omni-flash", hasStartFrame: true, characterReferences: [portrait()] })
161
+ expect(start?.message).toContain("compete for the same input slots")
162
+ })
163
+ })
164
+
117
165
  it("a body image costs a second unit in the quota", () => {
118
166
  const withBody = portrait({ bodyImageUrl: "https://cdn.example/b.png" })
119
167
  // 2 body-sets (4) + 3 images = 7 → ok; + 1 more image = 8 → rejected