@nodaro/shared 3.69.0 → 3.71.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 (198) hide show
  1. package/dist/{chunk-25C2E2GI.cjs → chunk-4A3ITJJB.cjs} +6 -6
  2. package/dist/{chunk-25C2E2GI.cjs.map → chunk-4A3ITJJB.cjs.map} +1 -1
  3. package/dist/{chunk-5EQRIUGI.cjs → chunk-4HV3LY4A.cjs} +78 -78
  4. package/dist/chunk-4HV3LY4A.cjs.map +1 -0
  5. package/dist/{chunk-PERUFUVH.cjs → chunk-5B337MCI.cjs} +15 -15
  6. package/dist/{chunk-PERUFUVH.cjs.map → chunk-5B337MCI.cjs.map} +1 -1
  7. package/dist/{chunk-7EQJIGVT.js → chunk-6FUVGATF.js} +3 -3
  8. package/dist/{chunk-7EQJIGVT.js.map → chunk-6FUVGATF.js.map} +1 -1
  9. package/dist/{chunk-WML66SUV.cjs → chunk-6PEWM2B3.cjs} +18 -18
  10. package/dist/{chunk-WML66SUV.cjs.map → chunk-6PEWM2B3.cjs.map} +1 -1
  11. package/dist/{chunk-KLEKJUQI.js → chunk-BO6IKV24.js} +5 -5
  12. package/dist/{chunk-KLEKJUQI.js.map → chunk-BO6IKV24.js.map} +1 -1
  13. package/dist/{chunk-KSHAAPQF.cjs → chunk-BOCHNFDU.cjs} +4 -4
  14. package/dist/chunk-BOCHNFDU.cjs.map +1 -0
  15. package/dist/{chunk-AH6OQXLW.js → chunk-BQV6NV7E.js} +3 -3
  16. package/dist/{chunk-AH6OQXLW.js.map → chunk-BQV6NV7E.js.map} +1 -1
  17. package/dist/{chunk-BDW25A7Y.js → chunk-BVP4M5AK.js} +247 -11
  18. package/dist/chunk-BVP4M5AK.js.map +1 -0
  19. package/dist/{chunk-ML55U7WM.js → chunk-C2UHX7OF.js} +3 -3
  20. package/dist/{chunk-ML55U7WM.js.map → chunk-C2UHX7OF.js.map} +1 -1
  21. package/dist/{chunk-Q2LEJXLZ.cjs → chunk-C32IL6RD.cjs} +2 -2
  22. package/dist/{chunk-Q2LEJXLZ.cjs.map → chunk-C32IL6RD.cjs.map} +1 -1
  23. package/dist/{chunk-5WHU7CYE.js → chunk-CL7ECTK2.js} +52 -7
  24. package/dist/chunk-CL7ECTK2.js.map +1 -0
  25. package/dist/{chunk-FUYBUT65.js → chunk-COA2OJIH.js} +51 -28
  26. package/dist/chunk-COA2OJIH.js.map +1 -0
  27. package/dist/{chunk-PLANUXQL.cjs → chunk-CV2BEK52.cjs} +25 -3
  28. package/dist/chunk-CV2BEK52.cjs.map +1 -0
  29. package/dist/{chunk-HW6TLOK4.cjs → chunk-DRPHRE4J.cjs} +2 -2
  30. package/dist/{chunk-HW6TLOK4.cjs.map → chunk-DRPHRE4J.cjs.map} +1 -1
  31. package/dist/{chunk-LZPG4XHT.js → chunk-F3XG5J5V.js} +3 -3
  32. package/dist/{chunk-LZPG4XHT.js.map → chunk-F3XG5J5V.js.map} +1 -1
  33. package/dist/{chunk-I6TBKTW3.cjs → chunk-H52P7DD2.cjs} +73 -73
  34. package/dist/{chunk-I6TBKTW3.cjs.map → chunk-H52P7DD2.cjs.map} +1 -1
  35. package/dist/{chunk-AGIG5HUU.cjs → chunk-HUCGHMOI.cjs} +17 -17
  36. package/dist/{chunk-AGIG5HUU.cjs.map → chunk-HUCGHMOI.cjs.map} +1 -1
  37. package/dist/{chunk-3AB3YIFM.cjs → chunk-I4C6ZYU4.cjs} +6 -6
  38. package/dist/{chunk-3AB3YIFM.cjs.map → chunk-I4C6ZYU4.cjs.map} +1 -1
  39. package/dist/{chunk-UVUHVY7F.js → chunk-JCYTTTM2.js} +2 -2
  40. package/dist/{chunk-UVUHVY7F.js.map → chunk-JCYTTTM2.js.map} +1 -1
  41. package/dist/{chunk-7OSUEYZ4.js → chunk-JPSKVBYB.js} +3 -3
  42. package/dist/{chunk-7OSUEYZ4.js.map → chunk-JPSKVBYB.js.map} +1 -1
  43. package/dist/{chunk-TAPBDT47.js → chunk-JVYDKXGY.js} +4 -4
  44. package/dist/{chunk-TAPBDT47.js.map → chunk-JVYDKXGY.js.map} +1 -1
  45. package/dist/{chunk-YT4ZTJVC.js → chunk-K2P7KOIT.js} +11 -11
  46. package/dist/{chunk-YT4ZTJVC.js.map → chunk-K2P7KOIT.js.map} +1 -1
  47. package/dist/{chunk-YVQFYW2U.js → chunk-K3YGI5IW.js} +25 -4
  48. package/dist/chunk-K3YGI5IW.js.map +1 -0
  49. package/dist/{chunk-4IMEJQVQ.cjs → chunk-K5WRF2F3.cjs} +4 -4
  50. package/dist/{chunk-4IMEJQVQ.cjs.map → chunk-K5WRF2F3.cjs.map} +1 -1
  51. package/dist/{chunk-TDU45K6Z.js → chunk-KD4UUCMW.js} +5 -5
  52. package/dist/{chunk-TDU45K6Z.js.map → chunk-KD4UUCMW.js.map} +1 -1
  53. package/dist/{chunk-UJREE6EQ.cjs → chunk-LBKMQAXD.cjs} +9 -9
  54. package/dist/{chunk-UJREE6EQ.cjs.map → chunk-LBKMQAXD.cjs.map} +1 -1
  55. package/dist/{chunk-XZYZYWKG.cjs → chunk-MI4WEFJ4.cjs} +21 -21
  56. package/dist/{chunk-XZYZYWKG.cjs.map → chunk-MI4WEFJ4.cjs.map} +1 -1
  57. package/dist/{chunk-RURPG6IS.cjs → chunk-MN7BUGXF.cjs} +7 -7
  58. package/dist/{chunk-RURPG6IS.cjs.map → chunk-MN7BUGXF.cjs.map} +1 -1
  59. package/dist/{chunk-54E2JO4E.cjs → chunk-NNCHSLFD.cjs} +309 -26
  60. package/dist/chunk-NNCHSLFD.cjs.map +1 -0
  61. package/dist/{chunk-6Q4BS6AR.js → chunk-NT3ZFUNJ.js} +31 -3
  62. package/dist/chunk-NT3ZFUNJ.js.map +1 -0
  63. package/dist/{chunk-G6AOKNAY.js → chunk-PPXUSZJU.js} +3 -3
  64. package/dist/{chunk-G6AOKNAY.js.map → chunk-PPXUSZJU.js.map} +1 -1
  65. package/dist/{chunk-6QJHSN6J.cjs → chunk-QCGSL4CJ.cjs} +4 -4
  66. package/dist/{chunk-6QJHSN6J.cjs.map → chunk-QCGSL4CJ.cjs.map} +1 -1
  67. package/dist/{chunk-DE55SA2X.js → chunk-QME5O4NG.js} +8 -6
  68. package/dist/chunk-QME5O4NG.js.map +1 -0
  69. package/dist/{chunk-KL6GAYTT.js → chunk-S6DXSQCV.js} +5 -3
  70. package/dist/chunk-S6DXSQCV.js.map +1 -0
  71. package/dist/{chunk-LSX2OFNB.js → chunk-SAOIGWA2.js} +3 -3
  72. package/dist/{chunk-LSX2OFNB.js.map → chunk-SAOIGWA2.js.map} +1 -1
  73. package/dist/{chunk-PHQVAPSD.js → chunk-SHSDGAI4.js} +29 -17
  74. package/dist/chunk-SHSDGAI4.js.map +1 -0
  75. package/dist/{chunk-QNPYYSLT.cjs → chunk-SR7WH4FX.cjs} +33 -33
  76. package/dist/{chunk-QNPYYSLT.cjs.map → chunk-SR7WH4FX.cjs.map} +1 -1
  77. package/dist/{chunk-OZA4DE23.js → chunk-SZ7ALYPK.js} +3 -3
  78. package/dist/{chunk-OZA4DE23.js.map → chunk-SZ7ALYPK.js.map} +1 -1
  79. package/dist/{chunk-DNWFFVC6.js → chunk-T4YYUI5Q.js} +3 -3
  80. package/dist/{chunk-DNWFFVC6.js.map → chunk-T4YYUI5Q.js.map} +1 -1
  81. package/dist/{chunk-ZWEVRMFN.cjs → chunk-TOYWEF6E.cjs} +51 -28
  82. package/dist/chunk-TOYWEF6E.cjs.map +1 -0
  83. package/dist/{chunk-V24EPI5N.cjs → chunk-U4DIGIC3.cjs} +5 -3
  84. package/dist/chunk-U4DIGIC3.cjs.map +1 -0
  85. package/dist/{chunk-NTCSXKZ3.cjs → chunk-U6APV2PO.cjs} +5 -5
  86. package/dist/{chunk-NTCSXKZ3.cjs.map → chunk-U6APV2PO.cjs.map} +1 -1
  87. package/dist/{chunk-7PC2YHBN.cjs → chunk-UJIPIVTB.cjs} +48 -48
  88. package/dist/{chunk-7PC2YHBN.cjs.map → chunk-UJIPIVTB.cjs.map} +1 -1
  89. package/dist/{chunk-H5KHWTAE.js → chunk-UY6QZX7H.js} +4 -4
  90. package/dist/chunk-UY6QZX7H.js.map +1 -0
  91. package/dist/{chunk-DBD4BCGH.cjs → chunk-VDFQKLDG.cjs} +33 -2
  92. package/dist/chunk-VDFQKLDG.cjs.map +1 -0
  93. package/dist/{chunk-OEOOXL3F.js → chunk-VZIMLPDC.js} +5 -5
  94. package/dist/chunk-VZIMLPDC.js.map +1 -0
  95. package/dist/{chunk-TWUFC32F.cjs → chunk-W4CJ2P3F.cjs} +8 -8
  96. package/dist/{chunk-TWUFC32F.cjs.map → chunk-W4CJ2P3F.cjs.map} +1 -1
  97. package/dist/{chunk-HP3YIWNJ.js → chunk-WARGPM7P.js} +2 -2
  98. package/dist/{chunk-HP3YIWNJ.js.map → chunk-WARGPM7P.js.map} +1 -1
  99. package/dist/{chunk-3OHRFSQL.cjs → chunk-WHK3HTFY.cjs} +73 -60
  100. package/dist/chunk-WHK3HTFY.cjs.map +1 -0
  101. package/dist/{chunk-5ZCZL73I.js → chunk-X3YRSRHP.js} +3 -3
  102. package/dist/{chunk-5ZCZL73I.js.map → chunk-X3YRSRHP.js.map} +1 -1
  103. package/dist/{chunk-OOUJZR4K.js → chunk-XK75VOEH.js} +5 -5
  104. package/dist/{chunk-OOUJZR4K.js.map → chunk-XK75VOEH.js.map} +1 -1
  105. package/dist/{chunk-LY6IR5LL.cjs → chunk-YHZUTPZL.cjs} +26 -24
  106. package/dist/{chunk-DE55SA2X.js.map → chunk-YHZUTPZL.cjs.map} +1 -1
  107. package/dist/{chunk-MGSGLRHZ.cjs → chunk-ZJQ2L3MI.cjs} +72 -11
  108. package/dist/chunk-ZJQ2L3MI.cjs.map +1 -0
  109. package/dist/entries/apps.cjs +43 -43
  110. package/dist/entries/apps.js +8 -8
  111. package/dist/entries/credits.cjs +426 -238
  112. package/dist/entries/credits.d.cts +277 -1
  113. package/dist/entries/credits.d.ts +277 -1
  114. package/dist/entries/credits.js +11 -11
  115. package/dist/entries/edl.cjs +60 -60
  116. package/dist/entries/edl.d.cts +96 -1
  117. package/dist/entries/edl.d.ts +96 -1
  118. package/dist/entries/edl.js +1 -1
  119. package/dist/entries/llm-models.cjs +76 -72
  120. package/dist/entries/llm-models.d.cts +38 -4
  121. package/dist/entries/llm-models.d.ts +38 -4
  122. package/dist/entries/llm-models.js +2 -2
  123. package/dist/entries/media.cjs +87 -87
  124. package/dist/entries/media.js +1 -1
  125. package/dist/entries/model-catalog.cjs +133 -133
  126. package/dist/entries/model-catalog.js +4 -4
  127. package/dist/entries/models.cjs +431 -415
  128. package/dist/entries/models.d.cts +62 -27
  129. package/dist/entries/models.d.ts +62 -27
  130. package/dist/entries/models.js +7 -7
  131. package/dist/entries/nodes.cjs +215 -215
  132. package/dist/entries/nodes.js +11 -11
  133. package/dist/entries/pipeline.cjs +153 -153
  134. package/dist/entries/pipeline.js +3 -3
  135. package/dist/entries/social.cjs +241 -177
  136. package/dist/entries/social.d.cts +189 -6
  137. package/dist/entries/social.d.ts +189 -6
  138. package/dist/entries/social.js +2 -2
  139. package/dist/entries/ugc.cjs +71 -71
  140. package/dist/entries/ugc.js +4 -4
  141. package/dist/entries/video.cjs +153 -153
  142. package/dist/entries/video.js +7 -7
  143. package/dist/entries/workflow.cjs +152 -152
  144. package/dist/entries/workflow.js +4 -4
  145. package/dist/index.cjs +2203 -1931
  146. package/dist/index.d.cts +5 -5
  147. package/dist/index.d.ts +5 -5
  148. package/dist/index.js +27 -27
  149. package/package.json +1 -1
  150. package/src/__tests__/audio-isolation-pricing.test.ts +49 -0
  151. package/src/__tests__/cast-swap-limits.test.ts +54 -20
  152. package/src/__tests__/competitors.test.ts +69 -0
  153. package/src/__tests__/credit-identifiers.test.ts +9 -10
  154. package/src/__tests__/lip-sync-pricing.test.ts +29 -2
  155. package/src/__tests__/llm-models.test.ts +50 -7
  156. package/src/__tests__/motion-transfer-pricing.test.ts +252 -0
  157. package/src/__tests__/suno-separate.test.ts +32 -0
  158. package/src/__tests__/video-to-video-pricing.test.ts +151 -0
  159. package/src/audio-isolation-pricing.ts +80 -0
  160. package/src/cast-swap-limits.ts +43 -25
  161. package/src/competitors.ts +86 -8
  162. package/src/credit-identifiers.ts +6 -0
  163. package/src/entries/credits.ts +56 -0
  164. package/src/entries/edl.ts +2 -0
  165. package/src/entries/llm-models.ts +2 -0
  166. package/src/entries/models.ts +4 -0
  167. package/src/entries/social.ts +34 -0
  168. package/src/generated/unit-contracts.ts +1 -0
  169. package/src/lip-sync-pricing.ts +25 -0
  170. package/src/llm-models.ts +60 -4
  171. package/src/model-catalog.ts +46 -23
  172. package/src/motion-transfer-pricing.ts +239 -0
  173. package/src/node-runtime-keys.ts +2 -2
  174. package/src/producer-types.ts +2 -0
  175. package/src/suno-separate.ts +51 -0
  176. package/src/topics.ts +162 -0
  177. package/src/use-case-output.ts +102 -0
  178. package/src/video-face-mesh.ts +1 -1
  179. package/src/video-to-video-pricing.ts +248 -0
  180. package/dist/chunk-3OHRFSQL.cjs.map +0 -1
  181. package/dist/chunk-54E2JO4E.cjs.map +0 -1
  182. package/dist/chunk-5EQRIUGI.cjs.map +0 -1
  183. package/dist/chunk-5WHU7CYE.js.map +0 -1
  184. package/dist/chunk-6Q4BS6AR.js.map +0 -1
  185. package/dist/chunk-BDW25A7Y.js.map +0 -1
  186. package/dist/chunk-DBD4BCGH.cjs.map +0 -1
  187. package/dist/chunk-FUYBUT65.js.map +0 -1
  188. package/dist/chunk-H5KHWTAE.js.map +0 -1
  189. package/dist/chunk-KL6GAYTT.js.map +0 -1
  190. package/dist/chunk-KSHAAPQF.cjs.map +0 -1
  191. package/dist/chunk-LY6IR5LL.cjs.map +0 -1
  192. package/dist/chunk-MGSGLRHZ.cjs.map +0 -1
  193. package/dist/chunk-OEOOXL3F.js.map +0 -1
  194. package/dist/chunk-PHQVAPSD.js.map +0 -1
  195. package/dist/chunk-PLANUXQL.cjs.map +0 -1
  196. package/dist/chunk-V24EPI5N.cjs.map +0 -1
  197. package/dist/chunk-YVQFYW2U.js.map +0 -1
  198. package/dist/chunk-ZWEVRMFN.cjs.map +0 -1
@@ -0,0 +1,80 @@
1
+ /**
2
+ * How an Audio Isolation run is priced (decided 2026-11-18): from the length
3
+ * of its audio as the server reads it before anything is held, never a length
4
+ * the caller declares.
5
+ *
6
+ * - The run is charged {@link AUDIO_ISOLATION_RATE_ID} once per started
7
+ * {@link AUDIO_ISOLATION_RATE_SECONDS} seconds of the audio, at least once,
8
+ * after forgiving `CLIP_PRICE_GRACE_SEC` past a mark. The hold IS the charge.
9
+ * - Audio longer than {@link AUDIO_ISOLATION_MAX_SEC} (30 minutes, a hair past
10
+ * it forgiven) is refused before anything is held; so is a file larger than
11
+ * {@link AUDIO_ISOLATION_MAX_BYTES}.
12
+ *
13
+ * The route, the workflow run, the MCP verb (which calls the route) and both
14
+ * estimates read this one module.
15
+ */
16
+ import { CLIP_PRICE_GRACE_SEC, gracedMeasuredSec } from "./priced-clip-seconds.js"
17
+
18
+ /** Float noise: a length that is arithmetic can land a hair past the limit, and must not be refused for it. */
19
+ const FLOAT_NOISE_SEC = 1e-9
20
+
21
+ /** The row an Audio Isolation run reserves and is charged: the price of ten seconds of audio. */
22
+ export const AUDIO_ISOLATION_RATE_ID = "elevenlabs-isolation:per-10s"
23
+
24
+ /** The seconds of audio one unit of {@link AUDIO_ISOLATION_RATE_ID} prices. */
25
+ export const AUDIO_ISOLATION_RATE_SECONDS = 10
26
+
27
+ /** The longest audio a run takes: 30 minutes. */
28
+ export const AUDIO_ISOLATION_MAX_SEC = 1800
29
+
30
+ /** The largest file a run takes (the provider's own limit): 500 MB. */
31
+ export const AUDIO_ISOLATION_MAX_BYTES = 500 * 1024 * 1024
32
+
33
+ /** The most units a run can be charged: the 30-minute cap's. */
34
+ export const AUDIO_ISOLATION_MAX_UNITS = AUDIO_ISOLATION_MAX_SEC / AUDIO_ISOLATION_RATE_SECONDS
35
+
36
+ /**
37
+ * The units of {@link AUDIO_ISOLATION_RATE_ID} an audio of `seconds` is
38
+ * charged: every started ten seconds after the grace, at least one, at most
39
+ * the cap's. THE one rounding every lane reads.
40
+ */
41
+ export function audioIsolationUnits(seconds: number): number {
42
+ if (!Number.isFinite(seconds) || seconds <= 0) return 1
43
+ const units = Math.ceil(gracedMeasuredSec(seconds) / AUDIO_ISOLATION_RATE_SECONDS)
44
+ return Math.min(AUDIO_ISOLATION_MAX_UNITS, Math.max(1, units))
45
+ }
46
+
47
+ /** What the length check answers for an audio of a given length. */
48
+ export type AudioIsolationLengthCheck =
49
+ | { readonly ok: true; readonly units: number }
50
+ | { readonly ok: false; readonly code: "audio_too_long"; readonly message: string }
51
+
52
+ /** The refusal of an audio past the 30-minute cap: how long it is, the limit, and what to do. */
53
+ export function audioIsolationTooLongMessage(seconds: number): string {
54
+ const minutes = Math.floor(seconds / 60)
55
+ const rest = Math.round(seconds - minutes * 60)
56
+ const length = rest > 0 ? `${minutes} min ${rest} s` : `${minutes} min`
57
+ return `The audio is ${length} long. Audio Isolation takes audio up to 30 minutes: split or trim it to 30 minutes or less first.`
58
+ }
59
+
60
+ /**
61
+ * Whether an audio of `seconds` can run, and the units it is charged. Past
62
+ * the 30-minute cap by more than `CLIP_PRICE_GRACE_SEC` is refused; within
63
+ * that grace it is charged at the cap.
64
+ */
65
+ export function checkAudioIsolationLength(seconds: number): AudioIsolationLengthCheck {
66
+ if (seconds > AUDIO_ISOLATION_MAX_SEC + CLIP_PRICE_GRACE_SEC + FLOAT_NOISE_SEC) {
67
+ return { ok: false, code: "audio_too_long", message: audioIsolationTooLongMessage(seconds) }
68
+ }
69
+ return { ok: true, units: audioIsolationUnits(seconds) }
70
+ }
71
+
72
+ /**
73
+ * The units an ESTIMATE quotes before the run reads the audio: the length
74
+ * the graph gives, at most the cap; a length it does not know quotes the cap
75
+ * (the most a run can be charged), and the caller marks it as an estimate.
76
+ */
77
+ export function audioIsolationEstimateUnits(knownSec?: number | null): number {
78
+ if (knownSec == null || !Number.isFinite(knownSec) || knownSec <= 0) return AUDIO_ISOLATION_MAX_UNITS
79
+ return audioIsolationUnits(knownSec)
80
+ }
@@ -58,7 +58,7 @@ export const CAST_SWAP_FACE_MASK_TARGETS = ["face", "head", "body"] as const
58
58
  export type CastSwapFaceMaskTarget = (typeof CAST_SWAP_FACE_MASK_TARGETS)[number]
59
59
 
60
60
  /**
61
- * How a direct Nodaro Motion run follows its clip (`style`, a public run
61
+ * How a direct Video Remake run follows its clip (`style`, a public run
62
62
  * field): `"precise"` (the default) follows the clip exactly; `"motion"`
63
63
  * follows only the clip's movement and takes every look from the photos. A
64
64
  * trend run ignores it (its trend decides).
@@ -100,10 +100,9 @@ export type CastSwapEngine = (typeof CAST_SWAP_ENGINES)[number]
100
100
  export const CAST_SWAP_ENGINE_WHEN_OMITTED: CastSwapEngine = "seedance-2-5"
101
101
 
102
102
  /**
103
- * Nodaro Motion — what people see of Cast Swap. Its two engines' PUBLIC ids,
103
+ * Video Remake — what people see of Cast Swap. Its two engines' PUBLIC ids,
104
104
  * the only ones documented and returned (a trend's `engine`, a run record, a
105
- * quote): `"motion-prism"` (Nodaro Motion Prism) and `"motion-pulse"` (Nodaro
106
- * Motion Pulse).
105
+ * quote): `"nodaro-prism"` (Nodaro Prism) and `"nodaro-pulse"` (Nodaro Pulse).
107
106
  *
108
107
  * `CAST_SWAP_ENGINES` stays the INTERNAL vocabulary: what a stored trend
109
108
  * version names, and what the platform sends the Cast Swap engine (which takes
@@ -112,29 +111,42 @@ export const CAST_SWAP_ENGINE_WHEN_OMITTED: CastSwapEngine = "seedance-2-5"
112
111
  * (`nodaroMotionEngineOf`). The engines' earlier public ids
113
112
  * (`NODARO_MOTION_LEGACY_ENGINES`) are read the same way and never returned.
114
113
  */
115
- export const NODARO_MOTION_ENGINES = ["motion-prism", "motion-pulse"] as const
114
+ export const NODARO_MOTION_ENGINES = ["nodaro-prism", "nodaro-pulse"] as const
116
115
 
117
116
  export type NodaroMotionEngine = (typeof NODARO_MOTION_ENGINES)[number]
118
117
 
119
118
  /**
120
- * The public ids the engines had before (renamed 2026-10-26), each with the
121
- * id it became. Still read wherever an engine is read — a request, a stored
122
- * run, an engine's declared engines, an admin setting's keys — and never
123
- * returned or documented.
119
+ * The public ids the engines had before, each with the id it became:
120
+ * `"motion-prism"` / `"motion-pulse"` (until 2026-11-17) and, before them,
121
+ * `"motion-pro"` / `"motion-lite"` (until 2026-10-26). Still read wherever an
122
+ * engine is read — a request, a stored run, an engine's declared engines, an
123
+ * admin setting's keys — and never returned or documented.
124
124
  */
125
125
  export const NODARO_MOTION_LEGACY_ENGINES = {
126
- "motion-pro": "motion-prism",
127
- "motion-lite": "motion-pulse",
126
+ "motion-prism": "nodaro-prism",
127
+ "motion-pulse": "nodaro-pulse",
128
+ "motion-pro": "nodaro-prism",
129
+ "motion-lite": "nodaro-pulse",
128
130
  } as const satisfies Record<string, NodaroMotionEngine>
129
131
 
130
132
  export type NodaroMotionLegacyEngine = keyof typeof NODARO_MOTION_LEGACY_ENGINES
131
133
 
132
- /** Each public id's earlier id (the inverse of `NODARO_MOTION_LEGACY_ENGINES`). */
134
+ /**
135
+ * Each public id's previous id (`"nodaro-prism"` → `"motion-prism"`): the key
136
+ * a Cast Swap engine from before the latest rename reads an admin setting by.
137
+ * Every earlier id, newest first, is in `NODARO_MOTION_EARLIER_ENGINES_OF`.
138
+ */
133
139
  export const NODARO_MOTION_LEGACY_ENGINE_OF = {
134
- "motion-prism": "motion-pro",
135
- "motion-pulse": "motion-lite",
140
+ "nodaro-prism": "motion-prism",
141
+ "nodaro-pulse": "motion-pulse",
136
142
  } as const satisfies Record<NodaroMotionEngine, NodaroMotionLegacyEngine>
137
143
 
144
+ /** Each public id's earlier ids, newest first (the inverse of `NODARO_MOTION_LEGACY_ENGINES`). */
145
+ export const NODARO_MOTION_EARLIER_ENGINES_OF = {
146
+ "nodaro-prism": ["motion-prism", "motion-pro"],
147
+ "nodaro-pulse": ["motion-pulse", "motion-lite"],
148
+ } as const satisfies Record<NodaroMotionEngine, readonly NodaroMotionLegacyEngine[]>
149
+
138
150
  /**
139
151
  * Each public engine's name, as people read it. The earlier ids are keys too,
140
152
  * each answering the name of the engine it became, so code written against
@@ -142,10 +154,12 @@ export const NODARO_MOTION_LEGACY_ENGINE_OF = {
142
154
  * not these keys.
143
155
  */
144
156
  export const NODARO_MOTION_ENGINE_NAMES = {
145
- "motion-prism": "Nodaro Motion Prism",
146
- "motion-pulse": "Nodaro Motion Pulse",
147
- "motion-pro": "Nodaro Motion Prism",
148
- "motion-lite": "Nodaro Motion Pulse",
157
+ "nodaro-prism": "Nodaro Prism",
158
+ "nodaro-pulse": "Nodaro Pulse",
159
+ "motion-prism": "Nodaro Prism",
160
+ "motion-pulse": "Nodaro Pulse",
161
+ "motion-pro": "Nodaro Prism",
162
+ "motion-lite": "Nodaro Pulse",
149
163
  } as const satisfies Record<NodaroMotionEngine | NodaroMotionLegacyEngine, string>
150
164
 
151
165
  /**
@@ -153,6 +167,8 @@ export const NODARO_MOTION_ENGINE_NAMES = {
153
167
  * earlier ids are keys too, as in `NODARO_MOTION_ENGINE_NAMES`.
154
168
  */
155
169
  export const CAST_SWAP_ENGINE_OF_NODARO_MOTION = {
170
+ "nodaro-prism": "seedance-2-5",
171
+ "nodaro-pulse": "kling-4",
156
172
  "motion-prism": "seedance-2-5",
157
173
  "motion-pulse": "kling-4",
158
174
  "motion-pro": "seedance-2-5",
@@ -161,8 +177,8 @@ export const CAST_SWAP_ENGINE_OF_NODARO_MOTION = {
161
177
 
162
178
  /** The public id of each internal engine. */
163
179
  export const NODARO_MOTION_ENGINE_OF_CAST_SWAP = {
164
- "seedance-2-5": "motion-prism",
165
- "kling-4": "motion-pulse",
180
+ "seedance-2-5": "nodaro-prism",
181
+ "kling-4": "nodaro-pulse",
166
182
  } as const satisfies Record<CastSwapEngine, NodaroMotionEngine>
167
183
 
168
184
  /** The public id of an internal engine. */
@@ -170,17 +186,17 @@ export function nodaroMotionEngineOf(engine: CastSwapEngine): NodaroMotionEngine
170
186
  return NODARO_MOTION_ENGINE_OF_CAST_SWAP[engine]
171
187
  }
172
188
 
173
- /** The name people read for an internal engine ("Nodaro Motion Prism" / "Nodaro Motion Pulse"). */
189
+ /** The name people read for an internal engine ("Nodaro Prism" / "Nodaro Pulse"). */
174
190
  export function nodaroMotionEngineName(engine: CastSwapEngine): string {
175
191
  return NODARO_MOTION_ENGINE_NAMES[nodaroMotionEngineOf(engine)]
176
192
  }
177
193
 
178
194
  /**
179
195
  * The internal engine a value names, in any vocabulary: a public id
180
- * (`"motion-prism"`, `"motion-pulse"`), an earlier public id (`"motion-pro"`,
181
- * `"motion-lite"`) or an internal one (`"seedance-2-5"`, `"kling-4"`), the
182
- * last two still accepted from older clients, older engines and stored data.
183
- * Undefined for anything else.
196
+ * (`"nodaro-prism"`, `"nodaro-pulse"`), an earlier public id
197
+ * (`NODARO_MOTION_LEGACY_ENGINES`) or an internal one (`"seedance-2-5"`,
198
+ * `"kling-4"`), the last ones still accepted from older clients, older
199
+ * engines and stored data. Undefined for anything else.
184
200
  */
185
201
  export function castSwapEngineFrom(value: unknown): CastSwapEngine | undefined {
186
202
  if (typeof value !== "string") return undefined
@@ -203,6 +219,8 @@ export function nodaroMotionEngineFrom(value: unknown): NodaroMotionEngine | und
203
219
  */
204
220
  export const CAST_SWAP_ENGINE_IDS_ACCEPTED = [
205
221
  ...NODARO_MOTION_ENGINES,
222
+ "motion-prism",
223
+ "motion-pulse",
206
224
  "motion-pro",
207
225
  "motion-lite",
208
226
  ...CAST_SWAP_ENGINES,
@@ -41,6 +41,45 @@ export type CompetitorSearchKind = "own" | "about"
41
41
  export interface CompetitorSearch {
42
42
  readonly kind: CompetitorSearchKind
43
43
  readonly platform: SocialPlatform
44
+ /** The term an about-search searches (a search term, or the name when the brand has none). Absent from an older server. */
45
+ readonly term?: string
46
+ }
47
+
48
+ /**
49
+ * The most search terms any brand can have (the platform's own ceiling; a plan
50
+ * allows fewer). A platform admin has no cap on terms, only on one scan's
51
+ * size (`COMPETITOR_SCAN_SEARCH_LIMIT`): one platform fits up to this many.
52
+ */
53
+ export const COMPETITOR_SEARCH_TERMS_MAX = 100
54
+ /** A brand whose scan would run more searches than this (each account, and each about-platform once per term) cannot be saved or scanned. */
55
+ export const COMPETITOR_SCAN_SEARCH_LIMIT = 100
56
+ /** The longest a search term can be. */
57
+ export const COMPETITOR_SEARCH_TERM_MAX_LENGTH = 100
58
+ /** A brand scan is charged this id per Social Search page it runs, summed (a topic scan has its own, `TOPIC_SCAN_PAGE_CREDIT_ID`). */
59
+ export const COMPETITOR_SCAN_PAGE_CREDIT_ID = "competitor-scan:per-page"
60
+
61
+ /**
62
+ * Search terms as the server keeps them: trimmed, inner whitespace collapsed,
63
+ * a one-word `#tag` or `@handle` without its trailing punctuation (`#tag!` →
64
+ * `#tag`), empty ones dropped, deduplicated without regard to case (the first
65
+ * spelling wins). Lengths, the count and a term with no letter or digit are
66
+ * the server's to refuse, not this function's to cut.
67
+ */
68
+ export function normalizeSearchTerms(terms: readonly string[]): string[] {
69
+ const seen = new Set<string>()
70
+ const out: string[] = []
71
+ for (const raw of terms) {
72
+ const spaced = raw.trim().replace(/\s+/g, " ")
73
+ // Combining marks (\p{M}) are part of a word: Hindi and Thai vowel signs are not punctuation.
74
+ const stripped = /^[#@]\S+$/.test(spaced) ? spaced.replace(/[^\p{L}\p{M}\p{N}_]+$/u, "") : spaced
75
+ // A tag with no word left ("#!") stays as sent, for the server to refuse with its reason.
76
+ const term = /[\p{L}\p{N}]/u.test(stripped) ? stripped : spaced
77
+ const key = term.toLowerCase()
78
+ if (term === "" || seen.has(key)) continue
79
+ seen.add(key)
80
+ out.push(term)
81
+ }
82
+ return out
44
83
  }
45
84
 
46
85
  export interface TrackedCompetitor {
@@ -59,10 +98,18 @@ export interface TrackedCompetitor {
59
98
  readonly lastScanError: string | null
60
99
  /** A scan is running now. */
61
100
  readonly scanning: boolean
62
- /** Searches one scan runs; a scan costs this many Social Search pages. */
101
+ /** Searches one scan runs. */
63
102
  readonly searches: number
64
103
  /** What the next scan searches. Absent from a server older than this field. */
65
104
  readonly searchPlan?: readonly CompetitorSearch[]
105
+ /**
106
+ * Phrases or #hashtags the searches for posts about the brand use instead
107
+ * of its name, and that a post must name to count as about it. Empty: the
108
+ * name. Absent from an older server.
109
+ */
110
+ readonly searchTerms?: readonly string[]
111
+ /** Social Search pages one scan runs: the scan costs this many pages. Absent from an older server (one page per search). */
112
+ readonly pages?: number
66
113
  readonly createdAt: string
67
114
  readonly updatedAt: string
68
115
  }
@@ -169,6 +216,14 @@ export interface CompetitorListResult {
169
216
  readonly data: readonly TrackedCompetitor[]
170
217
  /** How many months of scans your plan keeps (older scans are deleted at a brand's next scan). Absent from an older server. */
171
218
  readonly historyMonths?: number
219
+ /** Your plan's caps; null = no cap. Absent from an older server. */
220
+ readonly limits?: CompetitorLimits
221
+ }
222
+
223
+ /** What a plan allows a person on the Competitors page. */
224
+ export interface CompetitorLimits {
225
+ /** Search terms per brand; 0 = the name only; null = no cap. */
226
+ readonly searchTerms: number | null
172
227
  }
173
228
 
174
229
  /** One platform as one scan found and read it. Numbers a scan stored before they were kept answer null. */
@@ -514,18 +569,41 @@ export type CreateCompetitorInput = {
514
569
  readonly isOwn?: boolean
515
570
  /** Default weekly. */
516
571
  readonly schedule?: CompetitorSchedule
572
+ /** Phrases or #hashtags to search instead of the name (see `TrackedCompetitor.searchTerms`); the plan caps how many. */
573
+ readonly searchTerms?: readonly string[]
517
574
  }
518
575
 
519
576
  export type UpdateCompetitorInput = Partial<CreateCompetitorInput>
520
577
 
521
- /** Searches a scan of this configuration runs. */
522
- export function competitorScanSearches(c: { readonly accounts?: CompetitorAccounts; readonly aboutPlatforms?: readonly string[] }): number {
578
+ /**
579
+ * Searches a scan of this configuration runs: one per account, and one per
580
+ * about-platform per term (the name counts as the one term when there are
581
+ * none). `termCap` is the plan's cap (null = none): a scan searches only the
582
+ * first terms the plan allows.
583
+ */
584
+ export function competitorScanSearches(c: {
585
+ readonly accounts?: CompetitorAccounts
586
+ readonly aboutPlatforms?: readonly string[]
587
+ readonly searchTerms?: readonly string[]
588
+ readonly termCap?: number | null
589
+ }): number {
523
590
  const accounts = COMPETITOR_ACCOUNT_KEYS.filter((k) => (c.accounts?.[k] ?? "").trim() !== "").length
524
591
  const about = (c.aboutPlatforms ?? []).filter((p) => (COMPETITOR_ABOUT_PLATFORMS as readonly string[]).includes(p)).length
525
- return accounts + about
592
+ const terms = normalizeSearchTerms(c.searchTerms ?? [])
593
+ const cap = c.termCap === undefined || c.termCap === null ? COMPETITOR_SEARCH_TERMS_MAX : c.termCap
594
+ const used = Math.min(terms.length, cap)
595
+ return accounts + about * Math.max(1, used)
526
596
  }
527
597
 
528
- /** The credit id of a scan of `n` searches. */
598
+ /** Social Search pages a brand scan runs: every brand search reads one page. */
599
+ export function competitorScanPages(c: Parameters<typeof competitorScanSearches>[0]): number {
600
+ return competitorScanSearches(c)
601
+ }
602
+
603
+ /**
604
+ * The credit id of a scan of `n` searches.
605
+ * @deprecated A scan is charged per page at `COMPETITOR_SCAN_PAGE_CREDIT_ID`; this id caps at twelve searches. Kept for a plugin that still reserves it.
606
+ */
529
607
  export function competitorScanCreditId(n: number): string {
530
608
  const clamped = Math.min(Math.max(Math.round(n), 1), COMPETITOR_SCAN_MAX_SEARCHES)
531
609
  return `${COMPETITOR_SCAN_NODE_TYPE}:${clamped}`
@@ -536,9 +614,9 @@ export const COMPETITOR_SCAN_CREDIT_COSTS: Readonly<Record<string, number>> = Ob
536
614
  Array.from({ length: COMPETITOR_SCAN_MAX_SEARCHES }, (_, i) => [competitorScanCreditId(i + 1), (i + 1) * SOCIAL_SEARCH_CREDITS_PER_PAGE] as const),
537
615
  )
538
616
 
539
- /** The credits a scan of this many searches costs. */
540
- export function competitorScanCredits(searches: number): number {
541
- return searches <= 0 ? 0 : COMPETITOR_SCAN_CREDIT_COSTS[competitorScanCreditId(searches)] ?? 0
617
+ /** The credits a scan of this many pages costs, before the live price table loads (the base price of a page × pages). */
618
+ export function competitorScanCredits(pages: number): number {
619
+ return !Number.isFinite(pages) || pages <= 0 ? 0 : Math.round(pages) * SOCIAL_SEARCH_CREDITS_PER_PAGE
542
620
  }
543
621
 
544
622
  /** Whether a platform is one the about-search covers (used by pickers). */
@@ -1206,6 +1206,12 @@ export function pricedVideoSelection(opts: {
1206
1206
  * Compute composite model identifier for motion control with duration-tiered pricing.
1207
1207
  * Examples: "kling-3.0-motion:10s", "kling-3.0-motion:1080p:15s", "motion-transfer:5s"
1208
1208
  *
1209
+ * This is the old TIER row only, kept for older code and saved quotes: no
1210
+ * run is priced from it. A run is priced through `motionTransferPrice`
1211
+ * (motion-transfer-pricing.ts), per second of the driving video as the server
1212
+ * reads it, for every model and size (Wan Animate's flat rows below are its
1213
+ * floor).
1214
+ *
1209
1215
  * Wan Animate providers use resolution-tiered pricing (not per-second):
1210
1216
  * "wan-animate-move" (480p default), "wan-animate-move:580p", "wan-animate-move:720p"
1211
1217
  *
@@ -107,6 +107,8 @@ export {
107
107
  pickLipSyncBucket,
108
108
  getLipSyncMaxAudioSeconds,
109
109
  isPerSecondLipSyncProvider,
110
+ LIP_SYNC_CHARGED_AT_RUN_COST,
111
+ isLipSyncChargedAtRunCost,
110
112
  buildLipSyncCreditId,
111
113
  LIP_SYNC_AUDIO_RATES,
112
114
  OMNIHUMAN_2_0_PER_SECOND_CREDIT_ID,
@@ -118,6 +120,60 @@ export {
118
120
  LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS,
119
121
  } from "../lip-sync-pricing.js"
120
122
  export type { LipSyncDurationBucket, LipSyncAudioRate } from "../lip-sync-pricing.js"
123
+ export {
124
+ MOTION_TRANSFER_MIN_SEC,
125
+ MOTION_TRANSFER_IMAGE_ORIENTATION_MAX_SEC,
126
+ MOTION_TRANSFER_MAX_SEC,
127
+ MOTION_TRANSFER_SECOND_RATES,
128
+ MOTION_TRANSFER_RATE_IDS,
129
+ MOTION_TRANSFER_FLOOR_IDS,
130
+ motionTransferOrientation,
131
+ motionTransferMaxSec,
132
+ motionTransferRateOf,
133
+ motionTransferBilledSeconds,
134
+ motionTransferPrice,
135
+ motionTransferChargedPrice,
136
+ motionTransferBaseCharge,
137
+ checkMotionTransferLength,
138
+ motionTransferEstimateSeconds,
139
+ motionTransferEstimatePrice,
140
+ } from "../motion-transfer-pricing.js"
141
+ export type { MotionTransferSecondRate, MotionTransferPrice, MotionTransferLengthCheck } from "../motion-transfer-pricing.js"
142
+ export {
143
+ CLIP_PRICED_V2V_PROVIDERS,
144
+ HAPPYHORSE_EDIT_MIN_SEC,
145
+ HAPPYHORSE_EDIT_MAX_SEC,
146
+ WAN_VIDEOEDIT_MIN_SEC,
147
+ WAN_VIDEOEDIT_MAX_SEC,
148
+ WAN_VIDEOEDIT_FLOOR_CREDIT_ID,
149
+ V2V_CLIP_RATES,
150
+ V2V_CLIP_RATE_IDS,
151
+ isClipPricedV2vProvider,
152
+ v2vSeededRowCredits,
153
+ videoToVideoClipMinSec,
154
+ videoToVideoClipMaxSec,
155
+ videoToVideoSentResolution,
156
+ videoToVideoClipRateOf,
157
+ videoToVideoBilledSeconds,
158
+ checkVideoToVideoClipLength,
159
+ videoToVideoClipPrice,
160
+ wanVideoEditRateFromSeconds,
161
+ videoToVideoEstimateSeconds,
162
+ videoToVideoEstimatePrice,
163
+ } from "../video-to-video-pricing.js"
164
+ export type { ClipPricedV2vProvider, V2vClipRate, V2vClipLengthCheck, V2vClipPrice } from "../video-to-video-pricing.js"
165
+ export {
166
+ AUDIO_ISOLATION_RATE_ID,
167
+ AUDIO_ISOLATION_RATE_SECONDS,
168
+ AUDIO_ISOLATION_MAX_SEC,
169
+ AUDIO_ISOLATION_MAX_BYTES,
170
+ AUDIO_ISOLATION_MAX_UNITS,
171
+ audioIsolationUnits,
172
+ audioIsolationTooLongMessage,
173
+ checkAudioIsolationLength,
174
+ audioIsolationEstimateUnits,
175
+ } from "../audio-isolation-pricing.js"
176
+ export type { AudioIsolationLengthCheck } from "../audio-isolation-pricing.js"
121
177
  export {
122
178
  SEEDANCE_LIP_SYNC_SECONDS,
123
179
  isSeedanceLipSyncProvider,
@@ -42,3 +42,5 @@ export * from "../speaker-map-contract.js"
42
42
  export * from "../edit-plan-contract.js"
43
43
  // A person's review of an Edit Plan (`editedEdl`) and the one resolver that applies it.
44
44
  export * from "../edit-plan-review.js"
45
+ // What a podcast use-case run reports on its job's output_data (clip spans, trailer moments, speakers).
46
+ export * from "../use-case-output.js"
@@ -51,6 +51,8 @@ export {
51
51
  readsAudioOutsideLlmNodes,
52
52
  type LlmModalityCaps,
53
53
  llmAcceptsFiles,
54
+ llmFileWire,
55
+ type LlmFileWire,
54
56
  LLM_FILE_MODELS,
55
57
  LLM_REFERENCE_FILES_MAX,
56
58
  LLM_REFERENCE_FILES_MAX_TOTAL_BYTES,
@@ -308,6 +308,7 @@ export {
308
308
  CAST_SWAP_ENGINE_IDS_ACCEPTED,
309
309
  NODARO_MOTION_LEGACY_ENGINES,
310
310
  NODARO_MOTION_LEGACY_ENGINE_OF,
311
+ NODARO_MOTION_EARLIER_ENGINES_OF,
311
312
  nodaroMotionEngineFrom,
312
313
  nodaroMotionEngineOf,
313
314
  nodaroMotionEngineName,
@@ -467,8 +468,11 @@ export {
467
468
  SUNO_SEPARATE_TAKE_FIELDS,
468
469
  SUNO_SEPARATE_RESULT_FIELDS,
469
470
  SUNO_SEPARATE_META_FIELDS,
471
+ SUNO_SEPARATE_ID_FIELDS,
470
472
  sunoSeparateHandleUrl,
471
473
  sunoSeparatePrimaryUrl,
474
+ sunoSeparateHandleField,
475
+ sunoSeparateHandleIds,
472
476
  } from "../suno-separate.js"
473
477
  export type {
474
478
  SunoSeparateType,
@@ -229,7 +229,13 @@ export {
229
229
  ACTION_CARD_KINDS,
230
230
  BRAND_LESSON_KINDS,
231
231
  COMPETITOR_SCAN_CREDIT_COSTS,
232
+ COMPETITOR_SEARCH_TERMS_MAX,
233
+ COMPETITOR_SCAN_SEARCH_LIMIT,
234
+ COMPETITOR_SEARCH_TERM_MAX_LENGTH,
235
+ COMPETITOR_SCAN_PAGE_CREDIT_ID,
236
+ normalizeSearchTerms,
232
237
  competitorScanSearches,
238
+ competitorScanPages,
233
239
  competitorScanCreditId,
234
240
  competitorScanCredits,
235
241
  isCompetitorAboutPlatform,
@@ -266,6 +272,7 @@ export {
266
272
  type CompetitorScan,
267
273
  type CompetitorDetail,
268
274
  type CompetitorListResult,
275
+ type CompetitorLimits,
269
276
  type CompetitorHistory,
270
277
  type CompetitorHistoryPoint,
271
278
  type CompetitorHistoryPlatform,
@@ -284,6 +291,33 @@ export {
284
291
  type CreateCompetitorInput,
285
292
  type UpdateCompetitorInput,
286
293
  } from "../competitors.js"
294
+ export {
295
+ TOPIC_PLATFORMS,
296
+ TOPIC_DEFAULT_PLATFORMS,
297
+ TOPIC_POST_COUNTS,
298
+ TOPIC_SCAN_NODE_TYPE,
299
+ TOPIC_SCAN_PAGE_CREDIT_ID,
300
+ TOPICS_MAX,
301
+ SCAN_PAGE_CREDIT_COSTS,
302
+ topicScanPages,
303
+ topicScanCredits,
304
+ isTopicPlatform,
305
+ type TopicPlatform,
306
+ type TopicPostCount,
307
+ type TrackedTopic,
308
+ type TopicLimits,
309
+ type TopicListResult,
310
+ type CreateTopicInput,
311
+ type UpdateTopicInput,
312
+ type TopicScanCounts,
313
+ type TopicScan,
314
+ type TopicScanSummary,
315
+ type TopicDetail,
316
+ type TopicHistoryPlatform,
317
+ type TopicHistoryPoint,
318
+ type TopicHistory,
319
+ type TopicCardsResult,
320
+ } from "../topics.js"
287
321
  export {
288
322
  PLATFORM_SPECS,
289
323
  PLATFORM_LABELS,
@@ -14,6 +14,7 @@ export const UNIT_CONTRACTS: ReadonlyArray<readonly [type: string, producer: "au
14
14
  ["remove-audio", "video"], // unit:remove-audio
15
15
  ["gif-to-video", "video"], // unit:gif-to-video
16
16
  ["split-into-layers", "image"], // unit:split-into-layers
17
+ ["suno-speech", "audio"], // unit:suno-speech
17
18
  ]
18
19
 
19
20
  // The use-case node units (execution.kind "use-case"), in position order — each a route POST /v1/<type> (+ /estimate, /continue).
@@ -128,6 +128,9 @@ export const LIP_SYNC_MAX_AUDIO_SECONDS: Record<string, number> = {
128
128
  "sync-lipsync-v3": 300,
129
129
  // Volcengine (KIE) — video-to-video dubbing, per-second, 5-min ceiling.
130
130
  "volcengine-lipsync": 300,
131
+ // LatentSync — its output is as long as its audio, and its run time grows
132
+ // with that length. 5-min ceiling: longer audio is priced at it and cut to it.
133
+ "latentsync": 300,
131
134
  // The per-second-rate models: their own maximum (longer audio is refused; up to the 0.05 s its hold forgives past it, held at the maximum and cut to it).
132
135
  ...Object.fromEntries(Object.entries(LIP_SYNC_AUDIO_RATES).map(([provider, rate]) => [provider, rate.maxSeconds])),
133
136
  }
@@ -165,12 +168,34 @@ const PER_SECOND_LIP_SYNC_PROVIDERS = new Set([
165
168
  "sync-lipsync-v3",
166
169
  // Volcengine (KIE) — video-to-video dubbing, billed per output second.
167
170
  "volcengine-lipsync",
171
+ // LatentSync — held by the bucket of its audio's length and charged what the
172
+ // run used (LIP_SYNC_CHARGED_AT_RUN_COST below).
173
+ "latentsync",
168
174
  ])
169
175
 
170
176
  export function isPerSecondLipSyncProvider(provider: string): boolean {
171
177
  return PER_SECOND_LIP_SYNC_PROVIDERS.has(provider)
172
178
  }
173
179
 
180
+ /**
181
+ * Bucketed lip-sync models whose bucket row is a HOLD, not the charge (decided
182
+ * 2026-11-18): the run is charged what it used once it ends. Less than the
183
+ * hold releases the rest; more is collected from the payer's balance. The
184
+ * work such a model does grows with its audio's length AND with settings the
185
+ * bucket cannot see (LatentSync's inference steps, the size of its video), so
186
+ * one fixed row per bucket would be wrong for most runs. Every other bucketed
187
+ * model is charged its bucket row as it is.
188
+ *
189
+ * A member MUST be a bucketed model (`isPerSecondLipSyncProvider`): the hold is
190
+ * its bucket row. `lip-sync-pricing.test.ts` holds that.
191
+ */
192
+ export const LIP_SYNC_CHARGED_AT_RUN_COST: ReadonlySet<string> = new Set(["latentsync"])
193
+
194
+ /** Is this lip-sync model charged what its run used, with its bucket row as the hold? */
195
+ export function isLipSyncChargedAtRunCost(provider: unknown): boolean {
196
+ return typeof provider === "string" && LIP_SYNC_CHARGED_AT_RUN_COST.has(provider)
197
+ }
198
+
174
199
  /**
175
200
  * Build the credit identifier for a lip-sync request.
176
201
  *