hermes-agent/web/src/components
Ben 2fc4615fc4 feat(dashboard-auth): Phase 7 — SPA AuthWidget + /api/status auth fields
Phase 7 surfaces the OAuth gate state to users.

web/src/components/AuthWidget.tsx (new):
  Sidebar widget that fetches /api/auth/me on mount and renders a
  compact 'Logged in as <user_id…> via <provider>' row with a logout
  icon. Contract V1 (Nous Portal) emits no email/display_name claims,
  so user_id is the display value (truncated to 14 chars + ellipsis);
  display_name and email fallthroughs are forward-compat for OQ-C1.
  Renders nothing on 401 from /api/auth/me — that's the signal the
  gate isn't engaged (loopback mode), in which case the widget would
  be confusing.
  Logout POSTs /auth/logout (which clears cookies + redirects to
  /login) then full-page-navigates to /login itself; the SPA's fetch
  wrapper doesn't follow that redirect, so the navigation is explicit.

web/src/App.tsx: mounts <AuthWidget /> above <SidebarFooter />.
  Component is self-hiding in loopback mode so there's no need for a
  conditional mount.

web/src/lib/api.ts:
  - getAuthMe() + logout() helpers
  - AuthMeResponse type
  - StatusResponse gets optional auth_required + auth_providers fields
    so the existing StatusPage can render a gated/loopback badge.

hermes_cli/web_server.py: /api/status payload now includes
  - auth_required: bool — whether app.state.auth_required is True
  - auth_providers: list[str] — registered DashboardAuthProvider names
  Lazy-imports list_providers so early-startup status calls don't
  crash if the dashboard_auth module is still being set up.

tests/hermes_cli/test_dashboard_auth_status_endpoint.py: 3 new tests
covering the new status fields in both gated and loopback modes plus
a regression that no existing field got dropped from the payload.

The hermes status CLI is unchanged in this commit — that command
tracks model providers + OAuth credentials, not running-dashboard
state. The /api/status endpoint is the canonical place to query
dashboard auth-gate state, consumed by the React StatusPage already.
2026-05-27 02:12:27 -07:00
..
ui refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
AuthWidget.tsx feat(dashboard-auth): Phase 7 — SPA AuthWidget + /api/status auth fields 2026-05-27 02:12:27 -07:00
AutoField.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
Backdrop.tsx fix(web): consume bundled design system assets (#26391) 2026-05-19 07:47:55 -04:00
BottomPickSheet.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
ChatSidebar.tsx feat(dashboard-auth): SPA WS auth — getWsTicket() + buildWsAuthParam() 2026-05-27 02:12:27 -07:00
DeleteConfirmDialog.tsx feat: add sidebar 2026-04-24 00:56:19 -04:00
LanguageSwitcher.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
Markdown.tsx harden: restrict markdown link schemes; parse untrusted XML with defusedxml 2026-05-25 23:30:43 -07:00
ModelInfoCard.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
ModelPickerDialog.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
NouiTypography.tsx Merge upstream/main and address Copilot review feedback 2026-04-30 06:43:22 -04:00
OAuthLoginModal.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
OAuthProvidersCard.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
PlatformsCard.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
SidebarFooter.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
SidebarStatusStrip.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
SlashPopover.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
ThemeSwitcher.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00
Toast.tsx feat: dashboard OAuth provider management 2026-04-13 11:18:18 -07:00
ToolCall.tsx refactor(web): dashboard typography & contrast pass 2026-05-22 19:50:32 -07:00