API Reference lemon_channels v#0.1.0

View Source

Modules

LemonChannels provides channel plugins and outbox for message delivery.

Discord channel adapter.

File upload/download operations for the Discord transport.

Inbound message normalization for Discord.

Model/provider catalog for the Discord adapter's /model picker.

Builds the Discord message components (select menus + nav buttons) for the /model picker and parses the component callbacks they produce.

Adapter that integrates Discord with the unified ModelPolicy system.

Outbound message delivery for Discord.

Discord renderer for semantic delivery intents.

Discord slash-command schema definitions for the Lemon adapter.

Renders Discord message components for run status messages.

Supervisor for Discord adapter processes.

Discord transport that routes inbound events to LemonRouter through RouterBridge. Feature-complete with model picker, thinking, resume, cancel, trigger, cwd, and reactions.

Email channel adapter (Phase 2.4/B3).

Persists inbound email attachments to disk and describes them for the agent.

Configuration for the email adapter, from two sources.

RFC 2822 message identifiers: parsing, listing and rendering.

Sends mail for the email channel adapter over an SMTP relay.

Per-thread state for the email adapter: which thread a message id belongs to, and what a reply on that thread needs in order to thread correctly.

Generic channels renderer for semantic delivery intents.

Shared ModelPolicyAdapter logic for all channel transports.

Telegram channel adapter.

Inbound message normalization for Telegram.

Adapter that integrates Telegram with the unified ModelPolicy system.

Outbound message delivery for Telegram.

Telegram renderer for semantic delivery intents.

Supervisor for Telegram adapter processes.

Telegram polling transport shell.

Executes Telegram transport-local side effects produced by the ingress pipeline.

Telegram-local approval request message construction and submission.

Telegram-local callback query handler for inline keyboard actions.

Telegram-local chat and topic preference commands.

Command and message-routing decision tree for the Telegram transport shell.

Command detection, predicate logic, and message-entry helpers for the Telegram transport.

File upload/download operations for the Telegram transport.

Telegram-local execution helpers for normal inbound message submission.

Telegram-local normalized inbound context for transport ingress handling.

Media-group coalescence logic for the Telegram transport.

Message buffering and debounce logic for the Telegram transport.

Telegram-local model picker flow extracted from the transport shell.

Telegram-local normalization helpers for raw updates and transport timer events.

Telegram-local inbound pipeline coordinator.

Poll-loop and Telegram update dispatch helpers for the Telegram transport shell.

Small helper over Telegram transport runtime state.

Telegram-local /topic command handler extracted from the transport shell.

Focused Telegram inbound decision helpers used by the transport pipeline.

Telegram-local inbound voice-transcription helper for the transport pipeline.

Voice transcription client for Telegram voice notes.

WhatsApp channel adapter.

Pure functions for WhatsApp access control.

ETS-backed TTL dedup cache for WhatsApp messages.

Converts Markdown to WhatsApp formatting.

Inbound message normalization for WhatsApp.

Adapter that integrates WhatsApp with the unified ModelPolicy system.

Outbound message delivery for WhatsApp.

WhatsApp renderer for semantic delivery intents.

Supervisor for WhatsApp adapter processes.

Command and message-routing decision tree for the WhatsApp transport shell.

Command detection, predicate logic, and message-entry helpers for the WhatsApp transport.

Message buffering and debounce logic for the WhatsApp transport.

XMTP channel adapter.

OTP application and adapter lifecycle for LemonChannels.

Resolved routing binding for a chat scope: the transport, chat/topic ids and the project, agent, engine and queue-mode a message routes to. Produced by LemonChannels.BindingResolver.resolve_binding/1.

Resolves bindings and settings for a Telegram chat scope.

Channel capability definitions and registry.

Represents a single channel capability.

Registry for capability sets and lookups.

Query API for channel capabilities.

Typed wrapper for Discord known-target metadata.

Router-facing semantic delivery entrypoint.

Temporary compatibility parser for resume lines.

Environment variables read by lemon_channels — channel adapters and their limits.

Gateway config as seen by channels.

Optional inbound HTTP listener for channel adapters.

Contract for adapters that receive inbound HTTP.

Dispatches inbound HTTP to the adapter registered for the first path segment.

Route-based model policy management for Lemon.

Migration utilities for transitioning from legacy policy storage to ModelPolicy.

Route key handling for model policies.

Typed wrapper for persisted model-policy records.

Outbound payload for channel delivery.

Outbox for queuing and delivering outbound messages.

Chunker for splitting long messages into channel-sized pieces.

Deduplication for outbound messages.

Rate limiter for outbound message delivery.

Behaviour for channel plugins.

Tracks channel presentation state per {route, run, surface}.

Registry for channel plugins.

Script-friendly outbound notifications for Telegram and Discord.

Channel-owned directory of recently seen route targets.

Telegram delivery helpers backed only by LemonChannels.Outbox.

Formats markdown for Telegram in a robust way.

Typed wrapper for Telegram known-target metadata.

Renders CommonMark-ish markdown into Telegram-ready {text, entities} tuples.

Typed wrapper for Telegram message-id resume/session index tables.

Typed wrapper for Telegram per-chat/session preference state.

Truncation and splitting logic for Telegram messages.

Mix Tasks

Manage model policies for channels, accounts, peers, and threads.

Send a Telegram or Discord notification from shell scripts, cron jobs, and CI.