@assistant-ui/mcp-docs-server 0.1.25 → 0.1.26

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.
Files changed (50) hide show
  1. package/.docs/organized/code-examples/waterfall.md +4 -4
  2. package/.docs/organized/code-examples/with-a2a.md +5 -5
  3. package/.docs/organized/code-examples/with-ag-ui.md +6 -6
  4. package/.docs/organized/code-examples/with-ai-sdk-v6.md +7 -7
  5. package/.docs/organized/code-examples/with-artifacts.md +7 -7
  6. package/.docs/organized/code-examples/with-assistant-transport.md +5 -5
  7. package/.docs/organized/code-examples/with-chain-of-thought.md +7 -7
  8. package/.docs/organized/code-examples/with-cloud-standalone.md +8 -8
  9. package/.docs/organized/code-examples/with-cloud.md +7 -7
  10. package/.docs/organized/code-examples/with-custom-thread-list.md +7 -7
  11. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +10 -10
  12. package/.docs/organized/code-examples/with-expo.md +14 -14
  13. package/.docs/organized/code-examples/with-external-store.md +5 -5
  14. package/.docs/organized/code-examples/with-ffmpeg.md +7 -7
  15. package/.docs/organized/code-examples/with-google-adk.md +5 -5
  16. package/.docs/organized/code-examples/with-heat-graph.md +4 -4
  17. package/.docs/organized/code-examples/with-interactables.md +778 -0
  18. package/.docs/organized/code-examples/with-langgraph.md +6 -6
  19. package/.docs/organized/code-examples/with-parent-id-grouping.md +6 -6
  20. package/.docs/organized/code-examples/with-react-hook-form.md +8 -8
  21. package/.docs/organized/code-examples/with-react-ink.md +2 -2
  22. package/.docs/organized/code-examples/with-react-router.md +10 -10
  23. package/.docs/organized/code-examples/with-store.md +5 -5
  24. package/.docs/organized/code-examples/with-tanstack.md +8 -8
  25. package/.docs/organized/code-examples/with-tap-runtime.md +8 -8
  26. package/.docs/raw/blog/2026-03-launch-week/index.mdx +31 -0
  27. package/.docs/raw/docs/(docs)/cli.mdx +60 -0
  28. package/.docs/raw/docs/(docs)/guides/attachments.mdx +65 -4
  29. package/.docs/raw/docs/(docs)/guides/interactables.mdx +292 -0
  30. package/.docs/raw/docs/(docs)/guides/message-timing.mdx +3 -3
  31. package/.docs/raw/docs/(docs)/guides/multi-agent.mdx +1 -0
  32. package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +128 -0
  33. package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +6 -0
  34. package/.docs/raw/docs/cloud/ai-sdk.mdx +81 -1
  35. package/.docs/raw/docs/ink/primitives.mdx +141 -0
  36. package/.docs/raw/docs/primitives/action-bar.mdx +351 -0
  37. package/.docs/raw/docs/primitives/assistant-modal.mdx +215 -0
  38. package/.docs/raw/docs/primitives/attachment.mdx +216 -0
  39. package/.docs/raw/docs/primitives/branch-picker.mdx +221 -0
  40. package/.docs/raw/docs/primitives/chain-of-thought.mdx +311 -0
  41. package/.docs/raw/docs/primitives/composer.mdx +526 -0
  42. package/.docs/raw/docs/primitives/error.mdx +141 -0
  43. package/.docs/raw/docs/primitives/index.mdx +98 -0
  44. package/.docs/raw/docs/primitives/message.mdx +524 -0
  45. package/.docs/raw/docs/primitives/selection-toolbar.mdx +165 -0
  46. package/.docs/raw/docs/primitives/suggestion.mdx +242 -0
  47. package/.docs/raw/docs/primitives/thread-list.mdx +404 -0
  48. package/.docs/raw/docs/primitives/thread.mdx +482 -0
  49. package/.docs/raw/docs/ui/mention.mdx +168 -0
  50. package/package.json +3 -3
@@ -0,0 +1,404 @@
1
+ ---
2
+ title: ThreadList
3
+ description: Multi-thread management for listing, creating, switching, archiving, and deleting conversations.
4
+ ---
5
+
6
+ import { ThreadListPrimitiveSample } from "@/components/docs/samples/thread-list-primitive";
7
+ import { ThreadListPrimitive as ThreadListPrimitiveDocs, ThreadListItemPrimitive as ThreadListItemPrimitiveDocs, ThreadListItemMorePrimitive as ThreadListItemMorePrimitiveDocs } from "@/generated/primitiveDocs";
8
+
9
+ The ThreadList primitive manages multiple conversations by listing threads, creating new ones, switching between them, and archiving or deleting old ones. It's composed from three primitive namespaces: `ThreadListPrimitive`, `ThreadListItemPrimitive`, and `ThreadListItemMorePrimitive`.
10
+
11
+ <Tabs items={["Preview", "Code"]}>
12
+ <Tab>
13
+ <ThreadListPrimitiveSample />
14
+ </Tab>
15
+ <Tab>
16
+ ```tsx
17
+ import {
18
+ ThreadListPrimitive,
19
+ ThreadListItemPrimitive,
20
+ ThreadListItemMorePrimitive,
21
+ } from "@assistant-ui/react";
22
+ import { ArchiveIcon, MoreHorizontalIcon, PlusIcon, TrashIcon } from "lucide-react";
23
+
24
+ function MyThreadList() {
25
+ return (
26
+ <ThreadListPrimitive.Root className="flex flex-col gap-1">
27
+ <ThreadListPrimitive.New className="flex h-9 items-center gap-2 rounded-lg border px-3 text-sm hover:bg-muted">
28
+ <PlusIcon className="size-4" />
29
+ New Thread
30
+ </ThreadListPrimitive.New>
31
+ <ThreadListPrimitive.Items>
32
+ {() => <ThreadListItem />}
33
+ </ThreadListPrimitive.Items>
34
+ </ThreadListPrimitive.Root>
35
+ );
36
+ }
37
+
38
+ function ThreadListItem() {
39
+ return (
40
+ <ThreadListItemPrimitive.Root className="group flex h-9 items-center rounded-lg hover:bg-muted data-active:bg-muted">
41
+ <ThreadListItemPrimitive.Trigger className="flex-1 truncate px-3 text-sm">
42
+ <ThreadListItemPrimitive.Title fallback="New Chat" />
43
+ </ThreadListItemPrimitive.Trigger>
44
+ <ThreadListItemMorePrimitive.Root>
45
+ <ThreadListItemMorePrimitive.Trigger className="mr-2 size-7 rounded-md opacity-0 group-hover:opacity-100">
46
+ <MoreHorizontalIcon className="size-4" />
47
+ </ThreadListItemMorePrimitive.Trigger>
48
+ <ThreadListItemMorePrimitive.Content className="rounded-md border bg-popover p-1 shadow-md">
49
+ <ThreadListItemPrimitive.Archive asChild>
50
+ <ThreadListItemMorePrimitive.Item className="flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent">
51
+ <ArchiveIcon className="size-4" /> Archive
52
+ </ThreadListItemMorePrimitive.Item>
53
+ </ThreadListItemPrimitive.Archive>
54
+ <ThreadListItemPrimitive.Delete asChild>
55
+ <ThreadListItemMorePrimitive.Item className="flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-destructive hover:bg-destructive/10">
56
+ <TrashIcon className="size-4" /> Delete
57
+ </ThreadListItemMorePrimitive.Item>
58
+ </ThreadListItemPrimitive.Delete>
59
+ </ThreadListItemMorePrimitive.Content>
60
+ </ThreadListItemMorePrimitive.Root>
61
+ </ThreadListItemPrimitive.Root>
62
+ );
63
+ }
64
+ ```
65
+ </Tab>
66
+ </Tabs>
67
+
68
+ ## Quick Start
69
+
70
+ Minimal example:
71
+
72
+ ```tsx
73
+ import {
74
+ ThreadListPrimitive,
75
+ ThreadListItemPrimitive,
76
+ } from "@assistant-ui/react";
77
+
78
+ <ThreadListPrimitive.Root>
79
+ <ThreadListPrimitive.New>New Thread</ThreadListPrimitive.New>
80
+ <ThreadListPrimitive.Items>
81
+ {() => (
82
+ <ThreadListItemPrimitive.Root>
83
+ <ThreadListItemPrimitive.Trigger>
84
+ <ThreadListItemPrimitive.Title fallback="New Chat" />
85
+ </ThreadListItemPrimitive.Trigger>
86
+ </ThreadListItemPrimitive.Root>
87
+ )}
88
+ </ThreadListPrimitive.Items>
89
+ </ThreadListPrimitive.Root>
90
+ ```
91
+
92
+ `Root` renders a `<div>`, `New` renders a `<button>` that creates a new thread, and `Items` iterates over the thread list. Each item is composed from `ThreadListItemPrimitive` parts.
93
+
94
+ <Callout type="info">
95
+ Runtime setup: primitives require runtime context. Wrap your UI in `AssistantRuntimeProvider` with a runtime (for example `useLocalRuntime(...)`). See [Pick a Runtime](/docs/runtimes/pick-a-runtime).
96
+ </Callout>
97
+
98
+ ## Core Concepts
99
+
100
+ ### Three Namespaces
101
+
102
+ ThreadList is split across three namespaces to keep each level of abstraction composable:
103
+
104
+ - **`ThreadListPrimitive`**: The outer container. `Root` wraps the list, `New` creates threads, and `Items` iterates over them.
105
+ - **`ThreadListItemPrimitive`**: An individual thread row. `Root` provides context, `Trigger` switches to the thread, `Title` shows the thread name, and action buttons (Archive, Unarchive, Delete) manage the thread lifecycle.
106
+ - **`ThreadListItemMorePrimitive`**: An overflow dropdown menu (built on Radix DropdownMenu) for thread actions. Compose action buttons with menu items using `asChild`.
107
+
108
+ ### Active State
109
+
110
+ Both `ThreadListPrimitive.New` and `ThreadListItemPrimitive.Root` get a `data-active` attribute when they represent the current thread. Use this for styling:
111
+
112
+ ```tsx
113
+ <ThreadListItemPrimitive.Root className="hover:bg-muted data-active:bg-muted">
114
+ {/* ... */}
115
+ </ThreadListItemPrimitive.Root>
116
+ ```
117
+
118
+ The `New` button gets `data-active` when the user is on a fresh, unsaved thread.
119
+
120
+ ### Items Iterator
121
+
122
+ `ThreadListPrimitive.Items` now prefers a children render function, similar to `ThreadPrimitive.Messages`:
123
+
124
+ ```tsx
125
+ <ThreadListPrimitive.Items>
126
+ {({ threadListItem }) => (
127
+ <MyThreadItem threadId={threadListItem.id} />
128
+ )}
129
+ </ThreadListPrimitive.Items>
130
+ ```
131
+
132
+ `components` is deprecated. Use the `children` render function instead.
133
+
134
+ ### Archived Threads
135
+
136
+ Pass `archived` to `Items` to render archived threads separately:
137
+
138
+ ```tsx
139
+ <ThreadListPrimitive.Root>
140
+ <ThreadListPrimitive.New>New Thread</ThreadListPrimitive.New>
141
+ <ThreadListPrimitive.Items>
142
+ {() => <ThreadListItem />}
143
+ </ThreadListPrimitive.Items>
144
+
145
+ <h3>Archived</h3>
146
+ <ThreadListPrimitive.Items archived>
147
+ {() => <ArchivedThreadItem />}
148
+ </ThreadListPrimitive.Items>
149
+ </ThreadListPrimitive.Root>
150
+ ```
151
+
152
+ ### Thread Actions
153
+
154
+ `Archive`, `Unarchive`, and `Delete` buttons disable automatically when the runtime capability is unavailable.
155
+
156
+ ### Composing Actions with Menu Items
157
+
158
+ The canonical pattern composes `ThreadListItemPrimitive.Archive asChild` with `ThreadListItemMorePrimitive.Item` to get both the action behavior AND the menu item styling:
159
+
160
+ ```tsx
161
+ <ThreadListItemPrimitive.Archive asChild>
162
+ <ThreadListItemMorePrimitive.Item>
163
+ <ArchiveIcon className="size-4" /> Archive
164
+ </ThreadListItemMorePrimitive.Item>
165
+ </ThreadListItemPrimitive.Archive>
166
+ ```
167
+
168
+ `Archive` provides the click handler and disabled logic. `Item` provides the menu item behavior and styling. `asChild` merges them into a single element.
169
+
170
+ ## Parts
171
+
172
+ ### ThreadListPrimitive
173
+
174
+ #### Root
175
+
176
+ Container for the full thread list. Renders a `<div>` element unless `asChild` is set.
177
+
178
+ ```tsx
179
+ <ThreadListPrimitive.Root className="flex flex-col gap-1">
180
+ <ThreadListPrimitive.Items>
181
+ {() => <MyThreadItem />}
182
+ </ThreadListPrimitive.Items>
183
+ </ThreadListPrimitive.Root>
184
+ ```
185
+
186
+ #### New
187
+
188
+ Button that creates a new thread. Renders a `<button>` element unless `asChild` is set.
189
+
190
+ ```tsx
191
+ <ThreadListPrimitive.New className="rounded-lg border px-3 py-2 text-sm">
192
+ New Thread
193
+ </ThreadListPrimitive.New>
194
+ ```
195
+
196
+ #### Items
197
+
198
+ Renders a component per thread.
199
+
200
+ ```tsx
201
+ <ThreadListPrimitive.Items>
202
+ {() => <MyThreadItem />}
203
+ </ThreadListPrimitive.Items>
204
+ ```
205
+
206
+ <PrimitivesTypeTable type="ThreadListPrimitiveItemsProps" parameters={ThreadListPrimitiveDocs.Items.props} />
207
+
208
+ #### ItemByIndex
209
+
210
+ Renders a single thread at a specific index.
211
+
212
+ ```tsx
213
+ <ThreadListPrimitive.ItemByIndex
214
+ index={0}
215
+ components={{ ThreadListItem: MyThreadItem }}
216
+ />
217
+ ```
218
+
219
+ <PrimitivesTypeTable type="ThreadListPrimitiveItemByIndexProps" parameters={ThreadListPrimitiveDocs.ItemByIndex.props} />
220
+
221
+ ### ThreadListItemPrimitive
222
+
223
+ #### Root
224
+
225
+ Container for one thread list item. Renders a `<div>` element unless `asChild` is set.
226
+
227
+ ```tsx
228
+ <ThreadListItemPrimitive.Root className="flex items-center gap-2 rounded-lg px-2 py-1.5">
229
+ <ThreadListItemPrimitive.Trigger className="flex-1 text-left">
230
+ <ThreadListItemPrimitive.Title fallback="New Chat" />
231
+ </ThreadListItemPrimitive.Trigger>
232
+ </ThreadListItemPrimitive.Root>
233
+ ```
234
+
235
+ #### Trigger
236
+
237
+ Interactive button that selects the thread. Renders a `<button>` element unless `asChild` is set.
238
+
239
+ ```tsx
240
+ <ThreadListItemPrimitive.Trigger className="flex-1 text-left">
241
+ <ThreadListItemPrimitive.Title fallback="New Chat" />
242
+ </ThreadListItemPrimitive.Trigger>
243
+ ```
244
+
245
+ #### Title
246
+
247
+ Displays the thread title with a `fallback` prop. Renders a React fragment (no wrapper element). Use a `<span>` wrapper if you need to style it.
248
+
249
+ ```tsx
250
+ <ThreadListItemPrimitive.Title fallback="New Chat" />
251
+ ```
252
+
253
+ <PrimitivesTypeTable type="ThreadListItemPrimitiveTitleProps" parameters={ThreadListItemPrimitiveDocs.Title.props} />
254
+
255
+ #### Archive
256
+
257
+ Button that archives the current thread item. Renders a `<button>` element unless `asChild` is set.
258
+
259
+ ```tsx
260
+ <ThreadListItemPrimitive.Archive>Archive</ThreadListItemPrimitive.Archive>
261
+ ```
262
+
263
+ #### Unarchive
264
+
265
+ Button that restores the current thread item from the archive. Renders a `<button>` element unless `asChild` is set.
266
+
267
+ ```tsx
268
+ <ThreadListItemPrimitive.Unarchive>Unarchive</ThreadListItemPrimitive.Unarchive>
269
+ ```
270
+
271
+ #### Delete
272
+
273
+ Button that deletes the current thread item. Renders a `<button>` element unless `asChild` is set.
274
+
275
+ ```tsx
276
+ <ThreadListItemPrimitive.Delete>Delete</ThreadListItemPrimitive.Delete>
277
+ ```
278
+
279
+ ### ThreadListItemMorePrimitive
280
+
281
+ #### Root
282
+
283
+ Root container for the overflow menu primitives.
284
+
285
+ ```tsx
286
+ <ThreadListItemMorePrimitive.Root>
287
+ <ThreadListItemMorePrimitive.Trigger>More</ThreadListItemMorePrimitive.Trigger>
288
+ </ThreadListItemMorePrimitive.Root>
289
+ ```
290
+
291
+ #### Trigger
292
+
293
+ Button that opens the overflow menu. Renders a `<button>` element unless `asChild` is set.
294
+
295
+ ```tsx
296
+ <ThreadListItemMorePrimitive.Trigger className="rounded-md p-1 hover:bg-muted">
297
+ More
298
+ </ThreadListItemMorePrimitive.Trigger>
299
+ ```
300
+
301
+ #### Content
302
+
303
+ The dropdown panel. Renders a `<div>` via a portal (positioned relative to the trigger).
304
+
305
+ ```tsx
306
+ <ThreadListItemMorePrimitive.Content className="rounded-md border bg-popover p-1 shadow-md">
307
+ <ThreadListItemPrimitive.Archive asChild>
308
+ <ThreadListItemMorePrimitive.Item>Archive</ThreadListItemMorePrimitive.Item>
309
+ </ThreadListItemPrimitive.Archive>
310
+ </ThreadListItemMorePrimitive.Content>
311
+ ```
312
+
313
+ <PrimitivesTypeTable type="ThreadListItemMorePrimitiveContentProps" parameters={ThreadListItemMorePrimitiveDocs.Content.props} />
314
+
315
+ #### Item
316
+
317
+ Menu item slot inside the overflow menu. Renders a `<div>` element unless `asChild` is set.
318
+
319
+ ```tsx
320
+ <ThreadListItemMorePrimitive.Item>Archive</ThreadListItemMorePrimitive.Item>
321
+ ```
322
+
323
+ #### Separator
324
+
325
+ Visual separator between groups of menu items. Renders a `<div>` element unless `asChild` is set.
326
+
327
+ ```tsx
328
+ <ThreadListItemMorePrimitive.Separator className="my-1 h-px bg-border" />
329
+ ```
330
+
331
+ ## Patterns
332
+
333
+ ### Basic Thread List with New Button
334
+
335
+ ```tsx
336
+ <ThreadListPrimitive.Root className="flex flex-col gap-1">
337
+ <ThreadListPrimitive.New className="flex items-center gap-2 rounded-lg border px-3 py-2 text-sm">
338
+ <PlusIcon className="size-4" /> New Thread
339
+ </ThreadListPrimitive.New>
340
+ <ThreadListPrimitive.Items>
341
+ {() => <ThreadListItem />}
342
+ </ThreadListPrimitive.Items>
343
+ </ThreadListPrimitive.Root>
344
+ ```
345
+
346
+ ### Thread Item with More Menu
347
+
348
+ ```tsx
349
+ function ThreadListItem() {
350
+ return (
351
+ <ThreadListItemPrimitive.Root className="group flex items-center rounded-lg hover:bg-muted data-active:bg-muted">
352
+ <ThreadListItemPrimitive.Trigger className="flex-1 truncate px-3 py-2 text-sm">
353
+ <ThreadListItemPrimitive.Title fallback="New Chat" />
354
+ </ThreadListItemPrimitive.Trigger>
355
+ <ThreadListItemMorePrimitive.Root>
356
+ <ThreadListItemMorePrimitive.Trigger className="opacity-0 group-hover:opacity-100">
357
+ <MoreHorizontalIcon className="size-4" />
358
+ </ThreadListItemMorePrimitive.Trigger>
359
+ <ThreadListItemMorePrimitive.Content>
360
+ <ThreadListItemPrimitive.Archive asChild>
361
+ <ThreadListItemMorePrimitive.Item>Archive</ThreadListItemMorePrimitive.Item>
362
+ </ThreadListItemPrimitive.Archive>
363
+ <ThreadListItemMorePrimitive.Separator />
364
+ <ThreadListItemPrimitive.Delete asChild>
365
+ <ThreadListItemMorePrimitive.Item>Delete</ThreadListItemMorePrimitive.Item>
366
+ </ThreadListItemPrimitive.Delete>
367
+ </ThreadListItemMorePrimitive.Content>
368
+ </ThreadListItemMorePrimitive.Root>
369
+ </ThreadListItemPrimitive.Root>
370
+ );
371
+ }
372
+ ```
373
+
374
+ ### Archived Threads Section
375
+
376
+ ```tsx
377
+ <ThreadListPrimitive.Root>
378
+ <ThreadListPrimitive.New>New Thread</ThreadListPrimitive.New>
379
+
380
+ <h3 className="px-3 pt-4 text-xs font-medium text-muted-foreground">Recent</h3>
381
+ <ThreadListPrimitive.Items>
382
+ {() => <ThreadListItem />}
383
+ </ThreadListPrimitive.Items>
384
+
385
+ <h3 className="px-3 pt-4 text-xs font-medium text-muted-foreground">Archived</h3>
386
+ <ThreadListPrimitive.Items archived>
387
+ {() => <ArchivedItem />}
388
+ </ThreadListPrimitive.Items>
389
+ </ThreadListPrimitive.Root>
390
+ ```
391
+
392
+ In the `ArchivedItem` component, use `ThreadListItemPrimitive.Unarchive` instead of `Archive` to let users restore threads.
393
+
394
+ ## Relationship to Components
395
+
396
+ The shadcn [ThreadList](/docs/ui/thread-list) component wraps these primitives with Tailwind styling in a sidebar layout, including a skeleton loading state and a prebuilt more menu with archive and delete actions. Start there for a default thread list implementation. Reach for the primitives directly when you need a custom layout, different actions, or integration with your own sidebar or navigation system.
397
+
398
+ ## API Reference
399
+
400
+ For full prop details on every part, see the API reference for each namespace:
401
+
402
+ - [ThreadListPrimitive](/docs/api-reference/primitives/thread-list)
403
+ - [ThreadListItemPrimitive](/docs/api-reference/primitives/thread-list-item)
404
+ - [ThreadListItemMorePrimitive](/docs/api-reference/primitives/thread-list-item-more)