Watch
0
0
Fork
You've already forked hyperhive
0

drop the sqlite event log nothing reads, and the comments naming routes that are gone

This commit is contained in:
iris 2026-11-16 04:40:22 +01:00 • committed by mara
commit cbda9c162f
3 changed files with 71 additions and 305 deletions

View file

@ -11,7 +11,7 @@ use super::LoginStateCell;
/// the credential files (via [`crate::login::clear_session`]) and flip
/// `LoginState::NeedsLogin`; `by` heads the Note. Returns what was wiped, for the response.
pub(crate) async fn force_logout(login: &LoginStateCell, bus: &Bus, by: &str) -> String {
// Step 1: SIGINT claude (best-effort, matches `post_cancel_turn`).
// Step 1: SIGINT claude (best-effort, as a cancel does).
let _ = super::sigint_claude();
// Step 2: delete OAuth credential files only — login::clear_session owns
// the file set and preserves session-history files alongside them.
@ -35,7 +35,7 @@ pub(crate) async fn force_logout(login: &LoginStateCell, bus: &Bus, by: &str) ->
}
/// Human-readable summary of a [`crate::login::ClearedSession`] outcome for
/// the `/api/logout` response + note. Deliberately distinguishes "nothing to
/// the login watch's note. Deliberately distinguishes "nothing to
/// delete" from "something's there but we couldn't delete it" — both leave
/// `wiped` empty, but only the former is actually "already logged out";
/// conflating them would report a stuck undeletable `.credentials.json` as

View file

@ -1,13 +1,12 @@
//! Per-container HTTP UI. SPA shape: `GET /` returns a static shell;
//! `GET /static/*` serves CSS + JS; `GET /api/state` returns the page
//! state as JSON; the JS app renders. Live events stream on
//! `/events/stream`. Action POSTs return either a
//! 303 Redirect (for browsers that submit the form normally) or just
//! 200 OK — the JS app re-fetches `/api/state` afterwards.
//! Per-container HTTP server: the stats and screen pages (`GET /stats`,
//! `GET /screen`, `GET /static/*`), `GET /` redirecting to `/stats`, the small
//! JSON the dashboard card and those pages read (`/api/state`,
//! `/api/dashboard-state`, `/api/stats`) and the live event stream
//! `/events/stream`.
//!
//! Handlers are split by concern into the submodules below; this file owns the
//! shared [`AppState`], the listener + router wiring in [`serve`], and a couple
//! of small shared helpers ([`error_response`], [`SOCKET_FETCH_TIMEOUT`]).
//! shared [`AppState`], the listener + router wiring in [`serve`], and the
//! claude-signalling helpers the cancel command and the login watch share.
mod auth;
pub(crate) use auth::force_logout;
@ -230,8 +229,8 @@ fn read_gui_vnc_port() -> Option<u16> {
std::env::var("HIVE_GUI_VNC_PORT").ok()?.parse().ok()
}
/// Outcome of [`sigint_claude`] — shared by `/api/cancel` and `/api/logout`
/// so both can render the same three cases.
/// Outcome of [`sigint_claude`] — shared by the cancel command and the login watch's
/// logout so both can render the same three cases.
enum SigintOutcome {
/// The tracked pid was signalled.
Signalled,

View file

@ -121,7 +121,7 @@ fn read_own_status() -> (Option<String>, Option<i64>) {
}
}
/// Build the navigation link list for the agent page header. URLs
/// Build the navigation link list for the dashboard card's icon strip. URLs
/// 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