Commit graph

7 commits

Author SHA1 Message Date
ProofOfConcept
e8e9386856 channels: add open/close RPCs for dynamic pane management
Add open/close to the channel capnp schema. The tmux daemon implements
open by finding a pane by name (pane title or window name) and
attaching pipe-pane; close detaches and removes from state.

Tool handlers channel_open and channel_close added to the tool
registry.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-04 19:22:49 -04:00
ProofOfConcept
1ef137fb3a channels: add tmux pane channel daemon
Standalone daemon that streams tmux pane output via pipe-pane
(no polling). Each configured pane becomes a channel "tmux.<label>"
accessible through the standard channel.capnp protocol.

- pipe-pane streams PTY output directly to FIFOs
- Async readers push new lines into ChannelLogs
- send works via tmux send-keys
- Cleanup disconnects pipe-pane on daemon exit

Config: ~/.consciousness/channels/tmux.json5
Socket: ~/.consciousness/channels/tmux.sock

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-04 18:19:21 -04:00
ProofOfConcept
53a2dbac37 fix unread count: sent messages don't count as unread
Track outgoing messages separately (own counter) so they appear
in the log but don't inflate unread counts. Reset on recv.

Co-Developed-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-03 20:42:36 -04:00
ProofOfConcept
7d1637a2f0 irc: create channel log entries on JOIN
Channels now appear in list() immediately after joining,
not only after the first message arrives.

Co-Developed-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-03 20:09:06 -04:00
ProofOfConcept
c19f26f4fa telegram daemon: per-channel logs with shared ChannelLog
Same treatment as IRC daemon — replace single ring buffer with
BTreeMap<String, ChannelLog>. list() returns all channels with
per-channel unread counts. Sent messages tracked too.

Co-Developed-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-03 20:04:08 -04:00
ProofOfConcept
e604659e3a per-channel message logs with shared ChannelLog type
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>
2026-04-03 20:01:32 -04:00
ProofOfConcept
ad5f69abb8 channel architecture: wire protocol, daemons, supervisor
Design and implement the channel system for external communications:

- schema/channel.capnp: wire protocol for channel daemons
  (recv with all_new/min_count, send, subscribe, list)
- channels/irc/: standalone IRC daemon crate (consciousness-channel-irc)
- channels/telegram/: standalone Telegram daemon crate
  (consciousness-channel-telegram)
- src/thalamus/channels.rs: client connecting to daemon sockets
- src/thalamus/supervisor.rs: daemon lifecycle with file locking
  for multi-instance safety

Channel daemons listen on ~/.consciousness/channels/*.sock,
configs in *.json5, supervisor discovers and starts them.
IRC/Telegram modules removed from thalamus core — they're
now independent daemons that survive consciousness restarts.

Also: delete standalone tui.rs (moved to consciousness F4/F5),
fix build warnings, add F5 thalamus screen with channel status.

Co-Developed-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-03 18:46:41 -04:00