Skip to main content

Module rpc

Module rpc 

Source
Expand description

The pi --mode rpc command protocol: JSON objects on stdin (one per line, LF-delimited), {"type":"response",...} acknowledgements and streamed events on stdout.

Framing contract (from docs/rpc.md): split records on \n ONLY, tolerate a trailing \r — never use a splitter that also breaks on U+2028/U+2029, which are legal inside JSON strings.

Structs§

AgentState
Typed view of get_state response data.
BashResult
Typed view of bash response data.
ImageContent
An image attached to a prompt/steer/follow_up command.
Messages
Typed view of get_messages response data.
RpcResponse
The {"type":"response"} acknowledgement for one command.

Enums§

InputDisposition
What pi did with a submitted prompt/steer/follow_up input (RpcResponse::disposition, pi ≥ 0.99.0). It describes the submitted input only — not independent work an extension started, and not a guarantee of completion or that a queued message stays queued.
RpcCommand
A client → agent command. Serializes with the wire’s type tag; the optional id correlates the matching RpcResponse.
StreamingBehavior
How a prompt sent mid-stream should queue.