@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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @ai-sdk/harness
2
2
 
3
+ ## 1.0.81
4
+
5
+ ### Patch Changes
6
+
7
+ - 7f50d28: feat(harness): make `destroy` on `HarnessV1NetworkSandboxSession` mandatory
8
+ - ai@7.0.73
9
+
10
+ ## 1.0.80
11
+
12
+ ### Patch Changes
13
+
14
+ - ai@7.0.72
15
+
16
+ ## 1.0.79
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [9a37469]
21
+ - ai@7.0.71
22
+
3
23
  ## 1.0.78
4
24
 
5
25
  ### Patch Changes
@@ -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
@@ -1507,8 +1509,8 @@ declare class HarnessAgentSession {
1507
1509
  */
1508
1510
  stop(): Promise<HarnessAgentResumeSessionState>;
1509
1511
  /**
1510
- * Stop the runtime and discard resumability. A harness-owned sandbox is
1511
- * destroyed when supported; otherwise it is stopped.
1512
+ * Stop the runtime and discard resumability. A harness-owned network
1513
+ * sandbox is stopped and destroyed through its `destroy()` method.
1512
1514
  */
1513
1515
  destroy(): Promise<void>;
1514
1516
  /**
@@ -2598,11 +2598,10 @@ var HarnessAgentSession = class {
2598
2598
  }
2599
2599
  }
2600
2600
  /**
2601
- * Stop the runtime and discard resumability. A harness-owned sandbox is
2602
- * destroyed when supported; otherwise it is stopped.
2601
+ * Stop the runtime and discard resumability. A harness-owned network
2602
+ * sandbox is stopped and destroyed through its `destroy()` method.
2603
2603
  */
2604
2604
  async destroy() {
2605
- var _a4, _b4;
2606
2605
  if (this.sessionState !== "active") return;
2607
2606
  const session = this.underlyingSession;
2608
2607
  const sandboxSession = this.getSandboxSession();
@@ -2612,10 +2611,8 @@ var HarnessAgentSession = class {
2612
2611
  });
2613
2612
  }
2614
2613
  if (!this.ownsSandboxLifecycle) return;
2615
- if ("stop" in sandboxSession) {
2616
- await Promise.resolve(
2617
- (_b4 = (_a4 = sandboxSession.destroy) == null ? void 0 : _a4.call(sandboxSession)) != null ? _b4 : sandboxSession.stop()
2618
- ).catch(() => {
2614
+ if ("destroy" in sandboxSession) {
2615
+ await Promise.resolve(sandboxSession.destroy()).catch(() => {
2619
2616
  });
2620
2617
  }
2621
2618
  }