@nodaro/shared 1.10.0 → 1.11.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.
- package/dist/index.cjs +18 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -7
- package/dist/index.d.ts +20 -7
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/credit-identifiers.test.ts +24 -12
- package/src/__tests__/video-audio-capability.test.ts +34 -6
- package/src/credit-identifiers.ts +8 -2
- package/src/model-constants.ts +36 -10
package/dist/index.d.cts
CHANGED
|
@@ -1060,8 +1060,13 @@ declare const AUDIO_ADDON_PROVIDERS: Set<string>;
|
|
|
1060
1060
|
* lip-synced spoken dialogue. Toggle is offered; the
|
|
1061
1061
|
* pipeline still uses TTS + lip-sync for dialogue.
|
|
1062
1062
|
* "native_speech" — bakes spoken dialogue + lip movement from the prompt
|
|
1063
|
-
* (VEO 3.x
|
|
1064
|
-
*
|
|
1063
|
+
* (VEO 3.x always-on; Kling 2.6/3.0 behind the `sound`
|
|
1064
|
+
* toggle — probe-verified 2026-07-16: scripted lines come
|
|
1065
|
+
* back word-for-word with articulated lips on the KIE
|
|
1066
|
+
* path, matching the official Kling 2.6 audio guide and
|
|
1067
|
+
* Kling 3.0 prompting docs). The pipeline injects the
|
|
1068
|
+
* dialogue line, enables audio, and revoices the clip to
|
|
1069
|
+
* the character's saved voice.
|
|
1065
1070
|
* "audio_driven" — lip-syncs to a supplied reference-audio track (Seedance
|
|
1066
1071
|
* 2.0 multimodal). The pipeline synthesises the character's
|
|
1067
1072
|
* voice first, feeds it as reference audio, and skips the
|
|
@@ -1076,6 +1081,14 @@ interface VideoAudioCapability {
|
|
|
1076
1081
|
alwaysOn?: boolean;
|
|
1077
1082
|
/** Enabling audio raises the credit cost (Kling — see AUDIO_ADDON_PROVIDERS). */
|
|
1078
1083
|
affectsCost?: boolean;
|
|
1084
|
+
/**
|
|
1085
|
+
* The model generates audio when the caller expresses NO intent (its own
|
|
1086
|
+
* config default is on — kling-3.0's `sound: true`, kling-3-omni's
|
|
1087
|
+
* `generate_audio: true`). The `:audio` credit suffix mirrors this default
|
|
1088
|
+
* so an intent-less request is billed for the audio it actually produces
|
|
1089
|
+
* (see buildVideoCreditModelIdentifier). Absent ⇒ default off.
|
|
1090
|
+
*/
|
|
1091
|
+
defaultOn?: boolean;
|
|
1079
1092
|
}
|
|
1080
1093
|
/**
|
|
1081
1094
|
* Per-model audio capability. Only models that produce SOME audio are listed;
|
|
@@ -1097,11 +1110,11 @@ declare function getVideoAudioCapability(model: string | undefined): VideoAudioC
|
|
|
1097
1110
|
declare function videoModelSupportsAudio(model: string | undefined): boolean;
|
|
1098
1111
|
/**
|
|
1099
1112
|
* True when the model can produce lip-synced spoken DIALOGUE — either natively
|
|
1100
|
-
* (VEO) or driven by a supplied audio track (Seedance
|
|
1101
|
-
* dialogue auto-pick: in-model speech + character
|
|
1102
|
-
* reference audio (Seedance 2.0) vs.
|
|
1103
|
-
* Ambient-only models (
|
|
1104
|
-
* not speech.
|
|
1113
|
+
* (VEO 3.x, Kling 2.6/3.0/Omni) or driven by a supplied audio track (Seedance
|
|
1114
|
+
* 2.0). Drives the Story→Video dialogue auto-pick: in-model speech + character
|
|
1115
|
+
* revoice (VEO, Kling) / character-voiced reference audio (Seedance 2.0) vs.
|
|
1116
|
+
* the TTS + separate-lip-sync fallback. Ambient-only models (Seedance 1.x)
|
|
1117
|
+
* return `false` — their audio is SFX, not speech.
|
|
1105
1118
|
*/
|
|
1106
1119
|
declare function videoModelCanSpeakDialogue(model: string | undefined): boolean;
|
|
1107
1120
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1060,8 +1060,13 @@ declare const AUDIO_ADDON_PROVIDERS: Set<string>;
|
|
|
1060
1060
|
* lip-synced spoken dialogue. Toggle is offered; the
|
|
1061
1061
|
* pipeline still uses TTS + lip-sync for dialogue.
|
|
1062
1062
|
* "native_speech" — bakes spoken dialogue + lip movement from the prompt
|
|
1063
|
-
* (VEO 3.x
|
|
1064
|
-
*
|
|
1063
|
+
* (VEO 3.x always-on; Kling 2.6/3.0 behind the `sound`
|
|
1064
|
+
* toggle — probe-verified 2026-07-16: scripted lines come
|
|
1065
|
+
* back word-for-word with articulated lips on the KIE
|
|
1066
|
+
* path, matching the official Kling 2.6 audio guide and
|
|
1067
|
+
* Kling 3.0 prompting docs). The pipeline injects the
|
|
1068
|
+
* dialogue line, enables audio, and revoices the clip to
|
|
1069
|
+
* the character's saved voice.
|
|
1065
1070
|
* "audio_driven" — lip-syncs to a supplied reference-audio track (Seedance
|
|
1066
1071
|
* 2.0 multimodal). The pipeline synthesises the character's
|
|
1067
1072
|
* voice first, feeds it as reference audio, and skips the
|
|
@@ -1076,6 +1081,14 @@ interface VideoAudioCapability {
|
|
|
1076
1081
|
alwaysOn?: boolean;
|
|
1077
1082
|
/** Enabling audio raises the credit cost (Kling — see AUDIO_ADDON_PROVIDERS). */
|
|
1078
1083
|
affectsCost?: boolean;
|
|
1084
|
+
/**
|
|
1085
|
+
* The model generates audio when the caller expresses NO intent (its own
|
|
1086
|
+
* config default is on — kling-3.0's `sound: true`, kling-3-omni's
|
|
1087
|
+
* `generate_audio: true`). The `:audio` credit suffix mirrors this default
|
|
1088
|
+
* so an intent-less request is billed for the audio it actually produces
|
|
1089
|
+
* (see buildVideoCreditModelIdentifier). Absent ⇒ default off.
|
|
1090
|
+
*/
|
|
1091
|
+
defaultOn?: boolean;
|
|
1079
1092
|
}
|
|
1080
1093
|
/**
|
|
1081
1094
|
* Per-model audio capability. Only models that produce SOME audio are listed;
|
|
@@ -1097,11 +1110,11 @@ declare function getVideoAudioCapability(model: string | undefined): VideoAudioC
|
|
|
1097
1110
|
declare function videoModelSupportsAudio(model: string | undefined): boolean;
|
|
1098
1111
|
/**
|
|
1099
1112
|
* True when the model can produce lip-synced spoken DIALOGUE — either natively
|
|
1100
|
-
* (VEO) or driven by a supplied audio track (Seedance
|
|
1101
|
-
* dialogue auto-pick: in-model speech + character
|
|
1102
|
-
* reference audio (Seedance 2.0) vs.
|
|
1103
|
-
* Ambient-only models (
|
|
1104
|
-
* not speech.
|
|
1113
|
+
* (VEO 3.x, Kling 2.6/3.0/Omni) or driven by a supplied audio track (Seedance
|
|
1114
|
+
* 2.0). Drives the Story→Video dialogue auto-pick: in-model speech + character
|
|
1115
|
+
* revoice (VEO, Kling) / character-voiced reference audio (Seedance 2.0) vs.
|
|
1116
|
+
* the TTS + separate-lip-sync fallback. Ambient-only models (Seedance 1.x)
|
|
1117
|
+
* return `false` — their audio is SFX, not speech.
|
|
1105
1118
|
*/
|
|
1106
1119
|
declare function videoModelCanSpeakDialogue(model: string | undefined): boolean;
|
|
1107
1120
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2944,9 +2944,22 @@ var VIDEO_AUDIO_CAPABILITY = {
|
|
|
2944
2944
|
veo3: { mode: "native_speech", alwaysOn: true },
|
|
2945
2945
|
"veo3.1": { mode: "native_speech", alwaysOn: true },
|
|
2946
2946
|
veo3_lite: { mode: "native_speech", alwaysOn: true },
|
|
2947
|
-
// Kling 2.6 / 3.0 —
|
|
2948
|
-
|
|
2949
|
-
|
|
2947
|
+
// Kling 2.6 / 3.0 — native spoken dialogue + lip sync behind the `sound`
|
|
2948
|
+
// toggle (probe-verified on the KIE path 2026-07-16: scripted quoted lines
|
|
2949
|
+
// are spoken verbatim with articulated lips; the official Kling 2.6 audio
|
|
2950
|
+
// guide documents speech/dialogue/narration/singing with [Character@Voice]
|
|
2951
|
+
// binding, zh+en voices). Cost-affecting: `:audio` credit suffix.
|
|
2952
|
+
// kling-3.0's model default is sound ON (kie models.ts extraParams +
|
|
2953
|
+
// kling3-client `?? true`) → defaultOn keeps billing aligned with what an
|
|
2954
|
+
// intent-less request actually generates; kling 2.6 defaults OFF.
|
|
2955
|
+
kling: { mode: "native_speech", field: "sound", affectsCost: true },
|
|
2956
|
+
"kling-3.0": { mode: "native_speech", field: "sound", affectsCost: true, defaultOn: true },
|
|
2957
|
+
// Kling 3.0 Omni (Replicate kwaivgi/kling-v3-omni-video) — the Omni tier's
|
|
2958
|
+
// headline feature IS native dialogue (per-character voices, unified audio
|
|
2959
|
+
// timeline). Lever is Replicate's `generate_audio` (default true in our
|
|
2960
|
+
// provider config → defaultOn); audio is priced into the flat per-duration
|
|
2961
|
+
// rate, so NOT cost-affecting (no :audio composite).
|
|
2962
|
+
"kling-3-omni": { mode: "native_speech", field: "generateAudio", defaultOn: true },
|
|
2950
2963
|
// Seedance 1.x — optional ambient audio (generate_audio); not dialogue.
|
|
2951
2964
|
seedance: { mode: "ambient", field: "generateAudio" },
|
|
2952
2965
|
// Seedance 2.0 — multimodal; lip-syncs to a supplied reference-audio track.
|
|
@@ -3708,7 +3721,8 @@ function buildVideoCreditModelIdentifier(provider, duration, sound, nodeType, mo
|
|
|
3708
3721
|
if (!tiers) return effectiveProvider;
|
|
3709
3722
|
const tier = tiers.find((t2) => durationSec <= t2.maxSeconds) ?? tiers[tiers.length - 1];
|
|
3710
3723
|
let identifier = `${effectiveProvider}:${tier.suffix}`;
|
|
3711
|
-
|
|
3724
|
+
const soundOn = sound ?? getVideoAudioCapability(effectiveProvider).defaultOn === true;
|
|
3725
|
+
if (AUDIO_ADDON_PROVIDERS.has(effectiveProvider) && soundOn) {
|
|
3712
3726
|
identifier += ":audio";
|
|
3713
3727
|
}
|
|
3714
3728
|
if (MODE_ADDON_PROVIDERS.has(effectiveProvider) && (mode === "high" || mode === "pro")) {
|