@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
@@ -1,237 +1,113 @@
1
1
  ---
2
- title: Picking a Runtime
3
- description: Which runtime fits your backend? Decision guide for common setups.
2
+ title: Picking a runtime
3
+ description: Decision guide for choosing the right runtime, by framework or by feature.
4
4
  ---
5
5
 
6
- Choosing the right runtime is crucial for your assistant-ui implementation. This guide helps you navigate the options based on your specific needs.
6
+ import { AguiIcon } from "@/components/icons/agui";
7
+ import { GeminiIcon } from "@/components/icons/gemini";
8
+ import { LangChainIcon } from "@/components/icons/langchain";
9
+ import { LangGraphIcon } from "@/components/icons/langgraph";
10
+ import { MastraIcon } from "@/components/icons/mastra";
11
+ import { OpenCodeIcon } from "@/components/icons/opencode";
12
+ import { VercelIcon } from "@/components/icons/vercel";
13
+ import { Network } from "lucide-react";
7
14
 
8
- ## Quick Decision Tree
15
+ A runtime is the connection between assistant-ui's UI primitives and your AI backend. This page helps you pick one. Two lenses, pick whichever maps to what you already know.
9
16
 
10
- ```mermaid
11
- graph TD
12
- A[What's your starting point?] --> B{Existing Framework?}
13
- B -->|Vercel AI SDK| C[Use AI SDK Integration]
14
- B -->|LangGraph| D[Use LangGraph Runtime]
15
- B -->|LangServe| E[Use LangServe Runtime]
16
- B -->|Mastra| F[Use Mastra Runtime]
17
- B -->|AG-UI Protocol| J[Use AG-UI Runtime]
18
- B -->|A2A Protocol| K[Use A2A Runtime]
19
- B -->|Custom Backend| G{State Management?}
20
- G -->|Let assistant-ui handle it| H[Use LocalRuntime]
21
- G -->|I'll manage it myself| I[Use ExternalStoreRuntime]
22
- ```
17
+ ## Lens 1: by framework
23
18
 
24
- ## Core Runtimes
19
+ If you are already using one of these frameworks, the choice is mechanical.
25
20
 
26
- These are the foundational runtimes that power assistant-ui:
21
+ ### First-party adapters
27
22
 
28
- <Cards>
29
- <Card
30
- title="`LocalRuntime`"
31
- description="assistant-ui manages chat state internally. Simple adapter pattern for any backend."
32
- href="/docs/runtimes/custom/local"
33
- />
34
- <Card
35
- title="`ExternalStoreRuntime`"
36
- description="You control the state. Perfect for Redux, Zustand, or existing state management."
37
- href="/docs/runtimes/custom/external-store"
38
- />
39
- </Cards>
40
-
41
- ## Pre-Built Integrations
42
-
43
- For popular frameworks, we provide ready-to-use integrations built on top of our core runtimes:
23
+ assistant-ui ships React adapter packages for these. Pick the matching card and follow its overview.
44
24
 
45
25
  <Cards>
46
26
  <Card
27
+ icon={<VercelIcon width={20} height={20} />}
47
28
  title="Vercel AI SDK"
48
- description="For useChat hook - streaming with all major providers"
49
- href="/docs/runtimes/ai-sdk/v6"
50
- />
51
- <Card
52
- title="Data Stream Protocol"
53
- description="For custom backends using the data stream protocol standard"
54
- href="/docs/runtimes/data-stream"
29
+ description="useChat hook, streaming, tools, attachments, multi-step. v6 current; v5 / v4 legacy."
30
+ href="/docs/runtimes/ai-sdk"
55
31
  />
56
32
  <Card
33
+ icon={<LangGraphIcon width={20} height={20} className="text-[#1C3C3C] dark:text-[#5b9595]" />}
57
34
  title="LangGraph"
58
- description="For complex agent workflows with LangChain's graph framework"
35
+ description="Direct integration with @langchain/langgraph-sdk. Subgraph events, UI messages, message metadata."
59
36
  href="/docs/runtimes/langgraph"
60
37
  />
61
38
  <Card
62
- title="LangServe"
63
- description="For LangChain applications deployed with LangServe"
64
- href="/docs/runtimes/langserve"
39
+ icon={<LangChainIcon width={20} height={20} className="text-[#7FC8FF]" />}
40
+ title="LangChain useStream"
41
+ description="Wraps @langchain/react's useStream. Lighter-weight, tracks upstream."
42
+ href="/docs/runtimes/langchain"
65
43
  />
66
44
  <Card
67
- title="Mastra"
68
- description="For workflow orchestration with Mastra's ecosystem"
69
- href="/docs/runtimes/mastra/overview"
70
- />
71
- <Card
72
- title="AG-UI Protocol"
73
- description="For backends implementing the AG-UI (Agent-User Interaction) protocol"
74
- href="https://www.npmjs.com/package/@assistant-ui/react-ag-ui"
45
+ icon={<GeminiIcon width={20} height={20} />}
46
+ title="Google ADK"
47
+ description="ADK JS or Python agents. Tool confirmations, auth flows, multi-agent, code execution."
48
+ href="/docs/runtimes/google-adk"
75
49
  />
76
50
  <Card
51
+ icon={<Network width={20} height={20} />}
77
52
  title="A2A Protocol"
78
- description="For Agent-to-Agent protocol communication between AI agents"
53
+ description="Any A2A v1.0-compliant agent server. Streaming task state, artifacts, multi-tenancy."
79
54
  href="/docs/runtimes/a2a"
80
55
  />
56
+ <Card
57
+ icon={<AguiIcon width={20} height={20} />}
58
+ title="AG-UI Protocol"
59
+ description="AG-UI agents (CopilotKit, custom servers). Streaming text, thinking, tool calls, state snapshots."
60
+ href="/docs/runtimes/ag-ui"
61
+ />
62
+ <PlatformOnly platforms={["react"]}>
63
+ <Card
64
+ icon={<OpenCodeIcon width={20} height={20} />}
65
+ title="OpenCode"
66
+ description="OpenCode coding-agent server. Permission flows, questions, fork / revert. Experimental."
67
+ href="/docs/runtimes/opencode"
68
+ />
69
+ </PlatformOnly>
81
70
  </Cards>
82
71
 
83
- ## Understanding Runtime Architecture
72
+ <PlatformOnly platforms={["react"]}>
84
73
 
85
- ### How Pre-Built Integrations Work
74
+ ### Integration guides
86
75
 
87
- The pre-built integrations (AI SDK, LangGraph, etc.) are **not separate runtime types**. They're convenient wrappers built on top of our core runtimes:
76
+ For frameworks without a dedicated adapter, these wiring guides route through one of the adapters above.
88
77
 
89
- - **AI SDK Integration** → Built on `LocalRuntime` with streaming adapter
90
- - **LangGraph Runtime** → Built on `LocalRuntime` with graph execution adapter
91
- - **LangServe Runtime** → Built on `LocalRuntime` with LangServe client adapter
92
- - **Mastra Runtime** → Built on `LocalRuntime` with workflow adapter
93
- - **AG-UI Runtime** → Built on `LocalRuntime` with AG-UI protocol adapter
94
- - **A2A Runtime** → Built on `LocalRuntime` with Agent-to-Agent protocol adapter
78
+ <Cards>
79
+ <Card
80
+ icon={<MastraIcon width={20} height={20} />}
81
+ title="Mastra"
82
+ description="TypeScript agent framework. Wired through the Vercel AI SDK runtime."
83
+ href="/docs/integrations/frameworks/mastra/overview"
84
+ />
85
+ </Cards>
95
86
 
96
- This means you get all the benefits of `LocalRuntime` (automatic state management, built-in features) with zero configuration for your specific framework.
87
+ </PlatformOnly>
97
88
 
98
- ### When to Use Pre-Built vs Core Runtimes
89
+ ## Lens 2: by needs
99
90
 
100
- **Use a pre-built integration when:**
101
- - You're already using that framework
102
- - You want the fastest possible setup
103
- - The integration covers your needs
91
+ If you do not know your framework yet, or your backend is custom, pick by what you need:
104
92
 
105
- **Use a core runtime when:**
106
- - You have a custom backend
107
- - You need features not exposed by the integration
108
- - You want full control over the implementation
93
+ | You need | Use |
94
+ | --- | --- |
95
+ | Simple `fetch` call to your API, runtime owns state | [LocalRuntime](/docs/runtimes/custom/local-runtime) |
96
+ | Keep messages in redux, zustand, tanstack-query, etc. | [ExternalStoreRuntime](/docs/runtimes/custom/external-store) |
97
+ | Backend that already speaks the data stream protocol | [DataStream](/docs/runtimes/custom/data-stream) |
98
+ | Stream full agent state snapshots (not just messages) | [AssistantTransport](/docs/runtimes/custom/assistant-transport) |
109
99
 
110
- <Callout>
111
- Pre-built integrations can always be replaced with a custom `LocalRuntime` or `ExternalStoreRuntime` implementation if you need more control later.
112
- </Callout>
100
+ If none of the framework adapters fits, start at [custom backend](/docs/runtimes/custom).
101
+
102
+ ## Shared concepts
103
+
104
+ Regardless of which runtime you pick, four ideas apply across the board.
113
105
 
114
- ## Feature Comparison
115
-
116
- ### Core Runtime Capabilities
117
-
118
- | Feature | `LocalRuntime` | `ExternalStoreRuntime` |
119
- | ------- | -------------- | ---------------------- |
120
- | **State Management** | Automatic | You control |
121
- | **Setup Complexity** | Simple | Moderate |
122
- | **Message Editing** | Built-in | Implement `onEdit` |
123
- | **Branch Switching** | Built-in | Implement `setMessages` |
124
- | **Regeneration** | Built-in | Implement `onReload` |
125
- | **Cancellation** | Built-in | Implement `onCancel` |
126
- | **Multi-thread** | Via adapters | Via adapters |
127
-
128
- ### Available Adapters
129
-
130
- | Adapter | `LocalRuntime` | `ExternalStoreRuntime` |
131
- | ------- | -------------- | ---------------------- |
132
- | ChatModel | ✅ Required | ❌ N/A |
133
- | Attachments | ✅ | ✅ |
134
- | Speech | ✅ | ✅ |
135
- | Feedback | ✅ | ✅ |
136
- | History | ✅ | ❌ Use your state |
137
- | Suggestions | ✅ | ❌ Use your state |
138
-
139
- ## Common Implementation Patterns
140
-
141
- ### Vercel AI SDK with Streaming
142
-
143
- ```tsx
144
- import { AssistantRuntimeProvider, Thread } from "@assistant-ui/react";
145
- import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
146
-
147
- export function MyAssistant() {
148
- const runtime = useChatRuntime();
149
-
150
- return (
151
- <AssistantRuntimeProvider runtime={runtime}>
152
- <Thread />
153
- </AssistantRuntimeProvider>
154
- );
155
- }
156
- ```
157
-
158
- ### Custom Backend with `LocalRuntime`
159
-
160
- ```tsx
161
- import { useLocalRuntime } from "@assistant-ui/react";
162
-
163
- const runtime = useLocalRuntime({
164
- async run({ messages, abortSignal }) {
165
- const response = await fetch("/api/chat", {
166
- method: "POST",
167
- headers: { "Content-Type": "application/json" },
168
- body: JSON.stringify({ messages }),
169
- signal: abortSignal,
170
- });
171
- return response.json();
172
- },
173
- });
174
- ```
175
-
176
- ### Redux Integration with `ExternalStoreRuntime`
177
-
178
- ```tsx
179
- import { useExternalStoreRuntime } from "@assistant-ui/react";
180
-
181
- const messages = useSelector(selectMessages);
182
- const dispatch = useDispatch();
183
-
184
- const runtime = useExternalStoreRuntime({
185
- messages,
186
- onNew: async (message) => {
187
- dispatch(addUserMessage(message));
188
- const response = await api.chat(message);
189
- dispatch(addAssistantMessage(response));
190
- },
191
- setMessages: (messages) => dispatch(setMessages(messages)),
192
- onEdit: async (message) => dispatch(editMessage(message)),
193
- onReload: async (parentId) => dispatch(reloadMessage(parentId)),
194
- });
195
- ```
196
-
197
- ## Examples
198
-
199
- Explore our implementation examples:
200
-
201
- - **[AI SDK v6 Example](https://github.com/assistant-ui/assistant-ui/tree/main/examples/with-ai-sdk-v6)** - Vercel AI SDK with `useChatRuntime`
202
- - **[External Store Example](https://github.com/assistant-ui/assistant-ui/tree/main/examples/with-external-store)** - `ExternalStoreRuntime` with custom state
203
- - **[Assistant Cloud Example](https://github.com/assistant-ui/assistant-ui/tree/main/examples/with-cloud)** - Multi-thread with cloud persistence
204
- - **[LangGraph Example](https://github.com/assistant-ui/assistant-ui/tree/main/examples/with-langgraph)** - Agent workflows
205
-
206
- ## Common Pitfalls to Avoid
207
-
208
- ### LocalRuntime Pitfalls
209
- - **Forgetting the adapter**: `LocalRuntime` requires a `ChatModelAdapter` - it won't work without one
210
- - **Not handling errors**: Always handle API errors in your adapter's `run` function
211
- - **Missing abort signal**: Pass `abortSignal` to your fetch calls for proper cancellation
212
-
213
- ### ExternalStoreRuntime Pitfalls
214
- - **Mutating state**: Always create new arrays/objects when updating messages
215
- - **Missing handlers**: Each UI feature requires its corresponding handler (e.g., no edit button without `onEdit`)
216
- - **Forgetting optimistic updates**: Set `isRunning` to `true` for loading states
217
-
218
- ### General Pitfalls
219
- - **Wrong integration level**: Don't use `LocalRuntime` if you already have Vercel AI SDK - use the AI SDK integration instead
220
- - **Over-engineering**: Start with pre-built integrations before building custom solutions
221
- - **Ignoring TypeScript**: The types will guide you to the correct implementation
222
-
223
- ## Next Steps
224
-
225
- 1. **Choose your runtime** based on the decision tree above
226
- 2. **Follow the specific guide**:
227
- - [AI SDK Integration](/docs/runtimes/ai-sdk/v6)
228
- - [`LocalRuntime` Guide](/docs/runtimes/custom/local)
229
- - [`ExternalStoreRuntime` Guide](/docs/runtimes/custom/external-store)
230
- - [LangGraph Integration](/docs/runtimes/langgraph)
231
- 3. **Start with an example** from our [examples repository](https://github.com/assistant-ui/assistant-ui/tree/main/examples)
232
- 4. **Add features progressively** using adapters
233
- 5. **Consider Assistant Cloud** for production persistence
106
+ - **Architecture** — Framework adapters wrap one of two **core runtimes** (`LocalRuntime`, `ExternalStoreRuntime`). See [architecture](/docs/runtimes/concepts/architecture) for the full layering.
107
+ - **Adapters** (attachments, speech, feedback, history, suggestions) work the same way across runtimes. See [adapters](/docs/runtimes/concepts/adapters).
108
+ - **Threads** (single, cloud, custom database) follow the same model. See [threads](/docs/runtimes/concepts/threads).
109
+ - **Stability** policy: APIs prefixed with `unstable_` may change in any release. See [stability](/docs/runtimes/concepts/stability).
234
110
 
235
111
  <Callout type="info">
236
- Need help? Join our [Discord community](https://discord.gg/S9dwgCNEFs) or check the [GitHub](https://github.com/assistant-ui/assistant-ui).
112
+ Need help? Join our [Discord community](https://discord.gg/S9dwgCNEFs) or check the [GitHub repo](https://github.com/assistant-ui/assistant-ui).
237
113
  </Callout>
@@ -4,6 +4,7 @@ description: A vertically stacked set of interactive headings that reveal or hid
4
4
  links:
5
5
  - label: Radix UI Accordion
6
6
  url: https://www.radix-ui.com/primitives/docs/components/accordion
7
+ platforms: ["react"]
7
8
  ---
8
9
 
9
10
  import { PreviewCode } from "@/components/docs/preview-code.server";
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: AssistantModal
3
3
  description: Floating chat bubble for support widgets and help desks.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { AssistantModalSample } from "@/components/docs/samples/assistant-modal";
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: AssistantSidebar
3
3
  description: Side panel chat for co-pilot experiences and inline assistance.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { AssistantSidebarSample } from "@/components/docs/samples/assistant-sidebar";
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Attachment
3
3
  description: UI components for attaching and viewing files in messages.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { AttachmentSample } from "@/components/docs/samples/attachment";
@@ -4,6 +4,7 @@ description: A small label component for displaying status, categories, or metad
4
4
  links:
5
5
  - label: Radix UI Slot
6
6
  url: https://www.radix-ui.com/primitives/docs/utilities/slot
7
+ platforms: ["react"]
7
8
  ---
8
9
 
9
10
  import { PreviewCode } from "@/components/docs/preview-code.server";
@@ -0,0 +1,200 @@
1
+ ---
2
+ title: Composer Trigger Popover
3
+ description: Reusable picker UI for @ mentions, / slash commands, and any other character-triggered popover.
4
+ platforms: ["react"]
5
+ ---
6
+
7
+ import { ComposerTriggerPopoverSample } from "@/components/docs/samples/composer-trigger-popover";
8
+
9
+ <ComposerTriggerPopoverSample />
10
+
11
+ ## Getting Started
12
+
13
+ <Steps>
14
+ <Step>
15
+
16
+ ### Add `composer-trigger-popover`
17
+
18
+ <InstallCommand shadcn={["composer-trigger-popover"]} />
19
+
20
+ This adds `/components/assistant-ui/composer-trigger-popover.tsx` — a generic picker UI (Categories + Items + Back) driven by an adapter and one of two behavior props: `directive` (insert a chip) or `action` (run a callback).
21
+
22
+ </Step>
23
+ <Step>
24
+
25
+ ### Wrap the composer
26
+
27
+ Place `ComposerPrimitive.Unstable_TriggerPopoverRoot` around your composer. Any number of `ComposerTriggerPopover` declarations can live inside — each with its own trigger character, adapter, and behavior prop.
28
+
29
+ ```tsx title="components/assistant-ui/thread.tsx"
30
+ import { ComposerPrimitive } from "@assistant-ui/react";
31
+ import { ComposerTriggerPopover } from "@/components/assistant-ui/composer-trigger-popover";
32
+
33
+ const Composer = () => (
34
+ <ComposerPrimitive.Unstable_TriggerPopoverRoot>
35
+ <ComposerPrimitive.Root>
36
+ <ComposerPrimitive.Input placeholder="Type @ to mention, / for commands..." />
37
+ <ComposerPrimitive.Send />
38
+
39
+ {/* triggers declared here */}
40
+ </ComposerPrimitive.Root>
41
+ </ComposerPrimitive.Unstable_TriggerPopoverRoot>
42
+ );
43
+ ```
44
+
45
+ </Step>
46
+ </Steps>
47
+
48
+ ## @ Mention
49
+
50
+ Pair the popover with `unstable_useMentionAdapter` — the hook returns a spreadable `{ adapter, directive }` bundle so selecting an item writes a `:tool[Label]{name=id}` directive into the composer text.
51
+
52
+ ```tsx
53
+ import { unstable_useMentionAdapter } from "@assistant-ui/react";
54
+ import { WrenchIcon } from "lucide-react";
55
+
56
+ const mention = unstable_useMentionAdapter();
57
+
58
+ <ComposerTriggerPopover
59
+ char="@"
60
+ {...mention}
61
+ fallbackIcon={WrenchIcon}
62
+ />;
63
+ ```
64
+
65
+ Override formatter or add an `onInserted` callback via hook options: `unstable_useMentionAdapter({ formatter, onInserted })`.
66
+
67
+ `unstable_useMentionAdapter` also accepts `items` (flat custom list), `categories` (multi-category drill-down), and `includeModelContextTools` for fine-grained control. See the [Mentions guide](/docs/guides/mentions#built-in-mention-adapter).
68
+
69
+ Render selected mentions as chips in user messages with [`DirectiveText`](/docs/ui/directive-text). For inline chips **inside** the composer, use [`LexicalComposerInput`](/docs/guides/mentions#textarea-vs-lexical).
70
+
71
+ ## / Slash Command
72
+
73
+ Use [`unstable_useSlashCommandAdapter`](/docs/guides/slash-commands) to bundle commands (data + `execute`) into `{ adapter, action }` — then plug both into `ComposerTriggerPopover`. By default a directive chip is left in the composer as an audit trail; pass `removeOnExecute` to strip the `/command` text entirely. `iconMap` maps `metadata.icon` strings on items and categories to Lucide icons.
74
+
75
+ ```tsx
76
+ import {
77
+ unstable_useSlashCommandAdapter,
78
+ type Unstable_SlashCommand,
79
+ } from "@assistant-ui/react";
80
+ import { FileTextIcon, GlobeIcon, LanguagesIcon, SlashIcon } from "lucide-react";
81
+
82
+ const SLASH_COMMANDS: readonly Unstable_SlashCommand[] = [
83
+ {
84
+ id: "summarize",
85
+ description: "Summarize the conversation",
86
+ icon: "FileText",
87
+ execute: () => {/* ... */},
88
+ },
89
+ {
90
+ id: "translate",
91
+ description: "Translate to another language",
92
+ icon: "Languages",
93
+ execute: () => {/* ... */},
94
+ },
95
+ {
96
+ id: "search",
97
+ description: "Search the web",
98
+ icon: "Globe",
99
+ execute: () => {/* ... */},
100
+ },
101
+ ];
102
+
103
+ function SlashComposer() {
104
+ const slash = unstable_useSlashCommandAdapter({ commands: SLASH_COMMANDS });
105
+
106
+ return (
107
+ <ComposerTriggerPopover
108
+ char="/"
109
+ {...slash}
110
+ iconMap={{
111
+ FileText: FileTextIcon,
112
+ Languages: LanguagesIcon,
113
+ Globe: GlobeIcon,
114
+ }}
115
+ fallbackIcon={SlashIcon}
116
+ />
117
+ );
118
+ }
119
+ ```
120
+
121
+ ## Combining Triggers
122
+
123
+ Multiple popovers coexist under one `TriggerPopoverRoot`. Each reads state from its own declaration, so `@` and `/` never collide.
124
+
125
+ ```tsx
126
+ const commandHandlers: Record<string, () => void> = {
127
+ summarize: () => {/* ... */},
128
+ translate: () => {/* ... */},
129
+ };
130
+
131
+ <ComposerPrimitive.Unstable_TriggerPopoverRoot>
132
+ <ComposerPrimitive.Root>
133
+ <ComposerPrimitive.Input placeholder="Type @ to mention, / for commands..." />
134
+
135
+ <ComposerTriggerPopover
136
+ char="@"
137
+ adapter={mentionAdapter}
138
+ directive={{ formatter: unstable_defaultDirectiveFormatter }}
139
+ fallbackIcon={WrenchIcon}
140
+ />
141
+ <ComposerTriggerPopover
142
+ char="/"
143
+ adapter={slashAdapter}
144
+ action={{
145
+ formatter: unstable_defaultDirectiveFormatter,
146
+ onExecute: (item) => commandHandlers[item.id]?.(),
147
+ }}
148
+ iconMap={slashIcons}
149
+ fallbackIcon={SlashIcon}
150
+ />
151
+ </ComposerPrimitive.Root>
152
+ </ComposerPrimitive.Unstable_TriggerPopoverRoot>
153
+ ```
154
+
155
+ ## Keyboard Navigation
156
+
157
+ | Key | Action |
158
+ | --- | --- |
159
+ | <Kbd>ArrowDown</Kbd> | Highlight next item |
160
+ | <Kbd>ArrowUp</Kbd> | Highlight previous item |
161
+ | <Kbd>Enter</Kbd> | Select highlighted item / drill into category |
162
+ | <Kbd>Escape</Kbd> | Close popover |
163
+ | <Kbd>Backspace</Kbd> | Go back to categories (when query is empty) |
164
+
165
+ ## API Reference
166
+
167
+ | Prop | Type | Default | Description |
168
+ | --- | --- | --- | --- |
169
+ | `char` | `string` | — | Trigger character, e.g. `"@"` or `"/"` (required; unique within the root) |
170
+ | `adapter` | `Unstable_TriggerAdapter` | — | Provides categories, items, and search (required) |
171
+ | `directive` | `{ formatter, onInserted?, chip? }` | — | Enables directive-insert behavior. Mutually exclusive with `action`. |
172
+ | `action` | `{ formatter, onExecute, removeOnExecute?, chip? }` | — | Enables action behavior. Mutually exclusive with `directive`. |
173
+ | `iconMap` | `Record<string, IconComponent>` | — | Maps `item.metadata.icon` / `category.metadata.icon` strings to icons |
174
+ | `fallbackIcon` | `IconComponent` | `SparklesIcon` | Icon used when no `iconMap` entry matches |
175
+ | `backLabel` | `string` | `"Back"` | Back button label |
176
+ | `emptyCategoriesLabel` | `string` | `"No items available"` | Shown when no categories are available |
177
+ | `emptyItemsLabel` | `string` | `"No matching items"` | Shown when no items match |
178
+
179
+ All other props (`className`, etc.) forward to the underlying popover `div`.
180
+
181
+ ### `directive` object
182
+
183
+ | Field | Type | Description |
184
+ | --- | --- | --- |
185
+ | `formatter` | `Unstable_DirectiveFormatter` | Serializes the selected item into the directive text written to the composer |
186
+ | `onInserted` | `(item) => void` | Optional callback fired after the directive has been inserted |
187
+
188
+ ### `action` object
189
+
190
+ | Field | Type | Description |
191
+ | --- | --- | --- |
192
+ | `formatter` | `Unstable_DirectiveFormatter` | Serializes the selected item into the chip left behind (unused when `removeOnExecute`) |
193
+ | `onExecute` | `(item) => void` | Callback fired when an item is selected |
194
+ | `removeOnExecute` | `boolean` | When `true`, strips the trigger text instead of leaving a chip. Default `false`. |
195
+
196
+ ## Related
197
+
198
+ - [Directive Text](/docs/ui/directive-text) — renderer for mention chips in user messages
199
+ - [Mentions guide](/docs/guides/mentions) — `@`-mention architecture and formatter details
200
+ - [Slash Commands guide](/docs/guides/slash-commands) — `/`-command architecture
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Context Display
3
3
  description: Visualize token usage relative to a model's context window — ring, bar, or text — with a detailed hover popover.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { ContextDisplaySample } from "@/components/docs/samples/context-display";
@@ -6,6 +6,7 @@ links:
6
6
  url: https://github.com/sergeyt/parse-diff
7
7
  - label: diff
8
8
  url: https://github.com/kpdecker/jsdiff
9
+ platforms: ["react"]
9
10
  ---
10
11
 
11
12
  import { PreviewCode } from "@/components/docs/preview-code.server";