@shop-os/modelkit 0.2.21 → 0.2.22

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
@@ -279,13 +279,16 @@ var GEMINI_RATIOS = [
279
279
  "5:4",
280
280
  "adaptive"
281
281
  ];
282
- function geminiImage(id, label, aliases, sizes, display, exposure, references) {
282
+ var GEMINI_PROMPT_MAX_CHARS = 5e4;
283
+ var GPT_IMAGE_PROMPT = { referenceSyntax: "numbered", maxChars: 32e3 };
284
+ function geminiImage(id, label, aliases, sizes, display, exposure, references, promptMaxChars) {
285
+ const prompt = { referenceSyntax: "caption" };
286
+ if (promptMaxChars !== void 0) prompt.maxChars = promptMaxChars;
283
287
  const constraints = {
284
288
  aspectRatios: [...GEMINI_RATIOS],
285
289
  sizes,
286
290
  supports: ["safetySettings", "temperature"],
287
- // google-image sends MediaRef.label as a text part beside each reference.
288
- prompt: { referenceSyntax: "caption" }
291
+ prompt
289
292
  };
290
293
  if (references !== void 0) constraints.references = references;
291
294
  const model = {
@@ -317,7 +320,8 @@ var IMAGE_MODELS = [
317
320
  logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
318
321
  },
319
322
  ["cowork", "space_builder"],
320
- { images: 14 }
323
+ { images: 14 },
324
+ GEMINI_PROMPT_MAX_CHARS
321
325
  ),
322
326
  geminiImage(
323
327
  "gemini-3.1-flash-image-preview",
@@ -331,7 +335,8 @@ var IMAGE_MODELS = [
331
335
  logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
332
336
  },
333
337
  ["cowork", "space_builder"],
334
- { images: 14 }
338
+ { images: 14 },
339
+ GEMINI_PROMPT_MAX_CHARS
335
340
  ),
336
341
  geminiImage(
337
342
  "gemini-3.1-flash-lite-image",
@@ -344,7 +349,8 @@ var IMAGE_MODELS = [
344
349
  logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
345
350
  },
346
351
  ["cowork", "space_builder"],
347
- { images: 14 }
352
+ { images: 14 },
353
+ GEMINI_PROMPT_MAX_CHARS
348
354
  ),
349
355
  // trigger-workflows validates 1K only; pricing seeds 2K/4K rows so allow all three.
350
356
  geminiImage(
@@ -382,7 +388,8 @@ var IMAGE_MODELS = [
382
388
  sizes: ["1K", "2K", "4K"],
383
389
  qualityOptions: ["auto", "low", "medium", "high"],
384
390
  references: { images: 16 },
385
- supports: ["quality", "count", "outputFormat"]
391
+ supports: ["quality", "count", "outputFormat"],
392
+ prompt: GPT_IMAGE_PROMPT
386
393
  },
387
394
  defaults: { size: "1K", aspectRatio: "adaptive", quality: "auto" },
388
395
  usage: { ...IMAGE_USAGE, slug: "gpt" },
@@ -417,7 +424,8 @@ var IMAGE_MODELS = [
417
424
  sizes: ["1K", "2K", "4K"],
418
425
  qualityOptions: ["auto", "low", "medium", "high", "xhigh", "max"],
419
426
  references: { images: 16 },
420
- supports: ["quality", "count", "outputFormat"]
427
+ supports: ["quality", "count", "outputFormat"],
428
+ prompt: GPT_IMAGE_PROMPT
421
429
  },
422
430
  defaults: { size: "1K", aspectRatio: "adaptive", quality: "auto" },
423
431
  usage: { ...IMAGE_USAGE },
@@ -451,7 +459,8 @@ var IMAGE_MODELS = [
451
459
  sizes: ["1K", "2K", "4K"],
452
460
  qualityOptions: ["auto", "low", "medium", "high", "xhigh", "max"],
453
461
  references: { images: 16 },
454
- supports: ["quality", "count", "outputFormat"]
462
+ supports: ["quality", "count", "outputFormat"],
463
+ prompt: GPT_IMAGE_PROMPT
455
464
  },
456
465
  defaults: { size: "1K", aspectRatio: "adaptive", quality: "auto" },
457
466
  usage: { ...IMAGE_USAGE },
@@ -574,7 +583,9 @@ var IMAGE_MODELS = [
574
583
  sizes: ["1K"],
575
584
  references: { images: 8 },
576
585
  // flux-2-pro's job type always returns image/png; only the seed is forwarded.
577
- supports: ["seed"]
586
+ supports: ["seed"],
587
+ // Prodia's flux-2-pro schema gives the prompt a maxLength of 32,768.
588
+ prompt: { referenceSyntax: "numbered", maxChars: 32768 }
578
589
  },
579
590
  defaults: { size: "1K", aspectRatio: "1:1" },
580
591
  usage: { ...IMAGE_USAGE },
@@ -1376,6 +1387,9 @@ var H3_REFERENCE_RATIOS = ["adaptive", ...H3_RATIOS];
1376
1387
  var NEGATIVE_PROMPT = "blur, distort, and low quality";
1377
1388
  var FRAMES_EXCLUDE_REFERENCES = { framesExcludeReferences: true };
1378
1389
  var KLING_PROMPT = { referenceSyntax: "numbered", maxChars: 2500 };
1390
+ var SEEDANCE_PROMPT = { referenceSyntax: "numbered", maxChars: 3e4 };
1391
+ var H3_PROMPT = { referenceSyntax: "numbered", maxChars: 5e4 };
1392
+ var OMNI_PROMPT = { referenceSyntax: "caption", maxChars: 5e4 };
1379
1393
  var BYTEDANCE_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/3bba5d81-4e57-4e71-911b-cdfa05acca2c_compressed.png";
1380
1394
  var GOOGLE_LOGO2 = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png";
1381
1395
  var VIDEO_MODELS = [
@@ -1499,8 +1513,7 @@ var VIDEO_MODELS = [
1499
1513
  references: { images: 6, videos: 1, videoSeconds: { max: 10 } },
1500
1514
  sourceVideoSeconds: { max: 10 },
1501
1515
  supports: [],
1502
- // generateOmniVideo sends MediaRef.label as a text part beside each image.
1503
- prompt: { referenceSyntax: "caption" },
1516
+ prompt: OMNI_PROMPT,
1504
1517
  audio: "always"
1505
1518
  },
1506
1519
  defaults: {},
@@ -1537,8 +1550,7 @@ var VIDEO_MODELS = [
1537
1550
  // First-to-last-frame interpolation: `<LAST_FRAME>` goes with `<FIRST_FRAME>`.
1538
1551
  supports: ["videoExtension", "lastFrame"],
1539
1552
  extension: { segmentSeconds: 10, maxTotalSeconds: 40 },
1540
- // generateOmniVideo sends MediaRef.label as a text part beside each image.
1541
- prompt: { referenceSyntax: "caption" },
1553
+ prompt: OMNI_PROMPT,
1542
1554
  audio: "always"
1543
1555
  },
1544
1556
  defaults: {},
@@ -1577,6 +1589,7 @@ var VIDEO_MODELS = [
1577
1589
  ratioIgnoredWith: ["firstFrame", "sourceVideo"],
1578
1590
  // No seed: 2.x echoes it but does not honour it (two seeded runs differed, 2026-10-01).
1579
1591
  supports: ["generateAudio", "lastFrame", "watermark"],
1592
+ prompt: SEEDANCE_PROMPT,
1580
1593
  audio: "optional"
1581
1594
  },
1582
1595
  defaults: {
@@ -1618,6 +1631,7 @@ var VIDEO_MODELS = [
1618
1631
  ratioIgnoredWith: ["firstFrame", "sourceVideo"],
1619
1632
  // No seed: 2.x echoes it but does not honour it (two seeded runs differed, 2026-10-01).
1620
1633
  supports: ["generateAudio", "lastFrame", "watermark"],
1634
+ prompt: SEEDANCE_PROMPT,
1621
1635
  audio: "optional"
1622
1636
  },
1623
1637
  defaults: {
@@ -1659,6 +1673,7 @@ var VIDEO_MODELS = [
1659
1673
  ratioIgnoredWith: ["firstFrame", "sourceVideo"],
1660
1674
  // No seed: 2.x echoes it but does not honour it (two seeded runs differed, 2026-10-01).
1661
1675
  supports: ["generateAudio", "lastFrame", "watermark", "taskType"],
1676
+ prompt: SEEDANCE_PROMPT,
1662
1677
  audio: "optional"
1663
1678
  },
1664
1679
  defaults: {
@@ -1820,6 +1835,7 @@ var VIDEO_MODELS = [
1820
1835
  // fal's image-to-video endpoint has no aspect_ratio; the frame sets it.
1821
1836
  ratioIgnoredWith: ["firstFrame"],
1822
1837
  supports: ["seed", "promptExpansion", "lastFrame", "safetyChecker"],
1838
+ prompt: H3_PROMPT,
1823
1839
  audio: "always"
1824
1840
  },
1825
1841
  defaults: {
@@ -1853,6 +1869,7 @@ var VIDEO_MODELS = [
1853
1869
  // fal's image-to-video endpoint has no aspect_ratio; the frame sets it.
1854
1870
  ratioIgnoredWith: ["firstFrame"],
1855
1871
  supports: ["seed", "promptExpansion", "lastFrame", "safetyChecker"],
1872
+ prompt: H3_PROMPT,
1856
1873
  audio: "always"
1857
1874
  },
1858
1875
  defaults: {
@@ -1894,6 +1911,7 @@ var VIDEO_MODELS = [
1894
1911
  videoSeconds: { min: 2, max: 15, total: 15 }
1895
1912
  },
1896
1913
  supports: ["seed", "promptExpansion", "safetyChecker"],
1914
+ prompt: H3_PROMPT,
1897
1915
  audio: "always"
1898
1916
  },
1899
1917
  defaults: {
@@ -1937,6 +1955,7 @@ var VIDEO_MODELS = [
1937
1955
  videoSeconds: { min: 2, max: 15, total: 15 }
1938
1956
  },
1939
1957
  supports: ["seed", "promptExpansion", "safetyChecker"],
1958
+ prompt: H3_PROMPT,
1940
1959
  audio: "always"
1941
1960
  },
1942
1961
  defaults: {