@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
@@ -3,8 +3,12 @@ import {
3
3
  TRANSCRIBE_PROVIDERS,
4
4
  TRANSCRIBE_LANES,
5
5
  TRANSCRIBE_PROVIDER_CAPABILITIES,
6
+ CAPTION_TRANSCRIBE_LANES,
7
+ TRANSCRIBE_TARGET_LANGUAGES,
6
8
  transcribeProvidersWithWordTimestamps,
7
9
  transcribeLaneSupportsWordTimestamps,
10
+ transcribeProvidersWithTranslation,
11
+ transcribeLaneSupportsTranslation,
8
12
  DEFAULT_TRANSCRIBE_PROVIDER,
9
13
  DEFAULT_TRANSCRIBE_NODE_PROVIDER,
10
14
  } from "../model-constants.js"
@@ -32,16 +36,49 @@ describe("transcribe lane capabilities", () => {
32
36
  expect(extra, `capability rows for unknown lanes: ${extra.join(", ")}`).toEqual([])
33
37
  })
34
38
 
35
- it("openai/whisper cannot do word timestamps; the other two can", () => {
39
+ it("openai/whisper cannot do word timestamps; the other three can", () => {
36
40
  // Not a taste call: openai/whisper on Replicate has no `word_timestamps`
37
41
  // input in any published version, so the key is silently dropped.
38
42
  expect(TRANSCRIBE_PROVIDER_CAPABILITIES.whisper.wordTimestamps).toBe(false)
39
43
  expect(TRANSCRIBE_PROVIDER_CAPABILITIES["incredibly-fast-whisper"].wordTimestamps).toBe(true)
40
44
  expect(TRANSCRIBE_PROVIDER_CAPABILITIES["elevenlabs-stt"].wordTimestamps).toBe(true)
45
+ expect(TRANSCRIBE_PROVIDER_CAPABILITIES["nemotron-3-5-transcribe"].wordTimestamps).toBe(true)
41
46
  })
42
47
 
43
48
  it("transcribeProvidersWithWordTimestamps derives from the capability map", () => {
44
- expect(transcribeProvidersWithWordTimestamps()).toEqual(["incredibly-fast-whisper", "elevenlabs-stt"])
49
+ expect(transcribeProvidersWithWordTimestamps()).toEqual(["incredibly-fast-whisper", "elevenlabs-stt", "nemotron-3-5-transcribe"])
50
+ })
51
+
52
+ it("only Nemotron 3.5 Transcribe translates", () => {
53
+ expect(transcribeProvidersWithTranslation()).toEqual(["nemotron-3-5-transcribe"])
54
+ expect(transcribeLaneSupportsTranslation("nemotron-3-5-transcribe")).toBe(true)
55
+ expect(transcribeLaneSupportsTranslation("elevenlabs-stt")).toBe(false)
56
+ expect(transcribeLaneSupportsTranslation("deepgram")).toBe(false)
57
+ expect(transcribeLaneSupportsTranslation(undefined)).toBe(false)
58
+ })
59
+
60
+ it("the target languages are KIE's 32 (English first)", () => {
61
+ expect(TRANSCRIBE_TARGET_LANGUAGES[0]).toBe("en")
62
+ expect(TRANSCRIBE_TARGET_LANGUAGES).toHaveLength(32)
63
+ expect(new Set(TRANSCRIBE_TARGET_LANGUAGES).size).toBe(32)
64
+ })
65
+
66
+ it("the new engine joins at the END, so the first word-capable provider stays ElevenLabs STT", () => {
67
+ // Several call sites take "the first enabled word-capable provider" from
68
+ // TRANSCRIBE_PROVIDERS (add-captions' cloud relay among them).
69
+ expect(TRANSCRIBE_PROVIDERS[0]).toBe("elevenlabs-stt")
70
+ expect(TRANSCRIBE_PROVIDERS.find((p) => TRANSCRIBE_PROVIDER_CAPABILITIES[p].wordTimestamps)).toBe("elevenlabs-stt")
71
+ expect(TRANSCRIBE_PROVIDERS[TRANSCRIBE_PROVIDERS.length - 1]).toBe("nemotron-3-5-transcribe")
72
+ })
73
+
74
+ it("Add Captions keeps its three lanes: no length-priced engine runs inside its flat price", () => {
75
+ expect([...CAPTION_TRANSCRIBE_LANES].sort()).toEqual(["elevenlabs-stt", "incredibly-fast-whisper", "whisper"])
76
+ for (const lane of CAPTION_TRANSCRIBE_LANES) expect(TRANSCRIBE_LANES).toContain(lane)
77
+ })
78
+
79
+ it("the defaults do not move", () => {
80
+ expect(DEFAULT_TRANSCRIBE_PROVIDER).toBe("whisper")
81
+ expect(DEFAULT_TRANSCRIBE_NODE_PROVIDER).toBe("elevenlabs-stt")
45
82
  })
46
83
 
47
84
  it("the default lane is itself a lane", () => {
@@ -1,5 +1,5 @@
1
1
  import { describe, it, expect } from "vitest"
2
- import { findWordlessTranscriptFeeds, transcribeWordTimestampsRefusal } from "../transcribe-preflight.js"
2
+ import { findWordlessTranscriptFeeds, transcribeTargetLanguageOf, transcribeTranslationRefusal, transcribeWordTimestampsRefusal } from "../transcribe-preflight.js"
3
3
 
4
4
  const n = (id: string, type: string, data: Record<string, unknown> = {}) => ({ id, type, data })
5
5
  const e = (source: string, sourceHandle: string, target: string, targetHandle: string) => ({ source, sourceHandle, target, targetHandle })
@@ -63,3 +63,52 @@ describe("findWordlessTranscriptFeeds", () => {
63
63
  )).toEqual([])
64
64
  })
65
65
  })
66
+
67
+ // Nemotron 3.5 Transcribe (2026-11-12): word-capable, and the one engine that
68
+ // translates — never together with word timings (KIE refuses the pair).
69
+ describe("Nemotron 3.5 Transcribe: word timings and translation", () => {
70
+ it("is word-capable, unless it translates", () => {
71
+ expect(transcribeWordTimestampsRefusal("nemotron-3-5-transcribe")).toBeNull()
72
+ expect(transcribeWordTimestampsRefusal("nemotron-3-5-transcribe", "en")).toContain("translation")
73
+ expect(transcribeWordTimestampsRefusal("nemotron-3-5-transcribe", "")).toBeNull()
74
+ })
75
+
76
+ it("refuses a translation on any other engine, naming the one that translates", () => {
77
+ for (const lane of ["elevenlabs-stt", "whisper", "incredibly-fast-whisper"]) {
78
+ const msg = transcribeTranslationRefusal(lane, "en")!
79
+ expect(msg).toContain(`"${lane}"`)
80
+ expect(msg).toContain("nemotron-3-5-transcribe")
81
+ }
82
+ // An absent provider is the NODE default (elevenlabs-stt), which does not translate.
83
+ expect(transcribeTranslationRefusal(undefined, "en")).toContain('"elevenlabs-stt"')
84
+ })
85
+
86
+ it("refuses a language KIE does not translate into, and word timings beside a translation", () => {
87
+ expect(transcribeTranslationRefusal("nemotron-3-5-transcribe", "vi")).toContain('"vi"')
88
+ expect(transcribeTranslationRefusal("nemotron-3-5-transcribe", "en", true)).toContain("word timings")
89
+ })
90
+
91
+ it("passes a valid translation, and no translation at all on any engine", () => {
92
+ expect(transcribeTranslationRefusal("nemotron-3-5-transcribe", "he")).toBeNull()
93
+ expect(transcribeTranslationRefusal("nemotron-3-5-transcribe", "en", false)).toBeNull()
94
+ expect(transcribeTranslationRefusal("whisper", undefined, true)).toBeNull()
95
+ expect(transcribeTranslationRefusal("elevenlabs-stt", "")).toBeNull()
96
+ })
97
+
98
+ it("reads a target language as data carries it", () => {
99
+ expect(transcribeTargetLanguageOf(" en ")).toBe("en")
100
+ expect(transcribeTargetLanguageOf("")).toBeUndefined()
101
+ expect(transcribeTargetLanguageOf(undefined)).toBeUndefined()
102
+ expect(transcribeTargetLanguageOf(3)).toBeUndefined()
103
+ })
104
+
105
+ it("a translating node feeding captions is wordless; a transcribing one is not", () => {
106
+ const nodes = (data: Record<string, unknown>) => [n("t", "transcribe", { provider: "nemotron-3-5-transcribe", ...data }), n("c", "add-captions")]
107
+ const edges = [e("t", "json", "c", "transcript")]
108
+ expect(findWordlessTranscriptFeeds(nodes({}), edges)).toEqual([])
109
+ const hits = findWordlessTranscriptFeeds(nodes({ targetLanguage: "en" }), edges)
110
+ expect(hits).toHaveLength(1)
111
+ expect(hits[0]).toMatchObject({ transcribeNodeId: "t", consumerNodeId: "c", provider: "nemotron-3-5-transcribe" })
112
+ expect(hits[0]!.message).toContain("translation")
113
+ })
114
+ })
@@ -17,6 +17,7 @@ type Rows = {
17
17
  UNIT_REVIEW_HOLDS?: readonly string[]
18
18
  UNIT_PRESENTS?: ReadonlyArray<readonly [string, string]>
19
19
  UNIT_FAN_OUT_EACH?: ReadonlyArray<readonly [string, { each: readonly string[]; primary: string }]>
20
+ UNIT_LIST_PIPS?: ReadonlyArray<readonly [string, readonly string[]]>
20
21
  }
21
22
 
22
23
  function withRows(rows: Rows): void {
@@ -29,6 +30,7 @@ function withRows(rows: Rows): void {
29
30
  UNIT_REVIEW_HOLDS: [],
30
31
  UNIT_PRESENTS: [],
31
32
  UNIT_FAN_OUT_EACH: [],
33
+ UNIT_LIST_PIPS: [],
32
34
  ...rows,
33
35
  }))
34
36
  }
@@ -85,10 +87,27 @@ describe("a node unit's contract rows join the published tables", () => {
85
87
  expect(listResultsServeHandle("fixture-case", "json")).toBe(false)
86
88
  })
87
89
 
90
+ it("a list pip's edges run the next node once per item by default; the unit's other pips and an edge naming none keep Selected", async () => {
91
+ withRows({ UNIT_LIST_PIPS: [["fixture-layers", ["layers"]]] })
92
+ const { LIST_OUTPUT_HANDLES, defaultEdgeOutputMode, isListOutputHandle } = await import("../producer-types.js")
93
+ expect(LIST_OUTPUT_HANDLES).toEqual({ "fixture-layers": ["layers"] })
94
+ expect(isListOutputHandle("fixture-layers", "layers")).toBe(true)
95
+ expect(isListOutputHandle("fixture-layers", "base")).toBe(false)
96
+ expect(isListOutputHandle("fixture-layers", undefined)).toBe(false)
97
+ expect(isListOutputHandle("constructor", "layers")).toBe(false)
98
+ expect(defaultEdgeOutputMode("fixture-layers", "layers")).toBe("each")
99
+ expect(defaultEdgeOutputMode("fixture-layers", "base")).toBe("last")
100
+ expect(defaultEdgeOutputMode("fixture-layers", undefined)).toBe("last")
101
+ // A legacy node's default is untouched.
102
+ expect(defaultEdgeOutputMode("split-text", undefined)).toBe("each")
103
+ expect(defaultEdgeOutputMode("generate-image", "image")).toBe("last")
104
+ })
105
+
88
106
  it("with no rows every table is exactly its hand-written entries", async () => {
89
107
  withRows({})
90
- const { FAN_OUT_EACH_HANDLES } = await import("../producer-types.js")
108
+ const { FAN_OUT_EACH_HANDLES, LIST_OUTPUT_HANDLES } = await import("../producer-types.js")
91
109
  expect(Object.keys(FAN_OUT_EACH_HANDLES)).toEqual(["camera-switch", "ugc-clips"])
110
+ expect(LIST_OUTPUT_HANDLES).toEqual({})
92
111
  const { NON_PROMPT_TEXT_LANES } = await import("../fan-out-rows.js")
93
112
  const { REVIEW_HOLDING_USE_CASE_TYPES } = await import("../preview-gate.js")
94
113
  expect(NON_PROMPT_TEXT_LANES.music).toBeUndefined()
@@ -114,6 +133,13 @@ describe("a type that is hand-written and a node unit refuses to load", () => {
114
133
  }
115
134
  })
116
135
 
136
+ describe("a node unit with two list-pip rows refuses to load", () => {
137
+ it("../producer-types.js", async () => {
138
+ withRows({ UNIT_LIST_PIPS: [["fixture-layers", ["layers"]], ["fixture-layers", ["frames"]]] })
139
+ await expect(import("../producer-types.js")).rejects.toThrow(/LIST_OUTPUT_HANDLES: node unit fixture-layers has more than one row/)
140
+ })
141
+ })
142
+
117
143
  describe("a node unit with two fan-out rows refuses to load", () => {
118
144
  it("../producer-types.js", async () => {
119
145
  withRows({ UNIT_FAN_OUT_EACH: [["fixture-case", { each: ["media"], primary: "media" }], ["fixture-case", { each: ["json"], primary: "json" }]] })
@@ -2,14 +2,14 @@
2
2
  import { readFileSync } from "node:fs"
3
3
  import path from "node:path"
4
4
  import { describe, expect, it } from "vitest"
5
- import { UNIT_CONTRACTS, UNIT_FAN_OUT_EACH, UNIT_JSON_PIPS, UNIT_NON_PROMPT_INPUTS, UNIT_PRESENTS, UNIT_REVIEW_HOLDS, UNIT_USE_CASE_TYPES } from "../generated/unit-contracts.js"
5
+ import { UNIT_CONTRACTS, UNIT_FAN_OUT_EACH, UNIT_JSON_PIPS, UNIT_LIST_PIPS, UNIT_NON_PROMPT_INPUTS, UNIT_PRESENTS, UNIT_REVIEW_HOLDS, UNIT_USE_CASE_TYPES } from "../generated/unit-contracts.js"
6
6
 
7
7
  /**
8
8
  * What the node units may put in @nodaro/shared (decided 2026-10-16, widened
9
9
  * 2026-10-18): node type ids with closed vocabularies — the producer kind, the
10
10
  * use-case types, what a JSON pip carries, the non-prompt input pips, the
11
- * review holds, how a published app presents the result and which output pips
12
- * fan out item by item. Each feeds a published table beside its hand-written
11
+ * review holds, how a published app presents the result, which output pips
12
+ * fan out item by item and which carry a list. Each feeds a published table beside its hand-written
13
13
  * rows. Never a price, a credit id, a number, prompt or
14
14
  * doctrine text: every published version of this package is an irrevocable
15
15
  * Apache grant, and those live in backend/ (prices, ee/) and @nodaro/prompts
@@ -22,7 +22,7 @@ const GOLDEN = readFileSync(path.resolve(__dirname, "../../../../tools/units/__f
22
22
  const TYPE = "[a-z][a-z0-9-]*"
23
23
  const ROW_END = `, \\/\\/ unit:${TYPE}$`
24
24
  const PIP = `"[a-zA-Z][\\w-]*"`
25
- /** The seven declarations, in order, each with the one row shape its block may hold, and how the block ends. */
25
+ /** The eight declarations, in order, each with the one row shape its block may hold, and how the block ends. */
26
26
  const DECLARATIONS: ReadonlyArray<{ readonly head: RegExp; readonly row: RegExp; readonly end: string }> = [
27
27
  {
28
28
  head: /^export const UNIT_CONTRACTS: ReadonlyArray<readonly \[type: string, producer: "audio" \| "video" \| "image" \| "dynamic"\]> = \[$/,
@@ -51,11 +51,16 @@ const DECLARATIONS: ReadonlyArray<{ readonly head: RegExp; readonly row: RegExp;
51
51
  row: new RegExp(`^ {2}\\["${TYPE}", \\{ "each": \\[${PIP}(?:, ${PIP})*\\], "primary": ${PIP} \\}\\]${ROW_END}`),
52
52
  end: "]",
53
53
  },
54
+ {
55
+ head: /^export const UNIT_LIST_PIPS: ReadonlyArray<readonly \[type: string, pips: ReadonlyArray<string>\]> = \[$/,
56
+ row: new RegExp(`^ {2}\\["${TYPE}", \\[${PIP}(?:, ${PIP})*\\]\\]${ROW_END}`),
57
+ end: "]",
58
+ },
54
59
  ]
55
60
 
56
61
  /**
57
62
  * Problems with a contracts file's code lines (`//` comments and blanks aside —
58
- * a `/** … *\/` line is code, and refused); [] when it holds exactly the seven
63
+ * a `/** … *\/` line is code, and refused); [] when it holds exactly the eight
59
64
  * declarations, in order, each followed only by its own rows and its end line.
60
65
  */
61
66
  function contractProblems(source: string): string[] {
@@ -98,9 +103,15 @@ describe("generated/unit-contracts.ts carries only type ids with closed vocabula
98
103
  expect(h.each.length).toBeGreaterThan(0)
99
104
  for (const pip of [...h.each, h.primary]) expect(pip).toMatch(PIP_ID)
100
105
  }
106
+ // A list-pip row is a type id and pip ids only.
107
+ for (const [t, pips] of UNIT_LIST_PIPS) {
108
+ expect(t).toMatch(KEBAB)
109
+ expect(pips.length).toBeGreaterThan(0)
110
+ for (const pip of pips) expect(pip).toMatch(PIP_ID)
111
+ }
101
112
  })
102
113
 
103
- it("the file holds nothing else: the seven declarations and their rows", () => {
114
+ it("the file holds nothing else: the eight declarations and their rows", () => {
104
115
  expect(contractProblems(SOURCE)).toEqual([])
105
116
  })
106
117
 
@@ -110,6 +121,7 @@ describe("generated/unit-contracts.ts carries only type ids with closed vocabula
110
121
  const full = GOLDEN
111
122
  .replace("ReadonlyArray<string>]> = [\n", 'ReadonlyArray<string>]> = [\n ["fixture-case", ["media"]], // unit:fixture-case\n')
112
123
  .replace("UNIT_REVIEW_HOLDS: ReadonlyArray<string> = [\n", 'UNIT_REVIEW_HOLDS: ReadonlyArray<string> = [\n "fixture-case", // unit:fixture-case\n')
124
+ .replace("pips: ReadonlyArray<string>]> = [\n", 'pips: ReadonlyArray<string>]> = [\n ["fixture-echo", ["layers"]], // unit:fixture-echo\n')
113
125
  expect(full).not.toBe(GOLDEN)
114
126
  expect(contractProblems(full)).toEqual([])
115
127
  const refused = [
@@ -125,6 +137,8 @@ describe("generated/unit-contracts.ts carries only type ids with closed vocabula
125
137
  GOLDEN.replace('{ "each": ["text"], "primary": "text" }', '{ "each": ["text", 10], "primary": "text" }'),
126
138
  GOLDEN.replace('{ "each": ["text"], "primary": "text" }', '{ "each": ["text"], "primary": "text", "fee": "x" }'),
127
139
  GOLDEN.replace('{ "each": ["text"], "primary": "text" }', '{ "each": ["Make it cinematic"], "primary": "text" }'),
140
+ full.replace('["fixture-echo", ["layers"]]', '["fixture-echo", ["layers", 10]]'),
141
+ full.replace('["fixture-echo", ["layers"]]', '["fixture-echo", ["Split it nicely"]]'),
128
142
  ]
129
143
  for (const [i, src] of refused.entries()) {
130
144
  expect(src, `case ${i} changed the golden`).not.toBe(GOLDEN)
@@ -0,0 +1,107 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import {
3
+ NODARO_IMAGE_UPSCALE_DEFAULT_FACTOR,
4
+ NODARO_IMAGE_UPSCALE_FACTORS,
5
+ UPSCALE_FACTORS,
6
+ resolveNodaroImageUpscaleFactor,
7
+ resolveTopazUpscale,
8
+ resolveUpscaleFactor,
9
+ snappedUpscaleFactor,
10
+ TOPAZ_UPSCALE_FACTORS,
11
+ upscaleFactorsFor,
12
+ } from "../entries/credits.js"
13
+ import { HOUSE_ONLY_UPSCALE_FACTORS } from "../upscale-factors.js"
14
+ import { buildCreditModelIdentifier } from "../credit-identifiers.js"
15
+ import { MODEL_CATALOG } from "../model-catalog.js"
16
+ import { IMAGE_EDIT_PROVIDERS, UPSCALE_IMAGE_PROVIDERS } from "../model-constants.js"
17
+
18
+ describe("the factors each upscaler takes", () => {
19
+ it("Nodaro Image Upscale takes 1 / 2 / 4 / 8, default 2; Topaz keeps 1 / 2 / 4; Recraft takes none", () => {
20
+ expect(NODARO_IMAGE_UPSCALE_FACTORS).toEqual(["1", "2", "4", "8"])
21
+ expect(NODARO_IMAGE_UPSCALE_DEFAULT_FACTOR).toBe("2")
22
+ expect(upscaleFactorsFor("nodaro-image-upscale")).toEqual(["1", "2", "4", "8"])
23
+ expect(upscaleFactorsFor("topaz-image-upscale")).toEqual(TOPAZ_UPSCALE_FACTORS)
24
+ expect(TOPAZ_UPSCALE_FACTORS).toEqual(["1", "2", "4"])
25
+ expect(upscaleFactorsFor("recraft-upscale")).toBeUndefined()
26
+ })
27
+
28
+ it("UPSCALE_FACTORS is every factor any upscaler takes", () => {
29
+ const union = new Set(UPSCALE_IMAGE_PROVIDERS.flatMap((p) => upscaleFactorsFor(p) ?? []))
30
+ expect([...UPSCALE_FACTORS].sort()).toEqual([...union].sort())
31
+ })
32
+ })
33
+
34
+ describe("resolveNodaroImageUpscaleFactor / resolveUpscaleFactor", () => {
35
+ it("a listed factor is rendered as given; anything else at 2", () => {
36
+ for (const f of ["1", "2", "4", "8"]) expect(resolveNodaroImageUpscaleFactor(f)).toBe(f)
37
+ expect(resolveNodaroImageUpscaleFactor(" 8 ")).toBe("8")
38
+ expect(resolveNodaroImageUpscaleFactor(4)).toBe("4")
39
+ for (const f of [undefined, null, "", "3", "16", "8K", 0]) expect(resolveNodaroImageUpscaleFactor(f)).toBe("2")
40
+ })
41
+
42
+ it("Topaz resolves exactly as resolveTopazUpscale (8 still renders at 2, a legacy tier still maps)", () => {
43
+ for (const upscaleFactor of [undefined, "1", "2", "4", "8"]) {
44
+ for (const targetResolution of [undefined, "2K", "4K", "8K"]) {
45
+ expect(resolveUpscaleFactor("topaz-image-upscale", { upscaleFactor, targetResolution })).toBe(
46
+ resolveTopazUpscale({ upscaleFactor, targetResolution }).upscaleFactor,
47
+ )
48
+ }
49
+ }
50
+ })
51
+
52
+ it("Nodaro Image Upscale never reads a stored tier; a model with no factor list is sent its value as before, never an 8", () => {
53
+ expect(resolveUpscaleFactor("nodaro-image-upscale", { targetResolution: "4K" })).toBe("2")
54
+ // As it always was: a stored or mapped 1/2/4 is passed on.
55
+ expect(resolveUpscaleFactor("recraft-upscale", { upscaleFactor: "4" })).toBe("4")
56
+ expect(resolveUpscaleFactor("nano-banana-edit", { upscaleFactor: "2" })).toBe("2")
57
+ expect(resolveUpscaleFactor("grok-2-edit", { upscaleFactor: "1" })).toBe("1")
58
+ expect(resolveUpscaleFactor("recraft-upscale", {})).toBeUndefined()
59
+ // Only the house model takes 8: a node kept from it never sends it elsewhere.
60
+ expect(resolveUpscaleFactor("recraft-upscale", { upscaleFactor: "8" })).toBeUndefined()
61
+ expect(resolveUpscaleFactor(undefined, { upscaleFactor: "8" })).toBeUndefined()
62
+ expect(HOUSE_ONLY_UPSCALE_FACTORS).toEqual(["8"])
63
+ })
64
+ })
65
+
66
+ describe("snappedUpscaleFactor (the editor's fail-safe on a model switch)", () => {
67
+ it("a Nodaro Image Upscale 8x switched to Topaz runs, and is stored, at 2x", () => {
68
+ expect(snappedUpscaleFactor("topaz-image-upscale", { upscaleFactor: "8" })).toBe("2")
69
+ })
70
+
71
+ it("a Nodaro Image Upscale 8x switched to Recraft (or to no model, which runs as Recraft) keeps no factor", () => {
72
+ expect(snappedUpscaleFactor("recraft-upscale", { upscaleFactor: "8" })).toBeNull()
73
+ expect(snappedUpscaleFactor(undefined, { upscaleFactor: "8" })).toBeNull()
74
+ })
75
+
76
+ it("a saved Recraft node's own 1/2/4 stands, as it always did", () => {
77
+ for (const f of ["1", "2", "4"]) expect(snappedUpscaleFactor("recraft-upscale", { upscaleFactor: f }), f).toBeUndefined()
78
+ })
79
+
80
+ it("a factor the new model takes, or no factor stored: nothing to change", () => {
81
+ expect(snappedUpscaleFactor("nodaro-image-upscale", { upscaleFactor: "4" })).toBeUndefined()
82
+ expect(snappedUpscaleFactor("topaz-image-upscale", { upscaleFactor: "4" })).toBeUndefined()
83
+ expect(snappedUpscaleFactor("topaz-image-upscale", {})).toBeUndefined()
84
+ expect(snappedUpscaleFactor("recraft-upscale", {})).toBeUndefined()
85
+ expect(snappedUpscaleFactor("nodaro-image-upscale", { upscaleFactor: "3" })).toBe("2")
86
+ })
87
+ })
88
+
89
+ describe("the catalog and the provider lists", () => {
90
+ it("Nodaro Image Upscale is an own-label image upscaler, priced by output tier with a hold", () => {
91
+ const entry = MODEL_CATALOG["nodaro-image-upscale"]!
92
+ expect(entry).toMatchObject({ kind: "image", modes: ["upscale"], ownLabel: true, family: "Nodaro Upscale", series: "Nodaro Upscale", label: "Nodaro Image Upscale" })
93
+ expect(entry).not.toHaveProperty("maker")
94
+ expect(entry.pricing.map((p) => [p.identifier, p.credits])).toEqual([
95
+ ["nodaro-image-upscale:2K", 4],
96
+ ["nodaro-image-upscale:4K", 10],
97
+ ["nodaro-image-upscale:8K", 30],
98
+ ["nodaro-image-upscale", 30],
99
+ ])
100
+ expect(IMAGE_EDIT_PROVIDERS).toContain("nodaro-image-upscale")
101
+ expect(UPSCALE_IMAGE_PROVIDERS).toContain("nodaro-image-upscale")
102
+ })
103
+
104
+ it("the shared builder prices it at the hold — the size-aware id is built from the image's size, never a stored tier", () => {
105
+ expect(buildCreditModelIdentifier("nodaro-image-upscale", undefined, undefined, undefined, "4K")).toBe("nodaro-image-upscale")
106
+ })
107
+ })
@@ -159,18 +159,34 @@ describe("seedance-2-mini is a full Seedance 2 family member", () => {
159
159
  })
160
160
 
161
161
  describe("VIDEO_AUDIO_CAPABILITY internal consistency", () => {
162
- it("every AUDIO_ADDON provider is cost-affecting on the canonical `sound` lever", () => {
162
+ it("every AUDIO_ADDON provider is cost-affecting on the canonical `sound` intent", () => {
163
163
  // The billing-critical invariant: the `:audio` surcharge keys off `sound`,
164
- // so every surcharged model must declare audio, be marked cost-affecting,
165
- // and carry its toggle on that exact field (applyVideoAudioToggle then
166
- // refuses the generateAudio alias for these, making a billed/generated
167
- // divergence structurally impossible).
164
+ // so every surcharged model must declare audio, be marked cost-affecting
165
+ // (applyVideoAudioToggle then reads ONLY `sound` for it and refuses the
166
+ // generateAudio alias), and have a switch to write it to — Kling's wire
167
+ // key is `sound`, PixVerse V6 Max's `generate_audio_switch`. A
168
+ // billed/generated divergence is then structurally impossible.
168
169
  for (const m of AUDIO_ADDON_PROVIDERS) {
169
170
  const cap = getVideoAudioCapability(m)
170
171
  expect(cap.mode, m).not.toBe("none")
171
- expect(cap.field, m).toBe("sound")
172
+ expect(cap.field, m).toBeDefined()
173
+ expect(cap.alwaysOn, m).toBeUndefined()
172
174
  expect(cap.affectsCost, m).toBe(true)
175
+ for (const sound of [true, false]) {
176
+ const viaSound: Record<string, unknown> = {}
177
+ applyVideoAudioToggle(viaSound, m, { sound })
178
+ expect(Object.values(viaSound), m).toEqual([sound])
179
+ }
180
+ // The alias turns the switch only on a model that declares it reads it
181
+ // (PixVerse V6 Max) — its price reads the same field (videoAudioIntent).
182
+ const viaAlias: Record<string, unknown> = {}
183
+ applyVideoAudioToggle(viaAlias, m, { generateAudio: true })
184
+ expect(viaAlias, m).toEqual(getVideoAudioCapability(m).readsGenerateAudio ? { generate_audio_switch: true } : {})
173
185
  }
186
+ expect(getVideoAudioCapability("kling").field).toBe("sound")
187
+ expect(getVideoAudioCapability("kling-3.0").field).toBe("sound")
188
+ expect(getVideoAudioCapability("kling").readsGenerateAudio).toBeUndefined()
189
+ expect(getVideoAudioCapability("kling-3.0").readsGenerateAudio).toBeUndefined()
174
190
  })
175
191
 
176
192
  it("every VEO provider is native_speech", () => {
@@ -298,3 +314,16 @@ describe("applyVideoAudioToggle — neutral audio intent → per-model KIE field
298
314
  expect(input.generate_audio).toBe(true)
299
315
  })
300
316
  })
317
+
318
+ describe("readsGenerateAudio", () => {
319
+ it("is declared only by a cost-affecting model with a switch (today PixVerse V6 Max alone)", () => {
320
+ const declaring = Object.entries(VIDEO_AUDIO_CAPABILITY).filter(([, cap]) => cap.readsGenerateAudio).map(([m]) => m)
321
+ expect(declaring).toEqual(["pixverse-v6-max"])
322
+ for (const m of declaring) {
323
+ const cap = getVideoAudioCapability(m)
324
+ expect(cap.affectsCost, m).toBe(true)
325
+ expect(cap.field, m).toBeDefined()
326
+ expect(AUDIO_ADDON_PROVIDERS.has(m), m).toBe(true)
327
+ }
328
+ })
329
+ })
@@ -22,15 +22,21 @@ const portrait = (over: Partial<VideoCharacterReference> = {}): VideoCharacterRe
22
22
  })
23
23
 
24
24
  describe("character reference capability (data-driven)", () => {
25
- it("both Gemini Omni SKUs declare a 3-character cap, Kling 4.0 a 7-subject cap; nothing else does", () => {
25
+ it("both Gemini Omni SKUs declare a 3-character cap, Kling 4.0 and Kling 4.0 Flash a 7-subject cap; nothing else does", () => {
26
26
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-video"]?.characters).toBe(3)
27
27
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-flash"]?.characters).toBe(3)
28
28
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4"]?.characters).toBe(7)
29
+ expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4-flash"]?.characters).toBe(7)
29
30
  const others = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER)
30
- .filter(([id, l]) => !id.startsWith("gemini-omni") && id !== "kling-4" && (l?.characters ?? 0) > 0)
31
+ .filter(([id, l]) => !id.startsWith("gemini-omni") && id !== "kling-4" && id !== "kling-4-flash" && (l?.characters ?? 0) > 0)
31
32
  expect(others).toEqual([])
32
33
  })
33
34
 
35
+ it("only Kling 4.0 Flash binds its audio to the characters", () => {
36
+ const binders = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER).filter(([, l]) => l?.audioBindsToCharacters).map(([id]) => id)
37
+ expect(binders).toEqual(["kling-4-flash"])
38
+ })
39
+
34
40
  it("the wire ceiling is the widest declared cap", () => {
35
41
  const widest = Math.max(...Object.values(VIDEO_REF_LIMITS_BY_PROVIDER).map((l) => l?.characters ?? 0))
36
42
  expect(VIDEO_CHARACTER_REFS_WIRE_MAX).toBe(widest)
@@ -115,6 +121,18 @@ describe("videoCharacterRefProblem", () => {
115
121
  expect(videoCharacterRefProblem({ ...base, imageCount: 4, characterReferences: [withBody, withBody] })?.code)
116
122
  .toBe("character_references_quota")
117
123
  })
124
+
125
+ it("Kling 4.0 counts voice clips in its 15 materials; Flash's clips ride the characters and take no seat", () => {
126
+ const two = [portrait(), portrait()]
127
+ // 10 images + 1 start frame + 2 videos + 2 characters = 15.
128
+ const shape = { imageCount: 10, videoCount: 2, hasStartFrame: true, characterReferences: two }
129
+ expect(videoCharacterRefProblem({ ...shape, provider: "kling-4", audioCount: 0 })).toBeNull()
130
+ expect(videoCharacterRefProblem({ ...shape, provider: "kling-4", audioCount: 1 })?.code).toBe("character_references_quota")
131
+ expect(videoCharacterRefProblem({ ...shape, provider: "kling-4-flash", audioCount: 2 })).toBeNull()
132
+ const over = videoCharacterRefProblem({ ...shape, provider: "kling-4-flash", imageCount: 11, audioCount: 2 })
133
+ expect(over?.code).toBe("character_references_quota")
134
+ expect(over?.message).not.toContain("voices")
135
+ })
118
136
  })
119
137
 
120
138
  describe("Gemini Omni voice presets (data)", () => {
@@ -4,6 +4,8 @@ import {
4
4
  normalizeMinimaxH3Resolution,
5
5
  normalizeWan3Resolution,
6
6
  normalizeViduQ4Resolution,
7
+ normalizeGrokVideo15Resolution,
8
+ KLING_4_FLASH_RESOLUTION,
7
9
  VIDEO_GEN_PROVIDERS,
8
10
  } from "../model-constants.js"
9
11
 
@@ -59,6 +61,23 @@ describe("unlistedResolutionRendersAs matches the provider's own collapse rule",
59
61
  }
60
62
  })
61
63
 
64
+ it("grok-imagine-video-1.5 declares what normalizeGrokVideo15Resolution collapses to", () => {
65
+ const declared = MODEL_CATALOG["grok-imagine-video-1.5"]!.unlistedResolutionRendersAs
66
+ expect(declared).toBe("480p")
67
+ for (const off of ["360p", "2k", "4k", "nonsense"]) {
68
+ expect(normalizeGrokVideo15Resolution(off), `grok renders ${off} as`).toBe(declared)
69
+ expect(normalizeVideoRequestParams("grok-imagine-video-1.5", { resolution: off }).resolution).toBe(declared)
70
+ }
71
+ })
72
+
73
+ it("kling-4-flash declares the one band it renders — the runner sends 720p for anything", () => {
74
+ const declared = MODEL_CATALOG["kling-4-flash"]!.unlistedResolutionRendersAs
75
+ expect(declared).toBe(KLING_4_FLASH_RESOLUTION)
76
+ for (const off of ["480p", "1080p", "4k", "nonsense"]) {
77
+ expect(normalizeVideoRequestParams("kling-4-flash", { resolution: off }).resolution).toBe(declared)
78
+ }
79
+ })
80
+
62
81
  it("a declared collapse target is always one of the model's own bands", () => {
63
82
  for (const provider of VIDEO_GEN_PROVIDERS) {
64
83
  const entry = MODEL_CATALOG[provider]
@@ -0,0 +1,68 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { VIDEO_OVERLAY_PRESETS } from "../video-overlay.js"
3
+ import { resolveVideoOverlayGeometry, videoOverlayCanvas } from "../video-overlay-geometry.js"
4
+
5
+ describe("resolveVideoOverlayGeometry (§3.4 — shared by the preview and the worker)", () => {
6
+ it("the card preset on 1080×1920 (the spec's worked example)", () => {
7
+ expect(resolveVideoOverlayGeometry({ w: 1080, h: 1920 }, VIDEO_OVERLAY_PRESETS.card, 1080 / 2160)).toEqual({
8
+ box: { left: 119, top: 307, width: 842, height: 1152 },
9
+ drawn: { left: 252, top: 307, width: 576, height: 1152 },
10
+ })
11
+ })
12
+ it("full-frame on a 9:16 canvas is the whole canvas — no edge shrink", () => {
13
+ expect(resolveVideoOverlayGeometry({ w: 1080, h: 1920 }, VIDEO_OVERLAY_PRESETS["full-frame"], 16 / 9).drawn).toEqual({ left: 0, top: 0, width: 1080, height: 1920 })
14
+ })
15
+ it("a corner badge on 16:9", () => {
16
+ expect(resolveVideoOverlayGeometry({ w: 1920, h: 1080 }, VIDEO_OVERLAY_PRESETS["corner-badge"]["bottom-right"], 1).drawn).toEqual({ left: 1497, top: 691, width: 346, height: 346 })
17
+ })
18
+ it("an odd drawn size is rounded DOWN to even (libx264 yuv420p)", () => {
19
+ expect(resolveVideoOverlayGeometry({ w: 1000, h: 1000 }, { anchor: "top-left", x: 0, y: 0, width: 25, fit: "contain" }, 3).drawn).toEqual({ left: 1, top: 0, width: 248, height: 82 })
20
+ })
21
+ it("a very tall image at width 60 % with no height is fitted inside the canvas (the clamp): 192 × 1920", () => {
22
+ expect(resolveVideoOverlayGeometry({ w: 1080, h: 1920 }, { anchor: "center", x: 0, y: 0, width: 60, fit: "contain" }, 400 / 4000)).toEqual({
23
+ box: { left: 444, top: 0, width: 192, height: 1920 },
24
+ drawn: { left: 444, top: 0, width: 192, height: 1920 },
25
+ })
26
+ })
27
+ it("…and with height 60 % set: box 648 × 1152, contain → 114 × 1152, no clamp", () => {
28
+ const g = resolveVideoOverlayGeometry({ w: 1080, h: 1920 }, { anchor: "center", x: 0, y: 0, width: 60, height: 60, fit: "contain" }, 400 / 4000)
29
+ expect(g.box).toEqual({ left: 216, top: 384, width: 648, height: 1152 })
30
+ expect(g.drawn).toEqual({ left: 483, top: 384, width: 114, height: 1152 })
31
+ })
32
+ it("a drawn size that would round below 2 px is floored at 2 × 2 (Review Focus 4)", () => {
33
+ expect(resolveVideoOverlayGeometry({ w: 100, h: 100 }, { anchor: "top-left", x: 0, y: 0, width: 1, fit: "contain" }, 1).drawn).toMatchObject({ width: 2, height: 2 })
34
+ })
35
+ it("property: drawn is even, ≥ 2 and never larger than the canvas", () => {
36
+ const canvases = [{ w: 1080, h: 1920 }, { w: 1920, h: 1080 }, { w: 100, h: 100 }, { w: 640, h: 360 }]
37
+ for (const canvas of canvases) {
38
+ for (let width = 1; width <= 100; width += 7) {
39
+ for (const height of [undefined, 1, 14, 60, 100]) {
40
+ for (const aspect of [0.05, 0.5, 1, 2, 20]) {
41
+ for (const fit of ["contain", "cover"] as const) {
42
+ const { drawn } = resolveVideoOverlayGeometry(canvas, { anchor: "center", x: 0, y: 0, width, height, fit }, aspect)
43
+ expect(drawn.width % 2).toBe(0)
44
+ expect(drawn.height % 2).toBe(0)
45
+ expect(drawn.width).toBeGreaterThanOrEqual(2)
46
+ expect(drawn.width).toBeLessThanOrEqual(canvas.w)
47
+ expect(drawn.height).toBeLessThanOrEqual(canvas.h)
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ })
54
+ })
55
+
56
+ describe("videoOverlayCanvas", () => {
57
+ it("is the display size: SAR resolved, even-rounded", () => {
58
+ expect(videoOverlayCanvas({ width: 540, height: 1920, sar: 2 })).toEqual({ w: 1080, h: 1920 })
59
+ expect(videoOverlayCanvas({ width: 1079, height: 1919 })).toEqual({ w: 1078, h: 1918 })
60
+ })
61
+ it("a target aspect wins", () => {
62
+ expect(videoOverlayCanvas({ width: 1920, height: 1080 }, "9:16")).toEqual({ w: 1080, h: 1920 })
63
+ expect(videoOverlayCanvas(null, "4:5")).toEqual({ w: 1080, h: 1350 })
64
+ })
65
+ it("unknown size and no aspect → null", () => {
66
+ expect(videoOverlayCanvas(null)).toBeNull()
67
+ })
68
+ })
@@ -2,13 +2,12 @@ import { describe, expect, it } from "vitest"
2
2
  import {
3
3
  VIDEO_OVERLAY_MAX_LAYERS,
4
4
  assembleVideoOverlayRequest,
5
- formatVideoOverlayError,
6
5
  parseVideoOverlayLayerPlan,
7
- validateVideoOverlayRequest,
8
6
  videoOverlayCompositionKey,
9
7
  videoOverlayRenderOrder,
10
8
  videoOverlaySlotSources,
11
9
  } from "../video-overlay.js"
10
+ import { formatVideoOverlayError, validateVideoOverlayRequest } from "../video-overlay-validate.js"
12
11
 
13
12
  const box = { anchor: "top", x: 0, y: 12, width: 78, height: 52, fit: "contain" } as const
14
13
  const plan = [
@@ -47,13 +46,13 @@ describe("the layerPlan input (SP2 D6, spec §6.1)", () => {
47
46
  expect(verdict.ok).toBe(false)
48
47
  if (!verdict.ok) {
49
48
  expect(verdict.code).toBe("layer_without_image")
50
- expect(formatVideoOverlayError(verdict)).toBe("Plan layer 1: no image — set imageUrl on this layer in the plan.")
49
+ expect(formatVideoOverlayError(verdict)).toBe("Plan layer 1: no image or video — set imageUrl or videoUrl on this layer in the plan.")
51
50
  }
52
51
  })
53
52
  it("a handle layer without an image keeps the handle wording", () => {
54
53
  const verdict = validateVideoOverlayRequest({ layers: [{ start: 0, slot: 2 }] })
55
54
  expect(verdict.ok).toBe(false)
56
- if (!verdict.ok) expect(formatVideoOverlayError(verdict)).toBe("Layer 2: no image — connect one to the layer's handle or set imageUrl")
55
+ if (!verdict.ok) expect(formatVideoOverlayError(verdict)).toBe("Layer 2: no image or video — connect one to the layer's handle or set imageUrl or videoUrl")
57
56
  })
58
57
  it("reports an unparseable plan as invalid_layer_plan", () => {
59
58
  const req = assembleVideoOverlayRequest({ videoUrl: "https://cdn.example/v.mp4", data: { layers: [] }, wiredImageUrls: [], planLayers: "not json" })