Streaming decoder state machine for TCP/Serial transports.
Handles the resync algorithm per protocol.md §2 to recover from garbage on the wire. Thread-safe by virtue of being stateless; each decoder owns its state.
Feed a single byte into the decoder.
Feed a byte array, yielding all complete frames.
Reset the decoder to initial state (e.g., on disconnect).