/** * Code Mode — E2B transport * * The default {@link StdioCodeModeTransport} in `@mastra/core` writes the * runner/program files to the *host* tmpdir and spawns `node `. That * only works when the sandbox shares the host filesystem (e.g. `LocalSandbox`). * E2B runs the program in a remote micro-VM with its own filesystem, so the * host paths don't exist there and `node` exits immediately. * * `E2BCodeModeTransport` writes the runner/program *into* the sandbox via the * E2B files API and runs plain `node ` inside the VM. TypeScript is * stripped on the host with esbuild before upload, so it doesn't depend on the * sandbox's Node version (the core transport relies on * `node --experimental-strip-types`, which needs Node >= 22.6). * * The RPC frame protocol (host <-> runner) is unchanged: it reuses * `buildProgramModule`, `buildRunner`, and `FRAME_PREFIX` from * `@mastra/core/tools`. */ import type { CodeModeToolResult, CodeModeTransport } from '@mastra/core/tools'; /** * Code Mode transport for {@link E2BSandbox}. * * Writes the generated program and runner into the sandbox filesystem, runs * `node` there, and bridges `external_*` RPC calls back to the host over the * process's stdout/stdin — the same frame protocol as the core stdio transport. * * @example * ```typescript * import { createCodeMode } from '@mastra/core/tools'; * import { E2BSandbox, E2BCodeModeTransport } from '@mastra/e2b'; * * const { tool, instructions } = createCodeMode( * { tools: { getWeather, getForecast }, sandbox: new E2BSandbox() }, * new E2BCodeModeTransport(), * ); * ``` */ export declare class E2BCodeModeTransport implements CodeModeTransport { run(opts: Parameters[0]): Promise; } //# sourceMappingURL=transport.d.ts.map