@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,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "@assistant-ui/react-data-stream"
|
|
3
|
+
description: Hooks for connecting to data stream protocol endpoints and Assistant Cloud.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
Data Stream protocol integration for assistant-ui.
|
|
6
7
|
|
|
7
|
-
import { ParametersTable } from "@/components/docs";
|
|
8
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
8
9
|
|
|
9
10
|
## API Reference
|
|
10
11
|
|
package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/react-hook-form.mdx
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "@assistant-ui/react-hook-form"
|
|
3
|
+
description: React Hook Form integration for AI-assisted form filling.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
A React Hook Form integration for @assistant-ui.
|
|
6
7
|
|
|
7
|
-
import { ParametersTable } from "@/components/docs";
|
|
8
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
8
9
|
|
|
9
10
|
## API Reference
|
|
10
11
|
|
package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/vercel-ai-sdk.mdx
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "@assistant-ui/react-ai-sdk"
|
|
3
|
+
description: Vercel AI SDK v5 integration with chat runtime hooks and transport utilities.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
Vercel AI SDK integration for assistant-ui.
|
|
6
7
|
|
|
7
|
-
import { ParametersTable } from "@/components/docs";
|
|
8
|
-
import { Callout } from "fumadocs-ui/components/callout";
|
|
8
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
9
9
|
|
|
10
10
|
<Callout type="info">
|
|
11
11
|
This package provides integration with AI SDK v5. For AI SDK v4, see the [AI
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ActionBarMorePrimitive
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
A dropdown menu for additional actions that don't fit in the main action bar.
|
|
6
|
+
|
|
7
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
8
|
+
import { DataAttributesTable } from "@/components/docs/tables/DataAttributesTable";
|
|
9
|
+
import { Code } from "@radix-ui/themes";
|
|
10
|
+
|
|
11
|
+
## Anatomy
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { ActionBarPrimitive, ActionBarMorePrimitive } from "@assistant-ui/react";
|
|
15
|
+
|
|
16
|
+
const MessageActions = () => (
|
|
17
|
+
<ActionBarPrimitive.Root>
|
|
18
|
+
<ActionBarPrimitive.Copy />
|
|
19
|
+
<ActionBarPrimitive.Reload />
|
|
20
|
+
|
|
21
|
+
<ActionBarMorePrimitive.Root>
|
|
22
|
+
<ActionBarMorePrimitive.Trigger>
|
|
23
|
+
<MoreHorizontalIcon />
|
|
24
|
+
</ActionBarMorePrimitive.Trigger>
|
|
25
|
+
<ActionBarMorePrimitive.Content>
|
|
26
|
+
<ActionBarMorePrimitive.Item onSelect={() => console.log("Edit")}>
|
|
27
|
+
Edit
|
|
28
|
+
</ActionBarMorePrimitive.Item>
|
|
29
|
+
<ActionBarMorePrimitive.Item onSelect={() => console.log("Speak")}>
|
|
30
|
+
Read aloud
|
|
31
|
+
</ActionBarMorePrimitive.Item>
|
|
32
|
+
<ActionBarMorePrimitive.Separator />
|
|
33
|
+
<ActionBarMorePrimitive.Item onSelect={() => console.log("Feedback")}>
|
|
34
|
+
Submit feedback
|
|
35
|
+
</ActionBarMorePrimitive.Item>
|
|
36
|
+
</ActionBarMorePrimitive.Content>
|
|
37
|
+
</ActionBarMorePrimitive.Root>
|
|
38
|
+
</ActionBarPrimitive.Root>
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## API Reference
|
|
43
|
+
|
|
44
|
+
### Root
|
|
45
|
+
|
|
46
|
+
Contains all parts of the dropdown menu.
|
|
47
|
+
|
|
48
|
+
<ParametersTable
|
|
49
|
+
type="ActionBarMorePrimitiveRootProps"
|
|
50
|
+
parameters={[
|
|
51
|
+
{
|
|
52
|
+
name: "defaultOpen",
|
|
53
|
+
type: "boolean",
|
|
54
|
+
default: "false",
|
|
55
|
+
description:
|
|
56
|
+
"The open state of the dropdown menu when it is initially rendered. Use when you do not need to control its open state.",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "open",
|
|
60
|
+
type: "boolean",
|
|
61
|
+
description:
|
|
62
|
+
"The controlled open state of the dropdown menu. Must be used in conjunction with onOpenChange.",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "onOpenChange",
|
|
66
|
+
type: "(open: boolean) => void",
|
|
67
|
+
description:
|
|
68
|
+
"Event handler called when the open state of the dropdown menu changes.",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "modal",
|
|
72
|
+
type: "boolean",
|
|
73
|
+
default: "true",
|
|
74
|
+
description:
|
|
75
|
+
"The modality of the dropdown menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "dir",
|
|
79
|
+
type: "'ltr' | 'rtl'",
|
|
80
|
+
description: "The reading direction of the dropdown menu.",
|
|
81
|
+
},
|
|
82
|
+
]}
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
### Trigger
|
|
86
|
+
|
|
87
|
+
A button that toggles the dropdown menu.
|
|
88
|
+
|
|
89
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
90
|
+
|
|
91
|
+
<ParametersTable
|
|
92
|
+
type="ActionBarMorePrimitiveTriggerProps"
|
|
93
|
+
parameters={[
|
|
94
|
+
{
|
|
95
|
+
name: "asChild",
|
|
96
|
+
},
|
|
97
|
+
]}
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
<DataAttributesTable
|
|
101
|
+
data={[
|
|
102
|
+
{
|
|
103
|
+
attribute: "[data-state]",
|
|
104
|
+
values: <Code>"open" | "closed"</Code>,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
attribute: "[data-disabled]",
|
|
108
|
+
values: "Present when disabled",
|
|
109
|
+
},
|
|
110
|
+
]}
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
### Content
|
|
114
|
+
|
|
115
|
+
The component that pops out when the dropdown menu is open.
|
|
116
|
+
|
|
117
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
118
|
+
|
|
119
|
+
<ParametersTable
|
|
120
|
+
type="ActionBarMorePrimitiveContentProps"
|
|
121
|
+
parameters={[
|
|
122
|
+
{
|
|
123
|
+
name: "asChild",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "side",
|
|
127
|
+
type: "'top' | 'right' | 'bottom' | 'left'",
|
|
128
|
+
default: "'bottom'",
|
|
129
|
+
description: "The preferred side of the trigger to render against.",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "sideOffset",
|
|
133
|
+
type: "number",
|
|
134
|
+
default: "4",
|
|
135
|
+
description: "The distance in pixels from the trigger.",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "align",
|
|
139
|
+
type: "'start' | 'center' | 'end'",
|
|
140
|
+
default: "'center'",
|
|
141
|
+
description: "The preferred alignment against the trigger.",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "alignOffset",
|
|
145
|
+
type: "number",
|
|
146
|
+
default: "0",
|
|
147
|
+
description: "An offset in pixels from the align option.",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "portalProps",
|
|
151
|
+
type: "PortalProps",
|
|
152
|
+
description: "Props to pass to the Portal component.",
|
|
153
|
+
},
|
|
154
|
+
]}
|
|
155
|
+
/>
|
|
156
|
+
|
|
157
|
+
<DataAttributesTable
|
|
158
|
+
data={[
|
|
159
|
+
{
|
|
160
|
+
attribute: "[data-state]",
|
|
161
|
+
values: <Code>"open" | "closed"</Code>,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
attribute: "[data-side]",
|
|
165
|
+
values: <Code>"top" | "right" | "bottom" | "left"</Code>,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
attribute: "[data-align]",
|
|
169
|
+
values: <Code>"start" | "center" | "end"</Code>,
|
|
170
|
+
},
|
|
171
|
+
]}
|
|
172
|
+
/>
|
|
173
|
+
|
|
174
|
+
Refer to Radix UI's Documentation for [DropdownMenu.Content](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#content) for more details.
|
|
175
|
+
|
|
176
|
+
### Item
|
|
177
|
+
|
|
178
|
+
A menu item within the dropdown menu.
|
|
179
|
+
|
|
180
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
181
|
+
|
|
182
|
+
<ParametersTable
|
|
183
|
+
type="ActionBarMorePrimitiveItemProps"
|
|
184
|
+
parameters={[
|
|
185
|
+
{
|
|
186
|
+
name: "asChild",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "disabled",
|
|
190
|
+
type: "boolean",
|
|
191
|
+
description: "When true, prevents the user from interacting with the item.",
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: "onSelect",
|
|
195
|
+
type: "(event: Event) => void",
|
|
196
|
+
description:
|
|
197
|
+
"Event handler called when the user selects an item (via mouse or keyboard). Calling event.preventDefault in this handler will prevent the dropdown menu from closing when selecting that item.",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: "textValue",
|
|
201
|
+
type: "string",
|
|
202
|
+
description:
|
|
203
|
+
"Optional text used for typeahead purposes. By default the typeahead behavior will use the .textContent of the item.",
|
|
204
|
+
},
|
|
205
|
+
]}
|
|
206
|
+
/>
|
|
207
|
+
|
|
208
|
+
<DataAttributesTable
|
|
209
|
+
data={[
|
|
210
|
+
{
|
|
211
|
+
attribute: "[data-disabled]",
|
|
212
|
+
values: "Present when disabled",
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
attribute: "[data-highlighted]",
|
|
216
|
+
values: "Present when highlighted",
|
|
217
|
+
},
|
|
218
|
+
]}
|
|
219
|
+
/>
|
|
220
|
+
|
|
221
|
+
Refer to Radix UI's Documentation for [DropdownMenu.Item](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#item) for more details.
|
|
222
|
+
|
|
223
|
+
### Separator
|
|
224
|
+
|
|
225
|
+
A visual separator between groups of items.
|
|
226
|
+
|
|
227
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
228
|
+
|
|
229
|
+
<ParametersTable
|
|
230
|
+
type="ActionBarMorePrimitiveSeparatorProps"
|
|
231
|
+
parameters={[
|
|
232
|
+
{
|
|
233
|
+
name: "asChild",
|
|
234
|
+
},
|
|
235
|
+
]}
|
|
236
|
+
/>
|
|
237
|
+
|
|
238
|
+
## Example Usage
|
|
239
|
+
|
|
240
|
+
### Basic dropdown menu
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
import { ActionBarMorePrimitive } from "@assistant-ui/react";
|
|
244
|
+
import { MoreHorizontal, Pencil, Volume2, ThumbsUp } from "lucide-react";
|
|
245
|
+
|
|
246
|
+
const MoreActionsMenu = () => (
|
|
247
|
+
<ActionBarMorePrimitive.Root>
|
|
248
|
+
<ActionBarMorePrimitive.Trigger className="action-button">
|
|
249
|
+
<MoreHorizontal className="size-4" />
|
|
250
|
+
</ActionBarMorePrimitive.Trigger>
|
|
251
|
+
<ActionBarMorePrimitive.Content className="dropdown-content">
|
|
252
|
+
<ActionBarMorePrimitive.Item
|
|
253
|
+
className="dropdown-item"
|
|
254
|
+
onSelect={() => console.log("Edit")}
|
|
255
|
+
>
|
|
256
|
+
<Pencil className="size-4" />
|
|
257
|
+
Edit message
|
|
258
|
+
</ActionBarMorePrimitive.Item>
|
|
259
|
+
<ActionBarMorePrimitive.Item
|
|
260
|
+
className="dropdown-item"
|
|
261
|
+
onSelect={() => console.log("Speak")}
|
|
262
|
+
>
|
|
263
|
+
<Volume2 className="size-4" />
|
|
264
|
+
Read aloud
|
|
265
|
+
</ActionBarMorePrimitive.Item>
|
|
266
|
+
<ActionBarMorePrimitive.Separator className="dropdown-separator" />
|
|
267
|
+
<ActionBarMorePrimitive.Item
|
|
268
|
+
className="dropdown-item"
|
|
269
|
+
onSelect={() => console.log("Like")}
|
|
270
|
+
>
|
|
271
|
+
<ThumbsUp className="size-4" />
|
|
272
|
+
Good response
|
|
273
|
+
</ActionBarMorePrimitive.Item>
|
|
274
|
+
</ActionBarMorePrimitive.Content>
|
|
275
|
+
</ActionBarMorePrimitive.Root>
|
|
276
|
+
);
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Using with action hooks
|
|
280
|
+
|
|
281
|
+
You can combine the dropdown menu items with action hooks from ActionBarPrimitive:
|
|
282
|
+
|
|
283
|
+
```tsx
|
|
284
|
+
import {
|
|
285
|
+
ActionBarPrimitive,
|
|
286
|
+
ActionBarMorePrimitive,
|
|
287
|
+
useAssistantApi,
|
|
288
|
+
useAssistantState,
|
|
289
|
+
} from "@assistant-ui/react";
|
|
290
|
+
import { useCallback } from "react";
|
|
291
|
+
|
|
292
|
+
const useEditAction = () => {
|
|
293
|
+
const api = useAssistantApi();
|
|
294
|
+
const disabled = useAssistantState(({ composer }) => composer.isEditing);
|
|
295
|
+
const callback = useCallback(() => api.composer().beginEdit(), [api]);
|
|
296
|
+
if (disabled) return null;
|
|
297
|
+
return callback;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
const useSpeakAction = () => {
|
|
301
|
+
const api = useAssistantApi();
|
|
302
|
+
return useCallback(() => api.message().speak(), [api]);
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
const MoreActionsWithHooks = () => {
|
|
306
|
+
const edit = useEditAction();
|
|
307
|
+
const speak = useSpeakAction();
|
|
308
|
+
|
|
309
|
+
return (
|
|
310
|
+
<ActionBarMorePrimitive.Root>
|
|
311
|
+
<ActionBarMorePrimitive.Trigger>
|
|
312
|
+
<MoreHorizontalIcon />
|
|
313
|
+
</ActionBarMorePrimitive.Trigger>
|
|
314
|
+
<ActionBarMorePrimitive.Content>
|
|
315
|
+
<ActionBarMorePrimitive.Item onSelect={edit ?? undefined} disabled={!edit}>
|
|
316
|
+
Edit
|
|
317
|
+
</ActionBarMorePrimitive.Item>
|
|
318
|
+
<ActionBarMorePrimitive.Item onSelect={speak}>
|
|
319
|
+
Read aloud
|
|
320
|
+
</ActionBarMorePrimitive.Item>
|
|
321
|
+
</ActionBarMorePrimitive.Content>
|
|
322
|
+
</ActionBarMorePrimitive.Root>
|
|
323
|
+
);
|
|
324
|
+
};
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: ActionBarPrimitive
|
|
3
|
+
description: Buttons for message actions like copy, edit, reload, speak, and feedback.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
Buttons to interact with the message.
|
|
6
7
|
|
|
7
|
-
import { ParametersTable
|
|
8
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
9
|
+
import { DataAttributesTable } from "@/components/docs/tables/DataAttributesTable";
|
|
8
10
|
import { Code } from "@radix-ui/themes";
|
|
9
11
|
|
|
10
12
|
## Anatomy
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: AssistantIf
|
|
3
|
+
description: Conditional rendering component based on thread, message, or composer state.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
Conditionally render children based on assistant state.
|
|
6
7
|
|
|
7
|
-
import { ParametersTable } from "@/components/docs";
|
|
8
|
-
import { Callout } from "fumadocs-ui/components/callout";
|
|
8
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
9
9
|
|
|
10
10
|
## Anatomy
|
|
11
11
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: AssistantModalPrimitive
|
|
3
|
+
description: A popover chat interface for floating assistant UI in the corner of the screen.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
A modal chat UI usually displayed in the bottom right corner of the screen.
|
|
6
7
|
|
|
7
8
|
import { Code } from "@radix-ui/themes";
|
|
8
|
-
import { ParametersTable
|
|
9
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
10
|
+
import { DataAttributesTable } from "@/components/docs/tables/DataAttributesTable";
|
|
9
11
|
|
|
10
12
|
## Anatomy
|
|
11
13
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: AttachmentPrimitive
|
|
3
|
+
description: Components for displaying and managing file attachments in messages and composer.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
Buttons to interact with attachments.
|
|
6
7
|
|
|
7
|
-
import { ParametersTable
|
|
8
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
9
|
+
import { DataAttributesTable } from "@/components/docs/tables/DataAttributesTable";
|
|
8
10
|
import { Code } from "@radix-ui/themes";
|
|
9
|
-
import { Callout } from "fumadocs-ui/components/callout";
|
|
10
11
|
|
|
11
12
|
<Callout>
|
|
12
13
|
**Dual Use!** Attachments can appear in both messages and composers.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: BranchPickerPrimitive
|
|
3
|
+
description: Navigate between conversation branches with previous/next controls.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
View and switch between branches.
|
|
6
7
|
|
|
7
|
-
import { ParametersTable } from "@/components/docs";
|
|
8
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
8
9
|
|
|
9
10
|
## Anatomy
|
|
10
11
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: ComposerPrimitive
|
|
3
|
+
description: Primitives for the text input, send button, and attachments.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
The user interface to add new messages or edit existing ones.
|
|
6
7
|
|
|
7
|
-
import { Callout } from "fumadocs-ui/components/callout";
|
|
8
8
|
|
|
9
|
-
import { ParametersTable
|
|
9
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
10
|
+
import { KeyboardTable } from "@/components/docs/tables/KeyboardTable";
|
|
10
11
|
import { Code } from "@radix-ui/themes";
|
|
11
12
|
|
|
12
13
|
<Callout>
|
|
@@ -37,6 +38,20 @@ const EditComposer = () => (
|
|
|
37
38
|
<ComposerPrimitive.Cancel />
|
|
38
39
|
</ComposerPrimitive.Root>
|
|
39
40
|
);
|
|
41
|
+
|
|
42
|
+
// with voice input (dictation)
|
|
43
|
+
const ComposerWithDictation = () => (
|
|
44
|
+
<ComposerPrimitive.Root>
|
|
45
|
+
<ComposerPrimitive.Input />
|
|
46
|
+
<ComposerPrimitive.If dictation={false}>
|
|
47
|
+
<ComposerPrimitive.Dictate />
|
|
48
|
+
</ComposerPrimitive.If>
|
|
49
|
+
<ComposerPrimitive.If dictation>
|
|
50
|
+
<ComposerPrimitive.StopDictation />
|
|
51
|
+
</ComposerPrimitive.If>
|
|
52
|
+
<ComposerPrimitive.Send />
|
|
53
|
+
</ComposerPrimitive.Root>
|
|
54
|
+
);
|
|
40
55
|
```
|
|
41
56
|
|
|
42
57
|
## API Reference
|
|
@@ -213,3 +228,87 @@ This primitive renders a `<button>` element unless `asChild` is set.
|
|
|
213
228
|
},
|
|
214
229
|
]}
|
|
215
230
|
/>
|
|
231
|
+
|
|
232
|
+
### Dictate
|
|
233
|
+
|
|
234
|
+
Renders a button to start dictation to convert voice to text.
|
|
235
|
+
|
|
236
|
+
Requires a `DictationAdapter` to be configured in the runtime.
|
|
237
|
+
|
|
238
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
239
|
+
|
|
240
|
+
<ParametersTable
|
|
241
|
+
type="ComposerPrimitiveDictateProps"
|
|
242
|
+
parameters={[
|
|
243
|
+
{
|
|
244
|
+
name: "asChild",
|
|
245
|
+
},
|
|
246
|
+
]}
|
|
247
|
+
/>
|
|
248
|
+
|
|
249
|
+
### StopDictation
|
|
250
|
+
|
|
251
|
+
Renders a button to stop the current dictation session.
|
|
252
|
+
|
|
253
|
+
Only rendered when dictation is active.
|
|
254
|
+
|
|
255
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
256
|
+
|
|
257
|
+
<ParametersTable
|
|
258
|
+
type="ComposerPrimitiveStopDictationProps"
|
|
259
|
+
parameters={[
|
|
260
|
+
{
|
|
261
|
+
name: "asChild",
|
|
262
|
+
},
|
|
263
|
+
]}
|
|
264
|
+
/>
|
|
265
|
+
|
|
266
|
+
### DictationTranscript
|
|
267
|
+
|
|
268
|
+
Renders the current interim (partial) transcript while dictation is active.
|
|
269
|
+
|
|
270
|
+
<Callout type="info">
|
|
271
|
+
**Note:** By default, interim transcripts are displayed directly in the composer input (like native dictation).
|
|
272
|
+
This component is for **advanced customization** when you want to display the interim transcript separately (e.g., in a different style or location).
|
|
273
|
+
</Callout>
|
|
274
|
+
|
|
275
|
+
Only renders when there is an active interim transcript (returns `null` otherwise).
|
|
276
|
+
|
|
277
|
+
This primitive renders a `<span>` element.
|
|
278
|
+
|
|
279
|
+
```tsx
|
|
280
|
+
{/* Optional: Display interim transcript separately with custom styling */}
|
|
281
|
+
<ComposerPrimitive.If dictation>
|
|
282
|
+
<div className="dictation-preview">
|
|
283
|
+
<ComposerPrimitive.DictationTranscript className="italic text-muted" />
|
|
284
|
+
</div>
|
|
285
|
+
</ComposerPrimitive.If>
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### If
|
|
289
|
+
|
|
290
|
+
Renders children if a condition is met.
|
|
291
|
+
|
|
292
|
+
<ParametersTable
|
|
293
|
+
type="UseComposerIfProps"
|
|
294
|
+
parameters={[
|
|
295
|
+
{
|
|
296
|
+
name: "editing",
|
|
297
|
+
required: false,
|
|
298
|
+
type: "boolean | undefined",
|
|
299
|
+
description: "Render children if the message is being edited.",
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
name: "dictation",
|
|
303
|
+
required: false,
|
|
304
|
+
type: "boolean | undefined",
|
|
305
|
+
description: "Render children if dictation is active.",
|
|
306
|
+
},
|
|
307
|
+
]}
|
|
308
|
+
/>
|
|
309
|
+
|
|
310
|
+
```tsx
|
|
311
|
+
<Composer.If editing>{/* rendered if message is being edited */}</Composer.If>
|
|
312
|
+
|
|
313
|
+
<Composer.If dictation>{/* rendered if dictation is active */}</Composer.If>
|
|
314
|
+
```
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: ErrorPrimitive
|
|
3
|
+
description: Components for displaying error messages in the chat interface.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
A component for displaying error messages in the UI.
|
|
6
7
|
|
|
7
|
-
import { ParametersTable } from "@/components/docs";
|
|
8
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
8
9
|
|
|
9
10
|
## Anatomy
|
|
10
11
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: MessagePartPrimitive
|
|
3
|
-
description:
|
|
3
|
+
description: Primitives for text, images, tool calls, and other message content.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { ParametersTable } from "@/components/docs";
|
|
6
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
7
7
|
import {
|
|
8
8
|
MessagePartRuntime,
|
|
9
9
|
TextMessagePartState,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: MessagePrimitive
|
|
3
|
+
description: Components for rendering message content, parts, and attachments.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
A single message in a conversation. Messages may consist of multiple parts.
|
|
6
7
|
|
|
7
|
-
import { ParametersTable } from "@/components/docs";
|
|
8
|
+
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
8
9
|
|
|
9
10
|
## Anatomy
|
|
10
11
|
|