@kolbo/mcp 1.93.7 → 1.94.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/README.md CHANGED
@@ -324,7 +324,7 @@ Requires DaVinci Resolve Studio with the Kolbo plugin open (Workspace → Workfl
324
324
  | `create_moodboard` / `update_moodboard` / `delete_moodboard` | Build/edit moodboards from image URLs (AI style analysis → master prompt) |
325
325
  | `clone_voice` / `import_elevenlabs_voice` / `delete_voice` | Custom voices: clone from an audio sample, import by ElevenLabs ID, delete |
326
326
  | `trim_video` | Frame-accurate server-side trim of a Kolbo-hosted video (async job, tool waits) |
327
- | `check_credits` | Check credit balance |
327
+ | `check_credits` | Check credit balance; widget hosts show total and plan, credit-pack, and redemption breakdown, while text hosts retain the plain-text response |
328
328
  | `get_generation_status` | Check one or many generations (`generation_ids`); `wait=true` blocks server-side until done — replaces client polling loops |
329
329
 
330
330
  ## Environment Variables
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolbo/mcp",
3
- "version": "1.93.7",
3
+ "version": "1.94.0",
4
4
  "description": "Kolbo AI MCP Server - Generate images, videos, music, speech, and sound effects from Claude Code",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/apps/index.js CHANGED
@@ -25,6 +25,7 @@ const { fontUploadWidgetHtml } = require('./widgets/fontUpload');
25
25
  const { listWidgetHtml } = require('./widgets/list');
26
26
  const { HOST_MAP } = require('../cdn');
27
27
  const { plansWidgetHtml } = require('./widgets/plans');
28
+ const { creditsWidgetHtml } = require('./widgets/credits');
28
29
  const { ResourceTemplate } = require('@modelcontextprotocol/sdk/server/mcp.js');
29
30
  const { McpError, ErrorCode } = require('@modelcontextprotocol/sdk/types.js');
30
31
 
@@ -36,7 +37,8 @@ const UI = {
36
37
  upload: 'ui://kolbo/upload.html',
37
38
  fontUpload: 'ui://kolbo/font-upload.html',
38
39
  list: 'ui://kolbo/list.html',
39
- plans: 'ui://kolbo/plans.html',
40
+ plans: 'ui://kolbo/plans.html',
41
+ credits: 'ui://kolbo/credits.html',
40
42
  };
41
43
 
42
44
  const WIDGET_BUILDERS = {
@@ -47,7 +49,8 @@ const WIDGET_BUILDERS = {
47
49
  [UI.upload]: uploadWidgetHtml,
48
50
  [UI.fontUpload]: fontUploadWidgetHtml,
49
51
  [UI.list]: listWidgetHtml,
50
- [UI.plans]: plansWidgetHtml,
52
+ [UI.plans]: plansWidgetHtml,
53
+ [UI.credits]: creditsWidgetHtml,
51
54
  };
52
55
 
53
56
  // Widgets are pure functions of source — build once per process.
@@ -169,7 +172,8 @@ function registerApps(server) {
169
172
  [UI.upload, 'Kolbo Upload Widget'],
170
173
  [UI.fontUpload, 'Kolbo Font Upload Widget'],
171
174
  [UI.list, 'Kolbo List Widget'],
172
- [UI.plans, 'Kolbo Plans Widget'],
175
+ [UI.plans, 'Kolbo Plans Widget'],
176
+ [UI.credits, 'Kolbo Credit Balance Widget'],
173
177
  ]) {
174
178
  for (const u of [versionedUri(uri), uri]) {
175
179
  registerAppResource(
@@ -770,7 +774,8 @@ const TOOL_WIDGETS = {
770
774
  list_docs: UI.list,
771
775
  list_media_folders: UI.list,
772
776
  list_visual_dna_folders: UI.list,
773
- show_plans: UI.plans,
777
+ show_plans: UI.plans,
778
+ check_credits: UI.credits,
774
779
  list_project_assets: UI.list,
775
780
  };
776
781
 
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ const { widgetPage } = require('../html');
4
+
5
+ const BODY = `
6
+ <style>
7
+ #loading[hidden], #balance[hidden], #error[hidden] { display: none !important; }
8
+ .k-credit-total { font-size: clamp(30px, 8vw, 46px); font-weight: 600; letter-spacing: -1.5px; line-height: 1.2; overflow-wrap: anywhere; }
9
+ .k-credit-label { color: var(--text-muted); font-size: 12px; margin-top: 6px; }
10
+ .k-credit-breakdown { margin: 22px 0 0; padding: 0; }
11
+ .k-credit-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--border); font-size: 13px; }
12
+ .k-credit-row dt { color: var(--text-muted); }
13
+ .k-credit-row dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
14
+ </style>
15
+ <div class="k-card">
16
+ <div class="k-head"><span class="k-logo" id="logo"></span><span class="k-title">Credit balance</span></div>
17
+ <div class="k-body" aria-live="polite">
18
+ <div id="loading" class="k-skel" style="height:160px" aria-label="Loading credit balance"></div>
19
+ <div id="balance" hidden>
20
+ <div class="k-credit-total" id="total"></div>
21
+ <div class="k-credit-label">Available credits</div>
22
+ <dl class="k-credit-breakdown">
23
+ <div class="k-credit-row"><dt>Plan credits</dt><dd id="plan"></dd></div>
24
+ <div class="k-credit-row"><dt>Credit pack</dt><dd id="pack"></dd></div>
25
+ <div class="k-credit-row"><dt>Redemption</dt><dd id="redemption"></dd></div>
26
+ </dl>
27
+ <div class="k-credit-label">Balance at time of check</div>
28
+ </div>
29
+ <div id="error" class="k-error" hidden>Credit balance unavailable. Please check again.</div>
30
+ </div>
31
+ </div>`;
32
+
33
+ const SCRIPT = `
34
+ el('logo').innerHTML = KOLBO_LOGO + '<span>Kolbo</span>';
35
+ function amount(value) {
36
+ if (value == null || value === '' || !Number.isFinite(Number(value))) return '\u2014';
37
+ return Number(value).toLocaleString('en-US', { maximumFractionDigits: 8 });
38
+ }
39
+ function render(result) {
40
+ var sc = result.structuredContent || structured(result);
41
+ var credits = sc && sc.credits;
42
+ el('loading').hidden = true;
43
+ el('error').hidden = !!credits && !result.isError;
44
+ el('balance').hidden = !credits || !!result.isError;
45
+ if (credits && !result.isError) {
46
+ el('total').textContent = amount(credits.total);
47
+ el('plan').textContent = amount(credits.plan_credits);
48
+ el('pack').textContent = amount(credits.credit_pack);
49
+ el('redemption').textContent = amount(credits.redemption);
50
+ }
51
+ window.kolbo.notifySize();
52
+ }
53
+ window.kolbo.onToolResult(render);
54
+ window.kolbo.ready(function (ctx) {
55
+ if (ctx && ctx.toolInfo && ctx.toolInfo.result) render(ctx.toolInfo.result);
56
+ });
57
+ `;
58
+
59
+ function creditsWidgetHtml() {
60
+ return widgetPage({ title: 'Kolbo Credit Balance', body: BODY, script: SCRIPT });
61
+ }
62
+
63
+ module.exports = { creditsWidgetHtml };
@@ -440,12 +440,11 @@ function registerModelTools(server, client, options = {}) {
440
440
  async () => {
441
441
  const result = await client.get('/v1/account/credits');
442
442
 
443
- return {
444
- content: [{
445
- type: 'text',
446
- text: `Credit Balance:\n- Total: ${result.credits.total}\n- Plan credits: ${result.credits.plan_credits}\n- Credit pack: ${result.credits.credit_pack}\n- Redemption: ${result.credits.redemption}`
447
- }]
448
- };
443
+ const text = `Credit Balance:\n- Total: ${result.credits.total}\n- Plan credits: ${result.credits.plan_credits}\n- Credit pack: ${result.credits.credit_pack}\n- Redemption: ${result.credits.redemption}`;
444
+ return ui() ? uiResult(UI.credits, text, {
445
+ widget: 'credits',
446
+ credits: result.credits,
447
+ }) : { content: [{ type: 'text', text }] };
449
448
  }
450
449
  );
451
450