@mastra/e2b 0.12.1-alpha.0 → 0.12.1-alpha.1
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
|
@@ -539,11 +539,12 @@ var E2BProcessHandle = class extends ProcessHandle {
|
|
|
539
539
|
throw new UnsupportedStdinCloseError("E2B SDK does not expose a way to close stdin for a running command");
|
|
540
540
|
}
|
|
541
541
|
};
|
|
542
|
-
/**
|
|
543
|
-
* E2B implementation of SandboxProcessManager.
|
|
544
|
-
* Uses the E2B SDK's commands.run() with background: true.
|
|
545
|
-
*/
|
|
546
542
|
var E2BProcessManager = class extends SandboxProcessManager {
|
|
543
|
+
_defaultTimeout;
|
|
544
|
+
constructor(opts = {}) {
|
|
545
|
+
super();
|
|
546
|
+
this._defaultTimeout = opts.defaultTimeout;
|
|
547
|
+
}
|
|
547
548
|
async spawn(command, options = {}) {
|
|
548
549
|
return this.sandbox.retryOnDead(async () => {
|
|
549
550
|
const e2b = this.sandbox.e2b;
|
|
@@ -555,7 +556,7 @@ var E2BProcessManager = class extends SandboxProcessManager {
|
|
|
555
556
|
stdin: options.stdinMode !== "ignore",
|
|
556
557
|
cwd: options.cwd ?? this.sandbox.workingDirectory,
|
|
557
558
|
envs,
|
|
558
|
-
timeoutMs: options.timeout,
|
|
559
|
+
timeoutMs: options.timeout ?? this._defaultTimeout,
|
|
559
560
|
onStdout: (data) => handle.emitStdout(data),
|
|
560
561
|
onStderr: (data) => handle.emitStderr(data)
|
|
561
562
|
}), e2b, Date.now(), options);
|
|
@@ -709,7 +710,7 @@ var E2BSandbox = class E2BSandbox extends MastraSandbox {
|
|
|
709
710
|
super({
|
|
710
711
|
...options,
|
|
711
712
|
name: "E2BSandbox",
|
|
712
|
-
processes: new E2BProcessManager()
|
|
713
|
+
processes: new E2BProcessManager({ defaultTimeout: options.timeout ?? 3e5 })
|
|
713
714
|
});
|
|
714
715
|
this.id = options.id ?? this.generateId();
|
|
715
716
|
this.timeout = options.timeout ?? 3e5;
|