@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,98 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { MODEL_CATALOG } from "../model-catalog.js"
3
+ import {
4
+ GROK_VIDEO_15_PROVIDER,
5
+ grokVideo15MiddleFrameSlots,
6
+ VIDEO_START_FRAME_ONLY_CODE,
7
+ videoStartFrameOnlyMessage,
8
+ videoStartFrameOnlyProblem,
9
+ videoStartFrameOnlyResolution,
10
+ } from "../model-constants.js"
11
+
12
+ const GROK = GROK_VIDEO_15_PROVIDER
13
+
14
+ const SENTENCE =
15
+ "Grok Imagine Video 1.5 takes a start frame only at 1080p: no end frame, loop or in-between frames. " +
16
+ "Choose 720p, or remove the end frame and the in-between frames."
17
+
18
+ describe("start-frame-only resolutions are declared in the catalog", () => {
19
+ it("Grok Imagine Video 1.5 takes a start frame only at 1080p", () => {
20
+ expect(MODEL_CATALOG[GROK]!.startFrameOnlyResolutions).toEqual(["1080p"])
21
+ })
22
+
23
+ it("every declared tier is one of the model's own resolutions", () => {
24
+ for (const [id, entry] of Object.entries(MODEL_CATALOG)) {
25
+ for (const tier of entry.startFrameOnlyResolutions ?? []) {
26
+ expect(entry.resolutions ?? [], `${id} declares ${tier}`).toContain(tier)
27
+ }
28
+ }
29
+ })
30
+
31
+ it("a model that declares none is never refused", () => {
32
+ expect(videoStartFrameOnlyResolution("kling-4-keyframes", "1080p")).toBeUndefined()
33
+ expect(videoStartFrameOnlyProblem("kling-4-keyframes", { resolution: "1080p", hasEndFrame: true, inBetweenFrameCount: 3 })).toBeUndefined()
34
+ expect(videoStartFrameOnlyProblem(undefined, { resolution: "1080p", hasEndFrame: true, inBetweenFrameCount: 3 })).toBeUndefined()
35
+ })
36
+
37
+ it("reads the resolution case-folded, as the runner sends it", () => {
38
+ expect(videoStartFrameOnlyResolution(GROK, "1080P")).toBe("1080p")
39
+ expect(videoStartFrameOnlyResolution(GROK, " 1080p ")).toBe("1080p")
40
+ expect(videoStartFrameOnlyResolution(GROK, "720p")).toBeUndefined()
41
+ expect(videoStartFrameOnlyResolution(GROK, undefined)).toBeUndefined()
42
+ })
43
+ })
44
+
45
+ describe("videoStartFrameOnlyProblem — every combination at 480p, 720p and 1080p", () => {
46
+ const RESOLUTIONS = ["480p", "720p", "1080p"] as const
47
+ const DURATIONS = Array.from({ length: 15 }, (_, i) => i + 1)
48
+
49
+ for (const resolution of RESOLUTIONS) {
50
+ for (const hasEndFrame of [false, true]) {
51
+ for (let wired = 0; wired <= 6; wired++) {
52
+ it(`${resolution}, end frame ${hasEndFrame ? "(or loop) " : "none, "}${wired} in-between frame(s) wired, 1–15s`, () => {
53
+ for (const durationSec of DURATIONS) {
54
+ const sent = Math.min(wired, grokVideo15MiddleFrameSlots(durationSec))
55
+ const refused = resolution === "1080p" && (hasEndFrame || sent > 0)
56
+ const problem = videoStartFrameOnlyProblem(GROK, { resolution, durationSec, hasEndFrame, inBetweenFrameCount: wired })
57
+ expect(problem !== undefined, `${durationSec}s`).toBe(refused)
58
+ if (problem) {
59
+ expect(problem.code).toBe(VIDEO_START_FRAME_ONLY_CODE)
60
+ expect(problem.message).toBe(SENTENCE)
61
+ }
62
+ }
63
+ })
64
+ }
65
+ }
66
+ }
67
+
68
+ it("a start frame alone runs at 1080p", () => {
69
+ expect(videoStartFrameOnlyProblem(GROK, { resolution: "1080p", durationSec: 8, hasEndFrame: false, inBetweenFrameCount: 0 })).toBeUndefined()
70
+ })
71
+
72
+ it("in-between frames all dropped by the clip's cap leave a start-only run, which runs at 1080p", () => {
73
+ // A 1-second clip has no whole second inside it: every in-between frame is dropped.
74
+ expect(grokVideo15MiddleFrameSlots(1)).toBe(0)
75
+ expect(videoStartFrameOnlyProblem(GROK, { resolution: "1080p", durationSec: 1, hasEndFrame: false, inBetweenFrameCount: 4 })).toBeUndefined()
76
+ // ...but an end frame beside it is still sent, so that run is refused.
77
+ expect(videoStartFrameOnlyProblem(GROK, { resolution: "1080p", durationSec: 1, hasEndFrame: true, inBetweenFrameCount: 4 })).toBeDefined()
78
+ // A 2-second clip keeps one of them, so it is refused.
79
+ expect(videoStartFrameOnlyProblem(GROK, { resolution: "1080p", durationSec: 2, hasEndFrame: false, inBetweenFrameCount: 4 })).toBeDefined()
80
+ })
81
+
82
+ it("an unset duration is judged at the length the run renders (the 8s default)", () => {
83
+ expect(videoStartFrameOnlyProblem(GROK, { resolution: "1080p", hasEndFrame: false, inBetweenFrameCount: 1 })).toBeDefined()
84
+ })
85
+ })
86
+
87
+ describe("the refusal sentence", () => {
88
+ it("says the tier takes a start frame only, and offers 720p or removing the frames", () => {
89
+ expect(videoStartFrameOnlyMessage(GROK, "1080p")).toBe(SENTENCE)
90
+ })
91
+
92
+ it("says nothing was charged only for a refused run", () => {
93
+ expect(videoStartFrameOnlyMessage(GROK, "1080p", { nothingCharged: true })).toBe(`${SENTENCE} Nothing was charged.`)
94
+ expect(
95
+ videoStartFrameOnlyProblem(GROK, { resolution: "1080p", hasEndFrame: true, inBetweenFrameCount: 0, nothingCharged: true })!.message,
96
+ ).toBe(`${SENTENCE} Nothing was charged.`)
97
+ })
98
+ })
@@ -0,0 +1,62 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { MODEL_CATALOG } from "../model-catalog.js"
3
+ import { normalizeVideoUpscaleResolution, videoUpscaleModelOf, videoUpscaleResolutionsFor, VIDEO_UPSCALE_RESOLUTIONS } from "../video-upscale-params.js"
4
+ import { normalizeNodeModelParams } from "../normalize-node-params.js"
5
+ import { VIDEO_UPSCALE_PROVIDERS } from "../model-constants.js"
6
+ import { NODARO_VIDEO_UPSCALE_DEFAULT_TIER, NODARO_VIDEO_UPSCALE_TIERS } from "../nodaro-video-upscale.js"
7
+ import { TOPAZ_VIDEO_RESOLUTIONS } from "../topaz-video.js"
8
+
9
+ /**
10
+ * The Video Upscale node's target resolution: held to what its provider takes
11
+ * only for a provider whose catalog entry declares its resolutions — Nodaro
12
+ * Video Upscale's 1080p / 2K / 4K. Topaz keeps its own list (720p / 1080p /
13
+ * 4K, `TOPAZ_VIDEO_RESOLUTIONS`) and every other provider's node is left
14
+ * exactly as it came: its run reads the field by its own rules.
15
+ */
16
+ describe("Video Upscale target resolution per provider", () => {
17
+ it("only Nodaro Video Upscale's catalog entry declares resolutions; the route's enum covers every provider's", () => {
18
+ expect(videoUpscaleResolutionsFor("nodaro-video-upscale")).toEqual([...NODARO_VIDEO_UPSCALE_TIERS])
19
+ for (const p of ["topaz", undefined, "veo-1080p", "veo-4k", "seedance-2-5-hd"]) {
20
+ expect(videoUpscaleResolutionsFor(p), String(p)).toEqual([])
21
+ }
22
+ expect(MODEL_CATALOG["topaz-video"]).not.toHaveProperty("resolutions")
23
+ expect(MODEL_CATALOG["topaz-video"]).not.toHaveProperty("defaultResolution")
24
+ for (const p of VIDEO_UPSCALE_PROVIDERS) expect(MODEL_CATALOG[videoUpscaleModelOf(p)], p).toBeDefined()
25
+ for (const r of [...TOPAZ_VIDEO_RESOLUTIONS, ...NODARO_VIDEO_UPSCALE_TIERS]) expect(VIDEO_UPSCALE_RESOLUTIONS).toContain(r)
26
+ })
27
+
28
+ it("coerces a value Nodaro Video Upscale does not take to its default, and canonicalises its spelling", () => {
29
+ expect(MODEL_CATALOG["nodaro-video-upscale"]!.defaultResolution).toBe(NODARO_VIDEO_UPSCALE_DEFAULT_TIER)
30
+ expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", "720p").targetResolution).toBe("1080p")
31
+ expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", "720p").adjustment?.reason).toMatch(/Nodaro Video Upscale/)
32
+ expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", "2K")).toEqual({ targetResolution: "2k" })
33
+ })
34
+
35
+ it("leaves every other provider's value, and an unset value, as it came", () => {
36
+ expect(normalizeVideoUpscaleResolution("topaz", "2k")).toEqual({ targetResolution: "2k" })
37
+ expect(normalizeVideoUpscaleResolution("topaz", "4K")).toEqual({ targetResolution: "4K" })
38
+ expect(normalizeVideoUpscaleResolution(undefined, "2k")).toEqual({ targetResolution: "2k" })
39
+ expect(normalizeVideoUpscaleResolution("veo-4k", "1080p")).toEqual({ targetResolution: "1080p" })
40
+ expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", undefined)).toEqual({ targetResolution: undefined })
41
+ expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", "")).toEqual({ targetResolution: undefined })
42
+ })
43
+
44
+ it("a node written straight into workflow JSON: only Nodaro Video Upscale's is healed; Topaz's, VEO's and an unnamed provider's come back as the same node", () => {
45
+ const nodes = [
46
+ // Topaz's spellings and another provider's target: left for its run, which drops what it does not take.
47
+ { id: "a", type: "video-upscale", data: { provider: "topaz", targetResolution: "4K" } },
48
+ // The old factor path stays: the run reads the factor when the target is not Topaz's.
49
+ { id: "b", type: "video-upscale", data: { provider: "topaz", targetResolution: "2k", upscaleFactor: "2" } },
50
+ // No provider named: Topaz, left alone.
51
+ { id: "c", type: "video-upscale", data: { targetResolution: "720P" } },
52
+ { id: "d", type: "video-upscale", data: { provider: "veo-4k", targetResolution: "2k" } },
53
+ { id: "e", type: "video-upscale", data: { provider: "nodaro-video-upscale", targetResolution: "720p", label: "E" } },
54
+ { id: "f", type: "video-upscale", data: { provider: "topaz", targetResolution: "8k", upscaleFactor: "4" } },
55
+ { id: "g", type: "video-upscale", data: { provider: "topaz", targetResolution: "2k", targetFps: 30 } },
56
+ ]
57
+ const { nodes: out, adjustments } = normalizeNodeModelParams(nodes)
58
+ for (const i of [0, 1, 2, 3, 5, 6]) expect(out[i], nodes[i]!.id).toBe(nodes[i])
59
+ expect(out[4]!.data).toEqual({ provider: "nodaro-video-upscale", targetResolution: "1080p", label: "E" })
60
+ expect(adjustments.map((a) => [a.nodeId, a.from, a.to])).toEqual([["e", "720p", "1080p"]])
61
+ })
62
+ })
@@ -0,0 +1,220 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import {
3
+ CHARACTER_NODE_DEFAULT_LABEL,
4
+ CHARACTER_NODE_RETIRED_DEFAULT_LABELS,
5
+ characterOwnName,
6
+ wiredCharacterNames,
7
+ wiredCharacterNamesOf,
8
+ wiredCharacterBySlug,
9
+ wiredCharacterKey,
10
+ aliasRetiredCharacterMentions,
11
+ entityImageUrl,
12
+ type WiredCharacterSource,
13
+ } from "../entries/entities.js"
14
+
15
+ const unnamed = (key: string, extra: Record<string, unknown> = {}): WiredCharacterSource => ({
16
+ key,
17
+ type: "character",
18
+ sourceHandle: "characterRef",
19
+ data: { label: CHARACTER_NODE_DEFAULT_LABEL, characterName: "", ...extra },
20
+ })
21
+ const named = (key: string, characterName: string): WiredCharacterSource => ({
22
+ key,
23
+ type: "character",
24
+ sourceHandle: "characterRef",
25
+ data: { label: CHARACTER_NODE_DEFAULT_LABEL, characterName },
26
+ })
27
+ const names = (sources: WiredCharacterSource[]) =>
28
+ [...wiredCharacterNames(sources)].map(([key, n]) => [key, n.name, n.slug])
29
+
30
+ describe("characterOwnName — the name a Character node was given", () => {
31
+ it("is its characterName, trimmed", () => {
32
+ expect(characterOwnName({ characterName: " Maya Lee ", label: CHARACTER_NODE_DEFAULT_LABEL })).toBe("Maya Lee")
33
+ })
34
+
35
+ it("is a label someone typed when it has no characterName", () => {
36
+ expect(characterOwnName({ characterName: "", label: "Hero" })).toBe("Hero")
37
+ })
38
+
39
+ it("is empty for the default label, a retired default, a label or name of only spaces, or no data", () => {
40
+ for (const data of [
41
+ { characterName: "", label: CHARACTER_NODE_DEFAULT_LABEL },
42
+ { characterName: " ", label: ` ${CHARACTER_NODE_DEFAULT_LABEL} ` },
43
+ { characterName: "", label: "Character" },
44
+ { characterName: "", label: " " },
45
+ { characterName: 42, label: undefined },
46
+ {},
47
+ null,
48
+ undefined,
49
+ ]) {
50
+ expect(characterOwnName(data)).toBe("")
51
+ }
52
+ })
53
+
54
+ it("the retired default is exactly the February–June 2026 one", () => {
55
+ // "Character" was the node's default label from 2026-02-03 until
56
+ // 2026-06-21; graphs saved then still carry it on unnamed nodes.
57
+ expect(CHARACTER_NODE_RETIRED_DEFAULT_LABELS).toEqual(["Character"])
58
+ })
59
+ })
60
+
61
+ describe("wiredCharacterNames — what each wired Character node is called by the node it feeds", () => {
62
+ it("one unnamed node is Character 1, never the node's type name", () => {
63
+ expect(names([unnamed("a")])).toEqual([["a", "Character 1", "character-1"]])
64
+ })
65
+
66
+ it("two unnamed nodes are two characters, numbered in wire order", () => {
67
+ expect(names([unnamed("a"), unnamed("b")])).toEqual([
68
+ ["a", "Character 1", "character-1"],
69
+ ["b", "Character 2", "character-2"],
70
+ ])
71
+ })
72
+
73
+ it("a typed label is the name", () => {
74
+ expect(names([unnamed("a", { label: "Hero" })])).toEqual([["a", "Hero", "hero"]])
75
+ })
76
+
77
+ it("an unnamed node beside a node NAMED Character 1 becomes Character 2, in either order", () => {
78
+ expect(names([named("n", "Character 1"), unnamed("a")])).toEqual([
79
+ ["n", "Character 1", "character-1"],
80
+ ["a", "Character 2", "character-2"],
81
+ ])
82
+ expect(names([unnamed("a"), named("n", "character 1")])).toEqual([
83
+ ["a", "Character 2", "character-2"],
84
+ ["n", "character 1", "character-1"],
85
+ ])
86
+ })
87
+
88
+ it("the same typed name on two nodes is one character, as before", () => {
89
+ expect(names([named("a", "Maya"), named("b", "Maya")])).toEqual([
90
+ ["a", "Maya", "maya"],
91
+ ["b", "Maya", "maya"],
92
+ ])
93
+ })
94
+
95
+ it("a mixed list (named, unnamed, named, unnamed)", () => {
96
+ expect(names([named("a", "Maya"), unnamed("b"), named("c", "Leo"), unnamed("d")])).toEqual([
97
+ ["a", "Maya", "maya"],
98
+ ["b", "Character 1", "character-1"],
99
+ ["c", "Leo", "leo"],
100
+ ["d", "Character 2", "character-2"],
101
+ ])
102
+ })
103
+
104
+ it("only a wire that delivers a character counts, and a node wired twice counts once", () => {
105
+ const viaImage: WiredCharacterSource = { ...unnamed("img"), sourceHandle: "image" }
106
+ const notCharacter: WiredCharacterSource = { key: "up", type: "upload-image", sourceHandle: "image", data: { label: "Character Asset" } }
107
+ expect(names([viaImage, notCharacter, unnamed("a"), unnamed("a")])).toEqual([["a", "Character 1", "character-1"]])
108
+ })
109
+
110
+ it("a typed name the slug cannot spell is a real name, keyed by the next number of the unnamed sequence", () => {
111
+ for (const [locale, typed] of [["he", "מאיה"], ["ja", "マヤ"], ["ko", "마야"]] as const) {
112
+ expect(names([unnamed("a"), named("b", typed), named("c", "Leo"), unnamed("d")]), locale).toEqual([
113
+ ["a", "Character 1", "character-1"],
114
+ ["b", typed, "character-2"],
115
+ ["c", "Leo", "leo"],
116
+ ["d", "Character 3", "character-3"],
117
+ ])
118
+ }
119
+ expect(names([named("a", "!!!"), unnamed("b")])).toEqual([
120
+ ["a", "!!!", "character-1"],
121
+ ["b", "Character 2", "character-2"],
122
+ ])
123
+ })
124
+
125
+ it("a numbered key skips a number a Latin name already has", () => {
126
+ expect(names([named("n", "Character 1"), named("m", "マヤ")])).toEqual([
127
+ ["n", "Character 1", "character-1"],
128
+ ["m", "マヤ", "character-2"],
129
+ ])
130
+ })
131
+
132
+ it("unnamed flags the nodes with no name of their own (a slug-less typed name is not one)", () => {
133
+ const m = wiredCharacterNames([named("a", "Maya"), unnamed("b"), named("c", "マヤ")])
134
+ expect(m.get("a")?.unnamed).toBe(false)
135
+ expect(m.get("b")?.unnamed).toBe(true)
136
+ expect(m.get("c")?.unnamed).toBe(false)
137
+ })
138
+ })
139
+
140
+ describe("wiredCharacterNamesOf — the same rule over a graph", () => {
141
+ it("reads the consumer's incoming wires in edge order, keyed by node id", () => {
142
+ const nodes = [
143
+ { id: "u1", type: "character", data: { label: CHARACTER_NODE_DEFAULT_LABEL, characterName: "" } },
144
+ { id: "u2", type: "character", data: { label: CHARACTER_NODE_DEFAULT_LABEL, characterName: "" } },
145
+ { id: "gi", type: "generate-image", data: {} },
146
+ { id: "other", type: "generate-image", data: {} },
147
+ ]
148
+ const edges = [
149
+ { source: "u2", target: "gi", sourceHandle: "characterRef" },
150
+ { source: "u1", target: "other", sourceHandle: "characterRef" },
151
+ { source: "u1", target: "gi", sourceHandle: "characterRef" },
152
+ ]
153
+ const m = wiredCharacterNamesOf("gi", nodes, edges)
154
+ expect([...m].map(([k, n]) => [k, n.name])).toEqual([["u2", "Character 1"], ["u1", "Character 2"]])
155
+ expect(wiredCharacterBySlug(m, "character-2")?.key).toBe("u1")
156
+ expect(wiredCharacterBySlug(m, "")).toBeUndefined()
157
+ })
158
+ })
159
+
160
+ describe("wiredCharacterKey — where a Character node's own elements are filed", () => {
161
+ const m = wiredCharacterNames([named("a", "Maya"), unnamed("b")])
162
+ it("a wired character: its slug", () => {
163
+ expect(wiredCharacterKey(m, "a", { characterName: "Maya" })).toBe("maya")
164
+ expect(wiredCharacterKey(m, "b", { characterName: "" })).toBe("character-1")
165
+ })
166
+ it("a node wired only as a plain image: its own name's slug, else a key of its own", () => {
167
+ expect(wiredCharacterKey(m, "c", { characterName: "Maya" })).toBe("maya")
168
+ expect(wiredCharacterKey(m, "d", { label: CHARACTER_NODE_DEFAULT_LABEL })).toBe("node:d")
169
+ })
170
+ })
171
+
172
+ describe("aliasRetiredCharacterMentions — a mention saved before unnamed characters were numbered", () => {
173
+ const prompt = "@character-asset:1 waves at @character:1:smile~lock while @character-asset:2:face watches"
174
+ it("with exactly one unnamed character wired, @character-asset and @character (any suffix) read as its slug", () => {
175
+ const m = wiredCharacterNames([unnamed("a"), named("b", "Leo")])
176
+ expect(aliasRetiredCharacterMentions(prompt, m)).toBe(
177
+ "@character-1:1 waves at @character-1:1:smile~lock while @character-1:2:face watches",
178
+ )
179
+ })
180
+
181
+ it("it follows the one unnamed node's number", () => {
182
+ const m = wiredCharacterNames([named("n", "Character 1"), unnamed("a")])
183
+ expect(aliasRetiredCharacterMentions("@character-asset:1", m)).toBe("@character-2:1")
184
+ })
185
+
186
+ it("with two unnamed characters, or none, the text is left as it is", () => {
187
+ expect(aliasRetiredCharacterMentions(prompt, wiredCharacterNames([unnamed("a"), unnamed("b")]))).toBe(prompt)
188
+ expect(aliasRetiredCharacterMentions(prompt, wiredCharacterNames([named("b", "Leo")]))).toBe(prompt)
189
+ expect(aliasRetiredCharacterMentions(prompt, wiredCharacterNames([named("b", "マヤ")]))).toBe(prompt)
190
+ })
191
+
192
+ it("a node labelled 'Character' (the retired default) is the one unnamed character too", () => {
193
+ const m = wiredCharacterNames([{ ...unnamed("a"), data: { label: "Character", characterName: "" } }])
194
+ expect(aliasRetiredCharacterMentions("@character:1 and @character-asset:1", m)).toBe("@character-1:1 and @character-1:1")
195
+ })
196
+
197
+ it("a retired slug a wired character really goes by is never rewritten", () => {
198
+ const m = wiredCharacterNames([named("c", "Character"), unnamed("a")])
199
+ expect(aliasRetiredCharacterMentions("@character:1 and @character-asset:1", m)).toBe("@character:1 and @character-1:1")
200
+ })
201
+
202
+ it("only whole mentions: not a numbered slug, a longer slug, an email-like token or one without an index", () => {
203
+ const m = wiredCharacterNames([unnamed("a")])
204
+ const text = "@character-1:1 @characters:1 x@character:1 @character-asset @character"
205
+ expect(aliasRetiredCharacterMentions(text, m)).toBe(text)
206
+ expect(aliasRetiredCharacterMentions(undefined, m)).toBeUndefined()
207
+ })
208
+ })
209
+
210
+ describe("entityImageUrl — the image an entity node gives out, and a Character's portrait", () => {
211
+ it("the starred default asset, else the active generated result, else the source image", () => {
212
+ const results = [{ url: "r0" }, { url: "r1" }]
213
+ expect(entityImageUrl({ defaultAssetUrl: "d", generatedResults: results, activeResultIndex: 1, sourceImageUrl: "s" })).toBe("d")
214
+ expect(entityImageUrl({ defaultAssetUrl: "", generatedResults: results, activeResultIndex: 1, sourceImageUrl: "s" })).toBe("r1")
215
+ expect(entityImageUrl({ generatedResults: results, sourceImageUrl: "s" })).toBe("r0")
216
+ expect(entityImageUrl({ generatedResults: [], sourceImageUrl: "s" })).toBe("s")
217
+ expect(entityImageUrl({})).toBeUndefined()
218
+ expect(entityImageUrl(null)).toBeUndefined()
219
+ })
220
+ })
@@ -60,6 +60,14 @@ export interface ProjectedCatalogOption {
60
60
  * large tile stays sharp; `imageUrl` is its 480px member.
61
61
  */
62
62
  imageSrcSet?: string
63
+ /**
64
+ * Absolute URL of the option's enlarged picture: the larger version to show
65
+ * where a picker shows the option big (hover, zoom, a detail view). Present
66
+ * only on a deployment that shows its own pictures (`catalogs.images:
67
+ * "own"`) and gave one for this option, on the REST replies; on its media
68
+ * host, like `imageUrl`. Absent otherwise — draw `imageUrl` there instead.
69
+ */
70
+ imageLargeUrl?: string
63
71
  }
64
72
 
65
73
  export interface ProjectedCatalogDimension {
@@ -81,3 +81,21 @@ export {
81
81
  pitchTempoBaseCredits,
82
82
  semitonesToPitchRatio,
83
83
  } from "./pitch-tempo.js"
84
+
85
+ export {
86
+ NEMOTRON_TRANSCRIBE_ID,
87
+ NEMOTRON_TRANSCRIBE_PRICING,
88
+ nemotronTranscribeStartedMinutes,
89
+ nemotronTranscribeCreditId,
90
+ nemotronTranscribeQuoteCreditId,
91
+ parseNemotronTranscribeCreditId,
92
+ nemotronTranscribeBaseCredits,
93
+ } from "./nemotron-transcribe.js"
94
+
95
+ export {
96
+ VIDEO_OVERLAY_PRICING,
97
+ VIDEO_OVERLAY_REMEASURE_SLACK_SEC,
98
+ videoOverlayCreditId,
99
+ videoOverlayVideoUnits,
100
+ videoOverlayBaseTooLong,
101
+ } from "./video-overlay.js"
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Nemotron 3.5 Transcribe pricing — per STARTED minute of the file (decided
3
+ * 2026-11-12): the same price with word timings or a translation.
4
+ *
5
+ * The base price is 0.75 credits a minute, which no whole-credit row can hold
6
+ * (`model_pricing.credit_cost` is an integer), so the rate row prices FOUR
7
+ * minutes — the same trick as Nodaro Video Upscale's four-second rows. A run
8
+ * reserves `nemotron-3-5-transcribe:<N>m` (N = started minutes, 1..60), which
9
+ * billing prices as that row × N ÷ 4, rounded up once for the whole run, then
10
+ * marked up once — never a row of its own, so a retune of the rate row moves
11
+ * the route, the workflow run, the node's Run button and every estimate
12
+ * together. The same id is built by the route (from the probed length), the
13
+ * workflow run (the same probe) and the editor (the upstream length it knows).
14
+ * That id is the HOLD: a run is then CHARGED for the minutes the provider
15
+ * reports it decoded, up or down (decided 2026-11-12; backend
16
+ * `lib/nemotron-transcribe-settle.ts`).
17
+ *
18
+ * Worked base prices at the row's launch value of 3 (per 4 minutes):
19
+ * 0:45 → 1, 1:00 → 1, 1:01 → 2, 10:00 → 8, 60:00 → 45.
20
+ * The listed (marked-up) price follows from those.
21
+ */
22
+
23
+ /** The engine's id — the Transcribe node's `provider`, and the bare price id. */
24
+ export const NEMOTRON_TRANSCRIBE_ID = "nemotron-3-5-transcribe"
25
+
26
+ export const NEMOTRON_TRANSCRIBE_PRICING = {
27
+ /** The rate row: credits per {@link NEMOTRON_TRANSCRIBE_PRICING.RATE_MINUTES} minutes. Never reserved by itself. */
28
+ RATE_CREDIT_ID: "nemotron-3-5-transcribe:per-4m",
29
+ /** The minutes the rate row prices. */
30
+ RATE_MINUTES: 4,
31
+ /** The rate row's launch value (admin-retunable in /admin/models): 0.75 base credits a minute. */
32
+ CREDITS_PER_RATE_DEFAULT: 3,
33
+ /** The longest file a run accepts, in seconds (KIE's 60-minute limit; the route refuses longer). */
34
+ MAX_DURATION_SEC: 3600,
35
+ /** The most minutes a `nemotron-3-5-transcribe:<N>m` id can carry. */
36
+ MAX_MINUTES: 60,
37
+ /** The largest file a run accepts, in bytes (KIE's 200 MB limit). */
38
+ MAX_BYTES: 200 * 1024 * 1024,
39
+ } as const
40
+
41
+ /**
42
+ * Started minutes of a file of `durationSec` seconds: ceil(sec / 60), at least
43
+ * 1, at most 60. An unknown or non-positive length counts as one minute here; a
44
+ * quote of an unknown length names 60 instead ({@link nemotronTranscribeQuoteCreditId}),
45
+ * as does a run whose file's length cannot be read (it holds 60 minutes and
46
+ * settles at the provider's decoded length).
47
+ */
48
+ export function nemotronTranscribeStartedMinutes(durationSec: number | null | undefined): number {
49
+ if (typeof durationSec !== "number" || !Number.isFinite(durationSec) || durationSec <= 0) return 1
50
+ return Math.min(NEMOTRON_TRANSCRIBE_PRICING.MAX_MINUTES, Math.max(1, Math.ceil(durationSec / 60)))
51
+ }
52
+
53
+ /** `nemotron-3-5-transcribe:<N>m` — the id a run on a file of `durationSec` seconds reserves. */
54
+ export function nemotronTranscribeCreditId(durationSec: number | null | undefined): string {
55
+ return `${NEMOTRON_TRANSCRIBE_ID}:${nemotronTranscribeStartedMinutes(durationSec)}m`
56
+ }
57
+
58
+ /**
59
+ * The id a QUOTE names for a file of `durationSec` seconds — every estimate
60
+ * before a run. A known length is the id its run reserves. An UNKNOWN length is
61
+ * the 60-minute id: a run measures the file before it reserves, holds 60
62
+ * minutes for one whose length cannot be read and refuses one over 60 minutes,
63
+ * and the provider refuses longer audio, so 60 minutes is the most any run can
64
+ * be charged and the quote is never below the charge (Pitch & Tempo's rule).
65
+ */
66
+ export function nemotronTranscribeQuoteCreditId(durationSec: number | null | undefined): string {
67
+ const known = typeof durationSec === "number" && Number.isFinite(durationSec) && durationSec > 0
68
+ return nemotronTranscribeCreditId(known ? durationSec : NEMOTRON_TRANSCRIBE_PRICING.MAX_DURATION_SEC)
69
+ }
70
+
71
+ /** The minutes of a `nemotron-3-5-transcribe:<N>m` id (1 ≤ N ≤ 60), or `undefined` for any other id. */
72
+ export function parseNemotronTranscribeCreditId(id: string): { minutes: number } | undefined {
73
+ const m = /^nemotron-3-5-transcribe:(\d+)m$/.exec(id)
74
+ if (!m) return undefined
75
+ const minutes = Number(m[1])
76
+ if (!Number.isInteger(minutes) || minutes < 1 || minutes > NEMOTRON_TRANSCRIBE_PRICING.MAX_MINUTES) return undefined
77
+ return { minutes }
78
+ }
79
+
80
+ /**
81
+ * The base of a run of `minutes` started minutes from the rate row's value
82
+ * (`ratePerBlock` credits per {@link NEMOTRON_TRANSCRIBE_PRICING.RATE_MINUTES}
83
+ * minutes): rate × minutes ÷ 4, rounded up once for the whole run, at least 1.
84
+ */
85
+ export function nemotronTranscribeBaseCredits(ratePerBlock: number, minutes: number): number {
86
+ return Math.max(1, Math.ceil((ratePerBlock * minutes) / NEMOTRON_TRANSCRIBE_PRICING.RATE_MINUTES))
87
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Video Overlay pricing — which row a run is charged from, and how many units
3
+ * of it. One mapping for every place that names the price: the route
4
+ * (`POST /v1/video-overlay`), the workflow run's reservation, the node's Run
5
+ * button and the workflow estimates.
6
+ *
7
+ * An image-only run is the flat `video-overlay` row, whatever its layers or
8
+ * the base's length; its base is never measured for the price. A run with any
9
+ * video layer is charged the `video-overlay:video` row once per started 5
10
+ * seconds of the output — the base's length, which is the output's — the unit
11
+ * Mask Composite is charged by. The route and the workflow run measure the
12
+ * base before anything is reserved, and refuse one they cannot read or one
13
+ * past {@link VIDEO_OVERLAY_PRICING.MAX_BASE_SEC}. Before a run, a base whose
14
+ * length is not known yet is quoted at that cap, so a quote is never below
15
+ * what the run is charged.
16
+ *
17
+ * Worked examples, in units of the `video-overlay:video` row:
18
+ * 10 s → 2, 23 s → 5, 60 s → 12, unknown → 12, 61 s → refused.
19
+ */
20
+ import { pricedClipSeconds } from "../priced-clip-seconds.js"
21
+ import { VIDEO_OVERLAY_VIDEO_MAX_BASE_SEC } from "../video-overlay.js"
22
+
23
+ export const VIDEO_OVERLAY_PRICING = {
24
+ /** An image-only run: one flat row. */
25
+ IMAGE_CREDIT_ID: "video-overlay",
26
+ /** A run with a video layer: one row per started {@link VIDEO_OVERLAY_PRICING.UNIT_SEC} seconds of the output. */
27
+ VIDEO_CREDIT_ID: "video-overlay:video",
28
+ /** Seconds of output one unit of the video row covers. */
29
+ UNIT_SEC: 5,
30
+ /** The longest base a run with a video layer accepts, in seconds. */
31
+ MAX_BASE_SEC: VIDEO_OVERLAY_VIDEO_MAX_BASE_SEC,
32
+ } as const
33
+
34
+ /**
35
+ * How much longer, in seconds, the base the worker downloads may run than the
36
+ * base measured before the run was charged, before the worker refuses it as
37
+ * changed: a re-measure can read a hair longer (a re-encode, a container's
38
+ * rounding), and that is not a different file. Applied to the seconds, never
39
+ * to the units: a base billed for 10 s renders at up to 10.5 s.
40
+ */
41
+ export const VIDEO_OVERLAY_REMEASURE_SLACK_SEC = 0.5
42
+
43
+ /** The row a run is charged from: the flat image row, or the per-5-second video row when any layer is a video. */
44
+ export function videoOverlayCreditId(hasVideoLayer: boolean): string {
45
+ return hasVideoLayer ? VIDEO_OVERLAY_PRICING.VIDEO_CREDIT_ID : VIDEO_OVERLAY_PRICING.IMAGE_CREDIT_ID
46
+ }
47
+
48
+ /**
49
+ * Units of the video row for a base `baseSec` long: one per started 5
50
+ * seconds, at least one, after `pricedClipSeconds` (up to 0.05 s past a whole
51
+ * second is ignored, so a 10.01 s base is 2 units). An unknown length counts
52
+ * the cap — the pre-run quote for a base not measured yet — and so does a
53
+ * length past it (such a base is refused before anything is reserved).
54
+ */
55
+ export function videoOverlayVideoUnits(baseSec: number | null | undefined): number {
56
+ const sec =
57
+ typeof baseSec === "number" && Number.isFinite(baseSec) && baseSec > 0
58
+ ? Math.min(baseSec, VIDEO_OVERLAY_PRICING.MAX_BASE_SEC)
59
+ : VIDEO_OVERLAY_PRICING.MAX_BASE_SEC
60
+ return Math.ceil(pricedClipSeconds(sec) / VIDEO_OVERLAY_PRICING.UNIT_SEC)
61
+ }
62
+
63
+ /**
64
+ * Whether a measured base is past the cap for a run with a video layer. Read
65
+ * on the priced seconds the units use, so a base the price counts as 60 s
66
+ * (60.04 s, a whole-second cut of a 29.97 fps clip) is accepted at 12 units.
67
+ */
68
+ export function videoOverlayBaseTooLong(baseSec: number): boolean {
69
+ return pricedClipSeconds(baseSec) > VIDEO_OVERLAY_PRICING.MAX_BASE_SEC
70
+ }