@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,6 +1,7 @@
1
1
  ---
2
2
  title: Composer
3
3
  description: Build custom message input UIs with full control over layout and behavior.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { ComposerPrimitiveSample } from "@/components/docs/samples/composer-primitive";
@@ -104,26 +105,31 @@ The primitive's behavior (keyboard handling, disabled state, form submission) is
104
105
 
105
106
  ### Unstable Trigger Popovers
106
107
 
107
- Composer includes an unstable **trigger popover** system for character-triggered popovers (e.g. `@` for mentions, `/` for slash commands). Multiple triggers can coexist on the same input.
108
-
109
- **Mentions** (`@` trigger) — insert directive text into the message:
108
+ Composer includes an unstable **trigger popover** system for character-triggered popovers (e.g. `@` for mentions, `/` for slash commands). Multiple triggers coexist under a single `TriggerPopoverRoot`.
110
109
 
111
110
  ```tsx
112
- <ComposerPrimitive.Unstable_MentionRoot adapter={mentionAdapter}>
111
+ <ComposerPrimitive.Unstable_TriggerPopoverRoot>
113
112
  <ComposerPrimitive.Root>
114
- <ComposerPrimitive.Input placeholder="Type @ to mention..." />
115
- <ComposerPrimitive.Unstable_MentionPopover />
116
- </ComposerPrimitive.Root>
117
- </ComposerPrimitive.Unstable_MentionRoot>
118
- ```
119
-
120
- **Slash commands** (`/` trigger) — execute an action and clear the command text:
113
+ <ComposerPrimitive.Input placeholder="Type @ to mention, / for commands..." />
121
114
 
122
- ```tsx
123
- <ComposerPrimitive.Unstable_SlashCommandRoot adapter={slashAdapter}>
124
- <ComposerPrimitive.Root>
125
- <ComposerPrimitive.Input placeholder="Type / for commands..." />
126
- <ComposerPrimitive.Unstable_TriggerPopoverPopover>
115
+ {/* @ mention — inserts directive text into the message */}
116
+ <ComposerPrimitive.Unstable_TriggerPopover
117
+ char="@"
118
+ adapter={mentionAdapter}
119
+ >
120
+ <ComposerPrimitive.Unstable_TriggerPopover.Directive formatter={formatter} />
121
+ {/* popover UI */}
122
+ </ComposerPrimitive.Unstable_TriggerPopover>
123
+
124
+ {/* / slash command — runs a handler on selection; leaves an audit-trail chip by default */}
125
+ <ComposerPrimitive.Unstable_TriggerPopover
126
+ char="/"
127
+ adapter={slashAdapter}
128
+ >
129
+ <ComposerPrimitive.Unstable_TriggerPopover.Action
130
+ formatter={formatter}
131
+ onExecute={(item) => commandHandlers[item.id]?.()}
132
+ />
127
133
  <ComposerPrimitive.Unstable_TriggerPopoverItems>
128
134
  {(items) => items.map(item => (
129
135
  <ComposerPrimitive.Unstable_TriggerPopoverItem key={item.id} item={item}>
@@ -131,9 +137,9 @@ Composer includes an unstable **trigger popover** system for character-triggered
131
137
  </ComposerPrimitive.Unstable_TriggerPopoverItem>
132
138
  ))}
133
139
  </ComposerPrimitive.Unstable_TriggerPopoverItems>
134
- </ComposerPrimitive.Unstable_TriggerPopoverPopover>
140
+ </ComposerPrimitive.Unstable_TriggerPopover>
135
141
  </ComposerPrimitive.Root>
136
- </ComposerPrimitive.Unstable_SlashCommandRoot>
142
+ </ComposerPrimitive.Unstable_TriggerPopoverRoot>
137
143
  ```
138
144
 
139
145
  See the [Mentions guide](/docs/guides/mentions) and [Slash Commands guide](/docs/guides/slash-commands) for full documentation.
@@ -313,103 +319,130 @@ Clears the active quote from the composer. Renders a `<button>` element unless `
313
319
  </ComposerPrimitive.QuoteDismiss>
314
320
  ```
315
321
 
316
- ### Unstable_MentionRoot
322
+ ### Unstable_TriggerPopoverRoot
317
323
 
318
- Provider that manages mention state and `@` trigger detection.
324
+ Root provider that groups one or more `TriggerPopover` declarations and owns the shared input plugin registry.
319
325
 
320
326
  ```tsx
321
- <ComposerPrimitive.Unstable_MentionRoot trigger="@" adapter={mentionAdapter}>
327
+ <ComposerPrimitive.Unstable_TriggerPopoverRoot>
322
328
  <ComposerPrimitive.Root>
323
- <LexicalComposerInput placeholder="Type @ to mention a tool..." />
324
- <ComposerPrimitive.Unstable_MentionPopover />
329
+ <LexicalComposerInput placeholder="Type @ to mention, / for commands..." />
330
+ <ComposerPrimitive.Unstable_TriggerPopover char="@" adapter={mentionAdapter}>
331
+ <ComposerPrimitive.Unstable_TriggerPopover.Directive formatter={formatter} />
332
+ ...
333
+ </ComposerPrimitive.Unstable_TriggerPopover>
325
334
  </ComposerPrimitive.Root>
326
- </ComposerPrimitive.Unstable_MentionRoot>
335
+ </ComposerPrimitive.Unstable_TriggerPopoverRoot>
327
336
  ```
328
337
 
329
- <PrimitivesTypeTable type="ComposerPrimitiveMentionRootProps" parameters={ComposerPrimitiveDocs.Unstable_MentionRoot.props} />
338
+ ### Unstable_TriggerPopover
330
339
 
331
- ### Unstable_MentionPopover
332
-
333
- Container for the mention picker popover. It only renders while a trigger match is active.
340
+ Declares a trigger (by `char`, `adapter`) and renders the popover container. Selection behavior is declared by rendering exactly one behavior sub-primitive inside — either `<Unstable_TriggerPopover.Directive>` (insert a directive on selection) or `<Unstable_TriggerPopover.Action>` (run `onExecute` on selection). Only renders its DOM (and children) while the trigger is active in the composer input.
334
341
 
335
342
  ```tsx
336
- <ComposerPrimitive.Unstable_MentionPopover className="rounded-lg border bg-popover p-1 shadow-md">
337
- <ComposerPrimitive.Unstable_MentionCategories>
343
+ <ComposerPrimitive.Unstable_TriggerPopover
344
+ char="@"
345
+ adapter={mentionAdapter}
346
+ className="rounded-lg border bg-popover p-1 shadow-md"
347
+ >
348
+ <ComposerPrimitive.Unstable_TriggerPopover.Directive formatter={formatter} />
349
+ <ComposerPrimitive.Unstable_TriggerPopoverCategories>
338
350
  {(categories) => categories.map((category) => (
339
- <ComposerPrimitive.Unstable_MentionCategoryItem
351
+ <ComposerPrimitive.Unstable_TriggerPopoverCategoryItem
340
352
  key={category.id}
341
353
  categoryId={category.id}
342
354
  >
343
355
  {category.label}
344
- </ComposerPrimitive.Unstable_MentionCategoryItem>
356
+ </ComposerPrimitive.Unstable_TriggerPopoverCategoryItem>
345
357
  ))}
346
- </ComposerPrimitive.Unstable_MentionCategories>
347
- </ComposerPrimitive.Unstable_MentionPopover>
358
+ </ComposerPrimitive.Unstable_TriggerPopoverCategories>
359
+ </ComposerPrimitive.Unstable_TriggerPopover>
360
+ ```
361
+
362
+ Behavior is supplied by exactly one of two sub-primitives:
363
+
364
+ - `<Unstable_TriggerPopover.Directive formatter={...} onInserted={...} />` — writes `:type[label]{name=id}` into the composer text (mention behavior)
365
+ - `<Unstable_TriggerPopover.Action onExecute={...} removeOnExecute={...} />` — runs a callback on selection; leaves a directive chip behind by default (slash-command behavior)
366
+
367
+ ### Unstable_TriggerPopover.Directive
368
+
369
+ Behavior sub-primitive. Registers the directive-insert behavior with its parent `TriggerPopover`. Renders nothing.
370
+
371
+ ```tsx
372
+ <ComposerPrimitive.Unstable_TriggerPopover.Directive
373
+ formatter={unstable_defaultDirectiveFormatter}
374
+ onInserted={(item) => track("mention", item.id)}
375
+ />
376
+ ```
377
+
378
+ ### Unstable_TriggerPopover.Action
379
+
380
+ Behavior sub-primitive. Registers the action behavior with its parent `TriggerPopover`. Renders nothing. By default leaves a directive chip behind after executing (audit trail); pass `removeOnExecute` to strip the trigger text entirely.
381
+
382
+ ```tsx
383
+ <ComposerPrimitive.Unstable_TriggerPopover.Action
384
+ onExecute={(item) => commandHandlers[item.id]?.()}
385
+ removeOnExecute={false}
386
+ />
348
387
  ```
349
388
 
350
- ### Unstable_MentionCategories
389
+ ### Unstable_TriggerPopoverCategories
351
390
 
352
- Render-function primitive for the top-level mention categories.
391
+ Render-function primitive for the top-level category list. Only renders while no category is active and search mode is off.
353
392
 
354
393
  ```tsx
355
- <ComposerPrimitive.Unstable_MentionCategories>
394
+ <ComposerPrimitive.Unstable_TriggerPopoverCategories>
356
395
  {(categories) => categories.map((category) => (
357
- <ComposerPrimitive.Unstable_MentionCategoryItem
396
+ <ComposerPrimitive.Unstable_TriggerPopoverCategoryItem
358
397
  key={category.id}
359
398
  categoryId={category.id}
360
399
  >
361
400
  {category.label}
362
- </ComposerPrimitive.Unstable_MentionCategoryItem>
401
+ </ComposerPrimitive.Unstable_TriggerPopoverCategoryItem>
363
402
  ))}
364
- </ComposerPrimitive.Unstable_MentionCategories>
403
+ </ComposerPrimitive.Unstable_TriggerPopoverCategories>
365
404
  ```
366
405
 
367
- <PrimitivesTypeTable type="ComposerPrimitiveMentionCategoriesProps" parameters={ComposerPrimitiveDocs.Unstable_MentionCategories.props} />
406
+ ### Unstable_TriggerPopoverCategoryItem
368
407
 
369
- ### Unstable_MentionCategoryItem
370
-
371
- Button that selects a mention category and drills into its items.
408
+ Button that selects a category and drills into its items.
372
409
 
373
410
  ```tsx
374
- <ComposerPrimitive.Unstable_MentionCategoryItem categoryId="tools">
411
+ <ComposerPrimitive.Unstable_TriggerPopoverCategoryItem categoryId="tools">
375
412
  Tools
376
- </ComposerPrimitive.Unstable_MentionCategoryItem>
413
+ </ComposerPrimitive.Unstable_TriggerPopoverCategoryItem>
377
414
  ```
378
415
 
379
- ### Unstable_MentionItems
416
+ ### Unstable_TriggerPopoverItems
380
417
 
381
- Render-function primitive for the items inside the currently selected category.
418
+ Render-function primitive for the items inside the currently selected category (or global search results).
382
419
 
383
420
  ```tsx
384
- <ComposerPrimitive.Unstable_MentionItems>
421
+ <ComposerPrimitive.Unstable_TriggerPopoverItems>
385
422
  {(items) => items.map((item) => (
386
- <ComposerPrimitive.Unstable_MentionItem key={item.id} item={item} />
423
+ <ComposerPrimitive.Unstable_TriggerPopoverItem key={item.id} item={item} />
387
424
  ))}
388
- </ComposerPrimitive.Unstable_MentionItems>
425
+ </ComposerPrimitive.Unstable_TriggerPopoverItems>
389
426
  ```
390
427
 
391
- <PrimitivesTypeTable type="ComposerPrimitiveMentionItemsProps" parameters={ComposerPrimitiveDocs.Unstable_MentionItems.props} />
392
-
393
- ### Unstable_MentionItem
428
+ ### Unstable_TriggerPopoverItem
394
429
 
395
- Selectable mention item inside the popover.
430
+ Selectable item inside the popover.
396
431
 
397
432
  ```tsx
398
- <ComposerPrimitive.Unstable_MentionItem item={item}>
433
+ <ComposerPrimitive.Unstable_TriggerPopoverItem item={item}>
399
434
  {item.label}
400
- </ComposerPrimitive.Unstable_MentionItem>
435
+ </ComposerPrimitive.Unstable_TriggerPopoverItem>
401
436
  ```
402
437
 
403
- <PrimitivesTypeTable type="ComposerPrimitiveMentionItemProps" parameters={ComposerPrimitiveDocs.Unstable_MentionItem.props} />
404
-
405
- ### Unstable_MentionBack
438
+ ### Unstable_TriggerPopoverBack
406
439
 
407
440
  Back button used when drilling from categories into a specific item list.
408
441
 
409
442
  ```tsx
410
- <ComposerPrimitive.Unstable_MentionBack className="rounded-md px-2 py-1 text-sm hover:bg-accent">
443
+ <ComposerPrimitive.Unstable_TriggerPopoverBack className="rounded-md px-2 py-1 text-sm hover:bg-accent">
411
444
  Back
412
- </ComposerPrimitive.Unstable_MentionBack>
445
+ </ComposerPrimitive.Unstable_TriggerPopoverBack>
413
446
  ```
414
447
 
415
448
  ## Patterns
@@ -473,7 +506,7 @@ The dropzone sets `data-dragging` when a file is being dragged over it, so you c
473
506
  `DictationTranscript` renders a `<span>` showing the interim speech-to-text transcript while the user is speaking.
474
507
 
475
508
  <Callout type="info">
476
- Voice input requires a `DictationAdapter` configured in your runtime. See [Speech & Dictation](/docs/guides/speech) for setup.
509
+ Voice input requires a `DictationAdapter` configured in your runtime. See [Dictation](/docs/guides/dictation) for setup.
477
510
  </Callout>
478
511
 
479
512
  ### Custom Submit Behavior
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Error
3
3
  description: Accessible error display for messages with automatic error text extraction.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { ErrorPrimitiveSample } from "@/components/docs/samples/error-primitive";
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Overview
3
3
  description: Unstyled, accessible building blocks for AI chat interfaces.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  Primitives are the foundation of assistant-ui. They are unstyled, accessible React components that handle all the wiring for AI chat, including state management, keyboard shortcuts, auto-scrolling, streaming, and tool calls, so you can focus entirely on your UI.
@@ -84,7 +85,7 @@ Additional primitive references:
84
85
  - [ThreadListItemPrimitive](/docs/api-reference/primitives/thread-list-item)
85
86
  - [ThreadListItemMorePrimitive](/docs/api-reference/primitives/thread-list-item-more)
86
87
  - [ActionBarMorePrimitive](/docs/api-reference/primitives/action-bar-more)
87
- - [AssistantIf (`AuiIf`)](/docs/api-reference/primitives/assistant-if)
88
+ - [AuiIf](/docs/api-reference/primitives/assistant-if)
88
89
 
89
90
  ## Common Mistakes
90
91
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Message
3
3
  description: Build custom message rendering with content parts, attachments, and hover state.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { MessagePrimitiveSample } from "@/components/docs/samples/message-primitive";
@@ -108,7 +109,7 @@ Runtime setup: primitives require runtime context. Wrap your UI in `AssistantRun
108
109
  ```
109
110
 
110
111
  <Callout type="info">
111
- For most new `MessagePrimitive.Parts` code, prefer the `children` render function. Grouped Chain of Thought is the current exception: it plugs into `MessagePrimitive.Parts` via `components.ChainOfThought`.
112
+ For most new code, prefer `MessagePrimitive.Parts` with a `children` render function. When you need adjacent grouping, use `MessagePrimitive.GroupedParts`.
112
113
  </Callout>
113
114
 
114
115
  ### Tool Resolution
@@ -145,7 +146,7 @@ Returning `null` still allows registered tool UIs and data renderer UIs to rende
145
146
 
146
147
  - `ToolGroup` wraps consecutive tool-call parts
147
148
  - `ReasoningGroup` wraps consecutive reasoning parts
148
- - `components.ChainOfThought` takes over all reasoning and tool-call rendering (mutually exclusive with `ToolGroup`, `ReasoningGroup`, `tools`, and `Reasoning`). Despite the deprecation of `components` in general, this is still the current way to wire grouped Chain of Thought.
149
+ - `components.ChainOfThought` takes over all reasoning and tool-call rendering (mutually exclusive with `ToolGroup`, `ReasoningGroup`, `tools`, and `Reasoning`). This legacy path is deprecated; use `MessagePrimitive.GroupedParts` for grouped Chain of Thought in new code.
149
150
  - `data.by_name` and `data.Fallback` let you route custom data part types
150
151
  - `Quote` renders quoted message references from metadata
151
152
  - `Empty` and `Unstable_Audio` are available for edge and experimental rendering paths
@@ -187,7 +188,7 @@ Returning `null` still allows registered tool UIs and data renderer UIs to rende
187
188
  />
188
189
  ```
189
190
 
190
- For new code, use the `children` render function instead.
191
+ For new code, use the `children` render function or `GroupedParts` instead.
191
192
 
192
193
  ### Hover State
193
194
 
@@ -247,6 +248,45 @@ Renders each content part with type-based component resolution.
247
248
 
248
249
  <PrimitivesTypeTable type="MessagePrimitivePartsProps" parameters={MessagePrimitiveDocs.Parts.props} />
249
250
 
251
+ ### GroupedParts
252
+
253
+ Groups adjacent message parts into a nested tree. Use `groupBy` to return group keys for parts that should be grouped, then switch on `part.type` in the render function. Group cases render `children`; leaf cases render their own UI.
254
+
255
+ ```tsx
256
+ <MessagePrimitive.GroupedParts
257
+ groupBy={(part) => {
258
+ if (part.type === "reasoning")
259
+ return ["group-chainOfThought", "group-reasoning"];
260
+ if (part.type === "tool-call")
261
+ return ["group-chainOfThought", "group-tool"];
262
+ return null;
263
+ }}
264
+ >
265
+ {({ part, children }) => {
266
+ switch (part.type) {
267
+ case "group-chainOfThought":
268
+ return <div>{children}</div>;
269
+ case "group-reasoning":
270
+ return <ReasoningRoot>{children}</ReasoningRoot>;
271
+ case "group-tool":
272
+ return <ToolGroupRoot>{children}</ToolGroupRoot>;
273
+ case "text":
274
+ return <MarkdownText />;
275
+ case "reasoning":
276
+ return <Reasoning {...part} />;
277
+ case "tool-call":
278
+ return part.toolUI ?? <ToolFallback {...part} />;
279
+ case "data":
280
+ return part.dataRendererUI;
281
+ default:
282
+ return null;
283
+ }
284
+ }}
285
+ </MessagePrimitive.GroupedParts>
286
+ ```
287
+
288
+ <PrimitivesTypeTable type="MessagePrimitiveGroupedPartsProps" parameters={MessagePrimitiveDocs.GroupedParts.props} />
289
+
250
290
  ### Content
251
291
 
252
292
  Legacy alias for `Parts`.
@@ -340,7 +380,7 @@ Renders quote metadata when the current message includes a quote. Place it above
340
380
 
341
381
  ### Unstable_PartsGrouped
342
382
 
343
- Groups consecutive parts by a custom grouping function *(unstable)*.
383
+ Groups parts by a custom grouping function *(unstable; use `GroupedParts` for adjacent grouping)*.
344
384
 
345
385
  ```tsx
346
386
  <MessagePrimitive.Unstable_PartsGrouped
@@ -453,9 +493,32 @@ import { ErrorPrimitive, MessagePrimitive } from "@assistant-ui/react";
453
493
 
454
494
  `ErrorPrimitive.Root` renders a `<div>` container with `role="alert"` and `ErrorPrimitive.Message` renders a `<span>` that displays the error text. `Root` always renders. Only `Message` conditionally returns `null` when there is no error. Wrap in `<MessagePrimitive.Error>` if you want the entire block to be conditional. See the [ErrorPrimitive API Reference](/docs/api-reference/primitives/error) for full details.
455
495
 
496
+ ### Render After Stream Completes
497
+
498
+ To render content only once the assistant message has finished streaming (a follow-up card, a feedback prompt, a generated component that should not flicker through partial states), gate it with [`AuiIf`](/docs/api-reference/primitives/assistant-if) on `s.message.status`:
499
+
500
+ ```tsx
501
+ import { MessagePrimitive, AuiIf } from "@assistant-ui/react";
502
+
503
+ <MessagePrimitive.Root>
504
+ <MessagePrimitive.Parts />
505
+
506
+ <AuiIf
507
+ condition={(s) =>
508
+ s.message.role === "assistant" &&
509
+ s.message.status?.type === "complete"
510
+ }
511
+ >
512
+ <FollowUpCard />
513
+ </AuiIf>
514
+ </MessagePrimitive.Root>;
515
+ ```
516
+
517
+ `s.message.status` is a discriminated union of `running | requires-action | complete | incomplete`, defined only on assistant messages. The `role === "assistant"` guard keeps the predicate type-safe. For tool-call-driven generative UI that defers rendering inside the part itself, see [Deferred Rendering](/docs/guides/tool-ui#deferred-rendering) in the Generative UI guide.
518
+
456
519
  ### Legacy and Unstable APIs
457
520
 
458
- - `MessagePrimitive.Unstable_PartsGrouped` and `MessagePrimitive.Unstable_PartsGroupedByParentId` are unstable APIs for custom grouping.
521
+ - `MessagePrimitive.Unstable_PartsGrouped` and `MessagePrimitive.Unstable_PartsGroupedByParentId` are unstable APIs for non-adjacent custom grouping.
459
522
  - `Unstable_PartsGroupedByParentId` is deprecated in favor of `Unstable_PartsGrouped`.
460
523
 
461
524
  ### Role-Based Styling
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: SelectionToolbar
3
3
  description: A floating toolbar that appears when text is selected within a message.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { SelectionToolbarPrimitiveSample } from "@/components/docs/samples/selection-toolbar-primitive";
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Suggestion
3
3
  description: Suggested prompts that users can click to quickly send or populate the composer.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { SuggestionPrimitiveSample } from "@/components/docs/samples/suggestion-primitive";
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: ThreadList
3
3
  description: Multi-thread management for listing, creating, switching, archiving, and deleting conversations.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { ThreadListPrimitiveSample } from "@/components/docs/samples/thread-list-primitive";
@@ -218,6 +219,44 @@ Renders a single thread at a specific index.
218
219
 
219
220
  <PrimitivesTypeTable type="ThreadListPrimitiveItemByIndexProps" parameters={ThreadListPrimitiveDocs.ItemByIndex.props} />
220
221
 
222
+ #### LoadMore
223
+
224
+ Button that appends the next page of threads. Renders a `<button>` element unless `asChild` is set, and is automatically disabled when the runtime is loading or when the adapter's last `list()` did not return a `nextCursor`. See [Threads concepts](/docs/runtimes/concepts/threads#paginating-the-thread-list) for the adapter contract.
225
+
226
+ ```tsx
227
+ <ThreadListPrimitive.LoadMore className="rounded-lg border px-3 py-2 text-sm">
228
+ Load more
229
+ </ThreadListPrimitive.LoadMore>
230
+ ```
231
+
232
+ For scroll-driven loading, wrap `aui.threads().loadMore()` in your own `IntersectionObserver` at the application layer; assistant-ui ships the explicit button to keep the primitive surface predictable.
233
+
234
+ ```tsx
235
+ import { useAui, useAuiState } from "@assistant-ui/react";
236
+ import { useEffect, useRef } from "react";
237
+
238
+ function LoadMoreSentinel() {
239
+ const aui = useAui();
240
+ const disabled = useAuiState(
241
+ (s) =>
242
+ !s.threads.hasMore || s.threads.isLoading || s.threads.isLoadingMore,
243
+ );
244
+ const ref = useRef<HTMLDivElement>(null);
245
+
246
+ useEffect(() => {
247
+ const el = ref.current;
248
+ if (!el || disabled) return;
249
+ const observer = new IntersectionObserver(([entry]) => {
250
+ if (entry?.isIntersecting) aui.threads().loadMore();
251
+ });
252
+ observer.observe(el);
253
+ return () => observer.disconnect();
254
+ }, [aui, disabled]);
255
+
256
+ return disabled ? null : <div ref={ref} className="h-9" />;
257
+ }
258
+ ```
259
+
221
260
  ### ThreadListItemPrimitive
222
261
 
223
262
  #### Root
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: Thread
3
3
  description: Build custom scrollable message containers with auto-scroll, empty states, and message rendering.
4
+ platforms: ["react"]
4
5
  ---
5
6
 
6
7
  import { ThreadPrimitiveSample } from "@/components/docs/samples/thread-primitive";
@@ -123,7 +124,18 @@ By default, new messages appear at the bottom and scroll down. With `turnAnchor=
123
124
  </ThreadPrimitive.Viewport>
124
125
  ```
125
126
 
126
- This is what the shadcn Thread component uses by default. For scroll anchoring to work correctly, `ViewportSlack` is needed on the last assistant message to provide enough min-height for the user message to anchor at the top. This is included automatically in the shadcn component.
127
+ When `turnAnchor="top"` is set, `MessagePrimitive.Root` automatically registers the latest assistant message as the top-anchor target and the preceding user message as the anchor — no additional component is required. The viewport itself manages a stable reserve element that provides the missing scroll range while the assistant response grows. This is the behavior used by the [Thread](/docs/ui/thread) component by default.
128
+
129
+ Use `topAnchorMessageClamp` to control how much of a long user message remains visible when `turnAnchor="top"`. Messages up to `tallerThan` stay fully visible. For messages taller than that, `visibleHeight` controls how much of the message's bottom edge remains visible above the assistant response:
130
+
131
+ ```tsx
132
+ <ThreadPrimitive.Viewport
133
+ turnAnchor="top"
134
+ topAnchorMessageClamp={{ tallerThan: "10em", visibleHeight: "6em" }}
135
+ >
136
+ {/* messages */}
137
+ </ThreadPrimitive.Viewport>
138
+ ```
127
139
 
128
140
  ### Viewport Scroll Options
129
141
 
@@ -274,18 +286,9 @@ Provides viewport context without rendering a scrollable element. Use this when
274
286
 
275
287
  ### ViewportSlack
276
288
 
277
- Adds min-height for scroll anchoring with `turnAnchor="top"`. It wraps its child element via `Slot` and does not render a DOM element of its own.
278
-
279
- ```tsx
280
- <MessagePrimitive.Root>
281
- <MessagePrimitive.Parts />
282
- <ThreadPrimitive.ViewportSlack>
283
- <div className="min-h-[40vh]" />
284
- </ThreadPrimitive.ViewportSlack>
285
- </MessagePrimitive.Root>
286
- ```
287
-
288
- Props: `fillClampThreshold` and `fillClampOffset` control how the slack height is calculated. `children` is required.
289
+ <Callout type="warn">
290
+ `ThreadPrimitive.ViewportSlack` has been removed from the public API. Top-anchor target registration is handled automatically by `MessagePrimitive.Root` when `turnAnchor="top"`. Remove `ViewportSlack` from your tree; if you customized `fillClampThreshold` or `fillClampOffset` on `ViewportSlack` or `MessagePrimitive.Root`, replace those props with `topAnchorMessageClamp` on `ThreadPrimitive.Viewport`.
291
+ </Callout>
289
292
 
290
293
  ### Messages
291
294
 
@@ -49,9 +49,7 @@ If you prefer to add assistant-ui to an existing Expo project, follow these step
49
49
 
50
50
  ### Install dependencies
51
51
 
52
- ```sh
53
- npx expo install @assistant-ui/react-native @assistant-ui/react-ai-sdk
54
- ```
52
+ <InstallCommand expo={["@assistant-ui/react-native", "@assistant-ui/react-ai-sdk"]} />
55
53
 
56
54
  </Step>
57
55
  <Step>
@@ -29,9 +29,7 @@ If you already have an assistant-ui web app, most of your code transfers directl
29
29
 
30
30
  ### Install the React Native package
31
31
 
32
- ```sh
33
- npx expo install @assistant-ui/react-native
34
- ```
32
+ <InstallCommand expo={["@assistant-ui/react-native"]} />
35
33
 
36
34
  </Step>
37
35
  <Step>