@webmcp-auto-ui/agent 2.5.24 → 2.5.26

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.
Files changed (46) hide show
  1. package/package.json +1 -1
  2. package/src/autoui-server.ts +17 -0
  3. package/src/diagnostics.ts +6 -6
  4. package/src/discovery-cache.ts +17 -3
  5. package/src/index.ts +3 -3
  6. package/src/loop.ts +27 -19
  7. package/src/providers/wasm.ts +184 -330
  8. package/src/recipes/_generated.ts +273 -0
  9. package/src/recipes/canary-data.md +50 -0
  10. package/src/recipes/canary-display.md +99 -0
  11. package/src/recipes/canary-middle.md +32 -0
  12. package/src/recipes/hummingbird-data.md +32 -0
  13. package/src/recipes/hummingbird-display.md +36 -0
  14. package/src/recipes/hummingbird-middle.md +18 -0
  15. package/src/tool-layers.ts +303 -31
  16. package/src/types.ts +6 -1
  17. package/tests/loop.test.ts +2 -2
  18. package/src/providers/gemma.worker.legacy.ts +0 -123
  19. package/src/providers/litert.worker.ts +0 -294
  20. package/src/recipes/widgets/actions.md +0 -28
  21. package/src/recipes/widgets/alert.md +0 -27
  22. package/src/recipes/widgets/cards.md +0 -41
  23. package/src/recipes/widgets/carousel.md +0 -39
  24. package/src/recipes/widgets/chart-rich.md +0 -51
  25. package/src/recipes/widgets/chart.md +0 -32
  26. package/src/recipes/widgets/code.md +0 -21
  27. package/src/recipes/widgets/d3.md +0 -36
  28. package/src/recipes/widgets/data-table.md +0 -46
  29. package/src/recipes/widgets/gallery.md +0 -39
  30. package/src/recipes/widgets/grid-data.md +0 -57
  31. package/src/recipes/widgets/hemicycle.md +0 -43
  32. package/src/recipes/widgets/js-sandbox.md +0 -32
  33. package/src/recipes/widgets/json-viewer.md +0 -27
  34. package/src/recipes/widgets/kv.md +0 -31
  35. package/src/recipes/widgets/list.md +0 -24
  36. package/src/recipes/widgets/log.md +0 -39
  37. package/src/recipes/widgets/map.md +0 -49
  38. package/src/recipes/widgets/profile.md +0 -49
  39. package/src/recipes/widgets/recipe-browser.md +0 -102
  40. package/src/recipes/widgets/sankey.md +0 -54
  41. package/src/recipes/widgets/stat-card.md +0 -43
  42. package/src/recipes/widgets/stat.md +0 -35
  43. package/src/recipes/widgets/tags.md +0 -30
  44. package/src/recipes/widgets/text.md +0 -19
  45. package/src/recipes/widgets/timeline.md +0 -38
  46. package/src/recipes/widgets/trombinoscope.md +0 -39
@@ -1,57 +0,0 @@
1
- ---
2
- widget: grid-data
3
- description: Data grid with cell highlighting
4
- group: rich
5
- schema:
6
- type: object
7
- required:
8
- - rows
9
- properties:
10
- title:
11
- type: string
12
- columns:
13
- type: array
14
- items:
15
- type: object
16
- required:
17
- - key
18
- - label
19
- properties:
20
- key:
21
- type: string
22
- label:
23
- type: string
24
- width:
25
- type: string
26
- rows:
27
- type: array
28
- items:
29
- type: array
30
- highlights:
31
- type: array
32
- items:
33
- type: object
34
- required:
35
- - row
36
- - col
37
- properties:
38
- row:
39
- type: number
40
- col:
41
- type: number
42
- color:
43
- type: string
44
- ---
45
-
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
-
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
-
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,43 +0,0 @@
1
- ---
2
- widget: hemicycle
3
- description: Parliamentary hemicycle with political groups
4
- group: rich
5
- schema:
6
- type: object
7
- required:
8
- - groups
9
- properties:
10
- title:
11
- type: string
12
- groups:
13
- type: array
14
- items:
15
- type: object
16
- required:
17
- - id
18
- - label
19
- - seats
20
- - color
21
- properties:
22
- id:
23
- type: string
24
- label:
25
- type: string
26
- seats:
27
- type: number
28
- color:
29
- type: string
30
- totalSeats:
31
- type: number
32
- ---
33
-
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
-
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
-
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,32 +0,0 @@
1
- ---
2
- widget: js-sandbox
3
- description: Isolated JavaScript sandbox with HTML/CSS
4
- group: advanced
5
- schema:
6
- type: object
7
- required:
8
- - code
9
- properties:
10
- title:
11
- type: string
12
- code:
13
- type: string
14
- html:
15
- type: string
16
- css:
17
- type: string
18
- height:
19
- type: string
20
- ---
21
-
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
-
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
-
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,27 +0,0 @@
1
- ---
2
- widget: json-viewer
3
- description: Interactive JSON viewer with expand/collapse
4
- group: rich
5
- schema:
6
- type: object
7
- required:
8
- - data
9
- properties:
10
- title:
11
- type: string
12
- data: {}
13
- maxDepth:
14
- type: number
15
- expanded:
16
- type: boolean
17
- ---
18
-
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
-
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
-
26
- ## Common mistakes
27
- - Passing a JSON string instead of an object — `data` expects an object/array, not a string
@@ -1,31 +0,0 @@
1
- ---
2
- widget: kv
3
- description: Key-value pairs (properties, metadata)
4
- group: simple
5
- schema:
6
- type: object
7
- required:
8
- - rows
9
- properties:
10
- title:
11
- type: string
12
- rows:
13
- type: array
14
- items:
15
- type: array
16
- items:
17
- type: string
18
- minItems: 2
19
- maxItems: 2
20
- ---
21
-
22
- ## When to use
23
- Display properties or metadata as key-value pairs. Ideal for detail cards, configurations, and structured summaries.
24
-
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
-
30
- ## Common mistakes
31
- - Passing an object `{key: value}` instead of an array of pairs `[[key, value]]`
@@ -1,24 +0,0 @@
1
- ---
2
- widget: list
3
- description: Ordered list of items
4
- group: simple
5
- schema:
6
- type: object
7
- required:
8
- - items
9
- properties:
10
- title:
11
- type: string
12
- items:
13
- type: array
14
- items:
15
- type: string
16
- ---
17
-
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
-
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,39 +0,0 @@
1
- ---
2
- widget: log
3
- description: Event log with levels and timestamps
4
- group: rich
5
- schema:
6
- type: object
7
- required:
8
- - entries
9
- properties:
10
- title:
11
- type: string
12
- entries:
13
- type: array
14
- items:
15
- type: object
16
- required:
17
- - message
18
- properties:
19
- timestamp:
20
- type: string
21
- level:
22
- type: string
23
- enum:
24
- - debug
25
- - info
26
- - warn
27
- - error
28
- message:
29
- type: string
30
- source:
31
- type: string
32
- ---
33
-
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
-
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,49 +0,0 @@
1
- ---
2
- widget: map
3
- description: Interactive map with markers
4
- group: advanced
5
- schema:
6
- type: object
7
- properties:
8
- title:
9
- type: string
10
- center:
11
- type: object
12
- properties:
13
- lat:
14
- type: number
15
- lng:
16
- type: number
17
- zoom:
18
- type: number
19
- height:
20
- type: string
21
- markers:
22
- type: array
23
- items:
24
- type: object
25
- required:
26
- - lat
27
- - lng
28
- properties:
29
- lat:
30
- type: number
31
- lng:
32
- type: number
33
- label:
34
- type: string
35
- color:
36
- type: string
37
- ---
38
-
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
-
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
-
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,49 +0,0 @@
1
- ---
2
- widget: profile
3
- description: Profile card with fields and statistics
4
- group: rich
5
- schema:
6
- type: object
7
- required:
8
- - name
9
- properties:
10
- name:
11
- type: string
12
- subtitle:
13
- type: string
14
- fields:
15
- type: array
16
- items:
17
- type: object
18
- required:
19
- - label
20
- - value
21
- properties:
22
- label:
23
- type: string
24
- value:
25
- type: string
26
- stats:
27
- type: array
28
- items:
29
- type: object
30
- required:
31
- - label
32
- - value
33
- properties:
34
- label:
35
- type: string
36
- value:
37
- type: string
38
- ---
39
-
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
-
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
-
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,102 +0,0 @@
1
- ---
2
- widget: recipe-browser
3
- description: Displays available recipes as interactive cards and allows viewing the detail of each recipe
4
- group: rich
5
- schema:
6
- type: object
7
- properties:
8
- title:
9
- type: string
10
- cards:
11
- type: array
12
- items:
13
- type: object
14
- required:
15
- - title
16
- properties:
17
- title:
18
- type: string
19
- description:
20
- type: string
21
- tags:
22
- type: array
23
- items:
24
- type: string
25
- meta:
26
- type: object
27
- properties:
28
- recipe_name:
29
- type: string
30
- server:
31
- type: string
32
- interactive:
33
- type: boolean
34
- required:
35
- - cards
36
- ---
37
-
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
-
41
- ## How to use
42
-
43
- ### Step 1 — List recipes
44
- Call `search_recipes()` on each connected server (MCP and WebMCP) to get the list of recipes.
45
-
46
- ### Step 2 — Display as interactive cards
47
- Use `widget_display('cards', ...)` with the `interactive: true` parameter to make cards clickable:
48
-
49
- ```json
50
- {
51
- "name": "cards",
52
- "params": {
53
- "title": "Available recipes",
54
- "cards": [
55
- {
56
- "title": "Recipe name",
57
- "description": "Short description",
58
- "tags": ["source_server"],
59
- "meta": { "recipe_name": "technical_name", "server": "server_name" }
60
- }
61
- ],
62
- "interactive": true
63
- }
64
- }
65
- ```
66
-
67
- The `meta` field is important: it will be returned in the interaction event when the user clicks on a card.
68
-
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
-
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
-
75
- ```json
76
- {
77
- "name": "code",
78
- "params": {
79
- "title": "Recipe: Name",
80
- "language": "markdown",
81
- "code": "full recipe content..."
82
- }
83
- }
84
- ```
85
-
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
-
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
-
93
- ## Full example
94
-
95
- User: "Show me the available recipes"
96
-
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,54 +0,0 @@
1
- ---
2
- widget: sankey
3
- description: Sankey diagram (flow between nodes)
4
- group: rich
5
- schema:
6
- type: object
7
- required:
8
- - nodes
9
- - links
10
- properties:
11
- title:
12
- type: string
13
- nodes:
14
- type: array
15
- items:
16
- type: object
17
- required:
18
- - id
19
- - label
20
- properties:
21
- id:
22
- type: string
23
- label:
24
- type: string
25
- color:
26
- type: string
27
- links:
28
- type: array
29
- items:
30
- type: object
31
- required:
32
- - source
33
- - target
34
- - value
35
- properties:
36
- source:
37
- type: string
38
- target:
39
- type: string
40
- value:
41
- type: number
42
- ---
43
-
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
-
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
-
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)
@@ -1,43 +0,0 @@
1
- ---
2
- widget: stat-card
3
- description: Enhanced stat card with trend and variant
4
- group: rich
5
- schema:
6
- type: object
7
- required:
8
- - label
9
- - value
10
- properties:
11
- label:
12
- type: string
13
- value:
14
- type: string
15
- unit:
16
- type: string
17
- delta:
18
- type: string
19
- trend:
20
- type: string
21
- enum:
22
- - up
23
- - down
24
- - flat
25
- previousValue:
26
- type: string
27
- variant:
28
- type: string
29
- enum:
30
- - default
31
- - success
32
- - warning
33
- - error
34
- - info
35
- ---
36
-
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
-
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,35 +0,0 @@
1
- ---
2
- widget: stat
3
- description: Key statistic (KPI, counter, total)
4
- group: simple
5
- schema:
6
- type: object
7
- required:
8
- - label
9
- - value
10
- properties:
11
- label:
12
- type: string
13
- value:
14
- type: string
15
- trend:
16
- type: string
17
- trendDir:
18
- type: string
19
- enum:
20
- - up
21
- - down
22
- - neutral
23
- ---
24
-
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
-
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
-
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,30 +0,0 @@
1
- ---
2
- widget: tags
3
- description: Group of tags/badges
4
- group: simple
5
- schema:
6
- type: object
7
- required:
8
- - tags
9
- properties:
10
- label:
11
- type: string
12
- tags:
13
- type: array
14
- items:
15
- type: object
16
- required:
17
- - text
18
- properties:
19
- text:
20
- type: string
21
- active:
22
- type: boolean
23
- ---
24
-
25
- ## When to use
26
- Display categories, labels, filters, or badges. Useful for showing tags associated with an item or presenting visual filters.
27
-
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,19 +0,0 @@
1
- ---
2
- widget: text
3
- description: Free-form text paragraph
4
- group: simple
5
- schema:
6
- type: object
7
- required:
8
- - content
9
- properties:
10
- content:
11
- type: string
12
- ---
13
-
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
-
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,38 +0,0 @@
1
- ---
2
- widget: timeline
3
- description: Event timeline with status
4
- group: rich
5
- schema:
6
- type: object
7
- required:
8
- - events
9
- properties:
10
- title:
11
- type: string
12
- events:
13
- type: array
14
- items:
15
- type: object
16
- required:
17
- - title
18
- properties:
19
- date:
20
- type: string
21
- title:
22
- type: string
23
- description:
24
- type: string
25
- status:
26
- type: string
27
- enum:
28
- - done
29
- - active
30
- - pending
31
- ---
32
-
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
-
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' }] })`