@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.
- package/.docs/organized/code-examples/store-example.md +628 -0
- package/.docs/organized/code-examples/with-ag-ui.md +792 -178
- package/.docs/organized/code-examples/with-ai-sdk-v5.md +762 -209
- package/.docs/organized/code-examples/with-assistant-transport.md +707 -254
- package/.docs/organized/code-examples/with-cloud.md +848 -202
- package/.docs/organized/code-examples/with-custom-thread-list.md +1855 -0
- package/.docs/organized/code-examples/with-external-store.md +788 -172
- package/.docs/organized/code-examples/with-ffmpeg.md +796 -196
- package/.docs/organized/code-examples/with-langgraph.md +864 -230
- package/.docs/organized/code-examples/with-parent-id-grouping.md +785 -255
- package/.docs/organized/code-examples/with-react-hook-form.md +804 -226
- package/.docs/organized/code-examples/with-tanstack.md +1574 -0
- package/.docs/raw/blog/2024-07-29-hello/index.mdx +2 -3
- package/.docs/raw/docs/api-reference/overview.mdx +6 -6
- package/.docs/raw/docs/api-reference/primitives/ActionBar.mdx +85 -4
- package/.docs/raw/docs/api-reference/primitives/AssistantIf.mdx +200 -0
- package/.docs/raw/docs/api-reference/primitives/Composer.mdx +0 -20
- package/.docs/raw/docs/api-reference/primitives/Message.mdx +0 -45
- package/.docs/raw/docs/api-reference/primitives/Thread.mdx +0 -50
- package/.docs/raw/docs/cli.mdx +396 -0
- package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +2 -3
- package/.docs/raw/docs/cloud/persistence/langgraph.mdx +2 -3
- package/.docs/raw/docs/devtools.mdx +2 -3
- package/.docs/raw/docs/getting-started.mdx +37 -1109
- package/.docs/raw/docs/guides/Attachments.mdx +3 -25
- package/.docs/raw/docs/guides/Branching.mdx +1 -1
- package/.docs/raw/docs/guides/Speech.mdx +1 -1
- package/.docs/raw/docs/guides/ToolUI.mdx +1 -1
- package/.docs/raw/docs/legacy/styled/AssistantModal.mdx +2 -3
- package/.docs/raw/docs/legacy/styled/Decomposition.mdx +6 -5
- package/.docs/raw/docs/legacy/styled/Markdown.mdx +2 -3
- package/.docs/raw/docs/legacy/styled/Thread.mdx +2 -3
- package/.docs/raw/docs/react-compatibility.mdx +2 -5
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +3 -4
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +3 -6
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +891 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +2 -3
- package/.docs/raw/docs/runtimes/custom/local.mdx +11 -41
- package/.docs/raw/docs/runtimes/data-stream.mdx +15 -11
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +4 -4
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +2 -3
- package/.docs/raw/docs/runtimes/langserve.mdx +2 -3
- package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +2 -3
- package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +2 -3
- package/.docs/raw/docs/ui/AssistantModal.mdx +3 -25
- package/.docs/raw/docs/ui/AssistantSidebar.mdx +2 -24
- package/.docs/raw/docs/ui/Attachment.mdx +3 -25
- package/.docs/raw/docs/ui/Markdown.mdx +2 -24
- package/.docs/raw/docs/ui/Mermaid.mdx +2 -24
- package/.docs/raw/docs/ui/Reasoning.mdx +2 -24
- package/.docs/raw/docs/ui/Scrollbar.mdx +4 -6
- package/.docs/raw/docs/ui/SyntaxHighlighting.mdx +3 -47
- package/.docs/raw/docs/ui/Thread.mdx +38 -53
- package/.docs/raw/docs/ui/ThreadList.mdx +4 -47
- package/.docs/raw/docs/ui/ToolFallback.mdx +2 -24
- package/package.json +15 -8
|
@@ -4,9 +4,9 @@ title: Thread
|
|
|
4
4
|
|
|
5
5
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
6
|
import { Callout } from "fumadocs-ui/components/callout";
|
|
7
|
-
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
|
8
7
|
import { ParametersTable } from "@/components/docs";
|
|
9
|
-
import {
|
|
8
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
9
|
+
import { ThreadSample } from "@/components/samples/thread-sample";
|
|
10
10
|
|
|
11
11
|
A complete chat interface that combines message rendering, auto-scrolling, composer input,
|
|
12
12
|
attachments, and conditional UI states. Fully customizable and composable.
|
|
@@ -19,7 +19,7 @@ attachments, and conditional UI states. Fully customizable and composable.
|
|
|
19
19
|
The Thread component is built with the following primitives:
|
|
20
20
|
|
|
21
21
|
```tsx
|
|
22
|
-
import { ThreadPrimitive } from "@assistant-ui/react";
|
|
22
|
+
import { ThreadPrimitive, AssistantIf } from "@assistant-ui/react";
|
|
23
23
|
|
|
24
24
|
<ThreadPrimitive.Root>
|
|
25
25
|
<ThreadPrimitive.Viewport>
|
|
@@ -27,14 +27,14 @@ import { ThreadPrimitive } from "@assistant-ui/react";
|
|
|
27
27
|
<ThreadPrimitive.Messages
|
|
28
28
|
components={{
|
|
29
29
|
EditComposer,
|
|
30
|
-
UserMessage,
|
|
30
|
+
UserMessage,
|
|
31
31
|
AssistantMessage,
|
|
32
32
|
}}
|
|
33
33
|
/>
|
|
34
34
|
<ThreadPrimitive.ScrollToBottom />
|
|
35
35
|
</ThreadPrimitive.Viewport>
|
|
36
36
|
<ThreadPrimitive.Suggestion />
|
|
37
|
-
<
|
|
37
|
+
<AssistantIf condition={...} />
|
|
38
38
|
</ThreadPrimitive.Root>
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -45,29 +45,7 @@ import { ThreadPrimitive } from "@assistant-ui/react";
|
|
|
45
45
|
|
|
46
46
|
### Add the component
|
|
47
47
|
|
|
48
|
-
<
|
|
49
|
-
<Tab>
|
|
50
|
-
|
|
51
|
-
```sh
|
|
52
|
-
npx assistant-ui@latest add thread
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
</Tab>
|
|
56
|
-
<Tab>
|
|
57
|
-
|
|
58
|
-
```sh
|
|
59
|
-
npx shadcn@latest add @assistant-ui/thread
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
</Tab>
|
|
63
|
-
<Tab>
|
|
64
|
-
|
|
65
|
-
```sh
|
|
66
|
-
npx shadcn@latest add "https://r.assistant-ui.com/thread"
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
</Tab>
|
|
70
|
-
</Tabs>
|
|
48
|
+
<InstallCommand shadcn={["thread"]} />
|
|
71
49
|
|
|
72
50
|
This adds a `/components/assistant-ui/thread.tsx` file to your project, which you can adjust as needed.
|
|
73
51
|
|
|
@@ -96,33 +74,33 @@ export default function Chat() {
|
|
|
96
74
|
### Welcome Screen
|
|
97
75
|
|
|
98
76
|
```tsx
|
|
99
|
-
<
|
|
77
|
+
<AssistantIf condition={({ thread }) => thread.isEmpty}>
|
|
100
78
|
<ThreadWelcome />
|
|
101
|
-
</
|
|
79
|
+
</AssistantIf>
|
|
102
80
|
```
|
|
103
81
|
|
|
104
82
|
### Viewport Spacer
|
|
105
83
|
|
|
106
84
|
```tsx
|
|
107
|
-
<
|
|
85
|
+
<AssistantIf condition={({ thread }) => !thread.isEmpty}>
|
|
108
86
|
<div className="min-h-8 grow" />
|
|
109
|
-
</
|
|
87
|
+
</AssistantIf>
|
|
110
88
|
```
|
|
111
89
|
|
|
112
90
|
### Conditional Send/Cancel Button
|
|
113
91
|
|
|
114
92
|
```tsx
|
|
115
|
-
<
|
|
93
|
+
<AssistantIf condition={({ thread }) => !thread.isRunning}>
|
|
116
94
|
<ComposerPrimitive.Send>
|
|
117
95
|
Send
|
|
118
96
|
</ComposerPrimitive.Send>
|
|
119
|
-
</
|
|
97
|
+
</AssistantIf>
|
|
120
98
|
|
|
121
|
-
<
|
|
99
|
+
<AssistantIf condition={({ thread }) => thread.isRunning}>
|
|
122
100
|
<ComposerPrimitive.Cancel>
|
|
123
101
|
Cancel
|
|
124
102
|
</ComposerPrimitive.Cancel>
|
|
125
|
-
</
|
|
103
|
+
</AssistantIf>
|
|
126
104
|
```
|
|
127
105
|
|
|
128
106
|
### Suggestions
|
|
@@ -381,33 +359,40 @@ Shows a suggestion to the user. When clicked, replaces the composer's value with
|
|
|
381
359
|
|
|
382
360
|
This primitive renders a `<button>` element unless `asChild` is set.
|
|
383
361
|
|
|
384
|
-
###
|
|
362
|
+
### AssistantIf
|
|
363
|
+
|
|
364
|
+
Conditionally renders children based on assistant state. This is a generic component that can access thread, message, composer, and other state.
|
|
385
365
|
|
|
386
|
-
|
|
366
|
+
```tsx
|
|
367
|
+
import { AssistantIf } from "@assistant-ui/react";
|
|
368
|
+
|
|
369
|
+
<AssistantIf condition={({ thread }) => thread.isEmpty}>
|
|
370
|
+
<WelcomeScreen />
|
|
371
|
+
</AssistantIf>
|
|
372
|
+
|
|
373
|
+
<AssistantIf condition={({ thread }) => thread.isRunning}>
|
|
374
|
+
<LoadingIndicator />
|
|
375
|
+
</AssistantIf>
|
|
376
|
+
|
|
377
|
+
<AssistantIf condition={({ message }) => message.role === "assistant"}>
|
|
378
|
+
<AssistantAvatar />
|
|
379
|
+
</AssistantIf>
|
|
380
|
+
```
|
|
387
381
|
|
|
388
382
|
<ParametersTable
|
|
389
|
-
type="
|
|
383
|
+
type="AssistantIfProps"
|
|
390
384
|
parameters={[
|
|
391
385
|
{
|
|
392
|
-
name: "
|
|
393
|
-
type: "
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
{
|
|
397
|
-
name: "running",
|
|
398
|
-
type: "boolean | undefined",
|
|
399
|
-
description: "Render children if the thread is running (assistant is responding).",
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
name: "disabled",
|
|
403
|
-
type: "boolean | undefined",
|
|
404
|
-
description: "Render children if the thread is disabled.",
|
|
386
|
+
name: "condition",
|
|
387
|
+
type: "(state: AssistantState) => boolean",
|
|
388
|
+
required: true,
|
|
389
|
+
description: "A function that receives the assistant state and returns whether to render children.",
|
|
405
390
|
},
|
|
406
391
|
]}
|
|
407
392
|
/>
|
|
408
393
|
|
|
409
394
|
<Callout type="info">
|
|
410
|
-
|
|
395
|
+
The condition function receives an `AssistantState` object with access to `thread`, `message`, `composer`, `part`, and `attachment` state depending on context.
|
|
411
396
|
</Callout>
|
|
412
397
|
|
|
413
398
|
|
|
@@ -5,7 +5,8 @@ title: ThreadList
|
|
|
5
5
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
6
|
import { Callout } from "fumadocs-ui/components/callout";
|
|
7
7
|
import { Tabs, Tab } from "fumadocs-ui/components/tabs";
|
|
8
|
-
import {
|
|
8
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
9
|
+
import { ThreadListSample } from "@/components/samples/threadlist-sample";
|
|
9
10
|
|
|
10
11
|
## Overview
|
|
11
12
|
|
|
@@ -28,55 +29,11 @@ Use `threadlist-sidebar` for a complete sidebar layout or `thread-list` for cust
|
|
|
28
29
|
|
|
29
30
|
#### ThreadListSidebar
|
|
30
31
|
|
|
31
|
-
<
|
|
32
|
-
<Tab>
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
npx assistant-ui@latest add threadlist-sidebar
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
</Tab>
|
|
39
|
-
<Tab>
|
|
40
|
-
|
|
41
|
-
```sh
|
|
42
|
-
npx shadcn@latest add @assistant-ui/threadlist-sidebar
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
</Tab>
|
|
46
|
-
<Tab>
|
|
47
|
-
|
|
48
|
-
```sh
|
|
49
|
-
npx shadcn@latest add "https://r.assistant-ui.com/threadlist-sidebar"
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
</Tab>
|
|
53
|
-
</Tabs>
|
|
32
|
+
<InstallCommand shadcn={["threadlist-sidebar"]} />
|
|
54
33
|
|
|
55
34
|
#### ThreadList
|
|
56
35
|
|
|
57
|
-
<
|
|
58
|
-
<Tab>
|
|
59
|
-
|
|
60
|
-
```sh
|
|
61
|
-
npx assistant-ui@latest add thread-list
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
</Tab>
|
|
65
|
-
<Tab>
|
|
66
|
-
|
|
67
|
-
```sh
|
|
68
|
-
npx shadcn@latest add @assistant-ui/thread-list
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
</Tab>
|
|
72
|
-
<Tab>
|
|
73
|
-
|
|
74
|
-
```sh
|
|
75
|
-
npx shadcn@latest add "https://r.assistant-ui.com/thread-list"
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
</Tab>
|
|
79
|
-
</Tabs>
|
|
36
|
+
<InstallCommand shadcn={["thread-list"]} />
|
|
80
37
|
|
|
81
38
|
</Step>
|
|
82
39
|
<Step>
|
|
@@ -3,7 +3,7 @@ title: ToolFallback
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
|
-
import {
|
|
6
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
@@ -16,29 +16,7 @@ The ToolFallback component displays a default ToolUI for tools that do not have
|
|
|
16
16
|
|
|
17
17
|
### Add `tool-fallback`
|
|
18
18
|
|
|
19
|
-
<
|
|
20
|
-
<Tab>
|
|
21
|
-
|
|
22
|
-
```sh
|
|
23
|
-
npx assistant-ui@latest add tool-fallback
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
</Tab>
|
|
27
|
-
<Tab>
|
|
28
|
-
|
|
29
|
-
```sh
|
|
30
|
-
npx shadcn@latest add @assistant-ui/tool-fallback
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
</Tab>
|
|
34
|
-
<Tab>
|
|
35
|
-
|
|
36
|
-
```sh
|
|
37
|
-
npx shadcn@latest add "https://r.assistant-ui.com/tool-fallback"
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
</Tab>
|
|
41
|
-
</Tabs>
|
|
19
|
+
<InstallCommand shadcn={["tool-fallback"]} />
|
|
42
20
|
|
|
43
21
|
This adds a `/components/assistant-ui/tool-fallback.tsx` file to your project, which you can adjust as needed.
|
|
44
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/mcp-docs-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "MCP server for assistant-ui documentation and examples",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
"assistant-ui-mcp": "./dist/stdio.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
12
|
-
"zod": "^4.1.
|
|
11
|
+
"@modelcontextprotocol/sdk": "^1.24.3",
|
|
12
|
+
"zod": "^4.1.13",
|
|
13
13
|
"gray-matter": "^4.0.3",
|
|
14
14
|
"cross-env": "^10.1.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/node": "^24.10.1",
|
|
18
18
|
"tsup": "^8.5.1",
|
|
19
|
-
"tsx": "^4.
|
|
19
|
+
"tsx": "^4.21.0",
|
|
20
20
|
"typescript": "^5.9.3",
|
|
21
|
-
"vitest": "^4.0.
|
|
21
|
+
"vitest": "^4.0.15"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
@@ -26,7 +26,15 @@
|
|
|
26
26
|
"README.md"
|
|
27
27
|
],
|
|
28
28
|
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
29
|
+
"access": "public",
|
|
30
|
+
"provenance": true
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/assistant-ui/assistant-ui/tree/main/packages/mcp-docs-server"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/assistant-ui/assistant-ui/issues"
|
|
30
38
|
},
|
|
31
39
|
"scripts": {
|
|
32
40
|
"clean": "tsx scripts/clean.mts",
|
|
@@ -36,7 +44,6 @@
|
|
|
36
44
|
"dev": "tsx src/stdio.ts",
|
|
37
45
|
"pretest": "pnpm build",
|
|
38
46
|
"test": "vitest run",
|
|
39
|
-
"test:watch": "vitest"
|
|
40
|
-
"lint": "eslint ."
|
|
47
|
+
"test:watch": "vitest"
|
|
41
48
|
}
|
|
42
49
|
}
|