//! Shared agent state: sysinfo handles and hot JSON cache. use std::sync::atomic::AtomicUsize; use std::sync::Arc; use sysinfo::System; use tokio::sync::{Mutex, Notify, RwLock}; pub type SharedSystem = Arc>; #[derive(Clone)] pub struct AppState { // Persistent sysinfo handles pub sys: SharedSystem, // Last serialized JSON snapshot for fast WS responses pub last_json: Arc>, // Adaptive sampling controls pub client_count: Arc, pub wake_sampler: Arc, pub auth_token: Option, }