@shop-os/modelkit 0.2.22 → 0.2.24

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.
@@ -942,6 +942,17 @@ declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
942
942
  declare function outputAudio(row: {
943
943
  constraints: unknown;
944
944
  }): AudioOutput | undefined;
945
+ /**
946
+ * Whether a video request is billed as having sound. `always` rows are true and `never` rows
947
+ * false; an `optional` row takes the request's `generateAudio`, then the row's default, then
948
+ * true. A row with no declared audio is true. Every fallback is true because the base video
949
+ * price is the sound-on price: a guess must never pick the cheaper silent rate. Pass the same
950
+ * `requested` value the request dispatches with, so the billed and generated sound agree.
951
+ */
952
+ declare function billedAudio(row: {
953
+ constraints: unknown;
954
+ defaults?: unknown;
955
+ }, requested?: boolean): boolean;
945
956
  declare function promptConventions(row: {
946
957
  constraints: unknown;
947
958
  }): PromptConventions;
@@ -981,4 +992,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
981
992
  /** Resolve caller options against a catalog row, dispatching on `model.type`. */
982
993
  declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
983
994
 
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 };
995
+ 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, billedAudio, 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
@@ -942,6 +942,17 @@ declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
942
942
  declare function outputAudio(row: {
943
943
  constraints: unknown;
944
944
  }): AudioOutput | undefined;
945
+ /**
946
+ * Whether a video request is billed as having sound. `always` rows are true and `never` rows
947
+ * false; an `optional` row takes the request's `generateAudio`, then the row's default, then
948
+ * true. A row with no declared audio is true. Every fallback is true because the base video
949
+ * price is the sound-on price: a guess must never pick the cheaper silent rate. Pass the same
950
+ * `requested` value the request dispatches with, so the billed and generated sound agree.
951
+ */
952
+ declare function billedAudio(row: {
953
+ constraints: unknown;
954
+ defaults?: unknown;
955
+ }, requested?: boolean): boolean;
945
956
  declare function promptConventions(row: {
946
957
  constraints: unknown;
947
958
  }): PromptConventions;
@@ -981,4 +992,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
981
992
  /** Resolve caller options against a catalog row, dispatching on `model.type`. */
982
993
  declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
983
994
 
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 };
995
+ 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, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, primeCatalog, promptConventions, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
package/dist/catalog.js CHANGED
@@ -385,6 +385,32 @@ var IMAGE_MODELS = [
385
385
  logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/characters/1787909065794-k9a7zz.png"
386
386
  }
387
387
  },
388
+ {
389
+ // References switch to the edit endpoint: the first is the image to edit,
390
+ // the rest (up to 4) guide it.
391
+ id: "ideogram-4.5",
392
+ aliases: [],
393
+ label: "Ideogram 4.5",
394
+ type: "image",
395
+ adapter: "fal",
396
+ providerModelId: "ideogram/v4.5",
397
+ lifecycle: "active",
398
+ exposure: ["cowork", "space_builder"],
399
+ constraints: {
400
+ aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5"],
401
+ sizes: ["1K", "2K"],
402
+ qualityOptions: ["auto", "low", "medium", "high"],
403
+ references: { images: 5 },
404
+ supports: ["quality", "count", "seed"]
405
+ },
406
+ defaults: { size: "2K", aspectRatio: "1:1", quality: "medium", count: 1 },
407
+ usage: { ...IMAGE_USAGE, slug: "ideogram" },
408
+ pricingKind: "image_size",
409
+ display: {
410
+ provider: "ideogram",
411
+ description: "Ideogram's precise edit model: repeated edits keep the untouched pixels and colours intact, at the source's native resolution. Also generates from text."
412
+ }
413
+ },
388
414
  {
389
415
  id: "seedream-5-0-pro",
390
416
  aliases: ["seedream-4-5"],
@@ -2011,6 +2037,17 @@ function outputAudio(row) {
2011
2037
  const view = ConstraintsReadView.safeParse(row.constraints);
2012
2038
  return view.success ? view.data.audio : void 0;
2013
2039
  }
2040
+ var DefaultsReadView = z.looseObject({
2041
+ generateAudio: z.boolean().optional().catch(void 0)
2042
+ });
2043
+ function billedAudio(row, requested) {
2044
+ const audio = outputAudio(row);
2045
+ if (audio === "never") return false;
2046
+ if (audio !== "optional") return true;
2047
+ if (requested !== void 0) return requested;
2048
+ const defaults = DefaultsReadView.safeParse(row.defaults);
2049
+ return (defaults.success ? defaults.data.generateAudio : void 0) ?? true;
2050
+ }
2014
2051
  function promptConventions(row) {
2015
2052
  const view = ConstraintsReadView.safeParse(row.constraints);
2016
2053
  const prompt = view.success ? view.data.prompt : void 0;
@@ -3217,6 +3254,7 @@ export {
3217
3254
  SurfaceSchema,
3218
3255
  TEXT_MODELS,
3219
3256
  VIDEO_MODELS,
3257
+ billedAudio,
3220
3258
  compareCatalogOrder,
3221
3259
  isListed,
3222
3260
  isListedOn,