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