Channels
Channels
Serve Maniac agents on Slack and other chat platforms with serveChannels, ChatToolset, and interactive approval cards.
Channels
@maniac-ai/agents/channels wraps Vercel's Chat SDK so a registered Maniac agent can listen on Slack, Discord, Telegram, Microsoft Teams, and WhatsApp Business without platform-specific code in the SDK.
The same Chat instance powers an outbound ChatToolset — mount it on any agent so the model can post, react, edit, and DM from inside a run.
npm install chat @chat-adapter/slack fastifyChat SDK packages are optional peers on @maniac-ai/agents.
Architecture
Inbound webhook → serveChannels.handle(event) → Maniac.chatStream → platform thread
Approval click → handleApprovalCallback → Maniac.resumeCheckpointStream
Agent tool call → ChatToolset (chat_post, …) → Chat SDK adapterQuick start
See the runnable example at packages/agents/examples/channels-slack-bot.ts.
import { Maniac, OpenAICompatibleModel } from "@maniac-ai/agents";
import { ChatToolset, serveChannels, buildFastifyHandler } from "@maniac-ai/agents/channels";
import { Chat } from "chat";
import { createSlackAdapter } from "@chat-adapter/slack";
const chat = new Chat({ adapters: { slack: createSlackAdapter() } });
const app = new Maniac({ model: new OpenAICompatibleModel({ slug: "gpt-4o-mini" }) });
app.agent({
id: "support",
instructions: "Use chat_* tools to post and react on Slack.",
toolsets: [new ChatToolset({ chat, preset: "messenger", requireApproval: true })]
});
const server = serveChannels(app, "support", { chat, threadContext: { maxMessages: 10 } });Topics
- Slack bot — webhooks, Fastify mounting, multimodal inbound
- Approvals —
requireApproval, approval cards, checkpoint resume
TypeScript only (for now)
Channels ship in TypeScript ahead of Python parity. Python support is blocked on an equivalent Chat SDK adapter ecosystem. See the parity matrix.
Import surface
import {
serveChannels,
buildFastifyHandler,
buildWebhookHandler,
ChatToolset
} from "@maniac-ai/agents/channels";