Protocol#
One WebSocket between the UI and a station; every message is a JSON object with a
type. The source of truth for shapes is the JSON Schema
protocol/schema/paperboat-0.schema.json ($defs/toUI, $defs/toStation);
protocol/README.md explains each message, and the web app’s types
(paperboat-shared/src/protocol.ts) are generated from the schema (npm run gen:protocol). A
station on the engine speaks it already.
Message Quick Reference#
Category |
Message Type |
Role & Payload |
|---|---|---|
Handshake & Starters |
|
Engine metadata, protocol version, and station view hints on connect. |
|
Declarations of available blocks and station object templates. |
|
|
Starter flow graph topology (nodes, edges, groups). |
|
|
Starter station equipment list and physical properties. |
|
|
Complete visual geometry entities and initial camera view. |
|
Live Telemetry & State |
|
Confirmation of run launch with unique execution identifier. |
|
Streaming telemetry sample emitted by a Monitor block ( |
|
|
Samples taken faster than every 30 ms, batched into one message ( |
|
|
Lightweight differential entity updates (positions, rotations, colors). |
|
|
Block lifecycle ( |
|
|
A point of a series off the run clock (a residual against its iteration). |
|
|
A monitor’s state changed ( |
|
|
A live picture: 2D shapes and/or a small field image. |
|
|
Fractional execution progress (0.0 to 1.0) towards duration. |
|
|
Diagnostic console messages ( |
|
|
Terminal completion status ( |
|
Client Commands |
|
Execute the flow with current graph topology and station overrides. |
|
Update physical object property values edited on the Station page. |
|
|
Abort the running simulation loop immediately. |
|
|
Change the speed of the run in progress; the station answers with |
|
|
Forward key and board-control down/up events to |
Station → UI#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UI → Station#
|
|
|
|
|
— |
|
|
|
|
|
|
Over HTTP, on the same port, a station with a web station serves its page’s folder and
/paperboat/station.js (The Station).