Templates
Build sandbox templates from a base image, a Dockerfile or builder steps, and manage builds.
Every method shows the same operation in each SDK; pick a language once and every tab on the site follows it.
Template
Section titled “Template”Fluent builder. Files copied from the host are sent as a deterministic tar context; helpers are in :mod:svm.template_helpers.
Properties
Section titled “Properties”Python exposes these as methods; see below.
TypeScript exposes these as methods; see below.
Go exposes these as methods; see below.
| Property | Type | Description |
|---|---|---|
catalog_template |
||
files |
||
ready_cmd |
||
start_cmd |
| Property | Type | Description |
|---|---|---|
DEV_CONTAINER_UP |
String |
The file a dev container’s start command creates once devcontainer up has finished; the ready command waits for it. |
list()
Section titled “list()”def list(*, page_size: int | None=None, page_token: str | None=None, visibility: str | None=None, client: SandboxClient | None=None) -> 'SandboxPage[TemplateInfo]'One page of the templates the caller can use (GET /v2/templates) as TemplateInfo; pass its next_page_token as page_token for the next page (None on the last one). visibility narrows the list to "private" (the team’s own), "public", "system" (the platform catalog every team can launch) or "all" (the default).
| Parameter | Type | Default |
|---|---|---|
page_size |
int | None |
None |
page_token |
str | None |
None |
visibility |
str | None |
None |
client |
SandboxClient | None |
None |
Returns 'SandboxPage[TemplateInfo]'
sdk/python/svm/templates.py:203static async list(options: { pageSize?: number; pageToken?: string; visibility?: "private" | "public" | "system" | "all" } = {}, client: SandboxClient = new SandboxClient()): Promise<SandboxPage<TemplateInfo>>One page of the templates the caller can use (GET /v2/templates); pass its nextPageToken as pageToken for the next page. visibility narrows it to the team’s own ("private"), "public", the platform catalog ("system") or "all" (the default).
| Parameter | Type | Default |
|---|---|---|
options |
{ pageSize?: number; pageToken?: string; visibility?: "private" | "public" | "system" | "all" } |
{} |
client |
SandboxClient |
new SandboxClient() |
Returns Promise<SandboxPage<TemplateInfo>>
sdk/typescript/src/template.ts:225Not in the Go SDK’s Template.
def self.list(client: Client.new, page_size: nil, page_token: nil, visibility: nil)One page of the caller’s templates as TemplateInfo: <tt>{ items:, next_page_token: }</tt>, as Sandbox.list gives; pass next_page_token back as page_token for the next page (nil on the last).
| Parameter | Type | Default |
|---|---|---|
client |
Client.new |
|
page_size |
nil |
|
page_token |
nil |
|
visibility |
nil |
sdk/ruby/lib/svm/template.rb:19public static SandboxPage<TemplateInfo> list(Client client)public static SandboxPage<TemplateInfo> list(Client client, int pageSize, String pageToken)public static SandboxPage<TemplateInfo> list(Client client, int pageSize, String pageToken, String visibility)The first page of the caller’s templates; list(Client, int, String) reads the others.
| Parameter | Type | Default |
|---|---|---|
client |
Client |
|
pageSize |
int |
optional |
pageToken |
String |
optional |
visibility |
String |
optional |
Returns SandboxPage<TemplateInfo>
sdk/java/src/main/java/dev/svm/sandbox/Template.java:630add_mcp_server()
Section titled “add_mcp_server()”def add_mcp_server(self: Template, name: str, *, catalog_id: str | None=None, command: str | None=None, args: list[str] | None=None, env_secret_names: list[str] | None=None, secrets: dict[str, str] | None=None, env: dict[str, str] | None=None, tool_rules: dict[str, Any] | None=None) -> TemplateTemplateHelpersRun an MCP server behind the gateway in every sandbox of this template, as mcp_servers of Sandbox.create takes it (a sandbox’s own server of the same name replaces it): a catalog server (catalog_id) or a custom one (command, with args), exactly one. The list is sent with the build and becomes the template’s (not the image’s: it does not change the build cache, and every tag has it). A sandbox restored from a snapshot keeps the snapshot’s own servers.
| Parameter | Type | Default |
|---|---|---|
name |
str |
|
catalog_id |
str | None |
None |
command |
str | None |
None |
args |
list[str] | None |
None |
env_secret_names |
list[str] | None |
None |
secrets |
dict[str, str] | None |
None |
env |
dict[str, str] | None |
None |
tool_rules |
dict[str, Any] | None |
None |
Returns Template
sdk/python/svm/template_helpers.py:286addMcpServer(name: string, options: { catalogId?: string; command?: string; args?: string[]; envSecretNames?: string[]; secrets?: Record<string, string>; env?: Record<string, string>; toolRules?: Record<string, unknown> }): thisRun an MCP server behind the gateway in every sandbox of this template, as mcpServers of Sandbox.create takes it (a sandbox’s own server of the same name replaces it): a catalog server (catalogId) or a custom one (command, with args), exactly one. The list is sent with the build and becomes the template’s (not the image’s: it does not change the build cache, and every tag has it). A sandbox restored from a snapshot keeps the snapshot’s own servers.
| Parameter | Type | Default |
|---|---|---|
name |
string |
|
options |
{ catalogId?: string; command?: string; args?: string[]; envSecretNames?: string[]; secrets?: Record<string, string>; env?: Record<string, string>; toolRules?: Record<string, unknown> } |
Returns this
sdk/typescript/src/template.ts:364func (t *Template) AddMcpServer(name string, options McpServerOptions) (*Template, error)AddMcpServer runs an MCP server behind the gateway in every sandbox of this template, as CreateSandboxOptions.MCPServers takes it (a sandbox’s own server of the same name replaces it). The list is sent with the build and becomes the template’s, not the image’s: it does not change the build cache, and every tag has it. A sandbox restored from a snapshot keeps the snapshot’s own servers.
| Parameter | Type | Default |
|---|---|---|
name |
string |
|
options |
McpServerOptions |
Returns (*Template, error)
sdk/go/template_helpers.go:468def add_mcp_server(name, catalog_id: nil, command: nil, args: nil, env_secret_names: nil, secrets: nil, env: nil, tool_rules: nil)Runs an MCP server behind the gateway in every sandbox of this template, as mcp_servers of Sandbox.create takes it (a sandbox’s own server of the same name replaces it): a catalog server (catalog_id) or a custom one (command, with args), exactly one. The list is sent with the build and becomes the template’s, not the image’s: it does not change the build cache, and every tag has it. A sandbox restored from a snapshot keeps the snapshot’s own servers.
| Parameter | Type | Default |
|---|---|---|
name |
||
catalog_id |
nil |
|
command |
nil |
|
args |
nil |
|
env_secret_names |
nil |
|
secrets |
nil |
|
env |
nil |
|
tool_rules |
nil |
sdk/ruby/lib/svm/template_helpers.rb:261public Template addMcpServer(String name, McpServerOptions options)Runs an MCP server behind the gateway in every sandbox of this template, as mcpServers of Sandbox.CreateOptions takes it (a sandbox’s own server of the same name replaces it). The list is sent with the build and becomes the template’s, not the image’s: it does not change the build cache, and every tag has it. A sandbox restored from a snapshot keeps the snapshot’s own servers.
| Parameter | Type | Default |
|---|---|---|
name |
String |
|
options |
McpServerOptions |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:263apt_install()
Section titled “apt_install()”def apt_install(self: Template, packages: list[str]) -> TemplateTemplateHelpersInstall system packages with apt-get, or with apk, dnf or pacman on an Alpine, Fedora or Arch Linux base (the image’s package names).
| Parameter | Type | Default |
|---|---|---|
packages |
list[str] |
Returns Template
sdk/python/svm/template_helpers.py:157aptInstall(packages: string[]): thisInstall system packages with apt-get, or with apk, dnf or pacman on an Alpine, Fedora or Arch Linux base (the image’s package names).
| Parameter | Type | Default |
|---|---|---|
packages |
string[] |
Returns this
sdk/typescript/src/template.ts:314func (t *Template) AptInstall(packages ...string) (*Template, error)AptInstall installs system packages with apt-get (without recommends, clearing the package lists), or with apk, dnf or pacman on an Alpine, Fedora or Arch Linux base (the image’s package names).
| Parameter | Type | Default |
|---|---|---|
packages |
...string |
optional |
Returns (*Template, error)
sdk/go/template_helpers.go:226def apt_install(packages)Installs system packages with apt-get, or with apk, dnf or pacman on an Alpine, Fedora or Arch Linux base (the image’s package names).
| Parameter | Type | Default |
|---|---|---|
packages |
sdk/ruby/lib/svm/template_helpers.rb:135public Template aptInstall(List<String> packages)Installs system packages with apt-get, or with apk, dnf or pacman on an Alpine, Fedora or Arch Linux base (the image’s package names).
| Parameter | Type | Default |
|---|---|---|
packages |
List<String> |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:132archive()
Section titled “archive()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
def self.archive(files)The build context as Python’s tarfile writes it (USTAR, sorted names, mode 0644, mtime/uid/gid 0, no owner names or device numbers, padded to a 10240-byte record), byte for byte, so every SDK sends the same archive and the same files_hash for the same files.
| Parameter | Type | Default |
|---|---|---|
files |
sdk/ruby/lib/svm/template.rb:307Not in the Java SDK’s Template.
assign_tags()
Section titled “assign_tags()”def assign_tags(name_or_id: str, tags: 'list[str]', *, build_id: str | None=None, client: SandboxClient | None=None) -> 'list[str]'Point tags at build_id (the latest ready build when None); returns the template’s tags afterwards.
| Parameter | Type | Default |
|---|---|---|
name_or_id |
str |
|
tags |
'list[str]' |
|
build_id |
str | None |
None |
client |
SandboxClient | None |
None |
Returns 'list[str]'
sdk/python/svm/templates.py:231static async assignTags(nameOrId: string, tags: string[], options: { buildId?: string } = {}, client: SandboxClient = new SandboxClient()): Promise<string[]>Point tags at buildId (the latest ready build when omitted); resolves to the template’s tags afterwards.
| Parameter | Type | Default |
|---|---|---|
nameOrId |
string |
|
tags |
string[] |
|
options |
{ buildId?: string } |
{} |
client |
SandboxClient |
new SandboxClient() |
Returns Promise<string[]>
sdk/typescript/src/template.ts:254Not in the Go SDK’s Template.
def self.assign_tags(name_or_id, tags, build_id: nil, client: Client.new)Points tags at build_id (the latest ready build when nil); returns the template’s tags afterwards.
| Parameter | Type | Default |
|---|---|---|
name_or_id |
||
tags |
||
build_id |
nil |
|
client |
Client.new |
sdk/ruby/lib/svm/template.rb:44public static List<String> assignTags(Client client, String nameOrId, List<String> tags, String buildId)Points tags at buildId (the latest ready build when null); returns the template’s tags afterwards.
| Parameter | Type | Default |
|---|---|---|
client |
Client |
|
nameOrId |
String |
|
tags |
List<String> |
|
buildId |
String |
Returns List<String>
sdk/java/src/main/java/dev/svm/sandbox/Template.java:675base_image()
Section titled “base_image()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
base_imageProperty (read-only).
public String baseImage()Returns String
sdk/java/src/main/java/dev/svm/sandbox/Template.java:65build()
Section titled “build()”def build(self, *, on_log: Callable[[BuildLogLine], None] | None=None, wait: bool=False, timeout_seconds: float=2400, idempotency_key: str | None=None, tags: list[str] | None=None) -> TemplateBuildBuild; tags (up to 16) point at the build once it is ready. With wait (or on_log) it follows the build to its end and raises BuildError when the build failed (a canceled build is returned).
| Parameter | Type | Default |
|---|---|---|
on_log |
Callable[[BuildLogLine], None] | None |
None |
wait |
bool |
False |
timeout_seconds |
float |
2400 |
idempotency_key |
str | None |
None |
tags |
list[str] | None |
None |
Returns TemplateBuild
Raises BuildError
sdk/python/svm/templates.py:357async build(options: { wait?: boolean; onLog?: (line: BuildLogLine) => void; timeoutMs?: number; idempotencyKey?: string; tags?: string[] } = {}): Promise<TemplateBuild>Build; tags (up to 16) point at the build once it is ready.
| Parameter | Type | Default |
|---|---|---|
options |
{ wait?: boolean; onLog?: (line: BuildLogLine) => void; timeoutMs?: number; idempotencyKey?: string; tags?: string[] } |
{} |
Returns Promise<TemplateBuild>
Raises BuildError
sdk/typescript/src/template.ts:508func (t *Template) Build(ctx context.Context, options BuildOptions) (*TemplateBuild, error)Build creates the template, starts a build, uploads the copied files and (with Wait or OnLog) follows it to the end.
| Parameter | Type | Default |
|---|---|---|
ctx |
context.Context |
|
options |
BuildOptions |
Returns (*TemplateBuild, error)
sdk/go/template.go:467def build(wait: false, on_log: nil, timeout: 2400, idempotency_key: nil, tags: nil)Create the template, start a build, upload the copied files and (with wait or on_log) follow it to the end; raises BuildError when the build failed (a canceled build is returned). tags (up to 16, each 1 to 128 characters) point at the build once it is ready.
| Parameter | Type | Default |
|---|---|---|
wait |
false |
|
on_log |
nil |
|
timeout |
2400 |
|
idempotency_key |
nil |
|
tags |
nil |
Raises BuildError, SandboxError
sdk/ruby/lib/svm/template.rb:204public TemplateBuild build(boolean follow, Consumer<BuildLogLine> onLog)public TemplateBuild build(boolean follow, Consumer<BuildLogLine> onLog, List<String> tags, String idempotencyKey)build(boolean, Consumer, List, String) without tags and with a fresh idempotency key.
| Parameter | Type | Default |
|---|---|---|
follow |
boolean |
|
onLog |
Consumer<BuildLogLine> |
|
tags |
List<String> |
optional |
idempotencyKey |
String |
optional |
Returns TemplateBuild
Raises BuildException, SandboxException
sdk/java/src/main/java/dev/svm/sandbox/Template.java:543bun_install()
Section titled “bun_install()”def bun_install(self: Template, packages: list[str] | None=None, *, global_: bool=False, **kw: Any) -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
packages |
list[str] | None |
None |
global_ |
bool |
False |
kw |
Any |
optional |
Returns Template
sdk/python/svm/template_helpers.py:181bunInstall(packages: string[] = [], options: { global?: boolean } = {}): this| Parameter | Type | Default |
|---|---|---|
packages |
string[] |
[] |
options |
{ global?: boolean } |
{} |
Returns this
sdk/typescript/src/template.ts:317func (t *Template) BunInstall(global bool, packages ...string) (*Template, error)BunInstall adds packages with bun (or installs the project’s, when none are named).
| Parameter | Type | Default |
|---|---|---|
global |
bool |
|
packages |
...string |
optional |
Returns (*Template, error)
sdk/go/template_helpers.go:259def bun_install(packages = [], global: false)| Parameter | Type | Default |
|---|---|---|
packages |
[] |
|
global |
false |
sdk/ruby/lib/svm/template_helpers.rb:154public Template bunInstall(List<String> packages, boolean global)| Parameter | Type | Default |
|---|---|---|
packages |
List<String> |
|
global |
boolean |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:152constructor()
Section titled “constructor()”Not in the Python SDK’s Template.
constructor(private readonly client: SandboxClient, private readonly name: string, private readonly options: TemplateOptions = {})| Parameter | Type | Default |
|---|---|---|
client |
SandboxClient |
|
name |
string |
|
options |
TemplateOptions |
{} |
sdk/typescript/src/template.ts:209Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
Not in the Java SDK’s Template.
context_archive()
Section titled “context_archive()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public static byte[] contextArchive(SortedMap<String, byte[]> files)The build context exactly as Python’s tarfile writes it (USTAR, sorted names, mode 0644, uid, gid and mtime 0, empty owner names, long names split into the prefix field, two zero blocks and padding to a 10240-byte record), so the files_hash is the same in every SDK. build uploads it; the svm CLI’s template build uses this same method.
| Parameter | Type | Default |
|---|---|---|
files |
SortedMap<String, byte[]> |
Returns byte[]
sdk/java/src/main/java/dev/svm/sandbox/Template.java:705copy()
Section titled “copy()”def copy(self, source: str, destination: str, *, content: bytes | None=None) -> 'Template'Copy source (a relative path in the build context, read from disk unless content is given) to destination in the image. Copies come before any run step (the files are placed in the image before the steps run), so a copy after run_cmd or a helper that runs a command is refused here.
| Parameter | Type | Default |
|---|---|---|
source |
str |
|
destination |
str |
|
content |
bytes | None |
None |
Returns 'Template'
sdk/python/svm/templates.py:277copy(source: string, destination: string, content?: string | Uint8Array): thisPut a build-context file in the image. Copies come before every run step (the build places the files before the steps run), so a copy after runCmd or an install helper is refused here, not later by the build.
| Parameter | Type | Default |
|---|---|---|
source |
string |
|
destination |
string |
|
content |
string | Uint8Array |
optional |
Returns this
sdk/typescript/src/template.ts:426func (t *Template) Copy(source, destination string, content []byte) (*Template, error)Copy puts content (or, when nil, the local file source) at destination in the image. Copy steps must come before run steps: a Copy after a run step is refused here, as the build would refuse it.
| Parameter | Type | Default |
|---|---|---|
source |
string |
|
destination |
string |
|
content |
[]byte |
Returns (*Template, error)
sdk/go/template.go:105def copy(source, destination, content: nil)Puts a file into the image: source is a safe relative path in the build context (it names the file; content supplies the bytes, else the local file of that name is read). Copy steps must come before run steps: a copy after a run_cmd raises ArgumentError here rather than at #build.
| Parameter | Type | Default |
|---|---|---|
source |
||
destination |
||
content |
nil |
Raises ArgumentError
sdk/ruby/lib/svm/template.rb:107public Template copy(String source, String destination, byte[] content)public Template copy(String source, String destination, Path localFile)Put content at destination in the image. Copy steps must come before run steps (the files are placed in the image before the steps run), so a copy after a run step is refused here, not later by the build.
| Parameter | Type | Default |
|---|---|---|
source |
String |
|
destination |
String |
|
content |
byte[] |
Returns Template
Raises SandboxException
sdk/java/src/main/java/dev/svm/sandbox/Template.java:325copy_items()
Section titled “copy_items()”def copy_items(self: Template, items: list[dict[str, Any]]) -> TemplateTemplateHelperscopy for each item ({"src": ..., "dest": ..., "content": optional bytes or text}), all or none.
| Parameter | Type | Default |
|---|---|---|
items |
list[dict[str, Any]] |
Returns Template
sdk/python/svm/template_helpers.py:216copyItems(items: CopyItem[]): thiscopy for each item, all or none.
| Parameter | Type | Default |
|---|---|---|
items |
CopyItem[] |
Returns this
sdk/typescript/src/template.ts:322func (t *Template) CopyItems(items []CopyItem) (*Template, error)CopyItems is Copy for each item, all or none.
| Parameter | Type | Default |
|---|---|---|
items |
[]CopyItem |
Returns (*Template, error)
sdk/go/template_helpers.go:337def copy_items(items)#copy for each item (a Hash with src, dest and an optional content), all or none.
| Parameter | Type | Default |
|---|---|---|
items |
sdk/ruby/lib/svm/template_helpers.rb:189public Template copyItems(List<CopyItem> items)copy(String, String, byte[]) for each item, all or none.
| Parameter | Type | Default |
|---|---|---|
items |
List<CopyItem> |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:345cpu_count()
Section titled “cpu_count()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public Template cpuCount(int n)| Parameter | Type | Default |
|---|---|---|
n |
int |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:44default_build_logger()
Section titled “default_build_logger()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public static Consumer<BuildLogLine> defaultBuildLogger()public static Consumer<BuildLogLine> defaultBuildLogger(java.io.PrintStream out)defaultBuildLogger(PrintStream) to standard error.
| Parameter | Type | Default |
|---|---|---|
out |
java.io.PrintStream |
optional |
Returns Consumer<BuildLogLine>
sdk/java/src/main/java/dev/svm/sandbox/Template.java:409delete()
Section titled “delete()”def delete(template_id: str, *, client: SandboxClient | None=None) -> None| Parameter | Type | Default |
|---|---|---|
template_id |
str |
|
client |
SandboxClient | None |
None |
sdk/python/svm/templates.py:249static async delete(templateId: string, client: SandboxClient = new SandboxClient()): Promise<void>Delete the template with this id.
| Parameter | Type | Default |
|---|---|---|
templateId |
string |
|
client |
SandboxClient |
new SandboxClient() |
sdk/typescript/src/template.ts:269Not in the Go SDK’s Template.
def self.delete(template_id, client: Client.new)| Parameter | Type | Default |
|---|---|---|
template_id |
||
client |
Client.new |
sdk/ruby/lib/svm/template.rb:70public static void delete(Client client, String templateId)Deletes the template templateId.
| Parameter | Type | Default |
|---|---|---|
client |
Client |
|
templateId |
String |
sdk/java/src/main/java/dev/svm/sandbox/Template.java:698dev_container_prebuild()
Section titled “dev_container_prebuild()”def dev_container_prebuild(self: Template, devcontainer_dir: str) -> TemplateTemplateHelpersBuild the dev container in devcontainer_dir (an absolute path holding devcontainer.json, usually <project>/.devcontainer) into the image: one run step that installs the devcontainer CLI when the image has none (npm install -g @devcontainers/cli) and builds it using the parent project as --workspace-folder and devcontainer.json as --config. The image needs Node and Docker, as a dev container does; the step fails the build with the CLI’s own message when it cannot build.
| Parameter | Type | Default |
|---|---|---|
devcontainer_dir |
str |
Returns Template
sdk/python/svm/template_helpers.py:258devContainerPrebuild(devcontainerDir: string): thisBuild the dev container in devcontainerDir (an absolute path holding devcontainer.json, usually <project>/.devcontainer) into the image: one run step that installs the devcontainer CLI when the image has none (npm install -g @devcontainers/cli) and builds it with the parent project as --workspace-folder and devcontainer.json as --config. The image needs Node and Docker, as a dev container does.
| Parameter | Type | Default |
|---|---|---|
devcontainerDir |
string |
Returns this
sdk/typescript/src/template.ts:349func (t *Template) DevContainerPrebuild(devcontainerDir string) (*Template, error)DevContainerPrebuild builds the dev container in devcontainerDir (an absolute path holding devcontainer.json, usually <project>/.devcontainer) into the image: one run step that installs the devcontainer CLI when the image has none (npm install -g @devcontainers/cli) and builds it with the parent project as --workspace-folder and devcontainer.json as --config. The image needs Node and Docker, as a dev container does.
| Parameter | Type | Default |
|---|---|---|
devcontainerDir |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:407def dev_container_prebuild(devcontainer_dir)Builds the dev container in devcontainer_dir (an absolute path holding devcontainer.json, usually <project>/.devcontainer) into the image: one run step that installs the devcontainer CLI when the image has none (npm install -g @devcontainers/cli) and builds it with the parent project as –workspace-folder and devcontainer.json as –config. The image needs Node and Docker, as a dev container does.
| Parameter | Type | Default |
|---|---|---|
devcontainer_dir |
sdk/ruby/lib/svm/template_helpers.rb:234public Template devContainerPrebuild(String devcontainerDir)Builds the dev container in devcontainerDir (an absolute path holding devcontainer.json, usually <project>/.devcontainer) into the image: one run step that installs the devcontainer CLI when the image has none (npm install -g @devcontainers/cli) and builds it with the parent project as --workspace-folder and devcontainer.json as --config. The image needs Node and Docker, as a dev container does.
| Parameter | Type | Default |
|---|---|---|
devcontainerDir |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:219disk_mb()
Section titled “disk_mb()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public Template diskMb(int mb)| Parameter | Type | Default |
|---|---|---|
mb |
int |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:43exists()
Section titled “exists()”def exists(name_or_id: str, *, client: SandboxClient | None=None) -> boolWhether a template of this name or ID is visible to the caller.
| Parameter | Type | Default |
|---|---|---|
name_or_id |
str |
|
client |
SandboxClient | None |
None |
Returns bool
sdk/python/svm/templates.py:217static async exists(nameOrId: string, client: SandboxClient = new SandboxClient()): Promise<boolean>Whether a template of this name or id is visible to the caller.
| Parameter | Type | Default |
|---|---|---|
nameOrId |
string |
|
client |
SandboxClient |
new SandboxClient() |
Returns Promise<boolean>
sdk/typescript/src/template.ts:238Not in the Go SDK’s Template.
def self.exists(name_or_id, client: Client.new)Whether a template of this name or id is visible to the caller.
| Parameter | Type | Default |
|---|---|---|
name_or_id |
||
client |
Client.new |
sdk/ruby/lib/svm/template.rb:31public static boolean exists(Client client, String nameOrId)Whether a template of this name or id is visible to the caller.
| Parameter | Type | Default |
|---|---|---|
client |
Client |
|
nameOrId |
String |
Returns boolean
sdk/java/src/main/java/dev/svm/sandbox/Template.java:662from_alpine_image()
Section titled “from_alpine_image()”def from_alpine_image(self: Template, version: str='3') -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
version |
str |
'3' |
Returns Template
sdk/python/svm/template_helpers.py:123fromAlpineImage(version = "3"): this| Parameter | Type | Default |
|---|---|---|
version |
string |
"3" |
Returns this
sdk/typescript/src/template.ts:300func (t *Template) FromAlpineImage(version string) (*Template, error)FromAlpineImage, FromFedoraImage and FromArchImage set an Alpine, Fedora or Arch Linux base; AptInstall uses its package manager.
| Parameter | Type | Default |
|---|---|---|
version |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:160def from_alpine_image(version = "3")| Parameter | Type | Default |
|---|---|---|
version |
"3" |
sdk/ruby/lib/svm/template_helpers.rb:104public Template fromAlpineImage(String version)| Parameter | Type | Default |
|---|---|---|
version |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:76from_arch_image()
Section titled “from_arch_image()”def from_arch_image(self: Template, version: str='latest') -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
version |
str |
'latest' |
Returns Template
sdk/python/svm/template_helpers.py:129fromArchImage(version = "latest"): this| Parameter | Type | Default |
|---|---|---|
version |
string |
"latest" |
Returns this
sdk/typescript/src/template.ts:302func (t *Template) FromArchImage(version string) (*Template, error)| Parameter | Type | Default |
|---|---|---|
version |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:166def from_arch_image(version = "latest")| Parameter | Type | Default |
|---|---|---|
version |
"latest" |
sdk/ruby/lib/svm/template_helpers.rb:106public Template fromArchImage(String version)| Parameter | Type | Default |
|---|---|---|
version |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:78from_base_image()
Section titled “from_base_image()”def from_base_image(self: Template) -> TemplateTemplateHelpersUbuntu 24.04, the system the platform’s default base template runs. The catalog image itself (with Python, Node and git) is the operator’s and cannot be named by a template, so add the tools you need.
Returns Template
sdk/python/svm/template_helpers.py:132fromBaseImage(): thisUbuntu 24.04, the system the platform’s default base template runs. The catalog image itself (with Python, Node and git) is the operator’s and cannot be named by a template, so add the tools you need.
Returns this
sdk/typescript/src/template.ts:305func (t *Template) FromBaseImage() (*Template, error)FromBaseImage is Ubuntu 24.04, the system the platform’s default base template runs. The catalog image itself (with Python, Node and git) is the operator’s and cannot be named by a template, so add the tools you need.
Returns (*Template, error)
sdk/go/template_helpers.go:172def from_base_imageUbuntu 24.04, the system the platform’s default base template runs. The catalog image itself (with Python, Node and git) is the operator’s and cannot be named by a template, so add the tools you need.
sdk/ruby/lib/svm/template_helpers.rb:110public Template fromBaseImage()Ubuntu 24.04, the system the platform’s default base template runs. The catalog image itself (with Python, Node and git) is the operator’s and cannot be named by a template, so add the tools you need.
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:83from_bun_image()
Section titled “from_bun_image()”def from_bun_image(self: Template, version: str='1') -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
version |
str |
'1' |
Returns Template
sdk/python/svm/template_helpers.py:114fromBunImage(version = "1"): this| Parameter | Type | Default |
|---|---|---|
version |
string |
"1" |
Returns this
sdk/typescript/src/template.ts:297func (t *Template) FromBunImage(version string) (*Template, error)| Parameter | Type | Default |
|---|---|---|
version |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:149def from_bun_image(version = "1")| Parameter | Type | Default |
|---|---|---|
version |
"1" |
sdk/ruby/lib/svm/template_helpers.rb:101public Template fromBunImage(String version)| Parameter | Type | Default |
|---|---|---|
version |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:73from_catalog_template()
Section titled “from_catalog_template()”def from_catalog_template(self, name: str) -> 'Template'Build on a platform catalog template (python, or python:latest) instead of an image: its image and steps come first and this builder’s steps follow. The result is this team’s own private template and counts toward the plan’s template limit.
| Parameter | Type | Default |
|---|---|---|
name |
str |
Returns 'Template'
sdk/python/svm/templates.py:260fromCatalogTemplate(name: string): thisBuild on a platform catalog template (python, or python:latest) instead of an image: its image and steps come first and this builder’s steps follow. The result is this team’s own private template and counts toward the plan’s template limit.
| Parameter | Type | Default |
|---|---|---|
name |
string |
Returns this
sdk/typescript/src/template.ts:284func (t *Template) FromCatalogTemplate(name string) (*Template, error)FromCatalogTemplate builds on a platform catalog template (python, or python:latest) instead of an image: its image and steps come first and this builder’s steps follow. The result is this team’s own private template and counts toward the plan’s template limit.
| Parameter | Type | Default |
|---|---|---|
name |
string |
Returns (*Template, error)
sdk/go/template.go:75def from_catalog_template(name)Builds on a platform catalog template (python, or python:latest) instead of an image: its image and steps come first and this builder’s steps follow. The result is this team’s own private template and counts toward the plan’s template limit.
| Parameter | Type | Default |
|---|---|---|
name |
sdk/ruby/lib/svm/template.rb:94public Template fromCatalogTemplate(String name)Builds on a platform catalog template (python, or python:latest) instead of an image: its image and steps come first and this builder’s steps follow. The result is this team’s own private template and counts toward the plan’s template limit.
| Parameter | Type | Default |
|---|---|---|
name |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:100from_debian_image()
Section titled “from_debian_image()”def from_debian_image(self: Template, version: str='bookworm') -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
version |
str |
'bookworm' |
Returns Template
sdk/python/svm/template_helpers.py:120fromDebianImage(version = "bookworm"): this| Parameter | Type | Default |
|---|---|---|
version |
string |
"bookworm" |
Returns this
sdk/typescript/src/template.ts:299func (t *Template) FromDebianImage(version string) (*Template, error)| Parameter | Type | Default |
|---|---|---|
version |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:155def from_debian_image(version = "bookworm")| Parameter | Type | Default |
|---|---|---|
version |
"bookworm" |
sdk/ruby/lib/svm/template_helpers.rb:103public Template fromDebianImage(String version)| Parameter | Type | Default |
|---|---|---|
version |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:75from_dockerfile()
Section titled “from_dockerfile()”def from_dockerfile(self, dockerfile: str, *, ready: str | None=None) -> 'Template'Fill this template from Dockerfile text, or a path to a Dockerfile.
FROM, RUN, ENV, WORKDIR, ENTRYPOINT/CMD and HEALTHCHECK are read; the rest follow :mod:svm.dockerfile (multi-stage builds and RUN flags are refused). ready is the readiness command when there is no HEALTHCHECK. A Docker Hub short name in FROM is read as its full name (python:3.12-slim -> docker.io/library/python:3.12-slim), and a command in the exec form ["/bin/sh", "-c", X] is the shell command X, so reading back what to_dockerfile wrote gives the same steps and commands.
| Parameter | Type | Default |
|---|---|---|
dockerfile |
str |
|
ready |
str | None |
None |
Returns 'Template'
sdk/python/svm/templates.py:309fromDockerfile(dockerfile: string, options: { ready?: string } = {}): thisFill this template from Dockerfile text; see translateDockerfile for what is accepted. A Docker Hub short name in FROM (python:3.12-slim) is read as its full name (docker.io/library/python:3.12-slim), and toDockerfile writes that back.
| Parameter | Type | Default |
|---|---|---|
dockerfile |
string |
|
options |
{ ready?: string } |
{} |
Returns this
sdk/typescript/src/template.ts:465func (t *Template) FromDockerfile(dockerfile, ready string) (*Template, error)FromDockerfile fills the template from Dockerfile text; ready is the readiness command when there is no HEALTHCHECK. FROM, RUN, ENV, WORKDIR, ENTRYPOINT/CMD and HEALTHCHECK are read; the rest is refused with its line number. A Docker Hub short name (python:3.12-slim) is read as docker.io/library/python:3.12-slim, and the exec form [“/bin/sh”, “-c”, X] as the shell command X, so FromDockerfile reads back what ToDockerfile writes, step for step.
| Parameter | Type | Default |
|---|---|---|
dockerfile |
string |
|
ready |
string |
Returns (*Template, error)
sdk/go/template.go:171def from_dockerfile(text, ready: nil)Fill the template from Dockerfile text. ready is the readiness command when there is no HEALTHCHECK.
| Parameter | Type | Default |
|---|---|---|
text |
||
ready |
nil |
Raises DockerfileError
sdk/ruby/lib/svm/template.rb:144public Template fromDockerfile(String text, String ready)Fill the template from Dockerfile text; ready is the readiness command when there is no HEALTHCHECK. A Docker Hub short name (FROM python:3.12-slim) is read in full (docker.io/library/python:3.12-slim), and a command in the exec form ["/bin/sh", "-c", X] is the shell command X, so fromDockerfile(toDockerfile()) gives the same steps.
| Parameter | Type | Default |
|---|---|---|
text |
String |
|
ready |
String |
Returns Template
Raises SandboxException
sdk/java/src/main/java/dev/svm/sandbox/Template.java:455from_fedora_image()
Section titled “from_fedora_image()”def from_fedora_image(self: Template, version: str='latest') -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
version |
str |
'latest' |
Returns Template
sdk/python/svm/template_helpers.py:126fromFedoraImage(version = "latest"): this| Parameter | Type | Default |
|---|---|---|
version |
string |
"latest" |
Returns this
sdk/typescript/src/template.ts:301func (t *Template) FromFedoraImage(version string) (*Template, error)| Parameter | Type | Default |
|---|---|---|
version |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:163def from_fedora_image(version = "latest")| Parameter | Type | Default |
|---|---|---|
version |
"latest" |
sdk/ruby/lib/svm/template_helpers.rb:105public Template fromFedoraImage(String version)| Parameter | Type | Default |
|---|---|---|
version |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:77from_gcp_registry()
Section titled “from_gcp_registry()”def from_gcp_registry(self: Template, image: str, secret_name: str) -> TemplateTemplateHelpersBase the template on an image in Google Artifact Registry or Container Registry. secret_name names a team secret holding _json_key:<service account key JSON>, sent to the registry as its user and password.
| Parameter | Type | Default |
|---|---|---|
image |
str |
|
secret_name |
str |
Returns Template
sdk/python/svm/template_helpers.py:137fromGcpRegistry(image: string, secretName: string): thisBase the template on an image in Google Artifact Registry or Container Registry. secretName names a team secret holding _json_key:<service account key JSON>, sent to the registry as its user and password.
| Parameter | Type | Default |
|---|---|---|
image |
string |
|
secretName |
string |
Returns this
sdk/typescript/src/template.ts:308func (t *Template) FromGcpRegistry(image, secretName string) (*Template, error)FromGcpRegistry bases the template on an image in Google Artifact Registry (<region>-docker.pkg.dev) or Container Registry (gcr.io). secretName names a team secret holding “_json_key:<service account key JSON>”, sent as the registry user and password.
| Parameter | Type | Default |
|---|---|---|
image |
string |
|
secretName |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:176def from_gcp_registry(image, secret_name)Bases the template on an image in Google Artifact Registry (<region>-docker.pkg.dev) or Container Registry (gcr.io). secret_name names a team secret holding “_json_key:<service account key JSON>”, sent to the registry as its user and password.
| Parameter | Type | Default |
|---|---|---|
image |
||
secret_name |
sdk/ruby/lib/svm/template_helpers.rb:114public Template fromGcpRegistry(String image, String secretName)Bases the template on an image in Google Artifact Registry (<region>-docker.pkg.dev) or Container Registry (gcr.io). secretName names a team secret holding _json_key:<service account key JSON>, sent as the registry user and password.
| Parameter | Type | Default |
|---|---|---|
image |
String |
|
secretName |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:89from_image()
Section titled “from_image()”def from_image(self, image: str, *, registry_secret: str | None=None) -> 'Template'Base the template on an OCI image; registry_secret names the team secret that pulls it from a private registry.
| Parameter | Type | Default |
|---|---|---|
image |
str |
|
registry_secret |
str | None |
None |
Returns 'Template'
sdk/python/svm/templates.py:252fromImage(image: string, options: { registrySecret?: string } = {}): thisBase the template on an OCI image; registrySecret names the team secret that pulls it from a private registry.
| Parameter | Type | Default |
|---|---|---|
image |
string |
|
options |
{ registrySecret?: string } |
{} |
Returns this
sdk/typescript/src/template.ts:274func (t *Template) FromImage(image string) (*Template, error)FromImage sets the base image (an OCI reference with a registry host).
| Parameter | Type | Default |
|---|---|---|
image |
string |
Returns (*Template, error)
sdk/go/template.go:65def from_image(image, registry_secret: nil)registry_secret names a team secret that holds the registry credentials for a private image.
| Parameter | Type | Default |
|---|---|---|
image |
||
registry_secret |
nil |
sdk/ruby/lib/svm/template.rb:85public Template fromImage(String image)public Template fromImage(String image, String registrySecret)registrySecret names a team secret that holds the registry credentials for a private image.
| Parameter | Type | Default |
|---|---|---|
image |
String |
|
registrySecret |
String |
optional |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:49from_node_image()
Section titled “from_node_image()”def from_node_image(self: Template, version: str='22') -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
version |
str |
'22' |
Returns Template
sdk/python/svm/template_helpers.py:111fromNodeImage(version = "22"): this| Parameter | Type | Default |
|---|---|---|
version |
string |
"22" |
Returns this
sdk/typescript/src/template.ts:296func (t *Template) FromNodeImage(version string) (*Template, error)| Parameter | Type | Default |
|---|---|---|
version |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:146def from_node_image(version = "22")| Parameter | Type | Default |
|---|---|---|
version |
"22" |
sdk/ruby/lib/svm/template_helpers.rb:100public Template fromNodeImage(String version)| Parameter | Type | Default |
|---|---|---|
version |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:72from_private_image()
Section titled “from_private_image()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
func (t *Template) FromPrivateImage(image, registrySecret string) (*Template, error)FromPrivateImage sets the base image and the team secret that pulls it from its registry.
| Parameter | Type | Default |
|---|---|---|
image |
string |
|
registrySecret |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:131Not in the Ruby SDK’s Template.
Not in the Java SDK’s Template.
from_python_image()
Section titled “from_python_image()”def from_python_image(self: Template, version: str='3.12') -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
version |
str |
'3.12' |
Returns Template
sdk/python/svm/template_helpers.py:108fromPythonImage(version = "3.12"): this| Parameter | Type | Default |
|---|---|---|
version |
string |
"3.12" |
Returns this
sdk/typescript/src/template.ts:295func (t *Template) FromPythonImage(version string) (*Template, error)FromPythonImage, FromNodeImage, FromBunImage, FromUbuntuImage and FromDebianImage set a well-known base image.
| Parameter | Type | Default |
|---|---|---|
version |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:143def from_python_image(version = "3.12")| Parameter | Type | Default |
|---|---|---|
version |
"3.12" |
sdk/ruby/lib/svm/template_helpers.rb:99public Template fromPythonImage(String version)| Parameter | Type | Default |
|---|---|---|
version |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:71from_template()
Section titled “from_template()”def from_template(self: Template, other: Template) -> TemplateTemplateHelpersStart from another builder’s definition: its image, registry, steps, files and commands.
| Parameter | Type | Default |
|---|---|---|
other |
Template |
Returns Template
sdk/python/svm/template_helpers.py:146fromTemplate(other: Template): thisStart from another builder’s definition: its image, registry, steps, files and commands.
| Parameter | Type | Default |
|---|---|---|
other |
Template |
Returns this
sdk/typescript/src/template.ts:386func (t *Template) FromTemplate(other *Template) *TemplateFromTemplate starts from another builder’s definition: its image, registry, steps, files and commands.
| Parameter | Type | Default |
|---|---|---|
other |
*Template |
Returns *Template
sdk/go/template_helpers.go:194def from_template(other)Starts from another builder’s definition: its image, registry, steps, files and commands.
| Parameter | Type | Default |
|---|---|---|
other |
sdk/ruby/lib/svm/template_helpers.rb:123public Template fromTemplate(Template other)Starts from another builder’s definition: its image, registry, steps, files and commands.
| Parameter | Type | Default |
|---|---|---|
other |
Template |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:110from_ubuntu_image()
Section titled “from_ubuntu_image()”def from_ubuntu_image(self: Template, version: str='24.04') -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
version |
str |
'24.04' |
Returns Template
sdk/python/svm/template_helpers.py:117fromUbuntuImage(version = "24.04"): this| Parameter | Type | Default |
|---|---|---|
version |
string |
"24.04" |
Returns this
sdk/typescript/src/template.ts:298func (t *Template) FromUbuntuImage(version string) (*Template, error)| Parameter | Type | Default |
|---|---|---|
version |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:152def from_ubuntu_image(version = "24.04")| Parameter | Type | Default |
|---|---|---|
version |
"24.04" |
sdk/ruby/lib/svm/template_helpers.rb:102public Template fromUbuntuImage(String version)| Parameter | Type | Default |
|---|---|---|
version |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:74get_tags()
Section titled “get_tags()”def get_tags(name_or_id: str, *, client: SandboxClient | None=None) -> 'list[str]'The tags of a template (by name or ID).
| Parameter | Type | Default |
|---|---|---|
name_or_id |
str |
|
client |
SandboxClient | None |
None |
Returns 'list[str]'
sdk/python/svm/templates.py:226static async getTags(nameOrId: string, client: SandboxClient = new SandboxClient()): Promise<string[]>The tags of a template (by name or id).
| Parameter | Type | Default |
|---|---|---|
nameOrId |
string |
|
client |
SandboxClient |
new SandboxClient() |
Returns Promise<string[]>
sdk/typescript/src/template.ts:249Not in the Go SDK’s Template.
def self.get_tags(name_or_id, client: Client.new)The tags of a template (by name or id).
| Parameter | Type | Default |
|---|---|---|
name_or_id |
||
client |
Client.new |
sdk/ruby/lib/svm/template.rb:39public static List<String> getTags(Client client, String nameOrId)The tags of a template (by name or id).
| Parameter | Type | Default |
|---|---|---|
client |
Client |
|
nameOrId |
String |
Returns List<String>
sdk/java/src/main/java/dev/svm/sandbox/Template.java:672git_clone()
Section titled “git_clone()”def git_clone(self: Template, url: str, path: str | None=None, *, branch: str | None=None, depth: int | None=None) -> TemplateTemplateHelpersClone an HTTPS repository at build time; the URL may carry no credential.
| Parameter | Type | Default |
|---|---|---|
url |
str |
|
path |
str | None |
None |
branch |
str | None |
None |
depth |
int | None |
None |
Returns Template
sdk/python/svm/template_helpers.py:189gitClone(url: string, path?: string, options: { branch?: string; depth?: number } = {}): this| Parameter | Type | Default |
|---|---|---|
url |
string |
|
path |
string |
optional |
options |
{ branch?: string; depth?: number } |
{} |
Returns this
sdk/typescript/src/template.ts:318func (t *Template) GitClone(repoURL, path, branch string, depth int) (*Template, error)GitClone clones an HTTPS repository at build time into path (empty for git’s default); branch and depth are optional.
| Parameter | Type | Default |
|---|---|---|
repoURL |
string |
|
path |
string |
|
branch |
string |
|
depth |
int |
Returns (*Template, error)
sdk/go/template_helpers.go:272def git_clone(url, path = nil, branch: nil, depth: nil)Clones an HTTPS repository at build time; the URL may carry no credential.
| Parameter | Type | Default |
|---|---|---|
url |
||
path |
nil |
|
branch |
nil |
|
depth |
nil |
sdk/ruby/lib/svm/template_helpers.rb:161public Template gitClone(String url, String path, String branch, Integer depth)Clones an HTTPS repository at build time; the URL may carry no credential. path, branch and depth may be null.
| Parameter | Type | Default |
|---|---|---|
url |
String |
|
path |
String |
|
branch |
String |
|
depth |
Integer |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:161initialize()
Section titled “initialize()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
def initialize(name, client: Client.new, visibility: "private", cpu_count: nil, memory_mb: nil, disk_mb: nil)| Parameter | Type | Default |
|---|---|---|
name |
||
client |
Client.new |
|
visibility |
"private" |
|
cpu_count |
nil |
|
memory_mb |
nil |
|
disk_mb |
nil |
sdk/ruby/lib/svm/template.rb:75Not in the Java SDK’s Template.
make_dir()
Section titled “make_dir()”def make_dir(self: Template, path: str, *, mode: str | None=None) -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
path |
str |
|
mode |
str | None |
None |
Returns Template
sdk/python/svm/template_helpers.py:208makeDir(path: string, options: { mode?: string } = {}): this| Parameter | Type | Default |
|---|---|---|
path |
string |
|
options |
{ mode?: string } |
{} |
Returns this
sdk/typescript/src/template.ts:319func (t *Template) MakeDir(path, mode string) (*Template, error)MakeDir creates path and its parents; mode is octal (like “755”) or empty.
| Parameter | Type | Default |
|---|---|---|
path |
string |
|
mode |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:301def make_dir(path, mode: nil)| Parameter | Type | Default |
|---|---|---|
path |
||
mode |
nil |
sdk/ruby/lib/svm/template_helpers.rb:179public Template makeDir(String path, String mode)| Parameter | Type | Default |
|---|---|---|
path |
String |
|
mode |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:184make_symlink()
Section titled “make_symlink()”def make_symlink(self: Template, target: str, link: str) -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
target |
str |
|
link |
str |
Returns Template
sdk/python/svm/template_helpers.py:213makeSymlink(target: string, link: string): this| Parameter | Type | Default |
|---|---|---|
target |
string |
|
link |
string |
Returns this
sdk/typescript/src/template.ts:320func (t *Template) MakeSymlink(target, link string) (*Template, error)MakeSymlink points link at target.
| Parameter | Type | Default |
|---|---|---|
target |
string |
|
link |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:317def make_symlink(target, link)| Parameter | Type | Default |
|---|---|---|
target |
||
link |
sdk/ruby/lib/svm/template_helpers.rb:184public Template makeSymlink(String target, String link)| Parameter | Type | Default |
|---|---|---|
target |
String |
|
link |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:189mcp_servers()
Section titled “mcp_servers()”mcp_servers: list[dict[str, Any]]Property.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
mcp_serversProperty (read-only).
public List<Map<String, Object>> mcpServers()The servers added so far, as the build request sends them.
Returns List<Map<String, Object>>
sdk/java/src/main/java/dev/svm/sandbox/Template.java:283memory_mb()
Section titled “memory_mb()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public Template memoryMb(int mb)| Parameter | Type | Default |
|---|---|---|
mb |
int |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:45npm_install()
Section titled “npm_install()”def npm_install(self: Template, packages: list[str] | None=None, *, global_: bool=False, **kw: Any) -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
packages |
list[str] | None |
None |
global_ |
bool |
False |
kw |
Any |
optional |
Returns Template
sdk/python/svm/template_helpers.py:174npmInstall(packages: string[] = [], options: { global?: boolean } = {}): this| Parameter | Type | Default |
|---|---|---|
packages |
string[] |
[] |
options |
{ global?: boolean } |
{} |
Returns this
sdk/typescript/src/template.ts:316func (t *Template) NpmInstall(global bool, packages ...string) (*Template, error)NpmInstall installs packages (or the project’s, when none are named), globally when global is set.
| Parameter | Type | Default |
|---|---|---|
global |
bool |
|
packages |
...string |
optional |
Returns (*Template, error)
sdk/go/template_helpers.go:246def npm_install(packages = [], global: false)| Parameter | Type | Default |
|---|---|---|
packages |
[] |
|
global |
false |
sdk/ruby/lib/svm/template_helpers.rb:149public Template npmInstall(List<String> packages, boolean global)| Parameter | Type | Default |
|---|---|---|
packages |
List<String> |
|
global |
boolean |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:145pip_install()
Section titled “pip_install()”def pip_install(self: Template, packages: list[str]) -> TemplateTemplateHelpers| Parameter | Type | Default |
|---|---|---|
packages |
list[str] |
Returns Template
sdk/python/svm/template_helpers.py:171pipInstall(packages: string[]): this| Parameter | Type | Default |
|---|---|---|
packages |
string[] |
Returns this
sdk/typescript/src/template.ts:315func (t *Template) PipInstall(packages ...string) (*Template, error)PipInstall installs Python packages with python3 -m pip.
| Parameter | Type | Default |
|---|---|---|
packages |
...string |
optional |
Returns (*Template, error)
sdk/go/template_helpers.go:240def pip_install(packages)| Parameter | Type | Default |
|---|---|---|
packages |
sdk/ruby/lib/svm/template_helpers.rb:145public Template pipInstall(List<String> packages)| Parameter | Type | Default |
|---|---|---|
packages |
List<String> |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:143registry_credentials()
Section titled “registry_credentials()”registry_credentials: list[dict[str, str]]Property.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
registry_credentialsProperty (read-only).
public List<Map<String, String>> registryCredentials()Returns List<Map<String, String>>
sdk/java/src/main/java/dev/svm/sandbox/Template.java:67remove()
Section titled “remove()”def remove(self: Template, path: str, *, recursive: bool=False) -> TemplateTemplateHelpersDelete path in the image (a directory needs recursive).
| Parameter | Type | Default |
|---|---|---|
path |
str |
|
recursive |
bool |
False |
Returns Template
sdk/python/svm/template_helpers.py:231remove(path: string, options: { recursive?: boolean } = {}): thisDelete path in the image (a directory needs recursive).
| Parameter | Type | Default |
|---|---|---|
path |
string |
|
options |
{ recursive?: boolean } |
{} |
Returns this
sdk/typescript/src/template.ts:334func (t *Template) Remove(path string, recursive bool) (*Template, error)Remove deletes path in the image (a directory needs recursive).
| Parameter | Type | Default |
|---|---|---|
path |
string |
|
recursive |
bool |
Returns (*Template, error)
sdk/go/template_helpers.go:355def remove(path, recursive: false)Deletes path in the image (a directory needs recursive).
| Parameter | Type | Default |
|---|---|---|
path |
||
recursive |
false |
sdk/ruby/lib/svm/template_helpers.rb:205public Template remove(String path, boolean recursive)Deletes path in the image (a directory needs recursive).
| Parameter | Type | Default |
|---|---|---|
path |
String |
|
recursive |
boolean |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:362remove_tags()
Section titled “remove_tags()”def remove_tags(name_or_id: str, tags: 'list[str]', *, client: SandboxClient | None=None) -> NoneRemove tags from a template; the builds stay.
| Parameter | Type | Default |
|---|---|---|
name_or_id |
str |
|
tags |
'list[str]' |
|
client |
SandboxClient | None |
None |
sdk/python/svm/templates.py:242static async removeTags(nameOrId: string, tags: string[], client: SandboxClient = new SandboxClient()): Promise<void>Remove tags from a template; the builds stay.
| Parameter | Type | Default |
|---|---|---|
nameOrId |
string |
|
tags |
string[] |
|
client |
SandboxClient |
new SandboxClient() |
sdk/typescript/src/template.ts:264Not in the Go SDK’s Template.
def self.remove_tags(name_or_id, tags, client: Client.new)Removes tags from a template; the builds stay.
| Parameter | Type | Default |
|---|---|---|
name_or_id |
||
tags |
||
client |
Client.new |
sdk/ruby/lib/svm/template.rb:53public static void removeTags(Client client, String nameOrId, List<String> tags)Removes tags from a template; the builds stay.
| Parameter | Type | Default |
|---|---|---|
client |
Client |
|
nameOrId |
String |
|
tags |
List<String> |
sdk/java/src/main/java/dev/svm/sandbox/Template.java:687rename()
Section titled “rename()”def rename(self: Template, src: str, dst: str) -> TemplateTemplateHelpersMove src to dst in the image.
| Parameter | Type | Default |
|---|---|---|
src |
str |
|
dst |
str |
Returns Template
sdk/python/svm/template_helpers.py:235rename(src: string, dst: string): thisMove src to dst in the image.
| Parameter | Type | Default |
|---|---|---|
src |
string |
|
dst |
string |
Returns this
sdk/typescript/src/template.ts:336func (t *Template) Rename(src, dst string) (*Template, error)Rename moves src to dst in the image.
| Parameter | Type | Default |
|---|---|---|
src |
string |
|
dst |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:367def rename(src, dst)Moves src to dst in the image.
| Parameter | Type | Default |
|---|---|---|
src |
||
dst |
sdk/ruby/lib/svm/template_helpers.rb:210public Template rename(String src, String dst)Moves src to dst in the image.
| Parameter | Type | Default |
|---|---|---|
src |
String |
|
dst |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:367run_argv()
Section titled “run_argv()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
func (t *Template) RunArgv(argv ...string) (*Template, error)RunArgv adds a step run as an argument vector.
| Parameter | Type | Default |
|---|---|---|
argv |
...string |
optional |
Returns (*Template, error)
sdk/go/template.go:95Not in the Ruby SDK’s Template.
Not in the Java SDK’s Template.
run_cmd()
Section titled “run_cmd()”def run_cmd(self, command: str | list[str]) -> 'Template'| Parameter | Type | Default |
|---|---|---|
command |
str | list[str] |
Returns 'Template'
sdk/python/svm/templates.py:270runCmd(command: string | string[]): this| Parameter | Type | Default |
|---|---|---|
command |
string | string[] |
Returns this
sdk/typescript/src/template.ts:416func (t *Template) RunCmd(command string) *TemplateRunCmd adds a step run through /bin/sh -c.
| Parameter | Type | Default |
|---|---|---|
command |
string |
Returns *Template
sdk/go/template.go:89def run_cmd(command)| Parameter | Type | Default |
|---|---|---|
command |
sdk/ruby/lib/svm/template.rb:102public Template runCmd(String command)public Template runCmd(List<String> argv)The same step with an argv instead of a shell line (Python’s run_cmd takes either).
| Parameter | Type | Default |
|---|---|---|
command |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:312set_default_user()
Section titled “set_default_user()”def set_default_user(self: Template, user: str) -> TemplateTemplateHelpersRun every command, process, PTY, code run and file call a sandbox of this template gets through the SDK as user unless the call names a user of its own, as commands.run(..., user="root") does for the operator. Unlike set_user it does not change the template’s start and ready commands, so the MCP gateway (a service) keeps root while an agent in the sandbox does not and cannot approve its own tool calls. user is an account name of the image; the image must have it (create it with a run_cmd such as useradd -m agent), or every call that names no user is refused.
| Parameter | Type | Default |
|---|---|---|
user |
str |
Returns Template
sdk/python/svm/template_helpers.py:246setDefaultUser(user: string): thisRun every command, process, PTY, code run and file call a sandbox of this template gets through the SDK as user unless the call names a user of its own (commands.run(cmd, { user: "root" }), as the operator does). Unlike setUser it does not change the start and ready commands, so the MCP gateway (a service) keeps root while an agent in the sandbox does not and cannot approve its own tool calls. user is an account name of the image; the image must have it, or every call that names no user is refused.
| Parameter | Type | Default |
|---|---|---|
user |
string |
Returns this
sdk/typescript/src/template.ts:345func (t *Template) SetDefaultUser(user string) (*Template, error)SetDefaultUser runs every command, process, PTY, code run and file call a sandbox of this template gets through the SDK as user, unless the call names a user of its own (RunOptions{User: “root”}, as the operator does). Unlike SetUser it does not change the start and ready commands, so the MCP gateway (a service) keeps root while an agent in the sandbox does not and cannot approve its own tool calls. user is an account name of the image; the image must have it, or every call that names no user is refused.
| Parameter | Type | Default |
|---|---|---|
user |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:392def set_default_user(user)Runs every command, process, PTY, code run and file call a sandbox of this template gets through the SDK as user, unless the call names a user of its own (<code>user: “root”</code> is the operator’s way). Unlike set_user it leaves the template’s start and ready commands alone, so a service such as the MCP gateway keeps root while an agent in the sandbox does not. user is an account name of the image (create it with run_cmd, like “useradd -m agent”); without it every call that names no user is refused.
| Parameter | Type | Default |
|---|---|---|
user |
sdk/ruby/lib/svm/template_helpers.rb:225public Template setDefaultUser(String user)Runs every command, process, PTY, code run and file call a sandbox of this template gets through the SDK as user, unless the call names a user of its own (root, for the operator). Unlike setUser it leaves the template’s start and ready commands alone, so a service such as the MCP gateway keeps root while an agent in the sandbox does not. user is an account name of the image (create it with runCmd("useradd -m agent")); without it every call that names no user is refused.
| Parameter | Type | Default |
|---|---|---|
user |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:205set_dev_container_start()
Section titled “set_dev_container_start()”def set_dev_container_start(self: Template, devcontainer_dir: str, command: str | None=None) -> TemplateTemplateHelpersStart the dev container in devcontainer_dir when the template starts (so it is running in the snapshot): the start command is devcontainer up --workspace-folder and --config followed by creating /devcontainer.up, and the ready command waits for that file (set_ready_cmd afterwards replaces it). With command it then runs command inside the dev container (devcontainer exec). Needs the devcontainer CLI: call dev_container_prebuild first.
| Parameter | Type | Default |
|---|---|---|
devcontainer_dir |
str |
|
command |
str | None |
None |
Returns Template
sdk/python/svm/template_helpers.py:269setDevContainerStart(devcontainerDir: string, command?: string): thisStart the dev container in devcontainerDir when the template starts (so it is running in the snapshot): the start command is devcontainer up --workspace-folder with the explicit --config, followed by creating /devcontainer.up; the ready command waits for that file (setReadyCmd afterwards replaces it). With command it then runs it inside the dev container (devcontainer exec). Needs the devcontainer CLI: call devContainerPrebuild first.
| Parameter | Type | Default |
|---|---|---|
devcontainerDir |
string |
|
command |
string |
optional |
Returns this
sdk/typescript/src/template.ts:355func (t *Template) SetDevContainerStart(devcontainerDir, command string) (*Template, error)SetDevContainerStart starts the dev container in devcontainerDir when the template starts (so it is running in the snapshot): the start command is devcontainer up --workspace-folder and --config followed by creating /devcontainer.up, and the ready command waits for that file (SetReadyCmd afterwards replaces it). A non-empty command is then run inside the dev container (devcontainer exec). It needs the devcontainer CLI: call DevContainerPrebuild first.
| Parameter | Type | Default |
|---|---|---|
devcontainerDir |
string |
|
command |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:427def set_dev_container_start(devcontainer_dir, command = nil)Starts the dev container in devcontainer_dir when the template starts (so it is running in the snapshot): the start command is devcontainer up –workspace-folder and –config followed by creating /devcontainer.up, and the ready command waits for that file (set_ready_cmd afterwards replaces it). A non-empty command is then run inside the dev container (devcontainer exec). It needs the devcontainer CLI: call dev_container_prebuild first.
| Parameter | Type | Default |
|---|---|---|
devcontainer_dir |
||
command |
nil |
sdk/ruby/lib/svm/template_helpers.rb:244public Template setDevContainerStart(String devcontainerDir)public Template setDevContainerStart(String devcontainerDir, String command)Starts the dev container with no command of its own: setDevContainerStart(String, String) with null.
| Parameter | Type | Default |
|---|---|---|
devcontainerDir |
String |
|
command |
String |
optional |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:226set_envs()
Section titled “set_envs()”def set_envs(self, envs: dict[str, str]) -> 'Template'| Parameter | Type | Default |
|---|---|---|
envs |
dict[str, str] |
Returns 'Template'
sdk/python/svm/templates.py:295setEnvs(envs: Record<string, string>): this| Parameter | Type | Default |
|---|---|---|
envs |
Record<string, string> |
Returns this
sdk/typescript/src/template.ts:445func (t *Template) SetEnvs(envs map[string]string) (*Template, error)SetEnvs adds environment variables as one step of flat name, value pairs.
| Parameter | Type | Default |
|---|---|---|
envs |
map[string]string |
Returns (*Template, error)
sdk/go/template.go:133def set_envs(envs)| Parameter | Type | Default |
|---|---|---|
envs |
sdk/ruby/lib/svm/template.rb:124public Template setEnvs(Map<String, String> envs)| Parameter | Type | Default |
|---|---|---|
envs |
Map<String, String> |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:427set_ready_cmd()
Section titled “set_ready_cmd()”def set_ready_cmd(self, command: str) -> 'Template'| Parameter | Type | Default |
|---|---|---|
command |
str |
Returns 'Template'
sdk/python/svm/templates.py:340setReadyCmd(command: string): this| Parameter | Type | Default |
|---|---|---|
command |
string |
Returns this
sdk/typescript/src/template.ts:484func (t *Template) SetReadyCmd(command string) *TemplateSetReadyCmd sets the command whose success says a sandbox is ready; a build needs one.
| Parameter | Type | Default |
|---|---|---|
command |
string |
Returns *Template
sdk/go/template.go:165def set_ready_cmd(command)| Parameter | Type | Default |
|---|---|---|
command |
sdk/ruby/lib/svm/template.rb:141public Template setReadyCmd(String command)| Parameter | Type | Default |
|---|---|---|
command |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:319set_start_cmd()
Section titled “set_start_cmd()”def set_start_cmd(self, command: str) -> 'Template'| Parameter | Type | Default |
|---|---|---|
command |
str |
Returns 'Template'
sdk/python/svm/templates.py:334setStartCmd(command: string): this| Parameter | Type | Default |
|---|---|---|
command |
string |
Returns this
sdk/typescript/src/template.ts:478func (t *Template) SetStartCmd(command string) *TemplateSetStartCmd sets the long-running command of sandboxes from this template.
| Parameter | Type | Default |
|---|---|---|
command |
string |
Returns *Template
sdk/go/template.go:162def set_start_cmd(command)| Parameter | Type | Default |
|---|---|---|
command |
sdk/ruby/lib/svm/template.rb:140public Template setStartCmd(String command)| Parameter | Type | Default |
|---|---|---|
command |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:318set_user()
Section titled “set_user()”def set_user(self: Template, user: str) -> TemplateTemplateHelpersRun the following steps, and the sandbox, as user (name, uid or user:group).
| Parameter | Type | Default |
|---|---|---|
user |
str |
Returns Template
sdk/python/svm/template_helpers.py:239setUser(user: string): thisRun the following steps, and the sandbox, as user (name, uid or user:group).
| Parameter | Type | Default |
|---|---|---|
user |
string |
Returns this
sdk/typescript/src/template.ts:338func (t *Template) SetUser(user string) (*Template, error)SetUser runs the following steps, and the sandbox, as user (name, uid or user:group).
| Parameter | Type | Default |
|---|---|---|
user |
string |
Returns (*Template, error)
sdk/go/template_helpers.go:380def set_user(user)Runs the following steps, and the sandbox, as user (name, uid or user:group).
| Parameter | Type | Default |
|---|---|---|
user |
sdk/ruby/lib/svm/template_helpers.rb:215public Template setUser(String user)Runs the following steps, and the sandbox, as user (name, uid or user:group).
| Parameter | Type | Default |
|---|---|---|
user |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:194set_workdir()
Section titled “set_workdir()”def set_workdir(self, path: str) -> 'Template'| Parameter | Type | Default |
|---|---|---|
path |
str |
Returns 'Template'
sdk/python/svm/templates.py:303setWorkdir(path: string): this| Parameter | Type | Default |
|---|---|---|
path |
string |
Returns this
sdk/typescript/src/template.ts:457func (t *Template) SetWorkdir(path string) (*Template, error)SetWorkdir sets the working directory of the start and ready commands.
| Parameter | Type | Default |
|---|---|---|
path |
string |
Returns (*Template, error)
sdk/go/template.go:153def set_workdir(path)| Parameter | Type | Default |
|---|---|---|
path |
sdk/ruby/lib/svm/template.rb:134public Template setWorkdir(String path)| Parameter | Type | Default |
|---|---|---|
path |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:437skip_cache()
Section titled “skip_cache()”def skip_cache(self: Template) -> TemplateTemplateHelpersBuild afresh: the build cache is keyed on the definition, and this adds a one-off value to it.
Returns Template
sdk/python/svm/template_helpers.py:311skipCache(): thisBuild afresh: the build cache is keyed on the definition, and this adds a one-off value to it.
Returns this
sdk/typescript/src/template.ts:383func (t *Template) SkipCache() *TemplateSkipCache makes the next build run afresh: the build cache is keyed on the definition, and this adds a one-off value to it.
Returns *Template
sdk/go/template_helpers.go:537def skip_cacheBuilds afresh: the build cache is keyed on the definition, and this adds a one-off value to it.
Source:sdk/ruby/lib/svm/template_helpers.rb:273public Template skipCache()Builds afresh: the build cache is keyed on the definition, and this adds a one-off value to it.
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:286steps()
Section titled “steps()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
stepsProperty (read-only).
public List<Map<String, Object>> steps()Returns List<Map<String, Object>>
sdk/java/src/main/java/dev/svm/sandbox/Template.java:66to_dockerfile()
Section titled “to_dockerfile()”def to_dockerfile(self: Template) -> strTemplateHelpersThe definition as a Dockerfile. from_dockerfile reads it back to the same image (in full, see svm.dockerfile.qualify_image), steps and commands, apart from COPY, USER and default_user (refused or a comment).
The builder applies a template’s environment and working directory to every RUN step, those listed before the set_envs/set_workdir call included (one environment, the last value of each variable; one directory, the last). So the Dockerfile says it the same way: the merged ENV and the last WORKDIR come right after FROM, before any RUN. USER stays where it is: it applies from its step on, as in a Dockerfile.
Returns str
sdk/python/svm/template_helpers.py:330toDockerfile(): stringReturns string
sdk/typescript/src/template.ts:410func (t *Template) ToDockerfile() (string, error)ToDockerfile renders the definition as a Dockerfile (FromDockerfile reads it back, apart from COPY and USER). The builder applies a template’s environment (one map, the last value of each variable) and working directory (the last) to every RUN step, those listed before SetEnvs/SetWorkdir included, so the merged ENV and the last WORKDIR come right after FROM, before any RUN (F163). USER stays in step order: it applies from its step on, as in a Dockerfile.
Returns (string, error)
sdk/go/template_helpers.go:601def to_dockerfileThe definition as a Dockerfile (from_dockerfile reads it back, apart from COPY and USER, to the same steps; it reads a Docker Hub short name such as python:3.12-slim as docker.io/library/python:3.12-slim). The builder applies a template’s environment (one map, the last value of each variable) and working directory (the last) to every RUN step, those listed before set_envs/set_workdir included, so the merged ENV and the last WORKDIR come right after FROM, before any RUN (F163). USER stays in step order.
Source:sdk/ruby/lib/svm/template_helpers.rb:292public String toDockerfile()The definition as a Dockerfile, the image name as given. fromDockerfile reads it back to the same steps and commands (apart from COPY and USER), with a Docker Hub short name in full (docker.io/library/...). ENV and WORKDIR come first: see TemplateHelpers.envAndWorkdir.
Returns String
sdk/java/src/main/java/dev/svm/sandbox/Template.java:293to_json_definition()
Section titled “to_json_definition()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
def to_json_definitionThe build request this builder sends (without the uploaded files’ hash).
Source:sdk/ruby/lib/svm/template_helpers.rb:278Not in the Java SDK’s Template.
visibility()
Section titled “visibility()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public Template visibility(String v)| Parameter | Type | Default |
|---|---|---|
v |
String |
Returns Template
sdk/java/src/main/java/dev/svm/sandbox/Template.java:42wait_for_file()
Section titled “wait_for_file()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public static String waitForFile(String path)A ready command that passes once path exists.
| Parameter | Type | Default |
|---|---|---|
path |
String |
Returns String
sdk/java/src/main/java/dev/svm/sandbox/Template.java:399wait_for_port()
Section titled “wait_for_port()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public static String waitForPort(int port)A ready command (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
sdk/java/src/main/java/dev/svm/sandbox/Template.java:372wait_for_process()
Section titled “wait_for_process()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public static String waitForProcess(String name)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
sdk/java/src/main/java/dev/svm/sandbox/Template.java:391wait_for_timeout()
Section titled “wait_for_timeout()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public static String waitForTimeout(Duration timeout)A ready command that passes after timeout (rounded up to whole seconds).
| Parameter | Type | Default |
|---|---|---|
timeout |
Duration |
Returns String
sdk/java/src/main/java/dev/svm/sandbox/Template.java:402wait_for_url()
Section titled “wait_for_url()”Not in the Python SDK’s Template.
Not in the TypeScript SDK’s Template.
Not in the Go SDK’s Template.
Not in the Ruby SDK’s Template.
public static String waitForUrl(String url)public static String waitForUrl(String url, int status)waitForUrl(String, int) for status 200.
| Parameter | Type | Default |
|---|---|---|
url |
String |
|
status |
int |
optional |
Returns String
sdk/java/src/main/java/dev/svm/sandbox/Template.java:378TemplateHelpers
Section titled “TemplateHelpers”Mixed into svm.templates.Template.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
mcp_servers |
list[dict[str, Any]] |
|
registry_credentials |
list[dict[str, str]] |
Not in the TypeScript SDK.
Not in the Go SDK.
Ruby exposes these as methods; see below.
Not in the Java SDK.
Not in the Python SDK’s TemplateHelpers.
Not in the TypeScript SDK.
Not in the Go SDK.
def self.abs(path)| Parameter | Type | Default |
|---|---|---|
path |
sdk/ruby/lib/svm/template_helpers.rb:44Not in the Java SDK.
add_mcp_server()
Section titled “add_mcp_server()”def add_mcp_server(self: Template, name: str, *, catalog_id: str | None=None, command: str | None=None, args: list[str] | None=None, env_secret_names: list[str] | None=None, secrets: dict[str, str] | None=None, env: dict[str, str] | None=None, tool_rules: dict[str, Any] | None=None) -> TemplateRun an MCP server behind the gateway in every sandbox of this template, as mcp_servers of Sandbox.create takes it (a sandbox’s own server of the same name replaces it): a catalog server (catalog_id) or a custom one (command, with args), exactly one. The list is sent with the build and becomes the template’s (not the image’s: it does not change the build cache, and every tag has it). A sandbox restored from a snapshot keeps the snapshot’s own servers.
| Parameter | Type | Default |
|---|---|---|
name |
str |
|
catalog_id |
str | None |
None |
command |
str | None |
None |
args |
list[str] | None |
None |
env_secret_names |
list[str] | None |
None |
secrets |
dict[str, str] | None |
None |
env |
dict[str, str] | None |
None |
tool_rules |
dict[str, Any] | None |
None |
Returns Template
sdk/python/svm/template_helpers.py:286Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
apt_install()
Section titled “apt_install()”def apt_install(self: Template, packages: list[str]) -> TemplateInstall system packages with apt-get, or with apk, dnf or pacman on an Alpine, Fedora or Arch Linux base (the image’s package names).
| Parameter | Type | Default |
|---|---|---|
packages |
list[str] |
Returns Template
sdk/python/svm/template_helpers.py:157Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
bun_install()
Section titled “bun_install()”def bun_install(self: Template, packages: list[str] | None=None, *, global_: bool=False, **kw: Any) -> Template| Parameter | Type | Default |
|---|---|---|
packages |
list[str] | None |
None |
global_ |
bool |
False |
kw |
Any |
optional |
Returns Template
sdk/python/svm/template_helpers.py:181Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
copy_items()
Section titled “copy_items()”def copy_items(self: Template, items: list[dict[str, Any]]) -> Templatecopy for each item ({"src": ..., "dest": ..., "content": optional bytes or text}), all or none.
| Parameter | Type | Default |
|---|---|---|
items |
list[dict[str, Any]] |
Returns Template
sdk/python/svm/template_helpers.py:216Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
dev_container_prebuild()
Section titled “dev_container_prebuild()”def dev_container_prebuild(self: Template, devcontainer_dir: str) -> TemplateBuild the dev container in devcontainer_dir (an absolute path holding devcontainer.json, usually <project>/.devcontainer) into the image: one run step that installs the devcontainer CLI when the image has none (npm install -g @devcontainers/cli) and builds it using the parent project as --workspace-folder and devcontainer.json as --config. The image needs Node and Docker, as a dev container does; the step fails the build with the CLI’s own message when it cannot build.
| Parameter | Type | Default |
|---|---|---|
devcontainer_dir |
str |
Returns Template
sdk/python/svm/template_helpers.py:258Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_alpine_image()
Section titled “from_alpine_image()”def from_alpine_image(self: Template, version: str='3') -> Template| Parameter | Type | Default |
|---|---|---|
version |
str |
'3' |
Returns Template
sdk/python/svm/template_helpers.py:123Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_arch_image()
Section titled “from_arch_image()”def from_arch_image(self: Template, version: str='latest') -> Template| Parameter | Type | Default |
|---|---|---|
version |
str |
'latest' |
Returns Template
sdk/python/svm/template_helpers.py:129Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_base_image()
Section titled “from_base_image()”def from_base_image(self: Template) -> TemplateUbuntu 24.04, the system the platform’s default base template runs. The catalog image itself (with Python, Node and git) is the operator’s and cannot be named by a template, so add the tools you need.
Returns Template
sdk/python/svm/template_helpers.py:132Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_bun_image()
Section titled “from_bun_image()”def from_bun_image(self: Template, version: str='1') -> Template| Parameter | Type | Default |
|---|---|---|
version |
str |
'1' |
Returns Template
sdk/python/svm/template_helpers.py:114Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_debian_image()
Section titled “from_debian_image()”def from_debian_image(self: Template, version: str='bookworm') -> Template| Parameter | Type | Default |
|---|---|---|
version |
str |
'bookworm' |
Returns Template
sdk/python/svm/template_helpers.py:120Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_fedora_image()
Section titled “from_fedora_image()”def from_fedora_image(self: Template, version: str='latest') -> Template| Parameter | Type | Default |
|---|---|---|
version |
str |
'latest' |
Returns Template
sdk/python/svm/template_helpers.py:126Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_gcp_registry()
Section titled “from_gcp_registry()”def from_gcp_registry(self: Template, image: str, secret_name: str) -> TemplateBase the template on an image in Google Artifact Registry or Container Registry. secret_name names a team secret holding _json_key:<service account key JSON>, sent to the registry as its user and password.
| Parameter | Type | Default |
|---|---|---|
image |
str |
|
secret_name |
str |
Returns Template
sdk/python/svm/template_helpers.py:137Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_node_image()
Section titled “from_node_image()”def from_node_image(self: Template, version: str='22') -> Template| Parameter | Type | Default |
|---|---|---|
version |
str |
'22' |
Returns Template
sdk/python/svm/template_helpers.py:111Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_python_image()
Section titled “from_python_image()”def from_python_image(self: Template, version: str='3.12') -> Template| Parameter | Type | Default |
|---|---|---|
version |
str |
'3.12' |
Returns Template
sdk/python/svm/template_helpers.py:108Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_template()
Section titled “from_template()”def from_template(self: Template, other: Template) -> TemplateStart from another builder’s definition: its image, registry, steps, files and commands.
| Parameter | Type | Default |
|---|---|---|
other |
Template |
Returns Template
sdk/python/svm/template_helpers.py:146Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
from_ubuntu_image()
Section titled “from_ubuntu_image()”def from_ubuntu_image(self: Template, version: str='24.04') -> Template| Parameter | Type | Default |
|---|---|---|
version |
str |
'24.04' |
Returns Template
sdk/python/svm/template_helpers.py:117Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
git_clone()
Section titled “git_clone()”def git_clone(self: Template, url: str, path: str | None=None, *, branch: str | None=None, depth: int | None=None) -> TemplateClone an HTTPS repository at build time; the URL may carry no credential.
| Parameter | Type | Default |
|---|---|---|
url |
str |
|
path |
str | None |
None |
branch |
str | None |
None |
depth |
int | None |
None |
Returns Template
sdk/python/svm/template_helpers.py:189Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
json_list()
Section titled “json_list()”Not in the Python SDK’s TemplateHelpers.
Not in the TypeScript SDK.
Not in the Go SDK.
def self.json_list(items)A JSON list written with “, “ between items, as Python’s json.dumps writes it.
| Parameter | Type | Default |
|---|---|---|
items |
sdk/ruby/lib/svm/template_helpers.rb:31Not in the Java SDK.
make_dir()
Section titled “make_dir()”def make_dir(self: Template, path: str, *, mode: str | None=None) -> Template| Parameter | Type | Default |
|---|---|---|
path |
str |
|
mode |
str | None |
None |
Returns Template
sdk/python/svm/template_helpers.py:208Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
make_symlink()
Section titled “make_symlink()”def make_symlink(self: Template, target: str, link: str) -> Template| Parameter | Type | Default |
|---|---|---|
target |
str |
|
link |
str |
Returns Template
sdk/python/svm/template_helpers.py:213Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
npm_install()
Section titled “npm_install()”def npm_install(self: Template, packages: list[str] | None=None, *, global_: bool=False, **kw: Any) -> Template| Parameter | Type | Default |
|---|---|---|
packages |
list[str] | None |
None |
global_ |
bool |
False |
kw |
Any |
optional |
Returns Template
sdk/python/svm/template_helpers.py:174Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
package_manager()
Section titled “package_manager()”Not in the Python SDK’s TemplateHelpers.
Not in the TypeScript SDK.
Not in the Go SDK.
def self.package_manager(image)The package manager of a base image, from its name: apk for Alpine (alpine:3, or a tag such as 3.12-alpine), dnf for Fedora, pacman for Arch Linux, apt-get otherwise.
| Parameter | Type | Default |
|---|---|---|
image |
sdk/ruby/lib/svm/template_helpers.rb:53Not in the Java SDK.
packages()
Section titled “packages()”Not in the Python SDK’s TemplateHelpers.
Not in the TypeScript SDK.
Not in the Go SDK.
def self.packages(list, allow_empty: false)| Parameter | Type | Default |
|---|---|---|
list |
||
allow_empty |
false |
sdk/ruby/lib/svm/template_helpers.rb:35Not in the Java SDK.
pip_install()
Section titled “pip_install()”def pip_install(self: Template, packages: list[str]) -> Template| Parameter | Type | Default |
|---|---|---|
packages |
list[str] |
Returns Template
sdk/python/svm/template_helpers.py:171Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
quote()
Section titled “quote()”Not in the Python SDK’s TemplateHelpers.
Not in the TypeScript SDK.
Not in the Go SDK.
def self.quote(word)Python’s shlex.quote: a safe word stays bare, anything else goes in single quotes.
| Parameter | Type | Default |
|---|---|---|
word |
sdk/ruby/lib/svm/template_helpers.rb:24Not in the Java SDK.
registry_of()
Section titled “registry_of()”Not in the Python SDK’s TemplateHelpers.
Not in the TypeScript SDK.
Not in the Go SDK.
def self.registry_of(image)The registry host of an image reference (Docker Hub when the first component is not a host).
| Parameter | Type | Default |
|---|---|---|
image |
sdk/ruby/lib/svm/template_helpers.rb:18Not in the Java SDK.
remove()
Section titled “remove()”def remove(self: Template, path: str, *, recursive: bool=False) -> TemplateDelete path in the image (a directory needs recursive).
| Parameter | Type | Default |
|---|---|---|
path |
str |
|
recursive |
bool |
False |
Returns Template
sdk/python/svm/template_helpers.py:231Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
rename()
Section titled “rename()”def rename(self: Template, src: str, dst: str) -> TemplateMove src to dst in the image.
| Parameter | Type | Default |
|---|---|---|
src |
str |
|
dst |
str |
Returns Template
sdk/python/svm/template_helpers.py:235Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
set_default_user()
Section titled “set_default_user()”def set_default_user(self: Template, user: str) -> TemplateRun every command, process, PTY, code run and file call a sandbox of this template gets through the SDK as user unless the call names a user of its own, as commands.run(..., user="root") does for the operator. Unlike set_user it does not change the template’s start and ready commands, so the MCP gateway (a service) keeps root while an agent in the sandbox does not and cannot approve its own tool calls. user is an account name of the image; the image must have it (create it with a run_cmd such as useradd -m agent), or every call that names no user is refused.
| Parameter | Type | Default |
|---|---|---|
user |
str |
Returns Template
sdk/python/svm/template_helpers.py:246Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
set_dev_container_start()
Section titled “set_dev_container_start()”def set_dev_container_start(self: Template, devcontainer_dir: str, command: str | None=None) -> TemplateStart the dev container in devcontainer_dir when the template starts (so it is running in the snapshot): the start command is devcontainer up --workspace-folder and --config followed by creating /devcontainer.up, and the ready command waits for that file (set_ready_cmd afterwards replaces it). With command it then runs command inside the dev container (devcontainer exec). Needs the devcontainer CLI: call dev_container_prebuild first.
| Parameter | Type | Default |
|---|---|---|
devcontainer_dir |
str |
|
command |
str | None |
None |
Returns Template
sdk/python/svm/template_helpers.py:269Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
set_user()
Section titled “set_user()”def set_user(self: Template, user: str) -> TemplateRun the following steps, and the sandbox, as user (name, uid or user:group).
| Parameter | Type | Default |
|---|---|---|
user |
str |
Returns Template
sdk/python/svm/template_helpers.py:239Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
skip_cache()
Section titled “skip_cache()”def skip_cache(self: Template) -> TemplateBuild afresh: the build cache is keyed on the definition, and this adds a one-off value to it.
Returns Template
sdk/python/svm/template_helpers.py:311Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
to_dockerfile()
Section titled “to_dockerfile()”def to_dockerfile(self: Template) -> strThe definition as a Dockerfile. from_dockerfile reads it back to the same image (in full, see svm.dockerfile.qualify_image), steps and commands, apart from COPY, USER and default_user (refused or a comment).
The builder applies a template’s environment and working directory to every RUN step, those listed before the set_envs/set_workdir call included (one environment, the last value of each variable; one directory, the last). So the Dockerfile says it the same way: the merged ENV and the last WORKDIR come right after FROM, before any RUN. USER stays where it is: it applies from its step on, as in a Dockerfile.
Returns str
sdk/python/svm/template_helpers.py:330Not in the TypeScript SDK.
Not in the Go SDK.
Not in the Ruby SDK’s TemplateHelpers.
Not in the Java SDK.
TemplateBuild
Section titled “TemplateBuild”TemplateBuild is a started build.
constructor()
Section titled “constructor()”Not in the Python SDK’s TemplateBuild.
constructor(private readonly client: SandboxClient, info: BuildInfo)| Parameter | Type | Default |
|---|---|---|
client |
SandboxClient |
|
info |
BuildInfo |
sdk/typescript/src/template.ts:164Not in the Go SDK’s TemplateBuild.
Not in the Ruby SDK’s TemplateBuild.
Not in the Java SDK’s TemplateBuild.
follow_logs()
Section titled “follow_logs()”def follow_logs(self, *, on_log: Callable[[BuildLogLine], None] | None=None, poll_seconds: float=1.0, timeout_seconds: float=2400.0, sleep: Callable[[float], None]=time.sleep, clock: Callable[[], float]=time.monotonic) -> Iterator[BuildLogLine]Yield the build’s log lines (BuildLogLine, with timestamp and stream) from the first one until the build ends (a finished build’s whole log, so it can be re-read). on_log=default_build_logger() prints them.
This is a generator: nothing is fetched, and on_log is not called, until it is iterated (for line in build.follow_logs(): or list(...)).
| Parameter | Type | Default |
|---|---|---|
on_log |
Callable[[BuildLogLine], None] | None |
None |
poll_seconds |
float |
1.0 |
timeout_seconds |
float |
2400.0 |
sleep |
Callable[[float], None] |
time.sleep |
clock |
Callable[[], float] |
time.monotonic |
Returns Iterator[BuildLogLine]
Raises TimeoutError
sdk/python/svm/templates.py:142async *followLogs(options: { onLog?: (line: BuildLogLine) => void; pollMs?: number; timeoutMs?: number } = {}): AsyncGenerator<BuildLogLine>The build’s log lines, with timestamp and stream, from the first one until the build ends; onLog: defaultBuildLogger() prints them.
| Parameter | Type | Default |
|---|---|---|
options |
{ onLog?: (line: BuildLogLine) => void; pollMs?: number; timeoutMs?: number } |
{} |
Returns AsyncGenerator<BuildLogLine>
Raises TimeoutError
sdk/typescript/src/template.ts:173func (b *TemplateBuild) FollowLogs(ctx context.Context, onLog func(BuildLogLine), timeout time.Duration) errorFollowLogs hands each log line, with its timestamp and stream, to onLog until the build is ready, failed or canceled.
| Parameter | Type | Default |
|---|---|---|
ctx |
context.Context |
|
onLog |
func(BuildLogLine) |
|
timeout |
time.Duration |
Returns error
sdk/go/template.go:424def follow_logs(on_log: nil, timeout: 2400)Hands each log line (a BuildLogLine, with timestamp and stream) to on_log until the build is ready, failed or canceled; <tt>on_log: SVM.default_build_logger</tt> prints them.
| Parameter | Type | Default |
|---|---|---|
on_log |
nil |
|
timeout |
2400 |
Raises TimeoutError
sdk/ruby/lib/svm/template.rb:437public void followLogs(Consumer<BuildLogLine> onLog, Duration timeout)Hands each log line, with its timestamp and stream, to onLog (null to only wait; Template.defaultBuildLogger() prints them) until the build is ready, failed or canceled, then refreshes it.
| Parameter | Type | Default |
|---|---|---|
onLog |
Consumer<BuildLogLine> |
|
timeout |
Duration |
Raises TimeoutException
sdk/java/src/main/java/dev/svm/sandbox/TemplateBuild.java:27id: strProperty (read-only).
id: stringProperty (read-only).
ID: stringProperty.
def idsdk/ruby/lib/svm/template.rb:431public String id()Returns String
sdk/java/src/main/java/dev/svm/sandbox/TemplateBuild.java:17info()
Section titled “info()”Not in the Python SDK’s TemplateBuild.
info: BuildInfoProperty.
Info: map[string]anyProperty.
infoProperty (read-only).
public Map<String, Object> info()Returns Map<String, Object>
sdk/java/src/main/java/dev/svm/sandbox/TemplateBuild.java:18initialize()
Section titled “initialize()”Not in the Python SDK’s TemplateBuild.
Not in the TypeScript SDK’s TemplateBuild.
Not in the Go SDK’s TemplateBuild.
def initialize(client, info)| Parameter | Type | Default |
|---|---|---|
client |
||
info |
sdk/ruby/lib/svm/template.rb:430Not in the Java SDK’s TemplateBuild.
refresh()
Section titled “refresh()”def refresh(self) -> BuildInfoReturns BuildInfo
sdk/python/svm/templates.py:135async refresh(): Promise<BuildInfo>Returns Promise<BuildInfo>
sdk/typescript/src/template.ts:167func (b *TemplateBuild) Refresh(ctx context.Context) (map[string]any, error)Refresh reads the build’s current state.
| Parameter | Type | Default |
|---|---|---|
ctx |
context.Context |
Returns (map[string]any, error)
sdk/go/template.go:415def refreshsdk/ruby/lib/svm/template.rb:433public Map<String, Object> refresh()Returns Map<String, Object>
sdk/java/src/main/java/dev/svm/sandbox/TemplateBuild.java:21status()
Section titled “status()”Not in the Python SDK’s TemplateBuild.
Not in the TypeScript SDK’s TemplateBuild.
Not in the Go SDK’s TemplateBuild.
Not in the Ruby SDK’s TemplateBuild.
public String status()Returns String
sdk/java/src/main/java/dev/svm/sandbox/TemplateBuild.java:19TemplateInfo
Section titled “TemplateInfo”TemplateInfo is a template as Templates.List returns it.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
build_status |
str | None |
|
latest_build_id |
str | None |
|
mcp_servers |
list[dict[str, Any]] |
|
name |
str |
|
tags |
list[str] |
|
template_id |
str |
|
visibility |
str |
| Property | Type | Description |
|---|---|---|
buildStatus |
string |
|
latestBuildId |
string |
|
mcpServers |
Array<Record<string, unknown>> |
The MCP servers every sandbox of the template runs (the contract’s McpServerConfig entries); only on your own templates. |
name |
string |
|
tags |
string[] |
|
templateId |
string |
|
visibility |
"private" | "public" | "system" |
| Property | Type | Description |
|---|---|---|
BuildStatus |
string |
|
LatestBuildID |
string |
|
MCPServers |
[]map[string]any |
MCPServers are the MCP servers every sandbox of the template runs (the contract’s McpServerConfig entries); only on your own templates. |
Name |
string |
|
Tags |
[]string |
|
TemplateID |
string |
|
Visibility |
string |
| Property | Type | Description |
|---|---|---|
build_status |
||
latest_build_id |
||
mcp_servers |
||
name |
||
tags |
||
template_id |
||
visibility |
| Property | Type | Description |
|---|---|---|
buildStatus |
String |
The newest build’s id and status; null before the first build. |
latestBuildId |
String |
The newest build’s id and status; null before the first build. |
mcpServers |
List<Map<String, Object>> |
The MCP servers every sandbox of the template runs (the contract’s McpServerConfig entries); empty when it has none. |
name |
String |
|
tags |
List<String> |
The template’s tags (empty when it has none). |
templateId |
String |
|
visibility |
String |
initialize()
Section titled “initialize()”Not in the Python SDK’s TemplateInfo.
Not in the TypeScript SDK’s TemplateInfo.
Not in the Go SDK’s TemplateInfo.
def initialize(*args)| Parameter | Type | Default |
|---|---|---|
*args |
optional |
sdk/ruby/lib/svm/template.rb:405Not in the Java SDK’s TemplateInfo.
Not in the Python SDK’s TemplateInfo.
Not in the TypeScript SDK’s TemplateInfo.
Not in the Go SDK’s TemplateInfo.
Not in the Ruby SDK’s TemplateInfo.
public Map<String, Object> raw()Every field the API returned.
Returns Map<String, Object>
sdk/java/src/main/java/dev/svm/sandbox/TemplateInfo.java:36BuildInfo
Section titled “BuildInfo”Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
build_id |
str |
|
digest |
str | None |
|
reason |
str | None |
|
status |
str |
|
template_id |
str |
|
upload_url |
str | None |
| Property | Type | Description |
|---|---|---|
buildId |
string |
|
digest |
string |
|
reason |
string |
|
status |
string |
|
templateId |
string |
|
uploadUrl |
string |
Not in the Go SDK.
Not in the Ruby SDK.
Not in the Java SDK.
BuildLogLine
Section titled “BuildLogLine”One line of a build’s log: timestamp (RFC 3339), stream (stdout, stderr or system, when known) and the text. str(line) is the text.
line()
Section titled “line()”line: strProperty (read-only).
line: stringProperty.
Line: stringProperty.
lineProperty.
public String line()Returns String
sdk/java/src/main/java/dev/svm/sandbox/BuildLogLine.java:15stream()
Section titled “stream()”stream: str | NoneProperty (read-only).
stream: stringProperty.
Stream: stringProperty.
streamProperty.
public String stream()Returns String
sdk/java/src/main/java/dev/svm/sandbox/BuildLogLine.java:17timestamp()
Section titled “timestamp()”timestamp: str | NoneProperty (read-only).
timestamp: stringProperty.
Timestamp: stringProperty.
timestampProperty.
public String timestamp()Returns String
sdk/java/src/main/java/dev/svm/sandbox/BuildLogLine.java:16DockerfileError
Section titled “DockerfileError”A Dockerfile uses something a template cannot represent.
Properties
Section titled “Properties”Python exposes these as methods; see below.
| Property | Type | Description |
|---|---|---|
line |
number |
| Property | Type | Description |
|---|---|---|
Line |
int |
|
Message |
string |
Ruby exposes these as methods; see below.
Not in the Java SDK.
constructor()
Section titled “constructor()”Not in the Python SDK’s DockerfileError.
constructor(readonly line: number, message: string)| Parameter | Type | Default |
|---|---|---|
line |
number |
|
message |
string |
sdk/typescript/src/dockerfile.ts:7Not in the Go SDK’s DockerfileError.
Not in the Ruby SDK’s DockerfileError.
Not in the Java SDK.
error()
Section titled “error()”Not in the Python SDK’s DockerfileError.
Not in the TypeScript SDK’s DockerfileError.
func (e *DockerfileError) Error() stringReturns string
sdk/go/dockerfile.go:16Not in the Ruby SDK’s DockerfileError.
Not in the Java SDK.