videodraft 0.4.0 → 0.4.1
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.js +22 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24,8 +24,8 @@ function readVersionFromDisk() {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function resolveVersion() {
|
|
27
|
-
if ("0.4.
|
|
28
|
-
return "0.4.
|
|
27
|
+
if ("0.4.1") {
|
|
28
|
+
return "0.4.1";
|
|
29
29
|
}
|
|
30
30
|
return readVersionFromDisk();
|
|
31
31
|
}
|
|
@@ -3799,6 +3799,14 @@ function positiveNumber2(value, label) {
|
|
|
3799
3799
|
}
|
|
3800
3800
|
return parsed;
|
|
3801
3801
|
}
|
|
3802
|
+
function nonNegativeInteger(value, label) {
|
|
3803
|
+
if (value === void 0) return void 0;
|
|
3804
|
+
const parsed = Number(value);
|
|
3805
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
3806
|
+
throw new UsageError(`${label} must be a non-negative integer.`);
|
|
3807
|
+
}
|
|
3808
|
+
return parsed;
|
|
3809
|
+
}
|
|
3802
3810
|
function chooseEditModel(explicit, refCount) {
|
|
3803
3811
|
if (explicit) {
|
|
3804
3812
|
if (!VIDEO_EDIT_MODELS.has(explicit)) {
|
|
@@ -3820,11 +3828,13 @@ function registerEditCommands(program) {
|
|
|
3820
3828
|
).option("--ref <url|file>", "reference image (repeatable)", collect2, []).option("--resolution <res>", "model-specific output resolution").option("--quality <tier>", "Kling O3 only: standard or pro").option(
|
|
3821
3829
|
"--duration <seconds>",
|
|
3822
3830
|
"Wan 2.7 only: 2-10s; other edit models follow the source/model duration"
|
|
3823
|
-
).option("--preserve-audio", "preserve original source audio when supported").option("--project <id>", "group in a project's AI Studio session").option("--session <id>", "AI Studio session id").option("--download <path>", "download the finished video").option("--no-wait", "submit and return the job id immediately").option("--estimate", "print the cost estimate and exit").action(async function(videoSource, promptWords) {
|
|
3831
|
+
).option("--preserve-audio", "preserve original source audio when supported").option("--project <id>", "group in a project's AI Studio session").option("--session <id>", "AI Studio session id").option("--scene <n>", "0-based scene index").option("--shot <n>", "0-based shot index").option("--download <path>", "download the finished video").option("--no-wait", "submit and return the job id immediately").option("--estimate", "print the cost estimate and exit").action(async function(videoSource, promptWords) {
|
|
3824
3832
|
const ctx = buildContext(this);
|
|
3825
3833
|
const opts = this.opts();
|
|
3826
3834
|
const model = chooseEditModel(opts.model, (opts.ref ?? []).length);
|
|
3827
3835
|
const duration = positiveNumber2(opts.duration, "--duration");
|
|
3836
|
+
const sceneIndex = nonNegativeInteger(opts.scene, "--scene");
|
|
3837
|
+
const shotIndex = nonNegativeInteger(opts.shot, "--shot");
|
|
3828
3838
|
const refCount = (opts.ref ?? []).length;
|
|
3829
3839
|
const maxRefs = model === "happy-horse-video-edit" ? 5 : model === "kling-o3-video-ref-edit" ? 4 : model === "wan-2.7-ref-edit" ? 1 : 0;
|
|
3830
3840
|
if (refCount > maxRefs) {
|
|
@@ -3885,7 +3895,9 @@ function registerEditCommands(program) {
|
|
|
3885
3895
|
duration_seconds: duration,
|
|
3886
3896
|
preserve_audio: opts.preserveAudio ? true : void 0,
|
|
3887
3897
|
project_id: opts.project,
|
|
3888
|
-
session_id: opts.session
|
|
3898
|
+
session_id: opts.session,
|
|
3899
|
+
scene_index: sceneIndex,
|
|
3900
|
+
shot_index: shotIndex
|
|
3889
3901
|
})
|
|
3890
3902
|
);
|
|
3891
3903
|
await handleAsyncJob(ctx, submitted, {
|
|
@@ -3900,7 +3912,7 @@ function registerEditCommands(program) {
|
|
|
3900
3912
|
).option("--quality <tier>", "standard or pro (default pro)").option(
|
|
3901
3913
|
"--orientation <mode>",
|
|
3902
3914
|
"video (30s cap) or image (10s cap); defaults to the model setting"
|
|
3903
|
-
).option("--no-original-sound", "remove sound from the motion reference").option("--duration <seconds>", "optional estimate hint").option("--project <id>", "group in a project's AI Studio session").option("--session <id>", "AI Studio session id").option("--download <path>", "download the finished video").option("--no-wait", "submit and return the job id immediately").option("--estimate", "print the cost estimate and exit").action(async function(imageSource, promptWords) {
|
|
3915
|
+
).option("--no-original-sound", "remove sound from the motion reference").option("--duration <seconds>", "optional estimate hint").option("--project <id>", "group in a project's AI Studio session").option("--session <id>", "AI Studio session id").option("--scene <n>", "0-based scene index").option("--shot <n>", "0-based shot index").option("--download <path>", "download the finished video").option("--no-wait", "submit and return the job id immediately").option("--estimate", "print the cost estimate and exit").action(async function(imageSource, promptWords) {
|
|
3904
3916
|
const ctx = buildContext(this);
|
|
3905
3917
|
const opts = this.opts();
|
|
3906
3918
|
const model = opts.model ?? "kling-v3-motion-control";
|
|
@@ -3910,6 +3922,8 @@ function registerEditCommands(program) {
|
|
|
3910
3922
|
);
|
|
3911
3923
|
}
|
|
3912
3924
|
const duration = positiveNumber2(opts.duration, "--duration");
|
|
3925
|
+
const sceneIndex = nonNegativeInteger(opts.scene, "--scene");
|
|
3926
|
+
const shotIndex = nonNegativeInteger(opts.shot, "--shot");
|
|
3913
3927
|
if (opts.quality && !["standard", "pro"].includes(opts.quality)) {
|
|
3914
3928
|
throw new UsageError('--quality must be "standard" or "pro".');
|
|
3915
3929
|
}
|
|
@@ -3958,7 +3972,9 @@ function registerEditCommands(program) {
|
|
|
3958
3972
|
character_orientation: opts.orientation,
|
|
3959
3973
|
keep_original_sound: opts.originalSound !== false,
|
|
3960
3974
|
project_id: opts.project,
|
|
3961
|
-
session_id: opts.session
|
|
3975
|
+
session_id: opts.session,
|
|
3976
|
+
scene_index: sceneIndex,
|
|
3977
|
+
shot_index: shotIndex
|
|
3962
3978
|
})
|
|
3963
3979
|
);
|
|
3964
3980
|
await handleAsyncJob(ctx, submitted, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "videodraft",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Official VideoDraft CLI — create AI videos, images and audio from your terminal. Agent-friendly: --json everywhere, stable exit codes, async job polling.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|