makaron-cli 0.16.2 → 0.17.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.16.2",
3
+ "version": "0.17.0",
4
4
  "description": "Give Claude Code a creative agent. Pass complete creative requests and source media to Makaron Chat.",
5
5
  "author": {
6
6
  "name": "Versa AI",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.16.2",
3
+ "version": "0.17.0",
4
4
  "description": "Give Codex a creative agent. Pass complete creative requests and source media to Makaron Chat.",
5
5
  "author": {
6
6
  "name": "Versa AI",
package/README.md CHANGED
@@ -384,7 +384,17 @@ npx makaron-cli edit --image photo.jpg --out result.jpg "make it dramatic"
384
384
  npx makaron-cli edit --image-model gpt-image-2.5-flare --background transparent --out sticker.png "a magenta star sticker"
385
385
  ```
386
386
 
387
- Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.5-flare|gpt-image-2.5-sunburst|wan2.7-image`, `--ref <file>` (model-specific limit), `--aspect <ratio>`, `--background auto|opaque|transparent`, `--out <path>`. Nano Banana 2.1 (`gemini-2.1`) supports up to 14 total input images and `--image-resolution 1K|2K|4K` (default 1K); it uses OpenRouter and does not retry or switch models automatically. Qwen Spicy supports 0–3 input images; legacy `qwen` requests map to it. Pony and WAI are retired. Transparent output routes strictly to GPT Image 2.5 Flare and is returned only when the provider supplies real PNG/WebP alpha.
387
+ Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.5-flare|gpt-image-2.5-sunburst|wan2.7-image|mj-v8.2`, `--ref <file>` (model-specific limit), `--aspect <ratio>`, `--background auto|opaque|transparent`, `--out <path>`. Nano Banana 2.1 (`gemini-2.1`) supports up to 14 total input images and `--image-resolution 1K|2K|4K` (default 1K); it uses OpenRouter and does not retry or switch models automatically. Qwen Spicy supports 0–3 input images; legacy `qwen` requests map to it. Pony and WAI are retired. Transparent output routes strictly to GPT Image 2.5 Flare and is returned only when the provider supplies real PNG/WebP alpha.
388
+
389
+ Midjourney V8.2 (`mj-v8.2`) accepts natural-language briefs and prepares the English prompt automatically. Fast returns up to 4 images, Draft up to 24 smaller drafts, and HD regenerates up to 4 higher-resolution images. Every returned image is saved; `--out scene.png` produces `scene-1.png`, `scene-2.png`, etc. A single result keeps the requested filename. Provider filtering can reduce the batch size.
390
+
391
+ ```bash
392
+ npx makaron-cli edit --image-model mj-v8.2 --aspect 16:9 --out scene.png "星空下被水淹没的宫殿走廊"
393
+ npx makaron-cli edit --image-model mj-v8.2 --mj-quality hd --mj-stylize 400 --mj-chaos 10 --out hallway.png "A hallway flooded. A starry night sky with big puffy clouds above."
394
+ npx makaron-cli edit --image-model mj-v8.2 --style-ref 2231018166 --style-ref 4162055066 --out city.png "A massive city skyline peeking through a sea of clouds."
395
+ ```
396
+
397
+ Midjourney-only options: `--mj-speed fast|draft`, `--mj-quality standard|hd`, repeatable `--style-ref <public-HTTPS-url|numeric-sref-code>`, `--mj-style-weight 0..1000`, `--mj-stylize 0..1000`, `--mj-chaos 0..100`, `--mj-seed 0..4294967295`, and `--mj-raw`. Draft cannot be combined with HD. This is image generation: do not use `--image` for precise edits, promise identity preservation, request transparent output or 4K, or treat HD as lossless upscaling. Public URL content references use `--ref`; local/base64 references are unsupported for this route. Failures and unknown paid outcomes are not automatically retried or switched to another model; keep the returned task ID. One provider batch is billed once, not once per candidate.
388
398
 
389
399
  `wan2.7-image` uses Alibaba international for fast, approximately 1K generation and editing (default 6 credits/image). Failed or timed-out Wan requests are not automatically retried or switched to another model. Face identity can change. Example: `makaron edit --image portrait.jpg --image-model wan2.7-image --aspect 16:9 --out stadium.jpg "Place this woman in a baseball stadium, preserving her face."`
390
400
 
package/bin/makaron.mjs CHANGED
@@ -1872,32 +1872,26 @@ function validateVideoFileForAnalysis(videoPath) {
1872
1872
 
1873
1873
  function saveMcpImage(result, outputPath) {
1874
1874
  const content = result?.content || [];
1875
- const textBlock = content.find(c => c.type === 'text');
1876
- const imageBlock = content.find(c => c.type === 'image');
1877
- if (textBlock) process.stderr.write(`${textBlock.text}\n`);
1878
- if (imageBlock) {
1879
- const extension = imageBlock.mimeType === 'image/png'
1880
- ? 'png'
1881
- : imageBlock.mimeType === 'image/webp'
1882
- ? 'webp'
1883
- : 'jpg';
1884
- let out = outputPath || `makaron-output-${Date.now()}.${extension}`;
1885
- if (outputPath) {
1886
- const requestedExtension = path.extname(outputPath).slice(1).toLowerCase();
1887
- const compatible = extension === 'jpg'
1888
- ? ['jpg', 'jpeg'].includes(requestedExtension)
1889
- : requestedExtension === extension;
1890
- if (!compatible) {
1891
- out = `${outputPath.slice(0, outputPath.length - path.extname(outputPath).length)}.${extension}`;
1892
- process.stderr.write(`Output is ${imageBlock.mimeType}; saving as ${out} so bytes and filename agree.\n`);
1893
- }
1894
- }
1895
- fs.writeFileSync(out, Buffer.from(imageBlock.data, 'base64'));
1875
+ const texts = content.filter(c => c.type === 'text');
1876
+ const images = content.filter(c => c.type === 'image');
1877
+ for (const text of texts) process.stderr.write(`${text.text}\n`);
1878
+ if (result?.isError) { process.exitCode = 1; return null; }
1879
+ const saved = [];
1880
+ const stamp = Date.now();
1881
+ for (const [index, image] of images.entries()) {
1882
+ const extension = image.mimeType === 'image/png' ? 'png' : image.mimeType === 'image/webp' ? 'webp' : 'jpg';
1883
+ const requestedExtension = outputPath ? path.extname(outputPath).slice(1).toLowerCase() : '';
1884
+ const compatible = extension === 'jpg' ? ['jpg', 'jpeg'].includes(requestedExtension) : requestedExtension === extension;
1885
+ const stem = outputPath ? outputPath.slice(0, outputPath.length - path.extname(outputPath).length) : `makaron-output-${stamp}`;
1886
+ const suffix = images.length > 1 ? `-${index + 1}` : '';
1887
+ const out = `${stem}${suffix}.${compatible ? requestedExtension : extension}`;
1888
+ if (outputPath && !compatible) process.stderr.write(`Output is ${image.mimeType}; saving as ${out} so bytes and filename agree.\n`);
1889
+ fs.writeFileSync(out, Buffer.from(image.data, 'base64'));
1896
1890
  console.log(out);
1897
- return out;
1891
+ saved.push(out);
1898
1892
  }
1899
- if (textBlock) console.log(textBlock.text);
1900
- return null;
1893
+ if (!images.length) for (const text of texts) console.log(text.text);
1894
+ return saved.length === 1 ? saved[0] : saved;
1901
1895
  }
1902
1896
 
1903
1897
  async function analyzeVideoCli(baseUrl, headers, rawVideo, questionParts) {
@@ -1938,16 +1932,26 @@ Usage:
1938
1932
  Options:
1939
1933
  --image <file|url> Base image to edit. Omit for text-to-image.
1940
1934
  --ref <file|url> Additional reference image. Repeatable; model-specific limit (Nano Banana 2.1: 14 total inputs).
1941
- --image-model <id> gemini, gemini-2.1, gemini-lite, qwen-spicy, openai, gpt-image-2.5-flare, gpt-image-2.5-sunburst, or wan2.7-image. Legacy qwen maps to qwen-spicy.
1935
+ --image-model <id> gemini, gemini-2.1, gemini-lite, qwen-spicy, openai, gpt-image-2.5-flare, gpt-image-2.5-sunburst, wan2.7-image, or mj-v8.2. Legacy qwen maps to qwen-spicy.
1942
1936
  --skill <id> enhance, creative, wild, or captions.
1943
1937
  --image-resolution <id> 1K, 2K, or 4K; Auto chooses Nano Banana 2.1.
1944
1938
  --nsfw Route NSFW directly to Qwen Spicy.
1945
1939
  --aspect <ratio> Output aspect ratio, for example 1:1, 16:9, or 9:16.
1946
1940
  --background <mode> auto, opaque, or transparent.
1947
- --out <file> Save the generated image to this path.
1941
+ --out <file> Save images; batches use name-1.ext, name-2.ext, etc.
1942
+ --mj-speed <mode> fast (up to 4 images) or draft (up to 24).
1943
+ --mj-quality <mode> standard or hd; HD regenerates, not lossless upscaling.
1944
+ --style-ref <url|code> Repeatable Midjourney public HTTPS style URL or numeric sref code.
1945
+ --mj-style-weight <n> Style reference weight, integer 0–1000.
1946
+ --mj-stylize <n> Stylization, integer 0–1000.
1947
+ --mj-chaos <n> Variety, integer 0–100.
1948
+ --mj-seed <n> Seed, integer 0–4294967295.
1949
+ --mj-raw Use Raw mode.
1948
1950
  --help, -h Show this help.
1949
1951
 
1950
1952
  Notes:
1953
+ MJ options require --image-model mj-v8.2; Draft + HD is invalid. Describe the scene
1954
+ naturally; the server prepares the English prompt. MJ is generation, not precise editing.
1951
1955
  Model selection is optional. Transparent output routes strictly to GPT Image 2.5 Flare
1952
1956
  and fails instead of returning an opaque fallback.
1953
1957
 
@@ -3022,6 +3026,7 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
3022
3026
  } else if (command === 'edit') {
3023
3027
  const { headers, baseUrl } = getAuth();
3024
3028
  const editArgs = {};
3029
+ const mjArgs = {};
3025
3030
  const promptParts = [];
3026
3031
  let outputPath = null;
3027
3032
  for (let i = 1; i < args.length; i++) {
@@ -3051,10 +3056,36 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
3051
3056
  editArgs.background = background;
3052
3057
  }
3053
3058
  else if (args[i] === '--out' && args[i + 1]) outputPath = args[++i];
3059
+ else if (['--mj-speed', '--mj-quality', '--style-ref', '--mj-style-weight', '--mj-stylize', '--mj-chaos', '--mj-seed'].includes(args[i])) {
3060
+ const flag = args[i], value = args[++i];
3061
+ if (!value || value.startsWith('--')) { console.error(`Missing value for ${flag}.`); process.exit(1); }
3062
+ if (flag === '--style-ref') {
3063
+ if (!/^\d{1,12}$/.test(value) && !/^https:\/\//.test(value)) { console.error('Style references require public HTTPS URLs or numeric sref codes.'); process.exit(1); }
3064
+ (mjArgs.styleReferences ||= []).push(value);
3065
+ } else if (flag === '--mj-speed' || flag === '--mj-quality') {
3066
+ const allowed = flag === '--mj-speed' ? ['fast', 'draft'] : ['standard', 'hd'];
3067
+ if (!allowed.includes(value)) { console.error(`Invalid ${flag}: use ${allowed.join(' or ')}.`); process.exit(1); }
3068
+ mjArgs[flag === '--mj-speed' ? 'speed' : 'quality'] = value;
3069
+ } else {
3070
+ const fields = { '--mj-style-weight': ['styleWeight', 1000], '--mj-stylize': ['stylize', 1000], '--mj-chaos': ['chaos', 100], '--mj-seed': ['seed', 4294967295] };
3071
+ const [key, max] = fields[flag], number = Number(value);
3072
+ if (!Number.isInteger(number) || number < 0 || number > max) { console.error(`${flag} must be an integer from 0 to ${max}.`); process.exit(1); }
3073
+ mjArgs[key] = number;
3074
+ }
3075
+ }
3076
+ else if (args[i] === '--mj-raw') mjArgs.raw = true;
3077
+ else if (args[i].startsWith('--mj-')) { console.error(`Unknown Midjourney option: ${args[i]}`); process.exit(1); }
3054
3078
  else promptParts.push(args[i]);
3055
3079
  }
3080
+ if (Object.keys(mjArgs).length) {
3081
+ if (editArgs.model !== 'mj-v8.2') { console.error('Midjourney options require --image-model mj-v8.2.'); process.exit(1); }
3082
+ if (mjArgs.speed === 'draft' && mjArgs.quality === 'hd') { console.error('Midjourney Draft cannot be combined with HD.'); process.exit(1); }
3083
+ if (mjArgs.styleWeight !== undefined && !mjArgs.styleReferences?.length) { console.error('--mj-style-weight requires --style-ref.'); process.exit(1); }
3084
+ if ((mjArgs.styleReferences?.length || 0) > 20) { console.error('Midjourney accepts at most 20 style references.'); process.exit(1); }
3085
+ editArgs.midjourney = mjArgs;
3086
+ }
3056
3087
  editArgs.editPrompt = promptParts.join(' ');
3057
- if (!editArgs.editPrompt) { console.error('Usage: makaron edit [--image <file|url>] [--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.5-flare|gpt-image-2.5-sunburst|wan2.7-image] [--ref <file>] [--aspect <ratio>] [--background auto|opaque|transparent] [--out <file>] "prompt"'); process.exit(1); }
3088
+ if (!editArgs.editPrompt) { console.error('Usage: makaron edit [--image <file|url>] [--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.5-flare|gpt-image-2.5-sunburst|wan2.7-image|mj-v8.2] [--ref <file>] [--aspect <ratio>] [--background auto|opaque|transparent] [--out <file>] "prompt"'); process.exit(1); }
3058
3089
  process.stderr.write('🎨 Generating...\n');
3059
3090
  const result = await callMcpTool(baseUrl, headers, 'makaron_edit_image', editArgs);
3060
3091
  saveMcpImage(result, outputPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.16.2",
3
+ "version": "0.17.0",
4
4
  "description": "Talk to Makaron Agent from the terminal — create projects, edit images, generate videos",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -315,7 +315,17 @@ npx makaron-cli edit --image photo.jpg --out result.jpg "make it dramatic"
315
315
  npx makaron-cli edit --image-model gpt-image-2.5-flare --background transparent --out sticker.png "a magenta star sticker"
316
316
  ```
317
317
 
318
- Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.5-flare|gpt-image-2.5-sunburst|wan2.7-image`, `--ref <file>` (model-specific limit), `--aspect <ratio>`, `--image-resolution 1K|2K|4K`, `--background auto|opaque|transparent`, `--nsfw`, `--out <path>`. Image Model Capability prefers matching requirements, then relaxes output conflicts to deliver an image: GPT Image 2.5 Flare → Nano Banana 2.1 → Qwen Spicy. Omit the model for Auto: an 8:1 banner or an explicit resolution tier selects Nano Banana 2.1. Native ratio presets do not promise exact mathematical ratios or user pixel dimensions. For Agent-assessed NSFW, pass `--nsfw` to route directly to Spicy; never probe another provider first. Unknown IDs use Flare-first Auto. Output conflicts relax before submission: transparent 8:1 normally keeps 8:1 with opaque output; NSFW always uses Spicy regardless of unsupported dimensions. Preserve input content first and explain actual adjustments. See current MCP tool descriptions for the generated capability table. Classic Nano Banana 2 (`gemini`), Lite, Sunburst and Wan are explicit routes; `openai` means Flare and legacy `qwen` means Spicy. Pony/WAI are retired. Transparent output prefers Flare or explicitly selected Sunburst, and may relax alpha when other requirements conflict. Supplier failures never trigger automatic image resubmission or model switching.
318
+ Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.5-flare|gpt-image-2.5-sunburst|wan2.7-image|mj-v8.2`, `--ref <file>` (model-specific limit), `--aspect <ratio>`, `--image-resolution 1K|2K|4K`, `--background auto|opaque|transparent`, `--nsfw`, `--out <path>`. Image Model Capability prefers matching requirements, then relaxes output conflicts to deliver an image: GPT Image 2.5 Flare → Nano Banana 2.1 → Qwen Spicy. Omit the model for Auto: an 8:1 banner or an explicit resolution tier selects Nano Banana 2.1. Native ratio presets do not promise exact mathematical ratios or user pixel dimensions. For Agent-assessed NSFW, pass `--nsfw` to route directly to Spicy; never probe another provider first. Unknown IDs use Flare-first Auto. Output conflicts relax before submission: transparent 8:1 normally keeps 8:1 with opaque output; NSFW always uses Spicy regardless of unsupported dimensions. Preserve input content first and explain actual adjustments. See current MCP tool descriptions for the generated capability table. Classic Nano Banana 2 (`gemini`), Lite, Sunburst and Wan are explicit routes; `openai` means Flare and legacy `qwen` means Spicy. Pony/WAI are retired. Transparent output prefers Flare or explicitly selected Sunburst, and may relax alpha when other requirements conflict. Supplier failures never trigger automatic image resubmission or model switching.
319
+
320
+ Midjourney V8.2 (`mj-v8.2`) accepts natural-language briefs and prepares the English prompt automatically. Fast returns up to 4 images, Draft up to 24 smaller drafts, and HD regenerates up to 4 higher-resolution images. Every returned image is saved; `--out scene.png` produces `scene-1.png`, `scene-2.png`, etc. A single result keeps the requested filename. Provider filtering can reduce the batch size.
321
+
322
+ ```bash
323
+ npx makaron-cli edit --image-model mj-v8.2 --aspect 16:9 --out scene.png "星空下被水淹没的宫殿走廊"
324
+ npx makaron-cli edit --image-model mj-v8.2 --mj-quality hd --mj-stylize 400 --mj-chaos 10 --out hallway.png "A hallway flooded. A starry night sky with big puffy clouds above."
325
+ npx makaron-cli edit --image-model mj-v8.2 --style-ref 2231018166 --style-ref 4162055066 --out city.png "A massive city skyline peeking through a sea of clouds."
326
+ ```
327
+
328
+ Midjourney-only options: `--mj-speed fast|draft`, `--mj-quality standard|hd`, repeatable `--style-ref <public-HTTPS-url|numeric-sref-code>`, `--mj-style-weight 0..1000`, `--mj-stylize 0..1000`, `--mj-chaos 0..100`, `--mj-seed 0..4294967295`, and `--mj-raw`. Draft cannot be combined with HD. This is image generation: do not use `--image` for precise edits, promise identity preservation, request transparent output or 4K, or treat HD as lossless upscaling. Public URL content references use `--ref`; local/base64 references are unsupported for this route. Failures and unknown paid outcomes are not automatically retried or switched to another model; keep the returned task ID. One provider batch is billed once, not once per candidate.
319
329
 
320
330
  ### `video` — Standalone video tools (no project timeline)
321
331