@assistant-ui/mcp-docs-server 0.1.17 → 0.1.19
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/with-ag-ui.md +518 -234
- package/.docs/organized/code-examples/{with-ai-sdk-v5.md → with-ai-sdk-v6.md} +476 -189
- package/.docs/organized/code-examples/with-assistant-transport.md +503 -301
- package/.docs/organized/code-examples/with-cloud.md +524 -226
- package/.docs/organized/code-examples/with-custom-thread-list.md +433 -146
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +2241 -0
- package/.docs/organized/code-examples/with-external-store.md +517 -231
- package/.docs/organized/code-examples/with-ffmpeg.md +500 -220
- package/.docs/organized/code-examples/with-langgraph.md +630 -319
- package/.docs/organized/code-examples/with-parent-id-grouping.md +517 -231
- package/.docs/organized/code-examples/with-react-hook-form.md +517 -233
- package/.docs/organized/code-examples/with-react-router.md +2167 -0
- package/.docs/organized/code-examples/{store-example.md → with-store.md} +18 -22
- package/.docs/organized/code-examples/with-tanstack.md +23 -41
- package/.docs/raw/blog/2025-01-31-changelog/index.mdx +0 -2
- package/.docs/raw/docs/{about-assistantui.mdx → (docs)/about-assistantui.mdx} +2 -1
- package/.docs/raw/docs/{architecture.mdx → (docs)/architecture.mdx} +3 -2
- package/.docs/raw/docs/{cli.mdx → (docs)/cli.mdx} +1 -19
- package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-readable.mdx +1 -0
- package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-tool-ui.mdx +2 -1
- package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-tool.mdx +2 -1
- package/.docs/raw/docs/{copilots → (docs)/copilots}/model-context.mdx +1 -0
- package/.docs/raw/docs/{copilots → (docs)/copilots}/motivation.mdx +1 -0
- package/.docs/raw/docs/{copilots → (docs)/copilots}/use-assistant-instructions.mdx +1 -0
- package/.docs/raw/docs/{devtools.mdx → (docs)/devtools.mdx} +4 -4
- package/.docs/raw/docs/{guides/Attachments.mdx → (docs)/guides/attachments.mdx} +4 -5
- package/.docs/raw/docs/{guides/Branching.mdx → (docs)/guides/branching.mdx} +2 -1
- package/.docs/raw/docs/{guides → (docs)/guides}/context-api.mdx +1 -0
- package/.docs/raw/docs/(docs)/guides/dictation.mdx +370 -0
- package/.docs/raw/docs/{guides/Editing.mdx → (docs)/guides/editing.mdx} +1 -0
- package/.docs/raw/docs/{guides/Latex.mdx → (docs)/guides/latex.mdx} +1 -2
- package/.docs/raw/docs/{guides/Speech.mdx → (docs)/guides/speech.mdx} +9 -10
- package/.docs/raw/docs/{guides/ToolUI.mdx → (docs)/guides/tool-ui.mdx} +15 -14
- package/.docs/raw/docs/{guides/Tools.mdx → (docs)/guides/tools.mdx} +10 -7
- package/.docs/raw/docs/{getting-started.mdx → (docs)/index.mdx} +17 -22
- package/.docs/raw/docs/{mcp-docs-server.mdx → (docs)/mcp-docs-server.mdx} +1 -2
- package/.docs/raw/docs/{api-reference/context-providers/AssistantRuntimeProvider.mdx → (reference)/api-reference/context-providers/assistant-runtime-provider.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/context-providers/TextMessagePartProvider.mdx → (reference)/api-reference/context-providers/text-message-part-provider.mdx} +2 -1
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/react-data-stream.mdx +2 -1
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/react-hook-form.mdx +2 -1
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/vercel-ai-sdk.mdx +2 -2
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/overview.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +327 -0
- package/.docs/raw/docs/{api-reference/primitives/ActionBar.mdx → (reference)/api-reference/primitives/action-bar.mdx} +3 -1
- package/.docs/raw/docs/{api-reference/primitives/AssistantIf.mdx → (reference)/api-reference/primitives/assistant-if.mdx} +2 -2
- package/.docs/raw/docs/{api-reference/primitives/AssistantModal.mdx → (reference)/api-reference/primitives/assistant-modal.mdx} +3 -1
- package/.docs/raw/docs/{api-reference/primitives/Attachment.mdx → (reference)/api-reference/primitives/attachment.mdx} +3 -2
- package/.docs/raw/docs/{api-reference/primitives/BranchPicker.mdx → (reference)/api-reference/primitives/branch-picker.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/primitives/Composer.mdx → (reference)/api-reference/primitives/composer.mdx} +101 -2
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/primitives/composition.mdx +1 -0
- package/.docs/raw/docs/{api-reference/primitives/Error.mdx → (reference)/api-reference/primitives/error.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/primitives/MessagePart.mdx → (reference)/api-reference/primitives/message-part.mdx} +2 -2
- package/.docs/raw/docs/{api-reference/primitives/Message.mdx → (reference)/api-reference/primitives/message.mdx} +2 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +221 -0
- package/.docs/raw/docs/{api-reference/primitives/ThreadListItem.mdx → (reference)/api-reference/primitives/thread-list-item.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/primitives/ThreadList.mdx → (reference)/api-reference/primitives/thread-list.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/primitives/Thread.mdx → (reference)/api-reference/primitives/thread.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/AssistantRuntime.mdx → (reference)/api-reference/runtimes/assistant-runtime.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/AttachmentRuntime.mdx → (reference)/api-reference/runtimes/attachment-runtime.mdx} +3 -2
- package/.docs/raw/docs/{api-reference/runtimes/ComposerRuntime.mdx → (reference)/api-reference/runtimes/composer-runtime.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/MessagePartRuntime.mdx → (reference)/api-reference/runtimes/message-part-runtime.mdx} +3 -2
- package/.docs/raw/docs/{api-reference/runtimes/MessageRuntime.mdx → (reference)/api-reference/runtimes/message-runtime.mdx} +3 -2
- package/.docs/raw/docs/{api-reference/runtimes/ThreadListItemRuntime.mdx → (reference)/api-reference/runtimes/thread-list-item-runtime.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/ThreadListRuntime.mdx → (reference)/api-reference/runtimes/thread-list-runtime.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/ThreadRuntime.mdx → (reference)/api-reference/runtimes/thread-runtime.mdx} +3 -5
- package/.docs/raw/docs/{legacy/styled/AssistantModal.mdx → (reference)/legacy/styled/assistant-modal.mdx} +2 -3
- package/.docs/raw/docs/{legacy/styled/Decomposition.mdx → (reference)/legacy/styled/decomposition.mdx} +1 -0
- package/.docs/raw/docs/{legacy/styled/Markdown.mdx → (reference)/legacy/styled/markdown.mdx} +2 -4
- package/.docs/raw/docs/{legacy/styled/Scrollbar.mdx → (reference)/legacy/styled/scrollbar.mdx} +2 -1
- package/.docs/raw/docs/{legacy/styled/ThreadWidth.mdx → (reference)/legacy/styled/thread-width.mdx} +1 -0
- package/.docs/raw/docs/{legacy/styled/Thread.mdx → (reference)/legacy/styled/thread.mdx} +2 -3
- package/.docs/raw/docs/{migrations → (reference)/migrations}/deprecation-policy.mdx +1 -0
- package/.docs/raw/docs/{migrations → (reference)/migrations}/react-langgraph-v0-7.mdx +1 -2
- package/.docs/raw/docs/{migrations → (reference)/migrations}/v0-11.mdx +1 -0
- package/.docs/raw/docs/{migrations → (reference)/migrations}/v0-12.mdx +1 -0
- package/.docs/raw/docs/{react-compatibility.mdx → (reference)/react-compatibility.mdx} +2 -3
- package/.docs/raw/docs/cloud/authorization.mdx +1 -0
- package/.docs/raw/docs/cloud/overview.mdx +1 -0
- package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +2 -3
- package/.docs/raw/docs/cloud/persistence/langgraph.mdx +5 -7
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +9 -8
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +2 -3
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +7 -6
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +38 -3
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +6 -8
- package/.docs/raw/docs/runtimes/custom/local.mdx +43 -16
- package/.docs/raw/docs/runtimes/data-stream.mdx +32 -4
- package/.docs/raw/docs/runtimes/helicone.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +3 -3
- package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +2 -1
- package/.docs/raw/docs/runtimes/langserve.mdx +2 -2
- package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +4 -5
- package/.docs/raw/docs/runtimes/mastra/overview.mdx +1 -0
- package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +3 -4
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +2 -4
- package/.docs/raw/docs/ui/assistant-modal.mdx +163 -0
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +90 -0
- package/.docs/raw/docs/ui/attachment.mdx +227 -0
- package/.docs/raw/docs/ui/{Markdown.mdx → markdown.mdx} +11 -6
- package/.docs/raw/docs/ui/{Mermaid.mdx → mermaid.mdx} +12 -5
- package/.docs/raw/docs/ui/{PartGrouping.mdx → part-grouping.mdx} +4 -6
- package/.docs/raw/docs/ui/reasoning.mdx +148 -0
- package/.docs/raw/docs/ui/{Scrollbar.mdx → scrollbar.mdx} +9 -7
- package/.docs/raw/docs/ui/sources.mdx +87 -0
- package/.docs/raw/docs/ui/{SyntaxHighlighting.mdx → syntax-highlighting.mdx} +9 -5
- package/.docs/raw/docs/ui/thread-list.mdx +275 -0
- package/.docs/raw/docs/ui/{Thread.mdx → thread.mdx} +5 -6
- package/.docs/raw/docs/ui/tool-fallback.mdx +112 -0
- package/.docs/raw/docs/ui/tool-group.mdx +214 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +14 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -0
- package/dist/prepare-docs/code-examples.d.ts +2 -0
- package/dist/prepare-docs/code-examples.d.ts.map +1 -0
- package/dist/prepare-docs/code-examples.js +129 -0
- package/dist/prepare-docs/code-examples.js.map +1 -0
- package/dist/prepare-docs/copy-raw.d.ts +2 -0
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -0
- package/dist/prepare-docs/copy-raw.js +50 -0
- package/dist/prepare-docs/copy-raw.js.map +1 -0
- package/dist/prepare-docs/prepare.d.ts +2 -0
- package/dist/prepare-docs/prepare.d.ts.map +1 -0
- package/dist/prepare-docs/prepare.js +18 -195
- package/dist/prepare-docs/prepare.js.map +1 -0
- package/dist/stdio.d.ts +3 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/stdio.js +4 -5
- package/dist/stdio.js.map +1 -0
- package/dist/tools/docs.d.ts +23 -0
- package/dist/tools/docs.d.ts.map +1 -0
- package/dist/tools/docs.js +168 -0
- package/dist/tools/docs.js.map +1 -0
- package/dist/tools/examples.d.ts +23 -0
- package/dist/tools/examples.d.ts.map +1 -0
- package/dist/tools/examples.js +95 -0
- package/dist/tools/examples.js.map +1 -0
- package/dist/tools/tests/test-setup.d.ts +4 -0
- package/dist/tools/tests/test-setup.d.ts.map +1 -0
- package/dist/tools/tests/test-setup.js +36 -0
- package/dist/tools/tests/test-setup.js.map +1 -0
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +20 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/mcp-format.d.ts +7 -0
- package/dist/utils/mcp-format.d.ts.map +1 -0
- package/dist/utils/mcp-format.js +11 -0
- package/dist/utils/mcp-format.js.map +1 -0
- package/dist/utils/mdx.d.ts +9 -0
- package/dist/utils/mdx.d.ts.map +1 -0
- package/dist/utils/mdx.js +27 -0
- package/dist/utils/mdx.js.map +1 -0
- package/dist/utils/paths.d.ts +8 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +84 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/security.d.ts +2 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +43 -0
- package/dist/utils/security.js.map +1 -0
- package/package.json +37 -19
- package/src/constants.ts +22 -0
- package/src/index.ts +51 -0
- package/src/prepare-docs/code-examples.ts +158 -0
- package/src/prepare-docs/copy-raw.ts +55 -0
- package/src/prepare-docs/prepare.ts +24 -0
- package/src/stdio.ts +7 -0
- package/src/tools/docs.ts +207 -0
- package/src/tools/examples.ts +107 -0
- package/src/tools/tests/docs.test.ts +124 -0
- package/src/tools/tests/examples.test.ts +94 -0
- package/src/tools/tests/integration.test.ts +46 -0
- package/src/tools/tests/json-parsing.test.ts +23 -0
- package/src/tools/tests/mcp-protocol.test.ts +133 -0
- package/src/tools/tests/path-traversal.test.ts +81 -0
- package/src/tools/tests/test-setup.ts +40 -0
- package/src/utils/logger.ts +20 -0
- package/src/utils/mcp-format.ts +12 -0
- package/src/utils/mdx.ts +39 -0
- package/src/utils/paths.ts +114 -0
- package/src/utils/security.ts +52 -0
- package/src/utils/tests/security.test.ts +119 -0
- package/.docs/raw/docs/index.mdx +0 -7
- package/.docs/raw/docs/ui/AssistantModal.mdx +0 -45
- package/.docs/raw/docs/ui/AssistantSidebar.mdx +0 -41
- package/.docs/raw/docs/ui/Attachment.mdx +0 -84
- package/.docs/raw/docs/ui/Reasoning.mdx +0 -152
- package/.docs/raw/docs/ui/ThreadList.mdx +0 -90
- package/.docs/raw/docs/ui/ToolFallback.mdx +0 -63
- package/.docs/raw/docs/ui/ToolGroup.mdx +0 -96
- package/dist/chunk-M2RKUM66.js +0 -38
- package/dist/chunk-NVNFQ5ZO.js +0 -423
- /package/.docs/raw/docs/{copilots → (docs)/copilots}/assistant-frame.mdx +0 -0
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: ThreadList
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
|
-
import { Callout } from "fumadocs-ui/components/callout";
|
|
7
|
-
import { Tabs, Tab } from "fumadocs-ui/components/tabs";
|
|
8
|
-
import { InstallCommand } from "@/components/docs/install-command";
|
|
9
|
-
import { ThreadListSample } from "@/components/samples/threadlist-sample";
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
|
|
13
|
-
The ThreadList component lets the user switch between threads.
|
|
14
|
-
|
|
15
|
-
<ThreadListSample />
|
|
16
|
-
|
|
17
|
-
<Callout>
|
|
18
|
-
This demo uses **ThreadListSidebar**, which includes `thread-list` as a dependency and provides a complete sidebar layout. For custom implementations, you can use `thread-list` directly.
|
|
19
|
-
</Callout>
|
|
20
|
-
|
|
21
|
-
## Getting Started
|
|
22
|
-
|
|
23
|
-
<Steps>
|
|
24
|
-
<Step>
|
|
25
|
-
|
|
26
|
-
### Add the component
|
|
27
|
-
|
|
28
|
-
Use `threadlist-sidebar` for a complete sidebar layout or `thread-list` for custom layouts.
|
|
29
|
-
|
|
30
|
-
#### ThreadListSidebar
|
|
31
|
-
|
|
32
|
-
<InstallCommand shadcn={["threadlist-sidebar"]} />
|
|
33
|
-
|
|
34
|
-
#### ThreadList
|
|
35
|
-
|
|
36
|
-
<InstallCommand shadcn={["thread-list"]} />
|
|
37
|
-
|
|
38
|
-
</Step>
|
|
39
|
-
<Step>
|
|
40
|
-
|
|
41
|
-
### Use in your application
|
|
42
|
-
|
|
43
|
-
<Tabs items={["With Sidebar", "Without Sidebar"]}>
|
|
44
|
-
<Tab value="With Sidebar">
|
|
45
|
-
```tsx title="/app/assistant.tsx"
|
|
46
|
-
import { Thread } from "@/components/assistant-ui/thread";
|
|
47
|
-
import { ThreadListSidebar } from "@/components/assistant-ui/threadlist-sidebar";
|
|
48
|
-
import {
|
|
49
|
-
SidebarProvider,
|
|
50
|
-
SidebarInset,
|
|
51
|
-
SidebarTrigger
|
|
52
|
-
} from "@/components/ui/sidebar";
|
|
53
|
-
|
|
54
|
-
export default function Assistant() {
|
|
55
|
-
return (
|
|
56
|
-
<SidebarProvider>
|
|
57
|
-
<div className="flex h-dvh w-full">
|
|
58
|
-
<ThreadListSidebar />
|
|
59
|
-
<SidebarInset>
|
|
60
|
-
{/* Add sidebar trigger, location can be customized */}
|
|
61
|
-
<SidebarTrigger className="absolute top-4 left-4" />
|
|
62
|
-
<Thread />
|
|
63
|
-
</SidebarInset>
|
|
64
|
-
</div>
|
|
65
|
-
</SidebarProvider>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
</Tab>
|
|
70
|
-
<Tab value="Without Sidebar">
|
|
71
|
-
```tsx title="/app/assistant.tsx"
|
|
72
|
-
import { Thread } from "@/components/assistant-ui/thread";
|
|
73
|
-
import { ThreadList } from "@/components/assistant-ui/thread-list";
|
|
74
|
-
|
|
75
|
-
export default function Assistant() {
|
|
76
|
-
return (
|
|
77
|
-
<div className="grid h-full grid-cols-[200px_1fr]">
|
|
78
|
-
<ThreadList />
|
|
79
|
-
<Thread />
|
|
80
|
-
</div>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
</Tab>
|
|
85
|
-
</Tabs>
|
|
86
|
-
|
|
87
|
-
</Step>
|
|
88
|
-
</Steps>
|
|
89
|
-
|
|
90
|
-
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: ToolFallback
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
|
-
import { InstallCommand } from "@/components/docs/install-command";
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
The ToolFallback component displays a default ToolUI for tools that do not have a dedicated ToolUI.
|
|
11
|
-
|
|
12
|
-
## Getting Started
|
|
13
|
-
|
|
14
|
-
<Steps>
|
|
15
|
-
<Step>
|
|
16
|
-
|
|
17
|
-
### Add `tool-fallback`
|
|
18
|
-
|
|
19
|
-
<InstallCommand shadcn={["tool-fallback"]} />
|
|
20
|
-
|
|
21
|
-
This adds a `/components/assistant-ui/tool-fallback.tsx` file to your project, which you can adjust as needed.
|
|
22
|
-
|
|
23
|
-
</Step>
|
|
24
|
-
<Step>
|
|
25
|
-
|
|
26
|
-
### Use it in your application
|
|
27
|
-
|
|
28
|
-
Pass the `ToolFallback` component to the `MessagePrimitive.Parts` component
|
|
29
|
-
|
|
30
|
-
```tsx twoslash title="/components/assistant-ui/thread.tsx" {1,11}
|
|
31
|
-
// @filename: /components/assistant-ui/tool-fallback.tsx
|
|
32
|
-
import { FC } from "react";
|
|
33
|
-
export const ToolFallback: FC = () => null;
|
|
34
|
-
|
|
35
|
-
// @filename: ./thread.tsx
|
|
36
|
-
import { FC } from "react";
|
|
37
|
-
import { MessagePrimitive } from "@assistant-ui/react";
|
|
38
|
-
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
|
39
|
-
|
|
40
|
-
const AssistantActionBar: FC = () => null;
|
|
41
|
-
const BranchPicker: FC<{ className?: string }> = () => null;
|
|
42
|
-
|
|
43
|
-
// ---cut---
|
|
44
|
-
import { ToolFallback } from "@/components/assistant-ui/tool-fallback";
|
|
45
|
-
|
|
46
|
-
const AssistantMessage: FC = () => {
|
|
47
|
-
return (
|
|
48
|
-
<MessagePrimitive.Root className="...">
|
|
49
|
-
<div className="...">
|
|
50
|
-
<MessagePrimitive.Parts
|
|
51
|
-
components={{ tools: { Fallback: ToolFallback } }}
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
<AssistantActionBar />
|
|
55
|
-
|
|
56
|
-
<BranchPicker className="..." />
|
|
57
|
-
</MessagePrimitive.Root>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
</Step>
|
|
63
|
-
</Steps>
|
|
@@ -1,96 +0,0 @@
|
|
|
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/dist/chunk-M2RKUM66.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'url';
|
|
2
|
-
import { dirname, join } from 'path';
|
|
3
|
-
|
|
4
|
-
// src/constants.ts
|
|
5
|
-
var __dirname$1 = dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
var ROOT_DIR = join(__dirname$1, "../../../");
|
|
7
|
-
var PACKAGE_DIR = join(__dirname$1, "../");
|
|
8
|
-
var EXAMPLES_PATH = join(ROOT_DIR, "examples");
|
|
9
|
-
var DOCS_BASE = join(PACKAGE_DIR, ".docs");
|
|
10
|
-
var DOCS_PATH = join(DOCS_BASE, "raw/docs");
|
|
11
|
-
join(DOCS_BASE, "raw/blog");
|
|
12
|
-
var CODE_EXAMPLES_PATH = join(DOCS_BASE, "organized/code-examples");
|
|
13
|
-
var MDX_EXTENSION = ".mdx";
|
|
14
|
-
var MD_EXTENSION = ".md";
|
|
15
|
-
var MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
16
|
-
var IS_PREPARE_MODE = process.env.PREPARE === "true";
|
|
17
|
-
|
|
18
|
-
// src/utils/logger.ts
|
|
19
|
-
var logger = {
|
|
20
|
-
debug: (message, ...args) => {
|
|
21
|
-
if (process.env.DEBUG) {
|
|
22
|
-
console.debug(`[DEBUG] ${message}`, ...args);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
info: (message, ...args) => {
|
|
26
|
-
if (process.env.PREPARE === "true") {
|
|
27
|
-
console.log(`[INFO] ${message}`, ...args);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
error: (message, ...args) => {
|
|
31
|
-
console.error(`[ERROR] ${message}`, ...args);
|
|
32
|
-
},
|
|
33
|
-
warn: (message, ...args) => {
|
|
34
|
-
console.warn(`[WARN] ${message}`, ...args);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { CODE_EXAMPLES_PATH, DOCS_PATH, EXAMPLES_PATH, IS_PREPARE_MODE, MAX_FILE_SIZE, MDX_EXTENSION, MD_EXTENSION, ROOT_DIR, logger };
|