Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/frontend/README.md
iris c6f8f26b16 frontend: the swarm UI's page chrome moves to @hive/shared as AppShell
The header bar, the nav row with its sliding underline, the settings menu slot, the skip link and the content column move out of the swarm UI's Shell into a router-free AppShell in @hive/shared, with their CSS. It takes the brand, the nav items, the current location and the link component, plus slots for extra tabs, settings entries and menus. The swarm UI's Shell keeps what is its own on top of it: the open agent-terminal tabs (their CSS moves to DynamicTabs.css), the swarm's settings, links and user menus, the swarm name and the full-bleed routes. No visible change; this is the base for the hive UI to reuse the same chrome.
2026-11-21 10:46:53 +01:00

38 lines
1.7 KiB
Markdown

# hyperhive frontend
npm workspaces project for the hyperhive browser-facing assets:
- `packages/shared/` — shared modules used by every surface (terminal
pane, Catppuccin palette + body typography, the `AppShell` page chrome the
swarm UI mounts).
- `packages/dashboard/` — the hive-c0re dashboard SPA.
- `packages/agent/` — the per-container web pages (stats, screen).
- `packages/swarm-ui/` — the swarm-level operator UI shell (hives,
agents, jobs, issue-report pages).
## 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;
`nix/packages/frontend.nix` wires up the build derivation. The
`services.hyperhive.agent.frontend.extraFiles` option in `agent.nix`
layers per-agent additions on top of the default agent dist.
## Why npm + esbuild
- **Hermetic**: dependencies vendored via the checked-in lockfile;
`buildNpmPackage` in nix uses it as the source-of-truth so the
output is reproducible without network access at build time.
- **esbuild**: `agent` and `swarm-ui` are Preact apps; `dashboard` is a
vanilla-JS + custom-element MPA with a few Preact-rendered pages
(`builds.js`, `agents.js`, imported by the dashboard entry); `shared` holds both kinds of module. No
framework runtime beyond Preact where it's used. Each workspace's
`build.mjs` is a short esbuild script.
- **Single-PR migration**: see the tracked design proposal and
the four-commit shape (npm scaffold → nix derivations → container
plumbing → Rust cutover).