makaron-cli 0.17.3 → 0.17.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.17.3",
3
+ "version": "0.17.4",
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.3",
3
+ "version": "0.17.4",
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
@@ -107,7 +107,7 @@ npx makaron-cli chat --project auto --image photo.jpg --json -b "make it cinemat
107
107
  npx makaron-cli chat --project auto --image img1.jpg --image img2.jpg --json -b "combine these"
108
108
  ```
109
109
 
110
- `chat` routes image and video models automatically, but you may select the Agent LLM with `--agent-model`. Accepted values are `auto`, the base model IDs (`gpt-6-luna`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-5.6-terra`, `gpt-5.6-sol`, `gpt-5.6-luna`, `grok-4.6`, `deepseek-v4-pro`, `deepseek-flash`), and the personal-plan routes (`gpt-6-luna-codex-subscription`, `gpt-6.1-sol-codex-subscription`, `gpt-6-sol-codex-subscription`, `gpt-5.6-terra-codex-subscription`, `gpt-5.6-sol-codex-subscription`, `gpt-5.6-luna-codex-subscription`, `grok-4.6-grok-subscription`). `auto` resolves to GPT-6 Luna through the Codex subscription for eligible accounts (including admins) and through Azure API otherwise. Base GPT-5.6, GPT-6 and GPT-6.1 IDs select Azure API and base `grok-4.6` selects OpenRouter API; the suffixed IDs explicitly request the corresponding personal plan where authorized. This flag changes only the reasoning/tool-calling Agent LLM.
110
+ `chat` routes image and video models automatically, but you may select the Agent LLM with `--agent-model`. Accepted values are `auto`, the base model IDs (`gpt-6-luna`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-5.6-terra`, `gpt-5.6-sol`, `gpt-5.6-luna`, `grok-4.6`, `deepseek-v4-pro`, `deepseek-flash`), and the personal-plan routes (`gpt-6-luna-codex-subscription`, `gpt-6.1-sol-codex-subscription`, `gpt-6-sol-codex-subscription`, `gpt-5.6-terra-codex-subscription`, `gpt-5.6-sol-codex-subscription`, `gpt-5.6-luna-codex-subscription`, `grok-4.6-grok-subscription`). `auto` defaults to DeepSeek Flash with native vision, following the server-configured Agent model. When that default is a GPT model, eligible accounts (including admins) can use the Codex subscription; an explicitly selected model or personal-plan route is preserved. Base GPT-5.6, GPT-6 and GPT-6.1 IDs select Azure API and base `grok-4.6` selects OpenRouter API; the suffixed IDs explicitly request the corresponding personal plan where authorized. This flag changes only the reasoning/tool-calling Agent LLM.
111
111
 
112
112
  ```bash
113
113
  # Explicit lower-cost Agent LLM for a controlled comparison
@@ -382,6 +382,8 @@ npx makaron-cli responses get <runId> --pick output # full output arr
382
382
  npx makaron-cli responses get <runId> --pick status
383
383
  npx makaron-cli responses get <runId> --pick credits_used # net credits this run cost
384
384
  npx makaron-cli responses get <runId> --pick usage # per-tool credit breakdown
385
+ npx makaron-cli responses get <runId> --events --json # timestamped raw tool/event evidence, including active runs
386
+ npx makaron-cli responses get <runId> --events --after 1000 --json # next page after the last returned event sequence
385
387
  ```
386
388
 
387
389
  ## Fallback: Direct tool calls (no project context)
@@ -731,3 +733,5 @@ npx makaron-cli admin fetch-skill https://www.makaron.app/s/4c4cbd57
731
733
  FAL video models: **fal H3 Turbo** uses `minimax-h3-max` for single-start-frame I2V/T2V. **FAL H3 Max** uses the new selector `fal-h3-max`: native T2V or image/video/audio reference-to-video, default 768p, optional 480p/1080p, integer 5–15s; at most 9 images / 3 videos / 3 audios / 12 total. Reference video/audio each 2–15s and each modality totals at most 15s. Source-video modifications use generation with feature references, not typed edit/extend. Reference input tokens are billed in addition to output video; query current pricing.
732
734
 
733
735
  The legacy `openai` image-model parameter now resolves to GPT Image 2.5 Flare.
736
+
737
+ `chat --stream` follows the original durable run when its live connection ends before completion. It does not submit another generation; already printed reply text is not replayed.
package/bin/makaron.mjs CHANGED
@@ -520,12 +520,12 @@ Options:
520
520
  grok-4.6-grok-subscription personal-plan route.
521
521
  --background, -b Submit and print a runId.
522
522
  --json Output structured JSON (includes per-run "usage" credits).
523
- --stream Legacy live SSE stream.
523
+ --stream Live SSE; follows the same run after handoff.
524
524
  --help, -h Show this help.
525
525
 
526
- Agent LLM defaults to auto (GPT-6 Luna through the Codex subscription for
527
- eligible accounts, including admins, or Azure API otherwise). GPT-5.6 and GPT-6
528
- base ids select Azure API; append -codex-subscription to
526
+ Agent LLM defaults to auto, following the server-configured Agent model.
527
+ When that default is a GPT model, eligible accounts can use the Codex plan.
528
+ GPT-5.6 and GPT-6 base ids select Azure API; append -codex-subscription to
529
529
  select the personal plan explicitly. Base grok-4.6 selects OpenRouter API;
530
530
  grok-4.6-grok-subscription selects the personal SuperGrok plan. Image/video
531
531
  model routing stays automatic in chat.
@@ -643,9 +643,15 @@ async function streamAgent(baseUrl, headers, projectId, prompt, opts = {}) {
643
643
  process.on('SIGINT', sigintHandler);
644
644
 
645
645
  const results = { images: [], designs: [], animationTasks: [], musicTasks: [], text: '' };
646
+ let completed = false;
646
647
 
647
648
  while (true) {
648
- const { done, value } = await reader.read();
649
+ let chunk;
650
+ try { chunk = await reader.read(); } catch (error) {
651
+ if (controller.signal.aborted) throw error;
652
+ break; // The durable run can continue after the SSE connection closes.
653
+ }
654
+ const { done, value } = chunk;
649
655
  if (done) break;
650
656
 
651
657
  buffer += decoder.decode(value, { stream: true });
@@ -711,14 +717,15 @@ async function streamAgent(baseUrl, headers, projectId, prompt, opts = {}) {
711
717
  break;
712
718
 
713
719
  case 'done':
720
+ completed = true;
714
721
  break;
715
722
  }
716
723
  }
717
724
  }
718
725
 
719
726
  process.removeListener('SIGINT', sigintHandler);
720
- if (results.text) process.stdout.write('\n');
721
- return { runId, results };
727
+ if (completed && results.text) process.stdout.write('\n');
728
+ return { runId, results, completed };
722
729
  }
723
730
 
724
731
  // ─── Run + Poll (non-blocking) ──────────────────────────────────────────────
@@ -759,7 +766,9 @@ async function pollRun(baseUrl, headers, runId, opts = {}) {
759
766
  if (background) return;
760
767
 
761
768
  let lastSeq = -1;
762
- let printedText = '';
769
+ let printedText = opts.alreadyPrintedText || '';
770
+ let replayPrefix = printedText;
771
+ let replayBuffer = '';
763
772
  const start = Date.now();
764
773
 
765
774
  while (true) {
@@ -790,7 +799,15 @@ async function pollRun(baseUrl, headers, runId, opts = {}) {
790
799
  if (json) continue; // skip printing in json mode
791
800
  switch (ev.type) {
792
801
  case 'content': {
793
- const newText = ev.data?.text || '';
802
+ let newText = ev.data?.text || '';
803
+ if (replayPrefix) {
804
+ replayBuffer += newText;
805
+ if (replayPrefix.startsWith(replayBuffer)) break;
806
+ newText = replayBuffer.startsWith(replayPrefix)
807
+ ? replayBuffer.slice(replayPrefix.length) : replayBuffer;
808
+ replayPrefix = '';
809
+ replayBuffer = '';
810
+ }
794
811
  process.stdout.write(newText);
795
812
  printedText += newText;
796
813
  break;
@@ -876,7 +893,8 @@ async function pollRun(baseUrl, headers, runId, opts = {}) {
876
893
  printRunUsage(data.usage);
877
894
  }
878
895
 
879
- if (data.status === 'failed' || data.status === 'aborted') process.exit(1);
896
+ // Let piped JSON drain before exiting; immediate exit truncates long traces.
897
+ if (data.status === 'failed' || data.status === 'aborted') process.exitCode = 1;
880
898
  return data;
881
899
  }
882
900
  }
@@ -2167,7 +2185,7 @@ function printHelp(topic, subtopic) {
2167
2185
  } else if (topic === 'chat') {
2168
2186
  printChatHelp();
2169
2187
  } else if (topic === 'responses' || topic === 'run') {
2170
- if (subtopic === 'get') console.log('Usage: makaron responses get <runId> [--wait] [--json] [--pick <field>] [--materialize|--export-compositions] [--publish-exports]');
2188
+ if (subtopic === 'get') console.log('Usage: makaron responses get <runId> [--wait] [--json] [--events] [--after <seq>] [--pick <field>] [--materialize|--export-compositions] [--publish-exports]');
2171
2189
  else if (subtopic === 'watch') console.log('Usage: makaron responses watch <runId> [--jsonl] [--interval <ms>]');
2172
2190
  else if (subtopic === 'list') console.log('Usage: makaron responses list --project <id>');
2173
2191
  else console.log(`Responses commands:
@@ -2675,18 +2693,27 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
2675
2693
 
2676
2694
  if (useStream) {
2677
2695
  // Legacy SSE mode
2678
- const { runId: streamRunId, results } = await streamAgent(baseUrl, headers, projectId, finalPrompt, {
2696
+ const { runId: streamRunId, results, completed } = await streamAgent(baseUrl, headers, projectId, finalPrompt, {
2679
2697
  agentModel,
2680
2698
  uploadedVideoCount: uploadedTurnVideoCount,
2681
2699
  turnMediaCount: uploadedTurnMediaCount,
2682
2700
  });
2683
- process.stderr.write('\n━━━ Results ━━━\n');
2684
- for (const img of results.images) process.stderr.write(`🖼️ Image: ${img.imageUrl}\n`);
2685
- for (const d of results.designs) process.stderr.write(`🎨 ${d.desc}\n`);
2686
- process.stderr.write(`🔗 ${APP_URL}/projects/${projectId}\n`);
2687
- printRunUsage(await fetchRunUsage(baseUrl, headers, streamRunId));
2688
- for (const task of results.animationTasks) await pollVideo(baseUrl, headers, task.taskId, task.snapshotId);
2689
- for (const task of results.musicTasks) await pollMusic(baseUrl, headers, task.taskId);
2701
+ if (!completed) {
2702
+ if (!streamRunId) {
2703
+ console.error('Stream ended without completion or a run ID; unable to follow the original run.');
2704
+ process.exit(1);
2705
+ }
2706
+ process.stderr.write(`\n↪ Following the same run after stream handoff: ${streamRunId}\n`);
2707
+ await pollRun(baseUrl, headers, streamRunId, { alreadyPrintedText: results.text });
2708
+ } else {
2709
+ process.stderr.write('\n━━━ Results ━━━\n');
2710
+ for (const img of results.images) process.stderr.write(`🖼️ Image: ${img.imageUrl}\n`);
2711
+ for (const d of results.designs) process.stderr.write(`🎨 ${d.desc}\n`);
2712
+ process.stderr.write(`🔗 ${APP_URL}/projects/${projectId}\n`);
2713
+ printRunUsage(await fetchRunUsage(baseUrl, headers, streamRunId));
2714
+ for (const task of results.animationTasks) await pollVideo(baseUrl, headers, task.taskId, task.snapshotId);
2715
+ for (const task of results.musicTasks) await pollMusic(baseUrl, headers, task.taskId);
2716
+ }
2690
2717
  } else {
2691
2718
  // Default: fire-and-forget + poll
2692
2719
  const { runId } = await submitRun(baseUrl, headers, projectId, finalPrompt, {
@@ -2730,10 +2757,16 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
2730
2757
  if (sub === 'get') {
2731
2758
  const runId = args[2];
2732
2759
  if (!runId) { console.error('Usage: makaron responses get <runId> [--wait] [--json] [--pick <field>] [--materialize|--export-compositions]'); process.exit(1); }
2733
- let wait = false, jsonOutput = false, pick = null, exportCompositions = false, publishExports = false;
2760
+ let wait = false, jsonOutput = false, pick = null, exportCompositions = false, publishExports = false, includeEvents = false, afterSeq = null;
2734
2761
  for (let i = 3; i < args.length; i++) {
2735
2762
  if (args[i] === '--wait') wait = true;
2736
2763
  if (args[i] === '--json') jsonOutput = true;
2764
+ if (args[i] === '--events') includeEvents = true;
2765
+ if (args[i] === '--after' && args[i + 1]) {
2766
+ afterSeq = Number(args[++i]);
2767
+ if (!Number.isSafeInteger(afterSeq) || afterSeq < 0) throw new Error('--after requires a non-negative integer sequence');
2768
+ includeEvents = true;
2769
+ }
2737
2770
  if (args[i] === '--export-compositions') exportCompositions = true;
2738
2771
  if (args[i] === '--materialize') {
2739
2772
  exportCompositions = true;
@@ -2757,7 +2790,8 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
2757
2790
  console.log(JSON.stringify(data, null, 2));
2758
2791
  }
2759
2792
  } else {
2760
- const res = await fetch(`${baseUrl}/api/agent/run/${runId}`, { headers });
2793
+ const eventQuery = includeEvents ? `?events=true${afterSeq !== null ? `&after=${afterSeq}` : ''}` : '';
2794
+ const res = await fetch(`${baseUrl}/api/agent/run/${runId}${eventQuery}`, { headers });
2761
2795
  if (!res.ok) { process.stderr.write(`Error ${res.status}: ${await res.text()}\n`); process.exit(1); }
2762
2796
  let data = await res.json();
2763
2797
  data = await reconcileRunWithProjectMedia(baseUrl, headers, data);
@@ -2770,7 +2804,7 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
2770
2804
  } else {
2771
2805
  console.log(JSON.stringify(data, null, 2));
2772
2806
  }
2773
- if (data.status === 'failed' || data.status === 'aborted') process.exit(1);
2807
+ if (data.status === 'failed' || data.status === 'aborted') process.exitCode = 1;
2774
2808
  }
2775
2809
 
2776
2810
  } else if (sub === 'watch') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.17.3",
3
+ "version": "0.17.4",
4
4
  "description": "Talk to Makaron Agent from the terminal — create projects, edit images, generate videos",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -111,7 +111,7 @@ npx makaron-cli chat --project auto --image photo.jpg --json -b "make it cinemat
111
111
  npx makaron-cli chat --project auto --image img1.jpg --image img2.jpg --json -b "combine these"
112
112
  ```
113
113
 
114
- `chat` routes image and video models automatically. Use `--agent-model` only when the user explicitly asks to select or compare the reasoning/tool-calling Agent LLM. Accepted values are `auto`, the base model IDs (`gpt-6-luna`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-5.6-terra`, `gpt-5.6-sol`, `gpt-5.6-luna`, `grok-4.6`, `deepseek-v4-pro`, `deepseek-flash`), and the personal-plan routes (`gpt-6-luna-codex-subscription`, `gpt-6.1-sol-codex-subscription`, `gpt-6-sol-codex-subscription`, `gpt-5.6-terra-codex-subscription`, `gpt-5.6-sol-codex-subscription`, `gpt-5.6-luna-codex-subscription`). `auto` uses GPT-6 Luna through the Codex subscription for eligible accounts (including admins) and through Azure API otherwise; base GPT-5.6, GPT-6 and GPT-6.1 IDs select Azure API, while suffixed IDs explicitly request the personal plan where authorized. Never put an image or video model ID in `--agent-model`.
114
+ `chat` routes image and video models automatically. Use `--agent-model` only when the user explicitly asks to select or compare the reasoning/tool-calling Agent LLM. Accepted values are `auto`, the base model IDs (`gpt-6-luna`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-5.6-terra`, `gpt-5.6-sol`, `gpt-5.6-luna`, `grok-4.6`, `deepseek-v4-pro`, `deepseek-flash`), and the personal-plan routes (`gpt-6-luna-codex-subscription`, `gpt-6.1-sol-codex-subscription`, `gpt-6-sol-codex-subscription`, `gpt-5.6-terra-codex-subscription`, `gpt-5.6-sol-codex-subscription`, `gpt-5.6-luna-codex-subscription`). `auto` defaults to DeepSeek Flash with native vision, following the server-configured Agent model; eligible accounts can use the Codex subscription when that default is a GPT model; base GPT-5.6, GPT-6 and GPT-6.1 IDs select Azure API, while suffixed IDs explicitly request the personal plan where authorized. Never put an image or video model ID in `--agent-model`.
115
115
 
116
116
  ```bash
117
117
  npx makaron-cli chat --project auto --agent-model deepseek-v4-pro --json -b "make a 20s badminton video"