@shop-os/modelkit 0.2.19 → 0.2.20

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.
@@ -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;
@@ -647,6 +660,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
647
660
  segmentSeconds: z.ZodNumber;
648
661
  maxTotalSeconds: z.ZodNumber;
649
662
  }, z.core.$loose>>;
663
+ audio: z.ZodOptional<z.ZodUnknown>;
664
+ prompt: z.ZodOptional<z.ZodUnknown>;
650
665
  }, z.core.$loose>;
651
666
  defaults: z.ZodObject<{
652
667
  references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -919,6 +934,15 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
919
934
  declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
920
935
  declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
921
936
 
937
+ declare const AUDIO_OUTPUTS: ("always" | "optional" | "never")[];
938
+ declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
939
+ declare function outputAudio(row: {
940
+ constraints: unknown;
941
+ }): AudioOutput | undefined;
942
+ declare function promptConventions(row: {
943
+ constraints: unknown;
944
+ }): PromptConventions;
945
+
922
946
  /** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
923
947
  type ProviderErrorBody = string | JsonValue;
924
948
  type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected" | "timeout" | "auth" | "network" | "rate_limited";
@@ -954,4 +978,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
954
978
  /** Resolve caller options against a catalog row, dispatching on `model.type`. */
955
979
  declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
956
980
 
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 };
981
+ 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;
@@ -647,6 +660,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
647
660
  segmentSeconds: z.ZodNumber;
648
661
  maxTotalSeconds: z.ZodNumber;
649
662
  }, z.core.$loose>>;
663
+ audio: z.ZodOptional<z.ZodUnknown>;
664
+ prompt: z.ZodOptional<z.ZodUnknown>;
650
665
  }, z.core.$loose>;
651
666
  defaults: z.ZodObject<{
652
667
  references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -919,6 +934,15 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
919
934
  declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
920
935
  declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
921
936
 
937
+ declare const AUDIO_OUTPUTS: ("always" | "optional" | "never")[];
938
+ declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
939
+ declare function outputAudio(row: {
940
+ constraints: unknown;
941
+ }): AudioOutput | undefined;
942
+ declare function promptConventions(row: {
943
+ constraints: unknown;
944
+ }): PromptConventions;
945
+
922
946
  /** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
923
947
  type ProviderErrorBody = string | JsonValue;
924
948
  type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected" | "timeout" | "auth" | "network" | "rate_limited";
@@ -954,4 +978,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
954
978
  /** Resolve caller options against a catalog row, dispatching on `model.type`. */
955
979
  declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
956
980
 
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 };
981
+ 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 };