Commit graph hyperhive/frontend
Author SHA1 Message Date
iris
6528a90233 fix(web_ui): drop stale (max) suffix from xhigh effort label
xhigh and max are distinct reasoning-effort levels (see EFFORT_LEVELS
in events.rs); labelling xhigh as '(max)' implied they were the same
level, per issue #2258.
2026-07-05 12:50:20 +02:00
damocles
788673341c refactor(term): add mutableRow to terminal api, use it for thinking_tokens 2026-07-05 12:39:26 +02:00
damocles
dc63bfcb23 fix(term): store text node ref for thinking_tokens, drop DOM dance 2026-07-05 12:20:37 +02:00
damocles
758f5ae5a8 fix(term): flex layout for details summary, fix thinking brain icon column 2026-07-05 12:10:24 +02:00
iris
40bd868f65 fix(agent-term): guard edit_schedule targets_add/remove against empty arrays
Empty arrays are truthy in JS so 'if (input.targets_add)' would emit
'+0 tgt' for an explicit []. Add .length guard so zero-element lists
are silently skipped — consistent with fmtArgsGeneric's [N] handling.

The MCP schema defaults both fields to null, making this theoretical,
but the guard is cleaner.
2026-07-04 18:22:05 +02:00
iris
f11357537e feat(agent-term): add formatters for scheduling and remaining request_* tools
Scheduling tools and the two remaining request_* tools fell through to
fmtArgsGeneric. They already had appropriate icons (⏱️ / 📦) but the
arg display was multi-field verbose.

New fmtToolUse cases:
- request_init_config: 'request_init_config* iris'
- request_update_meta_inputs: 'request_update_meta_inputs* [nixpkgs, …]'
  (or 'all' when inputs list is empty)
- list_schedules: 'list_schedules*()' (no args, explicit)
- cancel_schedule: 'cancel_schedule* #42 all' or '#42 [iris, dmatrix]'
- fire_schedule_now: 'fire_schedule_now* #42'
- edit_schedule: 'edit_schedule* #42 · body · interval · +2 tgt'
  (lists which fields are being changed, not their values)
- request_schedule_prompt: 'request_schedule_prompt* → iris at 14:00Z +3600s'

Closes #2201
2026-07-04 18:22:05 +02:00
iris
66057a97f7 fix(agent-term): split join_room/open_dm cases to fix open_dm always showing ?
join_room and open_dm shared a fall-through case with
(fmtRoom(input.room) || fmtUser(input.user_id) || '?'). fmtRoom()
returns the string '?' when input.room is undefined — truthy — so
the fmtUser() fallback was never reached and open_dm always displayed
'open_dm* ?'.

Split into two separate cases: join_room reads input.room, open_dm
reads input.user_id. Both degrade to '?' via fmtRoom/fmtUser's own
null guard.
2026-07-04 13:12:17 +02:00
iris
6c56bf76d6 feat(agent-term): matrix-tool icons + formatters, fill remaining fmtToolUse gaps
Add specific icons for matrix tools that had the generic 💬 fallback:
- mcp__matrix__read_room → 📖
- mcp__matrix__mark_read → 👁️
- mcp__matrix__list_rooms / list_room_members / list_invites → 📋
- mcp__bash__kill → 🛑 (was generic 🔧)

Add fmtToolUse cases for high-use tools that fell through to fmtArgsGeneric:
- set_status: 'set_status* "idle"' instead of 'set_status text: "idle"'
- get_loose_ends: 'get_loose_ends* [iris]' or 'get_loose_ends*()'
- get_agent_meta: 'get_agent_meta* iris' or 'get_agent_meta*()'
- cancel_loose_end: 'cancel_loose_end* question #42'
- bash kill: 'kill* abc123 [force]'
- Matrix tools: 'read_room* !abc1234 [50]', 'mark_read* !abc1234',
  'send_message* → !room: "body"', 'send_dm* → @mara: "body"',
  'send_reply*', 'send_reaction*', 'join_room*', 'open_dm*',
  'invite_user*', 'download_file*'

Also extend the short-name shortening to cover mcp__matrix__ prefix
(was only hyperhive + bash), so matrix tool rows show 'read_room*'
instead of 'mcp__matrix__read_room' as the prefix.

Two small helpers added: fmtRoom (truncates !id before ':' for
readability; keeps #alias intact) and fmtUser (@user:server → @user).

Closes #2198. Updates terminal-rendering.md icon list.
2026-07-04 13:12:17 +02:00
iris
94d537b7a9 feat(agent-term): show remind timing and message preview in tool row
`mcp__hyperhive__remind` calls previously rendered as the generic
`fmtArgsGeneric` output — with a multi-field input that showed
`message: "..." · delay_seconds: 300`, burying the message after
a verbose field name.

New format: `remind* +5m "check on PR..."` (or `at HH:MMZ` for
absolute timestamps). The timing renders first so it's scannable
at a glance, followed by the first 60 chars of the message body.
Works for all three input shapes: delay_seconds, at_unix_timestamp,
and file_path-only (shows the path as the preview).
2026-07-04 12:13:44 +02:00
iris
0a9f9a4fa6 feat(agent-term): complete tool-icon and fmtToolUse coverage
Several MCP tools appeared with the generic wrench icon (🔧) making
them hard to identify in the scrollback. fmtToolUse also lacked
specific formatters for some frequently-used tools, falling through
to fmtArgsGeneric.

Icons added:
- ack_until  →   (mark-as-read semantics)
- get_logs   → 📜  (log viewer)
- get_host_journal → 📜  (journal reader)

fmtToolUse cases added:
- ack_until          → "ack_until* ≤N" (message-id bound)
- get_logs           → "get_logs* <agent> [NL]"
- get_host_journal   → "get_host_journal* <container|unit> [/grep/] [NL]"
- restart/start/update → "restart* <name>" etc. (previously used
                          fmtArgsGeneric; now match kill's pattern)

Closes #2188.
2026-07-04 12:07:14 +02:00
iris
1fe6783756 feat(agent-term): show compact_boundary details in per-agent terminal
compact_boundary events currently render as the generic "⚙ compact_boundary"
muted note. The event carries useful metadata — pre/post token counts,
duration and trigger — that are invisible to the operator.

With this change the row reads:
  · ⚙ compact · manual · 772k→6k tokens · 101s

Fields rendered (all guarded — missing fields are silently omitted):
- trigger ("manual" or "auto")
- pre_tokens→post_tokens (formatted with k/M suffixes)
- duration_ms (ms or s)

Closes #2187.
2026-07-04 11:59:37 +02:00
iris
44531820d0 feat(agent-term): show details for plugin_install and commands_changed
Currently both system subtypes fall through to the generic muted
note renderer (⚙ <subtype>), giving the operator no insight into
what is happening.

plugin_install:
  Render status explicitly — "loading…" on started, "✓ done" on
  completed — so a slow plugin boot is visible in the scrollback
  instead of two identical cryptic rows.

commands_changed:
  Render the count of available slash commands in the summary row
  and expand to the full list in a collapsible details block. The
  list is most useful right after a fresh plugin_install so the
  operator can see exactly which /commands are now on offer.

Both handlers sit immediately before the generic catch-all in the
system-subtype dispatch in renderStream, preserving the existing
fall-through for other subtypes (context_window_exceeded etc.).

Closes #2183.
2026-07-04 11:59:37 +02:00
iris
9b607e2857 refactor(dashboard): extract SW4RM domain from tabs.js into swarm.js
tabs.js shrinks from 1651 to 457 lines. swarm.js is a new 1217-line
module that owns the containers/selection-bar/peer-hives domain:

- Container-state apply handlers (applyContainerStateChanged/Removed)
- Rebuild-queue sync + apply (syncRebuildQueueFromSnapshot, applyRebuildQueueChanged)
- Transient-state sync + apply (syncTransientsFromSnapshot, applyTransientSet/Cleared)
- renderContainersFromState (re-render from cached snapshot)
- Per-agent context menu (buildAgentMenu, agentMenuPost, closeAllAgentMenus)
- Topology tree builder (buildAgentTree, treePrefixDom)
- Container row (containerRowFingerprint, buildContainerLi, renderContainers)
- Selection bar (renderSelectionBar, addMoveActions, validReparentCandidates, addBulkButton)
- Peer hives section (renderPeerHives)
- Status-age ticker (30s setInterval for .status-age[data-set-at] spans)
- CTX_WARN/CTX_CAUTION constants
- Selection event listeners (Esc to clear, click on selection-clear)
- Agent-menu event listeners (click outside to close, Esc to close)

tabs.js (coordinator) retains:
- notifyDeltas + seenApprovals/seenQuestions/seededNotify
- bindAsyncForms
- Cross-domain ticker (approval request-age + reminder/schedule due-at)
- refreshState, pollTimer, operatorIsTyping, snapshotOpenDetails
- MUTATION_HANDLERS dispatch + bindDashboardStream
- activateTab, createTabStrip, initCall, refreshTabCounts, setTabCount

Behaviour-preserving code-move. Build verified.
2026-07-04 11:37:39 +02:00
damocles
cafef519a9 dashboard frontend: consume rfc3339 timestamps from the api 2026-07-02 22:28:30 +02:00
iris
1e15c8cc6b fix(dashboard): replace stale 'manager' with 'submitter' in approval UI text
Two operator-visible strings and one code comment still referenced 'the
manager' in the approval card UI:

- init_config card description: 'manager customises agent.nix before
  spawn' -> 'submitting agent customises agent.nix before spawn'
- deny form data-prompt: 'sent to manager' -> 'sent to submitter'
  (the deny note goes to the ApprovalResolved submitter, not a fixed
  manager role)
- code comment: 'surfaced to the manager via' -> 'surfaced to the
  submitting agent via'
- builds.html meta text: 'manager learns each outcome' -> 'the
  submitting agent learns each outcome'

The 'manager' role is no longer structural — root-ness is topological.
Any agent with the approvals tool group can submit; the note/event routes
to the submitter.
2026-07-02 14:15:07 +02:00
iris
688531030b fix(builds): add missing start/stop/graceful_stop kind glyphs to QUEUE_KIND_GLYPH
The QueueKind enum has graceful_stop, start, and stop variants but the
dashboard QUEUE_KIND_GLYPH map only covered rebuild/meta_update/spawn/
destroy/restart/startup_sweep/perm_change — the three missing kinds
rendered as '?' in the build queue UI.

This became visible with the deferred start-after-rebuild change: a fast-lane
Start entry now appears as a child of its Rebuild parent, but showed the
fallback '?' glyph.

Glyphs assigned: graceful_stop=⏹, start=▶, stop=■.

Also update the dashboard.md kind-glyph list to include all nine kinds and
note that deferred start-after-rebuild entries also use parent_id grouping.
2026-07-02 14:15:04 +02:00
damocles
ebb85e6291 fix(#2121): rebuild POST from agent term also missing api/ prefix (mara audit) 2026-07-01 19:33:25 +02:00
damocles
98b5e976af fix(#2121): add missing api/ prefix to answer-question POST from agent term 2026-07-01 19:33:25 +02:00
iris
5264828091 fix: view-queue link + agent inbox shows unread messages only
fix(dashboard): update 'view queue' link to /builds.html

The build queue moved to its own /builds.html page. The queue-summary
'view queue →' link in tabs.js still pointed at /core.html, so clicking
it landed on the wrong page.

fix(broker): filter agent inbox to unread (acked_at IS NULL)

recent_for was returning all messages regardless of ack state, so the
agent inbox showed everything even after 'mark all read'. Now filters
to acked_at IS NULL — mirroring exactly what mark_all_read drains —
so the inbox empties on reload after the operator drains it.
2026-07-01 18:41:43 +02:00
iris
cf16f81dee fix(terminal): add missing .tool-result-block.error red rule 2026-07-01 18:34:03 +02:00
iris
57f936af63 fix(agent): strip tool_use_error tags and render errors in red
When a tool call fails, claude wraps the result text in
<tool_use_error>...</tool_use_error> XML tags. The terminal was
displaying these raw, producing output like:
  '<tool_use_error>File has not been read yet.</tool_use_error>'

Fix renderToolResult in app.js:
- Check c.is_error on the tool_result content block.
- Strip the <tool_use_error>...</tool_use_error> wrapper from the text.
- Render error results with a '✗' prefix under '.tool-result.error'
  (flat, ≤120c) or '.tool-result-block.error' (<details>, longer text).

Add .live .tool-result.error { color: var(--red); } to terminal.css
so error results are visually distinct (red, same as turn-end-fail).

Update terminal-rendering.md row taxonomy to document the two new
error row classes.

Closes #2104.
2026-07-01 18:34:03 +02:00
iris
95b866a53d refactor(fe): trim >30-line comment blocks (second pass, #2077) 2026-06-29 01:05:53 +02:00
iris
ccc69bbc7b fix(dashboard): contain rebuild spinner within icon boundary 2026-06-29 01:05:34 +02:00
iris
964e55f0bb docs(web-ui/agent): add back-link nav + fix stale doc pointer in screen.html 2026-06-29 00:31:06 +02:00
iris
fe6685a155 refactor(fe): fix doc pointer in stream-worker.js to shape.md 2026-06-29 00:17:19 +02:00
iris
878aade8fa refactor(fe): trim impl-history and duplicated-docs prose from comments
Remove or shorten comment blocks that:
- explain where code used to live (impl history)
- duplicate rationale already in docs/web-ui.md
- contain speculative/future-work notes

Changes:
- tabs.js: drop "SYST3M tab used to render this" history; keep badge purpose
- schedules.js: drop "used to be a card layout" history + speculative nit note
- stream-worker.js: replace 10-line problem-statement with docs pointer
  (rationale already in docs/web-ui.md SSE multiplexing section); trim
  future-work parenthetical from subscription-tracking comment
- system-sections.css: drop extraction-history prose; keep what it does
- core.css: drop move-history prose; keep what it imports and why

Part of issue cleanup per operator feedback.
2026-06-29 00:12:30 +02:00
iris
c7c4a40e49 fix(builds): remove unused form import (copy-paste residue from core.js) 2026-06-28 23:56:11 +02:00
iris
beb28d5c37 feat(builds): add /builds.html — build lifecycle hub (closes #1999)
New standalone page /builds.html consolidating rebuild queue, meta
inputs, and build log history into one place, with a new 'Builds' home
tile linking to it. Addresses mara's request: new sub-page with a new
home tile, all three items moved there.

Changes:
- builds.html: new page with three sub-tabs: R3BU1LD QU3U3, M3T4 1NPUTS,
  BUILD L0GS. Same minimal-chrome header + createTabStrip pattern as core
  and logs pages.
- builds.js: new bundle combining rebuild queue renderer (from core.js),
  meta inputs renderer (from core.js), rebuild-live-log renderer (from
  core.js), and build log history renderer (from logs.js). Deep-links to
  /builds.html?id=N#buildlogs. Count pill id: builds-tab-count-rebuild.
  BUILD L0GS tab lazy-loads on first activation.
- builds.css: @imports system-sections.css (rebuild queue + meta inputs +
  live-log styles) and logs.css (build-logs-* component styles).
- build.mjs: register builds.js, builds.css, builds.html.
- core.html: remove R3BU1LD QU3U3 + M3T4 1NPUTS tabs (now on builds.html).
  Default tab changes to K3PT ST4T3.
- core.js: remove renderMetaInputs, renderRebuildQueue + helpers,
  renderRebuildLiveLog + live-log state, elapsed-time tickers,
  updateRebuildCount, and the rebuild_queue/meta_inputs SSE handlers.
  Remove openBuildLogStream + util imports no longer needed.
- core.css: remove .rebuild-live-log-* rules (moved to system-sections.css
  so builds.css can share them via @import).
- system-sections.css: add .rebuild-live-log-* styles (moved from core.css);
  update comment to mention builds.html.
- logs.html: remove BUILD tab + pane (moved to builds.html).
- logs.js: remove fetchBuild(), fmtTs, fmtDuration, openBuildLogStream
  import, and rebuild_queue_changed SSE debounce. Default tab: 'agent'.
  SSE stream retained for audit_entry_added live-appends.
- index.html: add Builds tile (🔨, rebuild queue · meta inputs · build
  logs); update Core tile desc to 'kept state · container load'; update
  Logs tile desc to remove 'build'.
2026-06-28 23:56:11 +02:00
iris
4df286345a refactor(permissions): move ghost-perm detection server-side
Add GET /api/permissions/stale endpoint that returns agent names with
explicit capability/tool-group JSON entries but no live container AND
no kept-state tombstone. Ghost detection is now entirely server-side —
one authoritative call, no client-side roster cache, no staleness window.

The previous client-side approach in core.js made three parallel API
calls (GET /api/capabilities, GET /api/tool-groups, GET /api/state) and
filtered the result against a module-level `liveContainerNames` Set
populated only on cold load and form submits. Any container lifecycle
event (spawn, destroy) while core.html was open left `liveContainerNames`
stale, risking a false-positive ghost entry for a live container.

Changes:
- permissions.rs: add `get_stale_permissions` handler + `StalePermsResponse`
  struct. Computes live roster (containers_snapshot), tombstone set
  (Coordinator::kept_state_names), explicit perm names (capabilities::read
  + tool_groups::read), then returns the difference sorted.
- dashboard.rs: register GET /api/permissions/stale.
- core.js: replace the three-call client-side logic in
  `fetchAndRenderStalePerms` with a single fetch to /api/permissions/stale.
  Remove `liveContainerNames` state + its syncFromSnapshot population.
2026-06-28 23:29:51 +02:00
iris
6ab0757cc6 feat(core): add stale permission entries sub-section to K3PT ST4T3
Adds a "stale permission entries" sub-section within the K3PT ST4T3 pane
on /core.html showing agents with explicit capability/tool-group JSON
entries but no live container — typically renamed or manually-deleted agents
whose entries persisted (e.g. the old "root" manager name after rename to
"ruth").

Each ghost agent gets a "✕ clear perms" button that calls
DELETE /api/permissions/{agent} (added in the prior commit). Lazy-loaded
on first K3PT ST4T3 tab activation; auto-refreshes on capabilities_changed
and tool_groups_changed SSE events.

core.js: track liveContainerNames from /api/state.containers; add
renderStalePerms + fetchAndRenderStalePerms; hook tab onShow + SSE handlers.

system-sections.css: new .tombstones-stale-* selectors for the ghost list
rows and error message.

core.html: add #tombstones-stale-perms div inside the K3PT ST4T3 pane;
expand comment to describe both sub-sections.
2026-06-28 23:29:51 +02:00
damocles
24cf69f72c fix(#1988): correct stale api/state reference in vnc auth comment 2026-06-28 01:38:56 +02:00
damocles
194da43c66 fix(#1988): send agent username not root for vnc apple-dh auth 2026-06-28 01:38:56 +02:00
iris
4375ab6246 feat(dash): show active model badge on agent cards (closes #2069)
Read the persisted model name from each agent's harness state file
(harness/hyperhive-model) and surface it as a small blue badge on
the container row in the SW4RM tab.

- container_view.rs: add `active_model: Option<String>` to
  ContainerView; populated by new `read_active_model` helper that
  reads harness/hyperhive-model; only set when container is running
  (stale model info from a stopped agent is misleading)
- container_view.rs: add active_model to ContainerView literal in
  host_stats test helper
- tabs.js: render badge-model chip after needs-update, before
  reminders; add active_model to the row fingerprint so re-renders
  fire on model change
- common.css: add .badge-model (blue, 80% opacity — informational)
2026-06-27 22:59:40 +02:00
iris
2bfa5bc1a8 feat(schedules): make schedules pausable
Adds pause/resume support for scheduled prompts.

Backend:
- New paused_at_unix column on scheduled_prompts table (added via
  ALTER TABLE migration so existing databases are upgraded on first
  start). The due-rows index is dropped and recreated to also exclude
  paused rows so the worker never fires them while paused.
- Worker's due() query gains AND paused_at_unix IS NULL filter.
- New pause(id) and resume(id) methods on ScheduledPrompts; both are
  idempotent and refuse cancelled rows.
- New POST /api/schedules/{id}/pause and /api/schedules/{id}/resume
  dashboard endpoints (operator-direct, no approval gate). Both emit
  a schedules snapshot on success so the tab updates live.
- WireSchedule gains paused_at_unix: Option<i64> so the frontend can
  render the state without an extra fetch.

Frontend:
- Paused rows render with a distinct row class + muted opacity.
- The next-fire cell shows a yellow pause glyph + tooltip with the
  paused-since timestamp and the would-have-fired time.
- Actions column: pause/resume toggle button (⏸/▶) beside fire/edit/cancel.
  Fire-now is disabled while paused (resume first).
- Sort order: active → paused → cancelled (paused slot keeps schedules
  visible without mixing them into the active top section).
- pauseSchedule() / resumeSchedule() async functions POST to the new
  endpoints and refresh the table on success.
2026-06-27 20:01:16 +02:00
iris
31433da3aa fix(permissions): propagate I/O errors as 500 from delete_agent_permissions
Both remove_agent() calls now run unconditionally for maximum partial
cleanup, but any I/O error is returned as HTTP 500 instead of silently
200-ing — so the frontend's !resp.ok path fires and the operator sees a
meaningful error rather than the stale row reappearing unchanged.

Also add a clarifying comment on isStale in permissions.js explaining
that containersState is keyed from nixos-container list (which includes
stopped-but-configured containers), so a temporarily-stopped agent is
not treated as stale — only destroyed/renamed agents are absent.
2026-06-27 13:44:11 +02:00
iris
a8fb33e2ee fix(permissions): mark stale agents and allow removing their explicit entries
The P3RM1SS10NS tab showed agents that no longer exist in the live
container roster — e.g. an agent named 'root' that was renamed or
destroyed but still had explicit entries in tool-groups.json and/or
capabilities.json. The roster-union behaviour is intentional for
temporarily-stopped agents, but stale entries from renamed/destroyed
agents are confusing.

Backend (dashboard/permissions.rs):
- New DELETE /api/permissions/{agent} handler that bypasses the live-
  roster guard (intentionally — that's the point). Calls
  tool_groups::remove_agent + capabilities::remove_agent to clear both
  JSON files, then emits live SSE snapshots so the tab updates without
  a page reload. Format-checks the agent name but does not require it to
  be in the containers snapshot.

Frontend (permissions.js):
- renderCapabilities / renderToolGroups now cross-reference agentNames
  against containersState (the live roster, already imported). Agents
  not in the live roster get an isStale flag.
- Stale rows get a '(not running)' label and a '✕ remove' button that
  calls clearStaleAgent() — a new async helper that DELETEs the stale
  entry and re-fetches both perm tables.
- Non-stale agents without explicit assignments still get '(default)'.

CSS (dashboard.css):
- .perm-row-stale (reduced opacity), .perm-stale-label (muted small
  text), .perm-remove-btn (small red-bordered button) + disabled state.
2026-06-27 13:44:11 +02:00
damocles
f060456860 feat(#2024): add /effort terminal slash command 2026-06-27 13:35:14 +02:00
iris
145f58b0b1 fix(core): add rebuild-live-log class to live-log container div
The CSS for the rebuild-queue live-log panel targets .rebuild-live-log
(border, border-radius, margin-top, background) but the HTML element only
had id="rebuild-live-log" — no class. As a result the panel box styles
never applied and the live log rendered unstyled (no border, no background,
no visual separation from the queue rows).

Fix: add class="rebuild-live-log" to the element so the CSS selector
matches.
2026-06-27 13:28:23 +02:00
iris
c65201ed7c fix(dashboard): render update_meta_inputs + schedule_prompt approval cards
Both kinds fell through to the spawn branch in renderApprovals, showing
a misleading 'spawn' chip and agent-spawn body text. Mara saw a meta-input
bump render as a spawn card for agent damocles and denied it.

Backend (dashboard.rs):
- Add commit_ref: None to the MergeConfigPr arm (struct was incomplete).
  All arms of ApprovalView now initialise every field.

Frontend (call.js):
- Add isUpdateMeta / isSchedule booleans alongside the existing kind flags.
- Glyph: update_meta_inputs gets ↻, schedule_prompt gets ⏱.
- Kind chip: 'meta-update' / 'schedule' (no kind-spawn class for either).
- Body: update_meta_inputs parses commit_ref as JSON Vec<String> and shows
  'bump flake inputs: foo, bar' or 'bump all flake inputs'; schedule_prompt
  parses SchedulePromptPayload and shows targets + first-fire time + cadence
  + a truncated body excerpt.
- History row: add 'meta-update' and 'schedule' cases (were both 'spawn').
- Import fmtDuration from util.js (needed for schedule cadence display).
2026-06-27 13:03:41 +02:00
damocles
09dc3682d7 fix(#1995): send {} body on schedule cancel-all (was empty body 400) 2026-06-26 01:23:06 +02:00
damocles
49db9d6e1c feat(#1990): surface pending recv() message count in get_loose_ends 2026-06-26 01:22:20 +02:00
iris
211dab6f90 fix(dashboard): carry pr_number on live approval_added
Completes the merge_config_pr approval-card link for live-added approvals.
The ApprovalAdded SSE event now carries pr_number (only for
merge_config_pr); applyApprovalAdded was dropping it, so a live-added
merge_config_pr card showed the sha but not the 'review PR on forge' link
until a cold /api/state reload. Carry pr_number through the same way as
sha_short.
2026-06-23 18:44:13 +02:00
iris
efb34ef677 fix(dashboard): drop stale manager destroy-hiding comment + vestigial block
Follow-up to the destroy-guard removal — the bootstrap/root container is
now destroyable end-to-end. The frontend already offered DESTR0Y/PURG3
for every container; the only manager-gating left was a stale doc-comment
('destroy/purge hidden for the manager') and a vestigial bare block
wrapping the menu appends. Drop both (no behaviour change), and update the
dashboard.md menu doc: 'disabled for the bootstrap container' -> available
for any container (hive-c0re recreates it on next startup if destroyed).
2026-06-23 18:33:45 +02:00
iris
d1125207b4 fix(#1940): render merge_config_pr approval cards
renderApprovals had no merge_config_pr case, so those approvals
mis-rendered as generic spawn cards (spawn chip, no sha, 'container will
be created' body). Add a dedicated branch:
- distinct glyph + 'merge-pr' kind chip
- show the reviewed PR-head sha (sha_short), like apply_commit
- a 'review PR on forge' link built from pr_number (now on ApprovalView),
  gated on forge_present, mirroring the apply_commit 'commit on forge' link
- no config-diff side-panel (apply_commit-only for now)
History rows get the 'merge-pr' chip too.
2026-06-23 17:24:03 +02:00
iris
684c85686e feat(stats): add an 'all' time range to agent + hive stats
Adds a Window::All option to the per-agent stats page and the hive-wide
rollup, selectable as a new 'all' tab on both.

- hive-ag3nt (per-agent, time-bucketed): All ranges from MIN(started_at)
  to now (fallback to now on an empty table) with an adaptive bucket
  width laddered by span — hourly <=2d, daily <=90d, weekly <=2y, 30-day
  beyond — so the trend series stays bounded (~<=104 buckets) at any age.
- hive-c0re (swarm rollup, not time-bucketed): All sets from=0 so the
  aggregate covers every recorded turn across all agents.
- frontend: an 'all' button on both the agent stats and dashboard hive
  stats window selectors (createTabStrip + fetch already pass the window
  string through, so no JS change needed).

cargo check passes on both crates; FE builds clean. Fixes #1919.
2026-06-22 23:47:20 +02:00
iris
581e5e3b4c fix(dashboard): send graceful=true not =1 for the kill query param
The kill endpoint deserializes ?graceful as a strict bool (true/false),
so the dashboard's ?graceful=1 failed with 'provided string was not
true or false' and graceful shutdown silently broke. The stop and
bulk-stop buttons build the param at two call sites in tabs.js; send
graceful=true instead (a hard kill still omits the param entirely).
Keeps the API contract strict — the FE one-liner damocles and I agreed
on, superseding the lax-bool deserializer in the closed #1917.
Fixes #1914.
2026-06-22 23:24:36 +02:00
iris
5ae5657ca4 fix(dashboard): extract themed-dialog styles into an importable modal.css
The themed dialog component (modal.js: themedConfirm / themedPrompt /
themedToast) is raised from common.js's data-async / data-confirm
handler, which every page loads — but its .tc-* styles lived only in
dashboard.css (the main tabbed dashboard's stylesheet). So on any
standalone page (core/C0R3, settings, flow, logs) a dialog rendered
completely unstyled: the build-queue rebuild-cancel confirm came up as
raw text.

Extract the .tc-* rules into a dedicated modal.css component (paired
with modal.js) and @import it from common.css, so the styles load
wherever a dialog can fire — not just the main dashboard. esbuild
inlines the @import into the common.css bundle, so there's no extra
request and the main dashboard is visually unchanged (it loads
common.css too). The stale 'themedConfirm() in common.js' comment is
gone with the move. Fixes #1910.
2026-06-22 22:24:42 +02:00
iris
aa55f8c777 fix(dashboard): import appendLinkified in schedules.js
renderReminders() calls appendLinkified() (for the reminder file_path
and message bodies) but schedules.js only imported { $, el } from
common.js, so the reminders_changed SSE handler threw
'ReferenceError: appendLinkified is not defined' and the reminders
pane failed to render. appendLinkified is exported from common.js;
add it to the import. Fixes #1909.
2026-06-22 22:18:39 +02:00
iris
fe974c580d dashboard(matrix-accounts): dim live dot when daemon heartbeat stalls
The daemon now force-rewrites its matrix-accounts.json snapshot every
~30s, so as_of_unix advances while the daemon is alive and a stalled
value is an honest 'stopped publishing' signal rather than just an old
snapshot. Use it: when an account's snapshot still says live but as_of
hasn't advanced in more than ~90s (3 missed heartbeats) and the
container is NOT explicitly down, dim + desaturate the green dot and
label it 'online · no heartbeat', with a tooltip explaining the daemon
is likely dead or wedged. The container cross-ref still takes
precedence — a stopped container stays the solid amber 'stale'. Keeps
the existing 3 states intact; adds a distinct degraded-green sub-state.
2026-06-22 14:15:19 +02:00
iris
0ec9e8b8a0 dashboard(matrix-accounts): shape-agnostic login error bodies
The matrix-account-login endpoint returns failures as a bare plain-text
body today (hive-c0re error_response). The RFC 9457 rework moves it to
application/problem+json. The submit handler previously called
resp.json() on the error path, which threw on the plain-text body and
collapsed every real failure to a generic 'login failed (HTTP 500)',
hiding the actual reason.

Read the error body shape-agnostically: parse JSON only on 2xx for the
success envelope; on failure read the body once as text and, if it
parses as JSON, surface problem+json 'detail' (then 'error'/'title'
fallbacks), else use the raw text. This handles both the current
plain-text and the future problem+json shapes with no BE/FE merge-order
coupling. Header contract doc updated to match.
2026-06-22 13:43:22 +02:00