remove the hive dashboard's stats page and the price table behind it
The ST4TS page (/stats.html), GET /api/stats-hive, hive-c0re's hive_stats rollup and the modelPrices option that only fed its cost estimate are gone. Each agent's own /stats page and the turn-stats database it reads are unchanged. Setting modelPrices now fails evaluation with a message saying so.
This commit is contained in:
parent
1d3ab2fae5
commit
5e9a22cb38
3 changed files with 112 additions and 1207 deletions
|
|
@ -12,8 +12,7 @@ what you actually do here.
|
|||
|
||||
Everything starts at the **dashboard**, served at `/`. A pages menu
|
||||
(the link icon beside the profile avatar, at the right of the tab strip) links to the other
|
||||
surfaces — Stats, the API docs and the swarm UI — and each of
|
||||
those pages links back to the dashboard.
|
||||
surfaces — the API docs and the swarm UI.
|
||||
|
||||
The dashboard is where you'll spend most of your time. It's a single
|
||||
page with four tabs:
|
||||
|
|
@ -25,9 +24,6 @@ page with four tabs:
|
|||
- **K3PT ST4T3** — kept state from agents with no container
|
||||
(tombstones), with a purge button per entry.
|
||||
|
||||
Usage stats live on their own page, reached from the pages menu:
|
||||
**Stats** (`/stats.html`, swarm-wide usage stats).
|
||||
|
||||
Each agent also has its own page — a full terminal view of that
|
||||
agent's session, reachable by selecting its name anywhere in the
|
||||
dashboard, or directly at `/agent/<name>/` (or `http://<host>:<port>/`
|
||||
|
|
|
|||
|
|
@ -12,15 +12,13 @@ hive-c0re serves the dashboard at `/`.
|
|||
It has a fixed chrome header at the top and a `<main>` that shows exactly
|
||||
one tab pane at a time. The URL hash (`#agents`, `#rebuild`, `#meta`,
|
||||
`#kept`) drives which pane is
|
||||
active; hash changes don't reload the page. ST4TS
|
||||
is a standalone page reached from the pages menu, not from the
|
||||
dashboard tab strip.
|
||||
active; hash changes don't reload the page.
|
||||
|
||||
**Chrome header** (fixed, overlays the active tab pane):
|
||||
- **Pages menu**: a link icon at the right end of the chrome, beside the
|
||||
profile avatar (`links-menu.js`, `@hive/shared`'s `LinksMenu`, the same
|
||||
component the swarm UI uses for its service links), opening a popover with links to **stats**
|
||||
(`/stats.html`), **api docs** (`/api/docs/`) and **swarm** (the swarm
|
||||
component the swarm UI uses for its service links), opening a popover with links to **api docs**
|
||||
(`/api/docs/`) and **swarm** (the swarm
|
||||
UI at the swarm apex domain, opened in a new tab). The swarm entry
|
||||
comes from `state.swarm_public_url`, which hive-c0re reads from
|
||||
`HIVE_SWARM_PUBLIC_URL` (set from `services.hyperhive.swarm.domain`);
|
||||
|
|
@ -35,8 +33,7 @@ dashboard tab strip.
|
|||
If the name doesn't load the avatar shows a question mark, and without the URL the
|
||||
popover has no links.
|
||||
- **Tab strip**: `◆ 4G3NTS ◆`, `◆ R3BU1LD QU3U3 ◆`,
|
||||
`◆ K3PT ST4T3 ◆`. In-page tabs only — ST4TS
|
||||
lives on its own page, reached from the pages menu.
|
||||
`◆ K3PT ST4T3 ◆`.
|
||||
- **Banner-thin** (`░▒▓█▓▒░ HYPERHIVE / HIVE-C0RE / WE ARE THE WIRED ░▒▓█▓▒░`)
|
||||
— sits below the tab strip.
|
||||
- **No warning banner.** No page shows hive-level warnings (host disk
|
||||
|
|
@ -165,48 +162,6 @@ A build's output and history aren't on this page. hive-c0re logs every container
|
|||
to the journal, and the swarm's `builds` Grafana board reads those lines: the builds with
|
||||
their outcome and runtime, and the output of the one you pick.
|
||||
|
||||
## ST4TS page (`/stats.html`)
|
||||
|
||||
Hive-wide turn statistics, aggregated across every agent's
|
||||
`hyperhive-turn-stats.sqlite` for the selected window. Not a dashboard
|
||||
tab — a standalone page reached from the dashboard's pages menu,
|
||||
minimal chrome (a back-link and a title). Distinct from
|
||||
each agent's own `/stats` page (which carries the per-agent trend
|
||||
charts): ST4TS is the swarm-level rollup.
|
||||
|
||||
- **Window selector** (`1h`, `4h`, `24h`, `3d`, `7d`, `30d`, `all`) —
|
||||
a hash-routed tab strip (`#1h` / `#24h` / …) — re-fetches on change.
|
||||
- **Summary chips**: active agents, turns, total/input/output/cache-read
|
||||
tokens, and a labelled **est cost**.
|
||||
- **Busiest agents** table — one row per agent (most turns first):
|
||||
turns, input / output / cache-read tokens, est cost.
|
||||
- **Model mix** — turns per model across the swarm, as CSS bars.
|
||||
- **Favorite tools** — most-run normalised bash-command heads across the
|
||||
swarm (top 10, as CSS bars), aggregated from each agent's
|
||||
`bash_commands` table (written by the hive-bash-daemon capture). The
|
||||
header + list stay hidden until at least one agent has recorded a
|
||||
command, so the section never shows an empty block on a fresh hive.
|
||||
|
||||
Backed by `GET /api/stats-hive?window=<w>` in `hive-c0re`
|
||||
(`hive_stats.rs`): for every name from
|
||||
`Coordinator::kept_state_names()` it opens
|
||||
`agent_harness_dir(name)/hyperhive-turn-stats.sqlite` read-only (with a
|
||||
500 ms `busy_timeout`, since `turn_stats` is rollback-journal) and rolls
|
||||
the rows up, skipping missing / unreadable / zero-turn dbs so one
|
||||
bad db never fails the endpoint. This is a **pull** surface (no SSE):
|
||||
the page fetches the data on page load and on window change. Rendered
|
||||
with plain tables + CSS bars — the dashboard bundle ships no chart
|
||||
library.
|
||||
|
||||
The cost figure is a deliberately rough estimate from a per-model
|
||||
price table (`est_cost_usd`); it drifts with list pricing and the page
|
||||
labels it accordingly. The table is operator-tunable via the
|
||||
`services.hyperhive.deploy.hive-controller.modelPrices` nix option — each key is a
|
||||
model-family short name (matched case-insensitively as a substring of
|
||||
the model id, longest match wins) mapping to
|
||||
`{ input, output, cache_read, cache_write }` USD-per-million-token
|
||||
prices. Models not covered fall back to hive-c0re's built-in estimate.
|
||||
|
||||
## Container row
|
||||
|
||||
A full-height **square agent icon** (5em, capped) on the left. The
|
||||
|
|
@ -509,12 +464,6 @@ below — some endpoints aren't in it yet.
|
|||
build logs.
|
||||
- `GET /api/reminders` — list pending reminders for the
|
||||
dashboard's queued-reminders panel.
|
||||
- `GET /api/stats-hive?window=<1h|4h|24h|3d|7d|30d|all>` — hive-wide
|
||||
turn-stats rollup for the ST4TS tab. Aggregates every agent's
|
||||
`hyperhive-turn-stats.sqlite` read-only (skips missing / unreadable /
|
||||
zero-turn dbs); returns swarm totals, a busiest-first per-agent
|
||||
rollup, swarm model mix, and a labelled `est_cost_usd`. Window
|
||||
defaults to `24h`.
|
||||
- `POST /api/cancel-reminder/{id}` — hard-delete a pending reminder.
|
||||
- `POST /api/retry-reminder/{id}` — re-arm a reminder whose delivery
|
||||
failed (clears the failure state so the scheduler retries).
|
||||
|
|
|
|||
|
|
@ -16,13 +16,10 @@
|
|||
- `GET /static/*` → bundled CSS + JS produced by esbuild
|
||||
(`frontend/packages/{dashboard,agent}/build.mjs`). Both pages
|
||||
pull the shared terminal pane + Catppuccin palette + typography
|
||||
from `@hive/shared` (was `hive-fr0nt`); the dashboard ships one
|
||||
CSS bundle per page (`colors.css` + `theme.css` + `common.css`,
|
||||
loaded by every page, plus a page-specific bundle —
|
||||
`dashboard.css` /
|
||||
`stats.css`);
|
||||
from `@hive/shared` (was `hive-fr0nt`); the dashboard ships
|
||||
`colors.css` + `theme.css` + `common.css` + `dashboard.css`;
|
||||
`common.css` inlines `@hive/shared`'s
|
||||
`base.css` + `terminal.css` + `tabs.css` + `chrome.css` +
|
||||
`base.css` + `terminal.css` + `tabs.css` +
|
||||
`pill.css` via esbuild's `@import` resolution.
|
||||
`terminal.js` exports `{ create, linkify }` as ES module
|
||||
members; a back-compat shim in the IIFE bodies still exposes
|
||||
|
|
|
|||
Loading…
Reference in a new issue