Skip to content

Commit 7472553

Browse files
authored
Refresh AG-UI install and agent surface docs
2 parents cda8481 + c5cfa8d commit 7472553

11 files changed

Lines changed: 51 additions & 19 deletions

File tree

apps/website/content/docs/ag-ui/api/api-docs.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
{
406406
"name": "AgUiAgent",
407407
"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.",
409409
"properties": [
410410
{
411411
"name": "clientTools",
@@ -620,7 +620,7 @@
620620
"description": ""
621621
},
622622
"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```"
624624
]
625625
},
626626
{
@@ -646,6 +646,8 @@
646646
"type": "AgUiAgent<>",
647647
"description": ""
648648
},
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```"
651+
]
650652
}
651653
]

apps/website/content/docs/ag-ui/api/inject-agent.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,22 @@ These fields are stable across runtime adapters and are what chat components con
6565

6666
## AG-UI-specific surface
6767

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:
6969

7070
| Field | Type | Description |
7171
|-------|------|-------------|
7272
| `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`. |
7375

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:
7577

7678
```ts
7779
import { injectAgent } from '@threadplane/ag-ui';
7880

7981
const chat = injectAgent();
80-
chat.customEvents(); // Signal<CustomStreamEvent[]>
82+
chat.customEvents(); // CustomStreamEvent[]
83+
chat.subagents(); // Map<string, Subagent>
8184
```
8285

8386
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.

apps/website/content/docs/ag-ui/api/to-agent.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ const agent = toAgent(source, { telemetry: myTelemetrySink });
2424

2525
## AgUiAgent
2626

27-
`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:
2828

2929
| Field | Type | Description |
3030
|-------|------|-------------|
3131
| `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`. |
3234

3335
The standard `Agent` signals (`messages`, `status`, `isLoading`, `error`, `toolCalls`, `state`, `interrupt`) and actions (`submit`, `stop`, `regenerate`) are all present.
3436

apps/website/content/docs/ag-ui/concepts/architecture.mdx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ Every AG-UI event is passed through the reducer. The reducer updates Angular sig
8888
- `toolCalls` for tool call starts, arguments, results, and completion.
8989
- `state` for AG-UI state snapshots and JSON Patch deltas.
9090
- `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'`.
9294

9395
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()`.
9496

@@ -106,6 +108,12 @@ the final tool-call surface; with it, surfaces build up live.
106108

107109
The consuming side — how the chat composition turns these events into rendered surfaces — lives in chat's [A2UI overview](/docs/chat/a2ui/overview).
108110

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+
109117
## Provider choices
110118

111119
Use `provideAgent()` when you have a real AG-UI HTTP endpoint.
@@ -188,9 +196,10 @@ The AG-UI adapter currently covers:
188196
- Tool calls from `TOOL_CALL_*`.
189197
- Shared state from `STATE_SNAPSHOT` and `STATE_DELTA`.
190198
- 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`.
192200
- 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`.
194203
- Citations stored under `state.citations`.
195204

196205
These features are intentionally out of scope for the AG-UI adapter today:

apps/website/content/docs/ag-ui/getting-started/installation.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
## Install packages
1010

1111
```bash
12-
npm install @threadplane/chat @threadplane/ag-ui @ag-ui/client @ag-ui/core
12+
npm install @threadplane/chat @threadplane/ag-ui @ag-ui/client @ag-ui/core marked
1313
```
1414

1515
`@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>`.
1617

1718
## Peer Dependencies
1819

apps/website/content/docs/ag-ui/getting-started/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Want to see the finished result before you build? Open the live [AG-UI demo](htt
1414
<Step title="Install the packages">
1515

1616
```bash
17-
npm install @threadplane/chat @threadplane/ag-ui @ag-ui/client @ag-ui/core
17+
npm install @threadplane/chat @threadplane/ag-ui @ag-ui/client @ag-ui/core marked
1818
```
1919

2020
</Step>

apps/website/src/app/docs/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const BACKENDS: Backend[] = [
3838
{
3939
title: 'AG-UI',
4040
blurb: 'For CrewAI, Mastra, Pydantic AI, Strands, and more.',
41-
install: 'npm i @threadplane/chat @threadplane/ag-ui @ag-ui/client @ag-ui/core',
41+
install: 'npm i @threadplane/chat @threadplane/ag-ui @ag-ui/client @ag-ui/core marked',
4242
href: '/docs/ag-ui/getting-started/quickstart',
4343
logoSrc: '/logos/runtimes/copilotkit.svg',
4444
attribution: 'AG-UI · CopilotKit',

apps/website/src/app/llms.txt/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function buildLlmsTxt(): string {
3636
'# LangGraph backend with browser client tools:',
3737
'npm install @threadplane/chat @threadplane/langgraph @langchain/core @langchain/langgraph-sdk @threadplane/middleware marked',
3838
'# AG-UI backend:',
39-
'npm install @threadplane/chat @threadplane/ag-ui @ag-ui/client @ag-ui/core',
39+
'npm install @threadplane/chat @threadplane/ag-ui @ag-ui/client @ag-ui/core marked',
4040
'',
4141
'## Key API (symmetric across adapters)',
4242
'- provideAgent(config) — wires the adapter into Angular DI. Same name across @threadplane/langgraph and @threadplane/ag-ui.',

libs/ag-ui/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ Part of [Threadplane](https://github.com/cacheplane/angular-agent-framework).
3232
## Install
3333

3434
```bash
35-
npm install @threadplane/ag-ui @threadplane/chat @ag-ui/client @ag-ui/core
35+
npm install @threadplane/ag-ui @threadplane/chat @ag-ui/client @ag-ui/core marked
3636
```
3737

3838
**Peer dependencies:** `@threadplane/chat: *`, `@angular/core: ^20.0.0 || ^21.0.0`, `@ag-ui/client: *`, `@ag-ui/core: *`, `rxjs: ~7.8.0`
3939

40+
`marked` is the required markdown parser peer used by `@threadplane/chat` when you render assistant messages through `<chat>`.
41+
4042
---
4143

4244
## Quick start
@@ -83,6 +85,9 @@ Both `@threadplane/langgraph` and `@threadplane/ag-ui` expose `provideAgent`/`in
8385
| `toolCalls()` | In-progress and completed tool calls |
8486
| `error()` | Last run error, if any |
8587
| `state()` | Raw AG-UI state snapshot |
88+
| `customEvents()` | Non-`on_interrupt` `CUSTOM` events for live a2ui and app-specific side effects |
89+
| `subagents()` | `ACTIVITY_*` entries with `activityType: 'subagent'`, projected to the neutral subagent contract |
90+
| `clientTools` | Browser client-tool catalog, pending calls, and result resolution used by `<chat [clientTools]>` |
8691

8792
Which capabilities populate depends on the events the AG-UI backend emits. `submit()`, `stop()`, and `regenerate()` are supported.
8893

libs/ag-ui/src/lib/testing/provide-fake-agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { FakeAgent } from './fake-agent';
1515
* @example
1616
* ```ts
1717
* TestBed.configureTestingModule({
18-
* providers: [provideFakeAgent({ responses: ['Hello from the fake agent'] })],
18+
* providers: [provideFakeAgent({ tokens: ['Hello from the fake agent'] })],
1919
* });
2020
* ```
2121
*/

0 commit comments

Comments
 (0)