@nodaro/cli 1.28.1 → 1.30.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 CHANGED
@@ -152,11 +152,12 @@ nodaro voice design --description "..." --text "..." --watch
152
152
  nodaro voice remix --description "..." --text "..." --watch
153
153
  nodaro voice dub --audio <url> --target-language es --watch
154
154
 
155
- # Media — social-video import, trim, save, metadata probe
155
+ # Media — social-video import, trim, split into parts, save, metadata probe
156
156
  nodaro media download <url> [--max-height 720] [--section 30-90] --watch
157
157
  nodaro media metadata <url>
158
158
  nodaro media trim-video --video <url> --start 12 --end 48 --watch
159
159
  nodaro media trim-audio --video <url> --format wav --watch
160
+ nodaro media split-media --video <url> --chunk-duration 60 --min-part-duration 20 --watch
160
161
  nodaro media still-to-video --image <url> --audio <url> --motion ken-burns --watch
161
162
  nodaro media slideshow --images <url1> <url2> <url3> --audio <url> --transition dissolve --watch
162
163
  nodaro media save <url> [--type video] --watch
@@ -192,7 +193,7 @@ shows the shape, not every option.
192
193
  | Run a published app (with curated inputs/outputs) | `nodaro apps run <slug> --input k=v` |
193
194
  | Run a single node directly (one-shot, no DAG) | `nodaro nodes run <type> --param k=v` |
194
195
 
195
- The `nodes run` path is the SDK / CLI equivalent of the MCP server's verb tools (`generate_image`, `generate_video`, etc.) — the route convention is `POST /v1/<type>` for every generation node, so any node listed by `nodaro nodes list` can be invoked with `nodaro nodes run`.
196
+ The `nodes run` path is the SDK / CLI equivalent of the MCP server's verb tools (`generate_image`, `generate_video`, etc.) — it posts to the node's route (`POST /v1/<type>` for most node types; the SDK reference's `nodes.run` section lists the ones with a route of their own, such as `llm-chat` and the `suno-*` nodes), so any node listed by `nodaro nodes list` that runs on its own can be invoked with `nodaro nodes run`. A node type with no route of its own (`modify-image`, `paint-mask`, …) fails before calling the API, naming what to run instead.
196
197
 
197
198
  ### Param syntax
198
199
 
package/dist/index.js CHANGED
@@ -9,11 +9,19 @@ import { join } from 'path';
9
9
  import { createServer } from 'http';
10
10
  import { randomBytes } from 'crypto';
11
11
  import { spawn } from 'child_process';
12
- import { createClient, StaticTokenAuth, UnauthorizedError, NodaroError, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS } from '@nodaro/sdk';
12
+ import { ContinuationRefusedError, createClient, StaticTokenAuth, UnauthorizedError, NodaroError, LOCATION_ASSET_TYPES, LOCATION_ATTACH_COLUMNS, OBJECT_ASSET_TYPES, OBJECT_ATTACH_COLUMNS } from '@nodaro/sdk';
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_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';
16
+ import { CHARACTER_STYLES } from '@nodaro/shared/entities';
17
+ import { TRANSCRIBE_PROVIDERS, transcribeLaneSupportsWordTimestamps, DIALOGUE_PROVIDERS, dialogueStabilityAccepted, dialogueProviderOf, getDialogueCapabilities, TRANSCRIBE_LANES, DEFAULT_TRANSCRIBE_PROVIDER } from '@nodaro/shared/models';
18
+ import { OVERLAY_ANCHORS, OVERLAY_PLATFORM_IDS, DEFAULT_VIDEO_MASK_PROVIDER, VIDEO_MASK_PROVIDERS, VIDEO_MASK_LIMITS, MASK_COMPOSITE_BOUNDS, MASK_COMPOSITE_DEFAULTS, MASK_COMPOSITE_BACKGROUND_FITS, MASK_COMPOSITE_AUDIO_SOURCES } from '@nodaro/shared/media';
19
+ 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';
20
+ import { VIDEO_OVERLAY_PRESET_IDS, VIDEO_OVERLAY_CORNERS, VIDEO_OVERLAY_OUTPUT_ASPECTS, isVideoOverlayPresetId, isVideoOverlayCorner, isVideoOverlayOutputAspect, VIDEO_OVERLAY_FITS } from '@nodaro/shared/video';
21
+ import { SOCIAL_PLATFORMS, COMPETITOR_ACCOUNT_KEYS, isMeasurableCard, isSocialPost, COMPETITOR_ABOUT_PLATFORMS, COMPETITOR_SCHEDULES } from '@nodaro/shared/social';
22
+ import { collectionRecordHeadline } from '@nodaro/shared/nodes';
23
+ import { RECAST_SEGMENT_PACKS } from '@nodaro/shared/apps';
24
+ import { SPEAKER_LAYOUT_IDS, EDL_TARGET_ASPECTS, EDIT_PLAN_TIERS, EDIT_PLAN_MODES } from '@nodaro/shared/edl';
17
25
 
18
26
  var __getOwnPropNames = Object.getOwnPropertyNames;
19
27
  var __commonJS = (cb, mod) => function __require() {
@@ -29,7 +37,7 @@ var require_package = __commonJS({
29
37
  "package.json"(exports$1, module) {
30
38
  module.exports = {
31
39
  name: "@nodaro/cli",
32
- version: "1.28.1",
40
+ version: "1.30.0",
33
41
  description: "Command-line interface for Nodaro \u2014 list and run workflows, inspect jobs and executions, manage projects from the terminal.",
34
42
  type: "module",
35
43
  license: "Apache-2.0",
@@ -70,11 +78,11 @@ var require_package = __commonJS({
70
78
  "@inquirer/confirm": "^6.0.12",
71
79
  "@inquirer/input": "^5.0.12",
72
80
  "@inquirer/select": "^5.1.4",
73
- "@nodaro/sdk": "^2.25.0",
74
- "@nodaro/shared": "^3.28.0",
81
+ "@nodaro/sdk": "^2.27.0",
82
+ "@nodaro/shared": "^3.32.0",
75
83
  commander: "^12.1.0",
76
84
  picocolors: "^1.1.1",
77
- "@nodaro/prompts": "^1.37.1"
85
+ "@nodaro/prompts": "^1.38.0"
78
86
  },
79
87
  devDependencies: {
80
88
  tsup: "^8.5.0",
@@ -398,7 +406,7 @@ function saveWorkspace(profileName, workspaceId) {
398
406
  }
399
407
 
400
408
  // src/client.ts
401
- var CLI_VERSION = "1.28.1" ;
409
+ var CLI_VERSION = "1.30.0" ;
402
410
  function buildClient(profileName) {
403
411
  const { name, profile } = getProfile(profileName);
404
412
  if (!profile) {
@@ -2551,6 +2559,50 @@ Example:
2551
2559
  }
2552
2560
  }
2553
2561
  );
2562
+ cmd.command("split-media").description("cut a video and/or an audio file into parts between a minimum and a maximum length (frame/sample-exact)").option("--video <url>", "video URL to split").option("--audio <url>", "audio URL to split (split on its own when --video is given too)").requiredOption("--chunk-duration <sec>", "longest a part may be, in seconds (at least 1)", parseFloat).option("--min-part-duration <sec>", "shortest a part may be, in seconds (default 4, never above --chunk-duration)", parseFloat).option("--format <fmt>", "audio parts format: mp3 (default), wav, or aac").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", `
2563
+ The parts are on the finished job's output_data: videoUrls[] / audioUrls[], chunkCount, partDurationsSec[].
2564
+
2565
+ Examples:
2566
+ $ nodaro media split-media --video https://.../talk.mp4 --chunk-duration 60 --watch
2567
+ $ nodaro media split-media --audio https://.../episode.mp3 --chunk-duration 300 --min-part-duration 120 --format wav --watch`).action(
2568
+ async (opts) => {
2569
+ try {
2570
+ if (!opts.video && !opts.audio) {
2571
+ warn("Provide --video <url>, --audio <url>, or both");
2572
+ process.exit(1);
2573
+ }
2574
+ if (!Number.isFinite(opts.chunkDuration) || opts.chunkDuration < 1) {
2575
+ warn("--chunk-duration must be a number of seconds, at least 1");
2576
+ process.exit(1);
2577
+ }
2578
+ if (opts.minPartDuration !== void 0) {
2579
+ if (!Number.isFinite(opts.minPartDuration) || opts.minPartDuration < 0) {
2580
+ warn("--min-part-duration must be a number of seconds, 0 or more");
2581
+ process.exit(1);
2582
+ }
2583
+ if (opts.minPartDuration > opts.chunkDuration) {
2584
+ warn("--min-part-duration must not be longer than --chunk-duration");
2585
+ process.exit(1);
2586
+ }
2587
+ }
2588
+ if (opts.format && !["mp3", "wav", "aac"].includes(opts.format)) {
2589
+ warn(`--format must be mp3, wav, or aac (got "${opts.format}")`);
2590
+ process.exit(1);
2591
+ }
2592
+ const client = buildClient(opts.profile);
2593
+ const result = await client.media.splitMedia({
2594
+ ...opts.video ? { videoUrl: opts.video } : {},
2595
+ ...opts.audio ? { audioUrl: opts.audio } : {},
2596
+ chunkDuration: opts.chunkDuration,
2597
+ ...opts.minPartDuration !== void 0 ? { minPartDuration: opts.minPartDuration } : {},
2598
+ ...opts.format ? { audioFormat: opts.format } : {}
2599
+ });
2600
+ await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "split into chunks" });
2601
+ } catch (err) {
2602
+ handleError(err);
2603
+ }
2604
+ }
2605
+ );
2554
2606
  cmd.command("add-captions <videoUrl>").description(
2555
2607
  "burn captions into a video \u2014 static subtitles, or a kinetic word-highlight / karaoke / tiktok-words / word-pop / bouncy render"
2556
2608
  ).option("--text <text>", "the caption text \u2014 spaced evenly across the video when no word timings are given").option(
@@ -5778,6 +5830,11 @@ var SOURCE_LABELS = {
5778
5830
  function isEditPlanMode(v) {
5779
5831
  return EDIT_PLAN_MODES.includes(v);
5780
5832
  }
5833
+ var CONTINUATION_NEXT_STEP = {
5834
+ already_running: (id) => ` \u2014 follow it: nodaro jobs get ${id}`,
5835
+ continuation_superseded: (id) => ` \u2014 continue that one: nodaro edit continue-use-case ${id} --mode from-failed`,
5836
+ render_final_already_rendered: (id) => ` \u2014 its result is the one to use: nodaro jobs get ${id}`
5837
+ };
5781
5838
  function readJsonFile(path) {
5782
5839
  let raw;
5783
5840
  try {
@@ -5906,6 +5963,92 @@ function editCommand() {
5906
5963
  }
5907
5964
  }
5908
5965
  );
5966
+ const framingLayouts = ["auto", ...SPEAKER_LAYOUT_IDS];
5967
+ cmd.command("tighten-episode").description("tighten a podcast recording in one step (transcribe, cut silences, render; optional captions, music and framing)").requiredOption("--media <url>", "the recording (video or audio URL, up to 3 hours)").option("--music <url>", "optional music bed, ducked under the voice").option("--output <kind>", "video | audio (an audio recording always makes an audio episode)").option("--framing <aspect>", `frame a video episode on its speakers: ${EDL_TARGET_ASPECTS.join(" | ")}`).option("--layout <layout>", `layout with --framing (default auto): ${framingLayouts.join(" | ")}`).option("--no-captions", "no captions on a video episode").option("--review", "stop at a preview to review (render the final with `nodaro edit continue-use-case <jobId> --mode render-final`)").option("--plan-tier <tier>", EDIT_PLAN_TIERS.join(" | ")).option("--instructions <text>", "editing instructions for the planner").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(
5968
+ async (opts) => {
5969
+ if (opts.output !== void 0 && opts.output !== "video" && opts.output !== "audio") {
5970
+ warn(`--output must be "video" or "audio" (got "${opts.output}")`);
5971
+ process.exit(1);
5972
+ }
5973
+ if (opts.planTier !== void 0 && !EDIT_PLAN_TIERS.includes(opts.planTier)) {
5974
+ warn(`--plan-tier must be ${EDIT_PLAN_TIERS.join(", ")} (got "${opts.planTier}")`);
5975
+ process.exit(1);
5976
+ }
5977
+ if (opts.framing !== void 0 && !EDL_TARGET_ASPECTS.includes(opts.framing)) {
5978
+ warn(`--framing must be ${EDL_TARGET_ASPECTS.join(", ")} (got "${opts.framing}")`);
5979
+ process.exit(1);
5980
+ }
5981
+ if (opts.layout !== void 0 && opts.framing === void 0) {
5982
+ warn("--layout applies with --framing only (it picks the framed layout)");
5983
+ process.exit(1);
5984
+ }
5985
+ if (opts.layout !== void 0 && !framingLayouts.includes(opts.layout)) {
5986
+ warn(`--layout must be ${framingLayouts.join(", ")} (got "${opts.layout}")`);
5987
+ process.exit(1);
5988
+ }
5989
+ try {
5990
+ const client = buildClient(opts.profile);
5991
+ const result = await client.edit.tightenEpisode({
5992
+ mediaUrl: opts.media,
5993
+ ...opts.music ? { musicUrl: opts.music } : {},
5994
+ ...opts.output ? { output: opts.output } : {},
5995
+ ...opts.framing ? { framing: { aspect: opts.framing, layout: opts.layout ?? "auto" } } : {},
5996
+ // commander's --no-captions defaults `captions` to true: send it only when turned off.
5997
+ ...opts.captions === false ? { captions: false } : {},
5998
+ ...opts.review ? { reviewBeforeRender: true } : {},
5999
+ ...opts.planTier ? { planTier: opts.planTier } : {},
6000
+ ...opts.instructions ? { instructions: opts.instructions } : {}
6001
+ });
6002
+ await reportQueuedJob(result, () => client.jobs.getStatus(result.jobId), {
6003
+ json: opts.json,
6004
+ watch: opts.watch,
6005
+ pollInterval: opts.pollInterval,
6006
+ note: "tighten-episode"
6007
+ });
6008
+ } catch (err) {
6009
+ handleError(err);
6010
+ }
6011
+ }
6012
+ );
6013
+ cmd.command("continue-use-case <jobId>").description("continue a Tighten Episode run as a new job: from where it failed, or its Render final after a review").requiredOption("--mode <mode>", "from-failed | render-final").option("--edit <file>", "render-final only: a JSON file holding the reviewer's edit of the plan (an EDL)").option("--idempotency-key <key>", "sent as Idempotency-Key: a retry with the same key answers the run already started").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(async (jobId, opts) => {
6014
+ if (opts.mode !== "from-failed" && opts.mode !== "render-final") {
6015
+ warn(`--mode must be "from-failed" or "render-final" (got "${opts.mode}")`);
6016
+ process.exit(1);
6017
+ }
6018
+ if (opts.edit !== void 0 && opts.mode !== "render-final") {
6019
+ warn("--edit applies to --mode render-final only");
6020
+ process.exit(1);
6021
+ }
6022
+ try {
6023
+ const client = buildClient(opts.profile);
6024
+ const result = await client.edit.continueUseCase(
6025
+ {
6026
+ jobId,
6027
+ mode: opts.mode,
6028
+ ...opts.edit !== void 0 ? { editedEdl: readJsonFile(opts.edit) } : {}
6029
+ },
6030
+ opts.idempotencyKey ? { idempotencyKey: opts.idempotencyKey } : void 0
6031
+ );
6032
+ await reportQueuedJob(result, () => client.jobs.getStatus(result.jobId), {
6033
+ json: opts.json,
6034
+ watch: opts.watch,
6035
+ pollInterval: opts.pollInterval,
6036
+ note: `continue-use-case (${opts.mode})`
6037
+ });
6038
+ } catch (err) {
6039
+ if (err instanceof ContinuationRefusedError) {
6040
+ if (opts.json) {
6041
+ emit({ error: { code: err.code, message: err.message }, jobId: err.jobId }, opts);
6042
+ } else {
6043
+ console.error(pc3.red(`\u2717 ${err.message}`));
6044
+ console.error(pc3.dim(` code: ${err.code}`));
6045
+ console.error(pc3.dim(` job: ${err.jobId}${CONTINUATION_NEXT_STEP[err.code]?.(err.jobId) ?? ""}`));
6046
+ }
6047
+ process.exit(1);
6048
+ }
6049
+ handleError(err);
6050
+ }
6051
+ });
5909
6052
  cmd.command("plan").description("plan a transcript-driven cut / clips / chapters / trailer (Cloud edition)").requiredOption("--mode <mode>", EDIT_PLAN_MODES.join(" | ")).requiredOption("--plan-tier <tier>", "economy | standard | premium").requiredOption("--transcript <file>", "path to a timed transcript JSON file").option("--silence <file>", "optional silence JSON \u2014 the silence-detect job's output_data.json ({ version, ranges, durationMs })").option(
5910
6053
  "--source <url>",
5911
6054
  "a media source as [id=]url[@audio|@video] (repeatable); id defaults to source-N, kind to video",