| Filename | Latest commit message | Latest commit date |
|---|---|---|
Per mara on #14: 'make agent page not assume root path, links / api calls need to be relative'. atlas's nginx side (#15) will mount the per-agent UI at a prefix like /agent/<name>/ instead of its own port; for the page to keep working under that prefix, every in-page reference needs to resolve document-relative rather than root-anchored. Converted in this pass: - HTML <link>/<script>/<img>/<a> hrefs in index.html, stats.html, screen.html: '/icon' → 'icon', '/static/agent.css' → 'static/agent.css', back links '/' → './'. - app.js fetch() targets ('/api/state' → 'api/state', /api/cancel, /api/loose-ends, etc.), form actions ('/login/start', '/send'), EventSource urls ('/events/stream', '/events/history'). - stats.js fetch() targets. - screen.html WebSocket URL: was hardcoded as ws(s)://host/screen/ws; now derived from document.baseURI via new URL('screen/ws', document.baseURI) so the gateway prefix flows through. Slash-command labels (/cancel, /compact, …) and the dashboard-port link (different port, intentionally absolute) intentionally untouched. Added a new 'Per-agent relative paths' section to docs/web-ui.md covering the rationale + the trailing-slash gotcha (sub-pages like /stats must NOT have a trailing slash, or 'static/app.js' resolves under /stats/ instead of replacing the segment). Functional code unchanged; build clean. Damocles + atlas can proceed with the backend / nginx side without depending on this landing first, but once both ship the agent page works under the gateway-prefixed URL without further changes. refs #14 |
||
| .. | ||
| 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).