@mastra/e2b 0.13.0-alpha.2 → 0.13.0-alpha.3

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { MastraSandbox, ProcessHandle, SandboxNotReadyError, SandboxProcessManager, UnsupportedStdinCloseError, assertModesUnsupported } from "@mastra/core/workspace";
1
+ import { MastraSandbox, ProcessHandle, SandboxError, SandboxNotReadyError, SandboxProcessManager, UnsupportedStdinCloseError, assertModesUnsupported } from "@mastra/core/workspace";
2
2
  import { Sandbox, Template } from "e2b";
3
3
  import { createHash } from "crypto";
4
4
  import { execFile } from "child_process";
@@ -1262,6 +1262,11 @@ var E2BSandbox = class E2BSandbox extends MastraSandbox {
1262
1262
  if (this._preferredSandboxId) {
1263
1263
  const preferred = await this.connectToPreferredSandbox(this._preferredSandboxId);
1264
1264
  if (preferred) return preferred;
1265
+ if (this._constructorOptions.reattach === "required") throw new SandboxError(`E2B sandbox ${this._preferredSandboxId} could not be reattached (gone); refusing to provision a replacement because reattach is 'required'. Clear the persisted sandboxId to start a fresh sandbox.`, "SANDBOX_REATTACH_FAILED", {
1266
+ provider: "e2b",
1267
+ sandboxId: this._preferredSandboxId,
1268
+ logicalId: this.id
1269
+ });
1265
1270
  }
1266
1271
  return this.findExistingSandbox();
1267
1272
  }