@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.
Files changed (45) hide show
  1. package/package.json +1 -1
  2. package/src/autoui-server.ts +134 -134
  3. package/src/diagnostics.ts +3 -3
  4. package/src/loop.ts +6 -6
  5. package/src/providers/wasm.ts +5 -5
  6. package/src/recipes/_generated.ts +446 -446
  7. package/src/recipes/afficher-oeuvres-art-collection-musee.md +45 -45
  8. package/src/recipes/analyser-actualites-hacker-news.md +52 -52
  9. package/src/recipes/cartographier-observations-biodiversite.md +44 -44
  10. package/src/recipes/cross-server.md +48 -48
  11. package/src/recipes/dashboard-kpi.md +45 -45
  12. package/src/recipes/explorer-dossiers-legislatifs-parcours-texte.md +48 -48
  13. package/src/recipes/gallery-images.md +33 -33
  14. package/src/recipes/parlementaire-profile.md +58 -58
  15. package/src/recipes/rechercher-textes-juridiques-legifrance.md +38 -38
  16. package/src/recipes/weather-viz.md +35 -35
  17. package/src/recipes/widgets/actions.md +6 -6
  18. package/src/recipes/widgets/alert.md +6 -6
  19. package/src/recipes/widgets/cards.md +10 -10
  20. package/src/recipes/widgets/carousel.md +8 -8
  21. package/src/recipes/widgets/chart-rich.md +10 -10
  22. package/src/recipes/widgets/chart.md +9 -9
  23. package/src/recipes/widgets/code.md +6 -6
  24. package/src/recipes/widgets/d3.md +10 -10
  25. package/src/recipes/widgets/data-table.md +10 -10
  26. package/src/recipes/widgets/gallery.md +10 -10
  27. package/src/recipes/widgets/grid-data.md +11 -11
  28. package/src/recipes/widgets/hemicycle.md +9 -9
  29. package/src/recipes/widgets/js-sandbox.md +10 -10
  30. package/src/recipes/widgets/json-viewer.md +8 -8
  31. package/src/recipes/widgets/kv.md +9 -9
  32. package/src/recipes/widgets/list.md +7 -7
  33. package/src/recipes/widgets/log.md +6 -6
  34. package/src/recipes/widgets/map.md +10 -10
  35. package/src/recipes/widgets/profile.md +9 -9
  36. package/src/recipes/widgets/recipe-browser.md +33 -33
  37. package/src/recipes/widgets/sankey.md +10 -10
  38. package/src/recipes/widgets/stat-card.md +7 -7
  39. package/src/recipes/widgets/stat.md +10 -10
  40. package/src/recipes/widgets/tags.md +6 -6
  41. package/src/recipes/widgets/text.md +6 -6
  42. package/src/recipes/widgets/timeline.md +6 -6
  43. package/src/recipes/widgets/trombinoscope.md +8 -8
  44. package/src/summarize.ts +6 -6
  45. package/src/tool-layers.ts +26 -26
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  widget: stat-card
3
- description: Carte statistique enrichie avec tendance et variante
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
- ## Quand utiliser
38
- Pour un KPI enrichi avec contexte — delta, valeur précédente, unité, variante colorée. Préférer `stat` pour un chiffre simple sans contexte additionnel.
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
- ## Comment
41
- 1. Récupérer la métrique et sa valeur de comparaison via MCP
42
- 2. Calculer le delta si nécessaire
43
- 3. Appeler `autoui_webmcp_widget_display('stat-card', { label: 'Revenus', value: '142k', unit: '€', delta: '+12%', trend: 'up', previousValue: '127k', variant: 'success' })`
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: Statistique clé (KPI, compteur, total)
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
- ## Quand utiliser
26
- Pour afficher un chiffre clé unique — KPI, compteur, total, score. Idéal quand l'utilisateur demande "combien de…" ou un résumé chiffré.
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
- ## Comment
29
- 1. Récupérer la donnée via l'outil MCP approprié (ex: requête SQL, appel API)
30
- 2. Appeler `autoui_webmcp_widget_display('stat', { label: 'Utilisateurs actifs', value: '1 247' })`
31
- 3. Optionnel : ajouter `trend` (ex: '+12%') et `trendDir` ('up'/'down'/'neutral') pour indiquer l'évolution
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
- ## Erreurs courantes
34
- - Passer `value` comme nombre au lieu de string — toujours convertir en string
35
- - Oublier de formater le nombre (séparateurs de milliers, unités)
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: Groupe de tags/badges
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
- ## Quand utiliser
26
- Pour afficher des catégories, des labels, des filtres ou des badges. Utile pour montrer les tags associés à un élément ou proposer des filtres visuels.
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
- ## Comment
29
- 1. Récupérer les tags ou catégories depuis MCP
30
- 2. Appeler `autoui_webmcp_widget_display('tags', { label: 'Catégories', tags: [{ text: 'Finance', active: true }, { text: 'Tech' }] })`
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: Paragraphe de texte libre
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
- ## Quand utiliser
15
- Pour afficher un paragraphe de texte explicatif, un résumé ou une description longue. Préférer `stat` pour un chiffre, `kv` pour des paires structurées.
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
- ## Comment
18
- 1. Rédiger ou récupérer le texte à afficher
19
- 2. Appeler `autoui_webmcp_widget_display('text', { content: 'Voici le résumé de l\'analyse...' })`
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: Chronologie d'événements avec statut
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
- ## Quand utiliser
34
- Pour afficher une séquence d'événements chronologiqueshistorique, étapes d'un processus, journal d'activité. Chaque événement peut avoir un statut (done/active/pending).
33
+ ## When to use
34
+ Display a sequence of chronological eventshistory, process steps, activity log. Each event can have a status (done/active/pending).
35
35
 
36
- ## Comment
37
- 1. Récupérer les événements via MCP, les trier chronologiquement
38
- 2. Appeler `autoui_webmcp_widget_display('timeline', { title: 'Historique commande', events: [{ date: '2024-01-15', title: 'Commande passée', status: 'done' }, { date: '2024-01-16', title: 'Expédition', status: 'active' }] })`
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: Grille de personnes avec badges
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
- ## Quand utiliser
32
- Pour afficher une grille de personnes équipe, membres d'un groupe, participants. Chaque personne peut avoir un badge et une couleur distinctive.
31
+ ## When to use
32
+ Display a grid of peopleteam, group members, participants. Each person can have a badge and a distinctive color.
33
33
 
34
- ## Comment
35
- 1. Récupérer la liste des personnes via MCP
36
- 2. Appeler `autoui_webmcp_widget_display('trombinoscope', { title: 'Équipe Dev', people: [{ name: 'Alice', subtitle: 'Lead', badge: 'PM', color: '#4CAF50' }], columns: 3 })`
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
- ## Erreurs courantes
39
- - Ne JAMAIS inventer d'URLs d'images pour le champ `avatar`. Utiliser UNIQUEMENT les URLs retournées par les outils MCP. Si aucune URL n'est disponible, ne pas inclure de champ avatar — le widget affichera les initiales automatiquement.
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 = `Résume cette conversation en 2-3 phrases courtes.
44
- Garde uniquement l'intention de l'utilisateur et les décisions techniques prises.
45
- Anonymise TOUT : remplace les noms de personnes, d'entreprises, de lieux, de domaines et d'URLs par des termes génériques (ex: "un utilisateur", "une entreprise", "une ville", "un serveur MCP").
46
- Ne mentionne jamais de données personnelles.
47
- Réponds UNIQUEMENT avec le résumé, sans préambule.
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 = '(synthèse non disponible)';
66
+ chatSummary = '(summary unavailable)';
67
67
  }
68
68
 
69
69
  return {
@@ -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 = `Tu es un assistant IA qui aide les utilisateurs en répondant à leurs questions et en accomplissant des tâches à l'aide de recettes (appelées aussi skills ou recipes). Ces recettes ne sont pas des recettes de cuisine mais des instructions pour un agent IA avec des scripts, des schémas et des informations pour l'aider. Si tu ne trouve pas de recette ou d'outils appropriés, tu peux fallback sur un chat traditionnel sans tool calling (ETAPE 5).
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
- Tu NE DOIS PAS sauter d'étapes.
395
+ You MUST NOT skip steps.
396
396
 
397
- RÈGLE CRITIQUE : Tu DOIS exécuter toutes les étapes en silence. Ne génère AUCUNE réflexion interne, raisonnement ou texte intermédiaire.
397
+ CRITICAL RULE: You MUST execute all steps silently. Do NOT generate any internal reasoning, thinking, or intermediate text.
398
398
 
399
- ÉTAPE 1 — Liste toutes les recettes
399
+ STEP 1 — List all recipes
400
400
 
401
- Cherche une recette pertinente parmi celles-ci :
401
+ Look for a relevant recipe among these:
402
402
 
403
403
  ${listRecipes.join('\n')}
404
404
 
405
- Si au moins une recette pertinente est trouvéepasse à l'ÉTAPE 2.
406
- Si aucun résultatpasse à l'ÉTAPE 1b.
405
+ If at least one relevant recipe is foundgo to STEP 2.
406
+ If no resultsgo to STEP 1b.
407
407
 
408
- ÉTAPE 1b — Recherche de recettes
408
+ STEP 1b — Search recipes
409
409
 
410
- Aucune recette trouvée par liste. Recherche avec un ou des mot-clé(s) extrait de la demande :
410
+ No recipe found by listing. Search with keyword(s) extracted from the request:
411
411
 
412
412
  ${searchRecipes.join('\n')}
413
413
 
414
- Choisis la recette la plus pertinente par rapport à la demande.
415
- Si une recette correspondpasse à l'ÉTAPE 2.
416
- Si aucune recette disponible ou pertinentepasse à l'ÉTAPE 1c.
414
+ Pick the most relevant recipe for the request.
415
+ If a recipe matchesgo to STEP 2.
416
+ If no recipe is available or relevant go to STEP 1c.
417
417
 
418
- ÉTAPE 1c — Liste des outils
418
+ STEP 1c — List tools
419
419
 
420
- Aucune recette applicable. Liste un outil pertinent :
420
+ No applicable recipe. List a relevant tool:
421
421
 
422
422
  ${listTools.join('\n')}
423
423
 
424
- Si un outil pertinent est trouvéutilise-le directement pour répondre (passe à l'ÉTAPE 3).
425
- Si aucun résultatpasse à l'ÉTAPE 1d.
424
+ If a relevant tool is founduse it directly to respond (go to STEP 3).
425
+ If no resultsgo to STEP 1d.
426
426
 
427
- ÉTAPE 1d — Recherche d'outils
427
+ STEP 1d — Search tools
428
428
 
429
429
  ${searchTools.join('\n')}
430
430
 
431
- Choisis le ou les outils les plus pertinents et utilise-les pour répondre (passe à l'ÉTAPE 3).
431
+ Pick the most relevant tool(s) and use them to respond (go to STEP 3).
432
432
 
433
- ÉTAPE 2 — Lecture de la recette
433
+ STEP 2 — Read the recipe
434
434
 
435
435
  ${getRecipes.join('\n')}
436
436
 
437
- Lis les instructions complètes de la recette sélectionnée.
437
+ Read the full instructions of the selected recipe.
438
438
 
439
- ÉTAPE 3 — Exécution
439
+ STEP 3 — Execute
440
440
 
441
- Suis les instructions de la recette exactement si tu en as une. Sinon utilise les outils directement. Produis UNIQUEMENT le résultat final, un résumé en une phrase de l'action effectuée, ainsi que le résultat.
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
- ÉTAPE 4 — Affichage UI
443
+ STEP 4 — UI display
444
444
 
445
- Sauf indication UI contraire d'une recette, utilise ces outils pour afficher tes réponses sur le canvas :
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
- ÉTAPE 5 — Fallback
449
+ STEP 5 — Fallback
450
450
 
451
- En cas d'échec des étapes précédentes, fallback sur un chat classique sans tool calling.`;
451
+ If previous steps failed, fall back to a classic chat without tool calling.`;
452
452
 
453
453
  return { prompt, aliasMap };
454
454
  }