From e455964cb38174a49a598b4f8ac0a21b6a508c00 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 14 Oct 2026 20:23:14 +0200 Subject: [PATCH] dashboard: the SW4RM tab is the agents tab The swarm lives in the swarm UI; this tab lists the hive's agents. The tab is 4G3NTS at #agents, its pane and count pill follow, and the module that renders the containers is agents.js. Comments and docs that named SW4RM or swarm.js follow. --- docs/integrations/forge.md | 2 +- docs/web-ui/README.md | 6 ++-- docs/web-ui/dashboard.md | 16 +++++----- docs/web-ui/shape.md | 2 +- frontend/README.md | 2 +- .../src/agent-menu/hive-agent-menu.js | 4 +-- .../dashboard/src/{swarm.js => agents.js} | 15 +++++---- frontend/packages/dashboard/src/common.css | 2 +- frontend/packages/dashboard/src/dashboard.css | 12 +++---- .../packages/dashboard/src/dashboard.html | 30 ++++++++--------- frontend/packages/dashboard/src/tabs.js | 32 +++++++++---------- .../shared/src/hive-menu/hive-menu.js | 6 ++-- .../shared/src/hive-warn/hive-warn.js | 2 +- .../shared/src/jobq-rollup/JobqRollup.tsx | 4 +-- .../packages/swarm-ui/src/pages/JobsPage.tsx | 2 +- hive-agent/src/web_ui/screen.rs | 2 +- 16 files changed, 70 insertions(+), 69 deletions(-) rename frontend/packages/dashboard/src/{swarm.js => agents.js} (98%) diff --git a/docs/integrations/forge.md b/docs/integrations/forge.md index 08b2ab93..9e471b80 100644 --- a/docs/integrations/forge.md +++ b/docs/integrations/forge.md @@ -127,7 +127,7 @@ Two things live in the `agent-configs` Forgejo organization: [How a hive reads the forge](#how-a-hive-reads-the-forge)). - The dashboard links each container's deployed config commit to this config repo on the swarm's forge (`swarm.forge.publicUrl`; `null` means no - link), so operators can go straight from the SW4RM tab into + link), so operators can go straight from the 4G3NTS tab into the rendered repo without an extra `git` step. The `hive-forge` CLI (separate workspace crate, see diff --git a/docs/web-ui/README.md b/docs/web-ui/README.md index 242e2706..9c8f2fe4 100644 --- a/docs/web-ui/README.md +++ b/docs/web-ui/README.md @@ -18,7 +18,7 @@ never more than one step from the hub. The **dashboard** itself (`/dashboard.html`) is where you'll spend most of your time. It's a single page with five tabs: -- **SW4RM** — every agent, live. This is the default tab and the one +- **4G3NTS** — every agent, live. This is the default tab and the one you'll check most. - **R3BU1LD QU3U3**, **M3T4 1NPUTS** and **BUILD L0GS** — the build lifecycle: the rebuild queue with a live log of whatever is building, @@ -37,7 +37,7 @@ if the gateway isn't in front). ## The things you'll actually do -**Check on an agent.** SW4RM shows every container as a row: name, +**Check on an agent.** 4G3NTS shows every container as a row: name, whether it's running, what it's currently doing (a live status pill — `rebuilding…`, `starting…`, or similar — while something's in flight), and quick links (stats, screen, forge profile). Select the name to open @@ -49,7 +49,7 @@ repo. Review and merge them on the forge; the merge deploys the change. See [`config-changes.md`](../agent-lifecycle/config-changes.md#config-changes). **Start, stop, restart, or rebuild an agent.** Select one or more -agents on SW4RM (select the icon) and use the selection bar, or use the +agents on 4G3NTS (select the icon) and use the selection bar, or use the per-agent `⋮` menu on a single row. Rebuilding re-applies that agent's current config; use it whenever an agent shows as "needs update." diff --git a/docs/web-ui/dashboard.md b/docs/web-ui/dashboard.md index 6578f458..6cfd43f1 100644 --- a/docs/web-ui/dashboard.md +++ b/docs/web-ui/dashboard.md @@ -10,7 +10,7 @@ matrix accounts, the controller's job graph — are on the hive-c0re serves the dashboard at `/dashboard.html` (with the home page at `/`). It has a fixed chrome header at the top and a `
` that shows exactly -one tab pane at a time. The URL hash (`#swarm`, `#rebuild`, `#meta`, +one tab pane at a time. The URL hash (`#agents`, `#rebuild`, `#meta`, `#buildlogs`, `#permissions`) drives which pane is active; hash changes don't reload the page. FL0W and the other standalone pages are reachable from the H0M3 hub at `/`, not @@ -19,12 +19,12 @@ from the dashboard tab strip. **Chrome header** (fixed, overlays the active tab pane): - **← home back-link**: top-left of the chrome, links to the H0M3 hub at `/`. Every surface links back to the hub rather than to each other. -- **Tab strip**: `◆ SW4RM ◆`, `◆ R3BU1LD QU3U3 ◆`, `◆ M3T4 1NPUTS ◆`, +- **Tab strip**: `◆ 4G3NTS ◆`, `◆ R3BU1LD QU3U3 ◆`, `◆ M3T4 1NPUTS ◆`, `◆ BUILD L0GS ◆`, `◆ P3RM1SS10NS ◆`. In-page tabs only — the SYST3M panels live on the standalone **C0R3** page (`/core.html`), and FL0W / ST4TS live on their own pages too, all reachable from the - H0M3 hub (not the tab strip). Count pills on SW4RM + H0M3 hub (not the tab strip). Count pills on 4G3NTS (stale containers) and R3BU1LD QU3U3 (rebuilds in flight). - **Banner-thin** (`░▒▓█▓▒░ HYPERHIVE / HIVE-C0RE / WE ARE THE WIRED ░▒▓█▓▒░`) — sits below the tab strip. @@ -56,7 +56,7 @@ The FL0W page uses a slim header (a `← home` back-link + the page title) rather than the dashboard tab strip — it's a standalone surface, not a tab pane. -## SW4RM tab +## 4G3NTS tab **C0NTAINERS** — live containers as a flat list, one row per container, sorted alphabetically by agent name; every container the @@ -123,7 +123,7 @@ dashboard's one tab strip, `/api/state` snapshot and `rebuild_queue_changed`, `meta_inputs_changed` and `meta_update_running` on the stream alongside the dashboard's other kinds. The count pill on R3BU1LD QU3U3 is the number of rebuilds in flight. -The SW4RM tab does **not** read the graph endpoint, by design — the swarm +The 4G3NTS tab does **not** read the graph endpoint, by design — the swarm view stays independent of job-queue internals. Its per-agent pending badges are transient-only, and its queue-summary banner reads the much narrower `GET /api/jobq/rollup` instead (see Container row, below) — a @@ -414,7 +414,7 @@ the tooltip says "select … for bulk actions" or "deselect … (or press Esc to clear all)." The `` points at `/icon`; load failure falls back to the dimmed hyperhive mark (`/favicon.svg`). The card body sits to the right with three stacked lines -(`assets/swarm.js::renderContainers`). +(`assets/agents.js::renderContainers`). **Icon layout + load strategy:** the `` is absolutely @@ -586,7 +586,7 @@ queue — N running · M queued — view queue →` (the link goes to the R3BU1LD QU3U3 tab). The shared `JobqRollup` Preact component (`@hive/shared/jobq-rollup.js` — the same one swarm-ui's `/jobs` page mounts, pointed at swarm-controller's own rollup endpoint instead), -mounted once into `#jobq-rollup-section` by `swarm.js::initJobqRollup` +mounted once into `#jobq-rollup-section` by `agents.js::initJobqRollup` and refreshed via its own handle rather than being re-rendered by `renderContainers`. Reads `GET /api/jobq/rollup` (`hive-jobq-wire::state_rollup`) — `Vec<{ state, nodes, roots }>`, @@ -648,7 +648,7 @@ Bulk actions (`R3ST4RT` / `ST0P` / `ST4RT` / `P4US3` / `R3SUM3` / buttons — see **Container row** above. Selecting an agent's icon toggles its selection (an in-memory `Set`); `Esc` or the bar's `✕ clear` button drops everything. The selection persists across tab -switches in-memory — the bar just hides on non-SW4RM tabs since other +switches in-memory — the bar just hides on non-4G3NTS tabs since other tabs don't show the agent cards needed to cross-reference. When the operator selects one or more agents (via the icon), a sticky diff --git a/docs/web-ui/shape.md b/docs/web-ui/shape.md index 41ef2fa3..af9f4382 100644 --- a/docs/web-ui/shape.md +++ b/docs/web-ui/shape.md @@ -208,7 +208,7 @@ re-render), call `refreshState()`. State shapes live in `hive-c0re/src/dashboard/state_snapshot.rs::StateSnapshot` and `web_ui/state.rs::StateSnapshot` — when adding state fields, plumb through the snapshot struct and the -relevant domain module (`swarm.js`, `permissions.js`, etc.) render function. +relevant domain module (`agents.js`, `permissions.js`, etc.) render function. **Focus preservation:** `refreshState` checks whether `document.activeElement` sits inside one of the managed sections diff --git a/frontend/README.md b/frontend/README.md index 9717204c..8bab5d97 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -30,7 +30,7 @@ layers per-agent additions on top of the default agent dist. 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`, `swarm.js`, imported by the dashboard entry); `shared` holds both kinds of module. No + (`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 diff --git a/frontend/packages/dashboard/src/agent-menu/hive-agent-menu.js b/frontend/packages/dashboard/src/agent-menu/hive-agent-menu.js index afa4d261..8267589f 100644 --- a/frontend/packages/dashboard/src/agent-menu/hive-agent-menu.js +++ b/frontend/packages/dashboard/src/agent-menu/hive-agent-menu.js @@ -1,6 +1,6 @@ // hive-agent-menu.js — , the per-agent "⋮" context-menu // custom element. One instance per agent card, appended after -// .card-body in the container row's flex layout (swarm.js's +// .card-body in the container row's flex layout (agents.js's // buildContainerLi via buildAgentMenu). // // Deliberately a *light-DOM* element with no shadow root of its own: all @@ -66,7 +66,7 @@ async function agentMenuPost(actionPath, name, body, flags) { class HiveAgentMenu extends HTMLElement { connectedCallback() { // Same reconnect-without-detach hazard as (see its - // connectedCallback comment) — swarm.js's row cache can move an + // connectedCallback comment) — agents.js's row cache can move an // already-built
  • subtree without a real detach. Without this // guard a reconnect would append a second on top of the // first, doubling the dropdown. diff --git a/frontend/packages/dashboard/src/swarm.js b/frontend/packages/dashboard/src/agents.js similarity index 98% rename from frontend/packages/dashboard/src/swarm.js rename to frontend/packages/dashboard/src/agents.js index 1dec57fe..313f6043 100644 --- a/frontend/packages/dashboard/src/swarm.js +++ b/frontend/packages/dashboard/src/agents.js @@ -1,4 +1,4 @@ -// SW4RM (containers) domain — extracted from tabs.js. +// 4G3NTS (containers) domain — extracted from tabs.js. // Agent topology, container-row rendering, selection bar, and all // live-update apply handlers for container-state, transient, and // job-queue-rollup ops. See docs/web-ui/dashboard.md::Container row for the @@ -52,7 +52,7 @@ const selectionState = new Set(); // ─── job queue rollup (queue-summary banner only) ────────────────────────── // // The ONE piece of job-queue-derived state on this page, and deliberately -// narrow — mara: "swarm.js should not need to pull in the jobq to do its +// narrow — mara: "agents.js should not need to pull in the jobq to do its // job." Rendering is owned by the shared `JobqRollup` Preact component // (same one swarm-ui's /jobs page mounts, self-fetching // GET /api/jobq/rollup); this file just calls `render(h(...))` and bumps @@ -752,7 +752,7 @@ export function renderContainers(s) { } // ─── selection bar ─────────────────────────────────────────────────────────── -// Sticky-bottom strip; visible when >=1 agent selected on the SW4RM +// Sticky-bottom strip; visible when >=1 agent selected on the 4G3NTS // tab. See docs/web-ui/dashboard.md::Selection bar for the interaction model // and the per-action availability rules (disabled-with-tooltip for // actions that don't apply to the full selection). Actions POST per @@ -767,11 +767,12 @@ export function renderSelectionBar(containers) { if (!countSpan || !namesSpan || !actions) return; const selected = containers.filter((c) => selectionState.has(c.name)); - // Tab-gate: bar only renders on SW4RM (the only tab with agent + // Tab-gate: bar only renders on 4G3NTS (the only tab with agent // cards to cross-reference). Selection state lives in-memory and - // the bar reappears on return to SW4RM if still non-empty. - const onSwarmTab = (document.body.dataset.activeTab || "swarm") === "swarm"; - if (!selected.length || !onSwarmTab) { + // the bar reappears on return to 4G3NTS if still non-empty. + const onAgentsTab = + (document.body.dataset.activeTab || "agents") === "agents"; + if (!selected.length || !onAgentsTab) { bar.hidden = true; document.body.classList.remove("has-selection"); return; diff --git a/frontend/packages/dashboard/src/common.css b/frontend/packages/dashboard/src/common.css index 5d5d57ec..307bc90e 100644 --- a/frontend/packages/dashboard/src/common.css +++ b/frontend/packages/dashboard/src/common.css @@ -84,7 +84,7 @@ code { Semantic colour variants only — shape comes from `hive-pill-sm` (shared with the agent UI's pill/chip family, @hive/shared/pill.css), carried directly in the markup alongside each of these classnames - (swarm.js/core.js/builds.js). Used on container rows and build-log + (agents.js/core.js/builds.js). Used on container rows and build-log rows. */ .badge-warn { color: var(--amber); diff --git a/frontend/packages/dashboard/src/dashboard.css b/frontend/packages/dashboard/src/dashboard.css index b3322d3f..c1ecf3c6 100644 --- a/frontend/packages/dashboard/src/dashboard.css +++ b/frontend/packages/dashboard/src/dashboard.css @@ -127,14 +127,14 @@ body.dashboard-shell { font-weight: bold; } /* `display` above beats the UA's `[hidden]` rule, so an empty count (the - SW4RM and R3BU1LD QU3U3 pills at zero) would otherwise draw a "0". */ + 4G3NTS and R3BU1LD QU3U3 pills at zero) would otherwise draw a "0". */ .tab-count[hidden] { display: none; } /* Tab pane visibility — createTabStrip (@hive/shared/tabs.js) sets the `hidden` attribute on every inactive pane (resolved from the URL hash; - default — no hash — is SW4RM). Only the active pane stays visible. */ + default — no hash — is 4G3NTS). Only the active pane stays visible. */ .tab-pane[hidden] { display: none; } @@ -322,7 +322,7 @@ hive-agent-menu { --menu-btn-opacity: 1; } /* Card actions dim while a row has any pending-state badge (transient- - driven only now — see swarm.js's pending-badge derivation comment; + driven only now — see agents.js's pending-badge derivation comment; there is no separate queued-but-not-running row state to tell apart from this one anymore). */ .container-row.pending-running .actions { @@ -443,12 +443,12 @@ hive-agent-menu { shared component — amber/no-pulse for the standing caveat (a pulsing banner that's always present just teaches you to stop seeing it), `severity="red" pulse` for the port - collision (an incident, not a caveat). See core.js/swarm.js and + collision (an incident, not a caveat). See core.js/agents.js and hive-warn.css for the actual styling now. */ -/* Build-queue summary banner on the SW4RM tab moved to the shared +/* Build-queue summary banner on the 4G3NTS tab moved to the shared `JobqRollup` Preact component (`.jqr-*` classes, imported above) — - mounted by swarm.js::initJobqRollup into #jobq-rollup-section. */ + mounted by agents.js::initJobqRollup into #jobq-rollup-section. */ .pending-state { color: var(--amber); diff --git a/frontend/packages/dashboard/src/dashboard.html b/frontend/packages/dashboard/src/dashboard.html index ddfc25e1..fb889a80 100644 --- a/frontend/packages/dashboard/src/dashboard.html +++ b/frontend/packages/dashboard/src/dashboard.html @@ -26,14 +26,14 @@