Move ChannelLog to src/thalamus/channel_log.rs — shared by all channel daemon implementations. Each channel/PM gets its own log with consumed/unread tracking. IRC daemon: channels tracked via BTreeMap<String, ChannelLog>. list() returns all channels (joined + PMs) with per-channel unread counts. Sent messages stored in logs too. Co-Developed-By: Kent Overstreet <kent.overstreet@linux.dev>
30 lines
780 B
Rust
30 lines
780 B
Rust
// thalamus/ — universal notification routing and channel infrastructure
|
|
//
|
|
// Contains the shared daemon protocol, notification system, channel
|
|
// client/supervisor, and utility helpers used by both Claude-specific
|
|
// code (in claude/) and the future substrate-independent consciousness
|
|
// binary.
|
|
|
|
pub mod channel_log;
|
|
pub mod channels;
|
|
pub mod idle;
|
|
pub mod supervisor;
|
|
pub mod notify;
|
|
|
|
pub mod daemon_capnp {
|
|
include!(concat!(env!("OUT_DIR"), "/schema/daemon_capnp.rs"));
|
|
}
|
|
|
|
use std::path::PathBuf;
|
|
use std::time::{SystemTime, UNIX_EPOCH};
|
|
|
|
pub fn now() -> f64 {
|
|
SystemTime::now()
|
|
.duration_since(UNIX_EPOCH)
|
|
.unwrap()
|
|
.as_secs_f64()
|
|
}
|
|
|
|
pub fn home() -> PathBuf {
|
|
PathBuf::from(std::env::var("HOME").unwrap_or_else(|_| "/root".into()))
|
|
}
|