| Filename | Latest commit message | Latest commit date |
|---|---|---|
Fixes hyperhive#3223. swarm-controller: GET /api/hives (utoipa-annotated same as /health), serving the swarm's hive directory (name + domain) loaded once at startup from a new SWARM_CONTROLLER_HIVES env var. The controller's NixOS module sets it from services.hyperhive.swarm.hives, JSON-encoded the same way hive-c0re already builds HYPERHIVE_PEERS for its own peer list (environment.nix) — the full directory here rather than peers-minus-self, since a swarm-level daemon has no 'self' hive to exclude. Unset/malformed both fall back to an empty list with a warning rather than failing startup, so /health stays answerable even if this one env var is wrong. swarm-ui: App.tsx's Home route fetches /api/hives and renders it through the already-merged <Table>/<StatusChip>/<Panel> primitives — name, domain (linking out to that hive's own gateway-routed dashboard), and a static "configured" status chip until a real online/stale/offline rollup exists server-side. Also gave swarm-ui a base <a> color (theme's --blue) — base.css covers body/typography but not links, and this is genuinely page-level rather than any one component's concern. Verified end to end, not just source-reading: ran the real swarm-controller binary with SWARM_CONTROLLER_HIVES set, curled /api/hives + /health over its actual unix socket; separately served the real swarm-ui dist against a mock /api/hives and screenshotted the rendered table. Also re-verified the nginx wiring evaluates (same throwaway nixosSystem eval technique as #3212) — SWARM_CONTROLLER_HIVES resolves to the expected JSON shape. cargo test/clippy -p swarm-controller clean (2 tests, including a new load_hives one covering missing/malformed/valid env var states). npm run build + typecheck clean. |
||
| .. | ||
| packages | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
hyperhive frontend
npm workspaces project for the hyperhive browser-facing assets:
packages/shared/— shared modules used by both surfaces (terminal pane, Catppuccin palette + body typography).packages/dashboard/— the hive-c0re dashboard SPA.packages/agent/— the per-container web UI (default agent page, stats, screen).
Build
npm install # one-off; uses the checked-in package-lock.json
npm run build # builds every workspace into packages/*/dist/
The Rust binaries serve packages/dashboard/dist/ and
packages/agent/dist/ via tower_http::ServeDir at runtime; the
build derivation is wired up in nix/modules/frontend.nix. Per-agent
additions are layered on top of the default agent dist via the
hyperhive.frontend.extraFiles option in agent.nix.
Why npm + esbuild
- Hermetic: dependencies vendored via the checked-in lockfile;
buildNpmPackagein nix uses it as the source-of-truth so the output is reproducible without network access at build time. - esbuild: vanilla-JS bundler, no framework runtime overhead.
Each workspace's
build.mjsis ~30 lines. - Single-PR migration: see issue #273 for the design proposal and the four-commit shape (npm scaffold → nix derivations → container plumbing → Rust cutover).