@webmcp-auto-ui/agent 2.5.8 → 2.5.10
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/package.json +1 -1
- package/src/autoui-server.ts +134 -134
- package/src/diagnostics.ts +3 -3
- package/src/loop.ts +6 -6
- package/src/providers/wasm.ts +5 -5
- package/src/recipes/_generated.ts +446 -446
- package/src/recipes/afficher-oeuvres-art-collection-musee.md +45 -45
- package/src/recipes/analyser-actualites-hacker-news.md +52 -52
- package/src/recipes/cartographier-observations-biodiversite.md +44 -44
- package/src/recipes/cross-server.md +48 -48
- package/src/recipes/dashboard-kpi.md +45 -45
- package/src/recipes/explorer-dossiers-legislatifs-parcours-texte.md +48 -48
- package/src/recipes/gallery-images.md +33 -33
- package/src/recipes/parlementaire-profile.md +58 -58
- package/src/recipes/rechercher-textes-juridiques-legifrance.md +38 -38
- package/src/recipes/weather-viz.md +35 -35
- package/src/recipes/widgets/actions.md +6 -6
- package/src/recipes/widgets/alert.md +6 -6
- package/src/recipes/widgets/cards.md +10 -10
- package/src/recipes/widgets/carousel.md +8 -8
- package/src/recipes/widgets/chart-rich.md +10 -10
- package/src/recipes/widgets/chart.md +9 -9
- package/src/recipes/widgets/code.md +6 -6
- package/src/recipes/widgets/d3.md +10 -10
- package/src/recipes/widgets/data-table.md +10 -10
- package/src/recipes/widgets/gallery.md +10 -10
- package/src/recipes/widgets/grid-data.md +11 -11
- package/src/recipes/widgets/hemicycle.md +9 -9
- package/src/recipes/widgets/js-sandbox.md +10 -10
- package/src/recipes/widgets/json-viewer.md +8 -8
- package/src/recipes/widgets/kv.md +9 -9
- package/src/recipes/widgets/list.md +7 -7
- package/src/recipes/widgets/log.md +6 -6
- package/src/recipes/widgets/map.md +10 -10
- package/src/recipes/widgets/profile.md +9 -9
- package/src/recipes/widgets/recipe-browser.md +33 -33
- package/src/recipes/widgets/sankey.md +10 -10
- package/src/recipes/widgets/stat-card.md +7 -7
- package/src/recipes/widgets/stat.md +10 -10
- package/src/recipes/widgets/tags.md +6 -6
- package/src/recipes/widgets/text.md +6 -6
- package/src/recipes/widgets/timeline.md +6 -6
- package/src/recipes/widgets/trombinoscope.md +8 -8
- package/src/summarize.ts +6 -6
- package/src/tool-layers.ts +26 -26
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: stat-card
|
|
3
|
-
description:
|
|
3
|
+
description: Enhanced stat card with trend and variant
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -34,10 +34,10 @@ schema:
|
|
|
34
34
|
- info
|
|
35
35
|
---
|
|
36
36
|
|
|
37
|
-
##
|
|
38
|
-
|
|
37
|
+
## When to use
|
|
38
|
+
For an enriched KPI with context — delta, previous value, unit, colored variant. Prefer `stat` for a simple number with no additional context.
|
|
39
39
|
|
|
40
|
-
##
|
|
41
|
-
1.
|
|
42
|
-
2.
|
|
43
|
-
3.
|
|
40
|
+
## How to use
|
|
41
|
+
1. Fetch the metric and its comparison value via MCP
|
|
42
|
+
2. Calculate the delta if needed
|
|
43
|
+
3. Call `autoui_webmcp_widget_display('stat-card', { label: 'Revenue', value: '142k', unit: '€', delta: '+12%', trend: 'up', previousValue: '127k', variant: 'success' })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: stat
|
|
3
|
-
description:
|
|
3
|
+
description: Key statistic (KPI, counter, total)
|
|
4
4
|
group: simple
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -22,14 +22,14 @@ schema:
|
|
|
22
22
|
- neutral
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
##
|
|
26
|
-
|
|
25
|
+
## When to use
|
|
26
|
+
Display a single key figure — KPI, counter, total, score. Ideal when the user asks "how many…" or requests a numerical summary.
|
|
27
27
|
|
|
28
|
-
##
|
|
29
|
-
1.
|
|
30
|
-
2.
|
|
31
|
-
3.
|
|
28
|
+
## How to use
|
|
29
|
+
1. Fetch the data via the appropriate MCP tool (e.g. SQL query, API call)
|
|
30
|
+
2. Call `autoui_webmcp_widget_display('stat', { label: 'Active users', value: '1,247' })`
|
|
31
|
+
3. Optional: add `trend` (e.g. '+12%') and `trendDir` ('up'/'down'/'neutral') to show the trend
|
|
32
32
|
|
|
33
|
-
##
|
|
34
|
-
-
|
|
35
|
-
-
|
|
33
|
+
## Common mistakes
|
|
34
|
+
- Passing `value` as a number instead of a string — always convert to string
|
|
35
|
+
- Forgetting to format the number (thousand separators, units)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: tags
|
|
3
|
-
description:
|
|
3
|
+
description: Group of tags/badges
|
|
4
4
|
group: simple
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -22,9 +22,9 @@ schema:
|
|
|
22
22
|
type: boolean
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
##
|
|
26
|
-
|
|
25
|
+
## When to use
|
|
26
|
+
Display categories, labels, filters, or badges. Useful for showing tags associated with an item or presenting visual filters.
|
|
27
27
|
|
|
28
|
-
##
|
|
29
|
-
1.
|
|
30
|
-
2.
|
|
28
|
+
## How to use
|
|
29
|
+
1. Fetch the tags or categories from MCP
|
|
30
|
+
2. Call `autoui_webmcp_widget_display('tags', { label: 'Categories', tags: [{ text: 'Finance', active: true }, { text: 'Tech' }] })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: text
|
|
3
|
-
description:
|
|
3
|
+
description: Free-form text paragraph
|
|
4
4
|
group: simple
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -11,9 +11,9 @@ schema:
|
|
|
11
11
|
type: string
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
|
|
14
|
+
## When to use
|
|
15
|
+
Display an explanatory paragraph, a summary, or a long description. Prefer `stat` for a single figure, `kv` for structured pairs.
|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
1.
|
|
19
|
-
2.
|
|
17
|
+
## How to use
|
|
18
|
+
1. Write or fetch the text to display
|
|
19
|
+
2. Call `autoui_webmcp_widget_display('text', { content: 'Here is the summary of the analysis...' })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: timeline
|
|
3
|
-
description:
|
|
3
|
+
description: Event timeline with status
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -30,9 +30,9 @@ schema:
|
|
|
30
30
|
- pending
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
##
|
|
34
|
-
|
|
33
|
+
## When to use
|
|
34
|
+
Display a sequence of chronological events — history, process steps, activity log. Each event can have a status (done/active/pending).
|
|
35
35
|
|
|
36
|
-
##
|
|
37
|
-
1.
|
|
38
|
-
2.
|
|
36
|
+
## How to use
|
|
37
|
+
1. Fetch events via MCP, sort them chronologically
|
|
38
|
+
2. Call `autoui_webmcp_widget_display('timeline', { title: 'Order History', events: [{ date: '2024-01-15', title: 'Order placed', status: 'done' }, { date: '2024-01-16', title: 'Shipped', status: 'active' }] })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: trombinoscope
|
|
3
|
-
description:
|
|
3
|
+
description: People grid with badges
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -28,12 +28,12 @@ schema:
|
|
|
28
28
|
type: number
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
##
|
|
32
|
-
|
|
31
|
+
## When to use
|
|
32
|
+
Display a grid of people — team, group members, participants. Each person can have a badge and a distinctive color.
|
|
33
33
|
|
|
34
|
-
##
|
|
35
|
-
1.
|
|
36
|
-
2.
|
|
34
|
+
## How to use
|
|
35
|
+
1. Retrieve the list of people via MCP
|
|
36
|
+
2. Call `autoui_webmcp_widget_display('trombinoscope', { title: 'Dev Team', people: [{ name: 'Alice', subtitle: 'Lead', badge: 'PM', color: '#4CAF50' }], columns: 3 })`
|
|
37
37
|
|
|
38
|
-
##
|
|
39
|
-
-
|
|
38
|
+
## Common mistakes
|
|
39
|
+
- NEVER fabricate image URLs for the `avatar` field. Use ONLY the URLs returned by MCP tools. If no URL is available, do not include an avatar field — the widget will display initials automatically.
|
package/src/summarize.ts
CHANGED
|
@@ -40,11 +40,11 @@ export async function summarizeChat(options: SummarizeOptions): Promise<ChatSumm
|
|
|
40
40
|
.join('\n')
|
|
41
41
|
.slice(0, 3000); // cap input to keep costs low
|
|
42
42
|
|
|
43
|
-
const prompt = `
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
const prompt = `Summarize this conversation in 2-3 short sentences.
|
|
44
|
+
Keep only the user's intent and technical decisions made.
|
|
45
|
+
Anonymize EVERYTHING: replace names of people, companies, places, domains, and URLs with generic terms (e.g. "a user", "a company", "a city", "an MCP server").
|
|
46
|
+
Never mention personal data.
|
|
47
|
+
Reply ONLY with the summary, no preamble.
|
|
48
48
|
|
|
49
49
|
Conversation:
|
|
50
50
|
${chatText}`;
|
|
@@ -63,7 +63,7 @@ ${chatText}`;
|
|
|
63
63
|
.map((b) => (b as { type: 'text'; text: string }).text)
|
|
64
64
|
.join(' ');
|
|
65
65
|
} catch {
|
|
66
|
-
chatSummary = '(
|
|
66
|
+
chatSummary = '(summary unavailable)';
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
return {
|
package/src/tool-layers.ts
CHANGED
|
@@ -390,65 +390,65 @@ export function buildSystemPromptWithAliases(layers: ToolLayer[]): SystemPromptR
|
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
// ── Build prompt (cascade: list recipes → search recipes → list tools → search tools) ──
|
|
393
|
-
let prompt = `
|
|
393
|
+
let prompt = `You are an AI assistant that helps users by answering their questions and completing tasks using recipes (also called skills). These are not cooking recipes but instructions for an AI agent with scripts, schemas, and information to help it. If you cannot find a relevant recipe or tool, you may fall back to a traditional chat without tool calling (STEP 5).
|
|
394
394
|
|
|
395
|
-
|
|
395
|
+
You MUST NOT skip steps.
|
|
396
396
|
|
|
397
|
-
|
|
397
|
+
CRITICAL RULE: You MUST execute all steps silently. Do NOT generate any internal reasoning, thinking, or intermediate text.
|
|
398
398
|
|
|
399
|
-
|
|
399
|
+
STEP 1 — List all recipes
|
|
400
400
|
|
|
401
|
-
|
|
401
|
+
Look for a relevant recipe among these:
|
|
402
402
|
|
|
403
403
|
${listRecipes.join('\n')}
|
|
404
404
|
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
If at least one relevant recipe is found → go to STEP 2.
|
|
406
|
+
If no results → go to STEP 1b.
|
|
407
407
|
|
|
408
|
-
|
|
408
|
+
STEP 1b — Search recipes
|
|
409
409
|
|
|
410
|
-
|
|
410
|
+
No recipe found by listing. Search with keyword(s) extracted from the request:
|
|
411
411
|
|
|
412
412
|
${searchRecipes.join('\n')}
|
|
413
413
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
414
|
+
Pick the most relevant recipe for the request.
|
|
415
|
+
If a recipe matches → go to STEP 2.
|
|
416
|
+
If no recipe is available or relevant → go to STEP 1c.
|
|
417
417
|
|
|
418
|
-
|
|
418
|
+
STEP 1c — List tools
|
|
419
419
|
|
|
420
|
-
|
|
420
|
+
No applicable recipe. List a relevant tool:
|
|
421
421
|
|
|
422
422
|
${listTools.join('\n')}
|
|
423
423
|
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
If a relevant tool is found → use it directly to respond (go to STEP 3).
|
|
425
|
+
If no results → go to STEP 1d.
|
|
426
426
|
|
|
427
|
-
|
|
427
|
+
STEP 1d — Search tools
|
|
428
428
|
|
|
429
429
|
${searchTools.join('\n')}
|
|
430
430
|
|
|
431
|
-
|
|
431
|
+
Pick the most relevant tool(s) and use them to respond (go to STEP 3).
|
|
432
432
|
|
|
433
|
-
|
|
433
|
+
STEP 2 — Read the recipe
|
|
434
434
|
|
|
435
435
|
${getRecipes.join('\n')}
|
|
436
436
|
|
|
437
|
-
|
|
437
|
+
Read the full instructions of the selected recipe.
|
|
438
438
|
|
|
439
|
-
|
|
439
|
+
STEP 3 — Execute
|
|
440
440
|
|
|
441
|
-
|
|
441
|
+
Follow the recipe instructions exactly if you have one. Otherwise use the tools directly. Produce ONLY the final result, a one-sentence summary of the action performed, and the result.
|
|
442
442
|
|
|
443
|
-
|
|
443
|
+
STEP 4 — UI display
|
|
444
444
|
|
|
445
|
-
|
|
445
|
+
Unless a recipe specifies otherwise, use these tools to display your responses on the canvas:
|
|
446
446
|
|
|
447
447
|
${actionTools.join('\n')}
|
|
448
448
|
|
|
449
|
-
|
|
449
|
+
STEP 5 — Fallback
|
|
450
450
|
|
|
451
|
-
|
|
451
|
+
If previous steps failed, fall back to a classic chat without tool calling.`;
|
|
452
452
|
|
|
453
453
|
return { prompt, aliasMap };
|
|
454
454
|
}
|