diff --git a/components/message.tsx b/components/message.tsx
index 1ebe1b933..9f88ae264 100644
--- a/components/message.tsx
+++ b/components/message.tsx
@@ -3,17 +3,12 @@
import type { ChatRequestOptions, Message } from 'ai';
import cx from 'classnames';
import { AnimatePresence, motion } from 'framer-motion';
-import { memo, useMemo, useState } from 'react';
+import { memo, useState } from 'react';
import type { Vote } from '@/lib/db/schema';
import { DocumentToolCall, DocumentToolResult } from './document';
-import {
- ChevronDownIcon,
- LoaderIcon,
- PencilEditIcon,
- SparklesIcon,
-} from './icons';
+import { PencilEditIcon, SparklesIcon } from './icons';
import { Markdown } from './markdown';
import { MessageActions } from './message-actions';
import { PreviewAttachment } from './preview-attachment';
@@ -90,72 +85,84 @@ const PurePreviewMessage = ({
)}
- {message.reasoning && (
-
- )}
-
- {(message.content || message.reasoning) && mode === 'view' && (
-
- {message.role === 'user' && !isReadonly && (
-
-
-
+
+ Edit message
+
+ )}
- {message.toolInvocations && message.toolInvocations.length > 0 && (
-
- {message.toolInvocations.map((toolInvocation) => {
- const { toolName, toolCallId, state, args } = toolInvocation;
+
+ {p.text}
+
+
+ );
+ }
+ if (mode === 'edit') {
+ return (
+
+ );
+ }
+ return null;
+ case 'reasoning':
+ return (
+
+ );
+ case 'tool-invocation':
+ const { toolName, toolCallId, state, args } =
+ p.toolInvocation;
if (state === 'result') {
- const { result } = toolInvocation;
+ const { result } = p.toolInvocation;
return (
@@ -210,9 +217,10 @@ const PurePreviewMessage = ({
) : null}
);
- })}
-
- )}
+ default:
+ return null;
+ }
+ })}
{!isReadonly && (
=18'}
+ peerDependencies:
+ zod: ^3.0.0
+ peerDependenciesMeta:
+ zod:
+ optional: true
+
'@ai-sdk/provider@1.0.7':
resolution: {integrity: sha512-q1PJEZ0qD9rVR+8JFEd01/QM++csMT5UVwYXSN2u54BrVw/D8TZLTeg2FEfKK00DgAx0UtWd8XOhhwITP9BT5g==}
engines: {node: '>=18'}
- '@ai-sdk/react@1.1.8':
- resolution: {integrity: sha512-buHm7hP21xEOksnRQtJX9fKbi7cAUwanEBa5niddTDibCDKd+kIXP2vaJGy8+heB3rff+XSW3BWlA8pscK+n1g==}
+ '@ai-sdk/provider@1.0.8':
+ resolution: {integrity: sha512-f9jSYwKMdXvm44Dmab1vUBnfCDSFfI5rOtvV1W9oKB7WYHR5dGvCC6x68Mk3NUfrdmNoMVHGoh6JT9HCVMlMow==}
+ engines: {node: '>=18'}
+
+ '@ai-sdk/react@1.1.17':
+ resolution: {integrity: sha512-NAuEflFvjw1uh1AOmpyi7rBF4xasWsiWUb86JQ8ScjDGxoGDYEdBnaHOxUpooLna0dGNbSPkvDMnVRhoLKoxPQ==}
engines: {node: '>=18'}
peerDependencies:
react: ^18 || ^19 || ^19.0.0-rc
@@ -301,8 +314,8 @@ packages:
zod:
optional: true
- '@ai-sdk/ui-utils@1.1.8':
- resolution: {integrity: sha512-nbok53K1EalO2sZjBLFB33cqs+8SxiL6pe7ekZ7+5f2MJTwdvpShl6d9U4O8fO3DnZ9pYLzaVC0XNMxnJt030Q==}
+ '@ai-sdk/ui-utils@1.1.15':
+ resolution: {integrity: sha512-NsV/3CMmjc4m53snzRdtZM6teTQUXIKi8u0Kf7GBruSzaMSuZ4DWaAAlUshhR3p2FpZgtsogW+vYG1/rXsGu+Q==}
engines: {node: '>=18'}
peerDependencies:
zod: ^3.0.0
@@ -1662,8 +1675,8 @@ packages:
engines: {node: '>=0.4.0'}
hasBin: true
- ai@4.1.17:
- resolution: {integrity: sha512-5SW15tXDuxE/wlEOjRKxLxTOUIGD4C9bIee+FCFvXHTTAZhHiQjViC2s7RtMUW+hbFtGya302jUHY1Pe8A/YuQ==}
+ ai@4.1.44:
+ resolution: {integrity: sha512-2THAHlSdZkRemTu7XinH5wckO3QprrniKg31fczgg4RKvsow0OztsLalwcIGoo69S0WN4BErNKkBisT+wXREZg==}
engines: {node: '>=18'}
peerDependencies:
react: ^18 || ^19 || ^19.0.0-rc
@@ -3827,24 +3840,37 @@ snapshots:
optionalDependencies:
zod: 3.23.8
+ '@ai-sdk/provider-utils@2.1.9(zod@3.23.8)':
+ dependencies:
+ '@ai-sdk/provider': 1.0.8
+ eventsource-parser: 3.0.0
+ nanoid: 3.3.8
+ secure-json-parse: 2.7.0
+ optionalDependencies:
+ zod: 3.23.8
+
'@ai-sdk/provider@1.0.7':
dependencies:
json-schema: 0.4.0
- '@ai-sdk/react@1.1.8(react@19.0.0-rc-45804af1-20241021)(zod@3.23.8)':
+ '@ai-sdk/provider@1.0.8':
dependencies:
- '@ai-sdk/provider-utils': 2.1.6(zod@3.23.8)
- '@ai-sdk/ui-utils': 1.1.8(zod@3.23.8)
+ json-schema: 0.4.0
+
+ '@ai-sdk/react@1.1.17(react@19.0.0-rc-45804af1-20241021)(zod@3.23.8)':
+ dependencies:
+ '@ai-sdk/provider-utils': 2.1.9(zod@3.23.8)
+ '@ai-sdk/ui-utils': 1.1.15(zod@3.23.8)
swr: 2.2.5(react@19.0.0-rc-45804af1-20241021)
throttleit: 2.1.0
optionalDependencies:
react: 19.0.0-rc-45804af1-20241021
zod: 3.23.8
- '@ai-sdk/ui-utils@1.1.8(zod@3.23.8)':
+ '@ai-sdk/ui-utils@1.1.15(zod@3.23.8)':
dependencies:
- '@ai-sdk/provider': 1.0.7
- '@ai-sdk/provider-utils': 2.1.6(zod@3.23.8)
+ '@ai-sdk/provider': 1.0.8
+ '@ai-sdk/provider-utils': 2.1.9(zod@3.23.8)
zod-to-json-schema: 3.24.1(zod@3.23.8)
optionalDependencies:
zod: 3.23.8
@@ -4958,12 +4984,12 @@ snapshots:
acorn@8.14.0: {}
- ai@4.1.17(react@19.0.0-rc-45804af1-20241021)(zod@3.23.8):
+ ai@4.1.44(react@19.0.0-rc-45804af1-20241021)(zod@3.23.8):
dependencies:
- '@ai-sdk/provider': 1.0.7
- '@ai-sdk/provider-utils': 2.1.6(zod@3.23.8)
- '@ai-sdk/react': 1.1.8(react@19.0.0-rc-45804af1-20241021)(zod@3.23.8)
- '@ai-sdk/ui-utils': 1.1.8(zod@3.23.8)
+ '@ai-sdk/provider': 1.0.8
+ '@ai-sdk/provider-utils': 2.1.9(zod@3.23.8)
+ '@ai-sdk/react': 1.1.17(react@19.0.0-rc-45804af1-20241021)(zod@3.23.8)
+ '@ai-sdk/ui-utils': 1.1.15(zod@3.23.8)
'@opentelemetry/api': 1.9.0
jsondiffpatch: 0.6.0
optionalDependencies: