makaron-cli 0.17.17 → 0.17.18

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.17",
3
+ "version": "0.17.18",
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.17",
3
+ "version": "0.17.18",
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
@@ -624,11 +624,12 @@ Admin commands require an API key with admin privileges. Ask your admin to run `
624
624
 
625
625
  ### Add credits to a user
626
626
 
627
- Use either the account email address or the Supabase user UUID. Credits must be a positive integer.
627
+ Use the account email address, Supabase user UUID, or full active API key. Credits are added to the owning account (shared by its API keys), and must be a positive integer. Keep `MAKARON_API_KEY` set to your administrator credential; the positional API key identifies the recipient. Full recipient keys are redacted from command output.
628
628
 
629
629
  ```bash
630
630
  npx makaron-cli admin add-credits user@example.com 1000
631
631
  npx makaron-cli admin add-credits <user-id> 1000 --json
632
+ npx makaron-cli admin add-credits "$RECIPIENT_API_KEY" 1000 --json
632
633
  ```
633
634
 
634
635
  ### List all marketplace skills
package/bin/makaron.mjs CHANGED
@@ -2425,7 +2425,7 @@ Not sure which built-in skill to use? Start with:
2425
2425
  else if (subtopic === 'skill-categories') console.log('Usage: makaron admin skill-categories [--json|add|update|delete] ...');
2426
2426
  else if (subtopic === 'upload') console.log('Usage: makaron admin upload <local-file> <storage-path>');
2427
2427
  else if (subtopic === 'fetch-skill') console.log('Usage: makaron admin fetch-skill <share-code|url>');
2428
- else if (subtopic === 'add-credits') console.log('Usage: makaron admin add-credits <email-or-user-id> <credits> [--json]');
2428
+ else if (subtopic === 'add-credits') console.log('Usage: makaron admin add-credits <email-or-user-id-or-api-key> <credits> [--json]');
2429
2429
  else if (subtopic === 'set-admin') console.log('Usage: makaron admin set-admin <email>');
2430
2430
  else console.log(`Admin commands:
2431
2431
  admin skills List all marketplace skills
@@ -2438,7 +2438,7 @@ Not sure which built-in skill to use? Start with:
2438
2438
  admin skill-categories delete <id> Delete a category
2439
2439
  admin upload <file> <storage-path> Upload file to Storage
2440
2440
  admin fetch-skill <code|url> Download skill from share link
2441
- admin add-credits <user> <credits> Add credits by email or user ID
2441
+ admin add-credits <user> <credits> Add credits by email, user ID or API key
2442
2442
  admin set-admin <email> Grant admin access to a user
2443
2443
  `);
2444
2444
  } else if (topic === 'register') {
@@ -3817,17 +3817,25 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
3817
3817
  const user = args[2]?.trim();
3818
3818
  const credits = Number(args[3]);
3819
3819
  if (!user || !Number.isSafeInteger(credits) || credits <= 0) {
3820
- console.error('Usage: makaron admin add-credits <email-or-user-id> <credits> [--json]');
3820
+ console.error('Usage: makaron admin add-credits <email-or-user-id-or-api-key> <credits> [--json]');
3821
3821
  console.error('Credits must be a positive integer.');
3822
3822
  process.exit(1);
3823
3823
  }
3824
3824
 
3825
+ const isApiKey = user.startsWith('mk_live_');
3825
3826
  const res = await fetch(`${baseUrl}/api/admin/add-credits`, {
3826
3827
  method: 'POST',
3827
3828
  headers: { 'Content-Type': 'application/json', ...headers },
3828
- body: JSON.stringify({ email: user, credits }),
3829
+ body: JSON.stringify({ ...(isApiKey ? { apiKey: user } : { email: user }), credits }),
3829
3830
  });
3830
- const data = await res.json().catch(() => null);
3831
+ const responseText = await res.text();
3832
+ // Never echo the target credential, even if an older server includes it in an error.
3833
+ let data;
3834
+ try {
3835
+ data = JSON.parse(responseText, (_key, value) =>
3836
+ isApiKey && typeof value === 'string' ? value.replaceAll(user, '[redacted API key]') : value);
3837
+ }
3838
+ catch { data = null; }
3831
3839
  if (!res.ok) {
3832
3840
  console.error(`Error ${res.status}:`, data?.error || 'Failed to add credits');
3833
3841
  process.exit(1);
@@ -3835,7 +3843,7 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
3835
3843
  if (args.includes('--json')) {
3836
3844
  console.log(JSON.stringify(data));
3837
3845
  } else {
3838
- console.log(`✅ Added ${credits} credits to ${user}. New balance: ${data.newBalance}`);
3846
+ console.log(`✅ Added ${credits} credits to ${isApiKey ? data.userId : user}. New balance: ${data.newBalance}`);
3839
3847
  }
3840
3848
 
3841
3849
  } else {
@@ -3850,7 +3858,7 @@ if (!command || command === '--help' || command === '-h' || command === 'help')
3850
3858
  admin skill-categories delete <id> Delete a category
3851
3859
  admin upload <file> <storage-path> Upload file to Storage
3852
3860
  admin fetch-skill <code|url> Download skill from share link
3853
- admin add-credits <user> <credits> Add credits by email or user ID
3861
+ admin add-credits <user> <credits> Add credits by email, user ID or API key
3854
3862
  admin set-admin <email> Grant admin access to a user
3855
3863
  `);
3856
3864
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makaron-cli",
3
- "version": "0.17.17",
3
+ "version": "0.17.18",
4
4
  "description": "Talk to Makaron Agent from the terminal — create projects, edit images, generate videos",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -196,7 +196,7 @@ npx makaron-cli chat --project auto \
196
196
 
197
197
  `--skill` accepts an installed skill name, a marketplace UUID, or a unique marketplace label. Marketplace search matches every localized title, every localized default prompt, and category ids. If a marketplace skill is matched, the CLI installs or reuses it and sends `[Active skill: <installed-skill-name>]` to Makaron Agent. Do not call admin skill commands for ordinary users. There is intentionally no user-facing CLI delete command for marketplace skills.
198
198
 
199
- For an explicitly authorized administrator, `admin add-credits <email-or-user-id> <positive-integer> [--json]` adds credits to a user. Marketplace administrators can use `admin skills` to see category assignment and 4-locale title/prompt completeness, while `admin skill-categories` supports list/add/update/delete. New skills must include `en`, `zh`, `zh-Hant`, and `ja` in both `labels` and `prompts`, plus at least one existing `categories` id. Partial localized updates are safely merged server-side.
199
+ For an explicitly authorized administrator, `admin add-credits <email-or-user-id-or-api-key> <positive-integer> [--json]` adds credits to the owning account. A full active recipient API key can identify the account; keep `MAKARON_API_KEY` set to the administrator credential. Never include full keys in messages or logs. Marketplace administrators can use `admin skills` to see category assignment and 4-locale title/prompt completeness, while `admin skill-categories` supports list/add/update/delete. New skills must include `en`, `zh`, `zh-Hant`, and `ja` in both `labels` and `prompts`, plus at least one existing `categories` id. Partial localized updates are safely merged server-side.
200
200
 
201
201
  ### With additional images (existing project)
202
202