@ai-sdk/harness 1.0.19 → 1.0.21
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 +15 -0
- package/agent/index.ts +1 -1
- package/dist/agent/index.d.ts +17 -0
- package/dist/agent/index.js +3 -1
- package/dist/agent/index.js.map +1 -1
- package/package.json +3 -3
- package/src/agent/internal/turn-telemetry.ts +2 -0
- package/src/agent/prepare-sandbox-for-harness.ts +17 -0
- /package/src/agent/{prewarm.ts → prepare-harness-sandbox-template.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/harness",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@ai-sdk/provider": "4.0.2",
|
|
48
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
49
|
-
"ai": "7.0.
|
|
48
|
+
"@ai-sdk/provider-utils": "5.0.6",
|
|
49
|
+
"ai": "7.0.18"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"ws": "^8.21.0",
|
|
@@ -241,6 +241,7 @@ export function createTurnTelemetry(opts: {
|
|
|
241
241
|
dispatcher.onStepEnd?.(
|
|
242
242
|
cast<'onStepEnd'>({
|
|
243
243
|
callId,
|
|
244
|
+
stepNumber,
|
|
244
245
|
finishReason: info.finishReason,
|
|
245
246
|
usage: info.usage,
|
|
246
247
|
providerMetadata: info.providerMetadata,
|
|
@@ -313,6 +314,7 @@ export function createTurnTelemetry(opts: {
|
|
|
313
314
|
dispatcher.onStepEnd?.(
|
|
314
315
|
cast<'onStepEnd'>({
|
|
315
316
|
callId,
|
|
317
|
+
stepNumber,
|
|
316
318
|
finishReason: info.finishReason,
|
|
317
319
|
usage: info.usage,
|
|
318
320
|
providerMetadata: undefined,
|
|
@@ -19,6 +19,23 @@ export type PrepareSandboxForHarnessResult = {
|
|
|
19
19
|
readonly skippedHarnessIds: ReadonlyArray<string>;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Apply one or more harness bootstrap recipes to an existing sandbox session.
|
|
24
|
+
*
|
|
25
|
+
* Use this when a sandbox provider or caller wants to prepare a reusable
|
|
26
|
+
* sandbox template, image, or snapshot before creating live harness sessions.
|
|
27
|
+
*
|
|
28
|
+
* The function writes each adapter's bridge/bootstrap files, runs its install
|
|
29
|
+
* commands, and then returns a deterministic identity derived from the applied
|
|
30
|
+
* recipes and optional sandbox bootstrap configuration. Providers can use that
|
|
31
|
+
* identity as the cache key for the prepared artifact.
|
|
32
|
+
*
|
|
33
|
+
* This function only mutates the supplied sandbox; the caller is responsible for
|
|
34
|
+
* committing, snapshotting, or otherwise persisting that modified filesystem.
|
|
35
|
+
* When a later `HarnessAgent` session uses a sandbox created from the persisted
|
|
36
|
+
* artifact, the adapter recomputes the same recipe identity and the existing
|
|
37
|
+
* bootstrap marker makes the bootstrap logic a no-op.
|
|
38
|
+
*/
|
|
22
39
|
export async function prepareSandboxForHarness(options: {
|
|
23
40
|
readonly session: SandboxSession;
|
|
24
41
|
readonly harnesses: ReadonlyArray<HarnessAgentAdapter>;
|
|
File without changes
|