@fastgpt-sdk/sandbox-adapter 0.0.38-beta.1 → 0.0.38-beta.2

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.cjs CHANGED
@@ -48506,9 +48506,20 @@ class OpenSandboxAdapter extends BaseSandboxAdapter {
48506
48506
  async delete(sandboxId) {
48507
48507
  try {
48508
48508
  this._status = { state: "Deleting" };
48509
- if (sandboxId && (!this._sandbox || sandboxId !== this._id)) {
48510
- await this.connect(sandboxId);
48511
- this._status = { state: "Deleting" };
48509
+ if (sandboxId) {
48510
+ const manager = SandboxManager.create({ connectionConfig: this._connection });
48511
+ try {
48512
+ await manager.killSandbox(sandboxId);
48513
+ } finally {
48514
+ await manager.close().catch(() => {
48515
+ return;
48516
+ });
48517
+ }
48518
+ if (sandboxId === this._id) {
48519
+ this.sandbox = undefined;
48520
+ }
48521
+ this._status = { state: "UnExist" };
48522
+ return;
48512
48523
  }
48513
48524
  await this.sandbox.kill();
48514
48525
  this.sandbox = undefined;
package/dist/index.js CHANGED
@@ -48490,9 +48490,20 @@ class OpenSandboxAdapter extends BaseSandboxAdapter {
48490
48490
  async delete(sandboxId) {
48491
48491
  try {
48492
48492
  this._status = { state: "Deleting" };
48493
- if (sandboxId && (!this._sandbox || sandboxId !== this._id)) {
48494
- await this.connect(sandboxId);
48495
- this._status = { state: "Deleting" };
48493
+ if (sandboxId) {
48494
+ const manager = SandboxManager.create({ connectionConfig: this._connection });
48495
+ try {
48496
+ await manager.killSandbox(sandboxId);
48497
+ } finally {
48498
+ await manager.close().catch(() => {
48499
+ return;
48500
+ });
48501
+ }
48502
+ if (sandboxId === this._id) {
48503
+ this.sandbox = undefined;
48504
+ }
48505
+ this._status = { state: "UnExist" };
48506
+ return;
48496
48507
  }
48497
48508
  await this.sandbox.kill();
48498
48509
  this.sandbox = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastgpt-sdk/sandbox-adapter",
3
- "version": "0.0.38-beta.1",
3
+ "version": "0.0.38-beta.2",
4
4
  "description": "Unified abstraction layer for cloud sandbox providers with adapter pattern and feature polyfilling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",