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

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 (62) 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-conversational.md +511 -0
  12. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +10 -10
  13. package/.docs/organized/code-examples/with-expo.md +18 -18
  14. package/.docs/organized/code-examples/with-external-store.md +5 -5
  15. package/.docs/organized/code-examples/with-ffmpeg.md +220 -66
  16. package/.docs/organized/code-examples/with-google-adk.md +6 -6
  17. package/.docs/organized/code-examples/with-heat-graph.md +4 -4
  18. package/.docs/organized/code-examples/with-interactables.md +836 -0
  19. package/.docs/organized/code-examples/with-langgraph.md +6 -6
  20. package/.docs/organized/code-examples/with-livekit.md +591 -0
  21. package/.docs/organized/code-examples/with-parent-id-grouping.md +6 -6
  22. package/.docs/organized/code-examples/with-react-hook-form.md +8 -8
  23. package/.docs/organized/code-examples/with-react-ink.md +3 -3
  24. package/.docs/organized/code-examples/with-react-router.md +11 -11
  25. package/.docs/organized/code-examples/with-store.md +11 -6
  26. package/.docs/organized/code-examples/with-tanstack.md +8 -8
  27. package/.docs/organized/code-examples/with-tap-runtime.md +8 -8
  28. package/.docs/raw/blog/2026-03-launch-week/index.mdx +31 -0
  29. package/.docs/raw/docs/(docs)/cli.mdx +60 -0
  30. package/.docs/raw/docs/(docs)/copilots/model-context.mdx +9 -1
  31. package/.docs/raw/docs/(docs)/guides/attachments.mdx +65 -4
  32. package/.docs/raw/docs/(docs)/guides/interactables.mdx +354 -0
  33. package/.docs/raw/docs/(docs)/guides/message-timing.mdx +3 -3
  34. package/.docs/raw/docs/(docs)/guides/multi-agent.mdx +1 -0
  35. package/.docs/raw/docs/(docs)/guides/tool-ui.mdx +29 -0
  36. package/.docs/raw/docs/(docs)/guides/voice.mdx +333 -0
  37. package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +128 -0
  38. package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +23 -0
  39. package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +6 -0
  40. package/.docs/raw/docs/cloud/ai-sdk.mdx +81 -1
  41. package/.docs/raw/docs/ink/primitives.mdx +141 -0
  42. package/.docs/raw/docs/primitives/action-bar.mdx +351 -0
  43. package/.docs/raw/docs/primitives/assistant-modal.mdx +215 -0
  44. package/.docs/raw/docs/primitives/attachment.mdx +216 -0
  45. package/.docs/raw/docs/primitives/branch-picker.mdx +221 -0
  46. package/.docs/raw/docs/primitives/chain-of-thought.mdx +311 -0
  47. package/.docs/raw/docs/primitives/composer.mdx +526 -0
  48. package/.docs/raw/docs/primitives/error.mdx +141 -0
  49. package/.docs/raw/docs/primitives/index.mdx +98 -0
  50. package/.docs/raw/docs/primitives/message.mdx +524 -0
  51. package/.docs/raw/docs/primitives/selection-toolbar.mdx +165 -0
  52. package/.docs/raw/docs/primitives/suggestion.mdx +242 -0
  53. package/.docs/raw/docs/primitives/thread-list.mdx +404 -0
  54. package/.docs/raw/docs/primitives/thread.mdx +482 -0
  55. package/.docs/raw/docs/runtimes/a2a/index.mdx +4 -0
  56. package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +2 -2
  57. package/.docs/raw/docs/runtimes/assistant-transport.mdx +6 -2
  58. package/.docs/raw/docs/ui/context-display.mdx +2 -2
  59. package/.docs/raw/docs/ui/mention.mdx +168 -0
  60. package/.docs/raw/docs/ui/model-selector.mdx +1 -1
  61. package/.docs/raw/docs/ui/voice.mdx +172 -0
  62. package/package.json +3 -4
@@ -0,0 +1,168 @@
1
+ ---
2
+ title: Mention
3
+ description: Let users @-mention tools in the composer with a keyboard-navigable popover picker and inline chips.
4
+ ---
5
+
6
+ ## Getting Started
7
+
8
+ <Steps>
9
+ <Step>
10
+
11
+ ### Add `composer-mention`
12
+
13
+ <InstallCommand shadcn={["composer-mention"]} />
14
+
15
+ This adds a `/components/assistant-ui/composer-mention.tsx` file with `ComposerMentionPopover`, `ComposerMentionRoot`, and `DirectiveText`.
16
+
17
+ </Step>
18
+ <Step>
19
+
20
+ ### Wrap the Composer
21
+
22
+ Wrap your composer with `ComposerMentionPopover.Root` and add `<ComposerMentionPopover />` inside:
23
+
24
+ ```tsx title="components/assistant-ui/thread.tsx" {1,7,10}
25
+ import { ComposerMentionPopover } from "@/components/assistant-ui/composer-mention";
26
+
27
+ const Composer = () => {
28
+ return (
29
+ <ComposerMentionPopover.Root>
30
+ <ComposerPrimitive.Root>
31
+ <ComposerPrimitive.Input placeholder="Type @ to mention a tool..." />
32
+ <ComposerPrimitive.Send />
33
+ <ComposerMentionPopover />
34
+ </ComposerPrimitive.Root>
35
+ </ComposerMentionPopover.Root>
36
+ );
37
+ };
38
+ ```
39
+
40
+ The popover automatically shows registered tools when the user types `@`.
41
+
42
+ </Step>
43
+ <Step>
44
+
45
+ ### Render Mentions in User Messages
46
+
47
+ Use `DirectiveText` as the `Text` component for **user messages** so mention directives render as inline chips instead of raw `:tool[label]` syntax:
48
+
49
+ ```tsx title="components/assistant-ui/thread.tsx" {1,8}
50
+ import { DirectiveText } from "@/components/assistant-ui/composer-mention";
51
+
52
+ const UserMessage = () => {
53
+ return (
54
+ <MessagePrimitive.Root>
55
+ <MessagePrimitive.Parts
56
+ components={{
57
+ Text: DirectiveText,
58
+ }}
59
+ />
60
+ </MessagePrimitive.Root>
61
+ );
62
+ };
63
+ ```
64
+
65
+ <Callout>
66
+ `DirectiveText` renders plain text with mention chips. For assistant messages
67
+ that contain markdown, keep using your markdown renderer (e.g. `MarkdownText`).
68
+ </Callout>
69
+
70
+ </Step>
71
+ </Steps>
72
+
73
+ ## With Lexical Rich Editor
74
+
75
+ For inline mention chips in the composer (not just the popover), use `LexicalComposerInput` from `@assistant-ui/react-lexical`:
76
+
77
+ ```bash
78
+ npm install @assistant-ui/react-lexical lexical @lexical/react
79
+ ```
80
+
81
+ Replace `ComposerPrimitive.Input` with `LexicalComposerInput`:
82
+
83
+ ```tsx title="components/assistant-ui/thread.tsx" {1,8}
84
+ import { LexicalComposerInput } from "@assistant-ui/react-lexical";
85
+
86
+ const Composer = () => {
87
+ return (
88
+ <ComposerMentionPopover.Root>
89
+ <ComposerPrimitive.Root>
90
+ <LexicalComposerInput placeholder="Type @ to mention a tool..." />
91
+ <ComposerPrimitive.Send />
92
+ <ComposerMentionPopover />
93
+ </ComposerPrimitive.Root>
94
+ </ComposerMentionPopover.Root>
95
+ );
96
+ };
97
+ ```
98
+
99
+ `LexicalComposerInput` auto-wires to `MentionContext` — no extra props needed. Selected mentions appear as inline chips that are treated as atomic units (select, delete, undo as a whole).
100
+
101
+ ## Custom Formatter
102
+
103
+ The default directive format is `:type[label]{name=id}`. To use a custom format, pass a `formatter` to both the mention root and the message renderer:
104
+
105
+ ```tsx
106
+ import { ComposerMentionPopover } from "@/components/assistant-ui/composer-mention";
107
+ import { createDirectiveText } from "@/components/assistant-ui/composer-mention";
108
+
109
+ const myFormatter = {
110
+ serialize: (item) => `@${item.id}`,
111
+ parse: (text) => [{ kind: "text", text }], // implement your parsing
112
+ };
113
+
114
+ // In composer (textarea path):
115
+ <ComposerMentionPopover.Root formatter={myFormatter}>
116
+ ...
117
+ </ComposerMentionPopover.Root>
118
+
119
+ // In composer (Lexical path — also pass formatter):
120
+ <ComposerMentionPopover.Root formatter={myFormatter}>
121
+ <ComposerPrimitive.Root>
122
+ <LexicalComposerInput formatter={myFormatter} />
123
+ ...
124
+ </ComposerPrimitive.Root>
125
+ </ComposerMentionPopover.Root>
126
+
127
+ // In user messages:
128
+ const MyDirectiveText = createDirectiveText(myFormatter);
129
+ <MessagePrimitive.Parts components={{ Text: MyDirectiveText }} />
130
+ ```
131
+
132
+ ## Keyboard Navigation
133
+
134
+ The mention popover supports full keyboard navigation out of the box:
135
+
136
+ | Key | Action |
137
+ | --- | --- |
138
+ | <Kbd>ArrowDown</Kbd> | Highlight next item |
139
+ | <Kbd>ArrowUp</Kbd> | Highlight previous item |
140
+ | <Kbd>Enter</Kbd> | Select highlighted item / drill into category |
141
+ | <Kbd>Escape</Kbd> | Close popover |
142
+ | <Kbd>Backspace</Kbd> | Go back to categories (when query is empty) |
143
+
144
+ ## Components
145
+
146
+ ### `ComposerMentionPopover.Root`
147
+
148
+ Wraps the composer with mention context and a tool mention adapter. Provides the `@`-trigger detection, keyboard navigation, and popover state.
149
+
150
+ | Prop | Type | Default | Description |
151
+ | --- | --- | --- | --- |
152
+ | `adapter` | `Unstable_MentionAdapter` | Tool adapter | Custom mention adapter |
153
+ | `trigger` | `string` | `"@"` | Character(s) that open the popover |
154
+ | `formatter` | `Unstable_DirectiveFormatter` | Default | Custom directive serializer/parser |
155
+ | `formatLabel` | `(name: string) => string` | Title case | Format tool names for display |
156
+ | `categoryLabel` | `string` | `"Tools"` | Label for the tools category |
157
+
158
+ ### `ComposerMentionPopover`
159
+
160
+ Pre-built popover containing categories and items lists. Only renders when the `@` trigger is active.
161
+
162
+ ### `DirectiveText`
163
+
164
+ A `TextMessagePartComponent` that parses `:type[label]{name=id}` directives and renders them as styled inline chips.
165
+
166
+ ### `createDirectiveText(formatter)`
167
+
168
+ Factory function that creates a `TextMessagePartComponent` using a custom `Unstable_DirectiveFormatter`.
@@ -50,7 +50,7 @@ const ComposerAction: FC = () => {
50
50
 
51
51
  ### Read the model in your API route
52
52
 
53
- The selected model name is sent as `config.modelName` in the request body:
53
+ The selected model's `id` is sent as `config.modelName` in the request body:
54
54
 
55
55
  ```tsx title="app/api/chat/route.ts" {2,5}
56
56
  export async function POST(req: Request) {
@@ -0,0 +1,172 @@
1
+ ---
2
+ title: Voice
3
+ description: Realtime voice session controls with connect, mute, and status indicator.
4
+ ---
5
+
6
+ import { VoiceSample, VoiceVariantsSample, VoiceStatesSample } from "@/components/docs/samples/voice";
7
+
8
+ A control bar for realtime bidirectional voice sessions with an animated orb indicator. Works with any `RealtimeVoiceAdapter` (LiveKit, ElevenLabs, etc.).
9
+
10
+ <VoiceSample />
11
+
12
+ ## Getting Started
13
+
14
+ <Steps>
15
+ <Step>
16
+
17
+ ### Add the component
18
+
19
+ <InstallCommand shadcn={["voice"]} />
20
+
21
+ This adds `/components/assistant-ui/voice.tsx` to your project, which you can adjust as needed.
22
+
23
+ </Step>
24
+ <Step>
25
+
26
+ ### Configure a voice adapter
27
+
28
+ Pass a `RealtimeVoiceAdapter` to your runtime. See the [Realtime Voice guide](/docs/guides/voice) for details.
29
+
30
+ ```tsx
31
+ const runtime = useChatRuntime({
32
+ adapters: {
33
+ voice: myVoiceAdapter,
34
+ },
35
+ });
36
+ ```
37
+
38
+ </Step>
39
+ <Step>
40
+
41
+ ### Use in your application
42
+
43
+ ```tsx title="app/page.tsx"
44
+ import { Thread } from "@/components/assistant-ui/thread";
45
+ import { VoiceControl } from "@/components/assistant-ui/voice";
46
+ import { AuiIf } from "@assistant-ui/react";
47
+
48
+ export default function Chat() {
49
+ return (
50
+ <div className="flex h-full flex-col">
51
+ <AuiIf condition={(s) => s.thread.capabilities.voice}>
52
+ <VoiceControl />
53
+ </AuiIf>
54
+ <div className="min-h-0 flex-1">
55
+ <Thread />
56
+ </div>
57
+ </div>
58
+ );
59
+ }
60
+ ```
61
+
62
+ </Step>
63
+ </Steps>
64
+
65
+ ## Anatomy
66
+
67
+ The `VoiceControl` component is built with the following hooks and conditionals:
68
+
69
+ ```tsx
70
+ import { AuiIf, useVoiceState, useVoiceControls } from "@assistant-ui/react";
71
+
72
+ <div className="aui-voice-control">
73
+ <VoiceIndicator />
74
+
75
+ <AuiIf condition={(s) => s.thread.voice == null}>
76
+ <VoiceConnectButton />
77
+ </AuiIf>
78
+
79
+ <AuiIf condition={(s) => s.thread.voice?.status.type === "running"}>
80
+ <VoiceMuteButton />
81
+ <VoiceDisconnectButton />
82
+ </AuiIf>
83
+ </div>
84
+ ```
85
+
86
+ ## Examples
87
+
88
+ ### Conditionally show voice controls
89
+
90
+ Only render when a voice adapter is configured:
91
+
92
+ ```tsx
93
+ <AuiIf condition={(s) => s.thread.capabilities.voice}>
94
+ <VoiceControl />
95
+ </AuiIf>
96
+ ```
97
+
98
+ ### Voice toggle in composer
99
+
100
+ Add a compact voice toggle button inside the composer action area:
101
+
102
+ ```tsx
103
+ function ComposerVoiceToggle() {
104
+ const voiceState = useVoiceState();
105
+ const { connect, disconnect } = useVoiceControls();
106
+ const isActive =
107
+ voiceState?.status.type === "running" ||
108
+ voiceState?.status.type === "starting";
109
+
110
+ return (
111
+ <AuiIf condition={(s) => s.thread.capabilities.voice}>
112
+ <button
113
+ type="button"
114
+ onClick={() => (isActive ? disconnect() : connect())}
115
+ aria-label={isActive ? "End voice" : "Start voice"}
116
+ >
117
+ {isActive ? <PhoneOffIcon /> : <PhoneIcon />}
118
+ </button>
119
+ </AuiIf>
120
+ );
121
+ }
122
+ ```
123
+
124
+ ### Custom indicator colors
125
+
126
+ Override the indicator styles by targeting the `aui-voice-indicator` class:
127
+
128
+ ```css
129
+ .aui-voice-indicator {
130
+ /* Override active color */
131
+ &.bg-green-500 {
132
+ background: theme("colors.blue.500");
133
+ }
134
+ }
135
+ ```
136
+
137
+ ## States
138
+
139
+ The `VoiceOrb` responds to five voice session states with distinct animations:
140
+
141
+ <VoiceStatesSample />
142
+
143
+ ## Variants
144
+
145
+ Four built-in color palettes. Size is controlled via `className`.
146
+
147
+ <VoiceVariantsSample />
148
+
149
+ ## Sub-components
150
+
151
+ | Component | Description |
152
+ |-----------|-------------|
153
+ | `VoiceOrb` | Animated orb visual with gradient, glow, and ripple effects. Accepts `state` and `variant` props. |
154
+ | `VoiceControl` | Control bar with status dot, connect/disconnect, and mute/unmute buttons. |
155
+ | `VoiceConnectButton` | Calls `connect()`. Shown when no session is active. |
156
+ | `VoiceMuteButton` | Toggles `mute()`/`unmute()`. Shown when session is running. |
157
+ | `VoiceDisconnectButton` | Calls `disconnect()`. Shown when session is active. |
158
+
159
+ All sub-components are exported and can be used independently for custom layouts.
160
+
161
+ ## State Selectors
162
+
163
+ Use these with `AuiIf` or `useAuiState` to build custom voice UI:
164
+
165
+ | Selector | Type | Description |
166
+ |----------|------|-------------|
167
+ | `s.thread.capabilities.voice` | `boolean` | Whether a voice adapter is configured |
168
+ | `s.thread.voice` | `VoiceSessionState \| undefined` | `undefined` when no session |
169
+ | `s.thread.voice?.status.type` | `"starting" \| "running" \| "ended"` | Session phase |
170
+ | `s.thread.voice?.isMuted` | `boolean` | Microphone muted state |
171
+ | `s.thread.voice?.mode` | `"listening" \| "speaking"` | Who is currently active (user or agent) |
172
+ | `useVoiceVolume()` | `number` | Real-time audio level (0–1), separate from main state to avoid 20Hz re-renders |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/mcp-docs-server",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "MCP server for assistant-ui documentation and examples",
5
5
  "keywords": [
6
6
  "mcp",
@@ -15,7 +15,6 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
18
- "aui-source": "./src/index.ts",
19
18
  "types": "./dist/index.d.ts",
20
19
  "default": "./dist/index.js"
21
20
  }
@@ -33,14 +32,14 @@
33
32
  ],
34
33
  "sideEffects": false,
35
34
  "dependencies": {
36
- "@modelcontextprotocol/sdk": "^1.27.1",
35
+ "@modelcontextprotocol/sdk": "^1.29.0",
37
36
  "gray-matter": "^4.0.3",
38
37
  "zod": "^4.3.6"
39
38
  },
40
39
  "devDependencies": {
41
40
  "@types/node": "^25.5.0",
42
41
  "tsx": "^4.21.0",
43
- "vitest": "^4.1.0",
42
+ "vitest": "^4.1.2",
44
43
  "@assistant-ui/x-buildutils": "0.0.3"
45
44
  },
46
45
  "publishConfig": {