Expand description
Cloud push subscription — replaces per-agent polling with a single sidecar-level WebSocket to muxbus.agentmux.ai.
When MUXBUS_TOKEN is present, the subscriber:
- Opens wss://muxbus.agentmux.ai/ws with the bearer token.
- Listens for { type: “inject_available” } broadcast wake signals (zero metadata).
- On each signal, polls REST GET /reactive/pending/:id for every locally-registered agent.
- Delivers via ReactiveHandler; ACKs successful deliveries via REST POST /reactive/ack.
- Reconnects with exponential back-off on any disconnect.
The server broadcasts to ALL connected sidecars on every injection, so a subscriber cannot correlate the signal to any particular agent, account, or timing.
Agents register/unregister via add_agent()/remove_agent(). No MUXBUS_TOKEN → subscriber stays idle.
Structs§
Enums§
Constants§
Statics§
Functions§
- connect_
and_ 🔒run - get_
global_ subscriber - handle_
server_ 🔒msg - Handle a message from the cloud server. The WS wake signal carries zero metadata — the sidecar polls all its registered agents via REST to find pending injections, so a compromised subscriber gains nothing.
- load_
valid_ 🔒token - Load a valid (non-expired) access token, refreshing via refresh_token if needed. Saves refreshed credentials back to the store. Returns None if no credentials are stored, the token is expired and refresh fails, or the refresh_token is absent.
- run_
loop 🔒