Represents an active sandbox for running commands and file operations.
This class is typically obtained from SandboxClient.createSandbox() and provides methods for command execution and file I/O within the sandbox environment.
class Sandboxconst sandbox = await client.createSandbox("python-sandbox");
try {
const result = await sandbox.run("python --version");
console.log(result.stdout);
} finally {
await sandbox.delete();
}Timestamp when the sandbox was created.
URL for data plane operations (file I/O, command execution).
Computed expiration timestamp when a TTL is active.
Unique identifier (UUID). Remains constant even if name changes.
Idle timeout TTL in seconds (0 means disabled).
Display name (can be updated).
Provisioning status ("provisioning", "ready", "failed").
Human-readable status message (e.g., error details when failed).
Name of the template used to create this sandbox.
Maximum lifetime TTL in seconds (0 means disabled).
Timestamp when the sandbox was last updated.
Delete this sandbox.
Read a file from the sandbox.
Reconnect to this command from the last known offsets.
Returns a new CommandHandle that resumes output from where this one left off.
Execute a command in the sandbox.
When wait is true (default) and no streaming callbacks are provided,
tries WebSocket first and falls back to HTTP POST.
When wait is false or streaming callbacks are provided, uses WebSocket
(required). Returns a CommandHandle for streaming output.
Write content to a file in the sandbox.