@shop-os/modelkit 0.2.8 → 0.2.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/CHANGELOG.md +14 -0
- package/dist/catalog.cjs +126 -82
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +26 -5
- package/dist/catalog.d.ts +26 -5
- package/dist/catalog.js +126 -82
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +158 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -5
- package/dist/index.d.ts +26 -5
- package/dist/index.js +152 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -37,10 +37,13 @@ __export(index_exports, {
|
|
|
37
37
|
CatalogModelSchema: () => CatalogModelSchema,
|
|
38
38
|
CatalogSchema: () => CatalogSchema,
|
|
39
39
|
DEFAULT_ADAPTERS: () => DEFAULT_ADAPTERS,
|
|
40
|
+
ExposureSchema: () => ExposureSchema,
|
|
40
41
|
JsonObjectSchema: () => JsonObjectSchema,
|
|
41
42
|
JsonValueSchema: () => JsonValueSchema,
|
|
42
43
|
MODELS: () => MODELS,
|
|
43
44
|
ModelKitError: () => ModelKitError,
|
|
45
|
+
SURFACES: () => SURFACES2,
|
|
46
|
+
SurfaceSchema: () => SurfaceSchema,
|
|
44
47
|
aiSdkTextAdapter: () => aiSdkTextAdapter,
|
|
45
48
|
arkAdapter: () => arkAdapter,
|
|
46
49
|
aspectRatioToSize: () => aspectRatioToSize,
|
|
@@ -61,6 +64,8 @@ __export(index_exports, {
|
|
|
61
64
|
googleGenaiAdapter: () => googleGenaiAdapter,
|
|
62
65
|
googleImageAdapter: () => googleImageAdapter,
|
|
63
66
|
higgsfieldAdapter: () => higgsfieldAdapter,
|
|
67
|
+
isListed: () => isListed,
|
|
68
|
+
isListedOn: () => isListedOn,
|
|
64
69
|
isModelKitError: () => isModelKitError,
|
|
65
70
|
keysFromEnv: () => keysFromEnv,
|
|
66
71
|
languageModel: () => languageModel,
|
|
@@ -68,6 +73,7 @@ __export(index_exports, {
|
|
|
68
73
|
liveState: () => liveState,
|
|
69
74
|
mergeTextProviderOptions: () => mergeTextProviderOptions,
|
|
70
75
|
nearestAspectRatio: () => nearestAspectRatio,
|
|
76
|
+
normalizeExposure: () => normalizeExposure,
|
|
71
77
|
openaiImageAdapter: () => openaiImageAdapter,
|
|
72
78
|
passthroughTextModel: () => passthroughTextModel,
|
|
73
79
|
pollUntil: () => pollUntil,
|
|
@@ -216,6 +222,27 @@ var Catalog = class _Catalog {
|
|
|
216
222
|
}
|
|
217
223
|
};
|
|
218
224
|
|
|
225
|
+
// src/catalog/exposure.ts
|
|
226
|
+
var SURFACES = ["cowork", "space_builder"];
|
|
227
|
+
function normalizeExposure(value) {
|
|
228
|
+
if (value === "catalog") return ["cowork", "space_builder"];
|
|
229
|
+
if (value === "internal") return [];
|
|
230
|
+
if (Array.isArray(value)) {
|
|
231
|
+
if (value.every((entry) => SURFACES.includes(entry))) {
|
|
232
|
+
const present = new Set(value);
|
|
233
|
+
return SURFACES.filter((surface) => present.has(surface));
|
|
234
|
+
}
|
|
235
|
+
return value;
|
|
236
|
+
}
|
|
237
|
+
return value;
|
|
238
|
+
}
|
|
239
|
+
function isListedOn(row, surface) {
|
|
240
|
+
return row.lifecycle === "active" && row.exposure.includes(surface);
|
|
241
|
+
}
|
|
242
|
+
function isListed(row) {
|
|
243
|
+
return row.lifecycle === "active" && row.exposure.length > 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
219
246
|
// src/catalog/image.ts
|
|
220
247
|
var IMAGE_USAGE = { unit: "images" };
|
|
221
248
|
var GEMINI_RATIOS = [
|
|
@@ -266,7 +293,7 @@ var IMAGE_MODELS = [
|
|
|
266
293
|
description: "Create stunning, production-quality visuals with exceptional realism, detail, and typography. Best for campaigns, e-commerce, product photography, and hero creatives.",
|
|
267
294
|
logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
|
|
268
295
|
},
|
|
269
|
-
"
|
|
296
|
+
["cowork", "space_builder"],
|
|
270
297
|
{ images: 14 }
|
|
271
298
|
),
|
|
272
299
|
geminiImage(
|
|
@@ -280,7 +307,7 @@ var IMAGE_MODELS = [
|
|
|
280
307
|
description: "Generate high-quality images at speed. Perfect for brainstorming, moodboards, concept testing, creative exploration, and large batch workflows.",
|
|
281
308
|
logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
|
|
282
309
|
},
|
|
283
|
-
"
|
|
310
|
+
["cowork", "space_builder"],
|
|
284
311
|
{ images: 14 }
|
|
285
312
|
),
|
|
286
313
|
geminiImage(
|
|
@@ -293,7 +320,7 @@ var IMAGE_MODELS = [
|
|
|
293
320
|
description: "The fastest and most affordable image model. Ideal for rapid drafts, bulk exploration, and iterative concept testing at 1K resolution.",
|
|
294
321
|
logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
|
|
295
322
|
},
|
|
296
|
-
"
|
|
323
|
+
["cowork", "space_builder"],
|
|
297
324
|
{ images: 14 }
|
|
298
325
|
),
|
|
299
326
|
// trigger-workflows validates 1K only; pricing seeds 2K/4K rows so allow all three.
|
|
@@ -306,7 +333,7 @@ var IMAGE_MODELS = [
|
|
|
306
333
|
provider: "google",
|
|
307
334
|
description: "Nano Banana (legacy Gemini 2.5 Flash Image) native image generation and editing model for high-volume, low-latency creative workflows."
|
|
308
335
|
},
|
|
309
|
-
|
|
336
|
+
[]
|
|
310
337
|
),
|
|
311
338
|
{
|
|
312
339
|
// Cowork "auto" lets OpenAI pick the size; the canonical equivalent is adaptive.
|
|
@@ -317,7 +344,7 @@ var IMAGE_MODELS = [
|
|
|
317
344
|
adapter: "openai-image",
|
|
318
345
|
providerModelId: "gpt-image-2",
|
|
319
346
|
lifecycle: "active",
|
|
320
|
-
exposure: "
|
|
347
|
+
exposure: ["cowork", "space_builder"],
|
|
321
348
|
constraints: {
|
|
322
349
|
exactSizes: {
|
|
323
350
|
"1:1": "1024x1024",
|
|
@@ -352,7 +379,7 @@ var IMAGE_MODELS = [
|
|
|
352
379
|
adapter: "openai-image",
|
|
353
380
|
providerModelId: "gpt-image-2.5-sunburst",
|
|
354
381
|
lifecycle: "active",
|
|
355
|
-
exposure: "
|
|
382
|
+
exposure: ["cowork", "space_builder"],
|
|
356
383
|
constraints: {
|
|
357
384
|
exactSizes: {
|
|
358
385
|
"1:1": "1024x1024",
|
|
@@ -386,7 +413,7 @@ var IMAGE_MODELS = [
|
|
|
386
413
|
adapter: "openai-image",
|
|
387
414
|
providerModelId: "gpt-image-2.5-flare",
|
|
388
415
|
lifecycle: "active",
|
|
389
|
-
exposure: "
|
|
416
|
+
exposure: ["cowork", "space_builder"],
|
|
390
417
|
constraints: {
|
|
391
418
|
exactSizes: {
|
|
392
419
|
"1:1": "1024x1024",
|
|
@@ -420,7 +447,7 @@ var IMAGE_MODELS = [
|
|
|
420
447
|
adapter: "fal",
|
|
421
448
|
providerModelId: "muse-image-1.0",
|
|
422
449
|
lifecycle: "active",
|
|
423
|
-
exposure: "
|
|
450
|
+
exposure: ["cowork", "space_builder"],
|
|
424
451
|
constraints: {
|
|
425
452
|
aspectRatios: [
|
|
426
453
|
"21:9",
|
|
@@ -455,7 +482,7 @@ var IMAGE_MODELS = [
|
|
|
455
482
|
adapter: "ark",
|
|
456
483
|
providerModelId: "dola-seedream-5-0-pro-260628",
|
|
457
484
|
lifecycle: "active",
|
|
458
|
-
exposure: "
|
|
485
|
+
exposure: ["cowork", "space_builder"],
|
|
459
486
|
constraints: {
|
|
460
487
|
aspectRatios: ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "21:9", "4:5", "5:4"],
|
|
461
488
|
sizes: ["1K", "2K"],
|
|
@@ -481,7 +508,7 @@ var IMAGE_MODELS = [
|
|
|
481
508
|
adapter: "ark",
|
|
482
509
|
providerModelId: "seedream-4-5-251128",
|
|
483
510
|
lifecycle: "active",
|
|
484
|
-
exposure:
|
|
511
|
+
exposure: [],
|
|
485
512
|
constraints: {
|
|
486
513
|
// 97:30 has no Ark size spelling; the A+ flow pads inputs to 97:30 and
|
|
487
514
|
// omits the ratio instead. Advertise only sizes the adapter can send.
|
|
@@ -518,7 +545,7 @@ var IMAGE_MODELS = [
|
|
|
518
545
|
adapter: "prodia",
|
|
519
546
|
providerModelId: "flux-2-pro",
|
|
520
547
|
lifecycle: "active",
|
|
521
|
-
exposure: "
|
|
548
|
+
exposure: ["cowork", "space_builder"],
|
|
522
549
|
constraints: {
|
|
523
550
|
aspectRatios: ["1:1", "2:3", "3:2", "16:9", "9:16", "4:3", "3:4", "4:5", "5:4", "21:9"],
|
|
524
551
|
sizes: ["1K"],
|
|
@@ -545,7 +572,7 @@ var IMAGE_MODELS = [
|
|
|
545
572
|
adapter: "prodia",
|
|
546
573
|
providerModelId: "inference.gemini-3-pro.img2img.v1",
|
|
547
574
|
lifecycle: "active",
|
|
548
|
-
exposure:
|
|
575
|
+
exposure: [],
|
|
549
576
|
constraints: {
|
|
550
577
|
aspectRatios: ["1:1", "2:3", "3:2", "4:3", "3:4", "4:5", "5:4", "9:16", "16:9", "21:9"],
|
|
551
578
|
sizes: ["1K", "2K", "4K"],
|
|
@@ -570,7 +597,7 @@ var IMAGE_MODELS = [
|
|
|
570
597
|
adapter: "prodia",
|
|
571
598
|
providerModelId: "inference.nano-banana.img2img.v2",
|
|
572
599
|
lifecycle: "active",
|
|
573
|
-
exposure:
|
|
600
|
+
exposure: [],
|
|
574
601
|
constraints: {
|
|
575
602
|
aspectRatios: ["1:1", "2:3", "3:4", "4:3", "9:16", "16:9", "21:9"],
|
|
576
603
|
sizes: ["1K"],
|
|
@@ -596,7 +623,7 @@ var IMAGE_MODELS = [
|
|
|
596
623
|
adapter: "replicate",
|
|
597
624
|
providerModelId: "wan-video/wan-2.7-image-pro",
|
|
598
625
|
lifecycle: "active",
|
|
599
|
-
exposure:
|
|
626
|
+
exposure: [],
|
|
600
627
|
constraints: {
|
|
601
628
|
aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4"],
|
|
602
629
|
sizes: ["1K", "2K", "4K"],
|
|
@@ -622,7 +649,7 @@ var IMAGE_MODELS = [
|
|
|
622
649
|
adapter: "replicate",
|
|
623
650
|
providerModelId: "qwen/qwen-image-2-pro",
|
|
624
651
|
lifecycle: "active",
|
|
625
|
-
exposure:
|
|
652
|
+
exposure: [],
|
|
626
653
|
constraints: {
|
|
627
654
|
aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"],
|
|
628
655
|
sizes: [],
|
|
@@ -648,7 +675,7 @@ var IMAGE_MODELS = [
|
|
|
648
675
|
adapter: "replicate",
|
|
649
676
|
providerModelId: "qwen-edit-apps/qwen-image-edit-plus-lora-skin",
|
|
650
677
|
lifecycle: "active",
|
|
651
|
-
exposure:
|
|
678
|
+
exposure: [],
|
|
652
679
|
constraints: {
|
|
653
680
|
aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4"],
|
|
654
681
|
sizes: [],
|
|
@@ -677,7 +704,7 @@ var OTHER_MODELS = [
|
|
|
677
704
|
adapter: "google-genai",
|
|
678
705
|
providerModelId: "lyria-3-clip-preview",
|
|
679
706
|
lifecycle: "active",
|
|
680
|
-
exposure: "
|
|
707
|
+
exposure: ["cowork", "space_builder"],
|
|
681
708
|
constraints: {
|
|
682
709
|
durations: [30],
|
|
683
710
|
references: { images: 10 },
|
|
@@ -701,7 +728,7 @@ var OTHER_MODELS = [
|
|
|
701
728
|
adapter: "google-genai",
|
|
702
729
|
providerModelId: "lyria-3-pro-preview",
|
|
703
730
|
lifecycle: "active",
|
|
704
|
-
exposure: "
|
|
731
|
+
exposure: ["cowork", "space_builder"],
|
|
705
732
|
constraints: {
|
|
706
733
|
references: { images: 10 },
|
|
707
734
|
supports: []
|
|
@@ -724,7 +751,7 @@ var OTHER_MODELS = [
|
|
|
724
751
|
adapter: "replicate",
|
|
725
752
|
providerModelId: "google/lyria-2",
|
|
726
753
|
lifecycle: "active",
|
|
727
|
-
exposure:
|
|
754
|
+
exposure: [],
|
|
728
755
|
constraints: {
|
|
729
756
|
durations: [30],
|
|
730
757
|
supports: ["seed", "negativePrompt"]
|
|
@@ -746,7 +773,7 @@ var OTHER_MODELS = [
|
|
|
746
773
|
adapter: "replicate",
|
|
747
774
|
providerModelId: "zsxkib/mmaudio:62871fb59889b2d7c13777f08deb3b36bdff88f7e1d53a50ad7694548a41b484",
|
|
748
775
|
lifecycle: "active",
|
|
749
|
-
exposure: "
|
|
776
|
+
exposure: ["cowork", "space_builder"],
|
|
750
777
|
constraints: {
|
|
751
778
|
durations: { min: 1, max: 30 },
|
|
752
779
|
requires: ["sourceVideo"],
|
|
@@ -769,7 +796,7 @@ var OTHER_MODELS = [
|
|
|
769
796
|
adapter: "replicate",
|
|
770
797
|
providerModelId: "elevenlabs/music",
|
|
771
798
|
lifecycle: "active",
|
|
772
|
-
exposure:
|
|
799
|
+
exposure: [],
|
|
773
800
|
constraints: {
|
|
774
801
|
durations: { min: 5, max: 300 },
|
|
775
802
|
supports: ["instrumental"]
|
|
@@ -792,7 +819,7 @@ var OTHER_MODELS = [
|
|
|
792
819
|
adapter: "replicate",
|
|
793
820
|
providerModelId: "topazlabs/image-upscale",
|
|
794
821
|
lifecycle: "active",
|
|
795
|
-
exposure: "
|
|
822
|
+
exposure: ["cowork", "space_builder"],
|
|
796
823
|
constraints: {
|
|
797
824
|
references: { images: 1 },
|
|
798
825
|
requires: ["references"],
|
|
@@ -815,7 +842,7 @@ var OTHER_MODELS = [
|
|
|
815
842
|
adapter: "prodia",
|
|
816
843
|
providerModelId: "inference.remove-background.v1",
|
|
817
844
|
lifecycle: "active",
|
|
818
|
-
exposure: "
|
|
845
|
+
exposure: ["cowork", "space_builder"],
|
|
819
846
|
constraints: {
|
|
820
847
|
references: { images: 1 },
|
|
821
848
|
requires: ["references"],
|
|
@@ -854,7 +881,7 @@ function text(id, label, providerModelId, extra) {
|
|
|
854
881
|
adapter: "ai-sdk-text",
|
|
855
882
|
providerModelId,
|
|
856
883
|
lifecycle: "active",
|
|
857
|
-
exposure:
|
|
884
|
+
exposure: [],
|
|
858
885
|
constraints: { supports: [] },
|
|
859
886
|
defaults: {},
|
|
860
887
|
usage: { ...TEXT_USAGE },
|
|
@@ -873,7 +900,7 @@ var OPENAI_REASONING = { openai: { reasoningEffort: "medium", reasoningSummary:
|
|
|
873
900
|
var DEEPSEEK_THINKING = { deepseek: { thinking: { type: "enabled" } } };
|
|
874
901
|
var TEXT_MODELS = [
|
|
875
902
|
text("gpt-4o", "GPT-4o", "gpt-4o", {
|
|
876
|
-
exposure:
|
|
903
|
+
exposure: [],
|
|
877
904
|
display: {
|
|
878
905
|
provider: "openai",
|
|
879
906
|
costTier: 2,
|
|
@@ -882,7 +909,7 @@ var TEXT_MODELS = [
|
|
|
882
909
|
capabilities: { vision: true, contextWindow: 128e3 }
|
|
883
910
|
}),
|
|
884
911
|
text("gpt-4o-mini", "GPT-4o mini", "gpt-4o-mini", {
|
|
885
|
-
exposure:
|
|
912
|
+
exposure: [],
|
|
886
913
|
display: {
|
|
887
914
|
provider: "openai",
|
|
888
915
|
costTier: 1,
|
|
@@ -891,7 +918,7 @@ var TEXT_MODELS = [
|
|
|
891
918
|
capabilities: { vision: true, contextWindow: 128e3 }
|
|
892
919
|
}),
|
|
893
920
|
text("gpt-5.1", "GPT-5.1", "gpt-5.1", {
|
|
894
|
-
exposure: "
|
|
921
|
+
exposure: ["cowork", "space_builder"],
|
|
895
922
|
display: {
|
|
896
923
|
provider: "openai",
|
|
897
924
|
costTier: 3,
|
|
@@ -900,7 +927,7 @@ var TEXT_MODELS = [
|
|
|
900
927
|
capabilities: { vision: true, contextWindow: 4e5 }
|
|
901
928
|
}),
|
|
902
929
|
text("gpt-5.2", "GPT-5.2", "gpt-5.2", {
|
|
903
|
-
exposure: "
|
|
930
|
+
exposure: ["cowork", "space_builder"],
|
|
904
931
|
display: {
|
|
905
932
|
provider: "openai",
|
|
906
933
|
costTier: 3,
|
|
@@ -910,7 +937,7 @@ var TEXT_MODELS = [
|
|
|
910
937
|
}),
|
|
911
938
|
// 1.05M-token context: https://platform.openai.com/docs/models/gpt-5.4
|
|
912
939
|
text("gpt-5.4", "GPT-5.4", "gpt-5.4", {
|
|
913
|
-
exposure:
|
|
940
|
+
exposure: [],
|
|
914
941
|
display: {
|
|
915
942
|
provider: "openai",
|
|
916
943
|
costTier: 3,
|
|
@@ -923,7 +950,7 @@ var TEXT_MODELS = [
|
|
|
923
950
|
}),
|
|
924
951
|
// OpenAI never shipped gpt-5.1-mini or gpt-5.2-mini; callers that still send them get 5.4 mini.
|
|
925
952
|
text("gpt-5.4-mini", "GPT-5.4 mini", "gpt-5.4-mini", {
|
|
926
|
-
exposure: "
|
|
953
|
+
exposure: ["cowork", "space_builder"],
|
|
927
954
|
aliases: ["gpt-5.1-mini", "gpt-5.2-mini"],
|
|
928
955
|
display: {
|
|
929
956
|
provider: "openai",
|
|
@@ -933,7 +960,7 @@ var TEXT_MODELS = [
|
|
|
933
960
|
capabilities: { vision: true, contextWindow: 4e5 }
|
|
934
961
|
}),
|
|
935
962
|
text("gpt-5.5", "GPT-5.5", "gpt-5.5", {
|
|
936
|
-
exposure: "
|
|
963
|
+
exposure: ["cowork", "space_builder"],
|
|
937
964
|
display: {
|
|
938
965
|
provider: "openai",
|
|
939
966
|
costTier: 3,
|
|
@@ -945,7 +972,7 @@ var TEXT_MODELS = [
|
|
|
945
972
|
}
|
|
946
973
|
}),
|
|
947
974
|
text("gpt-5.6-luna", "GPT-5.6 Luna", "gpt-5.6-luna", {
|
|
948
|
-
exposure: "
|
|
975
|
+
exposure: ["cowork", "space_builder"],
|
|
949
976
|
display: {
|
|
950
977
|
chat: { providerOptions: OPENAI_REASONING },
|
|
951
978
|
provider: "openai",
|
|
@@ -959,7 +986,7 @@ var TEXT_MODELS = [
|
|
|
959
986
|
}
|
|
960
987
|
}),
|
|
961
988
|
text("gpt-5.6-terra", "GPT-5.6 Terra", "gpt-5.6-terra", {
|
|
962
|
-
exposure: "
|
|
989
|
+
exposure: ["cowork", "space_builder"],
|
|
963
990
|
display: {
|
|
964
991
|
chat: { providerOptions: OPENAI_REASONING },
|
|
965
992
|
provider: "openai",
|
|
@@ -973,7 +1000,7 @@ var TEXT_MODELS = [
|
|
|
973
1000
|
}
|
|
974
1001
|
}),
|
|
975
1002
|
text("gpt-5.6-sol", "GPT-5.6 Sol", "gpt-5.6-sol", {
|
|
976
|
-
exposure: "
|
|
1003
|
+
exposure: ["cowork", "space_builder"],
|
|
977
1004
|
display: {
|
|
978
1005
|
chat: { providerOptions: OPENAI_REASONING },
|
|
979
1006
|
provider: "openai",
|
|
@@ -988,7 +1015,7 @@ var TEXT_MODELS = [
|
|
|
988
1015
|
}),
|
|
989
1016
|
// Library key "claude-sonnet-4.5" maps to the SDK id "claude-sonnet-4-5".
|
|
990
1017
|
text("claude-sonnet-4-5", "Claude Sonnet 4.5", "claude-sonnet-4-5", {
|
|
991
|
-
exposure:
|
|
1018
|
+
exposure: [],
|
|
992
1019
|
aliases: ["claude-sonnet-4.5", "claude-sonnet-4-5-20250929"],
|
|
993
1020
|
display: {
|
|
994
1021
|
provider: "anthropic",
|
|
@@ -999,7 +1026,7 @@ var TEXT_MODELS = [
|
|
|
999
1026
|
}),
|
|
1000
1027
|
// Anthropic retired the dated 4.0 ids; callers that still send them get 4.6.
|
|
1001
1028
|
text("claude-sonnet-4-6", "Claude Sonnet 4.6", "claude-sonnet-4-6", {
|
|
1002
|
-
exposure: "
|
|
1029
|
+
exposure: ["cowork", "space_builder"],
|
|
1003
1030
|
aliases: [
|
|
1004
1031
|
"claude-sonnet-4.6",
|
|
1005
1032
|
"claude-sonnet-4",
|
|
@@ -1019,7 +1046,7 @@ var TEXT_MODELS = [
|
|
|
1019
1046
|
}
|
|
1020
1047
|
}),
|
|
1021
1048
|
text("claude-sonnet-5", "Claude Sonnet 5", "claude-sonnet-5", {
|
|
1022
|
-
exposure: "
|
|
1049
|
+
exposure: ["cowork", "space_builder"],
|
|
1023
1050
|
display: {
|
|
1024
1051
|
chat: { providerOptions: ANTHROPIC_ADAPTIVE },
|
|
1025
1052
|
provider: "anthropic",
|
|
@@ -1033,7 +1060,7 @@ var TEXT_MODELS = [
|
|
|
1033
1060
|
}
|
|
1034
1061
|
}),
|
|
1035
1062
|
text("claude-opus-4-8", "Claude Opus 4.8", "claude-opus-4-8", {
|
|
1036
|
-
exposure: "
|
|
1063
|
+
exposure: ["cowork", "space_builder"],
|
|
1037
1064
|
aliases: ["claude-opus-4.8", "claude-opus-4", "claude-opus-4.0", "claude-opus-4-20250514"],
|
|
1038
1065
|
display: {
|
|
1039
1066
|
chat: { providerOptions: ANTHROPIC_ADAPTIVE },
|
|
@@ -1048,7 +1075,7 @@ var TEXT_MODELS = [
|
|
|
1048
1075
|
}
|
|
1049
1076
|
}),
|
|
1050
1077
|
text("claude-haiku-4-5", "Claude Haiku 4.5", "claude-haiku-4-5", {
|
|
1051
|
-
exposure: "
|
|
1078
|
+
exposure: ["cowork", "space_builder"],
|
|
1052
1079
|
aliases: ["claude-haiku-4.5", "claude-haiku-4-5-20251001", "claude-haiku-4"],
|
|
1053
1080
|
display: {
|
|
1054
1081
|
chat: { providerOptions: ANTHROPIC_THINKING },
|
|
@@ -1063,7 +1090,7 @@ var TEXT_MODELS = [
|
|
|
1063
1090
|
}
|
|
1064
1091
|
}),
|
|
1065
1092
|
text("claude-opus-5", "Claude Opus 5", "claude-opus-5", {
|
|
1066
|
-
exposure:
|
|
1093
|
+
exposure: [],
|
|
1067
1094
|
aliases: ["claude-opus-5.0"],
|
|
1068
1095
|
display: {
|
|
1069
1096
|
provider: "anthropic",
|
|
@@ -1076,7 +1103,7 @@ var TEXT_MODELS = [
|
|
|
1076
1103
|
}
|
|
1077
1104
|
}),
|
|
1078
1105
|
text("claude-fable-5", "Claude Fable 5", "claude-fable-5", {
|
|
1079
|
-
exposure:
|
|
1106
|
+
exposure: [],
|
|
1080
1107
|
display: {
|
|
1081
1108
|
provider: "anthropic",
|
|
1082
1109
|
costTier: 3,
|
|
@@ -1088,7 +1115,7 @@ var TEXT_MODELS = [
|
|
|
1088
1115
|
}
|
|
1089
1116
|
}),
|
|
1090
1117
|
text("gemini-2.5-flash", "Gemini 2.5 Flash", "gemini-2.5-flash", {
|
|
1091
|
-
exposure:
|
|
1118
|
+
exposure: [],
|
|
1092
1119
|
display: {
|
|
1093
1120
|
provider: "google",
|
|
1094
1121
|
costTier: 1,
|
|
@@ -1100,7 +1127,7 @@ var TEXT_MODELS = [
|
|
|
1100
1127
|
}
|
|
1101
1128
|
}),
|
|
1102
1129
|
text("gemini-2.5-pro", "Gemini 2.5 Pro", "gemini-2.5-pro", {
|
|
1103
|
-
exposure:
|
|
1130
|
+
exposure: [],
|
|
1104
1131
|
display: {
|
|
1105
1132
|
provider: "google",
|
|
1106
1133
|
costTier: 2,
|
|
@@ -1112,7 +1139,7 @@ var TEXT_MODELS = [
|
|
|
1112
1139
|
}
|
|
1113
1140
|
}),
|
|
1114
1141
|
text("gemini-3.1-pro-preview", "Gemini 3.1 Pro (preview)", "gemini-3.1-pro-preview", {
|
|
1115
|
-
exposure: "
|
|
1142
|
+
exposure: ["cowork", "space_builder"],
|
|
1116
1143
|
display: {
|
|
1117
1144
|
provider: "google",
|
|
1118
1145
|
costTier: 2,
|
|
@@ -1124,7 +1151,7 @@ var TEXT_MODELS = [
|
|
|
1124
1151
|
}
|
|
1125
1152
|
}),
|
|
1126
1153
|
text("gemini-3.5-flash", "Gemini 3.5 Flash", "gemini-3.5-flash", {
|
|
1127
|
-
exposure: "
|
|
1154
|
+
exposure: ["cowork", "space_builder"],
|
|
1128
1155
|
display: {
|
|
1129
1156
|
provider: "google",
|
|
1130
1157
|
costTier: 1,
|
|
@@ -1136,7 +1163,7 @@ var TEXT_MODELS = [
|
|
|
1136
1163
|
}
|
|
1137
1164
|
}),
|
|
1138
1165
|
text("gemini-3.6-flash", "Gemini 3.6 Flash", "gemini-3.6-flash", {
|
|
1139
|
-
exposure: "
|
|
1166
|
+
exposure: ["cowork", "space_builder"],
|
|
1140
1167
|
display: {
|
|
1141
1168
|
provider: "google",
|
|
1142
1169
|
costTier: 1,
|
|
@@ -1148,7 +1175,7 @@ var TEXT_MODELS = [
|
|
|
1148
1175
|
}
|
|
1149
1176
|
}),
|
|
1150
1177
|
text("gemini-3.7-flash", "Gemini 3.7 Flash", "gemini-3.7-flash", {
|
|
1151
|
-
exposure: "
|
|
1178
|
+
exposure: ["cowork", "space_builder"],
|
|
1152
1179
|
display: {
|
|
1153
1180
|
provider: "google",
|
|
1154
1181
|
costTier: 1,
|
|
@@ -1161,7 +1188,7 @@ var TEXT_MODELS = [
|
|
|
1161
1188
|
}
|
|
1162
1189
|
}),
|
|
1163
1190
|
text("gemini-3.8-flash", "Gemini 3.8 Flash", "gemini-3.8-flash", {
|
|
1164
|
-
exposure:
|
|
1191
|
+
exposure: [],
|
|
1165
1192
|
display: {
|
|
1166
1193
|
provider: "google",
|
|
1167
1194
|
costTier: 1,
|
|
@@ -1174,12 +1201,12 @@ var TEXT_MODELS = [
|
|
|
1174
1201
|
}),
|
|
1175
1202
|
// Renamed to gemini-3.6-flash in vibe-shared model-migration.ts.
|
|
1176
1203
|
text("gemini-3-flash-preview", "Gemini 3 Flash (preview)", "gemini-3-flash-preview", {
|
|
1177
|
-
exposure:
|
|
1204
|
+
exposure: [],
|
|
1178
1205
|
lifecycle: "deprecated",
|
|
1179
1206
|
replacedBy: "gemini-3.6-flash"
|
|
1180
1207
|
}),
|
|
1181
1208
|
text("gemini-3.1-flash-lite", "Gemini 3.1 Flash Lite", "gemini-3.1-flash-lite", {
|
|
1182
|
-
exposure:
|
|
1209
|
+
exposure: [],
|
|
1183
1210
|
display: {
|
|
1184
1211
|
provider: "google",
|
|
1185
1212
|
costTier: 1,
|
|
@@ -1191,7 +1218,7 @@ var TEXT_MODELS = [
|
|
|
1191
1218
|
}
|
|
1192
1219
|
}),
|
|
1193
1220
|
text("sonar", "Sonar", "sonar", {
|
|
1194
|
-
exposure:
|
|
1221
|
+
exposure: [],
|
|
1195
1222
|
display: {
|
|
1196
1223
|
provider: "perplexity",
|
|
1197
1224
|
costTier: 1,
|
|
@@ -1203,7 +1230,7 @@ var TEXT_MODELS = [
|
|
|
1203
1230
|
}
|
|
1204
1231
|
}),
|
|
1205
1232
|
text("sonar-pro", "Sonar Pro", "sonar-pro", {
|
|
1206
|
-
exposure:
|
|
1233
|
+
exposure: [],
|
|
1207
1234
|
display: {
|
|
1208
1235
|
provider: "perplexity",
|
|
1209
1236
|
costTier: 2,
|
|
@@ -1215,7 +1242,7 @@ var TEXT_MODELS = [
|
|
|
1215
1242
|
}
|
|
1216
1243
|
}),
|
|
1217
1244
|
text("sonar-reasoning-pro", "Sonar Reasoning Pro", "sonar-reasoning-pro", {
|
|
1218
|
-
exposure:
|
|
1245
|
+
exposure: [],
|
|
1219
1246
|
display: {
|
|
1220
1247
|
provider: "perplexity",
|
|
1221
1248
|
costTier: 2,
|
|
@@ -1231,7 +1258,7 @@ var TEXT_MODELS = [
|
|
|
1231
1258
|
// stays an alias so stored selections keep resolving.
|
|
1232
1259
|
text("deepseek-flash", "DeepSeek V4.1 Flash", "deepseek-flash", {
|
|
1233
1260
|
aliases: ["deepseek-v4-flash"],
|
|
1234
|
-
exposure: "
|
|
1261
|
+
exposure: ["cowork", "space_builder"],
|
|
1235
1262
|
display: {
|
|
1236
1263
|
chat: { providerOptions: DEEPSEEK_THINKING },
|
|
1237
1264
|
provider: "deepseek",
|
|
@@ -1246,7 +1273,7 @@ var TEXT_MODELS = [
|
|
|
1246
1273
|
}
|
|
1247
1274
|
}),
|
|
1248
1275
|
text("deepseek-v4-pro", "DeepSeek V4 Pro", "deepseek-v4-pro", {
|
|
1249
|
-
exposure: "
|
|
1276
|
+
exposure: ["cowork", "space_builder"],
|
|
1250
1277
|
display: {
|
|
1251
1278
|
chat: { providerOptions: DEEPSEEK_THINKING },
|
|
1252
1279
|
provider: "deepseek",
|
|
@@ -1261,7 +1288,7 @@ var TEXT_MODELS = [
|
|
|
1261
1288
|
}),
|
|
1262
1289
|
// 1M-token context: https://docs.x.ai/docs/models/grok-4.3
|
|
1263
1290
|
text("grok-4.3", "Grok 4.3", "grok-4.3", {
|
|
1264
|
-
exposure: "
|
|
1291
|
+
exposure: ["cowork", "space_builder"],
|
|
1265
1292
|
display: {
|
|
1266
1293
|
provider: "xai",
|
|
1267
1294
|
costTier: 2,
|
|
@@ -1276,7 +1303,7 @@ var TEXT_MODELS = [
|
|
|
1276
1303
|
text("kimi-k2.5", "Kimi K2.5", "kimi-k2.5", {
|
|
1277
1304
|
lifecycle: "deprecated",
|
|
1278
1305
|
replacedBy: "kimi-k3",
|
|
1279
|
-
exposure:
|
|
1306
|
+
exposure: [],
|
|
1280
1307
|
display: {
|
|
1281
1308
|
chat: { temperature: 1 },
|
|
1282
1309
|
provider: "moonshot",
|
|
@@ -1286,7 +1313,7 @@ var TEXT_MODELS = [
|
|
|
1286
1313
|
capabilities: {}
|
|
1287
1314
|
}),
|
|
1288
1315
|
text("kimi-k3", "Kimi K3", "kimi-k3", {
|
|
1289
|
-
exposure: "
|
|
1316
|
+
exposure: ["cowork", "space_builder"],
|
|
1290
1317
|
display: {
|
|
1291
1318
|
chat: { temperature: 1 },
|
|
1292
1319
|
provider: "moonshot",
|
|
@@ -1302,7 +1329,7 @@ var TEXT_MODELS = [
|
|
|
1302
1329
|
// Cowork calls the provider "MiniMax-M3"; the pricing key is lowercase.
|
|
1303
1330
|
// 1M-token context: https://platform.minimax.io/docs/api-reference/text-openai-api
|
|
1304
1331
|
text("minimax-m3", "MiniMax M3", "MiniMax-M3", {
|
|
1305
|
-
exposure: "
|
|
1332
|
+
exposure: ["cowork", "space_builder"],
|
|
1306
1333
|
aliases: ["MiniMax-M3"],
|
|
1307
1334
|
display: {
|
|
1308
1335
|
provider: "minimax",
|
|
@@ -1339,7 +1366,7 @@ var VIDEO_MODELS = [
|
|
|
1339
1366
|
adapter: "google-genai",
|
|
1340
1367
|
providerModelId: "veo-3.1-generate-preview",
|
|
1341
1368
|
lifecycle: "active",
|
|
1342
|
-
exposure: "
|
|
1369
|
+
exposure: ["cowork", "space_builder"],
|
|
1343
1370
|
constraints: {
|
|
1344
1371
|
aspectRatios: [...OMNI_RATIOS],
|
|
1345
1372
|
resolutions: ["720p", "1080p", "4k"],
|
|
@@ -1369,7 +1396,7 @@ var VIDEO_MODELS = [
|
|
|
1369
1396
|
adapter: "google-genai",
|
|
1370
1397
|
providerModelId: "veo-3.1-fast-generate-preview",
|
|
1371
1398
|
lifecycle: "active",
|
|
1372
|
-
exposure:
|
|
1399
|
+
exposure: [],
|
|
1373
1400
|
constraints: {
|
|
1374
1401
|
aspectRatios: [...OMNI_RATIOS],
|
|
1375
1402
|
resolutions: ["720p", "1080p", "4k"],
|
|
@@ -1398,7 +1425,7 @@ var VIDEO_MODELS = [
|
|
|
1398
1425
|
adapter: "google-genai",
|
|
1399
1426
|
providerModelId: "veo-3.1-lite-generate-preview",
|
|
1400
1427
|
lifecycle: "active",
|
|
1401
|
-
exposure:
|
|
1428
|
+
exposure: [],
|
|
1402
1429
|
constraints: {
|
|
1403
1430
|
aspectRatios: [...OMNI_RATIOS],
|
|
1404
1431
|
resolutions: ["720p", "1080p"],
|
|
@@ -1428,7 +1455,7 @@ var VIDEO_MODELS = [
|
|
|
1428
1455
|
adapter: "google-genai",
|
|
1429
1456
|
providerModelId: "gemini-omni-flash-preview",
|
|
1430
1457
|
lifecycle: "active",
|
|
1431
|
-
exposure: "
|
|
1458
|
+
exposure: ["cowork", "space_builder"],
|
|
1432
1459
|
constraints: {
|
|
1433
1460
|
// 1.0 rejects `resolution`; it renders 720p. No defaults: the adapter
|
|
1434
1461
|
// sends ratio and duration only when the caller set them, so a
|
|
@@ -1456,7 +1483,7 @@ var VIDEO_MODELS = [
|
|
|
1456
1483
|
adapter: "google-genai",
|
|
1457
1484
|
providerModelId: "gemini-omni-1.1-flash",
|
|
1458
1485
|
lifecycle: "active",
|
|
1459
|
-
exposure: "
|
|
1486
|
+
exposure: ["cowork", "space_builder"],
|
|
1460
1487
|
constraints: {
|
|
1461
1488
|
aspectRatios: [...OMNI_RATIOS],
|
|
1462
1489
|
resolutions: ["360p", "720p", "1080p", "4k"],
|
|
@@ -1483,7 +1510,7 @@ var VIDEO_MODELS = [
|
|
|
1483
1510
|
adapter: "ark",
|
|
1484
1511
|
providerModelId: "dreamina-seedance-2-0-260128",
|
|
1485
1512
|
lifecycle: "active",
|
|
1486
|
-
exposure: "
|
|
1513
|
+
exposure: ["cowork", "space_builder"],
|
|
1487
1514
|
constraints: {
|
|
1488
1515
|
aspectRatios: [...SEEDANCE_RATIOS],
|
|
1489
1516
|
resolutions: ["480p", "720p", "1080p", "4k"],
|
|
@@ -1516,7 +1543,7 @@ var VIDEO_MODELS = [
|
|
|
1516
1543
|
adapter: "ark",
|
|
1517
1544
|
providerModelId: "dreamina-seedance-2-0-fast-260128",
|
|
1518
1545
|
lifecycle: "active",
|
|
1519
|
-
exposure: "
|
|
1546
|
+
exposure: ["cowork", "space_builder"],
|
|
1520
1547
|
constraints: {
|
|
1521
1548
|
aspectRatios: [...SEEDANCE_RATIOS],
|
|
1522
1549
|
resolutions: ["480p", "720p"],
|
|
@@ -1542,6 +1569,7 @@ var VIDEO_MODELS = [
|
|
|
1542
1569
|
},
|
|
1543
1570
|
{
|
|
1544
1571
|
// generateAudio defaults to false here (trigger-workflows); Space Builder defaults it to true.
|
|
1572
|
+
// omni_reference_task_type edit/extend: adaptive ratio, edit sends duration -1.
|
|
1545
1573
|
id: "seedance-2.5",
|
|
1546
1574
|
aliases: ["seedance-2-5", "dreamina-seedance-2-5-260628"],
|
|
1547
1575
|
label: "Seedance 2.5",
|
|
@@ -1549,14 +1577,14 @@ var VIDEO_MODELS = [
|
|
|
1549
1577
|
adapter: "ark",
|
|
1550
1578
|
providerModelId: "dreamina-seedance-2-5-260628",
|
|
1551
1579
|
lifecycle: "active",
|
|
1552
|
-
exposure: "
|
|
1580
|
+
exposure: ["cowork", "space_builder"],
|
|
1553
1581
|
constraints: {
|
|
1554
1582
|
aspectRatios: [...SEEDANCE_RATIOS],
|
|
1555
1583
|
resolutions: ["480p", "720p", "1080p"],
|
|
1556
1584
|
durations: { min: 4, max: 30 },
|
|
1557
1585
|
references: { images: 30, videos: 10, audios: 10 },
|
|
1558
1586
|
ratioIgnoredWith: ["firstFrame", "sourceVideo"],
|
|
1559
|
-
supports: ["generateAudio", "seed", "lastFrame", "watermark"]
|
|
1587
|
+
supports: ["generateAudio", "seed", "lastFrame", "watermark", "taskType"]
|
|
1560
1588
|
},
|
|
1561
1589
|
defaults: {
|
|
1562
1590
|
durationSeconds: 5,
|
|
@@ -1582,7 +1610,7 @@ var VIDEO_MODELS = [
|
|
|
1582
1610
|
adapter: "xai-video",
|
|
1583
1611
|
providerModelId: "grok-imagine-video",
|
|
1584
1612
|
lifecycle: "active",
|
|
1585
|
-
exposure: "
|
|
1613
|
+
exposure: ["cowork", "space_builder"],
|
|
1586
1614
|
constraints: {
|
|
1587
1615
|
aspectRatios: [...GROK_RATIOS],
|
|
1588
1616
|
resolutions: ["480p", "720p"],
|
|
@@ -1610,7 +1638,7 @@ var VIDEO_MODELS = [
|
|
|
1610
1638
|
adapter: "higgsfield",
|
|
1611
1639
|
providerModelId: "kling-video/v2.5-turbo/pro/image-to-video",
|
|
1612
1640
|
lifecycle: "active",
|
|
1613
|
-
exposure: "
|
|
1641
|
+
exposure: ["cowork", "space_builder"],
|
|
1614
1642
|
constraints: {
|
|
1615
1643
|
aspectRatios: [...KLING_RATIOS],
|
|
1616
1644
|
durations: [5, 10],
|
|
@@ -1641,7 +1669,7 @@ var VIDEO_MODELS = [
|
|
|
1641
1669
|
adapter: "higgsfield",
|
|
1642
1670
|
providerModelId: "kling-video/v3.0/pro/image-to-video",
|
|
1643
1671
|
lifecycle: "active",
|
|
1644
|
-
exposure: "
|
|
1672
|
+
exposure: ["cowork", "space_builder"],
|
|
1645
1673
|
constraints: {
|
|
1646
1674
|
aspectRatios: [...KLING_RATIOS],
|
|
1647
1675
|
durations: { min: 3, max: 15 },
|
|
@@ -1665,6 +1693,9 @@ var VIDEO_MODELS = [
|
|
|
1665
1693
|
},
|
|
1666
1694
|
{
|
|
1667
1695
|
// mode standard/pro selects 720p/1080p; the endpoint takes no separate resolution.
|
|
1696
|
+
// Replicate: "Max 7 [images] without video, 4 with video"; 4K does not support
|
|
1697
|
+
// reference_video. No `videos` limit yet: the adapter sends no reference video,
|
|
1698
|
+
// so `imagesWithVideo` stays dormant until one is wired through.
|
|
1668
1699
|
id: "kling-v3-omni-video",
|
|
1669
1700
|
aliases: ["kwaivgi/kling-v3-omni-video", "kling-v3-omni"],
|
|
1670
1701
|
label: "Kling V3 Omni",
|
|
@@ -1672,12 +1703,12 @@ var VIDEO_MODELS = [
|
|
|
1672
1703
|
adapter: "replicate",
|
|
1673
1704
|
providerModelId: "kwaivgi/kling-v3-omni-video",
|
|
1674
1705
|
lifecycle: "active",
|
|
1675
|
-
exposure: "
|
|
1706
|
+
exposure: ["cowork", "space_builder"],
|
|
1676
1707
|
constraints: {
|
|
1677
1708
|
aspectRatios: [...KLING_RATIOS],
|
|
1678
1709
|
resolutions: ["720p", "1080p"],
|
|
1679
1710
|
durations: { min: 3, max: 15 },
|
|
1680
|
-
references: { images: 7 },
|
|
1711
|
+
references: { images: 7, imagesWithVideo: 4 },
|
|
1681
1712
|
supports: ["generateAudio", "lastFrame"]
|
|
1682
1713
|
},
|
|
1683
1714
|
defaults: { durationSeconds: 5, aspectRatio: "16:9", generateAudio: false, mode: "pro" },
|
|
@@ -1698,7 +1729,7 @@ var VIDEO_MODELS = [
|
|
|
1698
1729
|
adapter: "fal",
|
|
1699
1730
|
providerModelId: "minimax/h3",
|
|
1700
1731
|
lifecycle: "active",
|
|
1701
|
-
exposure: "
|
|
1732
|
+
exposure: ["cowork", "space_builder"],
|
|
1702
1733
|
constraints: {
|
|
1703
1734
|
aspectRatios: [...H3_RATIOS],
|
|
1704
1735
|
resolutions: ["480p", "768p", "2k", "4k"],
|
|
@@ -1728,7 +1759,7 @@ var VIDEO_MODELS = [
|
|
|
1728
1759
|
adapter: "fal",
|
|
1729
1760
|
providerModelId: "minimax/h3-max",
|
|
1730
1761
|
lifecycle: "active",
|
|
1731
|
-
exposure: "
|
|
1762
|
+
exposure: ["cowork", "space_builder"],
|
|
1732
1763
|
constraints: {
|
|
1733
1764
|
aspectRatios: [...H3_RATIOS],
|
|
1734
1765
|
resolutions: ["480p", "768p"],
|
|
@@ -1758,7 +1789,7 @@ var VIDEO_MODELS = [
|
|
|
1758
1789
|
adapter: "fal",
|
|
1759
1790
|
providerModelId: "minimax/h3/reference-to-video",
|
|
1760
1791
|
lifecycle: "active",
|
|
1761
|
-
exposure: "
|
|
1792
|
+
exposure: ["cowork", "space_builder"],
|
|
1762
1793
|
constraints: {
|
|
1763
1794
|
aspectRatios: [...H3_REFERENCE_RATIOS],
|
|
1764
1795
|
resolutions: ["480p", "768p", "2k", "4k"],
|
|
@@ -1789,7 +1820,7 @@ var VIDEO_MODELS = [
|
|
|
1789
1820
|
adapter: "fal",
|
|
1790
1821
|
providerModelId: "minimax/h3-max/reference-to-video",
|
|
1791
1822
|
lifecycle: "active",
|
|
1792
|
-
exposure: "
|
|
1823
|
+
exposure: ["cowork", "space_builder"],
|
|
1793
1824
|
constraints: {
|
|
1794
1825
|
aspectRatios: [...H3_REFERENCE_RATIOS],
|
|
1795
1826
|
resolutions: ["480p", "768p"],
|
|
@@ -1821,7 +1852,7 @@ var VIDEO_MODELS = [
|
|
|
1821
1852
|
adapter: "fal",
|
|
1822
1853
|
providerModelId: "fal-ai/kling-video/o1/video-to-video/reference",
|
|
1823
1854
|
lifecycle: "active",
|
|
1824
|
-
exposure:
|
|
1855
|
+
exposure: [],
|
|
1825
1856
|
constraints: {
|
|
1826
1857
|
aspectRatios: [...KLING_RATIOS],
|
|
1827
1858
|
durations: { min: 3, max: 10 },
|
|
@@ -1846,7 +1877,7 @@ var VIDEO_MODELS = [
|
|
|
1846
1877
|
adapter: "replicate",
|
|
1847
1878
|
providerModelId: "minimax/hailuo-02",
|
|
1848
1879
|
lifecycle: "active",
|
|
1849
|
-
exposure:
|
|
1880
|
+
exposure: [],
|
|
1850
1881
|
constraints: {
|
|
1851
1882
|
resolutions: ["768p"],
|
|
1852
1883
|
durations: [6, 10],
|
|
@@ -1870,7 +1901,7 @@ var VIDEO_MODELS = [
|
|
|
1870
1901
|
adapter: "higgsfield",
|
|
1871
1902
|
providerModelId: "dop-preview",
|
|
1872
1903
|
lifecycle: "active",
|
|
1873
|
-
exposure:
|
|
1904
|
+
exposure: [],
|
|
1874
1905
|
constraints: {
|
|
1875
1906
|
requires: ["firstFrame"],
|
|
1876
1907
|
supports: ["seed", "lastFrame"]
|
|
@@ -1910,6 +1941,12 @@ var ADAPTER_IDS = [
|
|
|
1910
1941
|
];
|
|
1911
1942
|
var ModelTypeSchema = import_zod.z.enum(["text", "image", "video", "audio", "upscale", "bg-remove"]);
|
|
1912
1943
|
var LifecycleSchema = import_zod.z.enum(["active", "deprecated", "retired"]);
|
|
1944
|
+
var SurfaceSchema = import_zod.z.enum(["cowork", "space_builder"]);
|
|
1945
|
+
var SURFACES2 = SurfaceSchema.options;
|
|
1946
|
+
var ExposureSchema = import_zod.z.preprocess(
|
|
1947
|
+
normalizeExposure,
|
|
1948
|
+
import_zod.z.array(SurfaceSchema)
|
|
1949
|
+
);
|
|
1913
1950
|
var AdapterSchema = import_zod.z.enum(ADAPTER_IDS);
|
|
1914
1951
|
var AspectRatioSchema = import_zod.z.enum([
|
|
1915
1952
|
"1:1",
|
|
@@ -1947,6 +1984,7 @@ var SupportedOptionSchema = import_zod.z.enum([
|
|
|
1947
1984
|
"upscale",
|
|
1948
1985
|
"watermark",
|
|
1949
1986
|
"safetyChecker",
|
|
1987
|
+
"taskType",
|
|
1950
1988
|
"instrumental"
|
|
1951
1989
|
]);
|
|
1952
1990
|
var UsageUnitSchema = import_zod.z.enum([
|
|
@@ -1969,6 +2007,7 @@ var ProviderOptionValueSchema = import_zod.z.lazy(
|
|
|
1969
2007
|
var ProviderOptionsSchema = import_zod.z.record(import_zod.z.string(), import_zod.z.record(import_zod.z.string(), ProviderOptionValueSchema));
|
|
1970
2008
|
var ReferenceLimitsSchema = import_zod.z.looseObject({
|
|
1971
2009
|
images: import_zod.z.number().optional(),
|
|
2010
|
+
imagesWithVideo: import_zod.z.number().optional(),
|
|
1972
2011
|
videos: import_zod.z.number().optional(),
|
|
1973
2012
|
audios: import_zod.z.number().optional(),
|
|
1974
2013
|
total: import_zod.z.number().optional(),
|
|
@@ -2030,6 +2069,7 @@ var DefaultsSchema = import_zod.z.looseObject({
|
|
|
2030
2069
|
promptExpansion: import_zod.z.enum(["fast", "balanced", "quality"]).optional(),
|
|
2031
2070
|
watermark: import_zod.z.boolean().optional(),
|
|
2032
2071
|
safetyChecker: import_zod.z.boolean().optional(),
|
|
2072
|
+
taskType: import_zod.z.enum(["reference", "edit", "extend"]).optional(),
|
|
2033
2073
|
mode: import_zod.z.enum(["standard", "pro"]).optional(),
|
|
2034
2074
|
instrumental: import_zod.z.boolean().optional()
|
|
2035
2075
|
});
|
|
@@ -2061,7 +2101,7 @@ var CatalogModelSchemaBase = import_zod.z.looseObject({
|
|
|
2061
2101
|
providerModelId: import_zod.z.string().min(1),
|
|
2062
2102
|
lifecycle: LifecycleSchema,
|
|
2063
2103
|
replacedBy: import_zod.z.string().optional(),
|
|
2064
|
-
exposure:
|
|
2104
|
+
exposure: ExposureSchema,
|
|
2065
2105
|
constraints: ModelConstraintsSchema,
|
|
2066
2106
|
defaults: DefaultsSchema,
|
|
2067
2107
|
providerOptions: ProviderOptionsSchema.optional(),
|
|
@@ -2589,6 +2629,9 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
|
|
|
2589
2629
|
model,
|
|
2590
2630
|
warnings
|
|
2591
2631
|
);
|
|
2632
|
+
if (limits.imagesWithVideo !== void 0 && (limits.videos ?? 0) > 0 && videos.length > 0 && images.length > limits.imagesWithVideo) {
|
|
2633
|
+
images = trim("referenceImages", images, limits.imagesWithVideo, model, warnings);
|
|
2634
|
+
}
|
|
2592
2635
|
if (limits.total !== void 0) {
|
|
2593
2636
|
let over = images.length + videos.length + audios.length - limits.total;
|
|
2594
2637
|
if (over > 0) {
|
|
@@ -2622,7 +2665,8 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
|
|
|
2622
2665
|
"promptExpansion",
|
|
2623
2666
|
"lastFrame",
|
|
2624
2667
|
"watermark",
|
|
2625
|
-
"safetyChecker"
|
|
2668
|
+
"safetyChecker",
|
|
2669
|
+
"taskType"
|
|
2626
2670
|
]);
|
|
2627
2671
|
return { request: merged, warnings };
|
|
2628
2672
|
}
|
|
@@ -2923,7 +2967,7 @@ function passthroughTextModel(model) {
|
|
|
2923
2967
|
adapter: "ai-sdk-text",
|
|
2924
2968
|
providerModelId: model.modelId,
|
|
2925
2969
|
lifecycle: "active",
|
|
2926
|
-
exposure:
|
|
2970
|
+
exposure: [],
|
|
2927
2971
|
constraints: {},
|
|
2928
2972
|
defaults: {},
|
|
2929
2973
|
usage: { unit: "tokens" },
|
|
@@ -4063,9 +4107,22 @@ function seedanceErrorMessage(error, status) {
|
|
|
4063
4107
|
return `Seedance task ${status}`;
|
|
4064
4108
|
}
|
|
4065
4109
|
async function generateSeedanceVideo(req, ctx) {
|
|
4066
|
-
const key = arkKey(ctx);
|
|
4067
4110
|
const modelId = ctx.model.id;
|
|
4068
|
-
const
|
|
4111
|
+
const taskType = req.taskType;
|
|
4112
|
+
const hasVideo = Boolean(req.sourceVideo) || (req.referenceVideos?.length ?? 0) > 0;
|
|
4113
|
+
if ((taskType === "edit" || taskType === "extend") && !hasVideo) {
|
|
4114
|
+
throw new ModelKitError({
|
|
4115
|
+
code: "missing_input",
|
|
4116
|
+
message: `${ctx.model.id} ${taskType} task needs a source or reference video`,
|
|
4117
|
+
provider: "ark",
|
|
4118
|
+
model: ctx.model.id,
|
|
4119
|
+
retryable: false
|
|
4120
|
+
});
|
|
4121
|
+
}
|
|
4122
|
+
const key = arkKey(ctx);
|
|
4123
|
+
const requestedDuration = req.durationSeconds ?? 5;
|
|
4124
|
+
let duration = requestedDuration;
|
|
4125
|
+
if (taskType === "edit") duration = -1;
|
|
4069
4126
|
const resolution = req.resolution ?? "720p";
|
|
4070
4127
|
const content = [{ type: "text", text: req.prompt }];
|
|
4071
4128
|
if (req.firstFrame) {
|
|
@@ -4117,7 +4174,10 @@ async function generateSeedanceVideo(req, ctx) {
|
|
|
4117
4174
|
duration,
|
|
4118
4175
|
resolution
|
|
4119
4176
|
};
|
|
4120
|
-
if (
|
|
4177
|
+
if (taskType === "edit" || taskType === "extend") body.ratio = "adaptive";
|
|
4178
|
+
else if (!hasFrameAnchor && req.aspectRatio !== void 0) body.ratio = req.aspectRatio;
|
|
4179
|
+
if (taskType !== void 0 && ctx.model.id === "seedance-2.5")
|
|
4180
|
+
body.omni_reference_task_type = taskType;
|
|
4121
4181
|
if (req.generateAudio !== void 0) body.generate_audio = req.generateAudio;
|
|
4122
4182
|
if (req.seed !== void 0) body.seed = req.seed;
|
|
4123
4183
|
if (req.watermark !== void 0) body.watermark = req.watermark;
|
|
@@ -4137,7 +4197,7 @@ async function generateSeedanceVideo(req, ctx) {
|
|
|
4137
4197
|
}, retryOptsFor(ctx));
|
|
4138
4198
|
if (!submit.id) throwArkError(void 0, "Seedance task create returned no id", modelId);
|
|
4139
4199
|
const jobId = submit.id;
|
|
4140
|
-
const usage2 = seedanceUsage(ctx, req, duration);
|
|
4200
|
+
const usage2 = seedanceUsage(ctx, req, taskType === "edit" ? requestedDuration : duration);
|
|
4141
4201
|
const fetchStatus = async () => {
|
|
4142
4202
|
const res = await arkFetch(ctx, `${arkBaseUrl(ctx)}${SUBMIT_PATH}/${jobId}`, {
|
|
4143
4203
|
headers: { Authorization: `Bearer ${key}` }
|
|
@@ -4184,6 +4244,10 @@ async function generateSeedanceVideo(req, ctx) {
|
|
|
4184
4244
|
"Seedance task succeeded but returned no video_url",
|
|
4185
4245
|
modelId
|
|
4186
4246
|
);
|
|
4247
|
+
if (polled.duration !== void 0 && polled.duration > 0) {
|
|
4248
|
+
usage2.quantity = polled.duration;
|
|
4249
|
+
usage2.durationSeconds = polled.duration;
|
|
4250
|
+
}
|
|
4187
4251
|
const tokens = polled.usage;
|
|
4188
4252
|
if (tokens?.total_tokens !== void 0 && tokens.completion_tokens !== void 0) {
|
|
4189
4253
|
usage2.inputTokens = tokens.total_tokens - tokens.completion_tokens;
|
|
@@ -5237,7 +5301,7 @@ async function generateOmniVideo(req, ctx, createGenAIClient) {
|
|
|
5237
5301
|
const apiKey = googleKey(ctx);
|
|
5238
5302
|
const modelId = ctx.model.id;
|
|
5239
5303
|
const providerModelId = ctx.model.providerModelId;
|
|
5240
|
-
const duration = req.durationSeconds ??
|
|
5304
|
+
const duration = req.durationSeconds ?? 10;
|
|
5241
5305
|
const images = req.referenceImages ?? [];
|
|
5242
5306
|
const videos = req.referenceVideos ?? [];
|
|
5243
5307
|
const task = req.sourceVideo ? "edit" : req.firstFrame ? "image_to_video" : images.length > 0 || videos.length > 0 ? "reference_to_video" : "text_to_video";
|
|
@@ -7479,10 +7543,13 @@ var describe = (modelId) => createDefaultModelKit().describe(modelId);
|
|
|
7479
7543
|
CatalogModelSchema,
|
|
7480
7544
|
CatalogSchema,
|
|
7481
7545
|
DEFAULT_ADAPTERS,
|
|
7546
|
+
ExposureSchema,
|
|
7482
7547
|
JsonObjectSchema,
|
|
7483
7548
|
JsonValueSchema,
|
|
7484
7549
|
MODELS,
|
|
7485
7550
|
ModelKitError,
|
|
7551
|
+
SURFACES,
|
|
7552
|
+
SurfaceSchema,
|
|
7486
7553
|
aiSdkTextAdapter,
|
|
7487
7554
|
arkAdapter,
|
|
7488
7555
|
aspectRatioToSize,
|
|
@@ -7503,6 +7570,8 @@ var describe = (modelId) => createDefaultModelKit().describe(modelId);
|
|
|
7503
7570
|
googleGenaiAdapter,
|
|
7504
7571
|
googleImageAdapter,
|
|
7505
7572
|
higgsfieldAdapter,
|
|
7573
|
+
isListed,
|
|
7574
|
+
isListedOn,
|
|
7506
7575
|
isModelKitError,
|
|
7507
7576
|
keysFromEnv,
|
|
7508
7577
|
languageModel,
|
|
@@ -7510,6 +7579,7 @@ var describe = (modelId) => createDefaultModelKit().describe(modelId);
|
|
|
7510
7579
|
liveState,
|
|
7511
7580
|
mergeTextProviderOptions,
|
|
7512
7581
|
nearestAspectRatio,
|
|
7582
|
+
normalizeExposure,
|
|
7513
7583
|
openaiImageAdapter,
|
|
7514
7584
|
passthroughTextModel,
|
|
7515
7585
|
pollUntil,
|