@shop-os/modelkit 0.14.0 → 0.15.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/CHANGELOG.md +9 -0
- package/dist/catalog.cjs +34 -1
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +31 -1
- package/dist/catalog.d.ts +31 -1
- package/dist/catalog.js +34 -1
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +35 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +34 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -601,6 +601,11 @@ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "gen
|
|
|
601
601
|
| "insertWindow"
|
|
602
602
|
/** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
|
|
603
603
|
| "points" | "boxes";
|
|
604
|
+
/** Smallest frame a provider takes for an input video, in pixels (fal: "Min width: 700px"). */
|
|
605
|
+
interface VideoPixelLimits {
|
|
606
|
+
minWidth?: number;
|
|
607
|
+
minHeight?: number;
|
|
608
|
+
}
|
|
604
609
|
interface VideoSecondsLimits {
|
|
605
610
|
/** Minimum length of each reference video, in seconds. */
|
|
606
611
|
min?: number;
|
|
@@ -622,6 +627,8 @@ interface ReferenceLimits {
|
|
|
622
627
|
audioOnly?: boolean;
|
|
623
628
|
/** Per-video length caps (min/max each) and combined total for reference videos. */
|
|
624
629
|
videoSeconds?: VideoSecondsLimits;
|
|
630
|
+
/** Smallest frame each reference video may have (Kling 4.0: 700 px). Kits before 0.15.0 ignore it. */
|
|
631
|
+
videoPixels?: VideoPixelLimits;
|
|
625
632
|
/** Per-clip length caps (min/max each) and combined total for reference audio, in seconds. */
|
|
626
633
|
audioSeconds?: {
|
|
627
634
|
min?: number;
|
|
@@ -751,6 +758,8 @@ interface ModelConstraints {
|
|
|
751
758
|
languages?: LanguageOption[];
|
|
752
759
|
/** Audio-output rows whose provider lets the caller pick a file format; `defaults.outputFormat` is one. */
|
|
753
760
|
outputFormats?: string[];
|
|
761
|
+
/** Smallest frame the source video may have (Kling 4.0 Edit: 700 px). Kits before 0.15.0 ignore it. */
|
|
762
|
+
sourceVideoPixels?: VideoPixelLimits;
|
|
754
763
|
/** Length limits for the source video the row edits or extends. */
|
|
755
764
|
sourceVideoSeconds?: Omit<VideoSecondsLimits, "total"> & {
|
|
756
765
|
/** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
|
|
@@ -1253,6 +1262,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1253
1262
|
total: z.ZodOptional<z.ZodNumber>;
|
|
1254
1263
|
editMin: z.ZodOptional<z.ZodNumber>;
|
|
1255
1264
|
}, z.core.$loose>>;
|
|
1265
|
+
videoPixels: z.ZodOptional<z.ZodObject<{
|
|
1266
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
1267
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1268
|
+
}, z.core.$loose>>;
|
|
1256
1269
|
audioSeconds: z.ZodOptional<z.ZodObject<{
|
|
1257
1270
|
min: z.ZodOptional<z.ZodNumber>;
|
|
1258
1271
|
max: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1330,6 +1343,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1330
1343
|
name: z.ZodString;
|
|
1331
1344
|
}, z.core.$loose>>>;
|
|
1332
1345
|
outputFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1346
|
+
sourceVideoPixels: z.ZodOptional<z.ZodObject<{
|
|
1347
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
1348
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1349
|
+
}, z.core.$loose>>;
|
|
1333
1350
|
sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
|
|
1334
1351
|
max: z.ZodOptional<z.ZodNumber>;
|
|
1335
1352
|
min: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1858,6 +1875,19 @@ declare function videoLengthViolation(model: CatalogModel, input: {
|
|
|
1858
1875
|
sourceVideo?: number;
|
|
1859
1876
|
taskType?: VideoRequest["taskType"];
|
|
1860
1877
|
}): string | undefined;
|
|
1878
|
+
type MeasuredFrame = {
|
|
1879
|
+
width?: number;
|
|
1880
|
+
height?: number;
|
|
1881
|
+
} | undefined;
|
|
1882
|
+
/**
|
|
1883
|
+
* First frame-size violation for the videos a request sends, as a user-facing message, from
|
|
1884
|
+
* their measured pixel sizes (`references.videoPixels`, `sourceVideoPixels`). An unmeasured
|
|
1885
|
+
* video passes: the provider still has the last word.
|
|
1886
|
+
*/
|
|
1887
|
+
declare function videoSizeViolation(model: CatalogModel, input: {
|
|
1888
|
+
referenceVideos?: MeasuredFrame[];
|
|
1889
|
+
sourceVideo?: MeasuredFrame;
|
|
1890
|
+
}): string | undefined;
|
|
1861
1891
|
declare function resolveImageOptions(model: CatalogModel, request: ImageRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest>;
|
|
1862
1892
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
1863
1893
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
@@ -2263,4 +2293,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
|
|
|
2263
2293
|
/** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
|
|
2264
2294
|
declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
|
|
2265
2295
|
|
|
2266
|
-
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 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, arkAdapter, aspectRatioToSize, 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, 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, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|
|
2296
|
+
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 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, arkAdapter, aspectRatioToSize, 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, 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, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -601,6 +601,11 @@ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "gen
|
|
|
601
601
|
| "insertWindow"
|
|
602
602
|
/** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
|
|
603
603
|
| "points" | "boxes";
|
|
604
|
+
/** Smallest frame a provider takes for an input video, in pixels (fal: "Min width: 700px"). */
|
|
605
|
+
interface VideoPixelLimits {
|
|
606
|
+
minWidth?: number;
|
|
607
|
+
minHeight?: number;
|
|
608
|
+
}
|
|
604
609
|
interface VideoSecondsLimits {
|
|
605
610
|
/** Minimum length of each reference video, in seconds. */
|
|
606
611
|
min?: number;
|
|
@@ -622,6 +627,8 @@ interface ReferenceLimits {
|
|
|
622
627
|
audioOnly?: boolean;
|
|
623
628
|
/** Per-video length caps (min/max each) and combined total for reference videos. */
|
|
624
629
|
videoSeconds?: VideoSecondsLimits;
|
|
630
|
+
/** Smallest frame each reference video may have (Kling 4.0: 700 px). Kits before 0.15.0 ignore it. */
|
|
631
|
+
videoPixels?: VideoPixelLimits;
|
|
625
632
|
/** Per-clip length caps (min/max each) and combined total for reference audio, in seconds. */
|
|
626
633
|
audioSeconds?: {
|
|
627
634
|
min?: number;
|
|
@@ -751,6 +758,8 @@ interface ModelConstraints {
|
|
|
751
758
|
languages?: LanguageOption[];
|
|
752
759
|
/** Audio-output rows whose provider lets the caller pick a file format; `defaults.outputFormat` is one. */
|
|
753
760
|
outputFormats?: string[];
|
|
761
|
+
/** Smallest frame the source video may have (Kling 4.0 Edit: 700 px). Kits before 0.15.0 ignore it. */
|
|
762
|
+
sourceVideoPixels?: VideoPixelLimits;
|
|
754
763
|
/** Length limits for the source video the row edits or extends. */
|
|
755
764
|
sourceVideoSeconds?: Omit<VideoSecondsLimits, "total"> & {
|
|
756
765
|
/** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
|
|
@@ -1253,6 +1262,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1253
1262
|
total: z.ZodOptional<z.ZodNumber>;
|
|
1254
1263
|
editMin: z.ZodOptional<z.ZodNumber>;
|
|
1255
1264
|
}, z.core.$loose>>;
|
|
1265
|
+
videoPixels: z.ZodOptional<z.ZodObject<{
|
|
1266
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
1267
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1268
|
+
}, z.core.$loose>>;
|
|
1256
1269
|
audioSeconds: z.ZodOptional<z.ZodObject<{
|
|
1257
1270
|
min: z.ZodOptional<z.ZodNumber>;
|
|
1258
1271
|
max: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1330,6 +1343,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1330
1343
|
name: z.ZodString;
|
|
1331
1344
|
}, z.core.$loose>>>;
|
|
1332
1345
|
outputFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1346
|
+
sourceVideoPixels: z.ZodOptional<z.ZodObject<{
|
|
1347
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
1348
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1349
|
+
}, z.core.$loose>>;
|
|
1333
1350
|
sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
|
|
1334
1351
|
max: z.ZodOptional<z.ZodNumber>;
|
|
1335
1352
|
min: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1858,6 +1875,19 @@ declare function videoLengthViolation(model: CatalogModel, input: {
|
|
|
1858
1875
|
sourceVideo?: number;
|
|
1859
1876
|
taskType?: VideoRequest["taskType"];
|
|
1860
1877
|
}): string | undefined;
|
|
1878
|
+
type MeasuredFrame = {
|
|
1879
|
+
width?: number;
|
|
1880
|
+
height?: number;
|
|
1881
|
+
} | undefined;
|
|
1882
|
+
/**
|
|
1883
|
+
* First frame-size violation for the videos a request sends, as a user-facing message, from
|
|
1884
|
+
* their measured pixel sizes (`references.videoPixels`, `sourceVideoPixels`). An unmeasured
|
|
1885
|
+
* video passes: the provider still has the last word.
|
|
1886
|
+
*/
|
|
1887
|
+
declare function videoSizeViolation(model: CatalogModel, input: {
|
|
1888
|
+
referenceVideos?: MeasuredFrame[];
|
|
1889
|
+
sourceVideo?: MeasuredFrame;
|
|
1890
|
+
}): string | undefined;
|
|
1861
1891
|
declare function resolveImageOptions(model: CatalogModel, request: ImageRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest>;
|
|
1862
1892
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
1863
1893
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
@@ -2263,4 +2293,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
|
|
|
2263
2293
|
/** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
|
|
2264
2294
|
declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
|
|
2265
2295
|
|
|
2266
|
-
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 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, arkAdapter, aspectRatioToSize, 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, 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, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|
|
2296
|
+
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 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, arkAdapter, aspectRatioToSize, 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, 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, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|
package/dist/index.js
CHANGED
|
@@ -5093,6 +5093,7 @@ function klingMotionControl(tier) {
|
|
|
5093
5093
|
videos: 1,
|
|
5094
5094
|
audios: 0,
|
|
5095
5095
|
videoSeconds: { min: 3, max: 30.05 },
|
|
5096
|
+
videoPixels: { minWidth: 340, minHeight: 340 },
|
|
5096
5097
|
min: { images: 1, videos: 1 }
|
|
5097
5098
|
},
|
|
5098
5099
|
requires: ["references"],
|
|
@@ -5159,6 +5160,7 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
5159
5160
|
references: { ...NO_REFERENCES, images: 4 },
|
|
5160
5161
|
requires: ["sourceVideo"],
|
|
5161
5162
|
sourceVideoSeconds: { min: 3, max: 15.05 },
|
|
5163
|
+
sourceVideoPixels: { minWidth: 720, minHeight: 720 },
|
|
5162
5164
|
// generateAudio keeps (true) or drops (false) the source soundtrack.
|
|
5163
5165
|
supports: ["generateAudio"],
|
|
5164
5166
|
prompt: KLING_PROMPT,
|
|
@@ -5199,7 +5201,8 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
5199
5201
|
...NO_REFERENCES,
|
|
5200
5202
|
images: 10,
|
|
5201
5203
|
videos: 5,
|
|
5202
|
-
videoSeconds: { min: 3, max: 30.05, total: 30 }
|
|
5204
|
+
videoSeconds: { min: 3, max: 30.05, total: 30 },
|
|
5205
|
+
videoPixels: { minWidth: 700, minHeight: 700 }
|
|
5203
5206
|
},
|
|
5204
5207
|
supports: ["lastFrame"],
|
|
5205
5208
|
prompt: KLING_V4_PROMPT,
|
|
@@ -5233,6 +5236,7 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
5233
5236
|
references: { ...NO_REFERENCES, images: 10 },
|
|
5234
5237
|
requires: ["sourceVideo"],
|
|
5235
5238
|
sourceVideoSeconds: { min: 3, max: 30.05 },
|
|
5239
|
+
sourceVideoPixels: { minWidth: 700, minHeight: 700 },
|
|
5236
5240
|
supports: [],
|
|
5237
5241
|
prompt: KLING_V4_PROMPT,
|
|
5238
5242
|
audio: KLING_V4_AUDIO
|
|
@@ -7777,6 +7781,10 @@ var VideoSecondsLimitsSchema = z3.looseObject({
|
|
|
7777
7781
|
total: z3.number().optional(),
|
|
7778
7782
|
editMin: z3.number().optional()
|
|
7779
7783
|
});
|
|
7784
|
+
var VideoPixelLimitsSchema = z3.looseObject({
|
|
7785
|
+
minWidth: z3.number().int().positive().optional(),
|
|
7786
|
+
minHeight: z3.number().int().positive().optional()
|
|
7787
|
+
});
|
|
7780
7788
|
var ReferenceLimitsSchema = z3.looseObject({
|
|
7781
7789
|
images: z3.number().optional(),
|
|
7782
7790
|
imagesWithVideo: z3.number().optional(),
|
|
@@ -7785,6 +7793,7 @@ var ReferenceLimitsSchema = z3.looseObject({
|
|
|
7785
7793
|
total: z3.number().optional(),
|
|
7786
7794
|
audioOnly: z3.boolean().optional(),
|
|
7787
7795
|
videoSeconds: VideoSecondsLimitsSchema.optional(),
|
|
7796
|
+
videoPixels: VideoPixelLimitsSchema.optional(),
|
|
7788
7797
|
audioSeconds: z3.looseObject({
|
|
7789
7798
|
min: z3.number().optional(),
|
|
7790
7799
|
max: z3.number().optional(),
|
|
@@ -7874,6 +7883,7 @@ var ModelConstraintsSchema = z3.looseObject({
|
|
|
7874
7883
|
}).optional(),
|
|
7875
7884
|
languages: z3.array(LanguageOptionSchema).optional(),
|
|
7876
7885
|
outputFormats: z3.array(z3.string().min(1)).min(1).optional(),
|
|
7886
|
+
sourceVideoPixels: VideoPixelLimitsSchema.optional(),
|
|
7877
7887
|
sourceVideoSeconds: VideoSecondsLimitsSchema.omit({ total: true }).extend({ inReferenceTotal: z3.boolean().optional() }).optional(),
|
|
7878
7888
|
// segmentSeconds/maxTotalSeconds stay required: a kit before 0.3.0 drops a row whose
|
|
7879
7889
|
// extension lacks them, so every extension block keeps them.
|
|
@@ -17616,6 +17626,28 @@ function videoLengthViolation(model, input) {
|
|
|
17616
17626
|
return `${model.label} takes a source video of at least ${String(sourceMin)} s; this one is ${seconds2(source2, sourceMin)} s.`;
|
|
17617
17627
|
return void 0;
|
|
17618
17628
|
}
|
|
17629
|
+
function undersizedSide(frame, limits) {
|
|
17630
|
+
if (!frame || !limits) return void 0;
|
|
17631
|
+
const { width, height } = frame;
|
|
17632
|
+
if (limits.minWidth !== void 0 && width !== void 0 && width > 0 && width < limits.minWidth)
|
|
17633
|
+
return { side: "wide", min: limits.minWidth, actual: width };
|
|
17634
|
+
if (limits.minHeight !== void 0 && height !== void 0 && height > 0 && height < limits.minHeight)
|
|
17635
|
+
return { side: "tall", min: limits.minHeight, actual: height };
|
|
17636
|
+
return void 0;
|
|
17637
|
+
}
|
|
17638
|
+
function videoSizeViolation(model, input) {
|
|
17639
|
+
const refLimits = model.constraints.references?.videoPixels;
|
|
17640
|
+
const refs = input.referenceVideos ?? [];
|
|
17641
|
+
for (let i = 0; i < refs.length; i++) {
|
|
17642
|
+
const under2 = undersizedSide(refs[i], refLimits);
|
|
17643
|
+
if (under2)
|
|
17644
|
+
return `${model.label} takes reference videos at least ${String(under2.min)} px ${under2.side}; video ${i + 1} is ${String(under2.actual)} px.`;
|
|
17645
|
+
}
|
|
17646
|
+
const under = undersizedSide(input.sourceVideo, model.constraints.sourceVideoPixels);
|
|
17647
|
+
if (under)
|
|
17648
|
+
return `${model.label} takes a source video at least ${String(under.min)} px ${under.side}; this one is ${String(under.actual)} px.`;
|
|
17649
|
+
return void 0;
|
|
17650
|
+
}
|
|
17619
17651
|
function resolveImageOptions(model, request, onUnsupported = "error") {
|
|
17620
17652
|
const warnings = [];
|
|
17621
17653
|
const c = model.constraints;
|
|
@@ -19735,6 +19767,7 @@ export {
|
|
|
19735
19767
|
toGeneratedImage,
|
|
19736
19768
|
validateInputSpec,
|
|
19737
19769
|
videoLengthViolation,
|
|
19770
|
+
videoSizeViolation,
|
|
19738
19771
|
videoToolConstraints,
|
|
19739
19772
|
withRetry,
|
|
19740
19773
|
xaiVideoAdapter
|