@nodaro/cli 1.12.0 → 1.14.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
@@ -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.12.0",
32
+ version: "1.14.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": "^1.20.0",
74
- "@nodaro/shared": "^2.11.0",
73
+ "@nodaro/sdk": "^1.22.0",
74
+ "@nodaro/shared": "^2.12.2",
75
75
  commander: "^12.1.0",
76
76
  picocolors: "^1.1.1",
77
77
  "@nodaro/prompts": "^1.8.0"
@@ -398,7 +398,7 @@ function saveWorkspace(profileName, workspaceId) {
398
398
  }
399
399
 
400
400
  // src/client.ts
401
- var CLI_VERSION = "1.12.0" ;
401
+ var CLI_VERSION = "1.14.0" ;
402
402
  function buildClient(profileName) {
403
403
  const { name, profile } = getProfile(profileName);
404
404
  if (!profile) {
@@ -2401,14 +2401,23 @@ Example:
2401
2401
  cmd.command("collage <imageUrls...>").description("composite 2\u201330 images into ONE large 2K/4K collage (smart justified layout \u2014 no cropping \u2014 or uniform grid)").option(
2402
2402
  "--sizes <list>",
2403
2403
  "comma-separated per-image size hints aligned with the images: 0 auto (default), 1 big (~2\xD7 linear), 2 medium, 3 small (~\xBD). Relative \u2014 smart layout only"
2404
+ ).option("--numbered", "stamp 1-based sequence numbers at each image's corner (storyboard mode)").option("--badge-position <corner>", "where the number/label badges sit: top-left (default) or top-right").option(
2405
+ "--label <text>",
2406
+ 'per-image caption shown after the number; repeat once per image, in order (pass "" to skip one)',
2407
+ collectVariadic
2404
2408
  ).option("--layout <layout>", "smart (default \u2014 justified rows, output height floats) or grid (uniform letterboxed cells)").option("--resolution <res>", "long-edge resolution: 2K or 4K (default 4K)").option("--aspect-ratio <W:H>", 'output canvas ratio, e.g. "4:3" (exact in grid; a target shape in smart)').option("--gap <px>", "gap between images + outer margin in px (default 24)", (v) => parseInt(v, 10)).option("--background-color <hex>", "background shown in the gaps, #RRGGBB").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", `
2405
2409
  Examples:
2406
2410
  $ nodaro media collage https://x/a.png https://x/b.png https://x/c.png --watch
2407
2411
  $ nodaro media collage https://x/hero.png https://x/b.png https://x/c.png --sizes 1,3,3 --aspect-ratio 16:9 --watch
2412
+ $ nodaro media collage https://x/a.png https://x/b.png https://x/c.png --numbered --label Wide --label "" --label Close-up --watch
2408
2413
 
2409
2414
  --sizes aligns by position: "1,3,3" renders the first image big and the other
2410
2415
  two small. Hints are relative \u2014 all-equal hints change nothing, and the grid
2411
- layout ignores them.`).action(
2416
+ layout ignores them.
2417
+
2418
+ --numbered stamps 1, 2, 3\u2026 at each image's top-left corner, in the order the
2419
+ images are passed (--badge-position top-right moves the badges). Repeat --label once per image (in the same order) to caption it
2420
+ after the number ("3 \xB7 Close-up"); pass "" to skip a label for one image.`).action(
2412
2421
  async (imageUrls, opts) => {
2413
2422
  try {
2414
2423
  if (imageUrls.length < 2) {
@@ -2423,6 +2432,10 @@ layout ignores them.`).action(
2423
2432
  warn(`--resolution must be 2K or 4K (got "${opts.resolution}")`);
2424
2433
  process.exit(1);
2425
2434
  }
2435
+ if (opts.badgePosition && !["top-left", "top-right"].includes(opts.badgePosition)) {
2436
+ warn(`--badge-position must be top-left or top-right (got "${opts.badgePosition}")`);
2437
+ process.exit(1);
2438
+ }
2426
2439
  let imageSizes;
2427
2440
  if (opts.sizes !== void 0) {
2428
2441
  const parsed = opts.sizes.split(",").map((s) => parseInt(s.trim(), 10));
@@ -2432,10 +2445,28 @@ layout ignores them.`).action(
2432
2445
  }
2433
2446
  imageSizes = parsed;
2434
2447
  }
2448
+ let imageLabels;
2449
+ if (opts.label && opts.label.length > 0) {
2450
+ if (opts.label.length > imageUrls.length) {
2451
+ warn(`Too many --label values: ${opts.label.length} for ${imageUrls.length} images (one per image, in order)`);
2452
+ process.exit(1);
2453
+ }
2454
+ if (opts.label.some((s) => s.length > 80)) {
2455
+ warn("Each --label must be at most 80 characters");
2456
+ process.exit(1);
2457
+ }
2458
+ const mapped = opts.label.map((s) => s.trim() || null);
2459
+ if (mapped.some((l) => l !== null)) {
2460
+ imageLabels = mapped;
2461
+ }
2462
+ }
2435
2463
  const client = buildClient(opts.profile);
2436
2464
  const result = await client.media.imageCollage({
2437
2465
  imageUrls,
2438
2466
  ...imageSizes ? { imageSizes } : {},
2467
+ ...opts.numbered ? { numbered: true } : {},
2468
+ ...imageLabels ? { imageLabels } : {},
2469
+ ...opts.badgePosition ? { badgePosition: opts.badgePosition } : {},
2439
2470
  ...opts.layout ? { layout: opts.layout } : {},
2440
2471
  ...opts.resolution ? { resolution: opts.resolution } : {},
2441
2472
  ...opts.aspectRatio ? { aspectRatio: opts.aspectRatio } : {},