ai 4.0.0-canary.2 → 4.0.0-canary.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "4.0.0-canary.2",
3
+ "version": "4.0.0-canary.4",
4
4
  "description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -41,14 +41,11 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@ai-sdk/provider": "1.0.0-canary.0",
44
- "@ai-sdk/provider-utils": "2.0.0-canary.0",
45
- "@ai-sdk/react": "1.0.0-canary.2",
46
- "@ai-sdk/ui-utils": "1.0.0-canary.2",
44
+ "@ai-sdk/provider-utils": "2.0.0-canary.2",
45
+ "@ai-sdk/react": "1.0.0-canary.4",
46
+ "@ai-sdk/ui-utils": "1.0.0-canary.4",
47
47
  "@opentelemetry/api": "1.9.0",
48
- "eventsource-parser": "1.1.2",
49
48
  "jsondiffpatch": "0.6.0",
50
- "json-schema": "^0.4.0",
51
- "secure-json-parse": "^2.7.0",
52
49
  "zod-to-json-schema": "^3.23.3"
53
50
  },
54
51
  "devDependencies": {
@@ -68,7 +65,7 @@
68
65
  "react-dom": "^18",
69
66
  "react-server-dom-webpack": "18.3.0-canary-eb33bd747-20240312",
70
67
  "tsup": "^7.2.0",
71
- "typescript": "5.5.4",
68
+ "typescript": "5.6.3",
72
69
  "zod": "3.23.8",
73
70
  "@vercel/ai-tsconfig": "0.0.0",
74
71
  "eslint-config-vercel-ai": "0.0.0"
@@ -111,7 +108,7 @@
111
108
  "nextjs"
112
109
  ],
113
110
  "scripts": {
114
- "build": "tsup && cat react/dist/index.server.d.ts >> react/dist/index.d.ts",
111
+ "build": "tsup",
115
112
  "clean": "rm -rf dist && rm -rf react/dist && rm -rf rsc/dist",
116
113
  "dev": "tsup --watch",
117
114
  "lint": "eslint \"./**/*.ts*\"",
@@ -8,20 +8,3 @@ declare const useAssistant: typeof useAssistant$1;
8
8
  declare const experimental_useObject: <RESULT, INPUT = any>({ api, id, schema, initialValue, fetch, onError, onFinish, headers, }: _ai_sdk_react.Experimental_UseObjectOptions<RESULT>) => _ai_sdk_react.Experimental_UseObjectHelpers<RESULT, INPUT>;
9
9
 
10
10
  export { experimental_useObject, useAssistant, useChat, useCompletion };
11
- import * as react_jsx_runtime from 'react/jsx-runtime';
12
-
13
- type Props = {
14
- /**
15
- * A ReadableStream produced by the AI SDK.
16
- */
17
- stream: ReadableStream;
18
- };
19
- /**
20
- A React Server Component that recursively renders a stream of tokens.
21
- Can only be used inside of server components.
22
-
23
- @deprecated Use RSCs / Generative AI instead.
24
- */
25
- declare function Tokens(props: Props): Promise<react_jsx_runtime.JSX.Element>;
26
-
27
- export { Tokens };
@@ -437,7 +437,7 @@ It can be a user message, an assistant message, or a tool message.
437
437
  type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage | CoreToolMessage;
438
438
 
439
439
  type UIMessage = {
440
- role: 'system' | 'user' | 'assistant' | 'function' | 'data' | 'tool';
440
+ role: 'system' | 'user' | 'assistant' | 'data';
441
441
  content: string;
442
442
  toolInvocations?: ToolInvocation[];
443
443
  experimental_attachments?: Attachment[];
@@ -435,7 +435,7 @@ It can be a user message, an assistant message, or a tool message.
435
435
  type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage | CoreToolMessage;
436
436
 
437
437
  type UIMessage = {
438
- role: 'system' | 'user' | 'assistant' | 'function' | 'data' | 'tool';
438
+ role: 'system' | 'user' | 'assistant' | 'data';
439
439
  content: string;
440
440
  toolInvocations?: ToolInvocation[];
441
441
  experimental_attachments?: Attachment[];
@@ -1092,9 +1092,7 @@ function convertToCoreMessages(messages, options) {
1092
1092
  });
1093
1093
  break;
1094
1094
  }
1095
- case "function":
1096
- case "data":
1097
- case "tool": {
1095
+ case "data": {
1098
1096
  break;
1099
1097
  }
1100
1098
  default: {
@@ -1213,12 +1211,6 @@ var InvalidToolArgumentsError = class extends AISDKError6 {
1213
1211
  static isInstance(error) {
1214
1212
  return AISDKError6.hasMarker(error, marker6);
1215
1213
  }
1216
- /**
1217
- * @deprecated use `isInstance` instead
1218
- */
1219
- static isInvalidToolArgumentsError(error) {
1220
- return error instanceof Error && error.name === name6 && typeof error.toolName === "string" && typeof error.toolArgs === "string";
1221
- }
1222
1214
  };
1223
1215
  _a6 = symbol6;
1224
1216