@assistant-ui/mcp-docs-server 0.1.29 → 0.1.31

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.
Files changed (214) hide show
  1. package/.docs/organized/code-examples/waterfall.md +15 -7
  2. package/.docs/organized/code-examples/with-a2a.md +9 -21
  3. package/.docs/organized/code-examples/with-ag-ui.md +11 -8
  4. package/.docs/organized/code-examples/with-ai-sdk-v6.md +10 -10
  5. package/.docs/organized/code-examples/with-artifacts.md +12 -10
  6. package/.docs/organized/code-examples/with-assistant-transport.md +11 -12
  7. package/.docs/organized/code-examples/with-chain-of-thought.md +83 -54
  8. package/.docs/organized/code-examples/with-cloud-standalone.md +14 -11
  9. package/.docs/organized/code-examples/with-cloud.md +9 -10
  10. package/.docs/organized/code-examples/with-custom-thread-list.md +61 -16
  11. package/.docs/organized/code-examples/with-elevenlabs-conversational.md +17 -12
  12. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +13 -13
  13. package/.docs/organized/code-examples/with-expo.md +25 -21
  14. package/.docs/organized/code-examples/with-external-store.md +8 -8
  15. package/.docs/organized/code-examples/with-ffmpeg.md +17 -12
  16. package/.docs/organized/code-examples/with-generative-ui.md +9 -9
  17. package/.docs/organized/code-examples/with-google-adk.md +8 -8
  18. package/.docs/organized/code-examples/with-heat-graph.md +5 -5
  19. package/.docs/organized/code-examples/with-interactables.md +10 -25
  20. package/.docs/organized/code-examples/with-langchain.md +437 -0
  21. package/.docs/organized/code-examples/with-langgraph.md +16 -16
  22. package/.docs/organized/code-examples/with-livekit.md +18 -13
  23. package/.docs/organized/code-examples/with-opencode.md +105 -62
  24. package/.docs/organized/code-examples/with-parent-id-grouping.md +10 -10
  25. package/.docs/organized/code-examples/with-react-hook-form.md +220 -148
  26. package/.docs/organized/code-examples/with-react-ink.md +2 -2
  27. package/.docs/organized/code-examples/with-react-router.md +12 -12
  28. package/.docs/organized/code-examples/with-store.md +8 -5
  29. package/.docs/organized/code-examples/with-tanstack.md +10 -10
  30. package/.docs/organized/code-examples/with-tap-runtime.md +10 -6
  31. package/.docs/raw/docs/(docs)/cli.mdx +2 -1
  32. package/.docs/raw/docs/(docs)/copilots/assistant-frame.mdx +1 -0
  33. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +10 -3
  34. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +8 -3
  35. package/.docs/raw/docs/(docs)/copilots/make-assistant-visible.mdx +1 -0
  36. package/.docs/raw/docs/(docs)/copilots/model-context.mdx +1 -0
  37. package/.docs/raw/docs/(docs)/copilots/motivation.mdx +1 -0
  38. package/.docs/raw/docs/(docs)/copilots/use-assistant-instructions.mdx +1 -0
  39. package/.docs/raw/docs/(docs)/devtools.mdx +1 -0
  40. package/.docs/raw/docs/(docs)/index.mdx +1 -0
  41. package/.docs/raw/docs/(docs)/installation.mdx +1 -0
  42. package/.docs/raw/docs/(docs)/rtl.mdx +80 -0
  43. package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +34 -0
  44. package/.docs/raw/docs/(reference)/api-reference/adapters/feedback-speech.mdx +41 -0
  45. package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +26 -0
  46. package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +34 -0
  47. package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +31 -0
  48. package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +20 -0
  49. package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +26 -0
  50. package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +72 -0
  51. package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +41 -0
  52. package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +48 -0
  53. package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +30 -0
  54. package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +23 -0
  55. package/.docs/raw/docs/(reference)/api-reference/overview.mdx +21 -0
  56. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +7 -0
  57. package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +149 -40
  58. package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +65 -0
  59. package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +2 -0
  60. package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +50 -6
  61. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +15 -0
  62. package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +36 -1
  63. package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +38 -0
  64. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +9 -0
  65. package/.docs/raw/docs/(reference)/migrations/v0-14.mdx +144 -6
  66. package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +231 -3
  67. package/.docs/raw/docs/cloud/ai-sdk.mdx +221 -3
  68. package/.docs/raw/docs/cloud/langgraph.mdx +274 -2
  69. package/.docs/raw/docs/{(docs)/guides → guides}/attachments.mdx +41 -36
  70. package/.docs/raw/docs/guides/branching.mdx +76 -0
  71. package/.docs/raw/docs/guides/chain-of-thought.mdx +166 -0
  72. package/.docs/raw/docs/{(docs)/guides → guides}/context-api.mdx +50 -22
  73. package/.docs/raw/docs/{(docs)/guides → guides}/dictation.mdx +2 -0
  74. package/.docs/raw/docs/guides/editing.mdx +102 -0
  75. package/.docs/raw/docs/guides/index.mdx +103 -0
  76. package/.docs/raw/docs/{(docs)/guides → guides}/interactables.mdx +49 -0
  77. package/.docs/raw/docs/{(docs)/guides → guides}/latex.mdx +51 -8
  78. package/.docs/raw/docs/guides/mentions.mdx +520 -0
  79. package/.docs/raw/docs/{(docs)/guides → guides}/message-timing.mdx +8 -2
  80. package/.docs/raw/docs/{(docs)/guides → guides}/multi-agent.mdx +64 -4
  81. package/.docs/raw/docs/{(docs)/guides → guides}/quoting.mdx +10 -17
  82. package/.docs/raw/docs/guides/slash-commands.mdx +361 -0
  83. package/.docs/raw/docs/guides/speech.mdx +156 -0
  84. package/.docs/raw/docs/{(docs)/guides → guides}/suggestions.mdx +21 -83
  85. package/.docs/raw/docs/{(docs)/guides → guides}/tool-ui.mdx +108 -36
  86. package/.docs/raw/docs/{(docs)/guides → guides}/tools.mdx +131 -35
  87. package/.docs/raw/docs/{(docs)/guides → guides}/voice.mdx +39 -0
  88. package/.docs/raw/docs/ink/index.mdx +1 -3
  89. package/.docs/raw/docs/ink/migration.mdx +1 -3
  90. package/.docs/raw/docs/ink/primitives.mdx +37 -1
  91. package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +520 -0
  92. package/.docs/raw/docs/integrations/auth/better-auth.mdx +191 -0
  93. package/.docs/raw/docs/integrations/auth/clerk.mdx +172 -0
  94. package/.docs/raw/docs/integrations/auth/next-auth.mdx +196 -0
  95. package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +79 -0
  96. package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +188 -0
  97. package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +57 -0
  98. package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +201 -0
  99. package/.docs/raw/docs/integrations/gateways/index.mdx +157 -0
  100. package/.docs/raw/docs/integrations/index.mdx +173 -0
  101. package/.docs/raw/docs/integrations/observability/helicone.mdx +130 -0
  102. package/.docs/raw/docs/integrations/observability/langfuse.mdx +156 -0
  103. package/.docs/raw/docs/integrations/observability/langsmith.mdx +146 -0
  104. package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +712 -0
  105. package/.docs/raw/docs/integrations/tools/mcp.mdx +267 -0
  106. package/.docs/raw/docs/primitives/action-bar.mdx +1 -0
  107. package/.docs/raw/docs/primitives/assistant-modal.mdx +1 -0
  108. package/.docs/raw/docs/primitives/attachment.mdx +1 -0
  109. package/.docs/raw/docs/primitives/branch-picker.mdx +1 -0
  110. package/.docs/raw/docs/primitives/chain-of-thought.mdx +90 -85
  111. package/.docs/raw/docs/primitives/composer.mdx +96 -63
  112. package/.docs/raw/docs/primitives/error.mdx +1 -0
  113. package/.docs/raw/docs/primitives/index.mdx +2 -1
  114. package/.docs/raw/docs/primitives/message.mdx +68 -5
  115. package/.docs/raw/docs/primitives/selection-toolbar.mdx +1 -0
  116. package/.docs/raw/docs/primitives/suggestion.mdx +1 -0
  117. package/.docs/raw/docs/primitives/thread-list.mdx +39 -0
  118. package/.docs/raw/docs/primitives/thread.mdx +16 -13
  119. package/.docs/raw/docs/react-native/index.mdx +1 -3
  120. package/.docs/raw/docs/react-native/migration.mdx +1 -3
  121. package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +396 -0
  122. package/.docs/raw/docs/runtimes/a2a/overview.mdx +60 -0
  123. package/.docs/raw/docs/runtimes/a2a/quickstart.mdx +216 -0
  124. package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +70 -0
  125. package/.docs/raw/docs/runtimes/ag-ui/quickstart.mdx +243 -0
  126. package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +123 -0
  127. package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +52 -0
  128. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +71 -131
  129. package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +69 -63
  130. package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +365 -101
  131. package/.docs/raw/docs/runtimes/concepts/adapters.mdx +265 -0
  132. package/.docs/raw/docs/runtimes/concepts/architecture.mdx +125 -0
  133. package/.docs/raw/docs/runtimes/concepts/stability.mdx +67 -0
  134. package/.docs/raw/docs/runtimes/concepts/threads.mdx +428 -0
  135. package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +703 -0
  136. package/.docs/raw/docs/runtimes/custom/data-stream.mdx +323 -0
  137. package/.docs/raw/docs/runtimes/custom/external-store.mdx +253 -1236
  138. package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +746 -0
  139. package/.docs/raw/docs/runtimes/custom/overview.mdx +71 -0
  140. package/.docs/raw/docs/runtimes/google-adk/api.mdx +256 -0
  141. package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +717 -0
  142. package/.docs/raw/docs/runtimes/google-adk/overview.mdx +69 -0
  143. package/.docs/raw/docs/runtimes/google-adk/quickstart.mdx +229 -0
  144. package/.docs/raw/docs/runtimes/langchain.mdx +533 -0
  145. package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +305 -0
  146. package/.docs/raw/docs/runtimes/langgraph/interrupts.mdx +104 -0
  147. package/.docs/raw/docs/runtimes/langgraph/overview.mdx +84 -0
  148. package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +496 -0
  149. package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +127 -0
  150. package/.docs/raw/docs/runtimes/langgraph/threads.mdx +113 -0
  151. package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +3 -3
  152. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +0 -23
  153. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -1
  154. package/.docs/raw/docs/runtimes/opencode/hooks.mdx +191 -0
  155. package/.docs/raw/docs/runtimes/opencode/overview.mdx +48 -0
  156. package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +119 -0
  157. package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +74 -198
  158. package/.docs/raw/docs/ui/accordion.mdx +1 -0
  159. package/.docs/raw/docs/ui/assistant-modal.mdx +1 -0
  160. package/.docs/raw/docs/ui/assistant-sidebar.mdx +1 -0
  161. package/.docs/raw/docs/ui/attachment.mdx +1 -0
  162. package/.docs/raw/docs/ui/badge.mdx +1 -0
  163. package/.docs/raw/docs/ui/composer-trigger-popover.mdx +200 -0
  164. package/.docs/raw/docs/ui/context-display.mdx +1 -0
  165. package/.docs/raw/docs/ui/diff-viewer.mdx +1 -0
  166. package/.docs/raw/docs/ui/directive-text.mdx +114 -0
  167. package/.docs/raw/docs/ui/file.mdx +1 -0
  168. package/.docs/raw/docs/ui/image.mdx +1 -0
  169. package/.docs/raw/docs/ui/markdown.mdx +2 -14
  170. package/.docs/raw/docs/ui/mermaid.mdx +1 -0
  171. package/.docs/raw/docs/ui/message-timing.mdx +3 -2
  172. package/.docs/raw/docs/ui/model-selector.mdx +1 -0
  173. package/.docs/raw/docs/ui/part-grouping.mdx +325 -313
  174. package/.docs/raw/docs/ui/quote.mdx +1 -0
  175. package/.docs/raw/docs/ui/reasoning.mdx +69 -32
  176. package/.docs/raw/docs/ui/scrollbar.mdx +1 -0
  177. package/.docs/raw/docs/ui/select.mdx +1 -0
  178. package/.docs/raw/docs/ui/sources.mdx +1 -0
  179. package/.docs/raw/docs/ui/streamdown.mdx +1 -0
  180. package/.docs/raw/docs/ui/syntax-highlighting.mdx +1 -0
  181. package/.docs/raw/docs/ui/tabs.mdx +1 -0
  182. package/.docs/raw/docs/ui/thread-list.mdx +17 -0
  183. package/.docs/raw/docs/ui/thread.mdx +56 -1
  184. package/.docs/raw/docs/ui/tool-fallback.mdx +1 -0
  185. package/.docs/raw/docs/ui/tool-group.mdx +39 -11
  186. package/.docs/raw/docs/ui/voice.mdx +1 -0
  187. package/.docs/raw/docs/utilities/heat-graph.mdx +1 -0
  188. package/.docs/raw/docs/utilities/react-o11y.mdx +278 -0
  189. package/.docs/raw/docs/utilities/tw-shimmer.mdx +1 -0
  190. package/dist/utils/logger.js +1 -1
  191. package/dist/utils/logger.js.map +1 -1
  192. package/package.json +4 -4
  193. package/src/tools/tests/path-traversal.test.ts +1 -1
  194. package/src/utils/logger.ts +1 -1
  195. package/.docs/raw/docs/(docs)/guides/branching.mdx +0 -65
  196. package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +0 -164
  197. package/.docs/raw/docs/(docs)/guides/editing.mdx +0 -66
  198. package/.docs/raw/docs/(docs)/guides/mentions.mdx +0 -406
  199. package/.docs/raw/docs/(docs)/guides/slash-commands.mdx +0 -275
  200. package/.docs/raw/docs/(docs)/guides/speech.mdx +0 -38
  201. package/.docs/raw/docs/runtimes/a2a/index.mdx +0 -298
  202. package/.docs/raw/docs/runtimes/assistant-transport.mdx +0 -1033
  203. package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +0 -268
  204. package/.docs/raw/docs/runtimes/custom/local.mdx +0 -1464
  205. package/.docs/raw/docs/runtimes/data-stream.mdx +0 -422
  206. package/.docs/raw/docs/runtimes/google-adk/index.mdx +0 -686
  207. package/.docs/raw/docs/runtimes/helicone.mdx +0 -61
  208. package/.docs/raw/docs/runtimes/langgraph/index.mdx +0 -607
  209. package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +0 -12
  210. package/.docs/raw/docs/runtimes/langserve.mdx +0 -116
  211. package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +0 -218
  212. package/.docs/raw/docs/runtimes/mastra/overview.mdx +0 -18
  213. package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +0 -217
  214. package/.docs/raw/docs/ui/mention.mdx +0 -168
@@ -0,0 +1,70 @@
1
+ ---
2
+ title: Overview
3
+ description: Connect to AG-UI (Agent-User Interaction) protocol agents.
4
+ ---
5
+
6
+ `@assistant-ui/react-ag-ui` is a runtime adapter for the [AG-UI (Agent-User Interaction) protocol](https://github.com/ag-ui-protocol/ag-ui). It lets your assistant-ui frontend speak to any AG-UI-compliant agent server, including CopilotKit-based backends.
7
+
8
+ ## When to use it
9
+
10
+ Pick the AG-UI runtime when:
11
+
12
+ - Your backend implements the AG-UI protocol (e.g. CopilotKit agents, custom AG-UI servers).
13
+ - You want streaming text, thinking events, reasoning events, tool calls, and state snapshots in one protocol.
14
+ - You need agent-side state synchronization via `STATE_SNAPSHOT` and `STATE_DELTA` events.
15
+
16
+ If your backend is not AG-UI-compliant, see [picking a runtime](/docs/runtimes/pick-a-runtime) for alternatives.
17
+
18
+ ## Architecture
19
+
20
+ `@assistant-ui/react-ag-ui` is layered on `ExternalStoreRuntime` (see [architecture](/docs/runtimes/concepts/architecture)). The runtime owns AG-UI event parsing and message reconstruction; you provide an `HttpAgent` from `@ag-ui/client` and the adapter handles the wire protocol.
21
+
22
+ Shared adapters (attachments, speech, dictation, feedback, history) work the same way described in [adapters](/docs/runtimes/concepts/adapters).
23
+
24
+ ## Requirements
25
+
26
+ - An AG-UI-compatible agent server.
27
+ - React 18 or 19.
28
+
29
+ ## Install
30
+
31
+ <PlatformTabs>
32
+ <Tab value="React">
33
+
34
+ <InstallCommand npm={["@assistant-ui/react", "@assistant-ui/react-ag-ui", "@ag-ui/client"]} />
35
+
36
+ </Tab>
37
+ <Tab value="React Native">
38
+
39
+ <InstallCommand expo={["@assistant-ui/react-native", "@assistant-ui/react-ag-ui", "@ag-ui/client"]} />
40
+
41
+ </Tab>
42
+ <Tab value="React Ink">
43
+
44
+ <InstallCommand npm={["@assistant-ui/react-ink", "@assistant-ui/react-ag-ui", "@ag-ui/client", "ink", "react"]} />
45
+
46
+ </Tab>
47
+ </PlatformTabs>
48
+
49
+ ## Example
50
+
51
+ [`examples/with-ag-ui`](https://github.com/assistant-ui/assistant-ui/tree/main/examples/with-ag-ui) shows a complete reference implementation. Or scaffold one directly:
52
+
53
+ ```sh
54
+ npx assistant-ui@latest create my-app -e with-ag-ui
55
+ ```
56
+
57
+ ## Next
58
+
59
+ <Cards>
60
+ <Card
61
+ title="Quickstart"
62
+ description="Minimal HttpAgent + useAgUiRuntime setup."
63
+ href="/docs/runtimes/ag-ui/quickstart"
64
+ />
65
+ <Card
66
+ title="Runtime options"
67
+ description="useAgUiRuntime options, adapters, events, thread list."
68
+ href="/docs/runtimes/ag-ui/runtime-options"
69
+ />
70
+ </Cards>
@@ -0,0 +1,243 @@
1
+ ---
2
+ title: Quickstart
3
+ description: Minimal HttpAgent + useAgUiRuntime setup against an AG-UI server.
4
+ ---
5
+
6
+ Three steps to a working chat against an AG-UI agent. Assumes you have already installed the package and have an AG-UI server reachable; if not, start at [overview](/docs/runtimes/ag-ui).
7
+
8
+ <Steps>
9
+ <Step>
10
+
11
+ ### Wire up the runtime provider
12
+
13
+ Create an `HttpAgent` pointing at your AG-UI endpoint and pass it to `useAgUiRuntime`:
14
+
15
+ <PlatformTabs>
16
+ <Tab value="React">
17
+
18
+ ```tsx title="app/MyRuntimeProvider.tsx"
19
+ "use client";
20
+
21
+ import { useMemo } from "react";
22
+ import { AssistantRuntimeProvider } from "@assistant-ui/react";
23
+ import { useAgUiRuntime } from "@assistant-ui/react-ag-ui";
24
+ import { HttpAgent } from "@ag-ui/client";
25
+
26
+ export function MyRuntimeProvider({
27
+ children,
28
+ }: {
29
+ children: React.ReactNode;
30
+ }) {
31
+ const agent = useMemo(
32
+ () =>
33
+ new HttpAgent({
34
+ url: "http://localhost:8000/agent",
35
+ }),
36
+ [],
37
+ );
38
+
39
+ const runtime = useAgUiRuntime({ agent });
40
+
41
+ return (
42
+ <AssistantRuntimeProvider runtime={runtime}>
43
+ {children}
44
+ </AssistantRuntimeProvider>
45
+ );
46
+ }
47
+ ```
48
+
49
+ </Tab>
50
+ <Tab value="React Native">
51
+
52
+ ```tsx title="runtime/MyRuntimeProvider.tsx"
53
+ import { useMemo } from "react";
54
+ import { AssistantRuntimeProvider } from "@assistant-ui/react-native";
55
+ import { useAgUiRuntime } from "@assistant-ui/react-ag-ui";
56
+ import { HttpAgent } from "@ag-ui/client";
57
+
58
+ export function MyRuntimeProvider({
59
+ children,
60
+ }: {
61
+ children: React.ReactNode;
62
+ }) {
63
+ const agent = useMemo(
64
+ () =>
65
+ new HttpAgent({
66
+ url: "http://localhost:8000/agent",
67
+ }),
68
+ [],
69
+ );
70
+
71
+ const runtime = useAgUiRuntime({ agent });
72
+
73
+ return (
74
+ <AssistantRuntimeProvider runtime={runtime}>
75
+ {children}
76
+ </AssistantRuntimeProvider>
77
+ );
78
+ }
79
+ ```
80
+
81
+ </Tab>
82
+ <Tab value="React Ink">
83
+
84
+ ```tsx title="runtime/MyRuntimeProvider.tsx"
85
+ import { useMemo } from "react";
86
+ import { AssistantRuntimeProvider } from "@assistant-ui/react-ink";
87
+ import { useAgUiRuntime } from "@assistant-ui/react-ag-ui";
88
+ import { HttpAgent } from "@ag-ui/client";
89
+
90
+ export function MyRuntimeProvider({
91
+ children,
92
+ }: {
93
+ children: React.ReactNode;
94
+ }) {
95
+ const agent = useMemo(
96
+ () =>
97
+ new HttpAgent({
98
+ url: "http://localhost:8000/agent",
99
+ }),
100
+ [],
101
+ );
102
+
103
+ const runtime = useAgUiRuntime({ agent });
104
+
105
+ return (
106
+ <AssistantRuntimeProvider runtime={runtime}>
107
+ {children}
108
+ </AssistantRuntimeProvider>
109
+ );
110
+ }
111
+ ```
112
+
113
+ </Tab>
114
+ </PlatformTabs>
115
+
116
+ </Step>
117
+ <Step>
118
+
119
+ ### Render the Thread
120
+
121
+ <PlatformTabs>
122
+ <Tab value="React">
123
+
124
+ ```tsx title="app/page.tsx"
125
+ import { Thread } from "@/components/assistant-ui/thread";
126
+ import { MyRuntimeProvider } from "./MyRuntimeProvider";
127
+
128
+ export default function Page() {
129
+ return (
130
+ <MyRuntimeProvider>
131
+ <Thread />
132
+ </MyRuntimeProvider>
133
+ );
134
+ }
135
+ ```
136
+
137
+ </Tab>
138
+ <Tab value="React Native">
139
+
140
+ ```tsx title="app/index.tsx"
141
+ import { View } from "react-native";
142
+ import { Thread } from "@/components/assistant-ui/thread";
143
+ import { MyRuntimeProvider } from "@/runtime/MyRuntimeProvider";
144
+
145
+ export default function Page() {
146
+ return (
147
+ <MyRuntimeProvider>
148
+ <View style={{ flex: 1 }}>
149
+ <Thread />
150
+ </View>
151
+ </MyRuntimeProvider>
152
+ );
153
+ }
154
+ ```
155
+
156
+ </Tab>
157
+ <Tab value="React Ink">
158
+
159
+ ```tsx title="app.tsx"
160
+ import { Box } from "ink";
161
+ import { Thread } from "./components/thread.js";
162
+ import { MyRuntimeProvider } from "./runtime/MyRuntimeProvider.js";
163
+
164
+ export function App() {
165
+ return (
166
+ <MyRuntimeProvider>
167
+ <Box flexDirection="column">
168
+ <Thread />
169
+ </Box>
170
+ </MyRuntimeProvider>
171
+ );
172
+ }
173
+ ```
174
+
175
+ </Tab>
176
+ </PlatformTabs>
177
+
178
+ </Step>
179
+ <Step>
180
+
181
+ ### Set up UI components
182
+
183
+ <PlatformTabs>
184
+ <Tab value="React">
185
+
186
+ Follow the [UI Components guide](/docs/ui/thread) to wire up the Thread, composer, and supporting primitives.
187
+
188
+ </Tab>
189
+ <Tab value="React Native">
190
+
191
+ Follow the [React Native setup](/docs/react-native) to add a native Thread, composer, and supporting primitives.
192
+
193
+ </Tab>
194
+ <Tab value="React Ink">
195
+
196
+ Follow the [Ink setup](/docs/ink) to add a terminal Thread, composer, and supporting primitives.
197
+
198
+ </Tab>
199
+ </PlatformTabs>
200
+
201
+ </Step>
202
+ </Steps>
203
+
204
+ Once your AG-UI server is reachable, the runtime parses incoming events (`TEXT_MESSAGE_*`, `TOOL_CALL_*`, `STATE_SNAPSHOT`, etc.) into assistant-ui messages.
205
+
206
+ ## Showing thinking and reasoning
207
+
208
+ `showThinking` (default `true`) controls whether `THINKING_*` and `REASONING_*` events render as visible reasoning in the UI:
209
+
210
+ ```tsx
211
+ const runtime = useAgUiRuntime({
212
+ agent,
213
+ showThinking: false, // hide thinking blocks
214
+ });
215
+ ```
216
+
217
+ ## Adding adapters
218
+
219
+ Attachments, speech, dictation, feedback, history, and a custom thread list are supported via the standard adapter slots. See [adapters](/docs/runtimes/concepts/adapters):
220
+
221
+ ```tsx
222
+ const runtime = useAgUiRuntime({
223
+ agent,
224
+ adapters: { attachments, history, speech, feedback },
225
+ });
226
+ ```
227
+
228
+ For multi-thread, pass `adapters.threadList` (experimental); see [runtime options](/docs/runtimes/ag-ui/runtime-options#thread-list-experimental).
229
+
230
+ ## Next
231
+
232
+ <Cards>
233
+ <Card
234
+ title="Runtime options"
235
+ description="useAgUiRuntime options, adapters, events, thread list."
236
+ href="/docs/runtimes/ag-ui/runtime-options"
237
+ />
238
+ <Card
239
+ title="Pick a runtime"
240
+ description="Compare AG-UI to other runtime options."
241
+ href="/docs/runtimes/pick-a-runtime"
242
+ />
243
+ </Cards>
@@ -0,0 +1,123 @@
1
+ ---
2
+ title: Runtime options
3
+ description: useAgUiRuntime options, adapters, supported events, thread list.
4
+ ---
5
+
6
+ import { AguiIcon } from "@/components/icons/agui";
7
+
8
+ Reference for the runtime's API surface. Start with [quickstart](/docs/runtimes/ag-ui/quickstart) if you have not already.
9
+
10
+ ## useAgUiRuntime options
11
+
12
+ | Option | Type | Description |
13
+ | --- | --- | --- |
14
+ | `agent` | `HttpAgent` | An AG-UI client agent (from `@ag-ui/client`). Required. |
15
+ | `logger` | `Partial<Logger>` | Optional logger overrides. The runtime logs event-parser warnings and run lifecycle events. |
16
+ | `showThinking` | `boolean` | Whether to render `THINKING_*` and `REASONING_*` events as visible reasoning. Defaults to `true`. |
17
+ | `onError` | `(e: Error) => void` | Error callback fired on `RUN_ERROR` events and protocol errors. |
18
+ | `onCancel` | `() => void` | Cancellation callback fired when the user cancels a run. |
19
+ | `adapters` | `UseAgUiRuntimeAdapters` | Standard adapter slots (see below). |
20
+
21
+ ## Adapter slots
22
+
23
+ | Adapter | Slot | Notes |
24
+ | --- | --- | --- |
25
+ | Attachments | `adapters.attachments` | See [attachment adapter](/docs/runtimes/concepts/adapters#attachment-adapter). |
26
+ | Speech | `adapters.speech` | Text-to-speech. See [speech adapter](/docs/runtimes/concepts/adapters#speech-adapter). |
27
+ | Dictation | `adapters.dictation` | Speech-to-text input. |
28
+ | Feedback | `adapters.feedback` | Thumbs up / down. See [feedback adapter](/docs/runtimes/concepts/adapters#feedback-adapter). |
29
+ | History | `adapters.history` | Per-thread message persistence. |
30
+ | Thread list | `adapters.threadList` | Multi-thread switching (experimental, see below). |
31
+
32
+ ## Thread list (experimental)
33
+
34
+ <Callout type="warn">
35
+ The thread list adapter is currently experimental and may change without notice.
36
+ </Callout>
37
+
38
+ `UseAgUiThreadListAdapter` lets you back the thread list with your own state.
39
+
40
+ | Option | Type | Description |
41
+ | --- | --- | --- |
42
+ | `threadId` | `string` | The currently active thread ID. |
43
+ | `onSwitchToNewThread` | `() => Promise<void>` | Called when the user creates a new thread. Reset your thread state here. |
44
+ | `onSwitchToThread` | `(threadId: string) => Promise<{ messages, state? }>` | Called when the user switches threads. Return the persisted messages (and optional opaque state). |
45
+
46
+ ```tsx
47
+ const runtime = useAgUiRuntime({
48
+ agent,
49
+ adapters: {
50
+ threadList: {
51
+ threadId: currentThreadId,
52
+ onSwitchToNewThread: async () => {
53
+ setCurrentThreadId(await createThread());
54
+ },
55
+ onSwitchToThread: async (id) => {
56
+ const { messages, state } = await loadThread(id);
57
+ setCurrentThreadId(id);
58
+ return { messages, state };
59
+ },
60
+ },
61
+ },
62
+ });
63
+ ```
64
+
65
+ ## Supported events
66
+
67
+ The runtime parses the AG-UI event stream and maps each event type to assistant-ui state.
68
+
69
+ | Event | Effect |
70
+ | --- | --- |
71
+ | `RUN_STARTED` / `RUN_FINISHED` | Toggles thread `isRunning`. |
72
+ | `RUN_CANCELLED` | Marks the in-flight assistant message as cancelled. |
73
+ | `RUN_ERROR` | Marks the message as errored; fires `onError`. |
74
+ | `TEXT_MESSAGE_START` / `_CONTENT` / `_END` | Streams text content into an assistant message. |
75
+ | `TEXT_MESSAGE_CHUNK` | Appends a delta without explicit lifecycle. |
76
+ | `THINKING_START` / `_END` | Wraps reasoning blocks (when `showThinking` is on). |
77
+ | `THINKING_TEXT_MESSAGE_*` | Streams thinking text deltas. |
78
+ | `REASONING_START` / `_MESSAGE_*` / `_END` | Streams structured reasoning per message. |
79
+ | `TOOL_CALL_START` / `_ARGS` / `_END` | Streams tool calls into the current assistant message. |
80
+ | `TOOL_CALL_CHUNK` | Streams tool deltas without explicit lifecycle. |
81
+ | `TOOL_CALL_RESULT` | Attaches a tool result to a tool call. |
82
+ | `STATE_SNAPSHOT` | Replaces the agent's external state. |
83
+ | `STATE_DELTA` | Applies a JSON-patch-style delta to the agent's state. |
84
+ | `MESSAGES_SNAPSHOT` | Replaces the full message list (used for thread restore). |
85
+ | `CUSTOM` | Forwarded to your custom event handling. |
86
+ | `RAW` | Untyped passthrough for unrecognized events. |
87
+
88
+ ## Feature support
89
+
90
+ | Feature | Supported |
91
+ | --- | --- |
92
+ | Streaming text | Yes |
93
+ | Thinking / reasoning blocks | Yes |
94
+ | Tool calls and results | Yes |
95
+ | Tool result handoff (client-side execution) | Yes |
96
+ | State snapshots and deltas | Yes |
97
+ | Cancellation | Yes |
98
+ | Message editing | Yes |
99
+ | Message reload | Yes |
100
+ | Run resumption | Yes |
101
+ | Multi-thread | Experimental (`adapters.threadList`) |
102
+ | History persistence | Via [history adapter](/docs/runtimes/concepts/adapters#history-adapter) |
103
+
104
+ ## Related
105
+
106
+ <Cards>
107
+ <Card
108
+ icon={<AguiIcon width={20} height={20} />}
109
+ title="AG-UI overview"
110
+ description="What AG-UI is and when to pick it."
111
+ href="/docs/runtimes/ag-ui"
112
+ />
113
+ <Card
114
+ title="Quickstart"
115
+ description="Minimal runtime + Thread setup."
116
+ href="/docs/runtimes/ag-ui/quickstart"
117
+ />
118
+ <Card
119
+ title="Adapters"
120
+ description="Attachments, speech, feedback, history, thread list."
121
+ href="/docs/runtimes/concepts/adapters"
122
+ />
123
+ </Cards>
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: Overview
3
+ description: Vercel AI SDK integration for assistant-ui across major versions.
4
+ ---
5
+
6
+ import { VercelIcon } from "@/components/icons/vercel";
7
+
8
+ `@assistant-ui/react-ai-sdk` integrates assistant-ui with the [Vercel AI SDK](https://ai-sdk.dev/). It covers `useChat` flows, custom transports, frontend tools, attachments, quote context, multi-step agents, token usage, and cloud persistence.
9
+
10
+ ## Pick a version
11
+
12
+ | AI SDK | Runtime package | Docs |
13
+ | --- | --- | --- |
14
+ | `ai@^6` + `@ai-sdk/react@^3` | `@assistant-ui/react-ai-sdk` (latest) | [v6 (current)](/docs/runtimes/ai-sdk/v6) |
15
+ | `ai@^5` + `@ai-sdk/react@^2` | `@assistant-ui/react-ai-sdk@0.x` | [v5 (legacy)](/docs/runtimes/ai-sdk/v5-legacy) |
16
+ | `ai@^4` | `@assistant-ui/react-data-stream` | [v4 (legacy)](/docs/runtimes/ai-sdk/v4-legacy) |
17
+
18
+ New projects should target v6. v5 and v4 are documented for projects that have not migrated yet; both have known compatibility gaps and receive no new features.
19
+
20
+ ## Architecture
21
+
22
+ `@assistant-ui/react-ai-sdk` is layered on `ExternalStoreRuntime` (see [architecture](/docs/runtimes/concepts/architecture)). Features that ship as runtime adapters work the same way they do everywhere else; see [adapters](/docs/runtimes/concepts/adapters).
23
+
24
+ ## Choosing useChatRuntime vs useAISDKRuntime
25
+
26
+ Both ship in the same package.
27
+
28
+ - **`useChatRuntime`** (recommended) wraps the AI SDK's `useChat` hook and adds cloud thread support, the standard adapter slots, and `AssistantChatTransport` (which forwards system messages and frontend tools by default). Use this unless you have a reason not to.
29
+ - **`useAISDKRuntime`** is a lower-level hook that takes an existing `useChat` instance you control directly. Use it when you need to share the chat instance with non-assistant-ui code or wire in a custom transport that does not inherit from `AssistantChatTransport`.
30
+
31
+ ## Next
32
+
33
+ <Cards>
34
+ <Card
35
+ icon={<VercelIcon width={20} height={20} />}
36
+ title="v6 (current)"
37
+ description="Quickstart, frontend tools, attachments, quotes, history, multi-step, useAISDKRuntime."
38
+ href="/docs/runtimes/ai-sdk/v6"
39
+ />
40
+ <Card
41
+ icon={<VercelIcon width={20} height={20} />}
42
+ title="v5 (legacy)"
43
+ description="Reference for projects still on AI SDK v5."
44
+ href="/docs/runtimes/ai-sdk/v5-legacy"
45
+ />
46
+ <Card
47
+ icon={<VercelIcon width={20} height={20} />}
48
+ title="v4 (legacy)"
49
+ description="Reference for projects still on AI SDK v4."
50
+ href="/docs/runtimes/ai-sdk/v4-legacy"
51
+ />
52
+ </Cards>