Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apps/website/content/docs/chat/api/content-classifier.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ interface ContentClassifier {
/** A2UI surfaces parsed from the stream. */
readonly a2uiSurfaces: Signal<Map<string, A2uiSurface>>;

/** Per-surface A2UI accumulation state, keyed by surface ID. */
readonly a2uiSurfaceStates: Signal<Map<string, A2uiSurfaceState>>;

/** Parse errors encountered (non-fatal). */
readonly errors: Signal<string[]>;

Expand All @@ -53,12 +56,12 @@ interface ContentClassifier {
## ContentType

```typescript
type ContentType = 'undetermined' | 'markdown' | 'json-render' | 'a2ui' | 'mixed';
type ContentType = 'pending' | 'markdown' | 'json-render' | 'a2ui' | 'mixed';
```

| Value | Meaning |
|-------|---------|
| `undetermined` | No content received yet |
| `pending` | No content received yet |
| `markdown` | Plain text / markdown prose |
| `json-render` | JSON spec detected (first non-whitespace is `{`) |
| `a2ui` | A2UI payload detected via `---a2ui_JSON---` prefix, parsed as JSONL messages |
Expand Down
3 changes: 2 additions & 1 deletion apps/website/content/docs/chat/api/mock-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { MockAgent } from '@threadplane/chat';
## Signature

```typescript
function mockAgent(options?: MockAgentOptions): MockAgent
function mockAgent(opts?: MockAgentOptions): MockAgent
```

### Options
Expand All @@ -28,6 +28,7 @@ function mockAgent(options?: MockAgentOptions): MockAgent
| `withInterrupt` | `boolean` | `false` | Include a writable `interrupt` signal |
| `withSubagents` | `boolean` | `false` | Include a writable `subagents` signal |
| `history` | `AgentCheckpoint[]` | `undefined` | Include history and return an `AgentWithHistory`-compatible mock |
| `events$` | `Observable<AgentEvent>` | `EMPTY` | Event stream the mock exposes via `events$` (defaults to RxJS `EMPTY`) |

## Basic Test Usage

Expand Down
15 changes: 10 additions & 5 deletions apps/website/content/docs/chat/api/provide-chat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,21 @@ All chat components work without `provideChat()`. They use defaults:

```typescript
// This works fine without provideChat()
import { injectAgent, provideAgent } from '@threadplane/langgraph';

@Component({
imports: [ChatComponent],
providers: [
provideAgent({
apiUrl: 'http://localhost:2024',
assistantId: 'chat',
threadId: signal(null),
}),
],
template: `<chat [agent]="chatRef" />`,
})
export class SimpleChatComponent {
chatRef = agent({
apiUrl: 'http://localhost:2024',
assistantId: 'chat',
threadId: signal(null),
});
chatRef = injectAgent();
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Your App
LangGraph Platform
```

- **`@threadplane/langgraph`** provides `provideAgent()` and `injectAgent()` returning a `LangGraphAgent`, which satisfies the `Agent` contract consumed by `@threadplane/chat`. It exposes reactive Signals for `messages()`, `isLoading()`, `error()`, `interrupt()`, `toolCalls()`, `history()`, and more.
- **`@threadplane/langgraph`** provides `provideAgent()` and `injectAgent()` returning a `LangGraphAgent`, which satisfies the `Agent` contract consumed by `@threadplane/chat`. The base `Agent` contract exposes reactive Signals for `messages()`, `status()`, `isLoading()`, `error()`, `toolCalls()`, and `state()`, plus optional `interrupt()` and `subagents()`. Adapters can layer on more: LangGraph implements `AgentWithHistory`, adding `history()` for checkpoint time-travel.

- **`@threadplane/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 `@threadplane/render` - pass a view registry via the `[views]` input. The same `[views]` input enables A2UI rendering with `a2uiBasicCatalog()`, which currently maps 18 component types.

Expand Down
13 changes: 8 additions & 5 deletions apps/website/content/docs/chat/getting-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,24 @@ export const appConfig: ApplicationConfig = {
```ts
// chat-page.component.ts
import { Component, ChangeDetectionStrategy, signal } from '@angular/core';
import { agent } from '@threadplane/langgraph';
import { injectAgent, provideAgent } from '@threadplane/langgraph';
import { ChatComponent } from '@threadplane/chat';

@Component({
selector: 'app-chat-page',
standalone: true,
imports: [ChatComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
provideAgent({
assistantId: 'chat',
threadId: signal(null),
}),
],
template: `<div style="height: 100vh"><chat [agent]="chatAgent" /></div>`,
})
export class ChatPageComponent {
protected readonly chatAgent = agent({
assistantId: 'chat',
threadId: signal(null),
});
protected readonly chatAgent = injectAgent();
}
```

Expand Down
Loading