@assistant-ui/mcp-docs-server 0.1.14 → 0.1.16

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 (57) hide show
  1. package/.docs/organized/code-examples/store-example.md +628 -0
  2. package/.docs/organized/code-examples/with-ag-ui.md +792 -178
  3. package/.docs/organized/code-examples/with-ai-sdk-v5.md +762 -209
  4. package/.docs/organized/code-examples/with-assistant-transport.md +707 -254
  5. package/.docs/organized/code-examples/with-cloud.md +848 -202
  6. package/.docs/organized/code-examples/with-custom-thread-list.md +1855 -0
  7. package/.docs/organized/code-examples/with-external-store.md +788 -172
  8. package/.docs/organized/code-examples/with-ffmpeg.md +796 -196
  9. package/.docs/organized/code-examples/with-langgraph.md +864 -230
  10. package/.docs/organized/code-examples/with-parent-id-grouping.md +785 -255
  11. package/.docs/organized/code-examples/with-react-hook-form.md +804 -226
  12. package/.docs/organized/code-examples/with-tanstack.md +1574 -0
  13. package/.docs/raw/blog/2024-07-29-hello/index.mdx +2 -3
  14. package/.docs/raw/docs/api-reference/overview.mdx +6 -6
  15. package/.docs/raw/docs/api-reference/primitives/ActionBar.mdx +85 -4
  16. package/.docs/raw/docs/api-reference/primitives/AssistantIf.mdx +200 -0
  17. package/.docs/raw/docs/api-reference/primitives/Composer.mdx +0 -20
  18. package/.docs/raw/docs/api-reference/primitives/Message.mdx +0 -45
  19. package/.docs/raw/docs/api-reference/primitives/Thread.mdx +0 -50
  20. package/.docs/raw/docs/cli.mdx +396 -0
  21. package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +2 -3
  22. package/.docs/raw/docs/cloud/persistence/langgraph.mdx +2 -3
  23. package/.docs/raw/docs/devtools.mdx +2 -3
  24. package/.docs/raw/docs/getting-started.mdx +37 -1109
  25. package/.docs/raw/docs/guides/Attachments.mdx +3 -25
  26. package/.docs/raw/docs/guides/Branching.mdx +1 -1
  27. package/.docs/raw/docs/guides/Speech.mdx +1 -1
  28. package/.docs/raw/docs/guides/ToolUI.mdx +1 -1
  29. package/.docs/raw/docs/legacy/styled/AssistantModal.mdx +2 -3
  30. package/.docs/raw/docs/legacy/styled/Decomposition.mdx +6 -5
  31. package/.docs/raw/docs/legacy/styled/Markdown.mdx +2 -3
  32. package/.docs/raw/docs/legacy/styled/Thread.mdx +2 -3
  33. package/.docs/raw/docs/react-compatibility.mdx +2 -5
  34. package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +3 -4
  35. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +3 -6
  36. package/.docs/raw/docs/runtimes/assistant-transport.mdx +891 -0
  37. package/.docs/raw/docs/runtimes/custom/external-store.mdx +2 -3
  38. package/.docs/raw/docs/runtimes/custom/local.mdx +11 -41
  39. package/.docs/raw/docs/runtimes/data-stream.mdx +15 -11
  40. package/.docs/raw/docs/runtimes/langgraph/index.mdx +4 -4
  41. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -1
  42. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +2 -3
  43. package/.docs/raw/docs/runtimes/langserve.mdx +2 -3
  44. package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +2 -3
  45. package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +2 -3
  46. package/.docs/raw/docs/ui/AssistantModal.mdx +3 -25
  47. package/.docs/raw/docs/ui/AssistantSidebar.mdx +2 -24
  48. package/.docs/raw/docs/ui/Attachment.mdx +3 -25
  49. package/.docs/raw/docs/ui/Markdown.mdx +2 -24
  50. package/.docs/raw/docs/ui/Mermaid.mdx +2 -24
  51. package/.docs/raw/docs/ui/Reasoning.mdx +2 -24
  52. package/.docs/raw/docs/ui/Scrollbar.mdx +4 -6
  53. package/.docs/raw/docs/ui/SyntaxHighlighting.mdx +3 -47
  54. package/.docs/raw/docs/ui/Thread.mdx +38 -53
  55. package/.docs/raw/docs/ui/ThreadList.mdx +4 -47
  56. package/.docs/raw/docs/ui/ToolFallback.mdx +2 -24
  57. package/package.json +15 -8
@@ -0,0 +1,396 @@
1
+ ---
2
+ title: CLI
3
+ description: Use the assistant-ui CLI to add components and dependencies to your project.
4
+ ---
5
+
6
+ Use the `assistant-ui` CLI to quickly set up new projects and add components to existing ones.
7
+
8
+ ## init
9
+
10
+ Use the `init` command to initialize configuration and dependencies for a new project.
11
+
12
+ The `init` command installs dependencies, adds components, and configures your project for assistant-ui.
13
+
14
+ ```bash
15
+ npx assistant-ui@latest init
16
+ ```
17
+
18
+ This will:
19
+ - Detect if you have an existing project with a `package.json`
20
+ - Use `shadcn add` to install the assistant-ui quick-start component
21
+ - Add the default assistant-ui components (thread, composer, etc.) to your project
22
+ - Configure TypeScript paths and imports
23
+
24
+ **When to use:**
25
+ - Adding assistant-ui to an **existing** Next.js project
26
+ - First-time setup in a project with `package.json`
27
+
28
+ **Options**
29
+
30
+ ```bash
31
+ Usage: assistant-ui init [options]
32
+
33
+ initialize assistant-ui in a new or existing project
34
+
35
+ Options:
36
+ -c, --cwd <cwd> the working directory. defaults to the current directory.
37
+ -h, --help display help for command
38
+ ```
39
+
40
+ ---
41
+
42
+ ## create
43
+
44
+ Use the `create` command to scaffold a new Next.js project with assistant-ui pre-configured.
45
+
46
+ ```bash
47
+ npx assistant-ui@latest create [project-directory]
48
+ ```
49
+
50
+ This command uses `create-next-app` with assistant-ui starter templates.
51
+
52
+ **Available Templates**
53
+
54
+ | Template | Description | Command |
55
+ |----------|-------------|---------|
56
+ | `default` | Basic setup with Vercel AI SDK | `npx assistant-ui create` |
57
+ | `cloud` | With Assistant Cloud for persistence | `npx assistant-ui create -t cloud` |
58
+ | `langgraph` | LangGraph integration | `npx assistant-ui create -t langgraph` |
59
+ | `mcp` | Model Context Protocol support | `npx assistant-ui create -t mcp` |
60
+
61
+ **Examples**
62
+
63
+ ```bash
64
+ # Create with default template
65
+ npx assistant-ui@latest create my-app
66
+
67
+ # Create with cloud template
68
+ npx assistant-ui@latest create my-app -t cloud
69
+
70
+ # Create with specific package manager
71
+ npx assistant-ui@latest create my-app --use-pnpm
72
+
73
+ # Skip package installation
74
+ npx assistant-ui@latest create my-app --skip-install
75
+ ```
76
+
77
+ **Options**
78
+
79
+ ```bash
80
+ Usage: assistant-ui create [project-directory] [options]
81
+
82
+ create a new project
83
+
84
+ Arguments:
85
+ project-directory name of the project directory
86
+
87
+ Options:
88
+ -t, --template <template> template to use (default, cloud, langgraph, mcp)
89
+ --use-npm explicitly use npm
90
+ --use-pnpm explicitly use pnpm
91
+ --use-yarn explicitly use yarn
92
+ --use-bun explicitly use bun
93
+ --skip-install skip installing packages
94
+ -h, --help display help for command
95
+ ```
96
+
97
+ ---
98
+
99
+ ## add
100
+
101
+ Use the `add` command to add individual components to your project.
102
+
103
+ ```bash
104
+ npx assistant-ui@latest add [component]
105
+ ```
106
+
107
+ The `add` command fetches components from the assistant-ui registry and adds them to your project. It automatically:
108
+ - Installs required dependencies
109
+ - Adds TypeScript types
110
+ - Configures imports
111
+
112
+ **Popular Components**
113
+
114
+ ```bash
115
+ # Add the basic thread component
116
+ npx assistant-ui add thread
117
+
118
+ # Add thread list for multi-conversation support
119
+ npx assistant-ui add thread-list
120
+
121
+ # Add assistant modal
122
+ npx assistant-ui add assistant-modal
123
+
124
+ # Add multiple components at once
125
+ npx assistant-ui add thread thread-list assistant-sidebar
126
+ ```
127
+
128
+ **Options**
129
+
130
+ ```bash
131
+ Usage: assistant-ui add [options] <components...>
132
+
133
+ add a component to your project
134
+
135
+ Arguments:
136
+ components the components to add
137
+
138
+ Options:
139
+ -y, --yes skip confirmation prompt. (default: true)
140
+ -o, --overwrite overwrite existing files. (default: false)
141
+ -c, --cwd <cwd> the working directory. defaults to the current directory.
142
+ -p, --path <path> the path to add the component to.
143
+ -h, --help display help for command
144
+ ```
145
+
146
+ ---
147
+
148
+ ## update
149
+
150
+ Use the `update` command to update all `@assistant-ui/*` packages to their latest versions.
151
+
152
+ ```bash
153
+ npx assistant-ui@latest update
154
+ ```
155
+
156
+ This command:
157
+ - Scans your `package.json` for assistant-ui packages
158
+ - Updates them to the latest versions using your package manager
159
+ - Preserves other dependencies
160
+
161
+ **Examples**
162
+
163
+ ```bash
164
+ # Update all assistant-ui packages
165
+ npx assistant-ui update
166
+
167
+ # Dry run to see what would be updated
168
+ npx assistant-ui update --dry
169
+ ```
170
+
171
+ **Options**
172
+
173
+ ```bash
174
+ Usage: assistant-ui update [options]
175
+
176
+ update all '@assistant-ui/*' packages to latest versions
177
+
178
+ Options:
179
+ --dry print the command instead of running it
180
+ -c, --cwd <cwd> the working directory. defaults to the current directory.
181
+ -h, --help display help for command
182
+ ```
183
+
184
+ ---
185
+
186
+ ## upgrade
187
+
188
+ Use the `upgrade` command to automatically migrate your codebase when there are breaking changes.
189
+
190
+ ```bash
191
+ npx assistant-ui@latest upgrade
192
+ ```
193
+
194
+ This command:
195
+ - Runs codemods to transform your code
196
+ - Updates import paths and API usage
197
+ - Detects required dependency changes
198
+ - Prompts to install new packages
199
+
200
+ **What it does:**
201
+ - Applies all available codemods sequentially
202
+ - Shows progress bar with file count
203
+ - Reports any transformation errors
204
+ - Automatically detects and offers to install new dependencies
205
+
206
+ **Example output:**
207
+
208
+ ```bash
209
+ Starting upgrade...
210
+ Found 24 files to process.
211
+ Progress |████████████████████| 100% | ETA: 0s || Running v0-11/content-part-to-message-part...
212
+ Checking for package dependencies...
213
+ ✅ Upgrade complete!
214
+ ```
215
+
216
+ **Options**
217
+
218
+ ```bash
219
+ Usage: assistant-ui upgrade [options]
220
+
221
+ upgrade and apply codemods for breaking changes
222
+
223
+ Options:
224
+ -d, --dry dry run (no changes are made to files)
225
+ -p, --print print transformed files to stdout
226
+ --verbose show more information about the transform process
227
+ -j, --jscodeshift <options> pass options directly to jscodeshift
228
+ -h, --help display help for command
229
+ ```
230
+
231
+ ---
232
+
233
+ ## codemod
234
+
235
+ Use the `codemod` command to run a specific codemod transformation.
236
+
237
+ ```bash
238
+ npx assistant-ui@latest codemod <codemod> <source>
239
+ ```
240
+
241
+ This is useful when you want to run a specific migration rather than all available upgrades.
242
+
243
+ **Examples**
244
+
245
+ ```bash
246
+ # Run specific codemod on a directory
247
+ npx assistant-ui codemod v0-11/content-part-to-message-part ./src
248
+
249
+ # Run with dry run to preview changes
250
+ npx assistant-ui codemod v0-11/content-part-to-message-part ./src --dry
251
+
252
+ # Print transformed output
253
+ npx assistant-ui codemod v0-11/content-part-to-message-part ./src --print
254
+ ```
255
+
256
+ **Options**
257
+
258
+ ```bash
259
+ Usage: assistant-ui codemod [options] <codemod> <source>
260
+
261
+ run a specific codemod transformation
262
+
263
+ Arguments:
264
+ codemod codemod to run
265
+ source path to source files or directory to transform
266
+
267
+ Options:
268
+ -d, --dry dry run (no changes are made to files)
269
+ -p, --print print transformed files to stdout
270
+ --verbose show more information about the transform process
271
+ -j, --jscodeshift <options> pass options directly to jscodeshift
272
+ -h, --help display help for command
273
+ ```
274
+
275
+ ---
276
+
277
+ ## Common Workflows
278
+
279
+ ### Starting a new project
280
+
281
+ ```bash
282
+ # Create a new project with the default template
283
+ npx assistant-ui@latest create my-chatbot
284
+
285
+ # Navigate into the directory
286
+ cd my-chatbot
287
+
288
+ # Start development
289
+ npm run dev
290
+ ```
291
+
292
+ ### Adding to existing project
293
+
294
+ ```bash
295
+ # Initialize assistant-ui
296
+ npx assistant-ui@latest init
297
+
298
+ # Add additional components
299
+ npx assistant-ui@latest add thread-list assistant-modal
300
+
301
+ # Start development
302
+ npm run dev
303
+ ```
304
+
305
+ ### Keeping up to date
306
+
307
+ ```bash
308
+ # Check for updates (dry run)
309
+ npx assistant-ui@latest update --dry
310
+
311
+ # Update all packages
312
+ npx assistant-ui@latest update
313
+
314
+ # Run upgrade codemods if needed
315
+ npx assistant-ui@latest upgrade
316
+ ```
317
+
318
+ ### Migrating versions
319
+
320
+ ```bash
321
+ # Run automated migration
322
+ npx assistant-ui@latest upgrade
323
+
324
+ # Or run specific codemod
325
+ npx assistant-ui@latest codemod v0-11/content-part-to-message-part ./src
326
+
327
+ # Update packages after migration
328
+ npx assistant-ui@latest update
329
+ ```
330
+
331
+ ---
332
+
333
+ ## Component Registry
334
+
335
+ The CLI pulls components from our public registry at [r.assistant-ui.com](https://r.assistant-ui.com).
336
+
337
+ Each component includes:
338
+ - Full TypeScript source code
339
+ - All required dependencies
340
+ - Tailwind CSS configuration
341
+ - Usage examples
342
+
343
+ Components are added directly to your project's source code, giving you full control to customize them.
344
+
345
+ ---
346
+
347
+ ## Troubleshooting
348
+
349
+ ### Command not found
350
+
351
+ If you get a "command not found" error, make sure you're using `npx`:
352
+
353
+ ```bash
354
+ npx assistant-ui@latest init
355
+ ```
356
+
357
+ ### Permission errors
358
+
359
+ On Linux/macOS, if you encounter permission errors:
360
+
361
+ ```bash
362
+ sudo npx assistant-ui@latest init
363
+ ```
364
+
365
+ Or fix npm permissions: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
366
+
367
+ ### Conflicting dependencies
368
+
369
+ If you see dependency conflicts:
370
+
371
+ ```bash
372
+ # Try with --force flag
373
+ npm install --force
374
+
375
+ # Or use legacy peer deps
376
+ npm install --legacy-peer-deps
377
+ ```
378
+
379
+ ### Component already exists
380
+
381
+ Use the `--overwrite` flag to replace existing components:
382
+
383
+ ```bash
384
+ npx assistant-ui@latest add thread --overwrite
385
+ ```
386
+
387
+ ---
388
+
389
+ ## Configuration
390
+
391
+ The CLI respects your project's configuration:
392
+
393
+ - **Package Manager**: Automatically detects npm, pnpm, yarn, or bun
394
+ - **TypeScript**: Works with your `tsconfig.json` paths
395
+ - **Tailwind**: Uses your `tailwind.config.js` settings
396
+ - **Import Aliases**: Respects `components.json` or `assistant-ui.json` configuration
@@ -4,6 +4,7 @@ title: Chat History for AI SDK
4
4
 
5
5
  import { Steps, Step } from 'fumadocs-ui/components/steps';
6
6
  import { Callout } from 'fumadocs-ui/components/callout';
7
+ import { InstallCommand } from "@/components/docs/install-command";
7
8
 
8
9
  ## Overview
9
10
 
@@ -52,9 +53,7 @@ ASSISTANT_API_KEY=your-api-key-here
52
53
 
53
54
  Install the required packages:
54
55
 
55
- ```bash
56
- npm install @assistant-ui/react @assistant-ui/react-ai-sdk
57
- ```
56
+ <InstallCommand npm={["@assistant-ui/react", "@assistant-ui/react-ai-sdk"]} />
58
57
 
59
58
  </Step>
60
59
 
@@ -5,6 +5,7 @@ title: Chat History for LangGraph Cloud
5
5
  import { Steps, Step } from "fumadocs-ui/components/steps";
6
6
  import { Callout } from "fumadocs-ui/components/callout";
7
7
  import { Tab, Tabs } from "fumadocs-ui/components/tabs";
8
+ import { InstallCommand } from "@/components/docs/install-command";
8
9
 
9
10
  ## Overview
10
11
 
@@ -54,9 +55,7 @@ ASSISTANT_API_KEY=your-api-key-here
54
55
 
55
56
  Install the required packages:
56
57
 
57
- ```bash
58
- npm install @assistant-ui/react @assistant-ui/react-langgraph
59
- ```
58
+ <InstallCommand npm={["@assistant-ui/react", "@assistant-ui/react-langgraph"]} />
60
59
 
61
60
  </Step>
62
61
 
@@ -3,6 +3,7 @@ title: DevTools
3
3
  ---
4
4
 
5
5
  import { Step, Steps } from "fumadocs-ui/components/steps";
6
+ import { InstallCommand } from "@/components/docs/install-command";
6
7
 
7
8
  Hey, the assistant-ui DevTools allows you to debug the assistant-ui state and context, and events without resorting to `console.log`. It's an easy way to see how data flows to the assistant-ui's runtime layer.
8
9
 
@@ -15,9 +16,7 @@ Hey, the assistant-ui DevTools allows you to debug the assistant-ui state and co
15
16
 
16
17
  ### Install the DevTools package
17
18
 
18
- ```bash
19
- npm install @assistant-ui/react-devtools
20
- ```
19
+ <InstallCommand npm={["@assistant-ui/react-devtools"]} />
21
20
 
22
21
  </Step>
23
22
  <Step>