@nodaro/shared 3.46.0 → 3.48.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 (120) hide show
  1. package/dist/{chunk-WJK4O7PJ.cjs → chunk-2FYKQVMA.cjs} +21 -21
  2. package/dist/{chunk-WJK4O7PJ.cjs.map → chunk-2FYKQVMA.cjs.map} +1 -1
  3. package/dist/{chunk-AN44PLSL.js → chunk-2JRAAOQD.js} +3 -3
  4. package/dist/{chunk-AN44PLSL.js.map → chunk-2JRAAOQD.js.map} +1 -1
  5. package/dist/{chunk-I4YI6MAH.js → chunk-3O6JBTJW.js} +3 -3
  6. package/dist/{chunk-I4YI6MAH.js.map → chunk-3O6JBTJW.js.map} +1 -1
  7. package/dist/{chunk-XRRX2S2N.js → chunk-44PLEHQS.js} +28 -5
  8. package/dist/chunk-44PLEHQS.js.map +1 -0
  9. package/dist/{chunk-AAAWIDA4.js → chunk-4ZNG2PHH.js} +8 -8
  10. package/dist/{chunk-AAAWIDA4.js.map → chunk-4ZNG2PHH.js.map} +1 -1
  11. package/dist/{chunk-3YPX4L35.js → chunk-6W4XHOR2.js} +3 -3
  12. package/dist/{chunk-3YPX4L35.js.map → chunk-6W4XHOR2.js.map} +1 -1
  13. package/dist/{chunk-XKLFXNE7.cjs → chunk-A6HWGGU3.cjs} +6 -6
  14. package/dist/{chunk-XKLFXNE7.cjs.map → chunk-A6HWGGU3.cjs.map} +1 -1
  15. package/dist/{chunk-NJG7B6HZ.js → chunk-AKXCJKWT.js} +4 -4
  16. package/dist/{chunk-NJG7B6HZ.js.map → chunk-AKXCJKWT.js.map} +1 -1
  17. package/dist/{chunk-6BVYKKSF.cjs → chunk-BAUQVNG5.cjs} +5 -5
  18. package/dist/{chunk-6BVYKKSF.cjs.map → chunk-BAUQVNG5.cjs.map} +1 -1
  19. package/dist/{chunk-QG6UYOLZ.js → chunk-BWXF34WW.js} +3 -3
  20. package/dist/{chunk-QG6UYOLZ.js.map → chunk-BWXF34WW.js.map} +1 -1
  21. package/dist/{chunk-2FJIWJF2.cjs → chunk-CRCQCK6X.cjs} +21 -21
  22. package/dist/{chunk-2FJIWJF2.cjs.map → chunk-CRCQCK6X.cjs.map} +1 -1
  23. package/dist/{chunk-M3OBRT2H.cjs → chunk-EOY4G4GQ.cjs} +4 -4
  24. package/dist/{chunk-M3OBRT2H.cjs.map → chunk-EOY4G4GQ.cjs.map} +1 -1
  25. package/dist/{chunk-VI3MWT7A.cjs → chunk-FIWTGVGY.cjs} +11 -11
  26. package/dist/{chunk-VI3MWT7A.cjs.map → chunk-FIWTGVGY.cjs.map} +1 -1
  27. package/dist/{chunk-JZOIRN42.js → chunk-FLC5KEYV.js} +3 -3
  28. package/dist/{chunk-JZOIRN42.js.map → chunk-FLC5KEYV.js.map} +1 -1
  29. package/dist/{chunk-22R5ZSVQ.cjs → chunk-FZFHP5SA.cjs} +5 -5
  30. package/dist/{chunk-22R5ZSVQ.cjs.map → chunk-FZFHP5SA.cjs.map} +1 -1
  31. package/dist/{chunk-LBGKTQB7.cjs → chunk-FZQVONQ2.cjs} +12 -12
  32. package/dist/{chunk-LBGKTQB7.cjs.map → chunk-FZQVONQ2.cjs.map} +1 -1
  33. package/dist/{chunk-BVVKMQKR.cjs → chunk-G5NTNQ7W.cjs} +8 -2
  34. package/dist/chunk-G5NTNQ7W.cjs.map +1 -0
  35. package/dist/{chunk-GBKDNDEM.js → chunk-G7MSESCZ.js} +4 -4
  36. package/dist/chunk-G7MSESCZ.js.map +1 -0
  37. package/dist/{chunk-VZCZQ3AU.cjs → chunk-GBB4VVVZ.cjs} +45 -45
  38. package/dist/{chunk-VZCZQ3AU.cjs.map → chunk-GBB4VVVZ.cjs.map} +1 -1
  39. package/dist/{chunk-VB7ZRCFV.js → chunk-GFK4DZFC.js} +4 -4
  40. package/dist/{chunk-VB7ZRCFV.js.map → chunk-GFK4DZFC.js.map} +1 -1
  41. package/dist/{chunk-KF6C6MIE.js → chunk-H3HV4OZM.js} +4 -4
  42. package/dist/{chunk-KF6C6MIE.js.map → chunk-H3HV4OZM.js.map} +1 -1
  43. package/dist/{chunk-FVRCU6BX.cjs → chunk-HP4X2XGD.cjs} +8 -8
  44. package/dist/{chunk-FVRCU6BX.cjs.map → chunk-HP4X2XGD.cjs.map} +1 -1
  45. package/dist/{chunk-CKWM75AR.cjs → chunk-HS2IAUYM.cjs} +6 -6
  46. package/dist/{chunk-CKWM75AR.cjs.map → chunk-HS2IAUYM.cjs.map} +1 -1
  47. package/dist/{chunk-OVLY5XO4.cjs → chunk-HZMZLUU3.cjs} +4 -4
  48. package/dist/{chunk-OVLY5XO4.cjs.map → chunk-HZMZLUU3.cjs.map} +1 -1
  49. package/dist/{chunk-6KAEQ3GU.js → chunk-KV6MNZHI.js} +3 -3
  50. package/dist/{chunk-6KAEQ3GU.js.map → chunk-KV6MNZHI.js.map} +1 -1
  51. package/dist/{chunk-2HIDE3QV.js → chunk-LKCPFD5X.js} +7 -3
  52. package/dist/chunk-LKCPFD5X.js.map +1 -0
  53. package/dist/{chunk-Y7E6A7DU.js → chunk-P3A3QVFA.js} +4 -4
  54. package/dist/{chunk-Y7E6A7DU.js.map → chunk-P3A3QVFA.js.map} +1 -1
  55. package/dist/{chunk-27FFL4HJ.cjs → chunk-PNYOLAD6.cjs} +43 -43
  56. package/dist/{chunk-27FFL4HJ.cjs.map → chunk-PNYOLAD6.cjs.map} +1 -1
  57. package/dist/{chunk-BHL6P3O5.cjs → chunk-TQH7DYZP.cjs} +4 -4
  58. package/dist/chunk-TQH7DYZP.cjs.map +1 -0
  59. package/dist/chunk-UEXF2XQH.cjs +27 -0
  60. package/dist/{chunk-R6QC7QTO.cjs.map → chunk-UEXF2XQH.cjs.map} +1 -1
  61. package/dist/{chunk-U2CCL5YF.js → chunk-UTCOO6PQ.js} +3 -3
  62. package/dist/{chunk-U2CCL5YF.js.map → chunk-UTCOO6PQ.js.map} +1 -1
  63. package/dist/{chunk-3ZSMOVIE.js → chunk-VNB4BH36.js} +5 -5
  64. package/dist/{chunk-3ZSMOVIE.js.map → chunk-VNB4BH36.js.map} +1 -1
  65. package/dist/{chunk-N27WN2UX.cjs → chunk-XYUCAZS6.cjs} +66 -38
  66. package/dist/chunk-XYUCAZS6.cjs.map +1 -0
  67. package/dist/{chunk-PVTRJSSI.js → chunk-Y5DCFOLQ.js} +3 -3
  68. package/dist/{chunk-PVTRJSSI.js.map → chunk-Y5DCFOLQ.js.map} +1 -1
  69. package/dist/{chunk-UA6TJLWG.cjs → chunk-ZEMK3FPF.cjs} +8 -8
  70. package/dist/{chunk-UA6TJLWG.cjs.map → chunk-ZEMK3FPF.cjs.map} +1 -1
  71. package/dist/{chunk-5YVESC4X.js → chunk-ZHRU7HF3.js} +5 -5
  72. package/dist/{chunk-5YVESC4X.js.map → chunk-ZHRU7HF3.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/entities.cjs +131 -123
  80. package/dist/entries/entities.d.cts +13 -1
  81. package/dist/entries/entities.d.ts +13 -1
  82. package/dist/entries/entities.js +1 -1
  83. package/dist/entries/model-catalog.cjs +66 -66
  84. package/dist/entries/model-catalog.d.cts +2 -2
  85. package/dist/entries/model-catalog.d.ts +2 -2
  86. package/dist/entries/model-catalog.js +4 -4
  87. package/dist/entries/models.cjs +291 -271
  88. package/dist/entries/models.d.cts +49 -2
  89. package/dist/entries/models.d.ts +49 -2
  90. package/dist/entries/models.js +4 -4
  91. package/dist/entries/nodes.cjs +206 -206
  92. package/dist/entries/nodes.d.cts +1 -1
  93. package/dist/entries/nodes.d.ts +1 -1
  94. package/dist/entries/nodes.js +8 -8
  95. package/dist/entries/pipeline.cjs +149 -149
  96. package/dist/entries/pipeline.js +3 -3
  97. package/dist/entries/ugc.cjs +71 -71
  98. package/dist/entries/ugc.js +4 -4
  99. package/dist/entries/video.cjs +117 -117
  100. package/dist/entries/video.js +4 -4
  101. package/dist/index.cjs +1199 -1171
  102. package/dist/index.d.cts +3 -3
  103. package/dist/index.d.ts +3 -3
  104. package/dist/index.js +18 -18
  105. package/dist/{model-catalog-dQPdLltX.d.ts → model-catalog-Ciqsc0ha.d.cts} +16 -0
  106. package/dist/{model-catalog-dQPdLltX.d.cts → model-catalog-Ciqsc0ha.d.ts} +16 -0
  107. package/package.json +1 -1
  108. package/src/__tests__/audio-soundtrack.test.ts +49 -0
  109. package/src/audio-soundtrack.ts +75 -0
  110. package/src/entries/entities.ts +1 -0
  111. package/src/entries/models.ts +7 -0
  112. package/src/keepers-limits.ts +13 -0
  113. package/src/model-catalog.ts +18 -2
  114. package/dist/chunk-2HIDE3QV.js.map +0 -1
  115. package/dist/chunk-BHL6P3O5.cjs.map +0 -1
  116. package/dist/chunk-BVVKMQKR.cjs.map +0 -1
  117. package/dist/chunk-GBKDNDEM.js.map +0 -1
  118. package/dist/chunk-N27WN2UX.cjs.map +0 -1
  119. package/dist/chunk-R6QC7QTO.cjs +0 -27
  120. package/dist/chunk-XRRX2S2N.js.map +0 -1
@@ -0,0 +1,75 @@
1
+ import { hasFeature } from "./model-catalog.js"
2
+
3
+ /**
4
+ * Audio soundtrack: a video model whose reference audio clips are VOICE samples
5
+ * (catalog feature `voice-references`, Kling 4.0) cannot play a clip as it is —
6
+ * but it keeps a reference VIDEO's own sound when asked (`keep_original_sound`).
7
+ * A model declaring `audio-soundtrack` therefore plays the FIRST reference audio
8
+ * clip as the result's soundtrack: the platform turns that clip into a short
9
+ * reference video (one still frame carrying the audio) and sends it with the
10
+ * video's sound kept, so the people in the scene perform to the exact track.
11
+ * Any further clips stay voice samples.
12
+ *
13
+ * On by default (`audioSoundtrack` unset = on); a caller turns it off with
14
+ * `audioSoundtrack: false`. The clip then IS a reference video everywhere a run
15
+ * is checked or priced — the reference-video price, the 5-clip and 30-second
16
+ * caps — because the request carries it as one before any of those run.
17
+ */
18
+
19
+ /** The shortest reference video Kling 4.0 accepts; a shorter clip is padded with silence. */
20
+ export const AUDIO_SOUNDTRACK_MIN_SEC = 2
21
+
22
+ /** The soundtrack clip's frame rate: its length is a whole number of these frames. */
23
+ export const AUDIO_SOUNDTRACK_FPS = 24
24
+
25
+ /** Whether this run plays its first reference audio clip as the soundtrack. */
26
+ export function audioSoundtrackActive(args: {
27
+ provider: string | undefined
28
+ /** The node / request lever; unset = on. */
29
+ audioSoundtrack: boolean | undefined
30
+ /** How many reference audio clips the run carries (or has wired). */
31
+ audioRefCount: number
32
+ }): boolean {
33
+ return (
34
+ !!args.provider &&
35
+ hasFeature(args.provider, "audio-soundtrack") &&
36
+ args.audioSoundtrack !== false &&
37
+ args.audioRefCount > 0
38
+ )
39
+ }
40
+
41
+ /**
42
+ * The length of the soundtrack clip a run sends: the audio's own length, at
43
+ * least {@link AUDIO_SOUNDTRACK_MIN_SEC} (padded with silence) and at most the
44
+ * clip being made (the rest of a longer track is not played), on whole frames
45
+ * of {@link AUDIO_SOUNDTRACK_FPS} — the length the rendered file measures, so
46
+ * the quote, the estimate and the run's own reservation all read one number.
47
+ * An audio whose length is unknown counts as the whole clip — the longest it
48
+ * can be, so a price built from it is never below the run's.
49
+ */
50
+ export function audioSoundtrackClipSec(audioSec: number, outputSec: number): number {
51
+ const sec = !Number.isFinite(audioSec) || audioSec <= 0 ? outputSec : Math.min(outputSec, Math.max(AUDIO_SOUNDTRACK_MIN_SEC, audioSec))
52
+ return Math.round(sec * AUDIO_SOUNDTRACK_FPS) / AUDIO_SOUNDTRACK_FPS
53
+ }
54
+
55
+ /**
56
+ * The prompt for a soundtrack run: the soundtrack clip is reference video
57
+ * `@video_<videoNumber>` (after the caller's own clips), so a mention of the
58
+ * first audio clip (`@audio_1`) now names it, and the remaining audio clips
59
+ * move down one (`@audio_2` → `@audio_1`). A sentence before the prompt says
60
+ * what that clip is for, when it fits within `maxChars` (the model's prompt
61
+ * limit) — a prompt already near the limit keeps only the renaming.
62
+ */
63
+ export function audioSoundtrackPrompt(prompt: string, videoNumber: number, maxChars = Number.POSITIVE_INFINITY): string {
64
+ const video = `@video_${videoNumber}`
65
+ const renamed = prompt.replace(/@audio_(\d+)(?![\w一-龥])/g, (whole, digits: string) => {
66
+ const n = Number(digits)
67
+ if (n === 1) return video
68
+ return n > 1 ? `@audio_${n - 1}` : whole
69
+ })
70
+ const lead =
71
+ `${video} is the soundtrack: the people in the scene perform to this exact audio, ` +
72
+ "their lips in sync with any singing or speech. Take only its sound, nothing from its picture."
73
+ const withLead = renamed.trim() ? `${lead}\n${renamed}` : lead
74
+ return withLead.length <= maxChars ? withLead : renamed
75
+ }
@@ -7,6 +7,7 @@
7
7
  */
8
8
  export { FEATURED_ENTITIES, getFeaturedEntities } from "../featured-entities.js"
9
9
  export type { FeaturedEntity } from "../featured-entities.js"
10
+ export { KEEPER_CATALOG_CATEGORY_MAX, KEEPER_CATALOG_SORT_MAX } from "../keepers-limits.js"
10
11
  export {
11
12
  IMAGE_REF_TYPES,
12
13
  PASSTHROUGH_TYPES,
@@ -366,3 +366,10 @@ export type {
366
366
  TopazVideoTargetInput,
367
367
  TopazVideoTarget,
368
368
  } from "../topaz-video.js"
369
+ export {
370
+ AUDIO_SOUNDTRACK_MIN_SEC,
371
+ AUDIO_SOUNDTRACK_FPS,
372
+ audioSoundtrackActive,
373
+ audioSoundtrackClipSec,
374
+ audioSoundtrackPrompt,
375
+ } from "../audio-soundtrack.js"
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Nodaro Keepers — the bounds of a shelf entry, shared by the route that
3
+ * validates `PUT /v1/<kind>/:id/catalog`, the cursor it hands out and the
4
+ * Studio dialog that writes through it, so the form refuses exactly what the
5
+ * server would. Documented in the API and SDK references; a change here is
6
+ * a change to the public contract.
7
+ */
8
+
9
+ /** `catalogSort` (the shelf order) is an integer within ±this. */
10
+ export const KEEPER_CATALOG_SORT_MAX = 1_000_000
11
+
12
+ /** `catalogCategory` (the shelf heading) is at most this many characters. */
13
+ export const KEEPER_CATALOG_CATEGORY_MAX = 80
@@ -286,6 +286,22 @@ export interface ModelCatalogEntry {
286
286
  * reaches the model as a NAMED SUBJECT built from several of its images
287
287
  * (`characterReferencesFromWired` → `characterReferences`), not only as a
288
288
  * reference image (Kling 4.0: KIE `elements`, `@Name` in the prompt).
289
+ *
290
+ * `"voice-references"` (video models only) means the model takes each
291
+ * reference AUDIO clip as a VOICE sample — who speaks and how they sound —
292
+ * and makes its own soundtrack, rather than conditioning on the audio itself
293
+ * (Kling 4.0: KIE `voices`, `@VoiceN` in the prompt). The editor names that
294
+ * input "Voice Refs" for such a model.
295
+ *
296
+ * `"audio-soundtrack"` (video models only) means the platform can play the
297
+ * model's FIRST reference audio clip as the result's soundtrack: it sends
298
+ * that clip as a reference video (a still frame carrying the audio) with the
299
+ * video's own sound kept, so the scene is performed to the exact track (see
300
+ * `audio-soundtrack.ts`). On unless a run sets `audioSoundtrack: false`.
301
+ *
302
+ * `"audio-to-video"` (video models only) means ONE reference audio clip
303
+ * drives the generation — the picture is made to that audio (LTX 2.3 Pro's
304
+ * `audio_to_video` task). The node's Audio Refs input then takes one clip.
289
305
  */
290
306
  features?: readonly string[]
291
307
  /**
@@ -1813,7 +1829,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
1813
1829
  // `video-reference` is NOT declared: like wan-3, the generate-video-pro
1814
1830
  // extend chain (a continuation tail sent as a reference video) is unwired
1815
1831
  // for it, so the pro node offers it in keyframes mode only.
1816
- features: ["audio", "reference-image", "reference-to-video", "character-subjects"],
1832
+ features: ["audio", "reference-image", "reference-to-video", "character-subjects", "voice-references", "audio-soundtrack"],
1817
1833
  aspectRatios: VIDEO_RATIOS_KLING_4,
1818
1834
  durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
1819
1835
  defaultDuration: 5,
@@ -2275,7 +2291,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
2275
2291
  series: "LTX",
2276
2292
  description: "Lightricks LTX 2.3 Pro — text/image/audio→video up to 4K, 6/8/10s, end-frame interpolation.",
2277
2293
  useCases: ["premium", "high-res", "narrative"],
2278
- features: ["end-frame"],
2294
+ features: ["end-frame", "audio-to-video"],
2279
2295
  aspectRatios: ["16:9", "9:16"] as const,
2280
2296
  resolutions: ["1080p", "2k", "4k"] as const,
2281
2297
  durations: [6, 8, 10],