@shop-os/modelkit 0.2.19 → 0.2.21
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 +61 -0
- package/dist/catalog.cjs +343 -184
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +28 -1
- package/dist/catalog.d.ts +28 -1
- package/dist/catalog.js +343 -184
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +514 -328
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +514 -328
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -191,6 +191,15 @@ interface ReferenceLimits {
|
|
|
191
191
|
/** Per-video length caps (min/max each) and combined total for reference videos. */
|
|
192
192
|
videoSeconds?: VideoSecondsLimits;
|
|
193
193
|
}
|
|
194
|
+
/** Whether a video row's output has sound: always, switchable (`supports: generateAudio`), or silent. */
|
|
195
|
+
type AudioOutput = "always" | "optional" | "never";
|
|
196
|
+
/** How a prompt points at reference N: "image N" numbering, a caption beside each image, or prose. */
|
|
197
|
+
type ReferenceSyntax = "numbered" | "caption" | "descriptive";
|
|
198
|
+
interface PromptConventions {
|
|
199
|
+
referenceSyntax: ReferenceSyntax;
|
|
200
|
+
/** Provider-documented prompt length limit, in characters. */
|
|
201
|
+
maxChars?: number;
|
|
202
|
+
}
|
|
194
203
|
interface ModelConstraints {
|
|
195
204
|
aspectRatios?: AspectRatio[];
|
|
196
205
|
sizes?: ImageSize[];
|
|
@@ -224,6 +233,10 @@ interface ModelConstraints {
|
|
|
224
233
|
segmentSeconds: number;
|
|
225
234
|
maxTotalSeconds: number;
|
|
226
235
|
};
|
|
236
|
+
/** Whether the output has sound. Read it through `outputAudio(row)`, which tolerates bad data. */
|
|
237
|
+
audio?: AudioOutput;
|
|
238
|
+
/** Prompt conventions. Read them through `promptConventions(row)`, which fills the default. */
|
|
239
|
+
prompt?: PromptConventions;
|
|
227
240
|
}
|
|
228
241
|
/** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
|
|
229
242
|
type JsonPrimitive = string | number | boolean | null;
|
|
@@ -282,6 +295,8 @@ interface CatalogCapabilities {
|
|
|
282
295
|
acceptsSourceVideo?: boolean;
|
|
283
296
|
/** Video rows: first/last frames and reference images are mutually exclusive inputs. */
|
|
284
297
|
framesExcludeReferences?: boolean;
|
|
298
|
+
/** Video rows: a last frame is accepted only together with a first frame. */
|
|
299
|
+
lastFrameRequiresFirstFrame?: boolean;
|
|
285
300
|
/** Text rows. `reasoning`: the model streams reasoning the UI should surface. */
|
|
286
301
|
reasoning?: boolean;
|
|
287
302
|
vision?: boolean;
|
|
@@ -647,6 +662,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
647
662
|
segmentSeconds: z.ZodNumber;
|
|
648
663
|
maxTotalSeconds: z.ZodNumber;
|
|
649
664
|
}, z.core.$loose>>;
|
|
665
|
+
audio: z.ZodOptional<z.ZodUnknown>;
|
|
666
|
+
prompt: z.ZodOptional<z.ZodUnknown>;
|
|
650
667
|
}, z.core.$loose>;
|
|
651
668
|
defaults: z.ZodObject<{
|
|
652
669
|
references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -833,6 +850,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
833
850
|
capabilities: z.ZodOptional<z.ZodObject<{
|
|
834
851
|
acceptsSourceVideo: z.ZodOptional<z.ZodBoolean>;
|
|
835
852
|
framesExcludeReferences: z.ZodOptional<z.ZodBoolean>;
|
|
853
|
+
lastFrameRequiresFirstFrame: z.ZodOptional<z.ZodBoolean>;
|
|
836
854
|
reasoning: z.ZodOptional<z.ZodBoolean>;
|
|
837
855
|
vision: z.ZodOptional<z.ZodBoolean>;
|
|
838
856
|
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
@@ -919,6 +937,15 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
|
|
|
919
937
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
920
938
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
921
939
|
|
|
940
|
+
declare const AUDIO_OUTPUTS: ("always" | "optional" | "never")[];
|
|
941
|
+
declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
|
|
942
|
+
declare function outputAudio(row: {
|
|
943
|
+
constraints: unknown;
|
|
944
|
+
}): AudioOutput | undefined;
|
|
945
|
+
declare function promptConventions(row: {
|
|
946
|
+
constraints: unknown;
|
|
947
|
+
}): PromptConventions;
|
|
948
|
+
|
|
922
949
|
/** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
|
|
923
950
|
type ProviderErrorBody = string | JsonValue;
|
|
924
951
|
type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected" | "timeout" | "auth" | "network" | "rate_limited";
|
|
@@ -954,4 +981,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
|
954
981
|
/** Resolve caller options against a catalog row, dispatching on `model.type`. */
|
|
955
982
|
declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
|
|
956
983
|
|
|
957
|
-
export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
|
|
984
|
+
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, 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 Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, primeCatalog, promptConventions, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
|
package/dist/catalog.d.ts
CHANGED
|
@@ -191,6 +191,15 @@ interface ReferenceLimits {
|
|
|
191
191
|
/** Per-video length caps (min/max each) and combined total for reference videos. */
|
|
192
192
|
videoSeconds?: VideoSecondsLimits;
|
|
193
193
|
}
|
|
194
|
+
/** Whether a video row's output has sound: always, switchable (`supports: generateAudio`), or silent. */
|
|
195
|
+
type AudioOutput = "always" | "optional" | "never";
|
|
196
|
+
/** How a prompt points at reference N: "image N" numbering, a caption beside each image, or prose. */
|
|
197
|
+
type ReferenceSyntax = "numbered" | "caption" | "descriptive";
|
|
198
|
+
interface PromptConventions {
|
|
199
|
+
referenceSyntax: ReferenceSyntax;
|
|
200
|
+
/** Provider-documented prompt length limit, in characters. */
|
|
201
|
+
maxChars?: number;
|
|
202
|
+
}
|
|
194
203
|
interface ModelConstraints {
|
|
195
204
|
aspectRatios?: AspectRatio[];
|
|
196
205
|
sizes?: ImageSize[];
|
|
@@ -224,6 +233,10 @@ interface ModelConstraints {
|
|
|
224
233
|
segmentSeconds: number;
|
|
225
234
|
maxTotalSeconds: number;
|
|
226
235
|
};
|
|
236
|
+
/** Whether the output has sound. Read it through `outputAudio(row)`, which tolerates bad data. */
|
|
237
|
+
audio?: AudioOutput;
|
|
238
|
+
/** Prompt conventions. Read them through `promptConventions(row)`, which fills the default. */
|
|
239
|
+
prompt?: PromptConventions;
|
|
227
240
|
}
|
|
228
241
|
/** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
|
|
229
242
|
type JsonPrimitive = string | number | boolean | null;
|
|
@@ -282,6 +295,8 @@ interface CatalogCapabilities {
|
|
|
282
295
|
acceptsSourceVideo?: boolean;
|
|
283
296
|
/** Video rows: first/last frames and reference images are mutually exclusive inputs. */
|
|
284
297
|
framesExcludeReferences?: boolean;
|
|
298
|
+
/** Video rows: a last frame is accepted only together with a first frame. */
|
|
299
|
+
lastFrameRequiresFirstFrame?: boolean;
|
|
285
300
|
/** Text rows. `reasoning`: the model streams reasoning the UI should surface. */
|
|
286
301
|
reasoning?: boolean;
|
|
287
302
|
vision?: boolean;
|
|
@@ -647,6 +662,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
647
662
|
segmentSeconds: z.ZodNumber;
|
|
648
663
|
maxTotalSeconds: z.ZodNumber;
|
|
649
664
|
}, z.core.$loose>>;
|
|
665
|
+
audio: z.ZodOptional<z.ZodUnknown>;
|
|
666
|
+
prompt: z.ZodOptional<z.ZodUnknown>;
|
|
650
667
|
}, z.core.$loose>;
|
|
651
668
|
defaults: z.ZodObject<{
|
|
652
669
|
references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -833,6 +850,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
833
850
|
capabilities: z.ZodOptional<z.ZodObject<{
|
|
834
851
|
acceptsSourceVideo: z.ZodOptional<z.ZodBoolean>;
|
|
835
852
|
framesExcludeReferences: z.ZodOptional<z.ZodBoolean>;
|
|
853
|
+
lastFrameRequiresFirstFrame: z.ZodOptional<z.ZodBoolean>;
|
|
836
854
|
reasoning: z.ZodOptional<z.ZodBoolean>;
|
|
837
855
|
vision: z.ZodOptional<z.ZodBoolean>;
|
|
838
856
|
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
@@ -919,6 +937,15 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
|
|
|
919
937
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
920
938
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
921
939
|
|
|
940
|
+
declare const AUDIO_OUTPUTS: ("always" | "optional" | "never")[];
|
|
941
|
+
declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
|
|
942
|
+
declare function outputAudio(row: {
|
|
943
|
+
constraints: unknown;
|
|
944
|
+
}): AudioOutput | undefined;
|
|
945
|
+
declare function promptConventions(row: {
|
|
946
|
+
constraints: unknown;
|
|
947
|
+
}): PromptConventions;
|
|
948
|
+
|
|
922
949
|
/** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
|
|
923
950
|
type ProviderErrorBody = string | JsonValue;
|
|
924
951
|
type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected" | "timeout" | "auth" | "network" | "rate_limited";
|
|
@@ -954,4 +981,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
|
954
981
|
/** Resolve caller options against a catalog row, dispatching on `model.type`. */
|
|
955
982
|
declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
|
|
956
983
|
|
|
957
|
-
export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
|
|
984
|
+
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, 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 Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, primeCatalog, promptConventions, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
|