@nodaro/shared 3.39.0 → 3.41.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 (147) hide show
  1. package/dist/{chunk-5OED47LE.js → chunk-2BJADMEX.js} +3 -3
  2. package/dist/{chunk-5OED47LE.js.map → chunk-2BJADMEX.js.map} +1 -1
  3. package/dist/{chunk-YNJ44IAL.cjs → chunk-4IWVZR44.cjs} +5 -5
  4. package/dist/{chunk-YNJ44IAL.cjs.map → chunk-4IWVZR44.cjs.map} +1 -1
  5. package/dist/{chunk-33QG2DOW.cjs → chunk-4LKEOIOT.cjs} +6 -6
  6. package/dist/{chunk-33QG2DOW.cjs.map → chunk-4LKEOIOT.cjs.map} +1 -1
  7. package/dist/{chunk-ZG4XSEZV.js → chunk-5CKTBGB6.js} +71 -2
  8. package/dist/chunk-5CKTBGB6.js.map +1 -0
  9. package/dist/{chunk-BDSFMY4X.js → chunk-5J5L26IZ.js} +5 -5
  10. package/dist/{chunk-BDSFMY4X.js.map → chunk-5J5L26IZ.js.map} +1 -1
  11. package/dist/{chunk-VRLRPGO7.js → chunk-A4NDZBSJ.js} +93 -11
  12. package/dist/chunk-A4NDZBSJ.js.map +1 -0
  13. package/dist/{chunk-KOP7UTQR.cjs → chunk-ADYPAGQF.cjs} +71 -2
  14. package/dist/chunk-ADYPAGQF.cjs.map +1 -0
  15. package/dist/{chunk-HABDAHZR.cjs → chunk-BOUEGYGI.cjs} +118 -28
  16. package/dist/chunk-BOUEGYGI.cjs.map +1 -0
  17. package/dist/{chunk-JLKZEKQ3.cjs → chunk-BWQRAQUD.cjs} +43 -43
  18. package/dist/{chunk-JLKZEKQ3.cjs.map → chunk-BWQRAQUD.cjs.map} +1 -1
  19. package/dist/{chunk-KMNSK7T5.js → chunk-CWQC6IGE.js} +20 -5
  20. package/dist/chunk-CWQC6IGE.js.map +1 -0
  21. package/dist/{chunk-XUISP5BT.cjs → chunk-DC5EYYVX.cjs} +60 -38
  22. package/dist/chunk-DC5EYYVX.cjs.map +1 -0
  23. package/dist/{chunk-MSIIC6MY.cjs → chunk-DJIRIBKX.cjs} +4 -4
  24. package/dist/{chunk-MSIIC6MY.cjs.map → chunk-DJIRIBKX.cjs.map} +1 -1
  25. package/dist/{chunk-XA53RUSD.js → chunk-E4MLBJKG.js} +8 -8
  26. package/dist/{chunk-XA53RUSD.js.map → chunk-E4MLBJKG.js.map} +1 -1
  27. package/dist/chunk-FVZMFDRO.js +23 -0
  28. package/dist/chunk-FVZMFDRO.js.map +1 -0
  29. package/dist/{chunk-DKTRVOU5.js → chunk-GNY2S63W.js} +4 -4
  30. package/dist/{chunk-DKTRVOU5.js.map → chunk-GNY2S63W.js.map} +1 -1
  31. package/dist/{chunk-YHCG3HOR.js → chunk-GXTWKAJF.js} +3 -3
  32. package/dist/{chunk-YHCG3HOR.js.map → chunk-GXTWKAJF.js.map} +1 -1
  33. package/dist/{chunk-DE3PEIIP.cjs → chunk-IKCFSNNH.cjs} +21 -21
  34. package/dist/{chunk-DE3PEIIP.cjs.map → chunk-IKCFSNNH.cjs.map} +1 -1
  35. package/dist/{chunk-BYP62B7F.cjs → chunk-JN3V33AN.cjs} +6 -6
  36. package/dist/{chunk-BYP62B7F.cjs.map → chunk-JN3V33AN.cjs.map} +1 -1
  37. package/dist/{chunk-QXTCIJP5.js → chunk-LOTL72UI.js} +3 -3
  38. package/dist/{chunk-QXTCIJP5.js.map → chunk-LOTL72UI.js.map} +1 -1
  39. package/dist/{chunk-7QITUDRT.js → chunk-MLB6YNLS.js} +4 -4
  40. package/dist/{chunk-7QITUDRT.js.map → chunk-MLB6YNLS.js.map} +1 -1
  41. package/dist/{chunk-JABZNRXL.cjs → chunk-N2KG5AMQ.cjs} +4 -4
  42. package/dist/{chunk-JABZNRXL.cjs.map → chunk-N2KG5AMQ.cjs.map} +1 -1
  43. package/dist/{chunk-GLON7ANZ.cjs → chunk-P4QT7JGD.cjs} +7 -2
  44. package/dist/chunk-P4QT7JGD.cjs.map +1 -0
  45. package/dist/{chunk-IIGKJYWL.js → chunk-PYDZ7ZGH.js} +3 -3
  46. package/dist/{chunk-IIGKJYWL.js.map → chunk-PYDZ7ZGH.js.map} +1 -1
  47. package/dist/{chunk-ENFBA33M.cjs → chunk-RLVZ3RLE.cjs} +8 -8
  48. package/dist/{chunk-ENFBA33M.cjs.map → chunk-RLVZ3RLE.cjs.map} +1 -1
  49. package/dist/{chunk-JMUHMLJP.js → chunk-SYUY7GNT.js} +7 -5
  50. package/dist/chunk-SYUY7GNT.js.map +1 -0
  51. package/dist/{chunk-R6B2UDFR.js → chunk-T4EBNTKT.js} +7 -2
  52. package/dist/chunk-T4EBNTKT.js.map +1 -0
  53. package/dist/{chunk-VRUN5TG2.cjs → chunk-TUUEQ2WR.cjs} +8 -8
  54. package/dist/{chunk-VRUN5TG2.cjs.map → chunk-TUUEQ2WR.cjs.map} +1 -1
  55. package/dist/{chunk-HZ46RDLD.cjs → chunk-VNC5DNIQ.cjs} +11 -11
  56. package/dist/{chunk-HZ46RDLD.cjs.map → chunk-VNC5DNIQ.cjs.map} +1 -1
  57. package/dist/{chunk-MSDECC3A.cjs → chunk-VSDJCJKP.cjs} +44 -42
  58. package/dist/chunk-VSDJCJKP.cjs.map +1 -0
  59. package/dist/{chunk-GW54ANCH.js → chunk-X7IRSO4L.js} +3 -3
  60. package/dist/{chunk-GW54ANCH.js.map → chunk-X7IRSO4L.js.map} +1 -1
  61. package/dist/chunk-XOZIHGR5.cjs +27 -0
  62. package/dist/chunk-XOZIHGR5.cjs.map +1 -0
  63. package/dist/{chunk-YSEM7JDE.cjs → chunk-YEET2QGF.cjs} +4 -4
  64. package/dist/{chunk-YSEM7JDE.cjs.map → chunk-YEET2QGF.cjs.map} +1 -1
  65. package/dist/{chunk-CMH2ACOX.js → chunk-YEZ2YUKK.js} +3 -3
  66. package/dist/{chunk-CMH2ACOX.js.map → chunk-YEZ2YUKK.js.map} +1 -1
  67. package/dist/{chunk-SPP6HQMM.js → chunk-YX5FW7ON.js} +39 -5
  68. package/dist/chunk-YX5FW7ON.js.map +1 -0
  69. package/dist/{chunk-75ZMA34U.cjs → chunk-ZAOBNW6Y.cjs} +47 -11
  70. package/dist/chunk-ZAOBNW6Y.cjs.map +1 -0
  71. package/dist/{chunk-AZBIXGM5.js → chunk-ZXIP5T5V.js} +3 -3
  72. package/dist/{chunk-AZBIXGM5.js.map → chunk-ZXIP5T5V.js.map} +1 -1
  73. package/dist/entries/apps.cjs +42 -42
  74. package/dist/entries/apps.js +7 -7
  75. package/dist/entries/credits.cjs +150 -150
  76. package/dist/entries/credits.d.cts +1 -1
  77. package/dist/entries/credits.d.ts +1 -1
  78. package/dist/entries/credits.js +7 -7
  79. package/dist/entries/llm-models.d.cts +1 -1
  80. package/dist/entries/llm-models.d.ts +1 -1
  81. package/dist/entries/model-catalog.cjs +66 -66
  82. package/dist/entries/model-catalog.d.cts +2 -2
  83. package/dist/entries/model-catalog.d.ts +2 -2
  84. package/dist/entries/model-catalog.js +4 -4
  85. package/dist/entries/models.cjs +289 -229
  86. package/dist/entries/models.d.cts +39 -4
  87. package/dist/entries/models.d.ts +39 -4
  88. package/dist/entries/models.js +4 -4
  89. package/dist/entries/nodes.cjs +206 -206
  90. package/dist/entries/nodes.d.cts +1 -1
  91. package/dist/entries/nodes.d.ts +1 -1
  92. package/dist/entries/nodes.js +8 -8
  93. package/dist/entries/pipeline.cjs +149 -149
  94. package/dist/entries/pipeline.d.cts +1 -1
  95. package/dist/entries/pipeline.d.ts +1 -1
  96. package/dist/entries/pipeline.js +3 -3
  97. package/dist/entries/types.d.cts +8 -0
  98. package/dist/entries/types.d.ts +8 -0
  99. package/dist/entries/ugc.cjs +71 -71
  100. package/dist/entries/ugc.js +4 -4
  101. package/dist/entries/video.cjs +123 -115
  102. package/dist/entries/video.d.cts +26 -1
  103. package/dist/entries/video.d.ts +26 -1
  104. package/dist/entries/video.js +4 -4
  105. package/dist/entries/workflow.cjs +98 -98
  106. package/dist/entries/workflow.js +1 -1
  107. package/dist/index.cjs +1170 -1102
  108. package/dist/index.d.cts +4 -4
  109. package/dist/index.d.ts +4 -4
  110. package/dist/index.js +18 -18
  111. package/dist/{model-catalog-I48SvalA.d.ts → model-catalog-dQPdLltX.d.cts} +11 -0
  112. package/dist/{model-catalog-I48SvalA.d.cts → model-catalog-dQPdLltX.d.ts} +11 -0
  113. package/dist/{model-constants-C43YS07I.d.ts → model-constants-B5ka4TQr.d.cts} +61 -6
  114. package/dist/{model-constants-C43YS07I.d.cts → model-constants-B5ka4TQr.d.ts} +61 -6
  115. package/package.json +1 -1
  116. package/src/__tests__/cast-swap-limits.test.ts +27 -0
  117. package/src/__tests__/gvp-supported-providers.test.ts +8 -1
  118. package/src/__tests__/kling4-catalog.test.ts +129 -0
  119. package/src/__tests__/video-character-refs.test.ts +3 -2
  120. package/src/__tests__/workflow-export-strip.test.ts +14 -0
  121. package/src/cast-swap-limits.ts +46 -0
  122. package/src/catalog-projection.ts +8 -0
  123. package/src/credit-identifiers.ts +6 -0
  124. package/src/entries/models.ts +16 -0
  125. package/src/entries/video.ts +2 -0
  126. package/src/model-catalog.ts +82 -0
  127. package/src/model-constants.ts +151 -3
  128. package/src/node-default-mappings.ts +3 -0
  129. package/src/video-character-refs.ts +67 -0
  130. package/src/video-ui-defaults.ts +8 -5
  131. package/src/workflow-export.ts +7 -0
  132. package/dist/chunk-75ZMA34U.cjs.map +0 -1
  133. package/dist/chunk-GLON7ANZ.cjs.map +0 -1
  134. package/dist/chunk-HABDAHZR.cjs.map +0 -1
  135. package/dist/chunk-JMUHMLJP.js.map +0 -1
  136. package/dist/chunk-KMNSK7T5.js.map +0 -1
  137. package/dist/chunk-KOP7UTQR.cjs.map +0 -1
  138. package/dist/chunk-MSDECC3A.cjs.map +0 -1
  139. package/dist/chunk-R6B2UDFR.js.map +0 -1
  140. package/dist/chunk-SPP6HQMM.js.map +0 -1
  141. package/dist/chunk-VRLRPGO7.js.map +0 -1
  142. package/dist/chunk-W4GABGRD.js +0 -21
  143. package/dist/chunk-W4GABGRD.js.map +0 -1
  144. package/dist/chunk-XJ3HJSO5.cjs +0 -25
  145. package/dist/chunk-XJ3HJSO5.cjs.map +0 -1
  146. package/dist/chunk-XUISP5BT.cjs.map +0 -1
  147. package/dist/chunk-ZG4XSEZV.js.map +0 -1
@@ -352,13 +352,13 @@ type ImageGenProvider = typeof IMAGE_GEN_PROVIDERS[number];
352
352
  type ImageI2IProvider = typeof IMAGE_I2I_PROVIDERS[number];
353
353
  type ImageEditProvider = typeof IMAGE_EDIT_PROVIDERS[number];
354
354
  /** Image-to-video providers */
355
- declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5"];
355
+ declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5"];
356
356
  type ImageToVideoProvider = typeof IMAGE_TO_VIDEO_PROVIDERS[number];
357
357
  /** Text-to-video providers */
358
- declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v", "vidu-q4"];
358
+ declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v", "vidu-q4"];
359
359
  type TextToVideoProvider = typeof TEXT_TO_VIDEO_PROVIDERS[number];
360
360
  /** Unified video-generation providers (image-to-video ∪ text-to-video) for the generate-video node. */
361
- declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "vidu-q4" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
361
+ declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "kling-4" | "kling-4-keyframes" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "vidu-q4" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
362
362
  type VideoGenProvider = typeof VIDEO_GEN_PROVIDERS[number];
363
363
  /**
364
364
  * Video models that expose DISTINCT provider ids per mode (text-to-video vs
@@ -434,8 +434,9 @@ declare function videoProviderReferenceSyntax(provider: string | undefined): Vid
434
434
  /**
435
435
  * Reference-capable video models whose start/end frames ride a channel of
436
436
  * their OWN (separate frame parameters next to the reference list), so a frame
437
- * never occupies a reference seat. `kling-3-omni` (Replicate `start_image` /
438
- * `end_image`) is the only one — and it has no dispatch path today.
437
+ * never occupies a reference seat: `kling-3-omni` (Replicate `start_image` /
438
+ * `end_image`, no dispatch path today) and Kling 4.0 Keyframes (KIE
439
+ * `first_frame_url` / `last_frame_url` beside its in-between `keyframe_urls`).
439
440
  */
440
441
  declare const VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL: ReadonlySet<string>;
441
442
  /**
@@ -854,6 +855,34 @@ declare const VIDU_Q4_DEFAULT_RESOLUTION = "720p";
854
855
  * never disagree.
855
856
  */
856
857
  declare function normalizeViduQ4Resolution(resolution: string | undefined): "540p" | "720p" | "1080p" | "2k" | "4k";
858
+ /**
859
+ * Kling 4.0 family — two Nodaro ids over KIE's two Kling 4.0 endpoints:
860
+ * `kling-4` → `kling-4.0/reference-to-video`, `kling-4-keyframes` →
861
+ * `kling-4.0/keyframe-to-video`. Exact-membership set.
862
+ */
863
+ declare const KLING_4_PROVIDERS: Set<string>;
864
+ declare function isKling4Provider(provider: string | undefined): provider is "kling-4" | "kling-4-keyframes";
865
+ /** Kling 4.0 resolution rendered when the param is omitted or unknown — KIE's
866
+ * own default and the tier the bare credit identifier prices. */
867
+ declare const KLING_4_DEFAULT_RESOLUTION = "720p";
868
+ /**
869
+ * SINGLE normalization for the Kling 4.0 resolution lever. The KIE wire enum is
870
+ * lowercase ("720p" | "1080p"), the same spelling as the catalog and the credit
871
+ * identifiers; this folds case and collapses anything else to
872
+ * {@link KLING_4_DEFAULT_RESOLUTION}. The runner sends what this returns and
873
+ * the credit identifier bills what this returns.
874
+ */
875
+ declare function normalizeKling4Resolution(resolution: string | undefined): "720p" | "1080p";
876
+ /** Most in-between frames Kling 4.0 Keyframes takes (`keyframe_urls`). */
877
+ declare const KLING_4_MAX_MIDDLE_FRAMES = 8;
878
+ /**
879
+ * How many frames IN ALL (start + in-between + end) Kling 4.0 Keyframes
880
+ * accepts for a clip of `durationSec` seconds — KIE's own table
881
+ * (docs.kie.ai/market/kling/v4-keyframe-to-video): 3s → 4, 4s → 5 … 8s → 9,
882
+ * 9s or longer → 10. Live-verified 2026-10-23: 5 frames at 3s is a 422
883
+ * "duration 3s allows at most 4 frames (first + keyframes + last), got 5".
884
+ */
885
+ declare function kling4KeyframeFrameCap(durationSec: number | string | undefined): number;
857
886
  /**
858
887
  * Google Gemini Omni family — the KIE "gemini-omni-video" market model and its
859
888
  * faster/cheaper "google/gemini-omni-flash-1-1" sibling. Both take the SAME
@@ -1137,6 +1166,14 @@ declare const VIDEO_REF_LIMITS_BY_PROVIDER: Record<string, {
1137
1166
  audio?: number;
1138
1167
  characters?: number;
1139
1168
  voices?: number;
1169
+ /**
1170
+ * Cap on ALL materials together (images + videos + characters + audio),
1171
+ * when the provider counts them as one budget (Kling 4.0: 15). Absent ⇒
1172
+ * no combined cap beyond the per-kind ones — and, for a model declaring
1173
+ * `characters`, the Gemini Omni input-unit budget applies instead
1174
+ * (`videoCharacterRefProblem`).
1175
+ */
1176
+ materials?: number;
1140
1177
  } | undefined>;
1141
1178
  /** Per-reference-video duration bounds, in seconds. */
1142
1179
  interface RefVideoDurationLimit {
@@ -1185,6 +1222,24 @@ declare function checkRefVideoDurations(provider: string, durationsSec: readonly
1185
1222
  ok: false;
1186
1223
  message: string;
1187
1224
  };
1225
+ /**
1226
+ * Members of RESOLUTION_DURATION_PRICING that bill a run carrying a reference
1227
+ * VIDEO at a different per-second rate: their identifier gains a `-ref` suffix
1228
+ * after the resolution (`kling-4:8s:720p-ref`). The rate is per second of the
1229
+ * BILLED duration, which the reference-video billing rule
1230
+ * (backend ee/billing/ref-video-billing.ts) computes from the probed clips.
1231
+ */
1232
+ declare const VIDEO_REF_RATE_PROVIDERS: Set<string>;
1233
+ /**
1234
+ * Video models whose reference-VIDEO runs also bill the clips' own seconds:
1235
+ * the Seedance 2 family (`unit × (input + output)`) and the
1236
+ * VIDEO_REF_RATE_PROVIDERS (Kling 4.0: `unit × (output + max(output, input))`).
1237
+ * The reservation holds the worst case from the probed clips and the
1238
+ * settlement meters down to what was delivered (backend
1239
+ * ee/billing/seedance2-ref-video-credits.ts) — this is the one gate every lane
1240
+ * (routes, orchestrator, worker settlement, reconcile) asks.
1241
+ */
1242
+ declare function billsReferenceVideoSeconds(provider: string | undefined): boolean;
1188
1243
  /**
1189
1244
  * Video generation models whose provider API natively accepts a "match the
1190
1245
  * visual input's aspect" token, mapped to that provider's EXACT token.
@@ -1591,4 +1646,4 @@ declare function applyDefaultVideoSelection<D>(input: {
1591
1646
  duration: D | number | undefined;
1592
1647
  };
1593
1648
 
1594
- export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a, SUNO_DURATION_MODELS as a$, type ImageAspectRatio as a0, type ImageEditProvider as a1, type ImageEditTargetResolution as a2, type ImageGenProvider as a3, type ImageI2IProvider as a4, type ImageMaskMode as a5, type ImageQuality as a6, type ImageRenderingSpeed as a7, type ImageResolution as a8, type ImageToVideoProvider as a9, type ObjectMotionProvider as aA, PRICING_DEFAULT_DURATION_SEC as aB, PRICING_DEFAULT_RESOLUTION as aC, PROMPT_HARD_CEILING as aD, QA_CHECK_PROVIDERS as aE, type QaCheckProvider as aF, REF_IMAGE_MAX_LIMITS as aG, RENDERING_SPEED_SUPPORT as aH, REPLICATE_LIP_SYNC_PROVIDERS as aI, type RefAudioCheck as aJ, type RefAudioProbe as aK, type RefAudioRule as aL, type RefVideoDurationLimit as aM, SCRIPT_PROVIDERS as aN, SEEDANCE_2_5_REF_LIMITS as aO, SEEDANCE_2_CONTINUATION_REF_SEC as aP, SEEDANCE_2_EXTEND_STITCH as aQ, SEEDANCE_2_PROVIDERS as aR, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as aS, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as aT, SEEDANCE_2_REF_LIMITS as aU, SEEDANCE_LIP_SYNC_PROVIDERS as aV, SEEDANCE_VIDEO_EDIT_PROVIDERS as aW, SEEDANCE_VIDEO_EDIT_SHAPE as aX, SEED_SUPPORT as aY, SUNO_ACTIVE_MODELS as aZ, SUNO_ADD_TRACK_MODELS as a_, LIP_SYNC_PROVIDERS as aa, LLM_TEXT_INPUT_MAX as ab, LOCATION_ATMOSPHERE_PROVIDERS as ac, type LipSyncProvider as ad, type LocationAtmosphereProvider as ae, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as af, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as ag, MAX_TTS_CHARS_BY_PROVIDER as ah, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as ai, MINIMAX_H3_DEFAULT_RESOLUTION as aj, MINIMAX_H3_PROVIDERS as ak, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as al, MODIFY_IMAGE_PROVIDERS as am, MOTION_TRANSFER_PROVIDERS as an, MUSIC_CREDIT_ID as ao, MUSIC_PROVIDERS as ap, MUSIC_PROVIDER_LABELS as aq, type ModelPromptingStyle as ar, type ModifyImageProvider as as, type MotionTransferProviderType as at, type MusicProvider as au, NATIVE_ADAPTIVE_ASPECT as av, NATIVE_NEGATIVE_PROMPT_MODELS as aw, NATIVE_NEGATIVE_VIDEO_PROVIDERS as ax, NEGATIVE_PROMPT_MAX as ay, OBJECT_MOTION_PROVIDERS as az, AUDIO_ADDON_PROVIDERS as b, WAN_3_DEFAULT_RESOLUTION as b$, SUNO_HARD_CEILING as b0, SUNO_LEGACY_MODELS as b1, SUNO_MODELS as b2, SUNO_TEXT_MAX as b3, SUNO_TITLE_MAX as b4, type SceneInputMode as b5, SceneInputModeSchema as b6, type ScriptProvider as b7, type SeedanceVideoEditProvider as b8, type SunoAddTrackModel as b9, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bA, VIDEO_MODEL_CAPS as bB, VIDEO_MODE_ALIASES as bC, VIDEO_PROMPT_MAX as bD, VIDEO_PROVIDERS_REQUIRING_IMAGE as bE, VIDEO_PROVIDERS_WITHOUT_DISPATCH as bF, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as bG, VIDEO_REF_AUDIO_RULES as bH, VIDEO_REF_LIMITS_BY_PROVIDER as bI, VIDEO_REF_VIDEO_DURATION_LIMITS as bJ, VIDEO_TO_VIDEO_NODE_PROVIDERS as bK, VIDEO_TO_VIDEO_PROVIDERS as bL, VIDEO_UPSCALE_PROVIDERS as bM, VIDEO_VARIABLE_PRICING as bN, VIDU_Q4_DEFAULT_RESOLUTION as bO, VIDU_Q4_PROVIDERS as bP, VOICE_DESIGN_MODELS as bQ, type VideoAudioCapability as bR, type VideoAudioMode as bS, type VideoGenProvider as bT, type VideoModeAlias as bU, type VideoModelCapabilities as bV, type VideoReferenceSyntax as bW, type VideoToVideoNodeProvider as bX, type VideoToVideoProvider as bY, type VideoUpscaleProvider as bZ, type VoiceDesignModel as b_, type SunoModel as ba, T2I_TO_I2I_VARIANT as bb, TASK_CHAINED_EDIT_PROVIDERS as bc, TASK_CHAINED_EDIT_PROVIDER_IDS as bd, TEXT_TO_AUDIO_PROVIDERS as be, TEXT_TO_VIDEO_PROVIDERS as bf, TRANSCRIBE_LANES as bg, TRANSCRIBE_PROVIDERS as bh, TRANSCRIBE_PROVIDER_CAPABILITIES as bi, TTS_PROVIDERS as bj, TTS_TEXT_MAX as bk, TWO_K_RESOLUTION_PROVIDERS as bl, type TaskChainedEditProvider as bm, type TextToAudioProvider as bn, type TextToVideoProvider as bo, type TranscribeLane as bp, type TranscribeProvider as bq, type TtsProvider as br, UPSCALE_IMAGE_PROVIDERS as bs, type UpscaleImageProvider as bt, VARIABLE_PRICING_MODELS as bu, VEO_PROVIDERS as bv, VIDEO_AUDIO_CAPABILITY as bw, VIDEO_DURATION_TIERS as bx, VIDEO_GEN_COLLAPSED_T2V_IDS as by, VIDEO_GEN_PROVIDERS as bz, type AiWriterProvider as c, WAN_3_PROVIDERS as c0, applyDefaultVideoSelection as c1, applyVideoAudioToggle as c2, applyVideoNegativePrompt as c3, checkRefAudioRules as c4, checkRefVideoDurations as c5, defaultVideoAspectRatio as c6, findSeedance2AudioOverLimit as c7, getMaxImagePromptChars as c8, getMaxNegativePromptChars as c9, resolveGvpAnchorWire as cA, resolveMusicProvider as cB, resolveVideoModeForInputs as cC, resolveVideoProviderForMode as cD, seedance2AudioLimitSec as cE, segmentDurationsFor as cF, snapToNearestDuration as cG, sunoModelHonoursDuration as cH, supportsAutoVideoDuration as cI, supportsEndAnchor as cJ, supportsExtendRender as cK, transcribeLaneSupportsWordTimestamps as cL, transcribeProvidersWithWordTimestamps as cM, videoDefaultDurationSec as cN, videoModelCanSpeakDialogue as cO, videoModelSupportsAudio as cP, videoNegativeSuffix as cQ, videoProviderAppendsFrames as cR, videoProviderFoldsLoneEndFrame as cS, videoProviderRefModeFrameSeats as cT, videoProviderReferenceSyntax as cU, videoProviderRequiresImage as cV, videoProviderRunsFromReferences as cW, getMaxSunoPromptChars as ca, getMaxSunoStyleChars as cb, getMaxTtsChars as cc, getMaxVideoPromptChars as cd, getVideoAudioCapability as ce, hasContiguousSegmentDurations as cf, imageReferenceLimit as cg, isGeminiOmniProvider as ch, isGvpSupportedProvider as ci, isLegacySunoModel as cj, isMinimaxH3Provider as ck, isSeedance2Provider as cl, isSeedanceVideoEditProvider as cm, isVeoProvider as cn, isViduQ4Provider as co, isWan3Provider as cp, maxSegmentSecFor as cq, maxSegmentsFor as cr, maxVideoDurationSec as cs, minSegmentSecFor as ct, modelsForInputMode as cu, normalizeMinimaxH3Resolution as cv, normalizeViduQ4Resolution as cw, normalizeWan3Resolution as cx, preferredInputModeForModel as cy, pricedOutputDurationSec as cz, COMPOSER_PLAN_FIELDS as d, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_SUNO_MODEL as j, DEFAULT_TEXT_TO_AUDIO_PROVIDER as k, DEFAULT_TRANSCRIBE_NODE_PROVIDER as l, DEFAULT_TRANSCRIBE_PROVIDER as m, DEFAULT_TTS_PROVIDER as n, DEFAULT_VIDEO_DURATION_SEC as o, DEFAULT_VIDEO_PROVIDER as p, DEFAULT_VOICE_DESIGN_MODEL as q, DIALOGUE_PROVIDERS as r, DURATION_PRICED_PROVIDERS as s, type DialogueProvider as t, type ExtendVideoProvider as u, FAL_LIP_SYNC_PROVIDERS as v, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as w, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as x, type FaceSwapProvider as y, GUIDANCE_SCALE_SUPPORT as z };
1649
+ export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a, SEED_SUPPORT as a$, type ImageAspectRatio as a0, type ImageEditProvider as a1, type ImageEditTargetResolution as a2, type ImageGenProvider as a3, type ImageI2IProvider as a4, type ImageMaskMode as a5, type ImageQuality as a6, type ImageRenderingSpeed as a7, type ImageResolution as a8, type ImageToVideoProvider as a9, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aA, NEGATIVE_PROMPT_MAX as aB, OBJECT_MOTION_PROVIDERS as aC, type ObjectMotionProvider as aD, PRICING_DEFAULT_DURATION_SEC as aE, PRICING_DEFAULT_RESOLUTION as aF, PROMPT_HARD_CEILING as aG, QA_CHECK_PROVIDERS as aH, type QaCheckProvider as aI, REF_IMAGE_MAX_LIMITS as aJ, RENDERING_SPEED_SUPPORT as aK, REPLICATE_LIP_SYNC_PROVIDERS as aL, type RefAudioCheck as aM, type RefAudioProbe as aN, type RefAudioRule as aO, type RefVideoDurationLimit as aP, SCRIPT_PROVIDERS as aQ, SEEDANCE_2_5_REF_LIMITS as aR, SEEDANCE_2_CONTINUATION_REF_SEC as aS, SEEDANCE_2_EXTEND_STITCH as aT, SEEDANCE_2_PROVIDERS as aU, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as aV, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as aW, SEEDANCE_2_REF_LIMITS as aX, SEEDANCE_LIP_SYNC_PROVIDERS as aY, SEEDANCE_VIDEO_EDIT_PROVIDERS as aZ, SEEDANCE_VIDEO_EDIT_SHAPE as a_, KLING_4_DEFAULT_RESOLUTION as aa, KLING_4_MAX_MIDDLE_FRAMES as ab, KLING_4_PROVIDERS as ac, LIP_SYNC_PROVIDERS as ad, LLM_TEXT_INPUT_MAX as ae, LOCATION_ATMOSPHERE_PROVIDERS as af, type LipSyncProvider as ag, type LocationAtmosphereProvider as ah, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as ai, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as aj, MAX_TTS_CHARS_BY_PROVIDER as ak, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as al, MINIMAX_H3_DEFAULT_RESOLUTION as am, MINIMAX_H3_PROVIDERS as an, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as ao, MODIFY_IMAGE_PROVIDERS as ap, MOTION_TRANSFER_PROVIDERS as aq, MUSIC_CREDIT_ID as ar, MUSIC_PROVIDERS as as, MUSIC_PROVIDER_LABELS as at, type ModelPromptingStyle as au, type ModifyImageProvider as av, type MotionTransferProviderType as aw, type MusicProvider as ax, NATIVE_ADAPTIVE_ASPECT as ay, NATIVE_NEGATIVE_PROMPT_MODELS as az, AUDIO_ADDON_PROVIDERS as b, type VideoToVideoNodeProvider as b$, SUNO_ACTIVE_MODELS as b0, SUNO_ADD_TRACK_MODELS as b1, SUNO_DURATION_MODELS as b2, SUNO_HARD_CEILING as b3, SUNO_LEGACY_MODELS as b4, SUNO_MODELS as b5, SUNO_TEXT_MAX as b6, SUNO_TITLE_MAX as b7, type SceneInputMode as b8, SceneInputModeSchema as b9, VIDEO_DURATION_TIERS as bA, VIDEO_GEN_COLLAPSED_T2V_IDS as bB, VIDEO_GEN_PROVIDERS as bC, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bD, VIDEO_MODEL_CAPS as bE, VIDEO_MODE_ALIASES as bF, VIDEO_PROMPT_MAX as bG, VIDEO_PROVIDERS_REQUIRING_IMAGE as bH, VIDEO_PROVIDERS_WITHOUT_DISPATCH as bI, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as bJ, VIDEO_REF_AUDIO_RULES as bK, VIDEO_REF_LIMITS_BY_PROVIDER as bL, VIDEO_REF_RATE_PROVIDERS as bM, VIDEO_REF_VIDEO_DURATION_LIMITS as bN, VIDEO_TO_VIDEO_NODE_PROVIDERS as bO, VIDEO_TO_VIDEO_PROVIDERS as bP, VIDEO_UPSCALE_PROVIDERS as bQ, VIDEO_VARIABLE_PRICING as bR, VIDU_Q4_DEFAULT_RESOLUTION as bS, VIDU_Q4_PROVIDERS as bT, VOICE_DESIGN_MODELS as bU, type VideoAudioCapability as bV, type VideoAudioMode as bW, type VideoGenProvider as bX, type VideoModeAlias as bY, type VideoModelCapabilities as bZ, type VideoReferenceSyntax as b_, type ScriptProvider as ba, type SeedanceVideoEditProvider as bb, type SunoAddTrackModel as bc, type SunoModel as bd, T2I_TO_I2I_VARIANT as be, TASK_CHAINED_EDIT_PROVIDERS as bf, TASK_CHAINED_EDIT_PROVIDER_IDS as bg, TEXT_TO_AUDIO_PROVIDERS as bh, TEXT_TO_VIDEO_PROVIDERS as bi, TRANSCRIBE_LANES as bj, TRANSCRIBE_PROVIDERS as bk, TRANSCRIBE_PROVIDER_CAPABILITIES as bl, TTS_PROVIDERS as bm, TTS_TEXT_MAX as bn, TWO_K_RESOLUTION_PROVIDERS as bo, type TaskChainedEditProvider as bp, type TextToAudioProvider as bq, type TextToVideoProvider as br, type TranscribeLane as bs, type TranscribeProvider as bt, type TtsProvider as bu, UPSCALE_IMAGE_PROVIDERS as bv, type UpscaleImageProvider as bw, VARIABLE_PRICING_MODELS as bx, VEO_PROVIDERS as by, VIDEO_AUDIO_CAPABILITY as bz, type AiWriterProvider as c, videoProviderRefModeFrameSeats as c$, type VideoToVideoProvider as c0, type VideoUpscaleProvider as c1, type VoiceDesignModel as c2, WAN_3_DEFAULT_RESOLUTION as c3, WAN_3_PROVIDERS as c4, applyDefaultVideoSelection as c5, applyVideoAudioToggle as c6, applyVideoNegativePrompt as c7, billsReferenceVideoSeconds as c8, checkRefAudioRules as c9, minSegmentSecFor as cA, modelsForInputMode as cB, normalizeKling4Resolution as cC, normalizeMinimaxH3Resolution as cD, normalizeViduQ4Resolution as cE, normalizeWan3Resolution as cF, preferredInputModeForModel as cG, pricedOutputDurationSec as cH, resolveGvpAnchorWire as cI, resolveMusicProvider as cJ, resolveVideoModeForInputs as cK, resolveVideoProviderForMode as cL, seedance2AudioLimitSec as cM, segmentDurationsFor as cN, snapToNearestDuration as cO, sunoModelHonoursDuration as cP, supportsAutoVideoDuration as cQ, supportsEndAnchor as cR, supportsExtendRender as cS, transcribeLaneSupportsWordTimestamps as cT, transcribeProvidersWithWordTimestamps as cU, videoDefaultDurationSec as cV, videoModelCanSpeakDialogue as cW, videoModelSupportsAudio as cX, videoNegativeSuffix as cY, videoProviderAppendsFrames as cZ, videoProviderFoldsLoneEndFrame as c_, checkRefVideoDurations as ca, defaultVideoAspectRatio as cb, findSeedance2AudioOverLimit as cc, getMaxImagePromptChars as cd, getMaxNegativePromptChars as ce, getMaxSunoPromptChars as cf, getMaxSunoStyleChars as cg, getMaxTtsChars as ch, getMaxVideoPromptChars as ci, getVideoAudioCapability as cj, hasContiguousSegmentDurations as ck, imageReferenceLimit as cl, isGeminiOmniProvider as cm, isGvpSupportedProvider as cn, isKling4Provider as co, isLegacySunoModel as cp, isMinimaxH3Provider as cq, isSeedance2Provider as cr, isSeedanceVideoEditProvider as cs, isVeoProvider as ct, isViduQ4Provider as cu, isWan3Provider as cv, kling4KeyframeFrameCap as cw, maxSegmentSecFor as cx, maxSegmentsFor as cy, maxVideoDurationSec as cz, COMPOSER_PLAN_FIELDS as d, videoProviderReferenceSyntax as d0, videoProviderRequiresImage as d1, videoProviderRunsFromReferences as d2, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_SUNO_MODEL as j, DEFAULT_TEXT_TO_AUDIO_PROVIDER as k, DEFAULT_TRANSCRIBE_NODE_PROVIDER as l, DEFAULT_TRANSCRIBE_PROVIDER as m, DEFAULT_TTS_PROVIDER as n, DEFAULT_VIDEO_DURATION_SEC as o, DEFAULT_VIDEO_PROVIDER as p, DEFAULT_VOICE_DESIGN_MODEL as q, DIALOGUE_PROVIDERS as r, DURATION_PRICED_PROVIDERS as s, type DialogueProvider as t, type ExtendVideoProvider as u, FAL_LIP_SYNC_PROVIDERS as v, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as w, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as x, type FaceSwapProvider as y, GUIDANCE_SCALE_SUPPORT as z };
@@ -352,13 +352,13 @@ type ImageGenProvider = typeof IMAGE_GEN_PROVIDERS[number];
352
352
  type ImageI2IProvider = typeof IMAGE_I2I_PROVIDERS[number];
353
353
  type ImageEditProvider = typeof IMAGE_EDIT_PROVIDERS[number];
354
354
  /** Image-to-video providers */
355
- declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5"];
355
+ declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5"];
356
356
  type ImageToVideoProvider = typeof IMAGE_TO_VIDEO_PROVIDERS[number];
357
357
  /** Text-to-video providers */
358
- declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v", "vidu-q4"];
358
+ declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v", "vidu-q4"];
359
359
  type TextToVideoProvider = typeof TEXT_TO_VIDEO_PROVIDERS[number];
360
360
  /** Unified video-generation providers (image-to-video ∪ text-to-video) for the generate-video node. */
361
- declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "vidu-q4" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
361
+ declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "kling-4" | "kling-4-keyframes" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "vidu-q4" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
362
362
  type VideoGenProvider = typeof VIDEO_GEN_PROVIDERS[number];
363
363
  /**
364
364
  * Video models that expose DISTINCT provider ids per mode (text-to-video vs
@@ -434,8 +434,9 @@ declare function videoProviderReferenceSyntax(provider: string | undefined): Vid
434
434
  /**
435
435
  * Reference-capable video models whose start/end frames ride a channel of
436
436
  * their OWN (separate frame parameters next to the reference list), so a frame
437
- * never occupies a reference seat. `kling-3-omni` (Replicate `start_image` /
438
- * `end_image`) is the only one — and it has no dispatch path today.
437
+ * never occupies a reference seat: `kling-3-omni` (Replicate `start_image` /
438
+ * `end_image`, no dispatch path today) and Kling 4.0 Keyframes (KIE
439
+ * `first_frame_url` / `last_frame_url` beside its in-between `keyframe_urls`).
439
440
  */
440
441
  declare const VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL: ReadonlySet<string>;
441
442
  /**
@@ -854,6 +855,34 @@ declare const VIDU_Q4_DEFAULT_RESOLUTION = "720p";
854
855
  * never disagree.
855
856
  */
856
857
  declare function normalizeViduQ4Resolution(resolution: string | undefined): "540p" | "720p" | "1080p" | "2k" | "4k";
858
+ /**
859
+ * Kling 4.0 family — two Nodaro ids over KIE's two Kling 4.0 endpoints:
860
+ * `kling-4` → `kling-4.0/reference-to-video`, `kling-4-keyframes` →
861
+ * `kling-4.0/keyframe-to-video`. Exact-membership set.
862
+ */
863
+ declare const KLING_4_PROVIDERS: Set<string>;
864
+ declare function isKling4Provider(provider: string | undefined): provider is "kling-4" | "kling-4-keyframes";
865
+ /** Kling 4.0 resolution rendered when the param is omitted or unknown — KIE's
866
+ * own default and the tier the bare credit identifier prices. */
867
+ declare const KLING_4_DEFAULT_RESOLUTION = "720p";
868
+ /**
869
+ * SINGLE normalization for the Kling 4.0 resolution lever. The KIE wire enum is
870
+ * lowercase ("720p" | "1080p"), the same spelling as the catalog and the credit
871
+ * identifiers; this folds case and collapses anything else to
872
+ * {@link KLING_4_DEFAULT_RESOLUTION}. The runner sends what this returns and
873
+ * the credit identifier bills what this returns.
874
+ */
875
+ declare function normalizeKling4Resolution(resolution: string | undefined): "720p" | "1080p";
876
+ /** Most in-between frames Kling 4.0 Keyframes takes (`keyframe_urls`). */
877
+ declare const KLING_4_MAX_MIDDLE_FRAMES = 8;
878
+ /**
879
+ * How many frames IN ALL (start + in-between + end) Kling 4.0 Keyframes
880
+ * accepts for a clip of `durationSec` seconds — KIE's own table
881
+ * (docs.kie.ai/market/kling/v4-keyframe-to-video): 3s → 4, 4s → 5 … 8s → 9,
882
+ * 9s or longer → 10. Live-verified 2026-10-23: 5 frames at 3s is a 422
883
+ * "duration 3s allows at most 4 frames (first + keyframes + last), got 5".
884
+ */
885
+ declare function kling4KeyframeFrameCap(durationSec: number | string | undefined): number;
857
886
  /**
858
887
  * Google Gemini Omni family — the KIE "gemini-omni-video" market model and its
859
888
  * faster/cheaper "google/gemini-omni-flash-1-1" sibling. Both take the SAME
@@ -1137,6 +1166,14 @@ declare const VIDEO_REF_LIMITS_BY_PROVIDER: Record<string, {
1137
1166
  audio?: number;
1138
1167
  characters?: number;
1139
1168
  voices?: number;
1169
+ /**
1170
+ * Cap on ALL materials together (images + videos + characters + audio),
1171
+ * when the provider counts them as one budget (Kling 4.0: 15). Absent ⇒
1172
+ * no combined cap beyond the per-kind ones — and, for a model declaring
1173
+ * `characters`, the Gemini Omni input-unit budget applies instead
1174
+ * (`videoCharacterRefProblem`).
1175
+ */
1176
+ materials?: number;
1140
1177
  } | undefined>;
1141
1178
  /** Per-reference-video duration bounds, in seconds. */
1142
1179
  interface RefVideoDurationLimit {
@@ -1185,6 +1222,24 @@ declare function checkRefVideoDurations(provider: string, durationsSec: readonly
1185
1222
  ok: false;
1186
1223
  message: string;
1187
1224
  };
1225
+ /**
1226
+ * Members of RESOLUTION_DURATION_PRICING that bill a run carrying a reference
1227
+ * VIDEO at a different per-second rate: their identifier gains a `-ref` suffix
1228
+ * after the resolution (`kling-4:8s:720p-ref`). The rate is per second of the
1229
+ * BILLED duration, which the reference-video billing rule
1230
+ * (backend ee/billing/ref-video-billing.ts) computes from the probed clips.
1231
+ */
1232
+ declare const VIDEO_REF_RATE_PROVIDERS: Set<string>;
1233
+ /**
1234
+ * Video models whose reference-VIDEO runs also bill the clips' own seconds:
1235
+ * the Seedance 2 family (`unit × (input + output)`) and the
1236
+ * VIDEO_REF_RATE_PROVIDERS (Kling 4.0: `unit × (output + max(output, input))`).
1237
+ * The reservation holds the worst case from the probed clips and the
1238
+ * settlement meters down to what was delivered (backend
1239
+ * ee/billing/seedance2-ref-video-credits.ts) — this is the one gate every lane
1240
+ * (routes, orchestrator, worker settlement, reconcile) asks.
1241
+ */
1242
+ declare function billsReferenceVideoSeconds(provider: string | undefined): boolean;
1188
1243
  /**
1189
1244
  * Video generation models whose provider API natively accepts a "match the
1190
1245
  * visual input's aspect" token, mapped to that provider's EXACT token.
@@ -1591,4 +1646,4 @@ declare function applyDefaultVideoSelection<D>(input: {
1591
1646
  duration: D | number | undefined;
1592
1647
  };
1593
1648
 
1594
- export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a, SUNO_DURATION_MODELS as a$, type ImageAspectRatio as a0, type ImageEditProvider as a1, type ImageEditTargetResolution as a2, type ImageGenProvider as a3, type ImageI2IProvider as a4, type ImageMaskMode as a5, type ImageQuality as a6, type ImageRenderingSpeed as a7, type ImageResolution as a8, type ImageToVideoProvider as a9, type ObjectMotionProvider as aA, PRICING_DEFAULT_DURATION_SEC as aB, PRICING_DEFAULT_RESOLUTION as aC, PROMPT_HARD_CEILING as aD, QA_CHECK_PROVIDERS as aE, type QaCheckProvider as aF, REF_IMAGE_MAX_LIMITS as aG, RENDERING_SPEED_SUPPORT as aH, REPLICATE_LIP_SYNC_PROVIDERS as aI, type RefAudioCheck as aJ, type RefAudioProbe as aK, type RefAudioRule as aL, type RefVideoDurationLimit as aM, SCRIPT_PROVIDERS as aN, SEEDANCE_2_5_REF_LIMITS as aO, SEEDANCE_2_CONTINUATION_REF_SEC as aP, SEEDANCE_2_EXTEND_STITCH as aQ, SEEDANCE_2_PROVIDERS as aR, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as aS, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as aT, SEEDANCE_2_REF_LIMITS as aU, SEEDANCE_LIP_SYNC_PROVIDERS as aV, SEEDANCE_VIDEO_EDIT_PROVIDERS as aW, SEEDANCE_VIDEO_EDIT_SHAPE as aX, SEED_SUPPORT as aY, SUNO_ACTIVE_MODELS as aZ, SUNO_ADD_TRACK_MODELS as a_, LIP_SYNC_PROVIDERS as aa, LLM_TEXT_INPUT_MAX as ab, LOCATION_ATMOSPHERE_PROVIDERS as ac, type LipSyncProvider as ad, type LocationAtmosphereProvider as ae, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as af, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as ag, MAX_TTS_CHARS_BY_PROVIDER as ah, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as ai, MINIMAX_H3_DEFAULT_RESOLUTION as aj, MINIMAX_H3_PROVIDERS as ak, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as al, MODIFY_IMAGE_PROVIDERS as am, MOTION_TRANSFER_PROVIDERS as an, MUSIC_CREDIT_ID as ao, MUSIC_PROVIDERS as ap, MUSIC_PROVIDER_LABELS as aq, type ModelPromptingStyle as ar, type ModifyImageProvider as as, type MotionTransferProviderType as at, type MusicProvider as au, NATIVE_ADAPTIVE_ASPECT as av, NATIVE_NEGATIVE_PROMPT_MODELS as aw, NATIVE_NEGATIVE_VIDEO_PROVIDERS as ax, NEGATIVE_PROMPT_MAX as ay, OBJECT_MOTION_PROVIDERS as az, AUDIO_ADDON_PROVIDERS as b, WAN_3_DEFAULT_RESOLUTION as b$, SUNO_HARD_CEILING as b0, SUNO_LEGACY_MODELS as b1, SUNO_MODELS as b2, SUNO_TEXT_MAX as b3, SUNO_TITLE_MAX as b4, type SceneInputMode as b5, SceneInputModeSchema as b6, type ScriptProvider as b7, type SeedanceVideoEditProvider as b8, type SunoAddTrackModel as b9, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bA, VIDEO_MODEL_CAPS as bB, VIDEO_MODE_ALIASES as bC, VIDEO_PROMPT_MAX as bD, VIDEO_PROVIDERS_REQUIRING_IMAGE as bE, VIDEO_PROVIDERS_WITHOUT_DISPATCH as bF, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as bG, VIDEO_REF_AUDIO_RULES as bH, VIDEO_REF_LIMITS_BY_PROVIDER as bI, VIDEO_REF_VIDEO_DURATION_LIMITS as bJ, VIDEO_TO_VIDEO_NODE_PROVIDERS as bK, VIDEO_TO_VIDEO_PROVIDERS as bL, VIDEO_UPSCALE_PROVIDERS as bM, VIDEO_VARIABLE_PRICING as bN, VIDU_Q4_DEFAULT_RESOLUTION as bO, VIDU_Q4_PROVIDERS as bP, VOICE_DESIGN_MODELS as bQ, type VideoAudioCapability as bR, type VideoAudioMode as bS, type VideoGenProvider as bT, type VideoModeAlias as bU, type VideoModelCapabilities as bV, type VideoReferenceSyntax as bW, type VideoToVideoNodeProvider as bX, type VideoToVideoProvider as bY, type VideoUpscaleProvider as bZ, type VoiceDesignModel as b_, type SunoModel as ba, T2I_TO_I2I_VARIANT as bb, TASK_CHAINED_EDIT_PROVIDERS as bc, TASK_CHAINED_EDIT_PROVIDER_IDS as bd, TEXT_TO_AUDIO_PROVIDERS as be, TEXT_TO_VIDEO_PROVIDERS as bf, TRANSCRIBE_LANES as bg, TRANSCRIBE_PROVIDERS as bh, TRANSCRIBE_PROVIDER_CAPABILITIES as bi, TTS_PROVIDERS as bj, TTS_TEXT_MAX as bk, TWO_K_RESOLUTION_PROVIDERS as bl, type TaskChainedEditProvider as bm, type TextToAudioProvider as bn, type TextToVideoProvider as bo, type TranscribeLane as bp, type TranscribeProvider as bq, type TtsProvider as br, UPSCALE_IMAGE_PROVIDERS as bs, type UpscaleImageProvider as bt, VARIABLE_PRICING_MODELS as bu, VEO_PROVIDERS as bv, VIDEO_AUDIO_CAPABILITY as bw, VIDEO_DURATION_TIERS as bx, VIDEO_GEN_COLLAPSED_T2V_IDS as by, VIDEO_GEN_PROVIDERS as bz, type AiWriterProvider as c, WAN_3_PROVIDERS as c0, applyDefaultVideoSelection as c1, applyVideoAudioToggle as c2, applyVideoNegativePrompt as c3, checkRefAudioRules as c4, checkRefVideoDurations as c5, defaultVideoAspectRatio as c6, findSeedance2AudioOverLimit as c7, getMaxImagePromptChars as c8, getMaxNegativePromptChars as c9, resolveGvpAnchorWire as cA, resolveMusicProvider as cB, resolveVideoModeForInputs as cC, resolveVideoProviderForMode as cD, seedance2AudioLimitSec as cE, segmentDurationsFor as cF, snapToNearestDuration as cG, sunoModelHonoursDuration as cH, supportsAutoVideoDuration as cI, supportsEndAnchor as cJ, supportsExtendRender as cK, transcribeLaneSupportsWordTimestamps as cL, transcribeProvidersWithWordTimestamps as cM, videoDefaultDurationSec as cN, videoModelCanSpeakDialogue as cO, videoModelSupportsAudio as cP, videoNegativeSuffix as cQ, videoProviderAppendsFrames as cR, videoProviderFoldsLoneEndFrame as cS, videoProviderRefModeFrameSeats as cT, videoProviderReferenceSyntax as cU, videoProviderRequiresImage as cV, videoProviderRunsFromReferences as cW, getMaxSunoPromptChars as ca, getMaxSunoStyleChars as cb, getMaxTtsChars as cc, getMaxVideoPromptChars as cd, getVideoAudioCapability as ce, hasContiguousSegmentDurations as cf, imageReferenceLimit as cg, isGeminiOmniProvider as ch, isGvpSupportedProvider as ci, isLegacySunoModel as cj, isMinimaxH3Provider as ck, isSeedance2Provider as cl, isSeedanceVideoEditProvider as cm, isVeoProvider as cn, isViduQ4Provider as co, isWan3Provider as cp, maxSegmentSecFor as cq, maxSegmentsFor as cr, maxVideoDurationSec as cs, minSegmentSecFor as ct, modelsForInputMode as cu, normalizeMinimaxH3Resolution as cv, normalizeViduQ4Resolution as cw, normalizeWan3Resolution as cx, preferredInputModeForModel as cy, pricedOutputDurationSec as cz, COMPOSER_PLAN_FIELDS as d, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_SUNO_MODEL as j, DEFAULT_TEXT_TO_AUDIO_PROVIDER as k, DEFAULT_TRANSCRIBE_NODE_PROVIDER as l, DEFAULT_TRANSCRIBE_PROVIDER as m, DEFAULT_TTS_PROVIDER as n, DEFAULT_VIDEO_DURATION_SEC as o, DEFAULT_VIDEO_PROVIDER as p, DEFAULT_VOICE_DESIGN_MODEL as q, DIALOGUE_PROVIDERS as r, DURATION_PRICED_PROVIDERS as s, type DialogueProvider as t, type ExtendVideoProvider as u, FAL_LIP_SYNC_PROVIDERS as v, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as w, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as x, type FaceSwapProvider as y, GUIDANCE_SCALE_SUPPORT as z };
1649
+ export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a, SEED_SUPPORT as a$, type ImageAspectRatio as a0, type ImageEditProvider as a1, type ImageEditTargetResolution as a2, type ImageGenProvider as a3, type ImageI2IProvider as a4, type ImageMaskMode as a5, type ImageQuality as a6, type ImageRenderingSpeed as a7, type ImageResolution as a8, type ImageToVideoProvider as a9, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aA, NEGATIVE_PROMPT_MAX as aB, OBJECT_MOTION_PROVIDERS as aC, type ObjectMotionProvider as aD, PRICING_DEFAULT_DURATION_SEC as aE, PRICING_DEFAULT_RESOLUTION as aF, PROMPT_HARD_CEILING as aG, QA_CHECK_PROVIDERS as aH, type QaCheckProvider as aI, REF_IMAGE_MAX_LIMITS as aJ, RENDERING_SPEED_SUPPORT as aK, REPLICATE_LIP_SYNC_PROVIDERS as aL, type RefAudioCheck as aM, type RefAudioProbe as aN, type RefAudioRule as aO, type RefVideoDurationLimit as aP, SCRIPT_PROVIDERS as aQ, SEEDANCE_2_5_REF_LIMITS as aR, SEEDANCE_2_CONTINUATION_REF_SEC as aS, SEEDANCE_2_EXTEND_STITCH as aT, SEEDANCE_2_PROVIDERS as aU, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as aV, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as aW, SEEDANCE_2_REF_LIMITS as aX, SEEDANCE_LIP_SYNC_PROVIDERS as aY, SEEDANCE_VIDEO_EDIT_PROVIDERS as aZ, SEEDANCE_VIDEO_EDIT_SHAPE as a_, KLING_4_DEFAULT_RESOLUTION as aa, KLING_4_MAX_MIDDLE_FRAMES as ab, KLING_4_PROVIDERS as ac, LIP_SYNC_PROVIDERS as ad, LLM_TEXT_INPUT_MAX as ae, LOCATION_ATMOSPHERE_PROVIDERS as af, type LipSyncProvider as ag, type LocationAtmosphereProvider as ah, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as ai, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as aj, MAX_TTS_CHARS_BY_PROVIDER as ak, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as al, MINIMAX_H3_DEFAULT_RESOLUTION as am, MINIMAX_H3_PROVIDERS as an, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as ao, MODIFY_IMAGE_PROVIDERS as ap, MOTION_TRANSFER_PROVIDERS as aq, MUSIC_CREDIT_ID as ar, MUSIC_PROVIDERS as as, MUSIC_PROVIDER_LABELS as at, type ModelPromptingStyle as au, type ModifyImageProvider as av, type MotionTransferProviderType as aw, type MusicProvider as ax, NATIVE_ADAPTIVE_ASPECT as ay, NATIVE_NEGATIVE_PROMPT_MODELS as az, AUDIO_ADDON_PROVIDERS as b, type VideoToVideoNodeProvider as b$, SUNO_ACTIVE_MODELS as b0, SUNO_ADD_TRACK_MODELS as b1, SUNO_DURATION_MODELS as b2, SUNO_HARD_CEILING as b3, SUNO_LEGACY_MODELS as b4, SUNO_MODELS as b5, SUNO_TEXT_MAX as b6, SUNO_TITLE_MAX as b7, type SceneInputMode as b8, SceneInputModeSchema as b9, VIDEO_DURATION_TIERS as bA, VIDEO_GEN_COLLAPSED_T2V_IDS as bB, VIDEO_GEN_PROVIDERS as bC, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bD, VIDEO_MODEL_CAPS as bE, VIDEO_MODE_ALIASES as bF, VIDEO_PROMPT_MAX as bG, VIDEO_PROVIDERS_REQUIRING_IMAGE as bH, VIDEO_PROVIDERS_WITHOUT_DISPATCH as bI, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as bJ, VIDEO_REF_AUDIO_RULES as bK, VIDEO_REF_LIMITS_BY_PROVIDER as bL, VIDEO_REF_RATE_PROVIDERS as bM, VIDEO_REF_VIDEO_DURATION_LIMITS as bN, VIDEO_TO_VIDEO_NODE_PROVIDERS as bO, VIDEO_TO_VIDEO_PROVIDERS as bP, VIDEO_UPSCALE_PROVIDERS as bQ, VIDEO_VARIABLE_PRICING as bR, VIDU_Q4_DEFAULT_RESOLUTION as bS, VIDU_Q4_PROVIDERS as bT, VOICE_DESIGN_MODELS as bU, type VideoAudioCapability as bV, type VideoAudioMode as bW, type VideoGenProvider as bX, type VideoModeAlias as bY, type VideoModelCapabilities as bZ, type VideoReferenceSyntax as b_, type ScriptProvider as ba, type SeedanceVideoEditProvider as bb, type SunoAddTrackModel as bc, type SunoModel as bd, T2I_TO_I2I_VARIANT as be, TASK_CHAINED_EDIT_PROVIDERS as bf, TASK_CHAINED_EDIT_PROVIDER_IDS as bg, TEXT_TO_AUDIO_PROVIDERS as bh, TEXT_TO_VIDEO_PROVIDERS as bi, TRANSCRIBE_LANES as bj, TRANSCRIBE_PROVIDERS as bk, TRANSCRIBE_PROVIDER_CAPABILITIES as bl, TTS_PROVIDERS as bm, TTS_TEXT_MAX as bn, TWO_K_RESOLUTION_PROVIDERS as bo, type TaskChainedEditProvider as bp, type TextToAudioProvider as bq, type TextToVideoProvider as br, type TranscribeLane as bs, type TranscribeProvider as bt, type TtsProvider as bu, UPSCALE_IMAGE_PROVIDERS as bv, type UpscaleImageProvider as bw, VARIABLE_PRICING_MODELS as bx, VEO_PROVIDERS as by, VIDEO_AUDIO_CAPABILITY as bz, type AiWriterProvider as c, videoProviderRefModeFrameSeats as c$, type VideoToVideoProvider as c0, type VideoUpscaleProvider as c1, type VoiceDesignModel as c2, WAN_3_DEFAULT_RESOLUTION as c3, WAN_3_PROVIDERS as c4, applyDefaultVideoSelection as c5, applyVideoAudioToggle as c6, applyVideoNegativePrompt as c7, billsReferenceVideoSeconds as c8, checkRefAudioRules as c9, minSegmentSecFor as cA, modelsForInputMode as cB, normalizeKling4Resolution as cC, normalizeMinimaxH3Resolution as cD, normalizeViduQ4Resolution as cE, normalizeWan3Resolution as cF, preferredInputModeForModel as cG, pricedOutputDurationSec as cH, resolveGvpAnchorWire as cI, resolveMusicProvider as cJ, resolveVideoModeForInputs as cK, resolveVideoProviderForMode as cL, seedance2AudioLimitSec as cM, segmentDurationsFor as cN, snapToNearestDuration as cO, sunoModelHonoursDuration as cP, supportsAutoVideoDuration as cQ, supportsEndAnchor as cR, supportsExtendRender as cS, transcribeLaneSupportsWordTimestamps as cT, transcribeProvidersWithWordTimestamps as cU, videoDefaultDurationSec as cV, videoModelCanSpeakDialogue as cW, videoModelSupportsAudio as cX, videoNegativeSuffix as cY, videoProviderAppendsFrames as cZ, videoProviderFoldsLoneEndFrame as c_, checkRefVideoDurations as ca, defaultVideoAspectRatio as cb, findSeedance2AudioOverLimit as cc, getMaxImagePromptChars as cd, getMaxNegativePromptChars as ce, getMaxSunoPromptChars as cf, getMaxSunoStyleChars as cg, getMaxTtsChars as ch, getMaxVideoPromptChars as ci, getVideoAudioCapability as cj, hasContiguousSegmentDurations as ck, imageReferenceLimit as cl, isGeminiOmniProvider as cm, isGvpSupportedProvider as cn, isKling4Provider as co, isLegacySunoModel as cp, isMinimaxH3Provider as cq, isSeedance2Provider as cr, isSeedanceVideoEditProvider as cs, isVeoProvider as ct, isViduQ4Provider as cu, isWan3Provider as cv, kling4KeyframeFrameCap as cw, maxSegmentSecFor as cx, maxSegmentsFor as cy, maxVideoDurationSec as cz, COMPOSER_PLAN_FIELDS as d, videoProviderReferenceSyntax as d0, videoProviderRequiresImage as d1, videoProviderRunsFromReferences as d2, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_SUNO_MODEL as j, DEFAULT_TEXT_TO_AUDIO_PROVIDER as k, DEFAULT_TRANSCRIBE_NODE_PROVIDER as l, DEFAULT_TRANSCRIBE_PROVIDER as m, DEFAULT_TTS_PROVIDER as n, DEFAULT_VIDEO_DURATION_SEC as o, DEFAULT_VIDEO_PROVIDER as p, DEFAULT_VOICE_DESIGN_MODEL as q, DIALOGUE_PROVIDERS as r, DURATION_PRICED_PROVIDERS as s, type DialogueProvider as t, type ExtendVideoProvider as u, FAL_LIP_SYNC_PROVIDERS as v, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as w, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as x, type FaceSwapProvider as y, GUIDANCE_SCALE_SUPPORT as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodaro/shared",
3
- "version": "3.39.0",
3
+ "version": "3.41.0",
4
4
  "description": "Shared types, model catalog, wire contracts, and structural vocabularies for the Nodaro platform and SDK.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -7,8 +7,15 @@ import { describe, expect, it } from "vitest"
7
7
  import {
8
8
  CAST_SWAP_FACE_MASKING_BOUNDS,
9
9
  CAST_SWAP_FACE_MASKING_DEFAULTS,
10
+ CAST_SWAP_ENGINE_WHEN_OMITTED,
11
+ CAST_SWAP_ENGINES,
10
12
  CAST_SWAP_POST_PROMPT_MAX,
13
+ CAST_SWAP_RESOLUTIONS_BY_ENGINE,
11
14
  TREND_PROMPT_LIMITS,
15
+ castSwapEngineHasDraft,
16
+ CAST_SWAP_KLING_LENGTHS,
17
+ CAST_SWAP_KLING_LENGTH_WHEN_OMITTED,
18
+ CAST_SWAP_KLING_MAX_IMAGES,
12
19
  } from "../cast-swap-limits.js"
13
20
 
14
21
  describe("Cast Swap limits", () => {
@@ -46,4 +53,24 @@ describe("Cast Swap limits", () => {
46
53
  it("leaves 10 % margins at the left and right when the zone is left out", () => {
47
54
  expect(CAST_SWAP_FACE_MASKING_DEFAULTS.zone).toEqual({ leftPct: 10, rightPct: 10, topPct: 0, bottomPct: 0 })
48
55
  })
56
+
57
+ it("runs on Seedance 2.5 or Kling 4, Seedance when no engine is named", () => {
58
+ expect(CAST_SWAP_ENGINES).toEqual(["seedance-2-5", "kling-4"])
59
+ expect(CAST_SWAP_ENGINE_WHEN_OMITTED).toBe("seedance-2-5")
60
+ })
61
+
62
+ it("offers Kling 4 720p and 1080p with no draft, and Seedance 2.5 its 480p draft first", () => {
63
+ expect(CAST_SWAP_RESOLUTIONS_BY_ENGINE).toEqual({ "seedance-2-5": ["480p", "720p", "1080p"], "kling-4": ["720p", "1080p"] })
64
+ expect(castSwapEngineHasDraft("seedance-2-5")).toBe(true)
65
+ expect(castSwapEngineHasDraft("kling-4")).toBe(false)
66
+ })
67
+
68
+ it("fits a Kling 4 run's length by cutting the end, unless a trend or run says otherwise", () => {
69
+ expect(CAST_SWAP_KLING_LENGTHS).toEqual(["cut-end", "cut-start"])
70
+ expect(CAST_SWAP_KLING_LENGTH_WHEN_OMITTED).toBe("cut-end")
71
+ })
72
+
73
+ it("caps a Kling 4 run at 10 images", () => {
74
+ expect(CAST_SWAP_KLING_MAX_IMAGES).toBe(10)
75
+ })
49
76
  })
@@ -60,6 +60,7 @@ describe("GVP_SUPPORTED_PROVIDERS", () => {
60
60
  "veo3_lite",
61
61
  "gemini-omni-video",
62
62
  "gemini-omni-flash",
63
+ "kling-4",
63
64
  "grok-i2v",
64
65
  "wan-3",
65
66
  "wan-3-prime",
@@ -95,8 +96,14 @@ describe("GVP_SUPPORTED_PROVIDERS", () => {
95
96
  * does — fail the build rather than advertise a dropped capability.
96
97
  */
97
98
  it("agrees with VIDEO_REF_LIMITS_BY_PROVIDER (the forwarding-path audit)", () => {
99
+ // A `keyframes` model (Kling 4.0 Keyframes) forwards its Image References
100
+ // as in-between FRAMES — a real forwarding path, deliberately kept out of
101
+ // the pro node (its segments would send cast references as frames).
98
102
  const withRefLimits = Object.keys(VIDEO_REF_LIMITS_BY_PROVIDER).filter(
99
- (id) => MODEL_CATALOG[id]?.kind === "video" && !VIDEO_PROVIDERS_WITHOUT_DISPATCH.has(id),
103
+ (id) =>
104
+ MODEL_CATALOG[id]?.kind === "video" &&
105
+ !VIDEO_PROVIDERS_WITHOUT_DISPATCH.has(id) &&
106
+ !MODEL_CATALOG[id]?.features?.includes("keyframes"),
100
107
  )
101
108
  expect([...GVP_SUPPORTED_PROVIDERS].sort()).toEqual(withRefLimits.sort())
102
109
  })
@@ -0,0 +1,129 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { MODEL_CATALOG, hasFeature } from "../model-catalog.js"
3
+ import {
4
+ IMAGE_TO_VIDEO_PROVIDERS,
5
+ TEXT_TO_VIDEO_PROVIDERS,
6
+ KLING_4_PROVIDERS,
7
+ isKling4Provider,
8
+ normalizeKling4Resolution,
9
+ kling4KeyframeFrameCap,
10
+ VIDEO_REF_LIMITS_BY_PROVIDER,
11
+ VIDEO_REF_VIDEO_DURATION_LIMITS,
12
+ videoProviderRequiresImage,
13
+ videoProviderAppendsFrames,
14
+ isGvpSupportedProvider,
15
+ supportsExtendRender,
16
+ } from "../model-constants.js"
17
+ import { uiAspectRatioFill, uiDurationFill, uiResolutionFill } from "../video-ui-defaults.js"
18
+ import { characterReferencesFromWired, videoCharacterRefProblem } from "../video-character-refs.js"
19
+ import type { ConnectedReference } from "../types.js"
20
+
21
+ describe("kling-4 / kling-4-keyframes catalog", () => {
22
+ it("two Kling-series ids, both modes, 3-30s, 720p/1080p, no seed", () => {
23
+ for (const id of ["kling-4", "kling-4-keyframes"]) {
24
+ const m = MODEL_CATALOG[id]!
25
+ expect(m.series).toBe("Kling") // ⇒ closed to the free tier (FREE_BLOCKED_VIDEO_SERIES)
26
+ expect(m.maker).toBe("kuaishou")
27
+ expect([...m.modes]).toEqual(["i2v", "t2v"])
28
+ expect(m.durations).toEqual(Array.from({ length: 28 }, (_, i) => i + 3))
29
+ expect(m.defaultDuration).toBe(5)
30
+ expect(m.resolutions).toEqual(["720p", "1080p"])
31
+ expect(m.noSeed).toBe(true)
32
+ expect(m.aspectRatios).toEqual(["auto", "16:9", "9:16", "1:1", "21:9"])
33
+ expect(IMAGE_TO_VIDEO_PROVIDERS as readonly string[]).toContain(id)
34
+ expect(TEXT_TO_VIDEO_PROVIDERS as readonly string[]).toContain(id)
35
+ expect(videoProviderRequiresImage(id)).toBe(false)
36
+ }
37
+ expect([...KLING_4_PROVIDERS]).toEqual(["kling-4", "kling-4-keyframes"])
38
+ expect(isKling4Provider("kling-3.0")).toBe(false)
39
+ })
40
+
41
+ it("reference: subjects, voices and reference videos; keyframes: in-between frames on their own channel", () => {
42
+ expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4"]).toEqual({ images: 10, videos: 5, audio: 3, characters: 7, materials: 15 })
43
+ expect(VIDEO_REF_VIDEO_DURATION_LIMITS["kling-4"]).toEqual({ minSec: 2, maxSec: 30 })
44
+ expect(hasFeature("kling-4", "character-subjects")).toBe(true)
45
+ expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4-keyframes"]).toEqual({ images: 8 })
46
+ expect(hasFeature("kling-4-keyframes", "keyframes")).toBe(true)
47
+ expect(videoProviderAppendsFrames("kling-4")).toBe(true)
48
+ expect(videoProviderAppendsFrames("kling-4-keyframes")).toBe(false)
49
+ })
50
+
51
+ it("Generate Video Pro offers kling-4 in keyframes mode only and never the Keyframes id", () => {
52
+ expect(isGvpSupportedProvider("kling-4")).toBe(true)
53
+ expect(supportsExtendRender("kling-4")).toBe(false)
54
+ expect(isGvpSupportedProvider("kling-4-keyframes")).toBe(false)
55
+ })
56
+
57
+ it("the editor fills the rendered defaults: 720p, 5s, auto", () => {
58
+ for (const id of ["kling-4", "kling-4-keyframes"]) {
59
+ expect(uiResolutionFill(id)).toBe("720p")
60
+ expect(uiDurationFill(id)).toBe(5)
61
+ expect(uiAspectRatioFill(id)).toBe("auto")
62
+ }
63
+ })
64
+
65
+ it("normalizeKling4Resolution folds case and collapses anything else to 720p", () => {
66
+ expect(normalizeKling4Resolution("1080P")).toBe("1080p")
67
+ expect(normalizeKling4Resolution(" 1080p ")).toBe("1080p")
68
+ for (const v of [undefined, "", "720p", "480p", "4k", "garbage"]) expect(normalizeKling4Resolution(v)).toBe("720p")
69
+ expect(MODEL_CATALOG["kling-4"]!.unlistedResolutionRendersAs).toBe("720p")
70
+ })
71
+
72
+ it("kling4KeyframeFrameCap is KIE's table: 3s → 4 … 8s → 9, 9s or longer → 10", () => {
73
+ expect([3, 4, 5, 6, 7, 8, 9, 15, 30].map(kling4KeyframeFrameCap)).toEqual([4, 5, 6, 7, 8, 9, 10, 10, 10])
74
+ expect(kling4KeyframeFrameCap(Number.NaN)).toBe(6)
75
+ })
76
+ })
77
+
78
+ describe("characterReferencesFromWired", () => {
79
+ const ref = (over: Partial<ConnectedReference>): ConnectedReference => ({
80
+ id: "x",
81
+ defaultName: "Maya",
82
+ source: "wired-character",
83
+ url: "https://cdn.example/maya.png",
84
+ characterSlug: "maya",
85
+ ...over,
86
+ })
87
+
88
+ it("groups one character's entries: the canonical portrait first, then up to 3 views", () => {
89
+ const out = characterReferencesFromWired([
90
+ ref({ id: "v1", defaultName: "Maya / smile", url: "https://cdn.example/smile.png", variantSlug: "smile" }),
91
+ ref({ id: "c", characterCanonicalDescription: "Short silver hair" }),
92
+ ref({ id: "v2", defaultName: "Maya / side", url: "https://cdn.example/side.png", variantSlug: "side" }),
93
+ ref({ id: "v3", defaultName: "Maya / back", url: "https://cdn.example/back.png", variantSlug: "back" }),
94
+ ref({ id: "v4", defaultName: "Maya / walk", url: "https://cdn.example/walk.png", variantSlug: "walk" }),
95
+ ref({ id: "k", defaultName: "Kira", characterSlug: "kira", url: "https://cdn.example/kira.png", description: "Tall" }),
96
+ ])
97
+ expect(out).toEqual([
98
+ {
99
+ imageUrl: "https://cdn.example/maya.png",
100
+ extraImageUrls: ["https://cdn.example/smile.png", "https://cdn.example/side.png", "https://cdn.example/back.png"],
101
+ description: "Short silver hair",
102
+ name: "Maya",
103
+ },
104
+ { imageUrl: "https://cdn.example/kira.png", description: "Tall", name: "Kira" },
105
+ ])
106
+ })
107
+
108
+ it("skips anything that is not a wired character", () => {
109
+ expect(characterReferencesFromWired([ref({ source: "manual" as ConnectedReference["source"] })])).toEqual([])
110
+ })
111
+ })
112
+
113
+ describe("videoCharacterRefProblem — Kling 4.0's 15-material budget", () => {
114
+ const chars = (n: number) => Array.from({ length: n }, (_, i) => ({ imageUrl: `https://cdn.example/${i}.png`, description: "x" }))
115
+
116
+ it("takes characters beside a start frame (it joins the images)", () => {
117
+ expect(videoCharacterRefProblem({ provider: "kling-4", characterReferences: chars(2), imageCount: 1, videoCount: 0, hasStartFrame: true })).toBeNull()
118
+ })
119
+
120
+ it("refuses more than 15 materials in all and more than 7 characters", () => {
121
+ expect(videoCharacterRefProblem({ provider: "kling-4", characterReferences: chars(7), imageCount: 4, videoCount: 3, audioCount: 1, hasStartFrame: true })?.code).toBe("character_references_quota")
122
+ expect(videoCharacterRefProblem({ provider: "kling-4", characterReferences: chars(8), imageCount: 0, videoCount: 0, hasStartFrame: false })?.code).toBe("character_references_over_limit")
123
+ })
124
+
125
+ it("refuses a Gemini preset voice (Kling takes recorded voices as reference audio)", () => {
126
+ const voiced = [{ ...chars(1)[0]!, voice: { preset: "Kore" as never } }]
127
+ expect(videoCharacterRefProblem({ provider: "kling-4", characterReferences: voiced, imageCount: 0, videoCount: 0, hasStartFrame: false })?.code).toBe("character_voice_unsupported")
128
+ })
129
+ })
@@ -22,11 +22,12 @@ const portrait = (over: Partial<VideoCharacterReference> = {}): VideoCharacterRe
22
22
  })
23
23
 
24
24
  describe("character reference capability (data-driven)", () => {
25
- it("both Gemini Omni SKUs declare a 3-character cap; nothing else does", () => {
25
+ it("both Gemini Omni SKUs declare a 3-character cap, Kling 4.0 a 7-subject cap; nothing else does", () => {
26
26
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-video"]?.characters).toBe(3)
27
27
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-flash"]?.characters).toBe(3)
28
+ expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4"]?.characters).toBe(7)
28
29
  const others = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER)
29
- .filter(([id, l]) => !id.startsWith("gemini-omni") && (l?.characters ?? 0) > 0)
30
+ .filter(([id, l]) => !id.startsWith("gemini-omni") && id !== "kling-4" && (l?.characters ?? 0) > 0)
30
31
  expect(others).toEqual([])
31
32
  })
32
33
 
@@ -153,3 +153,17 @@ describe("stripExportContent — a type's own run results under generic names",
153
153
  expect(other.data).toEqual({ label: "Other", quote: "a quote to show", durationSec: 12 })
154
154
  })
155
155
  })
156
+
157
+ describe("stripExportContent — an MCP conversation step", () => {
158
+ it("keeps where it came from (the user's request), never the exporter's job id", () => {
159
+ const [node] = stripExportContent([
160
+ {
161
+ id: "n",
162
+ type: "generate-image",
163
+ position: { x: 0, y: 0 },
164
+ data: { label: "Generate Image", prompt: "p", mcpProvenance: { tool: "generate_image", userRequest: "two dolphins", jobId: "j1", client: "claude" } },
165
+ } as GenericNode,
166
+ ])
167
+ expect((node.data as Record<string, unknown>).mcpProvenance).toEqual({ tool: "generate_image", userRequest: "two dolphins", client: "claude" })
168
+ })
169
+ })
@@ -59,3 +59,49 @@ export const CAST_SWAP_FACE_MASKING_DEFAULTS = {
59
59
  blurStrengthPct: 2,
60
60
  threshold: 0.5,
61
61
  } as const
62
+
63
+ /**
64
+ * The video engines Cast Swap runs on. A run or estimate that leaves `engine`
65
+ * out runs on `CAST_SWAP_ENGINE_WHEN_OMITTED`, so callers that predate the
66
+ * choice keep what they had.
67
+ */
68
+ export const CAST_SWAP_ENGINES = ["seedance-2-5", "kling-4"] as const
69
+
70
+ export type CastSwapEngine = (typeof CAST_SWAP_ENGINES)[number]
71
+
72
+ /** The engine of a run, estimate or trend that names none. */
73
+ export const CAST_SWAP_ENGINE_WHEN_OMITTED: CastSwapEngine = "seedance-2-5"
74
+
75
+ /**
76
+ * The resolutions each engine renders, the default first. Seedance 2.5's 480p
77
+ * is its draft (`draft` is 480p only); Kling 4 has no draft and no 480p.
78
+ */
79
+ export const CAST_SWAP_RESOLUTIONS_BY_ENGINE = {
80
+ "seedance-2-5": ["480p", "720p", "1080p"],
81
+ "kling-4": ["720p", "1080p"],
82
+ } as const satisfies Record<CastSwapEngine, readonly ("480p" | "720p" | "1080p")[]>
83
+
84
+ /** Whether an engine renders drafts (Seedance 2.5's 480p draft; Kling 4 has none). */
85
+ export function castSwapEngineHasDraft(engine: CastSwapEngine): boolean {
86
+ return engine === "seedance-2-5"
87
+ }
88
+
89
+ /**
90
+ * Where a Kling 4 run cuts the clip to whole seconds (Kling renders whole
91
+ * seconds, and asked for more than the clip it stretches the motion; Seedance
92
+ * 2.5 ignores it): `"cut-end"` (the default) drops the fraction of a second at
93
+ * the clip's end, `"cut-start"` at its start.
94
+ */
95
+ export const CAST_SWAP_KLING_LENGTHS = ["cut-end", "cut-start"] as const
96
+
97
+ export type CastSwapKlingLength = (typeof CAST_SWAP_KLING_LENGTHS)[number]
98
+
99
+ /** The `klingLength` of a run or trend that names none. */
100
+ export const CAST_SWAP_KLING_LENGTH_WHEN_OMITTED: CastSwapKlingLength = "cut-end"
101
+
102
+ /**
103
+ * The most images one Kling 4 Cast Swap run sends, across every role and fixed
104
+ * reference (a role with prepared references counts its one prepared
105
+ * picture). Over it the route answers `too_many_images`.
106
+ */
107
+ export const CAST_SWAP_KLING_MAX_IMAGES = 10
@@ -39,6 +39,14 @@ export interface ProjectedCatalogOption {
39
39
  * URL, so it can be cached indefinitely.
40
40
  */
41
41
  imageUrl?: string
42
+ /**
43
+ * The same picture at several widths, as an HTML `srcset` value
44
+ * (`<url> 240w, <url> 480w, <url> 960w, <url> 1920w`) — present only for a
45
+ * render the Nodaro CDN resizes (Nodaro Cloud: the look previews and the
46
+ * music pickers' pictures). Pass it to `<img srcset>` with a `sizes` so a
47
+ * large tile stays sharp; `imageUrl` is its 480px member.
48
+ */
49
+ imageSrcSet?: string
42
50
  }
43
51
 
44
52
  export interface ProjectedCatalogDimension {