import { type BackgroundCommand, type BackgroundCommandOutput, type ExecOptions, type ExecResult, type ExecStreamEvent, type SandboxOptions } from "./types.js"; /** Options accepted by lazy sandbox. */ export interface LazySandboxOptions extends SandboxOptions { /** * Optional existing sandbox session to attach to instead of creating a new one. * Attached sessions are detached, not deleted, on close unless deleteOnClose is true. */ sandboxId?: string; /** Optional known endpoint for sandboxId; avoids the initial control-plane lookup. */ sandboxEndpoint?: string; /** Delete the sandbox when closing. Defaults to true for created sessions and false for sandboxId. */ deleteOnClose?: boolean; getProjectId?: () => string | null | undefined; startupTimeoutMs?: number; pollIntervalMs?: number; heartbeatIntervalMs?: number; heartbeatGraceMs?: number; controlRequestTimeoutMs?: number; execStartTimeoutMs?: number; execStartMaxAttempts?: number; execStartRetryDelayMs?: number; resolveRuntimeEndpoint?: (input: { endpoint: string; sessionId: string; }) => string; } /** Resolves default sandbox runtime endpoint. */ export declare function resolveDefaultSandboxRuntimeEndpoint(input: { endpoint: string; }): string; /** Lazily provisions sandbox sessions and keeps them alive while in use. */ export declare class LazySandbox { private readonly apiUrl; private readonly authToken; private readonly sandboxId; private readonly sandboxEndpoint; private readonly deleteOnClose; private readonly getProjectId; private readonly startupTimeoutMs; private readonly pollIntervalMs; private readonly heartbeatIntervalMs; private readonly heartbeatGraceMs; private readonly controlRequestTimeoutMs; private readonly execStartTimeoutMs; private readonly execStartMaxAttempts; private readonly execStartRetryDelayMs; private readonly resolveRuntimeEndpointOption; private endpoint; private sessionId; private sessionProjectId; private ensurePromise; private closePromise; private heartbeatPromise; private heartbeatTimer; private lastHeartbeatAt; private readonly activeBackgroundCommands; constructor(options?: LazySandboxOptions); ensure(): Promise; executeCommand(command: string, options?: ExecOptions): Promise; executeStream(command: string, options?: ExecOptions): AsyncGenerator; readFile(path: string): Promise; writeFiles(files: Array<{ path: string; content: string; }>): Promise; startBackgroundCommand(command: string, options?: ExecOptions): Promise; getBackgroundCommand(commandId: string): Promise; getBackgroundCommandOutput(commandId: string): Promise; listBackgroundCommands(): Promise; cancelBackgroundCommand(commandId: string): Promise; heartbeat(force?: boolean): Promise; close(): Promise; get id(): string | null; get url(): string | null; get isActive(): boolean; private bootstrapSession; private bootstrapCreatedSession; private resolveReadyEndpoint; private attachExistingSession; private getSession; private waitForReadySession; private waitForRuntimeDataPlaneReady; private touchSession; private heartbeatFailureCount; private static readonly HEARTBEAT_WARN_AFTER_FAILURES; private startHeartbeatLoop; private stopHeartbeatLoop; private deleteSession; private requireEndpoint; private resolveProjectId; private resetSessionState; private resolveExecOptions; private resolveBackgroundCommandRoute; private updateTrackedBackgroundCommand; private hasActiveInternalBackgroundCommand; private startExec; private fetchExecStart; private fetchControl; private waitForExecStartRetry; private reprovisionAfterExecStartFailure; private resolveRuntimeEndpointFor; private shouldUseInternalDataPlane; private resolveDataPlaneRoute; private requireSessionId; private authHeaders; private jsonHeaders; } //# sourceMappingURL=lazy-sandbox.d.ts.map