import type { SandboxSummary } from './types.js'; export type SubstrateId = 'e2b'; export interface SubstrateConfig { /** Credential for the substrate (e.g. E2B_API_KEY). */ apiKey: string; } export interface CreateOpts { template: string; envVars: Record; metadata: Record; autoPauseOnCap: boolean; name?: string; } export interface SandboxInfo { sandboxId: string; state: 'running' | 'paused' | 'dead'; metadata: Record; createdAt: string; } export interface RunResult { stdout: string; stderr: string; exitCode: number; } export interface SandboxHandle { readonly sandboxId: string; readonly substrate: SubstrateId; pause(): Promise; kill(): Promise; getInfo(): Promise; writeFile(path: string, contents: string | Uint8Array): Promise; readFile(path: string): Promise; run(cmd: string): Promise; } export interface ListOpts { metadata?: Record; } export interface SandboxSubstrate { readonly id: SubstrateId; create(opts: CreateOpts): Promise; connect(sandboxId: string): Promise; list(opts?: ListOpts): Promise; /** * Reset the sandbox's auto-pause countdown. The substrate-specific TTL * floor applies (e.g. e2b Hobby plan caps at 1h, Pro at 24h). For non-e2b * substrates that don't support this concept, implement as a no-op. */ extendTimeout(sandboxId: string, ttlMs: number): Promise; } export type SubstrateFactory = (id: SubstrateId, cfg: SubstrateConfig) => SandboxSubstrate; //# sourceMappingURL=substrate.d.ts.map