@assistant-ui/mcp-docs-server 0.1.24 → 0.1.25
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.
- package/.docs/organized/code-examples/waterfall.md +4 -2
- package/.docs/organized/code-examples/with-a2a.md +676 -0
- package/.docs/organized/code-examples/with-ag-ui.md +5 -6
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +27 -15
- package/.docs/organized/code-examples/with-artifacts.md +4 -4
- package/.docs/organized/code-examples/with-assistant-transport.md +2 -2
- package/.docs/organized/code-examples/with-chain-of-thought.md +33 -25
- package/.docs/organized/code-examples/with-cloud-standalone.md +9 -6
- package/.docs/organized/code-examples/with-cloud.md +4 -4
- package/.docs/organized/code-examples/with-custom-thread-list.md +6 -6
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +7 -7
- package/.docs/organized/code-examples/with-expo.md +565 -514
- package/.docs/organized/code-examples/with-external-store.md +2 -2
- package/.docs/organized/code-examples/with-ffmpeg.md +4 -4
- package/.docs/organized/code-examples/with-google-adk.md +353 -0
- package/.docs/organized/code-examples/with-heat-graph.md +304 -0
- package/.docs/organized/code-examples/with-langgraph.md +24 -22
- package/.docs/organized/code-examples/with-parent-id-grouping.md +3 -3
- package/.docs/organized/code-examples/with-react-hook-form.md +4 -4
- package/.docs/organized/code-examples/with-react-ink.md +265 -0
- package/.docs/organized/code-examples/with-react-router.md +5 -5
- package/.docs/organized/code-examples/with-store.md +28 -17
- package/.docs/organized/code-examples/with-tanstack.md +7 -7
- package/.docs/organized/code-examples/with-tap-runtime.md +5 -3
- package/.docs/raw/blog/2025-01-31-changelog/index.mdx +1 -1
- package/.docs/raw/blog/2026-03-launch-week/index.mdx +227 -0
- package/.docs/raw/docs/(docs)/architecture.mdx +1 -1
- package/.docs/raw/docs/(docs)/cli.mdx +14 -9
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +8 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +5 -1
- package/.docs/raw/docs/(docs)/copilots/{make-assistant-readable.mdx → make-assistant-visible.mdx} +14 -5
- package/.docs/raw/docs/(docs)/copilots/model-context.mdx +11 -11
- package/.docs/raw/docs/(docs)/copilots/motivation.mdx +2 -2
- package/.docs/raw/docs/(docs)/devtools.mdx +3 -2
- package/.docs/raw/docs/(docs)/guides/attachments.mdx +9 -11
- package/.docs/raw/docs/(docs)/guides/branching.mdx +11 -6
- package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +18 -16
- package/.docs/raw/docs/(docs)/guides/context-api.mdx +81 -43
- package/.docs/raw/docs/(docs)/guides/dictation.mdx +5 -5
- package/.docs/raw/docs/(docs)/guides/editing.mdx +16 -7
- package/.docs/raw/docs/(docs)/guides/latex.mdx +3 -0
- package/.docs/raw/docs/(docs)/guides/message-timing.mdx +2 -1
- package/.docs/raw/docs/(docs)/guides/multi-agent.mdx +173 -0
- package/.docs/raw/docs/(docs)/guides/quoting.mdx +55 -206
- package/.docs/raw/docs/(docs)/guides/speech.mdx +1 -4
- package/.docs/raw/docs/(docs)/guides/suggestions.mdx +9 -15
- package/.docs/raw/docs/(docs)/guides/tool-ui.mdx +17 -7
- package/.docs/raw/docs/(docs)/guides/tools.mdx +24 -9
- package/.docs/raw/docs/(docs)/index.mdx +3 -3
- package/.docs/raw/docs/(docs)/installation.mdx +69 -46
- package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +20 -6
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +24 -4
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +20 -19
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +28 -53
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +4 -4
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +7 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +20 -14
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +99 -45
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +52 -40
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +343 -23
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +4 -6
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +4 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +3 -5
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +169 -22
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +14 -4
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +15 -26
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +39 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +33 -9
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +48 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +36 -7
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +30 -10
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +12 -10
- package/.docs/raw/docs/(reference)/migrations/deprecation-policy.mdx +1 -1
- package/.docs/raw/docs/(reference)/migrations/react-langgraph-v0-7.mdx +9 -4
- package/.docs/raw/docs/(reference)/migrations/v0-11.mdx +7 -5
- package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +9 -7
- package/.docs/raw/docs/(reference)/migrations/v0-14.mdx +159 -0
- package/.docs/raw/docs/(reference)/react-compatibility.mdx +5 -134
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +84 -6
- package/.docs/raw/docs/cloud/ai-sdk.mdx +14 -4
- package/.docs/raw/docs/cloud/langgraph.mdx +13 -3
- package/.docs/raw/docs/ink/adapters.mdx +41 -0
- package/.docs/raw/docs/ink/custom-backend.mdx +203 -0
- package/.docs/raw/docs/ink/hooks.mdx +448 -0
- package/.docs/raw/docs/ink/index.mdx +239 -0
- package/.docs/raw/docs/ink/migration.mdx +140 -0
- package/.docs/raw/docs/ink/primitives.mdx +699 -0
- package/.docs/raw/docs/react-native/adapters.mdx +63 -87
- package/.docs/raw/docs/react-native/custom-backend.mdx +11 -14
- package/.docs/raw/docs/react-native/hooks.mdx +214 -232
- package/.docs/raw/docs/react-native/index.mdx +118 -159
- package/.docs/raw/docs/react-native/migration.mdx +144 -0
- package/.docs/raw/docs/react-native/primitives.mdx +431 -302
- package/.docs/raw/docs/runtimes/a2a/index.mdx +294 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +9 -9
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +14 -3
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +59 -25
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +13 -6
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +138 -38
- package/.docs/raw/docs/runtimes/custom/local.mdx +184 -42
- package/.docs/raw/docs/runtimes/data-stream.mdx +92 -19
- package/.docs/raw/docs/runtimes/google-adk/index.mdx +624 -0
- package/.docs/raw/docs/runtimes/helicone.mdx +6 -6
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +38 -27
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +15 -20
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +7 -11
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +8 -11
- package/.docs/raw/docs/runtimes/langserve.mdx +6 -7
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +18 -3
- package/.docs/raw/docs/ui/file.mdx +5 -4
- package/.docs/raw/docs/ui/image.mdx +5 -4
- package/.docs/raw/docs/ui/markdown.mdx +3 -1
- package/.docs/raw/docs/ui/model-selector.mdx +8 -8
- package/.docs/raw/docs/ui/part-grouping.mdx +7 -10
- package/.docs/raw/docs/ui/quote.mdx +210 -0
- package/.docs/raw/docs/ui/reasoning.mdx +12 -11
- package/.docs/raw/docs/ui/sources.mdx +88 -17
- package/.docs/raw/docs/ui/streamdown.mdx +16 -7
- package/.docs/raw/docs/ui/thread-list.mdx +11 -13
- package/.docs/raw/docs/ui/thread.mdx +28 -33
- package/.docs/raw/docs/ui/tool-fallback.mdx +5 -6
- package/.docs/raw/docs/ui/tool-group.mdx +9 -8
- package/.docs/raw/docs/utilities/heat-graph.mdx +236 -0
- package/.docs/raw/docs/utilities/tw-shimmer.mdx +211 -0
- package/package.json +4 -4
- package/.docs/raw/docs/(reference)/legacy/styled/assistant-modal.mdx +0 -77
- package/.docs/raw/docs/(reference)/legacy/styled/decomposition.mdx +0 -635
- package/.docs/raw/docs/(reference)/legacy/styled/markdown.mdx +0 -77
- package/.docs/raw/docs/(reference)/legacy/styled/scrollbar.mdx +0 -72
- package/.docs/raw/docs/(reference)/legacy/styled/thread-width.mdx +0 -22
- package/.docs/raw/docs/(reference)/legacy/styled/thread.mdx +0 -77
- /package/.docs/raw/docs/cloud/{overview.mdx → index.mdx} +0 -0
|
@@ -261,7 +261,6 @@ export function MyRuntimeProvider({
|
|
|
261
261
|
"use client";
|
|
262
262
|
|
|
263
263
|
import {
|
|
264
|
-
useAssistantRuntime,
|
|
265
264
|
useAssistantTool,
|
|
266
265
|
useAui,
|
|
267
266
|
AuiProvider,
|
|
@@ -289,7 +288,7 @@ function BrowserAlertTool() {
|
|
|
289
288
|
return { status: "shown" };
|
|
290
289
|
},
|
|
291
290
|
render: ({ args, result }) => (
|
|
292
|
-
<div className="mt-3 w-full max-w-
|
|
291
|
+
<div className="mt-3 w-full max-w-(--thread-max-width) rounded-lg border px-4 py-3 text-sm">
|
|
293
292
|
<p className="font-semibold text-muted-foreground">browser_alert</p>
|
|
294
293
|
<p className="mt-1">
|
|
295
294
|
Requested alert with message:
|
|
@@ -310,11 +309,11 @@ function BrowserAlertTool() {
|
|
|
310
309
|
}
|
|
311
310
|
|
|
312
311
|
function NewThreadButton() {
|
|
313
|
-
const
|
|
312
|
+
const aui = useAui();
|
|
314
313
|
|
|
315
314
|
return (
|
|
316
315
|
<button
|
|
317
|
-
onClick={() =>
|
|
316
|
+
onClick={() => aui.threads().switchToNewThread()}
|
|
318
317
|
className="absolute top-4 right-4 z-10 flex items-center gap-2 rounded-lg border bg-background px-3 py-2 font-medium text-sm shadow-sm transition-colors hover:bg-accent"
|
|
319
318
|
>
|
|
320
319
|
<PlusIcon className="size-4" />
|
|
@@ -421,7 +420,7 @@ export default nextConfig;
|
|
|
421
420
|
"@assistant-ui/ui": "workspace:*",
|
|
422
421
|
"class-variance-authority": "^0.7.1",
|
|
423
422
|
"clsx": "^2.1.1",
|
|
424
|
-
"lucide-react": "^0.
|
|
423
|
+
"lucide-react": "^0.577.0",
|
|
425
424
|
"next": "^16.1.6",
|
|
426
425
|
"react": "^19.2.4",
|
|
427
426
|
"react-dom": "^19.2.4",
|
|
@@ -430,7 +429,7 @@ export default nextConfig;
|
|
|
430
429
|
"devDependencies": {
|
|
431
430
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
432
431
|
"@tailwindcss/postcss": "^4.2.1",
|
|
433
|
-
"@types/node": "^25.
|
|
432
|
+
"@types/node": "^25.5.0",
|
|
434
433
|
"@types/react": "^19.2.14",
|
|
435
434
|
"@types/react-dom": "^19.2.3",
|
|
436
435
|
"postcss": "^8.5.8",
|
|
@@ -4,27 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
```typescript
|
|
6
6
|
import { openai } from "@ai-sdk/openai";
|
|
7
|
+
import { frontendTools } from "@assistant-ui/react-ai-sdk";
|
|
7
8
|
import {
|
|
9
|
+
JSONSchema7,
|
|
8
10
|
streamText,
|
|
9
11
|
convertToModelMessages,
|
|
12
|
+
type UIMessage,
|
|
10
13
|
tool,
|
|
11
14
|
stepCountIs,
|
|
12
15
|
zodSchema,
|
|
13
16
|
} from "ai";
|
|
14
|
-
import type { UIMessage } from "ai";
|
|
15
17
|
import { z } from "zod";
|
|
16
18
|
|
|
17
19
|
// Allow streaming responses up to 30 seconds
|
|
18
20
|
export const maxDuration = 30;
|
|
19
21
|
|
|
20
22
|
export async function POST(req: Request) {
|
|
21
|
-
const {
|
|
23
|
+
const {
|
|
24
|
+
messages,
|
|
25
|
+
system,
|
|
26
|
+
tools,
|
|
27
|
+
}: {
|
|
28
|
+
messages: UIMessage[];
|
|
29
|
+
system?: string;
|
|
30
|
+
tools?: Record<string, { description?: string; parameters: JSONSchema7 }>;
|
|
31
|
+
} = await req.json();
|
|
22
32
|
|
|
23
33
|
const result = streamText({
|
|
24
34
|
model: openai("gpt-4o"),
|
|
25
35
|
messages: await convertToModelMessages(messages),
|
|
36
|
+
...(system ? { system } : {}),
|
|
26
37
|
stopWhen: stepCountIs(10),
|
|
27
38
|
tools: {
|
|
39
|
+
...frontendTools(tools ?? {}),
|
|
28
40
|
get_current_weather: tool({
|
|
29
41
|
description: "Get the current weather",
|
|
30
42
|
inputSchema: zodSchema(
|
|
@@ -179,8 +191,8 @@ import type { Metadata } from "next";
|
|
|
179
191
|
import "./globals.css";
|
|
180
192
|
|
|
181
193
|
export const metadata: Metadata = {
|
|
182
|
-
title: "AI SDK
|
|
183
|
-
description: "Example using @assistant-ui/react with AI SDK
|
|
194
|
+
title: "AI SDK v6 Example",
|
|
195
|
+
description: "Example using @assistant-ui/react with AI SDK v6",
|
|
184
196
|
};
|
|
185
197
|
|
|
186
198
|
export default function RootLayout({
|
|
@@ -303,15 +315,15 @@ export default nextConfig;
|
|
|
303
315
|
"start": "next start"
|
|
304
316
|
},
|
|
305
317
|
"dependencies": {
|
|
306
|
-
"@ai-sdk/openai": "^3.0.
|
|
318
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
307
319
|
"@assistant-ui/react": "workspace:*",
|
|
308
320
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
309
321
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
310
322
|
"@assistant-ui/ui": "workspace:*",
|
|
311
|
-
"ai": "^6.0.
|
|
323
|
+
"ai": "^6.0.116",
|
|
312
324
|
"class-variance-authority": "^0.7.1",
|
|
313
325
|
"clsx": "^2.1.1",
|
|
314
|
-
"lucide-react": "^0.
|
|
326
|
+
"lucide-react": "^0.577.0",
|
|
315
327
|
"next": "^16.1.6",
|
|
316
328
|
"react": "^19.2.4",
|
|
317
329
|
"react-dom": "^19.2.4",
|
|
@@ -321,7 +333,7 @@ export default nextConfig;
|
|
|
321
333
|
"devDependencies": {
|
|
322
334
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
323
335
|
"@tailwindcss/postcss": "^4.2.1",
|
|
324
|
-
"@types/node": "^25.
|
|
336
|
+
"@types/node": "^25.5.0",
|
|
325
337
|
"@types/react": "^19.2.14",
|
|
326
338
|
"@types/react-dom": "^19.2.3",
|
|
327
339
|
"postcss": "^8.5.8",
|
|
@@ -353,26 +365,26 @@ cd my-app
|
|
|
353
365
|
|
|
354
366
|
Create `.env.local`:
|
|
355
367
|
|
|
356
|
-
```
|
|
357
|
-
|
|
368
|
+
```sh
|
|
369
|
+
OPENAI_API_KEY=your-api-key-here
|
|
358
370
|
```
|
|
359
371
|
|
|
360
372
|
### Run
|
|
361
373
|
|
|
362
374
|
```bash
|
|
363
|
-
|
|
364
|
-
|
|
375
|
+
pnpm install
|
|
376
|
+
pnpm dev
|
|
365
377
|
```
|
|
366
378
|
|
|
367
379
|
Open [http://localhost:3000](http://localhost:3000) to see the result.
|
|
368
380
|
|
|
369
381
|
## Key Features
|
|
370
382
|
|
|
371
|
-
- Uses the new AI SDK v6 with `@ai-sdk/
|
|
383
|
+
- Uses the new AI SDK v6 with `@ai-sdk/openai`
|
|
372
384
|
- Integrates with `@assistant-ui/react` using the new `useChatRuntime` hook
|
|
373
385
|
- No RSC support (client-side only)
|
|
374
386
|
- Simplified integration with the `useChatRuntime` hook that wraps AI SDK v6's `useChat`
|
|
375
|
-
-
|
|
387
|
+
- Uses `AssistantChatTransport` to pass system messages and frontend tools to the backend
|
|
376
388
|
|
|
377
389
|
## Custom Transport Configuration
|
|
378
390
|
|
|
@@ -406,7 +418,7 @@ const runtime = useChatRuntime({
|
|
|
406
418
|
|
|
407
419
|
## API Route
|
|
408
420
|
|
|
409
|
-
The API route at `/api/chat` uses
|
|
421
|
+
The API route at `/api/chat` uses AI SDK v6 `streamText`, forwards `system` and frontend `tools`, and merges them with a server-defined weather tool.
|
|
410
422
|
|
|
411
423
|
## Related Documentation
|
|
412
424
|
|
|
@@ -413,15 +413,15 @@ export default nextConfig;
|
|
|
413
413
|
"start": "next start"
|
|
414
414
|
},
|
|
415
415
|
"dependencies": {
|
|
416
|
-
"@ai-sdk/openai": "^3.0.
|
|
416
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
417
417
|
"@assistant-ui/react": "workspace:*",
|
|
418
418
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
419
419
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
420
420
|
"@assistant-ui/ui": "workspace:*",
|
|
421
|
-
"ai": "^6.0.
|
|
421
|
+
"ai": "^6.0.116",
|
|
422
422
|
"class-variance-authority": "^0.7.1",
|
|
423
423
|
"clsx": "^2.1.1",
|
|
424
|
-
"lucide-react": "^0.
|
|
424
|
+
"lucide-react": "^0.577.0",
|
|
425
425
|
"next": "^16.1.6",
|
|
426
426
|
"react": "^19.2.4",
|
|
427
427
|
"react-dom": "^19.2.4",
|
|
@@ -431,7 +431,7 @@ export default nextConfig;
|
|
|
431
431
|
"devDependencies": {
|
|
432
432
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
433
433
|
"@tailwindcss/postcss": "^4.2.1",
|
|
434
|
-
"@types/node": "^25.
|
|
434
|
+
"@types/node": "^25.5.0",
|
|
435
435
|
"@types/react": "^19.2.14",
|
|
436
436
|
"@types/react-dom": "^19.2.3",
|
|
437
437
|
"postcss": "^8.5.8",
|
|
@@ -423,7 +423,7 @@ export default nextConfig;
|
|
|
423
423
|
"@assistant-ui/ui": "workspace:*",
|
|
424
424
|
"class-variance-authority": "^0.7.1",
|
|
425
425
|
"clsx": "^2.1.1",
|
|
426
|
-
"lucide-react": "^0.
|
|
426
|
+
"lucide-react": "^0.577.0",
|
|
427
427
|
"next": "^16.1.6",
|
|
428
428
|
"react": "^19.2.4",
|
|
429
429
|
"react-dom": "^19.2.4",
|
|
@@ -433,7 +433,7 @@ export default nextConfig;
|
|
|
433
433
|
"devDependencies": {
|
|
434
434
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
435
435
|
"@tailwindcss/postcss": "^4.2.1",
|
|
436
|
-
"@types/node": "^25.
|
|
436
|
+
"@types/node": "^25.5.0",
|
|
437
437
|
"@types/react": "^19.2.14",
|
|
438
438
|
"@types/react-dom": "^19.2.3",
|
|
439
439
|
"postcss": "^8.5.8",
|
|
@@ -212,7 +212,6 @@ export default function RootLayout({
|
|
|
212
212
|
|
|
213
213
|
import { type FC, type PropsWithChildren, useState } from "react";
|
|
214
214
|
import { MarkdownText } from "@/components/assistant-ui/markdown-text";
|
|
215
|
-
import { ToolFallback } from "@/components/assistant-ui/tool-fallback";
|
|
216
215
|
import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button";
|
|
217
216
|
import { Button } from "@/components/ui/button";
|
|
218
217
|
import {
|
|
@@ -238,9 +237,12 @@ export const MyThread: FC = () => {
|
|
|
238
237
|
style={{ ["--thread-max-width" as string]: "44rem" }}
|
|
239
238
|
>
|
|
240
239
|
<ThreadPrimitive.Viewport className="flex flex-1 flex-col overflow-y-scroll scroll-smooth px-4 pt-8">
|
|
241
|
-
<ThreadPrimitive.Messages
|
|
242
|
-
|
|
243
|
-
|
|
240
|
+
<ThreadPrimitive.Messages>
|
|
241
|
+
{({ message }) => {
|
|
242
|
+
if (message.role === "user") return <UserMessage />;
|
|
243
|
+
return <AssistantMessage />;
|
|
244
|
+
}}
|
|
245
|
+
</ThreadPrimitive.Messages>
|
|
244
246
|
|
|
245
247
|
<ThreadPrimitive.ViewportFooter className="sticky bottom-0 mx-auto mt-auto flex w-full max-w-(--thread-max-width) flex-col gap-4 pb-4">
|
|
246
248
|
<ThreadPrimitive.ScrollToBottom asChild>
|
|
@@ -268,7 +270,12 @@ const UserMessage: FC = () => {
|
|
|
268
270
|
<MessagePrimitive.Root className="mx-auto w-full max-w-(--thread-max-width) py-3">
|
|
269
271
|
<div className="flex justify-end">
|
|
270
272
|
<div className="max-w-[80%] rounded-2xl bg-primary px-4 py-2 text-primary-foreground">
|
|
271
|
-
<MessagePrimitive.Parts
|
|
273
|
+
<MessagePrimitive.Parts>
|
|
274
|
+
{({ part }) => {
|
|
275
|
+
if (part.type === "text") return <Text {...part} />;
|
|
276
|
+
return null;
|
|
277
|
+
}}
|
|
278
|
+
</MessagePrimitive.Parts>
|
|
272
279
|
</div>
|
|
273
280
|
</div>
|
|
274
281
|
</MessagePrimitive.Root>
|
|
@@ -279,17 +286,14 @@ const AssistantMessage: FC = () => {
|
|
|
279
286
|
return (
|
|
280
287
|
<MessagePrimitive.Root className="mx-auto w-full max-w-(--thread-max-width) py-3">
|
|
281
288
|
<div className="flex flex-col gap-2 px-2 leading-relaxed">
|
|
282
|
-
{/*
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
<MessagePrimitive.Parts
|
|
288
|
-
components={{
|
|
289
|
-
Text: MarkdownText,
|
|
290
|
-
ChainOfThought,
|
|
289
|
+
{/* Text parts are rendered inline; ChainOfThought is rendered separately below. */}
|
|
290
|
+
<MessagePrimitive.Parts>
|
|
291
|
+
{({ part }) => {
|
|
292
|
+
if (part.type === "text") return <MarkdownText />;
|
|
293
|
+
return null;
|
|
291
294
|
}}
|
|
292
|
-
|
|
295
|
+
</MessagePrimitive.Parts>
|
|
296
|
+
<ChainOfThought />
|
|
293
297
|
</div>
|
|
294
298
|
</MessagePrimitive.Root>
|
|
295
299
|
);
|
|
@@ -315,13 +319,17 @@ const ChainOfThought: FC = () => {
|
|
|
315
319
|
Thinking
|
|
316
320
|
</ChainOfThoughtPrimitive.AccordionTrigger>
|
|
317
321
|
<AuiIf condition={(s) => !s.chainOfThought.collapsed}>
|
|
318
|
-
<ChainOfThoughtPrimitive.Parts
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
322
|
+
<ChainOfThoughtPrimitive.Parts>
|
|
323
|
+
{({ part }) => {
|
|
324
|
+
if (part.type === "reasoning")
|
|
325
|
+
return (
|
|
326
|
+
<PartLayout>
|
|
327
|
+
<Reasoning {...part} />
|
|
328
|
+
</PartLayout>
|
|
329
|
+
);
|
|
330
|
+
return null;
|
|
323
331
|
}}
|
|
324
|
-
|
|
332
|
+
</ChainOfThoughtPrimitive.Parts>
|
|
325
333
|
</AuiIf>
|
|
326
334
|
</ChainOfThoughtPrimitive.Root>
|
|
327
335
|
);
|
|
@@ -549,15 +557,15 @@ export default nextConfig;
|
|
|
549
557
|
"start": "next start"
|
|
550
558
|
},
|
|
551
559
|
"dependencies": {
|
|
552
|
-
"@ai-sdk/openai": "^3.0.
|
|
560
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
553
561
|
"@assistant-ui/react": "workspace:*",
|
|
554
562
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
555
563
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
556
564
|
"@assistant-ui/ui": "workspace:*",
|
|
557
|
-
"ai": "^6.0.
|
|
565
|
+
"ai": "^6.0.116",
|
|
558
566
|
"class-variance-authority": "^0.7.1",
|
|
559
567
|
"clsx": "^2.1.1",
|
|
560
|
-
"lucide-react": "^0.
|
|
568
|
+
"lucide-react": "^0.577.0",
|
|
561
569
|
"next": "^16.1.6",
|
|
562
570
|
"react": "^19.2.4",
|
|
563
571
|
"react-dom": "^19.2.4",
|
|
@@ -567,7 +575,7 @@ export default nextConfig;
|
|
|
567
575
|
"devDependencies": {
|
|
568
576
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
569
577
|
"@tailwindcss/postcss": "^4.2.1",
|
|
570
|
-
"@types/node": "^25.
|
|
578
|
+
"@types/node": "^25.5.0",
|
|
571
579
|
"@types/react": "^19.2.14",
|
|
572
580
|
"@types/react-dom": "^19.2.3",
|
|
573
581
|
"postcss": "^8.5.8",
|
|
@@ -19,10 +19,14 @@ export async function POST(req: Request) {
|
|
|
19
19
|
|
|
20
20
|
return result.toUIMessageStreamResponse({
|
|
21
21
|
messageMetadata: ({ part }) => {
|
|
22
|
+
if (part.type === "finish") {
|
|
23
|
+
return {
|
|
24
|
+
usage: part.totalUsage,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
22
27
|
if (part.type === "finish-step") {
|
|
23
28
|
return {
|
|
24
29
|
modelId: part.response.modelId,
|
|
25
|
-
usage: part.usage,
|
|
26
30
|
};
|
|
27
31
|
}
|
|
28
32
|
return undefined;
|
|
@@ -561,13 +565,12 @@ export default nextConfig;
|
|
|
561
565
|
"start": "next start"
|
|
562
566
|
},
|
|
563
567
|
"dependencies": {
|
|
564
|
-
"@ai-sdk/openai": "^3.0.
|
|
568
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
565
569
|
"@assistant-ui/cloud-ai-sdk": "workspace:*",
|
|
566
|
-
"ai": "^6.0.
|
|
567
|
-
"assistant-cloud": "workspace:*",
|
|
570
|
+
"ai": "^6.0.116",
|
|
568
571
|
"class-variance-authority": "^0.7.1",
|
|
569
572
|
"clsx": "^2.1.1",
|
|
570
|
-
"lucide-react": "^0.
|
|
573
|
+
"lucide-react": "^0.577.0",
|
|
571
574
|
"next": "^16.1.6",
|
|
572
575
|
"react": "^19.2.4",
|
|
573
576
|
"react-dom": "^19.2.4",
|
|
@@ -576,7 +579,7 @@ export default nextConfig;
|
|
|
576
579
|
"devDependencies": {
|
|
577
580
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
578
581
|
"@tailwindcss/postcss": "^4.2.1",
|
|
579
|
-
"@types/node": "^25.
|
|
582
|
+
"@types/node": "^25.5.0",
|
|
580
583
|
"@types/react": "^19.2.14",
|
|
581
584
|
"@types/react-dom": "^19.2.3",
|
|
582
585
|
"postcss": "^8.5.8",
|
|
@@ -327,15 +327,15 @@ export default nextConfig;
|
|
|
327
327
|
"start": "next start"
|
|
328
328
|
},
|
|
329
329
|
"dependencies": {
|
|
330
|
-
"@ai-sdk/openai": "^3.0.
|
|
330
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
331
331
|
"@assistant-ui/react": "workspace:*",
|
|
332
332
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
333
333
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
334
334
|
"@assistant-ui/ui": "workspace:*",
|
|
335
|
-
"ai": "^6.0.
|
|
335
|
+
"ai": "^6.0.116",
|
|
336
336
|
"class-variance-authority": "^0.7.1",
|
|
337
337
|
"clsx": "^2.1.1",
|
|
338
|
-
"lucide-react": "^0.
|
|
338
|
+
"lucide-react": "^0.577.0",
|
|
339
339
|
"next": "^16.1.6",
|
|
340
340
|
"react": "^19.2.4",
|
|
341
341
|
"react-dom": "^19.2.4",
|
|
@@ -344,7 +344,7 @@ export default nextConfig;
|
|
|
344
344
|
"devDependencies": {
|
|
345
345
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
346
346
|
"@tailwindcss/postcss": "^4.2.1",
|
|
347
|
-
"@types/node": "^25.
|
|
347
|
+
"@types/node": "^25.5.0",
|
|
348
348
|
"@types/react": "^19.2.14",
|
|
349
349
|
"@types/react-dom": "^19.2.3",
|
|
350
350
|
"postcss": "^8.5.8",
|
|
@@ -209,8 +209,8 @@ export default function RootLayout({
|
|
|
209
209
|
import type { ReactNode } from "react";
|
|
210
210
|
import {
|
|
211
211
|
AssistantRuntimeProvider,
|
|
212
|
-
|
|
213
|
-
type
|
|
212
|
+
useRemoteThreadListRuntime,
|
|
213
|
+
type RemoteThreadListAdapter,
|
|
214
214
|
} from "@assistant-ui/react";
|
|
215
215
|
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
216
216
|
import { createAssistantStream } from "assistant-stream";
|
|
@@ -414,16 +414,16 @@ export default nextConfig;
|
|
|
414
414
|
"start": "next start"
|
|
415
415
|
},
|
|
416
416
|
"dependencies": {
|
|
417
|
-
"@ai-sdk/openai": "^3.0.
|
|
417
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
418
418
|
"@assistant-ui/react": "workspace:*",
|
|
419
419
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
420
420
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
421
421
|
"@assistant-ui/ui": "workspace:*",
|
|
422
|
-
"ai": "^6.0.
|
|
422
|
+
"ai": "^6.0.116",
|
|
423
423
|
"assistant-stream": "workspace:*",
|
|
424
424
|
"class-variance-authority": "^0.7.1",
|
|
425
425
|
"clsx": "^2.1.1",
|
|
426
|
-
"lucide-react": "^0.
|
|
426
|
+
"lucide-react": "^0.577.0",
|
|
427
427
|
"next": "^16.1.6",
|
|
428
428
|
"react": "^19.2.4",
|
|
429
429
|
"react-dom": "^19.2.4",
|
|
@@ -433,7 +433,7 @@ export default nextConfig;
|
|
|
433
433
|
"devDependencies": {
|
|
434
434
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
435
435
|
"@tailwindcss/postcss": "^4.2.1",
|
|
436
|
-
"@types/node": "^25.
|
|
436
|
+
"@types/node": "^25.5.0",
|
|
437
437
|
"@types/react": "^19.2.14",
|
|
438
438
|
"@types/react-dom": "^19.2.3",
|
|
439
439
|
"postcss": "^8.5.8",
|
|
@@ -562,19 +562,19 @@ export default nextConfig;
|
|
|
562
562
|
"version": "0.0.0",
|
|
563
563
|
"type": "module",
|
|
564
564
|
"dependencies": {
|
|
565
|
-
"@ai-sdk/openai": "^3.0.
|
|
566
|
-
"@ai-sdk/react": "^3.0.
|
|
565
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
566
|
+
"@ai-sdk/react": "^3.0.118",
|
|
567
567
|
"@assistant-ui/react": "workspace:^",
|
|
568
568
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
569
569
|
"@assistant-ui/react-markdown": "workspace:^",
|
|
570
570
|
"@assistant-ui/ui": "workspace:*",
|
|
571
|
-
"@elevenlabs/client": "^0.15.
|
|
571
|
+
"@elevenlabs/client": "^0.15.1",
|
|
572
572
|
"@tailwindcss/postcss": "^4.2.1",
|
|
573
|
-
"ai": "^6.0.
|
|
573
|
+
"ai": "^6.0.116",
|
|
574
574
|
"class-variance-authority": "^0.7.1",
|
|
575
575
|
"clsx": "^2.1.1",
|
|
576
|
-
"lucide-react": "^0.
|
|
577
|
-
"motion": "^12.
|
|
576
|
+
"lucide-react": "^0.577.0",
|
|
577
|
+
"motion": "^12.36.0",
|
|
578
578
|
"next": "^16.1.6",
|
|
579
579
|
"postcss": "^8.5.8",
|
|
580
580
|
"react": "^19.2.4",
|
|
@@ -585,7 +585,7 @@ export default nextConfig;
|
|
|
585
585
|
},
|
|
586
586
|
"devDependencies": {
|
|
587
587
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
588
|
-
"@types/node": "^25.
|
|
588
|
+
"@types/node": "^25.5.0",
|
|
589
589
|
"@types/react": "^19.2.14",
|
|
590
590
|
"@types/react-dom": "^19.2.3",
|
|
591
591
|
"tw-animate-css": "^1.4.0",
|