makaron-cli 0.17.19 → 0.17.20
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +12 -0
- package/bin/makaron.mjs +83 -2
- package/package.json +1 -1
- package/skills/makaron/SKILL.md +12 -0
package/README.md
CHANGED
|
@@ -755,3 +755,15 @@ makaron chat --image mascot.png "Use GPT Image 2.6 Flare to make a looping GIF o
|
|
|
755
755
|
The provider schema also advertises xhigh/max reasoning, but the live 2.6 endpoint rejected both during acceptance. They are not exposed as working Makaron tiers. Exact active 2.6 pricing rows are required before submission; final cost uses that task's fal billable USD units.
|
|
756
756
|
|
|
757
757
|
Seedream 5.5 (`--image-model seedream-5.5`) uses EvoLink, accepts at most 10 ordered inputs (base included), `--image-resolution 1K|1.5K|2K`, and `--output-format png|jpeg` (default PNG). `--background transparent` requires native PNG alpha. Quality/reasoning/GIF/SVG controls are unsupported. It never participates in Auto or switches providers after failure. Direct `makaron edit --image/--ref` uploads local originals automatically; direct MCP callers must supply public HTTPS PNG/JPEG/WebP originals. Accepted task receipts are saved to the user workspace before polling. The server must configure `EVOLINK_API_KEY` and an exact active `seedream-5.5` pricing row before use.
|
|
758
|
+
|
|
759
|
+
### Image layer decomposition
|
|
760
|
+
|
|
761
|
+
```bash
|
|
762
|
+
makaron chat --project auto --image poster.png "拆成图层,文字可以编辑,返回 Makaron 编辑链接"
|
|
763
|
+
makaron layerize --image poster.png --max-outputs 8 --quality 1K --editable-text --json
|
|
764
|
+
makaron layerize status <jobId> --project <projectId> --json
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
Both paths return a Makaron `projectUrl`. Open it to edit the standard design in the GUI: move/scale image layers, reorder or delete/restore layers, and edit recognized text. Default raster layers preserve the decomposed appearance; `--editable-text` replaces recognized text with ordinary editable design text using approximate fonts. Decorative text can remain raster. The original image and PNG layers remain in the project/workspace. No new GUI renderer is required.
|
|
768
|
+
|
|
769
|
+
`--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.
|
package/bin/makaron.mjs
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import fs from 'fs';
|
|
15
|
+
import { randomUUID } from 'node:crypto';
|
|
15
16
|
import path from 'path';
|
|
16
17
|
import { createInterface } from 'readline';
|
|
17
18
|
import { execFileSync } from 'child_process';
|
|
@@ -403,7 +404,7 @@ function normalizeRunResponse(data) {
|
|
|
403
404
|
const projectId = data.projectId || data.project_id;
|
|
404
405
|
if (projectId) {
|
|
405
406
|
data.projectId = projectId;
|
|
406
|
-
data.projectUrl = `${APP_URL}/projects/${projectId}`;
|
|
407
|
+
data.projectUrl = data.project_url || `${APP_URL}/projects/${projectId}`;
|
|
407
408
|
}
|
|
408
409
|
return data;
|
|
409
410
|
}
|
|
@@ -914,7 +915,7 @@ async function pollRun(baseUrl, headers, runId, opts = {}) {
|
|
|
914
915
|
}
|
|
915
916
|
if (data.result.error) process.stderr.write(`❌ ${data.result.error}\n`);
|
|
916
917
|
}
|
|
917
|
-
process.stderr.write(`🔗 ${
|
|
918
|
+
process.stderr.write(`🔗 ${data.projectUrl}\n`);
|
|
918
919
|
printRunUsage(data.usage);
|
|
919
920
|
}
|
|
920
921
|
|
|
@@ -2211,6 +2212,80 @@ Run "makaron video create --help" for every model, option, example, and limit.
|
|
|
2211
2212
|
`);
|
|
2212
2213
|
}
|
|
2213
2214
|
|
|
2215
|
+
function printLayerizeHelp() {
|
|
2216
|
+
console.log(`Usage: makaron layerize --image <file|https-url> [--project <id>] [--json]
|
|
2217
|
+
makaron layerize status <jobId> --project <id> [--json]
|
|
2218
|
+
|
|
2219
|
+
--max-outputs <2..100> Maximum images including background (default 8)
|
|
2220
|
+
--quality <id> auto, 1K, 1.5K, 2K (default 1K)
|
|
2221
|
+
--editable-text Convert recognized text to editable design text; fonts may differ
|
|
2222
|
+
--prompt <text> Elements or regions to separate
|
|
2223
|
+
--request-id <uuid> Reuse the original request after interruption
|
|
2224
|
+
--no-wait Return the job and Makaron editing URL immediately
|
|
2225
|
+
|
|
2226
|
+
Returns a normal Makaron design. Open projectUrl to move/scale, reorder, delete/restore layers or edit
|
|
2227
|
+
recognized text. Charges actual output images once; query the same job to recover.
|
|
2228
|
+
Chat alternative: makaron chat --project auto --image poster.png "拆成图层,文字可编辑"
|
|
2229
|
+
`);
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
async function runLayerize(args) {
|
|
2233
|
+
const { baseUrl, headers } = getAuth();
|
|
2234
|
+
const options = {};
|
|
2235
|
+
const flags = new Set(['--json', '--editable-text', '--no-wait']);
|
|
2236
|
+
const valued = new Set(['--image', '--project', '--max-outputs', '--quality', '--prompt', '--request-id']);
|
|
2237
|
+
const statusOnly = args[1] === 'status';
|
|
2238
|
+
for (let i = statusOnly ? 3 : 1; i < args.length; i++) {
|
|
2239
|
+
const arg = args[i];
|
|
2240
|
+
if (flags.has(arg)) options[arg] = true;
|
|
2241
|
+
else if (valued.has(arg) && args[i + 1] && !args[i + 1].startsWith('--')) options[arg] = args[++i];
|
|
2242
|
+
else throw new Error(`Unknown or incomplete layerize option: ${arg}`);
|
|
2243
|
+
}
|
|
2244
|
+
const uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
2245
|
+
let projectId = options['--project'];
|
|
2246
|
+
const jobId = statusOnly ? args[2] : options['--request-id'] || randomUUID();
|
|
2247
|
+
const n = Number(options['--max-outputs'] || 8), quality = options['--quality'] || '1K';
|
|
2248
|
+
if (!uuid.test(jobId || '') || (projectId && !uuid.test(projectId))) throw new Error('Use valid project/request UUIDs.');
|
|
2249
|
+
if (!statusOnly && (!options['--image'] || !Number.isSafeInteger(n) || n < 2 || n > 100 || !['auto', '1K', '1.5K', '2K'].includes(quality))) throw new Error('Provide --image and valid layerize options; see layerize --help.');
|
|
2250
|
+
if (statusOnly && !projectId) throw new Error('status requires --project <id>.');
|
|
2251
|
+
const request = async (route, body) => {
|
|
2252
|
+
const response = await fetch(`${baseUrl}${route}`, { headers: { ...headers, 'Content-Type': 'application/json' }, ...(body ? { method: 'POST', body: JSON.stringify(body) } : {}) });
|
|
2253
|
+
const data = await response.json();
|
|
2254
|
+
if (!response.ok) throw new Error(data.error || `Layerize HTTP ${response.status}`);
|
|
2255
|
+
return data;
|
|
2256
|
+
};
|
|
2257
|
+
let result;
|
|
2258
|
+
if (!statusOnly) {
|
|
2259
|
+
if (!projectId) {
|
|
2260
|
+
projectId = (await request('/api/projects/create', { title: 'Layerized image' })).projectId;
|
|
2261
|
+
const privacy = await fetch(`${baseUrl}/api/projects/${projectId}/share`, { method: 'PATCH', headers: { ...headers, 'Content-Type': 'application/json' }, body: JSON.stringify({ is_public: false }) });
|
|
2262
|
+
if (!privacy.ok || (await request(`/api/projects/${projectId}/share`)).is_public !== false) throw new Error('Could not confirm private project; no decomposition was submitted.');
|
|
2263
|
+
}
|
|
2264
|
+
let imageUrl = options['--image'];
|
|
2265
|
+
if (!isHttpUrl(imageUrl)) [imageUrl] = await uploadImageFilesViaSignedUrl(baseUrl, headers, projectId, [imageUrl]);
|
|
2266
|
+
if (!imageUrl.startsWith('https://')) throw new Error('Layerize requires an uploaded HTTPS original.');
|
|
2267
|
+
// Attach the source once, only for a new job. A resumed request uses status instead.
|
|
2268
|
+
if (!options['--request-id']) await request('/api/projects/create', { _addToProject: projectId, imageUrls: [imageUrl] });
|
|
2269
|
+
process.stderr.write(`Layerize job: ${jobId}\nProject: ${projectId}\nRecovery: makaron layerize status ${jobId} --project ${projectId}\n`);
|
|
2270
|
+
// A paid submission is deliberately never retried on a transport error.
|
|
2271
|
+
result = await request('/api/layerize', { projectId, requestId: jobId, imageUrl, maxOutputs: n, quality, prompt: options['--prompt'], editableText: options['--editable-text'] === true });
|
|
2272
|
+
} else result = await request(`/api/layerize?projectId=${projectId}&jobId=${jobId}`);
|
|
2273
|
+
process.stderr.write(`Edit in Makaron: ${result.projectUrl}\n`);
|
|
2274
|
+
const deadline = Date.now() + 8 * 60_000;
|
|
2275
|
+
while (!options['--no-wait'] && ['preparing', 'processing'].includes(result.status) && Date.now() < deadline) {
|
|
2276
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
2277
|
+
result = await request(`/api/layerize?projectId=${projectId}&jobId=${jobId}`);
|
|
2278
|
+
}
|
|
2279
|
+
if (options['--json']) console.log(JSON.stringify(result));
|
|
2280
|
+
else {
|
|
2281
|
+
console.log(`${result.status === 'completed' ? 'Layers ready. Edit in Makaron' : result.status}: ${result.projectUrl}`);
|
|
2282
|
+
if (result.status !== 'completed') console.log(`Job: ${result.jobId}`);
|
|
2283
|
+
if (result.message) console.log(result.message);
|
|
2284
|
+
if (result.status !== 'completed') console.log(`Resume: makaron layerize status ${jobId} --project ${projectId}`);
|
|
2285
|
+
}
|
|
2286
|
+
if (['failed', 'uncertain'].includes(result.status)) process.exitCode = 1;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2214
2289
|
function printRootHelp() {
|
|
2215
2290
|
console.log(`Makaron CLI — Talk to Makaron Agent from the terminal
|
|
2216
2291
|
|
|
@@ -2233,6 +2308,9 @@ Commands:
|
|
|
2233
2308
|
create --image-url <url> Create project from URL
|
|
2234
2309
|
create --title "name" Create empty project (text-to-image)
|
|
2235
2310
|
|
|
2311
|
+
layerize --image <file|url> Split into editable design layers; returns Makaron edit URL
|
|
2312
|
+
layerize status <jobId> --project <id> Recover the same layer task
|
|
2313
|
+
|
|
2236
2314
|
chat --project <id> "message" Chat (non-blocking, polls for result)
|
|
2237
2315
|
chat --project <id> --image <file> Attach an image or visual reference
|
|
2238
2316
|
chat --project <id> --skill <id> Use a built-in or marketplace skill
|
|
@@ -2325,6 +2403,7 @@ function setupMakaron(values = []) {
|
|
|
2325
2403
|
}
|
|
2326
2404
|
|
|
2327
2405
|
function printHelp(topic, subtopic) {
|
|
2406
|
+
if (topic === 'layerize') { printLayerizeHelp(); return; }
|
|
2328
2407
|
if (topic === 'login') {
|
|
2329
2408
|
console.log('Usage: makaron login');
|
|
2330
2409
|
} else if (topic === 'create') {
|
|
@@ -2555,6 +2634,8 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
|
|
|
2555
2634
|
process.exit(1);
|
|
2556
2635
|
}
|
|
2557
2636
|
await createProject(baseUrl, headers, opts);
|
|
2637
|
+
} else if (command === 'layerize') {
|
|
2638
|
+
try { await runLayerize(args); } catch (error) { console.error(error.message + '\nRetain the printed job ID; query status before any new submission.'); process.exitCode = 1; }
|
|
2558
2639
|
} else if (command === 'chat') {
|
|
2559
2640
|
if (args.includes('--help') || args.includes('-h')) {
|
|
2560
2641
|
printChatHelp();
|
package/package.json
CHANGED
package/skills/makaron/SKILL.md
CHANGED
|
@@ -576,3 +576,15 @@ The legacy `openai` image-model parameter now resolves to GPT Image 2.6 Flare.
|
|
|
576
576
|
Naming Seedance 2.5 in chat defaults to Seedance 2.5 Eco. Use `seedance-2.5-native` only when explicitly requesting native generation; Eco supports 720p/1080p/2K/4K final delivery.
|
|
577
577
|
|
|
578
578
|
Seedream 5.5 (`--image-model seedream-5.5`) uses EvoLink, accepts at most 10 ordered inputs (base included), `--image-resolution 1K|1.5K|2K`, and `--output-format png|jpeg` (default PNG). `--background transparent` requires native PNG alpha. Quality/reasoning/GIF/SVG controls are unsupported. It never participates in Auto or switches providers after failure. Direct `makaron edit --image/--ref` uploads local originals automatically; direct MCP callers must supply public HTTPS PNG/JPEG/WebP originals. Accepted task receipts are saved to the user workspace before polling. The server must configure `EVOLINK_API_KEY` and an exact active `seedream-5.5` pricing row before use.
|
|
579
|
+
|
|
580
|
+
### Image layer decomposition
|
|
581
|
+
|
|
582
|
+
```bash
|
|
583
|
+
makaron chat --project auto --image poster.png "拆成图层,文字可以编辑,返回 Makaron 编辑链接"
|
|
584
|
+
makaron layerize --image poster.png --max-outputs 8 --quality 1K --editable-text --json
|
|
585
|
+
makaron layerize status <jobId> --project <projectId> --json
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
Both paths return a Makaron `projectUrl`. Open it to edit the standard design in the GUI: move/scale image layers, reorder or delete/restore layers, and edit recognized text. Default raster layers preserve the decomposed appearance; `--editable-text` replaces recognized text with ordinary editable design text using approximate fonts. Decorative text can remain raster. The original image and PNG layers remain in the project/workspace. No new GUI renderer is required.
|
|
589
|
+
|
|
590
|
+
`--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.
|