Skip to main content

Crate hrdr_protocol

Crate hrdr_protocol 

Source
Expand description

Wire types for hrdr’s web protocol. The server and every client (browser WASM, a native webview) share this crate so the WS frames and REST payloads are a single source of truth.

This crate is kept wasm32-clean on purpose: it depends only on serde, so it compiles in the browser (where hrdr-agent with its tokio/reqwest/zstd deps cannot).

Structs§

PaneTranscript
ServerFrame
Every server frame carries a global sequence number.
WireDiffLine
WireEntry
Byte-for-byte the JSON of hrdr_agent::Entry: flat kind/data + unix time.
WireEntryView
Server-computed display model that rides beside an entry.
WireGauge
WirePane
Snapshot of one pane’s chrome (list row + status-bar inputs live here).
WireStatus
Pre-built status bar (server ran hrdr_app::status_sections).
WireStatusRun
WireStatusSeg
WireTodo
WireToolDisplay
WireTurn
A snapshot of one pane’s turn clock. Not the agent’s live TurnStats (which holds Instant/SystemTime — not serde, not WASM), but the derived numbers the frontend needs.

Enums§

ClientMsg
InputSetMode
ServerMsg
WireCtxLevel
WireDiffLineKind
WireEntryKind
Matches hrdr_agent::EntryKind’s serde shape exactly. This is the one exception to “struct variants only” — it must mirror the externally-shaped serde, newtype variants included, so the round-trip test passes.
WirePaneId
Which conversation a message concerns. Mirrors hrdr_agent::PaneId. External tagging on purpose: serializes as "main" or {"sub": 7}.
WirePaneStatus
WireStatusRole
WireToolBody