@nodaro/cli 1.27.0 → 1.28.1
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 +99 -6
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
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, DIALOGUE_PROVIDERS, dialogueStabilityAccepted, dialogueProviderOf, getDialogueCapabilities, 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, SOCIAL_PLATFORMS, collectionRecordHeadline, COMPETITOR_ACCOUNT_KEYS, isMeasurableCard, EDIT_PLAN_MODES, isSocialPost, COMPETITOR_ABOUT_PLATFORMS, COMPETITOR_SCHEDULES, RECAST_SEGMENT_PACKS } from '@nodaro/shared';
|
|
16
|
+
import { CHARACTER_STYLES, TRANSCRIBE_PROVIDERS, transcribeLaneSupportsWordTimestamps, DIALOGUE_PROVIDERS, dialogueStabilityAccepted, dialogueProviderOf, getDialogueCapabilities, 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_VIDEO_MASK_PROVIDER, VIDEO_MASK_PROVIDERS, VIDEO_MASK_LIMITS, MASK_COMPOSITE_BOUNDS, MASK_COMPOSITE_DEFAULTS, MASK_COMPOSITE_BACKGROUND_FITS, MASK_COMPOSITE_AUDIO_SOURCES, DEFAULT_TRANSCRIBE_PROVIDER, SOCIAL_PLATFORMS, collectionRecordHeadline, COMPETITOR_ACCOUNT_KEYS, isMeasurableCard, EDIT_PLAN_MODES, isSocialPost, COMPETITOR_ABOUT_PLATFORMS, COMPETITOR_SCHEDULES, RECAST_SEGMENT_PACKS } 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.28.1",
|
|
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.25.0",
|
|
74
|
+
"@nodaro/shared": "^3.28.0",
|
|
75
75
|
commander: "^12.1.0",
|
|
76
76
|
picocolors: "^1.1.1",
|
|
77
|
-
"@nodaro/prompts": "^1.
|
|
77
|
+
"@nodaro/prompts": "^1.37.1"
|
|
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.28.1" ;
|
|
402
402
|
function buildClient(profileName) {
|
|
403
403
|
const { name, profile } = getProfile(profileName);
|
|
404
404
|
if (!profile) {
|
|
@@ -1304,6 +1304,7 @@ Examples:
|
|
|
1304
1304
|
$ echo '{"prompt":"hi","provider":"flux"}' > body.json
|
|
1305
1305
|
$ nodaro nodes run generate-image --params-file body.json --watch
|
|
1306
1306
|
$ nodaro nodes run text-to-speech --param text="And so it begins." --param previousText="The night before, nobody slept." --param nextText="By noon the harbour was empty." --watch
|
|
1307
|
+
$ nodaro nodes run video-depth --param videoUrl=https://cdn.example/clip.mp4 --param colormap=turbo --watch
|
|
1307
1308
|
|
|
1308
1309
|
Structured references (the editor's wired-reference shape) \u2014 let a {image:N} prompt
|
|
1309
1310
|
token bind a labeled reference, assembled server-side into @image_N (same as the
|
|
@@ -2900,6 +2901,77 @@ names).`).action(
|
|
|
2900
2901
|
}
|
|
2901
2902
|
}
|
|
2902
2903
|
);
|
|
2904
|
+
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("--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", `
|
|
2905
|
+
Examples:
|
|
2906
|
+
$ nodaro media video-mask https://x/dance.mp4 "the dancer" --watch
|
|
2907
|
+
$ nodaro media video-mask https://x/street.mp4 "person, dog" --threshold 0.3 --watch
|
|
2908
|
+
$ nodaro media video-mask https://x/long-take.mp4 "the skater" --model sam-3 --watch
|
|
2909
|
+
|
|
2910
|
+
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
|
|
2911
|
+
clip's length. Feed the mask to \`nodaro media mask-composite\`.`).action(async (videoUrl, prompt, opts) => {
|
|
2912
|
+
try {
|
|
2913
|
+
if (opts.model && !VIDEO_MASK_PROVIDERS.includes(opts.model)) {
|
|
2914
|
+
warn(`--model must be one of ${VIDEO_MASK_PROVIDERS.join(", ")} (got "${opts.model}")`);
|
|
2915
|
+
process.exit(1);
|
|
2916
|
+
}
|
|
2917
|
+
if (opts.threshold !== void 0 && !(opts.threshold >= VIDEO_MASK_LIMITS.THRESHOLD_MIN && opts.threshold <= VIDEO_MASK_LIMITS.THRESHOLD_MAX)) {
|
|
2918
|
+
warn(`--threshold must be between ${VIDEO_MASK_LIMITS.THRESHOLD_MIN} and ${VIDEO_MASK_LIMITS.THRESHOLD_MAX}`);
|
|
2919
|
+
process.exit(1);
|
|
2920
|
+
}
|
|
2921
|
+
const client = buildClient(opts.profile);
|
|
2922
|
+
const result = await client.media.videoMask({
|
|
2923
|
+
videoUrl,
|
|
2924
|
+
prompt,
|
|
2925
|
+
...opts.threshold !== void 0 ? { threshold: opts.threshold } : {},
|
|
2926
|
+
...opts.model ? { provider: opts.model } : {}
|
|
2927
|
+
});
|
|
2928
|
+
await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "video mask" });
|
|
2929
|
+
} catch (err) {
|
|
2930
|
+
handleError(err);
|
|
2931
|
+
}
|
|
2932
|
+
});
|
|
2933
|
+
cmd.command("mask-composite <foregroundUrl> <backgroundUrl> <maskUrl>").description("put a foreground video over a background video through a mask video (white = foreground) \u2014 local compositor, no AI").option("--invert", "swap which side of the mask shows the foreground").option("--feather <px>", `edge softening ${MASK_COMPOSITE_BOUNDS.FEATHER_MIN}\u2013${MASK_COMPOSITE_BOUNDS.FEATHER_MAX} px (default ${MASK_COMPOSITE_DEFAULTS.feather})`, (v) => parseInt(v, 10)).option("--grow <px>", `grow (+) or shrink (\u2212) the foreground region, ${MASK_COMPOSITE_BOUNDS.GROW_MIN}\u2013${MASK_COMPOSITE_BOUNDS.GROW_MAX} px (default 0)`, (v) => parseInt(v, 10)).option("--background-fit <fit>", `${MASK_COMPOSITE_BACKGROUND_FITS.join(" | ")} (default ${MASK_COMPOSITE_DEFAULTS.backgroundFit})`).option("--audio <source>", `${MASK_COMPOSITE_AUDIO_SOURCES.join(" | ")} (default ${MASK_COMPOSITE_DEFAULTS.audioSource})`).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", `
|
|
2934
|
+
Example:
|
|
2935
|
+
$ nodaro media mask-composite https://x/dance.mp4 https://x/beach.mp4 https://x/dance-mask.mp4 --feather 4 --grow -1 --watch
|
|
2936
|
+
|
|
2937
|
+
The result follows the FOREGROUND's size, frame rate and length; the background
|
|
2938
|
+
is fitted to that frame and loops when shorter; the mask holds its last frame.`).action(
|
|
2939
|
+
async (foregroundUrl, backgroundUrl, maskUrl, opts) => {
|
|
2940
|
+
try {
|
|
2941
|
+
const b = MASK_COMPOSITE_BOUNDS;
|
|
2942
|
+
if (opts.feather !== void 0 && !(Number.isInteger(opts.feather) && opts.feather >= b.FEATHER_MIN && opts.feather <= b.FEATHER_MAX)) {
|
|
2943
|
+
warn(`--feather must be a whole number from ${b.FEATHER_MIN} to ${b.FEATHER_MAX}`);
|
|
2944
|
+
process.exit(1);
|
|
2945
|
+
}
|
|
2946
|
+
if (opts.grow !== void 0 && !(Number.isInteger(opts.grow) && opts.grow >= b.GROW_MIN && opts.grow <= b.GROW_MAX)) {
|
|
2947
|
+
warn(`--grow must be a whole number from ${b.GROW_MIN} to ${b.GROW_MAX}`);
|
|
2948
|
+
process.exit(1);
|
|
2949
|
+
}
|
|
2950
|
+
if (opts.backgroundFit && !MASK_COMPOSITE_BACKGROUND_FITS.includes(opts.backgroundFit)) {
|
|
2951
|
+
warn(`--background-fit must be one of ${MASK_COMPOSITE_BACKGROUND_FITS.join(", ")} (got "${opts.backgroundFit}")`);
|
|
2952
|
+
process.exit(1);
|
|
2953
|
+
}
|
|
2954
|
+
if (opts.audio && !MASK_COMPOSITE_AUDIO_SOURCES.includes(opts.audio)) {
|
|
2955
|
+
warn(`--audio must be one of ${MASK_COMPOSITE_AUDIO_SOURCES.join(", ")} (got "${opts.audio}")`);
|
|
2956
|
+
process.exit(1);
|
|
2957
|
+
}
|
|
2958
|
+
const client = buildClient(opts.profile);
|
|
2959
|
+
const result = await client.media.maskComposite({
|
|
2960
|
+
foregroundUrl,
|
|
2961
|
+
backgroundUrl,
|
|
2962
|
+
maskUrl,
|
|
2963
|
+
...opts.invert ? { invertMask: true } : {},
|
|
2964
|
+
...opts.feather !== void 0 ? { feather: opts.feather } : {},
|
|
2965
|
+
...opts.grow !== void 0 ? { grow: opts.grow } : {},
|
|
2966
|
+
...opts.backgroundFit ? { backgroundFit: opts.backgroundFit } : {},
|
|
2967
|
+
...opts.audio ? { audioSource: opts.audio } : {}
|
|
2968
|
+
});
|
|
2969
|
+
await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "mask composite" });
|
|
2970
|
+
} catch (err) {
|
|
2971
|
+
handleError(err);
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
);
|
|
2903
2975
|
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", `
|
|
2904
2976
|
Example:
|
|
2905
2977
|
$ nodaro media overlay-placement https://x/base.png --intent "a logo" --aspect 2.5
|
|
@@ -3085,6 +3157,27 @@ Example:
|
|
|
3085
3157
|
}
|
|
3086
3158
|
}
|
|
3087
3159
|
);
|
|
3160
|
+
cmd.command("pitch-tempo").description("shift pitch by semitones and/or change tempo without changing pitch (Rubber Band); a video keeps its picture").option("--audio <url>", "audio URL to process").option("--video <url>", "video URL whose soundtrack to process (tempo stays 1x)").option("--semitones <n>", "pitch shift, -12..12 (12 = one octave up)", parseFloat).option("--tempo <x>", "speed factor 0.5..2 with the pitch kept", parseFloat).option("--no-preserve-formants", "let the timbre shift with the pitch (chipmunk / giant)").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").action(
|
|
3161
|
+
async (opts) => {
|
|
3162
|
+
try {
|
|
3163
|
+
if (Boolean(opts.audio) === Boolean(opts.video)) {
|
|
3164
|
+
warn("Provide exactly one of --audio <url> or --video <url>");
|
|
3165
|
+
process.exit(1);
|
|
3166
|
+
}
|
|
3167
|
+
const client = buildClient(opts.profile);
|
|
3168
|
+
const result = await client.audio.pitchTempo({
|
|
3169
|
+
...opts.audio ? { audioUrl: opts.audio } : {},
|
|
3170
|
+
...opts.video ? { videoUrl: opts.video } : {},
|
|
3171
|
+
...opts.semitones !== void 0 ? { semitones: opts.semitones } : {},
|
|
3172
|
+
...opts.tempo !== void 0 ? { tempo: opts.tempo } : {},
|
|
3173
|
+
...opts.preserveFormants === false ? { preserveFormants: false } : {}
|
|
3174
|
+
});
|
|
3175
|
+
await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "pitch & tempo" });
|
|
3176
|
+
} catch (err) {
|
|
3177
|
+
handleError(err);
|
|
3178
|
+
}
|
|
3179
|
+
}
|
|
3180
|
+
);
|
|
3088
3181
|
cmd.command("combine").description("concatenate audio segments end-to-end").option("--segment <url[@a-b]>", 'segment URL with an optional "@start-end" sub-range in seconds \u2014 repeat per segment, in order', collectVariadic).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", `
|
|
3089
3182
|
Example:
|
|
3090
3183
|
$ nodaro audio combine --segment https://.../intro.mp3 --segment "https://.../talk.mp3@12-95" --watch`).action(
|