// channel-tmux — Tmux pane channel daemon // // Uses tmux pipe-pane to stream pane output directly — no polling. // Each configured pane gets a Unix socket pair; pipe-pane sends // output to one end, the daemon reads from the other and pushes // new lines into ChannelLogs. // // Config: ~/.consciousness/channels/tmux.json5 // Socket: ~/.consciousness/channels/tmux.sock use std::cell::RefCell; use std::collections::BTreeMap; use std::rc::Rc; use capnp::capability::Promise; use capnp_rpc::{pry, rpc_twoparty_capnp, twoparty, RpcSystem}; use futures::AsyncReadExt; use tokio::io::AsyncBufReadExt; use tokio::net::UnixListener; use tokio_util::compat::TokioAsyncReadCompatExt; use log::{info, warn, error}; use poc_memory::channel_capnp::{channel_client, channel_server}; use poc_memory::thalamus::channel_log::ChannelLog; // ── Config ───────────────────────────────────────────────────── #[derive(Clone, serde::Deserialize)] struct PaneConfig { /// Tmux pane ID, e.g. "0:1.0" pane_id: String, /// Human-readable label, becomes the channel name "tmux.