@nodaro/cli 1.39.0 → 1.41.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/README.md +2 -2
- package/dist/index.js +174 -37
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ nodaro nodes run <type> --params-file body.json [--watch] [--poll-interval 1000]
|
|
|
124
124
|
|
|
125
125
|
# Models — browse the model catalog (makers, capability sheets, credit pricing, prompt tips)
|
|
126
126
|
nodaro models list [--kind video] [--mode i2v] [--family Google] [--featured]
|
|
127
|
-
nodaro models cost <id…> # credits charged per id; a metered LLM key (llm-chat:<model>) prints
|
|
127
|
+
nodaro models cost <id…> # credits charged per id; a metered LLM key (llm-chat:<model>) prints ≈N, an estimate
|
|
128
128
|
|
|
129
129
|
# Pickers — valid values for parameter-picker nodes (setting, mood, person, …)
|
|
130
130
|
nodaro pickers list # all picker node types + option counts + pictures
|
|
@@ -142,7 +142,7 @@ nodaro recast estimate --analysis-job <id> # quote credits before c
|
|
|
142
142
|
nodaro recast create --workflow <id> --analysis-job <id> # BUYS THE PLAN
|
|
143
143
|
nodaro recast start <recastId> && nodaro recast status <recastId>
|
|
144
144
|
|
|
145
|
-
# Trends — ready-made
|
|
145
|
+
# Trends — ready-made Nodaro Motion recipes: put your own pictures in a trend (Cloud)
|
|
146
146
|
nodaro trends list [--search <text>] [--favorites] # the catalog
|
|
147
147
|
nodaro trends get <slug> # its slots, examples, resolutions
|
|
148
148
|
nodaro trends estimate <slug> --slot person=<url>,<url> --choice person.outfit=original # free quote
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var require_package = __commonJS({
|
|
|
41
41
|
"package.json"(exports$1, module) {
|
|
42
42
|
module.exports = {
|
|
43
43
|
name: "@nodaro/cli",
|
|
44
|
-
version: "1.
|
|
44
|
+
version: "1.41.0",
|
|
45
45
|
description: "Command-line interface for Nodaro \u2014 list and run workflows, inspect jobs and executions, manage projects from the terminal.",
|
|
46
46
|
type: "module",
|
|
47
47
|
license: "Apache-2.0",
|
|
@@ -82,11 +82,11 @@ var require_package = __commonJS({
|
|
|
82
82
|
"@inquirer/confirm": "^6.0.12",
|
|
83
83
|
"@inquirer/input": "^5.0.12",
|
|
84
84
|
"@inquirer/select": "^5.1.4",
|
|
85
|
-
"@nodaro/sdk": "^2.
|
|
86
|
-
"@nodaro/shared": "^3.
|
|
85
|
+
"@nodaro/sdk": "^2.46.0",
|
|
86
|
+
"@nodaro/shared": "^3.44.0",
|
|
87
87
|
commander: "^12.1.0",
|
|
88
88
|
picocolors: "^1.1.1",
|
|
89
|
-
"@nodaro/prompts": "^1.42.
|
|
89
|
+
"@nodaro/prompts": "^1.42.1"
|
|
90
90
|
},
|
|
91
91
|
devDependencies: {
|
|
92
92
|
tsup: "^8.5.0",
|
|
@@ -413,7 +413,7 @@ function saveWorkspace(profileName, workspaceId) {
|
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
// src/client.ts
|
|
416
|
-
var CLI_VERSION = "1.
|
|
416
|
+
var CLI_VERSION = "1.41.0" ;
|
|
417
417
|
function buildPublicClient(opts = {}) {
|
|
418
418
|
const { profile } = getProfile(opts.profile);
|
|
419
419
|
return createClient({
|
|
@@ -552,7 +552,7 @@ function sessionsCommand() {
|
|
|
552
552
|
const cmd = new Command("sessions").description(
|
|
553
553
|
"generation sessions inside projects: list, read, create, rename, archive, import, remove, delete"
|
|
554
554
|
);
|
|
555
|
-
cmd.command("list").description("your sessions, newest first").option("--project <id>", "only this project's sessions").option("--tool <tool>", "only this tool's sessions, e.g. create-image").option("--archived", "include archived sessions").option("--limit <n>", "page size (1-100)").option("--cursor <cursor>", "the previous page's next").option("--profile <name>").option("--json").action(async (opts) => {
|
|
555
|
+
cmd.command("list").description("your sessions, newest first").option("--project <id>", "only this project's sessions (none: the sessions with no project)").option("--tool <tool>", "only this tool's sessions, e.g. create-image").option("--archived", "include archived sessions").option("--limit <n>", "page size (1-100)").option("--cursor <cursor>", "the previous page's next").option("--profile <name>").option("--json").action(async (opts) => {
|
|
556
556
|
try {
|
|
557
557
|
const client = buildClient(opts.profile);
|
|
558
558
|
const page = await client.sessions.list({
|
|
@@ -590,9 +590,10 @@ function sessionsCommand() {
|
|
|
590
590
|
handleError(err);
|
|
591
591
|
}
|
|
592
592
|
});
|
|
593
|
-
cmd.command("items <id>").description("a session's items, born-in and imported, newest first").option("--limit <n>", "page size (1-100)").option("--cursor <cursor>", "the previous page's next").option("--profile <name>").option("--json").action(async (id, opts) => {
|
|
593
|
+
cmd.command("items <id>").description("a session's items, born-in and imported, newest first").option("--removed", "the items removed from it (its Trash) instead").option("--limit <n>", "page size (1-100)").option("--cursor <cursor>", "the previous page's next").option("--profile <name>").option("--json").action(async (id, opts) => {
|
|
594
594
|
try {
|
|
595
595
|
const page = await buildClient(opts.profile).sessions.items(id, {
|
|
596
|
+
removed: opts.removed,
|
|
596
597
|
limit: opts.limit ? Number(opts.limit) : void 0,
|
|
597
598
|
cursor: opts.cursor
|
|
598
599
|
});
|
|
@@ -605,9 +606,9 @@ function sessionsCommand() {
|
|
|
605
606
|
jobId: i.jobId,
|
|
606
607
|
status: i.job.status,
|
|
607
608
|
imported: i.imported ? `from ${i.importedFrom?.title ?? i.importedFrom?.sessionId ?? "?"}` : "",
|
|
608
|
-
addedAt: i.addedAt
|
|
609
|
+
...opts.removed ? { removedAt: i.removedAt ?? "" } : { addedAt: i.addedAt }
|
|
609
610
|
})),
|
|
610
|
-
["jobId", "status", "imported", "addedAt"]
|
|
611
|
+
["jobId", "status", "imported", opts.removed ? "removedAt" : "addedAt"]
|
|
611
612
|
);
|
|
612
613
|
if (page.next) dim(`next: --cursor ${page.next}`);
|
|
613
614
|
} catch (err) {
|
|
@@ -660,14 +661,38 @@ function sessionsCommand() {
|
|
|
660
661
|
handleError(err);
|
|
661
662
|
}
|
|
662
663
|
});
|
|
663
|
-
cmd.command("
|
|
664
|
+
cmd.command("move <id>").description("move items of another session into this one, all-or-nothing (the source keeps them in its Trash)").requiredOption("--from <sessionId>", "the session they are in now").requiredOption("--jobs <ids>", "job ids, comma- or space-separated (up to 100)").option("--profile <name>").option("--json").action(async (id, opts) => {
|
|
664
665
|
try {
|
|
665
|
-
await buildClient(opts.profile).sessions.
|
|
666
|
+
const result = await buildClient(opts.profile).sessions.moveItems(id, { jobIds: idList(opts.jobs), fromSessionId: opts.from });
|
|
667
|
+
if (opts.json) {
|
|
668
|
+
emit(result.data, opts);
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
success(`moved ${result.data.moved} into session ${id}`);
|
|
672
|
+
} catch (err) {
|
|
673
|
+
handleError(err);
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
cmd.command("remove <id> <jobId>").description("remove one item from a session: to its Trash (the job stays); --forever deletes a removed one for good").option("--forever", "delete an item already removed, for good (the job stays)").option("--profile <name>").option("--json").action(async (id, jobId, opts) => {
|
|
677
|
+
try {
|
|
678
|
+
await buildClient(opts.profile).sessions.removeItem(id, jobId, { forever: opts.forever });
|
|
679
|
+
if (opts.json) {
|
|
680
|
+
emit({ success: true, id, jobId }, opts);
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
success(opts.forever ? `deleted ${jobId} from session ${id} for good` : `removed ${jobId} from session ${id} (in its Trash)`);
|
|
684
|
+
} catch (err) {
|
|
685
|
+
handleError(err);
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
cmd.command("restore <id> <jobId>").description("bring a removed item back into its session").option("--profile <name>").option("--json").action(async (id, jobId, opts) => {
|
|
689
|
+
try {
|
|
690
|
+
await buildClient(opts.profile).sessions.restoreItem(id, jobId);
|
|
666
691
|
if (opts.json) {
|
|
667
692
|
emit({ success: true, id, jobId }, opts);
|
|
668
693
|
return;
|
|
669
694
|
}
|
|
670
|
-
success(`
|
|
695
|
+
success(`restored ${jobId} in session ${id}`);
|
|
671
696
|
} catch (err) {
|
|
672
697
|
handleError(err);
|
|
673
698
|
}
|
|
@@ -686,6 +711,39 @@ function sessionsCommand() {
|
|
|
686
711
|
});
|
|
687
712
|
return cmd;
|
|
688
713
|
}
|
|
714
|
+
function trashCommand() {
|
|
715
|
+
const cmd = new Command("trash").description("the Trash: items removed from sessions, and deleted jobs");
|
|
716
|
+
cmd.command("list", { isDefault: true }).description("the Trash, newest first (restore: nodaro sessions restore / nodaro jobs restore)").option("--project <id>", "one project's Trash (none: the sessions with no project, and General)").option("--tool <tool>", "what a session of this tool holds or held, e.g. create-image").option("--type <types>", "only these input_data.type values, comma-separated (e.g. generate-image)").option("--limit <n>", "page size (1-100)").option("--cursor <cursor>", "the previous page's next").option("--profile <name>").option("--json").action(async (opts) => {
|
|
717
|
+
try {
|
|
718
|
+
const page = await buildClient(opts.profile).trash.list({
|
|
719
|
+
projectId: opts.project,
|
|
720
|
+
tool: opts.tool,
|
|
721
|
+
type: opts.type,
|
|
722
|
+
limit: opts.limit ? Number(opts.limit) : void 0,
|
|
723
|
+
cursor: opts.cursor
|
|
724
|
+
});
|
|
725
|
+
if (opts.json) {
|
|
726
|
+
emit(page, opts);
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
table(
|
|
730
|
+
page.data.map((e) => ({
|
|
731
|
+
kind: e.kind,
|
|
732
|
+
jobId: e.job.id,
|
|
733
|
+
type: e.job.input_data?.type ?? e.job.job_type ?? "",
|
|
734
|
+
from: e.kind === "removed" ? e.session.title ?? e.session.id : "",
|
|
735
|
+
at: e.kind === "removed" ? e.removedAt : e.deletedAt,
|
|
736
|
+
purgeAt: e.kind === "deleted" ? e.purgeAt : ""
|
|
737
|
+
})),
|
|
738
|
+
["kind", "jobId", "type", "from", "at", "purgeAt"]
|
|
739
|
+
);
|
|
740
|
+
if (page.next) dim(`next: --cursor ${page.next}`);
|
|
741
|
+
} catch (err) {
|
|
742
|
+
handleError(err);
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
return cmd;
|
|
746
|
+
}
|
|
689
747
|
function collectVariadic(value, previous) {
|
|
690
748
|
return [...previous ?? [], value];
|
|
691
749
|
}
|
|
@@ -1133,8 +1191,9 @@ function workflowsCommand() {
|
|
|
1133
1191
|
success(`Render final of ${renderNodeId} runs ${quote.nodeIds.join(", ")}`);
|
|
1134
1192
|
if (quote.estimatedCredits !== null) {
|
|
1135
1193
|
dim(
|
|
1136
|
-
//
|
|
1137
|
-
`estimated ${quote.estimatedCreditsIsEstimate ? "
|
|
1194
|
+
// `≈`: an LLM node in the run is charged its actual usage, so the figure is an estimate.
|
|
1195
|
+
`estimated ${quote.estimatedCreditsIsEstimate ? "\u2248" : ""}${quote.estimatedCredits} credits` + (quote.sufficient === false ? ` \u2014 not covered` + // The balance is checked against what the run holds while it renders: named when it is more than the price.
|
|
1196
|
+
(typeof quote.holdCredits === "number" && quote.holdCredits > quote.estimatedCredits ? `: holds up to about ${quote.holdCredits} credits while it renders` : "") + (quote.available !== null ? ` (${quote.available} available)` : "") : "")
|
|
1138
1197
|
);
|
|
1139
1198
|
}
|
|
1140
1199
|
return;
|
|
@@ -1310,8 +1369,8 @@ function ratingArg(value) {
|
|
|
1310
1369
|
throw new Error(`a rating is good, bad or clear (got "${value}")`);
|
|
1311
1370
|
}
|
|
1312
1371
|
function jobsCommand() {
|
|
1313
|
-
const cmd = new Command("jobs").description("list, inspect, rate and
|
|
1314
|
-
cmd.command("list").description("your jobs, newest first").option("--status <statuses>", "only these statuses, comma-separated (e.g. failed,cancelled)").option("--type <types>", "only these input_data.type values, comma-separated (e.g. generate-image)").option("--origin <origin>", "only jobs this client app sent").option("--source <sources>", "only jobs these surfaces created, comma-separated (mcp, web, cli, sdk, extension, app, api, internal)").option("--favorited", "only jobs you favorited").option("--no-favorited", "only jobs you did not favorite").option("--rating <rating>", "good, bad, rated (any) or unrated").option("--limit <n>", "page size (1-100)").option("--cursor <cursor>", "the previous page's next").option("--profile <name>").option("--json").action(async (opts) => {
|
|
1372
|
+
const cmd = new Command("jobs").description("list, inspect, rate, cancel, delete and restore jobs");
|
|
1373
|
+
cmd.command("list").description("your jobs, newest first").option("--status <statuses>", "only these statuses, comma-separated (e.g. failed,cancelled)").option("--type <types>", "only these input_data.type values, comma-separated (e.g. generate-image)").option("--origin <origin>", "only jobs this client app sent").option("--source <sources>", "only jobs these surfaces created, comma-separated (mcp, web, cli, sdk, extension, app, api, internal)").option("--favorited", "only jobs you favorited").option("--no-favorited", "only jobs you did not favorite").option("--rating <rating>", "good, bad, rated (any) or unrated").option("--project <id>", "only jobs a session of this project holds now (none: a session with no project)").option("--in-session", "only jobs at least one session holds").option("--no-in-session", "only jobs no session holds (General)").option("--with-sessions", "show the sessions each job is in").option("--limit <n>", "page size (1-100)").option("--cursor <cursor>", "the previous page's next").option("--profile <name>").option("--json").action(async (opts) => {
|
|
1315
1374
|
try {
|
|
1316
1375
|
const rating = ratingFilter(opts.rating);
|
|
1317
1376
|
const client = buildClient(opts.profile);
|
|
@@ -1322,6 +1381,9 @@ function jobsCommand() {
|
|
|
1322
1381
|
source: list(opts.source),
|
|
1323
1382
|
favorited: opts.favorited,
|
|
1324
1383
|
rating,
|
|
1384
|
+
projectId: opts.project,
|
|
1385
|
+
inSession: opts.inSession,
|
|
1386
|
+
withSessions: opts.withSessions,
|
|
1325
1387
|
limit: opts.limit ? Number(opts.limit) : void 0,
|
|
1326
1388
|
cursor: opts.cursor
|
|
1327
1389
|
});
|
|
@@ -1336,9 +1398,10 @@ function jobsCommand() {
|
|
|
1336
1398
|
type: job.input_data?.type ?? job.job_type ?? "",
|
|
1337
1399
|
favorited: job.favorited ? "yes" : "",
|
|
1338
1400
|
rating: job.rating ?? "",
|
|
1401
|
+
...opts.withSessions ? { sessions: (job.sessions ?? []).map((s) => s.title ?? s.id).join(", ") } : {},
|
|
1339
1402
|
created: job.created_at
|
|
1340
1403
|
})),
|
|
1341
|
-
["id", "status", "type", "favorited", "rating", "created"]
|
|
1404
|
+
["id", "status", "type", "favorited", "rating", ...opts.withSessions ? ["sessions"] : [], "created"]
|
|
1342
1405
|
);
|
|
1343
1406
|
if (page.next) dim(`next: --cursor ${page.next}`);
|
|
1344
1407
|
} catch (err) {
|
|
@@ -1376,6 +1439,26 @@ function jobsCommand() {
|
|
|
1376
1439
|
handleError(err);
|
|
1377
1440
|
}
|
|
1378
1441
|
});
|
|
1442
|
+
cmd.command("delete <id>").description("delete a job: to the Trash for 30 days, then for good (--forever: a job already in the Trash, now)").option("--forever", "delete a job already in the Trash for good, now").option("--profile <name>").option("--json").action(async (id, opts) => {
|
|
1443
|
+
try {
|
|
1444
|
+
const client = buildClient(opts.profile);
|
|
1445
|
+
const result = await client.jobs.delete(id, { forever: opts.forever });
|
|
1446
|
+
if (opts.json) emit(result, opts);
|
|
1447
|
+
else success(opts.forever ? `deleted job ${id} for good` : `deleted job ${id} (in the Trash for 30 days)`);
|
|
1448
|
+
} catch (err) {
|
|
1449
|
+
handleError(err);
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
cmd.command("restore <id>").description("bring a deleted job back from the Trash, into the sessions it was in").option("--profile <name>").option("--json").action(async (id, opts) => {
|
|
1453
|
+
try {
|
|
1454
|
+
const client = buildClient(opts.profile);
|
|
1455
|
+
const result = await client.jobs.restore(id);
|
|
1456
|
+
if (opts.json) emit(result, opts);
|
|
1457
|
+
else success(`restored job ${id}`);
|
|
1458
|
+
} catch (err) {
|
|
1459
|
+
handleError(err);
|
|
1460
|
+
}
|
|
1461
|
+
});
|
|
1379
1462
|
return cmd;
|
|
1380
1463
|
}
|
|
1381
1464
|
var MEDIA_TYPES = ["image", "video", "audio"];
|
|
@@ -1867,7 +1950,7 @@ async function pickNodeInteractively(client) {
|
|
|
1867
1950
|
}
|
|
1868
1951
|
function nodeCreditsLabel(n) {
|
|
1869
1952
|
if (n.creditCost === "unpriced") return "unpriced";
|
|
1870
|
-
return `${n.estimate ? "
|
|
1953
|
+
return `${n.estimate ? "\u2248" : ""}${n.creditCost} cr`;
|
|
1871
1954
|
}
|
|
1872
1955
|
function rejectPositionalParams(extras, example) {
|
|
1873
1956
|
if (!extras || extras.length === 0) return;
|
|
@@ -1900,7 +1983,7 @@ function nodesCommand() {
|
|
|
1900
1983
|
label: n.label,
|
|
1901
1984
|
category: n.category,
|
|
1902
1985
|
outputType: n.outputType,
|
|
1903
|
-
credits: n.creditCost === void 0 ? "" : n.estimate ?
|
|
1986
|
+
credits: n.creditCost === void 0 ? "" : n.estimate ? `\u2248${n.creditCost}` : n.creditCost,
|
|
1904
1987
|
providers: n.providers ? n.providers.length : ""
|
|
1905
1988
|
})),
|
|
1906
1989
|
["type", "label", "category", "outputType", "credits", "providers"]
|
|
@@ -3692,12 +3775,13 @@ image, passed through unchanged): \`nodaro jobs get <jobId>\`. Use the mask for
|
|
|
3692
3775
|
handleError(err);
|
|
3693
3776
|
}
|
|
3694
3777
|
});
|
|
3695
|
-
cmd.command("video-mask <videoUrl> <prompt>").description("track a subject described in text through a video (SAM 3.1, or --model sam-3 at half the price) and get a black-and-white mask video back (white = the subject)").option("--model <model>", `${VIDEO_MASK_PROVIDERS.join(" | ")} (default ${DEFAULT_VIDEO_MASK_PROVIDER})`).option("--threshold <n>", `detection confidence ${VIDEO_MASK_LIMITS.THRESHOLD_MIN}\u2013${VIDEO_MASK_LIMITS.THRESHOLD_MAX} (default ${VIDEO_MASK_LIMITS.THRESHOLD_DEFAULT}; lower finds more)`, parseFloat).option("--hold-last-mask", "keep the last mask on frames where the subject is lost (e.g. hidden behind a hand)").option("--min-subject-height <pct>", `ignore subjects smaller than this % of the frame height, ${VIDEO_MASK_LIMITS.MIN_SUBJECT_HEIGHT_PCT_MIN}\u2013${VIDEO_MASK_LIMITS.MIN_SUBJECT_HEIGHT_PCT_MAX} (default 0 = off)`, (v) => Number(v)).option("--max-subject-height <pct>", `ignore subjects larger than this % of the frame height, ${VIDEO_MASK_LIMITS.MAX_SUBJECT_HEIGHT_PCT_MIN}\u2013${VIDEO_MASK_LIMITS.MAX_SUBJECT_HEIGHT_PCT_MAX} (default 0 = off)`, (v) => Number(v)).option("--zone <L,R,T,B>", `keep only subjects whose centre is inside these left,right,top,bottom margins, each ${VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MIN}\u2013${VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MAX} % of the frame (default off)`).option("--per-shot", "detect the subject again in every shot after a scene cut").option("--watch", "poll until the job completes").option("--poll-interval <ms>", "watch poll interval in ms", (v) => parseInt(v, 10), 2e3).option("--profile <name>").option("--json").addHelpText("after", `
|
|
3778
|
+
cmd.command("video-mask <videoUrl> <prompt>").description("track a subject described in text through a video (SAM 3.1, or --model sam-3 at half the price) and get a black-and-white mask video back (white = the subject)").option("--model <model>", `${VIDEO_MASK_PROVIDERS.join(" | ")} (default ${DEFAULT_VIDEO_MASK_PROVIDER})`).option("--threshold <n>", `detection confidence ${VIDEO_MASK_LIMITS.THRESHOLD_MIN}\u2013${VIDEO_MASK_LIMITS.THRESHOLD_MAX} (default ${VIDEO_MASK_LIMITS.THRESHOLD_DEFAULT}; lower finds more)`, parseFloat).option("--hold-last-mask", "keep the last mask on frames where the subject is lost (e.g. hidden behind a hand), for up to 1 s").option("--min-subject-height <pct>", `ignore subjects smaller than this % of the frame height, ${VIDEO_MASK_LIMITS.MIN_SUBJECT_HEIGHT_PCT_MIN}\u2013${VIDEO_MASK_LIMITS.MIN_SUBJECT_HEIGHT_PCT_MAX} (default 0 = off)`, (v) => Number(v)).option("--max-subject-height <pct>", `ignore subjects larger than this % of the frame height, ${VIDEO_MASK_LIMITS.MAX_SUBJECT_HEIGHT_PCT_MIN}\u2013${VIDEO_MASK_LIMITS.MAX_SUBJECT_HEIGHT_PCT_MAX} (default 0 = off)`, (v) => Number(v)).option("--zone <L,R,T,B>", `keep only subjects whose centre is inside these left,right,top,bottom margins, each ${VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MIN}\u2013${VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MAX} % of the frame (default off)`).option("--per-shot", "detect the subject again in every shot after a scene cut").option("--redetect-every <sec>", `also detect the subject again every <sec> seconds, ${VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MIN}\u2013${VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MAX} (default 0 = off) \u2014 catches someone who enters or turns to camera mid-shot; slower, same price`, (v) => Number(v)).option("--watch", "poll until the job completes").option("--poll-interval <ms>", "watch poll interval in ms", (v) => parseInt(v, 10), 2e3).option("--profile <name>").option("--json").addHelpText("after", `
|
|
3696
3779
|
Examples:
|
|
3697
3780
|
$ nodaro media video-mask https://x/dance.mp4 "the dancer" --watch
|
|
3698
3781
|
$ nodaro media video-mask https://x/street.mp4 "person, dog" --threshold 0.3 --watch
|
|
3699
3782
|
$ nodaro media video-mask https://x/long-take.mp4 "the skater" --model sam-3 --watch
|
|
3700
3783
|
$ nodaro media video-mask https://x/edit.mp4 "face" --per-shot --zone 10,10,5,5 --watch
|
|
3784
|
+
$ nodaro media video-mask https://x/edit.mp4 "face" --per-shot --redetect-every 1 --watch
|
|
3701
3785
|
|
|
3702
3786
|
Clips up to ${VIDEO_MASK_LIMITS.MAX_BILLED_SEC} s at ${VIDEO_MASK_LIMITS.FPS_BASIS} fps (a faster clip counts proportionally longer); priced by the
|
|
3703
3787
|
clip's length. Feed the mask to \`nodaro media mask-composite\`.`).action(async (videoUrl, prompt, opts) => {
|
|
@@ -3722,6 +3806,10 @@ clip's length. Feed the mask to \`nodaro media mask-composite\`.`).action(async
|
|
|
3722
3806
|
warn("--min-subject-height is above --max-subject-height: no subject could be kept");
|
|
3723
3807
|
process.exit(1);
|
|
3724
3808
|
}
|
|
3809
|
+
if (opts.redetectEvery !== void 0 && !(Number.isFinite(opts.redetectEvery) && (opts.redetectEvery === 0 || opts.redetectEvery >= VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MIN && opts.redetectEvery <= VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MAX))) {
|
|
3810
|
+
warn(`--redetect-every must be 0 (off) or a number of seconds from ${VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MIN} to ${VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MAX}`);
|
|
3811
|
+
process.exit(1);
|
|
3812
|
+
}
|
|
3725
3813
|
const zone = opts.zone !== void 0 ? parseVideoMaskZone(opts.zone) : void 0;
|
|
3726
3814
|
const client = buildClient(opts.profile);
|
|
3727
3815
|
const result = await client.media.videoMask({
|
|
@@ -3733,7 +3821,8 @@ clip's length. Feed the mask to \`nodaro media mask-composite\`.`).action(async
|
|
|
3733
3821
|
...opts.minSubjectHeight !== void 0 ? { minSubjectHeightPct: opts.minSubjectHeight } : {},
|
|
3734
3822
|
...opts.maxSubjectHeight !== void 0 ? { maxSubjectHeightPct: opts.maxSubjectHeight } : {},
|
|
3735
3823
|
...zone ? { zone } : {},
|
|
3736
|
-
...opts.perShot ? { perShot: true } : {}
|
|
3824
|
+
...opts.perShot ? { perShot: true } : {},
|
|
3825
|
+
...opts.redetectEvery !== void 0 ? { redetectEverySec: opts.redetectEvery } : {}
|
|
3737
3826
|
});
|
|
3738
3827
|
await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "video mask" });
|
|
3739
3828
|
} catch (err) {
|
|
@@ -5700,13 +5789,13 @@ Examples:
|
|
|
5700
5789
|
}
|
|
5701
5790
|
);
|
|
5702
5791
|
cmd.command("cost <ids...>").description(
|
|
5703
|
-
"credits each identifier is charged \u2014 a model id, a credit id, or a metered LLM price key (<feature>:<model>[:direct]); an estimate prints as
|
|
5792
|
+
"credits each identifier is charged \u2014 a model id, a credit id, or a metered LLM price key (<feature>:<model>[:direct]); an estimate prints as \u2248N"
|
|
5704
5793
|
).option("--profile <name>").option("--json").addHelpText(
|
|
5705
5794
|
"after",
|
|
5706
5795
|
`
|
|
5707
5796
|
A metered LLM price key (llmPriceKey from @nodaro/shared/llm-models) is
|
|
5708
5797
|
charged for the tokens the call actually uses, so its figure is an estimate of
|
|
5709
|
-
a typical call and prints as
|
|
5798
|
+
a typical call and prints as \u2248N. Every model's per-token rate:
|
|
5710
5799
|
docs/pricing/llm-models.md.
|
|
5711
5800
|
|
|
5712
5801
|
Examples:
|
|
@@ -5736,7 +5825,7 @@ function costRows(ids, result) {
|
|
|
5736
5825
|
const credits = result.data[id];
|
|
5737
5826
|
if (typeof credits === "number") {
|
|
5738
5827
|
const estimate = estimates.has(id);
|
|
5739
|
-
return { id, credits: estimate ?
|
|
5828
|
+
return { id, credits: estimate ? `\u2248${credits}` : String(credits), note: estimate ? "estimate: charged per token used" : "" };
|
|
5740
5829
|
}
|
|
5741
5830
|
if (errors.has(id)) return { id, credits: "-", note: terminalSafe(result.errorCodes?.[id]?.message ?? "could not be priced") };
|
|
5742
5831
|
if (missing.has(id)) return { id, credits: "-", note: "no price on this server" };
|
|
@@ -5947,6 +6036,50 @@ function recastCommand() {
|
|
|
5947
6036
|
});
|
|
5948
6037
|
return cmd;
|
|
5949
6038
|
}
|
|
6039
|
+
|
|
6040
|
+
// src/quote-parts.ts
|
|
6041
|
+
var RENAMES = {
|
|
6042
|
+
motion: ["seedance", "kling"],
|
|
6043
|
+
motionExpected: ["seedanceExpected"],
|
|
6044
|
+
motionHd: ["seedanceHd"],
|
|
6045
|
+
privacy: ["masking"]
|
|
6046
|
+
};
|
|
6047
|
+
var OLD_KEYS = new Set(Object.values(RENAMES).flat());
|
|
6048
|
+
var finite = (v) => typeof v === "number" && Number.isFinite(v);
|
|
6049
|
+
function neutralParts(breakdown) {
|
|
6050
|
+
if (!breakdown || typeof breakdown !== "object" || Array.isArray(breakdown)) return {};
|
|
6051
|
+
const b = breakdown;
|
|
6052
|
+
const out = {};
|
|
6053
|
+
for (const [key2, value] of Object.entries(b)) if (!OLD_KEYS.has(key2) && finite(value)) out[key2] = value;
|
|
6054
|
+
for (const [key2, old] of Object.entries(RENAMES)) {
|
|
6055
|
+
if (key2 in out) continue;
|
|
6056
|
+
const from = old.find((k) => finite(b[k]));
|
|
6057
|
+
if (from !== void 0) out[key2] = b[from];
|
|
6058
|
+
}
|
|
6059
|
+
return out;
|
|
6060
|
+
}
|
|
6061
|
+
function neutralQuote(quote) {
|
|
6062
|
+
const { maskingCredits, privacyCredits, ...rest } = quote;
|
|
6063
|
+
const privacy = finite(privacyCredits) ? privacyCredits : finite(maskingCredits) ? maskingCredits : void 0;
|
|
6064
|
+
return {
|
|
6065
|
+
...rest,
|
|
6066
|
+
...quote.breakdown !== void 0 ? { breakdown: neutralParts(quote.breakdown) } : {},
|
|
6067
|
+
...privacy !== void 0 ? { privacyCredits: privacy } : {}
|
|
6068
|
+
};
|
|
6069
|
+
}
|
|
6070
|
+
var PART_LABELS = {
|
|
6071
|
+
castSwap: "Nodaro Motion",
|
|
6072
|
+
references: "reference pictures",
|
|
6073
|
+
motion: "video",
|
|
6074
|
+
motionExpected: "video, expected",
|
|
6075
|
+
motionHd: "1080p render",
|
|
6076
|
+
privacy: "clip preparation"
|
|
6077
|
+
};
|
|
6078
|
+
function quotePartLabel(part) {
|
|
6079
|
+
return Object.hasOwn(PART_LABELS, part) ? PART_LABELS[part] : part;
|
|
6080
|
+
}
|
|
6081
|
+
|
|
6082
|
+
// src/commands/trends.ts
|
|
5950
6083
|
var RESOLUTIONS = ["480p", "720p", "1080p"];
|
|
5951
6084
|
var SLOT_KEY_RE = /^[a-z0-9_]{1,32}$/;
|
|
5952
6085
|
var URL_SPLIT_RE = /,(?=\s*https?:\/\/)/i;
|
|
@@ -5960,9 +6093,12 @@ function addRunFlags(cmd) {
|
|
|
5960
6093
|
"--choice <key.chip=new|original>",
|
|
5961
6094
|
"a slot's chip: make it anew from your pictures or keep the clip's, e.g. person.outfit=original (repeatable; only the chips `trends get` lists for the slot)",
|
|
5962
6095
|
collectVariadic
|
|
5963
|
-
).option(
|
|
5964
|
-
|
|
5965
|
-
|
|
6096
|
+
).option(
|
|
6097
|
+
"--example <n>",
|
|
6098
|
+
"1-based example whose pictures fill the optional slots you leave empty (default 1); leave it out on a trend with no example, whose empty optional slots stay as in the original"
|
|
6099
|
+
).option("--details <text>", "your own words (at most 1,000 characters); mention a slot as {slot:<key>}").option("--preview", "a 4-second preview run (only when the trend offers one)").addOption(
|
|
6100
|
+
new Option("--resolution <r>", "one the trend offers (`trends get`); default its first: 480p, or 720p on a Nodaro Motion Lite trend").choices([...RESOLUTIONS])
|
|
6101
|
+
).option("--no-draft", "a full run instead of a draft (a draft is 480p only, and the default there; a Nodaro Motion Lite trend has none)");
|
|
5966
6102
|
}
|
|
5967
6103
|
function checkSlotKey(flag, spec, key2) {
|
|
5968
6104
|
if (!SLOT_KEY_RE.test(key2) || key2 === "__proto__") {
|
|
@@ -6031,7 +6167,7 @@ function buildRequest(flags) {
|
|
|
6031
6167
|
}
|
|
6032
6168
|
function trendsCommand() {
|
|
6033
6169
|
const cmd = new Command("trends").description(
|
|
6034
|
-
"trends \u2014 ready-made
|
|
6170
|
+
"trends \u2014 ready-made Nodaro Motion recipes: browse, quote, run with your own pictures, favorite (Cloud edition)"
|
|
6035
6171
|
);
|
|
6036
6172
|
cmd.command("list").description("the published trend catalog, in its curated order").option("--search <text>", "search text").option("--tag <tag>", "only trends with this tag").option("--favorites", "only your favorites").option("--locale <locale>", "language of names and descriptions (default your profile's, then English)").option("--limit <n>", "page size (1-60)").option("--cursor <cursor>", "the previous page's next").option("--profile <name>").option("--json").action(async (opts) => {
|
|
6037
6173
|
try {
|
|
@@ -6065,7 +6201,7 @@ function trendsCommand() {
|
|
|
6065
6201
|
handleError(err);
|
|
6066
6202
|
}
|
|
6067
6203
|
});
|
|
6068
|
-
cmd.command("get <slug>").description("a trend's page: its slots, examples, preview, engine and resolutions").option("--locale <locale>", "language of names and descriptions").option("--profile <name>").option("--json").action(async (slug, opts) => {
|
|
6204
|
+
cmd.command("get <slug>").description("a trend's page: its original, slots, examples, preview, engine and resolutions").option("--locale <locale>", "language of names and descriptions").option("--profile <name>").option("--json").action(async (slug, opts) => {
|
|
6069
6205
|
try {
|
|
6070
6206
|
const trend = await buildClient(opts.profile).trends.get(slug, { locale: opts.locale });
|
|
6071
6207
|
if (opts.json) emit(trend, opts);
|
|
@@ -6079,7 +6215,7 @@ function trendsCommand() {
|
|
|
6079
6215
|
).option("--profile <name>").option("--json").action(async (slug, opts) => {
|
|
6080
6216
|
try {
|
|
6081
6217
|
const request = buildRequest(opts);
|
|
6082
|
-
const quote = await buildClient(opts.profile).trends.estimate(slug, request);
|
|
6218
|
+
const quote = neutralQuote(await buildClient(opts.profile).trends.estimate(slug, request));
|
|
6083
6219
|
if (opts.json) {
|
|
6084
6220
|
emit(quote, opts);
|
|
6085
6221
|
return;
|
|
@@ -6087,7 +6223,7 @@ function trendsCommand() {
|
|
|
6087
6223
|
info(
|
|
6088
6224
|
`about ${quote.expectedCredits} credits` + (quote.holdCredits !== quote.expectedCredits ? ` (up to ${quote.holdCredits} held while it runs)` : "")
|
|
6089
6225
|
);
|
|
6090
|
-
for (const [part, credits] of Object.entries(quote.breakdown)) dim(` ${terminalSafe(part)}: ${credits}`);
|
|
6226
|
+
for (const [part, credits] of Object.entries(quote.breakdown)) dim(` ${terminalSafe(quotePartLabel(part))}: ${credits}`);
|
|
6091
6227
|
} catch (err) {
|
|
6092
6228
|
handleError(err);
|
|
6093
6229
|
}
|
|
@@ -6171,11 +6307,11 @@ function trendsCommand() {
|
|
|
6171
6307
|
}
|
|
6172
6308
|
function fullQualityCommand() {
|
|
6173
6309
|
const cmd = new Command("full-quality").description(
|
|
6174
|
-
"finish a run (
|
|
6310
|
+
"finish a run (Nodaro Motion or trend) at Full Quality at 1080p, as a new job: a draft's same take, or a new take of a Nodaro Motion Lite 720p run \u2014 `estimate` quotes it (free), `run` SPENDS CREDITS"
|
|
6175
6311
|
);
|
|
6176
6312
|
cmd.command("estimate <jobId>").description("quote finishing the run at Full Quality (free): same or new take, the credits, and until when it can be finished").option("--profile <name>").option("--json").action(async (jobId, opts) => {
|
|
6177
6313
|
try {
|
|
6178
|
-
const quote = await buildClient(opts.profile).castSwap.fullQualityEstimate(jobId);
|
|
6314
|
+
const quote = neutralQuote(await buildClient(opts.profile).castSwap.fullQualityEstimate(jobId));
|
|
6179
6315
|
if (opts.json) {
|
|
6180
6316
|
emit(quote, opts);
|
|
6181
6317
|
return;
|
|
@@ -6184,9 +6320,9 @@ function fullQualityCommand() {
|
|
|
6184
6320
|
if (quote.kind === "new-take") dim("a NEW take at 1080p from the same inputs (the 720p run stays)");
|
|
6185
6321
|
else dim("the same take at 1080p");
|
|
6186
6322
|
for (const [part, credits] of Object.entries(quote.breakdown)) {
|
|
6187
|
-
if (typeof credits === "number") dim(` ${terminalSafe(part)}: ${credits}`);
|
|
6323
|
+
if (typeof credits === "number") dim(` ${terminalSafe(quotePartLabel(part))}: ${credits}`);
|
|
6188
6324
|
}
|
|
6189
|
-
if (quote.kind !== "new-take" && quote.breakdown.
|
|
6325
|
+
if (quote.kind !== "new-take" && quote.breakdown.motionHd === 0) dim(" an earlier try's 1080p render is reused");
|
|
6190
6326
|
dim(`available until ${terminalSafe(quote.availableUntil)}`);
|
|
6191
6327
|
} catch (err) {
|
|
6192
6328
|
handleError(err);
|
|
@@ -6213,7 +6349,7 @@ function fullQualityCommand() {
|
|
|
6213
6349
|
return cmd;
|
|
6214
6350
|
}
|
|
6215
6351
|
function castSwapCommand() {
|
|
6216
|
-
const cmd = new Command("cast-swap").description("
|
|
6352
|
+
const cmd = new Command("cast-swap").description("Nodaro Motion \u2014 replace who and what is in a short video (Cloud edition)");
|
|
6217
6353
|
cmd.addCommand(fullQualityCommand());
|
|
6218
6354
|
return cmd;
|
|
6219
6355
|
}
|
|
@@ -6553,7 +6689,7 @@ var MOTION_PROVIDERS = [
|
|
|
6553
6689
|
"minimax",
|
|
6554
6690
|
"hailuo-2.3",
|
|
6555
6691
|
"wan-i2v",
|
|
6556
|
-
"seedance",
|
|
6692
|
+
"seedance-2-mini",
|
|
6557
6693
|
"bytedance-lite"
|
|
6558
6694
|
];
|
|
6559
6695
|
var ASSET_TYPE_TO_COLUMN2 = {
|
|
@@ -8361,6 +8497,7 @@ program.hook("preAction", () => {
|
|
|
8361
8497
|
program.addCommand(authCommand());
|
|
8362
8498
|
program.addCommand(projectsCommand());
|
|
8363
8499
|
program.addCommand(sessionsCommand());
|
|
8500
|
+
program.addCommand(trashCommand());
|
|
8364
8501
|
program.addCommand(workflowsCommand());
|
|
8365
8502
|
program.addCommand(appsCommand());
|
|
8366
8503
|
program.addCommand(nodesCommand());
|