@nodaro/shared 3.33.0 → 3.35.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 (265) hide show
  1. package/dist/{chunk-2NQLSLSN.cjs → chunk-24ZKPE33.cjs} +5 -5
  2. package/dist/{chunk-2NQLSLSN.cjs.map → chunk-24ZKPE33.cjs.map} +1 -1
  3. package/dist/{chunk-CK3GK34R.js → chunk-2HIDE3QV.js} +9 -3
  4. package/dist/chunk-2HIDE3QV.js.map +1 -0
  5. package/dist/{chunk-WDIBOWAA.js → chunk-2HVFF5SS.js} +6 -6
  6. package/dist/chunk-2HVFF5SS.js.map +1 -0
  7. package/dist/{chunk-FT5CF6IA.js → chunk-2QWNPYDG.js} +3 -3
  8. package/dist/{chunk-FT5CF6IA.js.map → chunk-2QWNPYDG.js.map} +1 -1
  9. package/dist/{chunk-M7GQBRZU.cjs → chunk-3YG3MYDE.cjs} +153 -24
  10. package/dist/chunk-3YG3MYDE.cjs.map +1 -0
  11. package/dist/{chunk-VNQRI2RO.cjs → chunk-5VNBQ4QK.cjs} +16 -16
  12. package/dist/{chunk-VNQRI2RO.cjs.map → chunk-5VNBQ4QK.cjs.map} +1 -1
  13. package/dist/{chunk-K3LLGRK7.cjs → chunk-5ZCXWA7J.cjs} +59 -15
  14. package/dist/chunk-5ZCXWA7J.cjs.map +1 -0
  15. package/dist/{chunk-Z2OL5AJD.cjs → chunk-6F6GGX2W.cjs} +4 -3
  16. package/dist/chunk-6F6GGX2W.cjs.map +1 -0
  17. package/dist/{chunk-D26ENTN2.cjs → chunk-72IFMNJE.cjs} +80 -52
  18. package/dist/chunk-72IFMNJE.cjs.map +1 -0
  19. package/dist/{chunk-SAW5OK36.cjs → chunk-A5Z3IMSJ.cjs} +6 -6
  20. package/dist/{chunk-SAW5OK36.cjs.map → chunk-A5Z3IMSJ.cjs.map} +1 -1
  21. package/dist/{chunk-VA42637J.cjs → chunk-AGEZY4LL.cjs} +46 -41
  22. package/dist/chunk-AGEZY4LL.cjs.map +1 -0
  23. package/dist/{chunk-BG5D5CZ6.js → chunk-ANOQWAMU.js} +23 -6
  24. package/dist/chunk-ANOQWAMU.js.map +1 -0
  25. package/dist/{chunk-PRYE7AZQ.cjs → chunk-AWWOQH46.cjs} +7 -7
  26. package/dist/chunk-AWWOQH46.cjs.map +1 -0
  27. package/dist/{chunk-JFS3NWZ5.cjs → chunk-B7WJJHJS.cjs} +7 -4
  28. package/dist/chunk-B7WJJHJS.cjs.map +1 -0
  29. package/dist/{chunk-D6GNRSCV.cjs → chunk-BBLE4UTG.cjs} +23 -6
  30. package/dist/chunk-BBLE4UTG.cjs.map +1 -0
  31. package/dist/{chunk-HGC5JNVA.cjs → chunk-BVVKMQKR.cjs} +9 -2
  32. package/dist/chunk-BVVKMQKR.cjs.map +1 -0
  33. package/dist/{chunk-YYV35XOS.js → chunk-C4R7BTBQ.js} +4 -3
  34. package/dist/chunk-C4R7BTBQ.js.map +1 -0
  35. package/dist/{chunk-PXFQVLBX.js → chunk-ETXUOETU.js} +26 -36
  36. package/dist/chunk-ETXUOETU.js.map +1 -0
  37. package/dist/{chunk-HKFMXNVQ.cjs → chunk-F4ZT5X2S.cjs} +11 -11
  38. package/dist/{chunk-HKFMXNVQ.cjs.map → chunk-F4ZT5X2S.cjs.map} +1 -1
  39. package/dist/{chunk-YBPBK5KI.js → chunk-FKQJYMCO.js} +97 -23
  40. package/dist/chunk-FKQJYMCO.js.map +1 -0
  41. package/dist/{chunk-ZDFHA2EC.js → chunk-FVKCNAEQ.js} +51 -7
  42. package/dist/chunk-FVKCNAEQ.js.map +1 -0
  43. package/dist/{chunk-ZL7UM6PU.cjs → chunk-GHBXS5RT.cjs} +4 -4
  44. package/dist/{chunk-ZL7UM6PU.cjs.map → chunk-GHBXS5RT.cjs.map} +1 -1
  45. package/dist/{chunk-ZO5PBBFX.js → chunk-GKJRNIP4.js} +59 -15
  46. package/dist/chunk-GKJRNIP4.js.map +1 -0
  47. package/dist/{chunk-UCFWI6D4.js → chunk-GRIMIJJ3.js} +3 -3
  48. package/dist/{chunk-UCFWI6D4.js.map → chunk-GRIMIJJ3.js.map} +1 -1
  49. package/dist/{chunk-5RYLK3MQ.js → chunk-GVHBHUFV.js} +11 -6
  50. package/dist/chunk-GVHBHUFV.js.map +1 -0
  51. package/dist/chunk-GZH2SIOF.cjs +99 -0
  52. package/dist/chunk-GZH2SIOF.cjs.map +1 -0
  53. package/dist/{chunk-SFW3UB2P.js → chunk-IJNQYMN7.js} +4 -4
  54. package/dist/{chunk-SFW3UB2P.js.map → chunk-IJNQYMN7.js.map} +1 -1
  55. package/dist/{chunk-HC7VKIV5.cjs → chunk-IRUPCNW2.cjs} +49 -46
  56. package/dist/chunk-IRUPCNW2.cjs.map +1 -0
  57. package/dist/{chunk-JL4C5VJ7.cjs → chunk-J65CAOUV.cjs} +14 -2
  58. package/dist/chunk-J65CAOUV.cjs.map +1 -0
  59. package/dist/{chunk-23FJQTEA.js → chunk-LJMNCSDG.js} +38 -15
  60. package/dist/chunk-LJMNCSDG.js.map +1 -0
  61. package/dist/{chunk-PVJBAPYJ.js → chunk-MEN7VLQ5.js} +8 -5
  62. package/dist/chunk-MEN7VLQ5.js.map +1 -0
  63. package/dist/{chunk-PHZ23DP3.js → chunk-MUA5L25B.js} +125 -12
  64. package/dist/chunk-MUA5L25B.js.map +1 -0
  65. package/dist/{chunk-WD6HJRBG.cjs → chunk-NWXB4F6D.cjs} +21 -21
  66. package/dist/{chunk-WD6HJRBG.cjs.map → chunk-NWXB4F6D.cjs.map} +1 -1
  67. package/dist/{chunk-PQHS255G.js → chunk-OHSIVNJO.js} +3 -3
  68. package/dist/chunk-OHSIVNJO.js.map +1 -0
  69. package/dist/{chunk-XGFTL5XY.js → chunk-PVVO23LZ.js} +3 -3
  70. package/dist/{chunk-XGFTL5XY.js.map → chunk-PVVO23LZ.js.map} +1 -1
  71. package/dist/{chunk-CUH22J4D.js → chunk-Q4ZXDDWA.js} +3 -3
  72. package/dist/{chunk-CUH22J4D.js.map → chunk-Q4ZXDDWA.js.map} +1 -1
  73. package/dist/{chunk-WKOIGLQX.cjs → chunk-QIIG2QDP.cjs} +8 -8
  74. package/dist/{chunk-WKOIGLQX.cjs.map → chunk-QIIG2QDP.cjs.map} +1 -1
  75. package/dist/{chunk-QA3MVQ32.js → chunk-QXW6O56Z.js} +6 -6
  76. package/dist/chunk-QXW6O56Z.js.map +1 -0
  77. package/dist/{chunk-5PC6JBGJ.cjs → chunk-R2VF5NQG.cjs} +3 -3
  78. package/dist/chunk-R2VF5NQG.cjs.map +1 -0
  79. package/dist/{chunk-7Z5LUTGU.js → chunk-RRI5YBUK.js} +6 -3
  80. package/dist/{chunk-JFS3NWZ5.cjs.map → chunk-RRI5YBUK.js.map} +1 -1
  81. package/dist/{chunk-HUR6ZJ7S.cjs → chunk-RUKFN3LJ.cjs} +6 -6
  82. package/dist/{chunk-HUR6ZJ7S.cjs.map → chunk-RUKFN3LJ.cjs.map} +1 -1
  83. package/dist/chunk-TCBHVIMD.js +89 -0
  84. package/dist/chunk-TCBHVIMD.js.map +1 -0
  85. package/dist/{chunk-SES6GDBQ.cjs → chunk-UJJUX6NW.cjs} +59 -8
  86. package/dist/chunk-UJJUX6NW.cjs.map +1 -0
  87. package/dist/{chunk-ZRL2UFTH.cjs → chunk-V3N56Z2S.cjs} +101 -22
  88. package/dist/chunk-V3N56Z2S.cjs.map +1 -0
  89. package/dist/{chunk-6WZ2VN7V.js → chunk-W36WCZS2.js} +6 -6
  90. package/dist/{chunk-6WZ2VN7V.js.map → chunk-W36WCZS2.js.map} +1 -1
  91. package/dist/{chunk-M36G6SRP.js → chunk-WXNQMJ67.js} +14 -3
  92. package/dist/chunk-WXNQMJ67.js.map +1 -0
  93. package/dist/{chunk-VXPLKQWY.cjs → chunk-XE5PE54B.cjs} +30 -40
  94. package/dist/chunk-XE5PE54B.cjs.map +1 -0
  95. package/dist/{chunk-OZSACQ2V.js → chunk-XJOBMAWW.js} +3 -3
  96. package/dist/{chunk-OZSACQ2V.js.map → chunk-XJOBMAWW.js.map} +1 -1
  97. package/dist/{chunk-OTATNBMD.js → chunk-XS7FI4JA.js} +3 -3
  98. package/dist/{chunk-OTATNBMD.js.map → chunk-XS7FI4JA.js.map} +1 -1
  99. package/dist/{chunk-HRXEZ3SX.cjs → chunk-YD3JA36S.cjs} +4 -4
  100. package/dist/{chunk-HRXEZ3SX.cjs.map → chunk-YD3JA36S.cjs.map} +1 -1
  101. package/dist/chunk-YYODFQEU.cjs +25 -0
  102. package/dist/chunk-YYODFQEU.cjs.map +1 -0
  103. package/dist/{chunk-UTQSSKSG.js → chunk-ZXBSARZX.js} +4 -4
  104. package/dist/{chunk-UTQSSKSG.js.map → chunk-ZXBSARZX.js.map} +1 -1
  105. package/dist/entries/apps.cjs +43 -42
  106. package/dist/entries/apps.d.cts +2 -2
  107. package/dist/entries/apps.d.ts +2 -2
  108. package/dist/entries/apps.js +8 -7
  109. package/dist/entries/catalogs.d.cts +1 -1
  110. package/dist/entries/catalogs.d.ts +1 -1
  111. package/dist/entries/credits.cjs +153 -153
  112. package/dist/entries/credits.d.cts +1 -1
  113. package/dist/entries/credits.d.ts +1 -1
  114. package/dist/entries/credits.js +8 -8
  115. package/dist/entries/edl.cjs +130 -102
  116. package/dist/entries/edl.d.cts +74 -3
  117. package/dist/entries/edl.d.ts +74 -3
  118. package/dist/entries/edl.js +2 -2
  119. package/dist/entries/entities.cjs +126 -122
  120. package/dist/entries/entities.d.cts +2 -2
  121. package/dist/entries/entities.d.ts +2 -2
  122. package/dist/entries/entities.js +1 -1
  123. package/dist/entries/i18n.cjs +11 -11
  124. package/dist/entries/i18n.d.cts +2 -2
  125. package/dist/entries/i18n.d.ts +2 -2
  126. package/dist/entries/i18n.js +1 -1
  127. package/dist/entries/llm-models.cjs +63 -43
  128. package/dist/entries/llm-models.d.cts +71 -4
  129. package/dist/entries/llm-models.d.ts +71 -4
  130. package/dist/entries/llm-models.js +1 -1
  131. package/dist/entries/media.cjs +45 -41
  132. package/dist/entries/media.d.cts +39 -1
  133. package/dist/entries/media.d.ts +39 -1
  134. package/dist/entries/media.js +1 -1
  135. package/dist/entries/model-catalog.cjs +66 -66
  136. package/dist/entries/model-catalog.d.cts +2 -2
  137. package/dist/entries/model-catalog.d.ts +2 -2
  138. package/dist/entries/model-catalog.js +4 -4
  139. package/dist/entries/models.cjs +274 -210
  140. package/dist/entries/models.d.cts +3 -3
  141. package/dist/entries/models.d.ts +3 -3
  142. package/dist/entries/models.js +5 -5
  143. package/dist/entries/nodes.cjs +222 -201
  144. package/dist/entries/nodes.d.cts +48 -8
  145. package/dist/entries/nodes.d.ts +48 -8
  146. package/dist/entries/nodes.js +10 -9
  147. package/dist/entries/pipeline.cjs +149 -149
  148. package/dist/entries/pipeline.d.cts +8 -4
  149. package/dist/entries/pipeline.d.ts +8 -4
  150. package/dist/entries/pipeline.js +3 -3
  151. package/dist/entries/social.cjs +174 -174
  152. package/dist/entries/social.d.cts +13 -5
  153. package/dist/entries/social.d.ts +13 -5
  154. package/dist/entries/social.js +2 -2
  155. package/dist/entries/types.d.cts +1 -1
  156. package/dist/entries/types.d.ts +1 -1
  157. package/dist/entries/ugc.cjs +71 -71
  158. package/dist/entries/ugc.js +4 -4
  159. package/dist/entries/video.cjs +115 -115
  160. package/dist/entries/video.d.cts +4 -3
  161. package/dist/entries/video.d.ts +4 -3
  162. package/dist/entries/video.js +4 -4
  163. package/dist/entries/workflow.cjs +96 -95
  164. package/dist/entries/workflow.d.cts +7 -18
  165. package/dist/entries/workflow.d.ts +7 -18
  166. package/dist/entries/workflow.js +2 -1
  167. package/dist/index.cjs +1708 -1567
  168. package/dist/index.d.cts +9 -9
  169. package/dist/index.d.ts +9 -9
  170. package/dist/index.js +26 -25
  171. package/dist/{model-catalog-V-ZNzRSd.d.ts → model-catalog-VIHGmQL2.d.cts} +22 -0
  172. package/dist/{model-catalog-V-ZNzRSd.d.cts → model-catalog-VIHGmQL2.d.ts} +22 -0
  173. package/dist/{presentation-utils-D0kxsWf9.d.cts → presentation-utils-A4i92SYo.d.cts} +1 -1
  174. package/dist/{presentation-utils-pZwlEAzo.d.ts → presentation-utils-DjdPtM9k.d.ts} +1 -1
  175. package/dist/{scene-node-types-C3kl_zyK.d.ts → scene-node-types-Cvbtf-0a.d.cts} +147 -6
  176. package/dist/{scene-node-types-C3kl_zyK.d.cts → scene-node-types-Cvbtf-0a.d.ts} +147 -6
  177. package/dist/{types-DffyGSy5.d.cts → types-CU6SQnMS.d.cts} +0 -5
  178. package/dist/{types-DffyGSy5.d.ts → types-CU6SQnMS.d.ts} +0 -5
  179. package/dist/{types-BRlFPEru.d.ts → types-DzUBR7yr.d.cts} +8 -1
  180. package/dist/{types-BRlFPEru.d.cts → types-DzUBR7yr.d.ts} +8 -1
  181. package/package.json +1 -1
  182. package/src/__tests__/camera-switch-contract.test.ts +33 -1
  183. package/src/__tests__/character-mention-slug.test.ts +0 -8
  184. package/src/__tests__/effective-tier.test.ts +3 -14
  185. package/src/__tests__/fixtures/camera-switch-speaker-map-parity.json +178 -0
  186. package/src/__tests__/fixtures/root-exports.baseline.json +21 -0
  187. package/src/__tests__/fixtures/speaker-map-camera-ids.json +26 -0
  188. package/src/__tests__/gvp-supported-providers.test.ts +1 -0
  189. package/src/__tests__/i18n-locale-completeness.test.ts +38 -3
  190. package/src/__tests__/llm-models.test.ts +200 -20
  191. package/src/__tests__/node-preset-extract.test.ts +10 -0
  192. package/src/__tests__/preview-gate-use-case.test.ts +16 -1
  193. package/src/__tests__/producer-types.test.ts +19 -0
  194. package/src/__tests__/run-continuation.test.ts +4 -1
  195. package/src/__tests__/speaker-map-contract.test.ts +48 -0
  196. package/src/__tests__/unit-contract-compose.test.ts +129 -0
  197. package/src/__tests__/unit-contracts.test.ts +134 -0
  198. package/src/__tests__/use-case-types.test.ts +33 -0
  199. package/src/__tests__/video-collapse-parity.test.ts +10 -0
  200. package/src/__tests__/video-frame-slot.test.ts +85 -0
  201. package/src/__tests__/video-mode-aliases.test.ts +1 -0
  202. package/src/__tests__/video-reference-only.test.ts +117 -0
  203. package/src/__tests__/vidu-q4-catalog.test.ts +230 -0
  204. package/src/camera-switch-contract.ts +36 -2
  205. package/src/credit-identifiers.ts +19 -6
  206. package/src/entity-asset-types.ts +13 -0
  207. package/src/entries/edl.ts +2 -0
  208. package/src/entries/llm-models.ts +5 -0
  209. package/src/entries/media.ts +1 -0
  210. package/src/entries/models.ts +25 -0
  211. package/src/entries/nodes.ts +5 -1
  212. package/src/fan-out-rows.ts +36 -3
  213. package/src/generate-mask.ts +40 -0
  214. package/src/generated/unit-contracts.ts +58 -0
  215. package/src/i18n/types.ts +13 -2
  216. package/src/json-kinds.ts +24 -4
  217. package/src/llm-models.ts +184 -31
  218. package/src/meta-ads-scrape.ts +16 -8
  219. package/src/model-catalog.ts +78 -13
  220. package/src/model-constants.ts +260 -5
  221. package/src/node-default-mappings.ts +3 -0
  222. package/src/node-preset-extract.ts +8 -0
  223. package/src/pipeline-types.ts +3 -0
  224. package/src/presentation-utils.ts +12 -12
  225. package/src/preview-gate.ts +4 -2
  226. package/src/producer-types.ts +19 -19
  227. package/src/run-continuation.ts +26 -4
  228. package/src/speaker-layouts.ts +8 -3
  229. package/src/speaker-map-contract.ts +77 -0
  230. package/src/unit-contract-compose.ts +55 -0
  231. package/src/use-case-types.ts +19 -0
  232. package/src/video-ui-defaults.ts +7 -5
  233. package/dist/chunk-23FJQTEA.js.map +0 -1
  234. package/dist/chunk-5PC6JBGJ.cjs.map +0 -1
  235. package/dist/chunk-5RYLK3MQ.js.map +0 -1
  236. package/dist/chunk-7Z5LUTGU.js.map +0 -1
  237. package/dist/chunk-BG5D5CZ6.js.map +0 -1
  238. package/dist/chunk-CK3GK34R.js.map +0 -1
  239. package/dist/chunk-D26ENTN2.cjs.map +0 -1
  240. package/dist/chunk-D6GNRSCV.cjs.map +0 -1
  241. package/dist/chunk-HC7VKIV5.cjs.map +0 -1
  242. package/dist/chunk-HGC5JNVA.cjs.map +0 -1
  243. package/dist/chunk-JL4C5VJ7.cjs.map +0 -1
  244. package/dist/chunk-K3LLGRK7.cjs.map +0 -1
  245. package/dist/chunk-M36G6SRP.js.map +0 -1
  246. package/dist/chunk-M7GQBRZU.cjs.map +0 -1
  247. package/dist/chunk-PHZ23DP3.js.map +0 -1
  248. package/dist/chunk-PQHS255G.js.map +0 -1
  249. package/dist/chunk-PRYE7AZQ.cjs.map +0 -1
  250. package/dist/chunk-PVJBAPYJ.js.map +0 -1
  251. package/dist/chunk-PXFQVLBX.js.map +0 -1
  252. package/dist/chunk-QA3MVQ32.js.map +0 -1
  253. package/dist/chunk-SES6GDBQ.cjs.map +0 -1
  254. package/dist/chunk-TU33KYKW.cjs +0 -25
  255. package/dist/chunk-TU33KYKW.cjs.map +0 -1
  256. package/dist/chunk-VA42637J.cjs.map +0 -1
  257. package/dist/chunk-VXPLKQWY.cjs.map +0 -1
  258. package/dist/chunk-WDIBOWAA.js.map +0 -1
  259. package/dist/chunk-YBPBK5KI.js.map +0 -1
  260. package/dist/chunk-YYV35XOS.js.map +0 -1
  261. package/dist/chunk-Z2OL5AJD.cjs.map +0 -1
  262. package/dist/chunk-ZDFHA2EC.js.map +0 -1
  263. package/dist/chunk-ZO5PBBFX.js.map +0 -1
  264. package/dist/chunk-ZRL2UFTH.cjs.map +0 -1
  265. package/src/__tests__/__snapshots__/prompt-builder-segments.test.ts.snap +0 -65
@@ -1,4 +1,4 @@
1
- import { MODEL_CATALOG } from './chunk-ZO5PBBFX.js';
1
+ import { MODEL_CATALOG } from './chunk-GKJRNIP4.js';
2
2
 
3
3
  // src/image-model-roles.ts
4
4
  var IMAGE_MODEL_ROLE_DEFAULTS = {
@@ -25,5 +25,5 @@ function defaultImageModel(role, aspectRatio) {
25
25
  }
26
26
 
27
27
  export { IMAGE_MODEL_RATIO_FALLBACKS, IMAGE_MODEL_ROLE_DEFAULTS, defaultImageModel, imageModelDrawsRatio };
28
- //# sourceMappingURL=chunk-UCFWI6D4.js.map
29
- //# sourceMappingURL=chunk-UCFWI6D4.js.map
28
+ //# sourceMappingURL=chunk-GRIMIJJ3.js.map
29
+ //# sourceMappingURL=chunk-GRIMIJJ3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/image-model-roles.ts"],"names":[],"mappings":";;;AAsBO,IAAM,yBAAA,GAA4B;AAAA,EACvC,SAAA,EAAW,aAAA;AAAA,EACX,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,aAAA;AAAA,EACR,IAAA,EAAM;AACR;AAUO,IAAM,2BAAA,GAAmF;AAAA,EAC9F,SAAA,EAAW,CAAC,wBAAA,EAA0B,iBAAiB,CAAA;AAAA,EACvD,OAAA,EAAS,CAAC,wBAAA,EAA0B,iBAAiB,CAAA;AAAA,EACrD,MAAA,EAAQ,CAAC,wBAAA,EAA0B,iBAAiB,CAAA;AAAA,EACpD,IAAA,EAAM,CAAC,4BAAA,EAA8B,iBAAiB;AACxD;AAGO,SAAS,oBAAA,CAAqB,SAAiB,WAAA,EAAsC;AAC1F,EAAA,IAAI,CAAC,aAAa,OAAO,IAAA;AACzB,EAAA,MAAM,MAAA,GAAS,aAAA,CAAc,OAAO,CAAA,EAAG,YAAA;AACvC,EAAA,OAAO,MAAA,KAAW,MAAA,IAAa,MAAA,CAAO,QAAA,CAAS,WAAW,CAAA;AAC5D;AAQO,SAAS,iBAAA,CAAkB,MAAsB,WAAA,EAAqC;AAC3F,EAAA,MAAM,OAAA,GAAU,0BAA0B,IAAI,CAAA;AAC9C,EAAA,IAAI,oBAAA,CAAqB,OAAA,EAAS,WAAW,CAAA,EAAG,OAAO,OAAA;AACvD,EAAA,OAAO,2BAAA,CAA4B,IAAI,CAAA,CAAE,IAAA,CAAK,CAAC,OAAO,oBAAA,CAAqB,EAAA,EAAI,WAAW,CAAC,CAAA,IAAK,OAAA;AAClG","file":"chunk-UCFWI6D4.js","sourcesContent":["import { MODEL_CATALOG } from \"./model-catalog.js\"\n\n/**\n * The platform's answer to \"which image model, when the caller names none\".\n *\n * One table by ROLE, so every surface that picks for the user (node defaults,\n * route and workflow fallbacks, MCP tools, studios, pipelines) reads the same\n * model instead of keeping its own literal. Before this table those literals\n * had drifted apart: the Generate Image node started on Nano Banana Pro, the\n * routes fell back to the original Nano Banana, and MCP used Nano Banana 2.1.\n *\n * Decided on 2026-10-08 from a blind five-model comparison, quality\n * first and price second:\n * - characters, general text-to-image and video anchors on GPT Image 2;\n * - edits on GPT Image 2.5 Flare.\n * With reference images attached, GPT Image 2 runs as its i2i sibling (the\n * provider swaps it), so `character` covers identity-from-reference too.\n *\n * Nano Banana Pro is no longer a default. It remains a FALLBACK only: last in\n * the ratio chain below (it is the one model here that draws 4:5 and 5:4), the\n * GPT-family safety-block retry, and the swimwear dressing model.\n */\nexport const IMAGE_MODEL_ROLE_DEFAULTS = {\n character: \"gpt-image-2\",\n general: \"gpt-image-2\",\n anchor: \"gpt-image-2\",\n edit: \"gpt-image-2-5-flare-i2i\",\n} as const\n\nexport type ImageModelRole = keyof typeof IMAGE_MODEL_ROLE_DEFAULTS\n\n/**\n * Where a role's model goes when it cannot draw the requested aspect ratio.\n * GPT Image 2 draws only auto / 1:1 / 16:9 / 9:16 / 4:3 / 3:4, so 21:9, 3:2,\n * 2:3 and the other wide or in-between ratios move to GPT Image 2.5 Sunburst,\n * and 4:5 / 5:4 (which neither GPT generation draws) to Nano Banana Pro.\n */\nexport const IMAGE_MODEL_RATIO_FALLBACKS: Readonly<Record<ImageModelRole, readonly string[]>> = {\n character: [\"gpt-image-2-5-sunburst\", \"nano-banana-pro\"],\n general: [\"gpt-image-2-5-sunburst\", \"nano-banana-pro\"],\n anchor: [\"gpt-image-2-5-sunburst\", \"nano-banana-pro\"],\n edit: [\"gpt-image-2-5-sunburst-i2i\", \"nano-banana-pro\"],\n}\n\n/** True when the model's catalog entry lists the ratio (or no ratio was asked for). */\nexport function imageModelDrawsRatio(modelId: string, aspectRatio?: string | null): boolean {\n if (!aspectRatio) return true\n const ratios = MODEL_CATALOG[modelId]?.aspectRatios\n return ratios === undefined || ratios.includes(aspectRatio)\n}\n\n/**\n * The default image model for a role at the requested aspect ratio: the role's\n * model when it draws the ratio, else the first fallback that does, else the\n * role's model (whose own ratio normalization then snaps the ratio). Read from\n * the catalog, so widening a model's documented ratios moves this with it.\n */\nexport function defaultImageModel(role: ImageModelRole, aspectRatio?: string | null): string {\n const primary = IMAGE_MODEL_ROLE_DEFAULTS[role]\n if (imageModelDrawsRatio(primary, aspectRatio)) return primary\n return IMAGE_MODEL_RATIO_FALLBACKS[role].find((id) => imageModelDrawsRatio(id, aspectRatio)) ?? primary\n}\n"]}
1
+ {"version":3,"sources":["../src/image-model-roles.ts"],"names":[],"mappings":";;;AAsBO,IAAM,yBAAA,GAA4B;AAAA,EACvC,SAAA,EAAW,aAAA;AAAA,EACX,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,aAAA;AAAA,EACR,IAAA,EAAM;AACR;AAUO,IAAM,2BAAA,GAAmF;AAAA,EAC9F,SAAA,EAAW,CAAC,wBAAA,EAA0B,iBAAiB,CAAA;AAAA,EACvD,OAAA,EAAS,CAAC,wBAAA,EAA0B,iBAAiB,CAAA;AAAA,EACrD,MAAA,EAAQ,CAAC,wBAAA,EAA0B,iBAAiB,CAAA;AAAA,EACpD,IAAA,EAAM,CAAC,4BAAA,EAA8B,iBAAiB;AACxD;AAGO,SAAS,oBAAA,CAAqB,SAAiB,WAAA,EAAsC;AAC1F,EAAA,IAAI,CAAC,aAAa,OAAO,IAAA;AACzB,EAAA,MAAM,MAAA,GAAS,aAAA,CAAc,OAAO,CAAA,EAAG,YAAA;AACvC,EAAA,OAAO,MAAA,KAAW,MAAA,IAAa,MAAA,CAAO,QAAA,CAAS,WAAW,CAAA;AAC5D;AAQO,SAAS,iBAAA,CAAkB,MAAsB,WAAA,EAAqC;AAC3F,EAAA,MAAM,OAAA,GAAU,0BAA0B,IAAI,CAAA;AAC9C,EAAA,IAAI,oBAAA,CAAqB,OAAA,EAAS,WAAW,CAAA,EAAG,OAAO,OAAA;AACvD,EAAA,OAAO,2BAAA,CAA4B,IAAI,CAAA,CAAE,IAAA,CAAK,CAAC,OAAO,oBAAA,CAAqB,EAAA,EAAI,WAAW,CAAC,CAAA,IAAK,OAAA;AAClG","file":"chunk-GRIMIJJ3.js","sourcesContent":["import { MODEL_CATALOG } from \"./model-catalog.js\"\n\n/**\n * The platform's answer to \"which image model, when the caller names none\".\n *\n * One table by ROLE, so every surface that picks for the user (node defaults,\n * route and workflow fallbacks, MCP tools, studios, pipelines) reads the same\n * model instead of keeping its own literal. Before this table those literals\n * had drifted apart: the Generate Image node started on Nano Banana Pro, the\n * routes fell back to the original Nano Banana, and MCP used Nano Banana 2.1.\n *\n * Decided on 2026-10-08 from a blind five-model comparison, quality\n * first and price second:\n * - characters, general text-to-image and video anchors on GPT Image 2;\n * - edits on GPT Image 2.5 Flare.\n * With reference images attached, GPT Image 2 runs as its i2i sibling (the\n * provider swaps it), so `character` covers identity-from-reference too.\n *\n * Nano Banana Pro is no longer a default. It remains a FALLBACK only: last in\n * the ratio chain below (it is the one model here that draws 4:5 and 5:4), the\n * GPT-family safety-block retry, and the swimwear dressing model.\n */\nexport const IMAGE_MODEL_ROLE_DEFAULTS = {\n character: \"gpt-image-2\",\n general: \"gpt-image-2\",\n anchor: \"gpt-image-2\",\n edit: \"gpt-image-2-5-flare-i2i\",\n} as const\n\nexport type ImageModelRole = keyof typeof IMAGE_MODEL_ROLE_DEFAULTS\n\n/**\n * Where a role's model goes when it cannot draw the requested aspect ratio.\n * GPT Image 2 draws only auto / 1:1 / 16:9 / 9:16 / 4:3 / 3:4, so 21:9, 3:2,\n * 2:3 and the other wide or in-between ratios move to GPT Image 2.5 Sunburst,\n * and 4:5 / 5:4 (which neither GPT generation draws) to Nano Banana Pro.\n */\nexport const IMAGE_MODEL_RATIO_FALLBACKS: Readonly<Record<ImageModelRole, readonly string[]>> = {\n character: [\"gpt-image-2-5-sunburst\", \"nano-banana-pro\"],\n general: [\"gpt-image-2-5-sunburst\", \"nano-banana-pro\"],\n anchor: [\"gpt-image-2-5-sunburst\", \"nano-banana-pro\"],\n edit: [\"gpt-image-2-5-sunburst-i2i\", \"nano-banana-pro\"],\n}\n\n/** True when the model's catalog entry lists the ratio (or no ratio was asked for). */\nexport function imageModelDrawsRatio(modelId: string, aspectRatio?: string | null): boolean {\n if (!aspectRatio) return true\n const ratios = MODEL_CATALOG[modelId]?.aspectRatios\n return ratios === undefined || ratios.includes(aspectRatio)\n}\n\n/**\n * The default image model for a role at the requested aspect ratio: the role's\n * model when it draws the ratio, else the first fallback that does, else the\n * role's model (whose own ratio normalization then snaps the ratio). Read from\n * the catalog, so widening a model's documented ratios moves this with it.\n */\nexport function defaultImageModel(role: ImageModelRole, aspectRatio?: string | null): string {\n const primary = IMAGE_MODEL_ROLE_DEFAULTS[role]\n if (imageModelDrawsRatio(primary, aspectRatio)) return primary\n return IMAGE_MODEL_RATIO_FALLBACKS[role].find((id) => imageModelDrawsRatio(id, aspectRatio)) ?? primary\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { uiResolutionFill } from './chunk-QA3MVQ32.js';
2
- import { HIGH_QUALITY_PROVIDERS, TWO_K_RESOLUTION_PROVIDERS, RESOLUTION_2K_4K_TIERED_PROVIDERS, IDEOGRAM_PROVIDERS, T2I_TO_I2I_VARIANT, DURATION_PRICED_PROVIDERS, isVeoProvider, VEO_RESOLUTION_TIERED_PROVIDERS, isGeminiOmniProvider, pricedOutputDurationSec, VIDEO_DURATION_TIERS, getVideoAudioCapability, AUDIO_ADDON_PROVIDERS, MODE_ADDON_PROVIDERS, RESOLUTION_VIDEO_REF_PRICING, PRICING_DEFAULT_RESOLUTION, RESOLUTION_DURATION_PRICING, isWan3Provider, normalizeWan3Resolution, isMinimaxH3Provider, normalizeMinimaxH3Resolution, MOTION_DURATION_TIERS, snapToNearestDuration } from './chunk-PHZ23DP3.js';
3
- import { isFlux2Model, normalizeModelInput, MODEL_CATALOG, normalizeVideoRequestParams, VIDEO_DURATION_AUTO, autoAspectNeedsSourceImage, FLUX2_RES_MP, defaultResolutionFor } from './chunk-ZO5PBBFX.js';
1
+ import { uiResolutionFill } from './chunk-QXW6O56Z.js';
2
+ import { HIGH_QUALITY_PROVIDERS, TWO_K_RESOLUTION_PROVIDERS, RESOLUTION_2K_4K_TIERED_PROVIDERS, IDEOGRAM_PROVIDERS, T2I_TO_I2I_VARIANT, DURATION_PRICED_PROVIDERS, isVeoProvider, VEO_RESOLUTION_TIERED_PROVIDERS, isGeminiOmniProvider, pricedOutputDurationSec, VIDEO_DURATION_TIERS, getVideoAudioCapability, AUDIO_ADDON_PROVIDERS, MODE_ADDON_PROVIDERS, RESOLUTION_VIDEO_REF_PRICING, PRICING_DEFAULT_RESOLUTION, RESOLUTION_DURATION_PRICING, isMinimaxH3Provider, normalizeMinimaxH3Resolution, MOTION_DURATION_TIERS, snapToNearestDuration, isWan3Provider, normalizeWan3Resolution, isViduQ4Provider, normalizeViduQ4Resolution } from './chunk-MUA5L25B.js';
3
+ import { isFlux2Model, normalizeModelInput, MODEL_CATALOG, normalizeVideoRequestParams, VIDEO_DURATION_AUTO, autoAspectNeedsSourceImage, FLUX2_RES_MP, defaultResolutionFor } from './chunk-GKJRNIP4.js';
4
4
 
5
5
  // src/credit-identifiers.ts
6
6
  function flux2MegapixelTier(model, resolution) {
@@ -94,6 +94,11 @@ function ltxPricedTier(provider, resolution, duration) {
94
94
  const dur = snapToNearestDuration(pricedOutputDurationSec(provider, duration), allowed);
95
95
  return { band, duration: dur };
96
96
  }
97
+ function wireNormalizedResolution(provider, resolution) {
98
+ if (isWan3Provider(provider)) return normalizeWan3Resolution(resolution).toLowerCase();
99
+ if (isViduQ4Provider(provider)) return normalizeViduQ4Resolution(resolution);
100
+ return resolution;
101
+ }
97
102
  function buildVideoCreditModelIdentifier(provider, duration, sound, nodeType, mode, resolution, hasVideoRef) {
98
103
  let effectiveProvider = provider;
99
104
  if (nodeType === "text-to-video") {
@@ -149,7 +154,7 @@ function buildVideoCreditModelIdentifier(provider, duration, sound, nodeType, mo
149
154
  if (resTiers) {
150
155
  const declaredDefault = PRICING_DEFAULT_RESOLUTION[effectiveProvider];
151
156
  const fallback = declaredDefault && resTiers.includes(declaredDefault) ? declaredDefault : resTiers[0];
152
- const requested = isWan3Provider(effectiveProvider) ? normalizeWan3Resolution(resolution).toLowerCase() : resolution;
157
+ const requested = wireNormalizedResolution(effectiveProvider, resolution);
153
158
  const res = requested && resTiers.includes(requested) ? requested : fallback;
154
159
  identifier += `:${res}`;
155
160
  }
@@ -263,5 +268,5 @@ var SUNO_VERSION_CREDIT_KEYS = {
263
268
  };
264
269
 
265
270
  export { SPEAKER_VIEW_CREDIT_IDS, SPEAKER_VIEW_PRICE_TIERS, SUNO_SELECT_OPERATIONS, SUNO_VERSION_CREDIT_KEYS, SUNO_VERSION_PRICED_OPERATIONS, applyEdlCreditId, buildCreditModelIdentifier, buildMotionCreditModelIdentifier, buildVideoCreditModelIdentifier, imageGenAutoAspectNeedsSourceImage, normalizedImageGenModelId, pricedVideoSelection, resolveImageGenCreditIdentifier, resolveNormalizedImageGen, seedanceVideoEditCreditId, speakerViewCreditId, speedRampCreditId, sunoCreditType, videoGenerationCreditId };
266
- //# sourceMappingURL=chunk-5RYLK3MQ.js.map
267
- //# sourceMappingURL=chunk-5RYLK3MQ.js.map
271
+ //# sourceMappingURL=chunk-GVHBHUFV.js.map
272
+ //# sourceMappingURL=chunk-GVHBHUFV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/credit-identifiers.ts"],"names":[],"mappings":";;;;;AA8DA,SAAS,kBAAA,CAAmB,OAAmB,UAAA,EAA6B;AAC1E,EAAA,MAAM,IAAA,GAAO,CAAC,CAAA,KAAc,CAAA,CAAE,QAAQ,SAAA,EAAW,EAAE,EAAE,IAAA,EAAK;AAC1D,EAAA,MAAM,MAAM,OAAO,UAAA,KAAe,QAAA,GAAW,IAAA,CAAK,UAAU,CAAA,G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AACvD;AAUO,IAAM,wBAAA,GAA6D;AAAA,EACxE,EAAA,EAAI,SAAA;AAAA,EACJ,OAAA,EAAS,cAAA;AAAA,EACT,OAAA,EAAS,cAAA;AAAA,EACT,IAAA,EAAM,WAAA;AAAA,EACN,EAAA,EAAI;AACN","file":"chunk-GVHBHUFV.js","sourcesContent":["/**\n * Build composite credit model identifiers for variable pricing.\n * Shared between frontend and backend.\n */\n\nimport {\n HIGH_QUALITY_PROVIDERS,\n TWO_K_RESOLUTION_PROVIDERS,\n RESOLUTION_2K_4K_TIERED_PROVIDERS,\n IDEOGRAM_PROVIDERS,\n DURATION_PRICED_PROVIDERS,\n AUDIO_ADDON_PROVIDERS,\n MODE_ADDON_PROVIDERS,\n RESOLUTION_VIDEO_REF_PRICING,\n RESOLUTION_DURATION_PRICING,\n VEO_RESOLUTION_TIERED_PROVIDERS,\n VIDEO_DURATION_TIERS,\n pricedOutputDurationSec,\n snapToNearestDuration,\n PRICING_DEFAULT_RESOLUTION,\n MOTION_DURATION_TIERS,\n T2I_TO_I2I_VARIANT,\n isVeoProvider,\n isMinimaxH3Provider,\n isGeminiOmniProvider,\n isWan3Provider,\n isViduQ4Provider,\n normalizeMinimaxH3Resolution,\n normalizeWan3Resolution,\n normalizeViduQ4Resolution,\n getVideoAudioCapability,\n} from \"./model-constants.js\"\nimport { isFlux2Model, FLUX2_RES_MP, type Flux2Model } from \"./flux2-pricing.js\"\nimport { VIDEO_DURATION_AUTO } from \"./video-duration-auto.js\"\nimport { uiResolutionFill } from \"./video-ui-defaults.js\"\nimport { MODEL_CATALOG, autoAspectNeedsSourceImage, normalizeModelInput, normalizeVideoRequestParams, defaultResolutionFor, type ModelInputAdjustment, type SourceImageSize } from \"./model-catalog.js\"\n\n/**\n * The megapixel tier a Flux 2 credit identifier is keyed on, for ANY incoming\n * `resolution` value.\n *\n * Flux 2 is the only family whose identifier INTERPOLATES the resolution\n * instead of matching it against a known set, and its callers are not\n * guaranteed to hand it a Flux 2 value:\n * - the multi-provider cost preview prices one node's data against EVERY\n * selected provider (`frontend/src/ee/hooks/use-providers-credits-sum.ts`),\n * so a node whose `resolution` is \"2K\" (the flux / nano-banana-pro value\n * space) reaches this branch verbatim;\n * - node data written straight into workflow JSON by an agent, an import or\n * a template never ran the config panel's provider-change fail-safe.\n * Interpolating that produced the off-grid id `flux-2-pro:2KMP:0ref`, which no\n * pricing row can answer — every cost badge 503'd `price_not_configured`\n * (18 production app-reports, 2026-09-07..14).\n *\n * A value off the grid snaps to the model's DEFAULT tier — the same `preferred`\n * value `normalizeModelInput` uses — so the preview asks for exactly the id the\n * route will reserve (both routes and the orchestrator normalize through\n * `resolveNormalizedImageGen` first, which makes this snap a no-op for them).\n * An ABSENT resolution keeps its long-standing meaning (\"this caller has no\n * resolution dimension at all\") and stays on 1 MP rather than moving to the\n * model default, which would silently re-price every resolution-less node.\n */\nfunction flux2MegapixelTier(model: Flux2Model, resolution?: string): string {\n const bare = (v: string) => v.replace(/\\s*MP$/i, \"\").trim()\n const raw = typeof resolution === \"string\" ? bare(resolution) : \"\"\n if (raw === \"\") return \"1\"\n // Numeric match so \"2.0\"/\" 2 MP\" land on the same grid point as \"2\", and the\n // GRID's own spelling is what gets emitted — returning the caller's \"2.0\"\n // would build \":2.0MP:\", another id no pricing row carries.\n const tier = FLUX2_RES_MP.find((t) => Number(t) === Number(raw))\n return tier ?? bare(defaultResolutionFor(model) ?? \"1 MP\")\n}\n\n/**\n * Compute composite model identifier for variable credit pricing.\n * Examples: \"gpt-image:high\", \"flux:2K\", \"nano-banana-pro:4K\", \"ideogram:TURBO\",\n * \"flux-2-pro:2MP\", \"flux-2-max:2MP:1ref\" (Flux 2 — billed per megapixel).\n *\n * For image models, uses quality/resolution/renderingSpeed and (Flux 2) the output\n * megapixel count plus (Flux 2 Max) the number of reference images attached at request time.\n * For video models, uses duration/sound params when the model has variable pricing.\n */\nexport function buildCreditModelIdentifier(\n provider: string,\n quality?: string,\n resolution?: string,\n renderingSpeed?: string,\n targetResolution?: string,\n referenceImageCount?: number,\n): string {\n // Flux 2 family: billed per output megapixel AND per reference image (each\n // ref counts as input megapixels). Resolution arrives as \"N MP\" strings (the\n // UI value space); strip the unit. ALL three models encode the ref count\n // (capped at 8): Pro/Klein i2i always carry the source image as a ref and\n // their cost formula charges per input MP, so the reserved identifier must\n // reflect refs (there is no metered true-up to correct an under-reserved tier).\n if (isFlux2Model(provider)) {\n return `${provider}:${flux2MegapixelTier(provider, resolution)}MP:${Math.min(referenceImageCount ?? 0, 8)}ref`\n }\n if (HIGH_QUALITY_PROVIDERS.has(provider) && quality === \"high\") {\n return `${provider}:high`\n }\n if (TWO_K_RESOLUTION_PROVIDERS.has(provider) && resolution === \"2K\") {\n return `${provider}:2K`\n }\n if (provider === \"nano-banana-pro\" && resolution === \"4K\") {\n return `${provider}:4K`\n }\n if (RESOLUTION_2K_4K_TIERED_PROVIDERS.has(provider) && (resolution === \"2K\" || resolution === \"4K\")) {\n return `${provider}:${resolution}`\n }\n // Topaz Image Upscale: 2K is default (no suffix), 4K/8K get composite identifiers\n if (provider === \"topaz-image-upscale\" && targetResolution && targetResolution !== \"2K\") {\n return `${provider}:${targetResolution}`\n }\n if (IDEOGRAM_PROVIDERS.has(provider)) {\n if (renderingSpeed === \"TURBO\") return `${provider}:TURBO`\n if (renderingSpeed === \"QUALITY\") return `${provider}:QUALITY`\n }\n return provider\n}\n\n/**\n * An image request's catalog-snapped parameters PLUS the credit identifier\n * priced off them.\n *\n * `adjustments` is the disclosure channel: every lever this changed, why, and\n * to what. Routes return it in the 200 body so a caller learns their value was\n * corrected instead of silently getting something else.\n */\nexport interface NormalizedImageGen {\n /** Credit identifier, priced off the SNAPPED `resolution` / `quality`. */\n identifier: string\n /** The catalog model id the params were snapped against (post T2I→I2I swap). */\n modelId: string\n aspectRatio?: string\n resolution?: string\n quality?: string\n /** Empty when the caller's values were already valid for `modelId`. */\n adjustments: ModelInputAdjustment[]\n}\n\n/**\n * The catalog model `resolveNormalizedImageGen` snaps against: the provider\n * (Nano Banana when none is named), or — with `swapToI2i` and references\n * attached — its i2i sibling, the model the generate-image route and the\n * workflow payload builder then send. That sibling has its OWN catalog entry\n * and lever lists. Exported so a caller that has to decide something about\n * those lists before the snap (whether a photo's size is worth reading) asks\n * about the same model the snap will use.\n */\nexport function normalizedImageGenModelId(opts: {\n provider: unknown\n refCount: number\n swapToI2i?: boolean\n}): string {\n const provider = typeof opts.provider === \"string\" && opts.provider.length > 0 ? opts.provider : \"nano-banana\"\n return opts.swapToI2i && opts.refCount > 0 ? (T2I_TO_I2I_VARIANT[provider] ?? provider) : provider\n}\n\n/**\n * Whether \"auto\" on a Generate Image request can need its photo's size: the\n * model the snap runs against (`normalizedImageGenModelId` with the swap on)\n * has no native auto. Given the ASSEMBLED reference count, it asks about exactly\n * that model; without one — a write boundary, or a run before its references\n * assemble — about both the provider and its i2i sibling, since references may\n * yet attach.\n */\nexport function imageGenAutoAspectNeedsSourceImage(opts: {\n provider: unknown\n aspectRatio: unknown\n refCount?: number\n}): boolean {\n const asks = (refCount: number) =>\n autoAspectNeedsSourceImage(normalizedImageGenModelId({ provider: opts.provider, refCount, swapToI2i: true }), opts.aspectRatio)\n return opts.refCount === undefined ? asks(0) || asks(1) : asks(opts.refCount)\n}\n\n/**\n * Snap an image request's catalog-governed levers to a combination the model\n * actually accepts, and price the credit identifier off the SNAPPED values.\n *\n * WHY THE SNAP LIVES HERE and not at the call site. Both image routes compute\n * their credit identifier TWICE — once in the `creditGuard` preHandler (the\n * CHECK) and once at the handler's `reserveCreditsForJob` (the DEBIT) — and a\n * dedicated test asserts the two stay byte-identical (see\n * `backend/src/routes/__tests__/generate-image.test.ts`, \"CHECK === DEBIT\").\n * `resolution` and `quality` are pricing dimensions, so a snap applied at only\n * one of those sites breaks that invariant, and `commit_credits` never collects\n * an upward delta — the reserve IS the charge. Putting the snap inside the\n * primitive makes CHECK, DEBIT and the workflow orchestrator agree by\n * construction rather than by everyone remembering to call a normalizer.\n *\n * Inputs are typed `unknown` on purpose: the preHandler runs BEFORE Zod, so a\n * caller can put a number or an object in `resolution`. Non-strings become\n * `undefined` rather than reaching `normalizeModelInput` as a lie.\n *\n * Unknown model ids pass through untouched (same contract as\n * `normalizeModelInput`) — the route's provider enum is the gate for those.\n *\n * `sourceImage` is the size of the photo the request transforms or is drawn\n * from (an image-to-image / edit source, or Generate Image's first wired\n * reference). It only decides \"auto\" on a model without a native auto, and the\n * ratio is not a pricing dimension on any such model (pinned across the catalog\n * by `auto-aspect-source.test.ts`), so a CHECK that runs before the size is\n * known prices the same identifier as the DEBIT that knows it.\n */\nexport function resolveNormalizedImageGen(opts: {\n provider: string | undefined\n aspectRatio?: unknown\n quality?: unknown\n resolution?: unknown\n renderingSpeed?: unknown\n refCount: number\n swapToI2i?: boolean\n sourceImage?: SourceImageSize\n}): NormalizedImageGen {\n const str = (v: unknown): string | undefined =>\n typeof v === \"string\" && v.length > 0 ? v : undefined\n\n const modelId = normalizedImageGenModelId(opts)\n\n const n = normalizeModelInput(\n modelId,\n {\n aspectRatio: str(opts.aspectRatio),\n resolution: str(opts.resolution),\n quality: str(opts.quality),\n },\n { sourceImage: opts.sourceImage },\n )\n\n return {\n identifier: buildCreditModelIdentifier(\n modelId,\n n.quality,\n n.resolution,\n str(opts.renderingSpeed),\n undefined,\n opts.refCount,\n ),\n modelId,\n aspectRatio: n.aspectRatio,\n resolution: n.resolution,\n quality: n.quality,\n adjustments: n.adjustments,\n }\n}\n\n/**\n * Reference-aware image-generation credit identifier — the SINGLE source of\n * truth shared by the single-node routes (`/v1/generate-image`,\n * `/v1/image-to-image`) and the workflow orchestrator\n * (`payload-builder.ts`). It centralises the two pricing dimensions that must\n * match across both paths or a Flux 2 generation is billed the wrong tier\n * (Flux 2 commits non-metered / has no upward true-up, so the reserved\n * identifier IS the final charge):\n * - `refCount`: the number of reference images sent to the provider (Flux 2\n * bills per ref). generate-image passes the assembled count (0 for pure\n * text-to-image); image-to-image passes 1 (the primary `imageUrl`) + extras.\n * - `swapToI2i`: generate-image auto-swaps a bare T2I provider to its i2i\n * sibling (`T2I_TO_I2I_VARIANT`) when refs are attached, so the credit id\n * matches the variant actually invoked. image-to-image is already an i2i\n * provider → pass `false`.\n *\n * The LoRA short-circuit (`flux-lora-character`) stays at the call site because\n * the routing decision needs a DB lookup the routes/orchestrator own.\n */\nexport function resolveImageGenCreditIdentifier(opts: {\n provider: string | undefined\n quality?: string\n resolution?: string\n renderingSpeed?: string\n refCount: number\n swapToI2i?: boolean\n}): string {\n return resolveNormalizedImageGen(opts).identifier\n}\n\n// T2V-specific credit overrides: some providers have different costs for T2V\n// vs I2V/V2V due to different default resolutions or colliding with image model names.\nconst T2V_CREDIT_OVERRIDES: Record<string, string> = {\n \"grok\": \"grok-i2v\", // T2V grok, same as I2V grok (not image grok = 4 cr)\n \"wan\": \"wan-t2v\", // T2V wan 1080p = (V2V wan 720p = 70 cr)\n \"wan-turbo\": \"wan-turbo-t2v\", // T2V wan-turbo 720p = (I2V wan-turbo 480p = 40 cr)\n}\n\n/**\n * Compute composite model identifier for video models with duration/audio-based pricing.\n * Examples: \"kling-3.0:5s\", \"kling-3.0:10s:audio\", \"seedance-2:8s:720p-ref\"\n *\n * @param provider - Video model key (e.g., \"kling-3.0\")\n * @param duration - Video duration in seconds\n * @param sound - Whether audio/sound is enabled\n * @param nodeType - Node type for T2V-specific cost overrides\n * @param mode - Quality variant that affects pricing\n * @param resolution - Output resolution (used by Seedance 2 for 480p/720p pricing)\n * @param hasVideoRef - Whether a reference video is connected (Seedance 2 uses a lower per-second rate when true)\n */\n/**\n * LTX 2.3 (Lightricks via Replicate) credit tiers: priced by\n * (resolution-band × duration-seconds). Keys mirror STATIC_CREDIT_COSTS /\n * model_pricing EXACTLY (lowercase band + raw seconds + \"s\"), e.g.\n * \"ltx-2.3-pro:1080p:6s\". This map is the source of truth for the nearest-tier\n * snap below, so an off-catalog (resolution, duration) from a direct API/SDK\n * call maps to a SEEDED price instead of hard-failing (price_not_configured\n * 503). Pro: 6/8/10s at every band. Fast: up to 20s at 1080p, 6/8/10s at 2k/4k.\n */\nconst LTX_DURATION_TIERS: Record<string, Record<string, number[]>> = {\n \"ltx-2.3-pro\": { \"1080p\": [6, 8, 10], \"2k\": [6, 8, 10], \"4k\": [6, 8, 10] },\n \"ltx-2.3-fast\": { \"1080p\": [6, 8, 10, 12, 14, 16, 18, 20], \"2k\": [6, 8, 10], \"4k\": [6, 8, 10] },\n}\n\n/**\n * The (band, duration) tier the LTX pricing ladder charges for a request, or\n * `undefined` for a non-LTX provider. Extracted so\n * `buildVideoCreditModelIdentifier` and `pricedVideoSelection` read the ladder\n * ONCE — the routes must send the tier they reserved, and a second copy of this\n * math is exactly how the two drift apart.\n *\n * An unknown/absent band falls back to 1080p (LTX's own default, and the band\n * `snapLtxInput` snaps to at the Replicate call), and an off-tier duration\n * snaps to the NEAREST seeded one so the emitted composite always prices.\n */\nfunction ltxPricedTier(\n provider: string,\n resolution?: string,\n duration?: number | string,\n): { band: string; duration: number } | undefined {\n const bands = LTX_DURATION_TIERS[provider]\n if (!bands) return undefined\n const band = bands[String(resolution)] ? String(resolution) : \"1080p\"\n const allowed = bands[band]!\n // The model's own default (catalog `defaultDuration`) when unset, then the\n // nearest rung of THIS band's ladder — the length LTX renders.\n const dur = snapToNearestDuration(pricedOutputDurationSec(provider, duration), allowed)\n return { band, duration: dur }\n}\n\n/**\n * The resolution a provider whose runner NORMALIZES the lever actually renders,\n * in the lowercase spelling of its credit composites — billing collapses\n * through the very normalizer the runner sends, so render == billed for every\n * spelling. `undefined` passes through untouched for every other provider.\n */\nfunction wireNormalizedResolution(provider: string, resolution: string | undefined): string | undefined {\n if (isWan3Provider(provider)) return normalizeWan3Resolution(resolution).toLowerCase()\n if (isViduQ4Provider(provider)) return normalizeViduQ4Resolution(resolution)\n return resolution\n}\n\nexport function buildVideoCreditModelIdentifier(\n provider: string,\n duration?: number | string,\n sound?: boolean,\n nodeType?: \"image-to-video\" | \"text-to-video\",\n mode?: string,\n resolution?: string,\n hasVideoRef?: boolean,\n): string {\n // T2V overrides: some providers have different base costs for text-to-video\n let effectiveProvider = provider\n if (nodeType === \"text-to-video\") {\n const override = T2V_CREDIT_OVERRIDES[provider]\n if (override) {\n // If override target also has duration pricing, use it as effective provider\n if (DURATION_PRICED_PROVIDERS.has(override)) {\n effectiveProvider = override\n } else {\n return override\n }\n }\n }\n\n // VEO 3.x resolution-tiered pricing: 720p is the base (no suffix), 1080p gets\n // \":1080p\" (Fast/Lite only), and 4K gets \":4k\" for ALL three tiers — direct-4K\n // generation chains KIE's get-4k-video off the base generation (the base runs\n // at 1080p). Duration is fixed at 8s for VEO so the duration-tier path below\n // does not apply.\n if (isVeoProvider(effectiveProvider)) {\n if (resolution === \"4k\") return `${effectiveProvider}:4k`\n // 1080p tier is Fast/Lite only (Quality has no 1080p surcharge).\n if (resolution === \"1080p\" && VEO_RESOLUTION_TIERED_PROVIDERS.has(effectiveProvider)) return `${effectiveProvider}:1080p`\n return effectiveProvider\n }\n\n // Gemini Omni family (gemini-omni-video + gemini-omni-flash): priced by\n // (resolution-band × duration), with a flat per-generation rate when a source\n // video is supplied (V2V). Lowercase \"4k\". The prefix is TEMPLATED from the\n // provider id, so a further Omni SKU needs no edit here — it only has to join\n // GEMINI_OMNI_PROVIDERS and seed its rows. These models are deliberately NOT\n // in DURATION_PRICED_PROVIDERS; this branch early-returns before that gate.\n if (isGeminiOmniProvider(effectiveProvider)) {\n if (hasVideoRef) {\n return resolution === \"4k\" ? `${effectiveProvider}:4k:vref` : `${effectiveProvider}:vref`\n }\n // The rendered length through the catalog funnel (nearest legal tier, the\n // model's own default when unset) so the composite is always a SEEDED one.\n const d = pricedOutputDurationSec(effectiveProvider, duration)\n return resolution === \"4k\" ? `${effectiveProvider}:4k:${d}` : `${effectiveProvider}:${d}`\n }\n\n // LTX 2.3: priced by (resolution-band × duration-seconds). The RESERVE must be\n // the correct composite — commit_credits (migration 176) only refunds a surplus\n // (actual < reserved) and NEVER collects an upward delta, so an under-reserved\n // LTX run (the bare-id default = cheapest 1080p:6s tier) stays under-charged\n // even with meteredCost:true. Snap to a seeded tier so the id always prices.\n const ltxTier = ltxPricedTier(effectiveProvider, resolution, duration)\n if (ltxTier) {\n return `${effectiveProvider}:${ltxTier.band}:${ltxTier.duration}s`\n }\n\n if (!DURATION_PRICED_PROVIDERS.has(effectiveProvider)) {\n return effectiveProvider\n }\n\n // A named-provider request with NO duration renders the model's own default\n // (kie/models.ts extraParams), so price that default — not the global 5s —\n // for providers whose per-second tiers wouldn't snap 5 up to it\n // (minimax-h3, seedance-2-5). One helper, shared with the dynamic\n // reference-video reservations, so the tier and the scaled reserve agree.\n const durationSec = pricedOutputDurationSec(effectiveProvider, duration)\n const tiers = VIDEO_DURATION_TIERS[effectiveProvider]\n if (!tiers) return effectiveProvider\n\n // Find the matching duration tier\n const tier = tiers.find(t => durationSec <= t.maxSeconds) ?? tiers[tiers.length - 1]\n let identifier = `${effectiveProvider}:${tier.suffix}`\n\n // Append audio suffix if applicable. When the caller expressed no intent\n // (sound === undefined), fall back to the model's own default (capability\n // `defaultOn` — kling-3.0 generates audio unless explicitly disabled), so an\n // intent-less request is billed for the audio it actually produces instead\n // of reserving the cheaper no-audio tier against an audio-on generation.\n const soundOn = sound ?? (getVideoAudioCapability(effectiveProvider).defaultOn === true)\n if (AUDIO_ADDON_PROVIDERS.has(effectiveProvider) && soundOn) {\n identifier += \":audio\"\n }\n\n // Append mode suffix for providers with quality-tiered pricing\n // \"high\" comes from I2V videoSize field, \"pro\" comes from T2V mode field\n if (MODE_ADDON_PROVIDERS.has(effectiveProvider) && (mode === \"high\" || mode === \"pro\")) {\n identifier += \":high\"\n }\n\n // Seedance 2.0 family: per-second billing with resolution + video-ref dimensions.\n // KIE accepts 480p / 720p / 1080p natively; per-second rates rise non-linearly\n // so each tier gets its own composite identifier.\n if (RESOLUTION_VIDEO_REF_PRICING.has(effectiveProvider)) {\n // Clamp to the model's catalog resolutions (single source of truth): e.g.\n // seedance-2-mini exposes only 480p/720p, so a stale/explicit 1080p (or 4k)\n // maps to its top priced tier instead of emitting an unpriced composite\n // (which the hard-fail credit guard would 503 on at runtime).\n const supported = MODEL_CATALOG[effectiveProvider]?.resolutions ?? [\"480p\", \"720p\", \"1080p\"]\n // An OMITTED resolution renders the model's KIE-side default, so price that\n // default rather than the cheapest tier — otherwise an intent-less request\n // reserves 480p against a 720p render and commit_credits (refund-only) can\n // never collect the delta. Providers without an entry keep the historical\n // 480p fallback, so this cannot reprice anything already live.\n const requested = resolution ?? PRICING_DEFAULT_RESOLUTION[effectiveProvider]\n const want = requested === \"4k\" ? \"4k\" : requested === \"1080p\" ? \"1080p\" : requested === \"720p\" ? \"720p\" : \"480p\"\n // Unsupported (e.g. a stale 1080p on seedance-2-mini) clamps to the model's\n // top priced tier so the emitted composite is always seeded.\n const res = supported.includes(want) ? want : (supported[supported.length - 1] ?? \"480p\")\n identifier += `:${res}`\n if (hasVideoRef) identifier += \"-ref\"\n }\n\n // Duration × resolution pricing without a -ref dimension. Resolutions\n // outside the provider's priced tiers (or undefined) collapse to the first\n // (default) tier so the emitted composite is always seeded — the hard-fail\n // guard fuzzes the whole resolution space.\n const resTiers = RESOLUTION_DURATION_PRICING[effectiveProvider]\n if (resTiers) {\n // The \"default tier\" is the provider's DECLARED default when it has one\n // (PRICING_DEFAULT_RESOLUTION — wan-3 renders 720p, not the cheapest tier),\n // otherwise the first listed tier. Declaring it explicitly means a cosmetic\n // reorder of the tier list can never reprice a live model, and an OMITTED\n // *or* unsupported resolution both land on what actually renders instead of\n // on the cheapest row (commit_credits refunds a surplus but can never\n // collect a shortfall). Behaviour-neutral for every member without a\n // declared default.\n const declaredDefault = PRICING_DEFAULT_RESOLUTION[effectiveProvider]\n const fallback = declaredDefault && resTiers.includes(declaredDefault) ? declaredDefault : resTiers[0]!\n // Wan 3.0 renders through `normalizeWan3Resolution`, which is CASE-INSENSITIVE\n // (\"1080P\" — KIE's own OpenAPI enum spelling, and the natural value for an\n // integrator reading the provider docs — renders 1080P). The tier list here is\n // lowercase and `Array.includes` is case-sensitive, so without this the render\n // path and the billing path disagree: \"1080P\" rendered the top tier and billed\n // the 720p row, a shortfall `commit_credits` (refund-only) can never collect.\n // Collapsing through the SAME normalizer the runner uses makes render == billed\n // by construction for every spelling, including garbage (→ the declared 720p).\n // Scoped to the families whose runner normalizes on purpose (Wan 3.0, Vidu\n // Q4): the other RESOLUTION_DURATION_PRICING members pass `resolution` to\n // their wire verbatim, so case-folding their billing without probing their\n // wire would reprice live models.\n const requested = wireNormalizedResolution(effectiveProvider, resolution)\n const res = requested && resTiers.includes(requested) ? requested : fallback\n identifier += `:${res}`\n }\n\n // MiniMax Hailuo 3 (768P lever, 2026-08-03): bare duration composites stay\n // the 2K (default) rate — byte-identical to the pre-lever seeded rows, so\n // existing workflows and admin overrides keep their ids — and only a\n // verified 768P selection appends \":768p\". normalizeMinimaxH3Resolution\n // collapses anything else to 2K, matching what KIE renders for an\n // omitted/unknown value, so billing can never undercut the render.\n if (isMinimaxH3Provider(effectiveProvider) && normalizeMinimaxH3Resolution(resolution) === \"768P\") {\n identifier += \":768p\"\n }\n\n return identifier\n}\n\n/**\n * The credit identifier a video GENERATION node is quoted at — Generate Video\n * (and the legacy Image/Text to Video nodes) and the Video to Video Seedance\n * edit lane, on every surface that quotes one: the node's cost pill, the\n * editor's run estimate, the prompt modal and the backend pre-run estimator.\n *\n * It applies the request levers the run applies BEFORE it prices\n * (payload-builder's `resolveVideoRequestNorm`): the model's UI resolution fill\n * when the node names none (`uiResolutionFill` — what the run sends), then the\n * catalog normalizer `normalizeVideoRequestParams`, which also owns the Seedance\n * Draft rule (a draft is priced AND sent at 480p whatever resolution came with\n * it). Without that, a node with no resolution was quoted at the identifier's\n * own default band (720p on Seedance 2.5) while the run sent and reserved 480p.\n *\n * `hasVideoRef` must come from the GRAPH (a wired reference-video edge, e.g.\n * `countRefModalityEdges(edges, id, \"video\") > 0`), never node data: nothing\n * writes `referenceVideoUrls` into a video node, so reading it there always\n * quoted the plain ladder for a run that reserves on the `-ref` one.\n */\nexport function videoGenerationCreditId(args: {\n provider: string\n duration?: number | string\n sound?: boolean\n nodeType?: \"image-to-video\" | \"text-to-video\"\n mode?: string\n resolution?: string\n draft?: boolean\n hasVideoRef?: boolean\n}): string {\n const { resolution } = normalizeVideoRequestParams(args.provider, {\n resolution: args.resolution ?? uiResolutionFill(args.provider),\n draft: args.draft === true,\n })\n return buildVideoCreditModelIdentifier(\n args.provider,\n args.duration,\n args.sound,\n args.nodeType ?? \"image-to-video\",\n args.mode,\n resolution,\n args.hasVideoRef === true,\n )\n}\n\n/**\n * The credit identifier a Video to Video node's Seedance EDIT lane reserves\n * under. Seedance has no v2v endpoint — the lane is a text-to-video job in edit\n * shape with the source clip as reference video 1 — so it prices on the\n * REFERENCE-VIDEO ladder at the model's LONGEST clip (Auto duration), and the\n * measured settlement refunds down to what was actually delivered.\n *\n * A thin call into {@link videoGenerationCreditId}, so a Generate Video node\n * making the same KIE call (Seedance, Auto, a wired reference video) is quoted\n * the same id. FOUR surfaces must agree on it exactly: the orchestrator's\n * reservation (payload-builder.ts), the backend pre-run estimator\n * (ee/billing/credits.ts), the node's cost pill, and the frontend run-level\n * estimate (config-panels/helpers.ts). A quote that disagrees with the reserve\n * is the documented `price_not_configured` / blank-pill trap.\n *\n * `resolution` is the node's one `v2vResolution` field; when unset the model's\n * own UI fill is priced, which is what the lane will send. `draft` is the\n * node's Seedance Draft toggle (priced at 480p).\n */\nexport function seedanceVideoEditCreditId(provider: string, resolution?: string, draft?: boolean): string {\n return videoGenerationCreditId({\n provider,\n duration: VIDEO_DURATION_AUTO,\n nodeType: \"text-to-video\",\n resolution,\n draft,\n hasVideoRef: true,\n })\n}\n\n/** What the video credit identifier PRICES for a request, for the levers whose\n * priced value must also be the value we SEND. */\nexport interface PricedVideoSelection {\n /** The resolution band the reservation is priced at when the request omitted\n * one — and only where the platform DECLARES that band as the provider's own\n * default. `undefined` means \"leave `resolution` exactly as the request had\n * it\": either the caller supplied one, or the provider's real default is not\n * known to be the band the identifier assumes. */\n resolution?: string\n /** The length the reservation is priced at and the wire carries, for a\n * provider whose price follows the clip length (LTX's seeded tier, the KIE\n * ladders, Gemini Omni). `undefined` for every other provider, and for Auto:\n * their duration passes through. */\n duration?: number\n /** Non-empty only for a lever the caller ASKED for and did not get (a 7s\n * request snapped to the 6s tier). Filling an omitted lever is a disclosure of\n * the price already being charged, not a correction, so it reports nothing. */\n adjustments: ModelInputAdjustment[]\n}\n\n/**\n * The other half of the video money path: `normalizeVideoRequestParams` snaps a\n * value the CATALOG governs; this returns the value the PRICE ladder governs.\n *\n * Two defects it closes, both of the same shape — the identifier prices one\n * thing and the wire carries another, and `commit_credits` (migration 176) only\n * ever refunds a surplus, so the reservation is the final charge:\n *\n * 1. **Absent resolution.** `buildVideoCreditModelIdentifier` prices an omitted\n * `resolution` as a concrete band (LTX → 1080p; a\n * {@link PRICING_DEFAULT_RESOLUTION} member → its declared default). Leaving\n * the key unset then lets the provider pick — documented for the KIE members\n * (their `extraParams` pin the same band) but UNDOCUMENTED for LTX on\n * Replicate. Sending the band we priced makes the two agree by construction.\n *\n * The fill is deliberately limited to providers with a DECLARED default.\n * `buildVideoCreditModelIdentifier` also has un-declared fallbacks — the\n * cheapest tier for a resolution-priced provider with no\n * `PRICING_DEFAULT_RESOLUTION` row — and those are a HEDGE, not a verified\n * provider default: seedance-2 / -fast / -mini pin `resolution: \"720p\"`\n * KIE-side while the identifier prices 480p, so filling 480p would downgrade\n * the render to match a price we already know is wrong. That mismatch is a\n * pre-existing identifier bug and is fixed by seeding the row, not here.\n *\n * 2. **Duration.** Every provider whose price follows the clip length is\n * charged at the length it RENDERS: its own default when the request named\n * none (catalog `defaultDuration`), the nearest length it offers otherwise\n * (`pricedOutputDurationSec` — the runners' own snap rule). The LTX ladder is\n * seeded per (band × seconds), so a 7s request snaps onto the 6s tier;\n * sending 7s would bill six and render seven. The same value is returned for\n * the other length-priced providers (the KIE ladders, Gemini Omni), so what\n * is priced is what is sent. Auto (-1) is the model's call and is untouched.\n *\n * Pure, and IDEMPOTENT against the identifier: feeding its output back in\n * cannot move the reserved tier. `video-request-normalize.test.ts` proves that\n * over every provider × resolution × duration.\n */\nexport function pricedVideoSelection(opts: {\n provider: string\n resolution?: string\n duration?: number | string\n}): PricedVideoSelection {\n const adjustments: ModelInputAdjustment[] = []\n const ltx = ltxPricedTier(opts.provider, opts.resolution, opts.duration)\n\n // The band the request will be priced AND rendered at. An explicit value\n // always wins — this only ever fills an omission.\n const resolution = opts.resolution\n ?? (ltx ? ltx.band : PRICING_DEFAULT_RESOLUTION[opts.provider])\n\n const requested = typeof opts.duration === \"string\" ? parseInt(opts.duration, 10) : opts.duration\n const asked = requested !== undefined && !Number.isNaN(requested)\n\n // Every provider whose price follows the clip length sends the length it is\n // CHARGED at (the catalog funnel: its own default when unset, the nearest\n // legal length otherwise). Auto (-1) is the model's call and is left alone.\n const lengthPriced = !!ltx || DURATION_PRICED_PROVIDERS.has(opts.provider) || isGeminiOmniProvider(opts.provider)\n if (!lengthPriced || (!ltx && asked && requested! <= 0)) return { resolution, adjustments }\n\n const duration = ltx ? ltx.duration : pricedOutputDurationSec(opts.provider, opts.duration)\n if (asked && requested !== duration) {\n adjustments.push({\n field: \"duration\",\n from: requested!,\n to: duration,\n reason: ltx\n ? `LTX renders ${ltx.band} in ${ltx.duration}s steps — using ${ltx.duration}s instead of ${requested}s.`\n : `${opts.provider} renders ${duration}s clips at the nearest length it offers — using ${duration}s instead of ${requested}s.`,\n })\n }\n return { resolution, duration, adjustments }\n}\n\n/**\n * Compute composite model identifier for motion control with duration-tiered pricing.\n * Examples: \"kling-3.0-motion:10s\", \"kling-3.0-motion:1080p:15s\", \"motion-transfer:5s\"\n *\n * Wan Animate providers use resolution-tiered pricing (not per-second):\n * \"wan-animate-move\" (480p default), \"wan-animate-move:580p\", \"wan-animate-move:720p\"\n *\n * @param provider - Motion control provider key (\"kling\" for 2.6, \"kling-3.0\", \"wan-animate-move\", \"wan-animate-replace\")\n * @param resolution - \"720p\" or \"1080p\" (Kling), \"480p\" or \"580p\" or \"720p\" (Wan Animate)\n * @param videoDuration - Reference video duration in seconds (defaults to 10s, unused for Wan Animate)\n */\nexport function buildMotionCreditModelIdentifier(\n provider: string,\n resolution: string,\n videoDuration?: number,\n): string {\n // Wan Animate providers use resolution-tiered pricing (not duration-based)\n if (provider === \"wan-animate-move\" || provider === \"wan-animate-replace\") {\n // 480p is the default (base identifier), 580p and 720p get composite suffix\n if (resolution === \"580p\" || resolution === \"720p\") {\n return `${provider}:${resolution}`\n }\n return provider\n }\n\n const raw = videoDuration ?? 10\n const durationSec = Math.floor(Number.isNaN(raw) ? 10 : raw) // default 10s; floor to match KIE per-second billing\n const tier = MOTION_DURATION_TIERS.find(t => durationSec <= t.maxSeconds)\n ?? MOTION_DURATION_TIERS[MOTION_DURATION_TIERS.length - 1]\n\n const base = provider === \"kling-3.0\" ? \"kling-3.0-motion\" : \"motion-transfer\"\n const resSuffix = resolution === \"1080p\" ? \":1080p\" : \"\"\n return `${base}${resSuffix}:${tier.suffix}`\n}\n\n/**\n * The Suno operations whose credit key depends on the model VERSION.\n *\n * `/v1/suno/generate`, `/cover` and `/extend` resolve their creditGuard\n * identifier through `sunoCreditType(model, <operation>)` (routes/suno.ts\n * :247-249, :335-337, :407-409). EVERY other Suno route charges a flat\n * per-operation key and ignores the version the node carries — mashup (:648),\n * add-instrumental (:852), add-vocals (:907), upload-extend (:1016),\n * replace-section (:710), style-boost (:771), convert-wav (:962),\n * lyrics (:482), music-video (:594), voice (:1218).\n *\n * Anything that QUOTES a Suno price — a dropdown row, a node badge, the\n * workflow-credit estimator — must follow the same split, or it displays a\n * credit key the route never charges.\n */\nexport const SUNO_VERSION_PRICED_OPERATIONS = [\n \"suno-generate\",\n \"suno-cover\",\n \"suno-extend\",\n] as const\n\n/**\n * The seven Suno operations that appear behind a select/dropdown UI (model\n * pickers, node badges, the credit estimator) — the three version-priced\n * operations above, plus the four flat-key operations exercised by\n * `sunoCreditType`'s own test suite. A readonly tuple so later tasks (the\n * model dropdowns, node badges) can iterate or count it without redeclaring\n * the list and drifting from this one.\n */\nexport const SUNO_SELECT_OPERATIONS = [\n \"suno-generate\",\n \"suno-cover\",\n \"suno-extend\",\n \"suno-mashup\",\n \"suno-add-instrumental\",\n \"suno-add-vocals\",\n \"suno-upload-extend\",\n] as const\n\n/**\n * Adjust Speed's price id: motion-compensated (\"smooth\") interpolation is its\n * own, dearer tier. The route, the workflow run, and the editor's badge and\n * run estimate all price through this, so none of them can quote the fast tier\n * for a smooth run.\n */\nexport function speedRampCreditId(quality: unknown): \"speed-ramp\" | \"speed-ramp:smooth\" {\n return quality === \"smooth\" ? \"speed-ramp:smooth\" : \"speed-ramp\"\n}\n\n/**\n * Apply EDL's price id: a `proxy` render (the 720p preview) is its own,\n * cheaper per-output-minute row; a `final` render keeps the bare id. One id per\n * QUALITY, for a video and an audio output alike (decided 2026-10-04). Anything\n * that is not exactly \"proxy\" is the final, as the route and the node default\n * it. The route, the workflow run, and the editor's badge and run estimate all\n * price through this; the job itself is always named `apply-edl`.\n */\nexport function applyEdlCreditId(quality: unknown): \"apply-edl\" | \"apply-edl:proxy\" {\n return quality === \"proxy\" ? \"apply-edl:proxy\" : \"apply-edl\"\n}\n\n/**\n * Speaker View's price tiers (decided 2026-10-10, C4): a render is priced by\n * how many speakers it composites at once. `standard` — at most two tiles on\n * any segment and no zoom; `complex` — three to six tiles, or any zoom. Which\n * tier a render is in is the render rule's to say (the app's\n * `@nodaro/render-rules`), never this vocabulary's.\n */\nexport const SPEAKER_VIEW_PRICE_TIERS = [\"standard\", \"complex\"] as const\nexport type SpeakerViewPriceTier = (typeof SPEAKER_VIEW_PRICE_TIERS)[number]\n\nexport type SpeakerViewCreditId = \"speaker-view\" | \"speaker-view:proxy\" | \"speaker-view:complex\" | \"speaker-view:complex:proxy\"\n\n/** Every id `speakerViewCreditId` can name. */\nexport const SPEAKER_VIEW_CREDIT_IDS: readonly SpeakerViewCreditId[] = Object.freeze([\n \"speaker-view\",\n \"speaker-view:proxy\",\n \"speaker-view:complex\",\n \"speaker-view:complex:proxy\",\n] as const)\n\n/**\n * The credit id of a Speaker View render (F4, decided 2026-09-23; tiers\n * decided 2026-10-10): a Preview (`quality` \"proxy\") reserves on its own row,\n * anything else on the final's, and each in its price tier — `standard` on\n * `speaker-view` / `speaker-view:proxy`, `complex` on `speaker-view:complex` /\n * `speaker-view:complex:proxy`. A tier that is not exactly `standard` (absent\n * included) names the `complex` row: a caller that cannot tell quotes high,\n * never low. The job is always named `speaker-view`; only its credit id\n * follows the quality and the tier.\n */\nexport function speakerViewCreditId(quality: unknown, tier?: unknown): SpeakerViewCreditId {\n const proxy = quality === \"proxy\"\n if (tier === \"standard\") return proxy ? \"speaker-view:proxy\" : \"speaker-view\"\n return proxy ? \"speaker-view:complex:proxy\" : \"speaker-view:complex\"\n}\n\n/**\n * OUR Nodaro credit key for a Suno operation, given the model version and the\n * operation (which is also the node type and the BullMQ job name).\n *\n * This is the single source of truth for the Suno pricing contract, shared by\n * the reservation path (routes/suno.ts creditGuard), the egress seam\n * (workers/handlers/suno.ts `modelKey`, which must match what was reserved),\n * both workflow-credit estimators (ee/billing/credits.ts and the frontend\n * config-panels/helpers.ts), the seven Suno model dropdowns and the three Suno\n * node badges. It is a billing key — NEVER a KIE provider id — which is what\n * satisfies the B3 egress invariant.\n *\n * The version → key map is {@link SUNO_VERSION_CREDIT_KEYS}; a version with no\n * entry (V4 / V4_5 / V4_5ALL / V4_5PLUS) falls back to the operation key, and a\n * non-version-priced operation is returned unchanged.\n */\nexport function sunoCreditType(model: string | undefined, operation: string): string {\n if (!(SUNO_VERSION_PRICED_OPERATIONS as readonly string[]).includes(operation)) {\n return operation\n }\n return (model && SUNO_VERSION_CREDIT_KEYS[model]) || operation\n}\n\n/**\n * Suno version → Nodaro credit key for the version-priced operations. One row\n * per version that has its own `model_pricing` row / `STATIC_CREDIT_COSTS`\n * entry / `MODEL_CATALOG` pricing row, so an admin can reprice one version\n * without touching code. Every ACTIVE version MUST have a row here — guarded\n * by `__tests__/suno-credit-type.test.ts` (a new active version with no key\n * would silently bill at the operation key).\n */\nexport const SUNO_VERSION_CREDIT_KEYS: Readonly<Record<string, string>> = {\n V6: \"suno-v6\",\n V6_WILD: \"suno-v6_wild\",\n V6_MINI: \"suno-v6_mini\",\n V5_5: \"suno-v5_5\",\n V5: \"suno-v5\",\n}\n"]}
@@ -0,0 +1,99 @@
1
+ 'use strict';
2
+
3
+ // src/generated/unit-contracts.ts
4
+ var UNIT_CONTRACTS = [
5
+ ["tighten-episode", "dynamic"],
6
+ // unit:tighten-episode
7
+ ["episode-trailer", "video"],
8
+ // unit:episode-trailer
9
+ ["clip-pack", "dynamic"],
10
+ // unit:clip-pack
11
+ ["remove-audio", "video"],
12
+ // unit:remove-audio
13
+ ["gif-to-video", "video"]
14
+ // unit:gif-to-video
15
+ ];
16
+ var UNIT_USE_CASE_TYPES = [
17
+ "tighten-episode",
18
+ // unit:tighten-episode
19
+ "episode-chapters",
20
+ // unit:episode-chapters
21
+ "episode-trailer",
22
+ // unit:episode-trailer
23
+ "clip-pack"
24
+ // unit:clip-pack
25
+ ];
26
+ var UNIT_JSON_PIPS = [
27
+ ["tighten-episode", { "json": "edl" }],
28
+ // unit:tighten-episode
29
+ ["episode-chapters", { "json": "other" }],
30
+ // unit:episode-chapters
31
+ ["episode-trailer", { "json": "edl" }],
32
+ // unit:episode-trailer
33
+ ["clip-pack", { "json": "edl" }],
34
+ // unit:clip-pack
35
+ ["speaker-map", { "edl": "edl", "json": "other" }]
36
+ // unit:speaker-map
37
+ ];
38
+ var UNIT_NON_PROMPT_INPUTS = [
39
+ ["tighten-episode", ["music"]],
40
+ // unit:tighten-episode
41
+ ["episode-trailer", ["introCard"]]
42
+ // unit:episode-trailer
43
+ ];
44
+ var UNIT_REVIEW_HOLDS = [
45
+ "tighten-episode",
46
+ // unit:tighten-episode
47
+ "episode-trailer",
48
+ // unit:episode-trailer
49
+ "clip-pack"
50
+ // unit:clip-pack
51
+ ];
52
+ var UNIT_PRESENTS = [
53
+ ["tighten-episode", "video"],
54
+ // unit:tighten-episode
55
+ ["episode-chapters", "text"],
56
+ // unit:episode-chapters
57
+ ["clip-pack", "video"]
58
+ // unit:clip-pack
59
+ ];
60
+ var UNIT_FAN_OUT_EACH = [
61
+ ["episode-trailer", { "each": ["media"], "primary": "media" }],
62
+ // unit:episode-trailer
63
+ ["clip-pack", { "each": ["clips"], "primary": "clips" }]
64
+ // unit:clip-pack
65
+ ];
66
+
67
+ // src/unit-contract-compose.ts
68
+ function composeUnitSet(what, legacy, units) {
69
+ const clash = units.filter((t) => legacy.includes(t));
70
+ if (clash.length > 0) throw new Error(`${what}: ${clash.join(", ")} is both hand-written and a node unit \u2014 a type lives in one place (tools/units/README.md)`);
71
+ return /* @__PURE__ */ new Set([...legacy, ...units]);
72
+ }
73
+ function composeUnitRecord(what, legacy, units) {
74
+ const out = { ...legacy };
75
+ for (const [type, value] of units) {
76
+ if (Object.hasOwn(legacy, type)) throw new Error(`${what}: ${type} is both hand-written and a node unit \u2014 a type lives in one place (tools/units/README.md)`);
77
+ if (Object.hasOwn(out, type)) throw new Error(`${what}: node unit ${type} has more than one row`);
78
+ out[type] = value;
79
+ }
80
+ return out;
81
+ }
82
+ var unitProducers = (kind) => UNIT_CONTRACTS.filter(([, producer]) => producer === kind).map(([type]) => type);
83
+ var unitsPresenting = (kind) => UNIT_PRESENTS.filter(([, presents]) => presents === kind).map(([type]) => type);
84
+ var unitJsonPips = () => UNIT_JSON_PIPS;
85
+ var unitNonPromptInputs = () => UNIT_NON_PROMPT_INPUTS;
86
+ var unitReviewHolds = () => UNIT_REVIEW_HOLDS;
87
+ var unitFanOutEach = () => UNIT_FAN_OUT_EACH;
88
+
89
+ exports.UNIT_USE_CASE_TYPES = UNIT_USE_CASE_TYPES;
90
+ exports.composeUnitRecord = composeUnitRecord;
91
+ exports.composeUnitSet = composeUnitSet;
92
+ exports.unitFanOutEach = unitFanOutEach;
93
+ exports.unitJsonPips = unitJsonPips;
94
+ exports.unitNonPromptInputs = unitNonPromptInputs;
95
+ exports.unitProducers = unitProducers;
96
+ exports.unitReviewHolds = unitReviewHolds;
97
+ exports.unitsPresenting = unitsPresenting;
98
+ //# sourceMappingURL=chunk-GZH2SIOF.cjs.map
99
+ //# sourceMappingURL=chunk-GZH2SIOF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generated/unit-contracts.ts","../src/unit-contract-compose.ts"],"names":[],"mappings":";;;AAQO,IAAM,cAAA,GAA4G;AAAA,EACvH,CAAC,mBAAmB,SAAS,CAAA;AAAA;AAAA,EAC7B,CAAC,mBAAmB,OAAO,CAAA;AAAA;AAAA,EAC3B,CAAC,aAAa,SAAS,CAAA;AAAA;AAAA,EACvB,CAAC,gBAAgB,OAAO,CAAA;AAAA;AAAA,EACxB,CAAC,gBAAgB,OAAO;AAAA;AAC1B,CAAA;AAGO,IAAM,mBAAA,GAAsB;AAAA,EACjC,iBAAA;AAAA;AAAA,EACA,kBAAA;AAAA;AAAA,EACA,iBAAA;AAAA;AAAA,EACA;AAAA;AACF;AAGO,IAAM,cAAA,GAAyH;AAAA,EACpI,CAAC,iBAAA,EAAmB,EAAE,MAAA,EAAQ,OAAO,CAAA;AAAA;AAAA,EACrC,CAAC,kBAAA,EAAoB,EAAE,MAAA,EAAQ,SAAS,CAAA;AAAA;AAAA,EACxC,CAAC,iBAAA,EAAmB,EAAE,MAAA,EAAQ,OAAO,CAAA;AAAA;AAAA,EACrC,CAAC,WAAA,EAAa,EAAE,MAAA,EAAQ,OAAO,CAAA;AAAA;AAAA,EAC/B,CAAC,aAAA,EAAe,EAAE,OAAO,KAAA,EAAO,MAAA,EAAQ,SAAS;AAAA;AACnD,CAAA;AAGO,IAAM,sBAAA,GAAiG;AAAA,EAC5G,CAAC,iBAAA,EAAmB,CAAC,OAAO,CAAC,CAAA;AAAA;AAAA,EAC7B,CAAC,iB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MAAA,EAAQ,IAAI,CAAA,EAAG,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,IAAI,CAAA,EAAA,EAAK,IAAI,CAAA,8FAAA,CAA2F,CAAA;AAC5J,IAAA,IAAI,MAAA,CAAO,MAAA,CAAO,GAAA,EAAK,IAAI,CAAA,EAAG,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,IAAI,CAAA,YAAA,EAAe,IAAI,CAAA,sBAAA,CAAwB,CAAA;AAChG,IAAA,GAAA,CAAI,IAAI,CAAA,GAAI,KAAA;AAAA,EACd;AACA,EAAA,OAAO,GAAA;AACT;AAGO,IAAM,gBAAgB,CAAC,IAAA,KAC5B,eAAe,MAAA,CAAO,CAAC,GAAG,QAAQ,CAAA,KAAM,QAAA,KAAa,IAAI,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,IAAI,MAAM,IAAI;AAG1E,IAAM,kBAAkB,CAAC,IAAA,KAC9B,cAAc,MAAA,CAAO,CAAC,GAAG,QAAQ,CAAA,KAAM,QAAA,KAAa,IAAI,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,IAAI,MAAM,IAAI;AAGzE,IAAM,eAAe,MAAkG;AAGvH,IAAM,sBAAsB,MAA+D;AAG3F,IAAM,kBAAkB,MAAyB;AAGjD,IAAM,iBAAiB,MAA4G","file":"chunk-GZH2SIOF.cjs","sourcesContent":["// GENERATED by tools/units/gen.mjs — do not edit; run npm run gen:units\n// The unit contract published in @nodaro/shared (decided 2026-10-16, widened 2026-10-18): node type\n// ids with closed vocabularies — each unit's producer kind, the use-case types, what each JSON pip\n// carries, the input pips that are never a prompt lane, the review holds, how a published app\n// presents the result and which outputs fan out item by item. Never a price, credit id, number,\n// prompt or doctrine string. Each block feeds a published table that composes its rows with the\n// hand-written ones (unit-contract-compose.ts); every row is an irrevocable Apache grant.\n\nexport const UNIT_CONTRACTS: ReadonlyArray<readonly [type: string, producer: \"audio\" | \"video\" | \"image\" | \"dynamic\"]> = [\n [\"tighten-episode\", \"dynamic\"], // unit:tighten-episode\n [\"episode-trailer\", \"video\"], // unit:episode-trailer\n [\"clip-pack\", \"dynamic\"], // unit:clip-pack\n [\"remove-audio\", \"video\"], // unit:remove-audio\n [\"gif-to-video\", \"video\"], // unit:gif-to-video\n]\n\n// The use-case node units (execution.kind \"use-case\"), in position order — each a route POST /v1/<type> (+ /estimate, /continue).\nexport const UNIT_USE_CASE_TYPES = [\n \"tighten-episode\", // unit:tighten-episode\n \"episode-chapters\", // unit:episode-chapters\n \"episode-trailer\", // unit:episode-trailer\n \"clip-pack\", // unit:clip-pack\n] as const\n\n// What each JSON (look) output pip carries (contract.jsonPips) — json-kinds.ts composes these.\nexport const UNIT_JSON_PIPS: ReadonlyArray<readonly [type: string, pips: Readonly<Record<string, \"transcript\" | \"edl\" | \"other\">>]> = [\n [\"tighten-episode\", { \"json\": \"edl\" }], // unit:tighten-episode\n [\"episode-chapters\", { \"json\": \"other\" }], // unit:episode-chapters\n [\"episode-trailer\", { \"json\": \"edl\" }], // unit:episode-trailer\n [\"clip-pack\", { \"json\": \"edl\" }], // unit:clip-pack\n [\"speaker-map\", { \"edl\": \"edl\", \"json\": \"other\" }], // unit:speaker-map\n]\n\n// Input pips that are never a prompt lane (contract.nonPromptInputs) — fan-out-rows.ts composes these.\nexport const UNIT_NON_PROMPT_INPUTS: ReadonlyArray<readonly [type: string, handles: ReadonlyArray<string>]> = [\n [\"tighten-episode\", [\"music\"]], // unit:tighten-episode\n [\"episode-trailer\", [\"introCard\"]], // unit:episode-trailer\n]\n\n// Use-case units whose review-on run ends at a Preview that holds what follows (contract.reviewHold) — preview-gate.ts.\nexport const UNIT_REVIEW_HOLDS: ReadonlyArray<string> = [\n \"tighten-episode\", // unit:tighten-episode\n \"episode-trailer\", // unit:episode-trailer\n \"clip-pack\", // unit:clip-pack\n]\n\n// How a published app shows each unit's result where the producer sets do not decide it (contract.presents) — presentation-utils.ts.\nexport const UNIT_PRESENTS: ReadonlyArray<readonly [type: string, presents: \"image\" | \"video\" | \"audio\" | \"text\"]> = [\n [\"tighten-episode\", \"video\"], // unit:tighten-episode\n [\"episode-chapters\", \"text\"], // unit:episode-chapters\n [\"clip-pack\", \"video\"], // unit:clip-pack\n]\n\n// The outputs an \"each\" edge reads item by item when the unit ran once per item, and the pip an edge naming none reads (contract.fanOutEach) — producer-types.ts.\nexport const UNIT_FAN_OUT_EACH: ReadonlyArray<readonly [type: string, handles: { readonly each: ReadonlyArray<string>; readonly primary: string }]> = [\n [\"episode-trailer\", { \"each\": [\"media\"], \"primary\": \"media\" }], // unit:episode-trailer\n [\"clip-pack\", { \"each\": [\"clips\"], \"primary\": \"clips\" }], // unit:clip-pack\n]\n","/**\n * The node units' rows in @nodaro/shared (tools/units/README.md): the readers\n * of `generated/unit-contracts.ts` and the one rule every table that composes\n * them keeps — a type is hand-written or a node unit, never both. Internal:\n * no entry exports this module, so it adds nothing to the published surface;\n * the tables that compose its rows (producer-types, presentation-utils,\n * json-kinds, fan-out-rows, preview-gate) are what consumers read.\n */\nimport { UNIT_CONTRACTS, UNIT_FAN_OUT_EACH, UNIT_JSON_PIPS, UNIT_NON_PROMPT_INPUTS, UNIT_PRESENTS, UNIT_REVIEW_HOLDS } from \"./generated/unit-contracts.js\"\n\n/**\n * `legacy ∪ units` as a set, `legacy` first, refusing a type that is in both —\n * a type lives in one place (G1; the editor's and the server's composeSet keep\n * the same rule). Throws at module load, so any import of the set fails.\n */\nexport function composeUnitSet(what: string, legacy: readonly string[], units: readonly string[]): ReadonlySet<string> {\n const clash = units.filter((t) => legacy.includes(t))\n if (clash.length > 0) throw new Error(`${what}: ${clash.join(\", \")} is both hand-written and a node unit — a type lives in one place (tools/units/README.md)`)\n return new Set([...legacy, ...units])\n}\n\n/**\n * `legacy` with each unit row added after it, refusing a type that is in both\n * or a unit row given twice — the record twin of `composeUnitSet`. Throws at\n * module load, so any import of the record fails.\n */\nexport function composeUnitRecord<V>(what: string, legacy: Readonly<Record<string, V>>, units: ReadonlyArray<readonly [string, V]>): Readonly<Record<string, V>> {\n const out: Record<string, V> = { ...legacy }\n for (const [type, value] of units) {\n if (Object.hasOwn(legacy, type)) throw new Error(`${what}: ${type} is both hand-written and a node unit — a type lives in one place (tools/units/README.md)`)\n if (Object.hasOwn(out, type)) throw new Error(`${what}: node unit ${type} has more than one row`)\n out[type] = value\n }\n return out\n}\n\n/** The node units of one producer kind (`contract.producer`), in generated order. */\nexport const unitProducers = (kind: \"audio\" | \"video\" | \"image\" | \"dynamic\"): string[] =>\n UNIT_CONTRACTS.filter(([, producer]) => producer === kind).map(([type]) => type)\n\n/** The node units a published app shows as `kind` (`contract.presents`). */\nexport const unitsPresenting = (kind: \"image\" | \"video\" | \"audio\" | \"text\"): string[] =>\n UNIT_PRESENTS.filter(([, presents]) => presents === kind).map(([type]) => type)\n\n/** What each node unit's JSON (look) output pips carry (`contract.jsonPips`). */\nexport const unitJsonPips = (): ReadonlyArray<readonly [string, Readonly<Record<string, \"transcript\" | \"edl\" | \"other\">>]> => UNIT_JSON_PIPS\n\n/** Each node unit's input pips that are never a prompt lane (`contract.nonPromptInputs`). */\nexport const unitNonPromptInputs = (): ReadonlyArray<readonly [string, ReadonlyArray<string>]> => UNIT_NON_PROMPT_INPUTS\n\n/** The use-case units whose review-on run ends at a Preview that holds what follows (`contract.reviewHold`). */\nexport const unitReviewHolds = (): readonly string[] => UNIT_REVIEW_HOLDS\n\n/** Each node unit's fan-out \"each\" outputs and primary pip (`contract.fanOutEach`), in generated order. */\nexport const unitFanOutEach = (): ReadonlyArray<readonly [string, { readonly each: ReadonlyArray<string>; readonly primary: string }]> => UNIT_FAN_OUT_EACH\n"]}
@@ -1,5 +1,5 @@
1
- import { DEFAULT_DIALOGUE_PROVIDER } from './chunk-PHZ23DP3.js';
2
- import { MODEL_CATALOG } from './chunk-ZO5PBBFX.js';
1
+ import { DEFAULT_DIALOGUE_PROVIDER } from './chunk-MUA5L25B.js';
2
+ import { MODEL_CATALOG } from './chunk-GKJRNIP4.js';
3
3
 
4
4
  // src/dialogue-capabilities.ts
5
5
  function findDialogueCapabilities(provider) {
@@ -27,5 +27,5 @@ function dialogueStabilityAccepted(provider, value) {
27
27
  }
28
28
 
29
29
  export { dialogueHasLever, dialogueProviderOf, dialogueStabilityAccepted, dialogueSupportsTimestamps, findDialogueCapabilities, getDialogueCapabilities };
30
- //# sourceMappingURL=chunk-SFW3UB2P.js.map
31
- //# sourceMappingURL=chunk-SFW3UB2P.js.map
30
+ //# sourceMappingURL=chunk-IJNQYMN7.js.map
31
+ //# sourceMappingURL=chunk-IJNQYMN7.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dialogue-capabilities.ts"],"names":[],"mappings":";;;;AAeO,SAAS,yBAAyB,QAAA,EAAgD;AACvF,EAAA,IAAI,OAAO,QAAA,KAAa,QAAA,IAAY,CAAC,UAAU,OAAO,MAAA;AACtD,EAAA,IAAI,CAAC,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe,QAAQ,GAAG,OAAO,MAAA;AACpD,EAAA,MAAM,KAAA,GAAQ,cAAc,QAAQ,CAAA;AACpC,EAAA,OAAO,MAAM,KAAA,CAAM,QAAA,CAAS,UAAU,CAAA,GAAI,MAAM,GAAA,GAAM,MAAA;AACxD;AAGO,SAAS,mBAAmB,QAAA,EAAqC;AACtE,EAAA,OAAO,wBAAA,CAAyB,QAAQ,CAAA,GAAK,QAAA,GAAgC,yBAAA;AAC/E;AAGO,SAAS,wBAAwB,QAAA,EAAoC;AAC1E,EAAA,OAAO,aAAA,CAAc,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAG,GAAA;AACtD;AAGO,SAAS,gBAAA,CAAiB,UAAmB,KAAA,EAAiC;AACnF,EAAA,OAAO,uBAAA,CAAwB,QAAQ,CAAA,CAAE,MAAA,CAAO,SAAS,KAAK,CAAA;AAChE;AAGO,SAAS,2BAA2B,QAAA,EAA4B;AACrE,EAAA,OAAO,uBAAA,CAAwB,QAAQ,CAAA,CAAE,UAAA;AAC3C;AAGO,SAAS,yBAAA,CAA0B,UAAmB,KAAA,EAAwB;AACnF,EAAA,IAAI,CAAC,OAAO,QAAA,CAAS,KAAK,KAAK,KAAA,GAAQ,CAAA,IAAK,KAAA,GAAQ,CAAA,EAAG,OAAO,KAAA;AAC9D,EAAA,MAAM,KAAA,GAAQ,uBAAA,CAAwB,QAAQ,CAAA,CAAE,cAAA;AAChD,EAAA,OAAO,KAAA,GAAQ,KAAA,CAAM,QAAA,CAAS,KAAK,CAAA,GAAI,IAAA;AACzC","file":"chunk-SFW3UB2P.js","sourcesContent":["/**\n * Capability lookups for the DIALOGUE lane (`/v1/text-to-dialogue`, the Text to\n * Dialogue node, the voiced-video multi-speaker track).\n *\n * The dialogue models carry a `tts` sheet in `MODEL_CATALOG` like the\n * text-to-speech models, but each lane answers only for its own models: the\n * text-to-speech lookups (`tts-capabilities.ts`) treat a dialogue id as unknown,\n * and these treat a text-to-speech id as unknown. An unknown id here runs as\n * {@link DEFAULT_DIALOGUE_PROVIDER} (v3 dialogue) — not as the text-to-speech\n * fallback (turbo), which has no dialogue form.\n */\nimport { MODEL_CATALOG, type TtsCapabilities, type TtsSettingLever } from \"./model-catalog.js\"\nimport { DEFAULT_DIALOGUE_PROVIDER, type DialogueProvider } from \"./model-constants.js\"\n\n/** The sheet of a dialogue model, or `undefined` when the id is not one. Own properties only; a non-string is unknown. */\nexport function findDialogueCapabilities(provider: unknown): TtsCapabilities | undefined {\n if (typeof provider !== \"string\" || !provider) return undefined\n if (!Object.hasOwn(MODEL_CATALOG, provider)) return undefined\n const entry = MODEL_CATALOG[provider]!\n return entry.modes.includes(\"dialogue\") ? entry.tts : undefined\n}\n\n/** The dialogue model a request naming `provider` runs on (and is billed as). */\nexport function dialogueProviderOf(provider: unknown): DialogueProvider {\n return findDialogueCapabilities(provider) ? (provider as DialogueProvider) : DEFAULT_DIALOGUE_PROVIDER\n}\n\n/** The sheet a dialogue request runs under. */\nexport function getDialogueCapabilities(provider: unknown): TtsCapabilities {\n return MODEL_CATALOG[dialogueProviderOf(provider)]!.tts!\n}\n\n/** The dialogue model honours this voice-setting lever. */\nexport function dialogueHasLever(provider: unknown, lever: TtsSettingLever): boolean {\n return getDialogueCapabilities(provider).levers.includes(lever)\n}\n\n/** The dialogue model answers `/v1/text-to-dialogue/with-timestamps` (character timings + per-line voice segments). */\nexport function dialogueSupportsTimestamps(provider: unknown): boolean {\n return getDialogueCapabilities(provider).timestamps\n}\n\n/** `value` is a stability this platform accepts for the dialogue model: one of its steps, or any finite 0–1 when it has none. */\nexport function dialogueStabilityAccepted(provider: unknown, value: number): boolean {\n if (!Number.isFinite(value) || value < 0 || value > 1) return false\n const steps = getDialogueCapabilities(provider).stabilitySteps\n return steps ? steps.includes(value) : true\n}\n"]}
1
+ {"version":3,"sources":["../src/dialogue-capabilities.ts"],"names":[],"mappings":";;;;AAeO,SAAS,yBAAyB,QAAA,EAAgD;AACvF,EAAA,IAAI,OAAO,QAAA,KAAa,QAAA,IAAY,CAAC,UAAU,OAAO,MAAA;AACtD,EAAA,IAAI,CAAC,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe,QAAQ,GAAG,OAAO,MAAA;AACpD,EAAA,MAAM,KAAA,GAAQ,cAAc,QAAQ,CAAA;AACpC,EAAA,OAAO,MAAM,KAAA,CAAM,QAAA,CAAS,UAAU,CAAA,GAAI,MAAM,GAAA,GAAM,MAAA;AACxD;AAGO,SAAS,mBAAmB,QAAA,EAAqC;AACtE,EAAA,OAAO,wBAAA,CAAyB,QAAQ,CAAA,GAAK,QAAA,GAAgC,yBAAA;AAC/E;AAGO,SAAS,wBAAwB,QAAA,EAAoC;AAC1E,EAAA,OAAO,aAAA,CAAc,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAG,GAAA;AACtD;AAGO,SAAS,gBAAA,CAAiB,UAAmB,KAAA,EAAiC;AACnF,EAAA,OAAO,uBAAA,CAAwB,QAAQ,CAAA,CAAE,MAAA,CAAO,SAAS,KAAK,CAAA;AAChE;AAGO,SAAS,2BAA2B,QAAA,EAA4B;AACrE,EAAA,OAAO,uBAAA,CAAwB,QAAQ,CAAA,CAAE,UAAA;AAC3C;AAGO,SAAS,yBAAA,CAA0B,UAAmB,KAAA,EAAwB;AACnF,EAAA,IAAI,CAAC,OAAO,QAAA,CAAS,KAAK,KAAK,KAAA,GAAQ,CAAA,IAAK,KAAA,GAAQ,CAAA,EAAG,OAAO,KAAA;AAC9D,EAAA,MAAM,KAAA,GAAQ,uBAAA,CAAwB,QAAQ,CAAA,CAAE,cAAA;AAChD,EAAA,OAAO,KAAA,GAAQ,KAAA,CAAM,QAAA,CAAS,KAAK,CAAA,GAAI,IAAA;AACzC","file":"chunk-IJNQYMN7.js","sourcesContent":["/**\n * Capability lookups for the DIALOGUE lane (`/v1/text-to-dialogue`, the Text to\n * Dialogue node, the voiced-video multi-speaker track).\n *\n * The dialogue models carry a `tts` sheet in `MODEL_CATALOG` like the\n * text-to-speech models, but each lane answers only for its own models: the\n * text-to-speech lookups (`tts-capabilities.ts`) treat a dialogue id as unknown,\n * and these treat a text-to-speech id as unknown. An unknown id here runs as\n * {@link DEFAULT_DIALOGUE_PROVIDER} (v3 dialogue) — not as the text-to-speech\n * fallback (turbo), which has no dialogue form.\n */\nimport { MODEL_CATALOG, type TtsCapabilities, type TtsSettingLever } from \"./model-catalog.js\"\nimport { DEFAULT_DIALOGUE_PROVIDER, type DialogueProvider } from \"./model-constants.js\"\n\n/** The sheet of a dialogue model, or `undefined` when the id is not one. Own properties only; a non-string is unknown. */\nexport function findDialogueCapabilities(provider: unknown): TtsCapabilities | undefined {\n if (typeof provider !== \"string\" || !provider) return undefined\n if (!Object.hasOwn(MODEL_CATALOG, provider)) return undefined\n const entry = MODEL_CATALOG[provider]!\n return entry.modes.includes(\"dialogue\") ? entry.tts : undefined\n}\n\n/** The dialogue model a request naming `provider` runs on (and is billed as). */\nexport function dialogueProviderOf(provider: unknown): DialogueProvider {\n return findDialogueCapabilities(provider) ? (provider as DialogueProvider) : DEFAULT_DIALOGUE_PROVIDER\n}\n\n/** The sheet a dialogue request runs under. */\nexport function getDialogueCapabilities(provider: unknown): TtsCapabilities {\n return MODEL_CATALOG[dialogueProviderOf(provider)]!.tts!\n}\n\n/** The dialogue model honours this voice-setting lever. */\nexport function dialogueHasLever(provider: unknown, lever: TtsSettingLever): boolean {\n return getDialogueCapabilities(provider).levers.includes(lever)\n}\n\n/** The dialogue model answers `/v1/text-to-dialogue/with-timestamps` (character timings + per-line voice segments). */\nexport function dialogueSupportsTimestamps(provider: unknown): boolean {\n return getDialogueCapabilities(provider).timestamps\n}\n\n/** `value` is a stability this platform accepts for the dialogue model: one of its steps, or any finite 0–1 when it has none. */\nexport function dialogueStabilityAccepted(provider: unknown, value: number): boolean {\n if (!Number.isFinite(value) || value < 0 || value > 1) return false\n const steps = getDialogueCapabilities(provider).stabilitySteps\n return steps ? steps.includes(value) : true\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk6DAWSVX2_cjs = require('./chunk-6DAWSVX2.cjs');
4
- var chunkZRL2UFTH_cjs = require('./chunk-ZRL2UFTH.cjs');
5
- var chunkM7GQBRZU_cjs = require('./chunk-M7GQBRZU.cjs');
6
- var chunkK3LLGRK7_cjs = require('./chunk-K3LLGRK7.cjs');
4
+ var chunkV3N56Z2S_cjs = require('./chunk-V3N56Z2S.cjs');
5
+ var chunk3YG3MYDE_cjs = require('./chunk-3YG3MYDE.cjs');
6
+ var chunk5ZCXWA7J_cjs = require('./chunk-5ZCXWA7J.cjs');
7
7
 
8
8
  // src/gemini-omni-voices.ts
9
9
  var GEMINI_OMNI_VOICE_PRESETS = [
@@ -68,24 +68,24 @@ var NODE_DEFAULT_TYPES = [
68
68
  ];
69
69
  var MUSIC_PROVIDERS_FOR_VALIDATION = ["suno", "minimax"];
70
70
  var META = {
71
- "generate-image": { field: "provider", validValues: chunkM7GQBRZU_cjs.IMAGE_GEN_PROVIDERS, hasQuality: true, hasAspectRatio: true },
72
- "image-to-image": { field: "provider", validValues: chunkM7GQBRZU_cjs.IMAGE_I2I_PROVIDERS, hasQuality: true, hasAspectRatio: true },
73
- "edit-image": { field: "provider", validValues: chunkM7GQBRZU_cjs.IMAGE_EDIT_PROVIDERS, hasQuality: false, hasAspectRatio: false },
74
- "upscale-image": { field: "provider", validValues: chunkM7GQBRZU_cjs.UPSCALE_IMAGE_PROVIDERS, hasQuality: false, hasAspectRatio: false },
75
- "text-to-video": { field: "provider", validValues: chunkM7GQBRZU_cjs.TEXT_TO_VIDEO_PROVIDERS, hasQuality: true, hasAspectRatio: true },
76
- "image-to-video": { field: "provider", validValues: chunkM7GQBRZU_cjs.IMAGE_TO_VIDEO_PROVIDERS, hasQuality: true, hasAspectRatio: true },
77
- "generate-video": { field: "provider", validValues: chunkM7GQBRZU_cjs.VIDEO_GEN_PROVIDERS, hasQuality: true, hasAspectRatio: true },
78
- "lip-sync": { field: "provider", validValues: chunkM7GQBRZU_cjs.LIP_SYNC_PROVIDERS, hasQuality: false, hasAspectRatio: false },
79
- "text-to-speech": { field: "provider", validValues: chunkM7GQBRZU_cjs.TTS_PROVIDERS, hasQuality: false, hasAspectRatio: false },
71
+ "generate-image": { field: "provider", validValues: chunk3YG3MYDE_cjs.IMAGE_GEN_PROVIDERS, hasQuality: true, hasAspectRatio: true },
72
+ "image-to-image": { field: "provider", validValues: chunk3YG3MYDE_cjs.IMAGE_I2I_PROVIDERS, hasQuality: true, hasAspectRatio: true },
73
+ "edit-image": { field: "provider", validValues: chunk3YG3MYDE_cjs.IMAGE_EDIT_PROVIDERS, hasQuality: false, hasAspectRatio: false },
74
+ "upscale-image": { field: "provider", validValues: chunk3YG3MYDE_cjs.UPSCALE_IMAGE_PROVIDERS, hasQuality: false, hasAspectRatio: false },
75
+ "text-to-video": { field: "provider", validValues: chunk3YG3MYDE_cjs.TEXT_TO_VIDEO_PROVIDERS, hasQuality: true, hasAspectRatio: true },
76
+ "image-to-video": { field: "provider", validValues: chunk3YG3MYDE_cjs.IMAGE_TO_VIDEO_PROVIDERS, hasQuality: true, hasAspectRatio: true },
77
+ "generate-video": { field: "provider", validValues: chunk3YG3MYDE_cjs.VIDEO_GEN_PROVIDERS, hasQuality: true, hasAspectRatio: true },
78
+ "lip-sync": { field: "provider", validValues: chunk3YG3MYDE_cjs.LIP_SYNC_PROVIDERS, hasQuality: false, hasAspectRatio: false },
79
+ "text-to-speech": { field: "provider", validValues: chunk3YG3MYDE_cjs.TTS_PROVIDERS, hasQuality: false, hasAspectRatio: false },
80
80
  "generate-music": { field: "provider", validValues: MUSIC_PROVIDERS_FOR_VALIDATION, hasQuality: false, hasAspectRatio: false },
81
- "voice-design": { field: "model", validValues: chunkM7GQBRZU_cjs.VOICE_DESIGN_MODELS, hasQuality: false, hasAspectRatio: false },
82
- "ai-writer": { field: "model", validValues: chunkZRL2UFTH_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
83
- "llm-chat": { field: "model", validValues: chunkZRL2UFTH_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
84
- "lottie-overlay": { field: "model", validValues: chunkZRL2UFTH_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
85
- "3d-title": { field: "model", validValues: chunkZRL2UFTH_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
86
- "motion-graphics": { field: "model", validValues: chunkZRL2UFTH_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
87
- "image-to-text": { field: "model", validValues: chunkZRL2UFTH_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
88
- "qa-check": { field: "model", validValues: chunkZRL2UFTH_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false }
81
+ "voice-design": { field: "model", validValues: chunk3YG3MYDE_cjs.VOICE_DESIGN_MODELS, hasQuality: false, hasAspectRatio: false },
82
+ "ai-writer": { field: "model", validValues: chunkV3N56Z2S_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
83
+ "llm-chat": { field: "model", validValues: chunkV3N56Z2S_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
84
+ "lottie-overlay": { field: "model", validValues: chunkV3N56Z2S_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
85
+ "3d-title": { field: "model", validValues: chunkV3N56Z2S_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
86
+ "motion-graphics": { field: "model", validValues: chunkV3N56Z2S_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
87
+ "image-to-text": { field: "model", validValues: chunkV3N56Z2S_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false },
88
+ "qa-check": { field: "model", validValues: chunkV3N56Z2S_cjs.LLM_MODEL_IDS, hasQuality: false, hasAspectRatio: false }
89
89
  };
90
90
  function getTargetField(nodeType) {
91
91
  return META[nodeType].field;
@@ -146,6 +146,9 @@ var QUALITY_MAP = {
146
146
  // uppercase KIE wire form is produced only by normalizeWan3Resolution).
147
147
  "wan-3": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
148
148
  "wan-3-prime": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
149
+ // Vidu Q4 — five tiers; the quality rungs stop at 1080p so "high" never
150
+ // lands on the 2k/4k ladder (4k is closed to the free tier).
151
+ "vidu-q4": { field: "resolution", values: { low: "540p", mid: "720p", high: "1080p" } },
149
152
  "wan-2.7-i2v": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
150
153
  "wan-2.7-t2v": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
151
154
  "happyhorse": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
@@ -170,10 +173,10 @@ var QUALITY_MAP = {
170
173
  "flux-2-max": { field: "resolution", values: { low: "1 MP", mid: "2 MP", high: "4 MP" } }
171
174
  };
172
175
  var ASPECT_PASSTHROUGH_PROVIDERS = /* @__PURE__ */ new Set([
173
- ...chunkM7GQBRZU_cjs.IMAGE_GEN_PROVIDERS,
174
- ...chunkM7GQBRZU_cjs.IMAGE_I2I_PROVIDERS,
175
- ...chunkM7GQBRZU_cjs.TEXT_TO_VIDEO_PROVIDERS,
176
- ...chunkM7GQBRZU_cjs.IMAGE_TO_VIDEO_PROVIDERS
176
+ ...chunk3YG3MYDE_cjs.IMAGE_GEN_PROVIDERS,
177
+ ...chunk3YG3MYDE_cjs.IMAGE_I2I_PROVIDERS,
178
+ ...chunk3YG3MYDE_cjs.TEXT_TO_VIDEO_PROVIDERS,
179
+ ...chunk3YG3MYDE_cjs.IMAGE_TO_VIDEO_PROVIDERS
177
180
  ]);
178
181
  function mapQuality(provider, level) {
179
182
  const m = QUALITY_MAP[provider];
@@ -318,28 +321,28 @@ var DEFAULT_VOICE_CHANGER_MODEL = "eleven_multilingual_sts_v2";
318
321
 
319
322
  // src/model-tree.ts
320
323
  var ENUM_TARGETS = [
321
- [chunkM7GQBRZU_cjs.IMAGE_GEN_PROVIDERS, "generate-image"],
322
- [chunkM7GQBRZU_cjs.VIDEO_GEN_PROVIDERS, "generate-video"],
323
- [chunkM7GQBRZU_cjs.IMAGE_TO_VIDEO_PROVIDERS, "generate-video"],
324
- [chunkM7GQBRZU_cjs.TEXT_TO_VIDEO_PROVIDERS, "generate-video"],
325
- [chunkM7GQBRZU_cjs.UPSCALE_IMAGE_PROVIDERS, "upscale-image"],
326
- [chunkM7GQBRZU_cjs.VIDEO_UPSCALE_PROVIDERS, "video-upscale"],
324
+ [chunk3YG3MYDE_cjs.IMAGE_GEN_PROVIDERS, "generate-image"],
325
+ [chunk3YG3MYDE_cjs.VIDEO_GEN_PROVIDERS, "generate-video"],
326
+ [chunk3YG3MYDE_cjs.IMAGE_TO_VIDEO_PROVIDERS, "generate-video"],
327
+ [chunk3YG3MYDE_cjs.TEXT_TO_VIDEO_PROVIDERS, "generate-video"],
328
+ [chunk3YG3MYDE_cjs.UPSCALE_IMAGE_PROVIDERS, "upscale-image"],
329
+ [chunk3YG3MYDE_cjs.VIDEO_UPSCALE_PROVIDERS, "video-upscale"],
327
330
  [chunk6DAWSVX2_cjs.VIDEO_DEPTH_PROVIDERS, "video-depth"],
328
- [chunkM7GQBRZU_cjs.MODIFY_IMAGE_PROVIDERS, "modify-image"],
329
- [chunkM7GQBRZU_cjs.IMAGE_EDIT_PROVIDERS, "modify-image"],
330
- [chunkM7GQBRZU_cjs.VIDEO_TO_VIDEO_PROVIDERS, "video-to-video"],
331
- [chunkM7GQBRZU_cjs.EXTEND_VIDEO_PROVIDERS, "extend-video"],
332
- [chunkM7GQBRZU_cjs.MOTION_TRANSFER_PROVIDERS, "motion-transfer"],
333
- [chunkM7GQBRZU_cjs.LIP_SYNC_PROVIDERS, "lip-sync"],
334
- [chunkM7GQBRZU_cjs.FACE_SWAP_PROVIDERS, "face-swap"],
335
- [chunkM7GQBRZU_cjs.TTS_PROVIDERS, "text-to-speech"],
331
+ [chunk3YG3MYDE_cjs.MODIFY_IMAGE_PROVIDERS, "modify-image"],
332
+ [chunk3YG3MYDE_cjs.IMAGE_EDIT_PROVIDERS, "modify-image"],
333
+ [chunk3YG3MYDE_cjs.VIDEO_TO_VIDEO_PROVIDERS, "video-to-video"],
334
+ [chunk3YG3MYDE_cjs.EXTEND_VIDEO_PROVIDERS, "extend-video"],
335
+ [chunk3YG3MYDE_cjs.MOTION_TRANSFER_PROVIDERS, "motion-transfer"],
336
+ [chunk3YG3MYDE_cjs.LIP_SYNC_PROVIDERS, "lip-sync"],
337
+ [chunk3YG3MYDE_cjs.FACE_SWAP_PROVIDERS, "face-swap"],
338
+ [chunk3YG3MYDE_cjs.TTS_PROVIDERS, "text-to-speech"],
336
339
  // A dialogue model's id is the node's `provider`: without this row the Models
337
340
  // tab would create a BARE dialogue node, which runs as the default (v3) whatever
338
341
  // the user picked.
339
- [chunkM7GQBRZU_cjs.DIALOGUE_PROVIDERS, "text-to-dialogue"],
340
- [chunkM7GQBRZU_cjs.TEXT_TO_AUDIO_PROVIDERS, "text-to-audio"],
341
- [chunkM7GQBRZU_cjs.TRANSCRIBE_PROVIDERS, "transcribe"],
342
- [chunkM7GQBRZU_cjs.MUSIC_PROVIDERS, "suno-generate"]
342
+ [chunk3YG3MYDE_cjs.DIALOGUE_PROVIDERS, "text-to-dialogue"],
343
+ [chunk3YG3MYDE_cjs.TEXT_TO_AUDIO_PROVIDERS, "text-to-audio"],
344
+ [chunk3YG3MYDE_cjs.TRANSCRIBE_PROVIDERS, "transcribe"],
345
+ [chunk3YG3MYDE_cjs.MUSIC_PROVIDERS, "suno-generate"]
343
346
  ];
344
347
  var MODE_TO_NODE = {
345
348
  "t2i": "generate-image",
@@ -367,7 +370,7 @@ var MODE_TO_NODE = {
367
370
  "video-analysis": "video-analysis"
368
371
  };
369
372
  function modelToNodeTarget(modelId) {
370
- const entry = chunkK3LLGRK7_cjs.MODEL_CATALOG[modelId];
373
+ const entry = chunk5ZCXWA7J_cjs.MODEL_CATALOG[modelId];
371
374
  if (!entry) return null;
372
375
  const enumMatch = ENUM_TARGETS.find(([providers]) => providers.includes(modelId));
373
376
  const nodeType = enumMatch?.[1] ?? entry.modes.map((m) => MODE_TO_NODE[m]).find(Boolean);
@@ -388,7 +391,7 @@ function searchModelVariants(query, kind) {
388
391
  }
389
392
  function buildModelTree() {
390
393
  const bySeries = /* @__PURE__ */ new Map();
391
- for (const entry of Object.values(chunkK3LLGRK7_cjs.MODEL_CATALOG)) {
394
+ for (const entry of Object.values(chunk5ZCXWA7J_cjs.MODEL_CATALOG)) {
392
395
  const target = modelToNodeTarget(entry.id);
393
396
  if (!target || !entry.series) continue;
394
397
  let line = bySeries.get(entry.series);
@@ -426,5 +429,5 @@ exports.searchModelVariants = searchModelVariants;
426
429
  exports.selectLoraRoutingForMentions = selectLoraRoutingForMentions;
427
430
  exports.supportedDefaultDimensions = supportedDefaultDimensions;
428
431
  exports.validateProviderForNodeType = validateProviderForNodeType;
429
- //# sourceMappingURL=chunk-HC7VKIV5.cjs.map
430
- //# sourceMappingURL=chunk-HC7VKIV5.cjs.map
432
+ //# sourceMappingURL=chunk-IRUPCNW2.cjs.map
433
+ //# sourceMappingURL=chunk-IRUPCNW2.cjs.map