channels: improve tmux state tracking and config persistence

tmux channel:
- Track connected state per-pane (shows true channel availability)
- Persist pane config on add/remove (survives restarts)
- Remove cleanup_pipes on exit (unnecessary with persisted config)
- Reorder PaneConfig fields for consistency

telegram channel:
- Use json5 crate for config parsing (matches tmux)

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-12 20:11:34 -04:00
parent 4556e16fd7
commit 33156d9ab3
4 changed files with 90 additions and 58 deletions

View file

@ -8,6 +8,7 @@ capnp = "0.25"
capnp-rpc = "0.25"
dirs = "6"
futures = "0.3"
json5 = "1.3"
consciousness = { path = "../.." }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

View file

@ -40,7 +40,7 @@ fn load_config() -> Config {
let config_path = dir.join("telegram.json5");
let text = std::fs::read_to_string(&config_path)
.unwrap_or_else(|_| panic!("failed to read {}", config_path.display()));
let mut config: Config = serde_json::from_str(&text)
let mut config: Config = json5::from_str(&text)
.unwrap_or_else(|e| panic!("failed to parse {}: {}", config_path.display(), e));
// Read token from secrets file