@nodaro/shared 3.67.0 → 3.69.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 (202) hide show
  1. package/dist/{chunk-T4GIHHXY.cjs → chunk-25C2E2GI.cjs} +6 -6
  2. package/dist/{chunk-T4GIHHXY.cjs.map → chunk-25C2E2GI.cjs.map} +1 -1
  3. package/dist/{chunk-OXTF4Y3P.cjs → chunk-3AB3YIFM.cjs} +6 -6
  4. package/dist/{chunk-OXTF4Y3P.cjs.map → chunk-3AB3YIFM.cjs.map} +1 -1
  5. package/dist/{chunk-23IKLMRL.cjs → chunk-3OHRFSQL.cjs} +53 -51
  6. package/dist/{chunk-23IKLMRL.cjs.map → chunk-3OHRFSQL.cjs.map} +1 -1
  7. package/dist/{chunk-GNLA5NTT.cjs → chunk-4IMEJQVQ.cjs} +4 -4
  8. package/dist/{chunk-GNLA5NTT.cjs.map → chunk-4IMEJQVQ.cjs.map} +1 -1
  9. package/dist/{chunk-JTYCJ5OL.cjs → chunk-54E2JO4E.cjs} +100 -33
  10. package/dist/chunk-54E2JO4E.cjs.map +1 -0
  11. package/dist/{chunk-HTDKEYMY.cjs → chunk-5EQRIUGI.cjs} +139 -91
  12. package/dist/chunk-5EQRIUGI.cjs.map +1 -0
  13. package/dist/{chunk-AT53ZQUC.js → chunk-5WHU7CYE.js} +3 -3
  14. package/dist/{chunk-AT53ZQUC.js.map → chunk-5WHU7CYE.js.map} +1 -1
  15. package/dist/{chunk-BNR5FKL5.js → chunk-5ZCZL73I.js} +3 -3
  16. package/dist/{chunk-BNR5FKL5.js.map → chunk-5ZCZL73I.js.map} +1 -1
  17. package/dist/{chunk-6FQBKI2A.cjs → chunk-6JSYNKFL.cjs} +4 -4
  18. package/dist/{chunk-6FQBKI2A.cjs.map → chunk-6JSYNKFL.cjs.map} +1 -1
  19. package/dist/{chunk-WZG6GZIL.cjs → chunk-6QJHSN6J.cjs} +4 -4
  20. package/dist/{chunk-WZG6GZIL.cjs.map → chunk-6QJHSN6J.cjs.map} +1 -1
  21. package/dist/{chunk-OFQ6CU6S.js → chunk-7EQJIGVT.js} +3 -3
  22. package/dist/{chunk-OFQ6CU6S.js.map → chunk-7EQJIGVT.js.map} +1 -1
  23. package/dist/{chunk-XEPKONJC.js → chunk-7OSUEYZ4.js} +3 -3
  24. package/dist/{chunk-XEPKONJC.js.map → chunk-7OSUEYZ4.js.map} +1 -1
  25. package/dist/{chunk-3L7GMQ4M.cjs → chunk-7PC2YHBN.cjs} +54 -49
  26. package/dist/chunk-7PC2YHBN.cjs.map +1 -0
  27. package/dist/{chunk-BMDOPJBP.cjs → chunk-AGIG5HUU.cjs} +17 -17
  28. package/dist/{chunk-BMDOPJBP.cjs.map → chunk-AGIG5HUU.cjs.map} +1 -1
  29. package/dist/{chunk-5LWYX4GV.js → chunk-AH6OQXLW.js} +3 -3
  30. package/dist/{chunk-5LWYX4GV.js.map → chunk-AH6OQXLW.js.map} +1 -1
  31. package/dist/{chunk-RVQW623D.js → chunk-BDW25A7Y.js} +72 -18
  32. package/dist/chunk-BDW25A7Y.js.map +1 -0
  33. package/dist/{chunk-5J2LIQYU.js → chunk-DE55SA2X.js} +5 -5
  34. package/dist/{chunk-5J2LIQYU.js.map → chunk-DE55SA2X.js.map} +1 -1
  35. package/dist/{chunk-VBP4DH37.js → chunk-DNWFFVC6.js} +130 -15
  36. package/dist/chunk-DNWFFVC6.js.map +1 -0
  37. package/dist/{chunk-CLAKSLXF.js → chunk-E3PU7YC6.js} +3 -3
  38. package/dist/{chunk-CLAKSLXF.js.map → chunk-E3PU7YC6.js.map} +1 -1
  39. package/dist/{chunk-MVXZP6VB.js → chunk-FUYBUT65.js} +97 -2
  40. package/dist/chunk-FUYBUT65.js.map +1 -0
  41. package/dist/{chunk-SW5ZD7BO.js → chunk-G6AOKNAY.js} +3 -3
  42. package/dist/{chunk-SW5ZD7BO.js.map → chunk-G6AOKNAY.js.map} +1 -1
  43. package/dist/{chunk-EFYWV2V5.cjs → chunk-I6TBKTW3.cjs} +61 -61
  44. package/dist/{chunk-EFYWV2V5.cjs.map → chunk-I6TBKTW3.cjs.map} +1 -1
  45. package/dist/{chunk-3YWZ5SOZ.js → chunk-KLEKJUQI.js} +5 -5
  46. package/dist/{chunk-3YWZ5SOZ.js.map → chunk-KLEKJUQI.js.map} +1 -1
  47. package/dist/{chunk-OXBU5AGH.js → chunk-LSX2OFNB.js} +3 -3
  48. package/dist/{chunk-OXBU5AGH.js.map → chunk-LSX2OFNB.js.map} +1 -1
  49. package/dist/{chunk-66QSUUB4.cjs → chunk-LY6IR5LL.cjs} +12 -12
  50. package/dist/{chunk-66QSUUB4.cjs.map → chunk-LY6IR5LL.cjs.map} +1 -1
  51. package/dist/{chunk-5GG4CG4Y.js → chunk-LZPG4XHT.js} +3 -3
  52. package/dist/{chunk-5GG4CG4Y.js.map → chunk-LZPG4XHT.js.map} +1 -1
  53. package/dist/{chunk-PGDR7CO3.cjs → chunk-MGSGLRHZ.cjs} +8 -8
  54. package/dist/{chunk-PGDR7CO3.cjs.map → chunk-MGSGLRHZ.cjs.map} +1 -1
  55. package/dist/{chunk-Z77M7Q2R.js → chunk-ML55U7WM.js} +3 -3
  56. package/dist/{chunk-Z77M7Q2R.js.map → chunk-ML55U7WM.js.map} +1 -1
  57. package/dist/{chunk-ALRXY4QH.cjs → chunk-N7ZJD4CK.cjs} +6 -2
  58. package/dist/chunk-N7ZJD4CK.cjs.map +1 -0
  59. package/dist/{chunk-O2QOBA6Q.js → chunk-NPGP6FMU.js} +43 -3
  60. package/dist/chunk-NPGP6FMU.js.map +1 -0
  61. package/dist/{chunk-IWUW3YPM.cjs → chunk-NTCSXKZ3.cjs} +5 -5
  62. package/dist/{chunk-IWUW3YPM.cjs.map → chunk-NTCSXKZ3.cjs.map} +1 -1
  63. package/dist/chunk-NWNRATS3.js +13 -0
  64. package/dist/chunk-NWNRATS3.js.map +1 -0
  65. package/dist/{chunk-SCDE676D.js → chunk-OEOOXL3F.js} +65 -23
  66. package/dist/chunk-OEOOXL3F.js.map +1 -0
  67. package/dist/{chunk-GF7ZA26H.js → chunk-OOUJZR4K.js} +4 -4
  68. package/dist/{chunk-GF7ZA26H.js.map → chunk-OOUJZR4K.js.map} +1 -1
  69. package/dist/{chunk-5IZHECUP.js → chunk-OZA4DE23.js} +3 -3
  70. package/dist/{chunk-5IZHECUP.js.map → chunk-OZA4DE23.js.map} +1 -1
  71. package/dist/{chunk-GTBW2KAY.js → chunk-PHQVAPSD.js} +8 -6
  72. package/dist/{chunk-GTBW2KAY.js.map → chunk-PHQVAPSD.js.map} +1 -1
  73. package/dist/{chunk-5NVGKXJV.cjs → chunk-PLANUXQL.cjs} +89 -3
  74. package/dist/chunk-PLANUXQL.cjs.map +1 -0
  75. package/dist/{chunk-ZQ2BHOFH.cjs → chunk-Q2LEJXLZ.cjs} +6 -6
  76. package/dist/{chunk-ZQ2BHOFH.cjs.map → chunk-Q2LEJXLZ.cjs.map} +1 -1
  77. package/dist/{chunk-PJAJCFLP.cjs → chunk-QNPYYSLT.cjs} +168 -44
  78. package/dist/chunk-QNPYYSLT.cjs.map +1 -0
  79. package/dist/{chunk-G2G7XGFU.cjs → chunk-RURPG6IS.cjs} +7 -7
  80. package/dist/{chunk-G2G7XGFU.cjs.map → chunk-RURPG6IS.cjs.map} +1 -1
  81. package/dist/{chunk-PAUWEWTY.js → chunk-TDU45K6Z.js} +12 -7
  82. package/dist/chunk-TDU45K6Z.js.map +1 -0
  83. package/dist/{chunk-X2YHKP4D.cjs → chunk-TWUFC32F.cjs} +8 -8
  84. package/dist/{chunk-X2YHKP4D.cjs.map → chunk-TWUFC32F.cjs.map} +1 -1
  85. package/dist/{chunk-O6TBB4IF.cjs → chunk-TZWXZDSX.cjs} +48 -2
  86. package/dist/chunk-TZWXZDSX.cjs.map +1 -0
  87. package/dist/{chunk-F6XIH3TZ.cjs → chunk-UJREE6EQ.cjs} +9 -9
  88. package/dist/{chunk-F6XIH3TZ.cjs.map → chunk-UJREE6EQ.cjs.map} +1 -1
  89. package/dist/{chunk-CFTXW3ZL.js → chunk-UVUHVY7F.js} +3 -3
  90. package/dist/{chunk-CFTXW3ZL.js.map → chunk-UVUHVY7F.js.map} +1 -1
  91. package/dist/{chunk-37ZSFS6A.cjs → chunk-WML66SUV.cjs} +9 -9
  92. package/dist/{chunk-37ZSFS6A.cjs.map → chunk-WML66SUV.cjs.map} +1 -1
  93. package/dist/{chunk-M5QY464F.cjs → chunk-XZYZYWKG.cjs} +21 -21
  94. package/dist/{chunk-M5QY464F.cjs.map → chunk-XZYZYWKG.cjs.map} +1 -1
  95. package/dist/{chunk-3QJ3UR5Z.js → chunk-YT4ZTJVC.js} +9 -9
  96. package/dist/{chunk-3QJ3UR5Z.js.map → chunk-YT4ZTJVC.js.map} +1 -1
  97. package/dist/{chunk-V6OXSXIX.js → chunk-YVQFYW2U.js} +86 -4
  98. package/dist/chunk-YVQFYW2U.js.map +1 -0
  99. package/dist/{chunk-E62W5I6A.cjs → chunk-ZWEVRMFN.cjs} +97 -2
  100. package/dist/chunk-ZWEVRMFN.cjs.map +1 -0
  101. package/dist/entries/apps.cjs +42 -42
  102. package/dist/entries/apps.js +7 -7
  103. package/dist/entries/credits.cjs +295 -219
  104. package/dist/entries/credits.d.cts +233 -70
  105. package/dist/entries/credits.d.ts +233 -70
  106. package/dist/entries/credits.js +11 -11
  107. package/dist/entries/llm-models.cjs +84 -68
  108. package/dist/entries/llm-models.d.cts +36 -3
  109. package/dist/entries/llm-models.d.ts +36 -3
  110. package/dist/entries/llm-models.js +2 -2
  111. package/dist/entries/media.cjs +111 -107
  112. package/dist/entries/media.d.cts +17 -2
  113. package/dist/entries/media.d.ts +17 -2
  114. package/dist/entries/media.js +3 -3
  115. package/dist/entries/model-catalog.cjs +133 -133
  116. package/dist/entries/model-catalog.js +4 -4
  117. package/dist/entries/models.cjs +433 -397
  118. package/dist/entries/models.d.cts +2 -2
  119. package/dist/entries/models.d.ts +2 -2
  120. package/dist/entries/models.js +8 -8
  121. package/dist/entries/nodes.cjs +212 -212
  122. package/dist/entries/nodes.js +8 -8
  123. package/dist/entries/pipeline.cjs +153 -153
  124. package/dist/entries/pipeline.d.cts +1 -1
  125. package/dist/entries/pipeline.d.ts +1 -1
  126. package/dist/entries/pipeline.js +3 -3
  127. package/dist/entries/runtime-config.cjs +53 -29
  128. package/dist/entries/runtime-config.d.cts +53 -1
  129. package/dist/entries/runtime-config.d.ts +53 -1
  130. package/dist/entries/runtime-config.js +1 -1
  131. package/dist/entries/social.cjs +177 -177
  132. package/dist/entries/social.js +2 -2
  133. package/dist/entries/types.d.cts +12 -5
  134. package/dist/entries/types.d.ts +12 -5
  135. package/dist/entries/ugc.cjs +71 -71
  136. package/dist/entries/ugc.js +4 -4
  137. package/dist/entries/video.cjs +152 -152
  138. package/dist/entries/video.d.cts +2 -1
  139. package/dist/entries/video.d.ts +2 -1
  140. package/dist/entries/video.js +6 -6
  141. package/dist/index.cjs +1882 -1726
  142. package/dist/index.d.cts +5 -5
  143. package/dist/index.d.ts +5 -5
  144. package/dist/index.js +25 -25
  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__/add-captions-nemotron-pricing.test.ts +13 -1
  149. package/src/__tests__/extend-providers.test.ts +43 -6
  150. package/src/__tests__/fixtures/measured-input-quote-parity.json +2352 -1
  151. package/src/__tests__/fixtures/planned-length-quote-parity.json +100 -10
  152. package/src/__tests__/fixtures/probed-node-quote-parity.json +132 -0
  153. package/src/__tests__/fixtures/video-utility-quote-parity.json +945 -38
  154. package/src/__tests__/gemini-omni-extend.test.ts +110 -0
  155. package/src/__tests__/gvp-supported-providers.test.ts +3 -0
  156. package/src/__tests__/llm-models.test.ts +116 -2
  157. package/src/__tests__/llm-price-key.test.ts +2 -0
  158. package/src/__tests__/nemotron-transcribe-pricing.test.ts +32 -0
  159. package/src/__tests__/runtime-config-lists.test.ts +92 -0
  160. package/src/__tests__/seedance-2-5-flash-catalog.test.ts +194 -0
  161. package/src/__tests__/video-character-refs.test.ts +48 -0
  162. package/src/catalog-projection.ts +12 -5
  163. package/src/credit-estimators/add-captions-nemotron.ts +11 -1
  164. package/src/credit-estimators/index.ts +6 -1
  165. package/src/credit-estimators/nemotron-transcribe.ts +35 -3
  166. package/src/credit-estimators/pitch-tempo.ts +14 -0
  167. package/src/credit-estimators/video-sfx.ts +15 -0
  168. package/src/credit-estimators/video-utils.ts +48 -12
  169. package/src/credit-identifiers.ts +51 -32
  170. package/src/entries/credits.ts +18 -0
  171. package/src/entries/llm-models.ts +4 -0
  172. package/src/entries/models.ts +11 -0
  173. package/src/entries/runtime-config.ts +10 -1
  174. package/src/gemini-omni-extend-quote.ts +76 -0
  175. package/src/lip-sync-pricing.ts +16 -1
  176. package/src/llm-models.ts +117 -2
  177. package/src/model-catalog.ts +95 -0
  178. package/src/model-constants.ts +274 -11
  179. package/src/node-default-mappings.ts +2 -0
  180. package/src/priced-clip-seconds.ts +19 -1
  181. package/src/runtime-config/lists.ts +87 -0
  182. package/src/runtime-config/worlds.ts +10 -0
  183. package/src/seedance-extend-rate.ts +83 -20
  184. package/src/seedance-lip-sync.ts +68 -0
  185. package/src/video-character-refs.ts +26 -6
  186. package/dist/chunk-3L7GMQ4M.cjs.map +0 -1
  187. package/dist/chunk-5NVGKXJV.cjs.map +0 -1
  188. package/dist/chunk-ALRXY4QH.cjs.map +0 -1
  189. package/dist/chunk-E62W5I6A.cjs.map +0 -1
  190. package/dist/chunk-HTDKEYMY.cjs.map +0 -1
  191. package/dist/chunk-JTYCJ5OL.cjs.map +0 -1
  192. package/dist/chunk-MVXZP6VB.js.map +0 -1
  193. package/dist/chunk-O2QOBA6Q.js.map +0 -1
  194. package/dist/chunk-O6TBB4IF.cjs.map +0 -1
  195. package/dist/chunk-PAUWEWTY.js.map +0 -1
  196. package/dist/chunk-PJAJCFLP.cjs.map +0 -1
  197. package/dist/chunk-RVQW623D.js.map +0 -1
  198. package/dist/chunk-SCDE676D.js.map +0 -1
  199. package/dist/chunk-SMOO5FAH.js +0 -10
  200. package/dist/chunk-SMOO5FAH.js.map +0 -1
  201. package/dist/chunk-V6OXSXIX.js.map +0 -1
  202. package/dist/chunk-VBP4DH37.js.map +0 -1
@@ -0,0 +1,110 @@
1
+ import { describe, expect, it } from "vitest"
2
+ import {
3
+ EXTEND_VIDEO_PROVIDERS,
4
+ extendHasSoundSwitch,
5
+ getMaxVideoPromptChars,
6
+ isCatalogExtendProvider,
7
+ isSeedanceExtendProvider,
8
+ isTailExtendProvider,
9
+ refVideoAspectProblem,
10
+ } from "../model-constants.js"
11
+ import { MODEL_CATALOG } from "../model-catalog.js"
12
+ import { buildVideoCreditModelIdentifier, tailExtendCreditId, tailExtendResolution } from "../credit-identifiers.js"
13
+ import { geminiOmniExtendQuoteCreditId, parseGeminiOmniExtendQuoteCreditId } from "../gemini-omni-extend-quote.js"
14
+ import { isSeedanceExtendPricedBySecondsSent } from "../seedance-extend-rate.js"
15
+ import * as credits from "../entries/credits.js"
16
+
17
+ const P = "gemini-omni-flash-1-2-extend"
18
+
19
+ describe("Gemini Omni Flash 1.2 Extend: the provider", () => {
20
+ it("is a tail-recipe, catalog extend provider, listed after Kling 4, with no Seedance levers", () => {
21
+ const at = EXTEND_VIDEO_PROVIDERS.indexOf(P)
22
+ expect(EXTEND_VIDEO_PROVIDERS[at - 1]).toBe("kling-4-extend")
23
+ expect(isTailExtendProvider(P)).toBe(true)
24
+ expect(isCatalogExtendProvider(P)).toBe(true)
25
+ expect(isSeedanceExtendProvider(P)).toBe(false)
26
+ expect(extendHasSoundSwitch(P)).toBe(false)
27
+ expect(isSeedanceExtendPricedBySecondsSent(P)).toBe(false)
28
+ })
29
+
30
+ it("offers 3–10 s added at 360p / 720p / 1080p / 4K (default 8 s), made by Google, its default run first", () => {
31
+ const entry = MODEL_CATALOG[P]!
32
+ expect(entry.modes).toEqual(["extend"])
33
+ expect(entry.maker).toBe("google")
34
+ expect(entry.durations).toEqual([3, 4, 5, 6, 7, 8, 9, 10])
35
+ expect(entry.defaultDuration).toBe(8)
36
+ expect(entry.resolutions).toEqual(["360p", "720p", "1080p", "4k"])
37
+ expect(entry.pricing[0]!.identifier).toBe(tailExtendCreditId(P))
38
+ expect(entry.pricing[0]!.identifier).toBe("gemini-omni-flash-1-2-extend:720p:sent-10s:added-8s")
39
+ for (const row of entry.pricing) expect(parseGeminiOmniExtendQuoteCreditId(row.identifier), row.identifier).toBeDefined()
40
+ })
41
+
42
+ it("takes fal's 20000-character prompt; the plain Gemini Omni Flash 1.2 model's reference videos are untouched", () => {
43
+ expect(getMaxVideoPromptChars(P)).toBe(20000)
44
+ expect(refVideoAspectProblem("gemini-omni-flash-1-2", 640, 640)).toBeUndefined()
45
+ })
46
+
47
+ it("prices a resolution it renders as asked, any other at 720p", () => {
48
+ for (const res of ["360p", "720p", "1080p", "4k"]) expect(tailExtendResolution(P, res)).toBe(res)
49
+ for (const other of [undefined, "480p", "540p", "4K", "2160p"]) expect(tailExtendResolution(P, other)).toBe("720p")
50
+ })
51
+ })
52
+
53
+ // The one id of a whole run (decided 2026-11-17): both lengths and the resolution.
54
+ describe("geminiOmniExtendQuoteCreditId", () => {
55
+ it("names the resolution, the seconds sent (the overhang rule, at most 10) and the seconds added", () => {
56
+ expect(geminiOmniExtendQuoteCreditId({ sourcePictureSec: 4.37, duration: 3, resolution: "720p" })).toBe("gemini-omni-flash-1-2-extend:720p:sent-4.37s:added-3s")
57
+ expect(geminiOmniExtendQuoteCreditId({ sourcePictureSec: 4.06, duration: 3, resolution: "720p" })).toBe("gemini-omni-flash-1-2-extend:720p:sent-4s:added-3s")
58
+ expect(geminiOmniExtendQuoteCreditId({ sourcePictureSec: 42, duration: 5, resolution: "4k" })).toBe("gemini-omni-flash-1-2-extend:4k:sent-10s:added-5s")
59
+ })
60
+
61
+ it("an unknown source is the whole 10 s window; no length is 8 s; another resolution is 720p; a length outside 3–10 is held in it", () => {
62
+ expect(geminiOmniExtendQuoteCreditId({})).toBe("gemini-omni-flash-1-2-extend:720p:sent-10s:added-8s")
63
+ expect(geminiOmniExtendQuoteCreditId({ sourcePictureSec: null, duration: "12", resolution: "480p" })).toBe("gemini-omni-flash-1-2-extend:720p:sent-10s:added-10s")
64
+ expect(geminiOmniExtendQuoteCreditId({ sourcePictureSec: -1, duration: 2, resolution: "360p" })).toBe("gemini-omni-flash-1-2-extend:360p:sent-10s:added-3s")
65
+ })
66
+
67
+ it("is what tailExtendCreditId and buildVideoCreditModelIdentifier name for a run on an unknown source", () => {
68
+ expect(tailExtendCreditId(P, 5, "4k")).toBe(geminiOmniExtendQuoteCreditId({ duration: 5, resolution: "4k" }))
69
+ expect(buildVideoCreditModelIdentifier(P, 8, undefined, undefined, undefined, "1080p")).toBe("gemini-omni-flash-1-2-extend:1080p:sent-10s:added-8s")
70
+ })
71
+
72
+ it("uses no character a URL query or an id splitter reads specially", () => {
73
+ const id = geminiOmniExtendQuoteCreditId({ sourcePictureSec: 4.37, duration: 3, resolution: "4k" })
74
+ expect(id).toMatch(/^[a-z0-9.:-]+$/)
75
+ expect(encodeURIComponent(id)).toBe(id.replace(/:/g, "%3A"))
76
+ // Not a `<rate>:<N>u` quote id.
77
+ expect(id.endsWith("u")).toBe(false)
78
+ })
79
+ })
80
+
81
+ describe("parseGeminiOmniExtendQuoteCreditId", () => {
82
+ it("reads back what the builder wrote", () => {
83
+ for (const [src, dur, res] of [[4.37, 3, "720p"], [undefined, 8, "4k"], [6, 10, "360p"]] as const) {
84
+ const id = geminiOmniExtendQuoteCreditId({ sourcePictureSec: src, duration: dur, resolution: res })
85
+ expect(parseGeminiOmniExtendQuoteCreditId(id)).toEqual({ resolution: res, sentSec: src ?? 10, addedSec: dur })
86
+ }
87
+ })
88
+
89
+ it("answers nothing for any other shape", () => {
90
+ for (const id of [
91
+ "gemini-omni-flash-1-2-extend:720p:per-second",
92
+ "gemini-omni-flash-1-2-extend:8s:720p",
93
+ "gemini-omni-flash-1-2-extend:720p:sent-10s:added-8.5s",
94
+ "gemini-omni-flash-1-2-extend:720p:sent-0s:added-8s",
95
+ "gemini-omni-flash-1-2-extend:720p:sent-10s+added-8s",
96
+ "seedance-2-5-extend:720p:per-2s:9u",
97
+ "",
98
+ ]) expect(parseGeminiOmniExtendQuoteCreditId(id), id).toBeUndefined()
99
+ })
100
+ })
101
+
102
+ // The irrevocable grant is kept minimal (decided 2026-11-17): the id builder,
103
+ // its reader and its parts' type; the rule, the rows and the shape check are
104
+ // the server's and the editor's (@nodaro/render-rules, backend).
105
+ describe("what @nodaro/shared exports for it", () => {
106
+ it("is the builder and the reader, nothing else of the engine", () => {
107
+ const names = Object.keys(credits).filter((k) => /gemini/i.test(k))
108
+ expect(names.sort()).toEqual(["geminiOmniExtendQuoteCreditId", "parseGeminiOmniExtendQuoteCreditId"])
109
+ })
110
+ })
@@ -55,6 +55,7 @@ describe("GVP_SUPPORTED_PROVIDERS", () => {
55
55
  "seedance-2-fast",
56
56
  "seedance-2-mini",
57
57
  "seedance-2-5",
58
+ "seedance-2-5-flash",
58
59
  "minimax-h3",
59
60
  "veo3.1",
60
61
  "veo3_lite",
@@ -186,6 +187,7 @@ describe("GVP_EXTEND_PROVIDERS", () => {
186
187
  "seedance-2-fast",
187
188
  "seedance-2-mini",
188
189
  "seedance-2-5",
190
+ "seedance-2-5-flash",
189
191
  "minimax-h3",
190
192
  ])
191
193
  // Behaviour-neutral swap: the derived set is exactly what the old
@@ -236,6 +238,7 @@ describe("GVP_END_FRAME_PROVIDERS", () => {
236
238
  "seedance-2-fast",
237
239
  "seedance-2-mini",
238
240
  "seedance-2-5",
241
+ "seedance-2-5-flash",
239
242
  "minimax-h3",
240
243
  // `veo3` is absent because GVP_END_FRAME_PROVIDERS is a subset of
241
244
  // GVP_SUPPORTED_PROVIDERS, which VEO 3.1 Quality left — see above. The
@@ -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,
@@ -66,6 +71,7 @@ const EXPECTED_MODEL_IDS = [
66
71
  "gemini-3.1-pro",
67
72
  "gemini-4-argon",
68
73
  "gemini-4-carbon",
74
+ "gemini-4-hydrogen",
69
75
  "claude-opus-4.7",
70
76
  "gpt-5.4",
71
77
  "gpt-5.5",
@@ -132,14 +138,14 @@ describe("LLM_MODELS data integrity", () => {
132
138
  expect(new Set(ids).size).toBe(ids.length)
133
139
  })
134
140
 
135
- it("has 9 economy, 8 standard, 16 premium models", () => {
141
+ it("has 9 economy, 8 standard, 17 premium models", () => {
136
142
  const tierCounts: Record<LlmTier, number> = { economy: 0, standard: 0, premium: 0 }
137
143
  for (const model of LLM_MODELS) {
138
144
  tierCounts[model.tier]++
139
145
  }
140
146
  expect(tierCounts.economy).toBe(9)
141
147
  expect(tierCounts.standard).toBe(8)
142
- expect(tierCounts.premium).toBe(16)
148
+ expect(tierCounts.premium).toBe(17)
143
149
  })
144
150
 
145
151
  it("all three kieFormats are represented", () => {
@@ -1136,6 +1142,114 @@ describe("gemini-4-carbon exposure", () => {
1136
1142
  })
1137
1143
  })
1138
1144
 
1145
+ // ---------------------------------------------------------------------------
1146
+ // 2026-11-16 addition: Gemini 4 Hydrogen (KIE lane and Google lane probed that
1147
+ // day). Carbon's lane shape, with an xhigh level on both lanes.
1148
+ // ---------------------------------------------------------------------------
1149
+ describe("gemini-4-hydrogen exposure", () => {
1150
+ it("premium Gemini, KIE first with Google's own API as the fallback — never direct-only or direct-first", () => {
1151
+ const m = getLlmModel("gemini-4-hydrogen")!
1152
+ expect(m.displayName).toBe("Gemini 4 Hydrogen")
1153
+ expect(m.series).toBe("Gemini")
1154
+ expect(m.tier).toBe("premium")
1155
+ expect(m.vendor).toBe("google")
1156
+ expect(m.kieFormat).toBe("chat-completions")
1157
+ expect(m.kieSlugOrModel).toBe("gemini-4-hydrogen-openai")
1158
+ expect(m.directGeminiModel).toBe("gemini-4-hydrogen")
1159
+ expect(m.directOnly).toBeUndefined()
1160
+ expect(m.preferDirect).toBeUndefined()
1161
+ expect(supportsAdvancedMode("gemini-4-hydrogen")).toBe(true)
1162
+ // Only Advanced mode moves it to Google's API — no effort does.
1163
+ expect(llmServesDirect("gemini-4-hydrogen")).toBe(false)
1164
+ expect(llmServesDirect("gemini-4-hydrogen", "xhigh")).toBe(false)
1165
+ expect(llmServesDirect("gemini-4-hydrogen", undefined, true)).toBe(true)
1166
+ })
1167
+
1168
+ it("declares NO trusted structured mode, only the response_format hint — callers parse and re-ask", () => {
1169
+ const m = getLlmModel("gemini-4-hydrogen")!
1170
+ expect(m.structuredOutputMode).toBeUndefined()
1171
+ expect(m.structuredOutputHint).toBe("kie-response-format")
1172
+ expect(STRUCTURED_VISION_MODELS.map((x) => x.id)).not.toContain("gemini-4-hydrogen")
1173
+ expect(DESCRIBE_TO_PICKER_MODELS.map((x) => x.id)).not.toContain("gemini-4-hydrogen")
1174
+ })
1175
+
1176
+ it("offers low / medium / high / xhigh on both lanes — `none` runs at Auto, `max` clamps to xhigh", () => {
1177
+ expect(availableReasoningEfforts("gemini-4-hydrogen")).toEqual(["low", "medium", "high", "xhigh"])
1178
+ expect(availableReasoningEfforts("gemini-4-hydrogen", true)).toEqual(["low", "medium", "high", "xhigh"])
1179
+ for (const advanced of [false, true]) {
1180
+ expect(effectiveReasoningEffort("gemini-4-hydrogen", "none", advanced)).toBeUndefined()
1181
+ expect(effectiveReasoningEffort("gemini-4-hydrogen", "max", advanced)).toBe("xhigh")
1182
+ expect(effectiveReasoningEffort("gemini-4-hydrogen", "xhigh", advanced)).toBe("xhigh")
1183
+ expect(effectiveReasoningEffort("gemini-4-hydrogen", "medium", advanced)).toBe("medium")
1184
+ }
1185
+ expect(getLlmModel("gemini-4-hydrogen")?.effortBelowLowestSendsLowest).toBeUndefined()
1186
+ })
1187
+
1188
+ it("takes XHIGH on Google's API (`directXhighThinking`)", () => {
1189
+ expect(getLlmModel("gemini-4-hydrogen")?.directXhighThinking).toBe(true)
1190
+ })
1191
+
1192
+ it("reasons by default, floored at the default 32768 on the registry's usual 16384 cap", () => {
1193
+ const m = getLlmModel("gemini-4-hydrogen")!
1194
+ expect(m.thinkingDefaultOn).toBe(true)
1195
+ expect(m.reasoningOutputFloor).toBeUndefined()
1196
+ expect(reasoningOutputFloor(m)).toBe(REASONING_OUTPUT_FLOOR)
1197
+ expect(m.maxOutputTokens).toBe(16384)
1198
+ })
1199
+
1200
+ it("resolves by its id and its KIE slug, and backs no feature default", () => {
1201
+ expect(getLlmModel("gemini-4-hydrogen-openai")?.id).toBe("gemini-4-hydrogen")
1202
+ expect(Object.values(LLM_FEATURE_DEFAULTS)).not.toContain("gemini-4-hydrogen")
1203
+ expect(getLlmTier("gemini-4-hydrogen")).toBe("premium")
1204
+ })
1205
+
1206
+ it("reads images, video and audio on the LLM nodes (decided 2026-11-16; probed 2026-11-17) — no files", () => {
1207
+ expect(getLlmModalityCaps("gemini-4-hydrogen")).toEqual({ image: true, video: true, audio: true })
1208
+ expect(llmAcceptsFiles("gemini-4-hydrogen")).toBe(false)
1209
+ })
1210
+
1211
+ it("its media caps are for the LLM nodes only: no Video Analysis list, tier, legacy row or passthrough", () => {
1212
+ expect(LLM_NODE_ONLY_MEDIA_MODELS).toEqual(["gemini-4-hydrogen"])
1213
+ expect(readsMediaOnLlmNodesOnly("gemini-4-hydrogen")).toBe(true)
1214
+ expect(readsMediaOnLlmNodesOnly("gemini-4-carbon")).toBe(false)
1215
+ expect(readsMediaOnLlmNodesOnly(undefined)).toBe(false)
1216
+ expect(VIDEO_ANALYSIS_LLM_MODELS).not.toContain("gemini-4-hydrogen")
1217
+ expect(Object.values(VIDEO_ANALYSIS_TIERS)).not.toContain("gemini-4-hydrogen")
1218
+ expect(Object.keys(VIDEO_ANALYSIS_LEGACY_MODELS)).not.toContain("gemini-4-hydrogen")
1219
+ // A stored raw `llmModel: "gemini-4-hydrogen"` on a Video Analysis node is
1220
+ // not passed through: it resolves like any unknown value.
1221
+ expect(resolveVideoAnalysisModel("gemini-4-hydrogen")).toBe(resolveVideoAnalysisModel("not-a-model"))
1222
+ })
1223
+
1224
+ it("reads no video or audio outside the LLM nodes (readsVideoOutsideLlmNodes / readsAudioOutsideLlmNodes); Carbon does", () => {
1225
+ expect(readsVideoOutsideLlmNodes("gemini-4-hydrogen")).toBe(false)
1226
+ expect(readsAudioOutsideLlmNodes("gemini-4-hydrogen")).toBe(false)
1227
+ expect(readsVideoOutsideLlmNodes("gemini-4-carbon")).toBe(true)
1228
+ expect(readsAudioOutsideLlmNodes("gemini-4-carbon")).toBe(true)
1229
+ expect(readsVideoOutsideLlmNodes("gemini-4-argon")).toBe(false)
1230
+ expect(readsVideoOutsideLlmNodes(undefined)).toBe(false)
1231
+ // The Video Analysis list is exactly the models that read both outside the LLM nodes.
1232
+ expect(VIDEO_ANALYSIS_LLM_MODELS).toEqual(LLM_MODELS.filter((m) => readsVideoOutsideLlmNodes(m.id) && readsAudioOutsideLlmNodes(m.id)).map((m) => m.id))
1233
+ })
1234
+
1235
+ it("every LLM-node-only media model really reads video and audio (else the list is stale)", () => {
1236
+ for (const id of LLM_NODE_ONLY_MEDIA_MODELS) {
1237
+ expect(getLlmModalityCaps(id), id).toMatchObject({ video: true, audio: true })
1238
+ }
1239
+ })
1240
+ })
1241
+
1242
+ describe("directXhighThinking is declared only where the direct lane can send it", () => {
1243
+ it("sits only on a model with a Google lane and an xhigh level on that lane's ladder", () => {
1244
+ const declared = LLM_MODELS.filter((m) => m.directXhighThinking)
1245
+ expect(declared.map((m) => m.id)).toEqual(["gemini-4-hydrogen"])
1246
+ for (const m of declared) {
1247
+ expect(m.directGeminiModel, m.id).toBeTruthy()
1248
+ expect(availableReasoningEfforts(m.id, true), m.id).toContain("xhigh")
1249
+ }
1250
+ })
1251
+ })
1252
+
1139
1253
  describe("gpt-6.1-terra exposure", () => {
1140
1254
  it("standard GPT-6.1 on the codex responses wire with an enforced schema, KIE only", () => {
1141
1255
  const m = getLlmModel("gpt-6.1-terra")!
@@ -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.
@@ -2,12 +2,16 @@ import { describe, expect, it } from "vitest"
2
2
  import {
3
3
  NEMOTRON_TRANSCRIBE_ID,
4
4
  NEMOTRON_TRANSCRIBE_PRICING,
5
+ NEMOTRON_UPWARD_GRACE_SEC,
6
+ nemotronHeldMinutes,
5
7
  nemotronTranscribeBaseCredits,
6
8
  nemotronTranscribeCreditId,
9
+ nemotronTranscribeHeldCreditId,
7
10
  nemotronTranscribeQuoteCreditId,
8
11
  nemotronTranscribeStartedMinutes,
9
12
  parseNemotronTranscribeCreditId,
10
13
  } from "../credit-estimators/nemotron-transcribe.js"
14
+ import { addCaptionsNemotronHeldCreditId, addCaptionsNemotronQuoteCreditId, parseAddCaptionsNemotronCreditId } from "../credit-estimators/add-captions-nemotron.js"
11
15
  import { MODEL_CATALOG } from "../model-catalog.js"
12
16
 
13
17
  const RATE = NEMOTRON_TRANSCRIBE_PRICING.CREDITS_PER_RATE_DEFAULT
@@ -53,6 +57,34 @@ describe("Nemotron 3.5 Transcribe pricing (per started minute, decided 2026-11-1
53
57
  expect(nemotronTranscribeQuoteCreditId(125)).toBe("nemotron-3-5-transcribe:3m")
54
58
  })
55
59
 
60
+ it("holds a measured file at the minutes the charge settles at: up to the grace past a minute is the minute below", () => {
61
+ expect(NEMOTRON_UPWARD_GRACE_SEC).toBe(1)
62
+ // A re-encoded 60-second cut measures a hair past 60 s (60.0004–60.011 s): held, and charged, at one minute.
63
+ expect(nemotronHeldMinutes(60)).toBe(1)
64
+ expect(nemotronHeldMinutes(60.0004)).toBe(1)
65
+ expect(nemotronHeldMinutes(60.011)).toBe(1)
66
+ expect(nemotronHeldMinutes(61)).toBe(1)
67
+ expect(nemotronHeldMinutes(61.001)).toBe(2)
68
+ expect(nemotronHeldMinutes(0.4)).toBe(1)
69
+ expect(nemotronHeldMinutes(3600)).toBe(60)
70
+ expect(nemotronTranscribeHeldCreditId(60.011)).toBe("nemotron-3-5-transcribe:1m")
71
+ expect(nemotronTranscribeHeldCreditId(125)).toBe("nemotron-3-5-transcribe:3m")
72
+ })
73
+
74
+ // The guard: a quote of a known length is never below the hold of a file that measures up to the grace past it.
75
+ const KNOWN = [0.5, 1, 30, 59, 59.5, 60, 60.5, 61, 119, 120, 180, 599.99, 600, 1800, 3540, 3599, 3600]
76
+ const OVER = [0, 1e-6, 0.0004, 0.011, 0.25, 0.5, 0.999, NEMOTRON_UPWARD_GRACE_SEC]
77
+ it.each(KNOWN)("a quote of %s s is never below the hold of a file measured up to the grace past it", (known) => {
78
+ for (const over of OVER) {
79
+ const measured = Math.min(known + over, NEMOTRON_TRANSCRIBE_PRICING.MAX_DURATION_SEC)
80
+ const quoted = parseNemotronTranscribeCreditId(nemotronTranscribeQuoteCreditId(known))!.minutes
81
+ expect(parseNemotronTranscribeCreditId(nemotronTranscribeHeldCreditId(measured))!.minutes, `${known} + ${over}`).toBeLessThanOrEqual(quoted)
82
+ // Add Captions on Nemotron: the same rule, its own ids.
83
+ const captionQuote = parseAddCaptionsNemotronCreditId(addCaptionsNemotronQuoteCreditId(known))!.minutes
84
+ expect(parseAddCaptionsNemotronCreditId(addCaptionsNemotronHeldCreditId(measured))!.minutes, `${known} + ${over}`).toBeLessThanOrEqual(captionQuote)
85
+ }
86
+ })
87
+
56
88
  it("lists the four-minute rate row in the catalog at the launch rate", () => {
57
89
  const entry = MODEL_CATALOG[NEMOTRON_TRANSCRIBE_ID as keyof typeof MODEL_CATALOG] as unknown as { pricing: Array<{ identifier: string; credits: number }>; maker?: string }
58
90
  expect(entry.pricing).toEqual([expect.objectContaining({ identifier: NEMOTRON_TRANSCRIBE_PRICING.RATE_CREDIT_ID, credits: RATE })])
@@ -0,0 +1,92 @@
1
+ import { describe, expect, it } from "vitest"
2
+ import {
3
+ ALLOW_LIST_EXEMPT_NODE_TYPES,
4
+ WORLD_IDS,
5
+ isAllowListGatedNodeType,
6
+ listsSet,
7
+ listsWithhold,
8
+ nodeListsWithhold,
9
+ worldOffered,
10
+ } from "../entries/runtime-config.js"
11
+
12
+ const NONE = { allow: [], deny: [] }
13
+ const everything = () => true
14
+
15
+ describe("listsWithhold — a deployment's own allow/deny lists", () => {
16
+ it("lists that are not set withhold nothing", () => {
17
+ expect(listsWithhold(NONE, "generate-image", everything)).toBe(false)
18
+ expect(listsSet(NONE)).toBe(false)
19
+ expect(listsSet(undefined)).toBe(false)
20
+ })
21
+
22
+ it("a non-empty allow withholds every governed id outside it", () => {
23
+ const lists = { allow: ["generate-image"], deny: [] }
24
+ expect(listsSet(lists)).toBe(true)
25
+ expect(listsWithhold(lists, "generate-image", everything)).toBe(false)
26
+ expect(listsWithhold(lists, "generate-video", everything)).toBe(true)
27
+ })
28
+
29
+ it("an id the allow list does not govern is withheld only by deny", () => {
30
+ const lists = { allow: ["generate-image"], deny: ["preview"] }
31
+ const governed = (id: string) => id !== "sticky-note" && id !== "preview"
32
+ expect(listsWithhold(lists, "sticky-note", governed)).toBe(false)
33
+ expect(listsWithhold(lists, "preview", governed)).toBe(true)
34
+ })
35
+
36
+ it("deny withholds what it names, also inside allow", () => {
37
+ const lists = { allow: ["generate-image", "dubbing"], deny: ["dubbing"] }
38
+ expect(listsSet({ allow: [], deny: ["dubbing"] })).toBe(true)
39
+ expect(listsWithhold(lists, "dubbing", everything)).toBe(true)
40
+ expect(listsWithhold(lists, "generate-image", everything)).toBe(false)
41
+ })
42
+ })
43
+
44
+ describe("nodeListsWithhold — the node lists", () => {
45
+ it("a whitelist never withholds a utility node or Site Capture by leaving it out", () => {
46
+ const lists = { allow: ["generate-image"], deny: [] }
47
+ expect(ALLOW_LIST_EXEMPT_NODE_TYPES).toEqual(expect.arrayContaining(["sticky-note", "preview", "group", "site-capture"]))
48
+ for (const type of ALLOW_LIST_EXEMPT_NODE_TYPES) {
49
+ expect(isAllowListGatedNodeType(type), type).toBe(false)
50
+ expect(nodeListsWithhold(lists, type), type).toBe(false)
51
+ expect(nodeListsWithhold({ allow: ["generate-image"], deny: [type] }, type), type).toBe(true)
52
+ }
53
+ })
54
+
55
+ it("a whitelist withholds every other node type it does not list, features with no canvas node included", () => {
56
+ const lists = { allow: ["generate-image", "dubbing"], deny: [] }
57
+ for (const type of ["generate-video", "combine-text", "sub-workflow", "cast-swap", "voice-clone-one-off"]) {
58
+ expect(isAllowListGatedNodeType(type), type).toBe(true)
59
+ expect(nodeListsWithhold(lists, type), type).toBe(true)
60
+ }
61
+ expect(nodeListsWithhold(lists, "dubbing")).toBe(false)
62
+ })
63
+
64
+ it("a deny of the Voice Clone node withholds a one-off clone too; a whitelist without it does not", () => {
65
+ expect(nodeListsWithhold({ allow: [], deny: ["voice-clone"] }, "voice-clone-one-off")).toBe(true)
66
+ expect(nodeListsWithhold({ allow: ["voice-clone-one-off"], deny: [] }, "voice-clone-one-off")).toBe(false)
67
+ })
68
+
69
+ it("takes the caller's own idea of what a whitelist governs", () => {
70
+ const lists = { allow: ["generate-image"], deny: [] }
71
+ expect(nodeListsWithhold(lists, "a-type-the-caller-does-not-know", (type) => type === "generate-video")).toBe(false)
72
+ expect(nodeListsWithhold(lists, "generate-video", (type) => type === "generate-video")).toBe(true)
73
+ })
74
+ })
75
+
76
+ describe("worldOffered — a world, by the profile's allowlist and the node types it runs", () => {
77
+ it("every world, where nothing is withheld and no allowlist is set", () => {
78
+ for (const id of WORLD_IDS) expect(worldOffered(undefined, id, () => false), id).toBe(true)
79
+ })
80
+
81
+ it("not a world the allowlist leaves out", () => {
82
+ expect(worldOffered({ allow: ["image"] }, "video", () => false)).toBe(false)
83
+ expect(worldOffered({ allow: ["image"] }, "image", () => false)).toBe(true)
84
+ })
85
+
86
+ it("not a world one of whose node types is withheld; a world that runs none follows the allowlist alone", () => {
87
+ const withheld = (type: string) => type === "text-to-video"
88
+ expect(worldOffered(undefined, "video", withheld)).toBe(false)
89
+ expect(worldOffered(undefined, "image", withheld)).toBe(true)
90
+ expect(worldOffered(undefined, "app", () => true)).toBe(true)
91
+ })
92
+ })
@@ -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
+ })