Skip to content

Ruby-only types

Types of the Ruby SDK with no Python counterpart of the same name: mostly option objects and result records. The methods that take them are on the area pages.

Plan limits and current use.

def self.limits(client: Client.new)
static
Parameter Type Default
client Client.new
Source: sdk/ruby/lib/svm/sandbox.rb:335 Source: sdk/ruby/lib/svm/sandbox.rb:334

svm auth login (the browser device-code sign-in) and svm auth logout, and the signed-in session the other commands fall back to when there is no SVM_API_KEY, SVM_ACCESS_TOKEN or saved api_key: the same requests, checks, messages and credential store as the Python CLI (svm/cli_auth.py), so a sign-in made by one CLI is used by the other.

def bounded_int(value, key, minimum, maximum)
static
Parameter Type Default
value
key
minimum
maximum

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/auth.rb:283
def config_path(env)
static
Parameter Type Default
env
Source: sdk/ruby/lib/svm/cli/auth.rb:57
def configure(path, domain, api_key, team = nil, force: false)
static
Parameter Type Default
path
domain
api_key
team nil
force false

Raises ConfigError

Source: sdk/ruby/lib/svm/cli/auth.rb:86
def configure_command(ctx)
static

svm auth configure: saves the domain and an API key (never echoed, never an argument) to the credentials file the SDKs read, with Python’s checks, messages and file layout (svm/cli_auth.py). The domain is –domain or SVM_DOMAIN: the project file is not read.

Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/auth.rb:46
def info(base, settings, open_store, request: method(:request_json))
static

svm auth info: the domain, which credential the CLI uses (api_key, access_token, session or none) and, for a signed-in user, who that is. No credential is ever part of the answer. /v2/me answers only a signed-in user, so an API key shows no user; the keyring is opened only when no credential is in the environment. settings is the credential the SDKs would use (the environment, else the credentials file), or nil: then the keyring session. signed_in is true only when GET /v2/me answered; it answers only a signed-in user, so an API key or a service account’s token it refuses (401 or 403) is reported with signed_in false, not as an error.

Parameter Type Default
base
settings
open_store
request method(:request_json)
Source: sdk/ruby/lib/svm/cli/auth.rb:246
def login(base, store, request: method(:request_json), sleep: Kernel.method(:sleep), clock: -> { Process.clock_gettime(Process::CLOCK_MONOTONIC) }, open_browser: ->(_uri) { false }, write: ->(text) { $stdout.puts(text) })
static
Parameter Type Default
base
store
request method(:request_json)
sleep Kernel.method(:sleep)
clock -> { Process.clock_gettime(Process::CLOCK_MONOTONIC) }
open_browser ->(_uri) { false }
write ->(text) { $stdout.puts(text) }

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/auth.rb:190
def logout(base, store, request: method(:request_json))
static
Parameter Type Default
base
store
request method(:request_json)
Source: sdk/ruby/lib/svm/cli/auth.rb:267
def loopback?(host)
static
Parameter Type Default
host
Source: sdk/ruby/lib/svm/cli/auth.rb:138
def open_browser(uri)
static

Python’s webbrowser.open: best effort; false when no browser could be started.

Parameter Type Default
uri
Source: sdk/ruby/lib/svm/cli/auth.rb:307
def prompt_api_key(stdin, err)
static

Reads a line from the terminal with echo off.

Parameter Type Default
stdin
err
Source: sdk/ruby/lib/svm/cli/auth.rb:79
def read_api_key(from_stdin, env, stdin, err, prompt)
static
Parameter Type Default
from_stdin
env
stdin
err
prompt
Source: sdk/ruby/lib/svm/cli/auth.rb:61
def refresh_access_token(base, store, request: method(:request_json))
static

Trades the stored refresh token for an access token (refreshAuthSession) and stores the rotated refresh token.

Parameter Type Default
base
store
request method(:request_json)

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/auth.rb:223
def request_json(base, method, path, body: nil, bearer_token: nil, api_key: nil, timeout: 10)
static

Python’s request_json: one JSON call to the API with no stored credential; an error answer is an ApiError, a broken connection a SandboxError that names the API.

Parameter Type Default
base
method
path
body nil
bearer_token nil
api_key nil
timeout 10

Raises ApiError, SandboxError

Source: sdk/ruby/lib/svm/cli/auth.rb:150
def required_string(value, key)
static
Parameter Type Default
value
key

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/auth.rb:277
def run(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/auth.rb:20
def url(domain, allow_insecure_http: false)
static

Python’s _url: an http(s) API origin, https unless the host is loopback (or allow_insecure_http), without credentials or a path.

Parameter Type Default
domain
allow_insecure_http false
Source: sdk/ruby/lib/svm/cli/auth.rb:120
def user_agent
static Source: sdk/ruby/lib/svm/cli/auth.rb:144
def validate_verification_uri(value)
static

https, or http to a loopback host; a host and no user information. A fragment is allowed: the console routes in the fragment (https://host/#/device), and a fragment never leaves the browser.

Parameter Type Default
value

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/auth.rb:291 Source: sdk/ruby/lib/svm/cli/auth.rb:17

What the data-plane commands ask of a sandbox, in one place so a test can stand in for it. The real one is a thin layer over SVM::Sandbox (commands and files); the recorded cases fix what the commands ask of it.

def download(path, io, o = {})

Streams into an IO; returns [size, sha256].

Parameter Type Default
path
io
o {}
Source: sdk/ruby/lib/svm/cli/box.rb:33
def download_to_file(path, dest, o = {})
Parameter Type Default
path
dest
o {}
Source: sdk/ruby/lib/svm/cli/box.rb:38
def forward_local(port, host, local_port)

A local listener relaying each connection to the port in the sandbox (#url, #close).

Parameter Type Default
port
host
local_port
Source: sdk/ruby/lib/svm/cli/box.rb:87
def info(path, o = {})
Parameter Type Default
path
o {}
Source: sdk/ruby/lib/svm/cli/box.rb:24
def initialize(sandbox)
Parameter Type Default
sandbox
Source: sdk/ruby/lib/svm/cli/box.rb:6
def list(path, depth, o = {})
Parameter Type Default
path
depth
o {}
Source: sdk/ruby/lib/svm/cli/box.rb:20
def open_tunnel(port)

A byte tunnel to a port in the sandbox (#write, #read => nil at the end, #close).

Parameter Type Default
port
Source: sdk/ruby/lib/svm/cli/box.rb:82
def os
Source: sdk/ruby/lib/svm/cli/box.rb:10
def pty_input(pid, data)
Parameter Type Default
pid
data
Source: sdk/ruby/lib/svm/cli/box.rb:73
def pty_open(cols, rows, terminal = {})

Starts the guest’s shell on a terminal of cols x rows (as Python’s pty.create: bash, or PowerShell on Windows, with no arguments), as terminal’s user, in its cwd and with its envs when given; returns its pid.

Parameter Type Default
cols
rows
terminal {}
Source: sdk/ruby/lib/svm/cli/box.rb:62
def pty_resize(pid, cols, rows)
Parameter Type Default
pid
cols
rows
Source: sdk/ruby/lib/svm/cli/box.rb:77
def pty_stream(pid, &block)

Yields the terminal’s output until the shell ends; returns its exit code.

Parameter Type Default
pid
&block optional
Source: sdk/ruby/lib/svm/cli/box.rb:69
def read(path, o = {})
Parameter Type Default
path
o {}
Source: sdk/ruby/lib/svm/cli/box.rb:28
def remove(path, o = {})
Parameter Type Default
path
o {}
Source: sdk/ruby/lib/svm/cli/box.rb:51
def run(command, user, timeout_seconds, sandbox_profile)

[stdout, stderr, exit_code]

Parameter Type Default
command
user
timeout_seconds
sandbox_profile
Source: sdk/ruby/lib/svm/cli/box.rb:15
def sandbox_info

The sandbox as the CLI shows it (connect –no-interactive).

Source: sdk/ruby/lib/svm/cli/box.rb:56
def upload(path, local, mode, o = {})
Parameter Type Default
path
local
mode
o {}
Source: sdk/ruby/lib/svm/cli/box.rb:47
def write(path, bytes, mode, o = {})
Parameter Type Default
path
bytes
mode
o {}
Source: sdk/ruby/lib/svm/cli/box.rb:43 Source: sdk/ruby/lib/svm/cli/box.rb:5

The svm command line: the same commands, flags, output and exit codes as the Python CLI, checked against its recorded cases.

def client_factory(env, hooks)
static

The credential from #settings, else the session svm auth login saved in the OS credential store (refreshed for an access token), as the Python CLI’s _client does.

Parameter Type Default
env
hooks
Source: sdk/ruby/lib/svm/cli.rb:85
def config_command(ctx, config_path, config)
static
Parameter Type Default
ctx
config_path
config
Source: sdk/ruby/lib/svm/cli.rb:194
def credential_domain(given, env, project)
static

The domain a command talks to and where it came from (–domain, SVM_DOMAIN, the credentials file or the project file).

A project file (svm.toml) never chooses the domain a credential from the environment or the credentials file is sent to (cert-2026-11-29, last review finding): only –domain, SVM_DOMAIN or the credentials file’s own domain do. A project domain that differs from the one the credential goes to or is the only one configured, is a configuration error.

Parameter Type Default
given
env
project

Raises ConfigError

Source: sdk/ruby/lib/svm/cli.rb:34
def default_hooks(env)
static
Parameter Type Default
env
Source: sdk/ruby/lib/svm/cli.rb:101
def dispatch(ctx, config_path, config)
static
Parameter Type Default
ctx
config_path
config
Source: sdk/ruby/lib/svm/cli.rb:181
def error_text(error)
static

The text Python prints for an error: a data-plane failure is its message alone (“not_found”), without the ERROR_CODE_PATH_NOT_FOUND: prefix SVM::ProcessError#message carries.

Parameter Type Default
error

Raises ProcessError

Source: sdk/ruby/lib/svm/cli.rb:108
def main(argv, env: ENV.to_h, out: $stdout, err: $stderr, stdin: $stdin, cwd: Dir.pwd, box_factory: nil, hooks: {})
static

Returns the exit code. hooks replaces what reaches beyond the streams (see Context#hook); a test passes its own.

Parameter Type Default
argv
env ENV.to_h
out $stdout
err $stderr
stdin $stdin
cwd Dir.pwd
box_factory nil
hooks {}
Source: sdk/ruby/lib/svm/cli.rb:119
def plain_domain(value)
static

A domain as compared and shown: with a scheme (https:// when it has none), lower case, no trailing slash.

Parameter Type Default
value
Source: sdk/ruby/lib/svm/cli.rb:56
def settings(domain, env, source = "--domain")
static

The credential as the SDKs resolve it: SVM_API_KEY or SVM_ACCESS_TOKEN, else the api_key in the credentials file ($SVM_CONFIG, else the default path); nil when there is none. domain (–domain, SVM_DOMAIN or svm.toml; source says which) wins over the file’s domain for a key from the environment.

A key from the credentials file is only sent to the domain saved with it (cert-2026-11-29 review R2-1): another domain, from –domain, SVM_DOMAIN or the project file, is a configuration error, so a cloned repository’s svm.toml cannot redirect it. A file without a domain lets –domain or SVM_DOMAIN choose, never the project file.

Parameter Type Default
domain
env
source "--domain"

Raises ConfigError

Source: sdk/ruby/lib/svm/cli.rb:67
def usage(err, message)
static
Parameter Type Default
err
message
Source: sdk/ruby/lib/svm/cli.rb:113 Source: sdk/ruby/lib/svm/cli.rb:21

gRPC-Web over HTTP/1.1 (unary, server-streaming and client-streaming calls): the messages travel in 5-byte-framed protobuf, the status in a final trailer frame. The edge relays them as ordinary gRPC.

Field Type Description
handle
retry_policy
def self.cancelled
static Source: sdk/ruby/lib/svm/envd.rb:155
def check_open!(mark)

Raises the CANCELLED error a closed call ends with when #close ran after mark (an earlier #epoch).

Parameter Type Default
mark
Source: sdk/ruby/lib/svm/envd.rb:151
def close

Ends the calls in flight on this channel: they raise CANCELLED and are not retried (a follower does not reconnect). A later call opens a new connection.

Source: sdk/ruby/lib/svm/envd.rb:161
def epoch

How many times #close has run: a call or a follower that began before a close ends instead of reconnecting.

Source: sdk/ruby/lib/svm/envd.rb:146
def initialize(handle, retry_policy, allow_insecure_http: false, timeout: 3600)
Parameter Type Default
handle
retry_policy
allow_insecure_http false
timeout 3600

Raises SandboxError

Source: sdk/ruby/lib/svm/envd.rb:112
def retry_policy
Source: sdk/ruby/lib/svm/envd.rb:125
def stream(service, rpc, requests, &block)

Calls rpc, yielding each message as it arrives. requests are sent as the one request body (a client stream is sent whole).

Parameter Type Default
service
rpc
requests
&block optional
Source: sdk/ruby/lib/svm/envd.rb:134
def unary(service, rpc, request)
Parameter Type Default
service
rpc
request
Source: sdk/ruby/lib/svm/envd.rb:127
def unary_client_stream(service, rpc, messages)

A client-streaming call: every message goes in one request body and the one answer comes back.

Parameter Type Default
service
rpc
messages
Source: sdk/ruby/lib/svm/envd_clients.rb:854 Source: sdk/ruby/lib/svm/envd.rb:111

The client’s proxy:, http_version:, headers: and logger: options, checked once when the client is made.

def self.headers(headers)
static

Extra headers for every call, as given; a reserved name, a bad name or a value with a line break is an ArgumentError.

Parameter Type Default
headers

Raises ArgumentError

Source: sdk/ruby/lib/svm/client_options.rb:14
def self.http(uri, proxy)
static

A Net::HTTP to uri, through proxy when there is one (and then not the environment’s), otherwise as Net::HTTP decides.

Parameter Type Default
uri
proxy
Source: sdk/ruby/lib/svm/client_options.rb:61
def self.http_version(version, proxy = nil)
static

The HTTP version a client was asked for: nil (the default, which is HTTP/1.1), “1.1” or “2”; anything else is an ArgumentError. Net::HTTP speaks HTTP/1.1 only, so “2” is the optional +http-2+ gem (SVM::Http2): without it, and with a proxy (the tunnel is HTTP/1.1), “2” is refused rather than ignored.

Parameter Type Default
version
proxy nil

Raises ArgumentError

Source: sdk/ruby/lib/svm/client_options.rb:27
def self.proxy(proxy)
static

An http:// proxy URL, optionally with user:password@, as a URI; the error never repeats it (it may hold a password). Net::HTTP on Ruby 2.6 speaks plain HTTP to a proxy, so an https:// proxy is refused rather than used without TLS.

Parameter Type Default
proxy
Source: sdk/ruby/lib/svm/client_options.rb:40
def self.proxy_secrets(proxy)
static

The parts of a proxy URL kept out of every message.

Parameter Type Default
proxy
Source: sdk/ruby/lib/svm/client_options.rb:54 Source: sdk/ruby/lib/svm/client_options.rb:8

Result types of the code interpreter, as Python’s svm.code_interpreter_models has them. They live in this namespace because SVM::Result is a command’s result.

def self.chart_struct(*members)
static
Parameter Type Default
*members optional
Source: sdk/ruby/lib/svm/charts.rb:37 Source: sdk/ruby/lib/svm/code_interpreter.rb:13

Where the API key and domain come from: arguments, then the environment, then a config file. The file is JSON with domain and api_key: $SVM_CONFIG when set (and then it must exist), else <XDG_CONFIG_HOME or ~/.config>/fcap/config.json when that exists. A file that holds an api_key must not be readable by group or others. The first source that gives any credential decides whether the key or the bearer token is used; the domain is chosen the same way on its own.

def self.default_path(env)
static
Parameter Type Default
env
Source: sdk/ruby/lib/svm/config.rb:12
def self.read(env)
static
Parameter Type Default
env

Raises ConfigError

Source: sdk/ruby/lib/svm/config.rb:17
def self.resolve(domain: nil, api_key: nil, bearer_token: nil, env: ENV)
static
Parameter Type Default
domain nil
api_key nil
bearer_token nil
env ENV

Raises ConfigError

Source: sdk/ruby/lib/svm/config.rb:38 Source: sdk/ruby/lib/svm/config.rb:8

The credentials could not be found or the config file cannot be trusted. kind is no_credentials, config_permissions, config_invalid, config_missing or conflict.

Field Type Description
kind
def initialize(kind, message)
Parameter Type Default
kind
message
Source: sdk/ruby/lib/svm/errors.rb:99 Source: sdk/ruby/lib/svm/errors.rb:96

An address of the origin that answers, for every new connection (the kept-alive ones are SVM::ConnectionPool’s).

Net::HTTP walks a host’s addresses one after another: on a machine whose IPv6 route leads nowhere, a name with AAAA and A records costs 3 s or more per dead address on every new connection and every stream (6 s in the lab where this was found).

def address_for(host, port, timeout = 10)
static

The IP address to connect to for host, or nil to let Net::HTTP decide: nil for an IP literal, for a host with one address family, when nothing answered in timeout seconds (Net::HTTP then reports its own error), and on Ruby 3.4 and newer, whose sockets already race the families. The choice is remembered for ADDRESS_TTL seconds.

Parameter Type Default
host
port
timeout 10
Source: sdk/ruby/lib/svm/connect.rb:20
def alternate(infos)
static

The addresses with the families alternating, the resolver’s first family first (RFC 8305 section 4).

Parameter Type Default
infos
Source: sdk/ruby/lib/svm/connect.rb:43
def forget(host, port)
static

Drops the remembered address of host (a connection to it failed: the network may have changed).

Parameter Type Default
host
port
Source: sdk/ruby/lib/svm/connect.rb:38
def race(infos, timeout)
static

The first address a TCP connection to could be established with, trying them ATTEMPT_DELAY apart; nil when none could.

Parameter Type Default
infos
timeout
Source: sdk/ruby/lib/svm/connect.rb:51 Source: sdk/ruby/lib/svm/connect.rb:9

Started HTTP/1.1 connections kept per origin and reused across calls (keep-alive), so a call does not pay DNS, TCP and TLS again. Without it every call opened a connection; on a network whose IPv6 route reaches nothing, Ruby before 3.4 (no Happy Eyeballs) waits on each IPv6 address first, about 6 s per call against a dual-stack host (mtcert 2026-12-04).

One pool serves the whole process: credentials travel in each request’s headers, never on the connection, so clients of any credential share it. A connection is used by one call at a time. It is not reused after a failed call, after it has been idle longer than IDLE_SECONDS, or, for a call that must not be sent twice, after REPLAY_SAFE_SECONDS: an idle socket the server has just closed would fail such a call after it may have been written. A child process after fork drops its parent’s connections without closing them (closing would end the parent’s TLS sessions).

def clear

Closes every idle connection.

Source: sdk/ruby/lib/svm/connection_pool.rb:67
def idle_count

Idle connections across all origins (for tests and diagnostics).

Source: sdk/ruby/lib/svm/connection_pool.rb:62
def initialize(clock: -> { Process.clock_gettime(Process::CLOCK_MONOTONIC) })
Parameter Type Default
clock -> { Process.clock_gettime(Process::CLOCK_MONOTONIC) }
Source: sdk/ruby/lib/svm/connection_pool.rb:33
def self.shared
static Source: sdk/ruby/lib/svm/connection_pool.rb:29
def with(key, repeatable:, open_timeout:, factory:, fresh: false)

Yields (http, reused): a started connection for key, built by factory when none is idle. When the block returns, the connection goes back to the pool; when it raises, the connection is closed. repeatable is false for a call that must not be sent twice, which then takes only a connection used within REPLAY_SAFE_SECONDS. fresh skips the idle ones.

Parameter Type Default
key
repeatable
open_timeout
factory
fresh false
Source: sdk/ruby/lib/svm/connection_pool.rb:40 Source: sdk/ruby/lib/svm/connection_pool.rb:14

svm sandbox exec and svm sandbox files ... over a sandbox’s data plane.

def exec(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/data_commands.rb:19
def files(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/data_commands.rb:67
def info(entry)
static

An entry as the CLI shows it: the type without the wire enum’s prefix, in lower case.

Parameter Type Default
entry
Source: sdk/ruby/lib/svm/cli/data_commands.rb:40
def mode(text)
static
Parameter Type Default
text
Source: sdk/ruby/lib/svm/cli/data_commands.rb:48
def options(ctx, *names)
static

The file-call options the command line set (user, gzip, metadata); nothing for one left alone, so a call that names none is exactly the call it always was.

Parameter Type Default
ctx
*names optional
Source: sdk/ruby/lib/svm/cli/data_commands.rb:56
def read(ctx, box)
static
Parameter Type Default
ctx
box
Source: sdk/ruby/lib/svm/cli/data_commands.rb:88
def run(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/data_commands.rb:8
def shell_quote(word)
static

Python’s shlex.quote

Parameter Type Default
word
Source: sdk/ruby/lib/svm/cli/data_commands.rb:14
def write(ctx, box)
static
Parameter Type Default
ctx
box
Source: sdk/ruby/lib/svm/cli/data_commands.rb:104 Source: sdk/ruby/lib/svm/cli/data_commands.rb:4

Lets rescue SVM::NotFoundError (and case ... when) match a data-plane failure of that cause.

===

def ===(other)
Parameter Type Default
other
Source: sdk/ruby/lib/svm/errors.rb:207 Source: sdk/ruby/lib/svm/errors.rb:206 Source: sdk/ruby/lib/svm/envd/proto.rb:10

What git and the language-server installs need while a sandbox’s layer-7 egress is on: the proxy URL (credentials included) and the CA it signs with, written owner-only into the sandbox. Read at each use from the sandbox’s egress settings, never put on a command line.

def self.settings(sandbox)
static

The sandbox’s egress settings when the firewall is on with a proxy and a CA, else nil. A deployment without the rules, or a key that may not read them, means no proxy.

Parameter Type Default
sandbox
Source: sdk/ruby/lib/svm/egress_env.rb:9
def self.write_ca(box, ca, **options)
static

Writes the CA to CA_FILE through box and returns the path; nil when the write failed (the result is yielded to the block first).

Parameter Type Default
box
ca
**options optional
Source: sdk/ruby/lib/svm/egress_env.rb:20 Source: sdk/ruby/lib/svm/egress_env.rb:4
def self.check_open(channel, mark)
static
Parameter Type Default
channel
mark
Source: sdk/ruby/lib/svm/envd.rb:292
def self.grpc_message(raw)
static

The text of a grpc-message header or trailer. gRPC percent-encodes it (“sandbox%20has%20ended”); a sequence that is not %XX stays as sent, and bytes that do not decode to UTF-8 are replaced rather than raised on.

Parameter Type Default
raw
Source: sdk/ruby/lib/svm/envd.rb:283
def self.mark(channel)
static

The channel’s close count now (nil for a channel that cannot be closed); Envd.check_open raises once the channel closed after it.

Parameter Type Default
channel
Source: sdk/ruby/lib/svm/envd.rb:288
def self.transient?(error)
static

Whether the same call may succeed on a new connection: the connection broke or the sandbox is not ready. A guest that took the call and stopped answering (reason GUEST_UNRESPONSIVE) is not: the host has already waited its health timeout, so a new connection meets the same stuck guest; the caller gets GuestUnresponsiveError at once.

Parameter Type Default
error

Raises GuestUnresponsiveError

Source: sdk/ruby/lib/svm/envd.rb:299 Source: sdk/ruby/lib/svm/envd.rb:39

The connection did not speak HTTP/2 (or broke it). An IOError, so the client reports it as a TransportError.

Source: sdk/ruby/lib/svm/http2.rb:17

A file or directory in a sandbox does not exist: a data-plane failure (ProcessError) with envd’s ERROR_CODE_PATH_NOT_FOUND (the reference vendor’s FileNotFoundError). A NotFoundError, so rescue SVM::NotFoundError still catches it.

def self.detail(details, kind)
static · from ApiError

A value from the details, whether they arrive as a list of {type, value} or as a mapping.

Parameter Type Default
details
kind
Source: sdk/ruby/lib/svm/errors.rb:148
def self.for(code, message, status, request_id = nil, path: nil, **fields)
static · from ApiError

The most specific error class for a code. GUEST_UNRESPONSIVE, SANDBOX_UNREACHABLE and FILE_UPLOAD_FAILED name their classes from the code alone (never from the path). For NOT_FOUND the request’s path says what is missing (a sandbox, volume or secret); HTTP 507 is NotEnoughSpaceError; an unknown code stays a plain ApiError.

Parameter Type Default
code
message
status
request_id nil
path nil
**fields optional

Raises ApiError, NotEnoughSpaceError

Source: sdk/ruby/lib/svm/errors.rb:137
def initialize(code, message, status, request_id = nil, details: nil, retryable: nil, retry_after_seconds: nil)
from ApiError
Parameter Type Default
code
message
status
request_id nil
details nil
retryable nil
retry_after_seconds nil
Source: sdk/ruby/lib/svm/errors.rb:11 Source: sdk/ruby/lib/svm/errors.rb:31

Follows a process across broken connections. A command’s output is addressed by byte offset, so a stream that breaks is picked up again with Connect from the offsets already seen: nothing is lost and nothing repeats. A stream that broke before its start event is ambiguous, so the client looks for it by its tag and starts it again only when it is not there.

Field Type Description
based
offsets
def initialize(channel, request, pid)
Parameter Type Default
channel
request
pid
Source: sdk/ruby/lib/svm/envd.rb:310
def run(&on_event)
Parameter Type Default
&on_event optional
Source: sdk/ruby/lib/svm/envd.rb:320 Source: sdk/ruby/lib/svm/envd.rb:309

Output the way the Python CLI writes it: str() of a value (True, None, single-quoted dicts) in text mode, and json.dumps(sort_keys=True, ensure_ascii=True) in JSON mode, so every SDK’s CLI prints the same bytes.

def json(value)
static
Parameter Type Default
value
Source: sdk/ruby/lib/svm/cli/format.rb:39
def json_string(text)
static
Parameter Type Default
text
Source: sdk/ruby/lib/svm/cli/format.rb:51
def py_quote(text)
static
Parameter Type Default
text
Source: sdk/ruby/lib/svm/cli/format.rb:24
def py_repr(value)
static
Parameter Type Default
value
Source: sdk/ruby/lib/svm/cli/format.rb:8
def py_str(value)
static
Parameter Type Default
value
Source: sdk/ruby/lib/svm/cli/format.rb:20 Source: sdk/ruby/lib/svm/cli/format.rb:5

A local listener whose connections are relayed through tunnels to a port in a sandbox.

Field Type Description
host +host+ and +port+ are the local listener’s (+port+ is the one the system chose when 0 was asked for).
port +host+ and +port+ are the local listener’s (+port+ is the one the system chose when 0 was asked for).
def addr
Source: sdk/ruby/lib/svm/streams.rb:252
def close
Source: sdk/ruby/lib/svm/streams.rb:255
def initialize(sandbox, remote_port, host, local_port)
Parameter Type Default
sandbox
remote_port
host
local_port
Source: sdk/ruby/lib/svm/streams.rb:244
def url
Source: sdk/ruby/lib/svm/streams.rb:253 Source: sdk/ruby/lib/svm/streams.rb:240

A sandbox as the guest helpers see it: commands and file writes, over the data plane.

def initialize(sandbox)
Parameter Type Default
sandbox
Source: sdk/ruby/lib/svm/mcp_approvals.rb:47
def run(command, **options)
Parameter Type Default
command
**options optional
Source: sdk/ruby/lib/svm/mcp_approvals.rb:51
def write_file(path, content)
Parameter Type Default
path
content
Source: sdk/ruby/lib/svm/mcp_approvals.rb:55 Source: sdk/ruby/lib/svm/mcp_approvals.rb:46

Persistent shell sessions and tmux-style terminals: helpers that run in the sandbox through its commands. They take anything that answers run(command, **options) with a result that has stdout, stderr and exit_code, which a Sandbox does through Sandbox#sessions and #terminals.

def self.checked_name(name, what = "names")
static
Parameter Type Default
name
what "names"
Source: sdk/ruby/lib/svm/guest_tools.rb:14
def self.q(word)
static
Parameter Type Default
word
Source: sdk/ruby/lib/svm/guest_tools.rb:10
def self.session_create_script(name, cwd: nil, envs: nil)
static

The shell that creates a session; public so a test can run it for real.

Parameter Type Default
name
cwd nil
envs nil
Source: sdk/ruby/lib/svm/guest_tools.rb:24
def self.session_run_script(name, command)
static

Restores the session, runs command in this shell, and saves cwd and exports on the way out, even after exit.

Parameter Type Default
name
command
Source: sdk/ruby/lib/svm/guest_tools.rb:38
def self.sorted_lines(text)
static
Parameter Type Default
text
Source: sdk/ruby/lib/svm/guest_tools.rb:19 Source: sdk/ruby/lib/svm/guest_tools.rb:5

--help / -h (or svm help ...) for this command path: the CLI prints Parser#help_text(path) and exits 0.

Field Type Description
path
def initialize(path)
Parameter Type Default
path
Source: sdk/ruby/lib/svm/cli/parser.rb:11 Source: sdk/ruby/lib/svm/cli/parser.rb:8

HTTP/2 for the client’s http_version: “2” option. Net::HTTP speaks HTTP/1.1 only, so this is an optional extra built on the pure-Ruby +http-2+ gem (the protocol: frames, HPACK, flow control), loaded only when a client asks for it; the sockets are this file’s. Over TLS it offers only h2 by ALPN, and on +http://+ it speaks HTTP/2 with prior knowledge (h2c), so a server that does not speak HTTP/2 fails the call; nothing falls back to HTTP/1.1. A Session answers the subset of Net::HTTP the client uses (the timeouts and request), one connection per call, as the Net::HTTP path does.

def self.require!
static

Loads the http-2 gem or raises the ArgumentError that names it; called when the client is made.

Raises ArgumentError

Source: sdk/ruby/lib/svm/http2.rb:20 Source: sdk/ruby/lib/svm/http2.rb:12

macOS keychain through /usr/bin/security; Python’s keyring macOS backend keeps a generic password with the same service (kSecAttrService) and account (kSecAttrAccount). The token never appears in a process’s arguments: security -i reads the add command on standard input.

def delete(service)
Parameter Type Default
service
Source: sdk/ruby/lib/svm/cli/keyring.rb:93
def get(service)
Parameter Type Default
service
Source: sdk/ruby/lib/svm/cli/keyring.rb:76
def set(service, token)
Parameter Type Default
service
token
Source: sdk/ruby/lib/svm/cli/keyring.rb:83 Source: sdk/ruby/lib/svm/cli/keyring.rb:72

The OS credential stores, reached as Python’s keyring reaches them (service “firecracker-agent-platform:<api url>”, account “session-refresh”), so a sign-in made by one CLI is used by the other. Only the rotating refresh token is kept. Like Python, there is no file fallback: without an OS store the CLI refuses to keep a token.

def open(url, path: ENV["PATH"])
static

The store for an API URL (already normalized), as Python’s CredentialStore(domain) opens it.

Parameter Type Default
url
path ENV["PATH"]

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/keyring.rb:19
def which(name, path)
static
Parameter Type Default
name
path
Source: sdk/ruby/lib/svm/cli/keyring.rb:35 Source: sdk/ruby/lib/svm/cli/keyring.rb:9

The commands that hold a terminal or a socket open: sandbox connect, sandbox forward and ssh, plus eval, which runs the svm-eval harness. Each behaves as the Python CLI’s does (svm/cli.py, svm/cli_network.py).

def bridge(ctx, box, port)
static

Copies standard input to the tunnel and the tunnel to standard output until the guest closes the port.

Parameter Type Default
ctx
box
port
Source: sdk/ruby/lib/svm/cli/live_commands.rb:188
def connect(ctx)
static

svm sandbox connect ID [--no-interactive]: an interactive guest shell on a PTY, or the sandbox’s information.

Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/live_commands.rb:13
def console_size(io)
static
Parameter Type Default
io
Source: sdk/ruby/lib/svm/cli/live_commands.rb:34
def eval_split(argv)
static

The global options before eval and the arguments after it, when the command is eval (Python’s _eval_args).

Parameter Type Default
argv
Source: sdk/ruby/lib/svm/cli/live_commands.rb:225
def forward(ctx)
static

svm sandbox forward ID PORT [--local-port N] [--host H]: listens until interrupted, then exits 0.

Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/live_commands.rb:144
def interactive(ctx, box)
static

Raw mode on a terminal standard input (restored after), keys sent as they are typed, the terminal resized with the local window (SIGWINCH), the guest’s output written as it arrives until the shell ends.

Piped input (F166) waits for the shell’s first output. Sent earlier, it reached the PTY before the shell’s line editor took the terminal, so the guest’s terminal echoed it (“echo …\r\nexit\r\n”) and the replay from the start printed that echo ahead of the prompt. Once the shell has written its prompt it echoes each line itself, after the prompt, as the other CLIs show. Keys typed on a terminal are sent at once, as before.

Parameter Type Default
ctx
box

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/live_commands.rb:76
def run_eval(globals, rest, env:, out:, err:, stdin:, cwd:)
static

svm eval ...: the svm-eval harness (bench/eval) with the rest of the line and SVM_DOMAIN from –domain, SVM_DOMAIN or svm.toml. Python imports the harness in-process; it is a Python package, so this runs its svm-eval command, which is the same entry point.

Parameter Type Default
globals
rest
env
out
err
stdin
cwd
Source: sdk/ruby/lib/svm/cli/live_commands.rb:236
def run_program(ctx, name, args)
static

Runs a program found on PATH with this process’s standard streams; its exit code (negative for a signal, as Python’s subprocess.call) is the command’s.

Parameter Type Default
ctx
name
args
Source: sdk/ruby/lib/svm/cli/live_commands.rb:216
def ssh(ctx)
static

svm ssh ID [--user U] [--port P] [--proxy | --print-config] [-- ssh args].

Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/live_commands.rb:167
def terminal?(input)
static
Parameter Type Default
input
Source: sdk/ruby/lib/svm/cli/live_commands.rb:113
def terminal_size(ctx)
static

Python’s shutil.get_terminal_size((80, 24)): COLUMNS and LINES win, then the size of standard output, else 80x24.

Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/live_commands.rb:24
def trap_resize(ctx, box, pid)
static

Returns the WINCH handler it replaced, or :none when the platform has no SIGWINCH.

Parameter Type Default
ctx
box
pid
Source: sdk/ruby/lib/svm/cli/live_commands.rb:131
def wait_for_interrupt
static

Blocks until Ctrl-C.

Source: sdk/ruby/lib/svm/cli/live_commands.rb:160
def with_raw(input)
static
Parameter Type Default
input
Source: sdk/ruby/lib/svm/cli/live_commands.rb:119 Source: sdk/ruby/lib/svm/cli/live_commands.rb:7

Egress rules, the inbound allowlist and custom domains.

def domain(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/network_commands.rb:81
def egress(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/network_commands.rb:17
def inbound(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/network_commands.rb:71
def inject_rule(value, identity)
static

HOST:HEADER=SECRET (or =AUDIENCE) as an allow rule with an inject object; the host is split at the first colon, the header at the first equals sign.

Parameter Type Default
value
identity
Source: sdk/ruby/lib/svm/cli/network_commands.rb:39
def redact_proxy(response)
static

The proxy URL carries the sandbox’s proxy token, which belongs in the guest, not in terminal scrollback.

Parameter Type Default
response
Source: sdk/ruby/lib/svm/cli/network_commands.rb:61
def rule(action, value)
static
Parameter Type Default
action
value
Source: sdk/ruby/lib/svm/cli/network_commands.rb:48
def run(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/network_commands.rb:9 Source: sdk/ruby/lib/svm/cli/network_commands.rb:6

Opens once, by the first output or by the wait running out (Ruby 2.6’s Queue#pop has no timeout).

def initialize(open)
Parameter Type Default
open
Source: sdk/ruby/lib/svm/cli/live_commands.rb:48
def open!
Source: sdk/ruby/lib/svm/cli/live_commands.rb:52
def wait(seconds)
Parameter Type Default
seconds
Source: sdk/ruby/lib/svm/cli/live_commands.rb:59 Source: sdk/ruby/lib/svm/cli/live_commands.rb:47 Source: sdk/ruby/lib/svm/cli/toml.rb:5

Reads the command line from the shared spec (cli/spec/*.json, generated from the Python CLI’s argparse parser).

def help_text(path)

The help for a command path: the usage line, then a group’s commands or a command’s arguments. Raises UsageError for an unknown path (as svm help nope).

Parameter Type Default
path

Raises UsageError

Source: sdk/ruby/lib/svm/cli/parser.rb:66
def initialize(dir = DIR)
Parameter Type Default
dir DIR
Source: sdk/ruby/lib/svm/cli/parser.rb:22
def parse(argv)
Parameter Type Default
argv

Raises HelpRequest, UsageError

Source: sdk/ruby/lib/svm/cli/parser.rb:27 Source: sdk/ruby/lib/svm/cli/parser.rb:18

Struct-like value whose #to_h is recursive.

def self.plain(v)
static
Parameter Type Default
v
Source: sdk/ruby/lib/svm/charts.rb:28
def to_h
Source: sdk/ruby/lib/svm/charts.rb:24 Source: sdk/ruby/lib/svm/charts.rb:23

Is a PNG one flat colour? Used by Desktop#screenshot to tell the black frame an X server gives before the desktop session has painted from a real frame. An image this cannot decode (palette, 16-bit, interlaced, damaged) counts as not flat, so the caller never waits on what it cannot judge.

def self.flat?(png)
static
Parameter Type Default
png
Source: sdk/ruby/lib/svm/png_flat.rb:12
def self.paeth(a, b, c)
static
Parameter Type Default
a
b
c
Source: sdk/ruby/lib/svm/png_flat.rb:68
def self.unfilter(kind, row, prev, bpp)
static
Parameter Type Default
kind
row
prev
bpp
Source: sdk/ruby/lib/svm/png_flat.rb:50 Source: sdk/ruby/lib/svm/png_flat.rb:7

svm.toml: found from the working directory upwards, or named by –config / SVM_PROJECT_CONFIG (SVM_CONFIG is the SDKs’ credentials file, never the project file). Unknown keys are refused.

def apply(group, command, args, path, data)
static

Fill what a command left unset from the project file, then the built-in defaults.

Parameter Type Default
group
command
args
path
data
Source: sdk/ruby/lib/svm/cli/project_file.rb:88
def check(path, data)
static
Parameter Type Default
path
data
Source: sdk/ruby/lib/svm/cli/project_file.rb:64
def check_fields(path, where, schema, fields)
static
Parameter Type Default
path
where
schema
fields
Source: sdk/ruby/lib/svm/cli/project_file.rb:77
def find(start)
static
Parameter Type Default
start
Source: sdk/ruby/lib/svm/cli/project_file.rb:39
def load(explicit, env, cwd)
static

[path or nil, parsed data]

Parameter Type Default
explicit
env
cwd
Source: sdk/ruby/lib/svm/cli/project_file.rb:50 Source: sdk/ruby/lib/svm/cli/project_file.rb:8

A protobuf codec driven by the generated schema (SVM::Envd::SCHEMA), so the SDK needs no protobuf library. Messages are Hashes keyed by field name; only the fields present on the wire come back. int64 values are Integers, bytes are binary Strings, enums are their names (an unknown number stays a number), google.protobuf.Timestamp is an RFC 3339 String.

def self.convert(type, field, raw)
static
Parameter Type Default
type
field
raw

Raises DecodeError

Source: sdk/ruby/lib/svm/envd/proto.rb:159
def self.decode(message, bytes)
static
Parameter Type Default
message
bytes
Source: sdk/ruby/lib/svm/envd/proto.rb:51
def self.decode_entry(field, raw)
static
Parameter Type Default
field
raw
Source: sdk/ruby/lib/svm/envd/proto.rb:185
def self.default?(field, v)
static
Parameter Type Default
field
v
Source: sdk/ruby/lib/svm/envd/proto.rb:101
def self.default_for(type)
static
Parameter Type Default
type
Source: sdk/ruby/lib/svm/envd/proto.rb:199
def self.encode(message, value)
static
Parameter Type Default
message
value
Source: sdk/ruby/lib/svm/envd/proto.rb:20
def self.enum_number(enum, v)
static
Parameter Type Default
enum
v
Source: sdk/ruby/lib/svm/envd/proto.rb:112
def self.read_raw(bytes, pos, wire)
static
Parameter Type Default
bytes
pos
wire

Raises DecodeError

Source: sdk/ruby/lib/svm/envd/proto.rb:146
def self.read_varint(bytes, pos)
static
Parameter Type Default
bytes
pos

Raises DecodeError

Source: sdk/ruby/lib/svm/envd/proto.rb:133
def self.tag(number, wire)
static
Parameter Type Default
number
wire
Source: sdk/ruby/lib/svm/envd/proto.rb:83
def self.timestamp(m)
static
Parameter Type Default
m
Source: sdk/ruby/lib/svm/envd/proto.rb:178
def self.varint(n)
static
Parameter Type Default
n
Source: sdk/ruby/lib/svm/envd/proto.rb:87
def self.write_value(out, number, type, field, v)
static
Parameter Type Default
out
number
type
field
v
Source: sdk/ruby/lib/svm/envd/proto.rb:117 Source: sdk/ruby/lib/svm/envd/proto.rb:9

Keeping credentials out of text the SDK produces.

def self.text(text, secrets = [])
static

text with every known secret, and anything shaped like a credential header or token parameter, replaced.

Parameter Type Default
text
secrets []
Source: sdk/ruby/lib/svm/redact.rb:14
def self.value(value, secrets = [])
static

The same for the strings inside a structure (a server’s error details).

Parameter Type Default
value
secrets []
Source: sdk/ruby/lib/svm/redact.rb:22 Source: sdk/ruby/lib/svm/redact.rb:3

What Net::HTTPResponse gives the client: code, +[]+, body and read_body (with or without a block).

Field Type Description
code
message
def [](name)
Parameter Type Default
name
Source: sdk/ruby/lib/svm/http2.rb:42
def body
Source: sdk/ruby/lib/svm/http2.rb:73
def each_header(&block)
Parameter Type Default
&block optional
Source: sdk/ruby/lib/svm/http2.rb:46
def http_version
Source: sdk/ruby/lib/svm/http2.rb:50
def initialize(status, headers, pump)
Parameter Type Default
status
headers
pump
Source: sdk/ruby/lib/svm/http2.rb:34
def read_body
Source: sdk/ruby/lib/svm/http2.rb:54 Source: sdk/ruby/lib/svm/http2.rb:31

How a failed request is repeated. max_attempts counts the first try. The wait after attempt n is base_delay * 2**(n-1) capped at max_delay, scaled by jitter (a number in [0.5, 1]); a server’s own Retry-After replaces it, and one longer than max_retry_after ends the call at once. A POST is repeated only because the client attaches an idempotency key to it that every attempt reuses.

Field Type Description
base_delay
jitter
max_attempts
max_delay
max_retry_after
sleeper
def backoff(attempt)

The wait after attempt number attempt (1-based) failed.

Parameter Type Default
attempt
Source: sdk/ruby/lib/svm/retry.rb:26
def initialize(max_attempts: 6, base_delay: 0.25, max_delay: 8.0, max_retry_after: 60.0, jitter: -> { 0.5 + rand * 0.5 }, sleeper: ->(s) { sleep(s) })
Parameter Type Default
max_attempts 6
base_delay 0.25
max_delay 8.0
max_retry_after 60.0
jitter -> { 0.5 + rand * 0.5 }
sleeper ->(s) { sleep(s) }
Source: sdk/ruby/lib/svm/retry.rb:14
def self.parse_retry_after(value)
static

Seconds from a Retry-After header: a number of seconds or an HTTP date; nil when absent or unreadable.

Parameter Type Default
value
Source: sdk/ruby/lib/svm/retry.rb:31
def spread(hinted)

A server’s Retry-After plus up to 25% more (none when jitter is fixed at 1), so clients refused together do not retry in step.

Parameter Type Default
hinted
Source: sdk/ruby/lib/svm/retry.rb:21
def self.status_retryable?(status, code, retryable)
static

Whether an error response says the same request may succeed later.

Parameter Type Default
status
code
retryable
Source: sdk/ruby/lib/svm/retry.rb:46
def wait_before_retry(error, attempt, repeatable)

Seconds to wait before the next attempt, or nil when the error ends the call.

Parameter Type Default
error
attempt
repeatable
Source: sdk/ruby/lib/svm/retry.rb:55 Source: sdk/ruby/lib/svm/retry.rb:8

Verifiers and keep policies for a rollout, as the request carries them.

def self.keep_all
static Source: sdk/ruby/lib/svm/rollouts.rb:20
def self.keep_none
static Source: sdk/ruby/lib/svm/rollouts.rb:21
def self.keep_passed(min_reward)
static
Parameter Type Default
min_reward
Source: sdk/ruby/lib/svm/rollouts.rb:18
def self.keep_top_k(k)
static
Parameter Type Default
k
Source: sdk/ruby/lib/svm/rollouts.rb:19
def self.verify_command(argv, timeout_seconds: nil)
static

A second command in each branch scores it (the last number it prints). argv[0] must be an absolute path in the guest (it is not run through a shell); timeout_seconds (1 to 300; the API’s default is 60) bounds it. It reads the command’s stdout on its stdin and its exit code in $SVM_EXIT_CODE.

Parameter Type Default
argv
timeout_seconds nil
Source: sdk/ruby/lib/svm/rollouts.rb:9
def self.verify_exit_code
static Source: sdk/ruby/lib/svm/rollouts.rb:4
def self.verify_output_match(pattern)
static
Parameter Type Default
pattern
Source: sdk/ruby/lib/svm/rollouts.rb:5
def self.verify_script(body, timeout_seconds: nil)
static

A script run by /bin/sh in each branch scores it (the last number it prints); timeout_seconds (1 to 300; the API’s default is 60) bounds it. The script reads the command’s stdout on its stdin and in $SVM_STDOUT, and its exit code in $SVM_EXIT_CODE.

Parameter Type Default
body
timeout_seconds nil
Source: sdk/ruby/lib/svm/rollouts.rb:15 Source: sdk/ruby/lib/svm/rollouts.rb:3
def create(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/sandbox_commands.rb:74
def list(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/sandbox_commands.rb:102
def logs(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/sandbox_commands.rb:121
def metrics(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/sandbox_commands.rb:128
def run(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/sandbox_commands.rb:15
def safe_info(item)
static

The sandbox as the CLI shows it: never the guest or traffic tokens.

Parameter Type Default
item
Source: sdk/ruby/lib/svm/cli/sandbox_commands.rb:9
def settle(ctx, path, item, transient, timeout = 120)
static

The SDK’s settle: look again soon, then every 100 ms, for at most 120 s, while the sandbox is in the transient state.

Parameter Type Default
ctx
path
item
transient
timeout 120
Source: sdk/ruby/lib/svm/cli/sandbox_commands.rb:63
def state(ctx)
static

sandbox info, sandbox pause [--wait] and sandbox resume [--timeout-seconds N] [--wait]: one call, then the sandbox’s safe fields (never its tokens). With –wait, the sandbox is followed as the SDK’s pause(wait)/resume(wait) do (GET while it is pausing or resuming), so the answer is the settled state even from an API that answers before the change is done.

Parameter Type Default
ctx

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/sandbox_commands.rb:36 Source: sdk/ruby/lib/svm/cli/sandbox_commands.rb:3

The Secret Service (GNOME Keyring, KeePassXC, KWallet’s Secret Service) through libsecret’s secret-tool. Python’s keyring SecretService backend stores the item with these attributes and label and looks it up by service and username; the token goes on standard input.

def delete(service)
Parameter Type Default
service
Source: sdk/ruby/lib/svm/cli/keyring.rb:122
def get(service)
Parameter Type Default
service
Source: sdk/ruby/lib/svm/cli/keyring.rb:109
def initialize(tool)
Parameter Type Default
tool
Source: sdk/ruby/lib/svm/cli/keyring.rb:105
def set(service, token)
Parameter Type Default
service
token
Source: sdk/ruby/lib/svm/cli/keyring.rb:116 Source: sdk/ruby/lib/svm/cli/keyring.rb:102
Field Type Description
max_retries
open_timeout
read_timeout
write_timeout
def initialize(uri)
Parameter Type Default
uri
Source: sdk/ruby/lib/svm/http2.rb:81
def request(req)

Sends req (a Net::HTTPRequest) and returns the Response; with a block, yields it as soon as the headers are in and reads the rest of the body when the block returns (or lets the block’s read_body stream it). The connection is closed afterwards.

Parameter Type Default
req
Source: sdk/ruby/lib/svm/http2.rb:90 Source: sdk/ruby/lib/svm/http2.rb:78
Field Type Description
api_key
bearer_token
domain
Source: sdk/ruby/lib/svm/config.rb:9

Raised inside #with by a caller that found its reused connection stale; the connection is closed and the caller sends again on a new one (fresh: true).

Source: sdk/ruby/lib/svm/connection_pool.rb:24

saved_seconds adds, for every hit, how long the stored run took less how long the hit took.

Field Type Description
hits
misses
saved_seconds
stored
uncacheable
def hit_rate
Source: sdk/ruby/lib/svm/tool_cache.rb:20 Source: sdk/ruby/lib/svm/tool_cache.rb:19

Volumes, snapshots, forks and secrets.

def fork(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/storage_commands.rb:18
def run(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/storage_commands.rb:9
def secret(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/storage_commands.rb:117
def secret_value(ctx)
static

Never a command-line argument, which would land in shell history and the process table.

Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/storage_commands.rb:133
def snapshot(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/storage_commands.rb:96
def volume(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/storage_commands.rb:33
def volume_files(ctx, id)
static
Parameter Type Default
ctx
id
Source: sdk/ruby/lib/svm/cli/storage_commands.rb:54 Source: sdk/ruby/lib/svm/cli/storage_commands.rb:6

The interface the auth commands use (Python’s get/set/delete_refresh_token), with Python’s messages on failure.

def delete_refresh_token

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/keyring.rb:62
def get_refresh_token

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/keyring.rb:49
def initialize(backend, service)
Parameter Type Default
backend
service
Source: sdk/ruby/lib/svm/cli/keyring.rb:45
def set_refresh_token(token)
Parameter Type Default
token

Raises SandboxError

Source: sdk/ruby/lib/svm/cli/keyring.rb:56 Source: sdk/ruby/lib/svm/cli/keyring.rb:44

svm team list, svm team info [TEAM_ID] (without one, the team this credential acts in) and svm team use TEAM_ID.

def run(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/team_commands.rb:7 Source: sdk/ruby/lib/svm/cli/team_commands.rb:4
def init(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/template_commands.rb:47
def publish(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/template_commands.rb:26
def run(ctx)
static
Parameter Type Default
ctx
Source: sdk/ruby/lib/svm/cli/template_commands.rb:10 Source: sdk/ruby/lib/svm/cli/template_commands.rb:5

The subset of TOML that svm.toml uses: tables, strings, integers, booleans, string arrays, inline tables, comments.

def inline_table(text, number)
static
Parameter Type Default
text
number

Raises ParseError

Source: sdk/ruby/lib/svm/cli/toml.rb:99
def list(text, number)
static
Parameter Type Default
text
number

Raises ParseError

Source: sdk/ruby/lib/svm/cli/toml.rb:86
def parse(text)
static
Parameter Type Default
text

Raises ParseError

Source: sdk/ruby/lib/svm/cli/toml.rb:8
def string(text, number)
static
Parameter Type Default
text
number

Raises ParseError

Source: sdk/ruby/lib/svm/cli/toml.rb:61
def strip_comment(line)
static
Parameter Type Default
line
Source: sdk/ruby/lib/svm/cli/toml.rb:29
def value(text, number)
static

Reads one value from the start of text; returns [value, the rest].

Parameter Type Default
text
number

Raises ParseError

Source: sdk/ruby/lib/svm/cli/toml.rb:46 Source: sdk/ruby/lib/svm/cli/toml.rb:4 Source: sdk/ruby/lib/svm/cli/parser.rb:5

What the API says about a volume.

Field Type Description
attached_sandbox_id
created_at
name
size_gb
volume_id
def self.from_hash(h)
static
Parameter Type Default
h
Source: sdk/ruby/lib/svm/volume.rb:7 Source: sdk/ruby/lib/svm/volume.rb:6

Windows Credential Manager as Python’s keyring WinVaultKeyring uses it: a generic credential whose target is the service and whose user is the account (or, when another user already holds the service target, the target “account@service”), the secret as UTF-16LE, persisted for the enterprise, through advapi32 with Fiddle (stdlib).

def self.api
static Source: sdk/ruby/lib/svm/cli/keyring.rb:143
def self.available?
static Source: sdk/ruby/lib/svm/cli/keyring.rb:136
def delete(service)
Parameter Type Default
service
Source: sdk/ruby/lib/svm/cli/keyring.rb:176
def get(service)
Parameter Type Default
service
Source: sdk/ruby/lib/svm/cli/keyring.rb:164
def set(service, token)
Parameter Type Default
service
token
Source: sdk/ruby/lib/svm/cli/keyring.rb:170 Source: sdk/ruby/lib/svm/cli/keyring.rb:131

The same desktop controls on a Windows sandbox (WIN-005). There is no shell to run xdotool in: each call is one PowerShell command that carries a base64 JSON request to the helper installed in the sandbox’s interactive session.

def double_click(x = nil, y = nil)
Parameter Type Default
x nil
y nil
Source: sdk/ruby/lib/svm/desktop_windows.rb:21
def drag(start, finish, _steps = nil)
Parameter Type Default
start
finish
_steps nil
Source: sdk/ruby/lib/svm/desktop_windows.rb:25
def get_application_windows(application)
Parameter Type Default
application
Source: sdk/ruby/lib/svm/desktop_windows.rb:48
def get_current_window_id
Source: sdk/ruby/lib/svm/desktop_windows.rb:47
def get_cursor_position
Source: sdk/ruby/lib/svm/desktop_windows.rb:45
def get_screen_size
Source: sdk/ruby/lib/svm/desktop_windows.rb:46
def get_window_title(window_id)
Parameter Type Default
window_id
Source: sdk/ruby/lib/svm/desktop_windows.rb:49
def has_app(application)

Whether application is a program Windows can start by name (what #launch runs), asked of PowerShell.

Parameter Type Default
application
Source: sdk/ruby/lib/svm/desktop_windows.rb:52
def initialize(sandbox)
from Desktop
Parameter Type Default
sandbox
Source: sdk/ruby/lib/svm/desktop.rb:46
def launch(application, uri = nil)
Parameter Type Default
application
uri nil
Source: sdk/ruby/lib/svm/desktop_windows.rb:43
def left_click(x = nil, y = nil)
Parameter Type Default
x nil
y nil
Source: sdk/ruby/lib/svm/desktop_windows.rb:18
def middle_click(x = nil, y = nil)
Parameter Type Default
x nil
y nil
Source: sdk/ruby/lib/svm/desktop_windows.rb:20
def mouse_press(button = "left")
Parameter Type Default
button "left"
Source: sdk/ruby/lib/svm/desktop_windows.rb:22
def mouse_release(button = "left")
Parameter Type Default
button "left"
Source: sdk/ruby/lib/svm/desktop_windows.rb:23
def move_mouse(x, y)
Parameter Type Default
x
y
Source: sdk/ruby/lib/svm/desktop_windows.rb:17
def open(file_or_url)
Parameter Type Default
file_or_url
Source: sdk/ruby/lib/svm/desktop_windows.rb:44
def press(key)
Parameter Type Default
key
Source: sdk/ruby/lib/svm/desktop_windows.rb:42
def right_click(x = nil, y = nil)
Parameter Type Default
x nil
y nil
Source: sdk/ruby/lib/svm/desktop_windows.rb:19
def screenshot(wait_for_frame: nil)

The Windows session is drawn when the helper answers, so there is no first frame to wait for.

Parameter Type Default
wait_for_frame nil

Raises SandboxError

Source: sdk/ruby/lib/svm/desktop_windows.rb:80
def scroll(amount = 1)
Parameter Type Default
amount 1
Source: sdk/ruby/lib/svm/desktop_windows.rb:35
def session_envs

wait_and_verify’s check runs in PowerShell as it is; there is no X display.

Source: sdk/ruby/lib/svm/desktop_windows.rb:10
def stream_url
from Desktop

Mints a one-time, short-lived noVNC browser entry URL; treat it as a secret. Waits (up to 15 s) until the noVNC server listens.

Raises SandboxError

Source: sdk/ruby/lib/svm/desktop.rb:238
def wait(ms)
from Desktop
Parameter Type Default
ms
Source: sdk/ruby/lib/svm/desktop.rb:156
def wait_and_verify(command, timeout: 10.0, interval: 0.5, &on_result)
from Desktop

Runs command in the desktop’s session every interval seconds until the block accepts its result (true), or timeout seconds pass (false). The block gets the command’s result (stdout, stderr, exit_code) whatever its exit code. The command runs at least once.

Parameter Type Default
command
timeout 10.0
interval 0.5
&on_result optional
Source: sdk/ruby/lib/svm/desktop.rb:164
def wait_until_ready(timeout: 60.0)

Waits until the interactive session answers the helper and has drawn a frame that is not one flat colour, and returns the seconds it took (a Float). Raises Timeout::Error after timeout seconds (Python raises its built-in TimeoutError).

Parameter Type Default
timeout 60.0

Raises TimeoutError

Source: sdk/ruby/lib/svm/desktop_windows.rb:60
def write(text, chunk_size: 25, delay_in_ms: 75)
Parameter Type Default
text
chunk_size 25
delay_in_ms 75
Source: sdk/ruby/lib/svm/desktop_windows.rb:37 Source: sdk/ruby/lib/svm/desktop_windows.rb:8