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
Copy file name to clipboardExpand all lines: apps/website/content/docs/ag-ui/api/api-docs.json
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -405,7 +405,7 @@
405
405
{
406
406
"name": "AgUiAgent",
407
407
"kind": "interface",
408
-
"description": "The neutral Agent contract, widened with the AG-UI adapter's optional\n`customEvents` signal (the chat composition feature-detects it to enable\nlive a2ui streaming) and the optional `clientTools` capability.\nMirrors langgraph's LangGraphAgent extension.",
408
+
"description": "The neutral Agent contract, widened with the AG-UI adapter's\n`customEvents` signal (the chat composition feature-detects it to enable\nlive a2ui streaming), the browser client-tools capability, and concrete\nACTIVITY-backed `subagents`.\nMirrors langgraph's LangGraphAgent extension where the protocol surfaces\noverlap.",
409
409
"properties": [
410
410
{
411
411
"name": "clientTools",
@@ -620,7 +620,7 @@
620
620
"description": ""
621
621
},
622
622
"examples": [
623
-
"```ts\nTestBed.configureTestingModule({\n providers: [provideFakeAgent({ responses: ['Hello from the fake agent'] })],\n});\n```"
623
+
"```ts\nTestBed.configureTestingModule({\n providers: [provideFakeAgent({ tokens: ['Hello from the fake agent'] })],\n});\n```"
624
624
]
625
625
},
626
626
{
@@ -646,6 +646,8 @@
646
646
"type": "AgUiAgent<>",
647
647
"description": ""
648
648
},
649
-
"examples": []
649
+
"examples": [
650
+
"```ts\nimport { HttpAgent } from '@ag-ui/client';\nimport { toAgent } from '@threadplane/ag-ui';\n\nconst agent = toAgent(new HttpAgent({ url: '/api/agent' }));\n```"
Copy file name to clipboardExpand all lines: apps/website/content/docs/ag-ui/api/inject-agent.mdx
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,19 +65,22 @@ These fields are stable across runtime adapters and are what chat components con
65
65
66
66
## AG-UI-specific surface
67
67
68
-
The AG-UI adapter extends the neutral `Agent` contract with one additional signal:
68
+
The AG-UI adapter extends the neutral `Agent` contract with AG-UI-specific protocol surfaces:
69
69
70
70
| Field | Type | Description |
71
71
|-------|------|-------------|
72
72
|`customEvents()`|`CustomStreamEvent[]`| Custom events emitted by the backend during a run. Accumulates per run; resets on each new `submit()`. |
73
+
|`clientTools`|`ClientToolsCapability`| Browser client-tool catalog, pending calls, and result resolution used by `<chat [clientTools]>`. |
74
+
|`subagents()`|`Map<string, Subagent>`|`ACTIVITY_*` entries with `activityType: 'subagent'`, projected to the neutral subagent contract and keyed by `messageId`. |
73
75
74
-
`injectAgent()` returns the `AgUiAgent` type — the neutral `Agent` contract plus `customEvents`— so the signal is reachable directly, no cast required:
76
+
`injectAgent()` returns the `AgUiAgent` type — the neutral `Agent` contract plus these AG-UI-specific fields — so they are reachable directly, no cast required:
The chat a2ui bridge reads `customEvents` to light up live generative-UI streaming when your backend emits `a2ui-partial` events. The consuming side is documented in chat's [A2UI overview](/docs/chat/a2ui/overview). See the [Custom Events guide](/docs/ag-ui/guides/custom-events) for backend wiring details.
`toAgent()` returns an `AgUiAgent`, which extends the neutral `Agent` contract with one additional signal:
27
+
`toAgent()` returns an `AgUiAgent`, which extends the neutral `Agent` contract with AG-UI-specific protocol surfaces:
28
28
29
29
| Field | Type | Description |
30
30
|-------|------|-------------|
31
31
|`customEvents()`|`Signal<CustomStreamEvent[]>`| Custom events accumulated during a run. Resets at the start of each new run. |
32
+
|`clientTools`|`ClientToolsCapability`| Browser client-tool catalog, pending calls, and result resolution. The chat composition uses this when you pass `<chat [clientTools]>`. |
33
+
|`subagents()`|`Signal<Map<string, Subagent>>`|`ACTIVITY_*` events with `activityType: 'subagent'`, projected to the neutral subagent contract and keyed by `messageId`. |
32
34
33
35
The standard `Agent` signals (`messages`, `status`, `isLoading`, `error`, `toolCalls`, `state`, `interrupt`) and actions (`submit`, `stop`, `regenerate`) are all present.
Copy file name to clipboardExpand all lines: apps/website/content/docs/ag-ui/concepts/architecture.mdx
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,9 @@ Every AG-UI event is passed through the reducer. The reducer updates Angular sig
88
88
-`toolCalls` for tool call starts, arguments, results, and completion.
89
89
-`state` for AG-UI state snapshots and JSON Patch deltas.
90
90
-`interrupt` cleared on `RUN_STARTED` and set by the `CUSTOM``on_interrupt` event.
91
-
-`events$` for custom events.
91
+
-`events$` for runtime-neutral custom-event side effects.
92
+
-`customEvents` for accumulated non-`on_interrupt``CUSTOM` events used by live a2ui and app-specific reactive UI.
93
+
-`subagents` for `ACTIVITY_*` events with `activityType: 'subagent'`.
92
94
93
95
When the user submits input, the adapter builds a user message, appends it locally, adds it to the AG-UI source with `source.addMessage()`, then calls `source.runAgent()`.
94
96
@@ -106,6 +108,12 @@ the final tool-call surface; with it, surfaces build up live.
106
108
107
109
The consuming side — how the chat composition turns these events into rendered surfaces — lives in chat's [A2UI overview](/docs/chat/a2ui/overview).
108
110
111
+
## Browser client tools
112
+
113
+
`AgUiAgent.clientTools` is the browser-tool bridge consumed by `<chat [clientTools]>`. The chat composition registers the browser catalog on the agent; the adapter threads that catalog into every `source.runAgent({ tools })` call, exposes unresolved browser-owned tool calls through `clientTools.pending()`, and sends the browser result back as a tool message before continuing the run.
114
+
115
+
See chat's [Client Tools guide](/docs/chat/guides/client-tools) for declaring `action()`, `view()`, and `ask()` tools. With AG-UI, the backend must bind the supplied AG-UI tool specs and finish the turn without emitting `TOOL_CALL_RESULT` for browser-owned tools so the client can resolve them.
116
+
109
117
## Provider choices
110
118
111
119
Use `provideAgent()` when you have a real AG-UI HTTP endpoint.
@@ -188,9 +196,10 @@ The AG-UI adapter currently covers:
188
196
- Tool calls from `TOOL_CALL_*`.
189
197
- Shared state from `STATE_SNAPSHOT` and `STATE_DELTA`.
190
198
- Message replacement from `MESSAGES_SNAPSHOT`.
191
-
- Custom events from `CUSTOM`.
199
+
- Custom events from non-`on_interrupt``CUSTOM` events, surfaced through both `events$` and `customEvents`.
192
200
- Interrupts from `CUSTOM` events named `on_interrupt`.
193
-
- Subagent/activity progress from `ACTIVITY_SNAPSHOT` and `ACTIVITY_DELTA`.
201
+
- Browser client tools via `AgUiAgent.clientTools`.
202
+
- Subagent progress from `ACTIVITY_SNAPSHOT` and `ACTIVITY_DELTA` events whose `activityType` is `subagent`.
194
203
- Citations stored under `state.citations`.
195
204
196
205
These features are intentionally out of scope for the AG-UI adapter today:
`@threadplane/chat` provides the chat UI primitives. `@threadplane/ag-ui` provides the adapter that wires an AG-UI backend into the `Agent` contract those primitives consume.
16
+
`marked` is the required markdown parser peer used by `@threadplane/chat` when assistant messages render through `<chat>`.
0 commit comments