app/network_transport.h

the pipe between a board and its remote peer.

Networked play (docs/networked-play-docs/PLAN.md) reuses the existing engine-vs-human loop with the opponent swapped for a socket. INetworkTransport is that socket, abstracted so the opponent seam (NetworkOpponent) stays frontend-agnostic and unit-testable with a fake — exactly like IEngine / IBoardBackend. The concrete implementation is a WebSocket client to the game relay (a Cloudflare Durable Object); see PLAN.md §5 and §7.

Only the move-carrying surface lives here. Matchmaking, connection lifecycle, and control messages (color assignment, resign, resync) layer on top as that work lands; this is deliberately the minimum the play loop needs.

namespace kirin
class INetworkTransport
#include <network_transport.h>

Public Functions

virtual ~INetworkTransport() = default
virtual void sendMove(const std::string &uci) = 0
virtual std::optional<std::string> awaitRemoteMove() = 0
virtual void cancelAwait() = 0