/** * Sandbox client SDK for ephemeral compute environments. * * Implements the bash-tool Sandbox interface for seamless integration * with AI agent tool loops. * * @module */ import { LazySandbox, type LazySandboxOptions } from "./lazy-sandbox.js"; import type { BackgroundCommand, BackgroundCommandOutput, ExecOptions, ExecResult, ExecStreamEvent, SandboxAttachment, SandboxListOptions, SandboxListResult, SandboxOptions } from "./types.js"; export { resolveSandboxApiUrl, resolveSandboxAuthToken } from "./config.js"; export type { BackgroundCommand, BackgroundCommandHeartbeatStatus, BackgroundCommandOutput, BackgroundCommandStatus, ExecOptions, ExecResult, ExecStreamEvent, SandboxAttachment, SandboxListOptions, SandboxListResult, SandboxOptions, SandboxSession, } from "./types.js"; /** Client for isolated ephemeral compute environments with command execution and file I/O. */ export declare class Sandbox { private endpoint; private sessionId; private authToken; private apiUrl; private constructor(); private static resolveApiUrl; private static resolveAuthToken; /** Create a new sandbox session. Claims a warm pod or creates a new one. */ static create(options?: SandboxOptions): Promise; /** Reconnect to an existing sandbox session. */ static get(id: string, options?: SandboxOptions): Promise; /** Attach to an already-known sandbox session and endpoint without a reconnect lookup. */ static attach(attachment: SandboxAttachment): Sandbox; /** List sandbox sessions with optional pagination. */ static list(options?: SandboxListOptions): Promise; private static waitForReady; /** Create a lazily-provisioned sandbox session with automatic heartbeats. */ static createLazy(options?: LazySandboxOptions): LazySandbox; /** Execute a bash command in the sandbox and return buffered result. */ executeCommand(command: string, options?: ExecOptions): Promise; /** Execute a bash command with streaming output (NDJSON). */ executeStream(command: string, options?: ExecOptions): AsyncGenerator; /** Read a file from the sandbox workspace. */ readFile(path: string): Promise; /** Write files to the sandbox workspace. */ writeFiles(files: Array<{ path: string; content: string; }>): Promise; /** Start an async background command in the sandbox. */ startBackgroundCommand(command: string, options?: ExecOptions): Promise; /** Get the status of an async background command. */ getBackgroundCommand(commandId: string): Promise; /** Get the output of an async background command. */ getBackgroundCommandOutput(commandId: string): Promise; /** List all background commands in the sandbox. */ listBackgroundCommands(): Promise; /** Cancel an async background command. */ cancelBackgroundCommand(commandId: string): Promise; private static mapBackgroundCommand; /** Send a heartbeat to prevent idle timeout. */ heartbeat(): Promise; /** Close the sandbox session and mark for deletion. */ close(): Promise; /** Get the session ID. */ get id(): string; /** Get the sandbox endpoint URL. */ get url(): string; } export declare function waitForSandboxReady(input: { apiUrl: string; id: string; authToken: string; maxWaitMs?: number; pollIntervalMs?: number; }): Promise; //# sourceMappingURL=sandbox.d.ts.map