@shop-os/modelkit 0.2.23 → 0.2.25
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 +14 -0
- package/README.md +1 -1
- package/dist/catalog.cjs +26 -0
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +6 -3
- package/dist/catalog.d.ts +6 -3
- package/dist/catalog.js +26 -0
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +121 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.js +120 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -437,6 +437,8 @@ type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
|
|
|
437
437
|
}>;
|
|
438
438
|
};
|
|
439
439
|
};
|
|
440
|
+
/** Which key set a call uses. Enterprise falls back to pro; sloosh never falls back. */
|
|
441
|
+
type KeyTier = "pro" | "enterprise" | "sloosh";
|
|
440
442
|
/** Key names a call can require, including the Bedrock credentials object. */
|
|
441
443
|
type RequiredKeyName = ProviderKeyName | "aws";
|
|
442
444
|
/** True when region is set AND (apiKey OR credentialProvider OR both static keys). */
|
|
@@ -468,6 +470,7 @@ interface ModelKitConfig {
|
|
|
468
470
|
keys: {
|
|
469
471
|
pro: ProviderKeys;
|
|
470
472
|
enterprise?: ProviderKeys;
|
|
473
|
+
sloosh?: ProviderKeys;
|
|
471
474
|
};
|
|
472
475
|
routing?: Routing;
|
|
473
476
|
/** Provider base-url overrides; unset entries use each adapter's documented default. */
|
|
@@ -480,8 +483,8 @@ interface ModelKitConfig {
|
|
|
480
483
|
logger?: Pick<Console, "debug" | "info" | "warn" | "error">;
|
|
481
484
|
}
|
|
482
485
|
interface CallContext {
|
|
483
|
-
/** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. */
|
|
484
|
-
tier?:
|
|
486
|
+
/** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. "sloosh" uses keys.sloosh only and never falls back. */
|
|
487
|
+
tier?: KeyTier;
|
|
485
488
|
signal?: AbortSignal;
|
|
486
489
|
/** Media retries after the initial request. Set 0 when a durable host owns recovery.
|
|
487
490
|
* Unset preserves adapter defaults. Successful pending-job polls are not retries.
|
|
@@ -992,4 +995,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
|
992
995
|
/** Resolve caller options against a catalog row, dispatching on `model.type`. */
|
|
993
996
|
declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
|
|
994
997
|
|
|
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 };
|
|
998
|
+
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 KeyTier, 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
|
@@ -437,6 +437,8 @@ type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
|
|
|
437
437
|
}>;
|
|
438
438
|
};
|
|
439
439
|
};
|
|
440
|
+
/** Which key set a call uses. Enterprise falls back to pro; sloosh never falls back. */
|
|
441
|
+
type KeyTier = "pro" | "enterprise" | "sloosh";
|
|
440
442
|
/** Key names a call can require, including the Bedrock credentials object. */
|
|
441
443
|
type RequiredKeyName = ProviderKeyName | "aws";
|
|
442
444
|
/** True when region is set AND (apiKey OR credentialProvider OR both static keys). */
|
|
@@ -468,6 +470,7 @@ interface ModelKitConfig {
|
|
|
468
470
|
keys: {
|
|
469
471
|
pro: ProviderKeys;
|
|
470
472
|
enterprise?: ProviderKeys;
|
|
473
|
+
sloosh?: ProviderKeys;
|
|
471
474
|
};
|
|
472
475
|
routing?: Routing;
|
|
473
476
|
/** Provider base-url overrides; unset entries use each adapter's documented default. */
|
|
@@ -480,8 +483,8 @@ interface ModelKitConfig {
|
|
|
480
483
|
logger?: Pick<Console, "debug" | "info" | "warn" | "error">;
|
|
481
484
|
}
|
|
482
485
|
interface CallContext {
|
|
483
|
-
/** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. */
|
|
484
|
-
tier?:
|
|
486
|
+
/** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. "sloosh" uses keys.sloosh only and never falls back. */
|
|
487
|
+
tier?: KeyTier;
|
|
485
488
|
signal?: AbortSignal;
|
|
486
489
|
/** Media retries after the initial request. Set 0 when a durable host owns recovery.
|
|
487
490
|
* Unset preserves adapter defaults. Successful pending-job polls are not retries.
|
|
@@ -992,4 +995,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
|
992
995
|
/** Resolve caller options against a catalog row, dispatching on `model.type`. */
|
|
993
996
|
declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
|
|
994
997
|
|
|
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 };
|
|
998
|
+
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 KeyTier, 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"],
|