Expand description
Bounded typed HTTP/1.1 client for the local Gate4Agent C2 observer API.
Structs§
- C2Client
- C2Control
Handle - C2Event
Receiver - C2Pending
Request - C2Reconnecting
Event Receiver - The event stream for a reconnecting connection. Backed by two bridge
channels created once, before the first physical connection, that only
close when the supervisor itself terminates – a reconnect is invisible
to it. The two channels mirror the split
C2EventReceiveralready carries per physical connection (regular events vs. harness_mcp read-proxy events), so a caller that wants harness_mcp events served ahead of a regular-event backlog can drain them independently instead of going through the mergedrecv(). - C2Reconnecting
Handle - Swappable, never-closing counterpart to
C2ControlHandle. Every accessor clones or reads out of awatchcell a background supervisor mutates on reconnect; no caller ever holds a handle bound to one specific physical connection, so a relay restart never permanently breaks it. - Drain
Client - Drain
Session - HqWg
Allowed Ip - One allowed IP. HQ accepts only the host route of the C2 tunnel address.
- HqWg
Client Config - HQ-side client configuration. Listen port must be 0.
- HqWg
Peer - The single C2 peer HQ dials.
Enums§
- C2Client
Error - C2Connection
Loss Reason - Why
control_ownertore its connection down, attached to every request still pending at that moment (C2ControlError::ConnectionLost). Logged once at the teardown point instead of being silently swallowed. - C2Control
Error - C2Link
State - Whether the harness’s own dedicated C2 control connection is live right now or being re-established after a loss.
- Drain
Error - HqWg
Client Error
Functions§
- bring_
up_ hq_ wireguard - Creates the HQ interface with kernel WireGuard and installs a route only
to the C2 tunnel address. A failed
ip link add type wireguardis returned asHqWgClientError::InterfaceCreatewith no other transport substituted. - connect_
core_ operator - Dial the core operator control socket (A2). Same wire as the former C2 control endpoint; the socket now lives on hatchery-server, not on C2.
- connect_
core_ operator_ reconnecting - Dial a reconnecting core operator control socket (A2).
Connects to a local
gate4agent-c2control endpoint the same wayconnect_localdoes – a dead endpoint at boot still fails fast with the identical error, unchanged – then hands the connection to a background supervisor that keeps it alive for as long as the returned handle (or its event receiver) is held. - connect_
local - connect_
local_ reconnecting - Connects to a local
gate4agent-c2control endpoint the same wayconnect_localdoes – a dead endpoint at boot still fails fast with the identical error, unchanged – then hands the connection to a background supervisor that keeps it alive for as long as the returned handle (or its event receiver) is held. - connect_
tunnel_ reconnecting - Same supervisor as
connect_local_reconnecting, dialing the tunnel TCP control port instead of the unix socket. Unix reconnect is unchanged. - connect_
tunnel_ tcp - Dials the C2 control frame protocol over TCP.