Expand description
The length-prefixed stdio handshake that precedes the WebSocket session.
Everything else in this protocol is protobuf-JSON, but the very first exchange is binary protobuf on the harness’s stdin/stdout:
client -> harness u32le length, then a serialised InputConfig
harness -> client u32le length, then a serialised OutputConfigOutputConfig carries the loopback port the harness just bound and the
per-process API key the WebSocket upgrade must present. Two messages, seven
fields between them, so this module hand-rolls the wire format rather than
taking a protobuf runtime dependency for it — see
scripts/codegen_antigravity.py for why a runtime is otherwise unnecessary.
The field numbers below are pinned by the descriptor snapshot in
tests/schemas/localharness.descriptor.bin, and this module’s tests lock them
against
bytes captured from a live 0.1.10 harness.
Enums§
- Decode
Error - A malformed handshake reply.
Functions§
- decode_
output_ config - Parses the
OutputConfigthe harness writes to stdout. - encode_
input_ config - Serialises an
InputConfigto binary protobuf, fields in tag order. - frame
- Prefixes a serialised message with its length, as the harness expects.