import type { ProviderId } from "@sandbox-agent/factory-shared"; export interface ProviderCapabilities { remote: boolean; supportsSessionReuse: boolean; } export interface CreateSandboxRequest { workspaceId: string; repoId: string; repoRemote: string; branchName: string; handoffId: string; debug?: (message: string, context?: Record) => void; options?: Record; } export interface ResumeSandboxRequest { workspaceId: string; sandboxId: string; options?: Record; } export interface DestroySandboxRequest { workspaceId: string; sandboxId: string; } export interface ReleaseSandboxRequest { workspaceId: string; sandboxId: string; } export interface EnsureAgentRequest { workspaceId: string; sandboxId: string; } export interface SandboxHealthRequest { workspaceId: string; sandboxId: string; } export interface AttachTargetRequest { workspaceId: string; sandboxId: string; } export interface ExecuteSandboxCommandRequest { workspaceId: string; sandboxId: string; command: string; label?: string; } export interface SandboxHandle { sandboxId: string; switchTarget: string; metadata: Record; } export interface AgentEndpoint { endpoint: string; token?: string; } export interface SandboxHealth { status: "healthy" | "degraded" | "down"; message: string; } export interface AttachTarget { target: string; } export interface ExecuteSandboxCommandResult { exitCode: number; result: string; } export interface SandboxProvider { id(): ProviderId; capabilities(): ProviderCapabilities; validateConfig(input: unknown): Promise>; createSandbox(req: CreateSandboxRequest): Promise; resumeSandbox(req: ResumeSandboxRequest): Promise; destroySandbox(req: DestroySandboxRequest): Promise; /** * Release resources for a sandbox without deleting its filesystem/state. * For remote providers, this typically maps to "stop"/"suspend". */ releaseSandbox(req: ReleaseSandboxRequest): Promise; ensureSandboxAgent(req: EnsureAgentRequest): Promise; health(req: SandboxHealthRequest): Promise; attachTarget(req: AttachTargetRequest): Promise; executeCommand(req: ExecuteSandboxCommandRequest): Promise; }