@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
@@ -368,6 +368,7 @@ export function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
368
368
  <div className="flex items-center gap-2">
369
369
  <span className="text-muted-foreground text-sm">Controls:</span>
370
370
  <button
371
+ type="button"
371
372
  onClick={() => {
372
373
  updateCurrentThreadMessages((prev) => [
373
374
  ...prev,
@@ -383,6 +384,7 @@ export function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
383
384
  Add User Message
384
385
  </button>
385
386
  <button
387
+ type="button"
386
388
  onClick={() => {
387
389
  updateCurrentThreadMessages((prev) => [
388
390
  ...prev,
@@ -400,12 +402,14 @@ export function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
400
402
  Add Assistant Message
401
403
  </button>
402
404
  <button
405
+ type="button"
403
406
  onClick={() => setIsRunning(!isRunning)}
404
407
  className="rounded-md bg-accent px-3 py-1 font-medium text-accent-foreground text-sm hover:bg-accent/80"
405
408
  >
406
409
  {isRunning ? "Stop" : "Start"} Running
407
410
  </button>
408
411
  <button
412
+ type="button"
409
413
  onClick={() => updateCurrentThreadMessages(() => [])}
410
414
  className="rounded-md bg-destructive px-3 py-1 font-medium text-sm text-white hover:bg-destructive/90"
411
415
  >
@@ -597,22 +601,22 @@ export default nextConfig;
597
601
  "@assistant-ui/ui": "workspace:*",
598
602
  "class-variance-authority": "^0.7.1",
599
603
  "clsx": "^2.1.1",
600
- "lucide-react": "^1.8.0",
601
- "next": "^16.2.3",
604
+ "lucide-react": "^1.14.0",
605
+ "next": "^16.2.4",
602
606
  "react": "^19.2.5",
603
607
  "react-dom": "^19.2.5",
604
608
  "tailwind-merge": "^3.5.0"
605
609
  },
606
610
  "devDependencies": {
607
611
  "@assistant-ui/x-buildutils": "workspace:*",
608
- "@tailwindcss/postcss": "^4.2.2",
612
+ "@tailwindcss/postcss": "^4.2.4",
609
613
  "@types/node": "^25.6.0",
610
614
  "@types/react": "^19.2.14",
611
615
  "@types/react-dom": "^19.2.3",
612
- "postcss": "^8.5.9",
613
- "tailwindcss": "^4.2.2",
616
+ "postcss": "^8.5.14",
617
+ "tailwindcss": "^4.2.4",
614
618
  "tw-animate-css": "^1.4.0",
615
- "typescript": "^6.0.2"
619
+ "typescript": "^6.0.3"
616
620
  }
617
621
  }
618
622
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: CLI
3
3
  description: Scaffold projects, add components, and manage updates from the command line.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  Use the `assistant-ui` CLI to quickly set up new projects and add components to existing ones.
@@ -68,7 +69,7 @@ Use `--example` to create a project from one of the monorepo examples with full
68
69
  | `with-artifacts` | HTML artifact rendering with live preview | `npx assistant-ui create my-app -e with-artifacts` |
69
70
  | `with-langgraph` | LangGraph agent with custom tools | `npx assistant-ui create my-app -e with-langgraph` |
70
71
  | `with-cloud` | Assistant Cloud persistence | `npx assistant-ui create my-app -e with-cloud` |
71
- | `with-ag-ui` | AG-UI protocol integration | `npx assistant-ui create my-app -e with-ag-ui` |
72
+ | `with-ag-ui` | [AG-UI protocol](/docs/runtimes/ag-ui) integration | `npx assistant-ui create my-app -e with-ag-ui` |
72
73
  | `with-assistant-transport` | Custom backend via Assistant Transport | `npx assistant-ui create my-app -e with-assistant-transport` |
73
74
  | `with-chain-of-thought` | Chain-of-thought with JS execution | `npx assistant-ui create my-app -e with-chain-of-thought` |
74
75
  | `with-external-store` | External message store | `npx assistant-ui create my-app -e with-external-store` |
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Assistant Frame API
3
3
  description: Share model context across iframe boundaries
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  The Assistant Frame API enables iframes to provide model context (tools and instructions) to a parent window's assistant. This is particularly useful for embedded applications, plugins, or sandboxed components that need to contribute capabilities to the main assistant.
@@ -1,11 +1,18 @@
1
1
  ---
2
2
  title: makeAssistantToolUI
3
3
  description: Register custom UI components to render tool executions and their status.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
- <Callout type="warn">
7
- `makeAssistantToolUI` is deprecated. Use the `Tools()` API instead. See the
8
- [Tools guide](/docs/guides/tools) for the recommended approach.
7
+ <Callout type="info">
8
+ Prefer pre-registering tool UIs via the [`Tools()` API](/docs/guides/tools)
9
+ (set `render` on the tool definition) or by mounting `makeAssistantToolUI`
10
+ near the root of your tree. A tool UI that is only registered while a
11
+ specific component is mounted will not appear when chat history is replayed
12
+ or during server-side rendering, since the registering component may not be
13
+ mounted at that point. Tool execution can still be registered dynamically
14
+ via [`makeAssistantTool`](/docs/copilots/make-assistant-tool); this caveat
15
+ applies specifically to the UI render function.
9
16
  </Callout>
10
17
 
11
18
  The `makeAssistantToolUI` utility is used to register a tool UI component with the Assistant.
@@ -1,11 +1,16 @@
1
1
  ---
2
2
  title: makeAssistantTool
3
3
  description: Create React components that provide reusable tools to the assistant.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
- <Callout type="warn">
7
- `makeAssistantTool` is deprecated. Use the `Tools()` API instead. See the
8
- [Tools guide](/docs/guides/tools) for the recommended approach.
7
+ <Callout type="info">
8
+ For most apps, the [`Tools()` API](/docs/guides/tools) is an easier starting
9
+ point: tool definitions live in a toolkit object rather than the component
10
+ tree. `makeAssistantTool` is fully supported and remains a good fit when a
11
+ tool's availability is tied to a component being mounted, for example a
12
+ product-specific tool that should only be exposed while that product's UI is
13
+ on screen (the [intelligent components](/docs/copilots/motivation) pattern).
9
14
  </Callout>
10
15
 
11
16
  `makeAssistantTool` creates a React component that provides a tool to the assistant. This is useful for defining reusable tools that can be composed into your application.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: makeAssistantVisible
3
3
  description: Make React components visible and interactive to assistants via higher-order component wrapping.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  `makeAssistantVisible` is a higher-order component (HOC) that makes React components "visible" by the assistant, allowing it to understand and interact with the component's HTML structure.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Model Context
3
3
  description: Configure assistant behavior through system instructions, tools, and context providers.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  Model Context is the foundation of intelligence in assistant-ui components. It provides configuration and capabilities to the assistant through a context provider system.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Intelligent Components
3
3
  description: Add intelligence to React components through readable interfaces and assistant tools.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  React revolutionized web development with components that combine logic, structure, and style. Now, with assistant-ui, we're adding a fourth dimension: intelligence. Let's learn how to build smart components through a practical banking app example.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: useAssistantInstructions
3
3
  description: React hook for setting system instructions to guide assistant behavior.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  `useAssistantInstructions` is a React hook that allows you to set system instructions for your assistant-ui components.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: DevTools
3
3
  description: Inspect runtime state, context, and events in the browser.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Introduction
3
3
  description: Beautiful, enterprise-grade AI chat interfaces for React, React Native, and terminal applications.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { PanelsTopLeft, Database, Terminal } from "lucide-react";
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Installation
3
3
  description: Get assistant-ui running in 5 minutes with npm and your first chat component.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
 
@@ -0,0 +1,80 @@
1
+ ---
2
+ title: RTL Support
3
+ description: Use assistant-ui with right-to-left languages like Arabic, Hebrew, and Persian.
4
+ platforms: ["react"]
5
+ ---
6
+
7
+ Components shipped through `@assistant-ui/ui` (npm) and the shadcn registry (`npx shadcn@latest add https://r.assistant-ui.com/...`) use logical Tailwind classes (`ms-*`, `pe-*`, `text-start`, `end-*`, `border-s`, ...). They flip automatically under `dir="rtl"` and render byte-identically under `dir="ltr"` (the default) — there is nothing to opt out of.
8
+
9
+ If you scaffolded from one of our templates (e.g. `npx assistant-ui@latest create -t default`), the generated `components/` folder still uses physical classes (`ml-*`, `text-left`, ...). Run shadcn's built-in migration **once** to convert both the shadcn primitives and assistant-ui's wrappers:
10
+
11
+ ```sh
12
+ # shadcn primitives under components/ui/
13
+ npx shadcn@latest migrate rtl
14
+
15
+ # assistant-ui wrappers (pass a custom glob)
16
+ npx shadcn@latest migrate rtl 'components/assistant-ui/**/*.tsx'
17
+ ```
18
+
19
+ Commit the diff and do not re-run. The upstream migration is not fully idempotent on repeat runs ([#9891](https://github.com/shadcn-ui/ui/pull/9891)); you may end up with duplicated `rtl:translate-x-*` classes.
20
+
21
+ After migrating, follow the setup below.
22
+
23
+ ## Setup
24
+
25
+ ### 1. Install the `direction` component
26
+
27
+ ```sh
28
+ npx shadcn@latest add https://r.assistant-ui.com/direction.json
29
+ ```
30
+
31
+ This adds `components/ui/direction.tsx`, a thin re-export of Radix UI's `DirectionProvider` and `useDirection`. It ensures Radix popovers, dropdowns, and menus pick up the current direction.
32
+
33
+ ### 2. Set `dir` on your root element
34
+
35
+ ```tsx title="app/layout.tsx"
36
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
37
+ return (
38
+ <html lang="ar" dir="rtl">
39
+ <body>{children}</body>
40
+ </html>
41
+ );
42
+ }
43
+ ```
44
+
45
+ ### 3. Wrap your app with `DirectionProvider`
46
+
47
+ ```tsx title="app/providers.tsx"
48
+ "use client";
49
+
50
+ import { DirectionProvider } from "@/components/ui/direction";
51
+
52
+ export function Providers({ children }: { children: React.ReactNode }) {
53
+ return <DirectionProvider dir="rtl">{children}</DirectionProvider>;
54
+ }
55
+ ```
56
+
57
+ For apps that need to switch direction at runtime, drive `dir` from state and also update `document.documentElement.dir` to keep Tailwind's `[dir=rtl]` selector in sync.
58
+
59
+ ## How it works
60
+
61
+ Every physical class (`ml-4`, `text-left`, `right-3`, `border-l`, ...) in `@assistant-ui/ui` is authored in logical form (`ms-4`, `text-start`, `end-3`, `border-s`, ...). Logical properties resolve to the matching physical side based on the ancestor with a `dir` attribute:
62
+
63
+ | Class | `dir="ltr"` | `dir="rtl"` |
64
+ | ----- | ----------- | ----------- |
65
+ | `ms-4` | `margin-left: 1rem` | `margin-right: 1rem` |
66
+ | `pe-2` | `padding-right: 0.5rem` | `padding-left: 0.5rem` |
67
+ | `end-3` | `right: 0.75rem` | `left: 0.75rem` |
68
+ | `text-start` | `text-align: left` | `text-align: right` |
69
+ | `border-s` | `border-left` | `border-right` |
70
+
71
+ A handful of Tailwind utilities have no logical equivalent, so we ship both the LTR value and an `rtl:` override:
72
+
73
+ - `translate-x-*`: emits `-translate-x-*` plus `rtl:translate-x-*` (sign-flipped).
74
+ - `space-x-*` / `divide-x-*`: emits the original plus `rtl:space-x-reverse` / `rtl:divide-x-reverse`.
75
+
76
+ ## Known edges
77
+
78
+ - **Radix `data-[side=left|right]:slide-in-from-*`** animations are intentionally preserved as physical. Radix's `DirectionProvider` already flips the emitted `data-side` value, so no rewrite is needed.
79
+ - **Third-party components and template scaffolds** may still use physical classes. Run `npx shadcn@latest migrate rtl` once per project (optionally with a path glob) to convert them. Do not re-run — see the note about upstream idempotency in the intro.
80
+ - **Text that mixes LTR and RTL content** (e.g., English code inside Arabic prose) relies on the browser's bidi algorithm. Wrap unambiguous spans with `<bdi>` or `dir="ltr"` if you need to pin direction locally.
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: Attachment Adapters
3
+ description: Upload and compose file attachment handlers.
4
+ ---
5
+
6
+ Attachment adapters control how files become assistant-ui attachments.
7
+
8
+ ```tsx
9
+ import {
10
+ CompositeAttachmentAdapter,
11
+ SimpleImageAttachmentAdapter,
12
+ SimpleTextAttachmentAdapter,
13
+ useLocalRuntime,
14
+ } from "@assistant-ui/react";
15
+
16
+ const attachments = new CompositeAttachmentAdapter([
17
+ new SimpleImageAttachmentAdapter(),
18
+ new SimpleTextAttachmentAdapter(),
19
+ ]);
20
+
21
+ const runtime = useLocalRuntime(chatModelAdapter, {
22
+ adapters: { attachments },
23
+ });
24
+ ```
25
+
26
+ ## Common Exports
27
+
28
+ - `AttachmentAdapter` is the interface for custom attachment handling.
29
+ - `SimpleImageAttachmentAdapter` converts supported image files.
30
+ - `SimpleTextAttachmentAdapter` converts supported text files.
31
+ - `CompositeAttachmentAdapter` tries multiple attachment adapters in order.
32
+ - `CloudFileAttachmentAdapter` uploads files through Assistant Cloud.
33
+
34
+ For a custom implementation guide, see [Custom Attachment Adapter](/docs/integrations/attachments/custom-adapter).
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: Feedback and Speech Adapters
3
+ description: Capture message feedback and connect speech or dictation.
4
+ ---
5
+
6
+ ## Feedback
7
+
8
+ `FeedbackAdapter` receives message feedback submitted through action primitives or runtime actions.
9
+
10
+ ```tsx
11
+ const runtime = useLocalRuntime(chatModelAdapter, {
12
+ adapters: {
13
+ feedback: {
14
+ submit: async ({ message, type }) => {
15
+ await fetch("/api/feedback", {
16
+ method: "POST",
17
+ body: JSON.stringify({ messageId: message.id, type }),
18
+ });
19
+ },
20
+ },
21
+ },
22
+ });
23
+ ```
24
+
25
+ ## Speech
26
+
27
+ `SpeechSynthesisAdapter` controls text-to-speech playback. `WebSpeechSynthesisAdapter` provides a browser implementation.
28
+
29
+ ```tsx
30
+ import { WebSpeechSynthesisAdapter } from "@assistant-ui/react";
31
+
32
+ const runtime = useLocalRuntime(chatModelAdapter, {
33
+ adapters: {
34
+ speech: new WebSpeechSynthesisAdapter(),
35
+ },
36
+ });
37
+ ```
38
+
39
+ ## Dictation and Suggestions
40
+
41
+ Runtime adapters can also provide dictation and suggestion behavior. Dictation powers composer voice input; suggestions power prompt suggestions rendered by thread and suggestion primitives.
@@ -0,0 +1,26 @@
1
+ ---
2
+ title: Overview
3
+ description: Interfaces for persistence, files, speech, dictation, feedback, suggestions, and runtime composition.
4
+ ---
5
+
6
+ {/* AUTO-GENERATED by scripts/generate-api-reference-overviews.mts */}
7
+ {/* Do not edit manually. */}
8
+
9
+ Adapters let you replace runtime behavior without replacing the UI. They are usually passed through runtime options or provided by integration packages.
10
+
11
+ ## Pages
12
+
13
+ <Cards>
14
+ <Card title={"Runtime Adapter Context"} href={"/docs/api-reference/adapters/runtime"}>
15
+ {"Provide runtime adapters through React context."}
16
+ </Card>
17
+ <Card title={"Attachment Adapters"} href={"/docs/api-reference/adapters/attachments"}>
18
+ {"Upload and compose file attachment handlers."}
19
+ </Card>
20
+ <Card title={"Persistence Adapters"} href={"/docs/api-reference/adapters/persistence"}>
21
+ {"Persist message history and thread lists."}
22
+ </Card>
23
+ <Card title={"Feedback and Speech Adapters"} href={"/docs/api-reference/adapters/feedback-speech"}>
24
+ {"Capture message feedback and connect speech or dictation."}
25
+ </Card>
26
+ </Cards>
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: Persistence Adapters
3
+ description: Persist message history and thread lists.
4
+ ---
5
+
6
+ assistant-ui has two persistence layers:
7
+
8
+ - `ThreadHistoryAdapter` persists messages for a single runtime thread.
9
+ - `RemoteThreadListAdapter` manages a backend-backed list of threads, including creating, loading, archiving, deleting, and title generation.
10
+
11
+ ## Thread History
12
+
13
+ ```tsx
14
+ const runtime = useLocalRuntime(chatModelAdapter, {
15
+ adapters: {
16
+ history: myHistoryAdapter,
17
+ },
18
+ });
19
+ ```
20
+
21
+ Use a history adapter when the app has one active thread or when thread list management lives somewhere else.
22
+
23
+ ## Remote Thread Lists
24
+
25
+ ```tsx
26
+ const runtime = useRemoteThreadListRuntime({
27
+ adapter: myRemoteThreadListAdapter,
28
+ runtimeHook: () => useLocalRuntime(chatModelAdapter),
29
+ });
30
+ ```
31
+
32
+ Use a remote thread list adapter when your backend owns conversation metadata and users can switch between many threads.
33
+
34
+ Assistant Cloud provides managed persistence through `AssistantCloud` and cloud runtime helpers. See [Threads](/docs/runtimes/concepts/threads) for the full threading model.
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: Runtime Adapter Context
3
+ description: Provide runtime adapters through React context.
4
+ ---
5
+
6
+ `RuntimeAdapterProvider` lets framework integrations provide adapters around a runtime hook instead of threading them through every hook call.
7
+
8
+ ```tsx
9
+ import {
10
+ RuntimeAdapterProvider,
11
+ useLocalRuntime,
12
+ } from "@assistant-ui/react";
13
+
14
+ function RuntimeRoot({ children }) {
15
+ return (
16
+ <RuntimeAdapterProvider
17
+ adapters={{
18
+ history,
19
+ attachments,
20
+ feedback,
21
+ }}
22
+ >
23
+ {children}
24
+ </RuntimeAdapterProvider>
25
+ );
26
+ }
27
+ ```
28
+
29
+ Runtime hooks merge context adapters with hook-specific options. Hook options are the right place for per-runtime configuration; the provider is useful when an integration or backend wrapper owns the adapter setup.
30
+
31
+ Use `useRuntimeAdapters` only when building a runtime integration that needs to read the adapter context directly.
@@ -0,0 +1,20 @@
1
+ ---
2
+ title: Overview
3
+ description: Context providers that establish assistant-ui runtime and message-part scopes.
4
+ ---
5
+
6
+ {/* AUTO-GENERATED by scripts/generate-api-reference-overviews.mts */}
7
+ {/* Do not edit manually. */}
8
+
9
+ Context providers establish the scopes that primitives and hooks read from. Most apps only use `AssistantRuntimeProvider` directly; lower-level providers are for custom renderers and advanced composition.
10
+
11
+ ## Pages
12
+
13
+ <Cards>
14
+ <Card title={"<AssistantRuntimeProvider />"} href={"/docs/api-reference/context-providers/assistant-runtime-provider"}>
15
+ {"Root provider that connects your runtime to assistant-ui components."}
16
+ </Card>
17
+ <Card title={"<TextMessagePartProvider />"} href={"/docs/api-reference/context-providers/text-message-part-provider"}>
18
+ {"Context provider for reusing text components outside of message content."}
19
+ </Card>
20
+ </Cards>
@@ -0,0 +1,26 @@
1
+ ---
2
+ title: Overview
3
+ description: Reactive state, runtime creation, model context, and utility hooks for React.
4
+ ---
5
+
6
+ {/* AUTO-GENERATED by scripts/generate-api-reference-overviews.mts */}
7
+ {/* Do not edit manually. */}
8
+
9
+ Hooks are the programmatic layer of `@assistant-ui/react`. Use them when primitives are not enough: reading state, creating runtimes, registering tools, wiring model context, or building custom behavior around the assistant runtime.
10
+
11
+ ## Pages
12
+
13
+ <Cards>
14
+ <Card title={"State Hooks"} href={"/docs/api-reference/hooks/state"}>
15
+ {"Read assistant state and call runtime actions."}
16
+ </Card>
17
+ <Card title={"Runtime Hooks"} href={"/docs/api-reference/hooks/runtimes"}>
18
+ {"Hooks for creating assistant runtimes."}
19
+ </Card>
20
+ <Card title={"Model Context Hooks"} href={"/docs/api-reference/hooks/model-context"}>
21
+ {"Register instructions, tools, tool UIs, and data renderers."}
22
+ </Card>
23
+ <Card title={"Utility Hooks"} href={"/docs/api-reference/hooks/utilities"}>
24
+ {"Focused helpers for message parts, quotes, timing, and viewport behavior."}
25
+ </Card>
26
+ </Cards>
@@ -0,0 +1,72 @@
1
+ ---
2
+ title: Model Context Hooks
3
+ description: Register instructions, tools, tool UIs, and data renderers.
4
+ ---
5
+
6
+ Model context hooks let React components contribute model-facing configuration while they are mounted.
7
+
8
+ ## Instructions
9
+
10
+ ```tsx
11
+ import { useAssistantInstructions } from "@assistant-ui/react";
12
+
13
+ useAssistantInstructions("Answer with concise examples.");
14
+ ```
15
+
16
+ ## Tools
17
+
18
+ `useAssistantTool` registers a tool definition, optional `execute` function, and optional renderer.
19
+
20
+ ```tsx
21
+ import { useAssistantTool } from "@assistant-ui/react";
22
+
23
+ useAssistantTool({
24
+ toolName: "get_weather",
25
+ description: "Get the current weather for a city",
26
+ parameters: {
27
+ type: "object",
28
+ properties: {
29
+ city: { type: "string" },
30
+ },
31
+ required: ["city"],
32
+ },
33
+ execute: async ({ city }) => ({ city, temperature: 72 }),
34
+ render: ({ args, result }) => (
35
+ <div>
36
+ {args.city}: {result?.temperature}F
37
+ </div>
38
+ ),
39
+ });
40
+ ```
41
+
42
+ ## Tool UI
43
+
44
+ Use `useAssistantToolUI` when the backend or model already owns the tool definition and the frontend only needs to render calls.
45
+
46
+ ```tsx
47
+ import { useAssistantToolUI } from "@assistant-ui/react";
48
+
49
+ useAssistantToolUI({
50
+ toolName: "get_weather",
51
+ render: ({ args, result, status }) => (
52
+ <div>{status.type === "running" ? "Loading..." : result?.summary}</div>
53
+ ),
54
+ });
55
+ ```
56
+
57
+ ## Data UI
58
+
59
+ `useAssistantDataUI` renders named data message parts.
60
+
61
+ ```tsx
62
+ import { useAssistantDataUI } from "@assistant-ui/react";
63
+
64
+ useAssistantDataUI({
65
+ name: "weather_card",
66
+ render: ({ data }) => <WeatherCard data={data} />,
67
+ });
68
+ ```
69
+
70
+ ## Declarative Registration
71
+
72
+ `makeAssistantTool` and `makeAssistantToolUI` create components that register model context when mounted. They are useful when tools should live in JSX alongside the feature that owns them.
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: Runtime Hooks
3
+ description: Hooks for creating assistant runtimes.
4
+ ---
5
+
6
+ Runtime hooks create the `AssistantRuntime` passed to `AssistantRuntimeProvider`.
7
+
8
+ ```tsx
9
+ import {
10
+ AssistantRuntimeProvider,
11
+ useLocalRuntime,
12
+ } from "@assistant-ui/react";
13
+
14
+ function App() {
15
+ const runtime = useLocalRuntime(chatModelAdapter);
16
+
17
+ return (
18
+ <AssistantRuntimeProvider runtime={runtime}>
19
+ {children}
20
+ </AssistantRuntimeProvider>
21
+ );
22
+ }
23
+ ```
24
+
25
+ ## Core Runtime Hooks
26
+
27
+ - [`useLocalRuntime`](/docs/runtimes/custom/local-runtime) creates a runtime from a `ChatModelAdapter`.
28
+ - [`useRemoteThreadListRuntime`](/docs/runtimes/concepts/threads) adds backend-backed thread list management.
29
+ - [`useExternalStoreRuntime`](/docs/runtimes/custom/external-store) adapts an external message store.
30
+ - [`useAssistantTransportRuntime`](/docs/runtimes/custom/assistant-transport) consumes assistant-stream transport events.
31
+
32
+ ## Integration Runtime Hooks
33
+
34
+ - [`useChatRuntime`](/docs/runtimes/ai-sdk/overview) adapts AI SDK chat helpers.
35
+ - [`useDataStreamRuntime`](/docs/runtimes/custom/data-stream) adapts assistant-stream data streams.
36
+ - [`useLangGraphRuntime`](/docs/runtimes/langgraph/overview) adapts LangGraph.
37
+ - [`useCloudThreadListRuntime`](/docs/cloud) uses Assistant Cloud for thread persistence.
38
+
39
+ ## Runtime Options
40
+
41
+ Most runtime hooks accept adapters for persistence, attachments, speech, dictation, feedback, and suggestions. See [Adapters](/docs/api-reference/adapters) for the adapter map.
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: State Hooks
3
+ description: Read assistant state and call runtime actions.
4
+ ---
5
+
6
+ ## useAuiState
7
+
8
+ `useAuiState` is the primary hook for reactive state. Pass a selector and the component re-renders when the selected value changes.
9
+
10
+ ```tsx
11
+ import { useAuiState } from "@assistant-ui/react";
12
+
13
+ const messages = useAuiState((s) => s.thread.messages);
14
+ const isRunning = useAuiState((s) => s.thread.isRunning);
15
+ const composerText = useAuiState((s) => s.composer.text);
16
+ ```
17
+
18
+ Selectors are scoped by context. Inside a message primitive, `s.message` refers to that message; inside an attachment primitive, `s.attachment` refers to that attachment.
19
+
20
+ ## useAui
21
+
22
+ `useAui` returns the runtime action API. Use it for imperative operations such as sending composer text, cancelling a run, switching threads, or submitting feedback.
23
+
24
+ ```tsx
25
+ import { useAui } from "@assistant-ui/react";
26
+
27
+ const aui = useAui();
28
+
29
+ aui.composer().setText("Hello");
30
+ aui.composer().send();
31
+ aui.thread().cancelRun();
32
+ ```
33
+
34
+ Runtime action and state shapes are documented in the [Runtime State](/docs/api-reference/runtimes/assistant-runtime) section.
35
+
36
+ ## useAuiEvent
37
+
38
+ `useAuiEvent` subscribes to runtime events without using the event as render state.
39
+
40
+ ```tsx
41
+ import { useAuiEvent } from "@assistant-ui/react";
42
+
43
+ useAuiEvent("thread.runStart", (payload) => {
44
+ console.log("Run started", payload);
45
+ });
46
+ ```
47
+
48
+ Use `useAuiEvent` for analytics, logging, or side effects that should not cause UI re-renders.