@nodaro/cli 1.49.0 → 1.50.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 +33 -16
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -11,12 +11,12 @@ import { randomBytes } from 'crypto';
|
|
|
11
11
|
import { spawn } from 'child_process';
|
|
12
12
|
import { createClient, StaticTokenAuth, CallbackAuth } from '@nodaro/sdk/client';
|
|
13
13
|
import { ContinuationPreviewPendingError, UnauthorizedError, NodaroError, AppRunVersionChangedError, AlreadyRunningError, ContinuationRefusedError } from '@nodaro/sdk/errors';
|
|
14
|
-
import { collectionRecordHeadline, PREVIEW_RENDER_NODE_TYPES, isPreviewRefusalCode, parseNodePresetExport } from '@nodaro/shared/nodes';
|
|
14
|
+
import { transcribeTranslationRefusal, collectionRecordHeadline, PREVIEW_RENDER_NODE_TYPES, isPreviewRefusalCode, parseNodePresetExport } from '@nodaro/shared/nodes';
|
|
15
15
|
import select from '@inquirer/select';
|
|
16
16
|
import checkbox from '@inquirer/checkbox';
|
|
17
17
|
import input from '@inquirer/input';
|
|
18
18
|
import { CHARACTER_STYLES } from '@nodaro/shared/entities';
|
|
19
|
-
import { TRANSCRIBE_PROVIDERS, transcribeLaneSupportsWordTimestamps, DIALOGUE_PROVIDERS, dialogueStabilityAccepted, dialogueProviderOf, getDialogueCapabilities,
|
|
19
|
+
import { TRANSCRIBE_PROVIDERS, transcribeLaneSupportsWordTimestamps, DIALOGUE_PROVIDERS, dialogueStabilityAccepted, dialogueProviderOf, getDialogueCapabilities, CAPTION_TRANSCRIBE_LANES, DEFAULT_TRANSCRIBE_PROVIDER, TRANSCRIBE_TARGET_LANGUAGES } from '@nodaro/shared/models';
|
|
20
20
|
import { VOICE_FAVORITE_TYPES } from '@nodaro/shared/pipeline';
|
|
21
21
|
import { OVERLAY_ANCHORS, OVERLAY_PLATFORM_IDS, GENERATE_MASK_LIMITS, DEFAULT_VIDEO_MASK_PROVIDER, VIDEO_MASK_PROVIDERS, VIDEO_MASK_LIMITS, MASK_COMPOSITE_BOUNDS, MASK_COMPOSITE_DEFAULTS, MASK_COMPOSITE_BACKGROUND_FITS, MASK_COMPOSITE_AUDIO_SOURCES, MASK_COMPOSITE_FILLS } from '@nodaro/shared/media';
|
|
22
22
|
import { ALL_CAPTION_STYLES, DEFAULT_CAPTION_LOOK, CAPTION_LOOK_IDS, CAPTION_MAX_WORDS_PER_LINE_MIN, CAPTION_MAX_WORDS_PER_LINE_MAX, SUPPORTED_FONT_NAMES } from '@nodaro/shared/captions';
|
|
@@ -42,7 +42,7 @@ var require_package = __commonJS({
|
|
|
42
42
|
"package.json"(exports$1, module) {
|
|
43
43
|
module.exports = {
|
|
44
44
|
name: "@nodaro/cli",
|
|
45
|
-
version: "1.
|
|
45
|
+
version: "1.50.1",
|
|
46
46
|
description: "Command-line interface for Nodaro \u2014 list and run workflows, inspect jobs and executions, manage projects from the terminal.",
|
|
47
47
|
type: "module",
|
|
48
48
|
license: "Apache-2.0",
|
|
@@ -83,11 +83,11 @@ var require_package = __commonJS({
|
|
|
83
83
|
"@inquirer/confirm": "^6.0.12",
|
|
84
84
|
"@inquirer/input": "^5.0.12",
|
|
85
85
|
"@inquirer/select": "^5.1.4",
|
|
86
|
-
"@nodaro/sdk": "^2.
|
|
87
|
-
"@nodaro/shared": "^3.
|
|
86
|
+
"@nodaro/sdk": "^2.71.0",
|
|
87
|
+
"@nodaro/shared": "^3.64.0",
|
|
88
88
|
commander: "^12.1.0",
|
|
89
89
|
picocolors: "^1.1.1",
|
|
90
|
-
"@nodaro/prompts": "^1.
|
|
90
|
+
"@nodaro/prompts": "^1.56.0"
|
|
91
91
|
},
|
|
92
92
|
devDependencies: {
|
|
93
93
|
tsup: "^8.5.0",
|
|
@@ -414,7 +414,7 @@ function saveWorkspace(profileName, workspaceId) {
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
// src/client.ts
|
|
417
|
-
var CLI_VERSION = "1.
|
|
417
|
+
var CLI_VERSION = "1.50.1" ;
|
|
418
418
|
function buildPublicClient(opts = {}) {
|
|
419
419
|
const { profile } = getProfile(opts.profile);
|
|
420
420
|
return createClient({
|
|
@@ -3495,7 +3495,10 @@ Examples:
|
|
|
3495
3495
|
).option("--animate", "animate per-word motion on the kinetic styles (the default)").option(
|
|
3496
3496
|
"--no-animate",
|
|
3497
3497
|
"freeze per-word motion on the kinetic styles \u2014 keeps grouping, line-holding and the spoken-word highlight (kinetic styles only)"
|
|
3498
|
-
).option("--no-auto-transcribe", "do NOT transcribe the video's audio when no --text / --captions-file is given").option(
|
|
3498
|
+
).option("--no-auto-transcribe", "do NOT transcribe the video's audio when no --text / --captions-file is given").option(
|
|
3499
|
+
"--transcribe-provider <name>",
|
|
3500
|
+
`engine for the auto-transcription: ${CAPTION_TRANSCRIBE_LANES.join(" | ")} (nemotron-3-5-transcribe adds the video's started minutes to the price)`
|
|
3501
|
+
).option(
|
|
3499
3502
|
"--segments-file <path>",
|
|
3500
3503
|
"JSON array of caption SEGMENTS \u2014 non-overlapping { startMs, endMs } ranges, each with its own style/look/position overrides and optional own words"
|
|
3501
3504
|
).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", `
|
|
@@ -3540,8 +3543,8 @@ Examples:
|
|
|
3540
3543
|
warn(`--font-weight must be 100-900 in steps of 100 (got "${opts.fontWeight}")`);
|
|
3541
3544
|
process.exit(1);
|
|
3542
3545
|
}
|
|
3543
|
-
if (opts.transcribeProvider && !
|
|
3544
|
-
warn(`--transcribe-provider must be one of ${
|
|
3546
|
+
if (opts.transcribeProvider && !CAPTION_TRANSCRIBE_LANES.includes(opts.transcribeProvider)) {
|
|
3547
|
+
warn(`--transcribe-provider must be one of ${CAPTION_TRANSCRIBE_LANES.join(", ")} (got "${opts.transcribeProvider}")`);
|
|
3545
3548
|
process.exit(1);
|
|
3546
3549
|
}
|
|
3547
3550
|
const maxWordsPerLine = opts.maxWordsPerLine !== void 0 ? parseMaxWordsPerLine(opts.maxWordsPerLine) : void 0;
|
|
@@ -3873,10 +3876,11 @@ image, passed through unchanged): \`nodaro jobs get <jobId>\`. Use the mask for
|
|
|
3873
3876
|
handleError(err);
|
|
3874
3877
|
}
|
|
3875
3878
|
});
|
|
3876
|
-
cmd.command("split-layers <imageUrl>").description("split one image into a base picture and separate layers \u2014 each element on its own transparent PNG, with its name, stacking order and the box it sits in on the base").option("--max-layers <n>", `the most layers to make, ${SPLIT_LAYERS_MAX_LAYERS.min}\u2013${SPLIT_LAYERS_MAX_LAYERS.max} (default ${SPLIT_LAYERS_MAX_LAYERS.default}); more elements than that merge into fewer layers`, (v) => Number(v)).option("--size <size>", `each image's pixel budget: ${SPLIT_LAYERS_SIZES.join(" | ")} (default 1K; auto keeps the picture's own size, between 1K and 2K)`).option("--prompt <text>", `what to separate, up to ${SPLIT_LAYERS_PROMPT_MAX.toLocaleString("en-US")} characters (default: the main elements are found automatically)`).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", `
|
|
3879
|
+
cmd.command("split-layers <imageUrl>").description("split one image into a base picture and separate layers \u2014 each element on its own transparent PNG, with its name, stacking order and the box it sits in on the base").option("--max-layers <n>", `the most layers to make, ${SPLIT_LAYERS_MAX_LAYERS.min}\u2013${SPLIT_LAYERS_MAX_LAYERS.max} (default ${SPLIT_LAYERS_MAX_LAYERS.default}); more elements than that merge into fewer layers`, (v) => Number(v)).option("--size <size>", `each image's pixel budget: ${SPLIT_LAYERS_SIZES.join(" | ")} (default 1K; auto keeps the picture's own size, between 1K and 2K)`).option("--prompt <text>", `what to separate, up to ${SPLIT_LAYERS_PROMPT_MAX.toLocaleString("en-US")} characters (default: the main elements are found automatically)`).option("--session <id>", "a generation session of yours to file the job in").option("--idempotency-key <key>", "sent as Idempotency-Key: a retry with the same key answers the job already started").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", `
|
|
3877
3880
|
Examples:
|
|
3878
3881
|
$ nodaro media split-layers https://x/poster.png --watch
|
|
3879
3882
|
$ nodaro media split-layers https://x/poster.png --max-layers 4 --size 2K --prompt "the title, the car, the sky" --watch --json
|
|
3883
|
+
$ nodaro media split-layers https://x/poster.png --session <sessionId> --idempotency-key poster-1-layers
|
|
3880
3884
|
|
|
3881
3885
|
The finished job's output carries \`imageUrl\` (the base picture), \`layers\` (each
|
|
3882
3886
|
layer's transparent PNG, bottom to top) and \`layerData\` (per layer: name,
|
|
@@ -3902,8 +3906,9 @@ charged only for the images it returns.`).action(async (imageUrl, opts) => {
|
|
|
3902
3906
|
imageUrl,
|
|
3903
3907
|
...opts.maxLayers !== void 0 ? { maxLayers: opts.maxLayers } : {},
|
|
3904
3908
|
...opts.size !== void 0 ? { size: opts.size } : {},
|
|
3905
|
-
...opts.prompt ? { prompt: opts.prompt } : {}
|
|
3906
|
-
|
|
3909
|
+
...opts.prompt ? { prompt: opts.prompt } : {},
|
|
3910
|
+
...opts.session !== void 0 ? { sessionId: opts.session } : {}
|
|
3911
|
+
}, opts.idempotencyKey ? { idempotencyKey: opts.idempotencyKey } : {});
|
|
3907
3912
|
await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "split into layers" });
|
|
3908
3913
|
} catch (err) {
|
|
3909
3914
|
handleError(err);
|
|
@@ -4261,7 +4266,10 @@ Example:
|
|
|
4261
4266
|
cmd.command("transcribe").description("transcribe an audio (or video) track to text \u2014 elevenlabs-stt is always word-level and can diarize + tag audio events").requiredOption("--audio <url>", "audio (or video) URL to transcribe").option(
|
|
4262
4267
|
"--provider <name>",
|
|
4263
4268
|
`transcription engine: ${TRANSCRIBE_PROVIDERS.join(" | ")} \u2014 "${DEFAULT_TRANSCRIBE_PROVIDER}" returns NO word timings, named or reached by omitting this flag`
|
|
4264
|
-
).option("--language <code>", "language code to force (default: auto-detect)").option("--diarize", "label which speaker said each word (elevenlabs-stt)").option("--tag-audio-events", "tag laughter / applause / other non-speech events (elevenlabs-stt)").option("--word-timestamps", "ask for per-word timings \u2014 rejected up front on a lane that cannot produce them").option(
|
|
4269
|
+
).option("--language <code>", "language code to force (default: auto-detect)").option("--diarize", "label which speaker said each word (elevenlabs-stt)").option("--tag-audio-events", "tag laughter / applause / other non-speech events (elevenlabs-stt)").option("--word-timestamps", "ask for per-word timings \u2014 rejected up front on a lane that cannot produce them").option(
|
|
4270
|
+
"--target-language <code>",
|
|
4271
|
+
`translate the speech into this language instead (nemotron-3-5-transcribe only, to or from English; never with --word-timestamps): ${TRANSCRIBE_TARGET_LANGUAGES.join(" | ")}`
|
|
4272
|
+
).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", `
|
|
4265
4273
|
The completed job's output_data carries: text (the whole transcript), words
|
|
4266
4274
|
(one entry per word, in MILLISECONDS) and json (the normalized transcript, also
|
|
4267
4275
|
ms). A top-level segments array (SECONDS) exists only on the legacy lanes \u2014
|
|
@@ -4274,7 +4282,10 @@ Feed the words straight into a kinetic caption render:
|
|
|
4274
4282
|
--style word-highlight --no-auto-transcribe --watch
|
|
4275
4283
|
|
|
4276
4284
|
Example:
|
|
4277
|
-
$ nodaro audio transcribe --audio https://.../interview.mp3 --provider elevenlabs-stt --diarize --watch
|
|
4285
|
+
$ nodaro audio transcribe --audio https://.../interview.mp3 --provider elevenlabs-stt --diarize --watch
|
|
4286
|
+
|
|
4287
|
+
Translate Spanish speech into English (Nemotron 3.5 Transcribe, priced per started minute):
|
|
4288
|
+
$ nodaro audio transcribe --audio https://.../entrevista.mp3 --provider nemotron-3-5-transcribe --target-language en --watch`).action(
|
|
4278
4289
|
async (opts) => {
|
|
4279
4290
|
try {
|
|
4280
4291
|
if (opts.provider && !TRANSCRIBE_PROVIDERS.includes(opts.provider)) {
|
|
@@ -4288,10 +4299,16 @@ Example:
|
|
|
4288
4299
|
);
|
|
4289
4300
|
process.exit(1);
|
|
4290
4301
|
}
|
|
4302
|
+
const translationRefusal = transcribeTranslationRefusal(resolvedLane, opts.targetLanguage, opts.wordTimestamps === true);
|
|
4303
|
+
if (translationRefusal) {
|
|
4304
|
+
warn(`--target-language: ${translationRefusal}`);
|
|
4305
|
+
process.exit(1);
|
|
4306
|
+
}
|
|
4291
4307
|
const client = buildClient(opts.profile);
|
|
4292
4308
|
const result = await client.audio.transcribe({
|
|
4293
4309
|
audioUrl: opts.audio,
|
|
4294
4310
|
...opts.provider ? { provider: opts.provider } : {},
|
|
4311
|
+
...opts.targetLanguage ? { targetLanguage: opts.targetLanguage } : {},
|
|
4295
4312
|
...opts.language ? { language: opts.language } : {},
|
|
4296
4313
|
...opts.diarize ? { diarize: true } : {},
|
|
4297
4314
|
...opts.tagAudioEvents ? { tagAudioEvents: true } : {},
|
|
@@ -5923,7 +5940,7 @@ Examples:
|
|
|
5923
5940
|
}
|
|
5924
5941
|
);
|
|
5925
5942
|
cmd.command("cost <ids...>").description(
|
|
5926
|
-
"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"
|
|
5943
|
+
"credits each identifier is charged \u2014 a model id, a credit id, or a metered LLM price key (<feature>:<model>[:direct | :effort-<level>]); an estimate prints as \u2248N"
|
|
5927
5944
|
).option("--profile <name>").option("--json").addHelpText(
|
|
5928
5945
|
"after",
|
|
5929
5946
|
`
|