palyrad daemon, interacting with agents via a rich chat interface, monitoring system health, and configuring security policies. It communicates with the daemon’s HTTP surface via the ConsoleApiClient, using a session-based authentication model that supports both direct login and seamless handoff from the Desktop Application.
Architecture Overview
The application is built using React and Vite, structured around a central state management hook and a routed shell that dynamically renders sections based on the operator’s navigation.Code-to-System Mapping: UI Entry Points
The following diagram maps the high-level UI concepts to their corresponding code entities withinapps/web.
Sources: apps/web/src/App.tsx#11-33, apps/web/src/console/ConsoleSectionContent.tsx#26-98, apps/web/src/console/components/layout/ConsoleSidebarNav.tsx#12-74
Data Flow and State Management
The console’s logic is centralized inuseConsoleAppState, which orchestrates authentication, session bootstrapping, and domain-specific state (e.g., channels, cron jobs, approvals).
Sources: apps/web/src/console/useConsoleAppState.tsx#163-220, apps/web/src/consoleApi.ts#1-42
Core Components
Console API Client
TheConsoleApiClient is the sole provider for communicating with the backend. It enforces security requirements such as CSRF token inclusion for mutating requests (POST/PUT/DELETE) while allowing anonymous access for initial session bootstrapping. It supports standard JSON REST patterns and NDJSON (Newline Delimited JSON) streaming for real-time chat transcripts.
For details, see Console API Client and State Management.
Sources: apps/web/src/consoleApi.ts#1-42, apps/web/src/consoleApi.test.ts#44-90
App State and Bootstrapping
The application follows a strict bootstrapping sequence:- Session Recovery: The app attempts to fetch an existing session via
api.getSession()with exponential backoff apps/web/src/console/useConsoleAppState.tsx#91-106. - Desktop Handoff: If a
desktop_handoff_tokenis present in the URL, it attempts to exchange it for a session apps/web/src/console/useConsoleAppState.tsx#108-122. - Auth Fallback: If no session is found, the user is redirected to the
ConsoleAuthScreenapps/web/src/App.tsx#20-30. - TTL Refresh: Once authenticated, sections like
overvieworchannelsare automatically refreshed based on defined Time-To-Live (TTL) values apps/web/src/console/useConsoleAppState.tsx#41-53.
Navigation and Sections
The console is divided into “Sections,” defined insectionMetadata.ts. These are grouped into five primary domains:
- Chat: The primary agent interaction workspace.
- Observability: Overview, Sessions, Usage, Logs, Inventory, and Support.
- Control: Approvals, Routines (Cron), Channels, and Browser.
- Agent: Agent Registry, Skills, and Memory management.
- Settings: Profiles, Access, Config, and Secrets.
Chat Interface
TheChatConsolePanel is the most complex section, providing a real-time transcript of agent actions, tool executions, and multi-modal outputs. It handles “A2UI” (Agent-to-UI) rendering, allowing agents to present interactive “Canvas” elements directly in the chat.
For details, see Chat Interface and Transcript.
Sources: apps/web/src/console/ConsoleSectionContent.tsx#30-38
Domain Summary Table
| Domain | Key Sections | Purpose |
|---|---|---|
| Observability | overview, logs, usage | High-level health, token consumption, and unified log streams. |
| Control | approvals, cron, channels | Human-in-the-loop gates, scheduled tasks, and platform connectors. |
| Agent | agents, skills, memory | Managing agent identities, WASM skill trust, and long-term memory. |
| Settings | config, secrets, access | Mutating palyra.toml, managing the vault, and device pairing. |