@mastra/e2b 0.12.0 → 0.12.1-alpha.0
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 +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/sandbox/process-manager.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -485,12 +485,14 @@ var E2BProcessHandle = class extends _mastra_core_workspace.ProcessHandle {
|
|
|
485
485
|
_e2bHandle;
|
|
486
486
|
_sandbox;
|
|
487
487
|
_startTime;
|
|
488
|
+
_stdinMode;
|
|
488
489
|
constructor(e2bHandle, sandbox, startTime, options) {
|
|
489
490
|
super(options);
|
|
490
491
|
this.pid = String(e2bHandle.pid);
|
|
491
492
|
this._e2bHandle = e2bHandle;
|
|
492
493
|
this._sandbox = sandbox;
|
|
493
494
|
this._startTime = startTime;
|
|
495
|
+
this._stdinMode = options?.stdinMode;
|
|
494
496
|
}
|
|
495
497
|
/** Delegates to E2B's handle so exitCode reflects server-side state without needing wait(). */
|
|
496
498
|
get exitCode() {
|
|
@@ -531,6 +533,7 @@ var E2BProcessHandle = class extends _mastra_core_workspace.ProcessHandle {
|
|
|
531
533
|
}
|
|
532
534
|
async sendStdin(data) {
|
|
533
535
|
if (this.exitCode !== void 0) throw new Error(`Process ${this.pid} has already exited with code ${this.exitCode}`);
|
|
536
|
+
if (this._stdinMode === "ignore") throw new Error(`Process ${this.pid} was not started with stdin support`);
|
|
534
537
|
await this._sandbox.commands.sendStdin(this._e2bHandle.pid, data);
|
|
535
538
|
}
|
|
536
539
|
async closeStdin() {
|
|
@@ -550,7 +553,7 @@ var E2BProcessManager = class extends _mastra_core_workspace.SandboxProcessManag
|
|
|
550
553
|
let handle;
|
|
551
554
|
handle = new E2BProcessHandle(await e2b.commands.run(command, {
|
|
552
555
|
background: true,
|
|
553
|
-
stdin:
|
|
556
|
+
stdin: options.stdinMode !== "ignore",
|
|
554
557
|
cwd: options.cwd ?? this.sandbox.workingDirectory,
|
|
555
558
|
envs,
|
|
556
559
|
timeoutMs: options.timeout,
|