Add service status and usage dashboard, refresh externally published edits

This commit is contained in:
2026-10-09 20:20:44 +01:00
parent 67ac79765f
commit a50e8648f6
31 changed files with 1283 additions and 42 deletions
+40 -2
View File
@@ -8,6 +8,34 @@ service manager directly. Legacy Python-managed installations require an explici
For source development, use `go run ./cmd/pipelines help`; start the native server
separately. Set `PIPELINES_URL` or pass `--url` to select another server.
## Dashboard and status
Home's `r` opens **all** recent runs (latest 50), not only failures. Wide terminals
show runs and pipelines side by side, with stacked panels on narrow terminals.
Run cards show status, duration, start time and the current stage when active.
The usage summary is aggregated over all stored history, including retry attempts:
total/active runs, outcomes, success rate, average completed duration, pipeline
usage and a zero-filled 14-day daily activity chart (UTC). Success rate is
succeeded / (succeeded + failed); active, canceled and interrupted runs are excluded.
The average includes all runs with a finish timestamp. No model cost/token counts
are inferred from missing data. `pipelines stats --json` exposes these aggregates.
Use `:status` on any TUI page to open server and ntfy information. Scroll with
arrows or `j/k`, PgUp/PgDn; `r` refreshes and Esc closes without changing the page.
`pipelines status [--json]` returns the same server data, including hostname,
start/uptime, the connected server endpoint/port, active interface IPs, ntfy
publishing health, public phone URL/topic/port and candidate URLs. It does not
start services or send a notification. The ntfy health probe has a two-second
deadline; it checks the publishing server, not phone reachability.
IPs belong to the **server computer or container**, not necessarily the client.
Candidate IP/port combinations are not reachability checks: loopback bindings,
firewalls, container port mapping and TLS can prevent access. ntfy candidates
are only derived when a configured endpoint identifies this computer; remote
ntfy hosts are not misrepresented as local. Publishing URLs and credentials are
never returned. Missing public phone configuration is labeled explicitly.
`pipelines service status` remains the separate OS autostart status command.
## Draft-first OpenCode workflow
```sh
@@ -42,6 +70,13 @@ the existing draft, `v` for server validation, and `s` for submission confirmati
`r` refreshes the list. Submission preserves create-only/version guards and rejects
drafts belonging to another server. An unnamed draft must be named through OpenCode
or CLI `submit --name`. Draft selection/editor completion never publishes it.
On editor exit, the connected TUI checks the authoritative server before asking
to submit. If the draft source is already published (including a newer version
after the draft's base that was subsequently superseded), it skips confirmation
and reloads the latest pipeline/page and Home list. Local-only changes still need
explicit submission. A failed check retains the draft and says publication could
not be verified; it never assumes publication from an editor's exit code. Original
draft conflict guards and retained draft files remain unchanged.
New unnamed drafts open OpenCode so the skill can name them. For named drafts,
the default editor is OpenCode; explicit `VISUAL`/`EDITOR` overrides remain.
@@ -81,7 +116,9 @@ Submitting activates included schedules, so review them before publishing.
| Run history/inspection | `runs --json`, `inspect ID --json` |
| Cancel | `cancel ID --json` |
| Connection and phone settings | `connection --json`, `ping --json` |
| Operational diagnostics | installed `logs`, `status`, `doctor` |
| Server/ntfy status popup | `status --json` |
| Usage statistics/charts | `stats --json` |
| Legacy operational diagnostics | managed `logs`, `doctor` |
The TUI does not spawn CLI processes for each request. Both front ends share
`internal/client`'s command transport and `internal/draft`'s persisted drafts;
@@ -94,7 +131,8 @@ printf '%s' '{"type":"get_pipeline","pipeline_id":1,"version":1}' | pipelines rp
Existing protocol commands: `ping`, `list_pipelines`, `get_pipeline`,
`list_templates`, `validate`, `submit`, `run_pipeline`, `list_runs`, `get_run`,
`cancel_run`, `retry_run`. See `internal/protocol/message.go` for JSON envelopes. Mutating RPCs
`cancel_run`, `retry_run`, `get_status`. `list_runs` also returns all-history `usage`
aggregates. See `internal/protocol/message.go` for JSON envelopes. Mutating RPCs
have real effects; they are not previews. TUI-only animation, scrolling, and
transient client logs are presentation, not separate server capabilities.