@assistant-ui/mcp-docs-server 0.1.4 → 0.1.5
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/local-ollama.md +10 -10
- package/.docs/organized/code-examples/search-agent-for-e-commerce.md +14 -14
- package/.docs/organized/code-examples/{with-vercel-ai-rsc.md → with-ai-sdk-v5.md} +224 -229
- package/.docs/organized/code-examples/with-ai-sdk.md +10 -10
- package/.docs/organized/code-examples/with-cloud.md +8 -8
- package/.docs/organized/code-examples/with-external-store.md +6 -6
- package/.docs/organized/code-examples/with-ffmpeg.md +15 -15
- package/.docs/organized/code-examples/with-langgraph.md +8 -8
- package/.docs/organized/code-examples/with-openai-assistants.md +9 -9
- package/.docs/organized/code-examples/with-parent-id-grouping.md +1374 -0
- package/.docs/organized/code-examples/with-react-hook-form.md +14 -14
- package/.docs/raw/docs/about-assistantui.mdx +9 -0
- package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +89 -32
- package/.docs/raw/docs/cloud/persistence/langgraph.mdx +187 -32
- package/.docs/raw/docs/guides/Latex.mdx +81 -0
- package/.docs/raw/docs/guides/ToolUI.mdx +0 -32
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat-v5.mdx +129 -0
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +1 -1
- package/.docs/raw/docs/ui/PartGrouping.mdx +540 -0
- package/.docs/raw/docs/ui/ToolGroup.mdx +96 -0
- package/package.json +7 -7
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ToolGroup
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
The ToolGroup component wraps consecutive tool-call message parts, enabling you to create custom presentations for grouped tool calls such as collapsible sections and custom styling.
|
|
10
|
+
|
|
11
|
+
### Use it in your application
|
|
12
|
+
|
|
13
|
+
Pass the `ToolGroup` component to the `MessagePrimitive.Parts` component
|
|
14
|
+
|
|
15
|
+
```tsx twoslash title="/components/assistant-ui/thread.tsx"
|
|
16
|
+
import { FC, PropsWithChildren } from "react";
|
|
17
|
+
import { MessagePrimitive } from "@assistant-ui/react";
|
|
18
|
+
|
|
19
|
+
const AssistantActionBar: FC = () => null;
|
|
20
|
+
const BranchPicker: FC<{ className?: string }> = () => null;
|
|
21
|
+
|
|
22
|
+
// ---cut---
|
|
23
|
+
const ToolGroup: FC<
|
|
24
|
+
PropsWithChildren<{ startIndex: number; endIndex: number }>
|
|
25
|
+
> = ({ startIndex, endIndex, children }) => {
|
|
26
|
+
const toolCount = endIndex - startIndex + 1;
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<details className="my-2">
|
|
30
|
+
<summary className="cursor-pointer font-medium">
|
|
31
|
+
{toolCount} tool {toolCount === 1 ? "call" : "calls"}
|
|
32
|
+
</summary>
|
|
33
|
+
<div className="space-y-2 pl-4">{children}</div>
|
|
34
|
+
</details>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const AssistantMessage: FC = () => {
|
|
39
|
+
return (
|
|
40
|
+
<MessagePrimitive.Root className="...">
|
|
41
|
+
<div className="...">
|
|
42
|
+
<MessagePrimitive.Parts components={{ ToolGroup }} />
|
|
43
|
+
</div>
|
|
44
|
+
<AssistantActionBar />
|
|
45
|
+
|
|
46
|
+
<BranchPicker className="..." />
|
|
47
|
+
</MessagePrimitive.Root>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Props
|
|
53
|
+
|
|
54
|
+
The ToolGroup component receives the following props:
|
|
55
|
+
|
|
56
|
+
- `startIndex`: The index of the first tool call in the group
|
|
57
|
+
- `endIndex`: The index of the last tool call in the group
|
|
58
|
+
- `children`: The rendered tool call components
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
### Collapsible Tool Group
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
const ToolGroup: FC<
|
|
66
|
+
PropsWithChildren<{ startIndex: number; endIndex: number }>
|
|
67
|
+
> = ({ startIndex, endIndex, children }) => {
|
|
68
|
+
const toolCount = endIndex - startIndex + 1;
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<details className="my-2">
|
|
72
|
+
<summary className="cursor-pointer font-medium">
|
|
73
|
+
{toolCount} tool {toolCount === 1 ? "call" : "calls"}
|
|
74
|
+
</summary>
|
|
75
|
+
<div className="space-y-2 pl-4">{children}</div>
|
|
76
|
+
</details>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Styled Tool Group with Header
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
const ToolGroup: FC<
|
|
85
|
+
PropsWithChildren<{ startIndex: number; endIndex: number }>
|
|
86
|
+
> = ({ startIndex, endIndex, children }) => {
|
|
87
|
+
return (
|
|
88
|
+
<div className="bg-muted/50 my-2 rounded-lg border p-4">
|
|
89
|
+
<div className="text-muted-foreground mb-2 text-sm">
|
|
90
|
+
Tool execution #{startIndex + 1}-{endIndex + 1}
|
|
91
|
+
</div>
|
|
92
|
+
<div className="space-y-2">{children}</div>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
```
|
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.5",
|
|
4
4
|
"description": "MCP server for assistant-ui documentation and examples",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
"assistant-ui-mcp": "./dist/stdio.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
12
|
-
"zod": "^
|
|
11
|
+
"@modelcontextprotocol/sdk": "^1.17.1",
|
|
12
|
+
"zod": "^4.0.14",
|
|
13
13
|
"gray-matter": "^4.0.3",
|
|
14
|
-
"cross-env": "^
|
|
14
|
+
"cross-env": "^10.0.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@types/node": "^24.0
|
|
17
|
+
"@types/node": "^24.1.0",
|
|
18
18
|
"tsup": "^8.5.0",
|
|
19
19
|
"tsx": "^4.20.3",
|
|
20
|
-
"typescript": "^5.
|
|
20
|
+
"typescript": "^5.9.2",
|
|
21
21
|
"vitest": "^3.2.4",
|
|
22
|
-
"eslint": "^9.
|
|
22
|
+
"eslint": "^9.32.0"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|