@shop-os/modelkit 0.7.7 → 0.7.10

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/catalog.js CHANGED
@@ -5118,8 +5118,10 @@ var RAY_RESOLUTIONS = ["360p", "720p", "1080p"];
5118
5118
  var RAY_PROMPT = { referenceSyntax: "numbered", maxChars: 6e3 };
5119
5119
  var LUMA_VIDEO_MODELS = [
5120
5120
  {
5121
- // https://docs.agents.lumalabs.ai: type "video" with a fixed 5 s duration;
5122
- // firstFrame and lastFrame ride as start_frame and end_frame.
5121
+ // https://docs.agents.lumalabs.ai: type "video" with a 5 s or 10 s duration;
5122
+ // firstFrame and lastFrame ride as start_frame and end_frame. Luma bills a
5123
+ // 10 s clip at 3x the 5 s price; pro-backend prices it that way, so this row
5124
+ // must not offer 10 s before that pricing is deployed (ENG-3324).
5123
5125
  id: "ray-3.2",
5124
5126
  aliases: [],
5125
5127
  label: "Ray 3.2",
@@ -5131,7 +5133,7 @@ var LUMA_VIDEO_MODELS = [
5131
5133
  constraints: {
5132
5134
  aspectRatios: ["adaptive", ...RAY_RATIOS],
5133
5135
  resolutions: [...RAY_RESOLUTIONS],
5134
- durations: [5],
5136
+ durations: [5, 10],
5135
5137
  supports: ["lastFrame"],
5136
5138
  prompt: { ...RAY_PROMPT },
5137
5139
  audio: "never"
@@ -5141,7 +5143,7 @@ var LUMA_VIDEO_MODELS = [
5141
5143
  pricingKind: "video_per_second",
5142
5144
  display: {
5143
5145
  provider: "luma",
5144
- description: "Luma Ray 3.2 text- and image-to-video with optional first and last frames, 5-second clips at up to 1080p.",
5146
+ description: "Luma Ray 3.2 text- and image-to-video with optional first and last frames, 5- or 10-second clips at up to 1080p.",
5145
5147
  logo: LUMA_LOGO2
5146
5148
  },
5147
5149
  capabilities: {}
@@ -5651,38 +5653,38 @@ var VIDEO_MODELS = [
5651
5653
  capabilities: { ...FRAMES_EXCLUDE_REFERENCES }
5652
5654
  },
5653
5655
  {
5654
- // mode standard/pro/4k selects 720p/1080p/4K; the endpoint takes no separate resolution.
5655
- // Replicate: "Max 7 [images] without video, 4 with video"; 4K does not support
5656
- // reference_video. No `videos` limit yet: the adapter sends no reference video,
5657
- // so `imagesWithVideo` stays dormant until one is wired through.
5656
+ // fal Kling O3 (adapters/fal-kling-omni.ts): mode standard/pro/4k selects 720p/1080p/4K
5657
+ // in the endpoint path. Moved off Replicate kwaivgi/kling-v3-omni-video, which fal sells
5658
+ // at half the price; the id and inputs stay. The Replicate mapper stays for deployed
5659
+ // model_catalog rows not yet switched. Frames and reference images share fal's cap of 7.
5660
+ // Reference video, multi-shot and keep-sound were never wired, so stay off.
5658
5661
  id: "kling-v3-omni-video",
5659
5662
  aliases: ["kwaivgi/kling-v3-omni-video", "kling-v3-omni"],
5660
5663
  label: "Kling V3 Omni",
5661
5664
  type: "video",
5662
- adapter: "replicate",
5663
- providerModelId: "kwaivgi/kling-v3-omni-video",
5665
+ adapter: "fal",
5666
+ providerModelId: "fal-ai/kling-video/o3",
5664
5667
  lifecycle: "active",
5665
5668
  exposure: ["cowork", "space_builder"],
5666
5669
  constraints: {
5667
5670
  aspectRatios: [...KLING_OMNI_RATIOS],
5668
5671
  resolutions: ["720p", "1080p", "4k"],
5669
5672
  durations: { min: 3, max: 15 },
5670
- references: { images: 7, imagesWithVideo: 4 },
5673
+ references: { images: 7, videos: 0, audios: 0 },
5671
5674
  supports: ["generateAudio", "lastFrame"],
5672
5675
  prompt: KLING_PROMPT2,
5673
5676
  audio: "optional"
5674
5677
  },
5675
5678
  defaults: { durationSeconds: 5, aspectRatio: "16:9", generateAudio: true, mode: "pro" },
5676
- usage: { unit: "compute_seconds" },
5679
+ usage: { ...VIDEO_USAGE3 },
5677
5680
  pricingKind: "video_per_second",
5678
5681
  display: {
5679
5682
  provider: "kuaishou",
5680
5683
  logo: "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0/light/kling-color.png",
5681
- description: "Kuaishou Kling Video 3.0 Omni unified generation and editing from text, start/end images, up to 7 reference images, and reference video; up to 15 seconds at up to 4K."
5684
+ description: "Kuaishou Kling Video 3.0 Omni generation from text, start/end images and up to 7 reference images, with optional native audio; up to 15 seconds at up to 4K."
5682
5685
  }
5683
- // end_image "Requires start_image", but no lastFrameRequiresFirstFrame: SpaceLab resolves
5684
- // replicate rows in error mode, so the flag would refuse its end-frame-only nodes, which
5685
- // the adapter sends as start_image.
5686
+ // No lastFrameRequiresFirstFrame: fal image-to-video needs a start frame, so the adapter
5687
+ // sends a lone end frame as the start frame, as the Replicate model took it.
5686
5688
  },
5687
5689
  {
5688
5690
  id: "minimax-h3",
@@ -8437,6 +8439,7 @@ var KLING_TIERS = [
8437
8439
  { mode: "pro", resolution: "1080p" },
8438
8440
  { mode: "4k", resolution: "4k" }
8439
8441
  ];
8442
+ var KLING_O3_OMNI = "fal-ai/kling-video/o3";
8440
8443
  function klingTier(req) {
8441
8444
  return KLING_TIERS.find((tier) => tier.resolution === req.resolution) ?? KLING_TIERS.find((tier) => tier.mode === req.mode) ?? KLING_TIERS[0];
8442
8445
  }
@@ -8585,6 +8588,7 @@ var RULES = /* @__PURE__ */ new Map([
8585
8588
  [MOTION_PRO, motionControl],
8586
8589
  [MOTION_STANDARD, motionControl],
8587
8590
  [O3_REFERENCE, o3Reference],
8591
+ [KLING_O3_OMNI, o3Reference],
8588
8592
  [O3_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
8589
8593
  [H3_TURBO, h3Turbo],
8590
8594
  [MINIMAX_H3_INSERT, h3Insert],
@@ -8614,13 +8618,14 @@ function h3EndFrameRatioWarning(model, ratio) {
8614
8618
  message: `${model.id} follows the end frame's aspect ratio`
8615
8619
  };
8616
8620
  }
8617
- function isReplicateKling(model) {
8621
+ function takesKlingMode(model) {
8622
+ if (model.adapter === "fal") return model.providerModelId.toLowerCase() === KLING_O3_OMNI;
8618
8623
  if (model.adapter !== "replicate") return false;
8619
8624
  const kind = videoKind(model.providerModelId);
8620
8625
  return kind === "kling" || kind === "kling-omni";
8621
8626
  }
8622
- function fillReplicateKlingResolution(model, req) {
8623
- if (isReplicateKling(model) && req.resolution === void 0) {
8627
+ function fillKlingModeResolution(model, req) {
8628
+ if (takesKlingMode(model) && req.resolution === void 0) {
8624
8629
  req.resolution = klingTier(req).resolution;
8625
8630
  }
8626
8631
  }
@@ -9013,10 +9018,10 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
9013
9018
  warnings
9014
9019
  );
9015
9020
  if (aspectRatio !== void 0) merged.aspectRatio = aspectRatio;
9016
- fillReplicateKlingResolution(model, merged);
9021
+ fillKlingModeResolution(model, merged);
9017
9022
  const resolution = resolveVideoResolution(merged.resolution, model, onUnsupported, warnings);
9018
9023
  if (resolution !== void 0) merged.resolution = resolution;
9019
- if (isReplicateKling(model)) delete merged.mode;
9024
+ if (takesKlingMode(model)) delete merged.mode;
9020
9025
  const duration = resolveDuration(
9021
9026
  merged.durationSeconds,
9022
9027
  c.durations,