feat(status): a status page, for the phone of whoever looks after the box

Is the box up, and speech, and the brain; how many conversations,
turns, IR presses, and looks, today and all time. Counts and times
only: no transcripts.

- status/status.js: what the events and checks add up to, and the page
- status/status-server.js: the page, the box's events and heartbeat,
  and a TCP check of each part every 30 s; events kept in a file
- status/pdtv26-status.service and Makefile: sudo make install on the
  home server, answering only the private network
- checks: status (its tests)

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-12-02 17:16:02 -06:00
1 parent 84d2816f24
commit 469d642902
8 files changed
+489

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
# The status page: bin/status-server HOST PORT STATE_DIR NAME BOX SPEECH BRAIN, with node.
# No npm dependencies: node's own http and net. The tests run as the package builds.
{ lib, stdenvNoCC, nodejs-slim }:
stdenvNoCC.mkDerivation {
pname = "pdtv26-status";
version = "0.1.0";
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [ ./status.js ./status.test.js ./status-server.js ];
};
nativeCheckInputs = [ nodejs-slim ];
doCheck = true;
checkPhase = ''
runHook preCheck
node --check status-server.js
node --test
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib/pdtv26-status $out/bin
cp status.js status-server.js $out/lib/pdtv26-status/
printf '#!/bin/sh\nexec %s %s/lib/pdtv26-status/status-server.js "$@"\n' ${nodejs-slim}/bin/node $out > $out/bin/status-server
chmod +x $out/bin/status-server
runHook postInstall
'';
}