Commit graph

10 commits

Author SHA1 Message Date
Kent Overstreet
58737a2cef channel_log: shared disk logging with round-trip
Move IRC's disk logging to thalamus/channel_log.rs as shared
functions: append_disk_log() and load_disk_log(). Any daemon
can use them — opt-in, not mandatory (tmux won't use them).

load_disk_log() populates a ChannelLog from disk on startup,
so history survives daemon restarts.

IRC daemon now uses the shared functions.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 13:26:42 -04:00
Kent Overstreet
a6ffe9e086 telegram: move token to secrets file
Read token from channels/telegram.secrets/token instead of the
json5 config. Keeps secrets out of config files.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 13:09:55 -04:00
Kent Overstreet
6d1411f2a1 move irc/telegram data under channels/
IRC logs → channels/irc.logs/
Telegram logs + offset → channels/telegram.logs/
Channel data now lives with channel infrastructure.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 13:06:27 -04:00
Kent Overstreet
93bc49959c deps: replace tracing with log+env_logger, drop console-subscriber
Switch all tracing::{info,warn,error} to log::{info,warn,error}.
Replace tracing_subscriber::fmt::init() with env_logger::init().
Drop tracing, tracing-subscriber, tracing-appender as direct deps.
Drop console feature from jobkit (was pulling in console-subscriber
which pulled in tracing-subscriber).

tracing still compiled as transitive dep of reqwest and tui-markdown,
but our code no longer depends on it.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 06:54:11 -04:00
Kent Overstreet
917960cb76 deps: remove faer (224 transitive crates)
Spectral decomposition (eigenvalue computation) removed — it was
only used by the spectral-save CLI command. The spectral embedding
reader and query engine features remain (they load pre-computed
embeddings from disk, no faer needed).

Removes: faer, nano-gemm, private-gemm, and ~220 other transitive
dependencies. Significant build time and artifact size reduction.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 06:39:47 -04:00
Kent Overstreet
c1a5638be5 deps: switch reqwest to rustls, drop aws-lc-sys
Use rustls instead of default native-tls (aws-lc-sys) for HTTPS.
Saves ~80 MB of build artifacts. Applied to both main crate and
telegram channel daemon.

Also: tracing default-features = false (Kent's edit).

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 06:31:50 -04:00
Kent Overstreet
7b75296457 Update reqwest
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 06:02:25 -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
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
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