makaron-cli 0.8.2 → 0.8.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "Talk to Makaron Agent from the terminal — create projects, edit images, generate videos",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -9,7 +9,7 @@
9
9
  "test:live": "MAKARON_LIVE=1 node test/live-smoke.mjs"
10
10
  },
11
11
  "bin": {
12
- "makaron": "./bin/makaron.mjs"
12
+ "makaron": "bin/makaron.mjs"
13
13
  },
14
14
  "files": [
15
15
  "bin/",
@@ -30,6 +30,6 @@
30
30
  "license": "MIT",
31
31
  "repository": {
32
32
  "type": "git",
33
- "url": "https://github.com/vegekyd/ai-image-editor"
33
+ "url": "git+https://github.com/vegekyd/ai-image-editor.git"
34
34
  }
35
35
  }
@@ -86,6 +86,16 @@ Returns immediately:
86
86
  npx makaron-cli chat --project <id> --image ref1.jpg --image ref2.jpg -b "use these as style reference"
87
87
  ```
88
88
 
89
+ ### Inspect existing timeline media
90
+
91
+ Before starting a follow-up run on an existing project, list the current timeline media so you know what assets are available and which `<<<media_N>>>` references to use:
92
+
93
+ ```bash
94
+ npx makaron-cli project media <projectId> --json
95
+ ```
96
+
97
+ This is project-scoped. `responses get <runId> --pick output` only returns artifacts from one run; `project media` returns the whole project timeline: original uploads, references, generated images, video snapshots, and editable compositions.
98
+
89
99
  ### With video input (edit, compose, extend)
90
100
 
91
101
  ```bash
@@ -102,7 +112,7 @@ npx makaron-cli chat --project <id> --video clip1.mp4 --video clip2.mp4 -b "comb
102
112
  npx makaron-cli chat --project auto --video https://example.com/dance.mp4 -b "extend this to 15 seconds"
103
113
  ```
104
114
 
105
- Supported formats: MP4, MOV, WebM. CLI local video uploads follow the same compatibility contract as the normal frontend flow: max 200MB, target max 15s with 0.5s metadata tolerance, and <=1080p / 2,086,876 frame pixels. The frontend can transcode oversized videos; the CLI rejects them so later Seedance editing does not fail. Videos are uploaded to the project timeline. The Agent can analyze scenes, edit content, compose multiple clips, extend duration, and add effects — all via natural language. Seedance video-reference editing is supported for ~15s videos that meet these upload limits; Kling remains the base/direct edit path.
115
+ Supported formats: MP4, MOV, WebM. CLI local video uploads support max 50MB, max 120s with 1s metadata tolerance, and <=1080p / 2,086,876 frame pixels. The frontend can transcode larger videos before upload; the CLI uploads directly to Storage and rejects videos above those limits. Videos are uploaded to the project timeline. The Agent can analyze scenes, edit content, compose multiple clips, extend duration, and add effects — all via natural language. Seedance video-reference editing is still limited to ~15s provider references, so longer uploaded videos should be split/prepared by the agent before model submission; Kling remains the base/direct edit path.
106
116
 
107
117
  Use `chat --project <id|auto> --video ...` for any project/timeline video work. Direct video commands are standalone raw-tool calls.
108
118
 
@@ -126,64 +136,6 @@ Outputs one JSON per line as artifacts appear:
126
136
  {"event":"done","status":"completed"}
127
137
  ```
128
138
 
129
- ### New Agent quickstart
130
-
131
- For a new Agent, keep the default service flow to two response commands:
132
-
133
- ```bash
134
- npx makaron-cli responses next <runId> --json
135
- npx makaron-cli responses handle <messageId> --run <runId> --choice approve
136
- npx makaron-cli responses deliver <artifactId> --run <runId> --channel feishu --message-id <messageId>
137
- ```
138
-
139
- `responses next` emits a compact timeline, detects text-only checkpoints for creative/service work, and returns `next_commands` when the Agent must handle a Makaron message before waiting for artifacts. It exits with code `3` on an unhandled checkpoint so wrappers stop instead of silently waiting. After handling a checkpoint, run the returned `next_commands.inspect` command to continue. While the run is still generating, it returns `status: "running"` and `blocking: false`. If completed image/video artifacts exist and have not been delivered, it returns `status: "has_artifacts"` and `blocking: true` with compact `undelivered_artifacts` entries containing `kind`, `status`, `url`, `fileName`, and `contentType` when available, plus `next_commands.deliver`; the Agent must send the artifact URL to the user, then record delivery with `responses deliver`. A non-checkpoint response returns `status: "ready"` or `status: "delivered"`. If a run failed, `responses next --json` prints `status: "failed"` and `blocking: true` plus `error.type`, `error.message`, `error.recoverable`, `error.detail`, and `next_command` to stdout before exiting `1`, so wrappers can parse the failure without scraping stderr. Use `--no-fail` to inspect checkpoint JSON without failing. For pure Q&A runs, use:
140
-
141
- ```bash
142
- npx makaron-cli responses next <runId> --json --checkpoint-mode off
143
- ```
144
-
145
- `responses handle` is the single checkpoint action command. Valid choices are `approve`, `revise`, `ask_user`, and `continue`. `responses deliver` records that a completed artifact was actually delivered to the user, preventing repeated delivery prompts.
146
-
147
- ### Dialogue events for external Agents
148
-
149
- Use this when another Agent needs to read what Makaron said, handle text checkpoints, and relay artifacts without inventing customer-service wording.
150
-
151
- ```bash
152
- npx makaron-cli responses events <runId> --jsonl
153
- # alias: npx makaron-cli responses timeline <runId> --jsonl
154
- # compact view: npx makaron-cli responses timeline <runId> --jsonl --compact
155
- # pure Q&A view: npx makaron-cli responses timeline <runId> --jsonl --checkpoint-mode off
156
- ```
157
-
158
- `events` and `timeline` are lower-level commands. New Agents should start with `responses next` and use these only when they need raw event streams.
159
-
160
- Events use only three factual types:
161
-
162
- ```json
163
- {"type":"message","id":"msg_1","runId":"run_xxx","seq":1,"text":"Makaron original message","requires_approval":true,"approval_options":["approve","revise","ask_user","continue"]}
164
- {"type":"approval","messageId":"msg_1","choice":"approve","status":"recorded"}
165
- {"type":"artifact","kind":"image","status":"completed","url":"https://..."}
166
- ```
167
-
168
- Makaron uses a conservative checkpoint rule for creative/service Agents: if a run stops with substantive text, has no image/video/music/design artifact, and has no continuing execution action such as a tool call, the message is marked `requires_approval: true`. Pure status text such as queued, rendering, uploading, or completed is not treated as a checkpoint. Pure Q&A flows should pass `--checkpoint-mode off`. If a message has `requires_approval: true`, the external Agent must record an approval before continuing to wait for artifacts or claiming completion:
169
-
170
- ```bash
171
- npx makaron-cli responses approve msg_1 --run <runId> --note "Proceed."
172
- npx makaron-cli responses revise msg_1 --run <runId> "make it softer"
173
- npx makaron-cli responses ask-user msg_1 --run <runId>
174
- npx makaron-cli responses continue msg_1 --run <runId>
175
- npx makaron-cli responses handle msg_1 --run <runId> --choice approve
176
- ```
177
-
178
- Important: approvals are a local Agent gate in v0. They are recorded by the CLI so wrappers and Skills can fail fast, but they do not pause or resume the remote Makaron runtime yet. Wrappers can enforce the local gate with:
179
-
180
- ```bash
181
- npx makaron-cli responses events <runId> --jsonl --checkpoint-mode service --fail-on-unapproved
182
- # alias: npx makaron-cli responses timeline <runId> --jsonl --compact --fail-on-unapproved
183
- ```
184
-
185
- Use `--compact` when relaying to another Agent or chat system; it merges consecutive Makaron content chunks into a single readable message.
186
-
187
139
  ### Extract specific results
188
140
 
189
141
  ```bash
@@ -246,9 +198,9 @@ npx makaron-cli video status <taskId>
246
198
  npx makaron-cli chat --project <id|auto> --video input.mp4 -b "make it funny"
247
199
  ```
248
200
 
249
- Options for `video create`: `--script "..."`, `--script-file <path>`, `--image <url>` (repeatable, up to 7), `--video <file|url>`, `--duration 3|5|7|10|15`, `--aspect 9:16|16:9|1:1`, `--model kling|seedance`
201
+ Options for `video create`: `--script "..."`, `--script-file <path>`, `--image <url>` (repeatable, up to 7), `--video <file|url>`, `--duration <seconds>`, `--aspect 9:16|16:9|1:1`, `--model kling|seedance`. SeeDance accepts integer output duration 4-15s (default 5s); Kling supports 5-15s.
250
202
 
251
- Video edit model behavior: `--model kling --video` uses Kling base/direct edit internally; `--model seedance --video` uses the Seedance video-reference path and requires target <=15s, <=1080p input. Tiny metadata padding up to 15.5s is accepted and output duration is clamped to 15s.
203
+ Video edit model behavior: `--model kling --video` uses Kling base/direct edit internally; `--model seedance --video` uses the Seedance video-reference path and requires target <=15s, <=50MB, width/height 300-6000px, aspect ratio 0.4-2.5, and frame pixels 409,600-2,086,876. Tiny metadata padding up to 15.5s is accepted and output duration is clamped to 15s.
252
204
 
253
205
  ### `music` — Music generation
254
206
 
@@ -310,41 +262,6 @@ type MakaronOutput =
310
262
  | Motion design | "create an Instagram story with animated text" |
311
263
  | Multi-step | "edit the photo then make a video from it" |
312
264
 
313
- ## Minimal Agent Wrapper
314
-
315
- A new Agent can use this minimal flow:
316
-
317
- ```bash
318
- RUN_JSON=$(npx makaron-cli chat --project auto --json -b "$USER_PROMPT")
319
- RUN_ID=$(echo "$RUN_JSON" | jq -r .runId)
320
- PROJECT_URL=$(echo "$RUN_JSON" | jq -r .projectUrl)
321
- send_message "Project created: $PROJECT_URL"
322
-
323
- if ! NEXT=$(npx makaron-cli responses next "$RUN_ID" --json); then
324
- STATUS=$(echo "$NEXT" | jq -r .status)
325
- if [ "$STATUS" = "needs_approval" ]; then
326
- MSG_ID=$(echo "$NEXT" | jq -r .checkpoint.id)
327
- TEXT=$(echo "$NEXT" | jq -r .checkpoint.text)
328
- send_message "$TEXT"
329
- npx makaron-cli responses handle "$MSG_ID" --run "$RUN_ID" --choice ask_user
330
- exit 3
331
- elif [ "$STATUS" = "failed" ]; then
332
- send_message "$(echo "$NEXT" | jq -r .error.message)"
333
- exit 1
334
- fi
335
- fi
336
-
337
- NEXT=$(npx makaron-cli responses next "$RUN_ID" --json --no-fail)
338
- if [ "$(echo "$NEXT" | jq -r .status)" = "has_artifacts" ]; then
339
- ARTIFACT_ID=$(echo "$NEXT" | jq -r ".undelivered_artifacts[0].id")
340
- ARTIFACT_URL=$(echo "$NEXT" | jq -r ".undelivered_artifacts[0].url")
341
- DELIVERY_MESSAGE_ID=$(send_message "$ARTIFACT_URL")
342
- npx makaron-cli responses deliver "$ARTIFACT_ID" --run "$RUN_ID" --channel feishu --message-id "$DELIVERY_MESSAGE_ID"
343
- fi
344
-
345
- RESULT=$(npx makaron-cli responses get "$RUN_ID" --wait --json)
346
- ```
347
-
348
265
  ## Recommended Pattern: Service Flow (Feishu/OpenClaw/Group Chat)
349
266
 
350
267
  When serving end-users in a chat environment (Feishu, Slack, Discord), use this proactive message pattern: