Skip to content
Guide Reference Download app

@claxedo/channels

@claxedo/channels is the framework glue for running Claxedo sessions from chat-shaped systems — GitHub, Telegram, Slack, Discord, WhatsApp, and local fake transports. It handles inbound command parsing, session resolution, runtime message forwarding, approval prompts, and reply rendering. It deliberately does not authenticate provider webhooks itself: the caller or mounted transport must verify signatures, secrets, and scopes before invoking the channel core.

Terminal window
npm install @claxedo/channels

Wire a channel core with an authorize hook and in-memory stores:

import {
createChannelCore,
createMemoryDedupStore,
createMemorySessionResolver,
type ChannelRuntime,
} from "@claxedo/channels"
declare const runtime: ChannelRuntime // your session/prompt runtime binding
const core = createChannelCore({
runtime,
dedup: createMemoryDedupStore(),
sessions: createMemorySessionResolver(runtime),
authorize: async (envelope) => {
if (envelope.channel !== "github") return { ok: false, message: "Unsupported channel." }
if (envelope.repo?.owner !== "acme") return { ok: false, message: "Repository is not linked." }
return { ok: true }
},
})

The authorize hook runs before deduplication and session creation — use it to bind provider identities to workspace permissions and least-privilege channel policy.

  • CorecreateChannelCore handles inbound commands, session resolution, runtime forwarding, approvals, and replies over shared InboundEnvelope/OutboundChunk contracts.
  • IngresscreateChannelsIngress mounts Hono routes and delegates enabled provider routes to a caller-provided bot/transport; createChannelRegistry drives env-based registration.
  • Provider helpersgithubWebhookEnvelope + verifyGitHubWebhookSignature, telegramUpdateEnvelope, and Baileys WhatsApp personal-mode transport glue.
  • Memory storescreateMemoryDedupStore, createMemorySessionResolver, createMemoryApprovalBridge are single-process helpers; use durable storage for multi-instance deployments.

See the README on GitHub for the full export table, per-provider security notes, and trust-model details.