@shop-os/modelkit 0.2.24 → 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/dist/index.d.cts CHANGED
@@ -440,6 +440,8 @@ type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
440
440
  }>;
441
441
  };
442
442
  };
443
+ /** Which key set a call uses. Enterprise falls back to pro; sloosh never falls back. */
444
+ type KeyTier = "pro" | "enterprise" | "sloosh";
443
445
  /** Key names a call can require, including the Bedrock credentials object. */
444
446
  type RequiredKeyName = ProviderKeyName | "aws";
445
447
  /** True when region is set AND (apiKey OR credentialProvider OR both static keys). */
@@ -471,6 +473,7 @@ interface ModelKitConfig {
471
473
  keys: {
472
474
  pro: ProviderKeys;
473
475
  enterprise?: ProviderKeys;
476
+ sloosh?: ProviderKeys;
474
477
  };
475
478
  routing?: Routing;
476
479
  /** Provider base-url overrides; unset entries use each adapter's documented default. */
@@ -483,8 +486,8 @@ interface ModelKitConfig {
483
486
  logger?: Pick<Console, "debug" | "info" | "warn" | "error">;
484
487
  }
485
488
  interface CallContext {
486
- /** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. */
487
- tier?: "pro" | "enterprise";
489
+ /** "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. */
490
+ tier?: KeyTier;
488
491
  signal?: AbortSignal;
489
492
  /** Media retries after the initial request. Set 0 when a durable host owns recovery.
490
493
  * Unset preserves adapter defaults. Successful pending-job polls are not retries.
@@ -1036,12 +1039,15 @@ declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest,
1036
1039
 
1037
1040
  /** Which key names an adapter needs. All of them must be set on a tier for that tier to win. */
1038
1041
  declare const ADAPTER_KEYS: Record<AdapterId, ProviderKeyName[]>;
1042
+ /** The required names the given non-pro tier is missing. */
1043
+ declare function missingTierKeys(config: ModelKitConfig, tier: Exclude<KeyTier, "pro">, names: RequiredKeyName[]): RequiredKeyName[];
1039
1044
  /**
1040
1045
  * Enterprise wins only when every key the adapter needs is set on the
1041
1046
  * enterprise tier; otherwise the pro keys are used. Mirrors trigger-workflows
1042
- * enterprise-keys.ts, extended to Ark and Prodia.
1047
+ * enterprise-keys.ts, extended to Ark and Prodia. Sloosh never falls back:
1048
+ * a sloosh call with a missing key throws.
1043
1049
  */
1044
- declare function resolveKeys(config: ModelKitConfig, names: RequiredKeyName[], tier?: "pro" | "enterprise"): ProviderKeys;
1050
+ declare function resolveKeys(config: ModelKitConfig, names: RequiredKeyName[], tier?: KeyTier): ProviderKeys;
1045
1051
  /** Build a ProviderKeys map from env with the given prefix ("" for pro, "ENTERPRISE_" for enterprise). */
1046
1052
  declare function keysFromEnv(env: NodeJS.ProcessEnv, prefix?: string): ProviderKeys;
1047
1053
 
@@ -1204,7 +1210,7 @@ declare const DEFAULT_ADAPTERS: Record<AdapterId, Adapter>;
1204
1210
 
1205
1211
  /**
1206
1212
  * All adapters registered. Keys default to process.env (pro = bare names,
1207
- * enterprise = ENTERPRISE_ prefix) when `keys` is omitted.
1213
+ * enterprise = ENTERPRISE_ prefix, sloosh = SLOOSH_ prefix) when `keys` is omitted.
1208
1214
  */
1209
1215
  declare function createDefaultModelKit(config?: Partial<ModelKitConfig>): ModelKit;
1210
1216
  /**
@@ -1237,4 +1243,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
1237
1243
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
1238
1244
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
1239
1245
 
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 };
1246
+ 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 KeyTier, 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, missingTierKeys, 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
@@ -440,6 +440,8 @@ type ProviderKeys = Partial<Record<ProviderKeyName, string>> & {
440
440
  }>;
441
441
  };
442
442
  };
443
+ /** Which key set a call uses. Enterprise falls back to pro; sloosh never falls back. */
444
+ type KeyTier = "pro" | "enterprise" | "sloosh";
443
445
  /** Key names a call can require, including the Bedrock credentials object. */
444
446
  type RequiredKeyName = ProviderKeyName | "aws";
445
447
  /** True when region is set AND (apiKey OR credentialProvider OR both static keys). */
@@ -471,6 +473,7 @@ interface ModelKitConfig {
471
473
  keys: {
472
474
  pro: ProviderKeys;
473
475
  enterprise?: ProviderKeys;
476
+ sloosh?: ProviderKeys;
474
477
  };
475
478
  routing?: Routing;
476
479
  /** Provider base-url overrides; unset entries use each adapter's documented default. */
@@ -483,8 +486,8 @@ interface ModelKitConfig {
483
486
  logger?: Pick<Console, "debug" | "info" | "warn" | "error">;
484
487
  }
485
488
  interface CallContext {
486
- /** "enterprise" picks keys.enterprise when every key for the provider is set, else falls back to pro. */
487
- tier?: "pro" | "enterprise";
489
+ /** "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. */
490
+ tier?: KeyTier;
488
491
  signal?: AbortSignal;
489
492
  /** Media retries after the initial request. Set 0 when a durable host owns recovery.
490
493
  * Unset preserves adapter defaults. Successful pending-job polls are not retries.
@@ -1036,12 +1039,15 @@ declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest,
1036
1039
 
1037
1040
  /** Which key names an adapter needs. All of them must be set on a tier for that tier to win. */
1038
1041
  declare const ADAPTER_KEYS: Record<AdapterId, ProviderKeyName[]>;
1042
+ /** The required names the given non-pro tier is missing. */
1043
+ declare function missingTierKeys(config: ModelKitConfig, tier: Exclude<KeyTier, "pro">, names: RequiredKeyName[]): RequiredKeyName[];
1039
1044
  /**
1040
1045
  * Enterprise wins only when every key the adapter needs is set on the
1041
1046
  * enterprise tier; otherwise the pro keys are used. Mirrors trigger-workflows
1042
- * enterprise-keys.ts, extended to Ark and Prodia.
1047
+ * enterprise-keys.ts, extended to Ark and Prodia. Sloosh never falls back:
1048
+ * a sloosh call with a missing key throws.
1043
1049
  */
1044
- declare function resolveKeys(config: ModelKitConfig, names: RequiredKeyName[], tier?: "pro" | "enterprise"): ProviderKeys;
1050
+ declare function resolveKeys(config: ModelKitConfig, names: RequiredKeyName[], tier?: KeyTier): ProviderKeys;
1045
1051
  /** Build a ProviderKeys map from env with the given prefix ("" for pro, "ENTERPRISE_" for enterprise). */
1046
1052
  declare function keysFromEnv(env: NodeJS.ProcessEnv, prefix?: string): ProviderKeys;
1047
1053
 
@@ -1204,7 +1210,7 @@ declare const DEFAULT_ADAPTERS: Record<AdapterId, Adapter>;
1204
1210
 
1205
1211
  /**
1206
1212
  * All adapters registered. Keys default to process.env (pro = bare names,
1207
- * enterprise = ENTERPRISE_ prefix) when `keys` is omitted.
1213
+ * enterprise = ENTERPRISE_ prefix, sloosh = SLOOSH_ prefix) when `keys` is omitted.
1208
1214
  */
1209
1215
  declare function createDefaultModelKit(config?: Partial<ModelKitConfig>): ModelKit;
1210
1216
  /**
@@ -1237,4 +1243,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
1237
1243
  /** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
1238
1244
  declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
1239
1245
 
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 };
1246
+ 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 KeyTier, 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, missingTierKeys, 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.js CHANGED
@@ -7987,10 +7987,22 @@ function hasAll(keys, names) {
7987
7987
  function hasKey(keys, name) {
7988
7988
  return hasAll(keys, [name]);
7989
7989
  }
7990
+ function missingTierKeys(config, tier, names) {
7991
+ return names.filter((name) => !hasAll(config.keys[tier], [name]));
7992
+ }
7990
7993
  function missingEnterpriseKeys(config, names) {
7991
- return names.filter((name) => !hasAll(config.keys.enterprise, [name]));
7994
+ return missingTierKeys(config, "enterprise", names);
7992
7995
  }
7993
7996
  function resolveKeys(config, names, tier = "pro") {
7997
+ if (tier === "sloosh") {
7998
+ if (names.length === 0) return config.keys.sloosh ?? {};
7999
+ if (hasAll(config.keys.sloosh, names)) return config.keys.sloosh;
8000
+ throw new ModelKitError({
8001
+ code: "auth",
8002
+ message: `Missing Sloosh API key for ${names.join(", ")}`,
8003
+ retryable: false
8004
+ });
8005
+ }
7994
8006
  if (tier === "enterprise" && hasAll(config.keys.enterprise, names))
7995
8007
  return config.keys.enterprise;
7996
8008
  if (names.length > 0 && !hasAll(config.keys.pro, names)) {
@@ -8186,6 +8198,7 @@ function resolveAnthropicTransport(model, config, tier, warn) {
8186
8198
  const preferred = preferredAnthropicTransport(model, config.routing ?? {});
8187
8199
  const usable = (transport) => {
8188
8200
  const name = transport === "bedrock" ? "aws" : "anthropic";
8201
+ if (tier === "sloosh") return hasKey(config.keys.sloosh, name);
8189
8202
  return hasKey(config.keys.pro, name) || tier === "enterprise" && hasKey(config.keys.enterprise, name);
8190
8203
  };
8191
8204
  if (usable(preferred)) return preferred;
@@ -8767,11 +8780,19 @@ function createModelKit(config, adapters) {
8767
8780
  }
8768
8781
 
8769
8782
  // src/default.ts
8783
+ function withSharedAws(keys) {
8784
+ const { pro, sloosh } = keys;
8785
+ if (!sloosh || sloosh.aws || !pro.aws) return keys;
8786
+ return { ...keys, sloosh: { ...sloosh, aws: pro.aws } };
8787
+ }
8770
8788
  function createDefaultModelKit(config = {}) {
8771
- const keys = config.keys ?? {
8772
- pro: keysFromEnv(process.env),
8773
- enterprise: keysFromEnv(process.env, "ENTERPRISE_")
8774
- };
8789
+ const keys = withSharedAws(
8790
+ config.keys ?? {
8791
+ pro: keysFromEnv(process.env),
8792
+ enterprise: keysFromEnv(process.env, "ENTERPRISE_"),
8793
+ sloosh: keysFromEnv(process.env, "SLOOSH_")
8794
+ }
8795
+ );
8775
8796
  return createModelKit({ ...config, keys }, DEFAULT_ADAPTERS);
8776
8797
  }
8777
8798
  var generateText2 = (options, call) => createDefaultModelKit().generateText(options, call);
@@ -8835,6 +8856,7 @@ export {
8835
8856
  liveCatalog,
8836
8857
  liveState,
8837
8858
  mergeTextProviderOptions,
8859
+ missingTierKeys,
8838
8860
  nearestAspectRatio,
8839
8861
  normalizeExposure,
8840
8862
  openaiImageAdapter,