Auto-exit server after 30 minutes idle, add liveness check to skill

Server tracks activity (HTTP requests, WebSocket messages, file
changes) and exits after 30 minutes of inactivity. On exit, deletes
.server-info and writes .server-stopped with reason. Visual companion
guide now instructs agents to check .server-info before each screen
push and restart if needed. Works on all harnesses, not just CC.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jesse Vincent
2026-03-11 18:32:09 -07:00
parent 85cab6eff0
commit 263e3268f4
2 changed files with 31 additions and 1 deletions

View File

@@ -83,7 +83,8 @@ Use `--url-host` to control what hostname is printed in the returned URL JSON.
## The Loop
1. **Write HTML** to a new file in `screen_dir`:
1. **Check server is alive**, then **write HTML** to a new file in `screen_dir`:
- Before each write, check that `$SCREEN_DIR/.server-info` exists. If it doesn't (or `.server-stopped` exists), the server has shut down — restart it with `start-server.sh` before continuing. The server auto-exits after 30 minutes of inactivity.
- Use semantic filenames: `platform.html`, `visual-style.html`, `layout.html`
- **Never reuse filenames** — each screen gets a fresh file
- Use Write tool — **never use cat/heredoc** (dumps noise into terminal)