@assistant-ui/mcp-docs-server 0.1.39 → 0.2.1

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 (185) hide show
  1. package/.docs/organized/code-examples/waterfall.md +17 -18
  2. package/.docs/organized/code-examples/with-a2a.md +20 -15
  3. package/.docs/organized/code-examples/with-ag-ui.md +19 -17
  4. package/.docs/organized/code-examples/with-ai-sdk-v7.md +17 -16
  5. package/.docs/organized/code-examples/with-artifacts.md +471 -145
  6. package/.docs/organized/code-examples/with-assistant-transport.md +23 -31
  7. package/.docs/organized/code-examples/with-browser-extension.md +21 -14
  8. package/.docs/organized/code-examples/with-chain-of-thought.md +22 -20
  9. package/.docs/organized/code-examples/with-cloud-standalone.md +13 -14
  10. package/.docs/organized/code-examples/with-cloud.md +22 -17
  11. package/.docs/organized/code-examples/with-custom-thread-list.md +17 -16
  12. package/.docs/organized/code-examples/with-elevenlabs-conversational.md +17 -17
  13. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +21 -19
  14. package/.docs/organized/code-examples/with-eve.md +70 -16
  15. package/.docs/organized/code-examples/with-expo.md +32 -51
  16. package/.docs/organized/code-examples/with-external-store.md +20 -15
  17. package/.docs/organized/code-examples/with-ffmpeg.md +24 -18
  18. package/.docs/organized/code-examples/with-generative-ui.md +20 -21
  19. package/.docs/organized/code-examples/with-google-adk.md +21 -16
  20. package/.docs/organized/code-examples/with-heat-graph.md +10 -11
  21. package/.docs/organized/code-examples/with-image-generation.md +13 -14
  22. package/.docs/organized/code-examples/with-interactables.md +17 -16
  23. package/.docs/organized/code-examples/with-langchain.md +13 -14
  24. package/.docs/organized/code-examples/with-langgraph.md +23 -17
  25. package/.docs/organized/code-examples/with-livekit.md +17 -17
  26. package/.docs/organized/code-examples/with-mcp.md +36 -32
  27. package/.docs/organized/code-examples/with-nuxt.md +2492 -0
  28. package/.docs/organized/code-examples/with-opencode.md +27 -21
  29. package/.docs/organized/code-examples/with-pi.md +69 -67
  30. package/.docs/organized/code-examples/with-react-hook-form.md +18 -17
  31. package/.docs/organized/code-examples/with-react-ink-web.md +10 -11
  32. package/.docs/organized/code-examples/with-react-ink.md +7 -7
  33. package/.docs/organized/code-examples/with-react-router.md +23 -17
  34. package/.docs/organized/code-examples/with-resumable-stream.md +15 -16
  35. package/.docs/organized/code-examples/with-store.md +31 -20
  36. package/.docs/organized/code-examples/with-tanstack.md +22 -16
  37. package/.docs/organized/code-examples/with-tap-runtime.md +19 -19
  38. package/.docs/organized/code-examples/with-virtualized-thread.md +12 -13
  39. package/.docs/organized/code-examples/with-vue.md +408 -0
  40. package/.docs/raw/docs/(docs)/cli.mdx +3 -1
  41. package/.docs/raw/docs/(docs)/devtools.mdx +7 -2
  42. package/.docs/raw/docs/(docs)/index.mdx +9 -76
  43. package/.docs/raw/docs/(docs)/installation.mdx +4 -18
  44. package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +24 -4
  45. package/.docs/raw/docs/(reference)/api-reference/generative-ui/a2ui.mdx +40 -0
  46. package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +3 -0
  47. package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +19 -420
  48. package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +4 -1
  49. package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +8 -0
  50. package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +21 -0
  51. package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +1 -9
  52. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +1 -18
  53. package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +24 -1
  54. package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +1 -1
  55. package/.docs/raw/docs/cloud/ai-sdk.mdx +2 -2
  56. package/.docs/raw/docs/cloud/langgraph.mdx +1 -1
  57. package/.docs/raw/docs/copilots/model-context.mdx +5 -4
  58. package/.docs/raw/docs/copilots/motivation.mdx +5 -5
  59. package/.docs/raw/docs/guides/attachments.mdx +3 -3
  60. package/.docs/raw/docs/guides/branching.mdx +2 -2
  61. package/.docs/raw/docs/guides/chain-of-thought.mdx +1 -1
  62. package/.docs/raw/docs/guides/context-api.mdx +89 -111
  63. package/.docs/raw/docs/guides/editing.mdx +5 -5
  64. package/.docs/raw/docs/guides/electron.mdx +369 -0
  65. package/.docs/raw/docs/guides/index.mdx +10 -0
  66. package/.docs/raw/docs/guides/quoting.mdx +3 -3
  67. package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +2 -2
  68. package/.docs/raw/docs/guides/resumable-streams.mdx +74 -3
  69. package/.docs/raw/docs/guides/suggestions.mdx +9 -9
  70. package/.docs/raw/docs/ink/hooks.mdx +12 -7
  71. package/.docs/raw/docs/ink/primitives.mdx +18 -10
  72. package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +16 -0
  73. package/.docs/raw/docs/integrations/auth/better-auth.mdx +3 -3
  74. package/.docs/raw/docs/integrations/auth/clerk.mdx +3 -3
  75. package/.docs/raw/docs/integrations/auth/next-auth.mdx +4 -4
  76. package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +1 -1
  77. package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +2 -2
  78. package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
  79. package/.docs/raw/docs/integrations/gateways/index.mdx +2 -2
  80. package/.docs/raw/docs/integrations/observability/helicone.mdx +2 -2
  81. package/.docs/raw/docs/integrations/observability/langfuse.mdx +1 -1
  82. package/.docs/raw/docs/integrations/observability/langsmith.mdx +3 -3
  83. package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +36 -9
  84. package/.docs/raw/docs/migrations/toolkit-tools.mdx +15 -13
  85. package/.docs/raw/docs/migrations/v0-15.mdx +236 -0
  86. package/.docs/raw/docs/primitives/attachment.mdx +2 -2
  87. package/.docs/raw/docs/primitives/composer.mdx +3 -3
  88. package/.docs/raw/docs/primitives/message.mdx +33 -1
  89. package/.docs/raw/docs/primitives/suggestion.mdx +1 -1
  90. package/.docs/raw/docs/primitives/thread-list.mdx +2 -2
  91. package/.docs/raw/docs/react-native/hooks.mdx +17 -7
  92. package/.docs/raw/docs/react-native/index.mdx +3 -3
  93. package/.docs/raw/docs/react-native/primitives.mdx +41 -7
  94. package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +3 -3
  95. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +5 -5
  96. package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +5 -5
  97. package/.docs/raw/docs/runtimes/ai-sdk/v6-legacy.mdx +13 -14
  98. package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +11 -12
  99. package/.docs/raw/docs/runtimes/concepts/threads.mdx +50 -11
  100. package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +20 -2
  101. package/.docs/raw/docs/runtimes/custom/external-store.mdx +31 -2
  102. package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +39 -12
  103. package/.docs/raw/docs/runtimes/eve/overview.mdx +51 -0
  104. package/.docs/raw/docs/runtimes/eve/quickstart.mdx +51 -2
  105. package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +9 -12
  106. package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
  107. package/.docs/raw/docs/runtimes/langgraph/overview.mdx +1 -1
  108. package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +1 -1
  109. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +7 -7
  110. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +4 -4
  111. package/.docs/raw/docs/runtimes/opencode/hooks.mdx +4 -1
  112. package/.docs/raw/docs/runtimes/opencode/overview.mdx +10 -0
  113. package/.docs/raw/docs/tools/a2ui.mdx +107 -0
  114. package/.docs/raw/docs/tools/backend.mdx +2 -2
  115. package/.docs/raw/docs/tools/defining-tools.mdx +9 -7
  116. package/.docs/raw/docs/tools/dynamic-tools.mdx +6 -4
  117. package/.docs/raw/docs/tools/interactables-legacy.mdx +28 -15
  118. package/.docs/raw/docs/tools/interactables.mdx +27 -16
  119. package/.docs/raw/docs/tools/mcp-apps.mdx +96 -8
  120. package/.docs/raw/docs/tools/mcp.mdx +9 -7
  121. package/.docs/raw/docs/tools/tool-ui.mdx +26 -22
  122. package/.docs/raw/docs/tools/user-managed-mcp.mdx +64 -14
  123. package/.docs/raw/docs/ui/file.mdx +6 -1
  124. package/.docs/raw/docs/ui/follow-up-suggestions.mdx +2 -0
  125. package/.docs/raw/docs/ui/mcp-config.mdx +8 -3
  126. package/.docs/raw/docs/ui/model-selector.mdx +9 -9
  127. package/.docs/raw/docs/ui/part-grouping.mdx +1 -5
  128. package/.docs/raw/docs/ui/reasoning.mdx +1 -1
  129. package/.docs/raw/docs/ui/thread.mdx +24 -5
  130. package/.docs/raw/docs/utilities/react-o11y.mdx +7 -9
  131. package/dist/constants.js +2 -2
  132. package/dist/constants.js.map +1 -1
  133. package/dist/index.d.ts +1 -1
  134. package/dist/index.js +2 -2
  135. package/dist/index.js.map +1 -1
  136. package/dist/prepare-docs/code-examples.js.map +1 -1
  137. package/dist/prepare-docs/prepare.d.ts +1 -1
  138. package/dist/prepare-docs/prepare.js.map +1 -1
  139. package/dist/stdio.d.ts +1 -1
  140. package/dist/tools/docs.d.ts +6 -10
  141. package/dist/tools/docs.d.ts.map +1 -1
  142. package/dist/tools/docs.js +6 -4
  143. package/dist/tools/docs.js.map +1 -1
  144. package/dist/tools/examples.d.ts +4 -8
  145. package/dist/tools/examples.d.ts.map +1 -1
  146. package/dist/tools/examples.js +4 -3
  147. package/dist/tools/examples.js.map +1 -1
  148. package/dist/tools/resources.d.ts +1 -1
  149. package/dist/tools/resources.d.ts.map +1 -1
  150. package/dist/tools/resources.js +3 -2
  151. package/dist/tools/resources.js.map +1 -1
  152. package/dist/tools/search.d.ts +4 -10
  153. package/dist/tools/search.d.ts.map +1 -1
  154. package/dist/tools/search.js +2 -2
  155. package/dist/tools/search.js.map +1 -1
  156. package/dist/tools/tests/mcp-test-client.d.ts +15 -0
  157. package/dist/tools/tests/mcp-test-client.d.ts.map +1 -0
  158. package/dist/tools/tests/mcp-test-client.js +68 -0
  159. package/dist/tools/tests/mcp-test-client.js.map +1 -0
  160. package/dist/tools/tests/test-setup.d.ts.map +1 -1
  161. package/dist/tools/tests/test-setup.js +2 -1
  162. package/dist/tools/tests/test-setup.js.map +1 -1
  163. package/dist/tools/xulux-templates.d.ts +9 -23
  164. package/dist/tools/xulux-templates.d.ts.map +1 -1
  165. package/dist/tools/xulux-templates.js +8 -6
  166. package/dist/tools/xulux-templates.js.map +1 -1
  167. package/dist/utils/logger.d.ts.map +1 -1
  168. package/dist/utils/mdx.js +2 -1
  169. package/dist/utils/mdx.js.map +1 -1
  170. package/dist/utils/security.js.map +1 -1
  171. package/dist/xulux/catalog-client.js +1 -1
  172. package/dist/xulux/catalog-client.js.map +1 -1
  173. package/package.json +6 -5
  174. package/src/index.ts +2 -2
  175. package/src/tools/docs.ts +2 -2
  176. package/src/tools/examples.ts +2 -2
  177. package/src/tools/resources.ts +1 -4
  178. package/src/tools/search.ts +2 -2
  179. package/src/tools/tests/completions.test.ts +40 -26
  180. package/src/tools/tests/docs.test.ts +2 -2
  181. package/src/tools/tests/integration.test.ts +3 -4
  182. package/src/tools/tests/mcp-protocol.test.ts +160 -175
  183. package/src/tools/tests/mcp-test-client.ts +111 -0
  184. package/src/tools/tests/resources.test.ts +97 -66
  185. package/src/tools/xulux-templates.ts +4 -4
@@ -0,0 +1,408 @@
1
+ # Example: with-vue
2
+
3
+ ## package.json
4
+
5
+ ```json
6
+ {
7
+ "name": "with-vue",
8
+ "version": "0.0.0",
9
+ "private": true,
10
+ "type": "module",
11
+ "scripts": {
12
+ "dev": "vite dev --port 3000",
13
+ "build": "vite build",
14
+ "serve": "vite preview"
15
+ },
16
+ "dependencies": {
17
+ "@assistant-ui/core": "workspace:*",
18
+ "@assistant-ui/store": "workspace:*",
19
+ "@assistant-ui/tap": "workspace:*",
20
+ "@assistant-ui/vue": "workspace:*",
21
+ "@lucide/vue": "^1.29.0",
22
+ "vue": "^3.5.41"
23
+ },
24
+ "devDependencies": {
25
+ "@tailwindcss/vite": "^4.3.3",
26
+ "@types/react": "^19.2.18",
27
+ "@vitejs/plugin-vue": "^6.0.8",
28
+ "tailwindcss": "^4.3.3",
29
+ "typescript": "^7.0.2",
30
+ "vite": "^8.2.1"
31
+ }
32
+ }
33
+
34
+ ```
35
+
36
+ ## src/env.d.ts
37
+
38
+ ```typescript
39
+ declare module "*.vue" {
40
+ import type { DefineComponent } from "vue";
41
+ const component: DefineComponent<
42
+ Record<string, never>,
43
+ Record<string, never>,
44
+ unknown
45
+ >;
46
+ export default component;
47
+ }
48
+
49
+ ```
50
+
51
+ ## src/main.ts
52
+
53
+ ```typescript
54
+ import { createApp } from "vue";
55
+ import "./styles.css";
56
+ import Root from "./Root.vue";
57
+
58
+ createApp(Root).mount("#app");
59
+
60
+ ```
61
+
62
+ ## src/runtime.ts
63
+
64
+ ```typescript
65
+ import type { AppendMessage, ExternalStoreAdapter } from "@assistant-ui/core";
66
+ import {
67
+ AssistantRuntimeImpl,
68
+ ExternalStoreRuntimeCore,
69
+ } from "@assistant-ui/core/internal";
70
+
71
+ export type EchoMessage = {
72
+ id: string;
73
+ role: "user" | "assistant";
74
+ text: string;
75
+ };
76
+
77
+ type EchoThread = {
78
+ id: string;
79
+ title: string;
80
+ messages: EchoMessage[];
81
+ };
82
+
83
+ let nextId = 0;
84
+ const freshId = (prefix: string) => `${prefix}-${nextId++}`;
85
+
86
+ const messageText = (message: AppendMessage) =>
87
+ message.content
88
+ .map((part) => (part.type === "text" ? part.text : ""))
89
+ .join("");
90
+
91
+ const convertEchoMessage = (message: EchoMessage) => ({
92
+ id: message.id,
93
+ role: message.role,
94
+ content: [{ type: "text" as const, text: message.text }],
95
+ });
96
+
97
+ export const createEchoRuntime = () => {
98
+ let threads: EchoThread[] = [
99
+ { id: freshId("thread"), title: "", messages: [] },
100
+ ];
101
+ let currentId = threads[0]!.id;
102
+ let isRunning = false;
103
+ let replyTimer: ReturnType<typeof setTimeout> | undefined;
104
+
105
+ const current = () => threads.find((thread) => thread.id === currentId)!;
106
+ const updateCurrent = (updater: (thread: EchoThread) => EchoThread) => {
107
+ threads = threads.map((thread) =>
108
+ thread.id === currentId ? updater(thread) : thread,
109
+ );
110
+ };
111
+
112
+ const reply = (text: string) => {
113
+ const replyTo = currentId;
114
+ isRunning = true;
115
+ sync();
116
+ replyTimer = setTimeout(() => {
117
+ if (currentId !== replyTo) return;
118
+ updateCurrent((thread) => ({
119
+ ...thread,
120
+ messages: [
121
+ ...thread.messages,
122
+ {
123
+ id: freshId("assistant"),
124
+ role: "assistant",
125
+ text: `Echo: ${text}`,
126
+ },
127
+ ],
128
+ }));
129
+ isRunning = false;
130
+ sync();
131
+ }, 600);
132
+ };
133
+
134
+ const appendUser = (text: string) => {
135
+ updateCurrent((thread) => ({
136
+ ...thread,
137
+ title: thread.title || text.slice(0, 40),
138
+ messages: [
139
+ ...thread.messages,
140
+ { id: freshId("user"), role: "user", text },
141
+ ],
142
+ }));
143
+ };
144
+
145
+ const makeAdapter = (): ExternalStoreAdapter<EchoMessage> => ({
146
+ messages: current().messages,
147
+ isRunning,
148
+ convertMessage: convertEchoMessage,
149
+ setMessages: (next) => {
150
+ updateCurrent((thread) => ({ ...thread, messages: next }));
151
+ sync();
152
+ },
153
+ onNew: async (message) => {
154
+ const text = messageText(message);
155
+ appendUser(text);
156
+ reply(text);
157
+ },
158
+ onEdit: async (message) => {
159
+ const text = messageText(message);
160
+ const parentIndex = message.parentId
161
+ ? current().messages.findIndex(
162
+ (entry) => entry.id === message.parentId,
163
+ ) + 1
164
+ : 0;
165
+ updateCurrent((thread) => ({
166
+ ...thread,
167
+ messages: thread.messages.slice(0, parentIndex),
168
+ }));
169
+ appendUser(text);
170
+ reply(text);
171
+ },
172
+ onReload: async (parentId) => {
173
+ let parentIndex = 0;
174
+ if (parentId) {
175
+ const index = current().messages.findIndex(
176
+ (entry) => entry.id === parentId,
177
+ );
178
+ if (index === -1) return;
179
+ parentIndex = index + 1;
180
+ }
181
+ const sliced = current().messages.slice(0, parentIndex);
182
+ const lastUser = [...sliced]
183
+ .reverse()
184
+ .find((entry) => entry.role === "user");
185
+ updateCurrent((thread) => ({ ...thread, messages: sliced }));
186
+ reply(`${lastUser?.text ?? ""} (again)`);
187
+ },
188
+ onCancel: async () => {
189
+ clearTimeout(replyTimer);
190
+ if (isRunning && current().messages.at(-1)?.role === "user") {
191
+ updateCurrent((thread) => ({
192
+ ...thread,
193
+ messages: thread.messages.slice(0, -1),
194
+ }));
195
+ }
196
+ isRunning = false;
197
+ // cancelRun restores the trailing user message into the composer
198
+ // synchronously after onCancel returns; an eager sync would delete it
199
+ // before that restore reads it.
200
+ queueMicrotask(sync);
201
+ },
202
+ adapters: {
203
+ threadList: {
204
+ threadId: currentId,
205
+ threads: threads.map((thread) => ({
206
+ status: "regular" as const,
207
+ id: thread.id,
208
+ title: thread.title,
209
+ })),
210
+ onSwitchToThread: (threadId) => {
211
+ clearTimeout(replyTimer);
212
+ isRunning = false;
213
+ currentId = threadId;
214
+ sync();
215
+ },
216
+ onSwitchToNewThread: () => {
217
+ clearTimeout(replyTimer);
218
+ isRunning = false;
219
+ const id = freshId("thread");
220
+ threads = [...threads, { id, title: "", messages: [] }];
221
+ currentId = id;
222
+ sync();
223
+ },
224
+ },
225
+ },
226
+ });
227
+
228
+ const core = new ExternalStoreRuntimeCore(makeAdapter());
229
+ const sync = () => core.setAdapter(makeAdapter());
230
+ return new AssistantRuntimeImpl(core);
231
+ };
232
+
233
+ ```
234
+
235
+ ## src/styles.css
236
+
237
+ ```css
238
+ @import "tailwindcss";
239
+
240
+ @custom-variant dark (&:is(.dark *));
241
+
242
+ @theme inline {
243
+ --radius-sm: calc(var(--radius) - 4px);
244
+ --radius-md: calc(var(--radius) - 2px);
245
+ --radius-lg: var(--radius);
246
+ --radius-xl: calc(var(--radius) + 4px);
247
+ --color-background: var(--background);
248
+ --color-foreground: var(--foreground);
249
+ --color-card: var(--card);
250
+ --color-card-foreground: var(--card-foreground);
251
+ --color-popover: var(--popover);
252
+ --color-popover-foreground: var(--popover-foreground);
253
+ --color-primary: var(--primary);
254
+ --color-primary-foreground: var(--primary-foreground);
255
+ --color-secondary: var(--secondary);
256
+ --color-secondary-foreground: var(--secondary-foreground);
257
+ --color-muted: var(--muted);
258
+ --color-muted-foreground: var(--muted-foreground);
259
+ --color-accent: var(--accent);
260
+ --color-accent-foreground: var(--accent-foreground);
261
+ --color-destructive: var(--destructive);
262
+ --color-border: var(--border);
263
+ --color-input: var(--input);
264
+ --color-ring: var(--ring);
265
+ --color-chart-1: var(--chart-1);
266
+ --color-chart-2: var(--chart-2);
267
+ --color-chart-3: var(--chart-3);
268
+ --color-chart-4: var(--chart-4);
269
+ --color-chart-5: var(--chart-5);
270
+ --color-sidebar: var(--sidebar);
271
+ --color-sidebar-foreground: var(--sidebar-foreground);
272
+ --color-sidebar-primary: var(--sidebar-primary);
273
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
274
+ --color-sidebar-accent: var(--sidebar-accent);
275
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
276
+ --color-sidebar-border: var(--sidebar-border);
277
+ --color-sidebar-ring: var(--sidebar-ring);
278
+ }
279
+
280
+ :root {
281
+ --radius: 0.625rem;
282
+ --background: oklch(1 0 0);
283
+ --foreground: oklch(0.141 0.005 285.823);
284
+ --card: oklch(1 0 0);
285
+ --card-foreground: oklch(0.141 0.005 285.823);
286
+ --popover: oklch(1 0 0);
287
+ --popover-foreground: oklch(0.141 0.005 285.823);
288
+ --primary: oklch(0.21 0.006 285.885);
289
+ --primary-foreground: oklch(0.985 0 0);
290
+ --secondary: oklch(0.967 0.001 286.375);
291
+ --secondary-foreground: oklch(0.21 0.006 285.885);
292
+ --muted: oklch(0.967 0.001 286.375);
293
+ --muted-foreground: oklch(0.552 0.016 285.938);
294
+ --accent: oklch(0.967 0.001 286.375);
295
+ --accent-foreground: oklch(0.21 0.006 285.885);
296
+ --destructive: oklch(0.577 0.245 27.325);
297
+ --border: oklch(0.92 0.004 286.32);
298
+ --input: oklch(0.92 0.004 286.32);
299
+ --ring: oklch(0.705 0.015 286.067);
300
+ --chart-1: oklch(0.646 0.222 41.116);
301
+ --chart-2: oklch(0.6 0.118 184.704);
302
+ --chart-3: oklch(0.398 0.07 227.392);
303
+ --chart-4: oklch(0.828 0.189 84.429);
304
+ --chart-5: oklch(0.769 0.188 70.08);
305
+ --sidebar: oklch(0.985 0 0);
306
+ --sidebar-foreground: oklch(0.141 0.005 285.823);
307
+ --sidebar-primary: oklch(0.21 0.006 285.885);
308
+ --sidebar-primary-foreground: oklch(0.985 0 0);
309
+ --sidebar-accent: oklch(0.967 0.001 286.375);
310
+ --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
311
+ --sidebar-border: oklch(0.92 0.004 286.32);
312
+ --sidebar-ring: oklch(0.705 0.015 286.067);
313
+ }
314
+
315
+ .dark {
316
+ --background: oklch(0.141 0.005 285.823);
317
+ --foreground: oklch(0.985 0 0);
318
+ --card: oklch(0.21 0.006 285.885);
319
+ --card-foreground: oklch(0.985 0 0);
320
+ --popover: oklch(0.21 0.006 285.885);
321
+ --popover-foreground: oklch(0.985 0 0);
322
+ --primary: oklch(0.92 0.004 286.32);
323
+ --primary-foreground: oklch(0.21 0.006 285.885);
324
+ --secondary: oklch(0.274 0.006 286.033);
325
+ --secondary-foreground: oklch(0.985 0 0);
326
+ --muted: oklch(0.274 0.006 286.033);
327
+ --muted-foreground: oklch(0.705 0.015 286.067);
328
+ --accent: oklch(0.274 0.006 286.033);
329
+ --accent-foreground: oklch(0.985 0 0);
330
+ --destructive: oklch(0.704 0.191 22.216);
331
+ --border: oklch(1 0 0 / 10%);
332
+ --input: oklch(1 0 0 / 15%);
333
+ --ring: oklch(0.552 0.016 285.938);
334
+ --chart-1: oklch(0.488 0.243 264.376);
335
+ --chart-2: oklch(0.696 0.17 162.48);
336
+ --chart-3: oklch(0.769 0.188 70.08);
337
+ --chart-4: oklch(0.627 0.265 303.9);
338
+ --chart-5: oklch(0.645 0.246 16.439);
339
+ --sidebar: oklch(0.21 0.006 285.885);
340
+ --sidebar-foreground: oklch(0.985 0 0);
341
+ --sidebar-primary: oklch(0.488 0.243 264.376);
342
+ --sidebar-primary-foreground: oklch(0.985 0 0);
343
+ --sidebar-accent: oklch(0.274 0.006 286.033);
344
+ --sidebar-accent-foreground: oklch(0.985 0 0);
345
+ --sidebar-border: oklch(1 0 0 / 10%);
346
+ --sidebar-ring: oklch(0.552 0.016 285.938);
347
+ }
348
+
349
+ @layer base {
350
+ * {
351
+ @apply border-border outline-ring/50;
352
+ }
353
+ body {
354
+ @apply bg-background text-foreground;
355
+ }
356
+ }
357
+
358
+ html,
359
+ body,
360
+ #app {
361
+ height: 100%;
362
+ }
363
+
364
+ ```
365
+
366
+ ## tsconfig.json
367
+
368
+ ```json
369
+ {
370
+ "compilerOptions": {
371
+ "target": "ES2022",
372
+ "module": "ESNext",
373
+ "moduleResolution": "bundler",
374
+ "strict": true,
375
+ "noEmit": true,
376
+ "skipLibCheck": true,
377
+ "types": ["vite/client"]
378
+ },
379
+ "include": ["src", "vite.config.ts"]
380
+ }
381
+
382
+ ```
383
+
384
+ ## vite.config.ts
385
+
386
+ ```typescript
387
+ import { defineConfig } from "vite";
388
+ import vue from "@vitejs/plugin-vue";
389
+ import tailwindcss from "@tailwindcss/vite";
390
+
391
+ // The assistant-ui runtime is written against react hook imports but runs on
392
+ // @assistant-ui/tap; aliasing react to the standalone shim resolves it with
393
+ // no React installed.
394
+ export default defineConfig({
395
+ plugins: [vue(), tailwindcss()],
396
+ resolve: {
397
+ alias: [
398
+ {
399
+ find: /^react\/compiler-runtime$/,
400
+ replacement: "@assistant-ui/tap/standalone-shim/compiler-runtime",
401
+ },
402
+ { find: /^react$/, replacement: "@assistant-ui/tap/standalone-shim" },
403
+ ],
404
+ },
405
+ });
406
+
407
+ ```
408
+
@@ -57,7 +57,7 @@ This command scaffolds a project from assistant-ui starter templates or examples
57
57
  | `cloud` | Cloud-backed persistence starter | `npx assistant-ui create -t cloud` |
58
58
  | `cloud-clerk` | Cloud-backed starter with Clerk auth | `npx assistant-ui create -t cloud-clerk` |
59
59
  | `langchain` | LangGraph starter with the react-langchain adapter | `npx assistant-ui create -t langchain` |
60
- | `mcp` | MCP starter template | `npx assistant-ui create -t mcp` |
60
+ | `mcp` | MCP tools + MCP Apps renderer starter | `npx assistant-ui create -t mcp` |
61
61
  | `eve` | Eve agent + Next.js starter | `npx assistant-ui create -t eve` |
62
62
 
63
63
  **Available Examples**
@@ -356,6 +356,7 @@ npx assistant-ui@latest info
356
356
  ```
357
357
 
358
358
  This command collects and prints:
359
+ - The running `assistant-ui` CLI version
359
360
  - OS, Node.js version, package manager, and framework
360
361
  - All installed `@assistant-ui/*` and `assistant-*` package versions
361
362
  - Key ecosystem dependency versions (React, Next.js, AI SDK, etc.)
@@ -365,6 +366,7 @@ This command collects and prints:
365
366
 
366
367
  ```
367
368
  Environment:
369
+ assistant-ui CLI: 0.0.106
368
370
  OS: macOS 15.3 (arm64)
369
371
  Node.js: v22.14.0
370
372
  Package Manager: pnpm 10.32.1
@@ -4,10 +4,13 @@ description: Inspect runtime state, context, and events in the browser.
4
4
  platforms: ["react"]
5
5
  ---
6
6
 
7
+ import { DevToolsSample, DevToolsModalSample } from "@/components/docs/samples/devtools";
7
8
 
8
9
  The assistant-ui DevTools allows you to debug the assistant-ui state and context, and events without resorting to `console.log`. It's an easy way to see how data flows to the assistant-ui's runtime layer.
9
10
 
10
- ![Screenshot of the DevTools UI showing logs and state panels](../../../../../.github/assets/devtoolsui.png)
11
+ Try it below — the chat on top is a live assistant-ui app, and the panel underneath is the real DevTools inspecting it. Send a message, trigger a tool call, and switch between the Thread, Context, and Activity tabs.
12
+
13
+ <DevToolsSample />
11
14
 
12
15
  ## Setup
13
16
 
@@ -45,7 +48,9 @@ export function AssistantApp() {
45
48
 
46
49
  That's it! In development builds you should now see the DevTools launcher in the lower-right corner of your site. The panel renders inline in an isolated shadow root, and the whole component is stripped from production builds.
47
50
 
48
- ![DevTools floating launcher anchored in the lower-right corner of a page](../../../../../.github/assets/devtoolsmodal.png)
51
+ Try it here — click the launcher in the lower-right corner of the frame, then use "Run a demo turn" to watch events stream into the open panel. In your app the window opens over a dimmed, click-to-close backdrop; the demo omits it so the app stays usable while the panel is open:
52
+
53
+ <DevToolsModalSample />
49
54
 
50
55
  </Step>
51
56
  </Steps>
@@ -1,88 +1,21 @@
1
1
  ---
2
2
  title: Documentation
3
- description: Build production-grade AI chat experiences in React with assistant-ui — components, runtimes, and primitives for ChatGPT-style UIs, copilots, and agents.
3
+ description: Components, runtimes, and primitives for building AI chat interfaces in React, React Native, and the terminal.
4
4
  platforms: ["react"]
5
5
  ---
6
6
 
7
- import { PanelsTopLeft, Database, Terminal } from "lucide-react";
7
+ <Quickstart />
8
8
 
9
- assistant-ui helps you create beautiful, enterprise-grade AI chat interfaces in minutes. Whether you're building a ChatGPT clone, a customer support chatbot, an AI assistant, or a complex multi-agent application, assistant-ui provides the frontend primitive components and state management layers to focus on what makes your application unique.
9
+ ## One library, any interface
10
10
 
11
- <Callout type="tip">
12
- Already using the AI SDK with your own UI? Add [cloud persistence with just one hook](/docs/cloud/ai-sdk), no UI library required.
13
- </Callout>
11
+ <DemoShowcase />
14
12
 
15
- ## Key Features
13
+ ## Bring your own backend
16
14
 
17
- <Cards>
18
- <Card icon={<PanelsTopLeft className="text-purple-300" />} title="Instant Chat UI">
19
- Pre-built beautiful, customizable chat interfaces out of the box. Easy to quickly iterate on your idea.
20
- </Card>
15
+ A runtime connects these components to your AI backend. Pick the one that matches your stack.
21
16
 
22
- <Card icon={<PanelsTopLeft className="text-blue-300" />} title="Chat State Management">
23
- Powerful state management for chat interactions, optimized for streaming responses and efficient rendering.
24
- </Card>
17
+ <RuntimeGrid />
25
18
 
26
- <Card icon={<Database className="text-green-300" />} title="High Performance">
27
- Optimized for speed and efficiency with minimal bundle size, ensuring your AI chat interfaces remain responsive.
28
- </Card>
19
+ ## Everything else
29
20
 
30
- <Card icon={<Terminal className="text-orange-300" />} title="Framework Agnostic">
31
- Easily integrate with any backend system, whether using Vercel AI SDK, direct LLM connections, or custom solutions. Works with any React-based framework.
32
- </Card>
33
- </Cards>
34
-
35
- ## Quick Try
36
-
37
- The fastest way to get started:
38
-
39
- ```sh
40
- npx assistant-ui@latest create
41
- ```
42
-
43
- This creates a new project with everything configured. Or choose a template:
44
-
45
- ```sh
46
- # Minimal starter
47
- npx assistant-ui@latest create -t minimal
48
-
49
- # Assistant Cloud - with persistence and thread management
50
- npx assistant-ui@latest create -t cloud
51
-
52
- # Assistant Cloud + Clerk authentication
53
- npx assistant-ui@latest create -t cloud-clerk
54
-
55
- # LangGraph starter (react-langchain adapter)
56
- npx assistant-ui@latest create -t langchain
57
-
58
- # MCP starter template
59
- npx assistant-ui@latest create -t mcp
60
-
61
- # Eve agent starter template
62
- npx assistant-ui@latest create -t eve
63
- ```
64
-
65
- ## What's Next?
66
-
67
- <Cards>
68
- <Card
69
- title="Installation"
70
- description="Full installation guide with CLI and manual setup options"
71
- href="/docs/installation"
72
- />
73
- <Card
74
- title="Agent Skills"
75
- description="Use AI tools to build with assistant-ui faster"
76
- href="/docs/llm"
77
- />
78
- <Card
79
- title="Pick a Runtime"
80
- description="Choose the right runtime for your needs"
81
- href="/docs/runtimes/pick-a-runtime"
82
- />
83
- <Card
84
- title="Examples"
85
- description="Explore full implementations and demos"
86
- href="/examples"
87
- />
88
- </Cards>
21
+ <QuickLinks />
@@ -22,28 +22,14 @@ The fastest way to get started with assistant-ui.
22
22
  npx assistant-ui@latest create
23
23
  ```
24
24
 
25
- Or choose a template:
25
+ Or start from a template:
26
26
 
27
27
  ```sh
28
- # Minimal starter
29
- npx assistant-ui@latest create -t minimal
30
-
31
- # Assistant Cloud - with persistence and thread management
32
28
  npx assistant-ui@latest create -t cloud
33
-
34
- # Assistant Cloud + Clerk authentication
35
- npx assistant-ui@latest create -t cloud-clerk
36
-
37
- # LangGraph starter (react-langchain adapter)
38
- npx assistant-ui@latest create -t langchain
39
-
40
- # MCP starter template
41
- npx assistant-ui@latest create -t mcp
42
-
43
- # Eve agent starter template
44
- npx assistant-ui@latest create -t eve
45
29
  ```
46
30
 
31
+ The [CLI reference](/docs/cli#create) lists every template and example, and what each one includes.
32
+
47
33
  **Add to an existing project:**
48
34
 
49
35
  ```sh
@@ -154,7 +140,7 @@ export const maxDuration = 30;
154
140
  export async function POST(req: Request) {
155
141
  const { messages, system, tools } = await req.json();
156
142
  const result = streamText({
157
- model: openai("gpt-5.4-nano"),
143
+ model: openai("gpt-5.6-luna"),
158
144
  system,
159
145
  messages: await convertToModelMessages(messages),
160
146
  tools: frontendTools(tools),
@@ -48,15 +48,35 @@ primitives built on it. Components rendered outside an `AuiProvider`
48
48
  receive a default client whose scope accessors throw on use, so
49
49
  missing-provider mistakes surface at the point of use.
50
50
 
51
+ `config` is required and must be built with [AuiConfig](/docs/api-reference/utilities/miscellaneous#auiconfig). At the top
52
+ level, `config` alone creates this subtree's own client. Under a parent
53
+ provider, `extends` is mandatory: pass `extends={aui}` to extend the parent
54
+ client or `extends={null}` to isolate from it (enforced with a dev error).
55
+ Configs are identity-insensitive — a fresh object per render is safe.
56
+ A config whose scopes are all Derived keeps its scope set fixed
57
+ at mount (dev-enforced); configs with a root scope, and empty configs,
58
+ may grow and shrink scopes across renders. `ref` receives the resulting
59
+ client after mount.
60
+
51
61
  When mounting a runtime built with one of the runtime hooks, use
52
62
  [AssistantRuntimeProvider](/docs/api-reference/context-providers/assistant-runtime-provider#assistantruntimeprovider) — it installs an `AuiProvider`
53
63
  internally — rather than wiring `AuiProvider` yourself.
54
64
 
55
65
  ```tsx
56
- function ScopedAssistant({ children, scopes }) {
57
- const aui = useAui(scopes);
58
-
59
- return <AuiProvider value={aui}>{children}</AuiProvider>;
66
+ function MessageScope({ index, children }) {
67
+ const aui = useAui();
68
+ const config = AuiConfig({
69
+ message: Derived({
70
+ source: "thread",
71
+ query: { index },
72
+ get: (aui) => aui.thread.message({ index }),
73
+ }),
74
+ });
75
+ return (
76
+ <AuiProvider extends={aui} config={config}>
77
+ {children}
78
+ </AuiProvider>
79
+ );
60
80
  }
61
81
  ```
62
82
 
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: A2UI
3
+ description: Convert A2UI surface operations into generative UI specs.
4
+ ---
5
+
6
+ import { A2uiOperation, A2uiOperationResult, A2uiState, A2uiSurfaceState, applyA2uiOperations, convertSurfaceToUISpec } from "@/generated/typeDocs";
7
+
8
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
+ {/* Do not edit manually. */}
10
+
11
+ {/* api-reference:start */}
12
+ {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
13
+ {/* Do not edit this block manually. */}
14
+
15
+ ## API Reference
16
+
17
+ ### A2uiOperation
18
+
19
+ <ParametersTable {...A2uiOperation} />
20
+
21
+ ### A2uiOperationResult
22
+
23
+ <ParametersTable {...A2uiOperationResult} />
24
+
25
+ ### A2uiState
26
+
27
+ <ParametersTable {...A2uiState} />
28
+
29
+ ### A2uiSurfaceState
30
+
31
+ <ParametersTable {...A2uiSurfaceState} />
32
+
33
+ ### applyA2uiOperations
34
+
35
+ <ParametersTable {...applyA2uiOperations} />
36
+
37
+ ### convertSurfaceToUISpec
38
+
39
+ <ParametersTable {...convertSurfaceToUISpec} />
40
+ {/* api-reference:end */}
@@ -30,6 +30,9 @@ description: Spec-driven generative UI for assistant-ui. The data format an assi
30
30
  <Card title={"Microsoft Teams"} href={"/docs/api-reference/generative-ui/teams"}>
31
31
  {"Convert generative UI trees to Teams Adaptive Cards and decode Action.Submit payloads back into $action payloads."}
32
32
  </Card>
33
+ <Card title={"A2UI"} href={"/docs/api-reference/generative-ui/a2ui"}>
34
+ {"Convert A2UI surface operations into generative UI specs."}
35
+ </Card>
33
36
  <Card title={"Generative UI Tokens"} href={"/docs/api-reference/generative-ui/tokens"}>
34
37
  {"Shared token arrays used by the default generative UI vocabulary for sizing, color, alignment, and component variants."}
35
38
  </Card>