@mastra/e2b 0.8.0 → 0.8.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
@@ -481,13 +481,18 @@ var E2BProcessHandle = class extends ProcessHandle {
481
481
  } catch (error) {
482
482
  const errorObj = error;
483
483
  const exitCode = errorObj.result?.exitCode ?? errorObj.exitCode ?? this.exitCode ?? 1;
484
- if (errorObj.result?.stdout) this.emitStdout(errorObj.result.stdout);
485
- if (errorObj.result?.stderr) this.emitStderr(errorObj.result.stderr);
484
+ const attachedStdout = errorObj.result?.stdout || errorObj.stdout;
485
+ const attachedStderr = errorObj.result?.stderr || errorObj.stderr;
486
+ if (!this.stdout && !this.stdoutTruncated && attachedStdout) this.emitStdout(attachedStdout);
487
+ if (!this.stderr && !this.stderrTruncated && attachedStderr) this.emitStderr(attachedStderr);
488
+ const stdout = this.stdout;
489
+ const stderr = this.stderr;
490
+ const terminalError = errorObj.result?.error || errorObj.error || (error instanceof Error ? error.message : String(error));
486
491
  return {
487
492
  success: false,
488
493
  exitCode,
489
- stdout: this.stdout,
490
- stderr: this.stderr || (error instanceof Error ? error.message : String(error)),
494
+ stdout,
495
+ stderr: [stderr, terminalError && !stderr.includes(terminalError) ? `Error: ${terminalError}` : ""].filter(Boolean).join("\n"),
491
496
  executionTimeMs: Date.now() - this._startTime
492
497
  };
493
498
  }