@shop-os/modelkit 0.2.15 → 0.2.17
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 +13 -0
- package/dist/catalog.cjs +23 -4
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +25 -2
- package/dist/catalog.d.ts +25 -2
- package/dist/catalog.js +23 -4
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +75 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +75 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -107,8 +107,14 @@ interface VideoRequest {
|
|
|
107
107
|
watermark?: boolean;
|
|
108
108
|
/** Provider-side safety checker toggle (fal MiniMax). Provider default when unset. */
|
|
109
109
|
safetyChecker?: boolean;
|
|
110
|
-
/** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio.
|
|
110
|
+
/** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio.
|
|
111
|
+
* `extend` on a `videoExtension` row continues the clip by `durationSeconds` more. */
|
|
111
112
|
taskType?: "reference" | "edit" | "extend";
|
|
113
|
+
/** Continue a provider-side session instead of re-sending the clip (Gemini Omni
|
|
114
|
+
* Interactions `previous_interaction_id`). The prior call's `VideoResult.providerRef`
|
|
115
|
+
* carries it. The provider rejects it together with an explicit video task, so the
|
|
116
|
+
* adapter sends the prompt alone; `taskType: "extend"` still selects the extend path. */
|
|
117
|
+
previousInteractionId?: string;
|
|
112
118
|
mode?: "standard" | "pro";
|
|
113
119
|
}
|
|
114
120
|
/**
|
|
@@ -160,7 +166,9 @@ interface MediaPart {
|
|
|
160
166
|
cleanup?: () => Promise<void>;
|
|
161
167
|
}
|
|
162
168
|
type RequiredInput = "firstFrame" | "sourceVideo" | "references";
|
|
163
|
-
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental"
|
|
169
|
+
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental"
|
|
170
|
+
/** Video rows that extend a clip in fixed segments up to a cumulative cap (see `ModelConstraints.extension`). */
|
|
171
|
+
| "videoExtension";
|
|
164
172
|
interface VideoSecondsLimits {
|
|
165
173
|
/** Minimum length of each reference video, in seconds. */
|
|
166
174
|
min?: number;
|
|
@@ -210,6 +218,12 @@ interface ModelConstraints {
|
|
|
210
218
|
/** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
|
|
211
219
|
inReferenceTotal?: boolean;
|
|
212
220
|
};
|
|
221
|
+
/** Video extension (rows with `supports: ["videoExtension"]`): each `taskType: "extend"`
|
|
222
|
+
* call adds up to `segmentSeconds` and the clip can grow to `maxTotalSeconds`. */
|
|
223
|
+
extension?: {
|
|
224
|
+
segmentSeconds: number;
|
|
225
|
+
maxTotalSeconds: number;
|
|
226
|
+
};
|
|
213
227
|
}
|
|
214
228
|
/** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
|
|
215
229
|
type JsonPrimitive = string | number | boolean | null;
|
|
@@ -351,6 +365,10 @@ interface VideoResult {
|
|
|
351
365
|
};
|
|
352
366
|
usage: UsageEvent;
|
|
353
367
|
raw?: unknown;
|
|
368
|
+
/** Provider handle for chaining a follow-up call (`VideoRequest.previousInteractionId`). */
|
|
369
|
+
providerRef?: {
|
|
370
|
+
interactionId: string;
|
|
371
|
+
};
|
|
354
372
|
}
|
|
355
373
|
interface VideoCallJob extends VideoJob {
|
|
356
374
|
warnings: Warning[];
|
|
@@ -613,6 +631,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
613
631
|
safetyChecker: "safetyChecker";
|
|
614
632
|
taskType: "taskType";
|
|
615
633
|
instrumental: "instrumental";
|
|
634
|
+
videoExtension: "videoExtension";
|
|
616
635
|
}>>>;
|
|
617
636
|
ratioIgnoredWith: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
618
637
|
firstFrame: "firstFrame";
|
|
@@ -624,6 +643,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
624
643
|
editMin: z.ZodOptional<z.ZodNumber>;
|
|
625
644
|
inReferenceTotal: z.ZodOptional<z.ZodBoolean>;
|
|
626
645
|
}, z.core.$loose>>;
|
|
646
|
+
extension: z.ZodOptional<z.ZodObject<{
|
|
647
|
+
segmentSeconds: z.ZodNumber;
|
|
648
|
+
maxTotalSeconds: z.ZodNumber;
|
|
649
|
+
}, z.core.$loose>>;
|
|
627
650
|
}, z.core.$loose>;
|
|
628
651
|
defaults: z.ZodObject<{
|
|
629
652
|
references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
package/dist/catalog.d.ts
CHANGED
|
@@ -107,8 +107,14 @@ interface VideoRequest {
|
|
|
107
107
|
watermark?: boolean;
|
|
108
108
|
/** Provider-side safety checker toggle (fal MiniMax). Provider default when unset. */
|
|
109
109
|
safetyChecker?: boolean;
|
|
110
|
-
/** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio.
|
|
110
|
+
/** Seedance omni-reference subtask hint. `edit` forces duration -1 and adaptive ratio.
|
|
111
|
+
* `extend` on a `videoExtension` row continues the clip by `durationSeconds` more. */
|
|
111
112
|
taskType?: "reference" | "edit" | "extend";
|
|
113
|
+
/** Continue a provider-side session instead of re-sending the clip (Gemini Omni
|
|
114
|
+
* Interactions `previous_interaction_id`). The prior call's `VideoResult.providerRef`
|
|
115
|
+
* carries it. The provider rejects it together with an explicit video task, so the
|
|
116
|
+
* adapter sends the prompt alone; `taskType: "extend"` still selects the extend path. */
|
|
117
|
+
previousInteractionId?: string;
|
|
112
118
|
mode?: "standard" | "pro";
|
|
113
119
|
}
|
|
114
120
|
/**
|
|
@@ -160,7 +166,9 @@ interface MediaPart {
|
|
|
160
166
|
cleanup?: () => Promise<void>;
|
|
161
167
|
}
|
|
162
168
|
type RequiredInput = "firstFrame" | "sourceVideo" | "references";
|
|
163
|
-
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental"
|
|
169
|
+
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental"
|
|
170
|
+
/** Video rows that extend a clip in fixed segments up to a cumulative cap (see `ModelConstraints.extension`). */
|
|
171
|
+
| "videoExtension";
|
|
164
172
|
interface VideoSecondsLimits {
|
|
165
173
|
/** Minimum length of each reference video, in seconds. */
|
|
166
174
|
min?: number;
|
|
@@ -210,6 +218,12 @@ interface ModelConstraints {
|
|
|
210
218
|
/** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
|
|
211
219
|
inReferenceTotal?: boolean;
|
|
212
220
|
};
|
|
221
|
+
/** Video extension (rows with `supports: ["videoExtension"]`): each `taskType: "extend"`
|
|
222
|
+
* call adds up to `segmentSeconds` and the clip can grow to `maxTotalSeconds`. */
|
|
223
|
+
extension?: {
|
|
224
|
+
segmentSeconds: number;
|
|
225
|
+
maxTotalSeconds: number;
|
|
226
|
+
};
|
|
213
227
|
}
|
|
214
228
|
/** JSON-compatible value. Provider options and raw payloads carry these, never `unknown`. */
|
|
215
229
|
type JsonPrimitive = string | number | boolean | null;
|
|
@@ -351,6 +365,10 @@ interface VideoResult {
|
|
|
351
365
|
};
|
|
352
366
|
usage: UsageEvent;
|
|
353
367
|
raw?: unknown;
|
|
368
|
+
/** Provider handle for chaining a follow-up call (`VideoRequest.previousInteractionId`). */
|
|
369
|
+
providerRef?: {
|
|
370
|
+
interactionId: string;
|
|
371
|
+
};
|
|
354
372
|
}
|
|
355
373
|
interface VideoCallJob extends VideoJob {
|
|
356
374
|
warnings: Warning[];
|
|
@@ -613,6 +631,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
613
631
|
safetyChecker: "safetyChecker";
|
|
614
632
|
taskType: "taskType";
|
|
615
633
|
instrumental: "instrumental";
|
|
634
|
+
videoExtension: "videoExtension";
|
|
616
635
|
}>>>;
|
|
617
636
|
ratioIgnoredWith: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
618
637
|
firstFrame: "firstFrame";
|
|
@@ -624,6 +643,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
624
643
|
editMin: z.ZodOptional<z.ZodNumber>;
|
|
625
644
|
inReferenceTotal: z.ZodOptional<z.ZodBoolean>;
|
|
626
645
|
}, z.core.$loose>>;
|
|
646
|
+
extension: z.ZodOptional<z.ZodObject<{
|
|
647
|
+
segmentSeconds: z.ZodNumber;
|
|
648
|
+
maxTotalSeconds: z.ZodNumber;
|
|
649
|
+
}, z.core.$loose>>;
|
|
627
650
|
}, z.core.$loose>;
|
|
628
651
|
defaults: z.ZodObject<{
|
|
629
652
|
references: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
package/dist/catalog.js
CHANGED
|
@@ -1391,7 +1391,14 @@ var VIDEO_MODELS = [
|
|
|
1391
1391
|
durations: [3, 4, 5, 6, 7, 8, 9, 10],
|
|
1392
1392
|
references: { images: 6, videos: 1, videoSeconds: { max: 10 } },
|
|
1393
1393
|
sourceVideoSeconds: { max: 10 },
|
|
1394
|
-
|
|
1394
|
+
// Extension (probe 2026-09-24, 360p): each `taskType: "extend"` call
|
|
1395
|
+
// renders `durationSeconds` more and returns the FULL cumulative clip
|
|
1396
|
+
// (3 s -> 6 s -> 9 s); the provider caps the clip at 40 s. A first
|
|
1397
|
+
// extension can upload a <= 10 s source with task "extend"; later ones
|
|
1398
|
+
// chain by `previousInteractionId` (the API rejects the id together
|
|
1399
|
+
// with a video task, so those calls carry the prompt alone).
|
|
1400
|
+
supports: ["videoExtension"],
|
|
1401
|
+
extension: { segmentSeconds: 10, maxTotalSeconds: 40 }
|
|
1395
1402
|
},
|
|
1396
1403
|
defaults: {},
|
|
1397
1404
|
usage: { ...VIDEO_USAGE },
|
|
@@ -1399,7 +1406,7 @@ var VIDEO_MODELS = [
|
|
|
1399
1406
|
display: {
|
|
1400
1407
|
provider: "google",
|
|
1401
1408
|
logo: GOOGLE_LOGO2,
|
|
1402
|
-
description: "Google Gemini Omni Flash 1.1 conversational video generation and
|
|
1409
|
+
description: "Google Gemini Omni Flash 1.1 conversational video generation, editing and extension; text, image, and up to 10-second video input, 3-10 second output at up to 4K and 24 FPS, extendable to 40 seconds."
|
|
1403
1410
|
},
|
|
1404
1411
|
capabilities: { acceptsSourceVideo: true }
|
|
1405
1412
|
},
|
|
@@ -2130,6 +2137,7 @@ var SupportedOptionSchema = z2.enum([
|
|
|
2130
2137
|
"watermark",
|
|
2131
2138
|
"safetyChecker",
|
|
2132
2139
|
"taskType",
|
|
2140
|
+
"videoExtension",
|
|
2133
2141
|
"instrumental"
|
|
2134
2142
|
]);
|
|
2135
2143
|
var UsageUnitSchema = z2.enum([
|
|
@@ -2177,7 +2185,8 @@ var ModelConstraintsSchema = z2.looseObject({
|
|
|
2177
2185
|
requires: z2.array(RequiredInputSchema).optional(),
|
|
2178
2186
|
supports: z2.array(SupportedOptionSchema).optional(),
|
|
2179
2187
|
ratioIgnoredWith: z2.array(z2.enum(["firstFrame", "sourceVideo"])).optional(),
|
|
2180
|
-
sourceVideoSeconds: VideoSecondsLimitsSchema.omit({ total: true }).extend({ inReferenceTotal: z2.boolean().optional() }).optional()
|
|
2188
|
+
sourceVideoSeconds: VideoSecondsLimitsSchema.omit({ total: true }).extend({ inReferenceTotal: z2.boolean().optional() }).optional(),
|
|
2189
|
+
extension: z2.looseObject({ segmentSeconds: z2.number(), maxTotalSeconds: z2.number() }).optional()
|
|
2181
2190
|
});
|
|
2182
2191
|
var MediaRefSchema = z2.union([
|
|
2183
2192
|
z2.looseObject({
|
|
@@ -2924,6 +2933,7 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
|
|
|
2924
2933
|
setOrDelete(merged, "referenceImages", images);
|
|
2925
2934
|
setOrDelete(merged, "referenceVideos", videos);
|
|
2926
2935
|
setOrDelete(merged, "referenceAudios", audios);
|
|
2936
|
+
const keepExtend = merged.taskType === "extend" && (model.constraints.supports ?? []).includes("videoExtension");
|
|
2927
2937
|
dropUnsupported(merged, model, warnings, [
|
|
2928
2938
|
"seed",
|
|
2929
2939
|
"negativePrompt",
|
|
@@ -2933,8 +2943,17 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
|
|
|
2933
2943
|
"lastFrame",
|
|
2934
2944
|
"watermark",
|
|
2935
2945
|
"safetyChecker",
|
|
2936
|
-
"taskType"
|
|
2946
|
+
...keepExtend ? [] : ["taskType"]
|
|
2937
2947
|
]);
|
|
2948
|
+
if (merged.previousInteractionId !== void 0 && !keepExtend) {
|
|
2949
|
+
warnings.push({
|
|
2950
|
+
code: "option_ignored",
|
|
2951
|
+
field: "previousInteractionId",
|
|
2952
|
+
from: merged.previousInteractionId,
|
|
2953
|
+
message: `${model.id} does not support previousInteractionId; ignored`
|
|
2954
|
+
});
|
|
2955
|
+
delete merged.previousInteractionId;
|
|
2956
|
+
}
|
|
2938
2957
|
return { request: merged, warnings };
|
|
2939
2958
|
}
|
|
2940
2959
|
function resolveAudioOptions(model, request, onUnsupported = "error") {
|