makaron-cli 0.17.22 → 0.17.23

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.17.22",
3
+ "version": "0.17.23",
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.17.22",
3
+ "version": "0.17.23",
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
@@ -409,7 +409,7 @@ npx makaron-cli edit --image photo.jpg --out result.jpg "make it dramatic"
409
409
  npx makaron-cli edit --image-model gpt-image-2.6-flare --background transparent --out sticker.png "a magenta star sticker"
410
410
  ```
411
411
 
412
- Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.6-flare|gpt-image-2.6-sunburst|wan2.7-image|mj-v8.2|seedream-5.5`, `--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 defaults to GPT Image 2.6 Flare; an explicitly selected GPT Image 2.6 variant is retained. Output is returned only when the provider supplies real alpha.
412
+ Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.6-flare|gpt-image-2.6-sunburst|wan2.7-image|mj-v8.2|seedream-5.5|kling-image-4.0`, `--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 defaults to GPT Image 2.6 Flare; an explicitly selected GPT Image 2.6 variant is retained. Output is returned only when the provider supplies real alpha.
413
413
 
414
414
  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.
415
415
 
@@ -778,3 +778,5 @@ Show the quoted total Makaron credits before repeating the identical request wit
778
778
  `--max-credits <quoted-total>` and a stable `--request-id <uuid>`. A higher fresh
779
779
  quote stops before charging. Input video adds billable seconds; supplier credits
780
780
  are different from Makaron credits. Native 4K uses EvoLink, never Eco enhancement.
781
+
782
+ Kling Image 4.0 (`--image-model kling-image-4.0`) generates or edits one native PNG at `--image-resolution 2K|4K|8K` (default 2K) on fal. You can include up to 10 ordered reference images, counting the source image. The CLI uploads local files automatically. Each input must be at most 30 MiB, at least 300 pixels on both sides, with an aspect ratio from 0.4 to 2.5. Refer to them as `@Image1`, `@Image2`. Keep the image request UUID printed by the CLI. If the response is uncertain, pass the same UUID with `--image-request-id <uuid>` to check the existing receipt without a second submission or charge. Hosted MCP requires `imageRequestId`. Pick a model with native transparency for cutouts. Kling Image 4.0 uses prompt-guided edits, so areas outside the requested edit can change.
package/bin/makaron.mjs CHANGED
@@ -2020,10 +2020,10 @@ function validateVideoFileForAnalysis(videoPath) {
2020
2020
  return { ok: true, mime };
2021
2021
  }
2022
2022
 
2023
- function saveMcpImage(result, outputPath) {
2023
+ async function saveMcpImage(result, outputPath) {
2024
2024
  const content = result?.content || [];
2025
2025
  const texts = content.filter(c => c.type === 'text');
2026
- const images = content.filter(c => c.type === 'image');
2026
+ const images = content.filter(c => c.type === 'image' || (c.type === 'resource_link' && c.mimeType?.startsWith('image/')));
2027
2027
  for (const text of texts) process.stderr.write(`${text.text}\n`);
2028
2028
  if (result?.isError) { process.exitCode = 1; return null; }
2029
2029
  const saved = [];
@@ -2037,7 +2037,15 @@ function saveMcpImage(result, outputPath) {
2037
2037
  const suffix = images.length > 1 ? `-${index + 1}` : '';
2038
2038
  const out = `${stem}${suffix}.${compatible ? requestedExtension : extension}`;
2039
2039
  if (outputPath && !compatible) process.stderr.write(`Output is ${image.mimeType}; saving as ${out} so bytes and filename agree.\n`);
2040
- fs.writeFileSync(out, Buffer.from(image.data, 'base64'));
2040
+ if (image.type === 'resource_link') {
2041
+ const url = new URL(image.uri);
2042
+ if (url.protocol !== 'https:' || url.username || url.password) throw new Error('Generated originals require a public HTTPS URL.');
2043
+ const response = await fetch(url, { signal: AbortSignal.timeout(180_000), redirect: 'error' });
2044
+ if (!response.ok) throw new Error(`Original download failed (${response.status}). Keep the image request ID; do not regenerate.`);
2045
+ const bytes = Buffer.from(await response.arrayBuffer());
2046
+ if (bytes.length > 200 * 1024 * 1024) throw new Error('Generated original exceeds 200MiB.');
2047
+ fs.writeFileSync(out, bytes);
2048
+ } else fs.writeFileSync(out, Buffer.from(image.data, 'base64'));
2041
2049
  console.log(out);
2042
2050
  saved.push(out);
2043
2051
  }
@@ -2083,9 +2091,10 @@ Usage:
2083
2091
  Options:
2084
2092
  --image <file|url> Base image to edit. Omit for text-to-image.
2085
2093
  --ref <file|url> Additional reference image. Repeatable; model-specific limit (Nano Banana 2.1: 14 total inputs).
2086
- --image-model <id> gemini, gemini-2.1, gemini-lite, qwen-spicy, openai, gpt-image-2.6-flare, gpt-image-2.6-sunburst, wan2.7-image, mj-v8.2, or seedream-5.5. Legacy qwen maps to qwen-spicy.
2094
+ --image-request-id <uuid> Stable Kling Image 4.0 generation ID; reuse to inspect a repeated attempt.
2095
+ --image-model <id> gemini, gemini-2.1, gemini-lite, qwen-spicy, openai, gpt-image-2.6-flare, gpt-image-2.6-sunburst, wan2.7-image, mj-v8.2, seedream-5.5, or kling-image-4.0. Legacy qwen maps to qwen-spicy.
2087
2096
  --skill <id> enhance, creative, wild, or captions.
2088
- --image-resolution <id> 1K, 2K, or 4K; Seedream 5.5 supports 1K, 1.5K and 2K. Auto remains Flare-first.
2097
+ --image-resolution <id> 1K, 2K, or 4K; Kling Image 4.0 supports 2K/4K/8K; Seedream 5.5 supports 1K, 1.5K and 2K. Auto remains Flare-first.
2089
2098
  --nsfw Route NSFW directly to Qwen Spicy.
2090
2099
  --aspect <ratio> Output aspect ratio, for example 1:1, 16:9, or 9:16.
2091
2100
  --background <mode> auto, opaque, or transparent.
@@ -3314,6 +3323,7 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
3314
3323
  editSourceFile = args[++i];
3315
3324
  editArgs.image = imageToArg(editSourceFile);
3316
3325
  }
3326
+ else if (args[i] === '--image-request-id' && args[i + 1]) editArgs.imageRequestId = args[++i];
3317
3327
  else if (args[i] === '--image-model' && args[i + 1]) editArgs.model = args[++i];
3318
3328
  else if (args[i] === '--model' && args[i + 1]) {
3319
3329
  warnLegacyModelFlag('--image-model');
@@ -3383,10 +3393,14 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
3383
3393
  editArgs.midjourney = mjArgs;
3384
3394
  }
3385
3395
  editArgs.editPrompt = promptParts.join(' ');
3386
- if (!editArgs.editPrompt) { console.error('Usage: makaron edit [--image <file|url>] [--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|wan2.7-image|mj-v8.2|seedream-5.5] [--ref <file>] [--aspect <ratio>] [--background auto|opaque|transparent] [--out <file>] "prompt"'); process.exit(1); }
3387
- if (editArgs.model === 'seedream-5.5') {
3396
+ if (!editArgs.editPrompt) { console.error('Usage: makaron edit [--image <file|url>] [--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|wan2.7-image|mj-v8.2|seedream-5.5|kling-image-4.0] [--ref <file>] [--aspect <ratio>] [--background auto|opaque|transparent] [--out <file>] "prompt"'); process.exit(1); }
3397
+ if (editArgs.model === 'kling-image-4.0') {
3398
+ editArgs.imageRequestId ||= randomUUID();
3399
+ process.stderr.write(`Image request ID: ${editArgs.imageRequestId} (retain it; never repeat an uncertain paid submission with a new ID)\n`);
3400
+ }
3401
+ if (['seedream-5.5', 'kling-image-4.0'].includes(editArgs.model)) {
3388
3402
  const sources = [...(editSourceFile ? [editSourceFile] : []), ...editReferenceFiles];
3389
- if (sources.length > 10) { console.error('Seedream 5.5 accepts at most 10 inputs including the base.'); process.exit(1); }
3403
+ if (sources.length > 10) { console.error('This model accepts at most 10 inputs including the base.'); process.exit(1); }
3390
3404
  const localFiles = sources.filter(source => !isHttpUrl(source));
3391
3405
  const uploaded = localFiles.length ? await uploadImageFilesViaSignedUrl(baseUrl, headers, undefined, localFiles) : [];
3392
3406
  const byPath = new Map(localFiles.map((source, index) => [source, uploaded[index]]));
@@ -3396,7 +3410,7 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
3396
3410
  }
3397
3411
  process.stderr.write('🎨 Generating...\n');
3398
3412
  const result = await callMcpTool(baseUrl, headers, 'makaron_edit_image', editArgs);
3399
- saveMcpImage(result, outputPath);
3413
+ await saveMcpImage(result, outputPath);
3400
3414
 
3401
3415
  } else if (command === 'analyze') {
3402
3416
  const { headers, baseUrl } = getAuth();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.17.22",
3
+ "version": "0.17.23",
4
4
  "description": "Talk to Makaron Agent from the terminal — create projects, edit images, generate videos",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -334,7 +334,7 @@ npx makaron-cli edit --image photo.jpg --out result.jpg "make it dramatic"
334
334
  npx makaron-cli edit --image-model gpt-image-2.6-flare --background transparent --out sticker.png "a magenta star sticker"
335
335
  ```
336
336
 
337
- Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.6-flare|gpt-image-2.6-sunburst|wan2.7-image|mj-v8.2|seedream-5.5`, `--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.6 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.
337
+ Options: `--image`, `--image-model gemini|gemini-2.1|gemini-lite|qwen-spicy|openai|gpt-image-2.6-flare|gpt-image-2.6-sunburst|wan2.7-image|mj-v8.2|seedream-5.5|kling-image-4.0`, `--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.6 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.
338
338
 
339
339
  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.
340
340
 
@@ -590,3 +590,5 @@ Both paths return a Makaron `projectUrl`. Open it to move/scale, reorder or dele
590
590
  Use `--editable-text` only when the user explicitly requests native editable text fields. It makes recognized text editable using approximate fonts; edited wording can differ in typography, texture and styling. A request to split layers or change wording alone does not imply this option. Describe the default result as image layers, including lettering, rather than promising native editable text. The original image and PNG layers remain in the project/workspace.
591
591
 
592
592
  `--project` reuses a project; otherwise the direct command creates a private project. `--max-outputs` is 2–100 including the background (default 8); quality is `auto|1K|1.5K|2K` (default `1K` for faster decomposition). One quality setting applies to the whole task; per-layer resolution controls are unavailable. Use an explicit higher tier or `auto` when preserving source resolution is required. The actual output count and pixel tiers determine one task charge. Failed or uncertain submissions are never replayed automatically; retain the printed job ID and query status. Repeated status reads preserve saved GUI edits and do not debit again. When the layers are ready, the edit link opens the resulting snapshot.
593
+
594
+ Kling Image 4.0 (`--image-model kling-image-4.0`) generates or edits one native PNG at `--image-resolution 2K|4K|8K` (default 2K) on fal. You can include up to 10 ordered reference images, counting the source image. The CLI uploads local files automatically. Each input must be at most 30 MiB, at least 300 pixels on both sides, with an aspect ratio from 0.4 to 2.5. Refer to them as `@Image1`, `@Image2`. Keep the image request UUID printed by the CLI. If the response is uncertain, pass the same UUID with `--image-request-id <uuid>` to check the existing receipt without a second submission or charge. Hosted MCP requires `imageRequestId`. Pick a model with native transparency for cutouts. Kling Image 4.0 uses prompt-guided edits, so areas outside the requested edit can change.