@nodaro/shared 3.61.0 → 3.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/dist/{chunk-4KYLNTR7.cjs → chunk-2PU3AGGS.cjs} +27 -4
  2. package/dist/chunk-2PU3AGGS.cjs.map +1 -0
  3. package/dist/{chunk-43TGSZRJ.js → chunk-2QKF7M2Z.js} +3 -3
  4. package/dist/{chunk-43TGSZRJ.js.map → chunk-2QKF7M2Z.js.map} +1 -1
  5. package/dist/{chunk-B6BG3LV2.js → chunk-34QLPTSA.js} +3 -3
  6. package/dist/{chunk-B6BG3LV2.js.map → chunk-34QLPTSA.js.map} +1 -1
  7. package/dist/chunk-3K24DWOH.js +453 -0
  8. package/dist/chunk-3K24DWOH.js.map +1 -0
  9. package/dist/{chunk-IRQ3SPX7.js → chunk-4DVWXEB6.js} +23 -4
  10. package/dist/chunk-4DVWXEB6.js.map +1 -0
  11. package/dist/{chunk-ZES6EZC4.js → chunk-4MMZD63H.js} +3 -3
  12. package/dist/{chunk-ZES6EZC4.js.map → chunk-4MMZD63H.js.map} +1 -1
  13. package/dist/{chunk-MQZRQ5LM.cjs → chunk-63H4C56Q.cjs} +8 -8
  14. package/dist/{chunk-MQZRQ5LM.cjs.map → chunk-63H4C56Q.cjs.map} +1 -1
  15. package/dist/{chunk-IVXSNW2B.cjs → chunk-6BZC2ZHC.cjs} +18 -332
  16. package/dist/chunk-6BZC2ZHC.cjs.map +1 -0
  17. package/dist/{chunk-M3SXUUWC.cjs → chunk-6FQBKI2A.cjs} +4 -11
  18. package/dist/chunk-6FQBKI2A.cjs.map +1 -0
  19. package/dist/{chunk-673E4KYC.js → chunk-6M563QE6.js} +134 -8
  20. package/dist/chunk-6M563QE6.js.map +1 -0
  21. package/dist/chunk-6TGB7ECA.cjs +48 -0
  22. package/dist/chunk-6TGB7ECA.cjs.map +1 -0
  23. package/dist/{chunk-XUJC6GHE.cjs → chunk-6XUG4L7X.cjs} +6 -6
  24. package/dist/{chunk-XUJC6GHE.cjs.map → chunk-6XUG4L7X.cjs.map} +1 -1
  25. package/dist/{chunk-XZKFZMRT.cjs → chunk-77WU3V3J.cjs} +6 -6
  26. package/dist/{chunk-XZKFZMRT.cjs.map → chunk-77WU3V3J.cjs.map} +1 -1
  27. package/dist/{chunk-ZFJN23V4.cjs → chunk-A2PX5IRC.cjs} +4 -4
  28. package/dist/{chunk-ZFJN23V4.cjs.map → chunk-A2PX5IRC.cjs.map} +1 -1
  29. package/dist/{chunk-ZDBPQBAA.js → chunk-AE3AAJ4O.js} +3 -3
  30. package/dist/{chunk-ZDBPQBAA.js.map → chunk-AE3AAJ4O.js.map} +1 -1
  31. package/dist/chunk-ALRXY4QH.cjs +13 -0
  32. package/dist/chunk-ALRXY4QH.cjs.map +1 -0
  33. package/dist/{chunk-UARGJ5IZ.js → chunk-BMJVKYVB.js} +56 -12
  34. package/dist/chunk-BMJVKYVB.js.map +1 -0
  35. package/dist/{chunk-6XVHYD5R.js → chunk-CLAKSLXF.js} +4 -9
  36. package/dist/chunk-CLAKSLXF.js.map +1 -0
  37. package/dist/chunk-CTANEPMY.js +61 -0
  38. package/dist/chunk-CTANEPMY.js.map +1 -0
  39. package/dist/chunk-CZ5IQB3L.js +42 -0
  40. package/dist/chunk-CZ5IQB3L.js.map +1 -0
  41. package/dist/{chunk-WGKAOUEQ.cjs → chunk-D34K455O.cjs} +3 -2
  42. package/dist/chunk-D34K455O.cjs.map +1 -0
  43. package/dist/chunk-EPXGG27L.js +331 -0
  44. package/dist/chunk-EPXGG27L.js.map +1 -0
  45. package/dist/{chunk-3M4BNKFJ.cjs → chunk-F6WGGYQW.cjs} +167 -3
  46. package/dist/chunk-F6WGGYQW.cjs.map +1 -0
  47. package/dist/{chunk-7FCTCWHD.js → chunk-FXGNRYQQ.js} +3 -3
  48. package/dist/{chunk-7FCTCWHD.js.map → chunk-FXGNRYQQ.js.map} +1 -1
  49. package/dist/{chunk-ZNM2LW3D.cjs → chunk-GMBDLNLD.cjs} +105 -56
  50. package/dist/chunk-GMBDLNLD.cjs.map +1 -0
  51. package/dist/{chunk-NJVOJXBS.cjs → chunk-GSKLPI3J.cjs} +104 -49
  52. package/dist/chunk-GSKLPI3J.cjs.map +1 -0
  53. package/dist/{chunk-EWS2VFO4.js → chunk-HBXF6RUU.js} +4 -4
  54. package/dist/{chunk-EWS2VFO4.js.map → chunk-HBXF6RUU.js.map} +1 -1
  55. package/dist/{chunk-MOMFX32D.js → chunk-HWQ2SYNA.js} +194 -325
  56. package/dist/chunk-HWQ2SYNA.js.map +1 -0
  57. package/dist/{chunk-SCMTN57Y.js → chunk-IY3Y462W.js} +3 -3
  58. package/dist/{chunk-SCMTN57Y.js.map → chunk-IY3Y462W.js.map} +1 -1
  59. package/dist/{chunk-ZZGQRRN7.js → chunk-KCZHQH2O.js} +6 -306
  60. package/dist/chunk-KCZHQH2O.js.map +1 -0
  61. package/dist/{chunk-XROE3CAS.cjs → chunk-KHH54GRP.cjs} +120 -79
  62. package/dist/chunk-KHH54GRP.cjs.map +1 -0
  63. package/dist/{chunk-FVVD6XY2.js → chunk-KL6GAYTT.js} +13 -4
  64. package/dist/chunk-KL6GAYTT.js.map +1 -0
  65. package/dist/{chunk-FVII3KHN.js → chunk-KMGCHV6O.js} +163 -4
  66. package/dist/chunk-KMGCHV6O.js.map +1 -0
  67. package/dist/{chunk-FMXFHJWX.cjs → chunk-L2TVY6XN.cjs} +4 -4
  68. package/dist/{chunk-FMXFHJWX.cjs.map → chunk-L2TVY6XN.cjs.map} +1 -1
  69. package/dist/{chunk-FQXRYPCX.cjs → chunk-LH72PQO2.cjs} +505 -68
  70. package/dist/chunk-LH72PQO2.cjs.map +1 -0
  71. package/dist/chunk-LMAQUR55.cjs +506 -0
  72. package/dist/chunk-LMAQUR55.cjs.map +1 -0
  73. package/dist/{chunk-F5YEMSNK.cjs → chunk-M5OCFGHF.cjs} +571 -30
  74. package/dist/chunk-M5OCFGHF.cjs.map +1 -0
  75. package/dist/{chunk-VOWJCUMR.js → chunk-MD4XHED4.js} +3 -3
  76. package/dist/{chunk-VOWJCUMR.js.map → chunk-MD4XHED4.js.map} +1 -1
  77. package/dist/chunk-N5HH46JF.cjs +68 -0
  78. package/dist/chunk-N5HH46JF.cjs.map +1 -0
  79. package/dist/{chunk-G4XWVWRI.js → chunk-NIAFR5EE.js} +5 -4
  80. package/dist/chunk-NIAFR5EE.js.map +1 -0
  81. package/dist/{chunk-CF4S4N5X.js → chunk-O2QOBA6Q.js} +2 -2
  82. package/dist/{chunk-CF4S4N5X.js.map → chunk-O2QOBA6Q.js.map} +1 -1
  83. package/dist/{chunk-4GGLKRYI.cjs → chunk-O6TBB4IF.cjs} +2 -2
  84. package/dist/{chunk-4GGLKRYI.cjs.map → chunk-O6TBB4IF.cjs.map} +1 -1
  85. package/dist/{chunk-SWVGHAYO.js → chunk-O7RZRUMZ.js} +110 -74
  86. package/dist/chunk-O7RZRUMZ.js.map +1 -0
  87. package/dist/{chunk-LLOIAGFB.js → chunk-OV3JTKBY.js} +449 -51
  88. package/dist/chunk-OV3JTKBY.js.map +1 -0
  89. package/dist/{chunk-A3FHTSLB.js → chunk-PSKZKLDG.js} +550 -31
  90. package/dist/chunk-PSKZKLDG.js.map +1 -0
  91. package/dist/{chunk-VB2ARGQ6.js → chunk-RGNHHIMN.js} +3 -3
  92. package/dist/chunk-RGNHHIMN.js.map +1 -0
  93. package/dist/chunk-SMOO5FAH.js +10 -0
  94. package/dist/chunk-SMOO5FAH.js.map +1 -0
  95. package/dist/{chunk-5XRRENHD.cjs → chunk-TM5JYSJF.cjs} +170 -17
  96. package/dist/chunk-TM5JYSJF.cjs.map +1 -0
  97. package/dist/{chunk-PONP5J5E.cjs → chunk-V24EPI5N.cjs} +13 -3
  98. package/dist/chunk-V24EPI5N.cjs.map +1 -0
  99. package/dist/{chunk-RQ4F3AJH.cjs → chunk-V5EEQR2U.cjs} +21 -21
  100. package/dist/{chunk-RQ4F3AJH.cjs.map → chunk-V5EEQR2U.cjs.map} +1 -1
  101. package/dist/chunk-WZVIBAKN.cjs +351 -0
  102. package/dist/chunk-WZVIBAKN.cjs.map +1 -0
  103. package/dist/{chunk-5M43XMRB.cjs → chunk-X5BAFW3Q.cjs} +8 -8
  104. package/dist/{chunk-5M43XMRB.cjs.map → chunk-X5BAFW3Q.cjs.map} +1 -1
  105. package/dist/{chunk-RUHKBEFF.js → chunk-XBTYGQ6Z.js} +63 -10
  106. package/dist/chunk-XBTYGQ6Z.js.map +1 -0
  107. package/dist/{chunk-JHTT2V4A.cjs → chunk-XGGZWA4A.cjs} +118 -52
  108. package/dist/chunk-XGGZWA4A.cjs.map +1 -0
  109. package/dist/{chunk-5I4T4QR5.cjs → chunk-XGVJGNZW.cjs} +5 -5
  110. package/dist/{chunk-5I4T4QR5.cjs.map → chunk-XGVJGNZW.cjs.map} +1 -1
  111. package/dist/{chunk-7ARKVJTN.cjs → chunk-Y35JQPT6.cjs} +228 -383
  112. package/dist/chunk-Y35JQPT6.cjs.map +1 -0
  113. package/dist/{chunk-AFQFGZN7.cjs → chunk-Y4GCJJPF.cjs} +8 -6
  114. package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
  115. package/dist/{chunk-C77F4ZTL.js → chunk-YUER7TJG.js} +3 -3
  116. package/dist/{chunk-C77F4ZTL.js.map → chunk-YUER7TJG.js.map} +1 -1
  117. package/dist/{chunk-HGI2VKIV.js → chunk-YX6TFX7H.js} +67 -14
  118. package/dist/chunk-YX6TFX7H.js.map +1 -0
  119. package/dist/{chunk-TWF2OSH4.cjs → chunk-ZPE2ZTJ4.cjs} +4 -4
  120. package/dist/{chunk-TWF2OSH4.cjs.map → chunk-ZPE2ZTJ4.cjs.map} +1 -1
  121. package/dist/entries/apps.cjs +44 -44
  122. package/dist/entries/apps.js +9 -9
  123. package/dist/entries/credits.cjs +286 -153
  124. package/dist/entries/credits.d.cts +254 -5
  125. package/dist/entries/credits.d.ts +254 -5
  126. package/dist/entries/credits.js +14 -9
  127. package/dist/entries/entities.cjs +188 -143
  128. package/dist/entries/entities.d.cts +122 -1
  129. package/dist/entries/entities.d.ts +122 -1
  130. package/dist/entries/entities.js +2 -1
  131. package/dist/entries/llm-models.cjs +77 -57
  132. package/dist/entries/llm-models.d.cts +85 -5
  133. package/dist/entries/llm-models.d.ts +85 -5
  134. package/dist/entries/llm-models.js +2 -2
  135. package/dist/entries/media.cjs +92 -87
  136. package/dist/entries/media.d.cts +19 -1
  137. package/dist/entries/media.d.ts +19 -1
  138. package/dist/entries/media.js +3 -2
  139. package/dist/entries/model-catalog.cjs +211 -103
  140. package/dist/entries/model-catalog.d.cts +135 -19
  141. package/dist/entries/model-catalog.d.ts +135 -19
  142. package/dist/entries/model-catalog.js +5 -5
  143. package/dist/entries/models.cjs +504 -295
  144. package/dist/entries/models.d.cts +71 -4
  145. package/dist/entries/models.d.ts +71 -4
  146. package/dist/entries/models.js +7 -6
  147. package/dist/entries/nodes.cjs +249 -233
  148. package/dist/entries/nodes.d.cts +35 -6
  149. package/dist/entries/nodes.d.ts +35 -6
  150. package/dist/entries/nodes.js +10 -10
  151. package/dist/entries/pipeline.cjs +152 -152
  152. package/dist/entries/pipeline.d.cts +3 -2
  153. package/dist/entries/pipeline.d.ts +3 -2
  154. package/dist/entries/pipeline.js +3 -3
  155. package/dist/entries/runtime-config.cjs +29 -29
  156. package/dist/entries/runtime-config.d.cts +10 -7
  157. package/dist/entries/runtime-config.d.ts +10 -7
  158. package/dist/entries/runtime-config.js +1 -1
  159. package/dist/entries/social.cjs +177 -177
  160. package/dist/entries/social.js +2 -2
  161. package/dist/entries/types.d.cts +8 -0
  162. package/dist/entries/types.d.ts +8 -0
  163. package/dist/entries/ugc.cjs +71 -71
  164. package/dist/entries/ugc.js +4 -4
  165. package/dist/entries/video.cjs +316 -208
  166. package/dist/entries/video.d.cts +490 -99
  167. package/dist/entries/video.d.ts +490 -99
  168. package/dist/entries/video.js +8 -4
  169. package/dist/entries/workflow.cjs +102 -102
  170. package/dist/entries/workflow.d.cts +5 -4
  171. package/dist/entries/workflow.d.ts +5 -4
  172. package/dist/entries/workflow.js +2 -2
  173. package/dist/{gpt-image-2-6-BeZdT-pW.d.cts → gpt-image-2-6-jIRQBRag.d.cts} +6 -0
  174. package/dist/{gpt-image-2-6-BeZdT-pW.d.ts → gpt-image-2-6-jIRQBRag.d.ts} +6 -0
  175. package/dist/index.cjs +2727 -2092
  176. package/dist/index.d.cts +11 -11
  177. package/dist/index.d.ts +11 -11
  178. package/dist/index.js +30 -27
  179. package/dist/{model-catalog-BgSvskgY.d.ts → model-catalog-C_Eo35tL.d.cts} +158 -14
  180. package/dist/{model-catalog-BgSvskgY.d.cts → model-catalog-C_Eo35tL.d.ts} +158 -14
  181. package/dist/{model-constants-DHd9jwQ7.d.cts → model-constants-Bg4ccSQb.d.ts} +427 -34
  182. package/dist/{model-constants-DHd9jwQ7.d.ts → model-constants-DWcxOmaY.d.cts} +427 -34
  183. package/package.json +1 -1
  184. package/src/__tests__/credit-identifiers.test.ts +29 -0
  185. package/src/__tests__/extend-providers.test.ts +194 -0
  186. package/src/__tests__/fixtures/mask-composite-quote-parity.json +118 -0
  187. package/src/__tests__/fixtures/root-exports.baseline.json +68 -0
  188. package/src/__tests__/gpt-image-2-6-formats.test.ts +4 -1
  189. package/src/__tests__/grok-video-15-catalog.test.ts +189 -0
  190. package/src/__tests__/gvp-supported-providers.test.ts +32 -4
  191. package/src/__tests__/lip-sync-audio-rate.test.ts +74 -0
  192. package/src/__tests__/lip-sync-levers.test.ts +31 -0
  193. package/src/__tests__/llm-models.test.ts +132 -3
  194. package/src/__tests__/llm-price-key.test.ts +152 -1
  195. package/src/__tests__/minimax-h3-image.test.ts +140 -0
  196. package/src/__tests__/model-makers.test.ts +49 -11
  197. package/src/__tests__/model-tree.test.ts +13 -0
  198. package/src/__tests__/nemotron-transcribe-pricing.test.ts +61 -0
  199. package/src/__tests__/normalize-node-params.test.ts +25 -0
  200. package/src/__tests__/pixverse-v6-max-catalog.test.ts +271 -0
  201. package/src/__tests__/prompt-length-limits.test.ts +4 -0
  202. package/src/__tests__/retired-video-provider.test.ts +15 -5
  203. package/src/__tests__/seedance-25-catalog-modes.test.ts +1 -1
  204. package/src/__tests__/seedance-task-type.test.ts +188 -0
  205. package/src/__tests__/seedream-5-5.test.ts +117 -0
  206. package/src/__tests__/transcribe-capabilities.test.ts +39 -2
  207. package/src/__tests__/transcribe-preflight.test.ts +50 -1
  208. package/src/__tests__/unit-contract-compose.test.ts +27 -1
  209. package/src/__tests__/unit-contracts.test.ts +20 -6
  210. package/src/__tests__/upscale-factors.test.ts +107 -0
  211. package/src/__tests__/video-audio-capability.test.ts +35 -6
  212. package/src/__tests__/video-character-refs.test.ts +20 -2
  213. package/src/__tests__/video-collapse-parity.test.ts +19 -0
  214. package/src/__tests__/video-overlay-geometry.test.ts +68 -0
  215. package/src/__tests__/video-overlay-layer-plan.test.ts +3 -4
  216. package/src/__tests__/video-overlay-layouts.test.ts +529 -0
  217. package/src/__tests__/video-overlay-pricing.test.ts +61 -0
  218. package/src/__tests__/video-overlay-validate.test.ts +128 -0
  219. package/src/__tests__/video-overlay-wired-kind.test.ts +207 -0
  220. package/src/__tests__/video-overlay.test.ts +280 -194
  221. package/src/__tests__/video-ref-limits.test.ts +2 -1
  222. package/src/__tests__/video-reference-only.test.ts +6 -2
  223. package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
  224. package/src/__tests__/video-start-frame-only.test.ts +98 -0
  225. package/src/__tests__/video-upscale-params.test.ts +62 -0
  226. package/src/__tests__/wired-character-names.test.ts +220 -0
  227. package/src/catalog-projection.ts +8 -0
  228. package/src/credit-estimators/index.ts +18 -0
  229. package/src/credit-estimators/nemotron-transcribe.ts +87 -0
  230. package/src/credit-estimators/video-overlay.ts +70 -0
  231. package/src/credit-identifiers.ts +183 -16
  232. package/src/entity-image-url.ts +21 -0
  233. package/src/entries/credits.ts +26 -1
  234. package/src/entries/entities.ts +14 -0
  235. package/src/entries/llm-models.ts +6 -0
  236. package/src/entries/model-catalog.ts +44 -1
  237. package/src/entries/models.ts +69 -0
  238. package/src/entries/nodes.ts +4 -0
  239. package/src/entries/video.ts +7 -1
  240. package/src/freecut-protocol.ts +8 -0
  241. package/src/generated/unit-contracts.ts +8 -1
  242. package/src/gpt-image-2-6.ts +6 -0
  243. package/src/input-image-pricing.ts +76 -0
  244. package/src/lip-sync-levers.ts +56 -0
  245. package/src/lip-sync-pricing.ts +91 -1
  246. package/src/llm-models.ts +249 -4
  247. package/src/mask-composite.ts +11 -0
  248. package/src/minimax-h3-image.ts +61 -0
  249. package/src/model-catalog.ts +604 -40
  250. package/src/model-constants.ts +860 -55
  251. package/src/model-tree.ts +2 -1
  252. package/src/nodaro-video-upscale.ts +48 -0
  253. package/src/node-default-mappings.ts +15 -2
  254. package/src/node-execution-state.ts +4 -3
  255. package/src/normalize-node-params.ts +49 -1
  256. package/src/producer-types.ts +23 -1
  257. package/src/runtime-config/contract.ts +10 -7
  258. package/src/seedance-draft.ts +2 -1
  259. package/src/seedance-task-type.ts +37 -0
  260. package/src/seedream-5-5.ts +45 -0
  261. package/src/transcribe-preflight.ts +58 -7
  262. package/src/unit-contract-compose.ts +4 -1
  263. package/src/upscale-factors.ts +111 -0
  264. package/src/video-character-refs.ts +7 -4
  265. package/src/video-duration.ts +9 -0
  266. package/src/video-overlay-geometry.ts +99 -0
  267. package/src/video-overlay-input.ts +25 -0
  268. package/src/video-overlay-layout-ids.ts +48 -0
  269. package/src/video-overlay-layouts.ts +315 -0
  270. package/src/video-overlay-validate.ts +223 -0
  271. package/src/video-overlay-video-layers.ts +304 -0
  272. package/src/video-overlay.ts +165 -297
  273. package/src/video-ui-defaults.ts +11 -7
  274. package/src/video-upscale-params.ts +67 -0
  275. package/src/wired-character-names.ts +202 -0
  276. package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
  277. package/dist/chunk-4KYLNTR7.cjs.map +0 -1
  278. package/dist/chunk-5XRRENHD.cjs.map +0 -1
  279. package/dist/chunk-673E4KYC.js.map +0 -1
  280. package/dist/chunk-6XVHYD5R.js.map +0 -1
  281. package/dist/chunk-7ARKVJTN.cjs.map +0 -1
  282. package/dist/chunk-7WGKP3EU.js +0 -23
  283. package/dist/chunk-7WGKP3EU.js.map +0 -1
  284. package/dist/chunk-A3FHTSLB.js.map +0 -1
  285. package/dist/chunk-AFQFGZN7.cjs.map +0 -1
  286. package/dist/chunk-F5YEMSNK.cjs.map +0 -1
  287. package/dist/chunk-FQXRYPCX.cjs.map +0 -1
  288. package/dist/chunk-FVII3KHN.js.map +0 -1
  289. package/dist/chunk-FVVD6XY2.js.map +0 -1
  290. package/dist/chunk-G4XWVWRI.js.map +0 -1
  291. package/dist/chunk-HGI2VKIV.js.map +0 -1
  292. package/dist/chunk-IRQ3SPX7.js.map +0 -1
  293. package/dist/chunk-IVXSNW2B.cjs.map +0 -1
  294. package/dist/chunk-JHTT2V4A.cjs.map +0 -1
  295. package/dist/chunk-KHZAQGRP.js +0 -17
  296. package/dist/chunk-KHZAQGRP.js.map +0 -1
  297. package/dist/chunk-LLOIAGFB.js.map +0 -1
  298. package/dist/chunk-M3SXUUWC.cjs.map +0 -1
  299. package/dist/chunk-MOMFX32D.js.map +0 -1
  300. package/dist/chunk-NCOGGRRP.cjs +0 -27
  301. package/dist/chunk-NCOGGRRP.cjs.map +0 -1
  302. package/dist/chunk-NJVOJXBS.cjs.map +0 -1
  303. package/dist/chunk-PONP5J5E.cjs.map +0 -1
  304. package/dist/chunk-RUHKBEFF.js.map +0 -1
  305. package/dist/chunk-SWVGHAYO.js.map +0 -1
  306. package/dist/chunk-UARGJ5IZ.js.map +0 -1
  307. package/dist/chunk-VB2ARGQ6.js.map +0 -1
  308. package/dist/chunk-WGKAOUEQ.cjs.map +0 -1
  309. package/dist/chunk-XROE3CAS.cjs.map +0 -1
  310. package/dist/chunk-ZLDFPVVI.cjs +0 -19
  311. package/dist/chunk-ZLDFPVVI.cjs.map +0 -1
  312. package/dist/chunk-ZNM2LW3D.cjs.map +0 -1
  313. package/dist/chunk-ZZGQRRN7.js.map +0 -1
@@ -0,0 +1,271 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { MODEL_CATALOG, MODEL_MAKERS, defaultResolutionFor, modelMakerOf, normalizeVideoRequestParams } from "../model-catalog.js"
3
+ import {
4
+ IMAGE_TO_VIDEO_PROVIDERS,
5
+ TEXT_TO_VIDEO_PROVIDERS,
6
+ VIDEO_GEN_PROVIDERS,
7
+ PIXVERSE_V6_MAX_PROVIDER,
8
+ PIXVERSE_V6_MAX_DEFAULT_QUALITY,
9
+ isPixverseV6MaxProvider,
10
+ normalizePixverseV6MaxQuality,
11
+ AUDIO_ADDON_PROVIDERS,
12
+ DURATION_PRICED_PROVIDERS,
13
+ RESOLUTION_DURATION_PRICING,
14
+ PRICING_DEFAULT_RESOLUTION,
15
+ VIDEO_DURATION_TIERS,
16
+ VIDEO_REF_LIMITS_BY_PROVIDER,
17
+ VIDEO_VARIABLE_PRICING,
18
+ applyVideoAudioToggle,
19
+ getVideoAudioCapability,
20
+ videoAudioIntent,
21
+ videoAudioPricedOn,
22
+ GVP_SUPPORTED_PROVIDERS,
23
+ GVP_EXTEND_PROVIDERS,
24
+ GVP_END_FRAME_PROVIDERS,
25
+ resolveGvpAnchorWire,
26
+ videoModelCanSpeakDialogue,
27
+ getMaxVideoPromptChars,
28
+ pricedOutputDurationSec,
29
+ videoProviderRequiresImage,
30
+ videoProviderFoldsLoneEndFrame,
31
+ isGvpSupportedProvider,
32
+ } from "../model-constants.js"
33
+ import { buildVideoCreditModelIdentifier, pricedVideoSelection, videoGenerationCreditId } from "../credit-identifiers.js"
34
+ import { uiAspectRatioFill, uiDurationFill, uiResolutionFill } from "../video-ui-defaults.js"
35
+ import { mapQuality } from "../node-default-mappings.js"
36
+
37
+ const ID = "pixverse-v6-max"
38
+ const DURATIONS = Array.from({ length: 15 }, (_, i) => i + 1)
39
+ const QUALITIES = ["360p", "540p", "720p", "1080p"] as const
40
+
41
+ describe("pixverse-v6-max catalog", () => {
42
+ it("one id over both endpoints: text-to-video and image-to-video, 1-15s, 360p-1080p, native audio", () => {
43
+ const m = MODEL_CATALOG[ID]!
44
+ expect(isPixverseV6MaxProvider(ID)).toBe(true)
45
+ expect(PIXVERSE_V6_MAX_PROVIDER).toBe(ID)
46
+ expect([...m.modes].sort()).toEqual(["i2v", "t2v"])
47
+ // No end frame, no reference images / videos / audio, no character subjects.
48
+ expect([...(m.features ?? [])]).toEqual(["audio"])
49
+ expect(m.durations).toEqual(DURATIONS)
50
+ expect(m.defaultDuration).toBe(5)
51
+ expect(m.resolutions).toEqual([...QUALITIES])
52
+ expect(m.defaultResolution).toBe("720p")
53
+ expect(m.unlistedResolutionRendersAs).toBe("720p")
54
+ // Both schemas take a seed (0-2147483647).
55
+ expect(m.noSeed).toBeUndefined()
56
+ // The text-to-video enum, in KIE's order; the image-to-video body takes none.
57
+ expect(m.aspectRatios).toEqual(["16:9", "4:3", "1:1", "3:4", "9:16", "2:3", "3:2", "21:9"])
58
+ })
59
+
60
+ it("is made by PixVerse, a maker of its own", () => {
61
+ expect(MODEL_MAKERS.pixverse).toEqual({ name: "PixVerse" })
62
+ expect(modelMakerOf(MODEL_CATALOG[ID]!)).toEqual({ id: "pixverse", name: "PixVerse" })
63
+ expect(MODEL_CATALOG[ID]!.family).toBe("PixVerse")
64
+ expect(MODEL_CATALOG[ID]!.series).toBe("PixVerse")
65
+ })
66
+
67
+ it("is offered in both video lanes, runs without an image, and takes no references", () => {
68
+ expect(IMAGE_TO_VIDEO_PROVIDERS as readonly string[]).toContain(ID)
69
+ expect(TEXT_TO_VIDEO_PROVIDERS as readonly string[]).toContain(ID)
70
+ expect(VIDEO_GEN_PROVIDERS as readonly string[]).toContain(ID)
71
+ expect(videoProviderRequiresImage(ID)).toBe(false)
72
+ expect(VIDEO_REF_LIMITS_BY_PROVIDER[ID]).toBeUndefined()
73
+ expect(videoProviderFoldsLoneEndFrame(ID)).toBe(false)
74
+ })
75
+
76
+ it("joins Generate Video Pro through its explicit opt-in, keyframes only, with no end anchor", () => {
77
+ expect(MODEL_CATALOG[ID]!.gvpWithoutReferences).toBe(true)
78
+ expect(isGvpSupportedProvider(ID)).toBe(true)
79
+ expect(GVP_SUPPORTED_PROVIDERS as readonly string[]).toContain(ID)
80
+ expect(GVP_EXTEND_PROVIDERS as readonly string[]).not.toContain(ID)
81
+ expect(GVP_END_FRAME_PROVIDERS as readonly string[]).not.toContain(ID)
82
+ })
83
+
84
+ it("a stored reference anchor choice runs as Auto in Generate Video Pro", () => {
85
+ expect(resolveGvpAnchorWire("reference", ID)).toBeUndefined()
86
+ expect(resolveGvpAnchorWire("start-end", ID)).toBe("upfront")
87
+ expect(resolveGvpAnchorWire("start-only", ID)).toBe("progressive")
88
+ // Every other model: "reference" still means none.
89
+ expect(resolveGvpAnchorWire("reference", "seedance-2")).toBe("none")
90
+ expect(resolveGvpAnchorWire("reference")).toBe("none")
91
+ })
92
+
93
+ it("caps the prompt at the schema's 5000 characters", () => {
94
+ expect(getMaxVideoPromptChars(ID)).toBe(5000)
95
+ })
96
+ })
97
+
98
+ describe("the native audio lever", () => {
99
+ it("is cost-affecting, on by default and classified ambient (no live dialogue probe yet)", () => {
100
+ const cap = getVideoAudioCapability(ID)
101
+ expect(cap).toEqual({ mode: "ambient", field: "generateAudioSwitch", affectsCost: true, defaultOn: true, readsGenerateAudio: true })
102
+ expect(AUDIO_ADDON_PROVIDERS.has(ID)).toBe(true)
103
+ expect(videoModelCanSpeakDialogue(ID)).toBe(false)
104
+ })
105
+
106
+ it("writes generate_audio_switch from `sound`, else `generateAudio` — the reading its price follows", () => {
107
+ for (const sound of [true, false]) {
108
+ const input: Record<string, unknown> = {}
109
+ applyVideoAudioToggle(input, ID, { sound })
110
+ expect(input).toEqual({ generate_audio_switch: sound })
111
+ }
112
+ // The Generate Video Pro engine sends `generateAudio` alone.
113
+ for (const generateAudio of [true, false]) {
114
+ const input: Record<string, unknown> = {}
115
+ applyVideoAudioToggle(input, ID, { generateAudio })
116
+ expect(input).toEqual({ generate_audio_switch: generateAudio })
117
+ expect(videoAudioIntent(ID, { generateAudio })).toBe(generateAudio)
118
+ }
119
+ // `sound` wins when both are sent.
120
+ const both: Record<string, unknown> = {}
121
+ applyVideoAudioToggle(both, ID, { sound: false, generateAudio: true })
122
+ expect(both).toEqual({ generate_audio_switch: false })
123
+ // The price reads the same: on with no intent, else the intent.
124
+ expect(videoAudioPricedOn(ID, {})).toBe(true)
125
+ expect(videoAudioPricedOn(ID, { generateAudio: false })).toBe(false)
126
+ expect(videoAudioPricedOn(ID, { sound: true, generateAudio: false })).toBe(true)
127
+ // No intent leaves the caller's own base value in place.
128
+ const base: Record<string, unknown> = { generate_audio_switch: true }
129
+ applyVideoAudioToggle(base, ID, undefined)
130
+ expect(base).toEqual({ generate_audio_switch: true })
131
+ })
132
+ })
133
+
134
+ describe("one quality normalizer for the wire and the bill", () => {
135
+ it("folds case and collapses anything else to 720p", () => {
136
+ expect(PIXVERSE_V6_MAX_DEFAULT_QUALITY).toBe("720p")
137
+ expect(normalizePixverseV6MaxQuality("1080P")).toBe("1080p")
138
+ expect(normalizePixverseV6MaxQuality(" 540p ")).toBe("540p")
139
+ expect(normalizePixverseV6MaxQuality("360p")).toBe("360p")
140
+ for (const off of [undefined, "", "480p", "4k", "2k", "nonsense"]) {
141
+ expect(normalizePixverseV6MaxQuality(off), String(off)).toBe("720p")
142
+ }
143
+ })
144
+
145
+ it("the catalog's collapse target is the normalizer's", () => {
146
+ for (const off of ["480p", "4k", "nonsense"]) {
147
+ expect(normalizeVideoRequestParams(ID, { resolution: off }).resolution, off).toBe(MODEL_CATALOG[ID]!.unlistedResolutionRendersAs)
148
+ }
149
+ })
150
+
151
+ it("the credit identifier bills what the runner renders, for every spelling", () => {
152
+ const cases: Array<[string | undefined, string]> = [
153
+ ["1080P", "1080p"], ["540P", "540p"], ["360p", "360p"], ["720p", "720p"],
154
+ [undefined, "720p"], ["480p", "720p"], ["4k", "720p"], ["nonsense", "720p"],
155
+ ]
156
+ for (const [asked, billed] of cases) {
157
+ expect(normalizePixverseV6MaxQuality(asked)).toBe(billed)
158
+ expect(buildVideoCreditModelIdentifier(ID, 5, false, "image-to-video", undefined, asked)).toBe(`${ID}:5s:${billed}`)
159
+ }
160
+ })
161
+ })
162
+
163
+ describe("the credit identifier", () => {
164
+ it("is one row per second × quality, with `:audio` last when audio is on — and on when unset", () => {
165
+ for (const d of DURATIONS) {
166
+ for (const q of QUALITIES) {
167
+ for (const mode of ["image-to-video", "text-to-video"] as const) {
168
+ expect(buildVideoCreditModelIdentifier(ID, d, false, mode, undefined, q)).toBe(`${ID}:${d}s:${q}`)
169
+ expect(buildVideoCreditModelIdentifier(ID, d, true, mode, undefined, q)).toBe(`${ID}:${d}s:${q}:audio`)
170
+ expect(buildVideoCreditModelIdentifier(ID, d, undefined, mode, undefined, q)).toBe(`${ID}:${d}s:${q}:audio`)
171
+ }
172
+ }
173
+ }
174
+ })
175
+
176
+ it("an unset request is the 5s 720p render with audio, and past 15s holds the top rung", () => {
177
+ expect(buildVideoCreditModelIdentifier(ID)).toBe(`${ID}:5s:720p:audio`)
178
+ expect(buildVideoCreditModelIdentifier(ID, 30, false, "text-to-video", undefined, "1080p")).toBe(`${ID}:15s:1080p`)
179
+ expect(pricedOutputDurationSec(ID, undefined)).toBe(5)
180
+ })
181
+
182
+ it("reads the request's audio fields as the runner does: `sound`, else `generateAudio`, else on", () => {
183
+ expect(buildVideoCreditModelIdentifier(ID, 5, { generateAudio: false }, "image-to-video", undefined, "720p")).toBe(`${ID}:5s:720p`)
184
+ expect(buildVideoCreditModelIdentifier(ID, 5, { generateAudio: true }, "image-to-video", undefined, "720p")).toBe(`${ID}:5s:720p:audio`)
185
+ expect(buildVideoCreditModelIdentifier(ID, 5, { sound: true, generateAudio: false }, "image-to-video", undefined, "720p")).toBe(`${ID}:5s:720p:audio`)
186
+ expect(buildVideoCreditModelIdentifier(ID, 5, {}, "image-to-video", undefined, "720p")).toBe(`${ID}:5s:720p:audio`)
187
+ expect(videoGenerationCreditId({ provider: ID, generateAudio: false })).toBe(`${ID}:5s:720p`)
188
+ })
189
+
190
+ it("Kling keeps reading `sound` alone: `generateAudio` moves none of its rows", () => {
191
+ for (const generateAudio of [true, false, undefined]) {
192
+ expect(buildVideoCreditModelIdentifier("kling-3.0", 10, { generateAudio }, "image-to-video")).toBe("kling-3.0:10s:audio")
193
+ expect(buildVideoCreditModelIdentifier("kling", 5, { generateAudio }, "image-to-video")).toBe("kling:5s")
194
+ expect(buildVideoCreditModelIdentifier("kling-3.0", 10, { sound: false, generateAudio }, "image-to-video")).toBe("kling-3.0:10s")
195
+ }
196
+ })
197
+
198
+ // A request that carries `generateAudio` alone — what a Generate Video Pro
199
+ // segment's provider is handed (the render-rules `gvpSegmentAudio` mapping).
200
+ it("a request carrying `generateAudio` alone is billed at the audio each model renders from it", () => {
201
+ expect(buildVideoCreditModelIdentifier(ID, 6, { generateAudio: true }, "image-to-video", undefined, "720p")).toBe(`${ID}:6s:720p:audio`)
202
+ expect(buildVideoCreditModelIdentifier(ID, 6, { generateAudio: false }, "image-to-video", undefined, "720p")).toBe(`${ID}:6s:720p`)
203
+ expect(buildVideoCreditModelIdentifier(ID, 6, { generateAudio: undefined }, "image-to-video", undefined, "720p")).toBe(`${ID}:6s:720p:audio`)
204
+ for (const generateAudio of [true, false, undefined]) {
205
+ // Kling 3.0 reads only `sound`: its default, on. Kling 2.6: off.
206
+ expect(buildVideoCreditModelIdentifier("kling-3.0", 10, { generateAudio }, "image-to-video")).toBe("kling-3.0:10s:audio")
207
+ expect(buildVideoCreditModelIdentifier("kling", 5, { generateAudio }, "image-to-video")).toBe("kling:5s")
208
+ }
209
+ })
210
+
211
+ it("a model whose price does not depend on audio keeps its rows whatever the request's audio", () => {
212
+ for (const other of ["seedance-2", "seedance-2-mini", "minimax-h3", "kling-4", "vidu-q4", "wan-3"]) {
213
+ const silent = buildVideoCreditModelIdentifier(other, 8, false, "image-to-video", undefined, "720p")
214
+ for (const generateAudio of [true, false, undefined]) {
215
+ expect(buildVideoCreditModelIdentifier(other, 8, { generateAudio }, "image-to-video", undefined, "720p"), other).toBe(silent)
216
+ }
217
+ }
218
+ })
219
+
220
+ it("moving `:audio` after the other dimensions leaves Kling's rows where they were", () => {
221
+ expect(buildVideoCreditModelIdentifier("kling-3.0", 10, true, "image-to-video")).toBe("kling-3.0:10s:audio")
222
+ expect(buildVideoCreditModelIdentifier("kling-3.0", 5, undefined, "image-to-video")).toBe("kling-3.0:5s:audio")
223
+ expect(buildVideoCreditModelIdentifier("kling-3.0", 15, false, "image-to-video")).toBe("kling-3.0:15s")
224
+ expect(buildVideoCreditModelIdentifier("kling", 5, true, "image-to-video")).toBe("kling:5s:audio")
225
+ expect(buildVideoCreditModelIdentifier("kling", 10, undefined, "image-to-video")).toBe("kling:10s")
226
+ })
227
+
228
+ it("is declared on every pricing table the builder reads", () => {
229
+ expect(DURATION_PRICED_PROVIDERS.has(ID)).toBe(true)
230
+ expect(RESOLUTION_DURATION_PRICING[ID]).toEqual([...QUALITIES])
231
+ expect(PRICING_DEFAULT_RESOLUTION[ID]).toBe("720p")
232
+ expect(VIDEO_DURATION_TIERS[ID]!.map((t) => t.suffix)).toEqual(DURATIONS.map((d) => `${d}s`))
233
+ expect(VIDEO_VARIABLE_PRICING[ID]).toBe("duration+resolution+audio")
234
+ })
235
+ })
236
+
237
+ describe("defaults every surface reads", () => {
238
+ it("an unset resolution and duration are 720p and 5s, never the 360p / 1s first entries", () => {
239
+ expect(pricedVideoSelection({ provider: ID })).toEqual({ resolution: "720p", duration: 5, adjustments: [] })
240
+ expect(pricedVideoSelection({ provider: ID, resolution: "360p", duration: 3 })).toEqual({ resolution: "360p", duration: 3, adjustments: [] })
241
+ expect(uiResolutionFill(ID)).toBe("720p")
242
+ expect(uiDurationFill(ID)).toBe(5)
243
+ expect(defaultResolutionFor(ID)).toBe("720p")
244
+ // No aspect fill: the text-to-video runner sends 16:9 (the first listed),
245
+ // and an image-to-video run follows the image.
246
+ expect(uiAspectRatioFill(ID)).toBeUndefined()
247
+ })
248
+
249
+ it("the quality rungs land on 540p / 720p / 1080p", () => {
250
+ expect(mapQuality(ID, "low")).toEqual({ field: "resolution", value: "540p" })
251
+ expect(mapQuality(ID, "mid")).toEqual({ field: "resolution", value: "720p" })
252
+ expect(mapQuality(ID, "high")).toEqual({ field: "resolution", value: "1080p" })
253
+ })
254
+ })
255
+
256
+ describe("the catalog's price rows follow the ladder", () => {
257
+ it("each row is ceil(rate × seconds / 10) × 10 at its quality and audio rate", () => {
258
+ // Base credits a second (KIE credits a second × 2.5, all whole numbers).
259
+ const rate: Record<string, readonly [number, number]> = {
260
+ "360p": [12, 18], "540p": [18, 22], "720p": [22, 30], "1080p": [44, 56],
261
+ }
262
+ const ladder = (q: string, s: number, audio: boolean) => Math.ceil((rate[q]![audio ? 1 : 0] * s) / 10) * 10
263
+ for (const row of MODEL_CATALOG[ID]!.pricing) {
264
+ const m = /^pixverse-v6-max(?::(\d+)s:(\d+p)(:audio)?)?$/.exec(row.identifier)
265
+ expect(m, row.identifier).not.toBeNull()
266
+ // The bare id is the default render: 5s 720p with audio.
267
+ const [s, q, audio] = m![1] ? [Number(m![1]), m![2]!, m![3] !== undefined] : [5, "720p", true]
268
+ expect(row.credits, row.identifier).toBe(ladder(q, s, audio))
269
+ }
270
+ })
271
+ })
@@ -25,6 +25,7 @@ import {
25
25
  VIDEO_GEN_PROVIDERS,
26
26
  VIDEO_TO_VIDEO_PROVIDERS,
27
27
  EXTEND_VIDEO_PROVIDERS,
28
+ LIP_SYNC_PROVIDERS,
28
29
  } from "../model-constants.js"
29
30
 
30
31
  describe("per-model prompt length limits", () => {
@@ -177,6 +178,9 @@ describe("per-model prompt length limits", () => {
177
178
  ...VIDEO_GEN_PROVIDERS,
178
179
  ...VIDEO_TO_VIDEO_PROVIDERS,
179
180
  ...EXTEND_VIDEO_PROVIDERS,
181
+ // A lip-sync model is a video model too: OmniHuman 2.0's prompt is cut to
182
+ // its own 300-character limit (KIE schema) through this same table.
183
+ ...LIP_SYNC_PROVIDERS,
180
184
  ])
181
185
 
182
186
  it("every image-cap key is a real image provider id", () => {
@@ -1,5 +1,6 @@
1
1
  import { describe, expect, it } from "vitest"
2
2
  import {
3
+ EXTEND_VIDEO_PROVIDERS,
3
4
  IMAGE_TO_VIDEO_PROVIDERS,
4
5
  OBJECT_MOTION_PROVIDERS,
5
6
  RETIRED_VIDEO_PROVIDERS,
@@ -10,26 +11,35 @@ import { MODEL_CATALOG } from "../model-catalog.js"
10
11
  import { PIPELINE_PINNABLE_VIDEO_MODELS, PipelineConfigSchema } from "../pipeline-types.js"
11
12
 
12
13
  /**
13
- * A retired video model (Seedance 1.5, retired upstream 2026-10-25) has no
14
+ * A retired video model id (Seedance 1.5, retired upstream 2026-10-25; the one
15
+ * Seedance Extend Video provider, split into one provider per model) has no
14
16
  * catalog entry and is in no provider list; every stored or sent copy of its
15
17
  * id runs as the model it became.
16
18
  */
17
19
  describe("RETIRED_VIDEO_PROVIDERS", () => {
18
- it("a retired id is gone from the catalog and every provider list; the model it runs as is live in both modes", () => {
20
+ it("a retired id is gone from the catalog and every provider list; the model it runs as is live in the list of its own kind", () => {
19
21
  for (const [retired, runsAs] of Object.entries(RETIRED_VIDEO_PROVIDERS)) {
20
22
  expect(MODEL_CATALOG[retired], retired).toBeUndefined()
21
- for (const list of [IMAGE_TO_VIDEO_PROVIDERS, TEXT_TO_VIDEO_PROVIDERS, OBJECT_MOTION_PROVIDERS, PIPELINE_PINNABLE_VIDEO_MODELS]) {
23
+ for (const list of [IMAGE_TO_VIDEO_PROVIDERS, TEXT_TO_VIDEO_PROVIDERS, OBJECT_MOTION_PROVIDERS, PIPELINE_PINNABLE_VIDEO_MODELS, EXTEND_VIDEO_PROVIDERS]) {
22
24
  expect((list as readonly string[]).includes(retired), retired).toBe(false)
23
25
  }
24
26
  expect(MODEL_CATALOG[runsAs]?.kind, runsAs).toBe("video")
25
- expect((IMAGE_TO_VIDEO_PROVIDERS as readonly string[]).includes(runsAs)).toBe(true)
26
- expect((TEXT_TO_VIDEO_PROVIDERS as readonly string[]).includes(runsAs)).toBe(true)
27
+ if (MODEL_CATALOG[runsAs]!.modes.includes("extend")) {
28
+ // An Extend Video provider: live in the extend list.
29
+ expect((EXTEND_VIDEO_PROVIDERS as readonly string[]).includes(runsAs), runsAs).toBe(true)
30
+ } else {
31
+ // A generation model: live in both modes.
32
+ expect((IMAGE_TO_VIDEO_PROVIDERS as readonly string[]).includes(runsAs), runsAs).toBe(true)
33
+ expect((TEXT_TO_VIDEO_PROVIDERS as readonly string[]).includes(runsAs), runsAs).toBe(true)
34
+ }
27
35
  }
28
36
  })
29
37
 
30
38
  it("canonicalVideoProvider maps a retired id and passes anything else through", () => {
31
39
  expect(canonicalVideoProvider("seedance")).toBe("seedance-2-mini")
40
+ expect(canonicalVideoProvider("seedance-2-extend")).toBe("seedance-2-5-extend")
32
41
  expect(canonicalVideoProvider("seedance-2")).toBe("seedance-2")
42
+ expect(canonicalVideoProvider("seedance-2-0-extend")).toBe("seedance-2-0-extend")
33
43
  expect(canonicalVideoProvider(undefined)).toBeUndefined()
34
44
  expect(canonicalVideoProvider("constructor")).toBe("constructor")
35
45
  })
@@ -30,6 +30,6 @@ describe("Seedance 2.5 in the catalog", () => {
30
30
 
31
31
  it("is not listed as an extend model: extending is a model of its own", () => {
32
32
  expect(entry.modes).not.toContain("extend")
33
- expect(MODEL_CATALOG["seedance-2-extend"]?.modes).toContain("extend")
33
+ expect(MODEL_CATALOG["seedance-2-5-extend"]?.modes).toContain("extend")
34
34
  })
35
35
  })
@@ -0,0 +1,188 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import {
3
+ listedSeedanceTaskType,
4
+ resolveSeedanceTaskType,
5
+ seedanceTaskTypeFitsMedia,
6
+ supportsReferenceTaskType,
7
+ SEEDANCE_VIDEO_EDIT_SHAPE,
8
+ type SeedanceTaskTypeFacts,
9
+ } from "../model-constants.js"
10
+ import { isVideoAutoAspectToken, videoAutoAspectRunsAt } from "../model-catalog.js"
11
+
12
+ const base: Omit<SeedanceTaskTypeFacts, "requested"> = {
13
+ provider: "seedance-2-5",
14
+ referenceImageCount: 0,
15
+ referenceAudioCount: 0,
16
+ referenceVideoSec: [6],
17
+ aspectRatio: "16:9",
18
+ duration: 5,
19
+ }
20
+
21
+ /** Nothing declared, ratio and length exactly as given, nothing reported. */
22
+ function expectUnchanged(facts: SeedanceTaskTypeFacts): void {
23
+ expect(resolveSeedanceTaskType(facts)).toEqual({
24
+ taskType: undefined,
25
+ aspectRatio: facts.aspectRatio,
26
+ duration: facts.duration,
27
+ adjustments: [],
28
+ })
29
+ }
30
+
31
+ describe("resolveSeedanceTaskType", () => {
32
+ it("edit: declares it and forces adaptive + Auto", () => {
33
+ const r = resolveSeedanceTaskType({ ...base, requested: "edit" })
34
+ expect(r).toMatchObject({ taskType: "edit", aspectRatio: "adaptive", duration: -1 })
35
+ expect(r.adjustments.map((a) => a.field).sort()).toEqual(["aspectRatio", "duration"])
36
+ })
37
+
38
+ it("extend: forces adaptive, keeps a fixed length, replaces Auto with the model's default", () => {
39
+ expect(resolveSeedanceTaskType({ ...base, requested: "extend" })).toMatchObject({ taskType: "extend", aspectRatio: "adaptive", duration: 5 })
40
+ expect(resolveSeedanceTaskType({ ...base, requested: "extend", duration: -1 }).duration).toBe(8)
41
+ expect(resolveSeedanceTaskType({ ...base, requested: "extend", duration: undefined }).duration).toBe(8)
42
+ })
43
+
44
+ it("reference: declares it and changes nothing, adaptive and Auto included", () => {
45
+ expect(resolveSeedanceTaskType({ ...base, requested: "reference", aspectRatio: "adaptive", duration: -1 }))
46
+ .toEqual({ taskType: "reference", aspectRatio: "adaptive", duration: -1, adjustments: [] })
47
+ expect(resolveSeedanceTaskType({ ...base, requested: "reference", referenceVideoSec: [], referenceImageCount: 2 }).taskType).toBe("reference")
48
+ })
49
+
50
+ it.each([
51
+ ["auto", "auto"], ["absent", undefined], ["wrong case", "EDIT"], ["number", 1], ["array", []], ["null", null],
52
+ ])("%s is Auto: unchanged", (_n, requested) => {
53
+ expectUnchanged({ ...base, requested })
54
+ })
55
+
56
+ it("another model: unchanged, even with a stale value", () => {
57
+ expectUnchanged({ ...base, provider: "kling-4", requested: "edit" })
58
+ })
59
+
60
+ // A draft declares, and is forced, exactly as the same request without Draft:
61
+ // the whole result, for each type, at a fixed and at an automatic length.
62
+ it.each([
63
+ ["edit", 5], ["edit", -1], ["extend", 5], ["extend", -1], ["reference", 5], ["reference", -1],
64
+ ] as const)("a draft declares %s at %s s exactly as a run without Draft", (requested, duration) => {
65
+ const run = resolveSeedanceTaskType({ ...base, requested, duration })
66
+ expect(run.taskType).toBe(requested)
67
+ expect(resolveSeedanceTaskType({ ...base, requested, duration, draft: true })).toStrictEqual(run)
68
+ expect(resolveSeedanceTaskType({ ...base, requested, duration, draft: false })).toStrictEqual(run)
69
+ })
70
+
71
+ it("a draft with an edit it cannot honour declares nothing, as a run without Draft", () => {
72
+ expectUnchanged({ ...base, draft: true, requested: "edit", referenceVideoSec: [3] })
73
+ })
74
+
75
+ it("no reference media at all: unchanged", () => {
76
+ expectUnchanged({ ...base, requested: "reference", referenceVideoSec: [], referenceImageCount: 0, referenceAudioCount: 0 })
77
+ })
78
+
79
+ it("edit or extend without a reference video: unchanged", () => {
80
+ expectUnchanged({ ...base, requested: "edit", referenceVideoSec: [], referenceImageCount: 1 })
81
+ expectUnchanged({ ...base, requested: "extend", referenceVideoSec: [], referenceImageCount: 1 })
82
+ })
83
+
84
+ it.each([[[3]], [[6, 3]], [[31]], [[undefined]], [[6, undefined]]])("edit with videos %j: unchanged", (referenceVideoSec) => {
85
+ expectUnchanged({ ...base, requested: "edit", referenceVideoSec })
86
+ })
87
+
88
+ it("edit at the bounds is declared", () => {
89
+ expect(resolveSeedanceTaskType({ ...base, requested: "edit", referenceVideoSec: [4] }).taskType).toBe("edit")
90
+ expect(resolveSeedanceTaskType({ ...base, requested: "edit", referenceVideoSec: [30] }).taskType).toBe("edit")
91
+ })
92
+
93
+ // Only `edit` needs measured lengths inside 4–30 s: `reference` and `extend`
94
+ // are declared whatever the reference video measures, or if it was not measured.
95
+ it.each([[[3]], [[31]], [[undefined]]])("reference and extend with videos %j are still declared", (referenceVideoSec) => {
96
+ expect(resolveSeedanceTaskType({ ...base, requested: "reference", referenceVideoSec }).taskType).toBe("reference")
97
+ expect(resolveSeedanceTaskType({ ...base, requested: "extend", referenceVideoSec }).taskType).toBe("extend")
98
+ })
99
+
100
+ it("edit reports the ratio and the length it replaces, from and to", () => {
101
+ const { adjustments } = resolveSeedanceTaskType({ ...base, requested: "edit" })
102
+ expect(adjustments).toEqual([
103
+ expect.objectContaining({ field: "aspectRatio", from: "16:9", to: "adaptive" }),
104
+ expect.objectContaining({ field: "duration", from: 5, to: -1 }),
105
+ ])
106
+ })
107
+
108
+ it("edit runs in the purpose-built edit shape", () => {
109
+ const r = resolveSeedanceTaskType({ ...base, requested: "edit" })
110
+ expect({ aspectRatio: r.aspectRatio, duration: r.duration }).toEqual(SEEDANCE_VIDEO_EDIT_SHAPE)
111
+ })
112
+
113
+ it("extend reports the ratio it replaces and an Auto length it replaces, from and to", () => {
114
+ expect(resolveSeedanceTaskType({ ...base, requested: "extend" }).adjustments).toEqual([
115
+ expect.objectContaining({ field: "aspectRatio", from: "16:9", to: "adaptive" }),
116
+ ])
117
+ expect(resolveSeedanceTaskType({ ...base, requested: "extend", duration: -1 }).adjustments).toEqual([
118
+ expect.objectContaining({ field: "aspectRatio", from: "16:9", to: "adaptive" }),
119
+ expect.objectContaining({ field: "duration", from: -1, to: 8 }),
120
+ ])
121
+ })
122
+
123
+ // "Auto" is the unified node's ratio token: with a reference video to match, a
124
+ // model that lists "adaptive" runs it at "adaptive" (`videoAutoAspectRunsAt`,
125
+ // the KIE adapter's own rule), so an edit or extend of an "Auto" request runs
126
+ // at the ratio it asked for — nothing is replaced, so nothing is reported.
127
+ it.each(["edit", "extend"] as const)("%s of an \"Auto\" or \"auto\" ratio reports no ratio adjustment, and still runs at adaptive", (requested) => {
128
+ for (const aspectRatio of ["Auto", "auto"]) {
129
+ const r = resolveSeedanceTaskType({ ...base, requested, aspectRatio, duration: requested === "edit" ? -1 : 8 })
130
+ expect(r).toEqual({ taskType: requested, aspectRatio: "adaptive", duration: requested === "edit" ? -1 : 8, adjustments: [] })
131
+ }
132
+ })
133
+
134
+ it.each(["edit", "extend"] as const)("%s of a fixed ratio still reports it", (requested) => {
135
+ const r = resolveSeedanceTaskType({ ...base, requested, aspectRatio: "16:9", duration: requested === "edit" ? -1 : 8 })
136
+ expect(r.adjustments).toEqual([expect.objectContaining({ field: "aspectRatio", from: "16:9", to: "adaptive" })])
137
+ })
138
+
139
+ it("the Auto token runs at adaptive only with a visual input, on a model that lists adaptive", () => {
140
+ expect(isVideoAutoAspectToken("Auto")).toBe(true)
141
+ expect(isVideoAutoAspectToken("auto")).toBe(true)
142
+ // Exactly the spellings the provider adapter matches.
143
+ for (const other of ["AUTO", " Auto", "adaptive", "16:9", "", undefined]) expect(isVideoAutoAspectToken(other)).toBe(false)
144
+ expect(videoAutoAspectRunsAt("seedance-2-5", true)).toBe("adaptive")
145
+ expect(videoAutoAspectRunsAt("seedance-2-5", false)).toBeUndefined()
146
+ expect(videoAutoAspectRunsAt("kling-4", true)).toBeUndefined()
147
+ expect(videoAutoAspectRunsAt(undefined, true)).toBeUndefined()
148
+ })
149
+
150
+ it("extend filling in a missing length reports nothing", () => {
151
+ const r = resolveSeedanceTaskType({ ...base, requested: "extend", aspectRatio: "adaptive", duration: undefined })
152
+ expect(r).toEqual({ taskType: "extend", aspectRatio: "adaptive", duration: 8, adjustments: [] })
153
+ })
154
+
155
+ it("the catalog names the model", () => {
156
+ expect(supportsReferenceTaskType("seedance-2-5")).toBe(true)
157
+ expect(supportsReferenceTaskType("seedance-2")).toBe(false)
158
+ expect(supportsReferenceTaskType(undefined)).toBe(false)
159
+ })
160
+
161
+ it("listedSeedanceTaskType: a value the model's list holds, matched exactly", () => {
162
+ for (const value of ["reference", "edit", "extend"]) {
163
+ expect(listedSeedanceTaskType("seedance-2-5", value)).toBe(value)
164
+ }
165
+ for (const value of ["auto", "EDIT", undefined, null, 1, []]) {
166
+ expect(listedSeedanceTaskType("seedance-2-5", value)).toBeUndefined()
167
+ }
168
+ expect(listedSeedanceTaskType("seedance-2", "edit")).toBeUndefined()
169
+ expect(listedSeedanceTaskType(undefined, "edit")).toBeUndefined()
170
+ })
171
+ })
172
+
173
+ describe("seedanceTaskTypeFitsMedia — the media each declared type needs", () => {
174
+ const none = { imageCount: 0, videoCount: 0, audioCount: 0 }
175
+
176
+ it("reference takes any reference media", () => {
177
+ expect(seedanceTaskTypeFitsMedia("reference", { ...none, imageCount: 1 })).toBe(true)
178
+ expect(seedanceTaskTypeFitsMedia("reference", { ...none, videoCount: 1 })).toBe(true)
179
+ expect(seedanceTaskTypeFitsMedia("reference", { ...none, audioCount: 1 })).toBe(true)
180
+ expect(seedanceTaskTypeFitsMedia("reference", none)).toBe(false)
181
+ })
182
+
183
+ it.each(["edit", "extend"] as const)("%s needs a reference video", (type) => {
184
+ expect(seedanceTaskTypeFitsMedia(type, { ...none, videoCount: 1 })).toBe(true)
185
+ expect(seedanceTaskTypeFitsMedia(type, { imageCount: 3, videoCount: 0, audioCount: 2 })).toBe(false)
186
+ expect(seedanceTaskTypeFitsMedia(type, none)).toBe(false)
187
+ })
188
+ })
@@ -0,0 +1,117 @@
1
+ import { describe, expect, it } from "vitest"
2
+ import { MODEL_CATALOG, defaultResolutionFor, normalizeModelInput } from "../model-catalog.js"
3
+ import { resolveNormalizedImageGen } from "../credit-identifiers.js"
4
+ import {
5
+ IMAGE_RESOLUTION_VALUES,
6
+ getMinImagePromptChars,
7
+ imageReferenceLimit,
8
+ requestImageLimit,
9
+ T2I_TO_I2I_VARIANT,
10
+ } from "../model-constants.js"
11
+ import { isPricedPerInputImage, isPricedPerInputImageEdit, pricedEstimatedImages, pricedSentImages } from "../input-image-pricing.js"
12
+ import { gptImage26EstimatedImages, gptImage26SentImages } from "../gpt-image-2-6.js"
13
+ import { SEEDREAM_5_5_DEFAULT_RESOLUTION, seedream55Resolution } from "../seedream-5-5.js"
14
+
15
+ describe("Seedream 5.5 in the catalog", () => {
16
+ it("takes 1K, 1.5K and 2K, 2K when none is named", () => {
17
+ for (const id of ["seedream-5-5", "seedream-5-5-i2i"]) {
18
+ expect(MODEL_CATALOG[id]!.resolutions).toEqual(["1K", "1.5K", "2K"])
19
+ expect(defaultResolutionFor(id)).toBe("2K")
20
+ }
21
+ expect(SEEDREAM_5_5_DEFAULT_RESOLUTION).toBe("2K")
22
+ expect(seedream55Resolution(undefined)).toBe("2K")
23
+ expect(seedream55Resolution("1.5k")).toBe("1.5K")
24
+ })
25
+
26
+ it("text to image never lists auto (its schema requires a real ratio); the edit lists it first", () => {
27
+ expect(MODEL_CATALOG["seedream-5-5"]!.aspectRatios).not.toContain("auto")
28
+ expect(MODEL_CATALOG["seedream-5-5"]!.aspectRatios).toHaveLength(8)
29
+ expect(MODEL_CATALOG["seedream-5-5-i2i"]!.aspectRatios![0]).toBe("auto")
30
+ expect(MODEL_CATALOG["seedream-5-5-i2i"]!.aspectRatios).toHaveLength(9)
31
+ })
32
+
33
+ it("auto on text to image becomes a real ratio: the one nearest a photo, else the first listed", () => {
34
+ const none = normalizeModelInput("seedream-5-5", { aspectRatio: "auto" })
35
+ expect(none.aspectRatio).toBe("1:1")
36
+ const portrait = normalizeModelInput("seedream-5-5", { aspectRatio: "auto" }, { sourceImage: { width: 768, height: 1024 } })
37
+ expect(portrait.aspectRatio).toBe("3:4")
38
+ expect(normalizeModelInput("seedream-5-5-i2i", { aspectRatio: "auto" }).aspectRatio).toBe("auto")
39
+ })
40
+
41
+ it("a stale size snaps to its default, 2K, and 1.5K is kept", () => {
42
+ expect(normalizeModelInput("seedream-5-5", { resolution: "4K" }).resolution).toBe("2K")
43
+ expect(normalizeModelInput("seedream-5-5", { resolution: "1.5K" }).resolution).toBe("1.5K")
44
+ expect(normalizeModelInput("seedream-5-5-i2i", { resolution: "1.5k" }).resolution).toBe("1.5K")
45
+ })
46
+
47
+ it("1.5K is in the route vocabulary, and moves to a size the model lists on every other model", () => {
48
+ expect(IMAGE_RESOLUTION_VALUES).toContain("1.5K")
49
+ for (const [id, m] of Object.entries(MODEL_CATALOG)) {
50
+ if (m.kind !== "image" || id.startsWith("seedream-5-5")) continue
51
+ expect(m.resolutions ?? [], id).not.toContain("1.5K")
52
+ const n = normalizeModelInput(id, { resolution: "1.5K" })
53
+ expect(n.resolution === undefined || (m.resolutions ?? []).includes(n.resolution), id).toBe(true)
54
+ }
55
+ })
56
+
57
+ it("a transparent background is kept in PNG and moved to auto in JPEG, before anything is priced", () => {
58
+ expect(normalizeModelInput("seedream-5-5", { background: "transparent" }).background).toBe("transparent")
59
+ expect(normalizeModelInput("seedream-5-5", { background: "transparent", outputFormat: "png" }).background).toBe("transparent")
60
+ const jpeg = normalizeModelInput("seedream-5-5-i2i", { background: "transparent", outputFormat: "jpeg" })
61
+ expect(jpeg.background).toBe("auto")
62
+ expect(jpeg.outputFormat).toBe("jpeg")
63
+ expect(jpeg.adjustments.map((a) => a.field)).toContain("background")
64
+ // A transparent background renders at every size here: nothing moves the size.
65
+ expect(normalizeModelInput("seedream-5-5", { background: "transparent", resolution: "2K" }).resolution).toBe("2K")
66
+ })
67
+
68
+ it("writes PNG or JPEG only", () => {
69
+ expect(normalizeModelInput("seedream-5-5", { outputFormat: "webp" }).outputFormat).toBe("png")
70
+ expect(normalizeModelInput("seedream-5-5", { outputFormat: "jpg" }).outputFormat).toBe("jpeg")
71
+ })
72
+ })
73
+
74
+ describe("Seedream 5.5 input images", () => {
75
+ it("references swap text to image onto the edit, which takes up to 10", () => {
76
+ expect(T2I_TO_I2I_VARIANT["seedream-5-5"]).toBe("seedream-5-5-i2i")
77
+ expect(imageReferenceLimit("seedream-5-5")).toBe(10)
78
+ expect(requestImageLimit("seedream-5-5")).toBe(10)
79
+ expect(requestImageLimit("seedream-5-5-i2i")).toBe(10)
80
+ // Every other model's request limit is unchanged.
81
+ expect(requestImageLimit("seedream-5-flash-i2i")).toBe(14)
82
+ expect(requestImageLimit("gpt-image-2-6-flare-i2i")).toBe(16)
83
+ })
84
+
85
+ it("is priced per input image, and counted as GPT Image 2.6 is", () => {
86
+ expect(isPricedPerInputImage("seedream-5-5")).toBe(true)
87
+ expect(isPricedPerInputImageEdit("seedream-5-5-i2i")).toBe(true)
88
+ expect(isPricedPerInputImage("seedream-5-flash")).toBe(false)
89
+ expect(pricedSentImages("seedream-5-5", ["https://a.png"], "https://b.png")).toBe(2)
90
+ expect(pricedSentImages("seedream-5-flash", ["https://a.png"], "https://b.png")).toBe(1)
91
+ expect(pricedEstimatedImages("seedream-5-5-i2i", { referenceImageUrls: ["https://a.png"] }, 1)).toBe(3)
92
+ // The generic count is GPT Image 2.6's count, unchanged.
93
+ for (const model of ["gpt-image-2-6-flare", "gpt-image-2-6-sunburst-i2i", "gpt-image-2-5-flare", "nano-banana-pro"]) {
94
+ expect(pricedSentImages(model, ["https://a.png"], "https://b.png")).toBe(gptImage26SentImages(model, ["https://a.png"], "https://b.png"))
95
+ const data = { referenceImageUrls: ["https://a.png"], baseImageUrl: "https://b.png", direction: { style: "moodboard:1" } }
96
+ expect(pricedEstimatedImages(model, data, 2)).toBe(gptImage26EstimatedImages(model, data, 2))
97
+ }
98
+ })
99
+
100
+ it("a Generate Image run with references is snapped and priced on the edit's own lists", () => {
101
+ const n = resolveNormalizedImageGen({ provider: "seedream-5-5", aspectRatio: "auto", resolution: "1.5K", refCount: 2, swapToI2i: true })
102
+ expect(n.modelId).toBe("seedream-5-5-i2i")
103
+ expect(n.aspectRatio).toBe("auto")
104
+ expect(n.identifier).toBe("seedream-5-5-i2i:1.5K:2ref")
105
+ const t2i = resolveNormalizedImageGen({ provider: "seedream-5-5", aspectRatio: "auto", refCount: 0, swapToI2i: true })
106
+ expect(t2i.modelId).toBe("seedream-5-5")
107
+ expect(t2i.aspectRatio).toBe("1:1")
108
+ expect(t2i.identifier).toBe("seedream-5-5:2K")
109
+ })
110
+
111
+ it("states a 5-character prompt minimum; no other model has one", () => {
112
+ expect(getMinImagePromptChars("seedream-5-5")).toBe(5)
113
+ expect(getMinImagePromptChars("seedream-5-5-i2i")).toBe(5)
114
+ expect(getMinImagePromptChars("seedream-5-flash")).toBe(0)
115
+ expect(getMinImagePromptChars(undefined)).toBe(0)
116
+ })
117
+ })