- Configurable backend: claude (CLI) or openai (API), selected in config.yaml - OpenAI streaming via SSE with conversation history in memory - Session isolation: config name included in session UUID - Markdown to Telegram HTML conversion (pulldown-cmark) for final messages - Fix sendMessageDraft: skip cursor to preserve monotonic text growth, skip empty content chunks from SSE stream - Simplify Makefile: single deploy target
34 lines
1.1 KiB
Makefile
34 lines
1.1 KiB
Makefile
REPO := $(shell pwd)
|
|
HERA := heradev
|
|
HERA_DIR := noc
|
|
|
|
.PHONY: build deploy deploy-hera
|
|
|
|
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 ~/bin ~/.config/systemd/user
|
|
systemctl --user stop noc 2>/dev/null || true
|
|
install target/release/noc ~/bin/noc
|
|
cp noc.service ~/.config/systemd/user/
|
|
systemctl --user daemon-reload
|
|
systemctl --user enable --now noc
|
|
systemctl --user restart noc
|
|
|
|
deploy-hera: build
|
|
ssh $(HERA) 'mkdir -p ~/bin ~/$(HERA_DIR) ~/.config/systemd/user && systemctl --user stop noc 2>/dev/null || true'
|
|
scp target/release/noc $(HERA):~/bin/
|
|
scp config.hera.yaml noc.service.in $(HERA):~/$(HERA_DIR)/
|
|
ssh $(HERA) 'bash -lc "\
|
|
cd ~/$(HERA_DIR) \
|
|
&& mv -f config.hera.yaml config.yaml \
|
|
&& sed -e \"s|@REPO@|\$$HOME/$(HERA_DIR)|g\" -e \"s|@PATH@|\$$PATH|g\" noc.service.in > ~/.config/systemd/user/noc.service \
|
|
&& systemctl --user daemon-reload \
|
|
&& systemctl --user enable --now noc \
|
|
&& systemctl --user restart noc \
|
|
&& systemctl --user status noc"'
|