1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Process-wide runtime-change events for the GUI dashboard.
//!
//! GUI pages read in-memory registries (running agents, non-agent LLM calls,
//! live transcript snapshots) and the voice pipeline status at render time —
//! there is no poll loop. When a mutation touches any of those in-memory
//! sources it broadcasts a [`RuntimeEvent`] here and the dashboard re-renders
//! on delivery. Emit sites are fire-and-forget; the receiver (the GUI) owns a
//! coalescing stream so a burst of mutations settles into a single re-render.
use OnceLock;
/// A GUI-relevant in-memory runtime source changed.
pub
/// Process-wide broadcast of runtime-change events.
pub static RUNTIME_EVENTS: =
new;
/// Initialise the runtime-change broadcast before the iced application runs
/// (same convention as [`crate::gui::LOG_BROADCAST`]) so the dashboard's
/// subscription always has a source — an uninitialized sender would end the
/// subscription stream on its first poll. Idempotent; called from `main`
/// via the [`crate::gui`] warm-up façade.
pub
/// Broadcast a runtime-change event. Best-effort: when the channel is not yet
/// initialised (tests / headless runs) this is a no-op.
pub