@shop-os/modelkit 0.18.2 → 0.19.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/index.d.cts CHANGED
@@ -636,10 +636,29 @@ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "gen
636
636
  | "insertWindow"
637
637
  /** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
638
638
  | "points" | "boxes";
639
- /** Smallest frame a provider takes for an input video, in pixels (fal: "Min width: 700px"). */
639
+ /** Frame-size limits a provider puts on an input video, in displayed pixels (after rotation). */
640
640
  interface VideoPixelLimits {
641
+ /** Smallest width (fal: "Min width: 700px"). */
641
642
  minWidth?: number;
642
643
  minHeight?: number;
644
+ /** Fewest pixels per frame, width x height (Seedance 2.0: 407,696). Older kits ignore it. */
645
+ minPixels?: number;
646
+ /** Most pixels per frame, width x height (Seedance 2.0: 8,295,044). Older kits ignore it. */
647
+ maxPixels?: number;
648
+ /** Longest side. Older kits ignore it. */
649
+ maxSide?: number;
650
+ }
651
+ /** Size limits a provider puts on a reference image, in displayed pixels (the same keys). */
652
+ type ImagePixelLimits = VideoPixelLimits;
653
+ /** Width-over-height range a provider takes for an input image (0.4 means 2:5). */
654
+ interface AspectLimits {
655
+ min?: number;
656
+ max?: number;
657
+ }
658
+ /** Frame-rate range a provider takes for an input video, in frames per second. */
659
+ interface VideoFpsLimits {
660
+ min?: number;
661
+ max?: number;
643
662
  }
644
663
  interface VideoSecondsLimits {
645
664
  /** Minimum length of each reference video, in seconds. */
@@ -664,6 +683,14 @@ interface ReferenceLimits {
664
683
  videoSeconds?: VideoSecondsLimits;
665
684
  /** Smallest frame each reference video may have (Kling 4.0: 700 px). Kits before 0.15.0 ignore it. */
666
685
  videoPixels?: VideoPixelLimits;
686
+ /** Frame-rate range for each reference video (Seedance 2.0: 23.8-60). Older kits ignore it. */
687
+ videoFps?: VideoFpsLimits;
688
+ /** Largest reference video file the provider takes, in bytes. Older kits ignore it. */
689
+ videoMaxBytes?: number;
690
+ /** Size limits for each reference image (Seedance 2.5: 90,000 px). Older kits ignore it. */
691
+ imagePixels?: ImagePixelLimits;
692
+ /** Width-over-height range for each reference image. Older kits ignore it. */
693
+ imageAspect?: AspectLimits;
667
694
  /** Per-clip length caps (min/max each) and combined total for reference audio, in seconds. */
668
695
  audioSeconds?: {
669
696
  min?: number;
@@ -1340,6 +1367,25 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1340
1367
  videoPixels: z.ZodOptional<z.ZodObject<{
1341
1368
  minWidth: z.ZodOptional<z.ZodNumber>;
1342
1369
  minHeight: z.ZodOptional<z.ZodNumber>;
1370
+ minPixels: z.ZodOptional<z.ZodNumber>;
1371
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1372
+ maxSide: z.ZodOptional<z.ZodNumber>;
1373
+ }, z.core.$loose>>;
1374
+ videoFps: z.ZodOptional<z.ZodObject<{
1375
+ min: z.ZodOptional<z.ZodNumber>;
1376
+ max: z.ZodOptional<z.ZodNumber>;
1377
+ }, z.core.$loose>>;
1378
+ videoMaxBytes: z.ZodOptional<z.ZodNumber>;
1379
+ imagePixels: z.ZodOptional<z.ZodObject<{
1380
+ minWidth: z.ZodOptional<z.ZodNumber>;
1381
+ minHeight: z.ZodOptional<z.ZodNumber>;
1382
+ minPixels: z.ZodOptional<z.ZodNumber>;
1383
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1384
+ maxSide: z.ZodOptional<z.ZodNumber>;
1385
+ }, z.core.$loose>>;
1386
+ imageAspect: z.ZodOptional<z.ZodObject<{
1387
+ min: z.ZodOptional<z.ZodNumber>;
1388
+ max: z.ZodOptional<z.ZodNumber>;
1343
1389
  }, z.core.$loose>>;
1344
1390
  audioSeconds: z.ZodOptional<z.ZodObject<{
1345
1391
  min: z.ZodOptional<z.ZodNumber>;
@@ -1447,6 +1493,9 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1447
1493
  sourceVideoPixels: z.ZodOptional<z.ZodObject<{
1448
1494
  minWidth: z.ZodOptional<z.ZodNumber>;
1449
1495
  minHeight: z.ZodOptional<z.ZodNumber>;
1496
+ minPixels: z.ZodOptional<z.ZodNumber>;
1497
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1498
+ maxSide: z.ZodOptional<z.ZodNumber>;
1450
1499
  }, z.core.$loose>>;
1451
1500
  sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
1452
1501
  max: z.ZodOptional<z.ZodNumber>;
@@ -2030,6 +2079,64 @@ declare function resolveVoiceCloneOptions(model: CatalogModel, request: VoiceClo
2030
2079
  /** `designVoice` on a `voice-design` row; a count over the row cap is clamped when coercing. */
2031
2080
  declare function resolveVoiceDesignOptions(model: CatalogModel, request: VoiceDesignRequest, onUnsupported?: OnUnsupported): ResolveResult<VoiceDesignRequest>;
2032
2081
 
2082
+ /**
2083
+ * The encode profile a conform plan is made for. Callers key cached conformed copies on it, so a
2084
+ * change to the plan rules or the encode settings gets a new name and never reuses an old copy.
2085
+ */
2086
+ declare const REFERENCE_VIDEO_CONFORM_PROFILE = "model-safe-v1";
2087
+ /** What a caller measured about a reference video. Width and height are as displayed (rotated). */
2088
+ interface ReferenceVideoProbe {
2089
+ width?: number | undefined;
2090
+ height?: number | undefined;
2091
+ fps?: number | undefined;
2092
+ bytes?: number | undefined;
2093
+ }
2094
+ type ReferenceVideoConformReason = "pixels_over" | "pixels_under" | "side_over" | "side_under" | "fps_over" | "fps_under" | "bytes_over";
2095
+ /** The size (displayed, even sides) and frame rate a re-encode must produce. */
2096
+ interface ReferenceVideoConformPlan {
2097
+ width: number;
2098
+ height: number;
2099
+ /** Absent: keep the source's frame rate. */
2100
+ fps?: number;
2101
+ /** The row's file-size cap, when it has one: the encode must stay under it. */
2102
+ maxBytes?: number;
2103
+ reasons: ReferenceVideoConformReason[];
2104
+ }
2105
+ /**
2106
+ * How to re-encode a reference video so `model` takes it, or null when it already fits (or the
2107
+ * row has no limits, or nothing about the video was measured). Sizes are the displayed ones, so a
2108
+ * rotated phone clip keeps its shape: a decoder that applies the rotation scales the rotated
2109
+ * frame. The plan never changes a video's length, so billing on its seconds is unchanged.
2110
+ */
2111
+ declare function referenceVideoConformPlan(model: CatalogModel, probe: ReferenceVideoProbe): ReferenceVideoConformPlan | null;
2112
+ /** What was measured about a reference image, as displayed (EXIF orientation applied). */
2113
+ interface ReferenceImageProbe {
2114
+ width?: number | undefined;
2115
+ height?: number | undefined;
2116
+ }
2117
+ type ReferenceImageConformReason = "pixels_over" | "pixels_under" | "side_over" | "side_under" | "aspect";
2118
+ /**
2119
+ * The image a re-encode must produce: `width` x `height` is the whole frame; `image` is the
2120
+ * picture scaled inside it, centred, the rest padded. They differ only when an aspect rule needed
2121
+ * padding, which keeps the picture unstretched.
2122
+ */
2123
+ interface ReferenceImageConformPlan {
2124
+ width: number;
2125
+ height: number;
2126
+ image: {
2127
+ width: number;
2128
+ height: number;
2129
+ };
2130
+ reasons: ReferenceImageConformReason[];
2131
+ }
2132
+ /**
2133
+ * How to resize a reference image so `model` takes it, or null when it fits (or the row has no
2134
+ * image limits, or its size was not measured). The shape is kept: a frame outside the row's
2135
+ * aspect range is padded to it, then the frame is scaled by pixel count (up when under the
2136
+ * minimum, down when over the maximum), sides rounded up when growing and down when shrinking.
2137
+ */
2138
+ declare function referenceImageConformPlan(model: CatalogModel, probe: ReferenceImageProbe): ReferenceImageConformPlan | null;
2139
+
2033
2140
  /** Which key names an adapter needs. All of them must be set on a tier for that tier to win. */
2034
2141
  declare const ADAPTER_KEYS: Record<AdapterId, ProviderKeyName[]>;
2035
2142
  /** The required names the given non-pro tier is missing. */
@@ -2466,4 +2573,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
2466
2573
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
2467
2574
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
2468
2575
 
2469
- export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type AnimationFrameSize, type AnimationLimits, type ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, type AudioOutput, type AudioRequest, type AudioResult, BYOK_PROVIDERS, type ByokField, type ByokFieldId, type ByokProvider, type ByokProviderId, type ByokSecret, type ByokTestResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeySource, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoPixelLimits, 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 VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, animationTier, arkAdapter, aspectRatioToSize, byokProviderForModel, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, imageOutputFormats, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keyOverrideFor, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, modelsPoweredBy, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, testProviderKey, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
2576
+ export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type AnimationFrameSize, type AnimationLimits, type ArrayInputSpecKey, type AspectLimits, type AspectRatio, type AudioNodeMethods, type AudioOutput, type AudioRequest, type AudioResult, BYOK_PROVIDERS, type ByokField, type ByokFieldId, type ByokProvider, type ByokProviderId, type ByokSecret, type ByokTestResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImagePixelLimits, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeySource, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_VIDEO_CONFORM_PROFILE, type ReferenceImageConformPlan, type ReferenceImageConformReason, type ReferenceImageProbe, type ReferenceLimits, type ReferenceSyntax, type ReferenceVideoConformPlan, type ReferenceVideoConformReason, type ReferenceVideoProbe, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoFpsLimits, type VideoJob, type VideoModel, type VideoPixelLimits, 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 VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, animationTier, arkAdapter, aspectRatioToSize, byokProviderForModel, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, imageOutputFormats, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keyOverrideFor, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, modelsPoweredBy, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, referenceImageConformPlan, referenceVideoConformPlan, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, testProviderKey, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
package/dist/index.d.ts CHANGED
@@ -636,10 +636,29 @@ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "gen
636
636
  | "insertWindow"
637
637
  /** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
638
638
  | "points" | "boxes";
639
- /** Smallest frame a provider takes for an input video, in pixels (fal: "Min width: 700px"). */
639
+ /** Frame-size limits a provider puts on an input video, in displayed pixels (after rotation). */
640
640
  interface VideoPixelLimits {
641
+ /** Smallest width (fal: "Min width: 700px"). */
641
642
  minWidth?: number;
642
643
  minHeight?: number;
644
+ /** Fewest pixels per frame, width x height (Seedance 2.0: 407,696). Older kits ignore it. */
645
+ minPixels?: number;
646
+ /** Most pixels per frame, width x height (Seedance 2.0: 8,295,044). Older kits ignore it. */
647
+ maxPixels?: number;
648
+ /** Longest side. Older kits ignore it. */
649
+ maxSide?: number;
650
+ }
651
+ /** Size limits a provider puts on a reference image, in displayed pixels (the same keys). */
652
+ type ImagePixelLimits = VideoPixelLimits;
653
+ /** Width-over-height range a provider takes for an input image (0.4 means 2:5). */
654
+ interface AspectLimits {
655
+ min?: number;
656
+ max?: number;
657
+ }
658
+ /** Frame-rate range a provider takes for an input video, in frames per second. */
659
+ interface VideoFpsLimits {
660
+ min?: number;
661
+ max?: number;
643
662
  }
644
663
  interface VideoSecondsLimits {
645
664
  /** Minimum length of each reference video, in seconds. */
@@ -664,6 +683,14 @@ interface ReferenceLimits {
664
683
  videoSeconds?: VideoSecondsLimits;
665
684
  /** Smallest frame each reference video may have (Kling 4.0: 700 px). Kits before 0.15.0 ignore it. */
666
685
  videoPixels?: VideoPixelLimits;
686
+ /** Frame-rate range for each reference video (Seedance 2.0: 23.8-60). Older kits ignore it. */
687
+ videoFps?: VideoFpsLimits;
688
+ /** Largest reference video file the provider takes, in bytes. Older kits ignore it. */
689
+ videoMaxBytes?: number;
690
+ /** Size limits for each reference image (Seedance 2.5: 90,000 px). Older kits ignore it. */
691
+ imagePixels?: ImagePixelLimits;
692
+ /** Width-over-height range for each reference image. Older kits ignore it. */
693
+ imageAspect?: AspectLimits;
667
694
  /** Per-clip length caps (min/max each) and combined total for reference audio, in seconds. */
668
695
  audioSeconds?: {
669
696
  min?: number;
@@ -1340,6 +1367,25 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1340
1367
  videoPixels: z.ZodOptional<z.ZodObject<{
1341
1368
  minWidth: z.ZodOptional<z.ZodNumber>;
1342
1369
  minHeight: z.ZodOptional<z.ZodNumber>;
1370
+ minPixels: z.ZodOptional<z.ZodNumber>;
1371
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1372
+ maxSide: z.ZodOptional<z.ZodNumber>;
1373
+ }, z.core.$loose>>;
1374
+ videoFps: z.ZodOptional<z.ZodObject<{
1375
+ min: z.ZodOptional<z.ZodNumber>;
1376
+ max: z.ZodOptional<z.ZodNumber>;
1377
+ }, z.core.$loose>>;
1378
+ videoMaxBytes: z.ZodOptional<z.ZodNumber>;
1379
+ imagePixels: z.ZodOptional<z.ZodObject<{
1380
+ minWidth: z.ZodOptional<z.ZodNumber>;
1381
+ minHeight: z.ZodOptional<z.ZodNumber>;
1382
+ minPixels: z.ZodOptional<z.ZodNumber>;
1383
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1384
+ maxSide: z.ZodOptional<z.ZodNumber>;
1385
+ }, z.core.$loose>>;
1386
+ imageAspect: z.ZodOptional<z.ZodObject<{
1387
+ min: z.ZodOptional<z.ZodNumber>;
1388
+ max: z.ZodOptional<z.ZodNumber>;
1343
1389
  }, z.core.$loose>>;
1344
1390
  audioSeconds: z.ZodOptional<z.ZodObject<{
1345
1391
  min: z.ZodOptional<z.ZodNumber>;
@@ -1447,6 +1493,9 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1447
1493
  sourceVideoPixels: z.ZodOptional<z.ZodObject<{
1448
1494
  minWidth: z.ZodOptional<z.ZodNumber>;
1449
1495
  minHeight: z.ZodOptional<z.ZodNumber>;
1496
+ minPixels: z.ZodOptional<z.ZodNumber>;
1497
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1498
+ maxSide: z.ZodOptional<z.ZodNumber>;
1450
1499
  }, z.core.$loose>>;
1451
1500
  sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
1452
1501
  max: z.ZodOptional<z.ZodNumber>;
@@ -2030,6 +2079,64 @@ declare function resolveVoiceCloneOptions(model: CatalogModel, request: VoiceClo
2030
2079
  /** `designVoice` on a `voice-design` row; a count over the row cap is clamped when coercing. */
2031
2080
  declare function resolveVoiceDesignOptions(model: CatalogModel, request: VoiceDesignRequest, onUnsupported?: OnUnsupported): ResolveResult<VoiceDesignRequest>;
2032
2081
 
2082
+ /**
2083
+ * The encode profile a conform plan is made for. Callers key cached conformed copies on it, so a
2084
+ * change to the plan rules or the encode settings gets a new name and never reuses an old copy.
2085
+ */
2086
+ declare const REFERENCE_VIDEO_CONFORM_PROFILE = "model-safe-v1";
2087
+ /** What a caller measured about a reference video. Width and height are as displayed (rotated). */
2088
+ interface ReferenceVideoProbe {
2089
+ width?: number | undefined;
2090
+ height?: number | undefined;
2091
+ fps?: number | undefined;
2092
+ bytes?: number | undefined;
2093
+ }
2094
+ type ReferenceVideoConformReason = "pixels_over" | "pixels_under" | "side_over" | "side_under" | "fps_over" | "fps_under" | "bytes_over";
2095
+ /** The size (displayed, even sides) and frame rate a re-encode must produce. */
2096
+ interface ReferenceVideoConformPlan {
2097
+ width: number;
2098
+ height: number;
2099
+ /** Absent: keep the source's frame rate. */
2100
+ fps?: number;
2101
+ /** The row's file-size cap, when it has one: the encode must stay under it. */
2102
+ maxBytes?: number;
2103
+ reasons: ReferenceVideoConformReason[];
2104
+ }
2105
+ /**
2106
+ * How to re-encode a reference video so `model` takes it, or null when it already fits (or the
2107
+ * row has no limits, or nothing about the video was measured). Sizes are the displayed ones, so a
2108
+ * rotated phone clip keeps its shape: a decoder that applies the rotation scales the rotated
2109
+ * frame. The plan never changes a video's length, so billing on its seconds is unchanged.
2110
+ */
2111
+ declare function referenceVideoConformPlan(model: CatalogModel, probe: ReferenceVideoProbe): ReferenceVideoConformPlan | null;
2112
+ /** What was measured about a reference image, as displayed (EXIF orientation applied). */
2113
+ interface ReferenceImageProbe {
2114
+ width?: number | undefined;
2115
+ height?: number | undefined;
2116
+ }
2117
+ type ReferenceImageConformReason = "pixels_over" | "pixels_under" | "side_over" | "side_under" | "aspect";
2118
+ /**
2119
+ * The image a re-encode must produce: `width` x `height` is the whole frame; `image` is the
2120
+ * picture scaled inside it, centred, the rest padded. They differ only when an aspect rule needed
2121
+ * padding, which keeps the picture unstretched.
2122
+ */
2123
+ interface ReferenceImageConformPlan {
2124
+ width: number;
2125
+ height: number;
2126
+ image: {
2127
+ width: number;
2128
+ height: number;
2129
+ };
2130
+ reasons: ReferenceImageConformReason[];
2131
+ }
2132
+ /**
2133
+ * How to resize a reference image so `model` takes it, or null when it fits (or the row has no
2134
+ * image limits, or its size was not measured). The shape is kept: a frame outside the row's
2135
+ * aspect range is padded to it, then the frame is scaled by pixel count (up when under the
2136
+ * minimum, down when over the maximum), sides rounded up when growing and down when shrinking.
2137
+ */
2138
+ declare function referenceImageConformPlan(model: CatalogModel, probe: ReferenceImageProbe): ReferenceImageConformPlan | null;
2139
+
2033
2140
  /** Which key names an adapter needs. All of them must be set on a tier for that tier to win. */
2034
2141
  declare const ADAPTER_KEYS: Record<AdapterId, ProviderKeyName[]>;
2035
2142
  /** The required names the given non-pro tier is missing. */
@@ -2466,4 +2573,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
2466
2573
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
2467
2574
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
2468
2575
 
2469
- export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type AnimationFrameSize, type AnimationLimits, type ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, type AudioOutput, type AudioRequest, type AudioResult, BYOK_PROVIDERS, type ByokField, type ByokFieldId, type ByokProvider, type ByokProviderId, type ByokSecret, type ByokTestResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeySource, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoPixelLimits, 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 VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, animationTier, arkAdapter, aspectRatioToSize, byokProviderForModel, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, imageOutputFormats, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keyOverrideFor, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, modelsPoweredBy, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, testProviderKey, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
2576
+ export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type AnimationFrameSize, type AnimationLimits, type ArrayInputSpecKey, type AspectLimits, type AspectRatio, type AudioNodeMethods, type AudioOutput, type AudioRequest, type AudioResult, BYOK_PROVIDERS, type ByokField, type ByokFieldId, type ByokProvider, type ByokProviderId, type ByokSecret, type ByokTestResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImagePixelLimits, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeySource, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_VIDEO_CONFORM_PROFILE, type ReferenceImageConformPlan, type ReferenceImageConformReason, type ReferenceImageProbe, type ReferenceLimits, type ReferenceSyntax, type ReferenceVideoConformPlan, type ReferenceVideoConformReason, type ReferenceVideoProbe, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoFpsLimits, type VideoJob, type VideoModel, type VideoPixelLimits, 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 VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, animationTier, arkAdapter, aspectRatioToSize, byokProviderForModel, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, imageOutputFormats, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keyOverrideFor, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, modelsPoweredBy, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, referenceImageConformPlan, referenceVideoConformPlan, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, testProviderKey, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };