pub enum AgentRequest {
Show 20 variants
Ping,
Pull {
image: String,
oci_platform: Option<String>,
auth: Option<RegistryAuth>,
},
Query {
image: String,
},
ListImages,
GarbageCollect {
dry_run: bool,
purge_all: bool,
},
PrepareOverlay {
image: String,
workload_id: String,
},
CleanupOverlay {
workload_id: String,
},
FormatStorage,
StorageStatus,
NetworkTest {
url: String,
},
Shutdown,
ExportLayer {
image_digest: String,
layer_index: usize,
},
VmExec {
command: Vec<String>,
env: Vec<(String, String)>,
workdir: Option<String>,
timeout_ms: Option<u64>,
interactive: bool,
tty: bool,
background: bool,
},
Run {
image: String,
command: Vec<String>,
env: Vec<(String, String)>,
workdir: Option<String>,
user: Option<String>,
mounts: Vec<(String, String, bool)>,
timeout_ms: Option<u64>,
interactive: bool,
tty: bool,
detached: bool,
persistent_overlay_id: Option<String>,
background: bool,
},
Stdin {
data: Vec<u8>,
},
Resize {
cols: u16,
rows: u16,
},
FileWrite {
path: String,
data: Vec<u8>,
mode: Option<u32>,
},
FileWriteBegin {
path: String,
mode: Option<u32>,
total_size: u64,
},
FileWriteChunk {
data: Vec<u8>,
done: bool,
},
FileRead {
path: String,
},
}Expand description
Agent request types (for image management and OCI operations).
Variants§
Ping
Ping to check if agent is alive.
Pull
Pull an OCI image and extract layers.
Fields
auth: Option<RegistryAuth>Optional registry authentication credentials.
Query
Query if an image exists locally.
ListImages
List all cached images.
GarbageCollect
Run garbage collection on unused layers.
Fields
PrepareOverlay
Prepare overlay rootfs for a workload.
CleanupOverlay
Clean up overlay rootfs for a workload.
FormatStorage
Format the storage disk (first-time setup).
StorageStatus
Get storage disk status.
NetworkTest
Test network connectivity directly from the agent (not via chroot). Used to debug TSI networking.
Shutdown
Shutdown the agent.
ExportLayer
Export a layer as a tar archive.
Used by smolvm pack to extract OCI layers for packaging.
The agent streams the layer tar data back via LayerData responses.
VmExec
Execute a command directly in the VM (not in a container).
This runs the command in the agent’s Alpine rootfs without any container isolation. Useful for VM-level operations and debugging.
Fields
Run
Run a command in an image’s rootfs.
This prepares an overlay, chroots into it, and executes the command. Returns stdout, stderr, and exit code when the command completes.
Fields
mounts: Vec<(String, String, bool)>Volume mounts to bind into the container. Each tuple is (virtiofs_tag, container_path, read_only).
timeout_ms: Option<u64>Timeout in milliseconds. If the command exceeds this duration, it will be killed and return exit code 124.
interactive: boolInteractive mode - stream I/O instead of buffering. When true, output is streamed via Stdout/Stderr responses, and stdin can be sent via the Stdin request.
tty: boolAllocate a pseudo-TTY for the command. Enables terminal features like colors, line editing, and signal handling.
detached: boolDetached mode — start the container and return immediately with the
container ID. Only meaningful when persistent_overlay_id is set.
Returns a Completed response with stdout containing the container ID.
Stdin
Send stdin data to a running interactive command.
Resize
Resize the PTY window (for TTY mode).
FileWrite
Write a file inside the VM in a single message.
Use only for files up to FILE_WRITE_SINGLE_SHOT_MAX. Larger
files must stream via Self::FileWriteBegin +
Self::FileWriteChunk to avoid exceeding MAX_FRAME_SIZE
after base64 + JSON inflation.
Fields
FileWriteBegin
Open a streaming file upload session on this connection.
Must be followed by one or more Self::FileWriteChunk
requests. The final chunk sets done: true to finalize.
Dropping the connection (or sending any non-chunk request)
before done aborts the session and leaves no partial file
at path.
Sessions are per-connection — one session at a time.
Fields
total_size: u64Expected total size in bytes. Rejected if it exceeds
FILE_TRANSFER_MAX_TOTAL. The agent uses this for an
early-fail check only; the actual size written is the sum
of chunk byte lengths.
FileWriteChunk
Append a chunk to the currently open streaming upload.
If done is true, the agent fsyncs and atomically renames the
staging file onto the target path.
Fields
data: Vec<u8>Chunk bytes. Typically FILE_WRITE_CHUNK_SIZE except
for the last chunk.
FileRead
Read a file from the VM.
Trait Implementations§
Source§impl Clone for AgentRequest
impl Clone for AgentRequest
Source§fn clone(&self) -> AgentRequest
fn clone(&self) -> AgentRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more