Functions
add_parser
Section titled “add_parser”def add_parser(groups: argparse._SubParsersAction) -> None| Parameter | Type | Default |
|---|---|---|
groups |
argparse._SubParsersAction |
sdk/python/svm/cli_config.py:43add_parser
Section titled “add_parser”def add_parser(box: argparse._SubParsersAction) -> None| Parameter | Type | Default |
|---|---|---|
box |
argparse._SubParsersAction |
sdk/python/svm/cli_files.py:21add_parser
Section titled “add_parser”def add_parser(groups: argparse._SubParsersAction) -> None| Parameter | Type | Default |
|---|---|---|
groups |
argparse._SubParsersAction |
sdk/python/svm/cli_network.py:21add_parser
Section titled “add_parser”def add_parser(groups: argparse._SubParsersAction) -> None| Parameter | Type | Default |
|---|---|---|
groups |
argparse._SubParsersAction |
sdk/python/svm/cli_storage.py:19add_parser
Section titled “add_parser”def add_parser(groups: argparse._SubParsersAction) -> None| Parameter | Type | Default |
|---|---|---|
groups |
argparse._SubParsersAction |
sdk/python/svm/cli_team.py:14add_parser
Section titled “add_parser”def add_parser(groups: argparse._SubParsersAction) -> None| Parameter | Type | Default |
|---|---|---|
groups |
argparse._SubParsersAction |
sdk/python/svm/cli_templates.py:27api_error
Section titled “api_error”def api_error(*, code: str, message: str, status_code: int, path: str | None=None, **fields) -> ApiErrorThe most specific ApiError for code. GUEST_UNRESPONSIVE, SANDBOX_UNREACHABLE and FILE_UPLOAD_FAILED name GuestUnresponsiveError, SandboxUnreachableError and FileUploadApiError 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 |
str |
|
message |
str |
|
status_code |
int |
|
path |
str | None |
None |
fields |
optional |
Returns ApiError
Raises ApiError, FileUploadApiError, GuestUnresponsiveError, NotEnoughSpaceError, SandboxUnreachableError
sdk/python/svm/errors.py:280def apply(args: argparse.Namespace, path: Path | None, data: dict[str, Any]) -> NoneFill the arguments a command left unset from the project file, then the built-in defaults.
| Parameter | Type | Default |
|---|---|---|
args |
argparse.Namespace |
|
path |
Path | None |
|
data |
dict[str, Any] |
sdk/python/svm/cli_config.py:103config_path
Section titled “config_path”def config_path(env: dict[str, str]) -> strThe file the SDKs read the credentials from: $SVM_CONFIG when set, else the default location (see _config).
| Parameter | Type | Default |
|---|---|---|
env |
dict[str, str] |
Returns str
sdk/python/svm/cli_auth.py:187configure
Section titled “configure”def configure(path: str, domain: str, api_key: str, team: str | None=None, *, force: bool=False) -> dict[str, Any]Write domain and api_key (and default_team_id when given) to the credentials file at path, mode 0600, keeping every other key in it. A file that already holds a domain or an API key is left alone unless force. The file is replaced atomically; a file that cannot be read as a JSON object is never overwritten. Nothing returned or raised holds the key.
| Parameter | Type | Default |
|---|---|---|
path |
str |
|
domain |
str |
|
api_key |
str |
|
team |
str | None |
None |
force |
bool |
False |
Returns dict[str, Any]
sdk/python/svm/cli_auth.py:211create_script
Section titled “create_script”def create_script(name: str, cwd: str | None, envs: dict[str, str] | None) -> str| Parameter | Type | Default |
|---|---|---|
name |
str |
|
cwd |
str | None |
|
envs |
dict[str, str] | None |
Returns str
sdk/python/svm/sessions.py:26default_build_logger
Section titled “default_build_logger”def default_build_logger(file: IO[str] | None=None) -> Callable[[BuildLogLine], None]An on_log for build/follow_logs that writes each line as <timestamp> [<stream>] <text> to file (standard error by default).
| Parameter | Type | Default |
|---|---|---|
file |
IO[str] | None |
None |
Returns Callable[[BuildLogLine], None]
sdk/python/svm/templates.py:58deserialize_chart
Section titled “deserialize_chart”def deserialize_chart(data: Dict[str, Any]) -> ChartThe typed chart for the kernel’s chart JSON.
| Parameter | Type | Default |
|---|---|---|
data |
Dict[str, Any] |
Returns Chart
sdk/python/svm/charts.py:147digest_of
Section titled “digest_of”def digest_of(path: str, size: int) -> 'hashlib._Hash'| Parameter | Type | Default |
|---|---|---|
path |
str |
|
size |
int |
Returns 'hashlib._Hash'
sdk/python/svm/transfer.py:108def emit(value: Any, as_json: bool) -> None| Parameter | Type | Default |
|---|---|---|
value |
Any |
|
as_json |
bool |
sdk/python/svm/cli_common.py:28emit_page
Section titled “emit_page”def emit_page(response: dict[str, Any], as_json: bool, columns: tuple[str, ...]) -> NoneA list response: JSON as the API sent it, else one tab-separated row per item and the next page token.
| Parameter | Type | Default |
|---|---|---|
response |
dict[str, Any] |
|
as_json |
bool |
|
columns |
tuple[str, ...] |
sdk/python/svm/cli_common.py:42def envs(values: list[str]) -> dict[str, str]--env KEY=VALUE entries of a terminal session.
| Parameter | Type | Default |
|---|---|---|
values |
list[str] |
Returns dict[str, str]
sdk/python/svm/cli_common.py:63error_kind
Section titled “error_kind”def error_kind(error: BaseException) -> strThe language-neutral name the conformance suite uses for an error.
| Parameter | Type | Default |
|---|---|---|
error |
BaseException |
Returns str
sdk/python/svm/errors.py:295def find(start: Path) -> Path | None| Parameter | Type | Default |
|---|---|---|
start |
Path |
Returns Path \| None
sdk/python/svm/cli_config.py:50def fork(client: SandboxClient, args: argparse.Namespace) -> intsvm sandbox fork and svm snapshot fork: the children, never their access tokens.
| Parameter | Type | Default |
|---|---|---|
client |
SandboxClient |
|
args |
argparse.Namespace |
Returns int
sdk/python/svm/cli_storage.py:83fork_options
Section titled “fork_options”def fork_options(parser: argparse.ArgumentParser) -> argparse.ArgumentParser| Parameter | Type | Default |
|---|---|---|
parser |
argparse.ArgumentParser |
Returns argparse.ArgumentParser
sdk/python/svm/cli_storage.py:76def group(subparsers: argparse._SubParsersAction, name: str, dest: str='command', **kwargs: Any) -> argparse._SubParsersAction| Parameter | Type | Default |
|---|---|---|
subparsers |
argparse._SubParsersAction |
|
name |
str |
|
dest |
str |
'command' |
kwargs |
Any |
optional |
Returns argparse._SubParsersAction
sdk/python/svm/cli_common.py:19def info(domain: str, settings: Any, open_store: Callable[[], Any], *, request: Callable[..., dict[str, Any]]=request_json) -> dict[str, Any]Who the CLI acts as: the domain, which credential it 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. settings is the credential the SDKs would use (the environment, else the credentials file: _config.resolve), or None; the keyring is opened only then. 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 access token that it refuses (401 or 403) is reported with signed_in false, not as an error.
| Parameter | Type | Default |
|---|---|---|
domain |
str |
|
settings |
Any |
|
open_store |
Callable[[], Any] |
|
request |
Callable[..., dict[str, Any]] |
request_json |
Returns dict[str, Any]
sdk/python/svm/cli_auth.py:157is_transient
Section titled “is_transient”def is_transient(error: grpc.RpcError) -> boolWhether 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 |
grpc.RpcError |
Returns bool
Raises GuestUnresponsiveError
sdk/python/svm/resume.py:23def leaf(subparsers: argparse._SubParsersAction, name: str, **kwargs: Any) -> argparse.ArgumentParserA command parser that accepts --json.
| Parameter | Type | Default |
|---|---|---|
subparsers |
argparse._SubParsersAction |
|
name |
str |
|
kwargs |
Any |
optional |
Returns argparse.ArgumentParser
sdk/python/svm/cli_common.py:14def load(explicit: str | None, env: dict[str, str]) -> tuple[Path | None, dict[str, Any]]The project file named by --config or SVM_PROJECT_CONFIG, else the nearest svm.toml, parsed and checked. (SVM_CONFIG is the SDKs’ credentials file, never the project file.)
| Parameter | Type | Default |
|---|---|---|
explicit |
str | None |
|
env |
dict[str, str] |
Returns tuple[Path \| None, dict[str, Any]]
sdk/python/svm/cli_config.py:58def login(domain: str, store: Any, *, request: Callable[..., dict[str, Any]]=request_json, sleep: Callable[[float], None]=time.sleep, clock: Callable[[], float]=time.monotonic, open_browser: Callable[[str], bool]=webbrowser.open, write: Callable[[str], None]=print) -> dict[str, Any]| Parameter | Type | Default |
|---|---|---|
domain |
str |
|
store |
Any |
|
request |
Callable[..., dict[str, Any]] |
request_json |
sleep |
Callable[[float], None] |
time.sleep |
clock |
Callable[[], float] |
time.monotonic |
open_browser |
Callable[[str], bool] |
webbrowser.open |
write |
Callable[[str], None] |
print |
Returns dict[str, Any]
sdk/python/svm/cli_auth.py:101logout
Section titled “logout”def logout(domain: str, store: Any, *, request: Callable[..., dict[str, Any]]=request_json) -> None| Parameter | Type | Default |
|---|---|---|
domain |
str |
|
store |
Any |
|
request |
Callable[..., dict[str, Any]] |
request_json |
sdk/python/svm/cli_auth.py:249def main(argv: list[str] | None=None, env: dict[str, str] | None=None) -> int| Parameter | Type | Default |
|---|---|---|
argv |
list[str] | None |
None |
env |
dict[str, str] | None |
None |
Returns int
sdk/python/svm/cli.py:434def main()sdk/python/svm/lsp_driver.py:43message_stream
Section titled “message_stream”def message_stream(path: str, mode: int, owner: str, group: str, source: 'bytes | BinaryIO', totals: dict, *, user: str='', metadata: 'dict[str, str] | None'=None, gzip: bool=False) -> IteratorThe WriteFile messages for source, counting what was sent (the file’s own bytes, whether or not they travel gzipped).
| Parameter | Type | Default |
|---|---|---|
path |
str |
|
mode |
int |
|
owner |
str |
|
group |
str |
|
source |
'bytes | BinaryIO' |
|
totals |
dict |
|
user |
str |
'' |
metadata |
'dict[str, str] | None' |
None |
gzip |
bool |
False |
Returns Iterator
sdk/python/svm/transfer.py:121metadata
Section titled “metadata”def metadata(values: list[str]) -> dict[str, str]| Parameter | Type | Default |
|---|---|---|
values |
list[str] |
Returns dict[str, str]
sdk/python/svm/cli_common.py:53normalize
Section titled “normalize”def normalize(tool: str, args: dict[str, Any]) -> dict[str, Any]Drop unset arguments and spell paths one way, so ./src/a.py and src/a.py share a key.
| Parameter | Type | Default |
|---|---|---|
tool |
str |
|
args |
dict[str, Any] |
Returns dict[str, Any]
sdk/python/svm/tool_cache.py:49open_tunnel
Section titled “open_tunnel”def open_tunnel(handle: AccessHandle, sandbox_id: str, port: int, *, timeout: float=10.0) -> Tunnel| Parameter | Type | Default |
|---|---|---|
handle |
AccessHandle |
|
sandbox_id |
str |
|
port |
int |
|
timeout |
float |
10.0 |
Returns Tunnel
Raises ApiError, TransportError
sdk/python/svm/tunnel.py:82paging
Section titled “paging”def paging(parser: argparse.ArgumentParser, size: int=50) -> None| Parameter | Type | Default |
|---|---|---|
parser |
argparse.ArgumentParser |
|
size |
int |
50 |
sdk/python/svm/cli_common.py:23parse_events
Section titled “parse_events”def parse_events(lines: Iterator[bytes]) -> Iterator[tuple[str | None, dict[str, Any]]](id, event) for every data: message of a server-sent event stream; comments and heartbeats are skipped.
| Parameter | Type | Default |
|---|---|---|
lines |
Iterator[bytes] |
Returns Iterator[tuple[str \| None, dict[str, Any]]]
sdk/python/svm/event_stream.py:23parse_log
Section titled “parse_log”def parse_log(text: str) -> list[GitCommit]| Parameter | Type | Default |
|---|---|---|
text |
str |
Returns list[GitCommit]
sdk/python/svm/git_types.py:99parse_result
Section titled “parse_result”def parse_result(result: dict[str, Any], max_chars: int, read_file: Any=None) -> BrowserResult| Parameter | Type | Default |
|---|---|---|
result |
dict[str, Any] |
|
max_chars |
int |
|
read_file |
Any |
None |
Returns BrowserResult
Raises BrowserError
sdk/python/svm/browser.py:108parse_status
Section titled “parse_status”def parse_status(text: str) -> GitStatusgit status --porcelain=v1 --branch -z output.
| Parameter | Type | Default |
|---|---|---|
text |
str |
Returns GitStatus
sdk/python/svm/git_types.py:61process_error
Section titled “process_error”def process_error(code: str, message: str, status: grpc.StatusCode, reason: str | None=None) -> ProcessErrorThe ProcessError for a data-plane failure, also an instance of the REST error class of its gRPC status (and of the specific class its envd code names, e.g. SandboxFileNotFoundError, or its reason: FILE_UPLOAD_FAILED is a FileUploadError, GUEST_UNRESPONSIVE a GuestUnresponsiveError).
| Parameter | Type | Default |
|---|---|---|
code |
str |
|
message |
str |
|
status |
grpc.StatusCode |
|
reason |
str | None |
None |
Returns ProcessError
Raises FileUploadError, GuestUnresponsiveError, ProcessError, SandboxFileNotFoundError
sdk/python/svm/process.py:83qualify_image
Section titled “qualify_image”def qualify_image(reference: str) -> strThe full name of an image reference, as the build service reads it: a Docker Hub short name gains its registry (python:3.12-slim -> docker.io/library/python:3.12-slim, acme/app:1 -> docker.io/acme/app:1); a reference whose first part is a host (it has a dot or a port, or is localhost) and a local/ image stay as they are.
| Parameter | Type | Default |
|---|---|---|
reference |
str |
Returns str
sdk/python/svm/dockerfile.py:62read_api_key
Section titled “read_api_key”def read_api_key(from_stdin: bool, env: dict[str, str], stdin: Any=None, prompt: Callable[[str], str]=getpass.getpass) -> strThe key to save: the first line of standard input with --api-key-stdin, else SVM_API_KEY, else a prompt that does not echo (a terminal is needed). The key is never an argument, so it is not in the process list or the shell history.
| Parameter | Type | Default |
|---|---|---|
from_stdin |
bool |
|
env |
dict[str, str] |
|
stdin |
Any |
None |
prompt |
Callable[[str], str] |
getpass.getpass |
Returns str
sdk/python/svm/cli_auth.py:192read_ranges
Section titled “read_ranges”def read_ranges(open_read: Callable[[int, int], Iterator], offset: int, limit: int, policy: RetryPolicy, still_same: Callable[[], bool] | None=None, on_auth: Callable[[grpc.RpcError], bool] | None=None) -> Iterator[bytes]The bytes of a file from offset (up to limit, 0 meaning to the end), resuming where a break left off.
open_read(offset, limit) opens one ranged read; still_same() is asked before each resume and raises when the file changed, because bytes from two versions must not be joined.
| Parameter | Type | Default |
|---|---|---|
open_read |
Callable[[int, int], Iterator] |
|
offset |
int |
|
limit |
int |
|
policy |
RetryPolicy |
|
still_same |
Callable[[], bool] | None |
None |
on_auth |
Callable[[grpc.RpcError], bool] | None |
None |
Returns Iterator[bytes]
Raises TransferError
sdk/python/svm/transfer.py:56reader
Section titled “reader”def reader(stream, out)| Parameter | Type | Default |
|---|---|---|
stream |
||
out |
sdk/python/svm/lsp_driver.py:26refresh_access_token
Section titled “refresh_access_token”def refresh_access_token(domain: str, store: Any, *, request: Callable[..., dict[str, Any]]=request_json) -> str| Parameter | Type | Default |
|---|---|---|
domain |
str |
|
store |
Any |
|
request |
Callable[..., dict[str, Any]] |
request_json |
Returns str
sdk/python/svm/cli_auth.py:141registry_of
Section titled “registry_of”def registry_of(image: str) -> strThe registry host of an image reference (Docker Hub when the first component is not a host).
| Parameter | Type | Default |
|---|---|---|
image |
str |
Returns str
sdk/python/svm/template_helpers.py:92release_data_plane
Section titled “release_data_plane”def release_data_plane(sandbox: object) -> NoneClose a sandbox handle’s data-plane channels (commands, files, metrics, ports) before the CLI exits. A gRPC channel left to the garbage collector at interpreter shutdown can deadlock in its __del__, so a command that printed its result could hang instead of exiting (F130).
| Parameter | Type | Default |
|---|---|---|
sandbox |
object |
sdk/python/svm/cli_common.py:99request_json
Section titled “request_json”def request_json(domain: str, method: str, path: str, *, body: dict[str, Any] | None=None, bearer_token: str | None=None, api_key: str | None=None, timeout: float=10.0) -> dict[str, Any]| Parameter | Type | Default |
|---|---|---|
domain |
str |
|
method |
str |
|
path |
str |
|
body |
dict[str, Any] | None |
None |
bearer_token |
str | None |
None |
api_key |
str | None |
None |
timeout |
float |
10.0 |
Returns dict[str, Any]
Raises ApiError
sdk/python/svm/cli_auth.py:63rewrite_data_plane_url
Section titled “rewrite_data_plane_url”def rewrite_data_plane_url(url: str, template: str | None=None) -> strThe data-plane URL to dial: url as the API gave it, or rewritten by SVM_DATA_PLANE_URL_TEMPLATE.
The template is an HTTP(S) URL in which {host} stands for the host the API gave (the edge routes on it, so keep it); the API’s path, if any, is kept. https://{host}:8443 reaches a data plane that is only on another machine’s loopback through ssh -L 8443:127.0.0.1:443 <that machine>. The data-plane token goes wherever the template points, so set it only to an address you control, as with SVM_DOMAIN.
| Parameter | Type | Default |
|---|---|---|
url |
str |
|
template |
str | None |
None |
Returns str
sdk/python/svm/sandbox_types.py:15def run(args: argparse.Namespace, path: Path | None, data: dict[str, Any]) -> int| Parameter | Type | Default |
|---|---|---|
args |
argparse.Namespace |
|
path |
Path | None |
|
data |
dict[str, Any] |
Returns int
sdk/python/svm/cli_config.py:125def run(client: SandboxClient, args: argparse.Namespace) -> int| Parameter | Type | Default |
|---|---|---|
client |
SandboxClient |
|
args |
argparse.Namespace |
Returns int
sdk/python/svm/cli_files.py:82def run(client: SandboxClient, args: argparse.Namespace) -> int| Parameter | Type | Default |
|---|---|---|
client |
SandboxClient |
|
args |
argparse.Namespace |
Returns int
sdk/python/svm/cli_network.py:67def run(client: SandboxClient, args: argparse.Namespace, env: dict[str, str]) -> int| Parameter | Type | Default |
|---|---|---|
client |
SandboxClient |
|
args |
argparse.Namespace |
|
env |
dict[str, str] |
Returns int
sdk/python/svm/cli_storage.py:100def run(client: SandboxClient, args: argparse.Namespace) -> int| Parameter | Type | Default |
|---|---|---|
client |
SandboxClient |
|
args |
argparse.Namespace |
Returns int
sdk/python/svm/cli_team.py:23def run(client: SandboxClient | None, args: argparse.Namespace) -> int| Parameter | Type | Default |
|---|---|---|
client |
SandboxClient | None |
|
args |
argparse.Namespace |
Returns int
sdk/python/svm/cli_templates.py:51run_script
Section titled “run_script”def run_script(name: str, command: str) -> strRestore the session, run command in this shell, and save cwd and exports on the way out, even after exit.
| Parameter | Type | Default |
|---|---|---|
name |
str |
|
command |
str |
Returns str
sdk/python/svm/sessions.py:37script
Section titled “script”def script(repo: str | None, *args: str) -> strThe shell line for git args in repo: quoted, non-interactive.
| Parameter | Type | Default |
|---|---|---|
repo |
str | None |
|
args |
str |
optional |
Returns str
sdk/python/svm/git.py:74send_whole
Section titled “send_whole”def send_whole(send: Callable[[Iterator], object], make_messages: Callable[[dict], Iterator], rewind: Callable[[], bool], policy: RetryPolicy, on_auth: Callable[[grpc.RpcError], bool] | None=None) -> tuple[object, dict]Send an upload, again from the start after a broken connection while the source can be rewound.
| Parameter | Type | Default |
|---|---|---|
send |
Callable[[Iterator], object] |
|
make_messages |
Callable[[dict], Iterator] |
|
rewind |
Callable[[], bool] |
|
policy |
RetryPolicy |
|
on_auth |
Callable[[grpc.RpcError], bool] | None |
None |
Returns tuple[object, dict]
Raises FileUploadError
sdk/python/svm/transfer.py:179sink_for
Section titled “sink_for”def sink_for(dest: 'str | os.PathLike[str] | BinaryIO', resume: bool)A writable file object for dest, the bytes it already holds, and how to finish it.
| Parameter | Type | Default |
|---|---|---|
dest |
'str | os.PathLike[str] | BinaryIO' |
|
resume |
bool |
sdk/python/svm/transfer.py:87terminal_options
Section titled “terminal_options”def terminal_options(parser: argparse.ArgumentParser) -> argparse.ArgumentParserThe options of the interactive guest shell: who it runs as, where, and with which environment.
| Parameter | Type | Default |
|---|---|---|
parser |
argparse.ArgumentParser |
Returns argparse.ArgumentParser
sdk/python/svm/cli_common.py:74translate_dockerfile
Section titled “translate_dockerfile”def translate(text: str, *, name: str, ready: list[str] | None=None) -> tuple[dict, list[str]]Return (definition, notes). ready is required unless there is a HEALTHCHECK.
| Parameter | Type | Default |
|---|---|---|
text |
str |
|
name |
str |
|
ready |
list[str] | None |
None |
Returns tuple[dict, list[str]]
Raises DockerfileError, SandboxError
sdk/python/svm/dockerfile.py:109verify_webhook_signature
Section titled “verify_webhook_signature”def verify_webhook_signature(secret: str | Sequence[str], body: bytes, header: str, *, tolerance_seconds: int=300, now: float | None=None) -> NoneRaise WebhookSignatureError unless header (the X-Webhook-Signature value) is a valid signature of body.
secret is the hex string the platform returned when the webhook was created; its bytes are the HMAC key. During a secret rotation pass a list of secrets (the new one and the old one): a signature by any of them verifies. Pass the body exactly as received, not re-encoded. A timestamp further than tolerance_seconds from now is refused, which is what stops a captured request from being replayed later.
| Parameter | Type | Default |
|---|---|---|
secret |
str | Sequence[str] |
|
body |
bytes |
|
header |
str |
|
tolerance_seconds |
int |
300 |
now |
float | None |
None |
Raises WebhookSignatureError
sdk/python/svm/webhook_signature.py:21volume_mounts
Section titled “volume_mounts”def volume_mounts(values)--volume ID:/path[:ro] entries as the create request’s volume_mounts.
| Parameter | Type | Default |
|---|---|---|
values |
sdk/python/svm/cli_common.py:87wait_for_file
Section titled “wait_for_file”def wait_for_file(path: str) -> strA ready command that passes once path exists.
| Parameter | Type | Default |
|---|---|---|
path |
str |
Returns str
sdk/python/svm/template_helpers.py:80wait_for_port
Section titled “wait_for_port”def wait_for_port(port: int) -> strA ready command that passes once something listens on TCP port (it reads /proc/net/tcp, so the image needs no tools).
| Parameter | Type | Default |
|---|---|---|
port |
int |
Returns str
sdk/python/svm/template_helpers.py:56wait_for_process
Section titled “wait_for_process”def wait_for_process(name: str) -> strA ready command that passes once a process named name runs (its /proc comm, at most 15 characters).
| Parameter | Type | Default |
|---|---|---|
name |
str |
Returns str
sdk/python/svm/template_helpers.py:73wait_for_timeout
Section titled “wait_for_timeout”def wait_for_timeout(ms: int) -> strA ready command that passes after ms milliseconds (rounded up to whole seconds).
| Parameter | Type | Default |
|---|---|---|
ms |
int |
Returns str
sdk/python/svm/template_helpers.py:85wait_for_url
Section titled “wait_for_url”def wait_for_url(url: str, status: int=200) -> strA ready command that passes once url answers with HTTP status (the image needs curl).
| Parameter | Type | Default |
|---|---|---|
url |
str |
|
status |
int |
200 |
Returns str
sdk/python/svm/template_helpers.py:63watch_events
Section titled “watch_events”def watch_events(call: Callable[[str, object], object], path: str, recursive: bool, policy: RetryPolicy, sleep: Callable[[float], None]=time.sleep, stop=None, user: str='') -> IteratorEvents of a directory through a polled watcher: the sandbox queues them, so a break loses none. stop (an event) ends the loop, so a consumer that went away does not leave a thread polling.
| Parameter | Type | Default |
|---|---|---|
call |
Callable[[str, object], object] |
|
path |
str |
|
recursive |
bool |
|
policy |
RetryPolicy |
|
sleep |
Callable[[float], None] |
time.sleep |
stop |
None |
|
user |
str |
'' |
Returns Iterator
Raises WatchLostError
sdk/python/svm/transfer.py:200without_access
Section titled “without_access”def without_access(item: dict[str, Any]) -> dict[str, Any]A sandbox as the API returned it, minus the guest and traffic tokens, which the CLI never prints.
| Parameter | Type | Default |
|---|---|---|
item |
dict[str, Any] |
Returns dict[str, Any]
sdk/python/svm/cli_common.py:82wrap_async
Section titled “wrap_async”def wrap_async(name: str)| Parameter | Type | Default |
|---|---|---|
name |
str |
sdk/python/svm/desktop_extras.py:145x11_key
Section titled “x11_key”def x11_key(key: str) -> strkey with common names (enter, esc, cmd+a, F5 …) turned into X11 keysyms, part by part; other parts are kept.
| Parameter | Type | Default |
|---|---|---|
key |
str |
Returns str
sdk/python/svm/desktop.py:46defaultBuildLogger
Section titled “defaultBuildLogger”function defaultBuildLogger(write: (text: string) => void = (text) => { process.stderr.write(text); }): (entry: BuildLogLine) => voidAn onLog for build/followLogs that writes each line as <timestamp> [<stream>] <text> to write (standard error by default).
| Parameter | Type | Default |
|---|---|---|
write |
(text: string) => void |
(text) => { process.stderr.write(text); } |
Returns (entry: BuildLogLine) => void
sdk/typescript/src/template.ts:56deserializeChart
Section titled “deserializeChart”function deserializeChart(data: unknown): ChartTypes | ChartThe typed chart for the kernel’s chart JSON; throws a TypeError when it is not a chart object.
| Parameter | Type | Default |
|---|---|---|
data |
unknown |
Returns ChartTypes \| Chart
sdk/typescript/src/charts.ts:67errorKind
Section titled “errorKind”function errorKind(error: unknown): stringThe language-neutral name the conformance suite uses for an error.
| Parameter | Type | Default |
|---|---|---|
error |
unknown |
Returns string
sdk/typescript/src/errors.ts:289gitScript
Section titled “gitScript”function gitScript(repo: string | undefined, ...args: string[]): stringThe shell line for git args in repo: quoted, non-interactive.
| Parameter | Type | Default |
|---|---|---|
repo |
string | undefined |
|
args |
string[] |
optional |
Returns string
sdk/typescript/src/git-client.ts:67normalize
Section titled “normalize”function normalize(tool: string, args: Record<string, unknown>): Record<string, unknown>Drop unset arguments and spell paths one way, so ./src/a.ts and src/a.ts share a key.
| Parameter | Type | Default |
|---|---|---|
tool |
string |
|
args |
Record<string, unknown> |
Returns Record<string, unknown>
sdk/typescript/src/tool-cache.ts:92parseGitLog
Section titled “parseGitLog”function parseGitLog(text: string): GitCommit[]| Parameter | Type | Default |
|---|---|---|
text |
string |
Returns GitCommit[]
sdk/typescript/src/git-client.ts:104parseGitStatus
Section titled “parseGitStatus”function parseGitStatus(text: string): GitStatusgit status --porcelain=v1 --branch -z output.
| Parameter | Type | Default |
|---|---|---|
text |
string |
Returns GitStatus
sdk/typescript/src/git-client.ts:73verifyWebhookSignature
Section titled “verifyWebhookSignature”async function verifyWebhookSignature(secret: string | readonly string[], body: string | Uint8Array, header: string, options: VerifyOptions = {}): Promise<void>Reject unless header (the X-Webhook-Signature value) is a valid signature of body.
secret is the hex string the platform returned when the webhook was created (its bytes are the HMAC-SHA-256 key), or a list of them while a secret is being rotated: the signature verifies when it matches any one. Pass the body exactly as received. A timestamp further than toleranceSeconds from now is refused, which is what stops a captured request being replayed. The comparison is the Web Crypto verify, which is constant-time.
| Parameter | Type | Default |
|---|---|---|
secret |
string | readonly string[] |
|
body |
string | Uint8Array |
|
header |
string |
|
options |
VerifyOptions |
{} |
Raises WebhookSignatureError
sdk/typescript/src/webhook-signature.ts:28waitForFile
Section titled “waitForFile”waitForFile = (path: string): stringA ready command that passes once path exists.
| Parameter | Type | Default |
|---|---|---|
path |
string |
Returns string
sdk/typescript/src/template-helpers.ts:97waitForPort
Section titled “waitForPort”function waitForPort(port: number): stringA ready command that passes once something listens on TCP port (it reads /proc/net/tcp, so the image needs no tools).
| Parameter | Type | Default |
|---|---|---|
port |
number |
Returns string
sdk/typescript/src/template-helpers.ts:74waitForProcess
Section titled “waitForProcess”function waitForProcess(name: string): stringA ready command that passes once a process named name runs (its /proc comm, at most 15 characters).
| Parameter | Type | Default |
|---|---|---|
name |
string |
Returns string
sdk/typescript/src/template-helpers.ts:90waitForTimeout
Section titled “waitForTimeout”function waitForTimeout(ms: number): stringA ready command that passes after ms milliseconds (rounded up to whole seconds).
| Parameter | Type | Default |
|---|---|---|
ms |
number |
Returns string
sdk/typescript/src/template-helpers.ts:124waitForUrl
Section titled “waitForUrl”function waitForUrl(url: string, status = 200): stringA ready command that passes once url answers with HTTP status (the image needs curl).
| Parameter | Type | Default |
|---|---|---|
url |
string |
|
status |
number |
200 |
Returns string
sdk/typescript/src/template-helpers.ts:81AgentToolsVersion
Section titled “AgentToolsVersion”func AgentToolsVersion() stringAgentToolsVersion names the uploaded tools; the same text in every SDK.
Returns string
sdk/go/agent_tools.go:68AsUser
Section titled “AsUser”func AsUser(user string) FileOptionAsUser runs the call as the named guest account, with that account’s file permissions, instead of the sandbox’s default user. The name is 1..256 characters without whitespace or NUL; “” keeps the default.
| Parameter | Type | Default |
|---|---|---|
user |
string |
Returns FileOption
sdk/go/files.go:49func Bool(b bool) *boolBool returns a pointer to b, for LifecycleTimers.AutoResume.
| Parameter | Type | Default |
|---|---|---|
b |
bool |
Returns *bool
sdk/go/sandbox.go:132BuildContextArchive
Section titled “BuildContextArchive”func BuildContextArchive(files map[string][]byte) ([]byte, error)BuildContextArchive is the build context a template’s copied files travel in: the same bytes Python’s Template sends (a USTAR tar written by Python’s tarfile, one regular file per source in name order, mode 0644, owner 0:0 with empty names, mtime 0, padded to a 10 KiB record), so the files_hash of a build does not depend on which SDK started it.
| Parameter | Type | Default |
|---|---|---|
files |
map[string][]byte |
Returns ([]byte, error)
sdk/go/build_context.go:14DefaultBuildLogger
Section titled “DefaultBuildLogger”func DefaultBuildLogger(w io.Writer) func(BuildLogLine)DefaultBuildLogger is an OnLog (BuildOptions, FollowLogs) that writes each line as “<timestamp> [<stream>] <text>” to w (standard error when nil).
| Parameter | Type | Default |
|---|---|---|
w |
io.Writer |
Returns func(BuildLogLine)
sdk/go/template.go:385ErrorKind
Section titled “ErrorKind”func ErrorKind(err error) stringErrorKind is the language-neutral name of an error, as the conformance suite uses it.
| Parameter | Type | Default |
|---|---|---|
err |
error |
Returns string
sdk/go/retry.go:345GitScript
Section titled “GitScript”func GitScript(repo string, args ...string) stringGitScript is the shell line for git args in repo (empty for none): quoted, non-interactive.
| Parameter | Type | Default |
|---|---|---|
repo |
string |
|
args |
...string |
optional |
Returns string
sdk/go/git_client.go:40KeepAll
Section titled “KeepAll”func KeepAll() *RolloutKeepKeepAll keeps every branch whose command ran; KeepNone keeps none.
Returns *RolloutKeep
sdk/go/rollouts.go:75KeepNone
Section titled “KeepNone”func KeepNone() *RolloutKeepReturns *RolloutKeep
sdk/go/rollouts.go:76KeepPassed
Section titled “KeepPassed”func KeepPassed(minReward float64) *RolloutKeepKeepPassed keeps branches whose reward is at least minReward (the default policy, with 1).
| Parameter | Type | Default |
|---|---|---|
minReward |
float64 |
Returns *RolloutKeep
sdk/go/rollouts.go:67KeepTopK
Section titled “KeepTopK”func KeepTopK(k int) *RolloutKeepKeepTopK keeps the k best rewards (ties go to the lower index).
| Parameter | Type | Default |
|---|---|---|
k |
int |
Returns *RolloutKeep
sdk/go/rollouts.go:72NewAgentTools
Section titled “NewAgentTools”func NewAgentTools(box GuestSandbox, cwd string, cache *ToolCache) *AgentToolsNewAgentTools wraps anything that runs commands and writes files in a sandbox; cwd is where relative paths start and cache may be nil.
| Parameter | Type | Default |
|---|---|---|
box |
GuestSandbox |
|
cwd |
string |
|
cache |
*ToolCache |
Returns *AgentTools
sdk/go/agent_tools.go:92NewBrowser
Section titled “NewBrowser”func NewBrowser(box GuestSandbox, o BrowserOptions) *BrowserNewBrowser makes a Browser over any GuestSandbox.
| Parameter | Type | Default |
|---|---|---|
box |
GuestSandbox |
|
o |
BrowserOptions |
Returns *Browser
sdk/go/guest_browser.go:105NewClient
Section titled “NewClient”func NewClient(options ClientOptions) (*Client, error)NewClient finds the domain and credential from the options, then SVM_DOMAIN, SVM_API_KEY and SVM_ACCESS_TOKEN, then the config file (see config.go).
| Parameter | Type | Default |
|---|---|---|
options |
ClientOptions |
Returns (*Client, error)
sdk/go/client.go:122NewDesktop
Section titled “NewDesktop”func NewDesktop(host DesktopHost) *DesktopNewDesktop wraps a host.
| Parameter | Type | Default |
|---|---|---|
host |
DesktopHost |
Returns *Desktop
sdk/go/desktop.go:57NewGit
Section titled “NewGit”func NewGit(runner GitRunner) *GitNewGit wraps anything that runs commands in a sandbox.
| Parameter | Type | Default |
|---|---|---|
runner |
GitRunner |
Returns *Git
sdk/go/git_client.go:32NewToolCache
Section titled “NewToolCache”func NewToolCache(o ToolCacheOptions) *ToolCacheNewToolCache returns an empty cache.
| Parameter | Type | Default |
|---|---|---|
o |
ToolCacheOptions |
Returns *ToolCache
sdk/go/tool_cache.go:77NewWindowsDesktop
Section titled “NewWindowsDesktop”func NewWindowsDesktop(host DesktopHost) *WindowsDesktopNewWindowsDesktop wraps a host.
| Parameter | Type | Default |
|---|---|---|
host |
DesktopHost |
Returns *WindowsDesktop
sdk/go/desktop_win.go:27Normalize
Section titled “Normalize”func Normalize(tool string, args map[string]any) map[string]anyNormalize is the tool-call arguments as a cache key sees them (Python’s tool_cache.normalize): unset arguments dropped and paths spelled one way, so ./src/a.py and src/a.py share a key.
| Parameter | Type | Default |
|---|---|---|
tool |
string |
|
args |
map[string]any |
Returns map[string]any
sdk/go/tool_cache.go:118ParseChart
Section titled “ParseChart”func ParseChart(data []byte) (Chart, error)ParseChart builds the typed chart for the kernel’s chart JSON; an error when it is not a chart object.
| Parameter | Type | Default |
|---|---|---|
data |
[]byte |
Returns (Chart, error)
sdk/go/charts.go:189ParseGitLog
Section titled “ParseGitLog”func ParseGitLog(text string) []GitCommitParseGitLog parses log output in the client’s format.
| Parameter | Type | Default |
|---|---|---|
text |
string |
Returns []GitCommit
sdk/go/git_status.go:116ParseGitStatus
Section titled “ParseGitStatus”func ParseGitStatus(text string) GitStatusInfoParseGitStatus parses git status --porcelain=v1 --branch -z.
| Parameter | Type | Default |
|---|---|---|
text |
string |
Returns GitStatusInfo
sdk/go/git_status.go:71RegistryOf
Section titled “RegistryOf”func RegistryOf(image string) stringRegistryOf is the registry host of an image reference (Docker Hub when the first component is not a host).
| Parameter | Type | Default |
|---|---|---|
image |
string |
Returns string
sdk/go/template_helpers.go:122SafeContextPath
Section titled “SafeContextPath”func SafeContextPath(source string) boolSafeContextPath reports whether source may name a file in the build context: relative, with no empty, “.” or “..” part.
| Parameter | Type | Default |
|---|---|---|
source |
string |
Returns bool
sdk/go/build_context.go:87Seconds
Section titled “Seconds”func Seconds(n int) *intSeconds returns a pointer to n, for the timers of LifecycleTimers.
| Parameter | Type | Default |
|---|---|---|
n |
int |
Returns *int
sdk/go/sandbox.go:147SecretFill
Section titled “SecretFill”func SecretFill(name string) (string, error)SecretFill returns the placeholder for the secret name: put it in a sandbox’s environment or a request header, and the egress proxy replaces it with the secret’s current value in HTTPS requests to the hosts an egress rule with SecretInject allows. Nothing is sent to the API, and the value never reaches the sandbox.
| Parameter | Type | Default |
|---|---|---|
name |
string |
Returns (string, error)
sdk/go/secret_inject.go:50SecretIamToken
Section titled “SecretIamToken”func SecretIamToken(audience, tokenType string) (IamToken, error)SecretIamToken returns the identity token for audience (1 to 256 printable characters); tokenType “” means “jwt”.
| Parameter | Type | Default |
|---|---|---|
audience |
string |
|
tokenType |
string |
Returns (IamToken, error)
sdk/go/secret_inject.go:74SecretInject
Section titled “SecretInject”func SecretInject(name string, headers []string, placeholder string) (*EgressInject, error)SecretInject returns the inject object for an egress rule that allows the hosts a secret may go to: replace placeholder (empty means SecretFill(name)) in headers with the secret name. One injection per rule: only the first rule that matches a request injects, so a second inject rule for the same host is ignored and its placeholder reaches the server.
| Parameter | Type | Default |
|---|---|---|
name |
string |
|
headers |
[]string |
|
placeholder |
string |
Returns (*EgressInject, error)
sdk/go/secret_inject.go:60VerifyCommand
Section titled “VerifyCommand”func VerifyCommand(argv []string, timeoutSeconds ...int) *RolloutVerifierVerifyCommand runs argv after the command; the last line it prints is the reward. argv[0] must be an absolute path. It reads the command’s stdout on its stdin and its exit code in $SVM_EXIT_CODE. An optional timeoutSeconds bounds the verifier (the server’s default when omitted).
| Parameter | Type | Default |
|---|---|---|
argv |
[]string |
|
timeoutSeconds |
...int |
optional |
Returns *RolloutVerifier
sdk/go/rollouts.go:41VerifyExitCode
Section titled “VerifyExitCode”func VerifyExitCode() *RolloutVerifierVerifyExitCode rewards exit status 0 with 1, anything else with 0 (the default).
Returns *RolloutVerifier
sdk/go/rollouts.go:31VerifyOutputMatch
Section titled “VerifyOutputMatch”func VerifyOutputMatch(pattern string) *RolloutVerifierVerifyOutputMatch rewards 1 when the RE2 pattern matches the command’s stdout.
| Parameter | Type | Default |
|---|---|---|
pattern |
string |
Returns *RolloutVerifier
sdk/go/rollouts.go:34VerifyScript
Section titled “VerifyScript”func VerifyScript(body string, timeoutSeconds ...int) *RolloutVerifierVerifyScript runs body with /bin/sh after the command; the last line it prints is the reward. The script reads the command’s stdout on its stdin and in $SVM_STDOUT, and its exit code in $SVM_EXIT_CODE. An optional timeoutSeconds bounds the verifier (the server’s default when omitted).
| Parameter | Type | Default |
|---|---|---|
body |
string |
|
timeoutSeconds |
...int |
optional |
Returns *RolloutVerifier
sdk/go/rollouts.go:48VerifyWebhookSignature
Section titled “VerifyWebhookSignature”func VerifyWebhookSignature[S WebhookSecrets](secret S, body []byte, header string, options ...WebhookVerifyOptions) errorVerifyWebhookSignature checks that header (the X-Webhook-Signature value) is a valid signature of body under secret: the hex string the platform returned when the webhook was created, or a list of them during a rotation. Pass body exactly as received. A timestamp further than the tolerance (five minutes by default) from now is refused, which stops a captured request being replayed.
| Parameter | Type | Default |
|---|---|---|
secret |
S |
|
body |
[]byte |
|
header |
string |
|
options |
...WebhookVerifyOptions |
optional |
Returns error
sdk/go/webhook_signature.go:35WaitForFile
Section titled “WaitForFile”func WaitForFile(path string) (string, error)WaitForFile is a ready command that passes once path exists.
| Parameter | Type | Default |
|---|---|---|
path |
string |
Returns (string, error)
sdk/go/template_helpers.go:81WaitForPort
Section titled “WaitForPort”func WaitForPort(port int) (string, error)WaitForPort is a ready command (for SetReadyCmd) that passes once something listens on TCP port; it reads /proc/net/tcp, so the image needs no tools.
| Parameter | Type | Default |
|---|---|---|
port |
int |
Returns (string, error)
sdk/go/template_helpers.go:49WaitForProcess
Section titled “WaitForProcess”func WaitForProcess(name string) (string, error)WaitForProcess is a ready command that passes once a process named name runs (its /proc comm, at most 15 characters).
| Parameter | Type | Default |
|---|---|---|
name |
string |
Returns (string, error)
sdk/go/template_helpers.go:72WaitForTimeout
Section titled “WaitForTimeout”func WaitForTimeout(d time.Duration) (string, error)WaitForTimeout is a ready command that passes after d (rounded up to whole seconds).
| Parameter | Type | Default |
|---|---|---|
d |
time.Duration |
Returns (string, error)
sdk/go/template_helpers.go:90WaitForURL
Section titled “WaitForURL”func WaitForURL(rawURL string, status int) (string, error)WaitForURL is a ready command that passes once rawURL answers with HTTP status (200 when 0); the image needs curl.
| Parameter | Type | Default |
|---|---|---|
rawURL |
string |
|
status |
int |
Returns (string, error)
sdk/go/template_helpers.go:57WatchStream
Section titled “WatchStream”func WatchStream() WatchOptionWatchStream reads the events as a stream instead of polling a watcher: no delay, but a broken connection ends the watch.
Returns WatchOption
sdk/go/files.go:389WatchUser
Section titled “WatchUser”func WatchUser(user string) WatchOptionWatchUser watches the directory as the named guest account instead of the sandbox’s default user.
| Parameter | Type | Default |
|---|---|---|
user |
string |
Returns WatchOption
sdk/go/files.go:392WithGzip
Section titled “WithGzip”func WithGzip() FileOptionWithGzip sends the data of a write, or asks for the data of a read, gzip-compressed over the wire. The bytes the caller gives or gets are plain, and every size and checksum counts the plain bytes.
Returns FileOption
sdk/go/files.go:59WithMetadata
Section titled “WithMetadata”func WithMetadata(metadata map[string]string) FileOptionWithMetadata stores key-value pairs with a written file (at most 16; keys 1..64 characters, values at most 256, no NUL). A write replaces the file and its pairs.
| Parameter | Type | Default |
|---|---|---|
metadata |
map[string]string |
Returns FileOption
sdk/go/files.go:53data_plane_by_reason
Section titled “data_plane_by_reason”def self.data_plane_by_reason(reason)Reasons the server names in the details of the typed error: FILE_UPLOAD_FAILED is a FileUploadError, so a TransferError; GUEST_UNRESPONSIVE, a guest that took the call and stopped answering, is a GuestUnresponsiveError (an UnavailableError by its status). (A method, not a constant: FileUploadError and TransferError are defined in envd.rb, after this file.)
| Parameter | Type | Default |
|---|---|---|
reason |
Raises FileUploadError, GuestUnresponsiveError, TransferError, UnavailableError
sdk/ruby/lib/svm/errors.rb:189data_plane_classes
Section titled “data_plane_classes”def self.data_plane_classes(error)The REST classes a data-plane failure is also an instance of, most specific first; a reason the server names comes first.
| Parameter | Type | Default |
|---|---|---|
error |
sdk/ruby/lib/svm/errors.rb:198default_build_logger
Section titled “default_build_logger”def self.default_build_logger(io = $stderr)An on_log for Template#build and TemplateBuild#follow_logs that writes each line as “<timestamp> [<stream>] <text>” to io.
| Parameter | Type | Default |
|---|---|---|
io |
$stderr |
sdk/ruby/lib/svm/template.rb:418error_kind
Section titled “error_kind”def self.error_kind(error)The language-neutral name the conformance suite uses for an error; a data-plane failure has the kind of its REST counterpart.
| Parameter | Type | Default |
|---|---|---|
error |
sdk/ruby/lib/svm/errors.rb:216verify_webhook_signature
Section titled “verify_webhook_signature”def self.verify_webhook_signature(secret, body, header, tolerance_seconds: 300, now: nil)Raises WebhookSignatureError unless header (the X-Webhook-Signature value) is a valid signature of body under secret (the hex string the platform returned when the webhook was created; pass the body exactly as received). secret may be an Array of secrets during a rotation. A timestamp further than tolerance_seconds from now is refused, which stops a captured request being replayed. Returns true.
| Parameter | Type | Default |
|---|---|---|
secret |
||
body |
||
header |
||
tolerance_seconds |
300 |
|
now |
nil |
Raises WebhookSignatureError
sdk/ruby/lib/svm/webhook_signature.rb:11wait_for_file
Section titled “wait_for_file”def self.wait_for_file(path)A ready command that passes once path exists.
| Parameter | Type | Default |
|---|---|---|
path |
sdk/ruby/lib/svm/template_helpers.rb:88wait_for_port
Section titled “wait_for_port”def self.wait_for_port(port)A ready command (for Template#set_ready_cmd) that passes once something listens on TCP port; it reads /proc/net/tcp, so the image needs no tools.
| Parameter | Type | Default |
|---|---|---|
port |
sdk/ruby/lib/svm/template_helpers.rb:64wait_for_process
Section titled “wait_for_process”def self.wait_for_process(name)A ready command that passes once a process named name runs (its /proc comm, at most 15 characters).
| Parameter | Type | Default |
|---|---|---|
name |
sdk/ruby/lib/svm/template_helpers.rb:80wait_for_timeout
Section titled “wait_for_timeout”def self.wait_for_timeout(ms)A ready command that passes after ms milliseconds (rounded up to whole seconds).
| Parameter | Type | Default |
|---|---|---|
ms |
sdk/ruby/lib/svm/template_helpers.rb:93wait_for_url
Section titled “wait_for_url”def self.wait_for_url(url, status = 200)A ready command that passes once url answers with HTTP status (the image needs curl).
| Parameter | Type | Default |
|---|---|---|
url |
||
status |
200 |
sdk/ruby/lib/svm/template_helpers.rb:70The Java SDK has no package-level functions; everything hangs off a class.