@nodaro/cli 1.14.0 → 1.16.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 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.14.0",
32
+ version: "1.16.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.22.0",
74
- "@nodaro/shared": "^2.12.2",
73
+ "@nodaro/sdk": "^1.24.0",
74
+ "@nodaro/shared": "^2.16.0",
75
75
  commander: "^12.1.0",
76
76
  picocolors: "^1.1.1",
77
- "@nodaro/prompts": "^1.8.0"
77
+ "@nodaro/prompts": "^1.11.0"
78
78
  },
79
79
  devDependencies: {
80
80
  tsup: "^8.5.0",
@@ -398,7 +398,7 @@ function saveWorkspace(profileName, workspaceId) {
398
398
  }
399
399
 
400
400
  // src/client.ts
401
- var CLI_VERSION = "1.14.0" ;
401
+ var CLI_VERSION = "1.16.0" ;
402
402
  function buildClient(profileName) {
403
403
  const { name, profile } = getProfile(profileName);
404
404
  if (!profile) {
@@ -1097,6 +1097,25 @@ function rejectPositionalInputs(extras, slug) {
1097
1097
  }
1098
1098
  process.exit(1);
1099
1099
  }
1100
+ function parseOverridePairs(pairs) {
1101
+ if (!pairs?.length) return void 0;
1102
+ const out = {};
1103
+ for (const pair of pairs) {
1104
+ const eq = pair.indexOf("=");
1105
+ const dot = pair.indexOf(".");
1106
+ if (eq === -1 || dot === -1 || dot > eq) throw new Error(`--override expects nodeId.field=value, got "${pair}"`);
1107
+ const nodeId = pair.slice(0, dot);
1108
+ const field = pair.slice(dot + 1, eq);
1109
+ const raw = pair.slice(eq + 1);
1110
+ let value = raw;
1111
+ try {
1112
+ value = JSON.parse(raw);
1113
+ } catch {
1114
+ }
1115
+ out[nodeId] = { ...out[nodeId] ?? {}, [field]: value };
1116
+ }
1117
+ return out;
1118
+ }
1100
1119
  function appsCommand() {
1101
1120
  const cmd = new Command("apps").description("browse and run published apps (workflows wrapped in a curated UI)");
1102
1121
  cmd.command("list").description("browse published apps (paginated)").option("--search <query>", "substring match on name/description").option("--limit <n>", "page size (max 50)", (v) => parseInt(v, 10)).option("--cursor <token>", "pagination cursor from a previous page").option("--category <slug>", "filter to a single category").option("--profile <name>").option("--json").action(async (opts) => {
@@ -1136,9 +1155,10 @@ function appsCommand() {
1136
1155
  handleError(err);
1137
1156
  }
1138
1157
  });
1139
- cmd.command("run [slug] [extras...]").description("trigger an app run. Inputs go through --input k=v (repeat) or --params-file inputs.json. Omit <slug> for an interactive picker.").option("--input <pairs...>", `input value, repeat or space-separate; JSON arrays/objects supported (e.g. --input prompt="hi" --input 'tags=["a","b"]')`, collectVariadic).option("--params-file <path>", "JSON file with the full inputs object (--input flags override matching keys)").option("--watch", "follow the resulting execution until completion").option("--profile <name>").option("--json").addHelpText("after", `
1158
+ cmd.command("run [slug] [extras...]").description("trigger an app run. Inputs go through --input k=v (repeat) or --params-file inputs.json. Omit <slug> for an interactive picker.").option("--input <pairs...>", `input value, repeat or space-separate; JSON arrays/objects supported (e.g. --input prompt="hi" --input 'tags=["a","b"]')`, collectVariadic).option("--params-file <path>", "JSON file with the full inputs object (--input flags override matching keys)").option("--override <pairs...>", 'advanced: raw node-data override nodeId.field=value (repeat); reaches fields not exposed as inputs, e.g. --override n1.promptPrefix="Cinematic still of"', collectVariadic).option("--watch", "follow the resulting execution until completion").option("--profile <name>").option("--json").addHelpText("after", `
1140
1159
  Examples:
1141
1160
  $ nodaro apps run hair-styler-dd3erw --input prompt="curly red hair" --watch
1161
+ $ nodaro apps run hair-styler-dd3erw --input prompt="curly red hair" --override n1.promptPrefix="Studio portrait of"
1142
1162
  $ echo '{"prompt":"hi","duration":8}' > inputs.json
1143
1163
  $ nodaro apps run hair-styler-dd3erw --params-file inputs.json --watch
1144
1164
 
@@ -1148,7 +1168,9 @@ Tip: \`nodaro apps get <slug>\` shows the input schema for that app.`).action(as
1148
1168
  const client = buildClient(opts.profile);
1149
1169
  const resolvedSlug = slug ?? await pickAppInteractively(client);
1150
1170
  const inputs = resolveParams(opts.input, opts.paramsFile);
1151
- const result = await client.apps.run(resolvedSlug, inputs);
1171
+ const result = await client.apps.run(resolvedSlug, inputs, {
1172
+ inputOverrides: parseOverridePairs(opts.override)
1173
+ });
1152
1174
  if (opts.json && !opts.watch) {
1153
1175
  emit(result, opts);
1154
1176
  return;
@@ -2110,6 +2132,52 @@ Example:
2110
2132
  }
2111
2133
  }
2112
2134
  );
2135
+ cmd.command("dialogue").description('voice a multi-speaker script as one audio file (ElevenLabs Dialogue v3) \u2014 each --line is "Voice: text"').requiredOption(
2136
+ "--line <line>",
2137
+ 'one script line as "Voice: text" (e.g. "Rachel: Hello there") \u2014 repeat in speaking order; the voice is a premade name or an ElevenLabs voice UUID',
2138
+ (v, prev) => [...prev, v],
2139
+ []
2140
+ ).option("--stability <n>", "0 (most variable) | 0.5 (balanced) | 1 (most stable)", (v) => parseFloat(v)).option("--language <code>", 'ISO 639-1 language hint, e.g. "en" (auto-detected when omitted)').option("--seed <n>", "deterministic sampling seed (0-4294967295); omit for random", (v) => parseInt(v, 10)).option("--text-normalization <mode>", "spell out numbers/dates: auto | on | off").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", `
2141
+ Limits: 5,000 characters total (under 2,000 recommended), up to 10 unique voices.
2142
+ Line text may carry [audio tags] like [laughs].
2143
+
2144
+ Example:
2145
+ $ nodaro voice dialogue --line "Rachel: [excited] We did it!" --line "Daniel: I never doubted us." --watch`).action(
2146
+ async (opts) => {
2147
+ try {
2148
+ if (opts.line.length === 0) {
2149
+ throw new Error('at least one --line is required (e.g. --line "Rachel: Hello there")');
2150
+ }
2151
+ const dialogue = opts.line.map((raw) => {
2152
+ const idx = raw.indexOf(":");
2153
+ if (idx < 1 || idx === raw.length - 1) {
2154
+ throw new Error(`--line must be "Voice: text", got: ${raw}`);
2155
+ }
2156
+ return { voice: raw.slice(0, idx).trim(), text: raw.slice(idx + 1).trim() };
2157
+ });
2158
+ if (opts.stability !== void 0 && ![0, 0.5, 1].includes(opts.stability)) {
2159
+ throw new Error("--stability must be exactly 0, 0.5, or 1");
2160
+ }
2161
+ if (opts.textNormalization !== void 0 && !["auto", "on", "off"].includes(opts.textNormalization)) {
2162
+ throw new Error("--text-normalization must be auto, on, or off");
2163
+ }
2164
+ const client = buildClient(opts.profile);
2165
+ const result = await client.voices.textToDialogue({
2166
+ dialogue,
2167
+ ...opts.stability !== void 0 ? { stability: opts.stability } : {},
2168
+ ...opts.language ? { languageCode: opts.language } : {},
2169
+ ...opts.seed !== void 0 ? { seed: opts.seed } : {},
2170
+ ...opts.textNormalization ? { applyTextNormalization: opts.textNormalization } : {}
2171
+ });
2172
+ await reportQueuedJob(result, () => client.jobs.get(result.jobId), {
2173
+ ...opts,
2174
+ note: `dialogue (${dialogue.length} lines)`
2175
+ });
2176
+ } catch (err) {
2177
+ handleError(err);
2178
+ }
2179
+ }
2180
+ );
2113
2181
  cmd.command("list").description("list the premade voices you can pass to --voice / --voices (or your voice clones with --clones)").option("--clones", "list your voice clones instead of the premade catalog").option("--profile <name>").option("--json").action(async (opts) => {
2114
2182
  try {
2115
2183
  const client = buildClient(opts.profile);
@@ -3033,8 +3101,8 @@ function buildCatalogSnapshot(projected, sidecars) {
3033
3101
  const push = (opts) => {
3034
3102
  for (const o of opts ?? []) if (!seen.has(o.id)) seen.set(o.id, o);
3035
3103
  };
3036
- if (projected.kind === "single") push(projected.options);
3037
- else for (const d of projected.dimensions ?? []) push(d.options);
3104
+ push(projected.options);
3105
+ for (const d of projected.dimensions ?? []) push(d.options);
3038
3106
  const entries = [...seen.values()].sort((a, b) => a.id.localeCompare(b.id));
3039
3107
  return { catalogId: projected.catalogId, kind: projected.kind, entries, sidecars };
3040
3108
  }