Skip to main content
The Palyra Web Console is a React-based operator dashboard that provides comprehensive management of the daemon’s internal state, security posture, and resource utilization. It interacts with the palyrad backend through two distinct REST API surfaces: the Console API (/console/v1/*), which handles session-based operator actions, and the Admin API (/admin/v1/*), which provides low-level status and diagnostic data often consumed by the CLI and automated health probes.

Console Architecture & Data Flow

The console is organized into functional sections, each mapped to specific capabilities published by the daemon. The ConsoleSectionContent component acts as the primary router, switching between sections based on the app.section state apps/web/src/console/ConsoleSectionContent.tsx#26-108.

API Interaction Model

The ConsoleApiClient is the centralized service for all backend communication. It manages:
  1. Authentication: Consuming desktop handoff tokens or performing standard login apps/web/src/consoleApi.ts#1-200.
  2. CSRF Protection: Automatically attaching x-palyra-csrf-token headers to mutating requests (POST, PUT, DELETE) after a successful session is established apps/web/src/consoleApi.test.ts#44-90.
  3. Automatic Retries: The loadBootstrapSession function implements exponential backoff for 429 (Rate Limited) and 401/403 (Auth) errors during initial boot apps/web/src/console/useConsoleAppState.tsx#88-107.

System State Mapping

The following diagram bridges the high-level UI sections to their corresponding backend API endpoints and data structures. Console Section to Code Entity Mapping Sources: apps/web/src/consoleApi.ts#124-130, apps/web/src/console/sections/OperationsSection.tsx#49-122, apps/web/src/console/sections/UsageSection.tsx#34-93

Console Sections Detail

1. Overview & Capability Catalog

The Overview section provides a high-level summary of the deployment posture and available capabilities. It consumes the CapabilityCatalog, which defines what features are enabled and whether they require CLI handoff apps/web/src/console/fixtures/m56ControlPlane.ts#5-105.

2. Operations & Diagnostics

The OperationsSection serves as the technical troubleshooting hub. It displays:

3. Usage & Token Tracking

The UsageSection tracks metrics across three dimensions: Sessions, Agents, and Models.

4. Channels & Router

The ChannelsSection manages external platform integrations (Discord, Slack, etc.).

5. Config & Secrets

The ConfigSection and SecretsSection provide a safe interface for modifying palyrad.toml and the vault.

Admin API Surface

The Admin API (/admin/v1/*) is distinct from the Console API as it often bypasses standard session cookies in favor of Bearer tokens, making it suitable for CLI and inter-process communication.
EndpointMethodPurposeSource
/admin/v1/statusGETReturns daemon health, gRPC ports, and auth requirements.crates/palyra-daemon/tests/admin_surface.rs#30-72
/admin/v1/journal/recentGETFetches recent events from the SQLite JournalStore.crates/palyra-daemon/tests/admin_surface.rs#75-107
/admin/v1/policy/explainGETEvaluates a Cedar policy against a specific principal/action/resource.crates/palyra-daemon/tests/admin_surface.rs#110-149

Security Headers

All Admin API responses are required to include strict security headers to prevent framing and content sniffing:

Authentication & Handoff Flow

The console supports a “Desktop Handoff” mechanism where the Tauri-based desktop app generates a short-lived token, allowing the user to open the web dashboard in a standard browser without re-authenticating. Authentication Sequence Sources: apps/web/src/App.test.tsx#69-107, apps/web/src/console/useConsoleAppState.tsx#109-123, apps/web/src/consoleApi.test.ts#44-53

Auto-Refresh Logic

To maintain up-to-date diagnostics without overloading the backend, the console implements a section-aware TTL (Time-To-Live) for data. Sections like channels and operations refresh every 8-10 seconds, while config and secrets have a longer 15-second TTL apps/web/src/console/useConsoleAppState.tsx#42-54. Sources: