What you can do
Everything is a flat method on
Bonya or Sandbox. There is no
client.sandboxes.create(...) namespace to navigate.
Bonya also has convenience methods that take a sandbox id instead of a
Sandbox handle, such as client.createSession(sandboxId, name, cmd) and
client.createPreview(sandboxId, port). Each fetches the sandbox first, so
prefer calling on sandbox when you already hold one.Create sandboxes
If create exhausts its deadline the SDK throws
SandboxCreationTimeoutError,
which carries the idempotencyKey so you can retry the same creation instead
of starting a second sandbox.
Get, list, and find by name
sandbox.state is one of creating, running, cooling, warm, cold,
waking, failed, deleting, deleted or lost.
Run commands
Streaming exec
Persistent sessions
^[a-z][a-z0-9-]{0,31}$. A session keeps running after you
detach and replays what it produced while nobody was attached.
Files
Previews
Lifecycle, snapshots, and forks
Jobs
runJob waits for the result; startJob returns immediately. Use
getJobRun(id), listJobRuns() and cancelJobRun(id) to track runs.
Schedules
cronExpressions, intervalSeconds or
runAtUnixNanos.
Templates
Registry connections, secrets, and secret sets
Organizations
BONYA_ORGANIZATION_ID, then
your personal organization. Creating organizations, members, invites and API
keys is done in the dashboard, not through the SDK.
Errors
Every error extendsBonyaError (with sandboxId, idempotencyKey, code).
Branch on the class: AuthenticationError, SandboxNotFoundError,
SandboxCreationTimeoutError, ExecFailedError, TimeoutError,
NoCapacityError, RateLimitedError, OutcomeUnknownError,
RemoteFileNotFoundError, and so on. API keys and capability tokens are
redacted from error messages.
problem+json; see Errors.