@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/dist/index.d.cts CHANGED
@@ -194,6 +194,15 @@ interface ReferenceLimits {
194
194
  /** Per-video length caps (min/max each) and combined total for reference videos. */
195
195
  videoSeconds?: VideoSecondsLimits;
196
196
  }
197
+ /** Whether a video row's output has sound: always, switchable (`supports: generateAudio`), or silent. */
198
+ type AudioOutput = "always" | "optional" | "never";
199
+ /** How a prompt points at reference N: "image N" numbering, a caption beside each image, or prose. */
200
+ type ReferenceSyntax = "numbered" | "caption" | "descriptive";
201
+ interface PromptConventions {
202
+ referenceSyntax: ReferenceSyntax;
203
+ /** Provider-documented prompt length limit, in characters. */
204
+ maxChars?: number;
205
+ }
197
206
  interface ModelConstraints {
198
207
  aspectRatios?: AspectRatio[];
199
208
  sizes?: ImageSize[];
@@ -227,6 +236,10 @@ interface ModelConstraints {
227
236
  segmentSeconds: number;
228
237
  maxTotalSeconds: number;
229
238
  };
239
+ /** Whether the output has sound. Read it through `outputAudio(row)`, which tolerates bad data. */
240
+ audio?: AudioOutput;
241
+ /** Prompt conventions. Read them through `promptConventions(row)`, which fills the default. */
242
+ prompt?: PromptConventions;
230
243
  }
231
244
  /** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
232
245
  type JsonPrimitive = string | number | boolean | null;
@@ -285,6 +298,8 @@ interface CatalogCapabilities {
285
298
  acceptsSourceVideo?: boolean;
286
299
  /** Video rows: first/last frames and reference images are mutually exclusive inputs. */
287
300
  framesExcludeReferences?: boolean;
301
+ /** Video rows: a last frame is accepted only together with a first frame. */
302
+ lastFrameRequiresFirstFrame?: boolean;
288
303
  /** Text rows. `reasoning`: the model streams reasoning the UI should surface. */
289
304
  reasoning?: boolean;
290
305
  vision?: boolean;
@@ -674,6 +689,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
674
689
  segmentSeconds: z.ZodNumber;
675
690
  maxTotalSeconds: z.ZodNumber;
676
691
  }, z.core.$loose>>;
692
+ audio: z.ZodOptional<z.ZodUnknown>;
693
+ prompt: z.ZodOptional<z.ZodUnknown>;
677
694
  }, z.core.$loose>;
678
695
  defaults: z.ZodObject<{
679
696
  references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -860,6 +877,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
860
877
  capabilities: z.ZodOptional<z.ZodObject<{
861
878
  acceptsSourceVideo: z.ZodOptional<z.ZodBoolean>;
862
879
  framesExcludeReferences: z.ZodOptional<z.ZodBoolean>;
880
+ lastFrameRequiresFirstFrame: z.ZodOptional<z.ZodBoolean>;
863
881
  reasoning: z.ZodOptional<z.ZodBoolean>;
864
882
  vision: z.ZodOptional<z.ZodBoolean>;
865
883
  contextWindow: z.ZodOptional<z.ZodNumber>;
@@ -1219,4 +1237,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
1219
1237
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
1220
1238
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
1221
1239
 
1222
- export { ADAPTER_IDS, ADAPTER_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, 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 CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type Exposure, ExposureSchema, type GeneratedImage, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type LanguageModelHandle, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, 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 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, type TextMethods, type TextModelInstance, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveKeys, resolveVideoOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, withRetry, xaiVideoAdapter };
1240
+ export { ADAPTER_IDS, ADAPTER_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, 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 CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type Exposure, ExposureSchema, type GeneratedImage, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type LanguageModelHandle, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, 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 SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveKeys, resolveVideoOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, withRetry, xaiVideoAdapter };
package/dist/index.d.ts CHANGED
@@ -194,6 +194,15 @@ interface ReferenceLimits {
194
194
  /** Per-video length caps (min/max each) and combined total for reference videos. */
195
195
  videoSeconds?: VideoSecondsLimits;
196
196
  }
197
+ /** Whether a video row's output has sound: always, switchable (`supports: generateAudio`), or silent. */
198
+ type AudioOutput = "always" | "optional" | "never";
199
+ /** How a prompt points at reference N: "image N" numbering, a caption beside each image, or prose. */
200
+ type ReferenceSyntax = "numbered" | "caption" | "descriptive";
201
+ interface PromptConventions {
202
+ referenceSyntax: ReferenceSyntax;
203
+ /** Provider-documented prompt length limit, in characters. */
204
+ maxChars?: number;
205
+ }
197
206
  interface ModelConstraints {
198
207
  aspectRatios?: AspectRatio[];
199
208
  sizes?: ImageSize[];
@@ -227,6 +236,10 @@ interface ModelConstraints {
227
236
  segmentSeconds: number;
228
237
  maxTotalSeconds: number;
229
238
  };
239
+ /** Whether the output has sound. Read it through `outputAudio(row)`, which tolerates bad data. */
240
+ audio?: AudioOutput;
241
+ /** Prompt conventions. Read them through `promptConventions(row)`, which fills the default. */
242
+ prompt?: PromptConventions;
230
243
  }
231
244
  /** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
232
245
  type JsonPrimitive = string | number | boolean | null;
@@ -285,6 +298,8 @@ interface CatalogCapabilities {
285
298
  acceptsSourceVideo?: boolean;
286
299
  /** Video rows: first/last frames and reference images are mutually exclusive inputs. */
287
300
  framesExcludeReferences?: boolean;
301
+ /** Video rows: a last frame is accepted only together with a first frame. */
302
+ lastFrameRequiresFirstFrame?: boolean;
288
303
  /** Text rows. `reasoning`: the model streams reasoning the UI should surface. */
289
304
  reasoning?: boolean;
290
305
  vision?: boolean;
@@ -674,6 +689,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
674
689
  segmentSeconds: z.ZodNumber;
675
690
  maxTotalSeconds: z.ZodNumber;
676
691
  }, z.core.$loose>>;
692
+ audio: z.ZodOptional<z.ZodUnknown>;
693
+ prompt: z.ZodOptional<z.ZodUnknown>;
677
694
  }, z.core.$loose>;
678
695
  defaults: z.ZodObject<{
679
696
  references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -860,6 +877,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
860
877
  capabilities: z.ZodOptional<z.ZodObject<{
861
878
  acceptsSourceVideo: z.ZodOptional<z.ZodBoolean>;
862
879
  framesExcludeReferences: z.ZodOptional<z.ZodBoolean>;
880
+ lastFrameRequiresFirstFrame: z.ZodOptional<z.ZodBoolean>;
863
881
  reasoning: z.ZodOptional<z.ZodBoolean>;
864
882
  vision: z.ZodOptional<z.ZodBoolean>;
865
883
  contextWindow: z.ZodOptional<z.ZodNumber>;
@@ -1219,4 +1237,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
1219
1237
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
1220
1238
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
1221
1239
 
1222
- export { ADAPTER_IDS, ADAPTER_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, 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 CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type Exposure, ExposureSchema, type GeneratedImage, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type LanguageModelHandle, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, 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 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, type TextMethods, type TextModelInstance, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveKeys, resolveVideoOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, withRetry, xaiVideoAdapter };
1240
+ export { ADAPTER_IDS, ADAPTER_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, 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 CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type Exposure, ExposureSchema, type GeneratedImage, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type LanguageModelHandle, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, 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 SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveKeys, resolveVideoOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, withRetry, xaiVideoAdapter };