ai 7.0.147 → 7.0.148
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
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 7.0.148
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b089ce8]
|
|
8
|
+
- Updated dependencies [39a776b]
|
|
9
|
+
- Updated dependencies [f1b550e]
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.65
|
|
11
|
+
- @ai-sdk/gateway@4.0.121
|
|
12
|
+
|
|
3
13
|
## 7.0.147
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.js
CHANGED
package/dist/internal/index.js
CHANGED
|
@@ -107,6 +107,7 @@ Raw runtime instances need their respective adapters; a custom
|
|
|
107
107
|
| `sandbox` | `Experimental_SandboxSession` | Required session for command execution and file operations. |
|
|
108
108
|
| `workingDirectory` | `string` | Optional absolute starting directory for each command, created if needed. When omitted, uses the sandbox's default directory. |
|
|
109
109
|
| `maxOutputLength` | `number` | Positive integer limiting characters retained from each output stream before a truncation notice. Defaults to `30000`. |
|
|
110
|
+
| `timeout` | `number` | Optional timeout per command execution, in milliseconds (integer from `1` to `2147483647`). No tool-level timeout by default. |
|
|
110
111
|
|
|
111
112
|
The model calls the tool with `{ command: string }` and receives
|
|
112
113
|
`{ stdout, stderr, exitCode }`. Nonzero exit codes are returned so the model can
|
|
@@ -114,6 +115,24 @@ inspect failures and recover. AI SDK cancellation is forwarded to the session.
|
|
|
114
115
|
Output truncation happens after execution and does not limit execution memory or
|
|
115
116
|
duration.
|
|
116
117
|
|
|
118
|
+
### Command timeout
|
|
119
|
+
|
|
120
|
+
Set `timeout` to cancel commands that run longer than the configured duration:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
const bash = await createBashTool({
|
|
124
|
+
sandbox,
|
|
125
|
+
timeout: 10_000,
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Each command gets a fresh timeout starting when its execution begins. This does
|
|
130
|
+
not include tool initialization or time waiting for model output or approval.
|
|
131
|
+
The timeout is combined with the caller's abort signal; either can cancel the
|
|
132
|
+
command. The sandbox must honor cancellation. Its result or error is passed
|
|
133
|
+
through; for example, just-bash returns exit code `124` when a running command is
|
|
134
|
+
cancelled. SDK and sandbox timeouts still apply when this option is omitted.
|
|
135
|
+
|
|
117
136
|
### Files and lifecycle
|
|
118
137
|
|
|
119
138
|
Commands use the sandbox's default working directory unless `workingDirectory`
|
|
@@ -106,6 +106,38 @@ try {
|
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
### Image Inputs
|
|
110
|
+
|
|
111
|
+
For harness adapters that support images, you can include an image as a file part
|
|
112
|
+
in the latest user message. Set `mediaType` to the image's MIME type:
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
import { readFileSync } from 'node:fs';
|
|
116
|
+
|
|
117
|
+
const result = await agent.generate({
|
|
118
|
+
session,
|
|
119
|
+
messages: [
|
|
120
|
+
{
|
|
121
|
+
role: 'user',
|
|
122
|
+
content: [
|
|
123
|
+
{
|
|
124
|
+
type: 'text',
|
|
125
|
+
text: 'Describe the image in one sentence.',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: 'file',
|
|
129
|
+
mediaType: 'image/png',
|
|
130
|
+
data: readFileSync('image.png'),
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
For image input support, see the
|
|
139
|
+
[adapter capability table](/docs/ai-sdk-harnesses/harness-adapters#adapter-capabilities).
|
|
140
|
+
|
|
109
141
|
## Lifecycle Callbacks
|
|
110
142
|
|
|
111
143
|
Configure lifecycle callbacks on `HarnessAgent` to observe agent calls, model
|
|
@@ -28,8 +28,8 @@ When the SDK fetches a URL taken from a provider response, it:
|
|
|
28
28
|
|
|
29
29
|
- **Rejects private, loopback, and link-local targets** — IPv4 (`10/8`,
|
|
30
30
|
`172.16/12`, `192.168/16`, `127/8`, `169.254/16`, CGNAT, multicast, …) and the
|
|
31
|
-
equivalent IPv6 ranges, plus `localhost
|
|
32
|
-
are rejected too.
|
|
31
|
+
equivalent IPv6 ranges, plus `localhost`, `.local`, `.localhost`, and
|
|
32
|
+
`.internal` hostnames. Non-`http(s)` schemes are rejected too.
|
|
33
33
|
- **Re-validates every redirect hop** — a URL that passes but then redirects to
|
|
34
34
|
an internal address is blocked; the redirect is never followed blindly.
|
|
35
35
|
- **Validates DNS at connection time on Node.js** — every resolved address is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.148",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ai-sdk/gateway": "4.0.
|
|
45
|
+
"@ai-sdk/gateway": "4.0.121",
|
|
46
46
|
"@ai-sdk/provider": "4.0.31",
|
|
47
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
47
|
+
"@ai-sdk/provider-utils": "5.0.65"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@ai-sdk/amazon-bedrock": "5.0.
|
|
51
|
-
"@ai-sdk/deepseek": "3.0.
|
|
52
|
-
"@ai-sdk/google": "4.0.
|
|
53
|
-
"@ai-sdk/groq": "4.0.
|
|
54
|
-
"@ai-sdk/huggingface": "2.0.
|
|
55
|
-
"@ai-sdk/moonshotai": "3.0.
|
|
56
|
-
"@ai-sdk/openai": "4.0.
|
|
50
|
+
"@ai-sdk/amazon-bedrock": "5.0.121",
|
|
51
|
+
"@ai-sdk/deepseek": "3.0.70",
|
|
52
|
+
"@ai-sdk/google": "4.0.102",
|
|
53
|
+
"@ai-sdk/groq": "4.0.67",
|
|
54
|
+
"@ai-sdk/huggingface": "2.0.75",
|
|
55
|
+
"@ai-sdk/moonshotai": "3.0.74",
|
|
56
|
+
"@ai-sdk/openai": "4.0.99",
|
|
57
57
|
"@ai-sdk/test-server": "2.0.4",
|
|
58
|
-
"@ai-sdk/xai": "5.0.
|
|
58
|
+
"@ai-sdk/xai": "5.0.27",
|
|
59
59
|
"@edge-runtime/vm": "^5.0.0",
|
|
60
60
|
"@smithy/eventstream-codec": "^4.3.3",
|
|
61
61
|
"@smithy/util-utf8": "^4.3.3",
|