@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
@@ -341,10 +341,18 @@ export const MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER: Record<string, number> = {
341
341
  "seedance-2-fast": 20000,
342
342
  "seedance-2-mini": 20000,
343
343
  "seedance-2-5-extend": 20000,
344
+ // Seedance 2.5 Flash Extend: the sibling extend's ceiling, under Flash's own
345
+ // 20480 with room for the recipe's wrapper and the reference directives.
346
+ "seedance-2-5-flash-extend": 20000,
344
347
  "seedance-2-0-extend": 20000,
348
+ // Gemini Omni Flash 1.2 Extend (fal) — 20000 chars, the endpoint's own cap;
349
+ // its prompt is sent as written, so the whole cap is the user's.
350
+ "gemini-omni-flash-1-2-extend": 20000,
345
351
  // Seedance 2.5 raises the prompt ceiling to 30000
346
352
  // (docs.kie.ai/market/bytedance/seedance-2-5).
347
353
  "seedance-2-5": 30000,
354
+ // Seedance 2.5 Flash — 20480 chars (docs.kie.ai/market/bytedance/seedance-2-5-flash).
355
+ "seedance-2-5-flash": 20480,
348
356
  "gemini-omni-video": 20000,
349
357
  // Gemini Omni Flash 1.1 — same 20000-char prompt surface as the pro sibling
350
358
  // (docs.kie.ai/market/google/gemini-omni-flash-1-1).
@@ -1175,6 +1183,7 @@ export const IMAGE_TO_VIDEO_PROVIDERS = [
1175
1183
  "seedance-2-fast",
1176
1184
  "seedance-2-mini",
1177
1185
  "seedance-2-5",
1186
+ "seedance-2-5-flash",
1178
1187
  "minimax-h3",
1179
1188
  "hailuo-2.3-pro",
1180
1189
  "hailuo-2.3",
@@ -1240,6 +1249,7 @@ export const TEXT_TO_VIDEO_PROVIDERS = [
1240
1249
  "seedance-2-fast",
1241
1250
  "seedance-2-mini",
1242
1251
  "seedance-2-5",
1252
+ "seedance-2-5-flash",
1243
1253
  "minimax-h3",
1244
1254
  "wan",
1245
1255
  "hailuo-standard",
@@ -1536,7 +1546,7 @@ export type VideoToVideoProvider = typeof VIDEO_TO_VIDEO_PROVIDERS[number]
1536
1546
  * measured settlement, the edit-mode retry and the reconcile recovery are that
1537
1547
  * lane's — there is no second copy to keep in step.
1538
1548
  */
1539
- export const SEEDANCE_VIDEO_EDIT_PROVIDERS = ["seedance-2-5"] as const
1549
+ export const SEEDANCE_VIDEO_EDIT_PROVIDERS = ["seedance-2-5", "seedance-2-5-flash"] as const
1540
1550
  export type SeedanceVideoEditProvider = typeof SEEDANCE_VIDEO_EDIT_PROVIDERS[number]
1541
1551
 
1542
1552
  export function isSeedanceVideoEditProvider(provider: string | undefined): provider is SeedanceVideoEditProvider {
@@ -1604,12 +1614,20 @@ export const EXTEND_VIDEO_PROVIDERS = [
1604
1614
  // Seedance extends ANY video, one provider per model: Seedance 2.5 (4–30 s
1605
1615
  // added) and Seedance 2.0 (4–15 s), each priced on its own rows
1606
1616
  // (`tailExtendCreditId`). The earlier single id `seedance-2-extend` is
1607
- // retired (RETIRED_VIDEO_PROVIDERS) and runs as Seedance 2.5.
1617
+ // retired (RETIRED_VIDEO_PROVIDERS) and runs as Seedance 2.5. Seedance 2.5
1618
+ // Flash extends the same way as Seedance 2.5 (4–30 s added, 480p / 720p),
1619
+ // generated on Seedance 2.5 Flash and priced on its own rows.
1608
1620
  "seedance-2-5-extend",
1621
+ "seedance-2-5-flash-extend",
1609
1622
  "seedance-2-0-extend",
1610
1623
  // Kling 4 extends ANY video the same way (3–30 s added, 720p / 1080p, its
1611
1624
  // sound always on), generated on Kling 4.0 and priced on its own rows.
1612
1625
  "kling-4-extend",
1626
+ // Gemini Omni Flash 1.2 extends ANY 16:9 or 9:16 video from its tail (3–10 s
1627
+ // added, 360p–4K), generated on fal: the source's last 10 s go in and come
1628
+ // back with the new seconds joined on, of which only the new ones are kept.
1629
+ // Priced on its own rows, per second sent and added.
1630
+ "gemini-omni-flash-1-2-extend",
1613
1631
  // PixVerse V6 extends ANY video natively (1–15 s added, 360p–1080p, a sound
1614
1632
  // switch): the whole source goes in and comes back with the new seconds
1615
1633
  // joined on, of which only the new ones are kept. Priced on its own rows.
@@ -1622,8 +1640,8 @@ export const EXTEND_VIDEO_PROVIDERS = [
1622
1640
  export type ExtendVideoProvider = typeof EXTEND_VIDEO_PROVIDERS[number]
1623
1641
 
1624
1642
  /** The Extend Video providers that run on Seedance, one per model. */
1625
- export type SeedanceExtendProvider = Extract<ExtendVideoProvider, "seedance-2-5-extend" | "seedance-2-0-extend">
1626
- const SEEDANCE_EXTEND_PROVIDERS: readonly SeedanceExtendProvider[] = ["seedance-2-5-extend", "seedance-2-0-extend"]
1643
+ export type SeedanceExtendProvider = Extract<ExtendVideoProvider, "seedance-2-5-extend" | "seedance-2-5-flash-extend" | "seedance-2-0-extend">
1644
+ const SEEDANCE_EXTEND_PROVIDERS: readonly SeedanceExtendProvider[] = ["seedance-2-5-extend", "seedance-2-5-flash-extend", "seedance-2-0-extend"]
1627
1645
 
1628
1646
  /**
1629
1647
  * Whether a value is one of the Seedance Extend Video providers. A retired id
@@ -1642,8 +1660,8 @@ export function isSeedanceExtendProvider(p: unknown): p is SeedanceExtendProvide
1642
1660
  * own catalog entry (its seconds added and resolutions) and price rows, one
1643
1661
  * per second and resolution (`tailExtendCreditId`).
1644
1662
  */
1645
- export type TailExtendProvider = SeedanceExtendProvider | Extract<ExtendVideoProvider, "kling-4-extend">
1646
- const TAIL_EXTEND_PROVIDERS: readonly TailExtendProvider[] = [...SEEDANCE_EXTEND_PROVIDERS, "kling-4-extend"]
1663
+ export type TailExtendProvider = SeedanceExtendProvider | Extract<ExtendVideoProvider, "kling-4-extend" | "gemini-omni-flash-1-2-extend">
1664
+ const TAIL_EXTEND_PROVIDERS: readonly TailExtendProvider[] = [...SEEDANCE_EXTEND_PROVIDERS, "kling-4-extend", "gemini-omni-flash-1-2-extend"]
1647
1665
 
1648
1666
  /**
1649
1667
  * Whether a value is one of the tail-recipe Extend Video providers
@@ -1719,6 +1737,14 @@ export function isGrokExtendSourceModel(p: unknown): boolean {
1719
1737
  return typeof p === "string" && (GROK_EXTEND_SOURCE_MODELS as readonly string[]).includes(p)
1720
1738
  }
1721
1739
 
1740
+ /**
1741
+ * The video node types whose run Grok Extend can continue, set to one of
1742
+ * {@link GROK_EXTEND_SOURCE_MODELS}: a Grok Imagine text- or image-to-video
1743
+ * node. The one list the Grok Extend quote and the result rows that carry a
1744
+ * source's task read.
1745
+ */
1746
+ export const GROK_EXTEND_SOURCE_NODE_TYPES: ReadonlySet<string> = new Set(["generate-video", "text-to-video", "image-to-video"])
1747
+
1722
1748
  /** Lip sync providers */
1723
1749
  export const LIP_SYNC_PROVIDERS = [
1724
1750
  "kling-avatar",
@@ -1760,6 +1786,7 @@ export const LIP_SYNC_PROVIDERS = [
1760
1786
  "seedance-2-fast",
1761
1787
  "seedance-2-mini",
1762
1788
  "seedance-2-5",
1789
+ "seedance-2-5-flash",
1763
1790
  // MiniMax Hailuo 3 — same multimodal audio-driven mechanism (r2v
1764
1791
  // reference_audio_urls paired with an image ref); rides the same
1765
1792
  // reference-audio lip-sync surface as the Seedance 2 family.
@@ -1804,6 +1831,7 @@ export const SEEDANCE_LIP_SYNC_PROVIDERS = new Set<string>([
1804
1831
  "seedance-2-fast",
1805
1832
  "seedance-2-mini",
1806
1833
  "seedance-2-5",
1834
+ "seedance-2-5-flash",
1807
1835
  "minimax-h3",
1808
1836
  ])
1809
1837
 
@@ -2354,6 +2382,7 @@ export const DURATION_PRICED_PROVIDERS = new Set([
2354
2382
  "seedance-2-fast",
2355
2383
  "seedance-2-mini",
2356
2384
  "seedance-2-5",
2385
+ "seedance-2-5-flash",
2357
2386
  "minimax-h3",
2358
2387
  "grok-imagine-video-1.5",
2359
2388
  "happyhorse",
@@ -2398,12 +2427,42 @@ export const SEEDANCE_2_PROVIDERS = new Set<string>([
2398
2427
  // DIFFERS (30s ceiling, no 1080p/4K, wider ref caps) the difference is
2399
2428
  // carried by the per-provider maps, never by branching on this set.
2400
2429
  "seedance-2-5",
2430
+ // Seedance 2.5 Flash — the fast tier of 2.5, same capability surface. Its
2431
+ // own facts (480p/720p, 10/5/5 references, WAV/MP3 reference audio, no
2432
+ // draft) live in the per-provider maps, as 2.5's do.
2433
+ "seedance-2-5-flash",
2401
2434
  ])
2402
2435
 
2403
2436
  export function isSeedance2Provider(provider: string | undefined): boolean {
2404
2437
  return !!provider && SEEDANCE_2_PROVIDERS.has(provider)
2405
2438
  }
2406
2439
 
2440
+ /**
2441
+ * Seedance models Edit Video Pro does not offer, although they are members of
2442
+ * the family it is drawn from (decided 2026-11-16: Seedance 2.5 Flash ships on
2443
+ * Generate Video, Generate Video Pro, Edit Video and Lip Sync; Edit Video Pro
2444
+ * is a separate decision). Read through {@link isEditVideoProProvider}.
2445
+ */
2446
+ export const EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS: ReadonlySet<string> = new Set<string>(["seedance-2-5-flash"])
2447
+
2448
+ /** Whether Edit Video Pro offers this model: a Seedance 2 family member it has not held back. */
2449
+ export function isEditVideoProProvider(provider: string | undefined): boolean {
2450
+ return isSeedance2Provider(provider) && !EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS.has(provider!)
2451
+ }
2452
+
2453
+ /**
2454
+ * The refusal for an Edit Video Pro run on a model it holds back
2455
+ * ({@link EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS}), or undefined: refused before
2456
+ * anything is priced or held, on the route's pricing and the workflow run
2457
+ * alike (a stored, imported or MCP-written node too). Any other model keeps
2458
+ * its own handling (an unknown one is refused by its price lookup).
2459
+ */
2460
+ export function editVideoProProviderRefusal(provider: string | undefined): string | undefined {
2461
+ return provider !== undefined && EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS.has(provider)
2462
+ ? `${provider} is not offered on Edit Video Pro. Pick another Edit Video Pro model.`
2463
+ : undefined
2464
+ }
2465
+
2407
2466
  /**
2408
2467
  * MiniMax Hailuo 3 family — the KIE "minimax-h3" market model. One Nodaro id
2409
2468
  * covers three KIE endpoints (text-to-video / image-to-video /
@@ -3065,6 +3124,17 @@ export const SEEDANCE_2_5_REF_LIMITS = {
3065
3124
  audio: 10,
3066
3125
  } as const
3067
3126
 
3127
+ /**
3128
+ * Seedance 2.5 Flash's reference caps (docs.kie.ai/market/bytedance/seedance-2-5-flash):
3129
+ * 10 images, 5 videos, 5 audio clips. Its own constant: Flash is the fast tier
3130
+ * of 2.5, but its caps are lower than 2.5's.
3131
+ */
3132
+ export const SEEDANCE_2_5_FLASH_REF_LIMITS = {
3133
+ images: 10,
3134
+ videos: 5,
3135
+ audio: 5,
3136
+ } as const
3137
+
3068
3138
  /**
3069
3139
  * KIE r2v REFERENCE-VIDEO MINIMUM (seconds) for the Seedance 2.0 family — the
3070
3140
  * provider hard-rejects shorter reference clips with a 400 BEFORE generation:
@@ -3127,6 +3197,9 @@ export const SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER: Record<string, number> =
3127
3197
  // Seedance 2.5 — documented hard limit: each reference audio 2-30s, ≤15 MB
3128
3198
  // per file (docs.kie.ai/market/bytedance/seedance-2-5).
3129
3199
  "seedance-2-5": 30,
3200
+ // Seedance 2.5 Flash — the same documented 2-30s per clip, ≤15 MB
3201
+ // (docs.kie.ai/market/bytedance/seedance-2-5-flash).
3202
+ "seedance-2-5-flash": 30,
3130
3203
  // MiniMax Hailuo 3 — documented hard limit: each reference audio segment
3131
3204
  // 2-15s, ≤15s total (docs.kie.ai/market/minimax-h3/reference-to-video).
3132
3205
  "minimax-h3": 15,
@@ -3165,8 +3238,16 @@ export function findSeedance2AudioOverLimit(
3165
3238
  export interface RefAudioRule {
3166
3239
  /** Accepted containers, as ffprobe's `format_name` spells them ("mp3"). */
3167
3240
  formats?: readonly string[]
3241
+ /**
3242
+ * A clip outside `formats` is converted to this format before it is sent,
3243
+ * instead of refused (decided 2026-11-16 for Seedance 2.5 Flash). Its length
3244
+ * is still checked.
3245
+ */
3246
+ convertsTo?: "mp3"
3168
3247
  minSec?: number
3169
3248
  maxSec?: number
3249
+ /** The most seconds all the reference audio of a request may play, together. */
3250
+ maxTotalSec?: number
3170
3251
  }
3171
3252
 
3172
3253
  /**
@@ -3186,6 +3267,13 @@ export interface RefAudioRule {
3186
3267
  */
3187
3268
  export const VIDEO_REF_AUDIO_RULES: Record<string, RefAudioRule | undefined> = {
3188
3269
  "vidu-q4": { formats: ["mp3"], minSec: 3, maxSec: 12 },
3270
+ // Seedance 2.5 Flash: "Format: wav, mp3", each clip 2-30 seconds, "total
3271
+ // duration of reference audio must not exceed 30 seconds"
3272
+ // (docs.kie.ai/market/bytedance/seedance-2-5-flash). A clip in another format
3273
+ // is converted to MP3 before it is sent (decided 2026-11-16); its length is
3274
+ // still refused before anything is held. Seedance 2.5 itself also takes AAC
3275
+ // and OGG, so it has no row here.
3276
+ "seedance-2-5-flash": { formats: ["wav", "mp3"], convertsTo: "mp3", minSec: 2, maxSec: 30, maxTotalSec: 30 },
3189
3277
  }
3190
3278
 
3191
3279
  /** One probed reference-audio clip. A field the probe could not read is absent. */
@@ -3197,24 +3285,37 @@ export interface RefAudioProbe {
3197
3285
 
3198
3286
  export type RefAudioCheck =
3199
3287
  | { ok: true }
3200
- | { ok: false; code: "audio_format_unsupported" | "audio_too_short" | "audio_too_long"; message: string }
3288
+ | { ok: false; code: "audio_format_unsupported" | "audio_too_short" | "audio_too_long" | "audio_total_too_long"; message: string }
3201
3289
 
3202
3290
  /**
3203
3291
  * Check probed reference-audio clips against {@link VIDEO_REF_AUDIO_RULES}.
3204
3292
  * An unreadable field is IGNORED, never rejected — a probe blip must not block
3205
3293
  * a legal run (the provider still has the final say).
3206
3294
  */
3207
- export function checkRefAudioRules(provider: string | undefined, probes: readonly RefAudioProbe[]): RefAudioCheck {
3295
+ export function checkRefAudioRules(
3296
+ provider: string | undefined,
3297
+ probes: readonly RefAudioProbe[],
3298
+ /**
3299
+ * Whether a clip outside `formats` can be converted on this install
3300
+ * (`convertsTo`). An install whose stored files no outside provider can
3301
+ * fetch cannot send a converted copy, so there the format is refused, before
3302
+ * anything is held, as on a rule that does not convert. Default: it can.
3303
+ */
3304
+ opts: { readonly canConvert?: boolean } = {},
3305
+ ): RefAudioCheck {
3208
3306
  const rule = provider ? VIDEO_REF_AUDIO_RULES[provider] : undefined
3209
3307
  if (!rule) return { ok: true }
3308
+ const converts = !!rule.convertsTo && opts.canConvert !== false
3309
+ let totalSec = 0
3210
3310
  for (const [i, p] of probes.entries()) {
3211
3311
  const n = i + 1
3212
- if (rule.formats && p.formatNames && p.formatNames.length > 0 && !p.formatNames.some((f) => rule.formats!.includes(f))) {
3312
+ if (rule.formats && !converts && p.formatNames && p.formatNames.length > 0 && !p.formatNames.some((f) => rule.formats!.includes(f))) {
3213
3313
  const want = rule.formats.map((f) => f.toUpperCase()).join(" or ")
3214
3314
  return { ok: false, code: "audio_format_unsupported", message: `Reference audio ${n} must be ${want} for this model. Convert the clip to ${want} and try again.` }
3215
3315
  }
3216
3316
  const d = p.durationSec
3217
3317
  if (d === undefined || !Number.isFinite(d) || d <= 0) continue
3318
+ totalSec += d
3218
3319
  if (rule.minSec !== undefined && d < rule.minSec) {
3219
3320
  return { ok: false, code: "audio_too_short", message: `Reference audio ${n} is too short for this model: ${d.toFixed(1)}s is under the ${rule.minSec}s minimum.` }
3220
3321
  }
@@ -3222,6 +3323,9 @@ export function checkRefAudioRules(provider: string | undefined, probes: readonl
3222
3323
  return { ok: false, code: "audio_too_long", message: `Reference audio ${n} is too long for this model: ${d.toFixed(1)}s exceeds the ${rule.maxSec}s limit. Please use a shorter audio clip.` }
3223
3324
  }
3224
3325
  }
3326
+ if (rule.maxTotalSec !== undefined && totalSec > rule.maxTotalSec) {
3327
+ return { ok: false, code: "audio_total_too_long", message: `The reference audio is too long for this model: ${totalSec.toFixed(1)}s together exceeds the ${rule.maxTotalSec}s limit. Use fewer or shorter clips.` }
3328
+ }
3225
3329
  return { ok: true }
3226
3330
  }
3227
3331
 
@@ -3246,6 +3350,15 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
3246
3350
  audio?: number
3247
3351
  characters?: number
3248
3352
  voices?: number
3353
+ /**
3354
+ * A request that sends more images, videos or audio clips than the caps
3355
+ * above is REFUSED on the API and MCP, before anything is held, instead of
3356
+ * sending the first ones (decided 2026-11-16 for Seedance 2.5 Flash; read
3357
+ * through `videoReferencesOverLimitProblem`). The editor trims what its
3358
+ * Run sends to the caps first (`trimVideoReferencesToLimits`), and a
3359
+ * workflow run keeps the provider's trim, so neither is refused.
3360
+ */
3361
+ requestRefusesOverLimit?: true
3249
3362
  /**
3250
3363
  * Cap on ALL materials together (images + videos + characters + audio),
3251
3364
  * when the provider counts them as one budget (Kling 4.0: 15). Absent ⇒
@@ -3254,6 +3367,26 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
3254
3367
  * (`videoCharacterRefProblem`).
3255
3368
  */
3256
3369
  materials?: number
3370
+ /**
3371
+ * The model's `characters` draw on no input budget of their own: they do
3372
+ * not count toward the `images` cap or the image + video quota (Gemini
3373
+ * Omni Flash 1.2: "Character images do not count toward the
3374
+ * reference-image quota"). Absent ⇒ a model declaring `characters` (and no
3375
+ * `materials`) spends them from the Gemini Omni 7-unit budget
3376
+ * (`videoCharacterRefProblem`). The cap on `characters` and the frame
3377
+ * exclusion still apply.
3378
+ */
3379
+ charactersOutsideImageBudget?: true
3380
+ /**
3381
+ * A scope for the model's cached character ids (and their voice
3382
+ * personas): the provider layer keys its id cache by it too, so an id
3383
+ * minted for this model is never served to another model, nor the other
3384
+ * way round. Absent ⇒ the unscoped cache shared by the Gemini Omni models
3385
+ * from before (their keys stay as they were). Set on Gemini Omni Flash 1.2
3386
+ * because whether an id minted for 1.1 works on 1.2 is unverified
3387
+ * (decided 2026-11-17).
3388
+ */
3389
+ characterIdScope?: string
3257
3390
  /**
3258
3391
  * Reference audio rides ON a character subject (its voice), not as a
3259
3392
  * material of its own: clip N belongs to wired character N, in the order
@@ -3295,6 +3428,8 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
3295
3428
  "seedance-2-mini": { ...SEEDANCE_2_REF_LIMITS },
3296
3429
  // Seedance 2.5 — wider caps than the 2.0 family (30 / 10 / 10).
3297
3430
  "seedance-2-5": { ...SEEDANCE_2_5_REF_LIMITS },
3431
+ // Seedance 2.5 Flash — lower caps than 2.5 (10 / 5 / 5).
3432
+ "seedance-2-5-flash": { ...SEEDANCE_2_5_FLASH_REF_LIMITS, requestRefusesOverLimit: true },
3298
3433
  // MiniMax Hailuo 3 — identical multimodal caps (9 images / 3 videos / 3
3299
3434
  // audio per docs.kie.ai/market/minimax-h3/reference-to-video). Note: KIE
3300
3435
  // bills input images beyond the first 5 (11 KIE cr each) — see the
@@ -3323,8 +3458,11 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
3323
3458
  "gemini-omni-flash": { images: 7, videos: 1, characters: 3, voices: 3 },
3324
3459
  // Gemini Omni Flash 1.2 — up to 6 images, one source video, and images +
3325
3460
  // 2 for a video ≤ 7, so 5 images beside a video (the request builder holds
3326
- // that). No `character_ids` / `audio_ids` in its schema: no characters, no voices.
3327
- "gemini-omni-flash-1-2": { images: 6, videos: 1 },
3461
+ // that). `character_ids` max 2, OUTSIDE that image quota (its schema:
3462
+ // "Character images do not count toward the reference-image quota"), never
3463
+ // beside a first/last frame (decided 2026-11-17). No `audio_ids` in its task
3464
+ // schema: no voices.
3465
+ "gemini-omni-flash-1-2": { images: 6, videos: 1, characters: 2, charactersOutsideImageBudget: true, characterIdScope: "gemini-omni-flash-1-2" },
3328
3466
  "kling-3-omni": { images: 7 }, // catalog/docs: "end frame + up to 7 reference images"
3329
3467
  // Kling 4.0 Reference — 10 images, 5 videos, 7 subjects (`characters`,
3330
3468
  // KIE `elements`) and 3 voices (reference audio, KIE `voices`), 15 in all
@@ -3381,6 +3519,63 @@ export interface RefVideoDurationLimit {
3381
3519
  maxTotalSec?: number
3382
3520
  }
3383
3521
 
3522
+ /** How many reference images, videos and audio clips a request sends. `frames` counts a start / end frame that joins the image list when any reference is sent. */
3523
+ export interface VideoReferenceCounts {
3524
+ images: number
3525
+ videos: number
3526
+ audio: number
3527
+ frames?: number
3528
+ }
3529
+
3530
+ /**
3531
+ * The refusal for a request that sends more references than the model takes,
3532
+ * on a model that refuses rather than trims (`requestRefusesOverLimit`), or
3533
+ * undefined. A start or end frame joins the image list once any reference is
3534
+ * sent (`resolveSeedance2Inputs`), so it counts toward the image cap then.
3535
+ */
3536
+ export function videoReferencesOverLimitProblem(provider: string | undefined, counts: VideoReferenceCounts): string | undefined {
3537
+ const row = provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider] : undefined
3538
+ if (!row?.requestRefusesOverLimit) return undefined
3539
+ const anyReference = counts.images + counts.videos + counts.audio > 0
3540
+ const images = counts.images + (anyReference ? (counts.frames ?? 0) : 0)
3541
+ const checks: Array<[number, number | undefined, string]> = [
3542
+ [images, row.images, anyReference && (counts.frames ?? 0) > 0 ? "images (a start or end frame counts as one)" : "images"],
3543
+ [counts.videos, row.videos, "videos"],
3544
+ [counts.audio, row.audio, "audio clips"],
3545
+ ]
3546
+ for (const [n, cap, noun] of checks) {
3547
+ if (cap !== undefined && n > cap) {
3548
+ return `${provider} takes at most ${cap} reference ${noun}; this request sends ${n}. Remove ${n - cap}.`
3549
+ }
3550
+ }
3551
+ return undefined
3552
+ }
3553
+
3554
+ /**
3555
+ * The references the editor's Run sends a model that refuses an over-limit
3556
+ * request: the first ones, up to its caps — images less the frames that join
3557
+ * them — so an editor run is never refused for references a model switch left
3558
+ * wired (decided 2026-11-16). Every other model's lists come back as they are
3559
+ * (the provider keeps its own trim).
3560
+ */
3561
+ export function trimVideoReferencesToLimits<T>(
3562
+ provider: string | undefined,
3563
+ refs: { images?: readonly T[]; videos?: readonly T[]; audio?: readonly T[]; frames?: number },
3564
+ ): { images?: T[]; videos?: T[]; audio?: T[] } {
3565
+ const row = provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider] : undefined
3566
+ const copy = (l: readonly T[] | undefined) => (l ? [...l] : undefined)
3567
+ if (!row?.requestRefusesOverLimit) return { images: copy(refs.images), videos: copy(refs.videos), audio: copy(refs.audio) }
3568
+ // Counted as the route counts them (`sentVideoReferenceCounts`): blank
3569
+ // entries dropped, the images without duplicates — so what is sent is never
3570
+ // over the caps the route judges.
3571
+ const blank = (x: T) => typeof x === "string" && x.trim().length === 0
3572
+ const clean = (l: readonly T[] | undefined, dedupe = false) =>
3573
+ l ? l.filter((x, i) => !blank(x) && (!dedupe || l.indexOf(x) === i)) : undefined
3574
+ const cut = (l: T[] | undefined, cap: number | undefined) => (l && cap !== undefined ? l.slice(0, Math.max(0, cap)) : l)
3575
+ const imageCap = row.images === undefined ? undefined : row.images - (refs.frames ?? 0)
3576
+ return { images: cut(clean(refs.images, true), imageCap), videos: cut(clean(refs.videos), row.videos), audio: cut(clean(refs.audio), row.audio) }
3577
+ }
3578
+
3384
3579
  /**
3385
3580
  * Reference-video duration limits, provider-declared.
3386
3581
  *
@@ -3405,6 +3600,9 @@ export interface RefVideoDurationLimit {
3405
3600
  */
3406
3601
  export const VIDEO_REF_VIDEO_DURATION_LIMITS: Record<string, RefVideoDurationLimit | undefined> = {
3407
3602
  "seedance-2-5": { minSec: 2, maxSec: 30, maxTotalSec: 30 },
3603
+ // Seedance 2.5 Flash — the same documented bounds: each clip 2-30s, the
3604
+ // reference videos ≤30s together (docs.kie.ai/market/bytedance/seedance-2-5-flash).
3605
+ "seedance-2-5-flash": { minSec: 2, maxSec: 30, maxTotalSec: 30 },
3408
3606
  // MiniMax Hailuo 3 — the provider states the per-clip bound in its own reject
3409
3607
  // text: "content[1].video_url: invalid param: video duration 52838 ms,
3410
3608
  // expected [2000, 15000] ms" (app-reports P4, 2 rows, the same clip retried).
@@ -3428,6 +3626,59 @@ export const VIDEO_REF_VIDEO_DURATION_LIMITS: Record<string, RefVideoDurationLim
3428
3626
  "kling-4-flash": { minSec: 2, maxSec: 20, maxTotalSec: 20 },
3429
3627
  }
3430
3628
 
3629
+ /**
3630
+ * The picture a reference video must have, per provider: only providers with a
3631
+ * documented rule are listed. Seedance 2.5 Flash
3632
+ * (docs.kie.ai/market/bytedance/seedance-2-5-flash): "Total pixels:
3633
+ * [640×640=409600, 834×1112=927408]" (a 480p- or 720p-class picture), "Aspect
3634
+ * ratio (width/height): [0.4, 2.5]" and "Frame rate (FPS): [24, 60]".
3635
+ *
3636
+ * The size and the frame rate are FITTED: the platform re-encodes every
3637
+ * reference video it sends such a model into the window (the provider's
3638
+ * reference-video re-encode), so no clip is refused for them. The shape is
3639
+ * REFUSED ({@link refVideoAspectProblem}) before anything is held: fitting it
3640
+ * would crop or stretch the picture.
3641
+ */
3642
+ export interface RefVideoPictureLimit {
3643
+ readonly minPixels: number
3644
+ readonly maxPixels: number
3645
+ /** Width ÷ height, inclusive. */
3646
+ readonly minAspect: number
3647
+ readonly maxAspect: number
3648
+ /** Frames per second, inclusive. */
3649
+ readonly minFps: number
3650
+ readonly maxFps: number
3651
+ }
3652
+
3653
+ export const VIDEO_REF_VIDEO_PICTURE_LIMITS: Record<string, RefVideoPictureLimit | undefined> = {
3654
+ "seedance-2-5-flash": { minPixels: 409_600, maxPixels: 927_408, minAspect: 0.4, maxAspect: 2.5, minFps: 24, maxFps: 60 },
3655
+ }
3656
+
3657
+ /** "2.5:1" for a ratio at or above 1, "1:2.5" below it. */
3658
+ function aspectText(ratio: number): string {
3659
+ const n = (v: number) => String(Math.round(v * 100) / 100)
3660
+ return ratio >= 1 ? `${n(ratio)}:1` : `1:${n(1 / ratio)}`
3661
+ }
3662
+
3663
+ /**
3664
+ * Why `provider` cannot take a reference video of `width` × `height` pixels, as
3665
+ * a finished sentence, or undefined when it can: its shape (width ÷ height)
3666
+ * outside the provider's `minAspect`–`maxAspect`
3667
+ * ({@link VIDEO_REF_VIDEO_PICTURE_LIMITS}). A provider with no row, or a size
3668
+ * that is not known (not a positive number), is never refused: the run
3669
+ * measures what it can, and a probe that failed must not refuse a run.
3670
+ */
3671
+ export function refVideoAspectProblem(provider: string, width: number | undefined, height: number | undefined): string | undefined {
3672
+ const limit = VIDEO_REF_VIDEO_PICTURE_LIMITS[provider]
3673
+ if (!limit || !width || !height || !(width > 0) || !(height > 0)) return undefined
3674
+ const ratio = width / height
3675
+ if (ratio >= limit.minAspect && ratio <= limit.maxAspect) return undefined
3676
+ return (
3677
+ `This model takes a reference video from ${aspectText(limit.minAspect)} to ${aspectText(limit.maxAspect)} (width to height) — ` +
3678
+ `one is ${width}×${height} (${aspectText(ratio)}). Crop it to a less extreme shape and run again.`
3679
+ )
3680
+ }
3681
+
3431
3682
  /**
3432
3683
  * The length a character's own clip (`characterReferences[].videoUrl`, a video
3433
3684
  * subject) must have, per provider. Kling 4.0 and Kling 4.0 Flash: "one 3-8
@@ -3631,6 +3882,7 @@ export const NATIVE_ADAPTIVE_ASPECT: Record<string, string> = {
3631
3882
  "seedance-2-fast": "adaptive",
3632
3883
  "seedance-2-mini": "adaptive",
3633
3884
  "seedance-2-5": "adaptive",
3885
+ "seedance-2-5-flash": "adaptive",
3634
3886
  // Wan 3.0 family: `adaptive` is the enum DEFAULT and KIE documents it as
3635
3887
  // "automatically selects the ratio based on the input media and intent"
3636
3888
  // (docs.kie.ai/market/wan/3-0-video) — i.e. match-the-input, not merely
@@ -3659,6 +3911,10 @@ export const NATIVE_ADAPTIVE_ASPECT: Record<string, string> = {
3659
3911
  */
3660
3912
  export const FRAME_MODE_ADAPTIVE_ONLY_ASPECT: ReadonlySet<string> = new Set([
3661
3913
  "seedance-2-5",
3914
+ // Seedance 2.5 Flash — DOCUMENTED on its own schema: "First-frame and
3915
+ // first-and-last-frame requests only support `adaptive`"
3916
+ // (docs.kie.ai/market/bytedance/seedance-2-5-flash).
3917
+ "seedance-2-5-flash",
3662
3918
  ])
3663
3919
 
3664
3920
  /**
@@ -3969,6 +4225,8 @@ export const VIDEO_AUDIO_CAPABILITY: Record<string, VideoAudioCapability> = {
3969
4225
  // on KIE and is cost-affecting only through the -ref/no-ref rate split,
3970
4226
  // which the resolution+ref composite already carries (no `:audio` suffix).
3971
4227
  "seedance-2-5": { mode: "audio_driven", field: "generateAudio", defaultOn: true },
4228
+ // Seedance 2.5 Flash — the same lever, default TRUE on KIE.
4229
+ "seedance-2-5-flash": { mode: "audio_driven", field: "generateAudio", defaultOn: true },
3972
4230
  // MiniMax Hailuo 3 — multimodal; lip-syncs to reference audio (r2v). The
3973
4231
  // KIE API exposes NO audio on/off parameter (audio is always produced), so
3974
4232
  // there is no toggle field — alwaysOn, like VEO.
@@ -4193,6 +4451,7 @@ export const VIDEO_VARIABLE_PRICING: Record<string, "duration" | "duration+audio
4193
4451
  "seedance-2-fast": "duration+resolution+ref",
4194
4452
  "seedance-2-mini": "duration+resolution+ref",
4195
4453
  "seedance-2-5": "duration+resolution+ref",
4454
+ "seedance-2-5-flash": "duration+resolution+ref",
4196
4455
  // MiniMax Hailuo 3 — per-second rate at two resolution tiers (2K default /
4197
4456
  // 768P). Duration + resolution form the composite (bare = 2K, ":768p"
4198
4457
  // appended for the cheaper tier); ref-video input seconds + extra input
@@ -4482,6 +4741,8 @@ export function maxVideoDurationSec(provider: string): number | undefined {
4482
4741
  export const PRICING_DEFAULT_RESOLUTION: Record<string, string> = {
4483
4742
  // KIE renders 720p when `resolution` is omitted (kie/models.ts extraParams).
4484
4743
  "seedance-2-5": "720p",
4744
+ // Seedance 2.5 Flash — KIE's documented default is 720p too (kie/models.ts extraParams).
4745
+ "seedance-2-5-flash": "720p",
4485
4746
  // Wan 3.0 family — KIE's OWN default is 1080P, but the provider layer pins
4486
4747
  // 720P (normalizeWan3Resolution / WAN_3_DEFAULT_RESOLUTION) so the rendered
4487
4748
  // tier equals the tier the bare identifier bills. This declaration is what
@@ -4665,6 +4926,8 @@ export const VIDEO_DURATION_TIERS: Record<string, Array<{ maxSeconds: number; su
4665
4926
  { maxSeconds: 15, suffix: "15s" },
4666
4927
  ],
4667
4928
  "seedance-2-5": SEEDANCE_2_5_DURATION_TIERS,
4929
+ // Seedance 2.5 Flash — the same 4-30s, one tier per second.
4930
+ "seedance-2-5-flash": SEEDANCE_2_5_DURATION_TIERS,
4668
4931
  "wan-3": WAN_3_DURATION_TIERS,
4669
4932
  "wan-3-prime": WAN_3_DURATION_TIERS,
4670
4933
  "vidu-q4": VIDU_Q4_DURATION_TIERS,
@@ -210,6 +210,8 @@ const QUALITY_MAP: Record<string, QualityMapping> = {
210
210
  // Seedance 2.5 spans 480p/720p/1080p on KIE (1080p accepted since the
211
211
  // 2026-08-17 re-probe; 4k still rejected), so each quality rung gets its own tier.
212
212
  "seedance-2-5": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
213
+ // Seedance 2.5 Flash — 480p / 720p only, so "high" stays at 720p.
214
+ "seedance-2-5-flash": { field: "resolution", values: { low: "480p", mid: "720p", high: "720p" } },
213
215
  // Wan 3.0 family — 480p / 720p / 1080p (lowercase catalog spellings; the
214
216
  // uppercase KIE wire form is produced only by normalizeWan3Resolution).
215
217
  "wan-3": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
@@ -12,7 +12,14 @@
12
12
  * read the clip's real length. Other models round as they always have.
13
13
  */
14
14
 
15
- /** How far past a whole second a clip is still priced as that second. */
15
+ /**
16
+ * How far past a whole second a clip is still priced as that second — and how
17
+ * far past a mark a measured file may run and still be HELD and CHARGED at
18
+ * that mark by the steps that measure their input and round with no grace of
19
+ * their own (decided 2026-11-14: Video SFX's rows, Pitch & Tempo's and
20
+ * Dubbing's minutes, OmniHuman 2.0's seconds). Their quotes read the length
21
+ * exactly, so a quote is never below the charge of a file up to this past it.
22
+ */
16
23
  export const CLIP_PRICE_GRACE_SEC = 0.05
17
24
 
18
25
  /**
@@ -22,6 +29,17 @@ export const CLIP_PRICE_GRACE_SEC = 0.05
22
29
  */
23
30
  const FLOAT_NOISE_SEC = 1e-9
24
31
 
32
+ /**
33
+ * A measured length less the hair its hold and charge forgive
34
+ * (`CLIP_PRICE_GRACE_SEC`) and less float noise: the ONE arithmetic Video
35
+ * SFX's, Pitch & Tempo's, Dubbing's and OmniHuman 2.0's held rows are read
36
+ * from. It can be 0 or below for a file under the grace; each caller keeps its
37
+ * own floor.
38
+ */
39
+ export function gracedMeasuredSec(measuredSec: number): number {
40
+ return measuredSec - CLIP_PRICE_GRACE_SEC - FLOAT_NOISE_SEC
41
+ }
42
+
25
43
  /** At least one second. The caller has checked that `sec` is a real length. */
26
44
  export function pricedClipSeconds(sec: number): number {
27
45
  return Math.max(1, Math.ceil(sec - CLIP_PRICE_GRACE_SEC - FLOAT_NOISE_SEC))
@@ -0,0 +1,87 @@
1
+ /**
2
+ * How a deployment's own lists withhold what it offers: `surface.nodes` and
3
+ * `surface.models` in its runtime configuration, each an `allow` / `deny`
4
+ * pair. This is the platform's rule before any admin setting (Admin →
5
+ * Availability can replace the lists, and switches models off); a client
6
+ * applies it the same way before the platform's per-viewer answer
7
+ * (`GET /v1/surface/availability`) has arrived, or after it could not be read,
8
+ * so a restricted deployment is judged by its own lists from the first paint.
9
+ * The worlds' half is `worldOffered` (worlds.ts).
10
+ *
11
+ * Structural vocabulary only (ids and node-type names), no content.
12
+ */
13
+
14
+ /** One kind's lists (`surface.nodes`, `surface.models`). */
15
+ export interface SurfaceAllowDeny {
16
+ readonly allow: readonly string[]
17
+ readonly deny: readonly string[]
18
+ }
19
+
20
+ /** Whether a kind's lists say anything: either one names an id. */
21
+ export function listsSet(lists: SurfaceAllowDeny | undefined): boolean {
22
+ return lists !== undefined && (lists.allow.length > 0 || lists.deny.length > 0)
23
+ }
24
+
25
+ /**
26
+ * Whether `lists` withhold `id`. A non-empty `allow` is a whitelist: it
27
+ * withholds every id outside it that it governs (`gated`: a whitelist only
28
+ * inverts over the ids an operator can see and set). `deny` withholds every
29
+ * id it names, governed or not, and wins over `allow`.
30
+ */
31
+ export function listsWithhold(lists: SurfaceAllowDeny, id: string, gated: (id: string) => boolean): boolean {
32
+ if (lists.allow.length > 0 && gated(id) && !lists.allow.includes(id)) return true
33
+ return lists.deny.includes(id)
34
+ }
35
+
36
+ /**
37
+ * Node types an `allow` list never withholds by leaving them out, so only
38
+ * `deny` withholds them: the canvas's utility nodes (they cost nothing and run
39
+ * nothing, and a whitelist that forgot the sticky note must not take away the
40
+ * canvas's notes) and Site Capture (an install switch governs it). The
41
+ * platform's own registry is held to this list.
42
+ */
43
+ export const ALLOW_LIST_EXEMPT_NODE_TYPES: readonly string[] = Object.freeze([
44
+ "collect",
45
+ "component",
46
+ "deduplicate",
47
+ "extract-field",
48
+ "filter-list",
49
+ "group",
50
+ "json-process",
51
+ "merge-lists",
52
+ "preview",
53
+ "router",
54
+ "selector",
55
+ "site-capture",
56
+ "sort-list",
57
+ "sticky-note",
58
+ "teleport-receive",
59
+ "teleport-send",
60
+ ])
61
+
62
+ const EXEMPT: ReadonlySet<string> = new Set(ALLOW_LIST_EXEMPT_NODE_TYPES)
63
+
64
+ /** Whether a node whitelist governs `type`: every node type but {@link ALLOW_LIST_EXEMPT_NODE_TYPES}. */
65
+ export function isAllowListGatedNodeType(type: string): boolean {
66
+ return !EXEMPT.has(type)
67
+ }
68
+
69
+ /**
70
+ * Capabilities a `deny` of another node withholds too: a one-off voice clone
71
+ * inside a speech node is voice cloning behind another door, so a deployment
72
+ * that denies the Voice Clone node withholds it.
73
+ */
74
+ const DENY_OF_NODE_WITHHOLDS: ReadonlyMap<string, string> = new Map([["voice-clone-one-off", "voice-clone"]])
75
+
76
+ /**
77
+ * Whether a deployment's node lists withhold `type`: {@link listsWithhold}
78
+ * over the node types a whitelist governs, and a capability that follows a
79
+ * denied node. `gated` is the caller's universe; by default
80
+ * {@link isAllowListGatedNodeType}, which governs a type it has never heard of
81
+ * (a client then withholds it rather than offering it).
82
+ */
83
+ export function nodeListsWithhold(nodes: SurfaceAllowDeny, type: string, gated: (type: string) => boolean = isAllowListGatedNodeType): boolean {
84
+ if (listsWithhold(nodes, type, gated)) return true
85
+ const follows = DENY_OF_NODE_WITHHOLDS.get(type)
86
+ return follows !== undefined && nodes.deny.includes(follows)
87
+ }