Skip to main content
The Palyra Desktop application (Tauri-based) serves as a process supervisor, an onboarding orchestrator, and a companion interface for the Palyra platform. It bridges the gap between raw sidecar processes (palyrad, palyra-browserd, palyra node) and the operator’s daily workflow by providing a native shell with local persistence, offline capabilities, and a guided setup experience.

Desktop State and Persistence

The desktop application manages its own persistent state independently of the daemon’s database. This state is stored in a state.json file located within the desktop state root directory.

DesktopStateFile Schema

The DesktopStateFile is the primary container for persistent settings, rollout flags, and onboarding progress. It includes a schema version for migration handling.

DesktopSecretStore

The desktop maintains a small, specialized secret store for runtime tokens required to communicate with sidecars.

Offline Drafts and Notifications

To handle intermittent connectivity, the desktop implements a bounded local buffer for drafts and notifications. Sources: [apps/desktop/src-tauri/src/desktop_state.rs#1-205](http://apps/desktop/src-tauri/src/desktop_state.rs#1-205), [apps/desktop/src-tauri/src/lib.rs#1-41](http://apps/desktop/src-tauri/src/lib.rs#1-41)

Onboarding Wizard and Lifecycle

The onboarding system guides the user through environment configuration, sidecar initialization, and external provider authentication (OpenAI, Discord).

DesktopOnboardingStep

The flow is modeled as a linear sequence of steps defined in DesktopOnboardingStep apps/desktop/src-tauri/src/desktop_state.rs#209-216:
  1. Welcome: Initial introduction.
  2. Environment: Selection of the runtime state root.
  3. Sidecars: Initializing and starting palyrad and palyra-browserd.
  4. Operator: Establishing the initial admin session.
  5. Providers: Configuring LLM backends and channel connectors.
  6. Node: Optional enrollment of the local desktop node host.

Data Flow: Onboarding Status

The ControlCenter captures raw inputs which are then transformed into an OnboardingStatusSnapshot for the UI. Onboarding Status Resolution Sources: [apps/desktop/src-tauri/src/onboarding.rs#81-115](http://apps/desktop/src-tauri/src/onboarding.rs#81-115), [apps/desktop/src-tauri/src/commands.rs#97-106](http://apps/desktop/src-tauri/src/commands.rs#97-106), [apps/desktop/src-tauri/src/onboarding.rs#141-165](http://apps/desktop/src-tauri/src/onboarding.rs#141-165)

Companion UI Architecture

The Companion UI is a React application hosted within Tauri that interacts with the ControlCenter via Tauri commands (invoke). It provides a streamlined “ambient” interface for the platform.

Component Mapping

The UI maps internal state to visual components:

API Integration (desktopApi.ts)

The frontend uses a typed bridge to communicate with the Rust backend:

State Reconciliation

The UI maintains local state for sections but reconciles it with the backend during the get_desktop_companion_snapshot call to ensure consistency across window reloads apps/desktop/src-tauri/src/commands.rs#129-133. Entity Association Diagram Sources: [apps/desktop/ui/src/App.tsx#60-169](http://apps/desktop/ui/src/App.tsx#60-169), [apps/desktop/ui/src/lib/desktopApi.ts#17-50](http://apps/desktop/ui/src/lib/desktopApi.ts#17-50), [apps/desktop/src-tauri/src/companion.rs#80-101](http://apps/desktop/src-tauri/src/companion.rs#80-101)

Feature Flags and Rollout

The desktop implements “Experimental Governance” to manage new features like the Native Canvas and Ambient Voice mode.

Rollout Logic

Rollout state is defined in DesktopCompanionRolloutState apps/desktop/src-tauri/src/desktop_state.rs#72-79. These flags are toggled via the update_desktop_companion_rollout command apps/desktop/src-tauri/src/commands.rs#194-202.
FlagPurpose
companion_shell_enabledControls the visibility of the rich chat/approval UI.
offline_drafts_enabledEnables the local queuing of messages when offline.
voice_capture_enabledEnables the push-to-talk audio attachment pipeline.
tts_playback_enabledEnables local speech synthesis for assistant narration.

Diagnostics Integration

The desktop UI surfaces experiment metadata from /console/v1/diagnostics, including:
  • Rollout Stage: (e.g., “preview”).
  • Security Review: A list of completed security audits for the feature.
  • Exit Criteria: Conditions required to move the feature out of experimental status.
Sources: [apps/desktop/src-tauri/src/snapshot.rs#181-208](http://apps/desktop/src-tauri/src/snapshot.rs#181-208), [apps/desktop/src-tauri/src/desktop_state.rs#71-92](http://apps/desktop/src-tauri/src/desktop_state.rs#71-92), [apps/desktop/README.md#100-118](http://apps/desktop/README.md#100-118)