zc2 0.0.25

P2P compute broker with credit-based billing, WAL, and broker mesh support
//! Data sources feeding the unified dashboard.
//!
//! Phase 1 of the terminal refactor (see `docs/TERMINAL_REFACTOR.md`).
//!
//! A [`DataSource`] produces a normalized [`Snapshot`] on demand. The local
//! broker and the remote attach mode each implement it, so the renderer never
//! needs to know which one it is talking to.

#![allow(dead_code)]
// `LocalSource`/`RemoteSource`/`RemoteShared` are re-exported for later phases
// and the cutover; suppress unused-import noise until all are consumed.
#![allow(unused_imports)]

pub mod local;
pub mod remote;

use crate::tui::views::snapshot::Snapshot;

pub use local::LocalSource;
pub use remote::{RemoteShared, RemoteSource};

/// A source of dashboard data.
pub trait DataSource: Send {
    /// Produce a fresh snapshot. Must be non-blocking — it runs on the render
    /// path every frame.
    fn snapshot(&self) -> Snapshot;

    /// Request an out-of-band refresh (e.g. the `r` key in remote mode).
    /// Default is a no-op for sources that are always live.
    fn request_refresh(&self) {}
}