Skip to main content

Module state

Module state 

Source
Expand description

state.* method types — endpoint health snapshot + push notifications.

Drives the Client App’s “Health” tab (SPEC §2.1 use case 2): BitLocker / AV signature / OS-patch / cert-expiry / disk-free / agent-self-update + arbitrary additional compliance checks. The snapshot is computed agent-side on demand (state.snapshot) and pushed when underlying checks flip via state.changed.

Structs§

Check
One compliance check result. name is the stable id (used as React key + analytics label); status drives the row’s color; detail is human-readable text for the row body. troubleshoot is the optional Manifest.id of the job whose execute button fixes this check — None means the check has no auto-remediation.
StateChangedParams
Push payload for state.changed. Pushed by the agent when one or more compliance checks flip status, or when online / vpn / agent_version change. A full StateSnapshot is included so the client doesn’t need a second round-trip — the push is strictly idempotent: applying a state.changed payload onto the client’s cached snapshot is a no-op replace, not a diff merge.
StateSnapshot
Full state bundle — the SPA renders this verbatim on the Health tab. SPEC §2.12.8’s complete-conversation example pins the shape:
StateSnapshotParams
state.snapshot takes no params.
StateSubscribeParams
state.subscribe takes no params.
StateSubscribeResult
state.subscribe returns an opaque subscription handle. The client passes it back to state.unsubscribe to stop the push stream; SPEC §2.12.7 says subscriptions are auto-cleaned on disconnect, so a well-behaved client never needs to remember these across reconnects.
StateUnsubscribeParams
state.unsubscribe params.

Enums§

CheckStatus
Four-state result mirroring the SPA’s color palette: ok = green, warn = yellow, fail = red, unknown = grey. Wire-encoded as snake_case ("ok" / "warn" / "fail" / "unknown") — the PascalCase convention is reserved for super::error::ErrorKind where SPEC §2.12.9 specifically pins it.