@nodaro/cli 1.21.0 → 1.24.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 +144 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -120,8 +120,8 @@ nodaro nodes run <type> --params-file body.json [--watch] [--poll-interval 1000]
|
|
|
120
120
|
nodaro models list [--kind video] [--mode i2v] [--family Google] [--featured]
|
|
121
121
|
|
|
122
122
|
# Pickers — valid values for parameter-picker nodes (setting, mood, person, …)
|
|
123
|
-
nodaro pickers list # all picker node types + option counts
|
|
124
|
-
nodaro pickers get <nodeType> [--full] [--category <c>] [--field <f>] # one picker's valid ids
|
|
123
|
+
nodaro pickers list # all picker node types + option counts + pictures
|
|
124
|
+
nodaro pickers get <nodeType> [--full] [--category <c>] [--field <f>] # one picker's valid ids (+ imageUrl per option)
|
|
125
125
|
nodaro pickers analyze "<text>" [--target setting,mood] # AI Fill: pick values from a description (credit-billed)
|
|
126
126
|
|
|
127
127
|
# Shots — Cine share → remix records
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { createClient, StaticTokenAuth, UnauthorizedError, NodaroError, LOCATION
|
|
|
13
13
|
import select from '@inquirer/select';
|
|
14
14
|
import checkbox from '@inquirer/checkbox';
|
|
15
15
|
import input from '@inquirer/input';
|
|
16
|
-
import { CHARACTER_STYLES, TRANSCRIBE_PROVIDERS, transcribeLaneSupportsWordTimestamps, ALL_CAPTION_STYLES, DEFAULT_CAPTION_LOOK, CAPTION_LOOK_IDS, CAPTION_MAX_WORDS_PER_LINE_MIN, CAPTION_MAX_WORDS_PER_LINE_MAX, TRANSCRIBE_LANES, SUPPORTED_FONT_NAMES, OVERLAY_ANCHORS, OVERLAY_PLATFORM_IDS, DEFAULT_TRANSCRIBE_PROVIDER } from '@nodaro/shared';
|
|
16
|
+
import { CHARACTER_STYLES, TRANSCRIBE_PROVIDERS, transcribeLaneSupportsWordTimestamps, ALL_CAPTION_STYLES, DEFAULT_CAPTION_LOOK, CAPTION_LOOK_IDS, CAPTION_MAX_WORDS_PER_LINE_MIN, CAPTION_MAX_WORDS_PER_LINE_MAX, TRANSCRIBE_LANES, SUPPORTED_FONT_NAMES, OVERLAY_ANCHORS, OVERLAY_PLATFORM_IDS, VIDEO_OVERLAY_PRESET_IDS, VIDEO_OVERLAY_CORNERS, VIDEO_OVERLAY_OUTPUT_ASPECTS, isVideoOverlayPresetId, isVideoOverlayCorner, isVideoOverlayOutputAspect, VIDEO_OVERLAY_FITS, DEFAULT_TRANSCRIBE_PROVIDER } from '@nodaro/shared';
|
|
17
17
|
|
|
18
18
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
19
19
|
var __commonJS = (cb, mod) => function __require() {
|
|
@@ -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.24.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": "^2.
|
|
74
|
-
"@nodaro/shared": "^3.
|
|
73
|
+
"@nodaro/sdk": "^2.17.0",
|
|
74
|
+
"@nodaro/shared": "^3.14.0",
|
|
75
75
|
commander: "^12.1.0",
|
|
76
76
|
picocolors: "^1.1.1",
|
|
77
|
-
"@nodaro/prompts": "^1.
|
|
77
|
+
"@nodaro/prompts": "^1.27.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.
|
|
401
|
+
var CLI_VERSION = "1.24.0" ;
|
|
402
402
|
function buildClient(profileName) {
|
|
403
403
|
const { name, profile } = getProfile(profileName);
|
|
404
404
|
if (!profile) {
|
|
@@ -2283,6 +2283,16 @@ function parseSection(raw) {
|
|
|
2283
2283
|
}
|
|
2284
2284
|
return { sectionStartSec: start, sectionEndSec: end };
|
|
2285
2285
|
}
|
|
2286
|
+
function parseAt(raw) {
|
|
2287
|
+
const m = raw.match(/^([0-9]+(?:\.[0-9]+)?)(?:-([0-9]+(?:\.[0-9]+)?))?$/);
|
|
2288
|
+
const start = m ? parseFloat(m[1]) : NaN;
|
|
2289
|
+
const end = m && m[2] !== void 0 ? parseFloat(m[2]) : void 0;
|
|
2290
|
+
if (!m || end !== void 0 && !(end > start)) {
|
|
2291
|
+
warn(`--at must be "<start>" or "<start>-<end>" in seconds with start < end (got "${raw}")`);
|
|
2292
|
+
process.exit(1);
|
|
2293
|
+
}
|
|
2294
|
+
return end === void 0 ? { start } : { start, end };
|
|
2295
|
+
}
|
|
2286
2296
|
function parseMaxWordsPerLine(raw) {
|
|
2287
2297
|
const n = Number(raw);
|
|
2288
2298
|
if (!Number.isInteger(n) || n < CAPTION_MAX_WORDS_PER_LINE_MIN || n > CAPTION_MAX_WORDS_PER_LINE_MAX) {
|
|
@@ -2326,7 +2336,7 @@ function parseSafeArea(raw) {
|
|
|
2326
2336
|
}
|
|
2327
2337
|
function mediaCommand() {
|
|
2328
2338
|
const cmd = new Command("media").description(
|
|
2329
|
-
"media ingestion + compositing \u2014 pull a social video into storage, trim video/audio, burn captions, still-to-video, slideshow, collage images, overlay layers on an image, save a URL to storage, probe metadata"
|
|
2339
|
+
"media ingestion + compositing \u2014 pull a social video into storage, trim video/audio, burn captions, still-to-video, slideshow, collage images, overlay layers on an image or timed images on a video, save a URL to storage, probe metadata"
|
|
2330
2340
|
);
|
|
2331
2341
|
cmd.command("download <url>").description("download a social video (YouTube / TikTok / Instagram / X / Facebook) into your storage").option("--max-height <px>", "cap the resolution (e.g. 720); omit for best available", (v) => parseInt(v, 10)).option("--section <a-b>", 'fetch ONLY this time range in seconds (e.g. "30-90"); the cut lands on keyframes, so pad and trim after').option("--watch", "stream the download's live progress until it completes").option("--profile <name>").option("--json").addHelpText("after", `
|
|
2332
2342
|
Examples:
|
|
@@ -2785,6 +2795,81 @@ vision model and answers in these same units.`).action(
|
|
|
2785
2795
|
}
|
|
2786
2796
|
}
|
|
2787
2797
|
);
|
|
2798
|
+
cmd.command("video-overlay <videoUrl> [layerUrls...]").description("place timed image layers over a video (local compositor, no AI; the audio is kept) \u2014 positional URLs are layers, one --at each").option("--at <start[-end]>", `a positional layer's window in seconds ("3" = from 3 s to the end, "1.2-2.6"); repeat once per layer, in order`, collectVariadic).option("--preset <id>", `placement for every positional layer: ${VIDEO_OVERLAY_PRESET_IDS.join(" | ")} (default: a corner badge \u2014 bottom-right, or the --corner given)`).option("--corner <corner>", `with --preset corner-badge: ${VIDEO_OVERLAY_CORNERS.join(" | ")} (default bottom-right)`).option("--layers-file <path>", "JSON file with the full layers array (custom boxes, opacity, animate, zIndex; mutually exclusive with positional layer URLs)").option("--aspect <ratio>", `render onto a ${VIDEO_OVERLAY_OUTPUT_ASPECTS.join(" | ")} canvas instead of the video's own size`).option("--base-fit <fit>", "with --aspect: how the video fills the canvas, cover (default) or contain").option("--background-color <hex>", "with --aspect: the padding colour under --base-fit contain, #RRGGBB").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", `
|
|
2799
|
+
Examples:
|
|
2800
|
+
$ nodaro media video-overlay https://x/clip.mp4 https://x/shot1.png https://x/shot2.png --at 1.2-2.6 --at 3-4.4 --preset card --watch
|
|
2801
|
+
$ nodaro media video-overlay https://x/clip.mp4 https://x/logo.png --at 0 --preset corner-badge --corner top-right --watch
|
|
2802
|
+
$ nodaro media video-overlay https://x/clip.mp4 --layers-file layers.json --aspect 9:16 --watch
|
|
2803
|
+
|
|
2804
|
+
A layers file holds the API's layers array, e.g.
|
|
2805
|
+
[{"imageUrl":"https://x/logo.png","start":0,"anchor":"top-left","x":4,"y":4,"width":12,"opacity":0.9}]
|
|
2806
|
+
Placement is in PERCENT of the output frame. An explicit box field overrides a
|
|
2807
|
+
preset; a layer with neither is a corner badge (bottom-right, or the corner it
|
|
2808
|
+
names).`).action(
|
|
2809
|
+
async (videoUrl, layerUrls, opts) => {
|
|
2810
|
+
try {
|
|
2811
|
+
if (opts.layersFile && layerUrls.length > 0) {
|
|
2812
|
+
warn("Pass layers EITHER as positional URLs OR with --layers-file, not both");
|
|
2813
|
+
process.exit(1);
|
|
2814
|
+
}
|
|
2815
|
+
if (!opts.layersFile && layerUrls.length === 0) {
|
|
2816
|
+
warn("Give at least one layer: a positional image URL (with its --at), or --layers-file with the layers array");
|
|
2817
|
+
process.exit(1);
|
|
2818
|
+
}
|
|
2819
|
+
if (opts.layersFile && (opts.at?.length || opts.preset || opts.corner)) {
|
|
2820
|
+
warn("--at, --preset and --corner apply to positional layers \u2014 put them inside the --layers-file entries instead");
|
|
2821
|
+
process.exit(1);
|
|
2822
|
+
}
|
|
2823
|
+
if (opts.preset && !isVideoOverlayPresetId(opts.preset)) {
|
|
2824
|
+
warn(`--preset must be one of ${VIDEO_OVERLAY_PRESET_IDS.join(", ")} (got "${opts.preset}")`);
|
|
2825
|
+
process.exit(1);
|
|
2826
|
+
}
|
|
2827
|
+
if (opts.corner && !isVideoOverlayCorner(opts.corner)) {
|
|
2828
|
+
warn(`--corner must be one of ${VIDEO_OVERLAY_CORNERS.join(", ")} (got "${opts.corner}")`);
|
|
2829
|
+
process.exit(1);
|
|
2830
|
+
}
|
|
2831
|
+
if (opts.aspect && !isVideoOverlayOutputAspect(opts.aspect)) {
|
|
2832
|
+
warn(`--aspect must be one of ${VIDEO_OVERLAY_OUTPUT_ASPECTS.join(", ")} (got "${opts.aspect}")`);
|
|
2833
|
+
process.exit(1);
|
|
2834
|
+
}
|
|
2835
|
+
if (opts.baseFit && !VIDEO_OVERLAY_FITS.includes(opts.baseFit)) {
|
|
2836
|
+
warn(`--base-fit must be cover or contain (got "${opts.baseFit}")`);
|
|
2837
|
+
process.exit(1);
|
|
2838
|
+
}
|
|
2839
|
+
if ((opts.baseFit || opts.backgroundColor) && !opts.aspect) {
|
|
2840
|
+
warn("--base-fit and --background-color need --aspect");
|
|
2841
|
+
process.exit(1);
|
|
2842
|
+
}
|
|
2843
|
+
let layers;
|
|
2844
|
+
if (opts.layersFile) {
|
|
2845
|
+
layers = readJsonArrayFile(opts.layersFile, "--layers-file");
|
|
2846
|
+
} else {
|
|
2847
|
+
const at = opts.at ?? [];
|
|
2848
|
+
if (at.length !== layerUrls.length) {
|
|
2849
|
+
warn(`Give one --at per layer URL, in order (${layerUrls.length} layer URL(s), ${at.length} --at)`);
|
|
2850
|
+
process.exit(1);
|
|
2851
|
+
}
|
|
2852
|
+
layers = layerUrls.map((imageUrl, i) => ({
|
|
2853
|
+
imageUrl,
|
|
2854
|
+
...parseAt(at[i]),
|
|
2855
|
+
...opts.preset ? { preset: opts.preset } : {},
|
|
2856
|
+
...opts.corner ? { corner: opts.corner } : {}
|
|
2857
|
+
}));
|
|
2858
|
+
}
|
|
2859
|
+
const client = buildClient(opts.profile);
|
|
2860
|
+
const result = await client.media.videoOverlay({
|
|
2861
|
+
videoUrl,
|
|
2862
|
+
layers,
|
|
2863
|
+
...opts.aspect ? { outputAspect: opts.aspect } : {},
|
|
2864
|
+
...opts.baseFit ? { baseFit: opts.baseFit } : {},
|
|
2865
|
+
...opts.backgroundColor ? { backgroundColor: opts.backgroundColor } : {}
|
|
2866
|
+
});
|
|
2867
|
+
await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "video overlay" });
|
|
2868
|
+
} catch (err) {
|
|
2869
|
+
handleError(err);
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
);
|
|
2788
2873
|
cmd.command("overlay-placement <imageUrl>").description("ask a vision model WHERE one overlay layer should sit \u2014 answers in `media overlay`'s own percent units").option("--intent <text>", 'what the layer is, in words \u2014 "a logo", "a price badge" (default a logo)').option("--aspect <ratio>", "the layer's width / height (1 = square, the default)", parseFloat).option("--safe-area <x,y,w,h>", "always-visible region as fractions 0..1; the placement is kept inside it").option("--profile <name>").option("--json").addHelpText("after", `
|
|
2789
2874
|
Example:
|
|
2790
2875
|
$ nodaro media overlay-placement https://x/base.png --intent "a logo" --aspect 2.5
|
|
@@ -3336,7 +3421,7 @@ function pickerCatalogsCommand() {
|
|
|
3336
3421
|
const cmd = new Command("pickers").description(
|
|
3337
3422
|
"list parameter-picker node types and their value catalogs (valid ids for setting, mood, person, \u2026)"
|
|
3338
3423
|
);
|
|
3339
|
-
cmd.command("list").description("list all picker node types + option counts").option("--profile <name>").option("--json").action(async (opts) => {
|
|
3424
|
+
cmd.command("list").description("list all picker node types + option counts (and how many options have a picture)").option("--profile <name>").option("--json").action(async (opts) => {
|
|
3340
3425
|
try {
|
|
3341
3426
|
const client = buildClient(opts.profile);
|
|
3342
3427
|
const result = await client.pickerCatalogs.list();
|
|
@@ -3350,9 +3435,10 @@ function pickerCatalogsCommand() {
|
|
|
3350
3435
|
label: c.label,
|
|
3351
3436
|
kind: c.kind,
|
|
3352
3437
|
field: c.valueField ?? (c.fields?.join("+") ?? ""),
|
|
3353
|
-
options: c.optionCount
|
|
3438
|
+
options: c.optionCount,
|
|
3439
|
+
images: c.imageCount ?? 0
|
|
3354
3440
|
})),
|
|
3355
|
-
["nodeType", "label", "kind", "field", "options"]
|
|
3441
|
+
["nodeType", "label", "kind", "field", "options", "images"]
|
|
3356
3442
|
);
|
|
3357
3443
|
} catch (err) {
|
|
3358
3444
|
handleError(err);
|
|
@@ -3390,7 +3476,11 @@ Examples:
|
|
|
3390
3476
|
$ nodaro pickers list
|
|
3391
3477
|
$ nodaro pickers get setting
|
|
3392
3478
|
$ nodaro pickers get setting --full --category Urban
|
|
3393
|
-
$ nodaro pickers get person --field hairColor
|
|
3479
|
+
$ nodaro pickers get person --field hairColor
|
|
3480
|
+
$ nodaro pickers get person --json | jq '.dimensions[].options[] | {id, imageUrl}'
|
|
3481
|
+
|
|
3482
|
+
Options that have a picture carry an absolute imageUrl; person and styling also
|
|
3483
|
+
return their topics (sections), each with its round picture.`
|
|
3394
3484
|
).action(
|
|
3395
3485
|
async (nodeType, opts) => {
|
|
3396
3486
|
try {
|
|
@@ -4892,9 +4982,13 @@ function parseSourceSpec(spec, index2) {
|
|
|
4892
4982
|
}
|
|
4893
4983
|
return { id: `source-${index2 + 1}`, url: spec, kind: "video" };
|
|
4894
4984
|
}
|
|
4985
|
+
function parseAudioSyncSource(spec, index2) {
|
|
4986
|
+
const named = /^([^=\s]{1,200})=(https?:\/\/.+)$/.exec(spec);
|
|
4987
|
+
return named ? { id: named[1], url: named[2] } : { id: `source-${index2 + 1}`, url: spec };
|
|
4988
|
+
}
|
|
4895
4989
|
function editCommand() {
|
|
4896
4990
|
const cmd = new Command("edit").description(
|
|
4897
|
-
"editorial primitives for podcast / long-form video \u2014 detect silence, apply an EDL, plan a cut"
|
|
4991
|
+
"editorial primitives for podcast / long-form video \u2014 detect silence, sync recordings, apply an EDL, plan a cut"
|
|
4898
4992
|
);
|
|
4899
4993
|
cmd.command("silence-detect <audioUrl>").description("detect silence ranges in an audio or video source (ffmpeg, keyless)").option("--threshold-db <dbfs>", "dBFS threshold, \u2264 0 (write a negative as --threshold-db=-35)", (v) => Number(v)).option("--min-silence-ms <ms>", "minimum silence length to report", (v) => parseInt(v, 10)).option("--pad-ms <ms>", "padding kept around speech", (v) => parseInt(v, 10)).option("--watch", "poll the job until it finishes").option("--poll-interval <ms>", "poll interval with --watch", (v) => parseInt(v, 10)).option("--profile <name>").option("--json").action(
|
|
4900
4994
|
async (audioUrl, opts) => {
|
|
@@ -4917,6 +5011,44 @@ function editCommand() {
|
|
|
4917
5011
|
}
|
|
4918
5012
|
}
|
|
4919
5013
|
);
|
|
5014
|
+
cmd.command("audio-sync").description("measure how far apart 2-6 recordings' clocks are, from their sound (keyless)").option(
|
|
5015
|
+
"--source <[id=]url>",
|
|
5016
|
+
"a recording (audio or video) as url or id=url (repeatable, 2-6); ids are minted as source-N when omitted",
|
|
5017
|
+
collectVariadic
|
|
5018
|
+
).option("--sources-file <file>", "JSON array of { id, url } rows (overrides --source)").option("--reference <id>", "the source every offset is measured against (default: the first)").option("--watch", "poll the job until it finishes").option("--poll-interval <ms>", "poll interval with --watch", (v) => parseInt(v, 10)).option("--profile <name>").option("--json").action(
|
|
5019
|
+
async (opts) => {
|
|
5020
|
+
let sources;
|
|
5021
|
+
if (opts.sourcesFile) {
|
|
5022
|
+
const parsed = readJsonFile(opts.sourcesFile);
|
|
5023
|
+
if (!Array.isArray(parsed)) {
|
|
5024
|
+
warn(`--sources-file ${opts.sourcesFile} must contain a JSON array of { id, url } rows`);
|
|
5025
|
+
process.exit(1);
|
|
5026
|
+
}
|
|
5027
|
+
sources = parsed;
|
|
5028
|
+
} else {
|
|
5029
|
+
sources = (opts.source ?? []).map(parseAudioSyncSource);
|
|
5030
|
+
}
|
|
5031
|
+
if (sources.length < 2 || sources.length > 6) {
|
|
5032
|
+
warn(`audio-sync takes 2-6 recordings \u2014 pass --source <url> (repeatable) or --sources-file <file> (got ${sources.length})`);
|
|
5033
|
+
process.exit(1);
|
|
5034
|
+
}
|
|
5035
|
+
try {
|
|
5036
|
+
const client = buildClient(opts.profile);
|
|
5037
|
+
const result = await client.edit.audioSync({
|
|
5038
|
+
sources,
|
|
5039
|
+
...opts.reference !== void 0 ? { reference: opts.reference } : {}
|
|
5040
|
+
});
|
|
5041
|
+
await reportQueuedJob(result, () => client.jobs.getStatus(result.jobId), {
|
|
5042
|
+
json: opts.json,
|
|
5043
|
+
watch: opts.watch,
|
|
5044
|
+
pollInterval: opts.pollInterval,
|
|
5045
|
+
note: `audio-sync (${sources.length} sources)`
|
|
5046
|
+
});
|
|
5047
|
+
} catch (err) {
|
|
5048
|
+
handleError(err);
|
|
5049
|
+
}
|
|
5050
|
+
}
|
|
5051
|
+
);
|
|
4920
5052
|
cmd.command("apply-edl").description("render an edit decision list into a video or audio cut").requiredOption("--edl <file>", "path to a JSON file holding the EDL").option("--transcript <file>", "optional transcript JSON to remap through the cut").option("--source <url>", "positional media-URL override for edl.sources[i] (repeatable)", collectVariadic).option("--output <kind>", "video | audio", "video").option("--quality <q>", "proxy | final", "final").option("--crossfade-ms <ms>", "default crossfade on boundaries with no transition", (v) => parseInt(v, 10)).option("--watch", "poll the job until it finishes").option("--poll-interval <ms>", "poll interval with --watch", (v) => parseInt(v, 10)).option("--profile <name>").option("--json").action(
|
|
4921
5053
|
async (opts) => {
|
|
4922
5054
|
if (opts.output !== "video" && opts.output !== "audio") {
|