@assistant-ui/mcp-docs-server 0.1.18 → 0.1.20

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 (148) hide show
  1. package/.docs/organized/code-examples/with-ag-ui.md +69 -1336
  2. package/.docs/organized/code-examples/with-ai-sdk-v6.md +429 -0
  3. package/.docs/organized/code-examples/with-assistant-transport.md +41 -1454
  4. package/.docs/organized/code-examples/with-cloud.md +73 -1442
  5. package/.docs/organized/code-examples/with-custom-thread-list.md +95 -1424
  6. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +674 -0
  7. package/.docs/organized/code-examples/with-external-store.md +68 -1334
  8. package/.docs/organized/code-examples/with-ffmpeg.md +73 -1341
  9. package/.docs/organized/code-examples/with-langgraph.md +52 -1545
  10. package/.docs/organized/code-examples/with-parent-id-grouping.md +58 -1364
  11. package/.docs/organized/code-examples/with-react-hook-form.md +73 -1726
  12. package/.docs/organized/code-examples/with-react-router.md +915 -0
  13. package/.docs/organized/code-examples/with-store.md +31 -31
  14. package/.docs/organized/code-examples/with-tanstack.md +78 -862
  15. package/.docs/raw/blog/2025-01-31-changelog/index.mdx +0 -2
  16. package/.docs/raw/docs/{architecture.mdx → (docs)/architecture.mdx} +3 -2
  17. package/.docs/raw/docs/{cli.mdx → (docs)/cli.mdx} +66 -18
  18. package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-readable.mdx +1 -0
  19. package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-tool-ui.mdx +2 -1
  20. package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-tool.mdx +2 -1
  21. package/.docs/raw/docs/{copilots → (docs)/copilots}/model-context.mdx +5 -4
  22. package/.docs/raw/docs/{copilots → (docs)/copilots}/motivation.mdx +4 -3
  23. package/.docs/raw/docs/{copilots → (docs)/copilots}/use-assistant-instructions.mdx +1 -0
  24. package/.docs/raw/docs/{devtools.mdx → (docs)/devtools.mdx} +4 -4
  25. package/.docs/raw/docs/{guides/Attachments.mdx → (docs)/guides/attachments.mdx} +6 -7
  26. package/.docs/raw/docs/{guides/Branching.mdx → (docs)/guides/branching.mdx} +2 -1
  27. package/.docs/raw/docs/{guides → (docs)/guides}/context-api.mdx +118 -117
  28. package/.docs/raw/docs/(docs)/guides/dictation.mdx +370 -0
  29. package/.docs/raw/docs/{guides/Editing.mdx → (docs)/guides/editing.mdx} +1 -0
  30. package/.docs/raw/docs/{guides/Latex.mdx → (docs)/guides/latex.mdx} +1 -2
  31. package/.docs/raw/docs/{guides/Speech.mdx → (docs)/guides/speech.mdx} +9 -10
  32. package/.docs/raw/docs/(docs)/guides/suggestions.mdx +296 -0
  33. package/.docs/raw/docs/{guides/ToolUI.mdx → (docs)/guides/tool-ui.mdx} +15 -14
  34. package/.docs/raw/docs/(docs)/guides/tools.mdx +564 -0
  35. package/.docs/raw/docs/(docs)/index.mdx +74 -0
  36. package/.docs/raw/docs/{getting-started.mdx → (docs)/installation.mdx} +18 -23
  37. package/.docs/raw/docs/(docs)/llm.mdx +209 -0
  38. package/.docs/raw/docs/{api-reference/context-providers/AssistantRuntimeProvider.mdx → (reference)/api-reference/context-providers/assistant-runtime-provider.mdx} +2 -1
  39. package/.docs/raw/docs/{api-reference/context-providers/TextMessagePartProvider.mdx → (reference)/api-reference/context-providers/text-message-part-provider.mdx} +2 -1
  40. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/react-data-stream.mdx +50 -3
  41. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/react-hook-form.mdx +2 -1
  42. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/vercel-ai-sdk.mdx +2 -2
  43. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/overview.mdx +10 -4
  44. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +327 -0
  45. package/.docs/raw/docs/{api-reference/primitives/ActionBar.mdx → (reference)/api-reference/primitives/action-bar.mdx} +7 -5
  46. package/.docs/raw/docs/{api-reference/primitives/AssistantIf.mdx → (reference)/api-reference/primitives/assistant-if.mdx} +51 -51
  47. package/.docs/raw/docs/{api-reference/primitives/AssistantModal.mdx → (reference)/api-reference/primitives/assistant-modal.mdx} +3 -1
  48. package/.docs/raw/docs/{api-reference/primitives/Attachment.mdx → (reference)/api-reference/primitives/attachment.mdx} +3 -2
  49. package/.docs/raw/docs/{api-reference/primitives/BranchPicker.mdx → (reference)/api-reference/primitives/branch-picker.mdx} +2 -1
  50. package/.docs/raw/docs/{api-reference/primitives/Composer.mdx → (reference)/api-reference/primitives/composer.mdx} +101 -2
  51. package/.docs/raw/docs/{api-reference → (reference)/api-reference}/primitives/composition.mdx +1 -0
  52. package/.docs/raw/docs/{api-reference/primitives/Error.mdx → (reference)/api-reference/primitives/error.mdx} +2 -1
  53. package/.docs/raw/docs/{api-reference/primitives/MessagePart.mdx → (reference)/api-reference/primitives/message-part.mdx} +2 -2
  54. package/.docs/raw/docs/{api-reference/primitives/Message.mdx → (reference)/api-reference/primitives/message.mdx} +2 -1
  55. package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +153 -0
  56. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +221 -0
  57. package/.docs/raw/docs/{api-reference/primitives/ThreadListItem.mdx → (reference)/api-reference/primitives/thread-list-item.mdx} +2 -1
  58. package/.docs/raw/docs/{api-reference/primitives/ThreadList.mdx → (reference)/api-reference/primitives/thread-list.mdx} +2 -1
  59. package/.docs/raw/docs/{api-reference/primitives/Thread.mdx → (reference)/api-reference/primitives/thread.mdx} +30 -40
  60. package/.docs/raw/docs/{api-reference/runtimes/AssistantRuntime.mdx → (reference)/api-reference/runtimes/assistant-runtime.mdx} +2 -1
  61. package/.docs/raw/docs/{api-reference/runtimes/AttachmentRuntime.mdx → (reference)/api-reference/runtimes/attachment-runtime.mdx} +3 -2
  62. package/.docs/raw/docs/{api-reference/runtimes/ComposerRuntime.mdx → (reference)/api-reference/runtimes/composer-runtime.mdx} +2 -1
  63. package/.docs/raw/docs/{api-reference/runtimes/MessagePartRuntime.mdx → (reference)/api-reference/runtimes/message-part-runtime.mdx} +3 -2
  64. package/.docs/raw/docs/{api-reference/runtimes/MessageRuntime.mdx → (reference)/api-reference/runtimes/message-runtime.mdx} +3 -2
  65. package/.docs/raw/docs/{api-reference/runtimes/ThreadListItemRuntime.mdx → (reference)/api-reference/runtimes/thread-list-item-runtime.mdx} +2 -1
  66. package/.docs/raw/docs/{api-reference/runtimes/ThreadListRuntime.mdx → (reference)/api-reference/runtimes/thread-list-runtime.mdx} +2 -1
  67. package/.docs/raw/docs/{api-reference/runtimes/ThreadRuntime.mdx → (reference)/api-reference/runtimes/thread-runtime.mdx} +3 -5
  68. package/.docs/raw/docs/{legacy/styled/AssistantModal.mdx → (reference)/legacy/styled/assistant-modal.mdx} +2 -3
  69. package/.docs/raw/docs/{legacy/styled/Decomposition.mdx → (reference)/legacy/styled/decomposition.mdx} +6 -5
  70. package/.docs/raw/docs/{legacy/styled/Markdown.mdx → (reference)/legacy/styled/markdown.mdx} +2 -4
  71. package/.docs/raw/docs/{legacy/styled/Scrollbar.mdx → (reference)/legacy/styled/scrollbar.mdx} +2 -1
  72. package/.docs/raw/docs/{legacy/styled/ThreadWidth.mdx → (reference)/legacy/styled/thread-width.mdx} +1 -0
  73. package/.docs/raw/docs/{legacy/styled/Thread.mdx → (reference)/legacy/styled/thread.mdx} +2 -3
  74. package/.docs/raw/docs/{migrations → (reference)/migrations}/deprecation-policy.mdx +1 -0
  75. package/.docs/raw/docs/{migrations → (reference)/migrations}/react-langgraph-v0-7.mdx +1 -2
  76. package/.docs/raw/docs/{migrations → (reference)/migrations}/v0-11.mdx +1 -0
  77. package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +300 -0
  78. package/.docs/raw/docs/{react-compatibility.mdx → (reference)/react-compatibility.mdx} +2 -3
  79. package/.docs/raw/docs/cloud/authorization.mdx +1 -0
  80. package/.docs/raw/docs/cloud/overview.mdx +1 -0
  81. package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +2 -3
  82. package/.docs/raw/docs/cloud/persistence/langgraph.mdx +5 -7
  83. package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +9 -8
  84. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +2 -3
  85. package/.docs/raw/docs/runtimes/assistant-transport.mdx +10 -9
  86. package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +7 -8
  87. package/.docs/raw/docs/runtimes/custom/external-store.mdx +6 -8
  88. package/.docs/raw/docs/runtimes/custom/local.mdx +55 -42
  89. package/.docs/raw/docs/runtimes/data-stream.mdx +67 -6
  90. package/.docs/raw/docs/runtimes/helicone.mdx +1 -0
  91. package/.docs/raw/docs/runtimes/langgraph/index.mdx +3 -3
  92. package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +1 -0
  93. package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +1 -0
  94. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +1 -0
  95. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -0
  96. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +2 -1
  97. package/.docs/raw/docs/runtimes/langserve.mdx +2 -2
  98. package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +4 -5
  99. package/.docs/raw/docs/runtimes/mastra/overview.mdx +1 -0
  100. package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +3 -4
  101. package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +2 -4
  102. package/.docs/raw/docs/ui/accordion.mdx +261 -0
  103. package/.docs/raw/docs/ui/assistant-modal.mdx +163 -0
  104. package/.docs/raw/docs/ui/assistant-sidebar.mdx +90 -0
  105. package/.docs/raw/docs/ui/attachment.mdx +227 -0
  106. package/.docs/raw/docs/ui/badge.mdx +140 -0
  107. package/.docs/raw/docs/ui/file.mdx +153 -0
  108. package/.docs/raw/docs/ui/image.mdx +101 -0
  109. package/.docs/raw/docs/ui/{Markdown.mdx → markdown.mdx} +11 -6
  110. package/.docs/raw/docs/ui/{Mermaid.mdx → mermaid.mdx} +12 -5
  111. package/.docs/raw/docs/ui/model-selector.mdx +226 -0
  112. package/.docs/raw/docs/ui/{PartGrouping.mdx → part-grouping.mdx} +6 -8
  113. package/.docs/raw/docs/ui/reasoning.mdx +150 -0
  114. package/.docs/raw/docs/ui/{Scrollbar.mdx → scrollbar.mdx} +9 -1
  115. package/.docs/raw/docs/ui/select.mdx +247 -0
  116. package/.docs/raw/docs/ui/sources.mdx +89 -0
  117. package/.docs/raw/docs/ui/streamdown.mdx +348 -0
  118. package/.docs/raw/docs/ui/{SyntaxHighlighting.mdx → syntax-highlighting.mdx} +9 -5
  119. package/.docs/raw/docs/ui/tabs.mdx +261 -0
  120. package/.docs/raw/docs/ui/thread-list.mdx +275 -0
  121. package/.docs/raw/docs/ui/{Thread.mdx → thread.mdx} +61 -76
  122. package/.docs/raw/docs/ui/tool-fallback.mdx +112 -0
  123. package/.docs/raw/docs/ui/tool-group.mdx +214 -0
  124. package/README.md +3 -3
  125. package/dist/tools/docs.js +1 -1
  126. package/dist/tools/examples.js +1 -1
  127. package/dist/tools/examples.js.map +1 -1
  128. package/package.json +5 -5
  129. package/src/tools/docs.ts +1 -1
  130. package/src/tools/examples.ts +1 -1
  131. package/src/tools/tests/docs.test.ts +18 -16
  132. package/src/tools/tests/examples.test.ts +6 -6
  133. package/src/tools/tests/path-traversal.test.ts +3 -3
  134. package/src/utils/tests/security.test.ts +3 -3
  135. package/.docs/organized/code-examples/with-ai-sdk-v5.md +0 -1735
  136. package/.docs/raw/docs/about-assistantui.mdx +0 -53
  137. package/.docs/raw/docs/guides/Tools.mdx +0 -738
  138. package/.docs/raw/docs/index.mdx +0 -7
  139. package/.docs/raw/docs/mcp-docs-server.mdx +0 -322
  140. package/.docs/raw/docs/migrations/v0-12.mdx +0 -125
  141. package/.docs/raw/docs/ui/AssistantModal.mdx +0 -45
  142. package/.docs/raw/docs/ui/AssistantSidebar.mdx +0 -41
  143. package/.docs/raw/docs/ui/Attachment.mdx +0 -84
  144. package/.docs/raw/docs/ui/Reasoning.mdx +0 -152
  145. package/.docs/raw/docs/ui/ThreadList.mdx +0 -90
  146. package/.docs/raw/docs/ui/ToolFallback.mdx +0 -63
  147. package/.docs/raw/docs/ui/ToolGroup.mdx +0 -96
  148. /package/.docs/raw/docs/{copilots → (docs)/copilots}/assistant-frame.mdx +0 -0
@@ -0,0 +1,429 @@
1
+ # Example: with-ai-sdk-v6
2
+
3
+ ## app/api/chat/route.ts
4
+
5
+ ```typescript
6
+ import { openai } from "@ai-sdk/openai";
7
+ import {
8
+ streamText,
9
+ convertToModelMessages,
10
+ tool,
11
+ stepCountIs,
12
+ zodSchema,
13
+ } from "ai";
14
+ import type { UIMessage } from "ai";
15
+ import { z } from "zod";
16
+
17
+ // Allow streaming responses up to 30 seconds
18
+ export const maxDuration = 30;
19
+
20
+ export async function POST(req: Request) {
21
+ const { messages }: { messages: UIMessage[] } = await req.json();
22
+
23
+ const result = streamText({
24
+ model: openai("gpt-4o"),
25
+ messages: await convertToModelMessages(messages),
26
+ stopWhen: stepCountIs(10),
27
+ tools: {
28
+ get_current_weather: tool({
29
+ description: "Get the current weather",
30
+ inputSchema: zodSchema(
31
+ z.object({
32
+ city: z.string(),
33
+ }),
34
+ ),
35
+ execute: async ({ city }) => {
36
+ return `The weather in ${city} is sunny`;
37
+ },
38
+ }),
39
+ },
40
+ });
41
+
42
+ return result.toUIMessageStreamResponse();
43
+ }
44
+
45
+ ```
46
+
47
+ ## app/globals.css
48
+
49
+ ```css
50
+ @import "tailwindcss";
51
+ @import "tw-animate-css";
52
+
53
+ @source "../../../packages/ui/src";
54
+
55
+ @custom-variant dark (&:is(.dark *));
56
+
57
+ @theme inline {
58
+ --radius-sm: calc(var(--radius) - 4px);
59
+ --radius-md: calc(var(--radius) - 2px);
60
+ --radius-lg: var(--radius);
61
+ --radius-xl: calc(var(--radius) + 4px);
62
+ --color-background: var(--background);
63
+ --color-foreground: var(--foreground);
64
+ --color-card: var(--card);
65
+ --color-card-foreground: var(--card-foreground);
66
+ --color-popover: var(--popover);
67
+ --color-popover-foreground: var(--popover-foreground);
68
+ --color-primary: var(--primary);
69
+ --color-primary-foreground: var(--primary-foreground);
70
+ --color-secondary: var(--secondary);
71
+ --color-secondary-foreground: var(--secondary-foreground);
72
+ --color-muted: var(--muted);
73
+ --color-muted-foreground: var(--muted-foreground);
74
+ --color-accent: var(--accent);
75
+ --color-accent-foreground: var(--accent-foreground);
76
+ --color-destructive: var(--destructive);
77
+ --color-border: var(--border);
78
+ --color-input: var(--input);
79
+ --color-ring: var(--ring);
80
+ --color-chart-1: var(--chart-1);
81
+ --color-chart-2: var(--chart-2);
82
+ --color-chart-3: var(--chart-3);
83
+ --color-chart-4: var(--chart-4);
84
+ --color-chart-5: var(--chart-5);
85
+ --color-sidebar: var(--sidebar);
86
+ --color-sidebar-foreground: var(--sidebar-foreground);
87
+ --color-sidebar-primary: var(--sidebar-primary);
88
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
89
+ --color-sidebar-accent: var(--sidebar-accent);
90
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
91
+ --color-sidebar-border: var(--sidebar-border);
92
+ --color-sidebar-ring: var(--sidebar-ring);
93
+ }
94
+
95
+ :root {
96
+ --radius: 0.625rem;
97
+ --background: oklch(1 0 0);
98
+ --foreground: oklch(0.141 0.005 285.823);
99
+ --card: oklch(1 0 0);
100
+ --card-foreground: oklch(0.141 0.005 285.823);
101
+ --popover: oklch(1 0 0);
102
+ --popover-foreground: oklch(0.141 0.005 285.823);
103
+ --primary: oklch(0.21 0.006 285.885);
104
+ --primary-foreground: oklch(0.985 0 0);
105
+ --secondary: oklch(0.967 0.001 286.375);
106
+ --secondary-foreground: oklch(0.21 0.006 285.885);
107
+ --muted: oklch(0.967 0.001 286.375);
108
+ --muted-foreground: oklch(0.552 0.016 285.938);
109
+ --accent: oklch(0.967 0.001 286.375);
110
+ --accent-foreground: oklch(0.21 0.006 285.885);
111
+ --destructive: oklch(0.577 0.245 27.325);
112
+ --border: oklch(0.92 0.004 286.32);
113
+ --input: oklch(0.92 0.004 286.32);
114
+ --ring: oklch(0.705 0.015 286.067);
115
+ --chart-1: oklch(0.646 0.222 41.116);
116
+ --chart-2: oklch(0.6 0.118 184.704);
117
+ --chart-3: oklch(0.398 0.07 227.392);
118
+ --chart-4: oklch(0.828 0.189 84.429);
119
+ --chart-5: oklch(0.769 0.188 70.08);
120
+ --sidebar: oklch(0.985 0 0);
121
+ --sidebar-foreground: oklch(0.141 0.005 285.823);
122
+ --sidebar-primary: oklch(0.21 0.006 285.885);
123
+ --sidebar-primary-foreground: oklch(0.985 0 0);
124
+ --sidebar-accent: oklch(0.967 0.001 286.375);
125
+ --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
126
+ --sidebar-border: oklch(0.92 0.004 286.32);
127
+ --sidebar-ring: oklch(0.705 0.015 286.067);
128
+ }
129
+
130
+ .dark {
131
+ --background: oklch(0.141 0.005 285.823);
132
+ --foreground: oklch(0.985 0 0);
133
+ --card: oklch(0.21 0.006 285.885);
134
+ --card-foreground: oklch(0.985 0 0);
135
+ --popover: oklch(0.21 0.006 285.885);
136
+ --popover-foreground: oklch(0.985 0 0);
137
+ --primary: oklch(0.92 0.004 286.32);
138
+ --primary-foreground: oklch(0.21 0.006 285.885);
139
+ --secondary: oklch(0.274 0.006 286.033);
140
+ --secondary-foreground: oklch(0.985 0 0);
141
+ --muted: oklch(0.274 0.006 286.033);
142
+ --muted-foreground: oklch(0.705 0.015 286.067);
143
+ --accent: oklch(0.274 0.006 286.033);
144
+ --accent-foreground: oklch(0.985 0 0);
145
+ --destructive: oklch(0.704 0.191 22.216);
146
+ --border: oklch(1 0 0 / 10%);
147
+ --input: oklch(1 0 0 / 15%);
148
+ --ring: oklch(0.552 0.016 285.938);
149
+ --chart-1: oklch(0.488 0.243 264.376);
150
+ --chart-2: oklch(0.696 0.17 162.48);
151
+ --chart-3: oklch(0.769 0.188 70.08);
152
+ --chart-4: oklch(0.627 0.265 303.9);
153
+ --chart-5: oklch(0.645 0.246 16.439);
154
+ --sidebar: oklch(0.21 0.006 285.885);
155
+ --sidebar-foreground: oklch(0.985 0 0);
156
+ --sidebar-primary: oklch(0.488 0.243 264.376);
157
+ --sidebar-primary-foreground: oklch(0.985 0 0);
158
+ --sidebar-accent: oklch(0.274 0.006 286.033);
159
+ --sidebar-accent-foreground: oklch(0.985 0 0);
160
+ --sidebar-border: oklch(1 0 0 / 10%);
161
+ --sidebar-ring: oklch(0.552 0.016 285.938);
162
+ }
163
+
164
+ @layer base {
165
+ * {
166
+ @apply border-border outline-ring/50;
167
+ }
168
+ body {
169
+ @apply bg-background text-foreground;
170
+ }
171
+ }
172
+
173
+ ```
174
+
175
+ ## app/layout.tsx
176
+
177
+ ```tsx
178
+ import type { Metadata } from "next";
179
+ import "./globals.css";
180
+
181
+ export const metadata: Metadata = {
182
+ title: "AI SDK v5 Example",
183
+ description: "Example using @assistant-ui/react with AI SDK v5",
184
+ };
185
+
186
+ export default function RootLayout({
187
+ children,
188
+ }: Readonly<{
189
+ children: React.ReactNode;
190
+ }>) {
191
+ return (
192
+ <html lang="en">
193
+ <body className="h-dvh">{children}</body>
194
+ </html>
195
+ );
196
+ }
197
+
198
+ ```
199
+
200
+ ## app/page.tsx
201
+
202
+ ```tsx
203
+ "use client";
204
+
205
+ import { Thread } from "@/components/assistant-ui/thread";
206
+ import { AssistantRuntimeProvider } from "@assistant-ui/react";
207
+ import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
208
+
209
+ export default function Home() {
210
+ // Using the new simplified useChatRuntime hook
211
+ const runtime = useChatRuntime();
212
+
213
+ return (
214
+ <AssistantRuntimeProvider runtime={runtime}>
215
+ <div className="h-full">
216
+ <Thread />
217
+ </div>
218
+ </AssistantRuntimeProvider>
219
+ );
220
+ }
221
+
222
+ ```
223
+
224
+ ## components.json
225
+
226
+ ```json
227
+ {
228
+ "$schema": "https://ui.shadcn.com/schema.json",
229
+ "style": "new-york",
230
+ "rsc": true,
231
+ "tsx": true,
232
+ "tailwind": {
233
+ "config": "",
234
+ "css": "app/globals.css",
235
+ "baseColor": "zinc",
236
+ "cssVariables": true,
237
+ "prefix": ""
238
+ },
239
+ "aliases": {
240
+ "components": "@/components",
241
+ "utils": "@/lib/utils",
242
+ "ui": "@/components/ui",
243
+ "lib": "@/lib",
244
+ "hooks": "@/hooks"
245
+ },
246
+ "iconLibrary": "lucide",
247
+ "registries": {
248
+ "@assistant-ui": "https://r.assistant-ui.com/{name}.json"
249
+ }
250
+ }
251
+
252
+ ```
253
+
254
+ ## lib/utils.ts
255
+
256
+ ```typescript
257
+ import { clsx, type ClassValue } from "clsx";
258
+ import { twMerge } from "tailwind-merge";
259
+
260
+ export function cn(...inputs: ClassValue[]) {
261
+ return twMerge(clsx(inputs));
262
+ }
263
+
264
+ ```
265
+
266
+ ## next.config.js
267
+
268
+ ```javascript
269
+ /** @type {import('next').NextConfig} */
270
+ const nextConfig = {
271
+ transpilePackages: ["@assistant-ui/react", "@assistant-ui/react-ai-sdk"],
272
+ };
273
+
274
+ export default nextConfig;
275
+
276
+ ```
277
+
278
+ ## package.json
279
+
280
+ ```json
281
+ {
282
+ "name": "with-ai-sdk-v6",
283
+ "version": "0.0.0",
284
+ "private": true,
285
+ "type": "module",
286
+ "scripts": {
287
+ "dev": "next dev",
288
+ "build": "next build",
289
+ "start": "next start"
290
+ },
291
+ "dependencies": {
292
+ "@ai-sdk/openai": "^3.0.19",
293
+ "@assistant-ui/react": "workspace:*",
294
+ "@assistant-ui/react-ai-sdk": "workspace:*",
295
+ "@assistant-ui/react-markdown": "workspace:*",
296
+ "@assistant-ui/ui": "workspace:*",
297
+ "@radix-ui/react-avatar": "^1.1.11",
298
+ "@radix-ui/react-collapsible": "^1.1.12",
299
+ "@radix-ui/react-dialog": "^1.1.15",
300
+ "@radix-ui/react-slot": "^1.2.4",
301
+ "@radix-ui/react-tooltip": "^1.2.8",
302
+ "ai": "^6.0.50",
303
+ "class-variance-authority": "^0.7.1",
304
+ "clsx": "^2.1.1",
305
+ "lucide-react": "^0.563.0",
306
+ "next": "^16.1.5",
307
+ "react": "^19.2.4",
308
+ "react-dom": "^19.2.4",
309
+ "tailwind-merge": "^3.4.0",
310
+ "zod": "^4.3.6"
311
+ },
312
+ "devDependencies": {
313
+ "@assistant-ui/x-buildutils": "workspace:*",
314
+ "@tailwindcss/postcss": "^4.1.18",
315
+ "@types/node": "^25.0.10",
316
+ "@types/react": "^19.2.9",
317
+ "@types/react-dom": "^19.2.3",
318
+ "postcss": "^8.5.6",
319
+ "tailwindcss": "^4.1.18",
320
+ "tw-animate-css": "^1.4.0",
321
+ "typescript": "^5.9.3"
322
+ }
323
+ }
324
+
325
+ ```
326
+
327
+ ## README.md
328
+
329
+ ```markdown
330
+ # AI SDK v6 Example
331
+
332
+ This example demonstrates how to use `@assistant-ui/react-ai-sdk` with the Vercel AI SDK v6.
333
+
334
+ ## Quick Start
335
+
336
+ ### Using CLI (Recommended)
337
+
338
+ ```bash
339
+ npx assistant-ui@latest create my-app --example with-ai-sdk-v6
340
+ cd my-app
341
+ ```
342
+
343
+ ### Environment Variables
344
+
345
+ Create `.env.local`:
346
+
347
+ ```
348
+ ANTHROPIC_API_KEY=your-api-key-here
349
+ ```
350
+
351
+ ### Run
352
+
353
+ ```bash
354
+ npm install
355
+ npm run dev
356
+ ```
357
+
358
+ Open [http://localhost:3000](http://localhost:3000) to see the result.
359
+
360
+ ## Key Features
361
+
362
+ - Uses the new AI SDK v6 with `@ai-sdk/react` and `@ai-sdk/anthropic`
363
+ - Integrates with `@assistant-ui/react` using the new `useChatRuntime` hook
364
+ - No RSC support (client-side only)
365
+ - Simplified integration with the `useChatRuntime` hook that wraps AI SDK v6's `useChat`
366
+ - Automatically uses `AssistantChatTransport` to pass system messages and frontend tools to the backend
367
+
368
+ ## Custom Transport Configuration
369
+
370
+ By default, `useChatRuntime` uses `AssistantChatTransport` which automatically forwards system messages and frontend tools to the backend.
371
+
372
+ ### Custom API URL with Forwarding
373
+
374
+ When customizing the API URL, you must explicitly use `AssistantChatTransport` to keep system/tools forwarding:
375
+
376
+ ```typescript
377
+ import { AssistantChatTransport } from "@assistant-ui/react-ai-sdk";
378
+
379
+ const runtime = useChatRuntime({
380
+ transport: new AssistantChatTransport({
381
+ api: "/my-custom-api/chat", // Custom URL with system/tools forwarding
382
+ }),
383
+ });
384
+ ```
385
+
386
+ ### Disable System/Tools Forwarding
387
+
388
+ To use the standard AI SDK transport without forwarding:
389
+
390
+ ```typescript
391
+ import { DefaultChatTransport } from "ai";
392
+
393
+ const runtime = useChatRuntime({
394
+ transport: new DefaultChatTransport(), // No system/tools forwarding
395
+ });
396
+ ```
397
+
398
+ ## API Route
399
+
400
+ The API route at `/api/chat` uses the new `streamText` function from AI SDK v6 to handle chat completions.
401
+
402
+ ## Related Documentation
403
+
404
+ - [assistant-ui Documentation](https://www.assistant-ui.com/docs)
405
+ - [AI SDK Integration Guide](https://www.assistant-ui.com/docs/runtimes/ai-sdk)
406
+
407
+ ```
408
+
409
+ ## tsconfig.json
410
+
411
+ ```json
412
+ {
413
+ "extends": "@assistant-ui/x-buildutils/ts/next",
414
+ "compilerOptions": {
415
+ "paths": {
416
+ "@/*": ["./*"],
417
+ "@/components/assistant-ui/*": [
418
+ "../../packages/ui/src/components/assistant-ui/*"
419
+ ],
420
+ "@/components/ui/*": ["../../packages/ui/src/components/ui/*"],
421
+ "@assistant-ui/ui/*": ["../../packages/ui/src/*"]
422
+ }
423
+ },
424
+ "include": ["**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
425
+ "exclude": ["node_modules"]
426
+ }
427
+
428
+ ```
429
+