makaron-cli 0.17.1 → 0.18.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/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +5 -4
- package/README.md +45 -1
- package/bin/makaron.mjs +22 -8
- package/craft/manifest.json +2877 -0
- package/craft/prompts/agent-coding.md +220 -0
- package/craft/prompts/agent.md +86 -0
- package/craft/prompts/animate.md +448 -0
- package/craft/prompts/audio.md +261 -0
- package/craft/prompts/captions.md +220 -0
- package/craft/prompts/coding-submission.md +31 -0
- package/craft/prompts/coding-workflow.md +26 -0
- package/craft/prompts/creative.md +108 -0
- package/craft/prompts/cutout.md +81 -0
- package/craft/prompts/enhance.md +123 -0
- package/craft/prompts/generate_image_tool.md +26 -0
- package/craft/prompts/image.md +222 -0
- package/craft/prompts/legacy/agent.md +123 -0
- package/craft/prompts/legacy/coding-tool.md +31 -0
- package/craft/prompts/legacy/video-tool.md +38 -0
- package/craft/prompts/legacy/workspace-authoring.md +13 -0
- package/craft/prompts/niji.md +117 -0
- package/craft/prompts/pony_translate.md +42 -0
- package/craft/prompts/remotion-composition.md +405 -0
- package/craft/prompts/video-reverse.md +170 -0
- package/craft/prompts/video-submission.md +44 -0
- package/craft/prompts/video-workflow.md +42 -0
- package/craft/prompts/wai_translate.md +28 -0
- package/craft/prompts/web-search.md +1 -0
- package/craft/prompts/wild.md +119 -0
- package/craft/prompts/workspace-authoring.md +13 -0
- package/craft/skills/SKILL_README.md +249 -0
- package/craft/skills/_shared/aesthetic-lens-contract.md +68 -0
- package/craft/skills/_shared/native-audiovisual.md +44 -0
- package/craft/skills/_shared/remotion-director-contract.md +133 -0
- package/craft/skills/_shared/remotion-video-director/README.md +140 -0
- package/craft/skills/_shared/remotion-video-director/SKILL.md +391 -0
- package/craft/skills/_shared/remotion-video-director/references/component-library.md +608 -0
- package/craft/skills/_shared/remotion-video-director/references/expert-definitions.md +214 -0
- package/craft/skills/_shared/remotion-video-director/references/music-and-audio.md +186 -0
- package/craft/skills/_shared/remotion-video-director/references/remotion-patterns.md +439 -0
- package/craft/skills/_shared/remotion-video-director/references/video-archetypes.md +395 -0
- package/craft/skills/_shared/speech-clock.md +63 -0
- package/craft/skills/_shared/spoken-caption.md +75 -0
- package/craft/skills/_shared/studio-production/audio-direction.md +60 -0
- package/craft/skills/_shared/studio-production/production-contract.md +188 -0
- package/craft/skills/_shared/studio-production/reference-analysis.md +37 -0
- package/craft/skills/_shared/studio-production/review-contract.md +77 -0
- package/craft/skills/_shared/studio-production/taste-direction.md +114 -0
- package/craft/skills/_shared/visual-asset-bridge/SKILL.md +57 -0
- package/craft/skills/_shared/visual-direction/SKILL.md +98 -0
- package/craft/skills/_shared/voice-translation.md +55 -0
- package/craft/skills/aesthetic-disney-character-motion/SKILL.md +66 -0
- package/craft/skills/aesthetic-lottiefiles-motion/SKILL.md +78 -0
- package/craft/skills/aesthetic-rampstack-direction/SKILL.md +68 -0
- package/craft/skills/ai-video-gen/SKILL.md +48 -0
- package/craft/skills/animated-explainer/SKILL.md +53 -0
- package/craft/skills/animation/SKILL.md +53 -0
- package/craft/skills/avatar-spokesperson/SKILL.md +66 -0
- package/craft/skills/canvas-procedural-animation/SKILL.md +48 -0
- package/craft/skills/character-animation/SKILL.md +57 -0
- package/craft/skills/character-animation-qa/SKILL.md +48 -0
- package/craft/skills/character-rigging/SKILL.md +48 -0
- package/craft/skills/cinematic/SKILL.md +53 -0
- package/craft/skills/cinematic-video/SKILL.md +65 -0
- package/craft/skills/clip-factory/SKILL.md +53 -0
- package/craft/skills/comfyui/SKILL.md +48 -0
- package/craft/skills/content-repurpose/SKILL.md +54 -0
- package/craft/skills/create-video/SKILL.md +48 -0
- package/craft/skills/documentary-montage/SKILL.md +53 -0
- package/craft/skills/doubao-tts/SKILL.md +51 -0
- package/craft/skills/explainer-aesthetic-disney/SKILL.md +33 -0
- package/craft/skills/explainer-aesthetic-lottiefiles/SKILL.md +33 -0
- package/craft/skills/explainer-aesthetic-rampstack/SKILL.md +33 -0
- package/craft/skills/explainer-video/SKILL.md +423 -0
- package/craft/skills/ffmpeg/SKILL.md +48 -0
- package/craft/skills/grok-media/SKILL.md +47 -0
- package/craft/skills/hybrid/SKILL.md +53 -0
- package/craft/skills/localization-dub/SKILL.md +59 -0
- package/craft/skills/long-video-anchor/SKILL.md +111 -0
- package/craft/skills/long-video-director/SKILL.md +217 -0
- package/craft/skills/long-video-storyboard/SKILL.md +102 -0
- package/craft/skills/makaron-mascot/SKILL.md +83 -0
- package/craft/skills/makaron-mascot/assets/character-sheet.jpg +0 -0
- package/craft/skills/makaron-mascot/assets/makaron-spark-pixel-wizard-concepts.png +0 -0
- package/craft/skills/media-use/SKILL.md +47 -0
- package/craft/skills/motion-design-video/SKILL.md +64 -0
- package/craft/skills/motion-graphics/SKILL.md +48 -0
- package/craft/skills/multi-angle-video/SKILL.md +533 -0
- package/craft/skills/music/SKILL.md +47 -0
- package/craft/skills/music-to-video/SKILL.md +60 -0
- package/craft/skills/photo-to-video/SKILL.md +60 -0
- package/craft/skills/podcast-repurpose/SKILL.md +53 -0
- package/craft/skills/pose-library-design/SKILL.md +48 -0
- package/craft/skills/reference-video-studio/SKILL.md +55 -0
- package/craft/skills/remotion/SKILL.md +48 -0
- package/craft/skills/remotion-best-practices/SKILL.md +48 -0
- package/craft/skills/screen-demo/SKILL.md +61 -0
- package/craft/skills/seedance-2-0/SKILL.md +48 -0
- package/craft/skills/seedance-2-5/SKILL.md +48 -0
- package/craft/skills/sound-effects/SKILL.md +47 -0
- package/craft/skills/source-video-studio/SKILL.md +68 -0
- package/craft/skills/speech-to-text/SKILL.md +47 -0
- package/craft/skills/sticker-maker/SKILL.md +178 -0
- package/craft/skills/svg-character-animation/SKILL.md +48 -0
- package/craft/skills/synthetic-screen-recording/SKILL.md +48 -0
- package/craft/skills/talking-head/SKILL.md +106 -0
- package/craft/skills/text-to-speech/SKILL.md +50 -0
- package/craft/skills/threejs-animation/SKILL.md +48 -0
- package/craft/skills/threejs-fundamentals/SKILL.md +48 -0
- package/craft/skills/threejs-geometry/SKILL.md +48 -0
- package/craft/skills/threejs-lighting/SKILL.md +48 -0
- package/craft/skills/threejs-materials/SKILL.md +48 -0
- package/craft/skills/threejs-shaders/SKILL.md +48 -0
- package/craft/skills/threejs-textures/SKILL.md +48 -0
- package/craft/skills/tiktok-video/SKILL.md +188 -0
- package/craft/skills/tiktok-video/references/audio-sync.md +58 -0
- package/craft/skills/tiktok-video/references/caption-direction.md +36 -0
- package/craft/skills/tiktok-video/references/delivery-qa.md +84 -0
- package/craft/skills/tiktok-video/references/platform-layout.md +62 -0
- package/craft/skills/video-edit/SKILL.md +144 -0
- package/craft/skills/video-edit/references/direct-reference-route.md +141 -0
- package/craft/skills/video-edit/references/editing-protocol.md +79 -0
- package/craft/skills/video-edit/references/frame-location.md +85 -0
- package/craft/skills/video-edit/references/replication-protocol.md +67 -0
- package/craft/skills/video-edit/references/shot-blueprint.md +116 -0
- package/craft/skills/video-edit/references/shot-blueprint.schema.json +143 -0
- package/craft/skills/video-edit/references/similarity-qa.md +47 -0
- package/craft/skills/video-edit/scripts/extract-shot-blueprint.mjs +313 -0
- package/craft/skills/video-ffmpeg-lab/SKILL.md +220 -0
- package/craft/skills/video-mature-themes/SKILL.md +175 -0
- package/craft/skills/video-segment-edit/SKILL.md +16 -0
- package/craft/skills/video-translate/SKILL.md +148 -0
- package/craft/skills/video-understand/SKILL.md +48 -0
- package/craft/skills/visual-style/SKILL.md +47 -0
- package/craft/skills/wan-3-0/SKILL.md +59 -0
- package/craft/skills/web-design-guidelines/SKILL.md +47 -0
- package/craft/skills/website-to-video/SKILL.md +61 -0
- package/craft-source.json +7 -0
- package/package.json +12 -5
- package/runtime/adapter.mjs +615 -0
- package/runtime/configure.mjs +28 -0
- package/runtime/tool-catalog.json +807 -0
- package/runtime/tool-cli.mjs +98 -0
- package/skills/makaron-native/SKILL.md +89 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Exploration only: no new planner, provider client, billing ledger or MCP server.
|
|
3
|
+
import { readFile, writeFile, mkdir, lstat, realpath } from 'node:fs/promises';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { pathToFileURL } from 'node:url';
|
|
7
|
+
import { createAdapter } from './adapter.mjs';
|
|
8
|
+
import { configure } from './configure.mjs';
|
|
9
|
+
|
|
10
|
+
const help = `Makaron host-owned CLI + Skill
|
|
11
|
+
makaron tools list [--live]
|
|
12
|
+
makaron tools call <tool_name> --input <args.json|->
|
|
13
|
+
makaron tools configure --endpoint https://<operator-host>/api/harness
|
|
14
|
+
Output: one JSON document; exit 0 success, 1 tool failure, 2 CLI/input failure.
|
|
15
|
+
Reuse MAKARON_* private settings; MAKARON_CRAFT_ROOT selects the verified craft bundle.
|
|
16
|
+
No Agent is launched automatically; service delegation requires its explicit tool.
|
|
17
|
+
`;
|
|
18
|
+
class InputError extends Error {}
|
|
19
|
+
const maxInput = 4 * 1024 * 1024;
|
|
20
|
+
async function stdinText(stream) {
|
|
21
|
+
const chunks = []; let size = 0;
|
|
22
|
+
for await (const c of stream) {
|
|
23
|
+
const b = Buffer.from(c); size += b.length;
|
|
24
|
+
if (size > maxInput) throw new InputError('JSON input exceeds 4 MiB');
|
|
25
|
+
chunks.push(b);
|
|
26
|
+
}
|
|
27
|
+
return Buffer.concat(chunks).toString('utf8');
|
|
28
|
+
}
|
|
29
|
+
async function presentation(result, workspace) {
|
|
30
|
+
const content = [];
|
|
31
|
+
for (const block of result.content || []) {
|
|
32
|
+
if (block.type === 'text') {
|
|
33
|
+
// Billing/task metadata may accompany the only substantive text result.
|
|
34
|
+
// Drop only a byte-identical JSON mirror, never an analysis or an error.
|
|
35
|
+
if (!result.structuredContent || block.text !== JSON.stringify(result.structuredContent)) content.push(block);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (block.type !== 'image') throw new Error('Unsupported CLI content');
|
|
39
|
+
const bytes = Buffer.from(block.data, 'base64');
|
|
40
|
+
const mime = bytes[0] === 255 && bytes[1] === 216 ? ['image/jpeg','jpg']
|
|
41
|
+
: bytes.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? ['image/png','png']
|
|
42
|
+
: bytes.toString('ascii',0,4) === 'RIFF' && bytes.toString('ascii',8,12) === 'WEBP' ? ['image/webp','webp'] : null;
|
|
43
|
+
if (!mime || mime[0] !== block.mimeType) throw new Error('Invalid image artifact');
|
|
44
|
+
await mkdir(workspace, {recursive:true,mode:0o700});
|
|
45
|
+
const stat = await lstat(workspace);
|
|
46
|
+
if (!stat.isDirectory() || stat.isSymbolicLink()) throw new Error('Unsafe workspace');
|
|
47
|
+
const sha256 = createHash('sha256').update(bytes).digest('hex');
|
|
48
|
+
const artifactPath = path.join(await realpath(workspace),`${sha256}.${mime[1]}`);
|
|
49
|
+
try { await writeFile(artifactPath,bytes,{flag:'wx',mode:0o600}); }
|
|
50
|
+
catch (e) {
|
|
51
|
+
if(e.code !== 'EEXIST') throw e;
|
|
52
|
+
const existing = await lstat(artifactPath);
|
|
53
|
+
if(!existing.isFile() || existing.isSymbolicLink() || !(await readFile(artifactPath)).equals(bytes)) throw new Error('Artifact conflict');
|
|
54
|
+
}
|
|
55
|
+
content.push({type:'artifact',artifactPath,mimeType:mime[0],sha256,sizeBytes:bytes.length});
|
|
56
|
+
}
|
|
57
|
+
return {schemaVersion:1,ok:!result.isError,result:result.structuredContent || null,content};
|
|
58
|
+
}
|
|
59
|
+
export async function run(argv, options = {}) {
|
|
60
|
+
const input = options.input || process.stdin;
|
|
61
|
+
const output = options.output || process.stdout;
|
|
62
|
+
const inputEnv = options.env || process.env;
|
|
63
|
+
const env = {...inputEnv, PLUGIN_DATA: inputEnv.PLUGIN_DATA || path.join((await import('node:os')).homedir(), '.makaron', 'cli')};
|
|
64
|
+
const send = value => output.write(JSON.stringify(value)+'\n');
|
|
65
|
+
try {
|
|
66
|
+
if (argv.length === 1 && ['--help','-h'].includes(argv[0])) { output.write(help); return 0; }
|
|
67
|
+
if (argv[0] === 'tools' && argv[1] === 'configure') {
|
|
68
|
+
const configured = await configure(argv.slice(2), env);
|
|
69
|
+
if (configured.help) output.write(configured.help); else send(configured);
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
const listing = argv[0] === 'tools' && argv[1] === 'list' && (argv.length === 2 || argv.length === 3 && argv[2] === '--live');
|
|
73
|
+
const calling = argv[0] === 'tools' && argv[1] === 'call' && argv.length === 5 && argv[3] === '--input';
|
|
74
|
+
if (!listing && !calling) throw new InputError('Use tools list [--live] or tools call <name> --input <file|->');
|
|
75
|
+
let args;
|
|
76
|
+
if (calling) {
|
|
77
|
+
let raw;
|
|
78
|
+
if (argv[4] === '-') raw = await stdinText(input);
|
|
79
|
+
else {
|
|
80
|
+
const stat = await lstat(argv[4]);
|
|
81
|
+
if (!stat.isFile() || stat.isSymbolicLink() || stat.size > maxInput) throw new InputError('Input must be a regular JSON file no larger than 4 MiB');
|
|
82
|
+
raw = await readFile(argv[4], 'utf8');
|
|
83
|
+
}
|
|
84
|
+
try { args = JSON.parse(raw); } catch { throw new InputError('Input must contain valid JSON'); }
|
|
85
|
+
if (!args || Array.isArray(args) || typeof args !== 'object') throw new InputError('Tool arguments must be a JSON object');
|
|
86
|
+
}
|
|
87
|
+
const version = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
88
|
+
const adapter = options.adapter || createAdapter({env,craftRoot:env.MAKARON_CRAFT_ROOT,clientName:`makaron-cli/${version}`});
|
|
89
|
+
if(listing) { send({schemaVersion:1,ok:true,tools:await adapter.listTools({refresh:argv[2] === '--live'})}); return 0; }
|
|
90
|
+
const result = await adapter.invokeTool(argv[2],args);
|
|
91
|
+
send({...(await presentation(result,adapter.workspaceDir)),tool:argv[2]});
|
|
92
|
+
return result.isError ? 1 : 0;
|
|
93
|
+
} catch (e) {
|
|
94
|
+
send({schemaVersion:1,ok:false,error:{code:e instanceof InputError?'CLI_INPUT_INVALID':'CLI_FAILED',message:e instanceof InputError?e.message:'CLI could not complete; inspect the existing receipt before retrying creative work'}});
|
|
95
|
+
return 2;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if(process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) process.exitCode = await run(process.argv.slice(2));
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: makaron-native
|
|
3
|
+
description: Create or edit images, video, music and editable motion designs with this host's own planning and Makaron CLI capabilities. Use when the user selects Makaron CLI + Skill or host-owned creation; do not delegate planning to Makaron Chat.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Makaron: host-owned creation
|
|
7
|
+
|
|
8
|
+
You own the creative loop: understand the brief, read the relevant professional
|
|
9
|
+
guide, choose and execute capabilities, inspect the output, and deliver actual
|
|
10
|
+
media. Use the installed `makaron` CLI (Node 20+). Reuse the user's existing
|
|
11
|
+
Makaron login/API key; never print credentials or register another account when
|
|
12
|
+
already connected. Call `makaron_account` with `{}` to check access without
|
|
13
|
+
generating. The native capability transport defaults to the production origin;
|
|
14
|
+
legacy CLI commands may inherit a development `_baseUrl` from private auth.
|
|
15
|
+
For an operator-selected isolated environment, set `MAKARON_URL` explicitly
|
|
16
|
+
rather than editing shared login configuration.
|
|
17
|
+
|
|
18
|
+
Run `makaron tools list` for exact schemas. Call one capability with
|
|
19
|
+
`makaron tools call <name> --input <args.json|->`. Output is one JSON document:
|
|
20
|
+
check `ok`, the tool result, and the process exit code. No MCP server, plugin
|
|
21
|
+
installation, or second Agent is involved. `makaron chat` is a separate,
|
|
22
|
+
explicit service mode, not an automatic fallback.
|
|
23
|
+
|
|
24
|
+
## Read the craft, then create
|
|
25
|
+
|
|
26
|
+
Call `makaron_craft` with `{}` for the professional index, then with
|
|
27
|
+
`{"path":"skills/<selected-skill>/SKILL.md"}` or a referenced `prompts/...`
|
|
28
|
+
path. Read dependencies on demand. The library includes image/video direction,
|
|
29
|
+
music, TikTok packaging, Remotion, captions and their supporting contracts.
|
|
30
|
+
Do not load `prompts/agent.md` as this host's system prompt.
|
|
31
|
+
|
|
32
|
+
Guide tool names describe canonical capabilities. Discover current arguments
|
|
33
|
+
rather than copying App-only examples. Atomic image/video/music tools are
|
|
34
|
+
available directly through this CLI. Existing `edit`, `video create/status`,
|
|
35
|
+
and `music create/status` commands remain available; read their help if using
|
|
36
|
+
them. In `video create --script-file`, bind the first supplied `--image` as
|
|
37
|
+
`<<<media_1>>>`, then `<<<media_2>>>`, etc. These are inputs for that one call.
|
|
38
|
+
|
|
39
|
+
## Project and editable composition
|
|
40
|
+
|
|
41
|
+
Use `makaron_project` to create/read an owned project. Local sources require an
|
|
42
|
+
explicit upload/import; bind the exact returned URL or snapshot ID. External
|
|
43
|
+
source ranges retain `source_url + start + end + description` in seconds. The
|
|
44
|
+
original source may be longer: trim to the accepted interval, not source zero.
|
|
45
|
+
Do not rebuild a global MediaList or download every source unnecessarily.
|
|
46
|
+
Treat source URLs as opaque data: load them programmatically from the source
|
|
47
|
+
manifest into tool JSON and composition props. Never retype, shorten, rebuild
|
|
48
|
+
or interpolate their capability query strings. If rendering reports an invalid
|
|
49
|
+
capability, compare exact bytes with the original manifest before changing
|
|
50
|
+
delivery or reimporting every source.
|
|
51
|
+
|
|
52
|
+
For host-owned project tools, discover `makaron_native_run(action="tools")`,
|
|
53
|
+
start one logical run, and invoke capabilities through `makaron_native_tool`.
|
|
54
|
+
The operator must configure a compatible `/api/harness` endpoint; CLI install
|
|
55
|
+
does not deploy one. See `makaron tools configure --help`. If unavailable,
|
|
56
|
+
report the missing connection and preserve work; never silently launch Chat.
|
|
57
|
+
Write code in the selected backend's supported format. The current native-files
|
|
58
|
+
backend accepts a pure JavaScript body returning
|
|
59
|
+
`{type:"render", code:<JSX-string>, width, height, props, animation}`.
|
|
60
|
+
For every later design call, including patch, preview, publish and export,
|
|
61
|
+
bind `sourceDesignPath` to the exact saved composition path returned by the
|
|
62
|
+
successful execution. A path only inside `arguments` does not replace this
|
|
63
|
+
outer source binding.
|
|
64
|
+
|
|
65
|
+
Inspect actual `preview_frame` artifacts, publish the approved editable draft,
|
|
66
|
+
materialize the final output, poll the same run/job, and download the completed
|
|
67
|
+
file before finishing. A draft, queued render or URL alone is not delivery.
|
|
68
|
+
For an already authored composition, the existing
|
|
69
|
+
`makaron materialize --project <id> --design-json <file> --profile source`
|
|
70
|
+
renders it without delegating creative planning; preserve its job ID.
|
|
71
|
+
|
|
72
|
+
## Recover and deliver
|
|
73
|
+
|
|
74
|
+
Every mutation takes a stable `client_request_id`. Persist request identity and
|
|
75
|
+
returned task/run/job; after timeout inspect `makaron_receipt` and the same
|
|
76
|
+
status. Unknown submissions never justify a fresh paid request. Source files
|
|
77
|
+
and unfinished projects stay intact. Do not change models or regenerate media
|
|
78
|
+
just to hide a failed attempt.
|
|
79
|
+
|
|
80
|
+
CLI images are returned as real local `artifactPath` files. Open them with the
|
|
81
|
+
host image reader. Download actual final video/audio and inspect it: full
|
|
82
|
+
decode, dimensions/duration, source contribution, representative frames and
|
|
83
|
+
requested edits. If speech is captioned, use measured speech timing. Audible
|
|
84
|
+
streams do not prove the requested soundtrack or sync; state review limits.
|
|
85
|
+
|
|
86
|
+
Deliver the actual absolute file through the host's media presentation and a
|
|
87
|
+
project link when useful. OpenClaw needs `MEDIA:<absolute-path>` on its own line;
|
|
88
|
+
verify the parsed media payload/channel delivery. Ordinary CLI stdout cannot
|
|
89
|
+
attach media to a chat. Keep editable source internal unless requested.
|