@assistant-ui/mcp-docs-server 0.1.18 → 0.1.20

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 (148) hide show
  1. package/.docs/organized/code-examples/with-ag-ui.md +69 -1336
  2. package/.docs/organized/code-examples/with-ai-sdk-v6.md +429 -0
  3. package/.docs/organized/code-examples/with-assistant-transport.md +41 -1454
  4. package/.docs/organized/code-examples/with-cloud.md +73 -1442
  5. package/.docs/organized/code-examples/with-custom-thread-list.md +95 -1424
  6. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +674 -0
  7. package/.docs/organized/code-examples/with-external-store.md +68 -1334
  8. package/.docs/organized/code-examples/with-ffmpeg.md +73 -1341
  9. package/.docs/organized/code-examples/with-langgraph.md +52 -1545
  10. package/.docs/organized/code-examples/with-parent-id-grouping.md +58 -1364
  11. package/.docs/organized/code-examples/with-react-hook-form.md +73 -1726
  12. package/.docs/organized/code-examples/with-react-router.md +915 -0
  13. package/.docs/organized/code-examples/with-store.md +31 -31
  14. package/.docs/organized/code-examples/with-tanstack.md +78 -862
  15. package/.docs/raw/blog/2025-01-31-changelog/index.mdx +0 -2
  16. package/.docs/raw/docs/{architecture.mdx → (docs)/architecture.mdx} +3 -2
  17. package/.docs/raw/docs/{cli.mdx → (docs)/cli.mdx} +66 -18
  18. package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-readable.mdx +1 -0
  19. package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-tool-ui.mdx +2 -1
  20. package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-tool.mdx +2 -1
  21. package/.docs/raw/docs/{copilots → (docs)/copilots}/model-context.mdx +5 -4
  22. package/.docs/raw/docs/{copilots → (docs)/copilots}/motivation.mdx +4 -3
  23. package/.docs/raw/docs/{copilots → (docs)/copilots}/use-assistant-instructions.mdx +1 -0
  24. package/.docs/raw/docs/{devtools.mdx → (docs)/devtools.mdx} +4 -4
  25. package/.docs/raw/docs/{guides/Attachments.mdx → (docs)/guides/attachments.mdx} +6 -7
  26. package/.docs/raw/docs/{guides/Branching.mdx → (docs)/guides/branching.mdx} +2 -1
  27. package/.docs/raw/docs/{guides → (docs)/guides}/context-api.mdx +118 -117
  28. package/.docs/raw/docs/(docs)/guides/dictation.mdx +370 -0
  29. package/.docs/raw/docs/{guides/Editing.mdx → (docs)/guides/editing.mdx} +1 -0
  30. package/.docs/raw/docs/{guides/Latex.mdx → (docs)/guides/latex.mdx} +1 -2
  31. package/.docs/raw/docs/{guides/Speech.mdx → (docs)/guides/speech.mdx} +9 -10
  32. package/.docs/raw/docs/(docs)/guides/suggestions.mdx +296 -0
  33. package/.docs/raw/docs/{guides/ToolUI.mdx → (docs)/guides/tool-ui.mdx} +15 -14
  34. package/.docs/raw/docs/(docs)/guides/tools.mdx +564 -0
  35. package/.docs/raw/docs/(docs)/index.mdx +74 -0
  36. package/.docs/raw/docs/{getting-started.mdx → (docs)/installation.mdx} +18 -23
  37. package/.docs/raw/docs/(docs)/llm.mdx +209 -0
  38. package/.docs/raw/docs/{api-reference/context-providers/AssistantRuntimeProvider.mdx → (reference)/api-reference/context-providers/assistant-runtime-provider.mdx} +2 -1
  39. package/.docs/raw/docs/{api-reference/context-providers/TextMessagePartProvider.mdx → (reference)/api-reference/context-providers/text-message-part-provider.mdx} +2 -1
  40. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/react-data-stream.mdx +50 -3
  41. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/react-hook-form.mdx +2 -1
  42. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/vercel-ai-sdk.mdx +2 -2
  43. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/overview.mdx +10 -4
  44. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +327 -0
  45. package/.docs/raw/docs/{api-reference/primitives/ActionBar.mdx → (reference)/api-reference/primitives/action-bar.mdx} +7 -5
  46. package/.docs/raw/docs/{api-reference/primitives/AssistantIf.mdx → (reference)/api-reference/primitives/assistant-if.mdx} +51 -51
  47. package/.docs/raw/docs/{api-reference/primitives/AssistantModal.mdx → (reference)/api-reference/primitives/assistant-modal.mdx} +3 -1
  48. package/.docs/raw/docs/{api-reference/primitives/Attachment.mdx → (reference)/api-reference/primitives/attachment.mdx} +3 -2
  49. package/.docs/raw/docs/{api-reference/primitives/BranchPicker.mdx → (reference)/api-reference/primitives/branch-picker.mdx} +2 -1
  50. package/.docs/raw/docs/{api-reference/primitives/Composer.mdx → (reference)/api-reference/primitives/composer.mdx} +101 -2
  51. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/primitives/composition.mdx +1 -0
  52. package/.docs/raw/docs/{api-reference/primitives/Error.mdx → (reference)/api-reference/primitives/error.mdx} +2 -1
  53. package/.docs/raw/docs/{api-reference/primitives/MessagePart.mdx → (reference)/api-reference/primitives/message-part.mdx} +2 -2
  54. package/.docs/raw/docs/{api-reference/primitives/Message.mdx → (reference)/api-reference/primitives/message.mdx} +2 -1
  55. package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +153 -0
  56. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +221 -0
  57. package/.docs/raw/docs/{api-reference/primitives/ThreadListItem.mdx → (reference)/api-reference/primitives/thread-list-item.mdx} +2 -1
  58. package/.docs/raw/docs/{api-reference/primitives/ThreadList.mdx → (reference)/api-reference/primitives/thread-list.mdx} +2 -1
  59. package/.docs/raw/docs/{api-reference/primitives/Thread.mdx → (reference)/api-reference/primitives/thread.mdx} +30 -40
  60. package/.docs/raw/docs/{api-reference/runtimes/AssistantRuntime.mdx → (reference)/api-reference/runtimes/assistant-runtime.mdx} +2 -1
  61. package/.docs/raw/docs/{api-reference/runtimes/AttachmentRuntime.mdx → (reference)/api-reference/runtimes/attachment-runtime.mdx} +3 -2
  62. package/.docs/raw/docs/{api-reference/runtimes/ComposerRuntime.mdx → (reference)/api-reference/runtimes/composer-runtime.mdx} +2 -1
  63. package/.docs/raw/docs/{api-reference/runtimes/MessagePartRuntime.mdx → (reference)/api-reference/runtimes/message-part-runtime.mdx} +3 -2
  64. package/.docs/raw/docs/{api-reference/runtimes/MessageRuntime.mdx → (reference)/api-reference/runtimes/message-runtime.mdx} +3 -2
  65. package/.docs/raw/docs/{api-reference/runtimes/ThreadListItemRuntime.mdx → (reference)/api-reference/runtimes/thread-list-item-runtime.mdx} +2 -1
  66. package/.docs/raw/docs/{api-reference/runtimes/ThreadListRuntime.mdx → (reference)/api-reference/runtimes/thread-list-runtime.mdx} +2 -1
  67. package/.docs/raw/docs/{api-reference/runtimes/ThreadRuntime.mdx → (reference)/api-reference/runtimes/thread-runtime.mdx} +3 -5
  68. package/.docs/raw/docs/{legacy/styled/AssistantModal.mdx → (reference)/legacy/styled/assistant-modal.mdx} +2 -3
  69. package/.docs/raw/docs/{legacy/styled/Decomposition.mdx → (reference)/legacy/styled/decomposition.mdx} +6 -5
  70. package/.docs/raw/docs/{legacy/styled/Markdown.mdx → (reference)/legacy/styled/markdown.mdx} +2 -4
  71. package/.docs/raw/docs/{legacy/styled/Scrollbar.mdx → (reference)/legacy/styled/scrollbar.mdx} +2 -1
  72. package/.docs/raw/docs/{legacy/styled/ThreadWidth.mdx → (reference)/legacy/styled/thread-width.mdx} +1 -0
  73. package/.docs/raw/docs/{legacy/styled/Thread.mdx → (reference)/legacy/styled/thread.mdx} +2 -3
  74. package/.docs/raw/docs/{migrations → (reference)/migrations}/deprecation-policy.mdx +1 -0
  75. package/.docs/raw/docs/{migrations → (reference)/migrations}/react-langgraph-v0-7.mdx +1 -2
  76. package/.docs/raw/docs/{migrations → (reference)/migrations}/v0-11.mdx +1 -0
  77. package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +300 -0
  78. package/.docs/raw/docs/{react-compatibility.mdx → (reference)/react-compatibility.mdx} +2 -3
  79. package/.docs/raw/docs/cloud/authorization.mdx +1 -0
  80. package/.docs/raw/docs/cloud/overview.mdx +1 -0
  81. package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +2 -3
  82. package/.docs/raw/docs/cloud/persistence/langgraph.mdx +5 -7
  83. package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +9 -8
  84. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +2 -3
  85. package/.docs/raw/docs/runtimes/assistant-transport.mdx +10 -9
  86. package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +7 -8
  87. package/.docs/raw/docs/runtimes/custom/external-store.mdx +6 -8
  88. package/.docs/raw/docs/runtimes/custom/local.mdx +55 -42
  89. package/.docs/raw/docs/runtimes/data-stream.mdx +67 -6
  90. package/.docs/raw/docs/runtimes/helicone.mdx +1 -0
  91. package/.docs/raw/docs/runtimes/langgraph/index.mdx +3 -3
  92. package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +1 -0
  93. package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +1 -0
  94. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +1 -0
  95. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -0
  96. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +2 -1
  97. package/.docs/raw/docs/runtimes/langserve.mdx +2 -2
  98. package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +4 -5
  99. package/.docs/raw/docs/runtimes/mastra/overview.mdx +1 -0
  100. package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +3 -4
  101. package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +2 -4
  102. package/.docs/raw/docs/ui/accordion.mdx +261 -0
  103. package/.docs/raw/docs/ui/assistant-modal.mdx +163 -0
  104. package/.docs/raw/docs/ui/assistant-sidebar.mdx +90 -0
  105. package/.docs/raw/docs/ui/attachment.mdx +227 -0
  106. package/.docs/raw/docs/ui/badge.mdx +140 -0
  107. package/.docs/raw/docs/ui/file.mdx +153 -0
  108. package/.docs/raw/docs/ui/image.mdx +101 -0
  109. package/.docs/raw/docs/ui/{Markdown.mdx → markdown.mdx} +11 -6
  110. package/.docs/raw/docs/ui/{Mermaid.mdx → mermaid.mdx} +12 -5
  111. package/.docs/raw/docs/ui/model-selector.mdx +226 -0
  112. package/.docs/raw/docs/ui/{PartGrouping.mdx → part-grouping.mdx} +6 -8
  113. package/.docs/raw/docs/ui/reasoning.mdx +150 -0
  114. package/.docs/raw/docs/ui/{Scrollbar.mdx → scrollbar.mdx} +9 -1
  115. package/.docs/raw/docs/ui/select.mdx +247 -0
  116. package/.docs/raw/docs/ui/sources.mdx +89 -0
  117. package/.docs/raw/docs/ui/streamdown.mdx +348 -0
  118. package/.docs/raw/docs/ui/{SyntaxHighlighting.mdx → syntax-highlighting.mdx} +9 -5
  119. package/.docs/raw/docs/ui/tabs.mdx +261 -0
  120. package/.docs/raw/docs/ui/thread-list.mdx +275 -0
  121. package/.docs/raw/docs/ui/{Thread.mdx → thread.mdx} +61 -76
  122. package/.docs/raw/docs/ui/tool-fallback.mdx +112 -0
  123. package/.docs/raw/docs/ui/tool-group.mdx +214 -0
  124. package/README.md +3 -3
  125. package/dist/tools/docs.js +1 -1
  126. package/dist/tools/examples.js +1 -1
  127. package/dist/tools/examples.js.map +1 -1
  128. package/package.json +5 -5
  129. package/src/tools/docs.ts +1 -1
  130. package/src/tools/examples.ts +1 -1
  131. package/src/tools/tests/docs.test.ts +18 -16
  132. package/src/tools/tests/examples.test.ts +6 -6
  133. package/src/tools/tests/path-traversal.test.ts +3 -3
  134. package/src/utils/tests/security.test.ts +3 -3
  135. package/.docs/organized/code-examples/with-ai-sdk-v5.md +0 -1735
  136. package/.docs/raw/docs/about-assistantui.mdx +0 -53
  137. package/.docs/raw/docs/guides/Tools.mdx +0 -738
  138. package/.docs/raw/docs/index.mdx +0 -7
  139. package/.docs/raw/docs/mcp-docs-server.mdx +0 -322
  140. package/.docs/raw/docs/migrations/v0-12.mdx +0 -125
  141. package/.docs/raw/docs/ui/AssistantModal.mdx +0 -45
  142. package/.docs/raw/docs/ui/AssistantSidebar.mdx +0 -41
  143. package/.docs/raw/docs/ui/Attachment.mdx +0 -84
  144. package/.docs/raw/docs/ui/Reasoning.mdx +0 -152
  145. package/.docs/raw/docs/ui/ThreadList.mdx +0 -90
  146. package/.docs/raw/docs/ui/ToolFallback.mdx +0 -63
  147. package/.docs/raw/docs/ui/ToolGroup.mdx +0 -96
  148. /package/.docs/raw/docs/{copilots → (docs)/copilots}/assistant-frame.mdx +0 -0
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  title: ComposerPrimitive
3
+ description: Primitives for the text input, send button, and attachments.
3
4
  ---
4
5
 
5
6
  The user interface to add new messages or edit existing ones.
6
7
 
7
- import { Callout } from "fumadocs-ui/components/callout";
8
8
 
9
- import { ParametersTable, KeyboardTable } from "@/components/docs";
9
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
10
+ import { KeyboardTable } from "@/components/docs/tables/KeyboardTable";
10
11
  import { Code } from "@radix-ui/themes";
11
12
 
12
13
  <Callout>
@@ -37,6 +38,20 @@ const EditComposer = () => (
37
38
  <ComposerPrimitive.Cancel />
38
39
  </ComposerPrimitive.Root>
39
40
  );
41
+
42
+ // with voice input (dictation)
43
+ const ComposerWithDictation = () => (
44
+ <ComposerPrimitive.Root>
45
+ <ComposerPrimitive.Input />
46
+ <ComposerPrimitive.If dictation={false}>
47
+ <ComposerPrimitive.Dictate />
48
+ </ComposerPrimitive.If>
49
+ <ComposerPrimitive.If dictation>
50
+ <ComposerPrimitive.StopDictation />
51
+ </ComposerPrimitive.If>
52
+ <ComposerPrimitive.Send />
53
+ </ComposerPrimitive.Root>
54
+ );
40
55
  ```
41
56
 
42
57
  ## API Reference
@@ -213,3 +228,87 @@ This primitive renders a `<button>` element unless `asChild` is set.
213
228
  },
214
229
  ]}
215
230
  />
231
+
232
+ ### Dictate
233
+
234
+ Renders a button to start dictation to convert voice to text.
235
+
236
+ Requires a `DictationAdapter` to be configured in the runtime.
237
+
238
+ This primitive renders a `<button>` element unless `asChild` is set.
239
+
240
+ <ParametersTable
241
+ type="ComposerPrimitiveDictateProps"
242
+ parameters={[
243
+ {
244
+ name: "asChild",
245
+ },
246
+ ]}
247
+ />
248
+
249
+ ### StopDictation
250
+
251
+ Renders a button to stop the current dictation session.
252
+
253
+ Only rendered when dictation is active.
254
+
255
+ This primitive renders a `<button>` element unless `asChild` is set.
256
+
257
+ <ParametersTable
258
+ type="ComposerPrimitiveStopDictationProps"
259
+ parameters={[
260
+ {
261
+ name: "asChild",
262
+ },
263
+ ]}
264
+ />
265
+
266
+ ### DictationTranscript
267
+
268
+ Renders the current interim (partial) transcript while dictation is active.
269
+
270
+ <Callout type="info">
271
+ **Note:** By default, interim transcripts are displayed directly in the composer input (like native dictation).
272
+ This component is for **advanced customization** when you want to display the interim transcript separately (e.g., in a different style or location).
273
+ </Callout>
274
+
275
+ Only renders when there is an active interim transcript (returns `null` otherwise).
276
+
277
+ This primitive renders a `<span>` element.
278
+
279
+ ```tsx
280
+ {/* Optional: Display interim transcript separately with custom styling */}
281
+ <ComposerPrimitive.If dictation>
282
+ <div className="dictation-preview">
283
+ <ComposerPrimitive.DictationTranscript className="italic text-muted" />
284
+ </div>
285
+ </ComposerPrimitive.If>
286
+ ```
287
+
288
+ ### If
289
+
290
+ Renders children if a condition is met.
291
+
292
+ <ParametersTable
293
+ type="UseComposerIfProps"
294
+ parameters={[
295
+ {
296
+ name: "editing",
297
+ required: false,
298
+ type: "boolean | undefined",
299
+ description: "Render children if the message is being edited.",
300
+ },
301
+ {
302
+ name: "dictation",
303
+ required: false,
304
+ type: "boolean | undefined",
305
+ description: "Render children if dictation is active.",
306
+ },
307
+ ]}
308
+ />
309
+
310
+ ```tsx
311
+ <Composer.If editing>{/* rendered if message is being edited */}</Composer.If>
312
+
313
+ <Composer.If dictation>{/* rendered if dictation is active */}</Composer.If>
314
+ ```
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: Composition
3
+ description: How to compose primitives with custom components using asChild.
3
4
  ---
4
5
 
5
6
  import { Code } from "@radix-ui/themes";
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  title: ErrorPrimitive
3
+ description: Components for displaying error messages in the chat interface.
3
4
  ---
4
5
 
5
6
  A component for displaying error messages in the UI.
6
7
 
7
- import { ParametersTable } from "@/components/docs";
8
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
8
9
 
9
10
  ## Anatomy
10
11
 
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  title: MessagePartPrimitive
3
- description: A part of a message's content. Message parts may be text, image, tool call or UI elements.
3
+ description: Primitives for text, images, tool calls, and other message content.
4
4
  ---
5
5
 
6
- import { ParametersTable } from "@/components/docs";
6
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
7
7
  import {
8
8
  MessagePartRuntime,
9
9
  TextMessagePartState,
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  title: MessagePrimitive
3
+ description: Components for rendering message content, parts, and attachments.
3
4
  ---
4
5
 
5
6
  A single message in a conversation. Messages may consist of multiple parts.
6
7
 
7
- import { ParametersTable } from "@/components/docs";
8
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
8
9
 
9
10
  ## Anatomy
10
11
 
@@ -0,0 +1,153 @@
1
+ ---
2
+ title: SuggestionPrimitive
3
+ ---
4
+
5
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
6
+
7
+ Primitives for rendering individual suggestions. These primitives must be used within a suggestion context provided by `ThreadPrimitive.Suggestions`.
8
+
9
+ ## Quick Reference
10
+
11
+ ```tsx
12
+ import { SuggestionPrimitive } from "@assistant-ui/react";
13
+
14
+ <SuggestionPrimitive.Title />
15
+ <SuggestionPrimitive.Description />
16
+ <SuggestionPrimitive.Trigger />
17
+ ```
18
+
19
+ ## API Reference
20
+
21
+ ### `SuggestionPrimitive.Title`
22
+
23
+ Displays the suggestion's title.
24
+
25
+ ```tsx
26
+ import { SuggestionPrimitive } from "@assistant-ui/react";
27
+
28
+ const SuggestionCard = () => {
29
+ return (
30
+ <div>
31
+ <h3>
32
+ <SuggestionPrimitive.Title />
33
+ </h3>
34
+ </div>
35
+ );
36
+ };
37
+ ```
38
+
39
+ This primitive renders a `<span>` element.
40
+
41
+ ### `SuggestionPrimitive.Description`
42
+
43
+ Displays the suggestion's description/label. This is only shown when suggestions are configured using the object format with separate title and label.
44
+
45
+ ```tsx
46
+ import { SuggestionPrimitive } from "@assistant-ui/react";
47
+
48
+ const SuggestionCard = () => {
49
+ return (
50
+ <div>
51
+ <p className="text-muted-foreground">
52
+ <SuggestionPrimitive.Description />
53
+ </p>
54
+ </div>
55
+ );
56
+ };
57
+ ```
58
+
59
+ This primitive renders a `<span>` element.
60
+
61
+ ### `SuggestionPrimitive.Trigger`
62
+
63
+ A button that triggers the suggestion action when clicked. When clicked, it either sends the message immediately or populates the composer with the suggestion's prompt.
64
+
65
+ ```tsx
66
+ import { SuggestionPrimitive } from "@assistant-ui/react";
67
+
68
+ const SuggestionButton = () => {
69
+ return (
70
+ <SuggestionPrimitive.Trigger send asChild>
71
+ <button>
72
+ <SuggestionPrimitive.Title />
73
+ </button>
74
+ </SuggestionPrimitive.Trigger>
75
+ );
76
+ };
77
+ ```
78
+
79
+ <ParametersTable
80
+ type="SuggestionPrimitiveTriggerProps"
81
+ parameters={[
82
+ {
83
+ name: "send",
84
+ type: "boolean",
85
+ description:
86
+ "When true, automatically sends the message. When false, only populates the composer with the suggestion's prompt.",
87
+ },
88
+ {
89
+ name: "clearComposer",
90
+ type: "boolean",
91
+ default: "true",
92
+ description:
93
+ "When send is false, determines whether to clear the composer before adding the suggestion (true) or append to existing text (false).",
94
+ },
95
+ {
96
+ name: "asChild",
97
+ type: "boolean",
98
+ default: "false",
99
+ description: "Merge props with child element instead of rendering a wrapper button.",
100
+ },
101
+ {
102
+ name: "className",
103
+ type: "string",
104
+ description: "CSS class name.",
105
+ },
106
+ ]}
107
+ />
108
+
109
+ This primitive renders a `<button>` element unless `asChild` is set.
110
+
111
+ ## Usage Example
112
+
113
+ ```tsx
114
+ import {
115
+ ThreadPrimitive,
116
+ SuggestionPrimitive,
117
+ } from "@assistant-ui/react";
118
+
119
+ const ThreadWelcome = () => {
120
+ return (
121
+ <div>
122
+ <h1>How can I help you?</h1>
123
+ <div className="grid grid-cols-2 gap-2">
124
+ <ThreadPrimitive.Suggestions
125
+ components={{
126
+ Suggestion: SuggestionCard,
127
+ }}
128
+ />
129
+ </div>
130
+ </div>
131
+ );
132
+ };
133
+
134
+ const SuggestionCard = () => {
135
+ return (
136
+ <SuggestionPrimitive.Trigger send asChild>
137
+ <button className="flex flex-col gap-1 rounded-lg border p-3 hover:bg-muted">
138
+ <span className="font-medium">
139
+ <SuggestionPrimitive.Title />
140
+ </span>
141
+ <span className="text-muted-foreground text-sm">
142
+ <SuggestionPrimitive.Description />
143
+ </span>
144
+ </button>
145
+ </SuggestionPrimitive.Trigger>
146
+ );
147
+ };
148
+ ```
149
+
150
+ ## See Also
151
+
152
+ - [Suggestions Guide](/docs/guides/suggestions) - Configure and customize suggestions
153
+ - [ThreadPrimitive.Suggestions](/docs/reference/api-reference/primitives/thread#threadprimitive-suggestions) - Render all suggestions
@@ -0,0 +1,221 @@
1
+ ---
2
+ title: ThreadListItemMorePrimitive
3
+ description: Dropdown menu for additional thread actions like archive and delete.
4
+ ---
5
+
6
+ A dropdown menu for displaying additional actions on a thread list item. Built on top of [Radix UI Dropdown Menu](https://www.radix-ui.com/primitives/docs/components/dropdown-menu).
7
+
8
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
9
+
10
+ ## Anatomy
11
+
12
+ ```tsx
13
+ import {
14
+ ThreadListItemPrimitive,
15
+ ThreadListItemMorePrimitive
16
+ } from "@assistant-ui/react";
17
+
18
+ const ThreadListItemMore = () => (
19
+ <ThreadListItemMorePrimitive.Root>
20
+ <ThreadListItemMorePrimitive.Trigger>
21
+ More options
22
+ </ThreadListItemMorePrimitive.Trigger>
23
+ <ThreadListItemMorePrimitive.Content>
24
+ <ThreadListItemPrimitive.Archive asChild>
25
+ <ThreadListItemMorePrimitive.Item>
26
+ Archive
27
+ </ThreadListItemMorePrimitive.Item>
28
+ </ThreadListItemPrimitive.Archive>
29
+ <ThreadListItemMorePrimitive.Separator />
30
+ <ThreadListItemPrimitive.Delete asChild>
31
+ <ThreadListItemMorePrimitive.Item>
32
+ Delete
33
+ </ThreadListItemMorePrimitive.Item>
34
+ </ThreadListItemPrimitive.Delete>
35
+ </ThreadListItemMorePrimitive.Content>
36
+ </ThreadListItemMorePrimitive.Root>
37
+ );
38
+ ```
39
+
40
+ ## API Reference
41
+
42
+ ### Root
43
+
44
+ Contains all parts of the dropdown menu. Wraps Radix UI's `DropdownMenu.Root`.
45
+
46
+ <ParametersTable
47
+ type="ThreadListItemMorePrimitiveRootProps"
48
+ parameters={[
49
+ {
50
+ name: "open",
51
+ type: "boolean",
52
+ description: "The controlled open state of the dropdown menu.",
53
+ },
54
+ {
55
+ name: "defaultOpen",
56
+ type: "boolean",
57
+ description: "The open state of the dropdown menu when it is initially rendered.",
58
+ },
59
+ {
60
+ name: "onOpenChange",
61
+ type: "(open: boolean) => void",
62
+ description: "Event handler called when the open state changes.",
63
+ },
64
+ {
65
+ name: "modal",
66
+ type: "boolean",
67
+ default: "true",
68
+ description: "Whether the dropdown menu should be modal.",
69
+ },
70
+ ]}
71
+ />
72
+
73
+ ### Trigger
74
+
75
+ The button that toggles the dropdown menu. Wraps Radix UI's `DropdownMenu.Trigger`.
76
+
77
+ This primitive renders a `<button>` element unless `asChild` is set.
78
+
79
+ <ParametersTable
80
+ type="ThreadListItemMorePrimitiveTriggerProps"
81
+ parameters={[
82
+ {
83
+ name: "asChild",
84
+ },
85
+ ]}
86
+ />
87
+
88
+ ### Content
89
+
90
+ The container for the dropdown menu items. Wraps Radix UI's `DropdownMenu.Portal` and `DropdownMenu.Content`.
91
+
92
+ <ParametersTable
93
+ type="ThreadListItemMorePrimitiveContentProps"
94
+ parameters={[
95
+ {
96
+ name: "side",
97
+ type: '"top" | "right" | "bottom" | "left"',
98
+ default: '"bottom"',
99
+ description: "The preferred side of the trigger to render against.",
100
+ },
101
+ {
102
+ name: "sideOffset",
103
+ type: "number",
104
+ default: "4",
105
+ description: "The distance in pixels from the trigger.",
106
+ },
107
+ {
108
+ name: "align",
109
+ type: '"start" | "center" | "end"',
110
+ default: '"center"',
111
+ description: "The preferred alignment against the trigger.",
112
+ },
113
+ {
114
+ name: "alignOffset",
115
+ type: "number",
116
+ default: "0",
117
+ description: "An offset in pixels from the align option.",
118
+ },
119
+ {
120
+ name: "portalProps",
121
+ type: "PortalProps",
122
+ description: "Props to pass to the Portal component.",
123
+ },
124
+ ]}
125
+ />
126
+
127
+ ### Item
128
+
129
+ A menu item within the dropdown. Wraps Radix UI's `DropdownMenu.Item`.
130
+
131
+ This primitive renders a `<div>` element unless `asChild` is set.
132
+
133
+ <ParametersTable
134
+ type="ThreadListItemMorePrimitiveItemProps"
135
+ parameters={[
136
+ {
137
+ name: "asChild",
138
+ },
139
+ {
140
+ name: "disabled",
141
+ type: "boolean",
142
+ description: "Whether the item is disabled.",
143
+ },
144
+ {
145
+ name: "onSelect",
146
+ type: "(event: Event) => void",
147
+ description: "Event handler called when the user selects an item.",
148
+ },
149
+ ]}
150
+ />
151
+
152
+ ### Separator
153
+
154
+ A visual separator between menu items. Wraps Radix UI's `DropdownMenu.Separator`.
155
+
156
+ <ParametersTable
157
+ type="ThreadListItemMorePrimitiveSeparatorProps"
158
+ parameters={[
159
+ {
160
+ name: "asChild",
161
+ },
162
+ ]}
163
+ />
164
+
165
+ ## Examples
166
+
167
+ ### With Icons
168
+
169
+ ```tsx
170
+ import { ArchiveIcon, TrashIcon, MoreHorizontalIcon } from "lucide-react";
171
+
172
+ const ThreadListItemMore = () => (
173
+ <ThreadListItemMorePrimitive.Root>
174
+ <ThreadListItemMorePrimitive.Trigger asChild>
175
+ <button className="icon-button">
176
+ <MoreHorizontalIcon />
177
+ </button>
178
+ </ThreadListItemMorePrimitive.Trigger>
179
+ <ThreadListItemMorePrimitive.Content
180
+ side="bottom"
181
+ align="start"
182
+ className="dropdown-content"
183
+ >
184
+ <ThreadListItemPrimitive.Archive asChild>
185
+ <ThreadListItemMorePrimitive.Item className="dropdown-item">
186
+ <ArchiveIcon className="icon" />
187
+ Archive
188
+ </ThreadListItemMorePrimitive.Item>
189
+ </ThreadListItemPrimitive.Archive>
190
+ </ThreadListItemMorePrimitive.Content>
191
+ </ThreadListItemMorePrimitive.Root>
192
+ );
193
+ ```
194
+
195
+ ### Complete Thread List Item with More Menu
196
+
197
+ ```tsx
198
+ const ThreadListItem = () => (
199
+ <ThreadListItemPrimitive.Root className="thread-item">
200
+ <ThreadListItemPrimitive.Trigger className="thread-trigger">
201
+ <ThreadListItemPrimitive.Title fallback="New Chat" />
202
+ </ThreadListItemPrimitive.Trigger>
203
+
204
+ <ThreadListItemMorePrimitive.Root>
205
+ <ThreadListItemMorePrimitive.Trigger asChild>
206
+ <button className="more-button">
207
+ <MoreHorizontalIcon />
208
+ </button>
209
+ </ThreadListItemMorePrimitive.Trigger>
210
+ <ThreadListItemMorePrimitive.Content>
211
+ <ThreadListItemPrimitive.Archive asChild>
212
+ <ThreadListItemMorePrimitive.Item>
213
+ <ArchiveIcon />
214
+ Archive
215
+ </ThreadListItemMorePrimitive.Item>
216
+ </ThreadListItemPrimitive.Archive>
217
+ </ThreadListItemMorePrimitive.Content>
218
+ </ThreadListItemMorePrimitive.Root>
219
+ </ThreadListItemPrimitive.Root>
220
+ );
221
+ ```
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  title: ThreadListItemPrimitive
3
+ description: Individual thread item with title, archive, and delete controls.
3
4
  ---
4
5
 
5
6
  A single thread item within a thread list.
6
7
 
7
- import { ParametersTable } from "@/components/docs";
8
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
8
9
 
9
10
  ## Anatomy
10
11
 
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  title: ThreadListPrimitive
3
+ description: Display and manage multiple conversation threads with create and archive actions.
3
4
  ---
4
5
 
5
6
  Displays a list of conversation threads.
6
7
 
7
- import { ParametersTable } from "@/components/docs";
8
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
8
9
 
9
10
  ## Anatomy
10
11
 
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  title: ThreadPrimitive
3
+ description: Primitives for the message list, viewport, and welcome screen.
3
4
  ---
4
5
 
5
6
  A conversation between a user and an assistant.
6
7
 
7
- import { ParametersTable } from "@/components/docs";
8
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
8
9
 
9
10
  ## Anatomy
10
11
 
@@ -182,57 +183,46 @@ This primitive renders a `<button>` element unless `asChild` is set.
182
183
  ]}
183
184
  />
184
185
 
185
- ### `ThreadPrimitive.Suggestion`
186
+ ### `ThreadPrimitive.Suggestions`
186
187
 
187
- Shows a suggestion to the user. When the user clicks on the suggestion, the composer's value is set to the suggestion's prompt.
188
-
189
- This primitive renders a `<button>` element unless `asChild` is set.
188
+ Renders all configured suggestions from the Suggestions API. Each suggestion is rendered using the provided Suggestion component.
190
189
 
191
190
  ```tsx
192
- import { ThreadPrimitive } from "@assistant-ui/react";
191
+ import { ThreadPrimitive, SuggestionPrimitive } from "@assistant-ui/react";
193
192
 
194
- const Suggestion = () => {
193
+ const SuggestionsList = () => {
195
194
  return (
196
- <ThreadPrimitive.Suggestion
197
- prompt="I need help with product search"
198
- send
199
- />
195
+ <div className="grid grid-cols-2 gap-2">
196
+ <ThreadPrimitive.Suggestions
197
+ components={{
198
+ Suggestion: SuggestionItem,
199
+ }}
200
+ />
201
+ </div>
200
202
  );
201
203
  };
204
+
205
+ const SuggestionItem = () => (
206
+ <SuggestionPrimitive.Trigger send asChild>
207
+ <button className="p-3 border rounded">
208
+ <SuggestionPrimitive.Title />
209
+ <SuggestionPrimitive.Description />
210
+ </button>
211
+ </SuggestionPrimitive.Trigger>
212
+ );
202
213
  ```
203
214
 
204
215
  <ParametersTable
205
- type="ThreadPrimitiveSuggestionProps"
216
+ type="ThreadPrimitiveSuggestionsProps"
206
217
  parameters={[
207
218
  {
208
- name: "prompt",
209
- type: "string",
210
- description: "The suggestion's prompt.",
211
- },
212
- {
213
- name: "send",
214
- type: "boolean",
215
- description:
216
- "When true, automatically sends the message. When false, replaces or appends the composer text with the suggestion - depending on the value of `clearComposer`",
217
- },
218
- {
219
- name: "clearComposer",
220
- type: "boolean",
221
- default: "true",
222
- description:
223
- "Whether to clear the composer after sending. When send is set to false, determines if composer text is replaced with suggestion (true, default), or if the suggestion's prompt is appended to the composer text (false).",
224
- },
225
- {
226
- name: "autoSend",
227
- type: "boolean",
228
- deprecated: true,
229
- description: "Deprecated. Use 'send' instead.",
230
- },
231
- {
232
- name: "method",
233
- type: "'replace'",
234
- deprecated: true,
235
- description: "Deprecated. This parameter is no longer used.",
219
+ name: "components",
220
+ type: "{ Suggestion: ComponentType }",
221
+ description: "Custom component to render each suggestion.",
236
222
  },
237
223
  ]}
238
224
  />
225
+
226
+ <Callout type="info">
227
+ Configure suggestions using the `Suggestions()` API in your runtime provider. See the [Suggestions guide](/docs/guides/suggestions) for details.
228
+ </Callout>
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  title: AssistantRuntime
3
+ description: Root runtime for managing threads, tool UIs, and assistant state.
3
4
  ---
4
5
 
5
- import { ParametersTable } from "@/components/docs";
6
+ import { ParametersTable } from "@/components/docs/tables/ParametersTable";
6
7
  import { AssistantRuntime, AssistantToolUIsState } from "@/generated/typeDocs";
7
8
 
8
9
  The `AssistantRuntime` is the root runtime of the application.