You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
client: implement reactive surface state with signals (google#903)
* client: implement reactive surface state with signals
- Introduces surfacesSignal inside the Angular MessageProcessor to
act as a reactive wrapper around Core's Surface map.
Angular's new signal-based change detection operates on strict
reference equality. During streaming execution, the web core
A2uiMessageProcessor mutates the underlying surface models in-place
for fast iteration. Because the memory references are unchanged, the
Angular UI doesn't know it needs to re-render. By overriding
processMessages and shallow-cloning the active surfaces into a brand
new Map via a notify() broadcast, we force Angular to observe the
mutated data model and reliably trigger UI updates.
- Adds @if (child) structural directives to iterative component
templates (e.g. Row, Column, List, Modal) to safely render nested
children as properties incrementally arrive over the network.
* feat(streaming): implement reactive client-side streaming support
By default, the Angular client uses the non-streaming API to communicate
with the agent. To enable streaming, set the `ENABLE_STREAMIING` env var
to `true.
```bash
export ENABLE_STREAMING=true
npm start -- contact
```
Copy file name to clipboardExpand all lines: samples/client/angular/README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,15 @@ Here are the instructions if you want to do each step manually.
41
41
*`npm start -- gallery` (Client-only, no server required)
42
42
5. Open http://localhost:4200/
43
43
44
+
## Streaming
45
+
46
+
By default, the Angular client uses the non-streaming API to communicate with the agent. To enable streaming, set the `ENABLE_STREAMING` environment variable to `true`:
47
+
48
+
```bash
49
+
export ENABLE_STREAMING=true
50
+
npm start -- contact
51
+
```
52
+
44
53
Important: The sample code provided is for demonstration purposes and illustrates the mechanics of A2UI and the Agent-to-Agent (A2A) protocol. When building production applications, it is critical to treat any agent operating outside of your direct control as a potentially untrusted entity.
45
54
46
55
All operational data received from an external agent—including its AgentCard, messages, artifacts, and task statuses—should be handled as untrusted input. For example, a malicious agent could provide crafted data in its fields (e.g., name, skills.description) that, if used without sanitization to construct prompts for a Large Language Model (LLM), could expose your application to prompt injection attacks.
0 commit comments