@shop-os/modelkit 0.2.14 → 0.2.16

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.
@@ -22,10 +22,14 @@ type OutputFormat = "png" | "jpeg" | "webp";
22
22
  type MediaRef = {
23
23
  url: string;
24
24
  label?: string;
25
+ /** Measured length of a video/audio; the kit never measures it. */
26
+ durationSeconds?: number;
25
27
  } | {
26
28
  bytes: Uint8Array;
27
29
  mime: string;
28
30
  label?: string;
31
+ /** Measured length of a video/audio; the kit never measures it. */
32
+ durationSeconds?: number;
29
33
  };
30
34
  /** Caller-driven Topaz upscale controls; see the topaz row and TopazImageInput. */
31
35
  interface UpscaleOptions {
@@ -103,8 +107,14 @@ interface VideoRequest {
103
107
  watermark?: boolean;
104
108
  /** Provider-side safety checker toggle (fal MiniMax). Provider default when unset. */
105
109
  safetyChecker?: boolean;
106
- /** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio. */
110
+ /** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio.
111
+ * `extend` on a `videoExtension` row continues the clip by `durationSeconds` more. */
107
112
  taskType?: "reference" | "edit" | "extend";
113
+ /** Continue a provider-side session instead of re-sending the clip (Gemini Omni
114
+ * Interactions `previous_interaction_id`). The prior call's `VideoResult.providerRef`
115
+ * carries it. The provider rejects it together with an explicit video task, so the
116
+ * adapter sends the prompt alone; `taskType: "extend"` still selects the extend path. */
117
+ previousInteractionId?: string;
108
118
  mode?: "standard" | "pro";
109
119
  }
110
120
  /**
@@ -156,7 +166,19 @@ interface MediaPart {
156
166
  cleanup?: () => Promise<void>;
157
167
  }
158
168
  type RequiredInput = "firstFrame" | "sourceVideo" | "references";
159
- type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental";
169
+ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental"
170
+ /** Video rows that extend a clip in fixed segments up to a cumulative cap (see `ModelConstraints.extension`). */
171
+ | "videoExtension";
172
+ interface VideoSecondsLimits {
173
+ /** Minimum length of each reference video, in seconds. */
174
+ min?: number;
175
+ /** Maximum length of each reference video, in seconds. */
176
+ max?: number;
177
+ /** Maximum combined length of the reference videos, in seconds. */
178
+ total?: number;
179
+ /** Higher per-video minimum when `taskType` is `edit` (Seedance 2.5: 4 s). */
180
+ editMin?: number;
181
+ }
160
182
  interface ReferenceLimits {
161
183
  images?: number;
162
184
  /** Lower image cap when a reference video is also sent (Kling V3 Omni: 7 → 4). */
@@ -166,6 +188,8 @@ interface ReferenceLimits {
166
188
  total?: number;
167
189
  /** Provider rejects a request whose only references are audio. */
168
190
  audioOnly?: boolean;
191
+ /** Per-video length caps (min/max each) and combined total for reference videos. */
192
+ videoSeconds?: VideoSecondsLimits;
169
193
  }
170
194
  interface ModelConstraints {
171
195
  aspectRatios?: AspectRatio[];
@@ -189,6 +213,17 @@ interface ModelConstraints {
189
213
  supports?: SupportedOption[];
190
214
  /** Ratio is dropped, with a warning, when one of these inputs is present. */
191
215
  ratioIgnoredWith?: ("firstFrame" | "sourceVideo")[];
216
+ /** Length limits for the source video the row edits or extends. */
217
+ sourceVideoSeconds?: Omit<VideoSecondsLimits, "total"> & {
218
+ /** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
219
+ inReferenceTotal?: boolean;
220
+ };
221
+ /** Video extension (rows with `supports: ["videoExtension"]`): each `taskType: "extend"`
222
+ * call adds up to `segmentSeconds` and the clip can grow to `maxTotalSeconds`. */
223
+ extension?: {
224
+ segmentSeconds: number;
225
+ maxTotalSeconds: number;
226
+ };
192
227
  }
193
228
  /** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
194
229
  type JsonPrimitive = string | number | boolean | null;
@@ -330,6 +365,10 @@ interface VideoResult {
330
365
  };
331
366
  usage: UsageEvent;
332
367
  raw?: unknown;
368
+ /** Provider handle for chaining a follow-up call (`VideoRequest.previousInteractionId`). */
369
+ providerRef?: {
370
+ interactionId: string;
371
+ };
333
372
  }
334
373
  interface VideoCallJob extends VideoJob {
335
374
  warnings: Warning[];
@@ -562,6 +601,12 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
562
601
  audios: z.ZodOptional<z.ZodNumber>;
563
602
  total: z.ZodOptional<z.ZodNumber>;
564
603
  audioOnly: z.ZodOptional<z.ZodBoolean>;
604
+ videoSeconds: z.ZodOptional<z.ZodObject<{
605
+ min: z.ZodOptional<z.ZodNumber>;
606
+ max: z.ZodOptional<z.ZodNumber>;
607
+ total: z.ZodOptional<z.ZodNumber>;
608
+ editMin: z.ZodOptional<z.ZodNumber>;
609
+ }, z.core.$loose>>;
565
610
  }, z.core.$loose>>;
566
611
  requires: z.ZodOptional<z.ZodArray<z.ZodEnum<{
567
612
  references: "references";
@@ -586,20 +631,33 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
586
631
  safetyChecker: "safetyChecker";
587
632
  taskType: "taskType";
588
633
  instrumental: "instrumental";
634
+ videoExtension: "videoExtension";
589
635
  }>>>;
590
636
  ratioIgnoredWith: z.ZodOptional<z.ZodArray<z.ZodEnum<{
591
637
  firstFrame: "firstFrame";
592
638
  sourceVideo: "sourceVideo";
593
639
  }>>>;
640
+ sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
641
+ max: z.ZodOptional<z.ZodNumber>;
642
+ min: z.ZodOptional<z.ZodNumber>;
643
+ editMin: z.ZodOptional<z.ZodNumber>;
644
+ inReferenceTotal: z.ZodOptional<z.ZodBoolean>;
645
+ }, z.core.$loose>>;
646
+ extension: z.ZodOptional<z.ZodObject<{
647
+ segmentSeconds: z.ZodNumber;
648
+ maxTotalSeconds: z.ZodNumber;
649
+ }, z.core.$loose>>;
594
650
  }, z.core.$loose>;
595
651
  defaults: z.ZodObject<{
596
652
  references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
597
653
  url: z.ZodString;
598
654
  label: z.ZodOptional<z.ZodString>;
655
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
599
656
  }, z.core.$loose>, z.ZodObject<{
600
657
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
601
658
  mime: z.ZodString;
602
659
  label: z.ZodOptional<z.ZodString>;
660
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
603
661
  }, z.core.$loose>]>>>;
604
662
  aspectRatio: z.ZodOptional<z.ZodEnum<{
605
663
  "1:1": "1:1";
@@ -654,50 +712,62 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
654
712
  firstFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
655
713
  url: z.ZodString;
656
714
  label: z.ZodOptional<z.ZodString>;
715
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
657
716
  }, z.core.$loose>, z.ZodObject<{
658
717
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
659
718
  mime: z.ZodString;
660
719
  label: z.ZodOptional<z.ZodString>;
720
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
661
721
  }, z.core.$loose>]>>;
662
722
  lastFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
663
723
  url: z.ZodString;
664
724
  label: z.ZodOptional<z.ZodString>;
725
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
665
726
  }, z.core.$loose>, z.ZodObject<{
666
727
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
667
728
  mime: z.ZodString;
668
729
  label: z.ZodOptional<z.ZodString>;
730
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
669
731
  }, z.core.$loose>]>>;
670
732
  sourceVideo: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
671
733
  url: z.ZodString;
672
734
  label: z.ZodOptional<z.ZodString>;
735
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
673
736
  }, z.core.$loose>, z.ZodObject<{
674
737
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
675
738
  mime: z.ZodString;
676
739
  label: z.ZodOptional<z.ZodString>;
740
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
677
741
  }, z.core.$loose>]>>;
678
742
  referenceImages: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
679
743
  url: z.ZodString;
680
744
  label: z.ZodOptional<z.ZodString>;
745
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
681
746
  }, z.core.$loose>, z.ZodObject<{
682
747
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
683
748
  mime: z.ZodString;
684
749
  label: z.ZodOptional<z.ZodString>;
750
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
685
751
  }, z.core.$loose>]>>>;
686
752
  referenceVideos: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
687
753
  url: z.ZodString;
688
754
  label: z.ZodOptional<z.ZodString>;
755
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
689
756
  }, z.core.$loose>, z.ZodObject<{
690
757
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
691
758
  mime: z.ZodString;
692
759
  label: z.ZodOptional<z.ZodString>;
760
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
693
761
  }, z.core.$loose>]>>>;
694
762
  referenceAudios: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
695
763
  url: z.ZodString;
696
764
  label: z.ZodOptional<z.ZodString>;
765
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
697
766
  }, z.core.$loose>, z.ZodObject<{
698
767
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
699
768
  mime: z.ZodString;
700
769
  label: z.ZodOptional<z.ZodString>;
770
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
701
771
  }, z.core.$loose>]>>>;
702
772
  resolution: z.ZodOptional<z.ZodEnum<{
703
773
  "360p": "360p";
@@ -839,6 +909,12 @@ interface ResolveResult<T> {
839
909
  }
840
910
  /** Nearest supported ratio in the same orientation bucket, else nearest overall, by log distance. */
841
911
  declare function nearestAspectRatio(requested: AspectRatio, supported: AspectRatio[]): AspectRatio;
912
+ /** First length violation for the videos a request sends, as a user-facing message. */
913
+ declare function videoLengthViolation(model: CatalogModel, input: {
914
+ referenceVideos?: (number | undefined)[];
915
+ sourceVideo?: number;
916
+ taskType?: VideoRequest["taskType"];
917
+ }): string | undefined;
842
918
  declare function resolveImageOptions(model: CatalogModel, request: ImageRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest>;
843
919
  declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
844
920
  declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
@@ -878,4 +954,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
878
954
  /** Resolve caller options against a catalog row, dispatching on `model.type`. */
879
955
  declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
880
956
 
881
- export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, 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 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 ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, 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, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };
957
+ export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, 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 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 ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, 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, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
package/dist/catalog.d.ts CHANGED
@@ -22,10 +22,14 @@ type OutputFormat = "png" | "jpeg" | "webp";
22
22
  type MediaRef = {
23
23
  url: string;
24
24
  label?: string;
25
+ /** Measured length of a video/audio; the kit never measures it. */
26
+ durationSeconds?: number;
25
27
  } | {
26
28
  bytes: Uint8Array;
27
29
  mime: string;
28
30
  label?: string;
31
+ /** Measured length of a video/audio; the kit never measures it. */
32
+ durationSeconds?: number;
29
33
  };
30
34
  /** Caller-driven Topaz upscale controls; see the topaz row and TopazImageInput. */
31
35
  interface UpscaleOptions {
@@ -103,8 +107,14 @@ interface VideoRequest {
103
107
  watermark?: boolean;
104
108
  /** Provider-side safety checker toggle (fal MiniMax). Provider default when unset. */
105
109
  safetyChecker?: boolean;
106
- /** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio. */
110
+ /** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio.
111
+ * `extend` on a `videoExtension` row continues the clip by `durationSeconds` more. */
107
112
  taskType?: "reference" | "edit" | "extend";
113
+ /** Continue a provider-side session instead of re-sending the clip (Gemini Omni
114
+ * Interactions `previous_interaction_id`). The prior call's `VideoResult.providerRef`
115
+ * carries it. The provider rejects it together with an explicit video task, so the
116
+ * adapter sends the prompt alone; `taskType: "extend"` still selects the extend path. */
117
+ previousInteractionId?: string;
108
118
  mode?: "standard" | "pro";
109
119
  }
110
120
  /**
@@ -156,7 +166,19 @@ interface MediaPart {
156
166
  cleanup?: () => Promise<void>;
157
167
  }
158
168
  type RequiredInput = "firstFrame" | "sourceVideo" | "references";
159
- type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental";
169
+ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental"
170
+ /** Video rows that extend a clip in fixed segments up to a cumulative cap (see `ModelConstraints.extension`). */
171
+ | "videoExtension";
172
+ interface VideoSecondsLimits {
173
+ /** Minimum length of each reference video, in seconds. */
174
+ min?: number;
175
+ /** Maximum length of each reference video, in seconds. */
176
+ max?: number;
177
+ /** Maximum combined length of the reference videos, in seconds. */
178
+ total?: number;
179
+ /** Higher per-video minimum when `taskType` is `edit` (Seedance 2.5: 4 s). */
180
+ editMin?: number;
181
+ }
160
182
  interface ReferenceLimits {
161
183
  images?: number;
162
184
  /** Lower image cap when a reference video is also sent (Kling V3 Omni: 7 → 4). */
@@ -166,6 +188,8 @@ interface ReferenceLimits {
166
188
  total?: number;
167
189
  /** Provider rejects a request whose only references are audio. */
168
190
  audioOnly?: boolean;
191
+ /** Per-video length caps (min/max each) and combined total for reference videos. */
192
+ videoSeconds?: VideoSecondsLimits;
169
193
  }
170
194
  interface ModelConstraints {
171
195
  aspectRatios?: AspectRatio[];
@@ -189,6 +213,17 @@ interface ModelConstraints {
189
213
  supports?: SupportedOption[];
190
214
  /** Ratio is dropped, with a warning, when one of these inputs is present. */
191
215
  ratioIgnoredWith?: ("firstFrame" | "sourceVideo")[];
216
+ /** Length limits for the source video the row edits or extends. */
217
+ sourceVideoSeconds?: Omit<VideoSecondsLimits, "total"> & {
218
+ /** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
219
+ inReferenceTotal?: boolean;
220
+ };
221
+ /** Video extension (rows with `supports: ["videoExtension"]`): each `taskType: "extend"`
222
+ * call adds up to `segmentSeconds` and the clip can grow to `maxTotalSeconds`. */
223
+ extension?: {
224
+ segmentSeconds: number;
225
+ maxTotalSeconds: number;
226
+ };
192
227
  }
193
228
  /** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
194
229
  type JsonPrimitive = string | number | boolean | null;
@@ -330,6 +365,10 @@ interface VideoResult {
330
365
  };
331
366
  usage: UsageEvent;
332
367
  raw?: unknown;
368
+ /** Provider handle for chaining a follow-up call (`VideoRequest.previousInteractionId`). */
369
+ providerRef?: {
370
+ interactionId: string;
371
+ };
333
372
  }
334
373
  interface VideoCallJob extends VideoJob {
335
374
  warnings: Warning[];
@@ -562,6 +601,12 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
562
601
  audios: z.ZodOptional<z.ZodNumber>;
563
602
  total: z.ZodOptional<z.ZodNumber>;
564
603
  audioOnly: z.ZodOptional<z.ZodBoolean>;
604
+ videoSeconds: z.ZodOptional<z.ZodObject<{
605
+ min: z.ZodOptional<z.ZodNumber>;
606
+ max: z.ZodOptional<z.ZodNumber>;
607
+ total: z.ZodOptional<z.ZodNumber>;
608
+ editMin: z.ZodOptional<z.ZodNumber>;
609
+ }, z.core.$loose>>;
565
610
  }, z.core.$loose>>;
566
611
  requires: z.ZodOptional<z.ZodArray<z.ZodEnum<{
567
612
  references: "references";
@@ -586,20 +631,33 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
586
631
  safetyChecker: "safetyChecker";
587
632
  taskType: "taskType";
588
633
  instrumental: "instrumental";
634
+ videoExtension: "videoExtension";
589
635
  }>>>;
590
636
  ratioIgnoredWith: z.ZodOptional<z.ZodArray<z.ZodEnum<{
591
637
  firstFrame: "firstFrame";
592
638
  sourceVideo: "sourceVideo";
593
639
  }>>>;
640
+ sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
641
+ max: z.ZodOptional<z.ZodNumber>;
642
+ min: z.ZodOptional<z.ZodNumber>;
643
+ editMin: z.ZodOptional<z.ZodNumber>;
644
+ inReferenceTotal: z.ZodOptional<z.ZodBoolean>;
645
+ }, z.core.$loose>>;
646
+ extension: z.ZodOptional<z.ZodObject<{
647
+ segmentSeconds: z.ZodNumber;
648
+ maxTotalSeconds: z.ZodNumber;
649
+ }, z.core.$loose>>;
594
650
  }, z.core.$loose>;
595
651
  defaults: z.ZodObject<{
596
652
  references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
597
653
  url: z.ZodString;
598
654
  label: z.ZodOptional<z.ZodString>;
655
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
599
656
  }, z.core.$loose>, z.ZodObject<{
600
657
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
601
658
  mime: z.ZodString;
602
659
  label: z.ZodOptional<z.ZodString>;
660
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
603
661
  }, z.core.$loose>]>>>;
604
662
  aspectRatio: z.ZodOptional<z.ZodEnum<{
605
663
  "1:1": "1:1";
@@ -654,50 +712,62 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
654
712
  firstFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
655
713
  url: z.ZodString;
656
714
  label: z.ZodOptional<z.ZodString>;
715
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
657
716
  }, z.core.$loose>, z.ZodObject<{
658
717
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
659
718
  mime: z.ZodString;
660
719
  label: z.ZodOptional<z.ZodString>;
720
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
661
721
  }, z.core.$loose>]>>;
662
722
  lastFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
663
723
  url: z.ZodString;
664
724
  label: z.ZodOptional<z.ZodString>;
725
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
665
726
  }, z.core.$loose>, z.ZodObject<{
666
727
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
667
728
  mime: z.ZodString;
668
729
  label: z.ZodOptional<z.ZodString>;
730
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
669
731
  }, z.core.$loose>]>>;
670
732
  sourceVideo: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
671
733
  url: z.ZodString;
672
734
  label: z.ZodOptional<z.ZodString>;
735
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
673
736
  }, z.core.$loose>, z.ZodObject<{
674
737
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
675
738
  mime: z.ZodString;
676
739
  label: z.ZodOptional<z.ZodString>;
740
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
677
741
  }, z.core.$loose>]>>;
678
742
  referenceImages: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
679
743
  url: z.ZodString;
680
744
  label: z.ZodOptional<z.ZodString>;
745
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
681
746
  }, z.core.$loose>, z.ZodObject<{
682
747
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
683
748
  mime: z.ZodString;
684
749
  label: z.ZodOptional<z.ZodString>;
750
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
685
751
  }, z.core.$loose>]>>>;
686
752
  referenceVideos: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
687
753
  url: z.ZodString;
688
754
  label: z.ZodOptional<z.ZodString>;
755
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
689
756
  }, z.core.$loose>, z.ZodObject<{
690
757
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
691
758
  mime: z.ZodString;
692
759
  label: z.ZodOptional<z.ZodString>;
760
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
693
761
  }, z.core.$loose>]>>>;
694
762
  referenceAudios: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
695
763
  url: z.ZodString;
696
764
  label: z.ZodOptional<z.ZodString>;
765
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
697
766
  }, z.core.$loose>, z.ZodObject<{
698
767
  bytes: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
699
768
  mime: z.ZodString;
700
769
  label: z.ZodOptional<z.ZodString>;
770
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
701
771
  }, z.core.$loose>]>>>;
702
772
  resolution: z.ZodOptional<z.ZodEnum<{
703
773
  "360p": "360p";
@@ -839,6 +909,12 @@ interface ResolveResult<T> {
839
909
  }
840
910
  /** Nearest supported ratio in the same orientation bucket, else nearest overall, by log distance. */
841
911
  declare function nearestAspectRatio(requested: AspectRatio, supported: AspectRatio[]): AspectRatio;
912
+ /** First length violation for the videos a request sends, as a user-facing message. */
913
+ declare function videoLengthViolation(model: CatalogModel, input: {
914
+ referenceVideos?: (number | undefined)[];
915
+ sourceVideo?: number;
916
+ taskType?: VideoRequest["taskType"];
917
+ }): string | undefined;
842
918
  declare function resolveImageOptions(model: CatalogModel, request: ImageRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest>;
843
919
  declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
844
920
  declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
@@ -878,4 +954,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
878
954
  /** Resolve caller options against a catalog row, dispatching on `model.type`. */
879
955
  declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
880
956
 
881
- export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, 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 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 ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, 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, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };
957
+ export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, 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 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 ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, 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, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };