System Architecture
The web application follows a standard React architecture using TypeScript, leveraging a centralized state hook (useConsoleAppState) and a specialized API client (ConsoleApiClient) for communicating with the daemon’s HTTP surface.
Web Console Component Relationship
Sources: apps/web/src/App.tsx#11-33, apps/web/src/console/useConsoleAppState.tsx#165-220, apps/web/src/console/ConsoleSectionContent.tsx#26-108, crates/palyra-daemon/src/transport/http/handlers/console/mod.rs#1-30Core Components
| Component | Responsibility | Location |
|---|---|---|
ConsoleApiClient | Low-level HTTP transport, CSRF handling, and NDJSON stream parsing. | apps/web/src/consoleApi.ts |
useConsoleAppState | Centralized state management, domain logic, and auto-refresh orchestration. | apps/web/src/console/useConsoleAppState.tsx |
ConsoleRoutedShell | The main layout wrapper providing the sidebar and navigation context. | apps/web/src/console/ConsoleRoutedShell.tsx |
ConsoleSectionContent | A switch-based router that renders specific sections based on the current path. | apps/web/src/console/ConsoleSectionContent.tsx |
Authentication and Boot Sequence
The console implements a robust boot sequence to ensure the operator is authenticated before accessing privileged data. It supports standard session-based login and a specialized “desktop handoff” mechanism for seamless transition from the Palyra Desktop app.- Booting State: The
Appcomponent initially rendersConsoleBootScreenwhileuseConsoleAppStateattempts to retrieve a valid session apps/web/src/App.tsx#16-18. - Handoff Check: The system checks for a
desktop_handoff_tokenin the URL query parameters to automatically authenticate users coming from the desktop supervisor apps/web/src/console/useConsoleAppState.tsx#110-124. - Session Validation: If no handoff occurs, it calls
api.getSession()to check for existing cookies apps/web/src/console/useConsoleAppState.tsx#89-108. - Auth Fallback: If unauthenticated, the user is redirected to
ConsoleAuthScreenapps/web/src/App.tsx#20-30.
Navigation and Domains
The console organizes its features into five primary navigation groups, defined inCONSOLE_NAV_GROUPS apps/web/src/console/navigation.ts#26-52.
| Group | Sections | Purpose |
|---|---|---|
| Chat | chat | Real-time agent interaction and session management. |
| Observability | overview, sessions, usage, logs, inventory, support | System health, token usage, and runtime logs. |
| Control | approvals, cron, channels, browser | Human-in-the-loop gates and automation scheduling. |
| Agent | agents, skills, memory | Configuring agent personas, tools, and long-term memory. |
| Settings | auth, access, config, secrets, operations | Identity providers, vault management, and system config. |
Section Auto-Refresh
To maintain high observability without manual page reloads, the console implements a TTL-based auto-refresh mechanism. Each section has a definedAUTO_REFRESH_SECTION_TTL_MS (e.g., 10 seconds for the overview) apps/web/src/console/useConsoleAppState.tsx#43-55. The shouldAutoRefreshSection function determines if a domain’s data is stale and triggers a background fetch via the corresponding domain hook apps/web/src/console/useConsoleAppState.tsx#63-73.
Child Pages
- Console API Client and State Management
Detailed documentation of the
ConsoleApiClient, CSRF mechanics, and theuseConsoleAppStatestate machine. - Chat Interface and Slash Commands
Deep dive into the
ChatConsolePanel, the A2UI rendering engine, and the command palette. - Console Sections Reference
A reference guide for every functional section within the dashboard, from
ApprovalstoUsage.