@nodaro/cli 1.1.2 → 1.3.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 +116 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -17,7 +17,11 @@ import { CHARACTER_STYLES } from '@nodaro/shared';
|
|
|
17
17
|
|
|
18
18
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
19
19
|
var __commonJS = (cb, mod) => function __require() {
|
|
20
|
-
|
|
20
|
+
try {
|
|
21
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
throw mod = 0, e;
|
|
24
|
+
}
|
|
21
25
|
};
|
|
22
26
|
|
|
23
27
|
// package.json
|
|
@@ -25,7 +29,7 @@ var require_package = __commonJS({
|
|
|
25
29
|
"package.json"(exports$1, module) {
|
|
26
30
|
module.exports = {
|
|
27
31
|
name: "@nodaro/cli",
|
|
28
|
-
version: "1.
|
|
32
|
+
version: "1.3.0",
|
|
29
33
|
description: "Command-line interface for Nodaro \u2014 list and run workflows, inspect jobs and executions, manage projects from the terminal.",
|
|
30
34
|
type: "module",
|
|
31
35
|
license: "Apache-2.0",
|
|
@@ -66,8 +70,8 @@ var require_package = __commonJS({
|
|
|
66
70
|
"@inquirer/confirm": "^6.0.12",
|
|
67
71
|
"@inquirer/input": "^5.0.12",
|
|
68
72
|
"@inquirer/select": "^5.1.4",
|
|
69
|
-
"@nodaro/sdk": "^1.
|
|
70
|
-
"@nodaro/shared": "^1.
|
|
73
|
+
"@nodaro/sdk": "^1.3.0",
|
|
74
|
+
"@nodaro/shared": "^1.9.0",
|
|
71
75
|
commander: "^12.1.0",
|
|
72
76
|
picocolors: "^1.1.1",
|
|
73
77
|
"@nodaro/prompts": "^1.0.1"
|
|
@@ -1441,14 +1445,15 @@ function commonWizardFields(opts) {
|
|
|
1441
1445
|
style: opts.style,
|
|
1442
1446
|
aspectRatio: opts.aspectRatio,
|
|
1443
1447
|
duration: opts.duration,
|
|
1444
|
-
llmModel: opts.llmModel
|
|
1448
|
+
llmModel: opts.llmModel,
|
|
1449
|
+
reasoningEffort: opts.reasoningEffort
|
|
1445
1450
|
};
|
|
1446
1451
|
}
|
|
1447
1452
|
function promptCommand() {
|
|
1448
1453
|
const cmd = new Command("prompt").description(
|
|
1449
1454
|
"AI prompt wizard \u2014 analyze, generate, and enhance prompts for generation nodes"
|
|
1450
1455
|
);
|
|
1451
|
-
cmd.command("wizard").description("interactive: answer guided questions and get an optimized prompt").option("--node-type <type>", "target node type (omit for an interactive picker)").option("--prompt <text>", "your rough idea (optional)").option("--provider <name>").option("--style <name>").option("--aspect-ratio <ratio>").option("--duration <seconds>", "clip duration in seconds", (v) => parseInt(v, 10)).option("--llm-model <id>").option("--profile <name>").action(async (opts) => {
|
|
1456
|
+
cmd.command("wizard").description("interactive: answer guided questions and get an optimized prompt").option("--node-type <type>", "target node type (omit for an interactive picker)").option("--prompt <text>", "your rough idea (optional)").option("--provider <name>").option("--style <name>").option("--aspect-ratio <ratio>").option("--duration <seconds>", "clip duration in seconds", (v) => parseInt(v, 10)).option("--llm-model <id>").option("--reasoning-effort <level>", "reasoning effort: none|low|medium|high|xhigh|max (model-dependent)").option("--profile <name>").action(async (opts) => {
|
|
1452
1457
|
try {
|
|
1453
1458
|
if (!isInteractive()) {
|
|
1454
1459
|
warn("`prompt wizard` needs an interactive terminal \u2014 use `prompt analyze` + `prompt generate`, or `prompt enhance`, in scripts.");
|
|
@@ -1498,7 +1503,7 @@ function promptCommand() {
|
|
|
1498
1503
|
handleError(err);
|
|
1499
1504
|
}
|
|
1500
1505
|
});
|
|
1501
|
-
cmd.command("analyze").description("return guided questions for a rough prompt idea").requiredOption("--node-type <type>").option("--prompt <text>").option("--provider <name>").option("--style <name>").option("--aspect-ratio <ratio>").option("--duration <seconds>", "clip duration in seconds", (v) => parseInt(v, 10)).option("--llm-model <id>").option("--profile <name>").option("--json").action(async (opts) => {
|
|
1506
|
+
cmd.command("analyze").description("return guided questions for a rough prompt idea").requiredOption("--node-type <type>").option("--prompt <text>").option("--provider <name>").option("--style <name>").option("--aspect-ratio <ratio>").option("--duration <seconds>", "clip duration in seconds", (v) => parseInt(v, 10)).option("--llm-model <id>").option("--reasoning-effort <level>", "reasoning effort: none|low|medium|high|xhigh|max (model-dependent)").option("--profile <name>").option("--json").action(async (opts) => {
|
|
1502
1507
|
try {
|
|
1503
1508
|
const client = buildClient(opts.profile);
|
|
1504
1509
|
const { jobId, questions } = await client.promptHelper.analyze({
|
|
@@ -1523,7 +1528,7 @@ function promptCommand() {
|
|
|
1523
1528
|
handleError(err);
|
|
1524
1529
|
}
|
|
1525
1530
|
});
|
|
1526
|
-
cmd.command("generate").description("build an optimized prompt from --selection category=value flags").requiredOption("--node-type <type>").option("--selection <pairs...>", "category=value (repeat); custom answers are wizard-only", collectVariadic).option("--original-prompt <text>").option("--provider <name>").option("--style <name>").option("--aspect-ratio <ratio>").option("--duration <seconds>", "clip duration in seconds", (v) => parseInt(v, 10)).option("--llm-model <id>").option("--profile <name>").option("--json").action(async (opts) => {
|
|
1531
|
+
cmd.command("generate").description("build an optimized prompt from --selection category=value flags").requiredOption("--node-type <type>").option("--selection <pairs...>", "category=value (repeat); custom answers are wizard-only", collectVariadic).option("--original-prompt <text>").option("--provider <name>").option("--style <name>").option("--aspect-ratio <ratio>").option("--duration <seconds>", "clip duration in seconds", (v) => parseInt(v, 10)).option("--llm-model <id>").option("--reasoning-effort <level>", "reasoning effort: none|low|medium|high|xhigh|max (model-dependent)").option("--profile <name>").option("--json").action(async (opts) => {
|
|
1527
1532
|
try {
|
|
1528
1533
|
const client = buildClient(opts.profile);
|
|
1529
1534
|
const selections = parseSelectionPairs(opts.selection);
|
|
@@ -1543,7 +1548,7 @@ function promptCommand() {
|
|
|
1543
1548
|
handleError(err);
|
|
1544
1549
|
}
|
|
1545
1550
|
});
|
|
1546
|
-
cmd.command("enhance").description("rewrite a rough idea into one optimized prompt (no questions)").requiredOption("--node-type <type>").option("--prompt <text>").option("--provider <name>").option("--style <name>").option("--aspect-ratio <ratio>").option("--duration <seconds>", "clip duration in seconds", (v) => parseInt(v, 10)).option("--llm-model <id>").option("--profile <name>").option("--json").action(async (opts) => {
|
|
1551
|
+
cmd.command("enhance").description("rewrite a rough idea into one optimized prompt (no questions)").requiredOption("--node-type <type>").option("--prompt <text>").option("--provider <name>").option("--style <name>").option("--aspect-ratio <ratio>").option("--duration <seconds>", "clip duration in seconds", (v) => parseInt(v, 10)).option("--llm-model <id>").option("--reasoning-effort <level>", "reasoning effort: none|low|medium|high|xhigh|max (model-dependent)").option("--profile <name>").option("--json").action(async (opts) => {
|
|
1547
1552
|
try {
|
|
1548
1553
|
const client = buildClient(opts.profile);
|
|
1549
1554
|
const result = await client.promptHelper.enhance({
|
|
@@ -1606,6 +1611,108 @@ Examples:
|
|
|
1606
1611
|
}
|
|
1607
1612
|
}
|
|
1608
1613
|
);
|
|
1614
|
+
cmd.command("recast").alias("pro").description(
|
|
1615
|
+
"multi-speaker recast (Voice Changer Pro, Cloud only) \u2014 detects each speaker and recasts speaker N to the N-th entry of --voices; a `keep` entry keeps that speaker's original voice"
|
|
1616
|
+
).option("--audio <url>", "audio URL to recast (audio \u2192 audio)").option("--video <url>", "video URL to recast (the audio track is recast and remuxed). Wins over --audio when both are given.").option(
|
|
1617
|
+
"--voices <list>",
|
|
1618
|
+
"comma-separated voices in speaker order \u2014 each entry is a premade name (Rachel), an ElevenLabs clone UUID, or the literal `keep` to keep that speaker's original voice"
|
|
1619
|
+
).option(
|
|
1620
|
+
"--voices-json <json>",
|
|
1621
|
+
`JSON array for per-voice settings \u2014 entries are a voice id string, a {"voiceId","stability","similarityBoost","style","useSpeakerBoost","seed","volumeMode","volume"} object, or null to keep that speaker's original voice`
|
|
1622
|
+
).option("--model <id>", "speech-to-speech model override").option("--no-preserve-background", "drop the separated music/SFX bed for a clean voice-only result (kept by default)").option("--separation-quality <q>", "voice/music separation quality: fast (default) or best").option("--music-volume-mode <mode>", "preserved background level: match (default), normalize, or manual").option("--music-volume <n>", "background level % (0-200) when --music-volume-mode is manual", parseFloat).option("--remove-background-noise", "denoise for a cleaner voice-only result").option("--voice-fx <preset>", "reverb/echo on the combined recast voices: room|bathroom|car|hall|concert-hall|church|cave|arena|outdoor|telephone|megaphone|echo|custom").option("--voice-fx-mix <n>", "reverb wet/dry mix % (0-100) \u2014 reverb presets", parseFloat).option("--voice-fx-delay <ms>", "echo delay in ms (20-2000) \u2014 echo/custom presets", (v) => parseInt(v, 10)).option("--voice-fx-decay <n>", "echo decay (0-1) \u2014 echo/custom presets", parseFloat).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", `
|
|
1623
|
+
Examples:
|
|
1624
|
+
$ nodaro voice recast --audio https://.../podcast.mp3 --voices Rachel,Aria --watch
|
|
1625
|
+
$ nodaro voice recast --video https://.../panel.mp4 --voices Rachel,keep,Aria --watch
|
|
1626
|
+
# speaker 1 \u2192 Rachel, speaker 2 keeps their original voice, speaker 3 \u2192 Aria
|
|
1627
|
+
$ nodaro voice recast --audio https://.../ad.mp3 \\
|
|
1628
|
+
--voices-json '[{"voiceId":"Rachel","stability":0.6},null,"Aria"]' --no-preserve-background`).action(
|
|
1629
|
+
async (opts) => {
|
|
1630
|
+
try {
|
|
1631
|
+
if (!opts.audio && !opts.video) {
|
|
1632
|
+
warn("Provide --audio <url> or --video <url> (one is required)");
|
|
1633
|
+
process.exit(1);
|
|
1634
|
+
}
|
|
1635
|
+
if (opts.voices && opts.voicesJson) {
|
|
1636
|
+
warn("--voices and --voices-json are mutually exclusive \u2014 pass one");
|
|
1637
|
+
process.exit(1);
|
|
1638
|
+
}
|
|
1639
|
+
if (!opts.voices && !opts.voicesJson) {
|
|
1640
|
+
warn("Provide --voices <v1,v2,...> (use `keep` to keep a speaker's original voice) or --voices-json <json>");
|
|
1641
|
+
process.exit(1);
|
|
1642
|
+
}
|
|
1643
|
+
let orderedVoices;
|
|
1644
|
+
if (opts.voices) {
|
|
1645
|
+
const entries = opts.voices.split(",").map((s) => s.trim());
|
|
1646
|
+
if (entries.some((e) => e === "")) {
|
|
1647
|
+
warn(`--voices has an empty entry: ${JSON.stringify(opts.voices)}`);
|
|
1648
|
+
process.exit(1);
|
|
1649
|
+
}
|
|
1650
|
+
orderedVoices = entries.map((e) => e.toLowerCase() === "keep" ? null : e);
|
|
1651
|
+
} else {
|
|
1652
|
+
let parsed;
|
|
1653
|
+
try {
|
|
1654
|
+
parsed = JSON.parse(opts.voicesJson);
|
|
1655
|
+
} catch {
|
|
1656
|
+
warn("--voices-json is not valid JSON");
|
|
1657
|
+
process.exit(1);
|
|
1658
|
+
}
|
|
1659
|
+
if (!Array.isArray(parsed) || parsed.length === 0 || !parsed.every((v) => v === null || typeof v === "string" || typeof v === "object" && !Array.isArray(v))) {
|
|
1660
|
+
warn("--voices-json must be a non-empty JSON array of voice id strings, per-voice settings objects, or null keep-slots");
|
|
1661
|
+
process.exit(1);
|
|
1662
|
+
}
|
|
1663
|
+
orderedVoices = parsed;
|
|
1664
|
+
}
|
|
1665
|
+
if (!orderedVoices.some((v) => v !== null)) {
|
|
1666
|
+
warn("At least one speaker must get a new voice \u2014 `keep` only marks speakers whose original voice stays");
|
|
1667
|
+
process.exit(1);
|
|
1668
|
+
}
|
|
1669
|
+
if ((opts.voiceFxMix !== void 0 || opts.voiceFxDelay !== void 0 || opts.voiceFxDecay !== void 0) && !opts.voiceFx) {
|
|
1670
|
+
warn("--voice-fx-mix / --voice-fx-delay / --voice-fx-decay require --voice-fx <preset>");
|
|
1671
|
+
process.exit(1);
|
|
1672
|
+
}
|
|
1673
|
+
const voiceFx = opts.voiceFx ? {
|
|
1674
|
+
preset: opts.voiceFx,
|
|
1675
|
+
...opts.voiceFxMix !== void 0 ? { wetDryMix: opts.voiceFxMix } : {},
|
|
1676
|
+
...opts.voiceFxDelay !== void 0 ? { delayMs: opts.voiceFxDelay } : {},
|
|
1677
|
+
...opts.voiceFxDecay !== void 0 ? { decay: opts.voiceFxDecay } : {}
|
|
1678
|
+
} : void 0;
|
|
1679
|
+
const client = buildClient(opts.profile);
|
|
1680
|
+
const input2 = {
|
|
1681
|
+
orderedVoices,
|
|
1682
|
+
// Video wins when both are given (matches the route + `voice changer`).
|
|
1683
|
+
...opts.video ? { videoUrl: opts.video } : { audioUrl: opts.audio },
|
|
1684
|
+
...opts.model ? { model: opts.model } : {},
|
|
1685
|
+
// Only sent when --no-preserve-background was used; otherwise omitted
|
|
1686
|
+
// so the server default (true) applies.
|
|
1687
|
+
...opts.preserveBackground === false ? { preserveBackground: false } : {},
|
|
1688
|
+
...opts.separationQuality ? { separationQuality: opts.separationQuality } : {},
|
|
1689
|
+
...opts.musicVolumeMode ? { musicVolumeMode: opts.musicVolumeMode } : {},
|
|
1690
|
+
...opts.musicVolume !== void 0 ? { musicVolume: opts.musicVolume } : {},
|
|
1691
|
+
...opts.removeBackgroundNoise ? { removeBackgroundNoise: true } : {},
|
|
1692
|
+
...voiceFx ? { voiceFx } : {}
|
|
1693
|
+
};
|
|
1694
|
+
const result = await client.voices.recast(input2);
|
|
1695
|
+
const jobId = result.jobId;
|
|
1696
|
+
if (opts.json && !opts.watch) {
|
|
1697
|
+
emit(result, opts);
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
success(`job ${jobId} queued (${opts.video ? "video" : "audio"} mode)`);
|
|
1701
|
+
if (!opts.watch) {
|
|
1702
|
+
dim(`follow: nodaro jobs get ${jobId}`);
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
await watchUntilTerminal({
|
|
1706
|
+
fetch: () => client.jobs.get(jobId),
|
|
1707
|
+
label: jobId,
|
|
1708
|
+
intervalMs: opts.pollInterval,
|
|
1709
|
+
...opts
|
|
1710
|
+
});
|
|
1711
|
+
} catch (err) {
|
|
1712
|
+
handleError(err);
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
);
|
|
1609
1716
|
return cmd;
|
|
1610
1717
|
}
|
|
1611
1718
|
function presetsCommand() {
|