@nodaro/shared 3.69.0 → 3.70.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 (176) hide show
  1. package/dist/{chunk-OZA4DE23.js → chunk-2VOXSVIE.js} +3 -3
  2. package/dist/{chunk-OZA4DE23.js.map → chunk-2VOXSVIE.js.map} +1 -1
  3. package/dist/{chunk-LSX2OFNB.js → chunk-42ICEVUN.js} +3 -3
  4. package/dist/{chunk-LSX2OFNB.js.map → chunk-42ICEVUN.js.map} +1 -1
  5. package/dist/{chunk-I6TBKTW3.cjs → chunk-4U7QAUV3.cjs} +73 -73
  6. package/dist/{chunk-I6TBKTW3.cjs.map → chunk-4U7QAUV3.cjs.map} +1 -1
  7. package/dist/{chunk-7EQJIGVT.js → chunk-52JNQG4K.js} +3 -3
  8. package/dist/{chunk-7EQJIGVT.js.map → chunk-52JNQG4K.js.map} +1 -1
  9. package/dist/{chunk-PERUFUVH.cjs → chunk-5B337MCI.cjs} +15 -15
  10. package/dist/{chunk-PERUFUVH.cjs.map → chunk-5B337MCI.cjs.map} +1 -1
  11. package/dist/{chunk-LY6IR5LL.cjs → chunk-5DRSENY3.cjs} +24 -24
  12. package/dist/{chunk-LY6IR5LL.cjs.map → chunk-5DRSENY3.cjs.map} +1 -1
  13. package/dist/{chunk-KLEKJUQI.js → chunk-BIQ7COJP.js} +5 -5
  14. package/dist/{chunk-KLEKJUQI.js.map → chunk-BIQ7COJP.js.map} +1 -1
  15. package/dist/{chunk-54E2JO4E.cjs → chunk-BLGZW3UF.cjs} +38 -26
  16. package/dist/chunk-BLGZW3UF.cjs.map +1 -0
  17. package/dist/{chunk-KSHAAPQF.cjs → chunk-BOCHNFDU.cjs} +4 -4
  18. package/dist/chunk-BOCHNFDU.cjs.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-PLANUXQL.cjs → chunk-CV2BEK52.cjs} +25 -3
  24. package/dist/chunk-CV2BEK52.cjs.map +1 -0
  25. package/dist/{chunk-RURPG6IS.cjs → chunk-DOY47F7S.cjs} +7 -7
  26. package/dist/{chunk-RURPG6IS.cjs.map → chunk-DOY47F7S.cjs.map} +1 -1
  27. package/dist/{chunk-LZPG4XHT.js → chunk-EWNDK4FV.js} +3 -3
  28. package/dist/{chunk-LZPG4XHT.js.map → chunk-EWNDK4FV.js.map} +1 -1
  29. package/dist/{chunk-25C2E2GI.cjs → chunk-FMQ43SJP.cjs} +6 -6
  30. package/dist/{chunk-25C2E2GI.cjs.map → chunk-FMQ43SJP.cjs.map} +1 -1
  31. package/dist/{chunk-NTCSXKZ3.cjs → chunk-FWPGRC4X.cjs} +5 -5
  32. package/dist/{chunk-NTCSXKZ3.cjs.map → chunk-FWPGRC4X.cjs.map} +1 -1
  33. package/dist/{chunk-WML66SUV.cjs → chunk-GC77W57T.cjs} +18 -18
  34. package/dist/{chunk-WML66SUV.cjs.map → chunk-GC77W57T.cjs.map} +1 -1
  35. package/dist/{chunk-5ZCZL73I.js → chunk-H2E4QXEZ.js} +3 -3
  36. package/dist/{chunk-5ZCZL73I.js.map → chunk-H2E4QXEZ.js.map} +1 -1
  37. package/dist/{chunk-OOUJZR4K.js → chunk-HA2PVTER.js} +5 -5
  38. package/dist/{chunk-OOUJZR4K.js.map → chunk-HA2PVTER.js.map} +1 -1
  39. package/dist/{chunk-XZYZYWKG.cjs → chunk-HBRDKHIW.cjs} +21 -21
  40. package/dist/{chunk-XZYZYWKG.cjs.map → chunk-HBRDKHIW.cjs.map} +1 -1
  41. package/dist/{chunk-ZWEVRMFN.cjs → chunk-HWBLZSM3.cjs} +14 -7
  42. package/dist/chunk-HWBLZSM3.cjs.map +1 -0
  43. package/dist/{chunk-AH6OQXLW.js → chunk-IKN54UGB.js} +3 -3
  44. package/dist/{chunk-AH6OQXLW.js.map → chunk-IKN54UGB.js.map} +1 -1
  45. package/dist/{chunk-UVUHVY7F.js → chunk-JCYTTTM2.js} +2 -2
  46. package/dist/{chunk-UVUHVY7F.js.map → chunk-JCYTTTM2.js.map} +1 -1
  47. package/dist/{chunk-QNPYYSLT.cjs → chunk-JEUZNHLL.cjs} +33 -33
  48. package/dist/{chunk-QNPYYSLT.cjs.map → chunk-JEUZNHLL.cjs.map} +1 -1
  49. package/dist/{chunk-TAPBDT47.js → chunk-JVYDKXGY.js} +4 -4
  50. package/dist/{chunk-TAPBDT47.js.map → chunk-JVYDKXGY.js.map} +1 -1
  51. package/dist/{chunk-YVQFYW2U.js → chunk-K3YGI5IW.js} +25 -4
  52. package/dist/chunk-K3YGI5IW.js.map +1 -0
  53. package/dist/{chunk-OEOOXL3F.js → chunk-KKFFQUMM.js} +5 -5
  54. package/dist/{chunk-OEOOXL3F.js.map → chunk-KKFFQUMM.js.map} +1 -1
  55. package/dist/{chunk-BDW25A7Y.js → chunk-LTBM2KMY.js} +20 -10
  56. package/dist/chunk-LTBM2KMY.js.map +1 -0
  57. package/dist/{chunk-AGIG5HUU.cjs → chunk-MZ772ZXA.cjs} +17 -17
  58. package/dist/{chunk-AGIG5HUU.cjs.map → chunk-MZ772ZXA.cjs.map} +1 -1
  59. package/dist/{chunk-G6AOKNAY.js → chunk-NS34PZ2S.js} +3 -3
  60. package/dist/{chunk-G6AOKNAY.js.map → chunk-NS34PZ2S.js.map} +1 -1
  61. package/dist/{chunk-6Q4BS6AR.js → chunk-NT3ZFUNJ.js} +31 -3
  62. package/dist/chunk-NT3ZFUNJ.js.map +1 -0
  63. package/dist/{chunk-DNWFFVC6.js → chunk-O53P2D4V.js} +3 -3
  64. package/dist/{chunk-DNWFFVC6.js.map → chunk-O53P2D4V.js.map} +1 -1
  65. package/dist/{chunk-5WHU7CYE.js → chunk-OW5AXH2Y.js} +51 -7
  66. package/dist/chunk-OW5AXH2Y.js.map +1 -0
  67. package/dist/{chunk-UJREE6EQ.cjs → chunk-OZHE77T3.cjs} +9 -9
  68. package/dist/{chunk-UJREE6EQ.cjs.map → chunk-OZHE77T3.cjs.map} +1 -1
  69. package/dist/{chunk-DE55SA2X.js → chunk-PKWRAMVB.js} +6 -6
  70. package/dist/{chunk-DE55SA2X.js.map → chunk-PKWRAMVB.js.map} +1 -1
  71. package/dist/{chunk-3OHRFSQL.cjs → chunk-POZBRZUM.cjs} +73 -60
  72. package/dist/chunk-POZBRZUM.cjs.map +1 -0
  73. package/dist/{chunk-TWUFC32F.cjs → chunk-PWIKUOLB.cjs} +8 -8
  74. package/dist/{chunk-TWUFC32F.cjs.map → chunk-PWIKUOLB.cjs.map} +1 -1
  75. package/dist/{chunk-3AB3YIFM.cjs → chunk-PYYYBINP.cjs} +6 -6
  76. package/dist/{chunk-3AB3YIFM.cjs.map → chunk-PYYYBINP.cjs.map} +1 -1
  77. package/dist/{chunk-6QJHSN6J.cjs → chunk-QCGSL4CJ.cjs} +4 -4
  78. package/dist/{chunk-6QJHSN6J.cjs.map → chunk-QCGSL4CJ.cjs.map} +1 -1
  79. package/dist/{chunk-7OSUEYZ4.js → chunk-QCVQVKCI.js} +3 -3
  80. package/dist/{chunk-7OSUEYZ4.js.map → chunk-QCVQVKCI.js.map} +1 -1
  81. package/dist/{chunk-7PC2YHBN.cjs → chunk-QCZYYAPZ.cjs} +48 -48
  82. package/dist/{chunk-7PC2YHBN.cjs.map → chunk-QCZYYAPZ.cjs.map} +1 -1
  83. package/dist/{chunk-4IMEJQVQ.cjs → chunk-QV32JI4L.cjs} +4 -4
  84. package/dist/{chunk-4IMEJQVQ.cjs.map → chunk-QV32JI4L.cjs.map} +1 -1
  85. package/dist/{chunk-YT4ZTJVC.js → chunk-QVAUBB2T.js} +11 -11
  86. package/dist/{chunk-YT4ZTJVC.js.map → chunk-QVAUBB2T.js.map} +1 -1
  87. package/dist/{chunk-FUYBUT65.js → chunk-R22UHRR6.js} +14 -7
  88. package/dist/chunk-R22UHRR6.js.map +1 -0
  89. package/dist/{chunk-KL6GAYTT.js → chunk-S6DXSQCV.js} +5 -3
  90. package/dist/chunk-S6DXSQCV.js.map +1 -0
  91. package/dist/{chunk-V24EPI5N.cjs → chunk-U4DIGIC3.cjs} +5 -3
  92. package/dist/chunk-U4DIGIC3.cjs.map +1 -0
  93. package/dist/{chunk-H5KHWTAE.js → chunk-UY6QZX7H.js} +4 -4
  94. package/dist/chunk-UY6QZX7H.js.map +1 -0
  95. package/dist/{chunk-PHQVAPSD.js → chunk-V6TC2NDG.js} +29 -17
  96. package/dist/chunk-V6TC2NDG.js.map +1 -0
  97. package/dist/{chunk-DBD4BCGH.cjs → chunk-VDFQKLDG.cjs} +33 -2
  98. package/dist/chunk-VDFQKLDG.cjs.map +1 -0
  99. package/dist/{chunk-MGSGLRHZ.cjs → chunk-WHV7MDNC.cjs} +70 -11
  100. package/dist/chunk-WHV7MDNC.cjs.map +1 -0
  101. package/dist/{chunk-5EQRIUGI.cjs → chunk-XBHDXURR.cjs} +78 -78
  102. package/dist/{chunk-5EQRIUGI.cjs.map → chunk-XBHDXURR.cjs.map} +1 -1
  103. package/dist/{chunk-TDU45K6Z.js → chunk-YLDY23N2.js} +5 -5
  104. package/dist/{chunk-TDU45K6Z.js.map → chunk-YLDY23N2.js.map} +1 -1
  105. package/dist/entries/apps.cjs +43 -43
  106. package/dist/entries/apps.js +8 -8
  107. package/dist/entries/credits.cjs +246 -238
  108. package/dist/entries/credits.d.cts +16 -1
  109. package/dist/entries/credits.d.ts +16 -1
  110. package/dist/entries/credits.js +11 -11
  111. package/dist/entries/llm-models.cjs +76 -72
  112. package/dist/entries/llm-models.d.cts +38 -4
  113. package/dist/entries/llm-models.d.ts +38 -4
  114. package/dist/entries/llm-models.js +2 -2
  115. package/dist/entries/media.cjs +87 -87
  116. package/dist/entries/media.js +1 -1
  117. package/dist/entries/model-catalog.cjs +133 -133
  118. package/dist/entries/model-catalog.js +4 -4
  119. package/dist/entries/models.cjs +431 -415
  120. package/dist/entries/models.d.cts +62 -27
  121. package/dist/entries/models.d.ts +62 -27
  122. package/dist/entries/models.js +7 -7
  123. package/dist/entries/nodes.cjs +215 -215
  124. package/dist/entries/nodes.js +11 -11
  125. package/dist/entries/pipeline.cjs +153 -153
  126. package/dist/entries/pipeline.js +3 -3
  127. package/dist/entries/social.cjs +237 -177
  128. package/dist/entries/social.d.cts +183 -6
  129. package/dist/entries/social.d.ts +183 -6
  130. package/dist/entries/social.js +2 -2
  131. package/dist/entries/ugc.cjs +71 -71
  132. package/dist/entries/ugc.js +4 -4
  133. package/dist/entries/video.cjs +153 -153
  134. package/dist/entries/video.js +7 -7
  135. package/dist/entries/workflow.cjs +152 -152
  136. package/dist/entries/workflow.js +4 -4
  137. package/dist/index.cjs +1959 -1871
  138. package/dist/index.d.cts +4 -4
  139. package/dist/index.d.ts +4 -4
  140. package/dist/index.js +26 -26
  141. package/package.json +1 -1
  142. package/src/__tests__/cast-swap-limits.test.ts +54 -20
  143. package/src/__tests__/competitors.test.ts +64 -0
  144. package/src/__tests__/lip-sync-pricing.test.ts +29 -2
  145. package/src/__tests__/llm-models.test.ts +50 -7
  146. package/src/__tests__/suno-separate.test.ts +32 -0
  147. package/src/cast-swap-limits.ts +43 -25
  148. package/src/competitors.ts +80 -8
  149. package/src/entries/credits.ts +2 -0
  150. package/src/entries/llm-models.ts +2 -0
  151. package/src/entries/models.ts +4 -0
  152. package/src/entries/social.ts +33 -0
  153. package/src/generated/unit-contracts.ts +1 -0
  154. package/src/lip-sync-pricing.ts +25 -0
  155. package/src/llm-models.ts +60 -4
  156. package/src/model-catalog.ts +12 -5
  157. package/src/node-runtime-keys.ts +2 -2
  158. package/src/suno-separate.ts +51 -0
  159. package/src/topics.ts +162 -0
  160. package/src/video-face-mesh.ts +1 -1
  161. package/dist/chunk-3OHRFSQL.cjs.map +0 -1
  162. package/dist/chunk-54E2JO4E.cjs.map +0 -1
  163. package/dist/chunk-5WHU7CYE.js.map +0 -1
  164. package/dist/chunk-6Q4BS6AR.js.map +0 -1
  165. package/dist/chunk-BDW25A7Y.js.map +0 -1
  166. package/dist/chunk-DBD4BCGH.cjs.map +0 -1
  167. package/dist/chunk-FUYBUT65.js.map +0 -1
  168. package/dist/chunk-H5KHWTAE.js.map +0 -1
  169. package/dist/chunk-KL6GAYTT.js.map +0 -1
  170. package/dist/chunk-KSHAAPQF.cjs.map +0 -1
  171. package/dist/chunk-MGSGLRHZ.cjs.map +0 -1
  172. package/dist/chunk-PHQVAPSD.js.map +0 -1
  173. package/dist/chunk-PLANUXQL.cjs.map +0 -1
  174. package/dist/chunk-V24EPI5N.cjs.map +0 -1
  175. package/dist/chunk-YVQFYW2U.js.map +0 -1
  176. package/dist/chunk-ZWEVRMFN.cjs.map +0 -1
@@ -46,6 +46,7 @@ import {
46
46
  LLM_REFERENCE_FILES_MAX_PAGES,
47
47
  LLM_REFERENCE_FILE_MIME_TYPES,
48
48
  llmAcceptsFiles,
49
+ llmFileWire,
49
50
  } from "../llm-models.js"
50
51
  import type { LlmModelDef, LlmTier, LlmFeature } from "../llm-models.js"
51
52
  import { PIPELINE_ACCEPTED_SCRIPT_LLMS, PIPELINE_LEGACY_PINNED_SCRIPT_LLMS, PIPELINE_PINNABLE_SCRIPT_LLMS, PipelineConfigSchema } from "../pipeline-types.js"
@@ -1203,9 +1204,17 @@ describe("gemini-4-hydrogen exposure", () => {
1203
1204
  expect(getLlmTier("gemini-4-hydrogen")).toBe("premium")
1204
1205
  })
1205
1206
 
1206
- it("reads images, video and audio on the LLM nodes (decided 2026-11-16; probed 2026-11-17) — no files", () => {
1207
- expect(getLlmModalityCaps("gemini-4-hydrogen")).toEqual({ image: true, video: true, audio: true })
1208
- expect(llmAcceptsFiles("gemini-4-hydrogen")).toBe(false)
1207
+ it("reads images, video, audio and PDF files on the LLM nodes (decided 2026-11-16 and 2026-11-17)", () => {
1208
+ expect(getLlmModalityCaps("gemini-4-hydrogen")).toEqual({ image: true, video: true, audio: true, file: true })
1209
+ expect(llmAcceptsFiles("gemini-4-hydrogen")).toBe(true)
1210
+ // The shape probed on its aggregator lane (2026-11-17), and an inline part on Google's own API.
1211
+ expect(llmFileWire("gemini-4-hydrogen")).toEqual({ kie: "image-url", direct: "inline-data" })
1212
+ })
1213
+
1214
+ it("the file cap enrols it in nothing outside the LLM nodes", () => {
1215
+ expect(VIDEO_ANALYSIS_LLM_MODELS).not.toContain("gemini-4-hydrogen")
1216
+ expect(readsVideoOutsideLlmNodes("gemini-4-hydrogen")).toBe(false)
1217
+ expect(readsAudioOutsideLlmNodes("gemini-4-hydrogen")).toBe(false)
1209
1218
  })
1210
1219
 
1211
1220
  it("its media caps are for the LLM nodes only: no Video Analysis list, tier, legacy row or passthrough", () => {
@@ -1283,10 +1292,11 @@ describe("gpt-6.1-terra exposure", () => {
1283
1292
  })
1284
1293
 
1285
1294
  describe("the `file` modality cap (documents, decided 2026-11-13)", () => {
1286
- it("is declared on GPT-6.1 Terra alone, and never derived for another model", () => {
1287
- expect(LLM_FILE_MODELS.map((m) => m.id)).toEqual(["gpt-6.1-terra"])
1288
- expect(Object.entries(LLM_MODALITY_CAPS).filter(([, c]) => c.file).map(([id]) => id)).toEqual(["gpt-6.1-terra"])
1289
- for (const m of LLM_MODELS) expect(llmAcceptsFiles(m.id), m.id).toBe(m.id === "gpt-6.1-terra")
1295
+ it("is declared on GPT-6.1 Terra and Gemini 4 Hydrogen, and never derived for another model", () => {
1296
+ const readers = ["gemini-4-hydrogen", "gpt-6.1-terra"]
1297
+ expect(LLM_FILE_MODELS.map((m) => m.id)).toEqual(readers)
1298
+ expect(Object.entries(LLM_MODALITY_CAPS).filter(([, c]) => c.file).map(([id]) => id).sort()).toEqual(readers)
1299
+ for (const m of LLM_MODELS) expect(llmAcceptsFiles(m.id), m.id).toBe(readers.includes(m.id))
1290
1300
  expect(llmAcceptsFiles(undefined)).toBe(false)
1291
1301
  expect(llmAcceptsFiles("no-such-model")).toBe(false)
1292
1302
  // Its siblings on the same endpoint do not read files here.
@@ -1294,6 +1304,39 @@ describe("the `file` modality cap (documents, decided 2026-11-13)", () => {
1294
1304
  expect(llmAcceptsFiles("gpt-5.6-terra")).toBe(false)
1295
1305
  })
1296
1306
 
1307
+ // Every declaration, by model. A shape is never derived from a model's
1308
+ // dialect: a new model gets a row here only with its own probe, whose date
1309
+ // goes on its registry entry.
1310
+ const FILE_WIRES: Record<string, unknown> = {
1311
+ // Probed 2026-11-13: an inline `input_file` part on the responses dialect.
1312
+ "gpt-6.1-terra": { kie: "input-file" },
1313
+ // Probed 2026-11-17 on both lanes: an `image_url` part on the aggregator's
1314
+ // chat-completions dialect, an inline part on Google's own API.
1315
+ "gemini-4-hydrogen": { kie: "image-url", direct: "inline-data" },
1316
+ }
1317
+
1318
+ it("a model reads files exactly when it is listed with how each of its lanes is sent one (`fileWire`)", () => {
1319
+ for (const m of LLM_MODELS) {
1320
+ expect(m.fileWire, m.id).toEqual(FILE_WIRES[m.id])
1321
+ expect(llmAcceptsFiles(m.id), m.id).toBe(m.id in FILE_WIRES)
1322
+ expect(llmFileWire(m.id), m.id).toEqual(FILE_WIRES[m.id])
1323
+ }
1324
+ expect(Object.keys(FILE_WIRES).sort()).toEqual(LLM_FILE_MODELS.map((m) => m.id).sort())
1325
+ // A sibling on the same dialect has no shape of its own.
1326
+ for (const id of ["gemini-4-carbon", "gemini-4-argon", "gemini-3.8-flash", "gpt-6.1-sol", "gpt-5.6-terra"]) expect(llmFileWire(id), id).toBeUndefined()
1327
+ expect(llmFileWire(undefined)).toBeUndefined()
1328
+ })
1329
+
1330
+ it("a declared shape fits the lanes its model has", () => {
1331
+ for (const m of LLM_FILE_MODELS) {
1332
+ // The aggregator's shape is one its dialect can carry.
1333
+ expect(m.kieFormat, m.id).toBe(m.fileWire!.kie === "input-file" ? "responses" : "chat-completions")
1334
+ // A direct Google lane is declared a shape, and only a model with one has it.
1335
+ expect(Boolean(m.fileWire!.direct), m.id).toBe(Boolean(m.directGeminiModel))
1336
+ expect(m.directFallbackModel, m.id).toBeUndefined()
1337
+ }
1338
+ })
1339
+
1297
1340
  it("PDF only, up to 5 files, 6 MB in all and 100 pages in all", () => {
1298
1341
  expect(LLM_REFERENCE_FILE_MIME_TYPES).toEqual(["application/pdf"])
1299
1342
  expect(LLM_REFERENCE_FILES_MAX).toBe(5)
@@ -10,6 +10,9 @@ import {
10
10
  sunoSeparateCreditId,
11
11
  sunoSeparateHandleUrl,
12
12
  sunoSeparatePrimaryUrl,
13
+ SUNO_SEPARATE_ID_FIELDS,
14
+ sunoSeparateHandleField,
15
+ sunoSeparateHandleIds,
13
16
  } from "../entries/models.js"
14
17
 
15
18
  describe("sunoSeparateCreditId", () => {
@@ -76,3 +79,32 @@ it("sunoSeparatePrimaryUrl", () => {
76
79
  expect(sunoSeparatePrimaryUrl({ isolatedUrl: "I", withoutUrl: "W" })).toBe("I")
77
80
  expect(sunoSeparatePrimaryUrl({ drumsUrl: "D" })).toBe("D")
78
81
  })
82
+
83
+ describe("sunoSeparateHandleIds — the Suno ids of the stem behind a handle", () => {
84
+ const out = {
85
+ sunoTaskId: "sep-task",
86
+ vocalUrl: "https://cdn/v.mp3",
87
+ instrumentalUrl: "https://cdn/i.mp3",
88
+ isolatedUrl: "https://cdn/x.mp3",
89
+ withoutUrl: "https://cdn/w.mp3",
90
+ sunoStemIds: { vocalUrl: "id-v", instrumentalUrl: "id-i", isolatedUrl: "id-x", withoutUrl: "id-w" },
91
+ }
92
+
93
+ it.each([
94
+ ["vocals", "id-v"], ["vocal-out", "id-v"], ["instrumental", "id-i"], ["instrumental-out", "id-i"],
95
+ ["isolated", "id-x"], ["without", "id-w"], [undefined, "id-v"],
96
+ ])("%s → %s", (handle, audioId) => {
97
+ expect(sunoSeparateHandleIds(out, handle)).toStrictEqual({ taskId: "sep-task", audioId })
98
+ })
99
+
100
+ it("no task id, no stem ids (a Demucs or cloud run, an older output), or no id for that stem: none", () => {
101
+ expect(sunoSeparateHandleIds({ ...out, sunoTaskId: undefined }, "vocals")).toBeUndefined()
102
+ expect(sunoSeparateHandleIds({ ...out, sunoStemIds: undefined }, "vocals")).toBeUndefined()
103
+ expect(sunoSeparateHandleIds({ ...out, sunoStemIds: { vocalUrl: "id-v" } }, "instrumental")).toBeUndefined()
104
+ })
105
+
106
+ it("the primary handle follows the primary stem", () => {
107
+ expect(sunoSeparateHandleField({ drumsUrl: "https://cdn/d.mp3" }, undefined)).toBe("drumsUrl")
108
+ expect(SUNO_SEPARATE_ID_FIELDS).toEqual(["sunoTaskId", "sunoStemIds"])
109
+ })
110
+ })
@@ -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,39 @@ 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
+ /** The most search terms any brand can have (the platform's own ceiling; a plan allows fewer). */
49
+ export const COMPETITOR_SEARCH_TERMS_MAX = 15
50
+ /** The longest a search term can be. */
51
+ export const COMPETITOR_SEARCH_TERM_MAX_LENGTH = 100
52
+ /** 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`). */
53
+ export const COMPETITOR_SCAN_PAGE_CREDIT_ID = "competitor-scan:per-page"
54
+
55
+ /**
56
+ * Search terms as the server keeps them: trimmed, inner whitespace collapsed,
57
+ * a one-word `#tag` or `@handle` without its trailing punctuation (`#tag!` →
58
+ * `#tag`), empty ones dropped, deduplicated without regard to case (the first
59
+ * spelling wins). Lengths, the count and a term with no letter or digit are
60
+ * the server's to refuse, not this function's to cut.
61
+ */
62
+ export function normalizeSearchTerms(terms: readonly string[]): string[] {
63
+ const seen = new Set<string>()
64
+ const out: string[] = []
65
+ for (const raw of terms) {
66
+ const spaced = raw.trim().replace(/\s+/g, " ")
67
+ // Combining marks (\p{M}) are part of a word: Hindi and Thai vowel signs are not punctuation.
68
+ const stripped = /^[#@]\S+$/.test(spaced) ? spaced.replace(/[^\p{L}\p{M}\p{N}_]+$/u, "") : spaced
69
+ // A tag with no word left ("#!") stays as sent, for the server to refuse with its reason.
70
+ const term = /[\p{L}\p{N}]/u.test(stripped) ? stripped : spaced
71
+ const key = term.toLowerCase()
72
+ if (term === "" || seen.has(key)) continue
73
+ seen.add(key)
74
+ out.push(term)
75
+ }
76
+ return out
44
77
  }
45
78
 
46
79
  export interface TrackedCompetitor {
@@ -59,10 +92,18 @@ export interface TrackedCompetitor {
59
92
  readonly lastScanError: string | null
60
93
  /** A scan is running now. */
61
94
  readonly scanning: boolean
62
- /** Searches one scan runs; a scan costs this many Social Search pages. */
95
+ /** Searches one scan runs. */
63
96
  readonly searches: number
64
97
  /** What the next scan searches. Absent from a server older than this field. */
65
98
  readonly searchPlan?: readonly CompetitorSearch[]
99
+ /**
100
+ * Phrases or #hashtags the searches for posts about the brand use instead
101
+ * of its name, and that a post must name to count as about it. Empty: the
102
+ * name. Absent from an older server.
103
+ */
104
+ readonly searchTerms?: readonly string[]
105
+ /** Social Search pages one scan runs: the scan costs this many pages. Absent from an older server (one page per search). */
106
+ readonly pages?: number
66
107
  readonly createdAt: string
67
108
  readonly updatedAt: string
68
109
  }
@@ -169,6 +210,14 @@ export interface CompetitorListResult {
169
210
  readonly data: readonly TrackedCompetitor[]
170
211
  /** How many months of scans your plan keeps (older scans are deleted at a brand's next scan). Absent from an older server. */
171
212
  readonly historyMonths?: number
213
+ /** Your plan's caps; null = no cap. Absent from an older server. */
214
+ readonly limits?: CompetitorLimits
215
+ }
216
+
217
+ /** What a plan allows a person on the Competitors page. */
218
+ export interface CompetitorLimits {
219
+ /** Search terms per brand; 0 = the name only; null = no cap. */
220
+ readonly searchTerms: number | null
172
221
  }
173
222
 
174
223
  /** One platform as one scan found and read it. Numbers a scan stored before they were kept answer null. */
@@ -514,18 +563,41 @@ export type CreateCompetitorInput = {
514
563
  readonly isOwn?: boolean
515
564
  /** Default weekly. */
516
565
  readonly schedule?: CompetitorSchedule
566
+ /** Phrases or #hashtags to search instead of the name (see `TrackedCompetitor.searchTerms`); the plan caps how many. */
567
+ readonly searchTerms?: readonly string[]
517
568
  }
518
569
 
519
570
  export type UpdateCompetitorInput = Partial<CreateCompetitorInput>
520
571
 
521
- /** Searches a scan of this configuration runs. */
522
- export function competitorScanSearches(c: { readonly accounts?: CompetitorAccounts; readonly aboutPlatforms?: readonly string[] }): number {
572
+ /**
573
+ * Searches a scan of this configuration runs: one per account, and one per
574
+ * about-platform per term (the name counts as the one term when there are
575
+ * none). `termCap` is the plan's cap (null = none): a scan searches only the
576
+ * first terms the plan allows.
577
+ */
578
+ export function competitorScanSearches(c: {
579
+ readonly accounts?: CompetitorAccounts
580
+ readonly aboutPlatforms?: readonly string[]
581
+ readonly searchTerms?: readonly string[]
582
+ readonly termCap?: number | null
583
+ }): number {
523
584
  const accounts = COMPETITOR_ACCOUNT_KEYS.filter((k) => (c.accounts?.[k] ?? "").trim() !== "").length
524
585
  const about = (c.aboutPlatforms ?? []).filter((p) => (COMPETITOR_ABOUT_PLATFORMS as readonly string[]).includes(p)).length
525
- return accounts + about
586
+ const terms = normalizeSearchTerms(c.searchTerms ?? [])
587
+ const cap = c.termCap === undefined || c.termCap === null ? COMPETITOR_SEARCH_TERMS_MAX : c.termCap
588
+ const used = Math.min(terms.length, cap)
589
+ return accounts + about * Math.max(1, used)
526
590
  }
527
591
 
528
- /** The credit id of a scan of `n` searches. */
592
+ /** Social Search pages a brand scan runs: every brand search reads one page. */
593
+ export function competitorScanPages(c: Parameters<typeof competitorScanSearches>[0]): number {
594
+ return competitorScanSearches(c)
595
+ }
596
+
597
+ /**
598
+ * The credit id of a scan of `n` searches.
599
+ * @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.
600
+ */
529
601
  export function competitorScanCreditId(n: number): string {
530
602
  const clamped = Math.min(Math.max(Math.round(n), 1), COMPETITOR_SCAN_MAX_SEARCHES)
531
603
  return `${COMPETITOR_SCAN_NODE_TYPE}:${clamped}`
@@ -536,9 +608,9 @@ export const COMPETITOR_SCAN_CREDIT_COSTS: Readonly<Record<string, number>> = Ob
536
608
  Array.from({ length: COMPETITOR_SCAN_MAX_SEARCHES }, (_, i) => [competitorScanCreditId(i + 1), (i + 1) * SOCIAL_SEARCH_CREDITS_PER_PAGE] as const),
537
609
  )
538
610
 
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
611
+ /** The credits a scan of this many pages costs, before the live price table loads (the base price of a page × pages). */
612
+ export function competitorScanCredits(pages: number): number {
613
+ return !Number.isFinite(pages) || pages <= 0 ? 0 : Math.round(pages) * SOCIAL_SEARCH_CREDITS_PER_PAGE
542
614
  }
543
615
 
544
616
  /** Whether a platform is one the about-search covers (used by pickers). */
@@ -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,
@@ -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,12 @@ export {
229
229
  ACTION_CARD_KINDS,
230
230
  BRAND_LESSON_KINDS,
231
231
  COMPETITOR_SCAN_CREDIT_COSTS,
232
+ COMPETITOR_SEARCH_TERMS_MAX,
233
+ COMPETITOR_SEARCH_TERM_MAX_LENGTH,
234
+ COMPETITOR_SCAN_PAGE_CREDIT_ID,
235
+ normalizeSearchTerms,
232
236
  competitorScanSearches,
237
+ competitorScanPages,
233
238
  competitorScanCreditId,
234
239
  competitorScanCredits,
235
240
  isCompetitorAboutPlatform,
@@ -266,6 +271,7 @@ export {
266
271
  type CompetitorScan,
267
272
  type CompetitorDetail,
268
273
  type CompetitorListResult,
274
+ type CompetitorLimits,
269
275
  type CompetitorHistory,
270
276
  type CompetitorHistoryPoint,
271
277
  type CompetitorHistoryPlatform,
@@ -284,6 +290,33 @@ export {
284
290
  type CreateCompetitorInput,
285
291
  type UpdateCompetitorInput,
286
292
  } from "../competitors.js"
293
+ export {
294
+ TOPIC_PLATFORMS,
295
+ TOPIC_DEFAULT_PLATFORMS,
296
+ TOPIC_POST_COUNTS,
297
+ TOPIC_SCAN_NODE_TYPE,
298
+ TOPIC_SCAN_PAGE_CREDIT_ID,
299
+ TOPICS_MAX,
300
+ SCAN_PAGE_CREDIT_COSTS,
301
+ topicScanPages,
302
+ topicScanCredits,
303
+ isTopicPlatform,
304
+ type TopicPlatform,
305
+ type TopicPostCount,
306
+ type TrackedTopic,
307
+ type TopicLimits,
308
+ type TopicListResult,
309
+ type CreateTopicInput,
310
+ type UpdateTopicInput,
311
+ type TopicScanCounts,
312
+ type TopicScan,
313
+ type TopicScanSummary,
314
+ type TopicDetail,
315
+ type TopicHistoryPlatform,
316
+ type TopicHistoryPoint,
317
+ type TopicHistory,
318
+ type TopicCardsResult,
319
+ } from "../topics.js"
287
320
  export {
288
321
  PLATFORM_SPECS,
289
322
  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
  *