@ai-sdk/harness 1.0.78 → 1.0.81

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/dist/index.d.ts CHANGED
@@ -112,11 +112,13 @@ interface HarnessV1NetworkSandboxSession extends Experimental_SandboxSession {
112
112
  /** Stop the sandbox. Idempotent. */
113
113
  readonly stop: () => PromiseLike<void>;
114
114
  /**
115
- * Destroy/delete the sandbox resource when supported. Optional because some
116
- * providers only have a stop/dispose concept. Implementations must handle
117
- * both a still-running sandbox and a previously stopped sandbox.
115
+ * Stop the sandbox session, then perform any additional cleanup necessary
116
+ * to destroy it, such as deleting its backing resource or freeing resources.
117
+ * Implementations with no cleanup beyond stopping may delegate to `stop()`.
118
+ * Implementations must handle both a still-running sandbox and a previously
119
+ * stopped sandbox.
118
120
  */
119
- readonly destroy?: () => PromiseLike<void>;
121
+ readonly destroy: () => PromiseLike<void>;
120
122
  /**
121
123
  * Update the sandbox's outbound network policy. Optional — implementations
122
124
  * without a local enforcement primitive (e.g. just-bash) omit this. Callers
@@ -297,11 +297,13 @@ interface HarnessV1NetworkSandboxSession extends Experimental_SandboxSession {
297
297
  /** Stop the sandbox. Idempotent. */
298
298
  readonly stop: () => PromiseLike<void>;
299
299
  /**
300
- * Destroy/delete the sandbox resource when supported. Optional because some
301
- * providers only have a stop/dispose concept. Implementations must handle
302
- * both a still-running sandbox and a previously stopped sandbox.
300
+ * Stop the sandbox session, then perform any additional cleanup necessary
301
+ * to destroy it, such as deleting its backing resource or freeing resources.
302
+ * Implementations with no cleanup beyond stopping may delegate to `stop()`.
303
+ * Implementations must handle both a still-running sandbox and a previously
304
+ * stopped sandbox.
303
305
  */
304
- readonly destroy?: () => PromiseLike<void>;
306
+ readonly destroy: () => PromiseLike<void>;
305
307
  /**
306
308
  * Update the sandbox's outbound network policy. Optional — implementations
307
309
  * without a local enforcement primitive (e.g. just-bash) omit this. Callers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/harness",
3
- "version": "1.0.78",
3
+ "version": "1.0.81",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -46,7 +46,7 @@
46
46
  "dependencies": {
47
47
  "@ai-sdk/provider": "4.0.7",
48
48
  "@ai-sdk/provider-utils": "5.0.28",
49
- "ai": "7.0.70"
49
+ "ai": "7.0.73"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "ws": "^8.21.0",
@@ -65,7 +65,7 @@
65
65
  "typescript": "5.8.3",
66
66
  "ws": "^8.21.0",
67
67
  "zod": "3.25.76",
68
- "@ai-sdk/otel": "1.0.70",
68
+ "@ai-sdk/otel": "1.0.73",
69
69
  "@vercel/ai-tsconfig": "0.0.0"
70
70
  },
71
71
  "engines": {
@@ -462,8 +462,8 @@ export class HarnessAgentSession {
462
462
  }
463
463
 
464
464
  /**
465
- * Stop the runtime and discard resumability. A harness-owned sandbox is
466
- * destroyed when supported; otherwise it is stopped.
465
+ * Stop the runtime and discard resumability. A harness-owned network
466
+ * sandbox is stopped and destroyed through its `destroy()` method.
467
467
  */
468
468
  async destroy(): Promise<void> {
469
469
  if (this.sessionState !== 'active') return;
@@ -474,10 +474,8 @@ export class HarnessAgentSession {
474
474
  await Promise.resolve(session.doDestroy()).catch(() => {});
475
475
  }
476
476
  if (!this.ownsSandboxLifecycle) return;
477
- if ('stop' in sandboxSession) {
478
- await Promise.resolve(
479
- sandboxSession.destroy?.() ?? sandboxSession.stop(),
480
- ).catch(() => {});
477
+ if ('destroy' in sandboxSession) {
478
+ await Promise.resolve(sandboxSession.destroy()).catch(() => {});
481
479
  }
482
480
  }
483
481
 
@@ -71,11 +71,13 @@ export interface HarnessV1NetworkSandboxSession extends SandboxSession {
71
71
  readonly stop: () => PromiseLike<void>;
72
72
 
73
73
  /**
74
- * Destroy/delete the sandbox resource when supported. Optional because some
75
- * providers only have a stop/dispose concept. Implementations must handle
76
- * both a still-running sandbox and a previously stopped sandbox.
74
+ * Stop the sandbox session, then perform any additional cleanup necessary
75
+ * to destroy it, such as deleting its backing resource or freeing resources.
76
+ * Implementations with no cleanup beyond stopping may delegate to `stop()`.
77
+ * Implementations must handle both a still-running sandbox and a previously
78
+ * stopped sandbox.
77
79
  */
78
- readonly destroy?: () => PromiseLike<void>;
80
+ readonly destroy: () => PromiseLike<void>;
79
81
 
80
82
  /**
81
83
  * Update the sandbox's outbound network policy. Optional — implementations