@shop-os/modelkit 0.18.1 → 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.
@@ -633,10 +633,29 @@ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "gen
633
633
  | "insertWindow"
634
634
  /** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
635
635
  | "points" | "boxes";
636
- /** Smallest frame a provider takes for an input video, in pixels (fal: "Min width: 700px"). */
636
+ /** Frame-size limits a provider puts on an input video, in displayed pixels (after rotation). */
637
637
  interface VideoPixelLimits {
638
+ /** Smallest width (fal: "Min width: 700px"). */
638
639
  minWidth?: number;
639
640
  minHeight?: number;
641
+ /** Fewest pixels per frame, width x height (Seedance 2.0: 407,696). Older kits ignore it. */
642
+ minPixels?: number;
643
+ /** Most pixels per frame, width x height (Seedance 2.0: 8,295,044). Older kits ignore it. */
644
+ maxPixels?: number;
645
+ /** Longest side. Older kits ignore it. */
646
+ maxSide?: number;
647
+ }
648
+ /** Size limits a provider puts on a reference image, in displayed pixels (the same keys). */
649
+ type ImagePixelLimits = VideoPixelLimits;
650
+ /** Width-over-height range a provider takes for an input image (0.4 means 2:5). */
651
+ interface AspectLimits {
652
+ min?: number;
653
+ max?: number;
654
+ }
655
+ /** Frame-rate range a provider takes for an input video, in frames per second. */
656
+ interface VideoFpsLimits {
657
+ min?: number;
658
+ max?: number;
640
659
  }
641
660
  interface VideoSecondsLimits {
642
661
  /** Minimum length of each reference video, in seconds. */
@@ -661,6 +680,14 @@ interface ReferenceLimits {
661
680
  videoSeconds?: VideoSecondsLimits;
662
681
  /** Smallest frame each reference video may have (Kling 4.0: 700 px). Kits before 0.15.0 ignore it. */
663
682
  videoPixels?: VideoPixelLimits;
683
+ /** Frame-rate range for each reference video (Seedance 2.0: 23.8-60). Older kits ignore it. */
684
+ videoFps?: VideoFpsLimits;
685
+ /** Largest reference video file the provider takes, in bytes. Older kits ignore it. */
686
+ videoMaxBytes?: number;
687
+ /** Size limits for each reference image (Seedance 2.5: 90,000 px). Older kits ignore it. */
688
+ imagePixels?: ImagePixelLimits;
689
+ /** Width-over-height range for each reference image. Older kits ignore it. */
690
+ imageAspect?: AspectLimits;
664
691
  /** Per-clip length caps (min/max each) and combined total for reference audio, in seconds. */
665
692
  audioSeconds?: {
666
693
  min?: number;
@@ -1306,6 +1333,25 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1306
1333
  videoPixels: z.ZodOptional<z.ZodObject<{
1307
1334
  minWidth: z.ZodOptional<z.ZodNumber>;
1308
1335
  minHeight: z.ZodOptional<z.ZodNumber>;
1336
+ minPixels: z.ZodOptional<z.ZodNumber>;
1337
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1338
+ maxSide: z.ZodOptional<z.ZodNumber>;
1339
+ }, z.core.$loose>>;
1340
+ videoFps: z.ZodOptional<z.ZodObject<{
1341
+ min: z.ZodOptional<z.ZodNumber>;
1342
+ max: z.ZodOptional<z.ZodNumber>;
1343
+ }, z.core.$loose>>;
1344
+ videoMaxBytes: z.ZodOptional<z.ZodNumber>;
1345
+ imagePixels: z.ZodOptional<z.ZodObject<{
1346
+ minWidth: z.ZodOptional<z.ZodNumber>;
1347
+ minHeight: z.ZodOptional<z.ZodNumber>;
1348
+ minPixels: z.ZodOptional<z.ZodNumber>;
1349
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1350
+ maxSide: z.ZodOptional<z.ZodNumber>;
1351
+ }, z.core.$loose>>;
1352
+ imageAspect: z.ZodOptional<z.ZodObject<{
1353
+ min: z.ZodOptional<z.ZodNumber>;
1354
+ max: z.ZodOptional<z.ZodNumber>;
1309
1355
  }, z.core.$loose>>;
1310
1356
  audioSeconds: z.ZodOptional<z.ZodObject<{
1311
1357
  min: z.ZodOptional<z.ZodNumber>;
@@ -1413,6 +1459,9 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1413
1459
  sourceVideoPixels: z.ZodOptional<z.ZodObject<{
1414
1460
  minWidth: z.ZodOptional<z.ZodNumber>;
1415
1461
  minHeight: z.ZodOptional<z.ZodNumber>;
1462
+ minPixels: z.ZodOptional<z.ZodNumber>;
1463
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1464
+ maxSide: z.ZodOptional<z.ZodNumber>;
1416
1465
  }, z.core.$loose>>;
1417
1466
  sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
1418
1467
  max: z.ZodOptional<z.ZodNumber>;
@@ -2051,6 +2100,64 @@ declare function resolveOptions(model: CatalogModel, call: ResolveCall, onUnsupp
2051
2100
 
2052
2101
  declare const MEDIA_NODE_MODELS: CatalogModel[];
2053
2102
 
2103
+ /**
2104
+ * The encode profile a conform plan is made for. Callers key cached conformed copies on it, so a
2105
+ * change to the plan rules or the encode settings gets a new name and never reuses an old copy.
2106
+ */
2107
+ declare const REFERENCE_VIDEO_CONFORM_PROFILE = "model-safe-v1";
2108
+ /** What a caller measured about a reference video. Width and height are as displayed (rotated). */
2109
+ interface ReferenceVideoProbe {
2110
+ width?: number | undefined;
2111
+ height?: number | undefined;
2112
+ fps?: number | undefined;
2113
+ bytes?: number | undefined;
2114
+ }
2115
+ type ReferenceVideoConformReason = "pixels_over" | "pixels_under" | "side_over" | "side_under" | "fps_over" | "fps_under" | "bytes_over";
2116
+ /** The size (displayed, even sides) and frame rate a re-encode must produce. */
2117
+ interface ReferenceVideoConformPlan {
2118
+ width: number;
2119
+ height: number;
2120
+ /** Absent: keep the source's frame rate. */
2121
+ fps?: number;
2122
+ /** The row's file-size cap, when it has one: the encode must stay under it. */
2123
+ maxBytes?: number;
2124
+ reasons: ReferenceVideoConformReason[];
2125
+ }
2126
+ /**
2127
+ * How to re-encode a reference video so `model` takes it, or null when it already fits (or the
2128
+ * row has no limits, or nothing about the video was measured). Sizes are the displayed ones, so a
2129
+ * rotated phone clip keeps its shape: a decoder that applies the rotation scales the rotated
2130
+ * frame. The plan never changes a video's length, so billing on its seconds is unchanged.
2131
+ */
2132
+ declare function referenceVideoConformPlan(model: CatalogModel, probe: ReferenceVideoProbe): ReferenceVideoConformPlan | null;
2133
+ /** What was measured about a reference image, as displayed (EXIF orientation applied). */
2134
+ interface ReferenceImageProbe {
2135
+ width?: number | undefined;
2136
+ height?: number | undefined;
2137
+ }
2138
+ type ReferenceImageConformReason = "pixels_over" | "pixels_under" | "side_over" | "side_under" | "aspect";
2139
+ /**
2140
+ * The image a re-encode must produce: `width` x `height` is the whole frame; `image` is the
2141
+ * picture scaled inside it, centred, the rest padded. They differ only when an aspect rule needed
2142
+ * padding, which keeps the picture unstretched.
2143
+ */
2144
+ interface ReferenceImageConformPlan {
2145
+ width: number;
2146
+ height: number;
2147
+ image: {
2148
+ width: number;
2149
+ height: number;
2150
+ };
2151
+ reasons: ReferenceImageConformReason[];
2152
+ }
2153
+ /**
2154
+ * How to resize a reference image so `model` takes it, or null when it fits (or the row has no
2155
+ * image limits, or its size was not measured). The shape is kept: a frame outside the row's
2156
+ * aspect range is padded to it, then the frame is scaled by pixel count (up when under the
2157
+ * minimum, down when over the maximum), sides rounded up when growing and down when shrinking.
2158
+ */
2159
+ declare function referenceImageConformPlan(model: CatalogModel, probe: ReferenceImageProbe): ReferenceImageConformPlan | null;
2160
+
2054
2161
  declare const AUDIO_OUTPUTS: ("always" | "optional" | "never")[];
2055
2162
  declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
2056
2163
  declare function outputAudio(row: {
@@ -2071,4 +2178,4 @@ declare function promptConventions(row: {
2071
2178
  constraints: unknown;
2072
2179
  }): PromptConventions;
2073
2180
 
2074
- export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AnimationFrameSize, type AnimationLimits, 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 ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeySource, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, 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 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 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, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoSizeViolation, videoToolConstraints };
2181
+ export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AnimationFrameSize, type AnimationLimits, type AspectLimits, 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 ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImagePixelLimits, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeySource, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, 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 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, 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 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 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, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, referenceImageConformPlan, referenceVideoConformPlan, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoSizeViolation, videoToolConstraints };
package/dist/catalog.d.ts CHANGED
@@ -633,10 +633,29 @@ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "gen
633
633
  | "insertWindow"
634
634
  /** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
635
635
  | "points" | "boxes";
636
- /** Smallest frame a provider takes for an input video, in pixels (fal: "Min width: 700px"). */
636
+ /** Frame-size limits a provider puts on an input video, in displayed pixels (after rotation). */
637
637
  interface VideoPixelLimits {
638
+ /** Smallest width (fal: "Min width: 700px"). */
638
639
  minWidth?: number;
639
640
  minHeight?: number;
641
+ /** Fewest pixels per frame, width x height (Seedance 2.0: 407,696). Older kits ignore it. */
642
+ minPixels?: number;
643
+ /** Most pixels per frame, width x height (Seedance 2.0: 8,295,044). Older kits ignore it. */
644
+ maxPixels?: number;
645
+ /** Longest side. Older kits ignore it. */
646
+ maxSide?: number;
647
+ }
648
+ /** Size limits a provider puts on a reference image, in displayed pixels (the same keys). */
649
+ type ImagePixelLimits = VideoPixelLimits;
650
+ /** Width-over-height range a provider takes for an input image (0.4 means 2:5). */
651
+ interface AspectLimits {
652
+ min?: number;
653
+ max?: number;
654
+ }
655
+ /** Frame-rate range a provider takes for an input video, in frames per second. */
656
+ interface VideoFpsLimits {
657
+ min?: number;
658
+ max?: number;
640
659
  }
641
660
  interface VideoSecondsLimits {
642
661
  /** Minimum length of each reference video, in seconds. */
@@ -661,6 +680,14 @@ interface ReferenceLimits {
661
680
  videoSeconds?: VideoSecondsLimits;
662
681
  /** Smallest frame each reference video may have (Kling 4.0: 700 px). Kits before 0.15.0 ignore it. */
663
682
  videoPixels?: VideoPixelLimits;
683
+ /** Frame-rate range for each reference video (Seedance 2.0: 23.8-60). Older kits ignore it. */
684
+ videoFps?: VideoFpsLimits;
685
+ /** Largest reference video file the provider takes, in bytes. Older kits ignore it. */
686
+ videoMaxBytes?: number;
687
+ /** Size limits for each reference image (Seedance 2.5: 90,000 px). Older kits ignore it. */
688
+ imagePixels?: ImagePixelLimits;
689
+ /** Width-over-height range for each reference image. Older kits ignore it. */
690
+ imageAspect?: AspectLimits;
664
691
  /** Per-clip length caps (min/max each) and combined total for reference audio, in seconds. */
665
692
  audioSeconds?: {
666
693
  min?: number;
@@ -1306,6 +1333,25 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1306
1333
  videoPixels: z.ZodOptional<z.ZodObject<{
1307
1334
  minWidth: z.ZodOptional<z.ZodNumber>;
1308
1335
  minHeight: z.ZodOptional<z.ZodNumber>;
1336
+ minPixels: z.ZodOptional<z.ZodNumber>;
1337
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1338
+ maxSide: z.ZodOptional<z.ZodNumber>;
1339
+ }, z.core.$loose>>;
1340
+ videoFps: z.ZodOptional<z.ZodObject<{
1341
+ min: z.ZodOptional<z.ZodNumber>;
1342
+ max: z.ZodOptional<z.ZodNumber>;
1343
+ }, z.core.$loose>>;
1344
+ videoMaxBytes: z.ZodOptional<z.ZodNumber>;
1345
+ imagePixels: z.ZodOptional<z.ZodObject<{
1346
+ minWidth: z.ZodOptional<z.ZodNumber>;
1347
+ minHeight: z.ZodOptional<z.ZodNumber>;
1348
+ minPixels: z.ZodOptional<z.ZodNumber>;
1349
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1350
+ maxSide: z.ZodOptional<z.ZodNumber>;
1351
+ }, z.core.$loose>>;
1352
+ imageAspect: z.ZodOptional<z.ZodObject<{
1353
+ min: z.ZodOptional<z.ZodNumber>;
1354
+ max: z.ZodOptional<z.ZodNumber>;
1309
1355
  }, z.core.$loose>>;
1310
1356
  audioSeconds: z.ZodOptional<z.ZodObject<{
1311
1357
  min: z.ZodOptional<z.ZodNumber>;
@@ -1413,6 +1459,9 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
1413
1459
  sourceVideoPixels: z.ZodOptional<z.ZodObject<{
1414
1460
  minWidth: z.ZodOptional<z.ZodNumber>;
1415
1461
  minHeight: z.ZodOptional<z.ZodNumber>;
1462
+ minPixels: z.ZodOptional<z.ZodNumber>;
1463
+ maxPixels: z.ZodOptional<z.ZodNumber>;
1464
+ maxSide: z.ZodOptional<z.ZodNumber>;
1416
1465
  }, z.core.$loose>>;
1417
1466
  sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
1418
1467
  max: z.ZodOptional<z.ZodNumber>;
@@ -2051,6 +2100,64 @@ declare function resolveOptions(model: CatalogModel, call: ResolveCall, onUnsupp
2051
2100
 
2052
2101
  declare const MEDIA_NODE_MODELS: CatalogModel[];
2053
2102
 
2103
+ /**
2104
+ * The encode profile a conform plan is made for. Callers key cached conformed copies on it, so a
2105
+ * change to the plan rules or the encode settings gets a new name and never reuses an old copy.
2106
+ */
2107
+ declare const REFERENCE_VIDEO_CONFORM_PROFILE = "model-safe-v1";
2108
+ /** What a caller measured about a reference video. Width and height are as displayed (rotated). */
2109
+ interface ReferenceVideoProbe {
2110
+ width?: number | undefined;
2111
+ height?: number | undefined;
2112
+ fps?: number | undefined;
2113
+ bytes?: number | undefined;
2114
+ }
2115
+ type ReferenceVideoConformReason = "pixels_over" | "pixels_under" | "side_over" | "side_under" | "fps_over" | "fps_under" | "bytes_over";
2116
+ /** The size (displayed, even sides) and frame rate a re-encode must produce. */
2117
+ interface ReferenceVideoConformPlan {
2118
+ width: number;
2119
+ height: number;
2120
+ /** Absent: keep the source's frame rate. */
2121
+ fps?: number;
2122
+ /** The row's file-size cap, when it has one: the encode must stay under it. */
2123
+ maxBytes?: number;
2124
+ reasons: ReferenceVideoConformReason[];
2125
+ }
2126
+ /**
2127
+ * How to re-encode a reference video so `model` takes it, or null when it already fits (or the
2128
+ * row has no limits, or nothing about the video was measured). Sizes are the displayed ones, so a
2129
+ * rotated phone clip keeps its shape: a decoder that applies the rotation scales the rotated
2130
+ * frame. The plan never changes a video's length, so billing on its seconds is unchanged.
2131
+ */
2132
+ declare function referenceVideoConformPlan(model: CatalogModel, probe: ReferenceVideoProbe): ReferenceVideoConformPlan | null;
2133
+ /** What was measured about a reference image, as displayed (EXIF orientation applied). */
2134
+ interface ReferenceImageProbe {
2135
+ width?: number | undefined;
2136
+ height?: number | undefined;
2137
+ }
2138
+ type ReferenceImageConformReason = "pixels_over" | "pixels_under" | "side_over" | "side_under" | "aspect";
2139
+ /**
2140
+ * The image a re-encode must produce: `width` x `height` is the whole frame; `image` is the
2141
+ * picture scaled inside it, centred, the rest padded. They differ only when an aspect rule needed
2142
+ * padding, which keeps the picture unstretched.
2143
+ */
2144
+ interface ReferenceImageConformPlan {
2145
+ width: number;
2146
+ height: number;
2147
+ image: {
2148
+ width: number;
2149
+ height: number;
2150
+ };
2151
+ reasons: ReferenceImageConformReason[];
2152
+ }
2153
+ /**
2154
+ * How to resize a reference image so `model` takes it, or null when it fits (or the row has no
2155
+ * image limits, or its size was not measured). The shape is kept: a frame outside the row's
2156
+ * aspect range is padded to it, then the frame is scaled by pixel count (up when under the
2157
+ * minimum, down when over the maximum), sides rounded up when growing and down when shrinking.
2158
+ */
2159
+ declare function referenceImageConformPlan(model: CatalogModel, probe: ReferenceImageProbe): ReferenceImageConformPlan | null;
2160
+
2054
2161
  declare const AUDIO_OUTPUTS: ("always" | "optional" | "never")[];
2055
2162
  declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
2056
2163
  declare function outputAudio(row: {
@@ -2071,4 +2178,4 @@ declare function promptConventions(row: {
2071
2178
  constraints: unknown;
2072
2179
  }): PromptConventions;
2073
2180
 
2074
- export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AnimationFrameSize, type AnimationLimits, 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 ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeySource, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, 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 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 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, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoSizeViolation, videoToolConstraints };
2181
+ export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AnimationFrameSize, type AnimationLimits, type AspectLimits, 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 ImageAnimation, type ImageBackground, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImagePixelLimits, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeySource, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, 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 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, 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 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 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, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, referenceImageConformPlan, referenceVideoConformPlan, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoSizeViolation, videoToolConstraints };