init: telegram bot bridging messages to claude sessions

Async Rust bot (teloxide + tokio) that:
- Authenticates users per chat with a passphrase (resets daily at 5am)
- Generates deterministic UUID v5 session IDs from chat_id + date
- Pipes messages to `claude -p --session-id/--resume <uuid>`
- Persists auth and session state to disk across restarts
- Deploys as systemd --user service via `make deploy`
This commit is contained in:
Fam Zheng
2026-04-05 06:56:46 +01:00
commit db8ff94f7c
9 changed files with 2651 additions and 0 deletions

16
Makefile Normal file
View File

@@ -0,0 +1,16 @@
REPO := $(shell pwd)
.PHONY: build deploy
build:
cargo build --release
noc.service: noc.service.in
sed -e 's|@REPO@|$(REPO)|g' -e 's|@PATH@|$(PATH)|g' $< > $@
deploy: build noc.service
mkdir -p ~/.config/systemd/user
cp noc.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now noc
systemctl --user restart noc