feat: add foreground monitor command with live status + recent logs

- serve now periodically writes account-pool state (active/cooldown/
  disabled, cooldown until, token expiry) to workbuddy-status.json,
  refreshed every 3s and immediately on cooldown/disable/refresh events
- new 'monitor' command runs in foreground: refreshes a live panel of
  all accounts (usable/cooldown/expired + reasons) every N seconds,
  optionally showing recent logs via journalctl (-journal) or a log
  file (-logfile)
- statusSnapshotFile excluded from git via .gitignore
- unit tests for tailLines and status snapshot states
This commit is contained in:
CangShui
2026-09-04 09:36:51 +08:00
parent 86b70baf29
commit 61aa053816
4 changed files with 405 additions and 12 deletions
+1
View File
@@ -7,6 +7,7 @@ last-*.json
*.json.bak
*.json.disabled
.workbuddy-*.json
workbuddy-status.json
# 本地编译产物
workbuddy-gateway.exe