@nodaro/cli 1.49.0 → 1.50.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
@@ -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, TRANSCRIBE_LANES, DEFAULT_TRANSCRIBE_PROVIDER } from '@nodaro/shared/models';
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.49.0",
45
+ version: "1.50.0",
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.69.0",
87
- "@nodaro/shared": "^3.62.0",
86
+ "@nodaro/sdk": "^2.70.0",
87
+ "@nodaro/shared": "^3.63.0",
88
88
  commander: "^12.1.0",
89
89
  picocolors: "^1.1.1",
90
- "@nodaro/prompts": "^1.54.0"
90
+ "@nodaro/prompts": "^1.55.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.49.0" ;
417
+ var CLI_VERSION = "1.50.0" ;
418
418
  function buildPublicClient(opts = {}) {
419
419
  const { profile } = getProfile(opts.profile);
420
420
  return createClient({
@@ -3495,7 +3495,7 @@ 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("--transcribe-provider <name>", `engine for the auto-transcription: ${TRANSCRIBE_LANES.join(" | ")}`).option(
3498
+ ).option("--no-auto-transcribe", "do NOT transcribe the video's audio when no --text / --captions-file is given").option("--transcribe-provider <name>", `engine for the auto-transcription: ${CAPTION_TRANSCRIBE_LANES.join(" | ")}`).option(
3499
3499
  "--segments-file <path>",
3500
3500
  "JSON array of caption SEGMENTS \u2014 non-overlapping { startMs, endMs } ranges, each with its own style/look/position overrides and optional own words"
3501
3501
  ).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 +3540,8 @@ Examples:
3540
3540
  warn(`--font-weight must be 100-900 in steps of 100 (got "${opts.fontWeight}")`);
3541
3541
  process.exit(1);
3542
3542
  }
3543
- if (opts.transcribeProvider && !TRANSCRIBE_LANES.includes(opts.transcribeProvider)) {
3544
- warn(`--transcribe-provider must be one of ${TRANSCRIBE_LANES.join(", ")} (got "${opts.transcribeProvider}")`);
3543
+ if (opts.transcribeProvider && !CAPTION_TRANSCRIBE_LANES.includes(opts.transcribeProvider)) {
3544
+ warn(`--transcribe-provider must be one of ${CAPTION_TRANSCRIBE_LANES.join(", ")} (got "${opts.transcribeProvider}")`);
3545
3545
  process.exit(1);
3546
3546
  }
3547
3547
  const maxWordsPerLine = opts.maxWordsPerLine !== void 0 ? parseMaxWordsPerLine(opts.maxWordsPerLine) : void 0;
@@ -3873,10 +3873,11 @@ image, passed through unchanged): \`nodaro jobs get <jobId>\`. Use the mask for
3873
3873
  handleError(err);
3874
3874
  }
3875
3875
  });
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", `
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("--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
3877
  Examples:
3878
3878
  $ nodaro media split-layers https://x/poster.png --watch
3879
3879
  $ nodaro media split-layers https://x/poster.png --max-layers 4 --size 2K --prompt "the title, the car, the sky" --watch --json
3880
+ $ nodaro media split-layers https://x/poster.png --session <sessionId> --idempotency-key poster-1-layers
3880
3881
 
3881
3882
  The finished job's output carries \`imageUrl\` (the base picture), \`layers\` (each
3882
3883
  layer's transparent PNG, bottom to top) and \`layerData\` (per layer: name,
@@ -3902,8 +3903,9 @@ charged only for the images it returns.`).action(async (imageUrl, opts) => {
3902
3903
  imageUrl,
3903
3904
  ...opts.maxLayers !== void 0 ? { maxLayers: opts.maxLayers } : {},
3904
3905
  ...opts.size !== void 0 ? { size: opts.size } : {},
3905
- ...opts.prompt ? { prompt: opts.prompt } : {}
3906
- });
3906
+ ...opts.prompt ? { prompt: opts.prompt } : {},
3907
+ ...opts.session !== void 0 ? { sessionId: opts.session } : {}
3908
+ }, opts.idempotencyKey ? { idempotencyKey: opts.idempotencyKey } : {});
3907
3909
  await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "split into layers" });
3908
3910
  } catch (err) {
3909
3911
  handleError(err);
@@ -4261,7 +4263,10 @@ Example:
4261
4263
  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
4264
  "--provider <name>",
4263
4265
  `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("--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", `
4266
+ ).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(
4267
+ "--target-language <code>",
4268
+ `translate the speech into this language instead (nemotron-3-5-transcribe only, to or from English; never with --word-timestamps): ${TRANSCRIBE_TARGET_LANGUAGES.join(" | ")}`
4269
+ ).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
4270
  The completed job's output_data carries: text (the whole transcript), words
4266
4271
  (one entry per word, in MILLISECONDS) and json (the normalized transcript, also
4267
4272
  ms). A top-level segments array (SECONDS) exists only on the legacy lanes \u2014
@@ -4274,7 +4279,10 @@ Feed the words straight into a kinetic caption render:
4274
4279
  --style word-highlight --no-auto-transcribe --watch
4275
4280
 
4276
4281
  Example:
4277
- $ nodaro audio transcribe --audio https://.../interview.mp3 --provider elevenlabs-stt --diarize --watch`).action(
4282
+ $ nodaro audio transcribe --audio https://.../interview.mp3 --provider elevenlabs-stt --diarize --watch
4283
+
4284
+ Translate Spanish speech into English (Nemotron 3.5 Transcribe, priced per started minute):
4285
+ $ nodaro audio transcribe --audio https://.../entrevista.mp3 --provider nemotron-3-5-transcribe --target-language en --watch`).action(
4278
4286
  async (opts) => {
4279
4287
  try {
4280
4288
  if (opts.provider && !TRANSCRIBE_PROVIDERS.includes(opts.provider)) {
@@ -4288,10 +4296,16 @@ Example:
4288
4296
  );
4289
4297
  process.exit(1);
4290
4298
  }
4299
+ const translationRefusal = transcribeTranslationRefusal(resolvedLane, opts.targetLanguage, opts.wordTimestamps === true);
4300
+ if (translationRefusal) {
4301
+ warn(`--target-language: ${translationRefusal}`);
4302
+ process.exit(1);
4303
+ }
4291
4304
  const client = buildClient(opts.profile);
4292
4305
  const result = await client.audio.transcribe({
4293
4306
  audioUrl: opts.audio,
4294
4307
  ...opts.provider ? { provider: opts.provider } : {},
4308
+ ...opts.targetLanguage ? { targetLanguage: opts.targetLanguage } : {},
4295
4309
  ...opts.language ? { language: opts.language } : {},
4296
4310
  ...opts.diarize ? { diarize: true } : {},
4297
4311
  ...opts.tagAudioEvents ? { tagAudioEvents: true } : {},
@@ -5923,7 +5937,7 @@ Examples:
5923
5937
  }
5924
5938
  );
5925
5939
  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"
5940
+ "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
5941
  ).option("--profile <name>").option("--json").addHelpText(
5928
5942
  "after",
5929
5943
  `