makaron-cli 0.5.1 → 0.5.3

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/README.md CHANGED
@@ -186,6 +186,47 @@ type MakaronOutput =
186
186
  | Motion design | "create an Instagram story with animated text" |
187
187
  | Multi-step | "edit the photo then make a video from it" |
188
188
 
189
+ ## Recommended Pattern: Service Flow (Feishu/OpenClaw/Group Chat)
190
+
191
+ When serving end-users in a chat environment (Feishu, Slack, Discord), use this proactive message pattern:
192
+
193
+ ```bash
194
+ # 1. Immediately reply to user: "收到,开始做"
195
+ send_message "收到!正在为你制作..."
196
+
197
+ # 2. Create project + submit (one command)
198
+ RUN_ID=$(npx makaron-cli chat --project auto --image photo.jpg -b "make it cinematic and create a 5s video")
199
+
200
+ # 3. Send project link proactively
201
+ PROJECT_URL=$(npx makaron-cli responses get $RUN_ID --pick project_url)
202
+ send_message "项目已创建:$PROJECT_URL"
203
+
204
+ # 4. Watch and send each artifact as it appears
205
+ npx makaron-cli responses watch $RUN_ID --jsonl | while read -r line; do
206
+ EVENT=$(echo "$line" | jq -r '.event')
207
+ TYPE=$(echo "$line" | jq -r '.item.type // empty')
208
+ URL=$(echo "$line" | jq -r '.item.url // empty')
209
+ STATUS=$(echo "$line" | jq -r '.item.status // empty')
210
+
211
+ if [ "$EVENT" = "output.added" ] && [ "$TYPE" = "image" ]; then
212
+ # Send image immediately as media (not just link)
213
+ send_image "$URL"
214
+ elif [ "$EVENT" = "output.updated" ] && [ "$TYPE" = "video" ] && [ "$STATUS" = "completed" ]; then
215
+ # Video ready — send as media
216
+ send_video "$URL"
217
+ elif [ "$EVENT" = "done" ]; then
218
+ send_message "全部完成 ✨"
219
+ fi
220
+ done
221
+ ```
222
+
223
+ **Key principles for service agents:**
224
+ - **Proactive, not reactive**: Don't wait for the full run to finish. Send progress messages and artifacts as they appear.
225
+ - **Media over links**: When possible, send images/videos as native media in the chat (download URL and upload as attachment), not just paste the URL.
226
+ - **Immediate acknowledgment**: Reply "收到" within 1 second of receiving user request. Don't make users wait for project creation.
227
+ - **Project link early**: Send the project URL right after creation so users can check anytime.
228
+ - **Stream artifacts**: Use `watch --jsonl` to push each artifact the moment it's ready. An image at 15s should reach the user at 15s, not after the video finishes at 5 minutes.
229
+
189
230
  ## Important Notes
190
231
 
191
232
  - One project = one conversation thread. All history is preserved.
package/SKILL.md CHANGED
@@ -188,6 +188,47 @@ type MakaronOutput =
188
188
  | Motion design | "create an Instagram story with animated text" |
189
189
  | Multi-step | "edit the photo then make a video from it" |
190
190
 
191
+ ## Recommended Pattern: Service Flow (Feishu/OpenClaw/Group Chat)
192
+
193
+ When serving end-users in a chat environment (Feishu, Slack, Discord), use this proactive message pattern:
194
+
195
+ ```bash
196
+ # 1. Immediately reply to user: "收到,开始做"
197
+ send_message "收到!正在为你制作..."
198
+
199
+ # 2. Create project + submit (one command)
200
+ RUN_ID=$(npx makaron-cli chat --project auto --image photo.jpg -b "make it cinematic and create a 5s video")
201
+
202
+ # 3. Send project link proactively
203
+ PROJECT_URL=$(npx makaron-cli responses get $RUN_ID --pick project_url)
204
+ send_message "项目已创建:$PROJECT_URL"
205
+
206
+ # 4. Watch and send each artifact as it appears
207
+ npx makaron-cli responses watch $RUN_ID --jsonl | while read -r line; do
208
+ EVENT=$(echo "$line" | jq -r '.event')
209
+ TYPE=$(echo "$line" | jq -r '.item.type // empty')
210
+ URL=$(echo "$line" | jq -r '.item.url // empty')
211
+ STATUS=$(echo "$line" | jq -r '.item.status // empty')
212
+
213
+ if [ "$EVENT" = "output.added" ] && [ "$TYPE" = "image" ]; then
214
+ # Send image immediately as media (not just link)
215
+ send_image "$URL"
216
+ elif [ "$EVENT" = "output.updated" ] && [ "$TYPE" = "video" ] && [ "$STATUS" = "completed" ]; then
217
+ # Video ready — send as media
218
+ send_video "$URL"
219
+ elif [ "$EVENT" = "done" ]; then
220
+ send_message "全部完成 ✨"
221
+ fi
222
+ done
223
+ ```
224
+
225
+ **Key principles for service agents:**
226
+ - **Proactive, not reactive**: Don't wait for the full run to finish. Send progress messages and artifacts as they appear.
227
+ - **Media over links**: When possible, send images/videos as native media in the chat (download URL and upload as attachment), not just paste the URL.
228
+ - **Immediate acknowledgment**: Reply "收到" within 1 second of receiving user request. Don't make users wait for project creation.
229
+ - **Project link early**: Send the project URL right after creation so users can check anytime.
230
+ - **Stream artifacts**: Use `watch --jsonl` to push each artifact the moment it's ready. An image at 15s should reach the user at 15s, not after the video finishes at 5 minutes.
231
+
191
232
  ## Important Notes
192
233
 
193
234
  - One project = one conversation thread. All history is preserved.
package/bin/makaron.mjs CHANGED
@@ -614,7 +614,11 @@ if (command === 'login') {
614
614
  let videoModel = undefined;
615
615
  let preferredModel = undefined;
616
616
  for (let i = 1; i < args.length; i++) {
617
- if (args[i] === '--project' && args[i + 1]) projectId = args[++i];
617
+ if (args[i] === '--help' || args[i] === '-h') {
618
+ console.error('Usage: makaron chat --project <id|auto> [--image <file>] [--stream] [--background|-b] [--json] "your message"');
619
+ process.exit(0);
620
+ }
621
+ else if (args[i] === '--project' && args[i + 1]) projectId = args[++i];
618
622
  else if (args[i] === '--image' && args[i + 1]) chatImages.push(args[++i]);
619
623
  else if (args[i] === '--stream') useStream = true;
620
624
  else if (args[i] === '--background' || args[i] === '-b') background = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Talk to Makaron Agent from the terminal — create projects, edit images, generate videos",
5
5
  "type": "module",
6
6
  "bin": {