@assistant-ui/mcp-docs-server 0.1.19 → 0.1.21

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 (108) hide show
  1. package/.docs/organized/code-examples/with-ag-ui.md +172 -1633
  2. package/.docs/organized/code-examples/with-ai-sdk-v6.md +42 -1640
  3. package/.docs/organized/code-examples/with-assistant-transport.md +40 -1743
  4. package/.docs/organized/code-examples/with-cloud.md +71 -1745
  5. package/.docs/organized/code-examples/with-custom-thread-list.md +87 -1723
  6. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +70 -1637
  7. package/.docs/organized/code-examples/with-external-store.md +67 -1624
  8. package/.docs/organized/code-examples/with-ffmpeg.md +71 -1629
  9. package/.docs/organized/code-examples/with-langgraph.md +95 -1893
  10. package/.docs/organized/code-examples/with-parent-id-grouping.md +57 -1654
  11. package/.docs/organized/code-examples/with-react-hook-form.md +220 -2163
  12. package/.docs/organized/code-examples/with-react-router.md +66 -1318
  13. package/.docs/organized/code-examples/with-store.md +31 -31
  14. package/.docs/organized/code-examples/with-tanstack.md +77 -861
  15. package/.docs/organized/code-examples/with-tap-runtime.md +812 -0
  16. package/.docs/raw/docs/(docs)/cli.mdx +66 -0
  17. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +0 -1
  18. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +0 -1
  19. package/.docs/raw/docs/(docs)/copilots/model-context.mdx +4 -4
  20. package/.docs/raw/docs/(docs)/copilots/motivation.mdx +3 -3
  21. package/.docs/raw/docs/(docs)/devtools.mdx +0 -1
  22. package/.docs/raw/docs/(docs)/guides/attachments.mdx +2 -3
  23. package/.docs/raw/docs/(docs)/guides/context-api.mdx +117 -117
  24. package/.docs/raw/docs/(docs)/guides/suggestions.mdx +296 -0
  25. package/.docs/raw/docs/(docs)/guides/tools.mdx +336 -513
  26. package/.docs/raw/docs/(docs)/index.mdx +33 -410
  27. package/.docs/raw/docs/(docs)/installation.mdx +450 -0
  28. package/.docs/raw/docs/(docs)/llm.mdx +209 -0
  29. package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +0 -1
  30. package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +0 -1
  31. package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +48 -3
  32. package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +0 -1
  33. package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +0 -1
  34. package/.docs/raw/docs/(reference)/api-reference/overview.mdx +9 -3
  35. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +20 -52
  36. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +16 -39
  37. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +49 -50
  38. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +3 -11
  39. package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +0 -3
  40. package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +0 -1
  41. package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +5 -16
  42. package/.docs/raw/docs/(reference)/api-reference/primitives/composition.mdx +0 -1
  43. package/.docs/raw/docs/(reference)/api-reference/primitives/error.mdx +0 -1
  44. package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +1 -2
  45. package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +0 -1
  46. package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +152 -0
  47. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +0 -1
  48. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +1 -2
  49. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +1 -2
  50. package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +28 -40
  51. package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +0 -1
  52. package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +1 -2
  53. package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +2 -3
  54. package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +1 -2
  55. package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +1 -2
  56. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +0 -1
  57. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +0 -1
  58. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +1 -2
  59. package/.docs/raw/docs/(reference)/legacy/styled/assistant-modal.mdx +0 -1
  60. package/.docs/raw/docs/(reference)/legacy/styled/decomposition.mdx +5 -5
  61. package/.docs/raw/docs/(reference)/legacy/styled/markdown.mdx +0 -1
  62. package/.docs/raw/docs/(reference)/legacy/styled/thread.mdx +0 -1
  63. package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +207 -33
  64. package/.docs/raw/docs/(reference)/react-compatibility.mdx +0 -1
  65. package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +0 -1
  66. package/.docs/raw/docs/cloud/persistence/langgraph.mdx +0 -1
  67. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +0 -1
  68. package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +118 -0
  69. package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +198 -0
  70. package/.docs/raw/docs/runtimes/assistant-transport.mdx +3 -3
  71. package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +5 -6
  72. package/.docs/raw/docs/runtimes/custom/external-store.mdx +9 -11
  73. package/.docs/raw/docs/runtimes/custom/local.mdx +43 -36
  74. package/.docs/raw/docs/runtimes/data-stream.mdx +35 -3
  75. package/.docs/raw/docs/runtimes/langgraph/index.mdx +1 -2
  76. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +0 -1
  77. package/.docs/raw/docs/runtimes/langserve.mdx +0 -1
  78. package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +0 -1
  79. package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +0 -1
  80. package/.docs/raw/docs/ui/accordion.mdx +259 -0
  81. package/.docs/raw/docs/ui/assistant-modal.mdx +1 -3
  82. package/.docs/raw/docs/ui/assistant-sidebar.mdx +1 -3
  83. package/.docs/raw/docs/ui/attachment.mdx +0 -2
  84. package/.docs/raw/docs/ui/badge.mdx +138 -0
  85. package/.docs/raw/docs/ui/diff-viewer.mdx +279 -0
  86. package/.docs/raw/docs/ui/file.mdx +152 -0
  87. package/.docs/raw/docs/ui/image.mdx +100 -0
  88. package/.docs/raw/docs/ui/markdown.mdx +0 -1
  89. package/.docs/raw/docs/ui/mermaid.mdx +0 -1
  90. package/.docs/raw/docs/ui/model-selector.mdx +224 -0
  91. package/.docs/raw/docs/ui/part-grouping.mdx +4 -5
  92. package/.docs/raw/docs/ui/reasoning.mdx +6 -5
  93. package/.docs/raw/docs/ui/scrollbar.mdx +26 -9
  94. package/.docs/raw/docs/ui/select.mdx +245 -0
  95. package/.docs/raw/docs/ui/sources.mdx +6 -5
  96. package/.docs/raw/docs/ui/streamdown.mdx +348 -0
  97. package/.docs/raw/docs/ui/syntax-highlighting.mdx +8 -63
  98. package/.docs/raw/docs/ui/tabs.mdx +259 -0
  99. package/.docs/raw/docs/ui/thread-list.mdx +98 -16
  100. package/.docs/raw/docs/ui/thread.mdx +57 -73
  101. package/.docs/raw/docs/ui/tool-fallback.mdx +0 -1
  102. package/.docs/raw/docs/ui/tool-group.mdx +1 -3
  103. package/README.md +3 -3
  104. package/package.json +4 -4
  105. package/src/tools/tests/examples.test.ts +1 -1
  106. package/.docs/raw/docs/(docs)/about-assistantui.mdx +0 -54
  107. package/.docs/raw/docs/(docs)/mcp-docs-server.mdx +0 -321
  108. package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +0 -219
@@ -0,0 +1,296 @@
1
+ ---
2
+ title: Suggestions
3
+ description: Display suggested prompts to help users get started with your assistant.
4
+ ---
5
+
6
+ Suggestions are pre-defined prompts that help users discover what your assistant can do. They appear in the welcome screen and provide a quick way to start conversations.
7
+
8
+ ## Overview
9
+
10
+ The Suggestions API allows you to configure a list of suggested prompts that are displayed when the thread is empty. Users can click on a suggestion to either populate the composer or immediately send the message.
11
+
12
+ ## Quick Start
13
+
14
+ Configure suggestions using the `Suggestions()` API in your runtime provider:
15
+
16
+ ```tsx
17
+ import { useAui, Tools, Suggestions } from "@assistant-ui/react";
18
+ import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
19
+
20
+ function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
21
+ const runtime = useChatRuntime();
22
+
23
+ const aui = useAui({
24
+ tools: Tools({ toolkit: myToolkit }),
25
+ suggestions: Suggestions([
26
+ "What can you help me with?",
27
+ "Tell me a joke",
28
+ "Explain quantum computing",
29
+ ]),
30
+ });
31
+
32
+ return (
33
+ <AssistantRuntimeProvider aui={aui} runtime={runtime}>
34
+ {children}
35
+ </AssistantRuntimeProvider>
36
+ );
37
+ }
38
+ ```
39
+
40
+ ## Suggestion Format
41
+
42
+ Suggestions can be provided as either strings or objects with title, label, and prompt:
43
+
44
+ ### Simple Strings
45
+
46
+ ```tsx
47
+ const aui = useAui({
48
+ suggestions: Suggestions([
49
+ "What's the weather today?",
50
+ "Help me write an email",
51
+ "Explain React hooks",
52
+ ]),
53
+ });
54
+ ```
55
+
56
+ ### Objects with Title and Description
57
+
58
+ For more detailed suggestions with separate display text and prompts:
59
+
60
+ ```tsx
61
+ const aui = useAui({
62
+ suggestions: Suggestions([
63
+ {
64
+ title: "Weather",
65
+ label: "in San Francisco",
66
+ prompt: "What's the weather in San Francisco?",
67
+ },
68
+ {
69
+ title: "React Hooks",
70
+ label: "useState and useEffect",
71
+ prompt: "Explain React hooks like useState and useEffect",
72
+ },
73
+ {
74
+ title: "Travel Tips",
75
+ label: "for Tokyo",
76
+ prompt: "Give me travel tips for visiting Tokyo",
77
+ },
78
+ ]),
79
+ });
80
+ ```
81
+
82
+ ## Displaying Suggestions
83
+
84
+ The default Thread component from the shadcn registry already includes suggestion rendering. The suggestions are displayed in the welcome screen when the thread is empty.
85
+
86
+ ### Customizing Suggestion Display
87
+
88
+ If you want to customize how suggestions are displayed, you can modify your Thread component:
89
+
90
+ ```tsx
91
+ import {
92
+ ThreadPrimitive,
93
+ SuggestionPrimitive,
94
+ AuiIf,
95
+ } from "@assistant-ui/react";
96
+
97
+ const ThreadWelcome = () => {
98
+ return (
99
+ <div className="flex flex-col items-center justify-center">
100
+ <h1>Welcome!</h1>
101
+ <p>How can I help you today?</p>
102
+
103
+ {/* Display suggestions */}
104
+ <div className="grid grid-cols-2 gap-2">
105
+ <ThreadPrimitive.Suggestions
106
+ components={{
107
+ Suggestion: SuggestionItem,
108
+ }}
109
+ />
110
+ </div>
111
+ </div>
112
+ );
113
+ };
114
+
115
+ const SuggestionItem = () => {
116
+ return (
117
+ <SuggestionPrimitive.Trigger send asChild>
118
+ <button className="rounded-lg border p-3 hover:bg-muted">
119
+ <div className="font-medium">
120
+ <SuggestionPrimitive.Title />
121
+ </div>
122
+ <div className="text-muted-foreground text-sm">
123
+ <SuggestionPrimitive.Description />
124
+ </div>
125
+ </button>
126
+ </SuggestionPrimitive.Trigger>
127
+ );
128
+ };
129
+ ```
130
+
131
+ ## Suggestion Primitives
132
+
133
+ ### ThreadPrimitive.Suggestions
134
+
135
+ Renders all suggestions from the suggestions scope.
136
+
137
+ ```tsx
138
+ <ThreadPrimitive.Suggestions
139
+ components={{
140
+ Suggestion: CustomSuggestionComponent,
141
+ }}
142
+ />
143
+ ```
144
+
145
+ ### SuggestionPrimitive.Title
146
+
147
+ Displays the suggestion's title (the first part when using object format, or the full text when using strings).
148
+
149
+ ```tsx
150
+ <SuggestionPrimitive.Title />
151
+ ```
152
+
153
+ ### SuggestionPrimitive.Description
154
+
155
+ Displays the suggestion's description/label (only shown when using object format).
156
+
157
+ ```tsx
158
+ <SuggestionPrimitive.Description />
159
+ ```
160
+
161
+ ### SuggestionPrimitive.Trigger
162
+
163
+ A button that triggers the suggestion action when clicked.
164
+
165
+ ```tsx
166
+ <SuggestionPrimitive.Trigger
167
+ send={true}
168
+ clearComposer={true}
169
+ asChild
170
+ >
171
+ <button>Click me</button>
172
+ </SuggestionPrimitive.Trigger>
173
+ ```
174
+
175
+ **Props:**
176
+
177
+ - `send` (boolean): When true, automatically sends the message. When false, only populates the composer.
178
+ - `clearComposer` (boolean, default: true): When `send` is false, determines if the composer is cleared before adding the suggestion (true) or if the suggestion is appended (false).
179
+ - `asChild` (boolean): Merge props with child element instead of rendering a button.
180
+
181
+ ## Dynamic Suggestions
182
+
183
+ You can dynamically change suggestions based on your application state:
184
+
185
+ ```tsx
186
+ import { useMemo } from "react";
187
+
188
+ function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
189
+ const runtime = useChatRuntime();
190
+ const user = useUser(); // Your user hook
191
+
192
+ const suggestions = useMemo(() => {
193
+ if (user.isPremium) {
194
+ return [
195
+ "Analyze my business data",
196
+ "Generate a detailed report",
197
+ "Create a custom workflow",
198
+ ];
199
+ }
200
+ return [
201
+ "What can you do?",
202
+ "Tell me a joke",
203
+ "Help me get started",
204
+ ];
205
+ }, [user.isPremium]);
206
+
207
+ const aui = useAui({
208
+ tools: Tools({ toolkit: myToolkit }),
209
+ suggestions: Suggestions(suggestions),
210
+ });
211
+
212
+ return (
213
+ <AssistantRuntimeProvider aui={aui} runtime={runtime}>
214
+ {children}
215
+ </AssistantRuntimeProvider>
216
+ );
217
+ }
218
+ ```
219
+
220
+ ## Context-Aware Suggestions
221
+
222
+ Suggestions can be tailored to different contexts or user intents:
223
+
224
+ ```tsx
225
+ const suggestions = [
226
+ {
227
+ title: "Code Review",
228
+ label: "Get feedback on your code",
229
+ prompt: "Can you review this code for me?",
230
+ },
231
+ {
232
+ title: "Debug Help",
233
+ label: "Find and fix issues",
234
+ prompt: "Help me debug this error",
235
+ },
236
+ {
237
+ title: "Best Practices",
238
+ label: "Learn recommended patterns",
239
+ prompt: "What are the best practices for this?",
240
+ },
241
+ ];
242
+ ```
243
+
244
+ ## Best Practices
245
+
246
+ 1. **Keep suggestions concise**: Use clear, actionable prompts that users can understand at a glance
247
+ 2. **Show capabilities**: Use suggestions to highlight your assistant's key features
248
+ 3. **Provide variety**: Offer suggestions across different use cases
249
+ 4. **Use the object format for complex suggestions**: When you need separate title/description, use the object format
250
+ 5. **Limit the number**: 3-6 suggestions work best to avoid overwhelming users
251
+ 6. **Make them actionable**: Each suggestion should lead to a meaningful interaction
252
+
253
+ ## Migration from Legacy API
254
+
255
+ If you're using the deprecated `ThreadPrimitive.Suggestion` component, migrate to the new API:
256
+
257
+ ### Before (Deprecated)
258
+
259
+ ```tsx
260
+ <ThreadPrimitive.Suggestion
261
+ prompt="What's the weather?"
262
+ send
263
+ />
264
+ ```
265
+
266
+ ### After (Recommended)
267
+
268
+ 1. Configure suggestions in your runtime provider:
269
+
270
+ ```tsx
271
+ const aui = useAui({
272
+ suggestions: Suggestions(["What's the weather?"]),
273
+ });
274
+ ```
275
+
276
+ 2. Display suggestions using the primitives:
277
+
278
+ ```tsx
279
+ <ThreadPrimitive.Suggestions
280
+ components={{
281
+ Suggestion: SuggestionItem,
282
+ }}
283
+ />
284
+ ```
285
+
286
+ The new API provides:
287
+ - **Centralized configuration**: Define suggestions once in your runtime provider
288
+ - **Better separation of concerns**: Configuration separate from presentation
289
+ - **Type safety**: Full TypeScript support
290
+ - **Consistency**: Follows the same pattern as the Tools API
291
+
292
+ ## Related
293
+
294
+ - [Thread Component](/docs/ui/thread) - Main chat interface
295
+ - [Tools Guide](/docs/guides/tools) - Configure assistant actions
296
+ - [Context API](/docs/guides/context-api) - Access assistant state