@assistant-ui/mcp-docs-server 0.2.0 → 0.2.2
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 +12 -13
- package/.docs/organized/code-examples/with-a2a.md +16 -11
- package/.docs/organized/code-examples/with-ag-ui.md +15 -13
- package/.docs/organized/code-examples/with-ai-sdk-v7.md +14 -13
- package/.docs/organized/code-examples/with-artifacts.md +14 -13
- package/.docs/organized/code-examples/with-assistant-transport.md +20 -28
- package/.docs/organized/code-examples/with-browser-extension.md +18 -11
- package/.docs/organized/code-examples/with-chain-of-thought.md +17 -15
- package/.docs/organized/code-examples/with-cloud-standalone.md +10 -11
- package/.docs/organized/code-examples/with-cloud.md +19 -14
- package/.docs/organized/code-examples/with-custom-thread-list.md +15 -14
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +14 -14
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +19 -17
- package/.docs/organized/code-examples/with-eve.md +66 -12
- package/.docs/organized/code-examples/with-expo.md +26 -31
- package/.docs/organized/code-examples/with-external-store.md +17 -12
- package/.docs/organized/code-examples/with-ffmpeg.md +21 -15
- package/.docs/organized/code-examples/with-generative-ui.md +271 -36
- package/.docs/organized/code-examples/with-google-adk.md +17 -12
- package/.docs/organized/code-examples/with-heat-graph.md +6 -7
- package/.docs/organized/code-examples/with-image-generation.md +9 -10
- package/.docs/organized/code-examples/with-interactables.md +14 -13
- package/.docs/organized/code-examples/with-langchain.md +12 -13
- package/.docs/organized/code-examples/with-langgraph.md +19 -13
- package/.docs/organized/code-examples/with-livekit.md +13 -13
- package/.docs/organized/code-examples/with-mcp.md +14 -15
- package/.docs/organized/code-examples/with-nuxt.md +2428 -0
- package/.docs/organized/code-examples/with-opencode.md +23 -14
- package/.docs/organized/code-examples/with-openui.md +449 -0
- package/.docs/organized/code-examples/with-pi.md +59 -57
- package/.docs/organized/code-examples/with-react-hook-form.md +16 -15
- package/.docs/organized/code-examples/with-react-ink-web.md +7 -8
- package/.docs/organized/code-examples/with-react-ink.md +6 -6
- package/.docs/organized/code-examples/with-react-router.md +17 -11
- package/.docs/organized/code-examples/with-resumable-stream.md +12 -13
- package/.docs/organized/code-examples/with-store.md +27 -16
- package/.docs/organized/code-examples/with-svelte.md +415 -0
- package/.docs/organized/code-examples/with-sveltekit.md +1061 -0
- package/.docs/organized/code-examples/with-tanstack.md +19 -13
- package/.docs/organized/code-examples/with-tap-runtime.md +15 -15
- package/.docs/organized/code-examples/with-virtualized-thread.md +8 -9
- package/.docs/organized/code-examples/with-vue.md +408 -0
- package/.docs/raw/docs/(docs)/cli.mdx +7 -2
- package/.docs/raw/docs/(docs)/index.mdx +9 -76
- package/.docs/raw/docs/(docs)/installation.mdx +6 -20
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +24 -4
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/slack.mdx +5 -1
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/teams.mdx +9 -2
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +2 -2
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +47 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +29 -4
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +52 -1
- package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +1 -1
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +2 -2
- package/.docs/raw/docs/cloud/ai-sdk.mdx +4 -4
- package/.docs/raw/docs/cloud/index.mdx +1 -1
- package/.docs/raw/docs/copilots/model-context.mdx +4 -3
- package/.docs/raw/docs/copilots/motivation.mdx +4 -4
- package/.docs/raw/docs/guides/attachments.mdx +2 -2
- package/.docs/raw/docs/guides/chain-of-thought.mdx +1 -1
- package/.docs/raw/docs/guides/context-api.mdx +15 -17
- package/.docs/raw/docs/guides/dictation.mdx +1 -1
- package/.docs/raw/docs/guides/electron.mdx +1 -1
- package/.docs/raw/docs/guides/mentions.mdx +2 -0
- package/.docs/raw/docs/guides/resumable-streams.mdx +74 -3
- package/.docs/raw/docs/guides/suggestions.mdx +15 -12
- package/.docs/raw/docs/ink/hooks.mdx +9 -4
- package/.docs/raw/docs/ink/primitives.mdx +5 -4
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +16 -0
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/clerk.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +2 -2
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
- package/.docs/raw/docs/integrations/gateways/index.mdx +2 -2
- package/.docs/raw/docs/integrations/observability/helicone.mdx +2 -2
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +1 -1
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +2 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +146 -128
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +15 -13
- package/.docs/raw/docs/migrations/v0-15.mdx +118 -4
- package/.docs/raw/docs/primitives/attachment.mdx +2 -2
- package/.docs/raw/docs/primitives/composer.mdx +2 -2
- package/.docs/raw/docs/primitives/message.mdx +33 -1
- package/.docs/raw/docs/primitives/suggestion.mdx +4 -2
- package/.docs/raw/docs/primitives/thread.mdx +1 -1
- package/.docs/raw/docs/react-native/hooks.mdx +14 -4
- package/.docs/raw/docs/react-native/index.mdx +1 -1
- package/.docs/raw/docs/react-native/primitives.mdx +2 -2
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +35 -5
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +1 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +1 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v6-legacy.mdx +9 -10
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +9 -10
- package/.docs/raw/docs/runtimes/claude-managed-agents.mdx +118 -0
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +2 -1
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +106 -27
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +19 -1
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +34 -1
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +36 -9
- package/.docs/raw/docs/runtimes/eve/overview.mdx +51 -0
- package/.docs/raw/docs/runtimes/eve/quickstart.mdx +51 -2
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +9 -12
- package/.docs/raw/docs/runtimes/langchain.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +5 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +7 -7
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +4 -4
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +1 -0
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +10 -0
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +8 -1
- package/.docs/raw/docs/tools/backend.mdx +2 -2
- package/.docs/raw/docs/tools/defining-tools.mdx +28 -7
- package/.docs/raw/docs/tools/dynamic-tools.mdx +6 -4
- package/.docs/raw/docs/tools/generative-ui-primitive.mdx +180 -0
- package/.docs/raw/docs/tools/generative-ui-slack.mdx +167 -0
- package/.docs/raw/docs/tools/generative-ui-teams.mdx +160 -0
- package/.docs/raw/docs/tools/generative-ui.mdx +224 -211
- package/.docs/raw/docs/tools/index.mdx +2 -1
- package/.docs/raw/docs/tools/interactables.mdx +29 -17
- package/.docs/raw/docs/tools/mcp-apps.mdx +35 -6
- package/.docs/raw/docs/tools/mcp.mdx +9 -7
- package/.docs/raw/docs/tools/openui.mdx +175 -0
- package/.docs/raw/docs/tools/tool-ui.mdx +27 -24
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +17 -8
- package/.docs/raw/docs/ui/attachment.mdx +27 -0
- package/.docs/raw/docs/ui/file.mdx +7 -2
- package/.docs/raw/docs/ui/image.mdx +1 -1
- package/.docs/raw/docs/ui/mcp-config.mdx +8 -3
- package/.docs/raw/docs/ui/model-selector.mdx +8 -8
- package/.docs/raw/docs/ui/part-grouping.mdx +1 -1
- package/.docs/raw/docs/ui/thread.mdx +24 -5
- package/.docs/raw/docs/utilities/react-o11y.mdx +7 -9
- package/dist/constants.js +2 -2
- package/dist/constants.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/prepare.js.map +1 -1
- package/dist/tools/docs.js +4 -2
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.js +2 -1
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/resources.js +2 -1
- package/dist/tools/resources.js.map +1 -1
- package/dist/tools/tests/test-setup.js +2 -1
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/tools/xulux-templates.js +4 -2
- package/dist/tools/xulux-templates.js.map +1 -1
- package/dist/utils/mdx.js +2 -1
- package/dist/utils/mdx.js.map +1 -1
- package/dist/xulux/catalog-client.js +1 -1
- package/dist/xulux/catalog-client.js.map +1 -1
- package/package.json +4 -4
- package/src/tools/tests/docs.test.ts +2 -2
- package/.docs/raw/docs/tools/interactables-legacy.mdx +0 -410
|
@@ -1,88 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Documentation
|
|
3
|
-
description:
|
|
3
|
+
description: Components, runtimes, and primitives for building AI chat interfaces in React, React Native, and the terminal.
|
|
4
4
|
platforms: ["react"]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<Quickstart />
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## One library, any interface
|
|
10
10
|
|
|
11
|
-
<
|
|
12
|
-
Already using the AI SDK with your own UI? Add [cloud persistence with just one hook](/docs/cloud/ai-sdk), no UI library required.
|
|
13
|
-
</Callout>
|
|
11
|
+
<DemoShowcase />
|
|
14
12
|
|
|
15
|
-
##
|
|
13
|
+
## Bring your own backend
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
<Card icon={<PanelsTopLeft className="text-purple-300" />} title="Instant Chat UI">
|
|
19
|
-
Pre-built beautiful, customizable chat interfaces out of the box. Easy to quickly iterate on your idea.
|
|
20
|
-
</Card>
|
|
15
|
+
A runtime connects these components to your AI backend. Pick the one that matches your stack.
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
Powerful state management for chat interactions, optimized for streaming responses and efficient rendering.
|
|
24
|
-
</Card>
|
|
17
|
+
<RuntimeGrid />
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
Optimized for speed and efficiency with minimal bundle size, ensuring your AI chat interfaces remain responsive.
|
|
28
|
-
</Card>
|
|
19
|
+
## Everything else
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
Easily integrate with any backend system, whether using Vercel AI SDK, direct LLM connections, or custom solutions. Works with any React-based framework.
|
|
32
|
-
</Card>
|
|
33
|
-
</Cards>
|
|
34
|
-
|
|
35
|
-
## Quick Try
|
|
36
|
-
|
|
37
|
-
The fastest way to get started:
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
npx assistant-ui@latest create
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
This creates a new project with everything configured. Or choose a template:
|
|
44
|
-
|
|
45
|
-
```sh
|
|
46
|
-
# Minimal starter
|
|
47
|
-
npx assistant-ui@latest create -t minimal
|
|
48
|
-
|
|
49
|
-
# Assistant Cloud - with persistence and thread management
|
|
50
|
-
npx assistant-ui@latest create -t cloud
|
|
51
|
-
|
|
52
|
-
# Assistant Cloud + Clerk authentication
|
|
53
|
-
npx assistant-ui@latest create -t cloud-clerk
|
|
54
|
-
|
|
55
|
-
# LangGraph starter (react-langchain adapter)
|
|
56
|
-
npx assistant-ui@latest create -t langchain
|
|
57
|
-
|
|
58
|
-
# MCP starter template
|
|
59
|
-
npx assistant-ui@latest create -t mcp
|
|
60
|
-
|
|
61
|
-
# Eve agent starter template
|
|
62
|
-
npx assistant-ui@latest create -t eve
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## What's Next?
|
|
66
|
-
|
|
67
|
-
<Cards>
|
|
68
|
-
<Card
|
|
69
|
-
title="Installation"
|
|
70
|
-
description="Full installation guide with CLI and manual setup options"
|
|
71
|
-
href="/docs/installation"
|
|
72
|
-
/>
|
|
73
|
-
<Card
|
|
74
|
-
title="Agent Skills"
|
|
75
|
-
description="Use AI tools to build with assistant-ui faster"
|
|
76
|
-
href="/docs/llm"
|
|
77
|
-
/>
|
|
78
|
-
<Card
|
|
79
|
-
title="Pick a Runtime"
|
|
80
|
-
description="Choose the right runtime for your needs"
|
|
81
|
-
href="/docs/runtimes/pick-a-runtime"
|
|
82
|
-
/>
|
|
83
|
-
<Card
|
|
84
|
-
title="Examples"
|
|
85
|
-
description="Explore full implementations and demos"
|
|
86
|
-
href="/examples"
|
|
87
|
-
/>
|
|
88
|
-
</Cards>
|
|
21
|
+
<QuickLinks />
|
|
@@ -22,28 +22,14 @@ The fastest way to get started with assistant-ui.
|
|
|
22
22
|
npx assistant-ui@latest create
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Or
|
|
25
|
+
Or start from a template:
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
# Minimal starter
|
|
29
|
-
npx assistant-ui@latest create -t minimal
|
|
30
|
-
|
|
31
|
-
# Assistant Cloud - with persistence and thread management
|
|
32
28
|
npx assistant-ui@latest create -t cloud
|
|
33
|
-
|
|
34
|
-
# Assistant Cloud + Clerk authentication
|
|
35
|
-
npx assistant-ui@latest create -t cloud-clerk
|
|
36
|
-
|
|
37
|
-
# LangGraph starter (react-langchain adapter)
|
|
38
|
-
npx assistant-ui@latest create -t langchain
|
|
39
|
-
|
|
40
|
-
# MCP starter template
|
|
41
|
-
npx assistant-ui@latest create -t mcp
|
|
42
|
-
|
|
43
|
-
# Eve agent starter template
|
|
44
|
-
npx assistant-ui@latest create -t eve
|
|
45
29
|
```
|
|
46
30
|
|
|
31
|
+
The [CLI reference](/docs/cli#create) lists every template and example, and what each one includes.
|
|
32
|
+
|
|
47
33
|
**Add to an existing project:**
|
|
48
34
|
|
|
49
35
|
```sh
|
|
@@ -154,7 +140,7 @@ export const maxDuration = 30;
|
|
|
154
140
|
export async function POST(req: Request) {
|
|
155
141
|
const { messages, system, tools } = await req.json();
|
|
156
142
|
const result = streamText({
|
|
157
|
-
model: openai("gpt-5.
|
|
143
|
+
model: openai("gpt-5.6-luna"),
|
|
158
144
|
system,
|
|
159
145
|
messages: await convertToModelMessages(messages),
|
|
160
146
|
tools: frontendTools(tools),
|
|
@@ -481,8 +467,8 @@ export default function MyApp() {
|
|
|
481
467
|
/>
|
|
482
468
|
<Card
|
|
483
469
|
title="Generative UI"
|
|
484
|
-
description="
|
|
485
|
-
href="/docs/tools/
|
|
470
|
+
description="Let the model compose UI from a component vocabulary you ship"
|
|
471
|
+
href="/docs/tools/generative-ui"
|
|
486
472
|
/>
|
|
487
473
|
<Card
|
|
488
474
|
title="Add Persistence"
|
package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx
CHANGED
|
@@ -48,15 +48,35 @@ primitives built on it. Components rendered outside an `AuiProvider`
|
|
|
48
48
|
receive a default client whose scope accessors throw on use, so
|
|
49
49
|
missing-provider mistakes surface at the point of use.
|
|
50
50
|
|
|
51
|
+
`config` is required and must be built with [AuiConfig](/docs/api-reference/utilities/miscellaneous#auiconfig). At the top
|
|
52
|
+
level, `config` alone creates this subtree's own client. Under a parent
|
|
53
|
+
provider, `extends` is mandatory: pass `extends={aui}` to extend the parent
|
|
54
|
+
client or `extends={null}` to isolate from it (enforced with a dev error).
|
|
55
|
+
Configs are identity-insensitive — a fresh object per render is safe.
|
|
56
|
+
A config whose scopes are all Derived keeps its scope set fixed
|
|
57
|
+
at mount (dev-enforced); configs with a root scope, and empty configs,
|
|
58
|
+
may grow and shrink scopes across renders. `ref` receives the resulting
|
|
59
|
+
client after mount.
|
|
60
|
+
|
|
51
61
|
When mounting a runtime built with one of the runtime hooks, use
|
|
52
62
|
[AssistantRuntimeProvider](/docs/api-reference/context-providers/assistant-runtime-provider#assistantruntimeprovider) — it installs an `AuiProvider`
|
|
53
63
|
internally — rather than wiring `AuiProvider` yourself.
|
|
54
64
|
|
|
55
65
|
```tsx
|
|
56
|
-
function
|
|
57
|
-
const aui = useAui(
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
function MessageScope({ index, children }) {
|
|
67
|
+
const aui = useAui();
|
|
68
|
+
const config = AuiConfig({
|
|
69
|
+
message: Derived({
|
|
70
|
+
source: "thread",
|
|
71
|
+
query: { index },
|
|
72
|
+
get: (aui) => aui.thread.message({ index }),
|
|
73
|
+
}),
|
|
74
|
+
});
|
|
75
|
+
return (
|
|
76
|
+
<AuiProvider extends={aui} config={config}>
|
|
77
|
+
{children}
|
|
78
|
+
</AuiProvider>
|
|
79
|
+
);
|
|
60
80
|
}
|
|
61
81
|
```
|
|
62
82
|
|
|
@@ -63,7 +63,11 @@ The blocks and non-fatal warnings produced by Slack conversion.
|
|
|
63
63
|
|
|
64
64
|
### SlackConversionWarning
|
|
65
65
|
|
|
66
|
-
A non-fatal
|
|
66
|
+
A non-fatal note reported during Slack conversion.
|
|
67
|
+
|
|
68
|
+
`clamped` removed content to fit a limit, `dropped` discarded a node or one
|
|
69
|
+
of its props and may leave a placeholder note behind, and `fallback` emitted
|
|
70
|
+
the node in a different form than requested.
|
|
67
71
|
|
|
68
72
|
<ParametersTable {...SlackConversionWarning} />
|
|
69
73
|
|
|
@@ -50,14 +50,21 @@ The attachments and non-fatal warnings produced by [toTeamsAttachments](/docs/ap
|
|
|
50
50
|
|
|
51
51
|
### TeamsConversionWarning
|
|
52
52
|
|
|
53
|
-
A non-fatal
|
|
53
|
+
A non-fatal note reported during Teams conversion.
|
|
54
|
+
|
|
55
|
+
`clamped` removed content to fit a limit, `dropped` discarded a node or one
|
|
56
|
+
of its props and may leave a placeholder note behind, and `fallback`
|
|
57
|
+
emitted the node in a different form than requested. `advisory` changed
|
|
58
|
+
nothing at all and notes content Teams may still render poorly or refuse,
|
|
59
|
+
such as a payload over the byte budget or a `Row` past the recommended
|
|
60
|
+
column count.
|
|
54
61
|
|
|
55
62
|
<ParametersTable {...TeamsConversionWarning} />
|
|
56
63
|
|
|
57
64
|
### toAdaptiveCard
|
|
58
65
|
|
|
59
66
|
Converts a generative-ui tree into a Microsoft Teams Adaptive Card and
|
|
60
|
-
non-fatal
|
|
67
|
+
non-fatal conversion warnings. Sizes, weights, and colors map to Adaptive
|
|
61
68
|
Card's semantic enums rather than raw values. An Input/Select/RadioGroup/
|
|
62
69
|
Checkbox/DatePicker whose id would be the reserved RESERVED_INPUT_ID
|
|
63
70
|
is renamed with a warning (see `decodeSubmitData`). Never throws: an
|
|
@@ -33,7 +33,7 @@ function QuoteBlock() {
|
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
|
-
const useMessageQuote: () => QuoteInfo;
|
|
36
|
+
const useMessageQuote: () => QuoteInfo | undefined;
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
### useMessageTiming
|
|
@@ -51,7 +51,7 @@ function MessageStats() {
|
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
```ts
|
|
54
|
-
const useMessageTiming: () => MessageTiming;
|
|
54
|
+
const useMessageTiming: () => MessageTiming | undefined;
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
### useRuntimeAdapters
|
|
@@ -36,7 +36,15 @@ Converts an assistant-ui append message into the message payload accepted by
|
|
|
36
36
|
Eve's `send` API.
|
|
37
37
|
|
|
38
38
|
```ts
|
|
39
|
-
const getEveMessageContent: (message: AppendMessage) =>
|
|
39
|
+
const getEveMessageContent: (message: AppendMessage) => EveMessageContent;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### toEveInputResponse
|
|
43
|
+
|
|
44
|
+
Converts an assistant-ui tool approval response into an Eve input response.
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
const toEveInputResponse: (response: RespondToToolApprovalOptions) => InputResponse;
|
|
40
48
|
```
|
|
41
49
|
|
|
42
50
|
### useEveAgentRuntime
|
|
@@ -48,4 +56,42 @@ session, supports cancellation, and maps Eve input requests to assistant-ui
|
|
|
48
56
|
tool approval UI.
|
|
49
57
|
|
|
50
58
|
<ParametersTable {...eve_useEveAgentRuntime} />
|
|
59
|
+
|
|
60
|
+
### useEveError
|
|
61
|
+
|
|
62
|
+
Read the last Eve session error from the runtime extras.
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const useEveError: () => Error | undefined;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### useEveEvents
|
|
69
|
+
|
|
70
|
+
Read the authoritative Eve server event stream from the runtime extras.
|
|
71
|
+
Defaults to an empty array outside an Eve runtime.
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
const useEveEvents: () => EveRuntimeExtras["events"];
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### useEveReset
|
|
78
|
+
|
|
79
|
+
Returns a function that resets the Eve session: aborts any in-flight turn,
|
|
80
|
+
recreates the owned session, and clears events and projected data. Pending
|
|
81
|
+
staged messages and tool execution state are discarded. Safe to render
|
|
82
|
+
outside an Eve runtime; invoking the returned function there throws.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
const useEveReset: () => () => void;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### useEveSession
|
|
89
|
+
|
|
90
|
+
Read the current Eve session cursor from the runtime extras. Persist it to
|
|
91
|
+
resume the session later via `initialSession`. `undefined` when no session
|
|
92
|
+
exists yet or outside an Eve runtime.
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
const useEveSession: () => EveRuntimeExtras["session"] | undefined;
|
|
96
|
+
```
|
|
51
97
|
{/* api-reference:end */}
|
|
@@ -3,7 +3,7 @@ title: "@assistant-ui/react-ai-sdk"
|
|
|
3
3
|
description: Vercel AI SDK runtime hooks, chat transports, and message conversion utilities for assistant-ui React applications.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { reactAiSdk_AISDKToolkit, reactAiSdk_AssistantChatTransport, reactAiSdk_createResumableSessionStorage, reactAiSdk_getThreadMessageTokenUsage, reactAiSdk_injectQuoteContext, reactAiSdk_unstable_injectInteractableContext, reactAiSdk_useAISDKRuntime, reactAiSdk_useChatRuntime } from "@/generated/integrationTypeDocs";
|
|
6
|
+
import { reactAiSdk_AISDKChat, reactAiSdk_AISDKThreads, reactAiSdk_AISDKToolkit, reactAiSdk_AssistantChatTransport, reactAiSdk_createResumableSessionStorage, reactAiSdk_getThreadMessageTokenUsage, reactAiSdk_injectQuoteContext, reactAiSdk_unstable_injectInteractableContext, reactAiSdk_useAISDKRuntime, reactAiSdk_useChatRuntime } from "@/generated/integrationTypeDocs";
|
|
7
7
|
|
|
8
8
|
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
9
|
{/* Do not edit manually. */}
|
|
@@ -14,6 +14,31 @@ import { reactAiSdk_AISDKToolkit, reactAiSdk_AssistantChatTransport, reactAiSdk_
|
|
|
14
14
|
|
|
15
15
|
## API Reference
|
|
16
16
|
|
|
17
|
+
### AISDKChat
|
|
18
|
+
|
|
19
|
+
`AuiConfig` entry that runs the AI SDK chat as the `threads` scope. Hosts the
|
|
20
|
+
same orchestration as `useChatRuntime` inside the client's own resource tree,
|
|
21
|
+
so it works with any `AssistantClient` host, React or not. Single thread; the
|
|
22
|
+
multi-thread and assistant-cloud surface is [AISDKThreads](/docs/api-reference/integrations/react-ai-sdk#aisdkthreads). The chat
|
|
23
|
+
id is captured when the entry mounts, so a later `id` change in the options
|
|
24
|
+
has no effect.
|
|
25
|
+
|
|
26
|
+
<ParametersTable {...reactAiSdk_AISDKChat} />
|
|
27
|
+
|
|
28
|
+
### AISDKThreads
|
|
29
|
+
|
|
30
|
+
`AuiConfig` entry that runs one AI SDK chat per thread. Hosts the same
|
|
31
|
+
per-thread orchestration as [AISDKChat](/docs/api-reference/integrations/react-ai-sdk#aisdkchat) inside the client's own
|
|
32
|
+
resource tree, so it works with any `AssistantClient` host, React or not.
|
|
33
|
+
Without `cloud`, threads live in memory for the client's lifetime and keep
|
|
34
|
+
their history across switches; each thread's chat id is its thread id.
|
|
35
|
+
With `cloud`, the list is a `RemoteThreadList` and the factory is keyed so
|
|
36
|
+
cloud history reloads on a switch. The store entry mounts only the visible
|
|
37
|
+
thread, so a switch cancels an in-flight run. Model context is
|
|
38
|
+
registered on the visible thread only.
|
|
39
|
+
|
|
40
|
+
<ParametersTable {...reactAiSdk_AISDKThreads} />
|
|
41
|
+
|
|
17
42
|
### AISDKToolkit
|
|
18
43
|
|
|
19
44
|
<ParametersTable {...reactAiSdk_AISDKToolkit} />
|
|
@@ -109,7 +134,7 @@ runtime hook. `undefined` when the current thread is not backed by the AI
|
|
|
109
134
|
SDK runtime.
|
|
110
135
|
|
|
111
136
|
```ts
|
|
112
|
-
const useAISDKChat: <UI_MESSAGE extends UIMessage = UIMessage<unknown, UIDataTypes, UITools>>() => UseChatHelpers<UI_MESSAGE
|
|
137
|
+
const useAISDKChat: <UI_MESSAGE extends UIMessage = UIMessage<unknown, UIDataTypes, UITools>>() => UseChatHelpers<UI_MESSAGE> | undefined;
|
|
113
138
|
```
|
|
114
139
|
|
|
115
140
|
### useAISDKError
|
|
@@ -119,7 +144,7 @@ Read the last AI SDK chat error object from the runtime extras.
|
|
|
119
144
|
the AI SDK runtime.
|
|
120
145
|
|
|
121
146
|
```ts
|
|
122
|
-
const useAISDKError: () => Error;
|
|
147
|
+
const useAISDKError: () => Error | undefined;
|
|
123
148
|
```
|
|
124
149
|
|
|
125
150
|
### useAISDKRuntime
|
|
@@ -133,7 +158,7 @@ const useAISDKError: () => Error;
|
|
|
133
158
|
### useThreadTokenUsage
|
|
134
159
|
|
|
135
160
|
```ts
|
|
136
|
-
function useThreadTokenUsage(): ThreadTokenUsage;
|
|
161
|
+
function useThreadTokenUsage(): ThreadTokenUsage | undefined;
|
|
137
162
|
```
|
|
138
163
|
|
|
139
164
|
### generativeTools
|
|
@@ -3,7 +3,7 @@ title: Utilities
|
|
|
3
3
|
description: Miscellaneous @assistant-ui/react utilities for custom rendering, composition, and advanced assistant UI behavior.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { AssistantCloud, ChainOfThoughtClient, DevToolsHooks, InMemoryThreadList, SingleThreadList, Suggestions, useSmooth } from "@/generated/typeDocs";
|
|
6
|
+
import { AssistantCloud, AuiConfig, ChainOfThoughtClient, DevToolsHooks, InMemoryThreadList, MessageNotSentError, RemoteThreadList, SingleThreadList, Suggestions, useSmooth } from "@/generated/typeDocs";
|
|
7
7
|
|
|
8
8
|
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
9
|
{/* Do not edit manually. */}
|
|
@@ -18,6 +18,29 @@ import { AssistantCloud, ChainOfThoughtClient, DevToolsHooks, InMemoryThreadList
|
|
|
18
18
|
|
|
19
19
|
<ParametersTable {...AssistantCloud} />
|
|
20
20
|
|
|
21
|
+
### AuiConfig
|
|
22
|
+
|
|
23
|
+
Builds a config for [AuiProvider](/docs/api-reference/context-providers/assistant-runtime-provider#auiprovider); the `config` prop only accepts
|
|
24
|
+
configs built with this helper.
|
|
25
|
+
|
|
26
|
+
A config is plain data: it can be hoisted to module scope, created inline
|
|
27
|
+
per render, or memoized — the provider never relies on config identity.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
const aui = useAui();
|
|
31
|
+
const config = AuiConfig({
|
|
32
|
+
message: Derived({
|
|
33
|
+
source: "thread",
|
|
34
|
+
query: { index: 0 },
|
|
35
|
+
get: (aui) => aui.thread.message({ index: 0 }),
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
<AuiProvider extends={aui} config={config}>{children}</AuiProvider>;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
<ParametersTable {...AuiConfig} />
|
|
43
|
+
|
|
21
44
|
### ChainOfThoughtClient
|
|
22
45
|
|
|
23
46
|
<ParametersTable {...ChainOfThoughtClient} />
|
|
@@ -36,6 +59,34 @@ const createMessageQueue: (driver: MessageQueueDriver) => MessageQueueController
|
|
|
36
59
|
|
|
37
60
|
<ParametersTable {...InMemoryThreadList} />
|
|
38
61
|
|
|
62
|
+
### isMessageNotSentError
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const isMessageNotSentError: (error: unknown) => error is MessageNotSentError;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### MessageNotSentError
|
|
69
|
+
|
|
70
|
+
Rejection reason for a send that never reached the backend, so nothing ran
|
|
71
|
+
and nothing is recoverable from the thread. A runtime adapter throws it from
|
|
72
|
+
`onNew` to hand the message back to the thread composer, which restores the
|
|
73
|
+
draft it cleared at dispatch time when nothing has claimed the composer
|
|
74
|
+
since. An edit composer closes at dispatch, so a rejected edit is not
|
|
75
|
+
restored.
|
|
76
|
+
|
|
77
|
+
<ParametersTable {...MessageNotSentError} />
|
|
78
|
+
|
|
79
|
+
### RemoteThreadList
|
|
80
|
+
|
|
81
|
+
`AuiConfig` `threads` entry backed by a `RemoteThreadListAdapter`. Thread
|
|
82
|
+
bodies are born from the `thread` factory inside the client tree, so any
|
|
83
|
+
`AssistantClient` host can run a remote or cloud list. Per-thread history
|
|
84
|
+
and attachments come from `unstable_useAdapters`. `useRemoteThreadListRuntime`
|
|
85
|
+
uses the same hook when `unstable_Provider` is omitted. Key the factory
|
|
86
|
+
with `withKey` so history reloads when the visible thread changes.
|
|
87
|
+
|
|
88
|
+
<ParametersTable {...RemoteThreadList} />
|
|
89
|
+
|
|
39
90
|
### SingleThreadList
|
|
40
91
|
|
|
41
92
|
<ParametersTable {...SingleThreadList} />
|
|
@@ -19,7 +19,7 @@ This integration provides:
|
|
|
19
19
|
|
|
20
20
|
## How It Works
|
|
21
21
|
|
|
22
|
-
The `useChatRuntime` hook from `@assistant-ui/react-ai-sdk` wraps AI SDK's `useChat` and adds cloud persistence via the `cloud` parameter. The runtime automatically:
|
|
22
|
+
The `useChatRuntime` hook from `@assistant-ui/react-ai-sdk` wraps AI SDK's `useChat` and adds cloud persistence via the `cloud` parameter. `AISDKThreads({ cloud })` is the store-entry list for `AuiConfig` / `createAssistantClient` hosts. That host mounts only the visible thread, so a switch cancels an in-flight run. The runtime automatically:
|
|
23
23
|
|
|
24
24
|
1. Creates a cloud thread on the first user message
|
|
25
25
|
2. Persists messages as they complete streaming
|
|
@@ -393,7 +393,7 @@ export async function POST(req: Request) {
|
|
|
393
393
|
const { messages } = await req.json();
|
|
394
394
|
|
|
395
395
|
const result = streamText({
|
|
396
|
-
model: openai("gpt-5.
|
|
396
|
+
model: openai("gpt-5.6-luna"),
|
|
397
397
|
messages,
|
|
398
398
|
});
|
|
399
399
|
|
|
@@ -332,7 +332,7 @@ Plus all other properties from AI SDK's [`UseChatHelpers`](https://sdk.vercel.ai
|
|
|
332
332
|
| Value | Type | Description |
|
|
333
333
|
|-------|------|-------------|
|
|
334
334
|
| `threads.cloud` | `AssistantCloud` | The cloud instance used for thread operations |
|
|
335
|
-
| `threads.threads` | `CloudThread[]` |
|
|
335
|
+
| `threads.threads` | `CloudThread[]` | Threads sorted by recency; includes archived threads when supplied by `useThreads({ includeArchived: true })` |
|
|
336
336
|
| `threads.threadId` | `string \| null` | Current thread ID (`null` for a new unsaved chat) |
|
|
337
337
|
| `threads.selectThread` | `(id: string \| null) => void` | Switch threads or pass `null` for a new chat |
|
|
338
338
|
| `threads.isLoading` | `boolean` | `true` during initial load or refresh |
|
|
@@ -378,7 +378,7 @@ The `useCloudChat` hook automatically reports run telemetry to Assistant Cloud a
|
|
|
378
378
|
**Requires route configuration:**
|
|
379
379
|
- `model_id` — The model used for the response
|
|
380
380
|
- `input_tokens` / `output_tokens` — Token usage statistics
|
|
381
|
-
- `reasoning_tokens` — Tokens used for chain-of-thought reasoning (e.g. GPT-5.
|
|
381
|
+
- `reasoning_tokens` — Tokens used for chain-of-thought reasoning (e.g. GPT-5.6 Luna or other reasoning models)
|
|
382
382
|
- `cached_input_tokens` — Input tokens served from the provider's prompt cache
|
|
383
383
|
|
|
384
384
|
To capture model and usage data, configure the `messageMetadata` callback in your AI SDK route:
|
|
@@ -391,7 +391,7 @@ export async function POST(req: Request) {
|
|
|
391
391
|
const { messages } = await req.json();
|
|
392
392
|
|
|
393
393
|
const result = streamText({
|
|
394
|
-
model: openai("gpt-5.
|
|
394
|
+
model: openai("gpt-5.6-luna"),
|
|
395
395
|
messages,
|
|
396
396
|
});
|
|
397
397
|
|
|
@@ -459,7 +459,7 @@ export async function POST(req: Request) {
|
|
|
459
459
|
const samplingCalls: Record<string, SamplingCallData[]> = {};
|
|
460
460
|
|
|
461
461
|
const result = streamText({
|
|
462
|
-
model: openai("gpt-5.
|
|
462
|
+
model: openai("gpt-5.6-luna"),
|
|
463
463
|
messages,
|
|
464
464
|
tools: {
|
|
465
465
|
delegate_to_gemini: tool({
|
|
@@ -16,7 +16,7 @@ Assistant Cloud is a hosted service that adds thread management, message persist
|
|
|
16
16
|
|
|
17
17
|
| Backend | Standalone Mode | With assistant-ui |
|
|
18
18
|
|---------|----------------|-------------------|
|
|
19
|
-
| AI SDK | [`useCloudChat`](/docs/cloud/ai-sdk) | [`useChatRuntime`](/docs/cloud/ai-sdk-assistant-ui) |
|
|
19
|
+
| AI SDK | [`useCloudChat`](/docs/cloud/ai-sdk) | [`useChatRuntime`](/docs/cloud/ai-sdk-assistant-ui) / `AISDKThreads` |
|
|
20
20
|
| LangGraph | — | [`useLangGraphRuntime`](/docs/cloud/langgraph) |
|
|
21
21
|
| Custom | — | Local Runtime |
|
|
22
22
|
|
|
@@ -63,6 +63,7 @@ export default defineToolkit({
|
|
|
63
63
|
|
|
64
64
|
```tsx title="app/Form.tsx"
|
|
65
65
|
import {
|
|
66
|
+
AuiConfig,
|
|
66
67
|
AuiProvider,
|
|
67
68
|
makeAssistantVisible,
|
|
68
69
|
Tools,
|
|
@@ -77,10 +78,10 @@ const ClickableButton = makeAssistantVisible(Button, {
|
|
|
77
78
|
|
|
78
79
|
// Use in your component
|
|
79
80
|
function Form() {
|
|
80
|
-
const aui = useAui(
|
|
81
|
-
|
|
81
|
+
const aui = useAui();
|
|
82
|
+
const config = AuiConfig({ tools: Tools({ toolkit }) });
|
|
82
83
|
return (
|
|
83
|
-
<AuiProvider
|
|
84
|
+
<AuiProvider extends={aui} config={config}>
|
|
84
85
|
<form>{/* form fields */}</form>
|
|
85
86
|
</AuiProvider>
|
|
86
87
|
);
|
|
@@ -131,15 +131,15 @@ export default defineToolkit({
|
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
```tsx title="app/SmartTransactionHistory.tsx"
|
|
134
|
-
import { AuiProvider, Tools, useAui } from "@assistant-ui/react";
|
|
134
|
+
import { AuiConfig, AuiProvider, Tools, useAui } from "@assistant-ui/react";
|
|
135
135
|
import toolkit from "./transaction-toolkit";
|
|
136
136
|
|
|
137
137
|
function SmartTransactionHistory() {
|
|
138
|
-
const aui = useAui({ tools: Tools({ toolkit }) });
|
|
139
|
-
|
|
140
138
|
// Previous instructions...
|
|
139
|
+
const aui = useAui();
|
|
140
|
+
const config = AuiConfig({ tools: Tools({ toolkit }) });
|
|
141
141
|
return (
|
|
142
|
-
<AuiProvider
|
|
142
|
+
<AuiProvider extends={aui} config={config}>
|
|
143
143
|
<TransactionHistory transactions={transactions} />
|
|
144
144
|
</AuiProvider>
|
|
145
145
|
);
|
|
@@ -118,7 +118,7 @@ Build your own adapters for specialized file handling. Below are complete exampl
|
|
|
118
118
|
|
|
119
119
|
### Vision-Capable Image Adapter
|
|
120
120
|
|
|
121
|
-
Send images to vision-capable LLMs like GPT-5.
|
|
121
|
+
Send images to vision-capable LLMs like GPT-5.6, Claude Sonnet 4.6, or Gemini Pro Vision:
|
|
122
122
|
|
|
123
123
|
```tsx
|
|
124
124
|
import {
|
|
@@ -276,7 +276,7 @@ const MyModelAdapter: ChatModelAdapter = {
|
|
|
276
276
|
msg.role === "user" &&
|
|
277
277
|
msg.content.some((part) => part.type === "image")
|
|
278
278
|
) {
|
|
279
|
-
// Format for GPT-5.
|
|
279
|
+
// Format for GPT-5.6 or similar vision models
|
|
280
280
|
return {
|
|
281
281
|
role: "user",
|
|
282
282
|
content: msg.content.map((part) => {
|
|
@@ -109,7 +109,7 @@ export async function POST(req: Request) {
|
|
|
109
109
|
const { messages } = await req.json();
|
|
110
110
|
|
|
111
111
|
const result = streamText({
|
|
112
|
-
model: openai("gpt-5.
|
|
112
|
+
model: openai("gpt-5.6-luna"),
|
|
113
113
|
messages: await convertToModelMessages(messages),
|
|
114
114
|
});
|
|
115
115
|
|
|
@@ -519,34 +519,32 @@ The table below covers the most commonly used actions. For the full catalog, see
|
|
|
519
519
|
|
|
520
520
|
### Events vs State Observation
|
|
521
521
|
|
|
522
|
-
`
|
|
522
|
+
Use `useAuiState` to render the current value of something; use `useAuiEvent` to react to the moment something happens. Both are supported: many events mark a transition you could also observe in state, and subscribing to the event is the intended way to run a side effect at that transition.
|
|
523
523
|
|
|
524
524
|
The rule of thumb:
|
|
525
525
|
|
|
526
|
-
1.
|
|
526
|
+
1. Rendering a value? → use `useAuiState`.
|
|
527
527
|
2. Are you the caller and want immediate feedback? → catch the rejection / read the return value.
|
|
528
|
-
3.
|
|
528
|
+
3. Running a side effect when something happens? → use `useAuiEvent`.
|
|
529
529
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
#### Currently Recommended (Truly Transient)
|
|
530
|
+
#### Available Events
|
|
533
531
|
|
|
534
532
|
| Event | When It Fires |
|
|
535
533
|
| ----------------------------- | ---------------------------------------------------------------------------- |
|
|
536
|
-
| `
|
|
534
|
+
| `threads.selectionChanged` | The main thread selection changed. Payload carries `threadId` (newly selected) and `previousThreadId`. Does not fire for the initially selected thread on mount. |
|
|
535
|
+
| `thread.runStart` / `runEnd` | A run started / ended on the thread (also visible as `isRunning` flipping) |
|
|
536
|
+
| `thread.initialize` | The thread transitioned from new to initialized, before the first message is added |
|
|
537
537
|
| `thread.modelContextUpdate` | The model context provider notified a change. The model context lives in a provider, not in thread state, so this event has no state-derivable equivalent. |
|
|
538
|
+
| `composer.send` | The user sent the composer contents; `messageId` is set for edit-composer sends |
|
|
539
|
+
| `composer.attachmentAdd` | An attachment was added to the composer |
|
|
540
|
+
| `composer.attachmentAddError` | An `addAttachment()` call failed. Payload `reason` discriminates `no-adapter` / `not-accepted` / `adapter-error`. The event additionally surfaces a human-readable `message` (and the underlying `Error` instance via the low-level `runtime.unstable_on("attachmentAddError")` API; `useAuiEvent` payloads omit it because raw `Error` objects are not store-serializable). |
|
|
538
541
|
|
|
539
|
-
####
|
|
540
|
-
|
|
541
|
-
These events fire at the same transition you can observe via state. They are kept for backward compatibility but new code should observe state instead.
|
|
542
|
+
#### Deprecated Events
|
|
542
543
|
|
|
543
|
-
|
|
|
544
|
-
|
|
|
545
|
-
| `
|
|
546
|
-
| `
|
|
547
|
-
| `thread.runStart` / `runEnd` | thread `isRunning` flipping to `true` / `false` |
|
|
548
|
-
| `thread.initialize` | thread `messages` becoming non-empty (or `isEmpty` flipping) |
|
|
549
|
-
| `threadListItem.switchedTo` / `switchedAway` | compare `s.threads.mainThreadId` against `s.threadListItem.id` |
|
|
544
|
+
| Deprecated Event | Use Instead |
|
|
545
|
+
| ----------------------------- | ---------------------------------------------------------------------------- |
|
|
546
|
+
| `threadListItem.switchedTo` | `threads.selectionChanged` — its `threadId` is the newly selected thread |
|
|
547
|
+
| `threadListItem.switchedAway` | `threads.selectionChanged` — its `previousThreadId` is the thread switched away from |
|
|
550
548
|
|
|
551
549
|
## Troubleshooting
|
|
552
550
|
|