@assistant-ui/mcp-docs-server 0.1.32 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/organized/code-examples/waterfall.md +20 -22
- package/.docs/organized/code-examples/with-a2a.md +24 -24
- package/.docs/organized/code-examples/with-ag-ui.md +30 -25
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +11 -9
- package/.docs/organized/code-examples/with-artifacts.md +49 -37
- package/.docs/organized/code-examples/with-assistant-transport.md +63 -51
- package/.docs/organized/code-examples/with-browser-extension.md +22 -10
- package/.docs/organized/code-examples/with-chain-of-thought.md +406 -87
- package/.docs/organized/code-examples/with-cloud-standalone.md +25 -24
- package/.docs/organized/code-examples/with-cloud.md +11 -9
- package/.docs/organized/code-examples/with-custom-thread-list.md +14 -12
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +23 -21
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +14 -13
- package/.docs/organized/code-examples/with-expo.md +44 -29
- package/.docs/organized/code-examples/with-external-store.md +9 -7
- package/.docs/organized/code-examples/with-ffmpeg.md +322 -285
- package/.docs/organized/code-examples/with-generative-ui.md +1066 -256
- package/.docs/organized/code-examples/with-google-adk.md +10 -8
- package/.docs/organized/code-examples/with-heat-graph.md +13 -11
- package/.docs/organized/code-examples/with-image-generation.md +19 -17
- package/.docs/organized/code-examples/with-interactables.md +317 -239
- package/.docs/organized/code-examples/with-langchain.md +14 -12
- package/.docs/organized/code-examples/with-langgraph.md +91 -83
- package/.docs/organized/code-examples/with-livekit.md +24 -22
- package/.docs/organized/code-examples/with-mcp.md +18 -12
- package/.docs/organized/code-examples/with-opencode.md +66 -66
- package/.docs/organized/code-examples/with-react-hook-form.md +19 -17
- package/.docs/organized/code-examples/with-react-ink.md +297 -102
- package/.docs/organized/code-examples/with-react-router.md +17 -15
- package/.docs/organized/code-examples/with-resumable-stream.md +15 -14
- package/.docs/organized/code-examples/with-store.md +78 -76
- package/.docs/organized/code-examples/with-tanstack.md +13 -14
- package/.docs/organized/code-examples/with-tap-runtime.md +26 -24
- package/.docs/raw/docs/(docs)/architecture.mdx +94 -42
- package/.docs/raw/docs/(docs)/cli.mdx +1 -2
- package/.docs/raw/docs/(docs)/installation.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +5 -1
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +15 -15
- package/.docs/raw/docs/(reference)/api-reference/external-store/runtime.mdx +14 -1
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +18 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +33 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/spec.mdx +45 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +41 -41
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +19 -1
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +122 -122
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +43 -2
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +6 -0
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +4 -6
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +30 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/component-tools.mdx +20 -3
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +8 -8
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +52 -4
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +100 -10
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +7 -59
- package/.docs/raw/docs/cloud/ai-sdk.mdx +0 -2
- package/.docs/raw/docs/{(docs)/copilots → copilots}/model-context.mdx +34 -26
- package/.docs/raw/docs/{(docs)/copilots → copilots}/motivation.mdx +32 -26
- package/.docs/raw/docs/guides/chain-of-thought.mdx +7 -9
- package/.docs/raw/docs/guides/context-api.mdx +2 -1
- package/.docs/raw/docs/guides/index.mdx +3 -12
- package/.docs/raw/docs/guides/mentions.mdx +4 -4
- package/.docs/raw/docs/guides/slash-commands.mdx +1 -1
- package/.docs/raw/docs/guides/suggestions.mdx +1 -1
- package/.docs/raw/docs/ink/adapters.mdx +23 -1
- package/.docs/raw/docs/ink/hooks.mdx +101 -85
- package/.docs/raw/docs/ink/migration.mdx +1 -1
- package/.docs/raw/docs/ink/primitives.mdx +2 -2
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +1 -1
- package/.docs/raw/docs/integrations/index.mdx +2 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +17 -2
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +232 -0
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +10 -16
- package/.docs/raw/docs/primitives/message.mdx +9 -10
- package/.docs/raw/docs/react-native/hooks.mdx +62 -79
- package/.docs/raw/docs/react-native/migration.mdx +1 -1
- package/.docs/raw/docs/react-native/primitives.mdx +2 -2
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +3 -0
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +41 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +122 -1
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +46 -4
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +7 -1
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +54 -12
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +62 -4
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +30 -7
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +108 -38
- package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +14 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +64 -50
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +98 -86
- package/.docs/raw/docs/tools/backend.mdx +144 -0
- package/.docs/raw/docs/tools/defining-tools.mdx +538 -0
- package/.docs/raw/docs/tools/dynamic-tools.mdx +110 -0
- package/.docs/raw/docs/tools/generative-ui.mdx +214 -0
- package/.docs/raw/docs/tools/index.mdx +71 -0
- package/.docs/raw/docs/{guides → tools}/interactables.mdx +1 -1
- package/.docs/raw/docs/{integrations/tools → tools}/mcp.mdx +145 -50
- package/.docs/raw/docs/{guides → tools}/multi-agent.mdx +15 -17
- package/.docs/raw/docs/tools/tool-ui.mdx +967 -0
- package/.docs/raw/docs/{integrations/tools/react-mcp.mdx → tools/user-managed-mcp.mdx} +7 -7
- package/.docs/raw/docs/ui/directive-text.mdx +3 -3
- package/.docs/raw/docs/ui/mcp-config.mdx +4 -4
- package/.docs/raw/docs/ui/mermaid.mdx +16 -9
- package/.docs/raw/docs/ui/part-grouping.mdx +84 -50
- package/.docs/raw/docs/ui/reasoning.mdx +4 -5
- package/.docs/raw/docs/ui/tool-fallback.mdx +16 -0
- package/.docs/raw/docs/ui/tool-group.mdx +5 -6
- package/.docs/raw/docs/utilities/heat-graph.mdx +1 -1
- package/.docs/raw/docs/utilities/react-o11y.mdx +2 -2
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/code-examples.d.ts.map +1 -1
- package/dist/prepare-docs/code-examples.js.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.js.map +1 -1
- package/dist/prepare-docs/prepare.js.map +1 -1
- package/dist/stdio.js.map +1 -1
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/utils/mdx.js.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js.map +1 -1
- package/package.json +5 -5
- package/.docs/organized/code-examples/with-parent-id-grouping.md +0 -596
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +0 -151
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +0 -230
- package/.docs/raw/docs/guides/generative-ui.mdx +0 -142
- package/.docs/raw/docs/guides/tool-ui.mdx +0 -858
- package/.docs/raw/docs/guides/tools.mdx +0 -736
- /package/.docs/raw/docs/{(docs)/copilots → copilots}/assistant-frame.mdx +0 -0
- /package/.docs/raw/docs/{(docs)/copilots → copilots}/make-assistant-visible.mdx +0 -0
- /package/.docs/raw/docs/{(docs)/copilots → copilots}/use-assistant-instructions.mdx +0 -0
- /package/.docs/raw/docs/{guides → tools}/mcp-apps.mdx +0 -0
|
@@ -33,61 +33,113 @@ A React state management context for assistant chat. The runtime handles data co
|
|
|
33
33
|
A hosted service that enhances your assistant experience with comprehensive thread management and message history. Assistant Cloud stores complete message history, automatically persists threads, supports human-in-the-loop workflows, and integrates with common auth providers to seamlessly allow users to resume conversations at any point. [Cloud Docs](/docs/cloud)
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
## What each layer owns
|
|
37
|
+
|
|
38
|
+
Before picking a runtime or wiring components, it helps to see which layer owns which responsibility. assistant-ui draws hard lines between rendering, conversation state, and where the model actually runs.
|
|
39
|
+
|
|
40
|
+
### UI layer
|
|
41
|
+
Primitives and prebuilt components render the assistant experience: thread, messages, composer, message parts, actions, attachments, suggestions. They read and write through the runtime context, not directly against the backend or model.
|
|
42
|
+
|
|
43
|
+
### Runtime layer
|
|
44
|
+
The state and behavior boundary between UI and backend. The runtime owns or adapts conversation state: messages, thread state, composer state, run lifecycle, branching, editing, regeneration. Different runtimes exist because different backends own this state differently. `LocalRuntime` keeps state internal; `ExternalStoreRuntime` delegates to your store.
|
|
45
|
+
|
|
46
|
+
### Backend / agent layer
|
|
47
|
+
Produces assistant output and app-specific behavior. Depending on the runtime and protocol, the backend may emit text, message parts, tool calls, metadata, agent state, attachments, or other events that the runtime maps into UI state.
|
|
48
|
+
|
|
49
|
+
### Integration / protocol layer
|
|
50
|
+
Runtime adapters and protocols bridge assistant-ui to different backend shapes: AI SDK, LangGraph, LangChain, ADK, A2A, AG-UI, OpenCode, or your own. The DataStream and AssistantTransport protocols let a generic backend talk to assistant-ui without a custom adapter per app.
|
|
51
|
+
|
|
52
|
+
### Persistence layer
|
|
53
|
+
Thread and message history can be stored by Assistant Cloud or by your own database via thread and history adapters. Persistence is separate from rendering and backend generation, though the runtime coordinates with it.
|
|
54
|
+
|
|
55
|
+
## There are three common ways to architect your assistant-ui application:
|
|
37
56
|
|
|
38
57
|
#### **1. Direct Integration with External Providers**
|
|
39
58
|
|
|
40
|
-
|
|
41
|
-
graph TD
|
|
59
|
+
<Flow.Root
|
|
60
|
+
llm={`graph TD
|
|
42
61
|
A[Frontend Components] --> B[Runtime]
|
|
43
|
-
B --> D[External Providers or LLM APIs]
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```
|
|
62
|
+
B --> D[External Providers or LLM APIs]`}
|
|
63
|
+
>
|
|
64
|
+
<Flow.Column>
|
|
65
|
+
<Flow.Node tone="pink">Frontend Components</Flow.Node>
|
|
66
|
+
<Flow.Arrow direction="down" length={36} />
|
|
67
|
+
<Flow.Node tone="blue">Runtime</Flow.Node>
|
|
68
|
+
<Flow.Arrow direction="down" length={36} />
|
|
69
|
+
<Flow.Node tone="red">External Providers or LLM APIs</Flow.Node>
|
|
70
|
+
</Flow.Column>
|
|
71
|
+
</Flow.Root>
|
|
54
72
|
|
|
55
73
|
#### **2. Using your own API endpoint**
|
|
56
74
|
|
|
57
|
-
|
|
58
|
-
graph TD
|
|
75
|
+
<Flow.Root
|
|
76
|
+
llm={`graph TD
|
|
59
77
|
A[Frontend Components] --> B[Runtime]
|
|
60
78
|
B --> E[Your API Backend]
|
|
61
|
-
E --> D[External Providers or LLM APIs]
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
E --> D[External Providers or LLM APIs]`}
|
|
80
|
+
>
|
|
81
|
+
<Flow.Column>
|
|
82
|
+
<Flow.Node tone="pink">Frontend Components</Flow.Node>
|
|
83
|
+
<Flow.Arrow direction="down" length={36} />
|
|
84
|
+
<Flow.Node tone="blue">Runtime</Flow.Node>
|
|
85
|
+
<Flow.Arrow direction="down" length={36} />
|
|
86
|
+
<Flow.Node tone="red">Your API Backend</Flow.Node>
|
|
87
|
+
<Flow.Arrow direction="down" length={36} />
|
|
88
|
+
<Flow.Node tone="red">External Providers or LLM APIs</Flow.Node>
|
|
89
|
+
</Flow.Column>
|
|
90
|
+
</Flow.Root>
|
|
73
91
|
|
|
74
92
|
#### **3. With Assistant Cloud**
|
|
75
93
|
|
|
76
|
-
|
|
77
|
-
graph TD
|
|
94
|
+
<Flow.Root
|
|
95
|
+
llm={`graph TD
|
|
78
96
|
A[Frontend Components] --> B[Runtime]
|
|
79
97
|
B --> C[Cloud]
|
|
80
98
|
E --> C
|
|
81
99
|
C --> D[External Providers or LLM APIs]
|
|
82
|
-
B --> E[Your API Backend]
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
B --> E[Your API Backend]`}
|
|
101
|
+
>
|
|
102
|
+
<Flow.Canvas
|
|
103
|
+
edges={[
|
|
104
|
+
{ from: "runtime", to: "backend", route: "down", fromOffset: -20 },
|
|
105
|
+
{ from: "runtime", to: "cloud", route: "down", fromOffset: 20 },
|
|
106
|
+
{ from: "cloud", to: "providers", route: "down" },
|
|
107
|
+
]}
|
|
108
|
+
>
|
|
109
|
+
<Flow.Column>
|
|
110
|
+
<Flow.Node tone="pink">Frontend Components</Flow.Node>
|
|
111
|
+
<Flow.Arrow direction="down" length={36} />
|
|
112
|
+
<Flow.Node flowId="runtime" tone="blue">Runtime</Flow.Node>
|
|
113
|
+
<div className="h-10" aria-hidden />
|
|
114
|
+
<Flow.Row>
|
|
115
|
+
<Flow.Node flowId="backend" tone="red">Your API Backend</Flow.Node>
|
|
116
|
+
<Flow.Arrow length={48} />
|
|
117
|
+
<Flow.Node flowId="cloud" tone="green">Cloud</Flow.Node>
|
|
118
|
+
</Flow.Row>
|
|
119
|
+
<div className="h-10" aria-hidden />
|
|
120
|
+
<Flow.Node flowId="providers" tone="red">External Providers or LLM APIs</Flow.Node>
|
|
121
|
+
</Flow.Column>
|
|
122
|
+
</Flow.Canvas>
|
|
123
|
+
</Flow.Root>
|
|
124
|
+
|
|
125
|
+
## Going deeper
|
|
126
|
+
|
|
127
|
+
These pages go one level deeper on runtime internals, adapters, and persistence.
|
|
128
|
+
|
|
129
|
+
<Cards>
|
|
130
|
+
<Card
|
|
131
|
+
title="Runtime architecture"
|
|
132
|
+
description="Core runtimes, protocol layers, and framework adapters — what each layer owns."
|
|
133
|
+
href="/docs/runtimes/concepts/architecture"
|
|
134
|
+
/>
|
|
135
|
+
<Card
|
|
136
|
+
title="Adapters"
|
|
137
|
+
description="Attachments, speech, feedback, history, suggestions across runtimes."
|
|
138
|
+
href="/docs/runtimes/concepts/adapters"
|
|
139
|
+
/>
|
|
140
|
+
<Card
|
|
141
|
+
title="Threads"
|
|
142
|
+
description="Multi-thread support: cloud, custom database, ExternalStore."
|
|
143
|
+
href="/docs/runtimes/concepts/threads"
|
|
144
|
+
/>
|
|
145
|
+
</Cards>
|
|
@@ -72,13 +72,12 @@ Use `--example` to create a project from one of the monorepo examples with full
|
|
|
72
72
|
| `with-ag-ui` | [AG-UI protocol](/docs/runtimes/ag-ui) integration | `npx assistant-ui create my-app -e with-ag-ui` |
|
|
73
73
|
| `with-assistant-transport` | Custom backend via Assistant Transport | `npx assistant-ui create my-app -e with-assistant-transport` |
|
|
74
74
|
| `with-resumable-stream` | Resumable LLM stream that survives reload mid-response | `npx assistant-ui create my-app -e with-resumable-stream` |
|
|
75
|
-
| `with-chain-of-thought` | Chain-of-thought
|
|
75
|
+
| `with-chain-of-thought` | Chain-of-thought reasoning, tool calls, and source citations | `npx assistant-ui create my-app -e with-chain-of-thought` |
|
|
76
76
|
| `with-external-store` | External message store | `npx assistant-ui create my-app -e with-external-store` |
|
|
77
77
|
| `with-custom-thread-list` | Custom thread list UI | `npx assistant-ui create my-app -e with-custom-thread-list` |
|
|
78
78
|
| `with-react-hook-form` | React Hook Form integration | `npx assistant-ui create my-app -e with-react-hook-form` |
|
|
79
79
|
| `with-ffmpeg` | FFmpeg video processing tool | `npx assistant-ui create my-app -e with-ffmpeg` |
|
|
80
80
|
| `with-elevenlabs-scribe` | ElevenLabs voice transcription | `npx assistant-ui create my-app -e with-elevenlabs-scribe` |
|
|
81
|
-
| `with-parent-id-grouping` | Message part grouping | `npx assistant-ui create my-app -e with-parent-id-grouping` |
|
|
82
81
|
| `with-expo` | Expo / React Native | `npx assistant-ui create my-app -e with-expo` |
|
|
83
82
|
| `with-react-ink` | Terminal UI chat | `npx assistant-ui create my-app -e with-react-ink` |
|
|
84
83
|
| `with-react-router` | React Router v7 integration | `npx assistant-ui create my-app -e with-react-router` |
|
|
@@ -3,7 +3,7 @@ title: Persistence Adapters
|
|
|
3
3
|
description: Persistence adapters for saving assistant-ui message history, remote thread lists, and long-running chat sessions across browser reloads.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { GenericThreadHistoryAdapter, InMemoryThreadListAdapter, MessageFormatAdapter, RemoteThreadListAdapter, ThreadHistoryAdapter } from "@/generated/typeDocs";
|
|
6
|
+
import { ExportedMessageRepository, GenericThreadHistoryAdapter, InMemoryThreadListAdapter, MessageFormatAdapter, RemoteThreadListAdapter, ThreadHistoryAdapter } from "@/generated/typeDocs";
|
|
7
7
|
|
|
8
8
|
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
9
|
{/* Do not edit manually. */}
|
|
@@ -14,6 +14,10 @@ import { GenericThreadHistoryAdapter, InMemoryThreadListAdapter, MessageFormatAd
|
|
|
14
14
|
|
|
15
15
|
## API Reference
|
|
16
16
|
|
|
17
|
+
### ExportedMessageRepository
|
|
18
|
+
|
|
19
|
+
<ParametersTable {...ExportedMessageRepository} />
|
|
20
|
+
|
|
17
21
|
### GenericThreadHistoryAdapter
|
|
18
22
|
|
|
19
23
|
<ParametersTable {...GenericThreadHistoryAdapter} />
|
|
@@ -14,6 +14,20 @@ import { useExternalMessageConverter } from "@/generated/typeDocs";
|
|
|
14
14
|
|
|
15
15
|
## API Reference
|
|
16
16
|
|
|
17
|
+
### bindExternalStoreMessage
|
|
18
|
+
|
|
19
|
+
<Callout type="warn">
|
|
20
|
+
<strong>Deprecated.</strong> This API is experimental and may change without notice.
|
|
21
|
+
</Callout>
|
|
22
|
+
|
|
23
|
+
Attach the original external store message(s) to a ThreadMessage or message part.
|
|
24
|
+
This is a no-op if the target already has a bound message.
|
|
25
|
+
Use `getExternalStoreMessages` to retrieve the bound messages later.
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
const bindExternalStoreMessage: <T>(target: object, message: T | T[]) => void;
|
|
29
|
+
```
|
|
30
|
+
|
|
17
31
|
### getExternalStoreMessages
|
|
18
32
|
|
|
19
33
|
```ts
|
|
@@ -33,20 +47,6 @@ const unstable_convertExternalMessages: <T extends WeakKey>(messages: T[], callb
|
|
|
33
47
|
### unstable_createMessageConverter
|
|
34
48
|
|
|
35
49
|
```ts
|
|
36
|
-
const unstable_createMessageConverter: <T extends object>(callback: useExternalMessageConverter.Callback<T>) => { useThreadMessages: ({ messages, isRunning, joinStrategy, metadata, }: { messages: T[]; isRunning: boolean; joinStrategy?:
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### bindExternalStoreMessage
|
|
40
|
-
|
|
41
|
-
<Callout type="warn">
|
|
42
|
-
<strong>Deprecated.</strong> This API is experimental and may change without notice.
|
|
43
|
-
</Callout>
|
|
44
|
-
|
|
45
|
-
Attach the original external store message(s) to a ThreadMessage or message part.
|
|
46
|
-
This is a no-op if the target already has a bound message.
|
|
47
|
-
Use `getExternalStoreMessages` to retrieve the bound messages later.
|
|
48
|
-
|
|
49
|
-
```ts
|
|
50
|
-
const bindExternalStoreMessage: <T>(target: object, message: T | T[]) => void;
|
|
50
|
+
const unstable_createMessageConverter: <T extends object>(callback: useExternalMessageConverter.Callback<T>) => { useThreadMessages: ({ messages, isRunning, joinStrategy, metadata, }: { messages: T[]; isRunning: boolean; joinStrategy?: JoinStrategy | undefined; metadata?: useExternalMessageConverter.Metadata; }) => ThreadMessage[]; toThreadMessages: (messages: T[], isRunning?: boolean, metadata?: useExternalMessageConverter.Metadata) => ThreadMessage[]; toOriginalMessages: (input: ThreadState | ThreadMessage | ThreadMessage["content"][number]) => unknown[]; toOriginalMessage: (input: ThreadState | ThreadMessage | ThreadMessage["content"][number]) => {}; useOriginalMessage: () => {}; useOriginalMessages: () => unknown[]; };
|
|
51
51
|
```
|
|
52
52
|
{/* api-reference:end */}
|
|
@@ -3,7 +3,7 @@ title: External Store Runtime
|
|
|
3
3
|
description: Runtime components, options, and adapters for using assistant-ui with externally owned chat state.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { ExternalStoreAdapter, ExternalThread, ExternalThreadProps, ExternalThreadQueueAdapter, useExternalStoreRuntime } from "@/generated/typeDocs";
|
|
6
|
+
import { ExternalStoreAdapter, ExternalThread, ExternalThreadProps, ExternalThreadQueueAdapter, useExternalStoreRuntime, useExternalStoreSharedOptions } from "@/generated/typeDocs";
|
|
7
7
|
|
|
8
8
|
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
9
|
{/* Do not edit manually. */}
|
|
@@ -28,9 +28,22 @@ import { ExternalStoreAdapter, ExternalThread, ExternalThreadProps, ExternalThre
|
|
|
28
28
|
|
|
29
29
|
### ExternalThreadQueueAdapter
|
|
30
30
|
|
|
31
|
+
The queue surface a runtime exposes so the composer can stay usable during a
|
|
32
|
+
run and render the pending messages.
|
|
33
|
+
|
|
31
34
|
<ParametersTable {...ExternalThreadQueueAdapter} />
|
|
32
35
|
|
|
36
|
+
### pickExternalStoreSharedOptions
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
const pickExternalStoreSharedOptions: (options: ExternalStoreSharedOptions) => ExternalStoreSharedOptions;
|
|
40
|
+
```
|
|
41
|
+
|
|
33
42
|
### useExternalStoreRuntime
|
|
34
43
|
|
|
35
44
|
<ParametersTable {...useExternalStoreRuntime} />
|
|
45
|
+
|
|
46
|
+
### useExternalStoreSharedOptions
|
|
47
|
+
|
|
48
|
+
<ParametersTable {...useExternalStoreSharedOptions} />
|
|
36
49
|
{/* api-reference:end */}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Generative UI API Reference
|
|
3
|
+
description: Spec-driven generative UI for assistant-ui. The data format an assistant streams, the component registry that resolves it, and the renderer that turns it into React elements.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
7
|
+
{/* The page list is generated from exported APIs; edit only the manual prose slot. */}
|
|
8
|
+
|
|
9
|
+
## Pages
|
|
10
|
+
|
|
11
|
+
<Cards>
|
|
12
|
+
<Card title={"Generative UI Spec"} href={"/docs/api-reference/generative-ui/spec"}>
|
|
13
|
+
{"The serializable node tree an assistant emits to describe generative UI. Covers the GenerativeUISpec format, its nodes, and the message part that carries the spec."}
|
|
14
|
+
</Card>
|
|
15
|
+
<Card title={"Generative UI Rendering"} href={"/docs/api-reference/generative-ui/rendering"}>
|
|
16
|
+
{"Render a generative UI spec into React. The renderer resolves spec nodes against your component registry, and the error thrown when a component cannot be resolved."}
|
|
17
|
+
</Card>
|
|
18
|
+
</Cards>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Generative UI Rendering
|
|
3
|
+
description: Render a generative UI spec into React. The renderer resolves spec nodes against your component registry, and the error thrown when a component cannot be resolved.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { GenerativeUIRender, GenerativeUIRenderError } from "@/generated/typeDocs";
|
|
7
|
+
|
|
8
|
+
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
|
+
{/* Do not edit manually. */}
|
|
10
|
+
|
|
11
|
+
{/* api-reference:start */}
|
|
12
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
|
|
13
|
+
{/* Do not edit this block manually. */}
|
|
14
|
+
|
|
15
|
+
## API Reference
|
|
16
|
+
|
|
17
|
+
### GenerativeUIRender
|
|
18
|
+
|
|
19
|
+
Internal renderer. Resolves a [GenerativeUISpec](/docs/api-reference/generative-ui/spec#generativeuispec) against the consumer
|
|
20
|
+
allowlist. Used by `MessagePrimitive.GenerativeUI` and by
|
|
21
|
+
`MessagePrimitive.Parts` when handling a `generative-ui` part.
|
|
22
|
+
|
|
23
|
+
<ParametersTable {...GenerativeUIRender} />
|
|
24
|
+
|
|
25
|
+
### GenerativeUIRenderError
|
|
26
|
+
|
|
27
|
+
Thrown when a generative-ui spec references a component name that is not
|
|
28
|
+
present in the consumer-provided allowlist. The allowlist is the security
|
|
29
|
+
boundary in the same-realm rendering path — there is no fallback by
|
|
30
|
+
default. Pass `Fallback` to opt into a soft-fail UX.
|
|
31
|
+
|
|
32
|
+
<ParametersTable {...GenerativeUIRenderError} />
|
|
33
|
+
{/* api-reference:end */}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Generative UI Spec
|
|
3
|
+
description: The serializable node tree an assistant emits to describe generative UI. Covers the GenerativeUISpec format, its nodes, and the message part that carries the spec.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { GenerativeUIMessagePart, GenerativeUINode, GenerativeUISpec } from "@/generated/typeDocs";
|
|
7
|
+
|
|
8
|
+
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
|
+
{/* Do not edit manually. */}
|
|
10
|
+
|
|
11
|
+
{/* api-reference:start */}
|
|
12
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
|
|
13
|
+
{/* Do not edit this block manually. */}
|
|
14
|
+
|
|
15
|
+
## API Reference
|
|
16
|
+
|
|
17
|
+
### GenerativeUIMessagePart
|
|
18
|
+
|
|
19
|
+
A message part that carries a JSON spec describing UI to render.
|
|
20
|
+
|
|
21
|
+
Render with `<MessagePrimitive.GenerativeUI components={...} />`. The
|
|
22
|
+
primitive resolves component names against the consumer-provided allowlist
|
|
23
|
+
— any unknown name throws a typed error rather than rendering. Stream-
|
|
24
|
+
friendly: a partially-streamed spec renders progressively.
|
|
25
|
+
|
|
26
|
+
<ParametersTable {...GenerativeUIMessagePart} />
|
|
27
|
+
|
|
28
|
+
### GenerativeUINode
|
|
29
|
+
|
|
30
|
+
A JSON spec describing a tree of UI components to render.
|
|
31
|
+
|
|
32
|
+
The agent emits a [GenerativeUIMessagePart](/docs/api-reference/generative-ui/spec#generativeuimessagepart) containing this spec, and
|
|
33
|
+
the consumer-provided component allowlist is used to resolve `component`
|
|
34
|
+
names. Any component referenced that is not present in the allowlist is
|
|
35
|
+
rejected with a typed error — the allowlist is the security boundary in the
|
|
36
|
+
default same-realm rendering path.
|
|
37
|
+
|
|
38
|
+
<ParametersTable {...GenerativeUINode} />
|
|
39
|
+
|
|
40
|
+
### GenerativeUISpec
|
|
41
|
+
|
|
42
|
+
The root spec for a generative UI tree.
|
|
43
|
+
|
|
44
|
+
<ParametersTable {...GenerativeUISpec} />
|
|
45
|
+
{/* api-reference:end */}
|
|
@@ -14,6 +14,47 @@ import { unstable_useMentionAdapter, unstable_useSlashCommandAdapter } from "@/g
|
|
|
14
14
|
|
|
15
15
|
## API Reference
|
|
16
16
|
|
|
17
|
+
### unstable_useMentionAdapter
|
|
18
|
+
|
|
19
|
+
<Callout type="warn">
|
|
20
|
+
<strong>Deprecated.</strong> Under active development and might change without notice.
|
|
21
|
+
</Callout>
|
|
22
|
+
|
|
23
|
+
Creates a spreadable `{ adapter, directive }` bundle for `@` mentions.
|
|
24
|
+
Supports tools registered in model context, explicit items, or both —
|
|
25
|
+
flat or categorized.
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
const mention = unstable_useMentionAdapter();
|
|
29
|
+
<ComposerTriggerPopover char="@" {...mention} />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
<ParametersTable {...unstable_useMentionAdapter} />
|
|
33
|
+
|
|
34
|
+
### unstable_useSlashCommandAdapter
|
|
35
|
+
|
|
36
|
+
<Callout type="warn">
|
|
37
|
+
<strong>Deprecated.</strong> Under active development and may change without notice.
|
|
38
|
+
</Callout>
|
|
39
|
+
|
|
40
|
+
Bundles slash command definitions (with inline `execute` callbacks) into
|
|
41
|
+
`{adapter, action}` that plug directly into `ComposerTriggerPopover`.
|
|
42
|
+
`execute` stays in the hook closure and is never attached to the returned
|
|
43
|
+
`TriggerItem`, keeping items serializable.
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
const slash = unstable_useSlashCommandAdapter({
|
|
47
|
+
commands: [
|
|
48
|
+
{ id: "summarize", execute: () => runSummarize(), icon: "FileText" },
|
|
49
|
+
{ id: "translate", execute: () => runTranslate(), icon: "Languages" },
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
<ComposerTriggerPopover char="/" {...slash} />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
<ParametersTable {...unstable_useSlashCommandAdapter} />
|
|
57
|
+
|
|
17
58
|
### unstable_useTriggerPopoverRootContext
|
|
18
59
|
|
|
19
60
|
```ts
|
|
@@ -54,45 +95,4 @@ Like `useTriggerPopoverTriggers` but returns an empty map outside a root.
|
|
|
54
95
|
```ts
|
|
55
96
|
const unstable_useTriggerPopoverTriggersOptional: () => ReadonlyMap<string, RegisteredTrigger>;
|
|
56
97
|
```
|
|
57
|
-
|
|
58
|
-
### unstable_useMentionAdapter
|
|
59
|
-
|
|
60
|
-
<Callout type="warn">
|
|
61
|
-
<strong>Deprecated.</strong> Under active development and might change without notice.
|
|
62
|
-
</Callout>
|
|
63
|
-
|
|
64
|
-
Creates a spreadable `{ adapter, directive }` bundle for `@` mentions.
|
|
65
|
-
Supports tools registered via `useAssistantTool`, explicit items, or both —
|
|
66
|
-
flat or categorized.
|
|
67
|
-
|
|
68
|
-
```tsx
|
|
69
|
-
const mention = unstable_useMentionAdapter();
|
|
70
|
-
<ComposerTriggerPopover char="@" {...mention} />
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
<ParametersTable {...unstable_useMentionAdapter} />
|
|
74
|
-
|
|
75
|
-
### unstable_useSlashCommandAdapter
|
|
76
|
-
|
|
77
|
-
<Callout type="warn">
|
|
78
|
-
<strong>Deprecated.</strong> Under active development and may change without notice.
|
|
79
|
-
</Callout>
|
|
80
|
-
|
|
81
|
-
Bundles slash command definitions (with inline `execute` callbacks) into
|
|
82
|
-
`{adapter, action}` that plug directly into `ComposerTriggerPopover`.
|
|
83
|
-
`execute` stays in the hook closure and is never attached to the returned
|
|
84
|
-
`TriggerItem`, keeping items serializable.
|
|
85
|
-
|
|
86
|
-
```tsx
|
|
87
|
-
const slash = unstable_useSlashCommandAdapter({
|
|
88
|
-
commands: [
|
|
89
|
-
{ id: "summarize", execute: () => runSummarize(), icon: "FileText" },
|
|
90
|
-
{ id: "translate", execute: () => runTranslate(), icon: "Languages" },
|
|
91
|
-
],
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
<ComposerTriggerPopover char="/" {...slash} />
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
<ParametersTable {...unstable_useSlashCommandAdapter} />
|
|
98
98
|
{/* api-reference:end */}
|
|
@@ -3,7 +3,7 @@ title: Model Context Hooks
|
|
|
3
3
|
description: React hooks for registering assistant-ui tools, data renderers, instructions, and model context providers.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { useAssistantInteractable, useInteractableState } from "@/generated/typeDocs";
|
|
6
|
+
import { useAssistantInteractable, useAuiToolOverrides, useInteractableState } from "@/generated/typeDocs";
|
|
7
7
|
|
|
8
8
|
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
9
|
{/* Do not edit manually. */}
|
|
@@ -23,6 +23,24 @@ state, use [useInteractableState](/docs/api-reference/hooks/model-context#useint
|
|
|
23
23
|
|
|
24
24
|
<ParametersTable {...useAssistantInteractable} />
|
|
25
25
|
|
|
26
|
+
### useAuiToolOverrides
|
|
27
|
+
|
|
28
|
+
<Callout type="warn">
|
|
29
|
+
<strong>Deprecated.</strong> Experimental, API may change.
|
|
30
|
+
</Callout>
|
|
31
|
+
|
|
32
|
+
Overrides toolkit entries for the current assistant scope.
|
|
33
|
+
|
|
34
|
+
This is intended for dynamic local-state tools whose model-facing contract is
|
|
35
|
+
declared in a `"use generative"` toolkit file with `execute: stubTool()`, but
|
|
36
|
+
whose actual executor must close over React state in the mounted component.
|
|
37
|
+
Keep the override keys stable after mount; dynamic key addition/removal is not
|
|
38
|
+
currently observed.
|
|
39
|
+
Overrides are registered at priority 1000, above toolkit defaults. Only one
|
|
40
|
+
mounted override provider may define a given tool name at a time.
|
|
41
|
+
|
|
42
|
+
<ParametersTable {...useAuiToolOverrides} />
|
|
43
|
+
|
|
26
44
|
### useInteractableState
|
|
27
45
|
|
|
28
46
|
Reads and writes the state of a registered interactable.
|