@nodaro/cli 1.4.0 → 1.5.0
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 +51 -4
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var require_package = __commonJS({
|
|
|
29
29
|
"package.json"(exports$1, module) {
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@nodaro/cli",
|
|
32
|
-
version: "1.
|
|
32
|
+
version: "1.5.0",
|
|
33
33
|
description: "Command-line interface for Nodaro \u2014 list and run workflows, inspect jobs and executions, manage projects from the terminal.",
|
|
34
34
|
type: "module",
|
|
35
35
|
license: "Apache-2.0",
|
|
@@ -70,11 +70,11 @@ var require_package = __commonJS({
|
|
|
70
70
|
"@inquirer/confirm": "^6.0.12",
|
|
71
71
|
"@inquirer/input": "^5.0.12",
|
|
72
72
|
"@inquirer/select": "^5.1.4",
|
|
73
|
-
"@nodaro/sdk": "^1.
|
|
74
|
-
"@nodaro/shared": "^1.
|
|
73
|
+
"@nodaro/sdk": "^1.8.0",
|
|
74
|
+
"@nodaro/shared": "^1.14.0",
|
|
75
75
|
commander: "^12.1.0",
|
|
76
76
|
picocolors: "^1.1.1",
|
|
77
|
-
"@nodaro/prompts": "^1.0
|
|
77
|
+
"@nodaro/prompts": "^1.4.0"
|
|
78
78
|
},
|
|
79
79
|
devDependencies: {
|
|
80
80
|
tsup: "^8.5.0",
|
|
@@ -744,6 +744,52 @@ function jobsCommand() {
|
|
|
744
744
|
});
|
|
745
745
|
return cmd;
|
|
746
746
|
}
|
|
747
|
+
function videoProCommand() {
|
|
748
|
+
const cmd = new Command("video-pro").description(
|
|
749
|
+
"stop / continue generate-video-pro runs (segmented long-video engine)"
|
|
750
|
+
);
|
|
751
|
+
cmd.command("stop <jobId>").description(
|
|
752
|
+
"gracefully stop a running job: keep + deliver the completed segments as the final video, refund the rest (the in-flight segment is billed \u2014 the provider keeps rendering it)"
|
|
753
|
+
).option("--profile <name>").option("--json").action(async (jobId, opts) => {
|
|
754
|
+
try {
|
|
755
|
+
const client = buildClient(opts.profile);
|
|
756
|
+
const result = await client.videoPro.stop(jobId);
|
|
757
|
+
if (opts.json) {
|
|
758
|
+
emit(result, opts);
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
if (result.stopping) {
|
|
762
|
+
success(`stop requested for ${jobId} \u2014 the engine finalizes the partial within seconds`);
|
|
763
|
+
dim(`follow: nodaro jobs get ${jobId}`);
|
|
764
|
+
} else {
|
|
765
|
+
success(`job ${jobId} had not started \u2014 cancelled with a full refund`);
|
|
766
|
+
}
|
|
767
|
+
} catch (err) {
|
|
768
|
+
handleError(err);
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
cmd.command("continue <jobId>").description(
|
|
772
|
+
"continue a stopped/failed/completed run as a NEW job \u2014 reuses the delivered segments, regenerates from --from-segment on (default: the first missing one); billed only for the regenerated segments"
|
|
773
|
+
).option("--from-segment <n>", "1-based segment to regenerate from (overrides everything from that point)", (v) => parseInt(v, 10)).option("--watch", "poll the new job until it finishes").option("--poll-interval <ms>", "poll interval with --watch", (v) => parseInt(v, 10)).option("--profile <name>").option("--json").action(
|
|
774
|
+
async (jobId, opts) => {
|
|
775
|
+
try {
|
|
776
|
+
const client = buildClient(opts.profile);
|
|
777
|
+
const result = await client.videoPro.continueRun(jobId, {
|
|
778
|
+
...opts.fromSegment !== void 0 ? { fromSegment: opts.fromSegment } : {}
|
|
779
|
+
});
|
|
780
|
+
await reportQueuedJob({ jobId: result.jobId }, () => client.jobs.getStatus(result.jobId), {
|
|
781
|
+
json: opts.json,
|
|
782
|
+
watch: opts.watch,
|
|
783
|
+
pollInterval: opts.pollInterval,
|
|
784
|
+
note: result.fromSegment !== void 0 ? `continues ${jobId} from segment ${result.fromSegment}` : `continues ${jobId}`
|
|
785
|
+
});
|
|
786
|
+
} catch (err) {
|
|
787
|
+
handleError(err);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
);
|
|
791
|
+
return cmd;
|
|
792
|
+
}
|
|
747
793
|
function executionsCommand() {
|
|
748
794
|
const cmd = new Command("executions").description("inspect and cancel workflow executions");
|
|
749
795
|
cmd.command("get <id>").description("show one execution by id (use --watch to follow until completion)").option("--profile <name>").option("--json").option("--watch", "poll until terminal status (completed/failed/cancelled)").action(async (id, opts) => {
|
|
@@ -3371,6 +3417,7 @@ program.addCommand(workflowsCommand());
|
|
|
3371
3417
|
program.addCommand(appsCommand());
|
|
3372
3418
|
program.addCommand(nodesCommand());
|
|
3373
3419
|
program.addCommand(jobsCommand());
|
|
3420
|
+
program.addCommand(videoProCommand());
|
|
3374
3421
|
program.addCommand(executionsCommand());
|
|
3375
3422
|
program.addCommand(charactersCommand());
|
|
3376
3423
|
program.addCommand(promptCommand());
|