Expand description
JSONL framing, JSON-RPC 2.0 types, RPC command/response/event types, and serialization helpers.
Structs§
- Command
Info - Command info for get_commands response
- Compaction
Result - Result of compaction
- Image
Data - Image data for RPC commands
- Json
RpcError - JSON-RPC 2.0 error object
- Json
RpcError Response - JSON-RPC 2.0 error response
- Json
RpcRequest - JSON-RPC 2.0 request
- Json
RpcSuccess Response - JSON-RPC 2.0 success response
- Jsonl
Line Reader - A strict JSONL line reader that splits on LF only (not CR or other separators). This is important because JSON strings may contain U+2028/U+2029 which Node.js readline would incorrectly split on.
- Model
Info - Model information for session state
- Pending
Extension Request - Tracks pending extension UI requests awaiting client responses.
- RpcImage
Source - Base64-encoded image data
- RpcOutput
- Thread-safe output writer that ensures atomic JSONL writes.
- Session
Handoff - Information about a session for handoff between processes.
- Session
State - Session state for get_state response
- Session
Stats - Result of a session stat query
- Source
Info - Source info for command provenance
Enums§
- RpcCommand
- RPC command from client
- RpcEvent
- Events emitted by the RPC server to the client during streaming.
- RpcExtension
UiRequest - Extension UI request
- RpcExtension
UiResponse - Extension UI response from client
- RpcResponse
- RPC response to client
Constants§
- JSONRPC_
INTERNAL_ ERROR - JSON-RPC internal error code.
- JSONRPC_
INVALID_ PARAMS - JSON-RPC invalid params error code.
- JSONRPC_
INVALID_ REQUEST - JSON-RPC invalid request error code.
- JSONRPC_
METHOD_ NOT_ FOUND - JSON-RPC method-not-found error code.
- JSONRPC_
PARSE_ ERROR - JSON-RPC parse error code.
Functions§
- jsonrpc_
to_ command - Map a JSON-RPC 2.0 method + params to an internal RPC command value.
- parse_
json_ line - Parse a JSONL line, trimming any trailing CR.
- rpc_
response_ to_ jsonrpc - Convert an internal RpcResponse to a JSON-RPC 2.0 response.
- serialize_
json_ line - Serialize a value as a strict JSONL record (JSON + LF).
- serialize_
json_ line_ obj - Serialize a serializable value as a JSONL record.