ai 5.0.0-canary.3 → 5.0.0-canary.5
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/CHANGELOG.md +30 -0
- package/dist/index.d.mts +1038 -178
- package/dist/index.d.ts +1038 -178
- package/dist/index.js +1839 -229
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1749 -178
- package/dist/index.mjs.map +1 -1
- package/{rsc/dist/rsc-server.d.mts → dist/internal/index.d.mts} +400 -366
- package/dist/internal/index.d.ts +782 -0
- package/dist/internal/index.js +1483 -0
- package/dist/internal/index.js.map +1 -0
- package/{rsc/dist/rsc-server.mjs → dist/internal/index.mjs} +1075 -1771
- package/dist/internal/index.mjs.map +1 -0
- package/mcp-stdio/dist/index.d.mts +6 -6
- package/mcp-stdio/dist/index.d.ts +6 -6
- package/mcp-stdio/dist/index.js +1 -1
- package/mcp-stdio/dist/index.js.map +1 -1
- package/mcp-stdio/dist/index.mjs +1 -1
- package/mcp-stdio/dist/index.mjs.map +1 -1
- package/mcp-stdio/get-environment.test.ts +13 -0
- package/mcp-stdio/get-environment.ts +1 -1
- package/package.json +14 -27
- package/rsc/dist/index.d.ts +0 -813
- package/rsc/dist/index.mjs +0 -18
- package/rsc/dist/rsc-client.d.mts +0 -1
- package/rsc/dist/rsc-client.mjs +0 -18
- package/rsc/dist/rsc-client.mjs.map +0 -1
- package/rsc/dist/rsc-server.mjs.map +0 -1
- package/rsc/dist/rsc-shared.d.mts +0 -101
- package/rsc/dist/rsc-shared.mjs +0 -308
- package/rsc/dist/rsc-shared.mjs.map +0 -1
@@ -0,0 +1,13 @@
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
2
|
+
import { getEnvironment } from './get-environment';
|
3
|
+
|
4
|
+
describe('getEnvironment', () => {
|
5
|
+
it('should not mutate the original custom environment object', () => {
|
6
|
+
const customEnv = { CUSTOM_VAR: 'custom_value' };
|
7
|
+
|
8
|
+
const result = getEnvironment(customEnv);
|
9
|
+
|
10
|
+
expect(customEnv).toStrictEqual({ CUSTOM_VAR: 'custom_value' });
|
11
|
+
expect(result).not.toBe(customEnv);
|
12
|
+
});
|
13
|
+
});
|
@@ -24,7 +24,7 @@ export function getEnvironment(
|
|
24
24
|
]
|
25
25
|
: ['HOME', 'LOGNAME', 'PATH', 'SHELL', 'TERM', 'USER'];
|
26
26
|
|
27
|
-
const env: Record<string, string> = customEnv
|
27
|
+
const env: Record<string, string> = customEnv ? { ...customEnv } : {};
|
28
28
|
|
29
29
|
for (const key of DEFAULT_INHERITED_ENV_VARS) {
|
30
30
|
const value = globalThis.process.env[key];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ai",
|
3
|
-
"version": "5.0.0-canary.
|
3
|
+
"version": "5.0.0-canary.5",
|
4
4
|
"description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"sideEffects": false,
|
@@ -21,39 +21,36 @@
|
|
21
21
|
"import": "./dist/index.mjs",
|
22
22
|
"require": "./dist/index.js"
|
23
23
|
},
|
24
|
+
"./internal": {
|
25
|
+
"types": "./dist/internal/index.d.ts",
|
26
|
+
"import": "./dist/internal/index.mjs",
|
27
|
+
"module": "./dist/internal/index.mjs",
|
28
|
+
"require": "./dist/internal/index.js"
|
29
|
+
},
|
24
30
|
"./test": {
|
25
31
|
"types": "./test/dist/index.d.ts",
|
26
32
|
"import": "./test/dist/index.mjs",
|
27
33
|
"module": "./test/dist/index.mjs",
|
28
34
|
"require": "./test/dist/index.js"
|
29
35
|
},
|
30
|
-
"./rsc": {
|
31
|
-
"types": "./rsc/dist/index.d.ts",
|
32
|
-
"react-server": "./rsc/dist/rsc-server.mjs",
|
33
|
-
"import": "./rsc/dist/rsc-client.mjs"
|
34
|
-
},
|
35
36
|
"./mcp-stdio": {
|
36
37
|
"types": "./mcp-stdio/dist/index.d.ts",
|
37
38
|
"import": "./mcp-stdio/dist/index.mjs",
|
39
|
+
"module": "./mcp-stdio/dist/index.mjs",
|
38
40
|
"require": "./mcp-stdio/dist/index.js"
|
39
41
|
}
|
40
42
|
},
|
41
43
|
"dependencies": {
|
42
|
-
"@ai-sdk/provider": "2.0.0-canary.
|
43
|
-
"@ai-sdk/provider-utils": "3.0.0-canary.
|
44
|
-
"@ai-sdk/ui-utils": "2.0.0-canary.2",
|
44
|
+
"@ai-sdk/provider": "2.0.0-canary.3",
|
45
|
+
"@ai-sdk/provider-utils": "3.0.0-canary.4",
|
45
46
|
"@opentelemetry/api": "1.9.0",
|
46
|
-
"
|
47
|
+
"zod-to-json-schema": "^3.24.1"
|
47
48
|
},
|
48
49
|
"devDependencies": {
|
50
|
+
"@types/json-schema": "7.0.15",
|
49
51
|
"@edge-runtime/vm": "^5.0.0",
|
50
52
|
"@types/node": "20.17.24",
|
51
|
-
"@types/react": "^18",
|
52
|
-
"@types/react-dom": "^18",
|
53
|
-
"@vitejs/plugin-react": "4.3.3",
|
54
53
|
"eslint": "8.57.1",
|
55
|
-
"react-dom": "^18",
|
56
|
-
"react-server-dom-webpack": "18.3.0-canary-eb33bd747-20240312",
|
57
54
|
"tsup": "^7.2.0",
|
58
55
|
"typescript": "5.8.3",
|
59
56
|
"zod": "3.23.8",
|
@@ -61,14 +58,8 @@
|
|
61
58
|
"eslint-config-vercel-ai": "0.0.0"
|
62
59
|
},
|
63
60
|
"peerDependencies": {
|
64
|
-
"react": "^18 || ^19 || ^19.0.0-rc",
|
65
61
|
"zod": "^3.23.8"
|
66
62
|
},
|
67
|
-
"peerDependenciesMeta": {
|
68
|
-
"react": {
|
69
|
-
"optional": true
|
70
|
-
}
|
71
|
-
},
|
72
63
|
"engines": {
|
73
64
|
"node": ">=18"
|
74
65
|
},
|
@@ -96,17 +87,13 @@
|
|
96
87
|
"lint": "eslint \"./**/*.ts*\"",
|
97
88
|
"type-check": "tsc --noEmit",
|
98
89
|
"prettier-check": "prettier --check \"./**/*.ts*\"",
|
99
|
-
"test": "pnpm test:node && pnpm test:edge
|
100
|
-
"test:e2e": "playwright test",
|
90
|
+
"test": "pnpm test:node && pnpm test:edge",
|
101
91
|
"test:edge": "vitest --config vitest.edge.config.js --run",
|
102
92
|
"test:edge:watch": "vitest --config vitest.edge.config.js",
|
103
93
|
"test:node": "vitest --config vitest.node.config.js --run",
|
104
94
|
"test:node:watch": "vitest --config vitest.node.config.js",
|
105
95
|
"test:node:core": "pnpm vitest --config vitest.node.config.js --run ./core/",
|
106
96
|
"test:node:core:watch": "pnpm vitest --config vitest.node.config.js ./core/",
|
107
|
-
"test:node:util": "pnpm vitest --config vitest.node.config.js --run ./util/"
|
108
|
-
"test:ui": "pnpm test:ui:react",
|
109
|
-
"test:ui:react": "vitest --config vitest.ui.react.config.js --run",
|
110
|
-
"test:ui:react:watch": "vitest --config vitest.ui.react.config.js"
|
97
|
+
"test:node:util": "pnpm vitest --config vitest.node.config.js --run ./util/"
|
111
98
|
}
|
112
99
|
}
|