Skip to main content
The Channel Connectors and Webhooks subsystem provides a unified interface for the Palyra daemon to communicate with external messaging platforms. By abstracting platform-specific APIs (Discord, Slack, etc.) into a standardized internal protocol, the daemon can route messages, handle mentions, and manage conversation state regardless of the transport layer. The architecture relies on the ChannelRouter to enforce policy and concurrency, while the ConnectorSupervisor manages the lifecycle of individual platform adapters.

Connector Framework

The connector framework is built around a provider-adapter pattern. Each external service is implemented as a ConnectorAdapter that handles the translation between Palyra’s internal message envelopes and the third-party API payloads.

Key Components

ComponentResponsibility
ConnectorAdapterTrait defining how to send outbound messages and report availability. crates/palyra-connectors/src/connectors/echo.rs#34-76
ConnectorSupervisorManages the lifecycle, restarts, and health monitoring of active connector instances. crates/palyra-connectors/src/lib.rs#7-11
ConnectorInstanceRecordPersistence model for a configured connector, including auth profiles and readiness state. crates/palyra-connectors/src/connectors/echo.rs#105-123
InboundMessageA normalized representation of a message received from an external platform. crates/palyra-daemon/src/channel_router.rs#215-227

System Entity Mapping

The following diagram illustrates how high-level connector concepts map to specific code entities within the palyra-connectors and palyra-daemon crates. Sources: crates/palyra-connectors/src/lib.rs#1-12, crates/palyra-daemon/src/channel_router.rs#215-230

Channel Router and Policy

The ChannelRouter acts as the central traffic controller for all inbound and outbound communication. It is responsible for enforcing ChannelRoutingRule configurations, which determine which users can interact with the daemon and how conversations are isolated.

Routing and Pairing Logic

For details on the supervisor and backpressure models, see Connector Framework and Channel Router. Sources: crates/palyra-daemon/src/channel_router.rs#161-192

Message Lifecycle

When a message enters the system, it passes through a validation and routing pipeline before reaching the agent runtime. Sources: crates/palyra-connectors/src/connectors/echo.rs#43-75, crates/palyra-daemon/src/channel_router.rs#215-240

Supported Connectors

  1. Discord: A full-featured integration supporting webhooks, slash commands, and complex embeds.
  2. Echo: An internal testing connector used for simulating message flows and verifying idempotency. crates/palyra-connectors/src/connectors/echo.rs#21-24
  3. Slack/Telegram: Standard adapters following the ConnectorKind specification.
For details on platform-specific implementation, validation, and replay protection, see Discord Integration and Webhooks. Sources: crates/palyra-connectors/src/connectors/echo.rs#35-41, crates/palyra-daemon/src/channel_router.rs#178-192

Child Pages