@assistant-ui/mcp-docs-server 0.1.7 → 0.1.8
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-ai-sdk-v5.md +3 -1
- package/.docs/organized/code-examples/with-cloud.md +3 -1
- package/.docs/organized/code-examples/with-external-store.md +3 -1
- package/.docs/organized/code-examples/with-ffmpeg.md +3 -1
- package/.docs/organized/code-examples/with-langgraph.md +66 -38
- package/.docs/organized/code-examples/with-parent-id-grouping.md +3 -1
- package/.docs/organized/code-examples/with-react-hook-form.md +3 -1
- package/.docs/raw/docs/api-reference/integrations/react-data-stream.mdx +194 -0
- package/.docs/raw/docs/api-reference/overview.mdx +6 -0
- package/.docs/raw/docs/api-reference/primitives/Composer.mdx +31 -0
- package/.docs/raw/docs/api-reference/primitives/Message.mdx +108 -3
- package/.docs/raw/docs/api-reference/primitives/Thread.mdx +59 -0
- package/.docs/raw/docs/api-reference/primitives/ThreadList.mdx +128 -0
- package/.docs/raw/docs/api-reference/primitives/ThreadListItem.mdx +160 -0
- package/.docs/raw/docs/api-reference/runtimes/AssistantRuntime.mdx +0 -11
- package/.docs/raw/docs/api-reference/runtimes/ComposerRuntime.mdx +3 -3
- package/.docs/raw/docs/copilots/assistant-frame.mdx +397 -0
- package/.docs/raw/docs/getting-started.mdx +20 -19
- package/.docs/raw/docs/guides/Attachments.mdx +6 -13
- package/.docs/raw/docs/guides/Tools.mdx +56 -13
- package/.docs/raw/docs/guides/context-api.mdx +574 -0
- package/.docs/raw/docs/migrations/v0-12.mdx +125 -0
- package/.docs/raw/docs/runtimes/custom/local.mdx +16 -3
- package/.docs/raw/docs/runtimes/data-stream.mdx +287 -0
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +5 -0
- package/.docs/raw/docs/ui/ThreadList.mdx +54 -16
- package/dist/{chunk-L4K23SWI.js → chunk-NVNFQ5ZO.js} +4 -1
- package/dist/index.js +1 -1
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +2 -2
- package/.docs/raw/docs/concepts/architecture.mdx +0 -19
- package/.docs/raw/docs/concepts/runtime-layer.mdx +0 -163
- package/.docs/raw/docs/concepts/why.mdx +0 -9
|
@@ -104,6 +104,65 @@ Renders all messages. This primitive renders a separate component for each messa
|
|
|
104
104
|
]}
|
|
105
105
|
/>
|
|
106
106
|
|
|
107
|
+
### MessageByIndex
|
|
108
|
+
|
|
109
|
+
Renders a single message at the specified index in the current thread.
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
<ThreadPrimitive.MessageByIndex
|
|
113
|
+
index={0}
|
|
114
|
+
components={{
|
|
115
|
+
UserMessage: MyUserMessage,
|
|
116
|
+
AssistantMessage: MyAssistantMessage
|
|
117
|
+
}}
|
|
118
|
+
/>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
<ParametersTable
|
|
122
|
+
type="ThreadPrimitive.MessageByIndex.Props"
|
|
123
|
+
parameters={[
|
|
124
|
+
{
|
|
125
|
+
name: "index",
|
|
126
|
+
type: "number",
|
|
127
|
+
required: true,
|
|
128
|
+
description: "The index of the message to render.",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "components",
|
|
132
|
+
type: "MessageComponents",
|
|
133
|
+
description: "The component configuration for rendering the message.",
|
|
134
|
+
children: [
|
|
135
|
+
{
|
|
136
|
+
type: "MessageComponents",
|
|
137
|
+
parameters: [
|
|
138
|
+
{
|
|
139
|
+
name: "Message",
|
|
140
|
+
type: "ComponentType",
|
|
141
|
+
description: "The component to render for each message.",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "UserMessage",
|
|
145
|
+
type: "ComponentType",
|
|
146
|
+
description: "The component to render for user messages.",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "EditComposer",
|
|
150
|
+
type: "ComponentType",
|
|
151
|
+
description:
|
|
152
|
+
"The component to render for user messages that are being edited.",
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "AssistantMessage",
|
|
156
|
+
type: "ComponentType",
|
|
157
|
+
description: "The component to render for assistant messages.",
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
]}
|
|
164
|
+
/>
|
|
165
|
+
|
|
107
166
|
### Empty
|
|
108
167
|
|
|
109
168
|
Renders children only when there are no messages.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ThreadListPrimitive
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Displays a list of conversation threads.
|
|
6
|
+
|
|
7
|
+
import { ParametersTable } from "@/components/docs";
|
|
8
|
+
|
|
9
|
+
## Anatomy
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { ThreadListPrimitive } from "@assistant-ui/react";
|
|
13
|
+
|
|
14
|
+
const ThreadList = () => (
|
|
15
|
+
<ThreadListPrimitive.Root>
|
|
16
|
+
<ThreadListPrimitive.New />
|
|
17
|
+
<ThreadListPrimitive.Items
|
|
18
|
+
components={{
|
|
19
|
+
ThreadListItem: MyThreadListItem
|
|
20
|
+
}}
|
|
21
|
+
/>
|
|
22
|
+
</ThreadListPrimitive.Root>
|
|
23
|
+
);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API Reference
|
|
27
|
+
|
|
28
|
+
### Root
|
|
29
|
+
|
|
30
|
+
Contains all parts of the thread list.
|
|
31
|
+
|
|
32
|
+
This primitive renders a `<div>` element unless `asChild` is set.
|
|
33
|
+
|
|
34
|
+
<ParametersTable
|
|
35
|
+
type="ThreadListPrimitiveRootProps"
|
|
36
|
+
parameters={[
|
|
37
|
+
{
|
|
38
|
+
name: "asChild",
|
|
39
|
+
},
|
|
40
|
+
]}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
### New
|
|
44
|
+
|
|
45
|
+
A button to create a new thread.
|
|
46
|
+
|
|
47
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
48
|
+
|
|
49
|
+
<ParametersTable
|
|
50
|
+
type="ThreadListPrimitiveNewProps"
|
|
51
|
+
parameters={[
|
|
52
|
+
{
|
|
53
|
+
name: "asChild",
|
|
54
|
+
},
|
|
55
|
+
]}
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
### Items
|
|
59
|
+
|
|
60
|
+
Renders all items in the thread list.
|
|
61
|
+
|
|
62
|
+
<ParametersTable
|
|
63
|
+
type="ThreadListPrimitive.Items.Props"
|
|
64
|
+
parameters={[
|
|
65
|
+
{
|
|
66
|
+
name: "archived",
|
|
67
|
+
type: "boolean",
|
|
68
|
+
default: "false",
|
|
69
|
+
description: "Whether to show archived threads instead of active threads.",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "components",
|
|
73
|
+
type: "ThreadListItemComponents",
|
|
74
|
+
required: true,
|
|
75
|
+
description: "The components to render for each thread list item.",
|
|
76
|
+
children: [
|
|
77
|
+
{
|
|
78
|
+
type: "ThreadListItemComponents",
|
|
79
|
+
parameters: [
|
|
80
|
+
{
|
|
81
|
+
name: "ThreadListItem",
|
|
82
|
+
type: "ComponentType",
|
|
83
|
+
required: true,
|
|
84
|
+
description: "The component to render for each thread in the list.",
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
]}
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
### ItemByIndex
|
|
94
|
+
|
|
95
|
+
Renders a single thread list item at the specified index.
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
<ThreadListPrimitive.ItemByIndex
|
|
99
|
+
index={0}
|
|
100
|
+
components={{
|
|
101
|
+
ThreadListItem: MyThreadListItem
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
<ParametersTable
|
|
107
|
+
type="ThreadListPrimitive.ItemByIndex.Props"
|
|
108
|
+
parameters={[
|
|
109
|
+
{
|
|
110
|
+
name: "index",
|
|
111
|
+
type: "number",
|
|
112
|
+
required: true,
|
|
113
|
+
description: "The index of the thread list item to render.",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "archived",
|
|
117
|
+
type: "boolean",
|
|
118
|
+
default: "false",
|
|
119
|
+
description: "Whether to render from archived threads instead of active threads.",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "components",
|
|
123
|
+
type: "ThreadListItemComponents",
|
|
124
|
+
required: true,
|
|
125
|
+
description: "The components to render for the thread list item.",
|
|
126
|
+
},
|
|
127
|
+
]}
|
|
128
|
+
/>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ThreadListItemPrimitive
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
A single thread item within a thread list.
|
|
6
|
+
|
|
7
|
+
import { ParametersTable } from "@/components/docs";
|
|
8
|
+
|
|
9
|
+
## Anatomy
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { ThreadListItemPrimitive } from "@assistant-ui/react";
|
|
13
|
+
|
|
14
|
+
const ThreadListItem = () => (
|
|
15
|
+
<ThreadListItemPrimitive.Root>
|
|
16
|
+
<ThreadListItemPrimitive.Trigger>
|
|
17
|
+
<ThreadListItemPrimitive.Title />
|
|
18
|
+
</ThreadListItemPrimitive.Trigger>
|
|
19
|
+
<ThreadListItemPrimitive.Archive />
|
|
20
|
+
<ThreadListItemPrimitive.Unarchive />
|
|
21
|
+
<ThreadListItemPrimitive.Delete />
|
|
22
|
+
</ThreadListItemPrimitive.Root>
|
|
23
|
+
);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API Reference
|
|
27
|
+
|
|
28
|
+
### Root
|
|
29
|
+
|
|
30
|
+
Contains all parts of the thread list item.
|
|
31
|
+
|
|
32
|
+
This primitive renders a `<div>` element unless `asChild` is set. It automatically adds `data-active="true"` and `aria-current="true"` attributes when the thread is the currently active thread.
|
|
33
|
+
|
|
34
|
+
<ParametersTable
|
|
35
|
+
type="ThreadListItemPrimitiveRootProps"
|
|
36
|
+
parameters={[
|
|
37
|
+
{
|
|
38
|
+
name: "asChild",
|
|
39
|
+
},
|
|
40
|
+
]}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
### Trigger
|
|
44
|
+
|
|
45
|
+
A button that switches to the thread when clicked.
|
|
46
|
+
|
|
47
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
48
|
+
|
|
49
|
+
<ParametersTable
|
|
50
|
+
type="ThreadListItemPrimitiveTriggerProps"
|
|
51
|
+
parameters={[
|
|
52
|
+
{
|
|
53
|
+
name: "asChild",
|
|
54
|
+
},
|
|
55
|
+
]}
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
### Title
|
|
59
|
+
|
|
60
|
+
Displays the title of the thread.
|
|
61
|
+
|
|
62
|
+
This primitive renders a `<span>` element unless `asChild` is set. The title is automatically derived from the first user message in the thread.
|
|
63
|
+
|
|
64
|
+
<ParametersTable
|
|
65
|
+
type="ThreadListItemPrimitiveTitleProps"
|
|
66
|
+
parameters={[
|
|
67
|
+
{
|
|
68
|
+
name: "asChild",
|
|
69
|
+
},
|
|
70
|
+
]}
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
### Archive
|
|
74
|
+
|
|
75
|
+
A button to archive the thread. Only shown for non-archived threads.
|
|
76
|
+
|
|
77
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
78
|
+
|
|
79
|
+
<ParametersTable
|
|
80
|
+
type="ThreadListItemPrimitiveArchiveProps"
|
|
81
|
+
parameters={[
|
|
82
|
+
{
|
|
83
|
+
name: "asChild",
|
|
84
|
+
},
|
|
85
|
+
]}
|
|
86
|
+
/>
|
|
87
|
+
|
|
88
|
+
### Unarchive
|
|
89
|
+
|
|
90
|
+
A button to unarchive the thread. Only shown for archived threads.
|
|
91
|
+
|
|
92
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
93
|
+
|
|
94
|
+
<ParametersTable
|
|
95
|
+
type="ThreadListItemPrimitiveUnarchiveProps"
|
|
96
|
+
parameters={[
|
|
97
|
+
{
|
|
98
|
+
name: "asChild",
|
|
99
|
+
},
|
|
100
|
+
]}
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
### Delete
|
|
104
|
+
|
|
105
|
+
A button to permanently delete the thread.
|
|
106
|
+
|
|
107
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
108
|
+
|
|
109
|
+
<ParametersTable
|
|
110
|
+
type="ThreadListItemPrimitiveDeleteProps"
|
|
111
|
+
parameters={[
|
|
112
|
+
{
|
|
113
|
+
name: "asChild",
|
|
114
|
+
},
|
|
115
|
+
]}
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
## Examples
|
|
119
|
+
|
|
120
|
+
### Basic Thread List Item
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
const MyThreadListItem = () => {
|
|
124
|
+
return (
|
|
125
|
+
<ThreadListItemPrimitive.Root className="thread-item">
|
|
126
|
+
<ThreadListItemPrimitive.Trigger className="thread-trigger">
|
|
127
|
+
<ThreadListItemPrimitive.Title />
|
|
128
|
+
</ThreadListItemPrimitive.Trigger>
|
|
129
|
+
<div className="thread-actions">
|
|
130
|
+
<ThreadListItemPrimitive.Archive>
|
|
131
|
+
Archive
|
|
132
|
+
</ThreadListItemPrimitive.Archive>
|
|
133
|
+
<ThreadListItemPrimitive.Delete>
|
|
134
|
+
Delete
|
|
135
|
+
</ThreadListItemPrimitive.Delete>
|
|
136
|
+
</div>
|
|
137
|
+
</ThreadListItemPrimitive.Root>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Archived Thread List Item
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
const ArchivedThreadListItem = () => {
|
|
146
|
+
return (
|
|
147
|
+
<ThreadListItemPrimitive.Root className="archived-thread-item">
|
|
148
|
+
<ThreadListItemPrimitive.Trigger>
|
|
149
|
+
<ThreadListItemPrimitive.Title />
|
|
150
|
+
</ThreadListItemPrimitive.Trigger>
|
|
151
|
+
<ThreadListItemPrimitive.Unarchive>
|
|
152
|
+
Restore
|
|
153
|
+
</ThreadListItemPrimitive.Unarchive>
|
|
154
|
+
<ThreadListItemPrimitive.Delete>
|
|
155
|
+
Delete Permanently
|
|
156
|
+
</ThreadListItemPrimitive.Delete>
|
|
157
|
+
</ThreadListItemPrimitive.Root>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
```
|
|
@@ -20,14 +20,3 @@ const runtime = useAssistantRuntime();
|
|
|
20
20
|
### Tool UI Registry
|
|
21
21
|
|
|
22
22
|
The tool UI registry is part of the assistant runtime. It allows you to display custom UI for tool calls, enabling generative UI.
|
|
23
|
-
|
|
24
|
-
#### `useToolUIs`
|
|
25
|
-
|
|
26
|
-
```tsx
|
|
27
|
-
import { useToolUIs } from "@assistant-ui/react";
|
|
28
|
-
|
|
29
|
-
const toolUIs = useToolUIs();
|
|
30
|
-
const webSearchToolUI = useToolUIs((m) => m.getToolUI("web_search"));
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
<ParametersTable {...AssistantToolUIsState} />
|
|
@@ -7,15 +7,15 @@ The composer runtime allows you to view or edit anything related to how new info
|
|
|
7
7
|
import { ParametersTable } from "@/components/docs";
|
|
8
8
|
import { ComposerRuntime, ThreadComposerRuntime, ThreadComposerState, EditComposerState } from "@/generated/typeDocs";
|
|
9
9
|
|
|
10
|
-
### `
|
|
10
|
+
### `useComposerRuntime`
|
|
11
11
|
|
|
12
12
|
Grabs the nearest composer (whether it’s the edit composer or the thread’s composer):
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
15
|
// Example
|
|
16
|
-
import {
|
|
16
|
+
import { useComposerRuntime } from "@assistant-ui/react";
|
|
17
17
|
|
|
18
|
-
const composerRuntime =
|
|
18
|
+
const composerRuntime = useComposerRuntime();
|
|
19
19
|
|
|
20
20
|
// set the text
|
|
21
21
|
composerRuntime.setText("Hello from the composer runtime");
|