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