@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
33 lines • 1.67 kB
TypeScript
import type { ByteSource } from '../../../io/types.ts';
import { RemoteSandbox } from '../base.ts';
import { PIPE_TRANSPORT, type PipeTransport } from '../mixin.ts';
import type { OutputFn, RunResult, SandboxPipe } from '../../types.ts';
import type { RuntimeOptions } from '../../config.ts';
import { type E2bSdk } from './sdk.ts';
import { type E2BConfig } from './config.ts';
/**
* An E2B sandbox the user runs as a whole-line runtime.
*
* You create the sandbox yourself (`e2b sandbox spawn` or the SDK);
* mirage only connects by `sandboxId` and execs lines. `apiKey` falls
* back to E2B_API_KEY. E2B's exec reports stdout and stderr
* separately, stdout as it arrives when streamed. Piped bytes use native
* stdin, chunk by chunk, followed by an explicit EOF; no input closes
* stdin when the command starts. The SDK's own command timeout is off: a
* command runs until mirage's limits stop it. A `mountType` serves the
* workspace over a PTY, since E2B's exec decodes output as text.
*/
export declare class E2BRuntime extends RemoteSandbox<E2BConfig> implements PipeTransport {
readonly [PIPE_TRANSPORT]: true;
readonly name = "e2b";
private sdk;
private sandbox;
constructor(options?: RuntimeOptions<E2BConfig>);
protected loadSdk(): Promise<E2bSdk>;
private ensureSdk;
private apiParams;
connect(): Promise<void>;
protected execArgv(argv: readonly string[], stdin: ByteSource | null, env: Record<string, string>, cwd: string, output: OutputFn | null, errors: OutputFn | null, signal?: AbortSignal): Promise<RunResult>;
openPipe(command: string): Promise<SandboxPipe>;
}
//# sourceMappingURL=runtime.d.ts.map