@nodaro/cli 1.39.0 → 1.40.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 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 ~N, an estimate
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
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.39.0",
44
+ version: "1.40.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.44.0",
86
- "@nodaro/shared": "^3.41.0",
85
+ "@nodaro/sdk": "^2.45.0",
86
+ "@nodaro/shared": "^3.42.0",
87
87
  commander: "^12.1.0",
88
88
  picocolors: "^1.1.1",
89
- "@nodaro/prompts": "^1.42.0"
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.39.0" ;
416
+ var CLI_VERSION = "1.40.0" ;
417
417
  function buildPublicClient(opts = {}) {
418
418
  const { profile } = getProfile(opts.profile);
419
419
  return createClient({
@@ -1133,8 +1133,9 @@ function workflowsCommand() {
1133
1133
  success(`Render final of ${renderNodeId} runs ${quote.nodeIds.join(", ")}`);
1134
1134
  if (quote.estimatedCredits !== null) {
1135
1135
  dim(
1136
- // `~`: an LLM node in the run is charged its actual usage, so the figure is an estimate.
1137
- `estimated ${quote.estimatedCreditsIsEstimate ? "~" : ""}${quote.estimatedCredits} credits` + (quote.sufficient === false ? ` \u2014 not covered${quote.available !== null ? ` (${quote.available} available)` : ""}` : "")
1136
+ // `≈`: an LLM node in the run is charged its actual usage, so the figure is an estimate.
1137
+ `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.
1138
+ (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
1139
  );
1139
1140
  }
1140
1141
  return;
@@ -1867,7 +1868,7 @@ async function pickNodeInteractively(client) {
1867
1868
  }
1868
1869
  function nodeCreditsLabel(n) {
1869
1870
  if (n.creditCost === "unpriced") return "unpriced";
1870
- return `${n.estimate ? "~" : ""}${n.creditCost} cr`;
1871
+ return `${n.estimate ? "\u2248" : ""}${n.creditCost} cr`;
1871
1872
  }
1872
1873
  function rejectPositionalParams(extras, example) {
1873
1874
  if (!extras || extras.length === 0) return;
@@ -1900,7 +1901,7 @@ function nodesCommand() {
1900
1901
  label: n.label,
1901
1902
  category: n.category,
1902
1903
  outputType: n.outputType,
1903
- credits: n.creditCost === void 0 ? "" : n.estimate ? `~${n.creditCost}` : n.creditCost,
1904
+ credits: n.creditCost === void 0 ? "" : n.estimate ? `\u2248${n.creditCost}` : n.creditCost,
1904
1905
  providers: n.providers ? n.providers.length : ""
1905
1906
  })),
1906
1907
  ["type", "label", "category", "outputType", "credits", "providers"]
@@ -3692,12 +3693,13 @@ image, passed through unchanged): \`nodaro jobs get <jobId>\`. Use the mask for
3692
3693
  handleError(err);
3693
3694
  }
3694
3695
  });
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", `
3696
+ 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
3697
  Examples:
3697
3698
  $ nodaro media video-mask https://x/dance.mp4 "the dancer" --watch
3698
3699
  $ nodaro media video-mask https://x/street.mp4 "person, dog" --threshold 0.3 --watch
3699
3700
  $ nodaro media video-mask https://x/long-take.mp4 "the skater" --model sam-3 --watch
3700
3701
  $ nodaro media video-mask https://x/edit.mp4 "face" --per-shot --zone 10,10,5,5 --watch
3702
+ $ nodaro media video-mask https://x/edit.mp4 "face" --per-shot --redetect-every 1 --watch
3701
3703
 
3702
3704
  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
3705
  clip's length. Feed the mask to \`nodaro media mask-composite\`.`).action(async (videoUrl, prompt, opts) => {
@@ -3722,6 +3724,10 @@ clip's length. Feed the mask to \`nodaro media mask-composite\`.`).action(async
3722
3724
  warn("--min-subject-height is above --max-subject-height: no subject could be kept");
3723
3725
  process.exit(1);
3724
3726
  }
3727
+ 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))) {
3728
+ 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}`);
3729
+ process.exit(1);
3730
+ }
3725
3731
  const zone = opts.zone !== void 0 ? parseVideoMaskZone(opts.zone) : void 0;
3726
3732
  const client = buildClient(opts.profile);
3727
3733
  const result = await client.media.videoMask({
@@ -3733,7 +3739,8 @@ clip's length. Feed the mask to \`nodaro media mask-composite\`.`).action(async
3733
3739
  ...opts.minSubjectHeight !== void 0 ? { minSubjectHeightPct: opts.minSubjectHeight } : {},
3734
3740
  ...opts.maxSubjectHeight !== void 0 ? { maxSubjectHeightPct: opts.maxSubjectHeight } : {},
3735
3741
  ...zone ? { zone } : {},
3736
- ...opts.perShot ? { perShot: true } : {}
3742
+ ...opts.perShot ? { perShot: true } : {},
3743
+ ...opts.redetectEvery !== void 0 ? { redetectEverySec: opts.redetectEvery } : {}
3737
3744
  });
3738
3745
  await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "video mask" });
3739
3746
  } catch (err) {
@@ -5700,13 +5707,13 @@ Examples:
5700
5707
  }
5701
5708
  );
5702
5709
  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 ~N"
5710
+ "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
5711
  ).option("--profile <name>").option("--json").addHelpText(
5705
5712
  "after",
5706
5713
  `
5707
5714
  A metered LLM price key (llmPriceKey from @nodaro/shared/llm-models) is
5708
5715
  charged for the tokens the call actually uses, so its figure is an estimate of
5709
- a typical call and prints as ~N. Every model's per-token rate:
5716
+ a typical call and prints as \u2248N. Every model's per-token rate:
5710
5717
  docs/pricing/llm-models.md.
5711
5718
 
5712
5719
  Examples:
@@ -5736,7 +5743,7 @@ function costRows(ids, result) {
5736
5743
  const credits = result.data[id];
5737
5744
  if (typeof credits === "number") {
5738
5745
  const estimate = estimates.has(id);
5739
- return { id, credits: estimate ? `~${credits}` : String(credits), note: estimate ? "estimate: charged per token used" : "" };
5746
+ return { id, credits: estimate ? `\u2248${credits}` : String(credits), note: estimate ? "estimate: charged per token used" : "" };
5740
5747
  }
5741
5748
  if (errors.has(id)) return { id, credits: "-", note: terminalSafe(result.errorCodes?.[id]?.message ?? "could not be priced") };
5742
5749
  if (missing.has(id)) return { id, credits: "-", note: "no price on this server" };
@@ -5960,7 +5967,10 @@ function addRunFlags(cmd) {
5960
5967
  "--choice <key.chip=new|original>",
5961
5968
  "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
5969
  collectVariadic
5963
- ).option("--example <n>", "1-based example whose pictures fill the optional slots you leave empty (default 1)").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(
5970
+ ).option(
5971
+ "--example <n>",
5972
+ "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"
5973
+ ).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(
5964
5974
  new Option("--resolution <r>", "one the trend offers (`trends get`); default its first: 480p, or 720p on a Kling 4 trend").choices([...RESOLUTIONS])
5965
5975
  ).option("--no-draft", "a full run instead of a draft (a draft is 480p only, and the default there; a Kling 4 trend has none)");
5966
5976
  }
@@ -6065,7 +6075,7 @@ function trendsCommand() {
6065
6075
  handleError(err);
6066
6076
  }
6067
6077
  });
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) => {
6078
+ 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
6079
  try {
6070
6080
  const trend = await buildClient(opts.profile).trends.get(slug, { locale: opts.locale });
6071
6081
  if (opts.json) emit(trend, opts);
@@ -6553,7 +6563,7 @@ var MOTION_PROVIDERS = [
6553
6563
  "minimax",
6554
6564
  "hailuo-2.3",
6555
6565
  "wan-i2v",
6556
- "seedance",
6566
+ "seedance-2-mini",
6557
6567
  "bytedance-lite"
6558
6568
  ];
6559
6569
  var ASSET_TYPE_TO_COLUMN2 = {