@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.js CHANGED
@@ -169,13 +169,16 @@ var GEMINI_RATIOS = [
169
169
  "5:4",
170
170
  "adaptive"
171
171
  ];
172
- function geminiImage(id, label, aliases, sizes, display, exposure, references) {
172
+ var GEMINI_PROMPT_MAX_CHARS = 5e4;
173
+ var GPT_IMAGE_PROMPT = { referenceSyntax: "numbered", maxChars: 32e3 };
174
+ function geminiImage(id, label, aliases, sizes, display, exposure, references, promptMaxChars) {
175
+ const prompt = { referenceSyntax: "caption" };
176
+ if (promptMaxChars !== void 0) prompt.maxChars = promptMaxChars;
173
177
  const constraints = {
174
178
  aspectRatios: [...GEMINI_RATIOS],
175
179
  sizes,
176
180
  supports: ["safetySettings", "temperature"],
177
- // google-image sends MediaRef.label as a text part beside each reference.
178
- prompt: { referenceSyntax: "caption" }
181
+ prompt
179
182
  };
180
183
  if (references !== void 0) constraints.references = references;
181
184
  const model = {
@@ -207,7 +210,8 @@ var IMAGE_MODELS = [
207
210
  logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
208
211
  },
209
212
  ["cowork", "space_builder"],
210
- { images: 14 }
213
+ { images: 14 },
214
+ GEMINI_PROMPT_MAX_CHARS
211
215
  ),
212
216
  geminiImage(
213
217
  "gemini-3.1-flash-image-preview",
@@ -221,7 +225,8 @@ var IMAGE_MODELS = [
221
225
  logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
222
226
  },
223
227
  ["cowork", "space_builder"],
224
- { images: 14 }
228
+ { images: 14 },
229
+ GEMINI_PROMPT_MAX_CHARS
225
230
  ),
226
231
  geminiImage(
227
232
  "gemini-3.1-flash-lite-image",
@@ -234,7 +239,8 @@ var IMAGE_MODELS = [
234
239
  logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
235
240
  },
236
241
  ["cowork", "space_builder"],
237
- { images: 14 }
242
+ { images: 14 },
243
+ GEMINI_PROMPT_MAX_CHARS
238
244
  ),
239
245
  // trigger-workflows validates 1K only; pricing seeds 2K/4K rows so allow all three.
240
246
  geminiImage(
@@ -272,7 +278,8 @@ var IMAGE_MODELS = [
272
278
  sizes: ["1K", "2K", "4K"],
273
279
  qualityOptions: ["auto", "low", "medium", "high"],
274
280
  references: { images: 16 },
275
- supports: ["quality", "count", "outputFormat"]
281
+ supports: ["quality", "count", "outputFormat"],
282
+ prompt: GPT_IMAGE_PROMPT
276
283
  },
277
284
  defaults: { size: "1K", aspectRatio: "adaptive", quality: "auto" },
278
285
  usage: { ...IMAGE_USAGE, slug: "gpt" },
@@ -307,7 +314,8 @@ var IMAGE_MODELS = [
307
314
  sizes: ["1K", "2K", "4K"],
308
315
  qualityOptions: ["auto", "low", "medium", "high", "xhigh", "max"],
309
316
  references: { images: 16 },
310
- supports: ["quality", "count", "outputFormat"]
317
+ supports: ["quality", "count", "outputFormat"],
318
+ prompt: GPT_IMAGE_PROMPT
311
319
  },
312
320
  defaults: { size: "1K", aspectRatio: "adaptive", quality: "auto" },
313
321
  usage: { ...IMAGE_USAGE },
@@ -341,7 +349,8 @@ var IMAGE_MODELS = [
341
349
  sizes: ["1K", "2K", "4K"],
342
350
  qualityOptions: ["auto", "low", "medium", "high", "xhigh", "max"],
343
351
  references: { images: 16 },
344
- supports: ["quality", "count", "outputFormat"]
352
+ supports: ["quality", "count", "outputFormat"],
353
+ prompt: GPT_IMAGE_PROMPT
345
354
  },
346
355
  defaults: { size: "1K", aspectRatio: "adaptive", quality: "auto" },
347
356
  usage: { ...IMAGE_USAGE },
@@ -464,7 +473,9 @@ var IMAGE_MODELS = [
464
473
  sizes: ["1K"],
465
474
  references: { images: 8 },
466
475
  // flux-2-pro's job type always returns image/png; only the seed is forwarded.
467
- supports: ["seed"]
476
+ supports: ["seed"],
477
+ // Prodia's flux-2-pro schema gives the prompt a maxLength of 32,768.
478
+ prompt: { referenceSyntax: "numbered", maxChars: 32768 }
468
479
  },
469
480
  defaults: { size: "1K", aspectRatio: "1:1" },
470
481
  usage: { ...IMAGE_USAGE },
@@ -1266,6 +1277,9 @@ var H3_REFERENCE_RATIOS = ["adaptive", ...H3_RATIOS];
1266
1277
  var NEGATIVE_PROMPT = "blur, distort, and low quality";
1267
1278
  var FRAMES_EXCLUDE_REFERENCES = { framesExcludeReferences: true };
1268
1279
  var KLING_PROMPT = { referenceSyntax: "numbered", maxChars: 2500 };
1280
+ var SEEDANCE_PROMPT = { referenceSyntax: "numbered", maxChars: 3e4 };
1281
+ var H3_PROMPT = { referenceSyntax: "numbered", maxChars: 5e4 };
1282
+ var OMNI_PROMPT = { referenceSyntax: "caption", maxChars: 5e4 };
1269
1283
  var BYTEDANCE_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/3bba5d81-4e57-4e71-911b-cdfa05acca2c_compressed.png";
1270
1284
  var GOOGLE_LOGO2 = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png";
1271
1285
  var VIDEO_MODELS = [
@@ -1389,8 +1403,7 @@ var VIDEO_MODELS = [
1389
1403
  references: { images: 6, videos: 1, videoSeconds: { max: 10 } },
1390
1404
  sourceVideoSeconds: { max: 10 },
1391
1405
  supports: [],
1392
- // generateOmniVideo sends MediaRef.label as a text part beside each image.
1393
- prompt: { referenceSyntax: "caption" },
1406
+ prompt: OMNI_PROMPT,
1394
1407
  audio: "always"
1395
1408
  },
1396
1409
  defaults: {},
@@ -1427,8 +1440,7 @@ var VIDEO_MODELS = [
1427
1440
  // First-to-last-frame interpolation: `<LAST_FRAME>` goes with `<FIRST_FRAME>`.
1428
1441
  supports: ["videoExtension", "lastFrame"],
1429
1442
  extension: { segmentSeconds: 10, maxTotalSeconds: 40 },
1430
- // generateOmniVideo sends MediaRef.label as a text part beside each image.
1431
- prompt: { referenceSyntax: "caption" },
1443
+ prompt: OMNI_PROMPT,
1432
1444
  audio: "always"
1433
1445
  },
1434
1446
  defaults: {},
@@ -1467,6 +1479,7 @@ var VIDEO_MODELS = [
1467
1479
  ratioIgnoredWith: ["firstFrame", "sourceVideo"],
1468
1480
  // No seed: 2.x echoes it but does not honour it (two seeded runs differed, 2026-10-01).
1469
1481
  supports: ["generateAudio", "lastFrame", "watermark"],
1482
+ prompt: SEEDANCE_PROMPT,
1470
1483
  audio: "optional"
1471
1484
  },
1472
1485
  defaults: {
@@ -1508,6 +1521,7 @@ var VIDEO_MODELS = [
1508
1521
  ratioIgnoredWith: ["firstFrame", "sourceVideo"],
1509
1522
  // No seed: 2.x echoes it but does not honour it (two seeded runs differed, 2026-10-01).
1510
1523
  supports: ["generateAudio", "lastFrame", "watermark"],
1524
+ prompt: SEEDANCE_PROMPT,
1511
1525
  audio: "optional"
1512
1526
  },
1513
1527
  defaults: {
@@ -1549,6 +1563,7 @@ var VIDEO_MODELS = [
1549
1563
  ratioIgnoredWith: ["firstFrame", "sourceVideo"],
1550
1564
  // No seed: 2.x echoes it but does not honour it (two seeded runs differed, 2026-10-01).
1551
1565
  supports: ["generateAudio", "lastFrame", "watermark", "taskType"],
1566
+ prompt: SEEDANCE_PROMPT,
1552
1567
  audio: "optional"
1553
1568
  },
1554
1569
  defaults: {
@@ -1710,6 +1725,7 @@ var VIDEO_MODELS = [
1710
1725
  // fal's image-to-video endpoint has no aspect_ratio; the frame sets it.
1711
1726
  ratioIgnoredWith: ["firstFrame"],
1712
1727
  supports: ["seed", "promptExpansion", "lastFrame", "safetyChecker"],
1728
+ prompt: H3_PROMPT,
1713
1729
  audio: "always"
1714
1730
  },
1715
1731
  defaults: {
@@ -1743,6 +1759,7 @@ var VIDEO_MODELS = [
1743
1759
  // fal's image-to-video endpoint has no aspect_ratio; the frame sets it.
1744
1760
  ratioIgnoredWith: ["firstFrame"],
1745
1761
  supports: ["seed", "promptExpansion", "lastFrame", "safetyChecker"],
1762
+ prompt: H3_PROMPT,
1746
1763
  audio: "always"
1747
1764
  },
1748
1765
  defaults: {
@@ -1784,6 +1801,7 @@ var VIDEO_MODELS = [
1784
1801
  videoSeconds: { min: 2, max: 15, total: 15 }
1785
1802
  },
1786
1803
  supports: ["seed", "promptExpansion", "safetyChecker"],
1804
+ prompt: H3_PROMPT,
1787
1805
  audio: "always"
1788
1806
  },
1789
1807
  defaults: {
@@ -1827,6 +1845,7 @@ var VIDEO_MODELS = [
1827
1845
  videoSeconds: { min: 2, max: 15, total: 15 }
1828
1846
  },
1829
1847
  supports: ["seed", "promptExpansion", "safetyChecker"],
1848
+ prompt: H3_PROMPT,
1830
1849
  audio: "always"
1831
1850
  },
1832
1851
  defaults: {