@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: chart
|
|
3
|
-
description:
|
|
3
|
+
description: Simple bar chart
|
|
4
4
|
group: simple
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -20,13 +20,13 @@ schema:
|
|
|
20
20
|
maxItems: 2
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
##
|
|
24
|
-
|
|
23
|
+
## When to use
|
|
24
|
+
Use for a quick bar chart with simple categorical data. Prefer `chart-rich` for multi-series charts, line charts, or pie charts.
|
|
25
25
|
|
|
26
|
-
##
|
|
27
|
-
1.
|
|
28
|
-
2.
|
|
29
|
-
3.
|
|
26
|
+
## How to use
|
|
27
|
+
1. Fetch the data via MCP (e.g. counts by category)
|
|
28
|
+
2. Format as an array of `[label, value]` pairs
|
|
29
|
+
3. Call `autoui_webmcp_widget_display('chart', { title: 'Sales by region', bars: [['North', 150], ['South', 230], ['East', 180]] })`
|
|
30
30
|
|
|
31
|
-
##
|
|
32
|
-
-
|
|
31
|
+
## Common mistakes
|
|
32
|
+
- Swapping label and value in pairs — the format is `[string, number]`, not `[number, string]`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: code
|
|
3
|
-
description:
|
|
3
|
+
description: Code block with syntax highlighting
|
|
4
4
|
group: simple
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -13,9 +13,9 @@ schema:
|
|
|
13
13
|
type: string
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
|
|
16
|
+
## When to use
|
|
17
|
+
Display source code, snippets, shell commands, or any monospace-formatted output. Specify `lang` to enable syntax highlighting.
|
|
18
18
|
|
|
19
|
-
##
|
|
20
|
-
1.
|
|
21
|
-
2.
|
|
19
|
+
## How to use
|
|
20
|
+
1. Fetch or generate the code based on the request
|
|
21
|
+
2. Call `autoui_webmcp_widget_display('code', { lang: 'python', content: 'def hello():\n print("Hello")' })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: d3
|
|
3
|
-
description:
|
|
3
|
+
description: D3.js visualization with presets (heatmap, radial, treemap, force)
|
|
4
4
|
group: advanced
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -23,14 +23,14 @@ schema:
|
|
|
23
23
|
type: object
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
##
|
|
27
|
-
|
|
26
|
+
## When to use
|
|
27
|
+
For advanced visualizations not covered by other widgets — hexagonal heatmaps, radial charts, hierarchical treemaps, force graphs. Choose the preset based on the data type.
|
|
28
28
|
|
|
29
|
-
##
|
|
30
|
-
1.
|
|
31
|
-
2.
|
|
32
|
-
3.
|
|
29
|
+
## How to use
|
|
30
|
+
1. Retrieve data via MCP
|
|
31
|
+
2. Choose the appropriate preset: `hex-heatmap` for spatial density, `radial` for cyclical data, `treemap` for hierarchies, `force` for relationship graphs
|
|
32
|
+
3. Call `autoui_webmcp_widget_display('d3', { title: 'Budget breakdown', preset: 'treemap', data: { name: 'Budget', children: [{ name: 'R&D', value: 500 }, { name: 'Marketing', value: 300 }] } })`
|
|
33
33
|
|
|
34
|
-
##
|
|
35
|
-
-
|
|
36
|
-
-
|
|
34
|
+
## Common mistakes
|
|
35
|
+
- The structure of `data` depends on the chosen preset — consult the preset documentation
|
|
36
|
+
- Do not confuse with `chart-rich` which is simpler but covers bar/line/pie
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: data-table
|
|
3
|
-
description:
|
|
3
|
+
description: Sortable data table with configurable columns
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -33,14 +33,14 @@ schema:
|
|
|
33
33
|
type: object
|
|
34
34
|
---
|
|
35
35
|
|
|
36
|
-
##
|
|
37
|
-
|
|
36
|
+
## When to use
|
|
37
|
+
Display tabular data with multiple columns — query results, record lists, inventories. Prefer `kv` for a single entity, `list` for a single column.
|
|
38
38
|
|
|
39
|
-
##
|
|
40
|
-
1.
|
|
41
|
-
2.
|
|
42
|
-
3.
|
|
39
|
+
## How to use
|
|
40
|
+
1. Fetch data via MCP (e.g. SQL result, list of objects)
|
|
41
|
+
2. Optional: define `columns` to control column order and labels
|
|
42
|
+
3. Call `autoui_webmcp_widget_display('data-table', { title: 'Users', columns: [{ key: 'name', label: 'Name' }, { key: 'email', label: 'Email' }], rows: [{ name: 'Alice', email: 'alice@ex.com' }] })`
|
|
43
43
|
|
|
44
|
-
##
|
|
45
|
-
-
|
|
46
|
-
-
|
|
44
|
+
## Common mistakes
|
|
45
|
+
- Forgetting that `rows` is an array of objects (not an array of arrays)
|
|
46
|
+
- Defining `columns.key` values that do not match the keys in the `rows` objects
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: gallery
|
|
3
|
-
description:
|
|
3
|
+
description: Image gallery in grid layout
|
|
4
4
|
group: media
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -26,14 +26,14 @@ schema:
|
|
|
26
26
|
type: number
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
-
##
|
|
30
|
-
|
|
29
|
+
## When to use
|
|
30
|
+
Display a collection of images in a grid — photo gallery, image search results, portfolio. Prefer `carousel` for sequential browsing.
|
|
31
31
|
|
|
32
|
-
##
|
|
33
|
-
1.
|
|
34
|
-
2.
|
|
32
|
+
## How to use
|
|
33
|
+
1. Retrieve image URLs via MCP (never fabricate URLs)
|
|
34
|
+
2. Call `autoui_webmcp_widget_display('gallery', { title: 'Site photos', images: [{ src: 'https://...', alt: 'Main view', caption: 'North facade' }], columns: 3 })`
|
|
35
35
|
|
|
36
|
-
##
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
36
|
+
## Common mistakes
|
|
37
|
+
- NEVER fabricate image URLs — only use those returned by MCP tools
|
|
38
|
+
- STRICTLY FORBIDDEN: placeholder URLs (`via.placeholder.com`, `placehold.co`, `dummyimage.com`, `?text=...`, `example.com/image.jpg`). If no real image is available, do NOT display a gallery — use a `text` or `cards` widget without an image instead
|
|
39
|
+
- Always provide an `alt` for accessibility
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: grid-data
|
|
3
|
-
description:
|
|
3
|
+
description: Data grid with cell highlighting
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -43,15 +43,15 @@ schema:
|
|
|
43
43
|
type: string
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
-
##
|
|
47
|
-
|
|
46
|
+
## When to use
|
|
47
|
+
Display data in a grid with the ability to highlight specific cells — dashboards, comparison matrices, tabular heatmaps. Prefer `data-table` for a classic sortable table.
|
|
48
48
|
|
|
49
|
-
##
|
|
50
|
-
1.
|
|
51
|
-
2.
|
|
52
|
-
3.
|
|
53
|
-
4.
|
|
49
|
+
## How to use
|
|
50
|
+
1. Fetch data via MCP
|
|
51
|
+
2. Structure into rows (arrays) with optional columns
|
|
52
|
+
3. Add `highlights` to draw attention to specific cells
|
|
53
|
+
4. Call `autoui_webmcp_widget_display('grid-data', { title: 'Risk Matrix', columns: [{ key: 'zone', label: 'Zone' }, { key: 'score', label: 'Score' }], rows: [['North', 85], ['South', 42]], highlights: [{ row: 0, col: 1, color: '#f44336' }] })`
|
|
54
54
|
|
|
55
|
-
##
|
|
56
|
-
-
|
|
57
|
-
- `rows`
|
|
55
|
+
## Common mistakes
|
|
56
|
+
- The `row` and `col` indexes in `highlights` are 0-based
|
|
57
|
+
- `rows` is an array of arrays (not objects), unlike `data-table`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: hemicycle
|
|
3
|
-
description:
|
|
3
|
+
description: Parliamentary hemicycle with political groups
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -31,13 +31,13 @@ schema:
|
|
|
31
31
|
type: number
|
|
32
32
|
---
|
|
33
33
|
|
|
34
|
-
##
|
|
35
|
-
|
|
34
|
+
## When to use
|
|
35
|
+
Visualize the composition of a parliamentary assembly or any set distributed into groups with proportions. Ideal for election results and seat distribution.
|
|
36
36
|
|
|
37
|
-
##
|
|
38
|
-
1.
|
|
39
|
-
2.
|
|
37
|
+
## How to use
|
|
38
|
+
1. Fetch composition data via MCP (groups, seat counts, colors)
|
|
39
|
+
2. Call `autoui_webmcp_widget_display('hemicycle', { title: 'National Assembly', groups: [{ id: 'lfi', label: 'LFI', seats: 75, color: '#cc2443' }, { id: 'ren', label: 'Renaissance', seats: 170, color: '#ffeb00' }], totalSeats: 577 })`
|
|
40
40
|
|
|
41
|
-
##
|
|
42
|
-
-
|
|
43
|
-
-
|
|
41
|
+
## Common mistakes
|
|
42
|
+
- Forgetting one of the 4 required fields in each `groups` object (id, label, seats, color are ALL required)
|
|
43
|
+
- Not providing a valid hexadecimal color
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: js-sandbox
|
|
3
|
-
description:
|
|
3
|
+
description: Isolated JavaScript sandbox with HTML/CSS
|
|
4
4
|
group: advanced
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -19,14 +19,14 @@ schema:
|
|
|
19
19
|
type: string
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
|
|
22
|
+
## When to use
|
|
23
|
+
For executing custom JavaScript code in an isolated environment (iframe) — interactive demos, prototypes, custom visualizations, bespoke widgets that no other widget covers.
|
|
24
24
|
|
|
25
|
-
##
|
|
26
|
-
1.
|
|
27
|
-
2.
|
|
25
|
+
## How to use
|
|
26
|
+
1. Write the JS code, and optionally the associated HTML/CSS
|
|
27
|
+
2. Call `autoui_webmcp_widget_display('js-sandbox', { title: 'Interactive demo', code: 'document.getElementById("app").textContent = "Hello!"', html: '<div id="app"></div>', css: '#app { font-size: 24px; }', height: '200px' })`
|
|
28
28
|
|
|
29
|
-
##
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
29
|
+
## Common mistakes
|
|
30
|
+
- The code runs in an isolated iframe — no access to the parent DOM or the app's global variables
|
|
31
|
+
- Always provide `html` if the JS code manipulates the DOM (otherwise there is nothing to display)
|
|
32
|
+
- Do not use this widget when a specialized widget exists (chart-rich, d3, etc.)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: json-viewer
|
|
3
|
-
description:
|
|
3
|
+
description: Interactive JSON viewer with expand/collapse
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -16,12 +16,12 @@ schema:
|
|
|
16
16
|
type: boolean
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
##
|
|
20
|
-
|
|
19
|
+
## When to use
|
|
20
|
+
Display raw JSON data interactively — API responses, configurations, complex data structures. The user can explore the tree by expanding levels.
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
1.
|
|
24
|
-
2.
|
|
22
|
+
## How to use
|
|
23
|
+
1. Fetch JSON data via MCP
|
|
24
|
+
2. Call `autoui_webmcp_widget_display('json-viewer', { title: 'API Response', data: { users: [...] }, maxDepth: 3, expanded: false })`
|
|
25
25
|
|
|
26
|
-
##
|
|
27
|
-
-
|
|
26
|
+
## Common mistakes
|
|
27
|
+
- Passing a JSON string instead of an object — `data` expects an object/array, not a string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: kv
|
|
3
|
-
description:
|
|
3
|
+
description: Key-value pairs (properties, metadata)
|
|
4
4
|
group: simple
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -19,13 +19,13 @@ schema:
|
|
|
19
19
|
maxItems: 2
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
|
|
22
|
+
## When to use
|
|
23
|
+
Display properties or metadata as key-value pairs. Ideal for detail cards, configurations, and structured summaries.
|
|
24
24
|
|
|
25
|
-
##
|
|
26
|
-
1.
|
|
27
|
-
2.
|
|
28
|
-
3.
|
|
25
|
+
## How to use
|
|
26
|
+
1. Fetch the data via MCP (e.g. record details, object properties)
|
|
27
|
+
2. Format as an array of pairs: `[['Name', 'Alice'], ['Email', 'alice@example.com']]`
|
|
28
|
+
3. Call `autoui_webmcp_widget_display('kv', { title: 'User details', rows: [['Name', 'Alice'], ['Email', 'alice@example.com']] })`
|
|
29
29
|
|
|
30
|
-
##
|
|
31
|
-
-
|
|
30
|
+
## Common mistakes
|
|
31
|
+
- Passing an object `{key: value}` instead of an array of pairs `[[key, value]]`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: list
|
|
3
|
-
description:
|
|
3
|
+
description: Ordered list of items
|
|
4
4
|
group: simple
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -15,10 +15,10 @@ schema:
|
|
|
15
15
|
type: string
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
##
|
|
19
|
-
|
|
18
|
+
## When to use
|
|
19
|
+
Display a simple list of text items — search results, steps, names, inventory items. Prefer `data-table` if items have multiple fields.
|
|
20
20
|
|
|
21
|
-
##
|
|
22
|
-
1.
|
|
23
|
-
2.
|
|
24
|
-
3.
|
|
21
|
+
## How to use
|
|
22
|
+
1. Fetch the data via MCP
|
|
23
|
+
2. Extract items as an array of strings
|
|
24
|
+
3. Call `autoui_webmcp_widget_display('list', { title: 'Results', items: ['Item 1', 'Item 2', 'Item 3'] })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: log
|
|
3
|
-
description:
|
|
3
|
+
description: Event log with levels and timestamps
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -31,9 +31,9 @@ schema:
|
|
|
31
31
|
type: string
|
|
32
32
|
---
|
|
33
33
|
|
|
34
|
-
##
|
|
35
|
-
|
|
34
|
+
## When to use
|
|
35
|
+
Display an event log — application logs, audit trail, operation history. Each entry can be color-coded by level (debug/info/warn/error).
|
|
36
36
|
|
|
37
|
-
##
|
|
38
|
-
1.
|
|
39
|
-
2.
|
|
37
|
+
## How to use
|
|
38
|
+
1. Fetch logs via MCP
|
|
39
|
+
2. Call `autoui_webmcp_widget_display('log', { title: 'Server Logs', entries: [{ timestamp: '14:32:01', level: 'error', message: 'Connection refused', source: 'db' }, { timestamp: '14:32:05', level: 'info', message: 'Retry successful', source: 'db' }] })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: map
|
|
3
|
-
description:
|
|
3
|
+
description: Interactive map with markers
|
|
4
4
|
group: advanced
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -36,14 +36,14 @@ schema:
|
|
|
36
36
|
type: string
|
|
37
37
|
---
|
|
38
38
|
|
|
39
|
-
##
|
|
40
|
-
|
|
39
|
+
## When to use
|
|
40
|
+
Display geolocated data — addresses, points of interest, itineraries, coverage areas. Ideal when the user asks "where is..." or "show on a map".
|
|
41
41
|
|
|
42
|
-
##
|
|
43
|
-
1.
|
|
44
|
-
2.
|
|
45
|
-
3.
|
|
42
|
+
## How to use
|
|
43
|
+
1. Retrieve coordinates via MCP (lat/lng)
|
|
44
|
+
2. Set the center and zoom based on the extent of the data
|
|
45
|
+
3. Call `autoui_webmcp_widget_display('map', { title: 'Our offices', center: { lat: 48.8566, lng: 2.3522 }, zoom: 12, markers: [{ lat: 48.8566, lng: 2.3522, label: 'Paris HQ' }] })`
|
|
46
46
|
|
|
47
|
-
##
|
|
48
|
-
-
|
|
49
|
-
-
|
|
47
|
+
## Common mistakes
|
|
48
|
+
- Swapping lat and lng (latitude = North/South, longitude = East/West)
|
|
49
|
+
- Forgetting to center the map on the displayed markers
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: profile
|
|
3
|
-
description:
|
|
3
|
+
description: Profile card with fields and statistics
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -37,13 +37,13 @@ schema:
|
|
|
37
37
|
type: string
|
|
38
38
|
---
|
|
39
39
|
|
|
40
|
-
##
|
|
41
|
-
|
|
40
|
+
## When to use
|
|
41
|
+
Display a profile card for a person or entity — employee, client, organization. Combines identity, detailed fields, and summarized statistics.
|
|
42
42
|
|
|
43
|
-
##
|
|
44
|
-
1.
|
|
45
|
-
2.
|
|
46
|
-
3.
|
|
43
|
+
## How to use
|
|
44
|
+
1. Retrieve the person/entity information via MCP
|
|
45
|
+
2. Separate the data into `fields` (text details) and `stats` (key figures)
|
|
46
|
+
3. Call `autoui_webmcp_widget_display('profile', { name: 'Alice Martin', subtitle: 'Senior Developer', fields: [{ label: 'Email', value: 'alice@ex.com' }], stats: [{ label: 'Projects', value: '12' }] })`
|
|
47
47
|
|
|
48
|
-
##
|
|
49
|
-
-
|
|
48
|
+
## Common mistakes
|
|
49
|
+
- NEVER fabricate image URLs for the avatar. 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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: recipe-browser
|
|
3
|
-
description:
|
|
3
|
+
description: Displays available recipes as interactive cards and allows viewing the detail of each recipe
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -35,28 +35,28 @@ schema:
|
|
|
35
35
|
- cards
|
|
36
36
|
---
|
|
37
37
|
|
|
38
|
-
##
|
|
39
|
-
|
|
38
|
+
## When to use
|
|
39
|
+
When the user wants to see available recipes, explore what the server can do, or understand how to use a specific widget.
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## How to use
|
|
42
42
|
|
|
43
|
-
###
|
|
44
|
-
|
|
43
|
+
### Step 1 — List recipes
|
|
44
|
+
Call `search_recipes()` on each connected server (MCP and WebMCP) to get the list of recipes.
|
|
45
45
|
|
|
46
|
-
###
|
|
47
|
-
|
|
46
|
+
### Step 2 — Display as interactive cards
|
|
47
|
+
Use `widget_display('cards', ...)` with the `interactive: true` parameter to make cards clickable:
|
|
48
48
|
|
|
49
49
|
```json
|
|
50
50
|
{
|
|
51
51
|
"name": "cards",
|
|
52
52
|
"params": {
|
|
53
|
-
"title": "
|
|
53
|
+
"title": "Available recipes",
|
|
54
54
|
"cards": [
|
|
55
55
|
{
|
|
56
|
-
"title": "
|
|
57
|
-
"description": "
|
|
58
|
-
"tags": ["
|
|
59
|
-
"meta": { "recipe_name": "
|
|
56
|
+
"title": "Recipe name",
|
|
57
|
+
"description": "Short description",
|
|
58
|
+
"tags": ["source_server"],
|
|
59
|
+
"meta": { "recipe_name": "technical_name", "server": "server_name" }
|
|
60
60
|
}
|
|
61
61
|
],
|
|
62
62
|
"interactive": true
|
|
@@ -64,39 +64,39 @@ Utilise `widget_display('cards', ...)` avec le paramètre `interactive: true` po
|
|
|
64
64
|
}
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
The `meta` field is important: it will be returned in the interaction event when the user clicks on a card.
|
|
68
68
|
|
|
69
|
-
###
|
|
70
|
-
|
|
69
|
+
### Step 3 — React to a click
|
|
70
|
+
When the user clicks on a card, you will receive an interaction message containing the `meta` data. Use `meta.recipe_name` and `meta.server` to:
|
|
71
71
|
|
|
72
|
-
1.
|
|
73
|
-
2.
|
|
72
|
+
1. Call `get_recipe(meta.recipe_name)` on the right server
|
|
73
|
+
2. Display the recipe content in a `code` widget with `language: 'markdown'`:
|
|
74
74
|
|
|
75
75
|
```json
|
|
76
76
|
{
|
|
77
77
|
"name": "code",
|
|
78
78
|
"params": {
|
|
79
|
-
"title": "
|
|
79
|
+
"title": "Recipe: Name",
|
|
80
80
|
"language": "markdown",
|
|
81
|
-
"code": "
|
|
81
|
+
"code": "full recipe content..."
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
3. **
|
|
86
|
+
3. **Link the two widgets**: the cards widget (list) and the code widget (detail) are linked. When the user clicks on another card, update the detail widget instead of creating a new one via `canvas('update', ...)`.
|
|
87
87
|
|
|
88
|
-
##
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
88
|
+
## Common mistakes
|
|
89
|
+
- Do not forget `interactive: true` in the cards — without it, clicks are not forwarded
|
|
90
|
+
- Do not create a new detail widget on each click — reuse the existing one via `canvas('update', ...)`
|
|
91
|
+
- MCP and WebMCP recipes have different server names — use the correct prefix for `get_recipe()`
|
|
92
92
|
|
|
93
|
-
##
|
|
93
|
+
## Full example
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
User: "Show me the available recipes"
|
|
96
96
|
|
|
97
|
-
1. `autoui_webmcp_search_recipes()` → 26
|
|
98
|
-
2. `tricoteuses_mcp_search_recipes()` → 10
|
|
99
|
-
3. `widget_display('cards', { title: "36
|
|
100
|
-
4. *
|
|
101
|
-
5. `autoui_webmcp_get_recipe('hemicycle')` →
|
|
102
|
-
6. `widget_display('code', { title: "
|
|
97
|
+
1. `autoui_webmcp_search_recipes()` → 26 widget recipes
|
|
98
|
+
2. `tricoteuses_mcp_search_recipes()` → 10 data recipes
|
|
99
|
+
3. `widget_display('cards', { title: "36 recipes", cards: [...], interactive: true })`
|
|
100
|
+
4. *User clicks on "Assembly composition"*
|
|
101
|
+
5. `autoui_webmcp_get_recipe('hemicycle')` → markdown content
|
|
102
|
+
6. `widget_display('code', { title: "Recipe: Assembly composition", language: "markdown", code: "..." })`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
widget: sankey
|
|
3
|
-
description:
|
|
3
|
+
description: Sankey diagram (flow between nodes)
|
|
4
4
|
group: rich
|
|
5
5
|
schema:
|
|
6
6
|
type: object
|
|
@@ -41,14 +41,14 @@ schema:
|
|
|
41
41
|
type: number
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
##
|
|
45
|
-
|
|
44
|
+
## When to use
|
|
45
|
+
Visualize flows or transfers between categories — budget, conversions, migrations, data flows. Nodes represent stages and links represent transferred quantities.
|
|
46
46
|
|
|
47
|
-
##
|
|
48
|
-
1.
|
|
49
|
-
2.
|
|
50
|
-
3.
|
|
47
|
+
## How to use
|
|
48
|
+
1. Fetch flow data via MCP
|
|
49
|
+
2. Define nodes (stages) and links (flows between stages)
|
|
50
|
+
3. Call `autoui_webmcp_widget_display('sankey', { title: 'Budget Flow', nodes: [{ id: 'rev', label: 'Revenue' }, { id: 'sal', label: 'Salaries' }], links: [{ source: 'rev', target: 'sal', value: 50000 }] })`
|
|
51
51
|
|
|
52
|
-
##
|
|
53
|
-
-
|
|
54
|
-
-
|
|
52
|
+
## Common mistakes
|
|
53
|
+
- The `source` and `target` in links must match existing `id` values in the nodes
|
|
54
|
+
- Do not create cycles (flow must be directional)
|