@webmcp-auto-ui/ui 2.5.36 → 2.5.38

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.
@@ -6,7 +6,7 @@
6
6
  // Collapsed by default.
7
7
  // ---------------------------------------------------------------------------
8
8
 
9
- import { callToolViaPostMessage } from '@webmcp-auto-ui/core';
9
+ import { canvas } from '@webmcp-auto-ui/sdk/canvas';
10
10
  import { openRecipeViewerModal, openToolViewerModal, type ImportedRecipe } from './import-modal-api.js';
11
11
  import type { NotebookCell, NotebookState, DataServerDescriptor } from './shared.js';
12
12
 
@@ -67,13 +67,22 @@ export function mountLeftPane(
67
67
  serversEl.innerHTML = '<div class="nb-lp-empty">No servers connected.</div>';
68
68
  return;
69
69
  }
70
+ let lastGroup: 'data' | 'webmcp' | null = null;
70
71
  for (const srv of servers) {
72
+ const group: 'data' | 'webmcp' = srv.kind === 'webmcp' ? 'webmcp' : 'data';
73
+ if (group !== lastGroup) {
74
+ const header = document.createElement('div');
75
+ header.className = 'nb-lp-group-header';
76
+ header.textContent = group === 'webmcp' ? 'Widgets' : 'Data';
77
+ serversEl.appendChild(header);
78
+ lastGroup = group;
79
+ }
71
80
  const section = document.createElement('section');
72
81
  section.className = 'nb-lp-srv';
73
82
  section.innerHTML = `
74
83
  <header class="nb-lp-srv-head">
75
84
  <span class="nb-lp-srv-dot"></span>
76
- <span class="nb-lp-srv-name">${escapeHtml(srv.name)}</span>
85
+ <span class="nb-lp-srv-name">${escapeHtml(srv.serverName ?? srv.label ?? srv.name)}</span>
77
86
  </header>
78
87
  <div class="nb-lp-srv-groups">
79
88
  ${srv.recipes?.length ? `
@@ -132,9 +141,13 @@ export function mountLeftPane(
132
141
  if (!imported.body && recipeBodyCache.has(key)) {
133
142
  imported.body = recipeBodyCache.get(key);
134
143
  }
144
+ // Bundled WebMCP servers expose recipe bodies inline — no MCP roundtrip.
145
+ if (!imported.body && srv.kind === 'webmcp') {
146
+ imported.body = `> ⚠ Recipe \`${r.name}\` (server \`${srv.name}\`) has no inline body.`;
147
+ }
135
148
  if (!imported.body) {
136
149
  try {
137
- const res: any = await callToolViaPostMessage(`${srv.name}_get_recipe`, { name: r.name, id: r.name });
150
+ const res: any = await canvas.callTool(srv.name, 'get_recipe', { name: r.name, id: r.name });
138
151
  const text = res?.content?.find?.((c: any) => c.type === 'text')?.text;
139
152
  if (text) {
140
153
  let body = text;
@@ -245,6 +258,13 @@ function injectLeftPaneStyles() {
245
258
  .nb-lp-title { flex: 1; font-weight: 600; font-size: 12px; }
246
259
  .nb-lp-close { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--color-text2, #666); }
247
260
  .nb-lp-servers { overflow-y: auto; padding: 8px 10px 12px; flex: 1; }
261
+ .nb-lp-group-header {
262
+ font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
263
+ color: var(--color-text2, #888); padding: 6px 2px 4px;
264
+ border-bottom: 1px dashed var(--color-border, #e4e4e7);
265
+ margin-bottom: 6px;
266
+ }
267
+ .nb-lp-group-header:not(:first-child) { margin-top: 14px; }
248
268
  .nb-lp-srv { margin-bottom: 10px; }
249
269
  .nb-lp-srv-head {
250
270
  display: flex; align-items: center; gap: 6px;
@@ -23,7 +23,6 @@
23
23
  title?: string;
24
24
  mode?: 'edit' | 'view';
25
25
  autoRun?: boolean;
26
- hideLiveToggle?: boolean;
27
26
  cells?: NotebookCell[];
28
27
  /** MCP servers for SQL execution (array of {name, url}) */
29
28
  servers?: Array<{ name: string; url?: string }>;