@nodaro/shared 3.63.0 → 3.65.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-3K24DWOH.js → chunk-222QM7CO.js} +3 -3
  2. package/dist/{chunk-3K24DWOH.js.map → chunk-222QM7CO.js.map} +1 -1
  3. package/dist/chunk-27HA6YOL.cjs +377 -0
  4. package/dist/chunk-27HA6YOL.cjs.map +1 -0
  5. package/dist/{chunk-4DVWXEB6.js → chunk-2NKF476Z.js} +3 -3
  6. package/dist/{chunk-4DVWXEB6.js.map → chunk-2NKF476Z.js.map} +1 -1
  7. package/dist/chunk-3AU52TSW.js +143 -0
  8. package/dist/chunk-3AU52TSW.js.map +1 -0
  9. package/dist/{chunk-F6WGGYQW.cjs → chunk-5NVGKXJV.cjs} +68 -29
  10. package/dist/chunk-5NVGKXJV.cjs.map +1 -0
  11. package/dist/{chunk-HWQ2SYNA.js → chunk-5SSMPYE5.js} +99 -9
  12. package/dist/chunk-5SSMPYE5.js.map +1 -0
  13. package/dist/{chunk-WRSWH7US.cjs → chunk-6BRWPJPP.cjs} +17 -2
  14. package/dist/chunk-6BRWPJPP.cjs.map +1 -0
  15. package/dist/{chunk-KHH54GRP.cjs → chunk-6ET3KDO4.cjs} +15 -338
  16. package/dist/chunk-6ET3KDO4.cjs.map +1 -0
  17. package/dist/{chunk-TM5JYSJF.cjs → chunk-6OSIOVF7.cjs} +98 -37
  18. package/dist/chunk-6OSIOVF7.cjs.map +1 -0
  19. package/dist/{chunk-YUER7TJG.js → chunk-6X5PBAC4.js} +13 -4
  20. package/dist/chunk-6X5PBAC4.js.map +1 -0
  21. package/dist/chunk-7BN4EDIC.cjs +185 -0
  22. package/dist/chunk-7BN4EDIC.cjs.map +1 -0
  23. package/dist/{chunk-6M563QE6.js → chunk-7OWXHW7Z.js} +78 -28
  24. package/dist/chunk-7OWXHW7Z.js.map +1 -0
  25. package/dist/{chunk-FXGNRYQQ.js → chunk-AT53ZQUC.js} +3 -3
  26. package/dist/{chunk-FXGNRYQQ.js.map → chunk-AT53ZQUC.js.map} +1 -1
  27. package/dist/{chunk-HSHCCBIV.js → chunk-BQYCZLMF.js} +16 -3
  28. package/dist/chunk-BQYCZLMF.js.map +1 -0
  29. package/dist/{chunk-34QLPTSA.js → chunk-BSTAAGLY.js} +3 -3
  30. package/dist/{chunk-34QLPTSA.js.map → chunk-BSTAAGLY.js.map} +1 -1
  31. package/dist/{chunk-PSKZKLDG.js → chunk-CW6MMQNO.js} +562 -26
  32. package/dist/chunk-CW6MMQNO.js.map +1 -0
  33. package/dist/{chunk-EPXGG27L.js → chunk-D5Y3EYRM.js} +5 -5
  34. package/dist/{chunk-EPXGG27L.js.map → chunk-D5Y3EYRM.js.map} +1 -1
  35. package/dist/{chunk-XGVJGNZW.cjs → chunk-DQ2PARNH.cjs} +15 -5
  36. package/dist/chunk-DQ2PARNH.cjs.map +1 -0
  37. package/dist/{chunk-6BZC2ZHC.cjs → chunk-E66HSC2E.cjs} +9 -9
  38. package/dist/{chunk-6BZC2ZHC.cjs.map → chunk-E66HSC2E.cjs.map} +1 -1
  39. package/dist/{chunk-NIAFR5EE.js → chunk-FGBGKBML.js} +32 -3
  40. package/dist/chunk-FGBGKBML.js.map +1 -0
  41. package/dist/{chunk-M5OCFGHF.cjs → chunk-FI3HJZWM.cjs} +588 -25
  42. package/dist/chunk-FI3HJZWM.cjs.map +1 -0
  43. package/dist/{chunk-L2TVY6XN.cjs → chunk-FJZTQTF4.cjs} +4 -4
  44. package/dist/{chunk-L2TVY6XN.cjs.map → chunk-FJZTQTF4.cjs.map} +1 -1
  45. package/dist/{chunk-XGGZWA4A.cjs → chunk-GJ3D5X4X.cjs} +52 -49
  46. package/dist/chunk-GJ3D5X4X.cjs.map +1 -0
  47. package/dist/{chunk-Q6IES3U2.js → chunk-H5KHWTAE.js} +5 -2
  48. package/dist/chunk-H5KHWTAE.js.map +1 -0
  49. package/dist/{chunk-MD4XHED4.js → chunk-H745DQ6V.js} +3 -3
  50. package/dist/{chunk-MD4XHED4.js.map → chunk-H745DQ6V.js.map} +1 -1
  51. package/dist/{chunk-KCZHQH2O.js → chunk-HAH2F7LT.js} +4 -4
  52. package/dist/{chunk-KCZHQH2O.js.map → chunk-HAH2F7LT.js.map} +1 -1
  53. package/dist/{chunk-V5EEQR2U.cjs → chunk-JQMFJAYU.cjs} +21 -21
  54. package/dist/{chunk-V5EEQR2U.cjs.map → chunk-JQMFJAYU.cjs.map} +1 -1
  55. package/dist/{chunk-WZVIBAKN.cjs → chunk-JYU5EIRM.cjs} +12 -12
  56. package/dist/{chunk-WZVIBAKN.cjs.map → chunk-JYU5EIRM.cjs.map} +1 -1
  57. package/dist/{chunk-Y35JQPT6.cjs → chunk-K6RIN3LW.cjs} +142 -45
  58. package/dist/chunk-K6RIN3LW.cjs.map +1 -0
  59. package/dist/{chunk-BLJUCPMV.cjs → chunk-KSHAAPQF.cjs} +5 -2
  60. package/dist/chunk-KSHAAPQF.cjs.map +1 -0
  61. package/dist/{chunk-2PU3AGGS.cjs → chunk-KTCEKGBJ.cjs} +7 -7
  62. package/dist/{chunk-2PU3AGGS.cjs.map → chunk-KTCEKGBJ.cjs.map} +1 -1
  63. package/dist/{chunk-LH72PQO2.cjs → chunk-KWYS4IIM.cjs} +165 -50
  64. package/dist/chunk-KWYS4IIM.cjs.map +1 -0
  65. package/dist/{chunk-GSKLPI3J.cjs → chunk-MIT2USTS.cjs} +118 -61
  66. package/dist/chunk-MIT2USTS.cjs.map +1 -0
  67. package/dist/{chunk-Y4GCJJPF.cjs → chunk-NYZQOIXJ.cjs} +35 -2
  68. package/dist/chunk-NYZQOIXJ.cjs.map +1 -0
  69. package/dist/{chunk-A2PX5IRC.cjs → chunk-PERUFUVH.cjs} +13 -13
  70. package/dist/{chunk-A2PX5IRC.cjs.map → chunk-PERUFUVH.cjs.map} +1 -1
  71. package/dist/{chunk-X5BAFW3Q.cjs → chunk-PGDR7CO3.cjs} +8 -8
  72. package/dist/{chunk-X5BAFW3Q.cjs.map → chunk-PGDR7CO3.cjs.map} +1 -1
  73. package/dist/{chunk-OV3JTKBY.js → chunk-PL7AQQV7.js} +123 -22
  74. package/dist/chunk-PL7AQQV7.js.map +1 -0
  75. package/dist/chunk-Q4YOLT4M.js +164 -0
  76. package/dist/chunk-Q4YOLT4M.js.map +1 -0
  77. package/dist/{chunk-GMBDLNLD.cjs → chunk-R5ILCNCC.cjs} +197 -60
  78. package/dist/chunk-R5ILCNCC.cjs.map +1 -0
  79. package/dist/chunk-RP4KQUNU.cjs +168 -0
  80. package/dist/chunk-RP4KQUNU.cjs.map +1 -0
  81. package/dist/{chunk-77WU3V3J.cjs → chunk-SPU7MUWE.cjs} +6 -6
  82. package/dist/{chunk-77WU3V3J.cjs.map → chunk-SPU7MUWE.cjs.map} +1 -1
  83. package/dist/{chunk-XBTYGQ6Z.js → chunk-ST7OBB5J.js} +8 -5
  84. package/dist/chunk-ST7OBB5J.js.map +1 -0
  85. package/dist/{chunk-2QKF7M2Z.js → chunk-TAPBDT47.js} +3 -3
  86. package/dist/{chunk-2QKF7M2Z.js.map → chunk-TAPBDT47.js.map} +1 -1
  87. package/dist/{chunk-BMJVKYVB.js → chunk-V5NLQ4L5.js} +123 -7
  88. package/dist/chunk-V5NLQ4L5.js.map +1 -0
  89. package/dist/{chunk-KMGCHV6O.js → chunk-V6OXSXIX.js} +63 -30
  90. package/dist/chunk-V6OXSXIX.js.map +1 -0
  91. package/dist/{chunk-LMAQUR55.cjs → chunk-WQMPIURW.cjs} +6 -6
  92. package/dist/{chunk-LMAQUR55.cjs.map → chunk-WQMPIURW.cjs.map} +1 -1
  93. package/dist/{chunk-ZPE2ZTJ4.cjs → chunk-WZG6GZIL.cjs} +4 -4
  94. package/dist/{chunk-ZPE2ZTJ4.cjs.map → chunk-WZG6GZIL.cjs.map} +1 -1
  95. package/dist/{chunk-AE3AAJ4O.js → chunk-XJANKTIL.js} +3 -3
  96. package/dist/{chunk-AE3AAJ4O.js.map → chunk-XJANKTIL.js.map} +1 -1
  97. package/dist/{chunk-O7RZRUMZ.js → chunk-XJWED257.js} +14 -309
  98. package/dist/chunk-XJWED257.js.map +1 -0
  99. package/dist/chunk-XSSLNINL.js +346 -0
  100. package/dist/chunk-XSSLNINL.js.map +1 -0
  101. package/dist/{chunk-6TGB7ECA.cjs → chunk-YD4XY74W.cjs} +12 -8
  102. package/dist/chunk-YD4XY74W.cjs.map +1 -0
  103. package/dist/{chunk-YX6TFX7H.js → chunk-YMZUE2IX.js} +66 -11
  104. package/dist/chunk-YMZUE2IX.js.map +1 -0
  105. package/dist/{chunk-4MMZD63H.js → chunk-Z77M7Q2R.js} +3 -3
  106. package/dist/{chunk-4MMZD63H.js.map → chunk-Z77M7Q2R.js.map} +1 -1
  107. package/dist/{chunk-CZ5IQB3L.js → chunk-ZSRXY5YT.js} +8 -5
  108. package/dist/chunk-ZSRXY5YT.js.map +1 -0
  109. package/dist/entries/apps.cjs +43 -42
  110. package/dist/entries/apps.js +8 -7
  111. package/dist/entries/captions.cjs +38 -30
  112. package/dist/entries/captions.d.cts +48 -2
  113. package/dist/entries/captions.d.ts +48 -2
  114. package/dist/entries/captions.js +1 -1
  115. package/dist/entries/credits.cjs +319 -191
  116. package/dist/entries/credits.d.cts +260 -19
  117. package/dist/entries/credits.d.ts +260 -19
  118. package/dist/entries/credits.js +11 -11
  119. package/dist/entries/entities.cjs +202 -193
  120. package/dist/entries/entities.d.cts +44 -9
  121. package/dist/entries/entities.d.ts +44 -9
  122. package/dist/entries/entities.js +2 -1
  123. package/dist/entries/llm-models.cjs +86 -62
  124. package/dist/entries/llm-models.d.cts +73 -20
  125. package/dist/entries/llm-models.d.ts +73 -20
  126. package/dist/entries/llm-models.js +2 -2
  127. package/dist/entries/media.cjs +79 -63
  128. package/dist/entries/media.d.cts +154 -1
  129. package/dist/entries/media.d.ts +154 -1
  130. package/dist/entries/media.js +1 -1
  131. package/dist/entries/model-catalog.cjs +205 -109
  132. package/dist/entries/model-catalog.d.cts +65 -58
  133. package/dist/entries/model-catalog.d.ts +65 -58
  134. package/dist/entries/model-catalog.js +4 -4
  135. package/dist/entries/models.cjs +527 -346
  136. package/dist/entries/models.d.cts +86 -7
  137. package/dist/entries/models.d.ts +86 -7
  138. package/dist/entries/models.js +6 -5
  139. package/dist/entries/nodes.cjs +220 -211
  140. package/dist/entries/nodes.d.cts +46 -3
  141. package/dist/entries/nodes.d.ts +46 -3
  142. package/dist/entries/nodes.js +10 -9
  143. package/dist/entries/pipeline.cjs +156 -152
  144. package/dist/entries/pipeline.d.cts +14 -4
  145. package/dist/entries/pipeline.d.ts +14 -4
  146. package/dist/entries/pipeline.js +3 -3
  147. package/dist/entries/social.cjs +177 -177
  148. package/dist/entries/social.js +2 -2
  149. package/dist/entries/ugc.cjs +71 -71
  150. package/dist/entries/ugc.js +4 -4
  151. package/dist/entries/video.cjs +174 -145
  152. package/dist/entries/video.d.cts +114 -2
  153. package/dist/entries/video.d.ts +114 -2
  154. package/dist/entries/video.js +7 -6
  155. package/dist/entries/workflow.cjs +150 -150
  156. package/dist/entries/workflow.d.cts +1 -1
  157. package/dist/entries/workflow.d.ts +1 -1
  158. package/dist/entries/workflow.js +2 -2
  159. package/dist/index.cjs +2430 -1929
  160. package/dist/index.d.cts +13 -12
  161. package/dist/index.d.ts +13 -12
  162. package/dist/index.js +28 -27
  163. package/dist/{model-catalog-C_Eo35tL.d.cts → model-catalog-BoUKGFNl.d.cts} +182 -3
  164. package/dist/{model-catalog-C_Eo35tL.d.ts → model-catalog-BoUKGFNl.d.ts} +182 -3
  165. package/dist/{model-constants-DWcxOmaY.d.cts → model-constants-BElS3AeE.d.ts} +142 -23
  166. package/dist/{model-constants-Bg4ccSQb.d.ts → model-constants-CpQz1bGa.d.cts} +142 -23
  167. package/dist/tts-capabilities-BtnDWK9K.d.ts +133 -0
  168. package/dist/tts-capabilities-C52UccTI.d.cts +133 -0
  169. package/package.json +1 -1
  170. package/src/__tests__/add-captions-nemotron-pricing.test.ts +111 -0
  171. package/src/__tests__/dialogue-capabilities.test.ts +167 -6
  172. package/src/__tests__/extend-providers.test.ts +353 -26
  173. package/src/__tests__/fixtures/mask-composite-quote-parity.json +1 -1
  174. package/src/__tests__/fixtures/measured-input-quote-parity.json +1435 -0
  175. package/src/__tests__/fixtures/planned-length-quote-parity.json +1866 -0
  176. package/src/__tests__/fixtures/video-utility-quote-parity.json +2343 -0
  177. package/src/__tests__/flux-3-klein.test.ts +203 -0
  178. package/src/__tests__/gpt-image-2-6-formats.test.ts +3 -1
  179. package/src/__tests__/kling4-catalog.test.ts +1 -1
  180. package/src/__tests__/llm-models.test.ts +48 -13
  181. package/src/__tests__/llm-price-key.test.ts +12 -0
  182. package/src/__tests__/model-makers.test.ts +3 -0
  183. package/src/__tests__/node-runtime-keys.test.ts +7 -0
  184. package/src/__tests__/normalize-node-params.test.ts +147 -1
  185. package/src/__tests__/retired-lip-sync-providers.test.ts +43 -0
  186. package/src/__tests__/seedance-extend-source-credit-id.test.ts +89 -0
  187. package/src/__tests__/sequence-execution.test.ts +22 -1
  188. package/src/__tests__/speech-pricing.test.ts +62 -1
  189. package/src/__tests__/suno-credit-type.test.ts +21 -2
  190. package/src/__tests__/transcribe-capabilities.test.ts +4 -2
  191. package/src/__tests__/tts-capabilities.test.ts +160 -4
  192. package/src/__tests__/video-analysis-catalog-sync.test.ts +4 -2
  193. package/src/__tests__/video-analysis-pricing.test.ts +22 -9
  194. package/src/__tests__/video-subjects.test.ts +192 -0
  195. package/src/__tests__/wired-character-names.test.ts +142 -0
  196. package/src/caption-styles.ts +62 -0
  197. package/src/credit-estimators/add-captions-nemotron.ts +73 -0
  198. package/src/credit-estimators/index.ts +14 -0
  199. package/src/credit-estimators/speech.ts +57 -9
  200. package/src/credit-identifiers.ts +284 -13
  201. package/src/dialogue-capabilities.ts +220 -3
  202. package/src/dubbing-structure.ts +186 -0
  203. package/src/entries/captions.ts +2 -0
  204. package/src/entries/credits.ts +25 -1
  205. package/src/entries/entities.ts +2 -0
  206. package/src/entries/llm-models.ts +7 -0
  207. package/src/entries/media.ts +3 -1
  208. package/src/entries/model-catalog.ts +30 -0
  209. package/src/entries/models.ts +54 -0
  210. package/src/entries/nodes.ts +2 -0
  211. package/src/entries/pipeline.ts +1 -1
  212. package/src/entries/video.ts +8 -1
  213. package/src/flux-3-klein.ts +69 -0
  214. package/src/gemini-tts.ts +144 -0
  215. package/src/input-image-pricing.ts +23 -6
  216. package/src/llm-models.ts +130 -36
  217. package/src/model-catalog.ts +539 -25
  218. package/src/model-constants.ts +247 -25
  219. package/src/node-default-mappings.ts +3 -0
  220. package/src/node-runtime-keys.ts +3 -0
  221. package/src/normalize-node-params.ts +123 -2
  222. package/src/seedance-extend-rate.ts +116 -0
  223. package/src/sequence-execution.ts +24 -0
  224. package/src/transcribe-preflight.ts +23 -0
  225. package/src/tts-capabilities.ts +193 -1
  226. package/src/video-analysis-pricing.ts +39 -15
  227. package/src/video-character-refs.ts +160 -3
  228. package/src/wired-character-names.ts +134 -18
  229. package/src/wired-character-video-subjects.ts +63 -0
  230. package/dist/chunk-63H4C56Q.cjs +0 -38
  231. package/dist/chunk-63H4C56Q.cjs.map +0 -1
  232. package/dist/chunk-6M563QE6.js.map +0 -1
  233. package/dist/chunk-6TGB7ECA.cjs.map +0 -1
  234. package/dist/chunk-6XUG4L7X.cjs +0 -54
  235. package/dist/chunk-6XUG4L7X.cjs.map +0 -1
  236. package/dist/chunk-BLJUCPMV.cjs.map +0 -1
  237. package/dist/chunk-BMJVKYVB.js.map +0 -1
  238. package/dist/chunk-CZ5IQB3L.js.map +0 -1
  239. package/dist/chunk-F6WGGYQW.cjs.map +0 -1
  240. package/dist/chunk-GMBDLNLD.cjs.map +0 -1
  241. package/dist/chunk-GSKLPI3J.cjs.map +0 -1
  242. package/dist/chunk-HBXF6RUU.js +0 -31
  243. package/dist/chunk-HBXF6RUU.js.map +0 -1
  244. package/dist/chunk-HSHCCBIV.js.map +0 -1
  245. package/dist/chunk-HWQ2SYNA.js.map +0 -1
  246. package/dist/chunk-IY3Y462W.js +0 -42
  247. package/dist/chunk-IY3Y462W.js.map +0 -1
  248. package/dist/chunk-KHH54GRP.cjs.map +0 -1
  249. package/dist/chunk-KMGCHV6O.js.map +0 -1
  250. package/dist/chunk-LH72PQO2.cjs.map +0 -1
  251. package/dist/chunk-M5OCFGHF.cjs.map +0 -1
  252. package/dist/chunk-NIAFR5EE.js.map +0 -1
  253. package/dist/chunk-O7RZRUMZ.js.map +0 -1
  254. package/dist/chunk-OV3JTKBY.js.map +0 -1
  255. package/dist/chunk-PSKZKLDG.js.map +0 -1
  256. package/dist/chunk-Q6IES3U2.js.map +0 -1
  257. package/dist/chunk-TM5JYSJF.cjs.map +0 -1
  258. package/dist/chunk-WRSWH7US.cjs.map +0 -1
  259. package/dist/chunk-XBTYGQ6Z.js.map +0 -1
  260. package/dist/chunk-XGGZWA4A.cjs.map +0 -1
  261. package/dist/chunk-XGVJGNZW.cjs.map +0 -1
  262. package/dist/chunk-Y35JQPT6.cjs.map +0 -1
  263. package/dist/chunk-Y4GCJJPF.cjs.map +0 -1
  264. package/dist/chunk-YUER7TJG.js.map +0 -1
  265. package/dist/chunk-YX6TFX7H.js.map +0 -1
@@ -0,0 +1,89 @@
1
+ import { describe, expect, it } from "vitest"
2
+ import {
3
+ seedanceExtendAddedSec,
4
+ seedanceExtendFullWindowCreditId,
5
+ seedanceExtendRefusesSource,
6
+ seedanceExtendSentSec,
7
+ seedanceExtendSourceCreditId,
8
+ seedanceExtendSourceSec,
9
+ seedanceExtendUnits,
10
+ tailExtendCreditId,
11
+ } from "../entries/credits.js"
12
+
13
+ /**
14
+ * `seedanceExtendSourceCreditId` (decided 2026-11-13): the ONE whole-run quote
15
+ * id a Seedance 2.5 Extend run on a known source is charged, by the seconds
16
+ * rule the server charges it by — units = (seconds sent + seconds added) ÷ 2,
17
+ * the seconds sent the source's picture read by the container-overhang rule,
18
+ * at most 10. Its parity with the server's charge is held in the backend
19
+ * (`seedance-extend-source-quote.test.ts`), where the server's quote
20
+ * resolution runs.
21
+ */
22
+
23
+ const RESOLUTIONS = [undefined, "480p", "720p", "1080p", "4k"] as const
24
+ const DURATIONS = [undefined, 1, 4, 8, 12, 30, 45, "12", -1] as const
25
+
26
+ describe("seedanceExtendSourceCreditId", () => {
27
+ it.each([
28
+ // [source picture s, seconds added, resolution, id]
29
+ [1.8, 4, "480p", "seedance-2-5-extend:480p:per-2s:2.9u"],
30
+ [4, 8, "720p", "seedance-2-5-extend:720p:per-2s:6u"],
31
+ // 8.04 s is a whole 8 s by the container-overhang rule; 8.3 s counts as measured.
32
+ [8.04, 8, "720p", "seedance-2-5-extend:720p:per-2s:8u"],
33
+ [8.3, 8, "720p", "seedance-2-5-extend:720p:per-2s:8.15u"],
34
+ // At most the 10 s window is sent: 10.05 s reads as 10 s, 25 s sends its last 10.
35
+ [10.05, 30, "1080p", "seedance-2-5-extend:1080p:per-2s:20u"],
36
+ [25, 4, "1080p", "seedance-2-5-extend:1080p:per-2s:7u"],
37
+ ] as const)("a %s s source, %s s added at %s: %s", (source, added, resolution, id) => {
38
+ expect(seedanceExtendSourceCreditId(source, added, resolution)).toBe(id)
39
+ })
40
+
41
+ it("a source the extend refuses (a measured picture under 1.8 s) names no id, whatever the seconds added", () => {
42
+ for (const [source, added] of [[1.7, 4], [1.7, 8], [1.0, 8], [0.5, 30], [1.79, 30]] as const) {
43
+ expect(seedanceExtendSourceCreditId(source, added, "720p"), `${source} s + ${added} s`).toBeUndefined()
44
+ }
45
+ expect(seedanceExtendSourceCreditId(1.8, 8, "720p")).toBe("seedance-2-5-extend:720p:per-2s:4.9u")
46
+ expect([1.79, 1.8, undefined, 0].map(seedanceExtendRefusesSource)).toEqual([true, false, false, false])
47
+ })
48
+
49
+ it("a length not known or unreadable names the full-window id, string for string", () => {
50
+ for (const unknown of [undefined, null, Number.NaN, 0, -1, -0.5, Number.POSITIVE_INFINITY]) {
51
+ for (const duration of DURATIONS) {
52
+ for (const resolution of RESOLUTIONS) {
53
+ expect(seedanceExtendSourceCreditId(unknown, duration, resolution), `${String(unknown)} ${String(duration)} ${String(resolution)}`)
54
+ .toBe(seedanceExtendFullWindowCreditId(duration, resolution))
55
+ }
56
+ }
57
+ }
58
+ // …which is what every client's builder names for a Seedance 2.5 extend.
59
+ expect(seedanceExtendFullWindowCreditId(8, "720p")).toBe(tailExtendCreditId("seedance-2-5-extend", 8, "720p"))
60
+ expect(seedanceExtendFullWindowCreditId(8, "720p")).toBe("seedance-2-5-extend:720p:per-2s:9u")
61
+ })
62
+
63
+ it("a source of 10 s or longer is the full window: the most a run sends", () => {
64
+ for (const source of [10, 10.2, 12, 25, 3600]) {
65
+ expect(seedanceExtendSourceCreditId(source, 8, "720p")).toBe(seedanceExtendFullWindowCreditId(8, "720p"))
66
+ }
67
+ })
68
+
69
+ it("is the seconds rule, composed: units = (sent + added) ÷ 2 on the resolution's two-second row", () => {
70
+ for (const source of [1.8, 2, 4.37, 6.04, 8.25, 8.26, 9.99]) {
71
+ for (const duration of DURATIONS) {
72
+ const units = seedanceExtendUnits(seedanceExtendSentSec(source), seedanceExtendAddedSec("seedance-2-5-extend", duration))
73
+ expect(seedanceExtendSourceCreditId(source, duration, "1080p")).toBe(`seedance-2-5-extend:1080p:per-2s:${String(units)}u`)
74
+ }
75
+ }
76
+ })
77
+ })
78
+
79
+ describe("the seconds rule (moved from @nodaro/render-rules, unchanged)", () => {
80
+ it("reads a picture by the container-overhang rule, then caps it at the 10 s window", () => {
81
+ expect([8.04, 8.25, 8.26, 8.3, 4.37, 0.5, 1.2].map(seedanceExtendSourceSec)).toEqual([8, 8, 8.26, 8.3, 4.37, 0.5, 1])
82
+ expect([1.8, 8.04, 10.05, 25, undefined, null, 0, Number.NaN].map(seedanceExtendSentSec)).toEqual([1.8, 8, 10, 10, 10, 10, 10, 10])
83
+ })
84
+
85
+ it("adds the requested seconds held in the catalog window (default 8 s), for every tail-recipe provider", () => {
86
+ expect([undefined, 1, 4, 30, 45, "12", "abc"].map((d) => seedanceExtendAddedSec("seedance-2-5-extend", d))).toEqual([8, 4, 4, 30, 30, 12, 8])
87
+ expect(seedanceExtendAddedSec("kling-4-extend", undefined)).toBe(5)
88
+ })
89
+ })
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from "vitest"
2
- import { assertCanvasExecutionAllowed, requiresSequenceExecution, STUDIO_DEPENDENT_FRAMES_CAPABILITY } from "../sequence-execution"
2
+ import { assertCanvasExecutionAllowed, isCodecOwnedDocument, requiresSequenceExecution, STUDIO_DEPENDENT_FRAMES_CAPABILITY } from "../sequence-execution"
3
3
 
4
4
  describe("dependency execution boundary", () => {
5
5
  it.each([
@@ -18,3 +18,24 @@ describe("dependency execution boundary", () => {
18
18
  .toThrow(expect.objectContaining({ nodeIds: ["linked"] }))
19
19
  })
20
20
  })
21
+
22
+ describe("isCodecOwnedDocument — the one predicate the server's routes and the editor ask", () => {
23
+ it("a Studio settings block holding keyframes, sequences or settled jobs, or declaring dependent frames", () => {
24
+ for (const studio of [{ keyframes: [] }, { sequences: [] }, { settledJobIds: [] }, { requiredCapabilities: [STUDIO_DEPENDENT_FRAMES_CAPABILITY] }]) {
25
+ expect(isCodecOwnedDocument([], { studio }), JSON.stringify(studio)).toBe(true)
26
+ }
27
+ })
28
+
29
+ it("any node carrying keyframeId, sequenceBinding or the declaration — whatever the settings", () => {
30
+ for (const data of [{ keyframeId: "k" }, { keyframeId: undefined }, { sequenceBinding: {} }, { requiredCapabilities: [STUDIO_DEPENDENT_FRAMES_CAPABILITY] }]) {
31
+ expect(isCodecOwnedDocument([{ id: "a", data: {} }, { id: "b", data }], {}), JSON.stringify(data)).toBe(true)
32
+ }
33
+ })
34
+
35
+ it("an ordinary document, a Studio marker alone, and malformed input are not", () => {
36
+ expect(isCodecOwnedDocument([{ id: "a", data: { prompt: "x" } }], {})).toBe(false)
37
+ expect(isCodecOwnedDocument([], { studio: { shots: [] } })).toBe(false)
38
+ expect(isCodecOwnedDocument([{ id: "a", data: { requiredCapabilities: ["other"] } }], null)).toBe(false)
39
+ for (const v of [undefined, null, "x", 3, [null, 7, { data: null }]]) expect(isCodecOwnedDocument(v, v)).toBe(false)
40
+ })
41
+ })
@@ -3,10 +3,19 @@ import {
3
3
  SPEECH_PRICE_UNIT_CHARS,
4
4
  SPEECH_FLOOR_UNITS,
5
5
  SPEECH_UNIT_CREDIT_SUFFIX,
6
+ SPEECH_PER_1K_CREDIT_SUFFIX,
6
7
  speechUnitCreditId,
7
8
  speechPriceUnits,
8
9
  speechCredits,
10
+ speechCreditsFor,
11
+ speechRowCredits,
12
+ speechRowUnits,
13
+ speechQuoteCreditId,
14
+ parseSpeechQuoteCreditId,
15
+ isSpeechLengthPriceId,
16
+ speechLengthPriceModel,
9
17
  } from "../credit-estimators/speech.js"
18
+ import { getTtsCapabilities } from "../tts-capabilities.js"
10
19
  import { TTS_PROVIDERS, TTS_PROVIDER_ALIASES, canonicalTtsProvider } from "../index.js"
11
20
 
12
21
  describe("speech pricing — the unit", () => {
@@ -50,7 +59,7 @@ describe("speech pricing — the unit row id", () => {
50
59
  expect(SPEECH_UNIT_CREDIT_SUFFIX).toBe(":per-100-chars")
51
60
  for (const id of TTS_PROVIDERS) {
52
61
  if (id in TTS_PROVIDER_ALIASES) continue
53
- expect(speechUnitCreditId(id)).toBe(`${id}:per-100-chars`)
62
+ expect(speechUnitCreditId(id)).toBe(getTtsCapabilities(id).ratePer1kChars ? `${id}:per-1k-chars` : `${id}:per-100-chars`)
54
63
  }
55
64
  expect(speechUnitCreditId("elevenlabs-dialogue")).toBe("elevenlabs-dialogue:per-100-chars")
56
65
  })
@@ -67,3 +76,55 @@ describe("speech pricing — the unit row id", () => {
67
76
  expect(id.startsWith("elevenlabs-v4:")).toBe(true)
68
77
  })
69
78
  })
79
+
80
+ describe("speech pricing — a rate quoted per 1,000 characters (decided 2026-11-12)", () => {
81
+ it("names the per-1K row for a model whose sheet says so; the count stays started hundreds", () => {
82
+ expect(SPEECH_PER_1K_CREDIT_SUFFIX).toBe(":per-1k-chars")
83
+ expect(speechUnitCreditId("gemini-3-8-flash-lite-tts")).toBe("gemini-3-8-flash-lite-tts:per-1k-chars")
84
+ expect(speechRowUnits("gemini-2-5-pro-tts")).toBe(10)
85
+ expect(speechRowUnits("elevenlabs-v4")).toBe(1)
86
+ expect(speechRowUnits("elevenlabs")).toBe(1)
87
+ expect(speechRowUnits("not-a-model")).toBe(1)
88
+ })
89
+
90
+ // The worked examples in docs/nodes/ai-audio/text-to-speech.md (Gemini rows) are these — change both together.
91
+ it.each([
92
+ // [model, chars, row, base credits]
93
+ ["gemini-3-8-flash-lite-tts", 100, 4, 4], // 8 units × 4 ÷ 10 = 3.2 → 4
94
+ ["gemini-3-8-flash-lite-tts", 1000, 4, 4],
95
+ ["gemini-3-8-flash-tts", 800, 6, 5], // 4.8 → 5
96
+ ["gemini-3-8-flash-tts", 2050, 6, 13], // 21 × 6 ÷ 10 = 12.6 → 13
97
+ ["gemini-3-1-flash-tts", 1000, 13, 13],
98
+ ["gemini-3-1-flash-tts", 100, 13, 11], // 10.4 → 11
99
+ ["gemini-2-5-pro-tts", 10000, 16, 160],
100
+ ["gemini-2-5-pro-tts", 2050, 16, 34], // 33.6 → 34
101
+ ] as const)("%s, %i characters at %i per 1,000 → %i base credits", (model, chars, row, base) => {
102
+ expect(speechCreditsFor(model, chars, row)).toBe(base)
103
+ })
104
+
105
+ it("on a per-100 row it is exactly speechCredits", () => {
106
+ for (const chars of [0, 100, 801, 5000]) expect(speechCreditsFor("elevenlabs-v4", chars, 4)).toBe(speechCredits(chars, 4))
107
+ expect(speechRowCredits(9, 4)).toBe(36)
108
+ expect(speechRowCredits(9, 4, 10)).toBe(4)
109
+ })
110
+
111
+ it("the request quote keeps one id shape for every model, and reads back with its row and how many hundreds the row prices", () => {
112
+ expect(speechQuoteCreditId("gemini-3-1-flash-tts", 21)).toBe("gemini-3-1-flash-tts:per-100-chars:21u")
113
+ expect(parseSpeechQuoteCreditId("gemini-3-1-flash-tts:per-100-chars:21u")).toEqual({
114
+ model: "gemini-3-1-flash-tts",
115
+ unitId: "gemini-3-1-flash-tts:per-1k-chars",
116
+ units: 21,
117
+ rowUnits: 10,
118
+ })
119
+ expect(parseSpeechQuoteCreditId("elevenlabs-v4:per-100-chars:9u")).toMatchObject({ unitId: "elevenlabs-v4:per-100-chars", rowUnits: 1 })
120
+ // Its cap in started hundreds bounds N, as for every model.
121
+ expect(parseSpeechQuoteCreditId("gemini-3-1-flash-tts:per-100-chars:101u")).toBeUndefined()
122
+ })
123
+
124
+ it("a per-1K row is a length price, priced for its model", () => {
125
+ expect(isSpeechLengthPriceId("gemini-2-5-pro-tts:per-1k-chars")).toBe(true)
126
+ expect(speechLengthPriceModel("gemini-2-5-pro-tts:per-1k-chars")).toBe("gemini-2-5-pro-tts")
127
+ expect(isSpeechLengthPriceId("gemini-2-5-pro-tts:per-1k-chars:3u")).toBe(false)
128
+ expect(isSpeechLengthPriceId("gemini-2-5-pro-tts")).toBe(false)
129
+ })
130
+ })
@@ -21,6 +21,24 @@ describe("sunoCreditType — the ONE implementation of the Suno route pricing co
21
21
  expect(sunoCreditType("V5_5", "suno-generate")).toBe("suno-v5_5")
22
22
  expect(sunoCreditType("V5", "suno-cover")).toBe("suno-v5")
23
23
  expect(sunoCreditType("V5_5", "suno-extend")).toBe("suno-v5_5")
24
+ // Their own rows since 2026-11-12 (they were charged under the operation's row, at the same price).
25
+ expect(sunoCreditType("V4_5PLUS", "suno-generate")).toBe("suno-v4_5plus")
26
+ expect(sunoCreditType("V4_5ALL", "suno-cover")).toBe("suno-v4_5all")
27
+ expect(sunoCreditType("V4_5", "suno-extend")).toBe("suno-v4_5")
28
+ })
29
+
30
+ // A version a deployment's model restriction can name is a catalog entry
31
+ // (its `dataValue`), and the row it is charged under is that entry's own.
32
+ it("gives every version but V4 its own credit key, the pricing row of its catalog entry", () => {
33
+ const sunoEntries = Object.values(MODEL_CATALOG).filter((m) => m.family === "Suno")
34
+ for (const model of SUNO_MODELS) {
35
+ const entry = sunoEntries.find((m) => m.dataValue === model)
36
+ expect(entry, `${model} has no MODEL_CATALOG entry with dataValue`).toBeTruthy()
37
+ if (model === "V4") continue
38
+ const key = SUNO_VERSION_CREDIT_KEYS[model]
39
+ expect(key, `${model} has no SUNO_VERSION_CREDIT_KEYS row`).toBe(entry!.id)
40
+ expect(entry!.pricing[0]!.identifier).toBe(key)
41
+ }
24
42
  })
25
43
 
26
44
  // A new active version with no key would silently bill at the operation
@@ -59,10 +77,11 @@ describe("sunoCreditType — the ONE implementation of the Suno route pricing co
59
77
  expect(sunoModelHonoursDuration(undefined)).toBe(false)
60
78
  })
61
79
 
62
- it("falls back to the operation key for versions with no dedicated price", () => {
80
+ it("falls back to the operation key for a version with no dedicated price (V4) and for none", () => {
63
81
  expect(sunoCreditType("V4", "suno-generate")).toBe("suno-generate")
64
- expect(sunoCreditType("V4_5ALL", "suno-cover")).toBe("suno-cover")
82
+ expect(sunoCreditType("V4", "suno-cover")).toBe("suno-cover")
65
83
  expect(sunoCreditType(undefined, "suno-extend")).toBe("suno-extend")
84
+ expect(sunoCreditType("V9", "suno-generate")).toBe("suno-generate")
66
85
  })
67
86
 
68
87
  // The reason this function is gated rather than a bare version map: these four
@@ -71,9 +71,11 @@ describe("transcribe lane capabilities", () => {
71
71
  expect(TRANSCRIBE_PROVIDERS[TRANSCRIBE_PROVIDERS.length - 1]).toBe("nemotron-3-5-transcribe")
72
72
  })
73
73
 
74
- it("Add Captions keeps its three lanes: no length-priced engine runs inside its flat price", () => {
75
- expect([...CAPTION_TRANSCRIBE_LANES].sort()).toEqual(["elevenlabs-stt", "incredibly-fast-whisper", "whisper"])
74
+ it("Add Captions offers Nemotron at the END of its lanes (priced per minute there too, decided 2026-11-13)", () => {
75
+ expect([...CAPTION_TRANSCRIBE_LANES]).toEqual(["whisper", "incredibly-fast-whisper", "elevenlabs-stt", "nemotron-3-5-transcribe"])
76
76
  for (const lane of CAPTION_TRANSCRIBE_LANES) expect(TRANSCRIBE_LANES).toContain(lane)
77
+ // Captions need word timings: every lane but whisper gives them, Nemotron included.
78
+ expect(TRANSCRIBE_PROVIDER_CAPABILITIES["nemotron-3-5-transcribe"].wordTimestamps).toBe(true)
77
79
  })
78
80
 
79
81
  it("the defaults do not move", () => {
@@ -1,6 +1,7 @@
1
+ import { replicaConsentProblem, replicaModels, replicaOf, ttsReplicaProblem, ttsTakesReplica } from "../tts-capabilities.js"
1
2
  import { describe, it, expect } from "vitest"
2
3
  import { MODEL_CATALOG, SPEECH_UNIT_PRICE_NOTE } from "../model-catalog.js"
3
- import { TTS_PROVIDERS, MAX_TTS_CHARS_BY_PROVIDER, getMaxTtsChars, TTS_TEXT_MAX } from "../model-constants.js"
4
+ import { TTS_PROVIDERS, MAX_TTS_CHARS_BY_PROVIDER, getMaxTtsChars, TTS_TEXT_MAX, DEFAULT_TTS_PROVIDER } from "../model-constants.js"
4
5
  import {
5
6
  TTS_PROVIDER_ALIASES,
6
7
  TTS_FALLBACK_PROVIDER,
@@ -13,6 +14,14 @@ import {
13
14
  ttsHasLever,
14
15
  ttsLanguageCodes,
15
16
  ttsSupportsTimestamps,
17
+ ttsNamedVoices,
18
+ ttsAcceptsVoice,
19
+ ttsNamedVoiceFor,
20
+ ttsAngleTags,
21
+ ttsDirection,
22
+ ttsDirectionFor,
23
+ ttsDirectionProblem,
24
+ ttsVoiceForModel,
16
25
  } from "../tts-capabilities.js"
17
26
 
18
27
  describe("speech-model capability sheets — totality", () => {
@@ -48,9 +57,12 @@ describe("speech-model capability sheets — totality", () => {
48
57
  for (const m of Object.values(MODEL_CATALOG)) {
49
58
  if (!m.tts) continue
50
59
  expect(Number.isInteger(m.tts.maxChars) && m.tts.maxChars > 0, `${m.id} maxChars`).toBe(true)
51
- expect(m.tts.levers, `${m.id} must honour stability`).toContain("stability")
60
+ // An ElevenLabs model honours stability; a named-voice model (Gemini) takes no ElevenLabs setting at all.
61
+ if (m.tts.voices) expect(m.tts.levers, `${m.id} takes no ElevenLabs lever`).toEqual([])
62
+ else expect(m.tts.levers, `${m.id} must honour stability`).toContain("stability")
52
63
  expect(new Set(m.tts.levers).size, `${m.id} duplicate lever`).toBe(m.tts.levers.length)
53
- expect(m.tts.languages.length, `${m.id} languages`).toBeGreaterThan(0)
64
+ // No language picker only where no language is ever sent (the text decides).
65
+ if (m.tts.languageCode) expect(m.tts.languages.length, `${m.id} languages`).toBeGreaterThan(0)
54
66
  expect(new Set(m.tts.languages).size, `${m.id} duplicate language`).toBe(m.tts.languages.length)
55
67
  // The `features` flag other packages already read must agree with the sheet.
56
68
  expect(m.features?.includes("audio-tags") ?? false, `${m.id} audio-tags feature`).toBe(m.tts.audioTags)
@@ -313,7 +325,7 @@ describe("elevenlabs-v4-turbo — the fast v4, added beside v4 (decided 2026-10-
313
325
  expect(getTtsCapabilities("elevenlabs-v3").maxChars).toBe(5000)
314
326
  expect(getTtsCapabilities("elevenlabs-turbo").maxChars).toBe(40000)
315
327
  expect(getTtsCapabilities("elevenlabs-multilingual").maxChars).toBe(10000)
316
- expect(TTS_PROVIDERS.filter((id) => id !== "elevenlabs-v4-turbo")).toEqual(["elevenlabs-v3", "elevenlabs-v4", "elevenlabs-turbo", "elevenlabs-multilingual", "elevenlabs"])
328
+ expect(TTS_PROVIDERS.filter((id) => id !== "elevenlabs-v4-turbo" && !id.startsWith("gemini-"))).toEqual(["elevenlabs-v3", "elevenlabs-v4", "elevenlabs-turbo", "elevenlabs-multilingual", "elevenlabs"])
317
329
  })
318
330
 
319
331
  it("the narration recommendation keeps v4 first and places v4 Turbo after v3, before Turbo v2.5", async () => {
@@ -373,3 +385,147 @@ describe("field mappings — the neighbour text fields are mappable", () => {
373
385
  expect(NODE_MAPPABLE_FIELDS["text-to-speech"]).toEqual(["directText", "previousText", "nextText"])
374
386
  })
375
387
  })
388
+
389
+ describe("Gemini speech — four models beside ElevenLabs (decided 2026-11-12)", () => {
390
+ const GEMINI_3_8 = ["gemini-3-8-flash-lite-tts", "gemini-3-8-flash-tts"]
391
+ const GEMINI_3_1 = ["gemini-3-1-flash-tts", "gemini-2-5-pro-tts"]
392
+
393
+ it("each is a text-to-speech model of Google's, priced per 1,000 characters; ElevenLabs v4 stays the default", () => {
394
+ for (const id of [...GEMINI_3_8, ...GEMINI_3_1]) {
395
+ expect(TTS_PROVIDERS as readonly string[]).toContain(id)
396
+ expect(MODEL_CATALOG[id]?.maker).toBe("google")
397
+ expect(MODEL_CATALOG[id]?.modes).toEqual(["tts", "dialogue"]) // one id for one speaker and two: dialogue priced on the one-speaker row by construction
398
+ expect(getTtsCapabilities(id).ratePer1kChars).toBe(true)
399
+ expect(MODEL_CATALOG[id]!.pricing.map((p) => p.identifier)).toEqual([id, `${id}:per-1k-chars`])
400
+ }
401
+ expect(DEFAULT_TTS_PROVIDER).toBe("elevenlabs-v4")
402
+ })
403
+
404
+ it("named voices only: 70 grouped by use on 3.8, the same 30 on 3.1 and 2.5; a voice of one list is not a voice of the other", () => {
405
+ for (const id of GEMINI_3_8) {
406
+ const voices = ttsNamedVoices(id)!
407
+ expect(voices).toHaveLength(70)
408
+ expect(voices.every((v) => v.group !== undefined)).toBe(true)
409
+ expect(new Set(voices.map((v) => v.id)).size).toBe(70)
410
+ expect(getTtsCapabilities(id).defaultVoice).toBe("Fola")
411
+ expect(ttsAcceptsVoice(id, "Fola")).toBe(true)
412
+ }
413
+ for (const id of GEMINI_3_1) {
414
+ expect(ttsNamedVoices(id)).toHaveLength(30)
415
+ expect(getTtsCapabilities(id).defaultVoice).toBe("Kore")
416
+ expect(ttsAcceptsVoice(id, "Fola")).toBe(false) // a 3.8 voice (KIE refuses it: 422)
417
+ expect(ttsAcceptsVoice(id, "Kore")).toBe(true)
418
+ }
419
+ // Every default is on its own list, and an ElevenLabs model takes any voice id (its own checks apply).
420
+ for (const id of [...GEMINI_3_8, ...GEMINI_3_1]) expect(ttsAcceptsVoice(id, getTtsCapabilities(id).defaultVoice!)).toBe(true)
421
+ expect(ttsNamedVoices("elevenlabs-v4")).toBeUndefined()
422
+ expect(ttsAcceptsVoice("elevenlabs-v4", "Rachel")).toBe(true)
423
+ })
424
+
425
+ it("ttsNamedVoiceFor: the voice asked for when the model speaks it, else the model's default; nothing on ElevenLabs", () => {
426
+ expect(ttsNamedVoiceFor("gemini-3-8-flash-tts", "Zephyr")).toBe("Zephyr")
427
+ expect(ttsNamedVoiceFor("gemini-3-8-flash-tts", "Rachel")).toBe("Fola")
428
+ expect(ttsNamedVoiceFor("gemini-3-1-flash-tts", undefined)).toBe("Kore")
429
+ expect(ttsNamedVoiceFor("elevenlabs-v4", "Rachel")).toBeUndefined()
430
+ })
431
+
432
+ it("no ElevenLabs lever, no language field, no timings, no neighbour text, a 10,000-character cap", () => {
433
+ for (const id of [...GEMINI_3_8, ...GEMINI_3_1]) {
434
+ const c = getTtsCapabilities(id)
435
+ expect(c).toMatchObject({ levers: [], languageCode: false, languages: [], timestamps: false, stitching: false, ssmlBreaks: false, maxChars: 10000, audioTags: true })
436
+ expect(getMaxTtsChars(id)).toBe(10000)
437
+ }
438
+ })
439
+
440
+ it("tags: 3.8 writes its own <angle> tags from a closed list; 3.1 / 2.5 take [square] tags as written", () => {
441
+ for (const id of GEMINI_3_8) {
442
+ expect(ttsAngleTags(id)).toContain("laugh")
443
+ expect(ttsAngleTags(id)).toContain("short pause")
444
+ expect(ttsAngleTags(id)).toHaveLength(40)
445
+ }
446
+ for (const id of [...GEMINI_3_1, "elevenlabs-v4"]) expect(ttsAngleTags(id)).toBeUndefined()
447
+ })
448
+
449
+ it("direction: free text per line on 3.8; style, pace, accent and audio profile on 3.1 / 2.5; none on ElevenLabs", () => {
450
+ for (const id of GEMINI_3_8) expect(ttsDirection(id)).toEqual({ styleMaxChars: 1000 })
451
+ for (const id of GEMINI_3_1) {
452
+ const d = ttsDirection(id)!
453
+ expect(d.styles).toContain("Deadpan")
454
+ expect(d.paces).toContain("Staccato")
455
+ expect(d.accents).toContain("British (RP)")
456
+ expect(d.audioProfileMaxChars).toBe(1000)
457
+ expect(d.styleMaxChars).toBeUndefined()
458
+ }
459
+ expect(ttsDirection("elevenlabs-v4")).toBeUndefined()
460
+ })
461
+
462
+ it("ttsDirectionFor keeps only what the model takes, trimmed; ttsDirectionProblem judges only that", () => {
463
+ const all = { styleDirection: " slow and dry ", pace: "Staccato", accent: "Australian", audioProfile: "A narrator" }
464
+ expect(ttsDirectionFor("gemini-3-8-flash-lite-tts", all)).toEqual({ styleDirection: "slow and dry" })
465
+ expect(ttsDirectionFor("gemini-3-1-flash-tts", { ...all, styleDirection: "Deadpan" })).toEqual({ styleDirection: "Deadpan", pace: "Staccato", accent: "Australian", audioProfile: "A narrator" })
466
+ expect(ttsDirectionFor("gemini-3-1-flash-tts", all)).toEqual({ pace: "Staccato", accent: "Australian", audioProfile: "A narrator" })
467
+ expect(ttsDirectionFor("elevenlabs-v4", all)).toEqual({})
468
+ expect(ttsDirectionProblem("gemini-3-8-flash-tts", all)).toBeUndefined()
469
+ expect(ttsDirectionProblem("gemini-3-8-flash-tts", { styleDirection: "x".repeat(1001) })).toMatchObject({ field: "styleDirection" })
470
+ expect(ttsDirectionProblem("gemini-3-1-flash-tts", all)).toMatchObject({ field: "styleDirection" })
471
+ expect(ttsDirectionProblem("gemini-3-1-flash-tts", { pace: "Slow" })).toMatchObject({ field: "pace" })
472
+ expect(ttsDirectionProblem("gemini-2-5-pro-tts", { accent: "" })).toBeUndefined()
473
+ expect(ttsDirectionProblem("elevenlabs-v4", { pace: "Slow" })).toBeUndefined()
474
+ })
475
+ })
476
+
477
+ describe("ttsVoiceForModel — the editor's model-switch rule where the editor is not there (decided 2026-11-13)", () => {
478
+ it("an ElevenLabs voice on a Gemini model becomes the model's default; a voice of its own list stays", () => {
479
+ expect(ttsVoiceForModel("gemini-3-8-flash-tts", "Rachel")).toBe("Fola")
480
+ expect(ttsVoiceForModel("gemini-3-1-flash-tts", "Fola")).toBe("Kore") // a 3.8 voice is not on 3.1's list
481
+ expect(ttsVoiceForModel("gemini-3-8-flash-tts", "Zephyr")).toBe("Zephyr")
482
+ expect(ttsVoiceForModel("gemini-2-5-pro-tts", "")).toBeUndefined()
483
+ expect(ttsVoiceForModel("gemini-2-5-pro-tts", undefined)).toBeUndefined()
484
+ })
485
+
486
+ it("a Gemini voice on an ElevenLabs model becomes no voice (the deployment's default); an ElevenLabs voice stays", () => {
487
+ expect(ttsVoiceForModel("elevenlabs-v4", "Fola")).toBeUndefined()
488
+ expect(ttsVoiceForModel("elevenlabs-turbo", "Kore")).toBeUndefined()
489
+ expect(ttsVoiceForModel("elevenlabs-v4", "Rachel")).toBe("Rachel")
490
+ expect(ttsVoiceForModel("elevenlabs-v4", "21m00Tcm4TlvDq8ikWAM")).toBe("21m00Tcm4TlvDq8ikWAM")
491
+ expect(ttsVoiceForModel(undefined, "Puck")).toBeUndefined() // no model: the fallback model, ElevenLabs
492
+ })
493
+
494
+ it("no Gemini voice name is also an ElevenLabs premade name", () => {
495
+ const premade = ["Rachel", "Aria", "Roger", "Sarah", "Laura", "Charlie", "George", "Callum", "River", "Liam", "Charlotte", "Alice", "Matilda", "Will", "Jessica", "Eric", "Chris", "Brian", "Daniel", "Lily", "Bill"]
496
+ for (const id of ["gemini-3-8-flash-tts", "gemini-3-1-flash-tts"]) {
497
+ for (const v of ttsNamedVoices(id)!) expect(premade, v.id).not.toContain(v.id)
498
+ }
499
+ })
500
+ })
501
+
502
+ describe("a one-off clone (replica, decided 2026-11-13)", () => {
503
+ it("3.8 Flash takes it; 3.8 Flash-Lite (KIE refuses it), 3.1, 2.5 and every ElevenLabs model do not", () => {
504
+ expect(ttsTakesReplica("gemini-3-8-flash-tts")).toBe(true)
505
+ for (const id of ["gemini-3-8-flash-lite-tts", "gemini-3-1-flash-tts", "gemini-2-5-pro-tts", "elevenlabs-v4", undefined]) expect(ttsTakesReplica(id), String(id)).toBe(false)
506
+ expect(replicaModels()).toEqual(["gemini-3-8-flash-tts"])
507
+ })
508
+
509
+ it("replicaOf reads two https links; ttsReplicaProblem refuses one on a model that does not clone, and a malformed one", () => {
510
+ const ok = { sourceAudioUrl: "https://a.example/s.wav", consentAudioUrl: "https://a.example/c.wav" }
511
+ expect(replicaOf(ok)).toEqual(ok)
512
+ expect(replicaOf({ ...ok, sourceAudioUrl: "http://a.example/s.wav" })).toBeUndefined()
513
+ expect(replicaOf({ sourceAudioUrl: "https://a" })).toBeUndefined()
514
+ expect(ttsReplicaProblem("gemini-3-8-flash-tts", ok)).toBeUndefined()
515
+ expect(ttsReplicaProblem("gemini-3-8-flash-tts", undefined)).toBeUndefined()
516
+ expect(ttsReplicaProblem("gemini-3-8-flash-lite-tts", ok)).toBe("gemini-3-8-flash-lite-tts does not clone a voice; a one-off clone runs on gemini-3-8-flash-tts")
517
+ expect(ttsReplicaProblem("gemini-3-8-flash-tts", { sourceAudioUrl: "file:///etc/passwd", consentAudioUrl: ok.consentAudioUrl })).toMatch(/https link/)
518
+ })
519
+ })
520
+
521
+ describe("a one-off clone's consent on the API and MCP (decided 2026-11-13)", () => {
522
+ it("a clone must say consent: true; none asked is no problem", () => {
523
+ const links = { sourceAudioUrl: "https://a.example/s.wav", consentAudioUrl: "https://a.example/c.wav" }
524
+ expect(replicaConsentProblem(undefined)).toBeUndefined()
525
+ expect(replicaConsentProblem({ ...links, consent: true })).toBeUndefined()
526
+ for (const replica of [links, { ...links, consent: false }, { ...links, consent: "yes" }]) {
527
+ expect(replicaConsentProblem(replica)).toMatch(/^replica\.consent must be true: it confirms "I confirm the voice in these recordings is my own/)
528
+ }
529
+ })
530
+ })
531
+
@@ -163,8 +163,10 @@ describe("bare video-analysis node-type credit id", () => {
163
163
  // plugin's token pin 8_203 -> 8_482, 356 wrote 2071: Stage 1.3 grew
164
164
  // that prompt again, moving the pin 8_482 -> 8_706, and 357 wrote 2076:
165
165
  // the transition vocabulary v2 doctrine (twelve named values; absent =
166
- // nothing asserted) grew it once more, moving the pin 8_706 -> 9_082.
167
- expect(ceiling).toBe(2076)
166
+ // nothing asserted) grew it once more, moving the pin 8_706 -> 9_082, and
167
+ // the fast-tier move to gemini-3.8-flash (2026-11-13) wrote 2097: smart's
168
+ // donor rolls roll the fast model too.
169
+ expect(ceiling).toBe(2097)
168
170
  })
169
171
 
170
172
  it("the bare id still bounds the default tier at the ceiling bucket", () => {
@@ -60,7 +60,7 @@ describe("video-analysis-pricing", () => {
60
60
  })
61
61
 
62
62
  it("model SSOT is capability-derived and Gemini-only today", () => {
63
- expect(VIDEO_ANALYSIS_LLM_MODELS).toEqual(["gemini-3-flash", "gemini-3.6-flash", "gemini-3.1-pro"])
63
+ expect(VIDEO_ANALYSIS_LLM_MODELS).toEqual(["gemini-3-flash", "gemini-3.6-flash", "gemini-3.8-flash", "gemini-3.1-pro", "gemini-4-carbon"])
64
64
  })
65
65
 
66
66
  it("tier layer: every model-backed tier maps to a real model AND every model is tier-reachable or explicitly legacy (no vendor leak)", () => {
@@ -103,9 +103,12 @@ describe("video-analysis-pricing", () => {
103
103
  expect(DEFAULT_VIDEO_ANALYSIS_TIER).toBe("pro")
104
104
  expect(DEFAULT_VIDEO_ANALYSIS_MODEL).toBe("gemini-3.1-pro")
105
105
  expect(resolveVideoAnalysisModel("pro")).toBe("gemini-3.1-pro")
106
- // The economy tiers moved to the cheaper flash generation when they moved to
107
- // the cheaper transport; the newer flash now sits behind the `smart` sentinel.
108
- expect(resolveVideoAnalysisModel("fast")).toBe("gemini-3-flash")
106
+ // The fast tier moved to gemini-3.8-flash when KIE dropped gemini-3-flash's
107
+ // channel (2026-11-13); gemini-3-flash is now a legacy fast backing.
108
+ expect(resolveVideoAnalysisModel("fast")).toBe("gemini-3.8-flash")
109
+ expect(VIDEO_ANALYSIS_LEGACY_MODELS["gemini-3-flash"]).toBe("fast")
110
+ // `ultra` (2026-11-13) is model-backed like fast and pro.
111
+ expect(resolveVideoAnalysisModel("ultra")).toBe("gemini-4-carbon")
109
112
  expect(resolveVideoAnalysisModel("mixed")).toBe("mixed") // roll-plan sentinel passthrough
110
113
  expect(resolveVideoAnalysisModel("mixed-fast")).toBe("mixed-fast")
111
114
  // `smart` is a sentinel too — it names an engine plan, never a model id, so the
@@ -120,6 +123,16 @@ describe("video-analysis-pricing", () => {
120
123
  expect(resolveVideoAnalysisModel("nonsense")).toBe("gemini-3.1-pro") // unknown → default, never throws
121
124
  })
122
125
 
126
+ it("ultra prices under its own model's family, above mixed and below smart in every bucket", () => {
127
+ for (const bucketSec of VIDEO_ANALYSIS_DURATION_BUCKETS) {
128
+ const id = buildVideoAnalysisCreditId(resolveVideoAnalysisModel("ultra"), bucketSec)
129
+ expect(id).toBe(`video-analysis:gemini-4-carbon:${bucketSec}s`)
130
+ const ultra = VIDEO_ANALYSIS_BUCKET_CREDITS[id]!
131
+ expect(ultra, `ultra <= mixed at ${bucketSec}s`).toBeGreaterThan(VIDEO_ANALYSIS_BUCKET_CREDITS[`video-analysis:mixed:${bucketSec}s`]!)
132
+ expect(ultra, `ultra >= smart at ${bucketSec}s`).toBeLessThan(VIDEO_ANALYSIS_BUCKET_CREDITS[`video-analysis:smart:${bucketSec}s`]!)
133
+ }
134
+ })
135
+
123
136
  it("mixed tiers price under ONE shared credit family (video-analysis:mixed:*)", () => {
124
137
  // Both variants are the identical compute plan — a per-variant price split
125
138
  // would be a phantom distinction and double the admin surface.
@@ -193,11 +206,11 @@ describe("video-audit-pricing", () => {
193
206
 
194
207
  it("videoAuditCreditsForBucket: table lookup by resolved bucket + family, snapping a raw duration onto the ladder", () => {
195
208
  expect(videoAuditCreditsForBucket(60, false)).toBe(215)
196
- expect(videoAuditCreditsForBucket(60, true)).toBe(396)
209
+ expect(videoAuditCreditsForBucket(60, true)).toBe(401)
197
210
  expect(videoAuditCreditsForBucket(180, false)).toBe(290)
198
211
  expect(videoAuditCreditsForBucket(360, false)).toBe(663)
199
212
  expect(videoAuditCreditsForBucket(600, false)).toBe(1073)
200
- expect(videoAuditCreditsForBucket(600, true)).toBe(1921)
213
+ expect(videoAuditCreditsForBucket(600, true)).toBe(1953)
201
214
  // Not just exact ladder values — a raw duration snaps up to its bucket.
202
215
  expect(videoAuditCreditsForBucket(70, false)).toBe(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:180s"])
203
216
  expect(videoAuditCreditsForBucket(9999, true)).toBe(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:auto:600s"])
@@ -239,17 +252,17 @@ describe("video-audit-pricing", () => {
239
252
  expect(Object.keys(VIDEO_AUDIT_BUCKET_CREDITS)).toHaveLength(8)
240
253
  // Bare-id values quoted in the task/catalog must equal each family's 600s ceiling.
241
254
  expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:600s"]).toBe(1073)
242
- expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:auto:600s"]).toBe(1921)
255
+ expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:auto:600s"]).toBe(1953)
243
256
  })
244
257
 
245
- it("auto family = base family + the gemini-3-flash (legacy fast tier) row at the same bucket, exactly — single-source, never hand-added", () => {
258
+ it("auto family = base family + the fast tier's row at the same bucket, exactly — single-source, never hand-added", () => {
246
259
  // Single-source assertion: reads the fast-tier row straight out of
247
260
  // VIDEO_ANALYSIS_BUCKET_CREDITS rather than re-hardcoding 180/185/514/846
248
261
  // here, so this test can't silently drift from that table either.
249
262
  for (const bucketSec of VIDEO_ANALYSIS_DURATION_BUCKETS) {
250
263
  const base = VIDEO_AUDIT_BUCKET_CREDITS[`video-audit:${bucketSec}s`]!
251
264
  const auto = VIDEO_AUDIT_BUCKET_CREDITS[`video-audit:auto:${bucketSec}s`]!
252
- const fastRow = VIDEO_ANALYSIS_BUCKET_CREDITS[`video-analysis:gemini-3-flash:${bucketSec}s`]!
265
+ const fastRow = VIDEO_ANALYSIS_BUCKET_CREDITS[buildVideoAnalysisCreditId(VIDEO_ANALYSIS_TIERS.fast, bucketSec)]!
253
266
  expect(auto - base, `auto-base mismatch at ${bucketSec}s`).toBe(fastRow)
254
267
  }
255
268
  })