@shop-os/modelkit 0.7.0 → 0.7.2

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
@@ -1769,6 +1769,15 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
1769
1769
  declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
1770
1770
  declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
1771
1771
 
1772
+ /**
1773
+ * A row whose aspect ratio is the frame it renders its source into (Ray 3.2 Reframe): it
1774
+ * requires a source video and lists ratios without "adaptive", so the ratio is a target. Every
1775
+ * other edit row keeps the source's framing.
1776
+ */
1777
+ declare function takesTargetAspectRatio(model: Pick<CatalogModel, "constraints">): boolean;
1778
+ /** Whether a Luma reframe asks for a vertical target at 1080p, which Luma does not render. */
1779
+ declare function lumaReframeTooTall(req: Pick<VideoRequest, "aspectRatio" | "resolution">): boolean;
1780
+
1772
1781
  /** `generateSpeech` on a `speech` row. */
1773
1782
  declare function resolveSpeechOptions(model: CatalogModel, request: SpeechRequest, onUnsupported?: OnUnsupported): ResolveResult<SpeechRequest>;
1774
1783
  /** `changeVoice` on a `voice-change` row. */
@@ -2142,4 +2151,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
2142
2151
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
2143
2152
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
2144
2153
 
2145
- 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 ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, 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 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 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 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 VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
2154
+ 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 ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, 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 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 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 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 VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
package/dist/index.d.ts CHANGED
@@ -1769,6 +1769,15 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
1769
1769
  declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
1770
1770
  declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
1771
1771
 
1772
+ /**
1773
+ * A row whose aspect ratio is the frame it renders its source into (Ray 3.2 Reframe): it
1774
+ * requires a source video and lists ratios without "adaptive", so the ratio is a target. Every
1775
+ * other edit row keeps the source's framing.
1776
+ */
1777
+ declare function takesTargetAspectRatio(model: Pick<CatalogModel, "constraints">): boolean;
1778
+ /** Whether a Luma reframe asks for a vertical target at 1080p, which Luma does not render. */
1779
+ declare function lumaReframeTooTall(req: Pick<VideoRequest, "aspectRatio" | "resolution">): boolean;
1780
+
1772
1781
  /** `generateSpeech` on a `speech` row. */
1773
1782
  declare function resolveSpeechOptions(model: CatalogModel, request: SpeechRequest, onUnsupported?: OnUnsupported): ResolveResult<SpeechRequest>;
1774
1783
  /** `changeVoice` on a `voice-change` row. */
@@ -2142,4 +2151,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
2142
2151
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
2143
2152
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
2144
2153
 
2145
- 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 ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, 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 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 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 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 VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
2154
+ 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 ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, 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 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 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 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 VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
package/dist/index.js CHANGED
@@ -6137,14 +6137,17 @@ var VIDEO_TOOL_MODELS = [
6137
6137
  {
6138
6138
  // https://fal.ai/models/fal-ai/flashvsr/upscale/video/api: upscale_factor 1-4, X264 MP4
6139
6139
  // by default; fal bills $0.0005 per output megapixel-frame (width x height x frames).
6140
+ // Retired (ENG-3314): the price rows tier by short edge, which under-prices square, wide
6141
+ // and above-4k outputs.
6140
6142
  id: "flashvsr",
6141
6143
  aliases: ["flashvsr-upscale"],
6142
6144
  label: "FlashVSR",
6143
6145
  type: "video-tool",
6144
6146
  adapter: "fal",
6145
6147
  providerModelId: "fal-ai/flashvsr/upscale/video",
6146
- lifecycle: "active",
6147
- exposure: ["cowork", "space_builder"],
6148
+ lifecycle: "retired",
6149
+ replacedBy: "flux-video-upscale-precise",
6150
+ exposure: [],
6148
6151
  constraints: {
6149
6152
  supports: [],
6150
6153
  tool: { kind: "upscale", upscaleFactor: { min: 1, max: 4 } }
@@ -6347,6 +6350,57 @@ function applyXaiVideoRules(model, req, onUnsupported, warnings) {
6347
6350
  });
6348
6351
  req.resolution = XAI_REFERENCE_MAX_RESOLUTION;
6349
6352
  }
6353
+ function takesTargetAspectRatio(model) {
6354
+ const ratios = model.constraints.aspectRatios ?? [];
6355
+ return (model.constraints.requires ?? []).includes("sourceVideo") && ratios.length > 0 && !ratios.includes("adaptive");
6356
+ }
6357
+ var LUMA_REFRAME_VERTICAL_MAX_RESOLUTION = "720p";
6358
+ function lumaReframeTooTall(req) {
6359
+ const vertical = req.aspectRatio === "9:16" || req.aspectRatio === "3:4";
6360
+ return vertical && req.resolution === "1080p";
6361
+ }
6362
+ function applyLumaVideoRules(model, req, onUnsupported, warnings) {
6363
+ if (model.adapter !== "luma" || !takesTargetAspectRatio(model)) return;
6364
+ if (req.aspectRatio === void 0 || req.aspectRatio === "adaptive") {
6365
+ const listed2 = model.constraints.aspectRatios ?? [];
6366
+ const fallback = model.defaults.aspectRatio !== void 0 && model.defaults.aspectRatio !== "adaptive" ? model.defaults.aspectRatio : listed2[0];
6367
+ const message2 = `${model.id} needs a target aspect ratio: ${listed2.join(", ")}`;
6368
+ if (onUnsupported === "error" || fallback === void 0) {
6369
+ throw new ModelKitError({
6370
+ code: "unsupported_option",
6371
+ message: message2,
6372
+ model: model.id,
6373
+ retryable: false
6374
+ });
6375
+ }
6376
+ warnings.push({
6377
+ code: "ratio_coerced",
6378
+ field: "aspectRatio",
6379
+ from: req.aspectRatio ?? "adaptive",
6380
+ to: fallback,
6381
+ message: message2
6382
+ });
6383
+ req.aspectRatio = fallback;
6384
+ }
6385
+ if (!lumaReframeTooTall(req)) return;
6386
+ const message = `${model.id} renders 9:16 and 3:4 reframes at up to ${LUMA_REFRAME_VERTICAL_MAX_RESOLUTION}`;
6387
+ if (onUnsupported === "error") {
6388
+ throw new ModelKitError({
6389
+ code: "unsupported_option",
6390
+ message,
6391
+ model: model.id,
6392
+ retryable: false
6393
+ });
6394
+ }
6395
+ warnings.push({
6396
+ code: "resolution_coerced",
6397
+ field: "resolution",
6398
+ from: req.resolution,
6399
+ to: LUMA_REFRAME_VERTICAL_MAX_RESOLUTION,
6400
+ message
6401
+ });
6402
+ req.resolution = LUMA_REFRAME_VERTICAL_MAX_RESOLUTION;
6403
+ }
6350
6404
  var MINIMAX_H3_INSERT = "minimax/h3-max/insert-video";
6351
6405
  var INSERT_MIN = 1.625;
6352
6406
  var INSERT_MAX = 60;
@@ -13777,16 +13831,12 @@ function lumaVideoMode(ctx) {
13777
13831
  }
13778
13832
  return mode;
13779
13833
  }
13780
- function reframeTooTall(req) {
13781
- const vertical = req.aspectRatio === "9:16" || req.aspectRatio === "3:4";
13782
- return vertical && req.resolution === "1080p";
13783
- }
13784
13834
  function sentResolution(req, mode) {
13785
- return mode === "reframe" && reframeTooTall(req) ? "720p" : req.resolution;
13835
+ return mode === "reframe" && lumaReframeTooTall(req) ? "720p" : req.resolution;
13786
13836
  }
13787
13837
  function lumaReframeResolution(req, ctx) {
13788
13838
  const requested = req.resolution;
13789
- if (requested === void 0 || !reframeTooTall(req)) return requested;
13839
+ if (requested === void 0 || !lumaReframeTooTall(req)) return requested;
13790
13840
  const message = `${ctx.model.id} renders 9:16 and 3:4 reframes at up to 720p`;
13791
13841
  if ((ctx.call.onUnsupported ?? "error") === "error") {
13792
13842
  throw new ModelKitError({
@@ -16516,6 +16566,7 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
16516
16566
  delete merged.previousInteractionId;
16517
16567
  }
16518
16568
  applyXaiVideoRules(model, merged, onUnsupported, warnings);
16569
+ applyLumaVideoRules(model, merged, onUnsupported, warnings);
16519
16570
  checkVideoRequired(model, merged);
16520
16571
  applyFalVideoRules(model, merged, request.aspectRatio, warnings);
16521
16572
  return { request: merged, warnings };
@@ -18120,6 +18171,7 @@ export {
18120
18171
  liveCatalog,
18121
18172
  liveState,
18122
18173
  lumaAdapter,
18174
+ lumaReframeTooTall,
18123
18175
  mergeTextProviderOptions,
18124
18176
  missingTierKeys,
18125
18177
  model3dCall,
@@ -18157,6 +18209,7 @@ export {
18157
18209
  sortCatalogRows,
18158
18210
  streamObject,
18159
18211
  streamText,
18212
+ takesTargetAspectRatio,
18160
18213
  textUsageEvent,
18161
18214
  toGeneratedImage,
18162
18215
  validateInputSpec,