Skip to main content
This section provides an overview of the foundational crates and utility libraries that support the Palyra ecosystem. These libraries provide the cross-cutting concerns—such as configuration schemas, authentication primitives, secure storage, and remote node communication—that allow the daemon, CLI, and desktop applications to operate as a unified system.

Library Ecosystem Overview

The Palyra workspace is built upon several core libraries that abstract complex logic away from the main application binaries.

Component Relationship

The following diagram illustrates how the shared libraries serve as the foundation for the higher-level applications. Shared Library Dependency Map Sources: crates/palyra-common/Cargo.toml#1-23, crates/palyra-vault/src/lib.rs#1-20

palyra-common: Core Utilities

The palyra-common crate is the lowest-level dependency in the workspace. It defines the fundamental data structures and validation logic used across all Rust components.
  • Daemon Configuration: Defines the RootFileConfig and DaemonConfig schemas used for palyra.toml validation. It includes redact_secret_config_values to ensure sensitive keys aren’t leaked in logs.
  • Workspace Patching: Implements apply_workspace_patch crates/palyra-common/src/workspace_patch.rs#207-211, a fail-closed mechanism for applying atomic file changes within sandboxed workspace roots.
  • Validation: Provides validate_canonical_id crates/palyra-common/src/ids.rs#24-24 for ensuring ULID-compatible identifiers and parse_daemon_bind_socket crates/palyra-common/src/net.rs#25-25 for network address parsing.
  • Redaction: Contains utilities in palyra_common::redaction for masking sensitive strings in diagnostic outputs.
For details, see palyra-common: Core Utilities. Sources: crates/palyra-common/src/lib.rs#1-33, crates/palyra-common/src/workspace_patch.rs#19-39

palyra-auth and palyra-control-plane

These crates manage the identity and external communication requirements of the Palyra ecosystem.
  • palyra-auth: Handles authentication primitives, including API key management, OAuth refresh state persistence, and the openai_auth integration used for proxying requests to LLM providers.
  • palyra-control-plane: Provides the client and models for communicating with the Palyra Control Plane. This includes managing high-level “Objectives” and reporting daemon health/telemetry if configured.
For details, see palyra-auth and palyra-control-plane. Sources: crates/palyra-common/src/lib.rs#4-5

palyra-vault: Secure Secret Storage

The palyra-vault crate provides a unified API for sensitive data persistence, abstracting over platform-specific secure enclaves. Vault Backend Architecture Sources: crates/palyra-vault/src/lib.rs#12-20, crates/palyra-vault/src/backend.rs#41-49, crates/palyra-vault/src/backend.rs#135-158

Node Runtime and Remote Nodes

Palyra supports distributed execution through remote nodes. This functionality is powered by gRPC and mTLS.
  • NodeService: The gRPC interface that allows the daemon to execute DeviceCapability on remote hardware.
  • Pairing Flow: Implements secure device association using PairingMethod (e.g., QR codes or proof-of-possession) crates/palyra-cli/tests/pairing_flow.rs#32-70.
  • palyra-transport-quic: A custom transport layer that uses QUIC for low-latency, mTLS-encrypted communication between nodes, featuring pinned server fingerprints for TOFU (Trust On First Use) security.
For details, see Node Runtime and Remote Nodes. Sources: crates/palyra-cli/tests/pairing_flow.rs#17-28, crates/palyra-common/src/lib.rs#31-32

Configuration and Validation Flow

The following table summarizes how configuration is handled across the shared libraries.
FeatureCode EntityPurpose
Path Parsingparse_config_pathResolves ~/.config/palyra vs CWD paths.
Validationconfig_validateCLI command to verify palyra.toml integrity.
Redactionredact_secret_config_valuesMasks api_key in config dumps.
ID Safetyvalidate_canonical_idPrevents path traversal via malformed IDs.
Sources: crates/palyra-common/src/lib.rs#18-24, crates/palyra-cli/tests/config_validate.rs#24-36

Child Pages