- Ops Alerts → Ask Claude now calls `devdesk attach --investigate SESSION UID`. The server looks the alert up, writes the prompt and starts Claude in a new alert-<name> session with it as the first prompt, already sent. Prompts are stored in prompts/<session>.txt and consumed once by devdesk-claude-run. A session that is already running is just opened. - The prompt has the rule, query, summary, details and labels, and where it runs: the CT/VM id, the node it is on now, status and HA state, and `ssh <node> pct exec <id> --`. It reminds Claude that HA guests move (`devdesk guests <id>`), and gives aggregate rules a hint. - `devdesk guests`: Proxmox inventory over SSH (DEVDESK_PVE_NODES). pvesh gives the cluster view; each node gives lxc-info and guest-agent IPs. Cached in guests.json, keeping last-seen IPs for stopped guests; --alerts refreshes it in the background every 5 minutes. - Alerts carry uid, query, description and targets, matched by instance IP/host or by name; each card shows the target. - cmd_alerts moves to libexec/devdesk-ops.sh. Closes #39 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60 lines
2.6 KiB
Makefile
60 lines
2.6 KiB
Makefile
# DevDesk build. debhelper drives this: `make` (all), `make test`, `make install DESTDIR=…`.
|
|
|
|
PREFIX ?= /usr
|
|
SYSCONFDIR ?= /etc
|
|
DESTDIR ?=
|
|
LIBDIR := $(PREFIX)/lib/devdesk
|
|
SHAREDIR := $(PREFIX)/share/devdesk
|
|
TTYD_ARCH ?= x86_64
|
|
|
|
SHELL_SCRIPTS := bin/devdesk $(wildcard libexec/devdesk-*) scripts/fetch-ttyd.sh debian/devdesk.postinst debian/devdesk.postrm
|
|
WEB_SOURCES := web/build.mjs web/index.template.html web/styles.css $(wildcard web/src/*.js) $(wildcard web/editor/*.js) \
|
|
vendor/web_template/base.css debian/changelog
|
|
|
|
.PHONY: all lint test install clean sync-template
|
|
|
|
all: dist/index.html build/ttyd
|
|
|
|
node_modules/.package-lock.json: package.json package-lock.json
|
|
npm ci --no-audit --no-fund
|
|
|
|
dist/index.html: node_modules/.package-lock.json $(WEB_SOURCES)
|
|
node web/build.mjs
|
|
|
|
build/ttyd: vendor/ttyd/VERSION vendor/ttyd/SHA256SUMS scripts/fetch-ttyd.sh
|
|
scripts/fetch-ttyd.sh $@ $(TTYD_ARCH)
|
|
@touch $@
|
|
|
|
lint: node_modules/.package-lock.json
|
|
npx eslint --max-warnings 0 --ext .js,.mjs web/src web/editor web/build.mjs tests/protocol.test.mjs
|
|
shellcheck -x $(SHELL_SCRIPTS)
|
|
jq empty share/claude-settings.json
|
|
|
|
test: node_modules/.package-lock.json
|
|
node --test tests/*.test.mjs
|
|
bats tests/
|
|
|
|
install: all
|
|
install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(LIBDIR)/bin $(DESTDIR)$(SHAREDIR) $(DESTDIR)$(SYSCONFDIR)/devdesk
|
|
install -m 0755 bin/devdesk $(DESTDIR)$(PREFIX)/bin/devdesk
|
|
install -m 0644 libexec/devdesk-lib.sh $(DESTDIR)$(LIBDIR)/devdesk-lib.sh
|
|
install -m 0755 libexec/devdesk-picker libexec/devdesk-claude-run libexec/devdesk-session-hook \
|
|
libexec/devdesk-tmux-ready libexec/devdesk-serve libexec/devdesk-statusline \
|
|
libexec/devdesk-deploy libexec/devdesk-state-hook libexec/devdesk-notify-matrix libexec/devdesk-guard $(DESTDIR)$(LIBDIR)/
|
|
install -m 0644 libexec/devdesk-files.sh libexec/devdesk-inbox.sh libexec/devdesk-history.sh libexec/devdesk-ops.sh \
|
|
$(DESTDIR)$(LIBDIR)/
|
|
install -m 0755 build/ttyd $(DESTDIR)$(LIBDIR)/bin/ttyd
|
|
install -m 0644 dist/index.html share/tmux.conf share/claude-settings.json $(DESTDIR)$(SHAREDIR)/
|
|
install -d $(DESTDIR)$(SHAREDIR)/assets
|
|
install -m 0644 dist/assets/editor.js $(DESTDIR)$(SHAREDIR)/assets/editor.js
|
|
install -m 0644 etc/env $(DESTDIR)$(SYSCONFDIR)/devdesk/env
|
|
|
|
clean:
|
|
rm -rf dist build
|
|
|
|
# Refresh the vendored design system: make sync-template TEMPLATE=../web_template
|
|
sync-template:
|
|
@test -n "$(TEMPLATE)" || { echo "usage: make sync-template TEMPLATE=/path/to/web_template"; exit 2; }
|
|
cp $(TEMPLATE)/base.css vendor/web_template/base.css
|
|
@echo "Updated base.css — record the commit in vendor/web_template/UPSTREAM: $$(git -C $(TEMPLATE) rev-parse --short HEAD)"
|