Skip to content

Commit 54e4771

Browse files
committed
docs: correct website docs drift
1 parent cad8ace commit 54e4771

26 files changed

Lines changed: 108 additions & 71 deletions

File tree

apps/website/content/AGENTS.md.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { ChatComponent as NgafChatComponent } from '@ngaf/chat';
2929
`,
3030
})
3131
export class ChatComponent {
32-
chat = agent({ assistantId: 'chat_agent' });
32+
chat = agent({ apiUrl: 'http://localhost:2024', assistantId: 'chat_agent' });
3333
}
3434
```
3535

apps/website/content/CLAUDE.md.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { ChatComponent as NgafChatComponent } from '@ngaf/chat';
2929
`,
3030
})
3131
export class ChatComponent {
32-
chat = agent({ assistantId: 'chat_agent' });
32+
chat = agent({ apiUrl: 'http://localhost:2024', assistantId: 'chat_agent' });
3333
}
3434
```
3535

apps/website/content/docs/agent/api/api-docs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@
651651
{
652652
"name": "apiUrl",
653653
"type": "string",
654-
"description": "Base URL of the LangGraph Platform API.",
655-
"optional": false
654+
"description": "Base URL of the LangGraph Platform API. Defaults to `provideAgent({ apiUrl })` when omitted.",
655+
"optional": true
656656
},
657657
{
658658
"name": "assistantId",

apps/website/content/docs/chat/api/api-docs.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5543,13 +5543,13 @@
55435543
{
55445544
"name": "assistantName",
55455545
"type": "string",
5546-
"description": "Override the default assistant display name (default: \"Assistant\").",
5546+
"description": "Shared assistant display name for consumers that read CHAT_CONFIG (default: \"Assistant\").",
55475547
"optional": true
55485548
},
55495549
{
55505550
"name": "avatarLabel",
55515551
"type": "string",
5552-
"description": "Override the default AI avatar label (default: \"A\").",
5552+
"description": "Shared AI avatar label for consumers that read CHAT_CONFIG (default: \"A\").",
55535553
"optional": true
55545554
},
55555555
{
@@ -5561,7 +5561,7 @@
55615561
{
55625562
"name": "renderRegistry",
55635563
"type": "AngularRegistry",
5564-
"description": "Default render registry for generative UI components.",
5564+
"description": "Shared render registry for consumers that read CHAT_CONFIG.",
55655565
"optional": true
55665566
}
55675567
],

apps/website/content/docs/chat/api/chat-config.mdx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ChatConfig
22

3-
`ChatConfig` is the configuration interface accepted by `provideChat()`. It defines global settings for chat composition components including the generative UI registry, assistant labels, and license token.
3+
`ChatConfig` is the configuration interface accepted by `provideChat()`. The object is stored under `CHAT_CONFIG` for application code that wants shared chat defaults, and `provideChat()` uses the license token to start the package license check.
44

55
**Import:**
66

@@ -13,11 +13,11 @@ import type { AngularRegistry } from '@ngaf/render';
1313

1414
```typescript
1515
interface ChatConfig {
16-
/** Default render registry for generative UI components. */
16+
/** Shared render registry for consumers that read CHAT_CONFIG. */
1717
renderRegistry?: AngularRegistry;
18-
/** Override the default AI avatar label (default: "A"). */
18+
/** Shared AI avatar label for consumers that read CHAT_CONFIG (default: "A"). */
1919
avatarLabel?: string;
20-
/** Override the default assistant display name (default: "Assistant"). */
20+
/** Shared assistant display name for consumers that read CHAT_CONFIG (default: "Assistant"). */
2121
assistantName?: string;
2222
/** Signed license token from cacheplane.dev. Optional; omitted in dev. */
2323
license?: string;
@@ -32,7 +32,7 @@ interface ChatConfig {
3232
avatarLabel?: string
3333
```
3434

35-
A short string (typically one or two characters) displayed in the AI avatar badge that appears next to assistant messages in composition components.
35+
A short string (typically one or two characters) for wrappers or components that choose to read `CHAT_CONFIG`.
3636

3737
**Default:** `"A"`
3838

@@ -42,15 +42,15 @@ A short string (typically one or two characters) displayed in the AI avatar badg
4242
provideChat({ avatarLabel: 'AI' });
4343
```
4444

45-
There is no avatar-specific CSS token. Use `avatarLabel` for the badge text, and use the shared `--ngaf-chat-*` tokens such as `--ngaf-chat-surface`, `--ngaf-chat-text`, and `--ngaf-chat-text-muted` to align surrounding chat surfaces with your app theme.
45+
There is no avatar-specific CSS token. Use the shared `--ngaf-chat-*` tokens such as `--ngaf-chat-surface`, `--ngaf-chat-text`, and `--ngaf-chat-text-muted` to align chat surfaces with your app theme.
4646

4747
### assistantName
4848

4949
```typescript
5050
assistantName?: string
5151
```
5252

53-
The display name for the AI assistant. Used in labels, ARIA attributes, and any place where the assistant needs a human-readable name.
53+
The display name for wrappers or components that choose to read `CHAT_CONFIG`.
5454

5555
**Default:** `"Assistant"`
5656

@@ -66,7 +66,7 @@ provideChat({ assistantName: 'Code Copilot' });
6666
renderRegistry?: AngularRegistry
6767
```
6868

69-
The default render registry for generative UI components.
69+
A shared render registry value for consumers that inject `CHAT_CONFIG`. `ChatComponent` does not read this value directly; pass a `ViewRegistry` to the `<chat [views]="...">` input for built-in generative UI rendering.
7070

7171
**Example:**
7272

@@ -112,12 +112,21 @@ export class ChatHeaderComponent {
112112
}
113113
```
114114

115+
## Gotcha: Inputs Still Win
116+
117+
`provideChat()` is not a replacement for component inputs. For generative UI, configure the chat surface directly:
118+
119+
```html
120+
<chat [agent]="agentRef" [views]="views" [store]="store" [handlers]="handlers" />
121+
```
122+
123+
Use `CHAT_CONFIG` when you are building your own wrappers or want route-level defaults that your code reads explicitly.
124+
115125
## Type Location
116126

117-
The `ChatConfig` interface is defined in two files within the library:
127+
The canonical `ChatConfig` interface is defined alongside `provideChat()`:
118128

119129
- `libs/chat/src/lib/provide-chat.ts` -- The canonical definition with JSDoc comments, alongside the `provideChat()` function and `CHAT_CONFIG` token
120-
- `libs/chat/src/lib/chat.types.ts` -- A separate internal type used by lower-level chat types
121130

122131
The public API exports `ChatConfig` as a type-only export:
123132

apps/website/content/docs/chat/api/provide-chat.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# provideChat()
22

3-
`provideChat` is the provider factory that registers `@ngaf/chat` configuration in Angular's dependency injection system. Call it once in your `ApplicationConfig` (or at the route level) to set global defaults used by chat composition components.
3+
`provideChat` is the provider factory that registers `@ngaf/chat` configuration in Angular's dependency injection system and starts the package license check. Call it in your `ApplicationConfig` or at the route level when you need a shared `CHAT_CONFIG` value.
44

55
```typescript
66
import { provideChat } from '@ngaf/chat';
@@ -23,7 +23,7 @@ function provideChat(config: ChatConfig): EnvironmentProviders
2323

2424
| Parameter | Type | Description |
2525
|-----------|------|-------------|
26-
| `config` | `ChatConfig` | Configuration object with optional render registry, avatar label, and assistant name |
26+
| `config` | `ChatConfig` | Configuration object with optional render registry, avatar label, assistant name, and license token |
2727

2828
**Returns:** `EnvironmentProviders` -- created via `makeEnvironmentProviders()`, compatible with `bootstrapApplication`, `ApplicationConfig`, and route-level `providers`.
2929

@@ -35,7 +35,7 @@ function provideChat(config: ChatConfig): EnvironmentProviders
3535
{ provide: CHAT_CONFIG, useValue: config }
3636
```
3737

38-
This makes the `ChatConfig` object available throughout the application via the `CHAT_CONFIG` injection token.
38+
This makes the `ChatConfig` object available throughout the application via the `CHAT_CONFIG` injection token. `provideChat()` does not automatically wire generative UI into `<chat>`; pass `[views]`, `[store]`, and `[handlers]` directly to `ChatComponent`.
3939

4040
## CHAT_CONFIG Injection Token
4141

@@ -67,8 +67,10 @@ See the [ChatConfig API reference](/docs/chat/api/chat-config) for the full inte
6767

6868
| Option | Type | Default | Description |
6969
|--------|------|---------|-------------|
70-
| `avatarLabel` | `string` | `"A"` | AI avatar badge text |
71-
| `assistantName` | `string` | `"Assistant"` | AI assistant display name |
70+
| `renderRegistry` | `AngularRegistry` | `undefined` | Stored on `CHAT_CONFIG` for consumers that want a shared render registry. `<chat>` uses the `[views]` input directly. |
71+
| `avatarLabel` | `string` | `"A"` | Shared avatar label for consumers that inject `CHAT_CONFIG` |
72+
| `assistantName` | `string` | `"Assistant"` | Shared assistant display name for consumers that inject `CHAT_CONFIG` |
73+
| `license` | `string` | `undefined` | Signed license token used by the package license check |
7274

7375
## Usage Patterns
7476

@@ -126,7 +128,7 @@ All chat components work without `provideChat()`. They use defaults:
126128

127129
- Avatar label: `"A"`
128130
- Assistant name: `"Assistant"`
129-
- Generative UI requires `[views]` input on `ChatComponent`
131+
- Generative UI still requires the `[views]` input on `ChatComponent`
130132

131133
```typescript
132134
// This works fine without provideChat()
@@ -136,6 +138,7 @@ All chat components work without `provideChat()`. They use defaults:
136138
})
137139
export class SimpleChatComponent {
138140
chatRef = agent({
141+
apiUrl: 'http://localhost:2024',
139142
assistantId: 'chat_agent',
140143
threadId: signal(null),
141144
});

apps/website/content/docs/chat/components/chat.mdx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import { ChatComponent } from '@ngaf/chat';
4848
})
4949
export class ChatPageComponent {
5050
chatRef = agent({
51+
apiUrl: 'http://localhost:2024',
5152
assistantId: 'chat_agent',
5253
threadId: signal(null),
5354
});
@@ -100,6 +101,7 @@ When you pass a non-empty `threads` array, a sidebar appears on the left (hidden
100101
})
101102
export class ChatWithThreadsComponent {
102103
chatRef = agent({
104+
apiUrl: 'http://localhost:2024',
103105
assistantId: 'chat_agent',
104106
threadId: signal(null),
105107
});
@@ -151,7 +153,19 @@ AI messages containing JSON are parsed character-by-character as tokens stream.
151153

152154
## A2UI Rendering
153155

154-
When AI messages contain A2UI content (prefixed with `---a2ui_JSON---`), the component auto-detects and renders surfaces using the built-in `a2uiBasicCatalog()`. This includes 12 components from the A2UI v0.9 basic catalog: Text, Image, Icon, Divider, Row, Column, Card, List, Button, TextField, CheckBox, and ChoicePicker.
156+
When AI messages contain A2UI content (prefixed with `---a2ui_JSON---`), the component auto-detects A2UI mode. Pass `a2uiBasicCatalog()` to `[views]` to render the built-in catalog:
157+
158+
```typescript
159+
import { ChatComponent, a2uiBasicCatalog } from '@ngaf/chat';
160+
161+
views = a2uiBasicCatalog();
162+
```
163+
164+
```html
165+
<chat [agent]="chatRef" [views]="views" />
166+
```
167+
168+
The catalog currently maps 18 component types: Text, Image, Icon, Divider, Row, Column, Card, List, Button, TextField, CheckBox, MultipleChoice, DateTimeInput, Slider, Tabs, Modal, Video, and AudioPlayer.
155169

156170
A2UI surfaces support two-way data binding, button actions, template expansion over collections, and validation. See the [A2UI guide](/docs/render/a2ui/overview) for details.
157171

apps/website/content/docs/chat/getting-started/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ LangGraph Platform
6060

6161
- **`@ngaf/langgraph`** provides the `agent()` function and returns a `LangGraphAgent`, which satisfies the `Agent` contract consumed by `@ngaf/chat`. It exposes reactive Signals for `messages()`, `isLoading()`, `error()`, `interrupt()`, `toolCalls()`, `history()`, and more.
6262

63-
- **`@ngaf/render`** provides `RenderSpecComponent` and view registries for rendering JSON UI specs as Angular components. The `ChatComponent` auto-detects JSON specs in AI messages and renders them through `@ngaf/render` - pass a view registry via the `[views]` input. The `ChatComponent` also auto-detects A2UI v0.9 payloads and renders them using a built-in 12-component catalog.
63+
- **`@ngaf/render`** provides `RenderSpecComponent` and view registries for rendering JSON UI specs as Angular components. The `ChatComponent` auto-detects JSON specs in AI messages and renders them through `@ngaf/render` - pass a view registry via the `[views]` input. The same `[views]` input enables A2UI rendering with `a2uiBasicCatalog()`, which currently maps 18 component types.
6464

6565
## When to Use `ChatComponent` vs. Custom Assembly
6666

apps/website/content/docs/chat/guides/configuration.mdx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Configuration
22

3-
`@ngaf/chat` uses Angular's dependency injection system for global configuration. The `provideChat()` function registers a `ChatConfig` object under the `CHAT_CONFIG` injection token.
3+
`@ngaf/chat` uses Angular's dependency injection system for shared configuration. The `provideChat()` function registers a `ChatConfig` object under the `CHAT_CONFIG` injection token and starts the package license check.
44

55
## provideChat()
66

7-
Call `provideChat()` in your application's provider array to set global configuration for chat components.
7+
Call `provideChat()` in your application's provider array when your application or wrappers need to inject shared chat configuration.
88

99
```typescript
1010
// app.config.ts
@@ -32,21 +32,31 @@ function provideChat(config: ChatConfig): EnvironmentProviders
3232
## ChatConfig Interface
3333

3434
```typescript
35+
import type { AngularRegistry } from '@ngaf/render';
36+
3537
interface ChatConfig {
38+
/** Default render registry for consumers that read CHAT_CONFIG. */
39+
renderRegistry?: AngularRegistry;
40+
3641
/** Override the default AI avatar label (default: "A"). */
3742
avatarLabel?: string;
3843
3944
/** Override the default assistant display name (default: "Assistant"). */
4045
assistantName?: string;
46+
47+
/** Signed license token from cacheplane.dev. Optional in development. */
48+
license?: string;
4149
}
4250
```
4351

4452
### Options
4553

4654
| Option | Type | Default | Description |
4755
|--------|------|---------|-------------|
48-
| `avatarLabel` | `string` | `"A"` | Single character or short string displayed in the AI avatar badge next to assistant messages. |
49-
| `assistantName` | `string` | `"Assistant"` | Display name for the AI assistant, used in labels and ARIA attributes. |
56+
| `renderRegistry` | `AngularRegistry` | `undefined` | Stored on `CHAT_CONFIG` for consumers that want a shared render registry. Pass `[views]` directly to `ChatComponent` for built-in generative UI rendering. |
57+
| `avatarLabel` | `string` | `"A"` | Single character or short string for consumers that inject `CHAT_CONFIG`. |
58+
| `assistantName` | `string` | `"Assistant"` | Display name for consumers that inject `CHAT_CONFIG`. |
59+
| `license` | `string` | `undefined` | Signed license token used by the package license check. |
5060

5161
## CHAT_CONFIG Injection Token
5262

@@ -110,6 +120,6 @@ All composition components use sensible defaults. If you do not call `provideCha
110120

111121
- Use `"A"` as the avatar label
112122
- Use `"Assistant"` as the assistant name
113-
- Have no render registry (generative UI will not render)
123+
- Have no injected `CHAT_CONFIG`
114124

115-
This means you can use `ChatComponent`, `ChatInputComponent`, and all other components without any global configuration for basic chat functionality.
125+
This means you can use `ChatComponent`, `ChatInputComponent`, and all other components without global configuration for basic chat functionality. Generative UI is controlled by the `ChatComponent` `[views]`, `[store]`, and `[handlers]` inputs.

apps/website/content/docs/chat/guides/generative-ui.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const myViews = views({
4646
})
4747
export class ChatPageComponent {
4848
chatRef = agent({
49+
apiUrl: 'http://localhost:2024',
4950
assistantId: 'gen_ui_agent',
5051
threadId: signal(null),
5152
});
@@ -132,7 +133,7 @@ The store enables two-way data binding between generative UI components and your
132133

133134
## A2UI Protocol
134135

135-
For agents that implement Google's A2UI v0.9 protocol, `ChatComponent` auto-detects A2UI payloads (prefixed with `---a2ui_JSON---`) and renders them using the built-in A2UI catalog. See the [A2UI guide](/docs/render/a2ui/overview) for details.
136+
For agents that emit A2UI JSONL payloads, `ChatComponent` auto-detects content prefixed with `---a2ui_JSON---`. Pass `a2uiBasicCatalog()` to `[views]` when you want those surfaces rendered with the built-in components. See the [A2UI guide](/docs/render/a2ui/overview) for details.
136137

137138
## What's Next
138139

@@ -152,6 +153,6 @@ For agents that implement Google's A2UI v0.9 protocol, `ChatComponent` auto-dete
152153
Full reference for the JSON spec format, prop expressions, and element types.
153154
</Card>
154155
<Card title="A2UI Protocol" icon="layers" href="/docs/render/a2ui/overview">
155-
Render A2UI v0.9 surfaces with the built-in 12-component catalog.
156+
Render A2UI surfaces with the built-in 18-component catalog.
156157
</Card>
157158
</CardGroup>

0 commit comments

Comments
 (0)