AgentClient is the low-level transport for talking to agentd through a running sandbox’s relay socket. Most applications should use Sandbox, exec, and fs instead. Use AgentClient when you are building a protocol-level integration or an SDK layer.
The Rust client has two tiers:
- Typed methods encode and decode microsandbox protocol messages for you.
- Raw methods move framed CBOR bytes without decoding the message body.
Message body: v, t, and p. It is not just the inner payload.
connect()
core.ready frame, and starts one background reader task.
agent::connect_sandbox()
request()
stream()
send() for follow-up messages such as stdin, resize, signal, or file data chunks.
The receiver yields messages until a terminal frame is delivered or the connection closes.
send()
request_raw()
stream_raw()
send_raw()
ready()
core.ready payload from the handshake.
ready_bytes()
core.ready frame body as CBOR bytes.
close()
RawFrame
id is the protocol correlation id, flags is the frame flag byte, and body is the CBOR-encoded protocol message body.