remove the forge links from the hive dashboard and the agent page
Each agent row on the hive dashboard, and the agent page's link menu, linked to the agent's forge profile and its config repo. Both are gone, with what only they used: - hive-agent no longer builds the two links, the `Forge` link kind, or the `forge_public_url` field of its state, and no longer reads `HIVE_FORGE_PUBLIC_URL`. The agent page's link menu and the dashboard row's icon strip (which skips a forge link an agent not yet rebuilt still sends) drop their forge handling. - hive-c0re's dashboard state no longer carries `forge_public_url`. - `HIVE_FORGE_PUBLIC_URL` is no longer forwarded to agents through the meta flake (the forwarded-variable list, its test fixture, the controller's settings and the VM test), so the next meta flake render differs by that one line. hive-c0re still reads it for the forge URL a hive publishes, so `swarm.forge.publicUrl` stays, with its description corrected. - The docs stop describing the links.
This commit is contained in:
parent
1b6d7f3c99
commit
d516bb890c
1 changed files with 49 additions and 148 deletions
|
|
@ -47,10 +47,7 @@ pub(super) async fn api_state(State(state): State<AppState>) -> axum::Json<State
|
|||
context_window_tokens,
|
||||
ctx_usage,
|
||||
cost_usage,
|
||||
links: agent_links(&state.label, state.gui_vnc_port.is_some()),
|
||||
forge_public_url: std::env::var("HIVE_FORGE_PUBLIC_URL")
|
||||
.ok()
|
||||
.filter(|s| !s.is_empty()),
|
||||
links: agent_links(state.gui_vnc_port.is_some()),
|
||||
hive_name: crate::identity::hive_name(),
|
||||
swarm_name: crate::identity::swarm_name(),
|
||||
effort: shown.effort,
|
||||
|
|
@ -87,7 +84,7 @@ pub(super) async fn api_dashboard_state(
|
|||
ctx_tokens,
|
||||
context_window_tokens,
|
||||
rate_limited,
|
||||
links: agent_links(&state.label, state.gui_vnc_port.is_some()),
|
||||
links: agent_links(state.gui_vnc_port.is_some()),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -148,13 +145,6 @@ pub(super) struct StateSnapshot {
|
|||
/// — single source of truth. See [`docs/2-handbook/hives/dashboard.md::Container row`]
|
||||
/// for the frontend resolver + which links appear in which conditions.
|
||||
links: Vec<AgentLink>,
|
||||
/// Public URL of the forge (e.g.
|
||||
/// `"https://forge.pr1ma.darkest.space"`). Sourced from
|
||||
/// `HIVE_FORGE_PUBLIC_URL` (set from
|
||||
/// `services.hyperhive.swarm.forge.publicUrl`); `None` when unset. The frontend uses this to build
|
||||
/// forge nav-strip links, and **hides** the forge link entirely
|
||||
/// when absent rather than guessing `<hostname>:3000`.
|
||||
forge_public_url: Option<String>,
|
||||
/// Human name of this hive instance (e.g. `"pr1ma"`). Sourced
|
||||
/// from `HYPERHIVE_HIVE_NAME`; `None` when unset. The frontend
|
||||
/// uses this for the page `<title>` and header label so browser
|
||||
|
|
@ -190,7 +180,7 @@ pub(super) struct StateSnapshot {
|
|||
/// of truth for what links an agent exposes.
|
||||
#[derive(Serialize)]
|
||||
struct AgentLink {
|
||||
/// `kind = Container | Forge` → path; `kind = External` → full URL.
|
||||
/// `kind = Container` → path; `kind = External` → full URL.
|
||||
/// The frontend prepends the right base before rendering.
|
||||
url: String,
|
||||
icon: String,
|
||||
|
|
@ -209,10 +199,6 @@ enum AgentLinkKind {
|
|||
/// `/screen`). Agent page: same-origin path. Dashboard:
|
||||
/// `http://<host>:<container.port><url>`.
|
||||
Container,
|
||||
/// `url` is a path on the local Forgejo (`/<label>`,
|
||||
/// `/agent-configs/<label>`). Both surfaces:
|
||||
/// `http://<host>:3000<url>`.
|
||||
Forge,
|
||||
/// `url` is already a fully-qualified absolute URL — use as-is.
|
||||
/// Agent-declared `services.hyperhive.agent.dashboardLinks` extras arrive here.
|
||||
External,
|
||||
|
|
@ -272,7 +258,7 @@ fn read_own_status() -> (Option<String>, Option<i64>) {
|
|||
}
|
||||
|
||||
/// Build the navigation link list for the agent page header. URLs
|
||||
/// are paths (relative) for `Container`/`Forge` targets and absolute
|
||||
/// are paths (relative) for `Container` targets and absolute
|
||||
/// for `External`; the frontend resolves each against its `kind`
|
||||
/// against the right base so the backend never has to guess the
|
||||
/// operator's browser host. See
|
||||
|
|
@ -282,16 +268,9 @@ fn read_own_status() -> (Option<String>, Option<i64>) {
|
|||
/// Icons are real emoji, not unicode arrow/geometric glyphs — mara:
|
||||
/// operator-declared `dashboardLinks` extras are already free-choice
|
||||
/// emoji, so the built-ins should read as the same family rather than
|
||||
/// mixing in plain text glyphs (which also don't reliably render as a
|
||||
/// hexagon/arrow across fonts to begin with). `config` went through two
|
||||
/// rounds on this: gear (`⚙`, with and without a variation selector)
|
||||
/// still rendered broken in mara's browser either way — same
|
||||
/// font-unreliable codepoint `icons.tsx` already documents avoiding.
|
||||
/// Landed on the wrench (`🔧`) instead: a supplementary-plane pictograph
|
||||
/// with `Emoji_Presentation=Yes`, same category as every other icon
|
||||
/// here (`📊`/`🖥`/`🔨`/`🧭`), so it doesn't need a variation selector to
|
||||
/// render as color emoji in the first place.
|
||||
fn agent_links(label: &str, gui_enabled: bool) -> Vec<AgentLink> {
|
||||
/// mixing in plain text glyphs (which also don't reliably render across
|
||||
/// fonts to begin with).
|
||||
fn agent_links(gui_enabled: bool) -> Vec<AgentLink> {
|
||||
let mut links = Vec::new();
|
||||
|
||||
links.push(AgentLink {
|
||||
|
|
@ -310,26 +289,6 @@ fn agent_links(label: &str, gui_enabled: bool) -> Vec<AgentLink> {
|
|||
});
|
||||
}
|
||||
|
||||
// Either copy of the forge token: the one fetched from the swarm secret
|
||||
// store (`HIVE_FORGE_TOKEN_FILE`), or the state-dir file the hive used
|
||||
// to write.
|
||||
let fetched_token = std::env::var_os("HIVE_FORGE_TOKEN_FILE")
|
||||
.is_some_and(|p| std::path::Path::new(&p).is_file());
|
||||
if fetched_token || crate::paths::state_dir().join("forge-token").is_file() {
|
||||
links.push(AgentLink {
|
||||
url: format!("/{label}"),
|
||||
icon: "🔨".to_owned(),
|
||||
label: "forge".to_owned(),
|
||||
kind: AgentLinkKind::Forge,
|
||||
});
|
||||
links.push(AgentLink {
|
||||
url: format!("/agent-configs/{label}"),
|
||||
icon: "🔧".to_owned(),
|
||||
label: "config".to_owned(),
|
||||
kind: AgentLinkKind::Forge,
|
||||
});
|
||||
}
|
||||
|
||||
// Agent-declared extras (`services.hyperhive.agent.dashboardLinks` → the
|
||||
// `hive-dashboard-links` NixOS oneshot writes them to
|
||||
// `{state_dir}/hyperhive-dashboard-links.json`). Shape on disk
|
||||
|
|
|
|||
Loading…
Reference in a new issue