@ai-sdk/harness 1.0.79 → 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 +13 -0
- package/dist/agent/index.d.ts +8 -6
- package/dist/agent/index.js +4 -7
- package/dist/agent/index.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/utils/index.d.ts +6 -4
- package/package.json +3 -3
- package/src/agent/harness-agent-session.ts +4 -6
- package/src/v1/harness-v1-network-sandbox-session.ts +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
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
|
+
|
|
3
16
|
## 1.0.79
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/agent/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
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
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
|
|
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
|
|
1511
|
-
*
|
|
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
|
/**
|
package/dist/agent/index.js
CHANGED
|
@@ -2598,11 +2598,10 @@ var HarnessAgentSession = class {
|
|
|
2598
2598
|
}
|
|
2599
2599
|
}
|
|
2600
2600
|
/**
|
|
2601
|
-
* Stop the runtime and discard resumability. A harness-owned
|
|
2602
|
-
*
|
|
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 ("
|
|
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
|
}
|