Protocol v1 is UTF-8 NDJSON over stdin/stdout. Each line contains exactly one request or response. Standard error is never part of the protocol.
- Client sends
hellowithprotocol_version = 1. - Host responds with its version and capabilities.
- Client creates one surface.
- Client submits monotonically increasing frame identifiers.
- Client sends
shutdownand waits forack.
Only one surface is supported in the first implementation. The identifiers and message shape already allow multiple surfaces in a later host release.
Frames contain an ordered commands array. Supported v1 operations are:
backgroundfill,stroke,no_fill,no_strokestroke_weightcircle,ellipse,rect,line
Coordinates and dimensions are 32-bit floating-point values in renderer pixels. Colors use normalized RGBA channels from 0 through 1. Dimensions cannot be negative and all floating-point values must be finite.
Errors are ordinary responses:
{"type":"error","code":"invalid_state","message":"frame requires an active surface"}Expected codes in v1:
invalid_jsoninvalid_requestinvalid_stateunsupported_protocolunknown_surfacerenderer_errormessage_too_large
An error does not terminate the host unless the client subsequently requests shutdown or the transport closes.
NDJSON is the control-plane and correctness format. Before large drawings or pixel transfer are supported, the protocol will add negotiated binary frame payloads. A frame remains the unit of batching and acknowledgement so clients never send one IPC message per primitive.