@shop-os/modelkit 0.24.0 → 0.25.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.d.cts CHANGED
@@ -12,7 +12,7 @@ import { LanguageModelV3, LanguageModelV2 } from '@ai-sdk/provider';
12
12
  /** The AI SDK video model spelling: a catalog id or a provider video model instance. */
13
13
  type VideoModel = Parameters<typeof experimental_generateVideo>[0]["model"];
14
14
  type AspectRatio = "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "4:5" | "5:4" | "21:9" | "9:21" | "97:30" | "1:4" | "4:1" | "1:8" | "8:1" | "adaptive";
15
- type ImageSize = "512" | "1K" | "2K" | "4K";
15
+ type ImageSize = "512" | "1K" | "2K" | "4K" | "8K";
16
16
  type VideoResolution = "360p" | "480p" | "720p" | "768p" | "1080p" | "2k" | "4k";
17
17
  /** "xhigh" and "max" exist only on gpt-image-2.5; gpt-image-2 rejects them at the provider. */
18
18
  type ImageQuality = "auto" | "low" | "medium" | "high" | "xhigh" | "max";
@@ -1376,6 +1376,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1376
1376
  "1K": "1K";
1377
1377
  "2K": "2K";
1378
1378
  "4K": "4K";
1379
+ "8K": "8K";
1379
1380
  }>>>;
1380
1381
  resolutions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1381
1382
  "360p": "360p";
@@ -1687,6 +1688,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1687
1688
  "1K": "1K";
1688
1689
  "2K": "2K";
1689
1690
  "4K": "4K";
1691
+ "8K": "8K";
1690
1692
  }>>;
1691
1693
  exactSize: z.ZodOptional<z.ZodString>;
1692
1694
  quality: z.ZodOptional<z.ZodEnum<{
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ import { LanguageModelV3, LanguageModelV2 } from '@ai-sdk/provider';
12
12
  /** The AI SDK video model spelling: a catalog id or a provider video model instance. */
13
13
  type VideoModel = Parameters<typeof experimental_generateVideo>[0]["model"];
14
14
  type AspectRatio = "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "4:5" | "5:4" | "21:9" | "9:21" | "97:30" | "1:4" | "4:1" | "1:8" | "8:1" | "adaptive";
15
- type ImageSize = "512" | "1K" | "2K" | "4K";
15
+ type ImageSize = "512" | "1K" | "2K" | "4K" | "8K";
16
16
  type VideoResolution = "360p" | "480p" | "720p" | "768p" | "1080p" | "2k" | "4k";
17
17
  /** "xhigh" and "max" exist only on gpt-image-2.5; gpt-image-2 rejects them at the provider. */
18
18
  type ImageQuality = "auto" | "low" | "medium" | "high" | "xhigh" | "max";
@@ -1376,6 +1376,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1376
1376
  "1K": "1K";
1377
1377
  "2K": "2K";
1378
1378
  "4K": "4K";
1379
+ "8K": "8K";
1379
1380
  }>>>;
1380
1381
  resolutions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1381
1382
  "360p": "360p";
@@ -1687,6 +1688,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1687
1688
  "1K": "1K";
1688
1689
  "2K": "2K";
1689
1690
  "4K": "4K";
1691
+ "8K": "8K";
1690
1692
  }>>;
1691
1693
  exactSize: z.ZodOptional<z.ZodString>;
1692
1694
  quality: z.ZodOptional<z.ZodEnum<{
package/dist/index.js CHANGED
@@ -363,6 +363,34 @@ var FAL_IMAGE_MODELS = [
363
363
  logo: `${LOBE}/kling-color.png`
364
364
  }
365
365
  },
366
+ {
367
+ // kling/v4/text-to-image; references switch to kling/v4/image-to-image (up to 10,
368
+ // "@Image1".."@Image10"). Per output image: $0.063 at 2K, $0.094 at 4K (Kling price page,
369
+ // 2026-11-17); each reference adds $0.003, which we absorb. Native 8K is ENG-4137.
370
+ id: "kling-image-4.0",
371
+ aliases: [],
372
+ label: "Kling Image 4.0",
373
+ type: "image",
374
+ adapter: "fal",
375
+ providerModelId: "kling/v4/text-to-image",
376
+ lifecycle: "active",
377
+ exposure: EXPOSURE,
378
+ constraints: {
379
+ aspectRatios: [...KLING_RATIOS, "adaptive"],
380
+ sizes: ["2K", "4K"],
381
+ references: { images: 10 },
382
+ supports: ["count"],
383
+ prompt: { referenceSyntax: "numbered", maxChars: 21e3 }
384
+ },
385
+ defaults: { size: "2K", aspectRatio: "adaptive", count: 1 },
386
+ usage: { ...IMAGE_USAGE },
387
+ pricingKind: "image_size",
388
+ display: {
389
+ provider: "kuaishou",
390
+ description: "Kling Image 4.0 for photoreal text-to-image, long in-image text and multi-reference editing; takes a prompt and up to 10 reference images and outputs 2K or 4K.",
391
+ logo: `${LOBE}/kling-color.png`
392
+ }
393
+ },
366
394
  {
367
395
  // fal-ai/kling-image/v3/text-to-image; a reference switches to .../v3/image-to-image, which
368
396
  // takes exactly one image_url and no "auto" ratio. $0.028 per image.
@@ -8181,7 +8209,7 @@ var AspectRatioSchema = z3.enum([
8181
8209
  "8:1",
8182
8210
  "adaptive"
8183
8211
  ]);
8184
- var ImageSizeSchema = z3.enum(["512", "1K", "2K", "4K"]);
8212
+ var ImageSizeSchema = z3.enum(["512", "1K", "2K", "4K", "8K"]);
8185
8213
  var VideoResolutionSchema = z3.enum(["360p", "480p", "720p", "768p", "1080p", "2k", "4k"]);
8186
8214
  var ImageQualitySchema = z3.enum(["auto", "low", "medium", "high", "xhigh", "max"]);
8187
8215
  var OutputFormatSchema = z3.enum(["png", "jpeg", "webp", "gif", "svg"]);
@@ -9098,6 +9126,20 @@ var FAL_IMAGE_SPECS = /* @__PURE__ */ new Map([
9098
9126
  aspectRatios: KLING_RATIOS3
9099
9127
  }
9100
9128
  ],
9129
+ [
9130
+ // No output_format or seed field. Kling caps non-English prompts at 21,000 characters
9131
+ // (API update 2026-11-17), under the schema's 50,000.
9132
+ "kling/v4/text-to-image",
9133
+ {
9134
+ label: "Kling Image 4.0",
9135
+ maxReferences: 10,
9136
+ maxCount: 9,
9137
+ outputFormats: [],
9138
+ promptMax: 21e3,
9139
+ promptRequired: true,
9140
+ aspectRatios: [...KLING_RATIOS3, "adaptive"]
9141
+ }
9142
+ ],
9101
9143
  [
9102
9144
  "recraft/v4.1/flash/text-to-image",
9103
9145
  {
@@ -11882,13 +11924,13 @@ function minimaxH3Image(editEndpoint) {
11882
11924
  var H3_IMAGE_AREAS = { ...TIER_AREAS2, "4K": 4096 * 4096 };
11883
11925
  var MINIMAX_H3_IMAGE = minimaxH3Image("minimax/h3-image/edit");
11884
11926
  var MINIMAX_H3_IMAGE_HIGHSPEED = minimaxH3Image("minimax/h3-image/highspeed/edit");
11885
- function klingImage(editEndpoint, sizes, field) {
11927
+ function klingImage(editEndpoint, sizes, field, fallbackSize = "1K") {
11886
11928
  return {
11887
11929
  editEndpoint,
11888
11930
  build({ label, req, refs, edit: edit2 }, model) {
11889
11931
  const input = {
11890
11932
  prompt: req.prompt,
11891
- resolution: pick(model, label, "size", req.size ?? "1K", sizes)
11933
+ resolution: pick(model, label, "size", req.size ?? fallbackSize, sizes)
11892
11934
  };
11893
11935
  if (req.aspectRatio === "adaptive") {
11894
11936
  if (edit2) input["aspect_ratio"] = "auto";
@@ -11910,6 +11952,12 @@ var KLING_V3 = klingImage(
11910
11952
  { "1K": "1K", "2K": "2K" },
11911
11953
  "image_url"
11912
11954
  );
11955
+ var KLING_V42 = klingImage(
11956
+ "kling/v4/image-to-image",
11957
+ { "2K": "2K", "4K": "4K", "8K": "8K" },
11958
+ "image_urls",
11959
+ "2K"
11960
+ );
11913
11961
  var RECRAFT_SIZES = {
11914
11962
  "1:1": "square_hd",
11915
11963
  "4:3": "landscape_4_3",
@@ -11966,6 +12014,7 @@ var FAMILIES = /* @__PURE__ */ new Map([
11966
12014
  ["minimax/h3-image/highspeed/text-to-image", MINIMAX_H3_IMAGE_HIGHSPEED],
11967
12015
  ["fal-ai/kling-image/o3/text-to-image", KLING_O3],
11968
12016
  ["fal-ai/kling-image/v3/text-to-image", KLING_V3],
12017
+ ["kling/v4/text-to-image", KLING_V42],
11969
12018
  ["recraft/v4.1/flash/text-to-image", RECRAFT_FLASH],
11970
12019
  ["fal-ai/sensenova-u1-infographic", SENSENOVA],
11971
12020
  ["fal-ai/seedvr/upscale/image", SEEDVR]
@@ -18753,7 +18802,7 @@ function resolveOutputFormat(model, format, onUnsupported, warnings) {
18753
18802
  }
18754
18803
 
18755
18804
  // src/resolve-options.ts
18756
- var SIZE_ORDER = ["512", "1K", "2K", "4K"];
18805
+ var SIZE_ORDER = ["512", "1K", "2K", "4K", "8K"];
18757
18806
  var RESOLUTION_ORDER = ["360p", "480p", "720p", "768p", "1080p", "2k", "4k"];
18758
18807
  function ratioValue(r) {
18759
18808
  if (r === "adaptive") return 1;
@@ -20564,7 +20613,7 @@ function textAbortOptions(sdk, context) {
20564
20613
  var catalogId = z38.string();
20565
20614
  var exactSize = z38.templateLiteral([z38.number(), "x", z38.number()]);
20566
20615
  var sdkRatio = z38.templateLiteral([z38.number(), ":", z38.number()]);
20567
- var sizeTier = z38.enum(["512", "1K", "2K", "4K"]);
20616
+ var sizeTier = z38.enum(["512", "1K", "2K", "4K", "8K"]);
20568
20617
  function isCatalogId(model) {
20569
20618
  return catalogId.safeParse(model).success;
20570
20619
  }