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
//! ATM Daemon - Session registry and broadcast server
//!
//! This crate provides the core infrastructure for the ATM daemon:
//! - `registry` - Session registry actor for tracking Claude Code sessions
//! - `server` - Unix socket server for client connections
//! - `monitor` - Process monitoring for CPU/memory tracking
//!
//! # Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │ atmd daemon │
//! ├─────────────────────────────────────────────────────────────┤
//! │ │
//! │ ┌─────────────────┐ ┌─────────────────────────────┐ │
//! │ │ DaemonServer │────▶│ RegistryActor │ │
//! │ │ (Unix Socket) │ │ (session state owner) │ │
//! │ └────────┬────────┘ └──────────────┬──────────────┘ │
//! │ │ │ │
//! │ │ connections │ events │
//! │ ▼ ▼ │
//! │ ┌─────────────────┐ ┌─────────────────────────────┐ │
//! │ │ConnectionHandler│ │ broadcast::Sender │ │
//! │ │ (per client) │ │ (event distribution) │ │
//! │ └─────────────────┘ └─────────────────────────────┘ │
//! │ │
//! └─────────────────────────────────────────────────────────────┘
//! ```
//!
//! # Panic-Free Guarantees
//!
//! All production code in this crate follows the panic-free policy from CLAUDE.md:
//! - No `.unwrap()`, `.expect()`, `panic!()`, `unreachable!()`, `todo!()`
//! - All fallible operations return `Result` or `Option`
//! - Channel operations handle closure gracefully