@nodaro/shared 3.8.0 → 3.9.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.
@@ -119,10 +119,10 @@ export const VIDEO_PROMPT_MAX = 8000
119
119
 
120
120
  /**
121
121
  * Suno prompt / lyrics / content ceiling — the LARGEST any Suno version accepts
122
- * in custom mode (V4.5 / V4.5PLUS / V4.5ALL / V5 / V5.5 = 5000). NOT the route
122
+ * in custom mode (V6 family and V4.5+ / V5 / V5.5 = 5000). NOT the route
123
123
  * Zod bound — the routes bind at {@link SUNO_HARD_CEILING} and clamp to the
124
124
  * per-version cap via {@link getMaxSunoPromptChars} (3000 non-custom for every
125
- * version; in custom mode 3000 for V4/V3.5, 5000 for V4.5+/V5) before the job
125
+ * version; in custom mode 3000 for V4/V3.5, 5000 for V4.5+/V5/V6) before the job
126
126
  * is built. This constant is shared with the editor `maxLength` / counter
127
127
  * (warn-don't-block at the per-version cap). `style` and `title` have their
128
128
  * own caps ({@link getMaxSunoStyleChars} / {@link SUNO_TITLE_MAX}).
@@ -310,9 +310,11 @@ export function getMaxTtsChars(provider: string | undefined): number {
310
310
  * SUNO_TEXT_MAX} is 5000 today — the largest per-version prompt cap; the
311
311
  * route Zod bound is {@link SUNO_HARD_CEILING}.)
312
312
  * - prompt / lyrics: 3000 in non-custom mode (all versions); in custom mode
313
- * 3000 for V4/V3.5 and 5000 for V4.5 / V4.5PLUS / V4.5ALL / V5 / V5.5.
314
- * - style: 200 for V4/V3.5, 1000 for V4.5+.
315
- * - title: 80 (all versions).
313
+ * 3000 for V4/V3.5 and 5000 for V4.5 / V4.5PLUS / V4.5ALL / V5 / V5.5 and
314
+ * the whole V6 family (V6 / V6_WILD / V6_MINI).
315
+ * - style: 200 for V4/V3.5, 1000 for V4.5+ and V6.
316
+ * - title: 80 (all versions; the extend docs quote 100 for V6 — we keep the
317
+ * stricter generate cap so one value is right everywhere).
316
318
  */
317
319
  export const SUNO_TITLE_MAX = 80
318
320
 
@@ -1229,19 +1231,72 @@ export const QA_CHECK_PROVIDERS = [
1229
1231
  ] as const
1230
1232
  export type QaCheckProvider = typeof QA_CHECK_PROVIDERS[number]
1231
1233
 
1232
- /** Suno model versions */
1233
- export const SUNO_MODELS = [
1234
- "V4",
1235
- "V4_5",
1234
+ /**
1235
+ * The current Suno generation (docs.kie.ai/suno-api/generate-music, 2026-09:
1236
+ * the V6 family), listed first in every picker; V6 is the default.
1237
+ *
1238
+ * - V6 — flagship: greater musical expression, more natural vocals, richer details.
1239
+ * - V6_WILD — bolder, more distinctive, less predictable output for exploration.
1240
+ * - V6_MINI — lightweight and fast; quality/speed balance.
1241
+ *
1242
+ * This is also the set that honours `duration` ({@link SUNO_DURATION_MODELS}).
1243
+ */
1244
+ export const SUNO_ACTIVE_MODELS = ["V6", "V6_WILD", "V6_MINI"] as const
1245
+ export type SunoActiveModel = typeof SUNO_ACTIVE_MODELS[number]
1246
+
1247
+ /**
1248
+ * The earlier Suno generations. Still offered in every picker as ordinary
1249
+ * choices (users report each has its own character), still accepted by every
1250
+ * route, and confirmed generating on 2026-09-11. KIE's docs tag them
1251
+ * "Discontinued"; if KIE ever stops serving one, coerce it to
1252
+ * {@link DEFAULT_SUNO_MODEL} at the provider send seam — never remove it from
1253
+ * {@link SUNO_MODELS}, which would 400 every saved music workflow.
1254
+ */
1255
+ export const SUNO_LEGACY_MODELS = [
1256
+ "V5_5",
1257
+ "V5",
1236
1258
  "V4_5PLUS",
1237
1259
  "V4_5ALL",
1238
- "V5",
1239
- "V5_5",
1260
+ "V4_5",
1261
+ "V4",
1240
1262
  ] as const
1263
+ export type SunoLegacyModel = typeof SUNO_LEGACY_MODELS[number]
1264
+
1265
+ /**
1266
+ * Every Suno model version — the picker order, the route / MCP Zod enum and
1267
+ * the `data.model` type on Suno nodes. Current generation first (V6 = default),
1268
+ * then the earlier generations newest-first.
1269
+ */
1270
+ export const SUNO_MODELS = [...SUNO_ACTIVE_MODELS, ...SUNO_LEGACY_MODELS] as const
1241
1271
  export type SunoModel = typeof SUNO_MODELS[number]
1242
1272
 
1243
- /** Suno models that support add-instrumental / add-vocals operations */
1244
- export const SUNO_ADD_TRACK_MODELS = ["V4_5PLUS", "V5", "V5_5"] as const
1273
+ /** The Suno version used when a caller omits `model` — KIE's own default. */
1274
+ export const DEFAULT_SUNO_MODEL = "V6" satisfies SunoActiveModel
1275
+
1276
+ export function isLegacySunoModel(model: string | undefined): model is SunoLegacyModel {
1277
+ return (SUNO_LEGACY_MODELS as readonly string[]).includes(model ?? "")
1278
+ }
1279
+
1280
+ /**
1281
+ * Suno versions that HONOUR `duration` (custom mode only). Per the generate /
1282
+ * extend docs the field "will only take effect when the model is V6, V6_MINI,
1283
+ * or V6_WILD" — V5_5 was struck from that sentence when V6 shipped. The
1284
+ * provider client's send-gate (`sunoGenerate` in suno-client.ts) is the single
1285
+ * chokepoint that consults this set; the editor uses it only to decide whether
1286
+ * to SHOW the duration field.
1287
+ */
1288
+ export const SUNO_DURATION_MODELS: ReadonlySet<string> = new Set<SunoModel>(SUNO_ACTIVE_MODELS)
1289
+
1290
+ export function sunoModelHonoursDuration(model: string | undefined): boolean {
1291
+ return SUNO_DURATION_MODELS.has(model ?? "")
1292
+ }
1293
+
1294
+ /**
1295
+ * Suno models accepted by add-instrumental / add-vocals (docs enum: the V6
1296
+ * family plus V4_5PLUS / V5 / V5_5). Same current-then-earlier order as
1297
+ * {@link SUNO_MODELS}.
1298
+ */
1299
+ export const SUNO_ADD_TRACK_MODELS = [...SUNO_ACTIVE_MODELS, "V4_5PLUS", "V5", "V5_5"] as const
1245
1300
  export type SunoAddTrackModel = typeof SUNO_ADD_TRACK_MODELS[number]
1246
1301
 
1247
1302
  /** Voice design models */