@nodaro/cli 1.27.0 → 1.28.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
@@ -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.27.0",
32
+ version: "1.28.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,8 +70,8 @@ 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.22.0",
74
- "@nodaro/shared": "^3.27.0",
73
+ "@nodaro/sdk": "^2.23.0",
74
+ "@nodaro/shared": "^3.28.0",
75
75
  commander: "^12.1.0",
76
76
  picocolors: "^1.1.1",
77
77
  "@nodaro/prompts": "^1.36.0"
@@ -398,7 +398,7 @@ function saveWorkspace(profileName, workspaceId) {
398
398
  }
399
399
 
400
400
  // src/client.ts
401
- var CLI_VERSION = "1.27.0" ;
401
+ var CLI_VERSION = "1.28.0" ;
402
402
  function buildClient(profileName) {
403
403
  const { name, profile } = getProfile(profileName);
404
404
  if (!profile) {
@@ -2900,6 +2900,77 @@ names).`).action(
2900
2900
  }
2901
2901
  }
2902
2902
  );
2903
+ 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", `
2904
+ Examples:
2905
+ $ nodaro media video-mask https://x/dance.mp4 "the dancer" --watch
2906
+ $ nodaro media video-mask https://x/street.mp4 "person, dog" --threshold 0.3 --watch
2907
+ $ nodaro media video-mask https://x/long-take.mp4 "the skater" --model sam-3 --watch
2908
+
2909
+ 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
2910
+ clip's length. Feed the mask to \`nodaro media mask-composite\`.`).action(async (videoUrl, prompt, opts) => {
2911
+ try {
2912
+ if (opts.model && !VIDEO_MASK_PROVIDERS.includes(opts.model)) {
2913
+ warn(`--model must be one of ${VIDEO_MASK_PROVIDERS.join(", ")} (got "${opts.model}")`);
2914
+ process.exit(1);
2915
+ }
2916
+ if (opts.threshold !== void 0 && !(opts.threshold >= VIDEO_MASK_LIMITS.THRESHOLD_MIN && opts.threshold <= VIDEO_MASK_LIMITS.THRESHOLD_MAX)) {
2917
+ warn(`--threshold must be between ${VIDEO_MASK_LIMITS.THRESHOLD_MIN} and ${VIDEO_MASK_LIMITS.THRESHOLD_MAX}`);
2918
+ process.exit(1);
2919
+ }
2920
+ const client = buildClient(opts.profile);
2921
+ const result = await client.media.videoMask({
2922
+ videoUrl,
2923
+ prompt,
2924
+ ...opts.threshold !== void 0 ? { threshold: opts.threshold } : {},
2925
+ ...opts.model ? { provider: opts.model } : {}
2926
+ });
2927
+ await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "video mask" });
2928
+ } catch (err) {
2929
+ handleError(err);
2930
+ }
2931
+ });
2932
+ 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", `
2933
+ Example:
2934
+ $ nodaro media mask-composite https://x/dance.mp4 https://x/beach.mp4 https://x/dance-mask.mp4 --feather 4 --grow -1 --watch
2935
+
2936
+ The result follows the FOREGROUND's size, frame rate and length; the background
2937
+ is fitted to that frame and loops when shorter; the mask holds its last frame.`).action(
2938
+ async (foregroundUrl, backgroundUrl, maskUrl, opts) => {
2939
+ try {
2940
+ const b = MASK_COMPOSITE_BOUNDS;
2941
+ if (opts.feather !== void 0 && !(Number.isInteger(opts.feather) && opts.feather >= b.FEATHER_MIN && opts.feather <= b.FEATHER_MAX)) {
2942
+ warn(`--feather must be a whole number from ${b.FEATHER_MIN} to ${b.FEATHER_MAX}`);
2943
+ process.exit(1);
2944
+ }
2945
+ if (opts.grow !== void 0 && !(Number.isInteger(opts.grow) && opts.grow >= b.GROW_MIN && opts.grow <= b.GROW_MAX)) {
2946
+ warn(`--grow must be a whole number from ${b.GROW_MIN} to ${b.GROW_MAX}`);
2947
+ process.exit(1);
2948
+ }
2949
+ if (opts.backgroundFit && !MASK_COMPOSITE_BACKGROUND_FITS.includes(opts.backgroundFit)) {
2950
+ warn(`--background-fit must be one of ${MASK_COMPOSITE_BACKGROUND_FITS.join(", ")} (got "${opts.backgroundFit}")`);
2951
+ process.exit(1);
2952
+ }
2953
+ if (opts.audio && !MASK_COMPOSITE_AUDIO_SOURCES.includes(opts.audio)) {
2954
+ warn(`--audio must be one of ${MASK_COMPOSITE_AUDIO_SOURCES.join(", ")} (got "${opts.audio}")`);
2955
+ process.exit(1);
2956
+ }
2957
+ const client = buildClient(opts.profile);
2958
+ const result = await client.media.maskComposite({
2959
+ foregroundUrl,
2960
+ backgroundUrl,
2961
+ maskUrl,
2962
+ ...opts.invert ? { invertMask: true } : {},
2963
+ ...opts.feather !== void 0 ? { feather: opts.feather } : {},
2964
+ ...opts.grow !== void 0 ? { grow: opts.grow } : {},
2965
+ ...opts.backgroundFit ? { backgroundFit: opts.backgroundFit } : {},
2966
+ ...opts.audio ? { audioSource: opts.audio } : {}
2967
+ });
2968
+ await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "mask composite" });
2969
+ } catch (err) {
2970
+ handleError(err);
2971
+ }
2972
+ }
2973
+ );
2903
2974
  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
2975
  Example:
2905
2976
  $ nodaro media overlay-placement https://x/base.png --intent "a logo" --aspect 2.5
@@ -3085,6 +3156,27 @@ Example:
3085
3156
  }
3086
3157
  }
3087
3158
  );
3159
+ 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(
3160
+ async (opts) => {
3161
+ try {
3162
+ if (Boolean(opts.audio) === Boolean(opts.video)) {
3163
+ warn("Provide exactly one of --audio <url> or --video <url>");
3164
+ process.exit(1);
3165
+ }
3166
+ const client = buildClient(opts.profile);
3167
+ const result = await client.audio.pitchTempo({
3168
+ ...opts.audio ? { audioUrl: opts.audio } : {},
3169
+ ...opts.video ? { videoUrl: opts.video } : {},
3170
+ ...opts.semitones !== void 0 ? { semitones: opts.semitones } : {},
3171
+ ...opts.tempo !== void 0 ? { tempo: opts.tempo } : {},
3172
+ ...opts.preserveFormants === false ? { preserveFormants: false } : {}
3173
+ });
3174
+ await reportQueuedJob(result, () => client.jobs.get(result.jobId), { ...opts, note: "pitch & tempo" });
3175
+ } catch (err) {
3176
+ handleError(err);
3177
+ }
3178
+ }
3179
+ );
3088
3180
  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
3181
  Example:
3090
3182
  $ nodaro audio combine --segment https://.../intro.mp3 --segment "https://.../talk.mp3@12-95" --watch`).action(