@nodaro/shared 1.10.0 → 1.12.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 CHANGED
@@ -1690,6 +1690,26 @@ var VIDEO_MODELS = {
1690
1690
  { identifier: "video-analysis:gemini-3.1-pro:360s", credits: 7 },
1691
1691
  { identifier: "video-analysis:gemini-3.1-pro:600s", credits: 11, note: "10-min ceiling" }
1692
1692
  ]
1693
+ },
1694
+ // Both mixed tiers are variants of the same advanced multi-engine analysis
1695
+ // and share this ONE credit family (videoAnalysisCreditSegment maps both;
1696
+ // plan internals live in the private analysis plugin).
1697
+ "mixed-video-analysis": {
1698
+ id: "mixed-video-analysis",
1699
+ kind: "video",
1700
+ modes: ["video-analysis"],
1701
+ family: "Nodaro",
1702
+ label: "Video Analysis (Mixed)",
1703
+ series: "Video Analysis",
1704
+ description: "Our most advanced analysis tier \u2014 multiple analysis engines combined into one result for maximum completeness and accuracy. Billed per duration bucket.",
1705
+ useCases: ["video-analysis", "shot-list", "premium", "most-complete"],
1706
+ pricing: [
1707
+ { identifier: "video-analysis:mixed", credits: 14, note: "10-min ceiling (no duration given)" },
1708
+ { identifier: "video-analysis:mixed:60s", credits: 3 },
1709
+ { identifier: "video-analysis:mixed:180s", credits: 4 },
1710
+ { identifier: "video-analysis:mixed:360s", credits: 9 },
1711
+ { identifier: "video-analysis:mixed:600s", credits: 14, note: "10-min ceiling" }
1712
+ ]
1693
1713
  }
1694
1714
  };
1695
1715
  var AUDIO_MODELS = {
@@ -2946,9 +2966,22 @@ var VIDEO_AUDIO_CAPABILITY = {
2946
2966
  veo3: { mode: "native_speech", alwaysOn: true },
2947
2967
  "veo3.1": { mode: "native_speech", alwaysOn: true },
2948
2968
  veo3_lite: { mode: "native_speech", alwaysOn: true },
2949
- // Kling 2.6 / 3.0 — ambient sound/SFX toggle; not lip-synced speech. Cost-affecting.
2950
- kling: { mode: "ambient", field: "sound", affectsCost: true },
2951
- "kling-3.0": { mode: "ambient", field: "sound", affectsCost: true },
2969
+ // Kling 2.6 / 3.0 — native spoken dialogue + lip sync behind the `sound`
2970
+ // toggle (probe-verified on the KIE path 2026-07-16: scripted quoted lines
2971
+ // are spoken verbatim with articulated lips; the official Kling 2.6 audio
2972
+ // guide documents speech/dialogue/narration/singing with [Character@Voice]
2973
+ // binding, zh+en voices). Cost-affecting: `:audio` credit suffix.
2974
+ // kling-3.0's model default is sound ON (kie models.ts extraParams +
2975
+ // kling3-client `?? true`) → defaultOn keeps billing aligned with what an
2976
+ // intent-less request actually generates; kling 2.6 defaults OFF.
2977
+ kling: { mode: "native_speech", field: "sound", affectsCost: true },
2978
+ "kling-3.0": { mode: "native_speech", field: "sound", affectsCost: true, defaultOn: true },
2979
+ // Kling 3.0 Omni (Replicate kwaivgi/kling-v3-omni-video) — the Omni tier's
2980
+ // headline feature IS native dialogue (per-character voices, unified audio
2981
+ // timeline). Lever is Replicate's `generate_audio` (default true in our
2982
+ // provider config → defaultOn); audio is priced into the flat per-duration
2983
+ // rate, so NOT cost-affecting (no :audio composite).
2984
+ "kling-3-omni": { mode: "native_speech", field: "generateAudio", defaultOn: true },
2952
2985
  // Seedance 1.x — optional ambient audio (generate_audio); not dialogue.
2953
2986
  seedance: { mode: "ambient", field: "generateAudio" },
2954
2987
  // Seedance 2.0 — multimodal; lip-syncs to a supplied reference-audio track.
@@ -3710,7 +3743,8 @@ function buildVideoCreditModelIdentifier(provider, duration, sound, nodeType, mo
3710
3743
  if (!tiers) return effectiveProvider;
3711
3744
  const tier = tiers.find((t2) => durationSec <= t2.maxSeconds) ?? tiers[tiers.length - 1];
3712
3745
  let identifier = `${effectiveProvider}:${tier.suffix}`;
3713
- if (AUDIO_ADDON_PROVIDERS.has(effectiveProvider) && sound) {
3746
+ const soundOn = sound ?? getVideoAudioCapability(effectiveProvider).defaultOn === true;
3747
+ if (AUDIO_ADDON_PROVIDERS.has(effectiveProvider) && soundOn) {
3714
3748
  identifier += ":audio";
3715
3749
  }
3716
3750
  if (MODE_ADDON_PROVIDERS.has(effectiveProvider) && (mode === "high" || mode === "pro")) {
@@ -4474,15 +4508,27 @@ function resolveLlmCreditId(feature, body) {
4474
4508
  }
4475
4509
  var VIDEO_ANALYSIS_LLM_MODELS = LLM_MODELS.filter((m) => getLlmModalityCaps(m.id).video && getLlmModalityCaps(m.id).audio).map((m) => m.id);
4476
4510
  var VIDEO_ANALYSIS_TIERS = { fast: "gemini-3-flash", pro: "gemini-3.1-pro" };
4477
- var VIDEO_ANALYSIS_TIER_ORDER = ["pro", "fast"];
4511
+ var VIDEO_ANALYSIS_MIXED_TIERS = ["mixed", "mixed-fast"];
4512
+ var VIDEO_ANALYSIS_TIER_ORDER = ["pro", "fast", "mixed", "mixed-fast"];
4478
4513
  var DEFAULT_VIDEO_ANALYSIS_TIER = "pro";
4479
4514
  var DEFAULT_VIDEO_ANALYSIS_MODEL = VIDEO_ANALYSIS_TIERS[DEFAULT_VIDEO_ANALYSIS_TIER];
4480
- var VIDEO_ANALYSIS_TIER_LABELS = { fast: "Fast", pro: "Pro" };
4515
+ var VIDEO_ANALYSIS_TIER_LABELS = {
4516
+ fast: "Fast",
4517
+ pro: "Pro",
4518
+ mixed: "Mixed",
4519
+ "mixed-fast": "Mixed (consistent)"
4520
+ };
4481
4521
  function isVideoAnalysisTier(v) {
4482
- return Object.prototype.hasOwnProperty.call(VIDEO_ANALYSIS_TIERS, v);
4522
+ return VIDEO_ANALYSIS_TIER_ORDER.includes(v);
4523
+ }
4524
+ function isVideoAnalysisMixedTier(v) {
4525
+ return VIDEO_ANALYSIS_MIXED_TIERS.includes(v);
4483
4526
  }
4484
4527
  function resolveVideoAnalysisModel(input) {
4485
- if (input && isVideoAnalysisTier(input)) return VIDEO_ANALYSIS_TIERS[input];
4528
+ if (input && isVideoAnalysisMixedTier(input)) return input;
4529
+ if (input && Object.prototype.hasOwnProperty.call(VIDEO_ANALYSIS_TIERS, input)) {
4530
+ return VIDEO_ANALYSIS_TIERS[input];
4531
+ }
4486
4532
  if (input && VIDEO_ANALYSIS_LLM_MODELS.includes(input)) return input;
4487
4533
  return DEFAULT_VIDEO_ANALYSIS_MODEL;
4488
4534
  }
@@ -12110,15 +12156,25 @@ var VIDEO_ANALYSIS_BUCKET_CREDITS = {
12110
12156
  "video-analysis:gemini-3.1-pro:60s": 2,
12111
12157
  "video-analysis:gemini-3.1-pro:180s": 3,
12112
12158
  "video-analysis:gemini-3.1-pro:360s": 7,
12113
- "video-analysis:gemini-3.1-pro:600s": 11
12159
+ "video-analysis:gemini-3.1-pro:600s": 11,
12160
+ // Mixed tiers (`mixed` + `mixed-fast`) share ONE credit family — they are
12161
+ // variants of the same engine plan (plan internals live in the private
12162
+ // analysis plugin). Admin-tunable via model_pricing like every other row.
12163
+ "video-analysis:mixed:60s": 3,
12164
+ "video-analysis:mixed:180s": 4,
12165
+ "video-analysis:mixed:360s": 9,
12166
+ "video-analysis:mixed:600s": 14
12114
12167
  };
12168
+ function videoAnalysisCreditSegment(modelOrSentinel) {
12169
+ return modelOrSentinel === "mixed-fast" ? "mixed" : modelOrSentinel;
12170
+ }
12115
12171
  function pickVideoAnalysisBucket(durationSec) {
12116
12172
  for (const b of VIDEO_ANALYSIS_DURATION_BUCKETS) if (durationSec <= b) return b;
12117
12173
  return VIDEO_ANALYSIS_MAX_DURATION_SEC;
12118
12174
  }
12119
12175
  function buildVideoAnalysisCreditId(model, durationSec) {
12120
12176
  const bucket = durationSec !== void 0 && durationSec > 0 ? pickVideoAnalysisBucket(Math.min(durationSec, VIDEO_ANALYSIS_MAX_DURATION_SEC)) : VIDEO_ANALYSIS_MAX_DURATION_SEC;
12121
- return `video-analysis:${model}:${bucket}s`;
12177
+ return `video-analysis:${videoAnalysisCreditSegment(model)}:${bucket}s`;
12122
12178
  }
12123
12179
  function bucketSecondsFromCreditId(creditId) {
12124
12180
  const m = /^video-analysis:.+:(\d+)s$/.exec(creditId);
@@ -12492,6 +12548,7 @@ exports.VIDEO_ANALYSIS_ENTITY_SOURCES = VIDEO_ANALYSIS_ENTITY_SOURCES;
12492
12548
  exports.VIDEO_ANALYSIS_LLM_MODELS = VIDEO_ANALYSIS_LLM_MODELS;
12493
12549
  exports.VIDEO_ANALYSIS_MAX_DURATION_SEC = VIDEO_ANALYSIS_MAX_DURATION_SEC;
12494
12550
  exports.VIDEO_ANALYSIS_MAX_SCENE_SEC = VIDEO_ANALYSIS_MAX_SCENE_SEC;
12551
+ exports.VIDEO_ANALYSIS_MIXED_TIERS = VIDEO_ANALYSIS_MIXED_TIERS;
12495
12552
  exports.VIDEO_ANALYSIS_TIERS = VIDEO_ANALYSIS_TIERS;
12496
12553
  exports.VIDEO_ANALYSIS_TIER_LABELS = VIDEO_ANALYSIS_TIER_LABELS;
12497
12554
  exports.VIDEO_ANALYSIS_TIER_ORDER = VIDEO_ANALYSIS_TIER_ORDER;
@@ -12689,6 +12746,7 @@ exports.isSeedance2Provider = isSeedance2Provider;
12689
12746
  exports.isTiltDirection = isTiltDirection;
12690
12747
  exports.isUsageMode = isUsageMode;
12691
12748
  exports.isVeoProvider = isVeoProvider;
12749
+ exports.isVideoAnalysisMixedTier = isVideoAnalysisMixedTier;
12692
12750
  exports.isVideoAnalysisTier = isVideoAnalysisTier;
12693
12751
  exports.jsonResultToList = jsonResultToList;
12694
12752
  exports.listBoardTemplates = listBoardTemplates;
@@ -12813,6 +12871,7 @@ exports.validateObjects = validateObjects;
12813
12871
  exports.validateProviderForNodeType = validateProviderForNodeType;
12814
12872
  exports.validateSubWorkflowRoutes = validateSubWorkflowRoutes;
12815
12873
  exports.variantJobId = variantJobId;
12874
+ exports.videoAnalysisCreditSegment = videoAnalysisCreditSegment;
12816
12875
  exports.videoAnalysisNumWindows = videoAnalysisNumWindows;
12817
12876
  exports.videoAnalysisResultSchema = videoAnalysisResultSchema;
12818
12877
  exports.videoModelCanSpeakDialogue = videoModelCanSpeakDialogue;