@shop-os/modelkit 0.2.2 → 0.2.3
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 +8 -0
- package/dist/catalog.cjs +31 -26
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +16 -9
- package/dist/catalog.d.ts +16 -9
- package/dist/catalog.js +31 -26
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +147 -139
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -9
- package/dist/index.d.ts +16 -9
- package/dist/index.js +147 -139
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -222,8 +222,9 @@ interface CatalogDisplay {
|
|
|
222
222
|
/** Chat picker highlight flag. */
|
|
223
223
|
recommended?: boolean;
|
|
224
224
|
/**
|
|
225
|
-
* Picker position:
|
|
226
|
-
* after the ordered ones.
|
|
225
|
+
* Picker position: higher comes first; rows without one keep catalog order
|
|
226
|
+
* after the ordered ones. Give a new model the next number up to surface
|
|
227
|
+
* it at the top.
|
|
227
228
|
*/
|
|
228
229
|
sortOrder?: number;
|
|
229
230
|
/**
|
|
@@ -457,10 +458,18 @@ declare const CatalogModelSchema: z.ZodType<CatalogModel>;
|
|
|
457
458
|
declare const CatalogSchema: z.ZodType<CatalogModel[]>;
|
|
458
459
|
|
|
459
460
|
type CatalogOrigin = "remote" | "last-good" | "snapshot";
|
|
461
|
+
interface PrimeCatalogResult {
|
|
462
|
+
origin: CatalogOrigin;
|
|
463
|
+
rowCount: number;
|
|
464
|
+
revision?: string;
|
|
465
|
+
error?: string;
|
|
466
|
+
}
|
|
460
467
|
interface LiveCatalogState {
|
|
461
468
|
catalog: Catalog;
|
|
462
|
-
memo: Promise<
|
|
463
|
-
timer: ReturnType<typeof setInterval>
|
|
469
|
+
memo: Promise<PrimeCatalogResult> | undefined;
|
|
470
|
+
timer: (ReturnType<typeof setInterval> & {
|
|
471
|
+
unref?: () => void;
|
|
472
|
+
}) | undefined;
|
|
464
473
|
revision: string | undefined;
|
|
465
474
|
origin: CatalogOrigin;
|
|
466
475
|
}
|
|
@@ -487,11 +496,9 @@ interface CatalogSource {
|
|
|
487
496
|
logger?: Pick<Console, "debug" | "info" | "warn" | "error">;
|
|
488
497
|
}
|
|
489
498
|
|
|
490
|
-
interface
|
|
491
|
-
|
|
492
|
-
rowCount: number;
|
|
499
|
+
interface CatalogEnvelope {
|
|
500
|
+
rows: CatalogModel[];
|
|
493
501
|
revision?: string;
|
|
494
|
-
error?: string;
|
|
495
502
|
}
|
|
496
503
|
/** Fetch, validate, swap into liveCatalog. Never throws. Second call returns the same promise. */
|
|
497
504
|
declare function primeCatalog(source: CatalogSource): Promise<PrimeCatalogResult>;
|
|
@@ -741,4 +748,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
|
|
|
741
748
|
/** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
|
|
742
749
|
declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
|
|
743
750
|
|
|
744
|
-
export { ADAPTER_IDS, ADAPTER_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 CatalogModel, CatalogModelSchema, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DefaultObjectOutput, type GeneratedImage, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, 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 ReferenceLimits, type RequiredInput, type ResolveResult, type Routing, type SupportedOption, type TextMethods, type TextModelInstance, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, createDefaultModelKit, createModelKit, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, higgsfieldAdapter, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, nearestAspectRatio, openaiImageAdapter, passthroughTextModel, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveKeys, resolveVideoOptions, shouldRetry, sleep, streamObject, streamText, textUsageEvent, toGeneratedImage, withRetry, xaiVideoAdapter };
|
|
751
|
+
export { ADAPTER_IDS, ADAPTER_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, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DefaultObjectOutput, type GeneratedImage, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, 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 ReferenceLimits, type RequiredInput, type ResolveResult, type Routing, type SupportedOption, type TextMethods, type TextModelInstance, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, createDefaultModelKit, createModelKit, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, higgsfieldAdapter, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, nearestAspectRatio, openaiImageAdapter, passthroughTextModel, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveKeys, resolveVideoOptions, shouldRetry, sleep, streamObject, streamText, textUsageEvent, toGeneratedImage, withRetry, xaiVideoAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -222,8 +222,9 @@ interface CatalogDisplay {
|
|
|
222
222
|
/** Chat picker highlight flag. */
|
|
223
223
|
recommended?: boolean;
|
|
224
224
|
/**
|
|
225
|
-
* Picker position:
|
|
226
|
-
* after the ordered ones.
|
|
225
|
+
* Picker position: higher comes first; rows without one keep catalog order
|
|
226
|
+
* after the ordered ones. Give a new model the next number up to surface
|
|
227
|
+
* it at the top.
|
|
227
228
|
*/
|
|
228
229
|
sortOrder?: number;
|
|
229
230
|
/**
|
|
@@ -457,10 +458,18 @@ declare const CatalogModelSchema: z.ZodType<CatalogModel>;
|
|
|
457
458
|
declare const CatalogSchema: z.ZodType<CatalogModel[]>;
|
|
458
459
|
|
|
459
460
|
type CatalogOrigin = "remote" | "last-good" | "snapshot";
|
|
461
|
+
interface PrimeCatalogResult {
|
|
462
|
+
origin: CatalogOrigin;
|
|
463
|
+
rowCount: number;
|
|
464
|
+
revision?: string;
|
|
465
|
+
error?: string;
|
|
466
|
+
}
|
|
460
467
|
interface LiveCatalogState {
|
|
461
468
|
catalog: Catalog;
|
|
462
|
-
memo: Promise<
|
|
463
|
-
timer: ReturnType<typeof setInterval>
|
|
469
|
+
memo: Promise<PrimeCatalogResult> | undefined;
|
|
470
|
+
timer: (ReturnType<typeof setInterval> & {
|
|
471
|
+
unref?: () => void;
|
|
472
|
+
}) | undefined;
|
|
464
473
|
revision: string | undefined;
|
|
465
474
|
origin: CatalogOrigin;
|
|
466
475
|
}
|
|
@@ -487,11 +496,9 @@ interface CatalogSource {
|
|
|
487
496
|
logger?: Pick<Console, "debug" | "info" | "warn" | "error">;
|
|
488
497
|
}
|
|
489
498
|
|
|
490
|
-
interface
|
|
491
|
-
|
|
492
|
-
rowCount: number;
|
|
499
|
+
interface CatalogEnvelope {
|
|
500
|
+
rows: CatalogModel[];
|
|
493
501
|
revision?: string;
|
|
494
|
-
error?: string;
|
|
495
502
|
}
|
|
496
503
|
/** Fetch, validate, swap into liveCatalog. Never throws. Second call returns the same promise. */
|
|
497
504
|
declare function primeCatalog(source: CatalogSource): Promise<PrimeCatalogResult>;
|
|
@@ -741,4 +748,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
|
|
|
741
748
|
/** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
|
|
742
749
|
declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
|
|
743
750
|
|
|
744
|
-
export { ADAPTER_IDS, ADAPTER_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 CatalogModel, CatalogModelSchema, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DefaultObjectOutput, type GeneratedImage, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, 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 ReferenceLimits, type RequiredInput, type ResolveResult, type Routing, type SupportedOption, type TextMethods, type TextModelInstance, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, createDefaultModelKit, createModelKit, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, higgsfieldAdapter, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, nearestAspectRatio, openaiImageAdapter, passthroughTextModel, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveKeys, resolveVideoOptions, shouldRetry, sleep, streamObject, streamText, textUsageEvent, toGeneratedImage, withRetry, xaiVideoAdapter };
|
|
751
|
+
export { ADAPTER_IDS, ADAPTER_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, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DefaultObjectOutput, type GeneratedImage, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, 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 ReferenceLimits, type RequiredInput, type ResolveResult, type Routing, type SupportedOption, type TextMethods, type TextModelInstance, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type Warning, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, createDefaultModelKit, createModelKit, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, higgsfieldAdapter, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, nearestAspectRatio, openaiImageAdapter, passthroughTextModel, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveKeys, resolveVideoOptions, shouldRetry, sleep, streamObject, streamText, textUsageEvent, toGeneratedImage, withRetry, xaiVideoAdapter };
|