@shop-os/modelkit 0.2.8 → 0.2.10
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/dist/catalog.cjs +126 -82
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +26 -5
- package/dist/catalog.d.ts +26 -5
- package/dist/catalog.js +126 -82
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +158 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -5
- package/dist/index.d.ts +26 -5
- package/dist/index.js +152 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -37,6 +37,9 @@ interface UpscaleOptions {
|
|
|
37
37
|
}
|
|
38
38
|
type ModelType = "text" | "image" | "video" | "audio" | "upscale" | "bg-remove";
|
|
39
39
|
type Lifecycle = "active" | "deprecated" | "retired";
|
|
40
|
+
type Surface = "cowork" | "space_builder";
|
|
41
|
+
/** @deprecated use Surface[] */
|
|
42
|
+
type Exposure = Surface[];
|
|
40
43
|
type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video";
|
|
41
44
|
/** Gemini image safety threshold, per category, sent only when the caller opts in. */
|
|
42
45
|
type ImageSafetySetting = {
|
|
@@ -100,6 +103,8 @@ interface VideoRequest {
|
|
|
100
103
|
watermark?: boolean;
|
|
101
104
|
/** Provider-side safety checker toggle (fal MiniMax). Provider default when unset. */
|
|
102
105
|
safetyChecker?: boolean;
|
|
106
|
+
/** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio. */
|
|
107
|
+
taskType?: "reference" | "edit" | "extend";
|
|
103
108
|
mode?: "standard" | "pro";
|
|
104
109
|
}
|
|
105
110
|
/**
|
|
@@ -151,9 +156,11 @@ interface MediaPart {
|
|
|
151
156
|
cleanup?: () => Promise<void>;
|
|
152
157
|
}
|
|
153
158
|
type RequiredInput = "firstFrame" | "sourceVideo" | "references";
|
|
154
|
-
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "instrumental";
|
|
159
|
+
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental";
|
|
155
160
|
interface ReferenceLimits {
|
|
156
161
|
images?: number;
|
|
162
|
+
/** Lower image cap when a reference video is also sent (Kling V3 Omni: 7 → 4). */
|
|
163
|
+
imagesWithVideo?: number;
|
|
157
164
|
videos?: number;
|
|
158
165
|
audios?: number;
|
|
159
166
|
total?: number;
|
|
@@ -257,10 +264,12 @@ interface CatalogModel {
|
|
|
257
264
|
lifecycle: Lifecycle;
|
|
258
265
|
replacedBy?: string;
|
|
259
266
|
/**
|
|
260
|
-
* "
|
|
261
|
-
* "
|
|
267
|
+
* Surfaces the row is listed on: "cowork" = listed in Cowork pickers
|
|
268
|
+
* (Creative Studio, chat); "space_builder" = listed in Space Builder
|
|
269
|
+
* pickers; [] = hidden from every picker, callable by id (the old
|
|
270
|
+
* "internal"); ["cowork", "space_builder"] = the old "catalog".
|
|
262
271
|
*/
|
|
263
|
-
exposure:
|
|
272
|
+
exposure: Surface[];
|
|
264
273
|
constraints: ModelConstraints;
|
|
265
274
|
defaults: Partial<Omit<ImageRequest, "model" | "prompt"> & Omit<VideoRequest, "model" | "prompt"> & Omit<AudioRequest, "model" | "prompt">>;
|
|
266
275
|
/** Provider options merged under the caller's on every call. Chat-only tuning belongs in display.chat. */
|
|
@@ -436,10 +445,22 @@ declare class Catalog {
|
|
|
436
445
|
declare function compareCatalogOrder(a: CatalogModel, b: CatalogModel): number;
|
|
437
446
|
declare function sortCatalogRows<T extends CatalogModel>(rows: readonly T[]): T[];
|
|
438
447
|
|
|
448
|
+
declare function normalizeExposure(value: unknown): unknown;
|
|
449
|
+
/** True when an active row is listed on `surface`. */
|
|
450
|
+
declare function isListedOn(row: CatalogModel, surface: Surface): boolean;
|
|
451
|
+
/** True when an active row is listed on at least one surface. */
|
|
452
|
+
declare function isListed(row: CatalogModel): boolean;
|
|
453
|
+
|
|
439
454
|
/** Seeded from Cowork, Space Builder and trigger-workflows. See catalog/*.ts. */
|
|
440
455
|
declare const MODELS: CatalogModel[];
|
|
441
456
|
|
|
442
457
|
declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video"];
|
|
458
|
+
declare const SurfaceSchema: z.ZodEnum<{
|
|
459
|
+
cowork: "cowork";
|
|
460
|
+
space_builder: "space_builder";
|
|
461
|
+
}>;
|
|
462
|
+
declare const SURFACES: ("cowork" | "space_builder")[];
|
|
463
|
+
declare const ExposureSchema: z.ZodType<Surface[], unknown>;
|
|
443
464
|
declare const CatalogModelSchema: z.ZodType<CatalogModel>;
|
|
444
465
|
declare const CatalogSchema: z.ZodType<CatalogModel[]>;
|
|
445
466
|
|
|
@@ -545,4 +566,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
|
545
566
|
/** Resolve caller options against a catalog row, dispatching on `model.type`. */
|
|
546
567
|
declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
|
|
547
568
|
|
|
548
|
-
export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, 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 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 ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type ReferenceLimits, type RequiredInput, type ResolveResult, type Routing, type SupportedOption, 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 Warning, compareCatalogOrder, isModelKitError, liveCatalog, liveState, nearestAspectRatio, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };
|
|
569
|
+
export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, 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 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 ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type ReferenceLimits, type RequiredInput, 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 Warning, compareCatalogOrder, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };
|
package/dist/catalog.d.ts
CHANGED
|
@@ -37,6 +37,9 @@ interface UpscaleOptions {
|
|
|
37
37
|
}
|
|
38
38
|
type ModelType = "text" | "image" | "video" | "audio" | "upscale" | "bg-remove";
|
|
39
39
|
type Lifecycle = "active" | "deprecated" | "retired";
|
|
40
|
+
type Surface = "cowork" | "space_builder";
|
|
41
|
+
/** @deprecated use Surface[] */
|
|
42
|
+
type Exposure = Surface[];
|
|
40
43
|
type AdapterId = "ai-sdk-text" | "google-image" | "openai-image" | "google-genai" | "ark" | "fal" | "replicate" | "prodia" | "higgsfield" | "xai-video";
|
|
41
44
|
/** Gemini image safety threshold, per category, sent only when the caller opts in. */
|
|
42
45
|
type ImageSafetySetting = {
|
|
@@ -100,6 +103,8 @@ interface VideoRequest {
|
|
|
100
103
|
watermark?: boolean;
|
|
101
104
|
/** Provider-side safety checker toggle (fal MiniMax). Provider default when unset. */
|
|
102
105
|
safetyChecker?: boolean;
|
|
106
|
+
/** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio. */
|
|
107
|
+
taskType?: "reference" | "edit" | "extend";
|
|
103
108
|
mode?: "standard" | "pro";
|
|
104
109
|
}
|
|
105
110
|
/**
|
|
@@ -151,9 +156,11 @@ interface MediaPart {
|
|
|
151
156
|
cleanup?: () => Promise<void>;
|
|
152
157
|
}
|
|
153
158
|
type RequiredInput = "firstFrame" | "sourceVideo" | "references";
|
|
154
|
-
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "instrumental";
|
|
159
|
+
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental";
|
|
155
160
|
interface ReferenceLimits {
|
|
156
161
|
images?: number;
|
|
162
|
+
/** Lower image cap when a reference video is also sent (Kling V3 Omni: 7 → 4). */
|
|
163
|
+
imagesWithVideo?: number;
|
|
157
164
|
videos?: number;
|
|
158
165
|
audios?: number;
|
|
159
166
|
total?: number;
|
|
@@ -257,10 +264,12 @@ interface CatalogModel {
|
|
|
257
264
|
lifecycle: Lifecycle;
|
|
258
265
|
replacedBy?: string;
|
|
259
266
|
/**
|
|
260
|
-
* "
|
|
261
|
-
* "
|
|
267
|
+
* Surfaces the row is listed on: "cowork" = listed in Cowork pickers
|
|
268
|
+
* (Creative Studio, chat); "space_builder" = listed in Space Builder
|
|
269
|
+
* pickers; [] = hidden from every picker, callable by id (the old
|
|
270
|
+
* "internal"); ["cowork", "space_builder"] = the old "catalog".
|
|
262
271
|
*/
|
|
263
|
-
exposure:
|
|
272
|
+
exposure: Surface[];
|
|
264
273
|
constraints: ModelConstraints;
|
|
265
274
|
defaults: Partial<Omit<ImageRequest, "model" | "prompt"> & Omit<VideoRequest, "model" | "prompt"> & Omit<AudioRequest, "model" | "prompt">>;
|
|
266
275
|
/** Provider options merged under the caller's on every call. Chat-only tuning belongs in display.chat. */
|
|
@@ -436,10 +445,22 @@ declare class Catalog {
|
|
|
436
445
|
declare function compareCatalogOrder(a: CatalogModel, b: CatalogModel): number;
|
|
437
446
|
declare function sortCatalogRows<T extends CatalogModel>(rows: readonly T[]): T[];
|
|
438
447
|
|
|
448
|
+
declare function normalizeExposure(value: unknown): unknown;
|
|
449
|
+
/** True when an active row is listed on `surface`. */
|
|
450
|
+
declare function isListedOn(row: CatalogModel, surface: Surface): boolean;
|
|
451
|
+
/** True when an active row is listed on at least one surface. */
|
|
452
|
+
declare function isListed(row: CatalogModel): boolean;
|
|
453
|
+
|
|
439
454
|
/** Seeded from Cowork, Space Builder and trigger-workflows. See catalog/*.ts. */
|
|
440
455
|
declare const MODELS: CatalogModel[];
|
|
441
456
|
|
|
442
457
|
declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video"];
|
|
458
|
+
declare const SurfaceSchema: z.ZodEnum<{
|
|
459
|
+
cowork: "cowork";
|
|
460
|
+
space_builder: "space_builder";
|
|
461
|
+
}>;
|
|
462
|
+
declare const SURFACES: ("cowork" | "space_builder")[];
|
|
463
|
+
declare const ExposureSchema: z.ZodType<Surface[], unknown>;
|
|
443
464
|
declare const CatalogModelSchema: z.ZodType<CatalogModel>;
|
|
444
465
|
declare const CatalogSchema: z.ZodType<CatalogModel[]>;
|
|
445
466
|
|
|
@@ -545,4 +566,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
|
545
566
|
/** Resolve caller options against a catalog row, dispatching on `model.type`. */
|
|
546
567
|
declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
|
|
547
568
|
|
|
548
|
-
export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, 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 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 ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type ReferenceLimits, type RequiredInput, type ResolveResult, type Routing, type SupportedOption, 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 Warning, compareCatalogOrder, isModelKitError, liveCatalog, liveState, nearestAspectRatio, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };
|
|
569
|
+
export { ADAPTER_IDS, type AdapterEndpoints, type AdapterId, 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 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 ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type ReferenceLimits, type RequiredInput, 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 Warning, compareCatalogOrder, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, primeCatalog, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows };
|