Skip to main content

Module broadcast

Module broadcast 

Expand description

The process-wide observability event bus.

BroadcastObserver turns ObserverEvents into the JSON frames that /api/events (SSE) and RPC logs/subscribe deliver, and keeps the most recent ones in an EventBuffer for history replay (/api/events/history, RPC events/history). EventBus bundles the live sender with that buffer. The daemon owns one bus and installs its observer as the global broadcast hook exactly once, so agent, tool, and LLM frames reach RPC subscribers whether or not the gateway runs; a standalone gateway builds and installs its own.

Structs§

BroadcastObserver
EventBuffer
Thread-safe ring buffer that retains recent events for history replay.
EventBus
The live event sender plus its history buffer.

Constants§

EVENT_CHANNEL_CAPACITY
Frames the live broadcast channel holds for slow subscribers.
EVENT_HISTORY_CAPACITY
Frames retained for history replay.

Functions§

history_events
Buffered frames that may be replayed, oldest first.
is_public_event
Whether a frame may be delivered on a public, non-session stream: every observer frame (tagged source = "observability"), plus any frame that is not scoped to a session.