Add is_online/is_persistent for persistent agent sessions

- Sessions now track whether agent is online or offline
- Persistent agents (no support code) stay in session list when disconnected
- Dashboard shows online/offline status with color indicator
- Connect/Chat buttons disabled when agent is offline
- Agent reconnection reuses existing session
This commit is contained in:
2025-12-28 17:52:26 -07:00
parent 3c2e0708ef
commit 1cc94c61e7
4 changed files with 81 additions and 8 deletions

View File

@@ -18,6 +18,8 @@ pub struct SessionInfo {
pub started_at: String,
pub viewer_count: usize,
pub is_streaming: bool,
pub is_online: bool,
pub is_persistent: bool,
pub last_heartbeat: String,
pub os_version: Option<String>,
pub is_elevated: bool,
@@ -34,6 +36,8 @@ impl From<crate::session::Session> for SessionInfo {
started_at: s.started_at.to_rfc3339(),
viewer_count: s.viewer_count,
is_streaming: s.is_streaming,
is_online: s.is_online,
is_persistent: s.is_persistent,
last_heartbeat: s.last_heartbeat.to_rfc3339(),
os_version: s.os_version,
is_elevated: s.is_elevated,