ai 7.0.68 → 7.0.69
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
package/dist/index.js
CHANGED
|
@@ -1143,7 +1143,7 @@ import {
|
|
|
1143
1143
|
} from "@ai-sdk/provider-utils";
|
|
1144
1144
|
|
|
1145
1145
|
// src/version.ts
|
|
1146
|
-
var VERSION = true ? "7.0.
|
|
1146
|
+
var VERSION = true ? "7.0.69" : "0.0.0-test";
|
|
1147
1147
|
|
|
1148
1148
|
// src/util/download/download.ts
|
|
1149
1149
|
var download = async ({
|
package/dist/internal/index.js
CHANGED
|
@@ -180,6 +180,11 @@ End every session explicitly:
|
|
|
180
180
|
Use `destroy()` for one-off scripts and tests. Use `detach()` or `stop()` for
|
|
181
181
|
HTTP routes that need multi-turn continuity.
|
|
182
182
|
|
|
183
|
+
When you pass `sandboxSession` to `agent.createSession()`, the caller retains
|
|
184
|
+
ownership of that sandbox. `session.stop()` and `session.destroy()` still end
|
|
185
|
+
the harness runtime but do not stop or destroy the supplied sandbox session.
|
|
186
|
+
In this case, the agent does not need a `sandbox` provider in its constructor.
|
|
187
|
+
|
|
183
188
|
```ts
|
|
184
189
|
const session = await agent.createSession({ sessionId: chatId });
|
|
185
190
|
|
|
@@ -401,10 +406,7 @@ const sandboxFromSnapshot = await Sandbox.create({
|
|
|
401
406
|
|
|
402
407
|
const agent = new HarnessAgent({
|
|
403
408
|
harness: claudeCode,
|
|
404
|
-
sandbox: createVercelSandbox({
|
|
405
|
-
sandbox: sandboxFromSnapshot,
|
|
406
|
-
bridgePorts: [4000],
|
|
407
|
-
}),
|
|
409
|
+
sandbox: createVercelSandbox({ sandbox: sandboxFromSnapshot }),
|
|
408
410
|
sandboxConfig,
|
|
409
411
|
});
|
|
410
412
|
|
|
@@ -437,6 +439,51 @@ console.log(preparation.identity);
|
|
|
437
439
|
Adapter-specific settings belong on the adapter factory, for example
|
|
438
440
|
`createCodex({ reasoningEffort: 'high' })`.
|
|
439
441
|
|
|
442
|
+
## Custom Sandbox Orchestration
|
|
443
|
+
|
|
444
|
+
When your application creates and manages sandboxes itself, prepare the network
|
|
445
|
+
sandbox session first and then pass that same session to `agent.createSession()`.
|
|
446
|
+
The agent does not need a sandbox provider and does not stop or destroy the
|
|
447
|
+
caller-owned sandbox.
|
|
448
|
+
|
|
449
|
+
```ts
|
|
450
|
+
import { HarnessAgent, prepareSandboxForHarness } from '@ai-sdk/harness/agent';
|
|
451
|
+
import { claudeCode } from '@ai-sdk/harness-claude-code';
|
|
452
|
+
import { createVercelSandbox } from '@ai-sdk/sandbox-vercel';
|
|
453
|
+
import { Sandbox } from '@vercel/sandbox';
|
|
454
|
+
|
|
455
|
+
const sandbox = await Sandbox.create({
|
|
456
|
+
runtime: 'node24',
|
|
457
|
+
ports: [4000],
|
|
458
|
+
});
|
|
459
|
+
const sandboxProvider = createVercelSandbox({ sandbox });
|
|
460
|
+
const sandboxSession = await sandboxProvider.createSession();
|
|
461
|
+
|
|
462
|
+
await prepareSandboxForHarness({
|
|
463
|
+
session: sandboxSession.restricted(),
|
|
464
|
+
harnesses: [claudeCode],
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
const agent = new HarnessAgent({ harness: claudeCode });
|
|
468
|
+
const session = await agent.createSession({ sandboxSession });
|
|
469
|
+
|
|
470
|
+
try {
|
|
471
|
+
const result = await agent.stream({
|
|
472
|
+
session,
|
|
473
|
+
prompt: 'Create a short TODO.md for this repository.',
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
for await (const part of result.stream) {
|
|
477
|
+
if (part.type === 'text-delta') {
|
|
478
|
+
process.stdout.write(part.text);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
} finally {
|
|
482
|
+
await session.destroy();
|
|
483
|
+
await sandbox.stop();
|
|
484
|
+
}
|
|
485
|
+
```
|
|
486
|
+
|
|
440
487
|
## Next Steps
|
|
441
488
|
|
|
442
489
|
- [Tools](/docs/ai-sdk-harnesses/tools) for built-in and host-executed tools.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.69",
|
|
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,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ai-sdk/gateway": "4.0.
|
|
45
|
+
"@ai-sdk/gateway": "4.0.55",
|
|
46
46
|
"@ai-sdk/provider": "4.0.7",
|
|
47
47
|
"@ai-sdk/provider-utils": "5.0.27"
|
|
48
48
|
},
|