AgentClient is the low-level raw transport for talking to agentd through a running sandbox’s relay socket. Most applications should use Sandbox, Exec, and filesystem helpers instead. Use this API when you are building protocol-level tools or higher-level SDK helpers.
All request bodies and response bodies are raw CBOR bytes. The SDK handles framing and correlation ids, but it does not encode or decode the CBOR message body for you.
The raw body is the full CBOR-encoded protocol Message body: v, t, and p. It is not just the inner payload.
Constants
| Name | Type | Description |
|---|---|---|
FlagTerminal / FLAG_TERMINAL | uint8 | Last frame for a correlation id |
FlagSessionStart / FLAG_SESSION_START | uint8 | First frame of a streaming session |
FlagShutdown / FLAG_SHUTDOWN | uint8 | Shutdown frame |
ConnectAgentSandbox()
ConnectAgentPath()
Request()
Stream()
Send()
AgentStream.ID().
ReadyBytes()
core.ready frame body as CBOR bytes.
Close()
CloseCtx()
RawFrame
ID is the protocol correlation id, Flags is the frame flag byte, and Body is the CBOR-encoded protocol message body.
AgentStream
ID() returns the protocol correlation id. Pass it to AgentClient.Send() for follow-up frames in the same session. Next() returns nil, nil at EOF.