@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.js
CHANGED
|
@@ -123,6 +123,27 @@ var Catalog = class _Catalog {
|
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
+
// src/catalog/exposure.ts
|
|
127
|
+
var SURFACES = ["cowork", "space_builder"];
|
|
128
|
+
function normalizeExposure(value) {
|
|
129
|
+
if (value === "catalog") return ["cowork", "space_builder"];
|
|
130
|
+
if (value === "internal") return [];
|
|
131
|
+
if (Array.isArray(value)) {
|
|
132
|
+
if (value.every((entry) => SURFACES.includes(entry))) {
|
|
133
|
+
const present = new Set(value);
|
|
134
|
+
return SURFACES.filter((surface) => present.has(surface));
|
|
135
|
+
}
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
138
|
+
return value;
|
|
139
|
+
}
|
|
140
|
+
function isListedOn(row, surface) {
|
|
141
|
+
return row.lifecycle === "active" && row.exposure.includes(surface);
|
|
142
|
+
}
|
|
143
|
+
function isListed(row) {
|
|
144
|
+
return row.lifecycle === "active" && row.exposure.length > 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
126
147
|
// src/catalog/image.ts
|
|
127
148
|
var IMAGE_USAGE = { unit: "images" };
|
|
128
149
|
var GEMINI_RATIOS = [
|
|
@@ -173,7 +194,7 @@ var IMAGE_MODELS = [
|
|
|
173
194
|
description: "Create stunning, production-quality visuals with exceptional realism, detail, and typography. Best for campaigns, e-commerce, product photography, and hero creatives.",
|
|
174
195
|
logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
|
|
175
196
|
},
|
|
176
|
-
"
|
|
197
|
+
["cowork", "space_builder"],
|
|
177
198
|
{ images: 14 }
|
|
178
199
|
),
|
|
179
200
|
geminiImage(
|
|
@@ -187,7 +208,7 @@ var IMAGE_MODELS = [
|
|
|
187
208
|
description: "Generate high-quality images at speed. Perfect for brainstorming, moodboards, concept testing, creative exploration, and large batch workflows.",
|
|
188
209
|
logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
|
|
189
210
|
},
|
|
190
|
-
"
|
|
211
|
+
["cowork", "space_builder"],
|
|
191
212
|
{ images: 14 }
|
|
192
213
|
),
|
|
193
214
|
geminiImage(
|
|
@@ -200,7 +221,7 @@ var IMAGE_MODELS = [
|
|
|
200
221
|
description: "The fastest and most affordable image model. Ideal for rapid drafts, bulk exploration, and iterative concept testing at 1K resolution.",
|
|
201
222
|
logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
|
|
202
223
|
},
|
|
203
|
-
"
|
|
224
|
+
["cowork", "space_builder"],
|
|
204
225
|
{ images: 14 }
|
|
205
226
|
),
|
|
206
227
|
// trigger-workflows validates 1K only; pricing seeds 2K/4K rows so allow all three.
|
|
@@ -213,7 +234,7 @@ var IMAGE_MODELS = [
|
|
|
213
234
|
provider: "google",
|
|
214
235
|
description: "Nano Banana (legacy Gemini 2.5 Flash Image) native image generation and editing model for high-volume, low-latency creative workflows."
|
|
215
236
|
},
|
|
216
|
-
|
|
237
|
+
[]
|
|
217
238
|
),
|
|
218
239
|
{
|
|
219
240
|
// Cowork "auto" lets OpenAI pick the size; the canonical equivalent is adaptive.
|
|
@@ -224,7 +245,7 @@ var IMAGE_MODELS = [
|
|
|
224
245
|
adapter: "openai-image",
|
|
225
246
|
providerModelId: "gpt-image-2",
|
|
226
247
|
lifecycle: "active",
|
|
227
|
-
exposure: "
|
|
248
|
+
exposure: ["cowork", "space_builder"],
|
|
228
249
|
constraints: {
|
|
229
250
|
exactSizes: {
|
|
230
251
|
"1:1": "1024x1024",
|
|
@@ -259,7 +280,7 @@ var IMAGE_MODELS = [
|
|
|
259
280
|
adapter: "openai-image",
|
|
260
281
|
providerModelId: "gpt-image-2.5-sunburst",
|
|
261
282
|
lifecycle: "active",
|
|
262
|
-
exposure: "
|
|
283
|
+
exposure: ["cowork", "space_builder"],
|
|
263
284
|
constraints: {
|
|
264
285
|
exactSizes: {
|
|
265
286
|
"1:1": "1024x1024",
|
|
@@ -293,7 +314,7 @@ var IMAGE_MODELS = [
|
|
|
293
314
|
adapter: "openai-image",
|
|
294
315
|
providerModelId: "gpt-image-2.5-flare",
|
|
295
316
|
lifecycle: "active",
|
|
296
|
-
exposure: "
|
|
317
|
+
exposure: ["cowork", "space_builder"],
|
|
297
318
|
constraints: {
|
|
298
319
|
exactSizes: {
|
|
299
320
|
"1:1": "1024x1024",
|
|
@@ -327,7 +348,7 @@ var IMAGE_MODELS = [
|
|
|
327
348
|
adapter: "fal",
|
|
328
349
|
providerModelId: "muse-image-1.0",
|
|
329
350
|
lifecycle: "active",
|
|
330
|
-
exposure: "
|
|
351
|
+
exposure: ["cowork", "space_builder"],
|
|
331
352
|
constraints: {
|
|
332
353
|
aspectRatios: [
|
|
333
354
|
"21:9",
|
|
@@ -362,7 +383,7 @@ var IMAGE_MODELS = [
|
|
|
362
383
|
adapter: "ark",
|
|
363
384
|
providerModelId: "dola-seedream-5-0-pro-260628",
|
|
364
385
|
lifecycle: "active",
|
|
365
|
-
exposure: "
|
|
386
|
+
exposure: ["cowork", "space_builder"],
|
|
366
387
|
constraints: {
|
|
367
388
|
aspectRatios: ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "21:9", "4:5", "5:4"],
|
|
368
389
|
sizes: ["1K", "2K"],
|
|
@@ -388,7 +409,7 @@ var IMAGE_MODELS = [
|
|
|
388
409
|
adapter: "ark",
|
|
389
410
|
providerModelId: "seedream-4-5-251128",
|
|
390
411
|
lifecycle: "active",
|
|
391
|
-
exposure:
|
|
412
|
+
exposure: [],
|
|
392
413
|
constraints: {
|
|
393
414
|
// 97:30 has no Ark size spelling; the A+ flow pads inputs to 97:30 and
|
|
394
415
|
// omits the ratio instead. Advertise only sizes the adapter can send.
|
|
@@ -425,7 +446,7 @@ var IMAGE_MODELS = [
|
|
|
425
446
|
adapter: "prodia",
|
|
426
447
|
providerModelId: "flux-2-pro",
|
|
427
448
|
lifecycle: "active",
|
|
428
|
-
exposure: "
|
|
449
|
+
exposure: ["cowork", "space_builder"],
|
|
429
450
|
constraints: {
|
|
430
451
|
aspectRatios: ["1:1", "2:3", "3:2", "16:9", "9:16", "4:3", "3:4", "4:5", "5:4", "21:9"],
|
|
431
452
|
sizes: ["1K"],
|
|
@@ -452,7 +473,7 @@ var IMAGE_MODELS = [
|
|
|
452
473
|
adapter: "prodia",
|
|
453
474
|
providerModelId: "inference.gemini-3-pro.img2img.v1",
|
|
454
475
|
lifecycle: "active",
|
|
455
|
-
exposure:
|
|
476
|
+
exposure: [],
|
|
456
477
|
constraints: {
|
|
457
478
|
aspectRatios: ["1:1", "2:3", "3:2", "4:3", "3:4", "4:5", "5:4", "9:16", "16:9", "21:9"],
|
|
458
479
|
sizes: ["1K", "2K", "4K"],
|
|
@@ -477,7 +498,7 @@ var IMAGE_MODELS = [
|
|
|
477
498
|
adapter: "prodia",
|
|
478
499
|
providerModelId: "inference.nano-banana.img2img.v2",
|
|
479
500
|
lifecycle: "active",
|
|
480
|
-
exposure:
|
|
501
|
+
exposure: [],
|
|
481
502
|
constraints: {
|
|
482
503
|
aspectRatios: ["1:1", "2:3", "3:4", "4:3", "9:16", "16:9", "21:9"],
|
|
483
504
|
sizes: ["1K"],
|
|
@@ -503,7 +524,7 @@ var IMAGE_MODELS = [
|
|
|
503
524
|
adapter: "replicate",
|
|
504
525
|
providerModelId: "wan-video/wan-2.7-image-pro",
|
|
505
526
|
lifecycle: "active",
|
|
506
|
-
exposure:
|
|
527
|
+
exposure: [],
|
|
507
528
|
constraints: {
|
|
508
529
|
aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4"],
|
|
509
530
|
sizes: ["1K", "2K", "4K"],
|
|
@@ -529,7 +550,7 @@ var IMAGE_MODELS = [
|
|
|
529
550
|
adapter: "replicate",
|
|
530
551
|
providerModelId: "qwen/qwen-image-2-pro",
|
|
531
552
|
lifecycle: "active",
|
|
532
|
-
exposure:
|
|
553
|
+
exposure: [],
|
|
533
554
|
constraints: {
|
|
534
555
|
aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"],
|
|
535
556
|
sizes: [],
|
|
@@ -555,7 +576,7 @@ var IMAGE_MODELS = [
|
|
|
555
576
|
adapter: "replicate",
|
|
556
577
|
providerModelId: "qwen-edit-apps/qwen-image-edit-plus-lora-skin",
|
|
557
578
|
lifecycle: "active",
|
|
558
|
-
exposure:
|
|
579
|
+
exposure: [],
|
|
559
580
|
constraints: {
|
|
560
581
|
aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4"],
|
|
561
582
|
sizes: [],
|
|
@@ -584,7 +605,7 @@ var OTHER_MODELS = [
|
|
|
584
605
|
adapter: "google-genai",
|
|
585
606
|
providerModelId: "lyria-3-clip-preview",
|
|
586
607
|
lifecycle: "active",
|
|
587
|
-
exposure: "
|
|
608
|
+
exposure: ["cowork", "space_builder"],
|
|
588
609
|
constraints: {
|
|
589
610
|
durations: [30],
|
|
590
611
|
references: { images: 10 },
|
|
@@ -608,7 +629,7 @@ var OTHER_MODELS = [
|
|
|
608
629
|
adapter: "google-genai",
|
|
609
630
|
providerModelId: "lyria-3-pro-preview",
|
|
610
631
|
lifecycle: "active",
|
|
611
|
-
exposure: "
|
|
632
|
+
exposure: ["cowork", "space_builder"],
|
|
612
633
|
constraints: {
|
|
613
634
|
references: { images: 10 },
|
|
614
635
|
supports: []
|
|
@@ -631,7 +652,7 @@ var OTHER_MODELS = [
|
|
|
631
652
|
adapter: "replicate",
|
|
632
653
|
providerModelId: "google/lyria-2",
|
|
633
654
|
lifecycle: "active",
|
|
634
|
-
exposure:
|
|
655
|
+
exposure: [],
|
|
635
656
|
constraints: {
|
|
636
657
|
durations: [30],
|
|
637
658
|
supports: ["seed", "negativePrompt"]
|
|
@@ -653,7 +674,7 @@ var OTHER_MODELS = [
|
|
|
653
674
|
adapter: "replicate",
|
|
654
675
|
providerModelId: "zsxkib/mmaudio:62871fb59889b2d7c13777f08deb3b36bdff88f7e1d53a50ad7694548a41b484",
|
|
655
676
|
lifecycle: "active",
|
|
656
|
-
exposure: "
|
|
677
|
+
exposure: ["cowork", "space_builder"],
|
|
657
678
|
constraints: {
|
|
658
679
|
durations: { min: 1, max: 30 },
|
|
659
680
|
requires: ["sourceVideo"],
|
|
@@ -676,7 +697,7 @@ var OTHER_MODELS = [
|
|
|
676
697
|
adapter: "replicate",
|
|
677
698
|
providerModelId: "elevenlabs/music",
|
|
678
699
|
lifecycle: "active",
|
|
679
|
-
exposure:
|
|
700
|
+
exposure: [],
|
|
680
701
|
constraints: {
|
|
681
702
|
durations: { min: 5, max: 300 },
|
|
682
703
|
supports: ["instrumental"]
|
|
@@ -699,7 +720,7 @@ var OTHER_MODELS = [
|
|
|
699
720
|
adapter: "replicate",
|
|
700
721
|
providerModelId: "topazlabs/image-upscale",
|
|
701
722
|
lifecycle: "active",
|
|
702
|
-
exposure: "
|
|
723
|
+
exposure: ["cowork", "space_builder"],
|
|
703
724
|
constraints: {
|
|
704
725
|
references: { images: 1 },
|
|
705
726
|
requires: ["references"],
|
|
@@ -722,7 +743,7 @@ var OTHER_MODELS = [
|
|
|
722
743
|
adapter: "prodia",
|
|
723
744
|
providerModelId: "inference.remove-background.v1",
|
|
724
745
|
lifecycle: "active",
|
|
725
|
-
exposure: "
|
|
746
|
+
exposure: ["cowork", "space_builder"],
|
|
726
747
|
constraints: {
|
|
727
748
|
references: { images: 1 },
|
|
728
749
|
requires: ["references"],
|
|
@@ -761,7 +782,7 @@ function text(id, label, providerModelId, extra) {
|
|
|
761
782
|
adapter: "ai-sdk-text",
|
|
762
783
|
providerModelId,
|
|
763
784
|
lifecycle: "active",
|
|
764
|
-
exposure:
|
|
785
|
+
exposure: [],
|
|
765
786
|
constraints: { supports: [] },
|
|
766
787
|
defaults: {},
|
|
767
788
|
usage: { ...TEXT_USAGE },
|
|
@@ -780,7 +801,7 @@ var OPENAI_REASONING = { openai: { reasoningEffort: "medium", reasoningSummary:
|
|
|
780
801
|
var DEEPSEEK_THINKING = { deepseek: { thinking: { type: "enabled" } } };
|
|
781
802
|
var TEXT_MODELS = [
|
|
782
803
|
text("gpt-4o", "GPT-4o", "gpt-4o", {
|
|
783
|
-
exposure:
|
|
804
|
+
exposure: [],
|
|
784
805
|
display: {
|
|
785
806
|
provider: "openai",
|
|
786
807
|
costTier: 2,
|
|
@@ -789,7 +810,7 @@ var TEXT_MODELS = [
|
|
|
789
810
|
capabilities: { vision: true, contextWindow: 128e3 }
|
|
790
811
|
}),
|
|
791
812
|
text("gpt-4o-mini", "GPT-4o mini", "gpt-4o-mini", {
|
|
792
|
-
exposure:
|
|
813
|
+
exposure: [],
|
|
793
814
|
display: {
|
|
794
815
|
provider: "openai",
|
|
795
816
|
costTier: 1,
|
|
@@ -798,7 +819,7 @@ var TEXT_MODELS = [
|
|
|
798
819
|
capabilities: { vision: true, contextWindow: 128e3 }
|
|
799
820
|
}),
|
|
800
821
|
text("gpt-5.1", "GPT-5.1", "gpt-5.1", {
|
|
801
|
-
exposure: "
|
|
822
|
+
exposure: ["cowork", "space_builder"],
|
|
802
823
|
display: {
|
|
803
824
|
provider: "openai",
|
|
804
825
|
costTier: 3,
|
|
@@ -807,7 +828,7 @@ var TEXT_MODELS = [
|
|
|
807
828
|
capabilities: { vision: true, contextWindow: 4e5 }
|
|
808
829
|
}),
|
|
809
830
|
text("gpt-5.2", "GPT-5.2", "gpt-5.2", {
|
|
810
|
-
exposure: "
|
|
831
|
+
exposure: ["cowork", "space_builder"],
|
|
811
832
|
display: {
|
|
812
833
|
provider: "openai",
|
|
813
834
|
costTier: 3,
|
|
@@ -817,7 +838,7 @@ var TEXT_MODELS = [
|
|
|
817
838
|
}),
|
|
818
839
|
// 1.05M-token context: https://platform.openai.com/docs/models/gpt-5.4
|
|
819
840
|
text("gpt-5.4", "GPT-5.4", "gpt-5.4", {
|
|
820
|
-
exposure:
|
|
841
|
+
exposure: [],
|
|
821
842
|
display: {
|
|
822
843
|
provider: "openai",
|
|
823
844
|
costTier: 3,
|
|
@@ -830,7 +851,7 @@ var TEXT_MODELS = [
|
|
|
830
851
|
}),
|
|
831
852
|
// OpenAI never shipped gpt-5.1-mini or gpt-5.2-mini; callers that still send them get 5.4 mini.
|
|
832
853
|
text("gpt-5.4-mini", "GPT-5.4 mini", "gpt-5.4-mini", {
|
|
833
|
-
exposure: "
|
|
854
|
+
exposure: ["cowork", "space_builder"],
|
|
834
855
|
aliases: ["gpt-5.1-mini", "gpt-5.2-mini"],
|
|
835
856
|
display: {
|
|
836
857
|
provider: "openai",
|
|
@@ -840,7 +861,7 @@ var TEXT_MODELS = [
|
|
|
840
861
|
capabilities: { vision: true, contextWindow: 4e5 }
|
|
841
862
|
}),
|
|
842
863
|
text("gpt-5.5", "GPT-5.5", "gpt-5.5", {
|
|
843
|
-
exposure: "
|
|
864
|
+
exposure: ["cowork", "space_builder"],
|
|
844
865
|
display: {
|
|
845
866
|
provider: "openai",
|
|
846
867
|
costTier: 3,
|
|
@@ -852,7 +873,7 @@ var TEXT_MODELS = [
|
|
|
852
873
|
}
|
|
853
874
|
}),
|
|
854
875
|
text("gpt-5.6-luna", "GPT-5.6 Luna", "gpt-5.6-luna", {
|
|
855
|
-
exposure: "
|
|
876
|
+
exposure: ["cowork", "space_builder"],
|
|
856
877
|
display: {
|
|
857
878
|
chat: { providerOptions: OPENAI_REASONING },
|
|
858
879
|
provider: "openai",
|
|
@@ -866,7 +887,7 @@ var TEXT_MODELS = [
|
|
|
866
887
|
}
|
|
867
888
|
}),
|
|
868
889
|
text("gpt-5.6-terra", "GPT-5.6 Terra", "gpt-5.6-terra", {
|
|
869
|
-
exposure: "
|
|
890
|
+
exposure: ["cowork", "space_builder"],
|
|
870
891
|
display: {
|
|
871
892
|
chat: { providerOptions: OPENAI_REASONING },
|
|
872
893
|
provider: "openai",
|
|
@@ -880,7 +901,7 @@ var TEXT_MODELS = [
|
|
|
880
901
|
}
|
|
881
902
|
}),
|
|
882
903
|
text("gpt-5.6-sol", "GPT-5.6 Sol", "gpt-5.6-sol", {
|
|
883
|
-
exposure: "
|
|
904
|
+
exposure: ["cowork", "space_builder"],
|
|
884
905
|
display: {
|
|
885
906
|
chat: { providerOptions: OPENAI_REASONING },
|
|
886
907
|
provider: "openai",
|
|
@@ -895,7 +916,7 @@ var TEXT_MODELS = [
|
|
|
895
916
|
}),
|
|
896
917
|
// Library key "claude-sonnet-4.5" maps to the SDK id "claude-sonnet-4-5".
|
|
897
918
|
text("claude-sonnet-4-5", "Claude Sonnet 4.5", "claude-sonnet-4-5", {
|
|
898
|
-
exposure:
|
|
919
|
+
exposure: [],
|
|
899
920
|
aliases: ["claude-sonnet-4.5", "claude-sonnet-4-5-20250929"],
|
|
900
921
|
display: {
|
|
901
922
|
provider: "anthropic",
|
|
@@ -906,7 +927,7 @@ var TEXT_MODELS = [
|
|
|
906
927
|
}),
|
|
907
928
|
// Anthropic retired the dated 4.0 ids; callers that still send them get 4.6.
|
|
908
929
|
text("claude-sonnet-4-6", "Claude Sonnet 4.6", "claude-sonnet-4-6", {
|
|
909
|
-
exposure: "
|
|
930
|
+
exposure: ["cowork", "space_builder"],
|
|
910
931
|
aliases: [
|
|
911
932
|
"claude-sonnet-4.6",
|
|
912
933
|
"claude-sonnet-4",
|
|
@@ -926,7 +947,7 @@ var TEXT_MODELS = [
|
|
|
926
947
|
}
|
|
927
948
|
}),
|
|
928
949
|
text("claude-sonnet-5", "Claude Sonnet 5", "claude-sonnet-5", {
|
|
929
|
-
exposure: "
|
|
950
|
+
exposure: ["cowork", "space_builder"],
|
|
930
951
|
display: {
|
|
931
952
|
chat: { providerOptions: ANTHROPIC_ADAPTIVE },
|
|
932
953
|
provider: "anthropic",
|
|
@@ -940,7 +961,7 @@ var TEXT_MODELS = [
|
|
|
940
961
|
}
|
|
941
962
|
}),
|
|
942
963
|
text("claude-opus-4-8", "Claude Opus 4.8", "claude-opus-4-8", {
|
|
943
|
-
exposure: "
|
|
964
|
+
exposure: ["cowork", "space_builder"],
|
|
944
965
|
aliases: ["claude-opus-4.8", "claude-opus-4", "claude-opus-4.0", "claude-opus-4-20250514"],
|
|
945
966
|
display: {
|
|
946
967
|
chat: { providerOptions: ANTHROPIC_ADAPTIVE },
|
|
@@ -955,7 +976,7 @@ var TEXT_MODELS = [
|
|
|
955
976
|
}
|
|
956
977
|
}),
|
|
957
978
|
text("claude-haiku-4-5", "Claude Haiku 4.5", "claude-haiku-4-5", {
|
|
958
|
-
exposure: "
|
|
979
|
+
exposure: ["cowork", "space_builder"],
|
|
959
980
|
aliases: ["claude-haiku-4.5", "claude-haiku-4-5-20251001", "claude-haiku-4"],
|
|
960
981
|
display: {
|
|
961
982
|
chat: { providerOptions: ANTHROPIC_THINKING },
|
|
@@ -970,7 +991,7 @@ var TEXT_MODELS = [
|
|
|
970
991
|
}
|
|
971
992
|
}),
|
|
972
993
|
text("claude-opus-5", "Claude Opus 5", "claude-opus-5", {
|
|
973
|
-
exposure:
|
|
994
|
+
exposure: [],
|
|
974
995
|
aliases: ["claude-opus-5.0"],
|
|
975
996
|
display: {
|
|
976
997
|
provider: "anthropic",
|
|
@@ -983,7 +1004,7 @@ var TEXT_MODELS = [
|
|
|
983
1004
|
}
|
|
984
1005
|
}),
|
|
985
1006
|
text("claude-fable-5", "Claude Fable 5", "claude-fable-5", {
|
|
986
|
-
exposure:
|
|
1007
|
+
exposure: [],
|
|
987
1008
|
display: {
|
|
988
1009
|
provider: "anthropic",
|
|
989
1010
|
costTier: 3,
|
|
@@ -995,7 +1016,7 @@ var TEXT_MODELS = [
|
|
|
995
1016
|
}
|
|
996
1017
|
}),
|
|
997
1018
|
text("gemini-2.5-flash", "Gemini 2.5 Flash", "gemini-2.5-flash", {
|
|
998
|
-
exposure:
|
|
1019
|
+
exposure: [],
|
|
999
1020
|
display: {
|
|
1000
1021
|
provider: "google",
|
|
1001
1022
|
costTier: 1,
|
|
@@ -1007,7 +1028,7 @@ var TEXT_MODELS = [
|
|
|
1007
1028
|
}
|
|
1008
1029
|
}),
|
|
1009
1030
|
text("gemini-2.5-pro", "Gemini 2.5 Pro", "gemini-2.5-pro", {
|
|
1010
|
-
exposure:
|
|
1031
|
+
exposure: [],
|
|
1011
1032
|
display: {
|
|
1012
1033
|
provider: "google",
|
|
1013
1034
|
costTier: 2,
|
|
@@ -1019,7 +1040,7 @@ var TEXT_MODELS = [
|
|
|
1019
1040
|
}
|
|
1020
1041
|
}),
|
|
1021
1042
|
text("gemini-3.1-pro-preview", "Gemini 3.1 Pro (preview)", "gemini-3.1-pro-preview", {
|
|
1022
|
-
exposure: "
|
|
1043
|
+
exposure: ["cowork", "space_builder"],
|
|
1023
1044
|
display: {
|
|
1024
1045
|
provider: "google",
|
|
1025
1046
|
costTier: 2,
|
|
@@ -1031,7 +1052,7 @@ var TEXT_MODELS = [
|
|
|
1031
1052
|
}
|
|
1032
1053
|
}),
|
|
1033
1054
|
text("gemini-3.5-flash", "Gemini 3.5 Flash", "gemini-3.5-flash", {
|
|
1034
|
-
exposure: "
|
|
1055
|
+
exposure: ["cowork", "space_builder"],
|
|
1035
1056
|
display: {
|
|
1036
1057
|
provider: "google",
|
|
1037
1058
|
costTier: 1,
|
|
@@ -1043,7 +1064,7 @@ var TEXT_MODELS = [
|
|
|
1043
1064
|
}
|
|
1044
1065
|
}),
|
|
1045
1066
|
text("gemini-3.6-flash", "Gemini 3.6 Flash", "gemini-3.6-flash", {
|
|
1046
|
-
exposure: "
|
|
1067
|
+
exposure: ["cowork", "space_builder"],
|
|
1047
1068
|
display: {
|
|
1048
1069
|
provider: "google",
|
|
1049
1070
|
costTier: 1,
|
|
@@ -1055,7 +1076,7 @@ var TEXT_MODELS = [
|
|
|
1055
1076
|
}
|
|
1056
1077
|
}),
|
|
1057
1078
|
text("gemini-3.7-flash", "Gemini 3.7 Flash", "gemini-3.7-flash", {
|
|
1058
|
-
exposure: "
|
|
1079
|
+
exposure: ["cowork", "space_builder"],
|
|
1059
1080
|
display: {
|
|
1060
1081
|
provider: "google",
|
|
1061
1082
|
costTier: 1,
|
|
@@ -1068,7 +1089,7 @@ var TEXT_MODELS = [
|
|
|
1068
1089
|
}
|
|
1069
1090
|
}),
|
|
1070
1091
|
text("gemini-3.8-flash", "Gemini 3.8 Flash", "gemini-3.8-flash", {
|
|
1071
|
-
exposure:
|
|
1092
|
+
exposure: [],
|
|
1072
1093
|
display: {
|
|
1073
1094
|
provider: "google",
|
|
1074
1095
|
costTier: 1,
|
|
@@ -1081,12 +1102,12 @@ var TEXT_MODELS = [
|
|
|
1081
1102
|
}),
|
|
1082
1103
|
// Renamed to gemini-3.6-flash in vibe-shared model-migration.ts.
|
|
1083
1104
|
text("gemini-3-flash-preview", "Gemini 3 Flash (preview)", "gemini-3-flash-preview", {
|
|
1084
|
-
exposure:
|
|
1105
|
+
exposure: [],
|
|
1085
1106
|
lifecycle: "deprecated",
|
|
1086
1107
|
replacedBy: "gemini-3.6-flash"
|
|
1087
1108
|
}),
|
|
1088
1109
|
text("gemini-3.1-flash-lite", "Gemini 3.1 Flash Lite", "gemini-3.1-flash-lite", {
|
|
1089
|
-
exposure:
|
|
1110
|
+
exposure: [],
|
|
1090
1111
|
display: {
|
|
1091
1112
|
provider: "google",
|
|
1092
1113
|
costTier: 1,
|
|
@@ -1098,7 +1119,7 @@ var TEXT_MODELS = [
|
|
|
1098
1119
|
}
|
|
1099
1120
|
}),
|
|
1100
1121
|
text("sonar", "Sonar", "sonar", {
|
|
1101
|
-
exposure:
|
|
1122
|
+
exposure: [],
|
|
1102
1123
|
display: {
|
|
1103
1124
|
provider: "perplexity",
|
|
1104
1125
|
costTier: 1,
|
|
@@ -1110,7 +1131,7 @@ var TEXT_MODELS = [
|
|
|
1110
1131
|
}
|
|
1111
1132
|
}),
|
|
1112
1133
|
text("sonar-pro", "Sonar Pro", "sonar-pro", {
|
|
1113
|
-
exposure:
|
|
1134
|
+
exposure: [],
|
|
1114
1135
|
display: {
|
|
1115
1136
|
provider: "perplexity",
|
|
1116
1137
|
costTier: 2,
|
|
@@ -1122,7 +1143,7 @@ var TEXT_MODELS = [
|
|
|
1122
1143
|
}
|
|
1123
1144
|
}),
|
|
1124
1145
|
text("sonar-reasoning-pro", "Sonar Reasoning Pro", "sonar-reasoning-pro", {
|
|
1125
|
-
exposure:
|
|
1146
|
+
exposure: [],
|
|
1126
1147
|
display: {
|
|
1127
1148
|
provider: "perplexity",
|
|
1128
1149
|
costTier: 2,
|
|
@@ -1138,7 +1159,7 @@ var TEXT_MODELS = [
|
|
|
1138
1159
|
// stays an alias so stored selections keep resolving.
|
|
1139
1160
|
text("deepseek-flash", "DeepSeek V4.1 Flash", "deepseek-flash", {
|
|
1140
1161
|
aliases: ["deepseek-v4-flash"],
|
|
1141
|
-
exposure: "
|
|
1162
|
+
exposure: ["cowork", "space_builder"],
|
|
1142
1163
|
display: {
|
|
1143
1164
|
chat: { providerOptions: DEEPSEEK_THINKING },
|
|
1144
1165
|
provider: "deepseek",
|
|
@@ -1153,7 +1174,7 @@ var TEXT_MODELS = [
|
|
|
1153
1174
|
}
|
|
1154
1175
|
}),
|
|
1155
1176
|
text("deepseek-v4-pro", "DeepSeek V4 Pro", "deepseek-v4-pro", {
|
|
1156
|
-
exposure: "
|
|
1177
|
+
exposure: ["cowork", "space_builder"],
|
|
1157
1178
|
display: {
|
|
1158
1179
|
chat: { providerOptions: DEEPSEEK_THINKING },
|
|
1159
1180
|
provider: "deepseek",
|
|
@@ -1168,7 +1189,7 @@ var TEXT_MODELS = [
|
|
|
1168
1189
|
}),
|
|
1169
1190
|
// 1M-token context: https://docs.x.ai/docs/models/grok-4.3
|
|
1170
1191
|
text("grok-4.3", "Grok 4.3", "grok-4.3", {
|
|
1171
|
-
exposure: "
|
|
1192
|
+
exposure: ["cowork", "space_builder"],
|
|
1172
1193
|
display: {
|
|
1173
1194
|
provider: "xai",
|
|
1174
1195
|
costTier: 2,
|
|
@@ -1183,7 +1204,7 @@ var TEXT_MODELS = [
|
|
|
1183
1204
|
text("kimi-k2.5", "Kimi K2.5", "kimi-k2.5", {
|
|
1184
1205
|
lifecycle: "deprecated",
|
|
1185
1206
|
replacedBy: "kimi-k3",
|
|
1186
|
-
exposure:
|
|
1207
|
+
exposure: [],
|
|
1187
1208
|
display: {
|
|
1188
1209
|
chat: { temperature: 1 },
|
|
1189
1210
|
provider: "moonshot",
|
|
@@ -1193,7 +1214,7 @@ var TEXT_MODELS = [
|
|
|
1193
1214
|
capabilities: {}
|
|
1194
1215
|
}),
|
|
1195
1216
|
text("kimi-k3", "Kimi K3", "kimi-k3", {
|
|
1196
|
-
exposure: "
|
|
1217
|
+
exposure: ["cowork", "space_builder"],
|
|
1197
1218
|
display: {
|
|
1198
1219
|
chat: { temperature: 1 },
|
|
1199
1220
|
provider: "moonshot",
|
|
@@ -1209,7 +1230,7 @@ var TEXT_MODELS = [
|
|
|
1209
1230
|
// Cowork calls the provider "MiniMax-M3"; the pricing key is lowercase.
|
|
1210
1231
|
// 1M-token context: https://platform.minimax.io/docs/api-reference/text-openai-api
|
|
1211
1232
|
text("minimax-m3", "MiniMax M3", "MiniMax-M3", {
|
|
1212
|
-
exposure: "
|
|
1233
|
+
exposure: ["cowork", "space_builder"],
|
|
1213
1234
|
aliases: ["MiniMax-M3"],
|
|
1214
1235
|
display: {
|
|
1215
1236
|
provider: "minimax",
|
|
@@ -1246,7 +1267,7 @@ var VIDEO_MODELS = [
|
|
|
1246
1267
|
adapter: "google-genai",
|
|
1247
1268
|
providerModelId: "veo-3.1-generate-preview",
|
|
1248
1269
|
lifecycle: "active",
|
|
1249
|
-
exposure: "
|
|
1270
|
+
exposure: ["cowork", "space_builder"],
|
|
1250
1271
|
constraints: {
|
|
1251
1272
|
aspectRatios: [...OMNI_RATIOS],
|
|
1252
1273
|
resolutions: ["720p", "1080p", "4k"],
|
|
@@ -1276,7 +1297,7 @@ var VIDEO_MODELS = [
|
|
|
1276
1297
|
adapter: "google-genai",
|
|
1277
1298
|
providerModelId: "veo-3.1-fast-generate-preview",
|
|
1278
1299
|
lifecycle: "active",
|
|
1279
|
-
exposure:
|
|
1300
|
+
exposure: [],
|
|
1280
1301
|
constraints: {
|
|
1281
1302
|
aspectRatios: [...OMNI_RATIOS],
|
|
1282
1303
|
resolutions: ["720p", "1080p", "4k"],
|
|
@@ -1305,7 +1326,7 @@ var VIDEO_MODELS = [
|
|
|
1305
1326
|
adapter: "google-genai",
|
|
1306
1327
|
providerModelId: "veo-3.1-lite-generate-preview",
|
|
1307
1328
|
lifecycle: "active",
|
|
1308
|
-
exposure:
|
|
1329
|
+
exposure: [],
|
|
1309
1330
|
constraints: {
|
|
1310
1331
|
aspectRatios: [...OMNI_RATIOS],
|
|
1311
1332
|
resolutions: ["720p", "1080p"],
|
|
@@ -1335,7 +1356,7 @@ var VIDEO_MODELS = [
|
|
|
1335
1356
|
adapter: "google-genai",
|
|
1336
1357
|
providerModelId: "gemini-omni-flash-preview",
|
|
1337
1358
|
lifecycle: "active",
|
|
1338
|
-
exposure: "
|
|
1359
|
+
exposure: ["cowork", "space_builder"],
|
|
1339
1360
|
constraints: {
|
|
1340
1361
|
// 1.0 rejects `resolution`; it renders 720p. No defaults: the adapter
|
|
1341
1362
|
// sends ratio and duration only when the caller set them, so a
|
|
@@ -1363,7 +1384,7 @@ var VIDEO_MODELS = [
|
|
|
1363
1384
|
adapter: "google-genai",
|
|
1364
1385
|
providerModelId: "gemini-omni-1.1-flash",
|
|
1365
1386
|
lifecycle: "active",
|
|
1366
|
-
exposure: "
|
|
1387
|
+
exposure: ["cowork", "space_builder"],
|
|
1367
1388
|
constraints: {
|
|
1368
1389
|
aspectRatios: [...OMNI_RATIOS],
|
|
1369
1390
|
resolutions: ["360p", "720p", "1080p", "4k"],
|
|
@@ -1390,7 +1411,7 @@ var VIDEO_MODELS = [
|
|
|
1390
1411
|
adapter: "ark",
|
|
1391
1412
|
providerModelId: "dreamina-seedance-2-0-260128",
|
|
1392
1413
|
lifecycle: "active",
|
|
1393
|
-
exposure: "
|
|
1414
|
+
exposure: ["cowork", "space_builder"],
|
|
1394
1415
|
constraints: {
|
|
1395
1416
|
aspectRatios: [...SEEDANCE_RATIOS],
|
|
1396
1417
|
resolutions: ["480p", "720p", "1080p", "4k"],
|
|
@@ -1423,7 +1444,7 @@ var VIDEO_MODELS = [
|
|
|
1423
1444
|
adapter: "ark",
|
|
1424
1445
|
providerModelId: "dreamina-seedance-2-0-fast-260128",
|
|
1425
1446
|
lifecycle: "active",
|
|
1426
|
-
exposure: "
|
|
1447
|
+
exposure: ["cowork", "space_builder"],
|
|
1427
1448
|
constraints: {
|
|
1428
1449
|
aspectRatios: [...SEEDANCE_RATIOS],
|
|
1429
1450
|
resolutions: ["480p", "720p"],
|
|
@@ -1449,6 +1470,7 @@ var VIDEO_MODELS = [
|
|
|
1449
1470
|
},
|
|
1450
1471
|
{
|
|
1451
1472
|
// generateAudio defaults to false here (trigger-workflows); Space Builder defaults it to true.
|
|
1473
|
+
// omni_reference_task_type edit/extend: adaptive ratio, edit sends duration -1.
|
|
1452
1474
|
id: "seedance-2.5",
|
|
1453
1475
|
aliases: ["seedance-2-5", "dreamina-seedance-2-5-260628"],
|
|
1454
1476
|
label: "Seedance 2.5",
|
|
@@ -1456,14 +1478,14 @@ var VIDEO_MODELS = [
|
|
|
1456
1478
|
adapter: "ark",
|
|
1457
1479
|
providerModelId: "dreamina-seedance-2-5-260628",
|
|
1458
1480
|
lifecycle: "active",
|
|
1459
|
-
exposure: "
|
|
1481
|
+
exposure: ["cowork", "space_builder"],
|
|
1460
1482
|
constraints: {
|
|
1461
1483
|
aspectRatios: [...SEEDANCE_RATIOS],
|
|
1462
1484
|
resolutions: ["480p", "720p", "1080p"],
|
|
1463
1485
|
durations: { min: 4, max: 30 },
|
|
1464
1486
|
references: { images: 30, videos: 10, audios: 10 },
|
|
1465
1487
|
ratioIgnoredWith: ["firstFrame", "sourceVideo"],
|
|
1466
|
-
supports: ["generateAudio", "seed", "lastFrame", "watermark"]
|
|
1488
|
+
supports: ["generateAudio", "seed", "lastFrame", "watermark", "taskType"]
|
|
1467
1489
|
},
|
|
1468
1490
|
defaults: {
|
|
1469
1491
|
durationSeconds: 5,
|
|
@@ -1489,7 +1511,7 @@ var VIDEO_MODELS = [
|
|
|
1489
1511
|
adapter: "xai-video",
|
|
1490
1512
|
providerModelId: "grok-imagine-video",
|
|
1491
1513
|
lifecycle: "active",
|
|
1492
|
-
exposure: "
|
|
1514
|
+
exposure: ["cowork", "space_builder"],
|
|
1493
1515
|
constraints: {
|
|
1494
1516
|
aspectRatios: [...GROK_RATIOS],
|
|
1495
1517
|
resolutions: ["480p", "720p"],
|
|
@@ -1517,7 +1539,7 @@ var VIDEO_MODELS = [
|
|
|
1517
1539
|
adapter: "higgsfield",
|
|
1518
1540
|
providerModelId: "kling-video/v2.5-turbo/pro/image-to-video",
|
|
1519
1541
|
lifecycle: "active",
|
|
1520
|
-
exposure: "
|
|
1542
|
+
exposure: ["cowork", "space_builder"],
|
|
1521
1543
|
constraints: {
|
|
1522
1544
|
aspectRatios: [...KLING_RATIOS],
|
|
1523
1545
|
durations: [5, 10],
|
|
@@ -1548,7 +1570,7 @@ var VIDEO_MODELS = [
|
|
|
1548
1570
|
adapter: "higgsfield",
|
|
1549
1571
|
providerModelId: "kling-video/v3.0/pro/image-to-video",
|
|
1550
1572
|
lifecycle: "active",
|
|
1551
|
-
exposure: "
|
|
1573
|
+
exposure: ["cowork", "space_builder"],
|
|
1552
1574
|
constraints: {
|
|
1553
1575
|
aspectRatios: [...KLING_RATIOS],
|
|
1554
1576
|
durations: { min: 3, max: 15 },
|
|
@@ -1572,6 +1594,9 @@ var VIDEO_MODELS = [
|
|
|
1572
1594
|
},
|
|
1573
1595
|
{
|
|
1574
1596
|
// mode standard/pro selects 720p/1080p; the endpoint takes no separate resolution.
|
|
1597
|
+
// Replicate: "Max 7 [images] without video, 4 with video"; 4K does not support
|
|
1598
|
+
// reference_video. No `videos` limit yet: the adapter sends no reference video,
|
|
1599
|
+
// so `imagesWithVideo` stays dormant until one is wired through.
|
|
1575
1600
|
id: "kling-v3-omni-video",
|
|
1576
1601
|
aliases: ["kwaivgi/kling-v3-omni-video", "kling-v3-omni"],
|
|
1577
1602
|
label: "Kling V3 Omni",
|
|
@@ -1579,12 +1604,12 @@ var VIDEO_MODELS = [
|
|
|
1579
1604
|
adapter: "replicate",
|
|
1580
1605
|
providerModelId: "kwaivgi/kling-v3-omni-video",
|
|
1581
1606
|
lifecycle: "active",
|
|
1582
|
-
exposure: "
|
|
1607
|
+
exposure: ["cowork", "space_builder"],
|
|
1583
1608
|
constraints: {
|
|
1584
1609
|
aspectRatios: [...KLING_RATIOS],
|
|
1585
1610
|
resolutions: ["720p", "1080p"],
|
|
1586
1611
|
durations: { min: 3, max: 15 },
|
|
1587
|
-
references: { images: 7 },
|
|
1612
|
+
references: { images: 7, imagesWithVideo: 4 },
|
|
1588
1613
|
supports: ["generateAudio", "lastFrame"]
|
|
1589
1614
|
},
|
|
1590
1615
|
defaults: { durationSeconds: 5, aspectRatio: "16:9", generateAudio: false, mode: "pro" },
|
|
@@ -1605,7 +1630,7 @@ var VIDEO_MODELS = [
|
|
|
1605
1630
|
adapter: "fal",
|
|
1606
1631
|
providerModelId: "minimax/h3",
|
|
1607
1632
|
lifecycle: "active",
|
|
1608
|
-
exposure: "
|
|
1633
|
+
exposure: ["cowork", "space_builder"],
|
|
1609
1634
|
constraints: {
|
|
1610
1635
|
aspectRatios: [...H3_RATIOS],
|
|
1611
1636
|
resolutions: ["480p", "768p", "2k", "4k"],
|
|
@@ -1635,7 +1660,7 @@ var VIDEO_MODELS = [
|
|
|
1635
1660
|
adapter: "fal",
|
|
1636
1661
|
providerModelId: "minimax/h3-max",
|
|
1637
1662
|
lifecycle: "active",
|
|
1638
|
-
exposure: "
|
|
1663
|
+
exposure: ["cowork", "space_builder"],
|
|
1639
1664
|
constraints: {
|
|
1640
1665
|
aspectRatios: [...H3_RATIOS],
|
|
1641
1666
|
resolutions: ["480p", "768p"],
|
|
@@ -1665,7 +1690,7 @@ var VIDEO_MODELS = [
|
|
|
1665
1690
|
adapter: "fal",
|
|
1666
1691
|
providerModelId: "minimax/h3/reference-to-video",
|
|
1667
1692
|
lifecycle: "active",
|
|
1668
|
-
exposure: "
|
|
1693
|
+
exposure: ["cowork", "space_builder"],
|
|
1669
1694
|
constraints: {
|
|
1670
1695
|
aspectRatios: [...H3_REFERENCE_RATIOS],
|
|
1671
1696
|
resolutions: ["480p", "768p", "2k", "4k"],
|
|
@@ -1696,7 +1721,7 @@ var VIDEO_MODELS = [
|
|
|
1696
1721
|
adapter: "fal",
|
|
1697
1722
|
providerModelId: "minimax/h3-max/reference-to-video",
|
|
1698
1723
|
lifecycle: "active",
|
|
1699
|
-
exposure: "
|
|
1724
|
+
exposure: ["cowork", "space_builder"],
|
|
1700
1725
|
constraints: {
|
|
1701
1726
|
aspectRatios: [...H3_REFERENCE_RATIOS],
|
|
1702
1727
|
resolutions: ["480p", "768p"],
|
|
@@ -1728,7 +1753,7 @@ var VIDEO_MODELS = [
|
|
|
1728
1753
|
adapter: "fal",
|
|
1729
1754
|
providerModelId: "fal-ai/kling-video/o1/video-to-video/reference",
|
|
1730
1755
|
lifecycle: "active",
|
|
1731
|
-
exposure:
|
|
1756
|
+
exposure: [],
|
|
1732
1757
|
constraints: {
|
|
1733
1758
|
aspectRatios: [...KLING_RATIOS],
|
|
1734
1759
|
durations: { min: 3, max: 10 },
|
|
@@ -1753,7 +1778,7 @@ var VIDEO_MODELS = [
|
|
|
1753
1778
|
adapter: "replicate",
|
|
1754
1779
|
providerModelId: "minimax/hailuo-02",
|
|
1755
1780
|
lifecycle: "active",
|
|
1756
|
-
exposure:
|
|
1781
|
+
exposure: [],
|
|
1757
1782
|
constraints: {
|
|
1758
1783
|
resolutions: ["768p"],
|
|
1759
1784
|
durations: [6, 10],
|
|
@@ -1777,7 +1802,7 @@ var VIDEO_MODELS = [
|
|
|
1777
1802
|
adapter: "higgsfield",
|
|
1778
1803
|
providerModelId: "dop-preview",
|
|
1779
1804
|
lifecycle: "active",
|
|
1780
|
-
exposure:
|
|
1805
|
+
exposure: [],
|
|
1781
1806
|
constraints: {
|
|
1782
1807
|
requires: ["firstFrame"],
|
|
1783
1808
|
supports: ["seed", "lastFrame"]
|
|
@@ -1817,6 +1842,12 @@ var ADAPTER_IDS = [
|
|
|
1817
1842
|
];
|
|
1818
1843
|
var ModelTypeSchema = z.enum(["text", "image", "video", "audio", "upscale", "bg-remove"]);
|
|
1819
1844
|
var LifecycleSchema = z.enum(["active", "deprecated", "retired"]);
|
|
1845
|
+
var SurfaceSchema = z.enum(["cowork", "space_builder"]);
|
|
1846
|
+
var SURFACES2 = SurfaceSchema.options;
|
|
1847
|
+
var ExposureSchema = z.preprocess(
|
|
1848
|
+
normalizeExposure,
|
|
1849
|
+
z.array(SurfaceSchema)
|
|
1850
|
+
);
|
|
1820
1851
|
var AdapterSchema = z.enum(ADAPTER_IDS);
|
|
1821
1852
|
var AspectRatioSchema = z.enum([
|
|
1822
1853
|
"1:1",
|
|
@@ -1854,6 +1885,7 @@ var SupportedOptionSchema = z.enum([
|
|
|
1854
1885
|
"upscale",
|
|
1855
1886
|
"watermark",
|
|
1856
1887
|
"safetyChecker",
|
|
1888
|
+
"taskType",
|
|
1857
1889
|
"instrumental"
|
|
1858
1890
|
]);
|
|
1859
1891
|
var UsageUnitSchema = z.enum([
|
|
@@ -1876,6 +1908,7 @@ var ProviderOptionValueSchema = z.lazy(
|
|
|
1876
1908
|
var ProviderOptionsSchema = z.record(z.string(), z.record(z.string(), ProviderOptionValueSchema));
|
|
1877
1909
|
var ReferenceLimitsSchema = z.looseObject({
|
|
1878
1910
|
images: z.number().optional(),
|
|
1911
|
+
imagesWithVideo: z.number().optional(),
|
|
1879
1912
|
videos: z.number().optional(),
|
|
1880
1913
|
audios: z.number().optional(),
|
|
1881
1914
|
total: z.number().optional(),
|
|
@@ -1937,6 +1970,7 @@ var DefaultsSchema = z.looseObject({
|
|
|
1937
1970
|
promptExpansion: z.enum(["fast", "balanced", "quality"]).optional(),
|
|
1938
1971
|
watermark: z.boolean().optional(),
|
|
1939
1972
|
safetyChecker: z.boolean().optional(),
|
|
1973
|
+
taskType: z.enum(["reference", "edit", "extend"]).optional(),
|
|
1940
1974
|
mode: z.enum(["standard", "pro"]).optional(),
|
|
1941
1975
|
instrumental: z.boolean().optional()
|
|
1942
1976
|
});
|
|
@@ -1968,7 +2002,7 @@ var CatalogModelSchemaBase = z.looseObject({
|
|
|
1968
2002
|
providerModelId: z.string().min(1),
|
|
1969
2003
|
lifecycle: LifecycleSchema,
|
|
1970
2004
|
replacedBy: z.string().optional(),
|
|
1971
|
-
exposure:
|
|
2005
|
+
exposure: ExposureSchema,
|
|
1972
2006
|
constraints: ModelConstraintsSchema,
|
|
1973
2007
|
defaults: DefaultsSchema,
|
|
1974
2008
|
providerOptions: ProviderOptionsSchema.optional(),
|
|
@@ -2496,6 +2530,9 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
|
|
|
2496
2530
|
model,
|
|
2497
2531
|
warnings
|
|
2498
2532
|
);
|
|
2533
|
+
if (limits.imagesWithVideo !== void 0 && (limits.videos ?? 0) > 0 && videos.length > 0 && images.length > limits.imagesWithVideo) {
|
|
2534
|
+
images = trim("referenceImages", images, limits.imagesWithVideo, model, warnings);
|
|
2535
|
+
}
|
|
2499
2536
|
if (limits.total !== void 0) {
|
|
2500
2537
|
let over = images.length + videos.length + audios.length - limits.total;
|
|
2501
2538
|
if (over > 0) {
|
|
@@ -2529,7 +2566,8 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
|
|
|
2529
2566
|
"promptExpansion",
|
|
2530
2567
|
"lastFrame",
|
|
2531
2568
|
"watermark",
|
|
2532
|
-
"safetyChecker"
|
|
2569
|
+
"safetyChecker",
|
|
2570
|
+
"taskType"
|
|
2533
2571
|
]);
|
|
2534
2572
|
return { request: merged, warnings };
|
|
2535
2573
|
}
|
|
@@ -2830,7 +2868,7 @@ function passthroughTextModel(model) {
|
|
|
2830
2868
|
adapter: "ai-sdk-text",
|
|
2831
2869
|
providerModelId: model.modelId,
|
|
2832
2870
|
lifecycle: "active",
|
|
2833
|
-
exposure:
|
|
2871
|
+
exposure: [],
|
|
2834
2872
|
constraints: {},
|
|
2835
2873
|
defaults: {},
|
|
2836
2874
|
usage: { unit: "tokens" },
|
|
@@ -3977,9 +4015,22 @@ function seedanceErrorMessage(error, status) {
|
|
|
3977
4015
|
return `Seedance task ${status}`;
|
|
3978
4016
|
}
|
|
3979
4017
|
async function generateSeedanceVideo(req, ctx) {
|
|
3980
|
-
const key = arkKey(ctx);
|
|
3981
4018
|
const modelId = ctx.model.id;
|
|
3982
|
-
const
|
|
4019
|
+
const taskType = req.taskType;
|
|
4020
|
+
const hasVideo = Boolean(req.sourceVideo) || (req.referenceVideos?.length ?? 0) > 0;
|
|
4021
|
+
if ((taskType === "edit" || taskType === "extend") && !hasVideo) {
|
|
4022
|
+
throw new ModelKitError({
|
|
4023
|
+
code: "missing_input",
|
|
4024
|
+
message: `${ctx.model.id} ${taskType} task needs a source or reference video`,
|
|
4025
|
+
provider: "ark",
|
|
4026
|
+
model: ctx.model.id,
|
|
4027
|
+
retryable: false
|
|
4028
|
+
});
|
|
4029
|
+
}
|
|
4030
|
+
const key = arkKey(ctx);
|
|
4031
|
+
const requestedDuration = req.durationSeconds ?? 5;
|
|
4032
|
+
let duration = requestedDuration;
|
|
4033
|
+
if (taskType === "edit") duration = -1;
|
|
3983
4034
|
const resolution = req.resolution ?? "720p";
|
|
3984
4035
|
const content = [{ type: "text", text: req.prompt }];
|
|
3985
4036
|
if (req.firstFrame) {
|
|
@@ -4031,7 +4082,10 @@ async function generateSeedanceVideo(req, ctx) {
|
|
|
4031
4082
|
duration,
|
|
4032
4083
|
resolution
|
|
4033
4084
|
};
|
|
4034
|
-
if (
|
|
4085
|
+
if (taskType === "edit" || taskType === "extend") body.ratio = "adaptive";
|
|
4086
|
+
else if (!hasFrameAnchor && req.aspectRatio !== void 0) body.ratio = req.aspectRatio;
|
|
4087
|
+
if (taskType !== void 0 && ctx.model.id === "seedance-2.5")
|
|
4088
|
+
body.omni_reference_task_type = taskType;
|
|
4035
4089
|
if (req.generateAudio !== void 0) body.generate_audio = req.generateAudio;
|
|
4036
4090
|
if (req.seed !== void 0) body.seed = req.seed;
|
|
4037
4091
|
if (req.watermark !== void 0) body.watermark = req.watermark;
|
|
@@ -4051,7 +4105,7 @@ async function generateSeedanceVideo(req, ctx) {
|
|
|
4051
4105
|
}, retryOptsFor(ctx));
|
|
4052
4106
|
if (!submit.id) throwArkError(void 0, "Seedance task create returned no id", modelId);
|
|
4053
4107
|
const jobId = submit.id;
|
|
4054
|
-
const usage2 = seedanceUsage(ctx, req, duration);
|
|
4108
|
+
const usage2 = seedanceUsage(ctx, req, taskType === "edit" ? requestedDuration : duration);
|
|
4055
4109
|
const fetchStatus = async () => {
|
|
4056
4110
|
const res = await arkFetch(ctx, `${arkBaseUrl(ctx)}${SUBMIT_PATH}/${jobId}`, {
|
|
4057
4111
|
headers: { Authorization: `Bearer ${key}` }
|
|
@@ -4098,6 +4152,10 @@ async function generateSeedanceVideo(req, ctx) {
|
|
|
4098
4152
|
"Seedance task succeeded but returned no video_url",
|
|
4099
4153
|
modelId
|
|
4100
4154
|
);
|
|
4155
|
+
if (polled.duration !== void 0 && polled.duration > 0) {
|
|
4156
|
+
usage2.quantity = polled.duration;
|
|
4157
|
+
usage2.durationSeconds = polled.duration;
|
|
4158
|
+
}
|
|
4101
4159
|
const tokens = polled.usage;
|
|
4102
4160
|
if (tokens?.total_tokens !== void 0 && tokens.completion_tokens !== void 0) {
|
|
4103
4161
|
usage2.inputTokens = tokens.total_tokens - tokens.completion_tokens;
|
|
@@ -5153,7 +5211,7 @@ async function generateOmniVideo(req, ctx, createGenAIClient) {
|
|
|
5153
5211
|
const apiKey = googleKey(ctx);
|
|
5154
5212
|
const modelId = ctx.model.id;
|
|
5155
5213
|
const providerModelId = ctx.model.providerModelId;
|
|
5156
|
-
const duration = req.durationSeconds ??
|
|
5214
|
+
const duration = req.durationSeconds ?? 10;
|
|
5157
5215
|
const images = req.referenceImages ?? [];
|
|
5158
5216
|
const videos = req.referenceVideos ?? [];
|
|
5159
5217
|
const task = req.sourceVideo ? "edit" : req.firstFrame ? "image_to_video" : images.length > 0 || videos.length > 0 ? "reference_to_video" : "text_to_video";
|
|
@@ -7394,10 +7452,13 @@ export {
|
|
|
7394
7452
|
CatalogModelSchema,
|
|
7395
7453
|
CatalogSchema,
|
|
7396
7454
|
DEFAULT_ADAPTERS,
|
|
7455
|
+
ExposureSchema,
|
|
7397
7456
|
JsonObjectSchema,
|
|
7398
7457
|
JsonValueSchema,
|
|
7399
7458
|
MODELS,
|
|
7400
7459
|
ModelKitError,
|
|
7460
|
+
SURFACES2 as SURFACES,
|
|
7461
|
+
SurfaceSchema,
|
|
7401
7462
|
aiSdkTextAdapter,
|
|
7402
7463
|
arkAdapter,
|
|
7403
7464
|
aspectRatioToSize,
|
|
@@ -7418,6 +7479,8 @@ export {
|
|
|
7418
7479
|
googleGenaiAdapter,
|
|
7419
7480
|
googleImageAdapter,
|
|
7420
7481
|
higgsfieldAdapter,
|
|
7482
|
+
isListed,
|
|
7483
|
+
isListedOn,
|
|
7421
7484
|
isModelKitError,
|
|
7422
7485
|
keysFromEnv,
|
|
7423
7486
|
languageModel,
|
|
@@ -7425,6 +7488,7 @@ export {
|
|
|
7425
7488
|
liveState,
|
|
7426
7489
|
mergeTextProviderOptions,
|
|
7427
7490
|
nearestAspectRatio,
|
|
7491
|
+
normalizeExposure,
|
|
7428
7492
|
openaiImageAdapter,
|
|
7429
7493
|
passthroughTextModel,
|
|
7430
7494
|
pollUntil,
|