@shop-os/modelkit 0.4.7 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/catalog.d.ts CHANGED
@@ -31,6 +31,19 @@ type MediaRef = {
31
31
  /** Measured length of a video/audio; the kit never measures it. */
32
32
  durationSeconds?: number;
33
33
  };
34
+ /** A click on the image for `mask` rows, in source pixels; `background` excludes the spot. */
35
+ interface MaskPoint {
36
+ x: number;
37
+ y: number;
38
+ label?: "foreground" | "background";
39
+ }
40
+ /** A box around the object to mask, in source pixels. */
41
+ interface MaskBox {
42
+ xMin: number;
43
+ yMin: number;
44
+ xMax: number;
45
+ yMax: number;
46
+ }
34
47
  /** Caller-driven Topaz upscale controls; see the topaz row and TopazImageInput. */
35
48
  interface UpscaleOptions {
36
49
  enhanceModel?: string;
@@ -39,13 +52,28 @@ interface UpscaleOptions {
39
52
  faceEnhancementCreativity?: number;
40
53
  faceEnhancementStrength?: number;
41
54
  }
42
- type ModelType = "text" | "image" | "video" | "audio" | "upscale" | "bg-remove"
43
- /** Video in, video out, no prompt: upscale, frame interpolation, SDR to HDR. */
44
- | "video-tool";
55
+ type ModelType = "text" | "image" | "video" | "audio"
56
+ /** Sound effects (`generateAudio`): a text description, or a `sourceVideo` to score when the row requires one. */
57
+ | "sound-effect" | "upscale" | "bg-remove"
58
+ /** Image segmentation (`generateImage`): one image and a prompt in, one mask per match out. */
59
+ | "mask"
60
+ /** Video in, video out, no prompt: upscale, frame interpolation, SDR to HDR, background removal, subtitles. */
61
+ | "video-tool"
62
+ /** Text to speech (`generateSpeech`). */
63
+ | "speech"
64
+ /** Speech to speech in another voice (`changeVoice`). */
65
+ | "voice-change"
66
+ /** Speech translated into `targetLanguage` (`dub`), from a video or an audio file. */
67
+ | "dubbing"
68
+ /** A face driven by speech (`lipsync`): a `sourceVideo` re-timed or a still `image` animated. */
69
+ | "lipsync"
70
+ /** Speech to text (`transcribe`). */
71
+ | "transcription";
45
72
  /** What a `video-tool` row does to its source clip. */
46
- type VideoToolKind = "upscale" | "interpolate" | "hdr";
73
+ type VideoToolKind = "upscale" | "interpolate" | "hdr" | "bg-remove" | "subtitles";
47
74
  /** Container/codec a video-tool row can write. */
48
- type VideoToolOutputFormat = "h265" | "prores";
75
+ /** `exr`: a ZIP of 16-bit EXR frames in `VideoToolResult.frames`, with an MP4 preview as `video`. */
76
+ type VideoToolOutputFormat = "h265" | "prores" | "exr";
49
77
  type Lifecycle = "active" | "deprecated" | "retired";
50
78
  type Surface = "cowork" | "space_builder";
51
79
  /** @deprecated use Surface[] */
@@ -75,6 +103,10 @@ interface ImageRequest {
75
103
  temperature?: number;
76
104
  /** Upscaler controls beyond `scaleFactor`/`outputFormat` (Topaz). */
77
105
  upscale?: UpscaleOptions;
106
+ /** Mask rows with `supports: points`: spots that refine what the prompt selects. */
107
+ points?: MaskPoint[];
108
+ /** Mask rows with `supports: boxes`: boxes around the objects to mask. */
109
+ boxes?: MaskBox[];
78
110
  }
79
111
  /**
80
112
  * What a caller passes to generateImage. Same field names as the AI SDK's
@@ -122,6 +154,12 @@ interface VideoRequest {
122
154
  * adapter sends the prompt alone; `taskType: "extend"` still selects the extend path. */
123
155
  previousInteractionId?: string;
124
156
  mode?: "standard" | "pro";
157
+ /** Rows with `supports: ["insertWindow"]`: where the generated scene starts in the
158
+ * source clip and where the source footage resumes, in seconds. */
159
+ insertWindow?: {
160
+ startSeconds: number;
161
+ resumeSeconds: number;
162
+ };
125
163
  }
126
164
  /**
127
165
  * What a caller passes to generateVideo. `duration` is the AI SDK spelling of
@@ -149,12 +187,38 @@ interface VideoToolRequest {
149
187
  source: VideoToolSource;
150
188
  /** Upscale rows. */
151
189
  upscaleFactor?: number;
152
- /** Upscale rows whose `constraints.tool.prompt` is set; ignored by every other row. */
190
+ /** Rows whose `constraints.tool.prompt` is set; ignored by every other row. */
153
191
  prompt?: string;
154
192
  /** Interpolate rows. */
155
193
  targetFps?: number;
156
194
  /** HDR rows; the row's first `outputFormats` entry when unset. */
157
195
  outputFormat?: VideoToolOutputFormat;
196
+ /** Subtitles rows: caption style and language; the row's first preset when unset. */
197
+ subtitles?: SubtitleOptions;
198
+ }
199
+ /** Per-tier caption text overrides; an unset field keeps the preset's own. */
200
+ interface SubtitleTextStyle {
201
+ /** A Google Font name the provider supports. */
202
+ font?: string;
203
+ /** 100 to 900. */
204
+ weight?: number;
205
+ /** `#rgb` or `#rrggbb`. */
206
+ color?: string;
207
+ }
208
+ /** Burned-in caption options; every unset field keeps the preset's own. */
209
+ interface SubtitleOptions {
210
+ /** One of `constraints.tool.presets`. */
211
+ preset?: string;
212
+ /** The spoken language (one of `tool.languages`); the provider detects it when unset. */
213
+ language?: string;
214
+ /** Caption in this language instead (one of `tool.translationLanguages`). */
215
+ translationLanguage?: string;
216
+ position?: "top" | "center" | "bottom";
217
+ shadow?: "none" | "min" | "mid" | "max";
218
+ /** Every word. */
219
+ baseline?: SubtitleTextStyle;
220
+ /** The words the provider marks as key. */
221
+ highlighted?: SubtitleTextStyle;
158
222
  }
159
223
  /** The output a video-tool request will produce, from the request alone. */
160
224
  interface VideoToolOutputSpec {
@@ -162,8 +226,11 @@ interface VideoToolOutputSpec {
162
226
  height: number;
163
227
  durationSeconds: number;
164
228
  fps?: number;
229
+ /** HDR: the frames the row renders at `fps`, which the request sends. */
230
+ frames?: number;
165
231
  resolution: VideoResolution;
166
- format: "h264" | VideoToolOutputFormat;
232
+ /** `vp9` (WebM with alpha) is what a `bg-remove` row writes. */
233
+ format: "h264" | "vp9" | VideoToolOutputFormat;
167
234
  }
168
235
  interface VideoToolCallContext extends CallContext {
169
236
  /** Where the provider posts the result when the job ends. */
@@ -191,6 +258,12 @@ interface VideoToolResult {
191
258
  mime?: string;
192
259
  bytes?: number;
193
260
  };
261
+ /** The frame archive of an `exr` row; `video` is then its preview. */
262
+ frames?: {
263
+ url: string;
264
+ mime?: string;
265
+ bytes?: number;
266
+ };
194
267
  output: VideoToolOutputSpec;
195
268
  usage: UsageEvent;
196
269
  raw?: unknown;
@@ -206,22 +279,118 @@ interface AudioRequest {
206
279
  seed?: number;
207
280
  /** Music models: no vocals. */
208
281
  instrumental?: boolean;
282
+ /** Music rows with `supports: lyrics`: the words to sing, with [verse]/[chorus] tags. */
283
+ lyrics?: string;
284
+ /** One of the row's `constraints.outputFormats`; the row default when unset. */
285
+ outputFormat?: string;
209
286
  /** Cancellation; combined with CallContext.signal before dispatch. */
210
287
  abortSignal?: AbortSignal;
211
288
  }
289
+ /** A provider file: a URL it hosts, or the bytes when it returns them inline. */
290
+ type MediaOutput = {
291
+ bytes: Uint8Array;
292
+ mime: string;
293
+ } | {
294
+ url: string;
295
+ mime?: string;
296
+ expiresAt?: Date;
297
+ };
212
298
  interface AudioResult {
213
- audio: {
214
- bytes: Uint8Array;
215
- mime: string;
216
- } | {
217
- url: string;
218
- expiresAt?: Date;
219
- };
299
+ audio: MediaOutput;
220
300
  /** Lyria returns lyrics as text parts next to the audio. */
221
301
  text?: string;
222
302
  usage: UsageEvent;
223
303
  raw?: JsonValue;
224
304
  }
305
+ /** `generateSpeech` on a `speech` row. Voice, language and format are ids the row lists. */
306
+ interface SpeechRequest {
307
+ model: string;
308
+ /** The script, spoken verbatim. */
309
+ text: string;
310
+ /** One of `constraints.voices[].id`; the row default when unset. */
311
+ voice?: string;
312
+ /** One of `constraints.languages[].code`; the provider detects it when unset. */
313
+ language?: string;
314
+ /** Rows with `supports: style`: how to speak it ("warm and slow"), kept out of the script. */
315
+ style?: string;
316
+ /** One of `constraints.outputFormats`; the row default when unset. */
317
+ outputFormat?: string;
318
+ abortSignal?: AbortSignal;
319
+ }
320
+ /** `changeVoice` on a `voice-change` row: the recording re-spoken in another voice. */
321
+ interface VoiceChangeRequest {
322
+ model: string;
323
+ /** Set `durationSeconds` so `constraints.references.audioSeconds` can be checked. */
324
+ sourceAudio: MediaRef;
325
+ voice?: string;
326
+ outputFormat?: string;
327
+ abortSignal?: AbortSignal;
328
+ }
329
+ /**
330
+ * `lipsync` on a `lipsync` row. The row's `requires` names the face input: `sourceVideo` (a
331
+ * video re-timed to the speech) or `firstFrame` (a still `image` animated).
332
+ */
333
+ interface LipsyncRequest {
334
+ model: string;
335
+ sourceVideo?: MediaRef;
336
+ image?: MediaRef;
337
+ /** The speech. Set `durationSeconds` so `constraints.references.audioSeconds` can be checked. */
338
+ audio: MediaRef;
339
+ /** Rows that list `constraints.resolutions`; the row default when unset. */
340
+ resolution?: VideoResolution;
341
+ abortSignal?: AbortSignal;
342
+ }
343
+ interface LipsyncResult {
344
+ video: MediaOutput;
345
+ usage: UsageEvent;
346
+ raw?: unknown;
347
+ }
348
+ /** `dub` on a `dubbing` row: exactly one of `sourceVideo` / `sourceAudio`. */
349
+ interface DubbingRequest {
350
+ model: string;
351
+ sourceVideo?: MediaRef;
352
+ sourceAudio?: MediaRef;
353
+ /** One of `constraints.languages[].code`. */
354
+ targetLanguage: string;
355
+ /** One of `constraints.outputFormats` on rows that list them. */
356
+ outputFormat?: string;
357
+ abortSignal?: AbortSignal;
358
+ }
359
+ /** The dubbed media, of the same kind as the source. */
360
+ interface DubbingResult {
361
+ video?: MediaOutput;
362
+ audio?: MediaOutput;
363
+ usage: UsageEvent;
364
+ raw?: unknown;
365
+ }
366
+ interface TranscriptionRequest {
367
+ model: string;
368
+ /** The speech, audio or video. Set `durationSeconds` so limits and usage can use it. */
369
+ source: MediaRef;
370
+ /** One of `constraints.languages[].code`; the provider detects the language when unset. */
371
+ language?: string;
372
+ /** Also return `subtitles` (SRT) built from the word timings. */
373
+ timestamps?: boolean;
374
+ abortSignal?: AbortSignal;
375
+ }
376
+ interface TranscriptWord {
377
+ text: string;
378
+ /** `word`, `spacing` or `audio_event` (ElevenLabs Scribe). */
379
+ type: string;
380
+ start?: number;
381
+ end?: number;
382
+ speakerId?: string;
383
+ }
384
+ interface TranscriptionResult {
385
+ text: string;
386
+ /** SubRip (SRT) cues, when the request asked for `timestamps`. */
387
+ subtitles?: string;
388
+ /** The language the provider detected or was told. */
389
+ language?: string;
390
+ words: TranscriptWord[];
391
+ usage: UsageEvent;
392
+ raw?: JsonValue;
393
+ }
225
394
  /** An AI SDK file part ready for generateText/generateObject, e.g. a video for understanding. */
226
395
  interface MediaPart {
227
396
  type: "file";
@@ -230,10 +399,18 @@ interface MediaPart {
230
399
  /** Set when the bytes were uploaded to a provider file store (Gemini Files API). Call `cleanup` after the request. */
231
400
  cleanup?: () => Promise<void>;
232
401
  }
233
- type RequiredInput = "firstFrame" | "sourceVideo" | "references";
402
+ type RequiredInput = "firstFrame" | "sourceVideo" | "references" | "sourceAudio";
234
403
  type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental"
404
+ /** Music rows that sing `AudioRequest.lyrics`. */
405
+ | "lyrics"
406
+ /** Speech rows that take `SpeechRequest.style`, a delivery instruction. */
407
+ | "style"
235
408
  /** Video rows that extend a clip in fixed segments up to a cumulative cap (see `ModelConstraints.extension`). */
236
- | "videoExtension";
409
+ | "videoExtension"
410
+ /** Video rows that generate a scene inside a source clip (`VideoRequest.insertWindow`). */
411
+ | "insertWindow"
412
+ /** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
413
+ | "points" | "boxes";
237
414
  interface VideoSecondsLimits {
238
415
  /** Minimum length of each reference video, in seconds. */
239
416
  min?: number;
@@ -265,6 +442,16 @@ interface ReferenceLimits {
265
442
  audioFormats?: string[];
266
443
  /** Largest reference audio file the provider takes, in bytes. */
267
444
  audioMaxBytes?: number;
445
+ /**
446
+ * Video rows: the fewest references of each kind a request needs (Kling 3.0 Motion Control:
447
+ * one image and one video). `requires: ["references"]` needs one of any kind; this names
448
+ * the kinds. Kits before 0.5.0 ignore it.
449
+ */
450
+ min?: {
451
+ images?: number;
452
+ videos?: number;
453
+ audios?: number;
454
+ };
268
455
  }
269
456
  interface VideoToolConstraints {
270
457
  kind: VideoToolKind;
@@ -275,7 +462,7 @@ interface VideoToolConstraints {
275
462
  };
276
463
  /** Upscale: the output's long edge may not pass this, in pixels. */
277
464
  maxOutputLongEdge?: number;
278
- /** Upscale: the row takes an optional prompt that guides added detail. */
465
+ /** Upscale and HDR: the row takes an optional prompt that guides the result. */
279
466
  prompt?: boolean;
280
467
  /** Interpolate: allowed target frame rate range. */
281
468
  fps?: {
@@ -284,11 +471,45 @@ interface VideoToolConstraints {
284
471
  };
285
472
  /** HDR: the formats the row writes, first is the default. */
286
473
  outputFormats?: VideoToolOutputFormat[];
474
+ /** The output's short edge is scaled down to this many pixels, keeping the aspect ratio. */
475
+ maxOutputShortEdge?: number;
476
+ /** The most frames the row renders (duration times frame rate). */
477
+ maxOutputFrames?: number;
478
+ /** HDR: the fewest frames the row renders; a shorter source is padded to it. */
479
+ minOutputFrames?: number;
480
+ /** HDR: the fastest output rate; a faster source renders at this rate. */
481
+ maxOutputFps?: number;
482
+ /** Subtitles: the caption styles, first is the default. */
483
+ presets?: string[];
484
+ /** Subtitles: spoken-language codes the provider transcribes. */
485
+ languages?: string[];
486
+ /** Subtitles: codes the provider can translate the captions into. */
487
+ translationLanguages?: string[];
488
+ /** Subtitles: the longest source above 1080p, in seconds (`sourceVideoSeconds.max` covers the rest). */
489
+ maxSecondsAbove1080p?: number;
287
490
  }
288
491
  /** Whether a video row's output has sound: always, switchable (`supports: generateAudio`), or silent. */
289
492
  type AudioOutput = "always" | "optional" | "never";
290
493
  /** How a prompt points at reference N: "image N" numbering, a caption beside each image, or prose. */
291
494
  type ReferenceSyntax = "numbered" | "caption" | "descriptive";
495
+ type VoiceGender = "male" | "female" | "neutral";
496
+ /** A voice a row offers. `id` is the value sent to the provider. */
497
+ interface VoiceOption {
498
+ id: string;
499
+ name: string;
500
+ gender?: VoiceGender;
501
+ accent?: string;
502
+ /** Language codes the provider lists for the voice. */
503
+ languages?: string[];
504
+ description?: string;
505
+ /** An https sample of the voice. */
506
+ previewUrl?: string;
507
+ }
508
+ /** A language a row takes. `code` is the value sent to the provider. */
509
+ interface LanguageOption {
510
+ code: string;
511
+ name: string;
512
+ }
292
513
  interface PromptConventions {
293
514
  referenceSyntax: ReferenceSyntax;
294
515
  /** Provider-documented prompt length limit, in characters. */
@@ -306,6 +527,8 @@ interface ModelConstraints {
306
527
  durationPresets?: number[];
307
528
  /** Curated quality choices for rows whose `supports` includes "quality". */
308
529
  qualityOptions?: string[];
530
+ /** Upscale rows: the `scaleFactor` values the row offers; absent means any. */
531
+ scaleFactors?: number[];
309
532
  /**
310
533
  * Exact pixel size per aspect ratio for rows an app must size verbatim
311
534
  * (gpt-image-2 keeps its historic WxH contract); callers pass it as `exactSize`.
@@ -313,9 +536,26 @@ interface ModelConstraints {
313
536
  exactSizes?: Record<string, string>;
314
537
  references?: ReferenceLimits;
315
538
  requires?: RequiredInput[];
539
+ /**
540
+ * Video rows: at least one of these inputs must be present (`requires` needs all of its
541
+ * own). Kits before 0.5.0 ignore it.
542
+ */
543
+ requiresOneOf?: RequiredInput[];
544
+ /**
545
+ * Video rows whose endpoint has no prompt field (MiniMax H3 Max Relight): the request needs
546
+ * no prompt, and a non-empty one is dropped with an `option_ignored` warning. Absent means
547
+ * the row takes a prompt. Kits before 0.5.0 ignore it.
548
+ */
549
+ noPrompt?: boolean;
316
550
  supports?: SupportedOption[];
317
551
  /** Ratio is dropped, with a warning, when one of these inputs is present. */
318
552
  ratioIgnoredWith?: ("firstFrame" | "sourceVideo")[];
553
+ /** Speech and voice-change rows: the voices offered; `defaults.voice` is one of their ids. */
554
+ voices?: VoiceOption[];
555
+ /** Speech, transcription and dubbing (target) rows: the languages taken. */
556
+ languages?: LanguageOption[];
557
+ /** Audio-output rows whose provider lets the caller pick a file format; `defaults.outputFormat` is one. */
558
+ outputFormats?: string[];
319
559
  /** Length limits for the source video the row edits or extends. */
320
560
  sourceVideoSeconds?: Omit<VideoSecondsLimits, "total"> & {
321
561
  /** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
@@ -408,6 +648,15 @@ interface CatalogCapabilities {
408
648
  vision?: boolean;
409
649
  contextWindow?: number;
410
650
  }
651
+ /** Row defaults the request types do not share. */
652
+ interface MediaNodeDefaults {
653
+ /** Image rows: png, jpeg or webp. Audio-output rows: one of `constraints.outputFormats`. */
654
+ outputFormat?: string;
655
+ /** One of `constraints.voices[].id`. */
656
+ voice?: string;
657
+ /** One of `constraints.languages[].code`. */
658
+ language?: string;
659
+ }
411
660
  interface CatalogModel {
412
661
  /** Canonical id. Equals the pricing key in pro-backend credit_pricing_* tables. */
413
662
  id: string;
@@ -427,7 +676,7 @@ interface CatalogModel {
427
676
  */
428
677
  exposure: Surface[];
429
678
  constraints: ModelConstraints;
430
- defaults: Partial<Omit<ImageRequest, "model" | "prompt"> & Omit<VideoRequest, "model" | "prompt"> & Omit<AudioRequest, "model" | "prompt">>;
679
+ defaults: Partial<Omit<ImageRequest, "model" | "prompt" | "outputFormat"> & Omit<VideoRequest, "model" | "prompt"> & Omit<AudioRequest, "model" | "prompt" | "outputFormat">> & MediaNodeDefaults;
431
680
  /** Provider options merged under the caller's on every call. Chat-only tuning belongs in display.chat. */
432
681
  providerOptions?: ProviderOptions;
433
682
  /**
@@ -647,7 +896,11 @@ declare function isListedOn(row: CatalogModel, surface: Surface): boolean;
647
896
  /** True when an active row is listed on at least one surface. */
648
897
  declare function isListed(row: CatalogModel): boolean;
649
898
 
650
- /** Seeded from Cowork, Space Builder and trigger-workflows. See catalog/*.ts. */
899
+ /**
900
+ * Every row, aggregated from the exported per-type collections only, so a row added anywhere
901
+ * else never reaches MODELS without its collection. Seeded from Cowork, Space Builder and
902
+ * trigger-workflows. See catalog/*.ts.
903
+ */
651
904
  declare const MODELS: CatalogModel[];
652
905
 
653
906
  declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video"];
@@ -675,9 +928,16 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
675
928
  image: "image";
676
929
  video: "video";
677
930
  audio: "audio";
931
+ "sound-effect": "sound-effect";
678
932
  upscale: "upscale";
679
933
  "bg-remove": "bg-remove";
934
+ mask: "mask";
680
935
  "video-tool": "video-tool";
936
+ speech: "speech";
937
+ "voice-change": "voice-change";
938
+ dubbing: "dubbing";
939
+ lipsync: "lipsync";
940
+ transcription: "transcription";
681
941
  }>;
682
942
  adapter: z.ZodEnum<{
683
943
  "ai-sdk-text": "ai-sdk-text";
@@ -740,6 +1000,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
740
1000
  }, z.core.$loose>, z.ZodArray<z.ZodNumber>]>>;
741
1001
  durationPresets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
742
1002
  qualityOptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
1003
+ scaleFactors: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
743
1004
  exactSizes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
744
1005
  references: z.ZodOptional<z.ZodObject<{
745
1006
  images: z.ZodOptional<z.ZodNumber>;
@@ -761,12 +1022,25 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
761
1022
  }, z.core.$loose>>;
762
1023
  audioFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
763
1024
  audioMaxBytes: z.ZodOptional<z.ZodNumber>;
1025
+ min: z.ZodOptional<z.ZodObject<{
1026
+ images: z.ZodOptional<z.ZodNumber>;
1027
+ videos: z.ZodOptional<z.ZodNumber>;
1028
+ audios: z.ZodOptional<z.ZodNumber>;
1029
+ }, z.core.$loose>>;
764
1030
  }, z.core.$loose>>;
765
1031
  requires: z.ZodOptional<z.ZodArray<z.ZodEnum<{
766
1032
  references: "references";
767
1033
  firstFrame: "firstFrame";
768
1034
  sourceVideo: "sourceVideo";
1035
+ sourceAudio: "sourceAudio";
769
1036
  }>>>;
1037
+ requiresOneOf: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1038
+ references: "references";
1039
+ firstFrame: "firstFrame";
1040
+ sourceVideo: "sourceVideo";
1041
+ sourceAudio: "sourceAudio";
1042
+ }>>>;
1043
+ noPrompt: z.ZodOptional<z.ZodBoolean>;
770
1044
  supports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
771
1045
  upscale: "upscale";
772
1046
  quality: "quality";
@@ -776,6 +1050,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
776
1050
  scaleFactor: "scaleFactor";
777
1051
  safetySettings: "safetySettings";
778
1052
  temperature: "temperature";
1053
+ points: "points";
1054
+ boxes: "boxes";
779
1055
  lastFrame: "lastFrame";
780
1056
  generateAudio: "generateAudio";
781
1057
  negativePrompt: "negativePrompt";
@@ -784,13 +1060,34 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
784
1060
  watermark: "watermark";
785
1061
  safetyChecker: "safetyChecker";
786
1062
  taskType: "taskType";
1063
+ insertWindow: "insertWindow";
787
1064
  instrumental: "instrumental";
1065
+ lyrics: "lyrics";
1066
+ style: "style";
788
1067
  videoExtension: "videoExtension";
789
1068
  }>>>;
790
1069
  ratioIgnoredWith: z.ZodOptional<z.ZodArray<z.ZodEnum<{
791
1070
  firstFrame: "firstFrame";
792
1071
  sourceVideo: "sourceVideo";
793
1072
  }>>>;
1073
+ voices: z.ZodOptional<z.ZodArray<z.ZodObject<{
1074
+ id: z.ZodString;
1075
+ name: z.ZodString;
1076
+ gender: z.ZodOptional<z.ZodEnum<{
1077
+ male: "male";
1078
+ female: "female";
1079
+ neutral: "neutral";
1080
+ }>>;
1081
+ accent: z.ZodOptional<z.ZodString>;
1082
+ languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
1083
+ description: z.ZodOptional<z.ZodString>;
1084
+ previewUrl: z.ZodOptional<z.ZodURL>;
1085
+ }, z.core.$loose>>>;
1086
+ languages: z.ZodOptional<z.ZodArray<z.ZodObject<{
1087
+ code: z.ZodString;
1088
+ name: z.ZodString;
1089
+ }, z.core.$loose>>>;
1090
+ outputFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
794
1091
  sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
795
1092
  max: z.ZodOptional<z.ZodNumber>;
796
1093
  min: z.ZodOptional<z.ZodNumber>;
@@ -808,8 +1105,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
808
1105
  tool: z.ZodOptional<z.ZodObject<{
809
1106
  kind: z.ZodEnum<{
810
1107
  upscale: "upscale";
1108
+ "bg-remove": "bg-remove";
811
1109
  interpolate: "interpolate";
812
1110
  hdr: "hdr";
1111
+ subtitles: "subtitles";
813
1112
  }>;
814
1113
  upscaleFactor: z.ZodOptional<z.ZodObject<{
815
1114
  min: z.ZodNumber;
@@ -824,7 +1123,16 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
824
1123
  outputFormats: z.ZodOptional<z.ZodArray<z.ZodEnum<{
825
1124
  h265: "h265";
826
1125
  prores: "prores";
1126
+ exr: "exr";
827
1127
  }>>>;
1128
+ maxOutputShortEdge: z.ZodOptional<z.ZodNumber>;
1129
+ maxOutputFrames: z.ZodOptional<z.ZodNumber>;
1130
+ minOutputFrames: z.ZodOptional<z.ZodNumber>;
1131
+ maxOutputFps: z.ZodOptional<z.ZodNumber>;
1132
+ presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1133
+ languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
1134
+ translationLanguages: z.ZodOptional<z.ZodArray<z.ZodString>>;
1135
+ maxSecondsAbove1080p: z.ZodOptional<z.ZodNumber>;
828
1136
  }, z.core.$loose>>;
829
1137
  audio: z.ZodOptional<z.ZodUnknown>;
830
1138
  prompt: z.ZodOptional<z.ZodUnknown>;
@@ -876,11 +1184,11 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
876
1184
  }>>;
877
1185
  seed: z.ZodOptional<z.ZodNumber>;
878
1186
  count: z.ZodOptional<z.ZodNumber>;
879
- outputFormat: z.ZodOptional<z.ZodEnum<{
1187
+ outputFormat: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
880
1188
  png: "png";
881
1189
  jpeg: "jpeg";
882
1190
  webp: "webp";
883
- }>>;
1191
+ }>, z.ZodString]>>;
884
1192
  scaleFactor: z.ZodOptional<z.ZodNumber>;
885
1193
  safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
886
1194
  category: z.ZodString;
@@ -894,6 +1202,20 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
894
1202
  faceEnhancementCreativity: z.ZodOptional<z.ZodNumber>;
895
1203
  faceEnhancementStrength: z.ZodOptional<z.ZodNumber>;
896
1204
  }, z.core.$loose>>;
1205
+ points: z.ZodOptional<z.ZodArray<z.ZodObject<{
1206
+ x: z.ZodNumber;
1207
+ y: z.ZodNumber;
1208
+ label: z.ZodOptional<z.ZodEnum<{
1209
+ foreground: "foreground";
1210
+ background: "background";
1211
+ }>>;
1212
+ }, z.core.$loose>>>;
1213
+ boxes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1214
+ xMin: z.ZodNumber;
1215
+ yMin: z.ZodNumber;
1216
+ xMax: z.ZodNumber;
1217
+ yMax: z.ZodNumber;
1218
+ }, z.core.$loose>>>;
897
1219
  firstFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
898
1220
  url: z.ZodString;
899
1221
  label: z.ZodOptional<z.ZodString>;
@@ -974,6 +1296,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
974
1296
  }>>;
975
1297
  watermark: z.ZodOptional<z.ZodBoolean>;
976
1298
  safetyChecker: z.ZodOptional<z.ZodBoolean>;
1299
+ insertWindow: z.ZodOptional<z.ZodObject<{
1300
+ startSeconds: z.ZodNumber;
1301
+ resumeSeconds: z.ZodNumber;
1302
+ }, z.core.$loose>>;
977
1303
  taskType: z.ZodOptional<z.ZodEnum<{
978
1304
  reference: "reference";
979
1305
  edit: "edit";
@@ -984,6 +1310,9 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
984
1310
  pro: "pro";
985
1311
  }>>;
986
1312
  instrumental: z.ZodOptional<z.ZodBoolean>;
1313
+ lyrics: z.ZodOptional<z.ZodString>;
1314
+ voice: z.ZodOptional<z.ZodString>;
1315
+ language: z.ZodOptional<z.ZodString>;
987
1316
  }, z.core.$loose>;
988
1317
  providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<ProviderOptionValue, unknown, z.core.$ZodTypeInternals<ProviderOptionValue, unknown>>>>>;
989
1318
  usage: z.ZodObject<{
@@ -1134,6 +1463,93 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
1134
1463
  declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
1135
1464
  declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
1136
1465
 
1466
+ /** `generateSpeech` on a `speech` row. */
1467
+ declare function resolveSpeechOptions(model: CatalogModel, request: SpeechRequest, onUnsupported?: OnUnsupported): ResolveResult<SpeechRequest>;
1468
+ /** `changeVoice` on a `voice-change` row. */
1469
+ declare function resolveVoiceChangeOptions(model: CatalogModel, request: VoiceChangeRequest, onUnsupported?: OnUnsupported): ResolveResult<VoiceChangeRequest>;
1470
+ /** `lipsync` on a `lipsync` row: the face input is the one its `requires` names. */
1471
+ declare function resolveLipsyncOptions(model: CatalogModel, request: LipsyncRequest, onUnsupported?: OnUnsupported): ResolveResult<LipsyncRequest>;
1472
+ /** `dub` on a `dubbing` row: one source, a target language the row lists. */
1473
+ declare function resolveDubbingOptions(model: CatalogModel, request: DubbingRequest, onUnsupported?: OnUnsupported): ResolveResult<DubbingRequest>;
1474
+ /** `transcribe` on a `transcription` row. */
1475
+ declare function resolveTranscriptionOptions(model: CatalogModel, request: TranscriptionRequest, onUnsupported?: OnUnsupported): ResolveResult<TranscriptionRequest>;
1476
+
1477
+ /** The client methods that execute a catalog row (text rows run through the text helpers). */
1478
+ type MediaMethod = "generateImage" | "generateVideo" | "generateAudio" | "generateSpeech" | "changeVoice" | "lipsync" | "dub" | "transcribe" | "submitVideoTool";
1479
+ /** Typed as a full `Record` so a new `ModelType` does not compile until it is routed here. */
1480
+ declare const MEDIA_METHODS: Record<ModelType, readonly MediaMethod[]>;
1481
+ /** A request tagged with the client method it is meant for. */
1482
+ type ResolveCall = {
1483
+ method: "generateImage";
1484
+ request: ImageRequest;
1485
+ } | {
1486
+ method: "generateVideo";
1487
+ request: VideoRequest;
1488
+ } | {
1489
+ method: "generateAudio";
1490
+ request: AudioRequest;
1491
+ } | {
1492
+ method: "generateSpeech";
1493
+ request: SpeechRequest;
1494
+ } | {
1495
+ method: "changeVoice";
1496
+ request: VoiceChangeRequest;
1497
+ } | {
1498
+ method: "lipsync";
1499
+ request: LipsyncRequest;
1500
+ } | {
1501
+ method: "dub";
1502
+ request: DubbingRequest;
1503
+ } | {
1504
+ method: "transcribe";
1505
+ request: TranscriptionRequest;
1506
+ } | {
1507
+ method: "submitVideoTool";
1508
+ request: VideoToolRequest;
1509
+ };
1510
+ type ResolvedCall = {
1511
+ method: "generateImage";
1512
+ request: ImageRequest;
1513
+ warnings: Warning[];
1514
+ } | {
1515
+ method: "generateVideo";
1516
+ request: VideoRequest;
1517
+ warnings: Warning[];
1518
+ } | {
1519
+ method: "generateAudio";
1520
+ request: AudioRequest;
1521
+ warnings: Warning[];
1522
+ } | {
1523
+ method: "generateSpeech";
1524
+ request: SpeechRequest;
1525
+ warnings: Warning[];
1526
+ } | {
1527
+ method: "changeVoice";
1528
+ request: VoiceChangeRequest;
1529
+ warnings: Warning[];
1530
+ } | {
1531
+ method: "lipsync";
1532
+ request: LipsyncRequest;
1533
+ warnings: Warning[];
1534
+ } | {
1535
+ method: "dub";
1536
+ request: DubbingRequest;
1537
+ warnings: Warning[];
1538
+ } | {
1539
+ method: "transcribe";
1540
+ request: TranscriptionRequest;
1541
+ warnings: Warning[];
1542
+ } | {
1543
+ method: "submitVideoTool";
1544
+ request: VideoToolRequest;
1545
+ warnings: Warning[];
1546
+ output: VideoToolOutputSpec;
1547
+ };
1548
+ /** Resolves a request exactly as the client method it names would before calling the provider. */
1549
+ declare function resolveOptions(model: CatalogModel, call: ResolveCall, onUnsupported?: OnUnsupported): ResolvedCall;
1550
+
1551
+ declare const MEDIA_NODE_MODELS: CatalogModel[];
1552
+
1137
1553
  declare const AUDIO_OUTPUTS: ("always" | "optional" | "never")[];
1138
1554
  declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
1139
1555
  declare function outputAudio(row: {
@@ -1180,15 +1596,4 @@ declare class ModelKitError extends Error {
1180
1596
  }
1181
1597
  declare function isModelKitError(err: unknown): err is ModelKitError;
1182
1598
 
1183
- /**
1184
- * Browser-safe catalog subpath (`@shop-os/modelkit/catalog`).
1185
- *
1186
- * Catalog rows, the option resolver and error types only. No adapters, no
1187
- * client, no key handling, no text helpers and no provider SDKs, so the
1188
- * bundle is safe to ship to browsers (Space Builder pickers, vibe-shared).
1189
- */
1190
-
1191
- /** Resolve caller options against a catalog row, dispatching on `model.type`. */
1192
- declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
1193
-
1194
- export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation, videoToolConstraints };
1599
+ export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, sortCatalogRows, videoLengthViolation, videoToolConstraints };