Skip to main content
The Palyra Web Console is organized into distinct operational domains called Sections. Each section represents a specific functional area of the daemon (e.g., Memory, Browser, Cron). State management is centralized in the useConsoleAppState hook, which orchestrates data fetching, auto-refresh logic, and domain-specific sub-hooks.

useConsoleAppState & Global State

The useConsoleAppState hook serves as the primary state container for the console application. It initializes the ConsoleApiClient and manages the lifecycle of the user session, theme, and navigation state.

Implementation Details

Auto-Refresh Mechanism

Sections implement a TTL-based auto-refresh strategy to keep the UI synchronized with the daemon without overloading the network. The function shouldAutoRefreshSection calculates if a refresh is due based on lastSectionAutoRefreshRef apps/web/src/console/useConsoleAppState.tsx#62-72. Sources: apps/web/src/console/useConsoleAppState.tsx#1-171

Section-Based Navigation

Navigation is driven by the Section type definition and rendered via the ConsoleSidebarNav and ConsoleSectionContent components.

UI-to-Code Mapping: Sidebar Navigation

The following diagram maps the visual navigation elements to their internal Section identifiers and implementing components. “Navigation Structure” Sources: apps/web/src/console/components/layout/ConsoleSidebarNav.tsx#12-74, apps/web/src/console/ConsoleSectionContent.tsx#26-107

Domain Hooks & Data Flow

To prevent useConsoleAppState from becoming unmaintainable, logic is delegated to “Domain Hooks.” These hooks encapsulate API calls and state transformations for specific subsystems.

Key Domain Hooks

Data Flow Diagram: Memory Section

The Memory section exemplifies the interaction between the global state, domain hooks, and the backend API. “Memory Section Data Flow” Sources: apps/web/src/console/sections/MemorySection.tsx#104-182, apps/web/src/console/useConsoleAppState.tsx#212-250

Core Sections Detail

Overview & Diagnostics

The Overview provides a “Single Pane of Glass” for the daemon. It uses buildAttentionItems to calculate counts for warnings, pending approvals, and degraded connectors apps/web/src/console/sections/OverviewSection.tsx#146-154. The Operations (Diagnostics) section provides technical depth, surfacing doctor --json exports, audit events, and self-healing incident logs apps/web/src/console/sections/OperationsSection.tsx#78-93.

Memory & Learning

The Memory section manages three tiers of storage:
  1. Session Memory: Raw hits from chat history apps/web/src/console/sections/MemorySection.tsx#141-141.
  2. Workspace: Curated markdown documents and notes apps/web/src/console/sections/MemorySection.tsx#110-110.
  3. Learning Queue: Autonomous facts and procedures extracted by the reflection pipeline apps/web/src/console/sections/MemorySection.tsx#155-157.

Automations (Cron)

The Cron section manages Routine records. It supports:

Config & Secrets

The console implements a “redacted-first” configuration UI. Sources: apps/web/src/console/sections/OverviewSection.tsx#100-154, apps/web/src/console/sections/MemorySection.tsx#1-182, apps/web/src/console/sections/CronSection.tsx#111-152, apps/web/src/App.config-access-support.test.tsx#37-150