hyperhive/hive-ag3nt/src
iris 229c4292e9 frontend: cut over Rust binaries to ServeDir; delete legacy assets
Phase 4 of #273 — the actual switch. Both axum routers now serve
their static surface via `tower_http::services::ServeDir` mounted
as a fallback service, reading the dist path from `HIVE_STATIC_DIR`
(set by Phase 3's NixOS module wiring).

Deletes:
- `hive-c0re/assets/{index.html, app.js, dashboard.css}`
- `hive-ag3nt/assets/{index.html, app.js, agent.css, stats.html,
   stats.js, screen.html}`
- The whole `hive-fr0nt/` crate (workspace member dropped, both
  hive-c0re and hive-ag3nt drop their `hive-fr0nt.workspace = true`
  dep). Its contents now live as `@hive/shared` under
  `frontend/packages/shared/`.

Rust changes:
- `hive-c0re/src/dashboard.rs`: remove `serve_index`, `serve_css`,
  `serve_app_js`, `serve_shared_js`, `serve_marked_js`,
  `serve_favicon` (all six `include_str!` handlers); replace their
  routes with a single `.fallback_service(ServeDir::new(static_dir))`
  on the router. Fail closed (anyhow::bail) if `HIVE_STATIC_DIR` is
  unset or not a directory at startup.
- `hive-ag3nt/src/web_ui.rs`: remove `serve_index`, `serve_css`,
  `serve_app_js`, `serve_shared_js`, `serve_marked_js`,
  `serve_stats`, `serve_stats_js`, `serve_screen`; same
  `fallback_service` pattern. `serve_icon` stays (consumes
  `/etc/hyperhive/icon.svg` + `branding/hyperhive.svg` fallback,
  neither of which lives under the frontend dist).
- `AgentLink` URLs for stats/screen switched from `/stats` / `/screen`
  to `/stats.html` / `/screen.html` since ServeDir doesn't auto-
  append the extension and the on-disk filename is the natural URL
  post-cutover.
- `Cargo.toml` (workspace): drop `hive-fr0nt` member + workspace
  dep, add `tower-http = { version = "0.6", features = ["fs"] }`.
- `hive-c0re/Cargo.toml` + `hive-ag3nt/Cargo.toml`: drop the
  `hive-fr0nt.workspace = true` dep, add `tower-http.workspace =
  true`.

Docs updated:
- `CLAUDE.md`: file map reflects `frontend/` (was `hive-fr0nt/` +
  `assets/`) and the ServeDir/HIVE_STATIC_DIR shape.
- `docs/web-ui.md` 'Shape (shared by both)' section: describes the
  ServeDir fallback + bundled-by-esbuild surface, no more
  `include_str!` references.
- `docs/terminal-rendering.md`: src paths point at
  `frontend/packages/{agent,shared}/src/`; marked is the npm dep,
  not vendored UMD.

Validation:
- `cargo check --workspace` — clean (5 warnings, all pre-existing
  in `rebuild_queue.rs`, none on changed files).
- `cargo clippy --workspace --all-targets` — clean (11 warnings,
  same pre-existing source).
- `cd frontend && npm run build` from the prior commit's lockfile
  produces the dist directories the new routers consume:
    dashboard: `dist/{index.html, static/{app.js, dashboard.css}}`
    agent:     `dist/{index.html, stats.html, screen.html,
                       static/{app.js, stats.js, agent.css}}`
  (favicon.svg lands in dashboard/ during the nix build —
  `nix/frontend.nix` install phase copies `branding/hyperhive.svg`
  there, since it's outside the npm tree.)

Refs #273.
2026-05-23 14:51:01 +02:00
..
bin set_status: consolidate whoami into get_agent_meta with optional name 2026-05-23 11:32:33 +02:00
client.rs docs: add missing #[must_use], # Errors, # Panics across public api 2026-05-22 19:41:27 +02:00
events.rs events: HIVE_DEFAULT_MODEL takes priority over persisted model (closes #319) 2026-05-23 00:38:17 +02:00
forge_notify.rs forge_notify: include reason field in all notification messages (closes #110) 2026-05-22 23:59:47 +02:00
lib.rs refactor: extract format_wake_prompt/now_unix/build_row into serve_common (closes #169) 2026-05-21 18:53:41 +02:00
login.rs refactor: per-agent state paths (/agents/{label}/state), centralize in paths.rs 2026-05-16 15:18:32 +02:00
login_session.rs docs: add missing #[must_use], # Errors, # Panics across public api 2026-05-22 19:41:27 +02:00
mcp.rs set_status: consolidate whoami into get_agent_meta with optional name 2026-05-23 11:32:33 +02:00
paths.rs fix: manager uses /agents/hm1nd/state, not /state, for HYPERHIVE_STATE_DIR 2026-05-20 13:35:12 +02:00
plugins.rs add optional in_reply_to field on send for conversation threading 2026-05-20 13:35:27 +02:00
serve_common.rs docs: add missing #[must_use], # Errors, # Panics across public api 2026-05-22 19:41:27 +02:00
stats.rs docs: add missing #[must_use], # Errors, # Panics across public api 2026-05-22 19:41:27 +02:00
turn.rs fix: self-calibrate context window from API result event 2026-05-22 22:20:07 +02:00
turn_stats.rs docs: add missing #[must_use], # Errors, # Panics across public api 2026-05-22 19:41:27 +02:00
web_ui.rs frontend: cut over Rust binaries to ServeDir; delete legacy assets 2026-05-23 14:51:01 +02:00