@assistant-ui/mcp-docs-server 0.1.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 (109) hide show
  1. package/.docs/organized/code-examples/local-ollama.md +1135 -0
  2. package/.docs/organized/code-examples/search-agent-for-e-commerce.md +1721 -0
  3. package/.docs/organized/code-examples/with-ai-sdk.md +1081 -0
  4. package/.docs/organized/code-examples/with-cloud.md +1164 -0
  5. package/.docs/organized/code-examples/with-external-store.md +1064 -0
  6. package/.docs/organized/code-examples/with-ffmpeg.md +1305 -0
  7. package/.docs/organized/code-examples/with-langgraph.md +1819 -0
  8. package/.docs/organized/code-examples/with-openai-assistants.md +1175 -0
  9. package/.docs/organized/code-examples/with-react-hook-form.md +1727 -0
  10. package/.docs/organized/code-examples/with-vercel-ai-rsc.md +1157 -0
  11. package/.docs/raw/blog/2024-07-29-hello/index.mdx +65 -0
  12. package/.docs/raw/blog/2024-09-11/index.mdx +10 -0
  13. package/.docs/raw/blog/2024-12-15/index.mdx +10 -0
  14. package/.docs/raw/blog/2025-01-31-changelog/index.mdx +129 -0
  15. package/.docs/raw/docs/about-assistantui.mdx +44 -0
  16. package/.docs/raw/docs/api-reference/context-providers/AssistantRuntimeProvider.mdx +30 -0
  17. package/.docs/raw/docs/api-reference/context-providers/TextContentPartProvider.mdx +26 -0
  18. package/.docs/raw/docs/api-reference/integrations/react-hook-form.mdx +103 -0
  19. package/.docs/raw/docs/api-reference/integrations/vercel-ai-sdk.mdx +145 -0
  20. package/.docs/raw/docs/api-reference/overview.mdx +583 -0
  21. package/.docs/raw/docs/api-reference/primitives/ActionBar.mdx +264 -0
  22. package/.docs/raw/docs/api-reference/primitives/AssistantModal.mdx +129 -0
  23. package/.docs/raw/docs/api-reference/primitives/Attachment.mdx +96 -0
  24. package/.docs/raw/docs/api-reference/primitives/BranchPicker.mdx +87 -0
  25. package/.docs/raw/docs/api-reference/primitives/Composer.mdx +204 -0
  26. package/.docs/raw/docs/api-reference/primitives/ContentPart.mdx +173 -0
  27. package/.docs/raw/docs/api-reference/primitives/Error.mdx +70 -0
  28. package/.docs/raw/docs/api-reference/primitives/Message.mdx +181 -0
  29. package/.docs/raw/docs/api-reference/primitives/Thread.mdx +197 -0
  30. package/.docs/raw/docs/api-reference/primitives/composition.mdx +21 -0
  31. package/.docs/raw/docs/api-reference/runtimes/AssistantRuntime.mdx +33 -0
  32. package/.docs/raw/docs/api-reference/runtimes/AttachmentRuntime.mdx +46 -0
  33. package/.docs/raw/docs/api-reference/runtimes/ComposerRuntime.mdx +69 -0
  34. package/.docs/raw/docs/api-reference/runtimes/ContentPartRuntime.mdx +22 -0
  35. package/.docs/raw/docs/api-reference/runtimes/MessageRuntime.mdx +49 -0
  36. package/.docs/raw/docs/api-reference/runtimes/ThreadListItemRuntime.mdx +32 -0
  37. package/.docs/raw/docs/api-reference/runtimes/ThreadListRuntime.mdx +31 -0
  38. package/.docs/raw/docs/api-reference/runtimes/ThreadRuntime.mdx +48 -0
  39. package/.docs/raw/docs/architecture.mdx +92 -0
  40. package/.docs/raw/docs/cloud/authorization.mdx +152 -0
  41. package/.docs/raw/docs/cloud/overview.mdx +55 -0
  42. package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +54 -0
  43. package/.docs/raw/docs/cloud/persistence/langgraph.mdx +123 -0
  44. package/.docs/raw/docs/concepts/architecture.mdx +19 -0
  45. package/.docs/raw/docs/concepts/runtime-layer.mdx +163 -0
  46. package/.docs/raw/docs/concepts/why.mdx +9 -0
  47. package/.docs/raw/docs/copilots/make-assistant-readable.mdx +71 -0
  48. package/.docs/raw/docs/copilots/make-assistant-tool-ui.mdx +76 -0
  49. package/.docs/raw/docs/copilots/make-assistant-tool.mdx +117 -0
  50. package/.docs/raw/docs/copilots/model-context.mdx +135 -0
  51. package/.docs/raw/docs/copilots/motivation.mdx +191 -0
  52. package/.docs/raw/docs/copilots/use-assistant-instructions.mdx +62 -0
  53. package/.docs/raw/docs/getting-started.mdx +1133 -0
  54. package/.docs/raw/docs/guides/Attachments.mdx +640 -0
  55. package/.docs/raw/docs/guides/Branching.mdx +59 -0
  56. package/.docs/raw/docs/guides/Editing.mdx +56 -0
  57. package/.docs/raw/docs/guides/Speech.mdx +43 -0
  58. package/.docs/raw/docs/guides/ToolUI.mdx +663 -0
  59. package/.docs/raw/docs/guides/Tools.mdx +496 -0
  60. package/.docs/raw/docs/index.mdx +7 -0
  61. package/.docs/raw/docs/legacy/styled/AssistantModal.mdx +85 -0
  62. package/.docs/raw/docs/legacy/styled/Decomposition.mdx +633 -0
  63. package/.docs/raw/docs/legacy/styled/Markdown.mdx +86 -0
  64. package/.docs/raw/docs/legacy/styled/Scrollbar.mdx +71 -0
  65. package/.docs/raw/docs/legacy/styled/Thread.mdx +84 -0
  66. package/.docs/raw/docs/legacy/styled/ThreadWidth.mdx +21 -0
  67. package/.docs/raw/docs/mcp-docs-server.mdx +324 -0
  68. package/.docs/raw/docs/migrations/deprecation-policy.mdx +41 -0
  69. package/.docs/raw/docs/migrations/v0-7.mdx +188 -0
  70. package/.docs/raw/docs/migrations/v0-8.mdx +160 -0
  71. package/.docs/raw/docs/migrations/v0-9.mdx +75 -0
  72. package/.docs/raw/docs/react-compatibility.mdx +208 -0
  73. package/.docs/raw/docs/runtimes/ai-sdk/rsc.mdx +226 -0
  74. package/.docs/raw/docs/runtimes/ai-sdk/use-assistant-hook.mdx +195 -0
  75. package/.docs/raw/docs/runtimes/ai-sdk/use-chat-hook.mdx +138 -0
  76. package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +136 -0
  77. package/.docs/raw/docs/runtimes/custom/external-store.mdx +1624 -0
  78. package/.docs/raw/docs/runtimes/custom/local.mdx +1185 -0
  79. package/.docs/raw/docs/runtimes/helicone.mdx +60 -0
  80. package/.docs/raw/docs/runtimes/langgraph/index.mdx +320 -0
  81. package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +11 -0
  82. package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +28 -0
  83. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +120 -0
  84. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +336 -0
  85. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +385 -0
  86. package/.docs/raw/docs/runtimes/langserve.mdx +126 -0
  87. package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +218 -0
  88. package/.docs/raw/docs/runtimes/mastra/overview.mdx +17 -0
  89. package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +196 -0
  90. package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +222 -0
  91. package/.docs/raw/docs/ui/AssistantModal.mdx +46 -0
  92. package/.docs/raw/docs/ui/AssistantSidebar.mdx +42 -0
  93. package/.docs/raw/docs/ui/Attachment.mdx +82 -0
  94. package/.docs/raw/docs/ui/Markdown.mdx +72 -0
  95. package/.docs/raw/docs/ui/Mermaid.mdx +79 -0
  96. package/.docs/raw/docs/ui/Scrollbar.mdx +59 -0
  97. package/.docs/raw/docs/ui/SyntaxHighlighting.mdx +253 -0
  98. package/.docs/raw/docs/ui/Thread.mdx +47 -0
  99. package/.docs/raw/docs/ui/ThreadList.mdx +49 -0
  100. package/.docs/raw/docs/ui/ToolFallback.mdx +64 -0
  101. package/.docs/raw/docs/ui/primitives/Thread.mdx +197 -0
  102. package/LICENSE +21 -0
  103. package/README.md +128 -0
  104. package/dist/chunk-C7O7EFKU.js +38 -0
  105. package/dist/chunk-CZCDQ3YH.js +420 -0
  106. package/dist/index.js +1 -0
  107. package/dist/prepare-docs/prepare.js +199 -0
  108. package/dist/stdio.js +8 -0
  109. package/package.json +43 -0
@@ -0,0 +1,1081 @@
1
+ # Example: with-ai-sdk
2
+
3
+ ## app/api/chat/route.ts
4
+
5
+ ```typescript
6
+ import { openai } from "@ai-sdk/openai";
7
+ import { frontendTools } from "@assistant-ui/react-ai-sdk";
8
+ import { streamText } from "ai";
9
+ import { z } from "zod";
10
+
11
+ export const runtime = "edge";
12
+ export const maxDuration = 30;
13
+
14
+ export async function POST(req: Request) {
15
+ const { messages, system, tools } = await req.json();
16
+
17
+ const result = streamText({
18
+ model: openai("gpt-4o"),
19
+ messages,
20
+ toolCallStreaming: true,
21
+ system,
22
+ tools: {
23
+ ...frontendTools(tools),
24
+ weather: {
25
+ description: "Get weather information",
26
+ parameters: z.object({
27
+ location: z.string().describe("Location to get weather for"),
28
+ }),
29
+ execute: async ({ location }) => {
30
+ return `The weather in ${location} is sunny.`;
31
+ },
32
+ },
33
+ },
34
+ });
35
+
36
+ return result.toDataStreamResponse();
37
+ }
38
+
39
+ ```
40
+
41
+ ## app/assistant.tsx
42
+
43
+ ```tsx
44
+ "use client";
45
+
46
+ import { AssistantRuntimeProvider } from "@assistant-ui/react";
47
+ import { Thread } from "@/components/assistant-ui/thread";
48
+ import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
49
+
50
+ export const Assistant = () => {
51
+ const runtime = useChatRuntime({
52
+ api: "/api/chat",
53
+ });
54
+
55
+ return (
56
+ <AssistantRuntimeProvider runtime={runtime}>
57
+ <div className="grid h-dvh gap-x-2 px-4 py-4">
58
+ <Thread />
59
+ </div>
60
+ </AssistantRuntimeProvider>
61
+ );
62
+ };
63
+
64
+ ```
65
+
66
+ ## app/globals.css
67
+
68
+ ```css
69
+ @import "tailwindcss";
70
+ @import "tw-animate-css";
71
+
72
+ @custom-variant dark (&:is(.dark *));
73
+
74
+ @theme inline {
75
+ --color-background: var(--background);
76
+ --color-foreground: var(--foreground);
77
+ --font-sans: var(--font-geist-sans);
78
+ --font-mono: var(--font-geist-mono);
79
+ --color-sidebar-ring: var(--sidebar-ring);
80
+ --color-sidebar-border: var(--sidebar-border);
81
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
82
+ --color-sidebar-accent: var(--sidebar-accent);
83
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
84
+ --color-sidebar-primary: var(--sidebar-primary);
85
+ --color-sidebar-foreground: var(--sidebar-foreground);
86
+ --color-sidebar: var(--sidebar);
87
+ --color-chart-5: var(--chart-5);
88
+ --color-chart-4: var(--chart-4);
89
+ --color-chart-3: var(--chart-3);
90
+ --color-chart-2: var(--chart-2);
91
+ --color-chart-1: var(--chart-1);
92
+ --color-ring: var(--ring);
93
+ --color-input: var(--input);
94
+ --color-border: var(--border);
95
+ --color-destructive: var(--destructive);
96
+ --color-accent-foreground: var(--accent-foreground);
97
+ --color-accent: var(--accent);
98
+ --color-muted-foreground: var(--muted-foreground);
99
+ --color-muted: var(--muted);
100
+ --color-secondary-foreground: var(--secondary-foreground);
101
+ --color-secondary: var(--secondary);
102
+ --color-primary-foreground: var(--primary-foreground);
103
+ --color-primary: var(--primary);
104
+ --color-popover-foreground: var(--popover-foreground);
105
+ --color-popover: var(--popover);
106
+ --color-card-foreground: var(--card-foreground);
107
+ --color-card: var(--card);
108
+ --radius-sm: calc(var(--radius) - 4px);
109
+ --radius-md: calc(var(--radius) - 2px);
110
+ --radius-lg: var(--radius);
111
+ --radius-xl: calc(var(--radius) + 4px);
112
+ }
113
+
114
+ :root {
115
+ --radius: 0.625rem;
116
+ --background: oklch(1 0 0);
117
+ --foreground: oklch(0.141 0.005 285.823);
118
+ --card: oklch(1 0 0);
119
+ --card-foreground: oklch(0.141 0.005 285.823);
120
+ --popover: oklch(1 0 0);
121
+ --popover-foreground: oklch(0.141 0.005 285.823);
122
+ --primary: oklch(0.21 0.006 285.885);
123
+ --primary-foreground: oklch(0.985 0 0);
124
+ --secondary: oklch(0.967 0.001 286.375);
125
+ --secondary-foreground: oklch(0.21 0.006 285.885);
126
+ --muted: oklch(0.967 0.001 286.375);
127
+ --muted-foreground: oklch(0.552 0.016 285.938);
128
+ --accent: oklch(0.967 0.001 286.375);
129
+ --accent-foreground: oklch(0.21 0.006 285.885);
130
+ --destructive: oklch(0.577 0.245 27.325);
131
+ --border: oklch(0.92 0.004 286.32);
132
+ --input: oklch(0.92 0.004 286.32);
133
+ --ring: oklch(0.705 0.015 286.067);
134
+ --chart-1: oklch(0.646 0.222 41.116);
135
+ --chart-2: oklch(0.6 0.118 184.704);
136
+ --chart-3: oklch(0.398 0.07 227.392);
137
+ --chart-4: oklch(0.828 0.189 84.429);
138
+ --chart-5: oklch(0.769 0.188 70.08);
139
+ --sidebar: oklch(0.985 0 0);
140
+ --sidebar-foreground: oklch(0.141 0.005 285.823);
141
+ --sidebar-primary: oklch(0.21 0.006 285.885);
142
+ --sidebar-primary-foreground: oklch(0.985 0 0);
143
+ --sidebar-accent: oklch(0.967 0.001 286.375);
144
+ --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
145
+ --sidebar-border: oklch(0.92 0.004 286.32);
146
+ --sidebar-ring: oklch(0.705 0.015 286.067);
147
+ }
148
+
149
+ .dark {
150
+ --background: oklch(0.141 0.005 285.823);
151
+ --foreground: oklch(0.985 0 0);
152
+ --card: oklch(0.21 0.006 285.885);
153
+ --card-foreground: oklch(0.985 0 0);
154
+ --popover: oklch(0.21 0.006 285.885);
155
+ --popover-foreground: oklch(0.985 0 0);
156
+ --primary: oklch(0.92 0.004 286.32);
157
+ --primary-foreground: oklch(0.21 0.006 285.885);
158
+ --secondary: oklch(0.274 0.006 286.033);
159
+ --secondary-foreground: oklch(0.985 0 0);
160
+ --muted: oklch(0.274 0.006 286.033);
161
+ --muted-foreground: oklch(0.705 0.015 286.067);
162
+ --accent: oklch(0.274 0.006 286.033);
163
+ --accent-foreground: oklch(0.985 0 0);
164
+ --destructive: oklch(0.704 0.191 22.216);
165
+ --border: oklch(1 0 0 / 10%);
166
+ --input: oklch(1 0 0 / 15%);
167
+ --ring: oklch(0.552 0.016 285.938);
168
+ --chart-1: oklch(0.488 0.243 264.376);
169
+ --chart-2: oklch(0.696 0.17 162.48);
170
+ --chart-3: oklch(0.769 0.188 70.08);
171
+ --chart-4: oklch(0.627 0.265 303.9);
172
+ --chart-5: oklch(0.645 0.246 16.439);
173
+ --sidebar: oklch(0.21 0.006 285.885);
174
+ --sidebar-foreground: oklch(0.985 0 0);
175
+ --sidebar-primary: oklch(0.488 0.243 264.376);
176
+ --sidebar-primary-foreground: oklch(0.985 0 0);
177
+ --sidebar-accent: oklch(0.274 0.006 286.033);
178
+ --sidebar-accent-foreground: oklch(0.985 0 0);
179
+ --sidebar-border: oklch(1 0 0 / 10%);
180
+ --sidebar-ring: oklch(0.552 0.016 285.938);
181
+ }
182
+
183
+ @layer base {
184
+ * {
185
+ @apply border-border outline-ring/50;
186
+ }
187
+ body {
188
+ @apply bg-background text-foreground;
189
+ }
190
+ }
191
+
192
+ ```
193
+
194
+ ## app/layout.tsx
195
+
196
+ ```tsx
197
+ import type { Metadata } from "next";
198
+ import { Geist, Geist_Mono } from "next/font/google";
199
+
200
+ import "./globals.css";
201
+
202
+ const geistSans = Geist({
203
+ variable: "--font-geist-sans",
204
+ subsets: ["latin"],
205
+ });
206
+
207
+ const geistMono = Geist_Mono({
208
+ variable: "--font-geist-mono",
209
+ subsets: ["latin"],
210
+ });
211
+
212
+ export const metadata: Metadata = {
213
+ title: "assistant-ui App",
214
+ description: "Generated by create-assistant-ui",
215
+ };
216
+
217
+ export default function RootLayout({
218
+ children,
219
+ }: Readonly<{
220
+ children: React.ReactNode;
221
+ }>) {
222
+ return (
223
+ <html lang="en" className="h-dvh">
224
+ <body
225
+ className={`${geistSans.variable} ${geistMono.variable} h-dvh antialiased`}
226
+ >
227
+ {children}
228
+ </body>
229
+ </html>
230
+ );
231
+ }
232
+
233
+ ```
234
+
235
+ ## app/page.tsx
236
+
237
+ ```tsx
238
+ "use client";
239
+
240
+ import { Assistant } from "./assistant";
241
+
242
+ export default function Home() {
243
+ return (
244
+ <main className="h-dvh">
245
+ <Assistant />
246
+ </main>
247
+ );
248
+ }
249
+
250
+ ```
251
+
252
+ ## components.json
253
+
254
+ ```json
255
+ {
256
+ "$schema": "https://ui.shadcn.com/schema.json",
257
+ "style": "new-york",
258
+ "rsc": true,
259
+ "tsx": true,
260
+ "tailwind": {
261
+ "config": "",
262
+ "css": "app/globals.css",
263
+ "baseColor": "zinc",
264
+ "cssVariables": true,
265
+ "prefix": ""
266
+ },
267
+ "aliases": {
268
+ "components": "@/components",
269
+ "utils": "@/lib/utils",
270
+ "ui": "@/components/ui",
271
+ "lib": "@/lib",
272
+ "hooks": "@/hooks"
273
+ },
274
+ "iconLibrary": "lucide"
275
+ }
276
+ ```
277
+
278
+ ## components/assistant-ui/markdown-text.tsx
279
+
280
+ ```tsx
281
+ "use client";
282
+
283
+ import "@assistant-ui/react-markdown/styles/dot.css";
284
+
285
+ import {
286
+ CodeHeaderProps,
287
+ MarkdownTextPrimitive,
288
+ unstable_memoizeMarkdownComponents as memoizeMarkdownComponents,
289
+ useIsMarkdownCodeBlock,
290
+ } from "@assistant-ui/react-markdown";
291
+ import remarkGfm from "remark-gfm";
292
+ import { FC, memo, useState } from "react";
293
+ import { CheckIcon, CopyIcon } from "lucide-react";
294
+
295
+ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button";
296
+ import { cn } from "@/lib/utils";
297
+
298
+ const MarkdownTextImpl = () => {
299
+ return (
300
+ <MarkdownTextPrimitive
301
+ remarkPlugins={[remarkGfm]}
302
+ className="aui-md"
303
+ components={defaultComponents}
304
+ />
305
+ );
306
+ };
307
+
308
+ export const MarkdownText = memo(MarkdownTextImpl);
309
+
310
+ const CodeHeader: FC<CodeHeaderProps> = ({ language, code }) => {
311
+ const { isCopied, copyToClipboard } = useCopyToClipboard();
312
+ const onCopy = () => {
313
+ if (!code || isCopied) return;
314
+ copyToClipboard(code);
315
+ };
316
+
317
+ return (
318
+ <div className="flex items-center justify-between gap-4 rounded-t-lg bg-zinc-900 px-4 py-2 text-sm font-semibold text-white">
319
+ <span className="lowercase [&>span]:text-xs">{language}</span>
320
+ <TooltipIconButton tooltip="Copy" onClick={onCopy}>
321
+ {!isCopied && <CopyIcon />}
322
+ {isCopied && <CheckIcon />}
323
+ </TooltipIconButton>
324
+ </div>
325
+ );
326
+ };
327
+
328
+ const useCopyToClipboard = ({
329
+ copiedDuration = 3000,
330
+ }: {
331
+ copiedDuration?: number;
332
+ } = {}) => {
333
+ const [isCopied, setIsCopied] = useState<boolean>(false);
334
+
335
+ const copyToClipboard = (value: string) => {
336
+ if (!value) return;
337
+
338
+ navigator.clipboard.writeText(value).then(() => {
339
+ setIsCopied(true);
340
+ setTimeout(() => setIsCopied(false), copiedDuration);
341
+ });
342
+ };
343
+
344
+ return { isCopied, copyToClipboard };
345
+ };
346
+
347
+ const defaultComponents = memoizeMarkdownComponents({
348
+ h1: ({ className, ...props }) => (
349
+ <h1
350
+ className={cn(
351
+ "mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0",
352
+ className,
353
+ )}
354
+ {...props}
355
+ />
356
+ ),
357
+ h2: ({ className, ...props }) => (
358
+ <h2
359
+ className={cn(
360
+ "mb-4 mt-8 scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0 last:mb-0",
361
+ className,
362
+ )}
363
+ {...props}
364
+ />
365
+ ),
366
+ h3: ({ className, ...props }) => (
367
+ <h3
368
+ className={cn(
369
+ "mb-4 mt-6 scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0 last:mb-0",
370
+ className,
371
+ )}
372
+ {...props}
373
+ />
374
+ ),
375
+ h4: ({ className, ...props }) => (
376
+ <h4
377
+ className={cn(
378
+ "mb-4 mt-6 scroll-m-20 text-xl font-semibold tracking-tight first:mt-0 last:mb-0",
379
+ className,
380
+ )}
381
+ {...props}
382
+ />
383
+ ),
384
+ h5: ({ className, ...props }) => (
385
+ <h5
386
+ className={cn(
387
+ "my-4 text-lg font-semibold first:mt-0 last:mb-0",
388
+ className,
389
+ )}
390
+ {...props}
391
+ />
392
+ ),
393
+ h6: ({ className, ...props }) => (
394
+ <h6
395
+ className={cn("my-4 font-semibold first:mt-0 last:mb-0", className)}
396
+ {...props}
397
+ />
398
+ ),
399
+ p: ({ className, ...props }) => (
400
+ <p
401
+ className={cn("mb-5 mt-5 leading-7 first:mt-0 last:mb-0", className)}
402
+ {...props}
403
+ />
404
+ ),
405
+ a: ({ className, ...props }) => (
406
+ <a
407
+ className={cn(
408
+ "text-primary font-medium underline underline-offset-4",
409
+ className,
410
+ )}
411
+ {...props}
412
+ />
413
+ ),
414
+ blockquote: ({ className, ...props }) => (
415
+ <blockquote
416
+ className={cn("border-l-2 pl-6 italic", className)}
417
+ {...props}
418
+ />
419
+ ),
420
+ ul: ({ className, ...props }) => (
421
+ <ul
422
+ className={cn("my-5 ml-6 list-disc [&>li]:mt-2", className)}
423
+ {...props}
424
+ />
425
+ ),
426
+ ol: ({ className, ...props }) => (
427
+ <ol
428
+ className={cn("my-5 ml-6 list-decimal [&>li]:mt-2", className)}
429
+ {...props}
430
+ />
431
+ ),
432
+ hr: ({ className, ...props }) => (
433
+ <hr className={cn("my-5 border-b", className)} {...props} />
434
+ ),
435
+ table: ({ className, ...props }) => (
436
+ <table
437
+ className={cn(
438
+ "my-5 w-full border-separate border-spacing-0 overflow-y-auto",
439
+ className,
440
+ )}
441
+ {...props}
442
+ />
443
+ ),
444
+ th: ({ className, ...props }) => (
445
+ <th
446
+ className={cn(
447
+ "bg-muted px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [&[align=center]]:text-center [&[align=right]]:text-right",
448
+ className,
449
+ )}
450
+ {...props}
451
+ />
452
+ ),
453
+ td: ({ className, ...props }) => (
454
+ <td
455
+ className={cn(
456
+ "border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",
457
+ className,
458
+ )}
459
+ {...props}
460
+ />
461
+ ),
462
+ tr: ({ className, ...props }) => (
463
+ <tr
464
+ className={cn(
465
+ "m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",
466
+ className,
467
+ )}
468
+ {...props}
469
+ />
470
+ ),
471
+ sup: ({ className, ...props }) => (
472
+ <sup
473
+ className={cn("[&>a]:text-xs [&>a]:no-underline", className)}
474
+ {...props}
475
+ />
476
+ ),
477
+ pre: ({ className, ...props }) => (
478
+ <pre
479
+ className={cn(
480
+ "overflow-x-auto rounded-b-lg bg-black p-4 text-white",
481
+ className,
482
+ )}
483
+ {...props}
484
+ />
485
+ ),
486
+ code: function Code({ className, ...props }) {
487
+ const isCodeBlock = useIsMarkdownCodeBlock();
488
+ return (
489
+ <code
490
+ className={cn(
491
+ !isCodeBlock && "bg-muted rounded border font-semibold",
492
+ className,
493
+ )}
494
+ {...props}
495
+ />
496
+ );
497
+ },
498
+ CodeHeader,
499
+ });
500
+
501
+ ```
502
+
503
+ ## components/assistant-ui/thread.tsx
504
+
505
+ ```tsx
506
+ import {
507
+ ActionBarPrimitive,
508
+ BranchPickerPrimitive,
509
+ ComposerPrimitive,
510
+ MessagePrimitive,
511
+ ThreadPrimitive,
512
+ } from "@assistant-ui/react";
513
+ import type { FC } from "react";
514
+ import {
515
+ ArrowDownIcon,
516
+ CheckIcon,
517
+ ChevronLeftIcon,
518
+ ChevronRightIcon,
519
+ CopyIcon,
520
+ PencilIcon,
521
+ RefreshCwIcon,
522
+ SendHorizontalIcon,
523
+ } from "lucide-react";
524
+ import { cn } from "@/lib/utils";
525
+
526
+ import { Button } from "@/components/ui/button";
527
+ import { MarkdownText } from "@/components/assistant-ui/markdown-text";
528
+ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button";
529
+
530
+ export const Thread: FC = () => {
531
+ return (
532
+ <ThreadPrimitive.Root
533
+ className="bg-background box-border flex h-full flex-col overflow-hidden"
534
+ style={{
535
+ ["--thread-max-width" as string]: "42rem",
536
+ }}
537
+ >
538
+ <ThreadPrimitive.Viewport className="flex h-full flex-col items-center overflow-y-scroll scroll-smooth bg-inherit px-4 pt-8">
539
+ <ThreadWelcome />
540
+
541
+ <ThreadPrimitive.Messages
542
+ components={{
543
+ UserMessage: UserMessage,
544
+ EditComposer: EditComposer,
545
+ AssistantMessage: AssistantMessage,
546
+ }}
547
+ />
548
+
549
+ <ThreadPrimitive.If empty={false}>
550
+ <div className="min-h-8 flex-grow" />
551
+ </ThreadPrimitive.If>
552
+
553
+ <div className="sticky bottom-0 mt-3 flex w-full max-w-[var(--thread-max-width)] flex-col items-center justify-end rounded-t-lg bg-inherit pb-4">
554
+ <ThreadScrollToBottom />
555
+ <Composer />
556
+ </div>
557
+ </ThreadPrimitive.Viewport>
558
+ </ThreadPrimitive.Root>
559
+ );
560
+ };
561
+
562
+ const ThreadScrollToBottom: FC = () => {
563
+ return (
564
+ <ThreadPrimitive.ScrollToBottom asChild>
565
+ <TooltipIconButton
566
+ tooltip="Scroll to bottom"
567
+ variant="outline"
568
+ className="absolute -top-8 rounded-full disabled:invisible"
569
+ >
570
+ <ArrowDownIcon />
571
+ </TooltipIconButton>
572
+ </ThreadPrimitive.ScrollToBottom>
573
+ );
574
+ };
575
+
576
+ const ThreadWelcome: FC = () => {
577
+ return (
578
+ <ThreadPrimitive.Empty>
579
+ <div className="flex w-full max-w-[var(--thread-max-width)] flex-grow flex-col">
580
+ <div className="flex w-full flex-grow flex-col items-center justify-center">
581
+ <p className="mt-4 font-medium">How can I help you today?</p>
582
+ </div>
583
+ <ThreadWelcomeSuggestions />
584
+ </div>
585
+ </ThreadPrimitive.Empty>
586
+ );
587
+ };
588
+
589
+ const ThreadWelcomeSuggestions: FC = () => {
590
+ return (
591
+ <div className="mt-3 flex w-full items-stretch justify-center gap-4">
592
+ <ThreadPrimitive.Suggestion
593
+ className="hover:bg-muted/80 flex max-w-sm grow basis-0 flex-col items-center justify-center rounded-lg border p-3 transition-colors ease-in"
594
+ prompt="What is the weather in Tokyo?"
595
+ method="replace"
596
+ autoSend
597
+ >
598
+ <span className="line-clamp-2 text-ellipsis text-sm font-semibold">
599
+ What is the weather in Tokyo?
600
+ </span>
601
+ </ThreadPrimitive.Suggestion>
602
+ <ThreadPrimitive.Suggestion
603
+ className="hover:bg-muted/80 flex max-w-sm grow basis-0 flex-col items-center justify-center rounded-lg border p-3 transition-colors ease-in"
604
+ prompt="What is assistant-ui?"
605
+ method="replace"
606
+ autoSend
607
+ >
608
+ <span className="line-clamp-2 text-ellipsis text-sm font-semibold">
609
+ What is assistant-ui?
610
+ </span>
611
+ </ThreadPrimitive.Suggestion>
612
+ </div>
613
+ );
614
+ };
615
+
616
+ const Composer: FC = () => {
617
+ return (
618
+ <ComposerPrimitive.Root className="focus-within:border-ring/20 flex w-full flex-wrap items-end rounded-lg border bg-inherit px-2.5 shadow-sm transition-colors ease-in">
619
+ <ComposerPrimitive.Input
620
+ rows={1}
621
+ autoFocus
622
+ placeholder="Write a message..."
623
+ className="placeholder:text-muted-foreground max-h-40 flex-grow resize-none border-none bg-transparent px-2 py-4 text-sm outline-none focus:ring-0 disabled:cursor-not-allowed"
624
+ />
625
+ <ComposerAction />
626
+ </ComposerPrimitive.Root>
627
+ );
628
+ };
629
+
630
+ const ComposerAction: FC = () => {
631
+ return (
632
+ <>
633
+ <ThreadPrimitive.If running={false}>
634
+ <ComposerPrimitive.Send asChild>
635
+ <TooltipIconButton
636
+ tooltip="Send"
637
+ variant="default"
638
+ className="my-2.5 size-8 p-2 transition-opacity ease-in"
639
+ >
640
+ <SendHorizontalIcon />
641
+ </TooltipIconButton>
642
+ </ComposerPrimitive.Send>
643
+ </ThreadPrimitive.If>
644
+ <ThreadPrimitive.If running>
645
+ <ComposerPrimitive.Cancel asChild>
646
+ <TooltipIconButton
647
+ tooltip="Cancel"
648
+ variant="default"
649
+ className="my-2.5 size-8 p-2 transition-opacity ease-in"
650
+ >
651
+ <CircleStopIcon />
652
+ </TooltipIconButton>
653
+ </ComposerPrimitive.Cancel>
654
+ </ThreadPrimitive.If>
655
+ </>
656
+ );
657
+ };
658
+
659
+ const UserMessage: FC = () => {
660
+ return (
661
+ <MessagePrimitive.Root className="grid w-full max-w-[var(--thread-max-width)] auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] gap-y-2 py-4 [&:where(>*)]:col-start-2">
662
+ <UserActionBar />
663
+
664
+ <div className="bg-muted text-foreground col-start-2 row-start-2 max-w-[calc(var(--thread-max-width)*0.8)] break-words rounded-3xl px-5 py-2.5">
665
+ <MessagePrimitive.Content />
666
+ </div>
667
+
668
+ <BranchPicker className="col-span-full col-start-1 row-start-3 -mr-1 justify-end" />
669
+ </MessagePrimitive.Root>
670
+ );
671
+ };
672
+
673
+ const UserActionBar: FC = () => {
674
+ return (
675
+ <ActionBarPrimitive.Root
676
+ hideWhenRunning
677
+ autohide="not-last"
678
+ className="col-start-1 row-start-2 mr-3 mt-2.5 flex flex-col items-end"
679
+ >
680
+ <ActionBarPrimitive.Edit asChild>
681
+ <TooltipIconButton tooltip="Edit">
682
+ <PencilIcon />
683
+ </TooltipIconButton>
684
+ </ActionBarPrimitive.Edit>
685
+ </ActionBarPrimitive.Root>
686
+ );
687
+ };
688
+
689
+ const EditComposer: FC = () => {
690
+ return (
691
+ <ComposerPrimitive.Root className="bg-muted my-4 flex w-full max-w-[var(--thread-max-width)] flex-col gap-2 rounded-xl">
692
+ <ComposerPrimitive.Input className="text-foreground flex h-8 w-full resize-none bg-transparent p-4 pb-0 outline-none" />
693
+
694
+ <div className="mx-3 mb-3 flex items-center justify-center gap-2 self-end">
695
+ <ComposerPrimitive.Cancel asChild>
696
+ <Button variant="ghost">Cancel</Button>
697
+ </ComposerPrimitive.Cancel>
698
+ <ComposerPrimitive.Send asChild>
699
+ <Button>Send</Button>
700
+ </ComposerPrimitive.Send>
701
+ </div>
702
+ </ComposerPrimitive.Root>
703
+ );
704
+ };
705
+
706
+ const AssistantMessage: FC = () => {
707
+ return (
708
+ <MessagePrimitive.Root className="relative grid w-full max-w-[var(--thread-max-width)] grid-cols-[auto_auto_1fr] grid-rows-[auto_1fr] py-4">
709
+ <div className="text-foreground col-span-2 col-start-2 row-start-1 my-1.5 max-w-[calc(var(--thread-max-width)*0.8)] break-words leading-7">
710
+ <MessagePrimitive.Content components={{ Text: MarkdownText }} />
711
+ </div>
712
+
713
+ <AssistantActionBar />
714
+
715
+ <BranchPicker className="col-start-2 row-start-2 -ml-2 mr-2" />
716
+ </MessagePrimitive.Root>
717
+ );
718
+ };
719
+
720
+ const AssistantActionBar: FC = () => {
721
+ return (
722
+ <ActionBarPrimitive.Root
723
+ hideWhenRunning
724
+ autohide="not-last"
725
+ autohideFloat="single-branch"
726
+ className="text-muted-foreground data-[floating]:bg-background col-start-3 row-start-2 -ml-1 flex gap-1 data-[floating]:absolute data-[floating]:rounded-md data-[floating]:border data-[floating]:p-1 data-[floating]:shadow-sm"
727
+ >
728
+ <ActionBarPrimitive.Copy asChild>
729
+ <TooltipIconButton tooltip="Copy">
730
+ <MessagePrimitive.If copied>
731
+ <CheckIcon />
732
+ </MessagePrimitive.If>
733
+ <MessagePrimitive.If copied={false}>
734
+ <CopyIcon />
735
+ </MessagePrimitive.If>
736
+ </TooltipIconButton>
737
+ </ActionBarPrimitive.Copy>
738
+ <ActionBarPrimitive.Reload asChild>
739
+ <TooltipIconButton tooltip="Refresh">
740
+ <RefreshCwIcon />
741
+ </TooltipIconButton>
742
+ </ActionBarPrimitive.Reload>
743
+ </ActionBarPrimitive.Root>
744
+ );
745
+ };
746
+
747
+ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
748
+ className,
749
+ ...rest
750
+ }) => {
751
+ return (
752
+ <BranchPickerPrimitive.Root
753
+ hideWhenSingleBranch
754
+ className={cn(
755
+ "text-muted-foreground inline-flex items-center text-xs",
756
+ className,
757
+ )}
758
+ {...rest}
759
+ >
760
+ <BranchPickerPrimitive.Previous asChild>
761
+ <TooltipIconButton tooltip="Previous">
762
+ <ChevronLeftIcon />
763
+ </TooltipIconButton>
764
+ </BranchPickerPrimitive.Previous>
765
+ <span className="font-medium">
766
+ <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />
767
+ </span>
768
+ <BranchPickerPrimitive.Next asChild>
769
+ <TooltipIconButton tooltip="Next">
770
+ <ChevronRightIcon />
771
+ </TooltipIconButton>
772
+ </BranchPickerPrimitive.Next>
773
+ </BranchPickerPrimitive.Root>
774
+ );
775
+ };
776
+
777
+ const CircleStopIcon = () => {
778
+ return (
779
+ <svg
780
+ xmlns="http://www.w3.org/2000/svg"
781
+ viewBox="0 0 16 16"
782
+ fill="currentColor"
783
+ width="16"
784
+ height="16"
785
+ >
786
+ <rect width="10" height="10" x="3" y="3" rx="2" />
787
+ </svg>
788
+ );
789
+ };
790
+
791
+ ```
792
+
793
+ ## components/assistant-ui/tooltip-icon-button.tsx
794
+
795
+ ```tsx
796
+ "use client";
797
+
798
+ import { ComponentPropsWithoutRef, forwardRef } from "react";
799
+
800
+ import {
801
+ Tooltip,
802
+ TooltipContent,
803
+ TooltipTrigger,
804
+ } from "@/components/ui/tooltip";
805
+ import { Button } from "@/components/ui/button";
806
+ import { cn } from "@/lib/utils";
807
+
808
+ export type TooltipIconButtonProps = ComponentPropsWithoutRef<typeof Button> & {
809
+ tooltip: string;
810
+ side?: "top" | "bottom" | "left" | "right";
811
+ };
812
+
813
+ export const TooltipIconButton = forwardRef<
814
+ HTMLButtonElement,
815
+ TooltipIconButtonProps
816
+ >(({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
817
+ return (
818
+ <Tooltip>
819
+ <TooltipTrigger asChild>
820
+ <Button
821
+ variant="ghost"
822
+ size="icon"
823
+ {...rest}
824
+ className={cn("size-6 p-1", className)}
825
+ ref={ref}
826
+ >
827
+ {children}
828
+ <span className="sr-only">{tooltip}</span>
829
+ </Button>
830
+ </TooltipTrigger>
831
+ <TooltipContent side={side}>{tooltip}</TooltipContent>
832
+ </Tooltip>
833
+ );
834
+ });
835
+
836
+ TooltipIconButton.displayName = "TooltipIconButton";
837
+
838
+ ```
839
+
840
+ ## components/ui/button.tsx
841
+
842
+ ```tsx
843
+ import * as React from "react";
844
+ import { Slot } from "@radix-ui/react-slot";
845
+ import { cva, type VariantProps } from "class-variance-authority";
846
+
847
+ import { cn } from "@/lib/utils";
848
+
849
+ const buttonVariants = cva(
850
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
851
+ {
852
+ variants: {
853
+ variant: {
854
+ default:
855
+ "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
856
+ destructive:
857
+ "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
858
+ outline:
859
+ "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
860
+ secondary:
861
+ "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
862
+ ghost:
863
+ "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
864
+ link: "text-primary underline-offset-4 hover:underline",
865
+ },
866
+ size: {
867
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
868
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
869
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
870
+ icon: "size-9",
871
+ },
872
+ },
873
+ defaultVariants: {
874
+ variant: "default",
875
+ size: "default",
876
+ },
877
+ },
878
+ );
879
+
880
+ function Button({
881
+ className,
882
+ variant,
883
+ size,
884
+ asChild = false,
885
+ ...props
886
+ }: React.ComponentProps<"button"> &
887
+ VariantProps<typeof buttonVariants> & {
888
+ asChild?: boolean;
889
+ }) {
890
+ const Comp = asChild ? Slot : "button";
891
+
892
+ return (
893
+ <Comp
894
+ data-slot="button"
895
+ className={cn(buttonVariants({ variant, size, className }))}
896
+ {...props}
897
+ />
898
+ );
899
+ }
900
+
901
+ export { Button, buttonVariants };
902
+
903
+ ```
904
+
905
+ ## components/ui/tooltip.tsx
906
+
907
+ ```tsx
908
+ "use client";
909
+
910
+ import * as React from "react";
911
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
912
+
913
+ import { cn } from "@/lib/utils";
914
+
915
+ function TooltipProvider({
916
+ delayDuration = 0,
917
+ ...props
918
+ }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
919
+ return (
920
+ <TooltipPrimitive.Provider
921
+ data-slot="tooltip-provider"
922
+ delayDuration={delayDuration}
923
+ {...props}
924
+ />
925
+ );
926
+ }
927
+
928
+ function Tooltip({
929
+ ...props
930
+ }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
931
+ return (
932
+ <TooltipProvider>
933
+ <TooltipPrimitive.Root data-slot="tooltip" {...props} />
934
+ </TooltipProvider>
935
+ );
936
+ }
937
+
938
+ function TooltipTrigger({
939
+ ...props
940
+ }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
941
+ return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
942
+ }
943
+
944
+ function TooltipContent({
945
+ className,
946
+ sideOffset = 0,
947
+ children,
948
+ ...props
949
+ }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
950
+ return (
951
+ <TooltipPrimitive.Portal>
952
+ <TooltipPrimitive.Content
953
+ data-slot="tooltip-content"
954
+ sideOffset={sideOffset}
955
+ className={cn(
956
+ "bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-[--radix-tooltip-content-transform-origin] text-balance rounded-md px-3 py-1.5 text-xs",
957
+ className,
958
+ )}
959
+ {...props}
960
+ >
961
+ {children}
962
+ <TooltipPrimitive.Arrow className="bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
963
+ </TooltipPrimitive.Content>
964
+ </TooltipPrimitive.Portal>
965
+ );
966
+ }
967
+
968
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
969
+
970
+ ```
971
+
972
+ ## eslint.config.ts
973
+
974
+ ```typescript
975
+ export { default } from "@assistant-ui/x-buildutils/eslint";
976
+
977
+ ```
978
+
979
+ ## lib/utils.ts
980
+
981
+ ```typescript
982
+ import { clsx, type ClassValue } from "clsx";
983
+ import { twMerge } from "tailwind-merge";
984
+
985
+ export function cn(...inputs: ClassValue[]) {
986
+ return twMerge(clsx(inputs));
987
+ }
988
+
989
+ ```
990
+
991
+ ## next.config.ts
992
+
993
+ ```typescript
994
+ import type { NextConfig } from "next";
995
+
996
+ const nextConfig: NextConfig = {
997
+ /* config options here */
998
+ };
999
+
1000
+ export default nextConfig;
1001
+
1002
+ ```
1003
+
1004
+ ## package.json
1005
+
1006
+ ```json
1007
+ {
1008
+ "name": "with-ai-sdk",
1009
+ "version": "0.1.0",
1010
+ "private": true,
1011
+ "scripts": {
1012
+ "dev": "next dev --turbo",
1013
+ "build": "next build",
1014
+ "start": "next start",
1015
+ "lint": "next lint"
1016
+ },
1017
+ "dependencies": {
1018
+ "@ai-sdk/openai": "^1.3.22",
1019
+ "@assistant-ui/react": "workspace:*",
1020
+ "@assistant-ui/react-ai-sdk": "workspace:*",
1021
+ "@assistant-ui/react-markdown": "workspace:*",
1022
+ "@radix-ui/react-slot": "^1.2.3",
1023
+ "@radix-ui/react-tooltip": "^1.2.7",
1024
+ "ai": "^4.3.16",
1025
+ "class-variance-authority": "^0.7.1",
1026
+ "clsx": "^2.1.1",
1027
+ "lucide-react": "^0.511.0",
1028
+ "next": "15.3.3",
1029
+ "react": "19.1.0",
1030
+ "react-dom": "19.1.0",
1031
+ "remark-gfm": "^4.0.1",
1032
+ "tailwind-merge": "^3.3.0",
1033
+ "tw-animate-css": "^1.3.3",
1034
+ "zod": "^3.25.49"
1035
+ },
1036
+ "devDependencies": {
1037
+ "@assistant-ui/x-buildutils": "workspace:*",
1038
+ "@types/node": "^22",
1039
+ "@types/react": "^19",
1040
+ "@types/react-dom": "^19",
1041
+ "eslint": "^9",
1042
+ "eslint-config-next": "15.3.3",
1043
+ "postcss": "^8",
1044
+ "tailwindcss": "^4.1.8",
1045
+ "typescript": "^5"
1046
+ }
1047
+ }
1048
+
1049
+ ```
1050
+
1051
+ ## tsconfig.json
1052
+
1053
+ ```json
1054
+ {
1055
+ "extends": "@assistant-ui/x-buildutils/ts/base",
1056
+ "compilerOptions": {
1057
+ "target": "ES6",
1058
+ "module": "ESNext",
1059
+ "incremental": true,
1060
+ "plugins": [
1061
+ {
1062
+ "name": "next"
1063
+ }
1064
+ ],
1065
+ "allowJs": true,
1066
+ "strictNullChecks": true,
1067
+ "jsx": "preserve",
1068
+ "paths": {
1069
+ "@/*": ["./*"],
1070
+ "@assistant-ui/*": ["../../packages/*/src"],
1071
+ "@assistant-ui/react/*": ["../../packages/react/src/*"],
1072
+ "assistant-stream": ["../../packages/assistant-stream/src"],
1073
+ "assistant-stream/*": ["../../packages/assistant-stream/src/*"]
1074
+ }
1075
+ },
1076
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
1077
+ "exclude": ["node_modules"]
1078
+ }
1079
+
1080
+ ```
1081
+