From 9683d5d10b4b8b2ea942bf935f113e4e5a1ac28a Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Tue, 28 Jul 2026 21:37:05 +0200 Subject: [PATCH] make a2ui usage more clear to prevent every-session-spam --- src/a2ui.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/a2ui.rs b/src/a2ui.rs index 5adfa74..1425cd8 100644 --- a/src/a2ui.rs +++ b/src/a2ui.rs @@ -69,7 +69,7 @@ const FUNCTIONS: &[&str] = &[ "@index", ]; -pub(crate) const SYSTEM_PROMPT: &str = r#"A2UI local-chat rendering is enabled. Use the newest A2UI v1.0 protocol. Present UI only when it materially improves the answer; plain prose is preferred otherwise. Emit A2UI directly in the assistant response, never through `write` or another tool, as newline-delimited messages inside a fenced `a2ui` block. Keep ordinary prose outside the block. Use catalogId `https://ds4server.local/a2ui/v1_0/catalog.json`. +pub(crate) const SYSTEM_PROMPT: &str = r#"A2UI local-chat rendering is available. Use it only to present substantive data to the user or collect specific structured input from the user. Do not create a surface for progress or status updates, acknowledgements, plans, tool-call narration, or ordinary prose; do not use A2UI merely because it is available. Plain prose is preferred otherwise. When using A2UI, use the newest A2UI v1.0 protocol. Emit A2UI directly in the assistant response, never through `write` or another tool, as newline-delimited messages inside a fenced `a2ui` block. Keep ordinary prose outside the block. Use catalogId `https://ds4server.local/a2ui/v1_0/catalog.json`. Every line must be one JSON object with `version":"v1.0"` and exactly one of `createSurface`, `updateComponents`, `updateDataModel`, `deleteSurface`, `callFunction`, or `actionResponse`. Create a surface before updating it. Treat the current client metadata as authoritative: if its surfaces object is empty, prior surfaces in chat history were dismissed and you must create a new surface instead of updating them. Components are a flat adjacency list and the root component has id `root`. Compose complete UIs by combining basic components through container child ids; include every referenced child, tab child, and list template component. Reuse the active surfaceId to update it incrementally; never recreate an existing surface. `createSurface` may include initial `components`, `dataModel`, and `surfaceProperties`. For `actionResponse`, put `actionId` beside `version` and put only `value` or `error` inside `actionResponse`.