Multi-platform message gateway and WeCom AI bot bridge with session context compression and smartsheet creation.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-message-gateway
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:a792883583/dsh-message-gateway
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README

A message-platform gateway plugin for the DSH Web GUI: a "Message platforms" entry below the "New session" button opens a full-screen manager for multi-platform message connectors — credential save, connection tests, status monitoring — plus a built-in persistent bridge for the WeCom AI bot: external messages drive the DSH assistant through a dedicated agent session, and replies stream back token by token. Also provides a universal proactive messaging API supporting Markdown text and native image attachments.
Features
- Sidebar entry: a "📮 Message platforms" button below "New session" opens the full-screen manager (close with ESC or by clicking the backdrop)
- Multi-platform connectors: Telegram / Discord / QQ bot / WeCom / WeCom AI bot / WeChat (external Wechaty gateway) / WeChat Official Account / WhatsApp / Email / DingTalk / Feishu / Bark / ServerChan / Webhooks
- WeCom AI bot: fill in
botId + secretto establish an official SDK WebSocket connection; supports streaming replies, media upload, and proactive image/file push - Telegram bot: save a Bot Token to enable long polling, supporting text streaming and
sendPhotoproactive image push - Discord bot: save a Bot Token to connect via Gateway, supporting channels/DMs and
filesattachment proactive image push - DingTalk Bot: configure custom bot Webhook & optional HMAC Secret; supports Markdown text and public image URL rendering
- Feishu / Lark Bot: configure custom bot Webhook & optional Secret signature for text and card delivery
- Bark (iOS): fill in Device Key for instant push notifications with rich image banners (public URL)
- ServerChan: fill in SendKey for push notifications to WeChat / mobile channels with Markdown image URLs
- QQ bot: save appId + secret to connect to the open-platform gateway; passive replies + streaming edits
- WeCom app: fill in CorpID/AgentID/Secret plus callback Token/EncodingAESKey for auto-dialogues
- WeChat Official Account: fill in AppID/Secret plus callback Token for follower dialogues
- WhatsApp: fill in Token + Phone Number ID for WhatsApp webhook dialogues
- Email: fill in IMAP (993/143) + SMTP (465/587/25) for threaded email conversations
- WeCom AI bot: fill in
- Universal proactive push channel:
POST /gateway/push(for cron jobs, automation scripts, and pipelines):- Request body:
platform: target platform (wecom-aibot/telegram/discord/dingtalk/feishu/bark/serverchan/email)target: destination target (single-chat userid or group id forwecom-aibot; numeric chatId fortelegram; channelId fordiscord; deviceKey forbark, etc.)content: optional text content (supports Markdown)title: optional title (email subject or notification prefix)image: optional image data (Base64 data or accessiblehttp(s)://image URL)filename: optional image filename (defaults toimage.png)
- Highlights:
- Text and image can be pushed together or separately
wecom-aibot,telegram, anddiscordsupport uploading raw local binary buffers directlybark,dingtalk, andserverchanautomatically adapt to public image URLs
- Request body:
- Credential management: plaintext is persisted only to
~/.dsh/gateway.json(mode 600, atomic write);/gateway/listnever returns credential plaintext, only aconfiguredflag - Secret redaction: message content written to logs / console is automatically masked for likely secrets (
sk-prefixed keys, GitHub tokens,Bearer,password=assignments, PEM private keys, and other common patterns), so secrets in bot conversations never leak into log files - Connection tests: real per-platform checks — Telegram/Discord via Bot API, QQ via access_token, WeCom via gettoken, WeChat MP via cgi-bin/token, WhatsApp via Graph API, Email via IMAP TCP banner, WeCom AI bot via the official SDK long connection (authenticated = pass)
- WeCom AI bot persistent bridge: official SDK WebSocket long connection with exponential backoff reconnect; incoming text messages are injected into an isolated dedicated agent session that wakes the DSH driver; replies stream back as chunks and finalize via
response_url- Multi-step stream accumulation without overwrite: in multi-step/complex agent tasks, earlier reasoning paragraphs are accumulated cleanly without being overwritten by later outputs; intermediate pauses display a dynamic status hint (
⏳ Processing, please wait…) which is stripped upon completion - Graceful shutdown & instant reconnect: catches process termination signals to perform proper handshake disconnects across all platforms, eliminating 30-second zombie connection timeouts and allowing re-connections in 1–2 seconds
- Group-chat @mention stripping: the leading
@bot-nameis removed before the assistant sees the message - Slash commands:
/help//time//status//stats(Chinese aliases: 帮助/菜单/时间/状态/统计) - Enter-chat welcome: optional configuration (
welcomeReply, defaults tofalsefor zero disturbance; when set totrue, auto-replies a greeting when a user enters single chat for the first time that day) - Proactive send channel:
POST /gateway/send({"chatid": "...", "content": "..."}) sends markdown messages as the bot - Message routing rules (plugin config
routes): route messages by "platform + keyword prefix" to a specific agent preset (isolated session) with an optional dedicated model / skill - Agent push tool (
send_chat_message): automatically registers a universal message-pushing tool for DSH agents, allowing AI assistants to proactively send summaries, task results, or alerts (including screenshots and text) to WeCom, Telegram, Discord, DingTalk, etc.
- Multi-step stream accumulation without overwrite: in multi-step/complex agent tasks, earlier reasoning paragraphs are accumulated cleanly without being overwritten by later outputs; intermediate pauses display a dynamic status hint (
- Webhook receive endpoint:
POST /gateway/webhook/inaccepts messages from external systems, injects them into the dedicated agent session and returns the full reply synchronously; optional HMAC-SHA256 signature validation - Multilingual: Chinese / English / Español, following the DSH Web UI language; defaults to Simplified Chinese
- Light / dark theme follows the DSH Web GUI
Usage
- Open DSH Web (
dsh web) and click the "Message platforms" button in the sidebar - Pick a platform on the left, fill in credentials on the right
- Click Save: credentials are persisted and a connection test runs automatically, refreshing the status immediately
- Click Test connection: tests the current form values without saving
- Saving
botId + secretfor the WeCom AI bot establishes the persistent bridge right away; deleting the config disconnects it
Install
# From npm (generic plugin, usable by any DSH user)
dsh plugin --profile web add dsh-message-gateway
Restart dsh web — the "Message platforms" button appears below "New session" in the sidebar. Open the page, pick a platform, fill in credentials and click Save — for the WeCom AI bot, saving botId + secret establishes the persistent bridge immediately and you can chat with the bot in WeCom right away (same as web: per-chat sessions + automatic context compression).
Config
All options have defaults and the plugin works out of the box; tune them via dsh plugin config or the profile config file:
| Option | Type | Default | Description |
|---|---|---|---|
botLocale |
zh | en |
zh |
Bot reply language |
maxChatAgents |
number | 40 |
Max chat sessions kept per bot; oldest is evicted beyond this |
autoStartWecom |
boolean | true |
Auto-connect the WeCom AI bot from saved credentials at startup |
groupReply |
boolean | true |
Reply to group messages (false = single chats only) |
Docs
- Architecture & extension guide (how to add a platform connector)
- Webhook receive endpoint contract
- WeChat (Wechaty) HTTP gateway contract
Architecture
- Host half (
lib/index.js):/gateway/*routes (list / save / delete / test / wechat-status) +BridgeManager(agent session injection and event-stream polling) +WecomBridge(SDK long-connection lifecycle) +gateway-store(credential persistence) - Client half (
lib/client.js): sidebar button mount + full-screen platform manager (React, loaded via the__ModuleLoader__closure)
Feedback
Found a bug or have a feature request? Open an issue on GitHub Issues — your feedback helps us make the plugin better.
License
MIT
Links
More in this category
xmanrui/dsh-im★ 1283
Connect IM bots to DeepSeek Harness via QR codes or bot credentials (9 channels: Feishu, WeChat, DingTalk, WeCom, QQ, Slack, Telegram, Discord, and WhatsApp).
alvinunreal/openpets#dsh★ 1186
Bridges DeepSeek Harness lifecycle status, errors, and approval requests to a locally running OpenPets desktop companion.
shaobeichen/dsh-pocket★ 1096
Remote phone access to the DSH Web UI: scan a QR code for LAN or public (cloudflared tunnel) access with real-time sync, a mobile-adaptive layout, and a settings tab.
inclusionAI/Avernet#deepseek-harness-channel-bcn★ 551
Connects DeepSeek Harness to Avernet's Bot Collaboration Network over WebSocket V2, with automatic onboarding, isolated agent sessions, tool-call events, and multi-bot routing tools.
THEWOLFWALKER/dsh-notifier★ 98
Multi-channel notifications and phone control for DSH: one `notify()` API across 27 channels, event-driven pushes, phone approvals and questions, phone task takeover (`/tasks` `/use`), images into the session, six inbound control channels, a loopback web console, bilingual messages (zh/en via `lang`), multi-agent routing, and zero runtime dependencies.
omdsh-dev/dsh-notification★ 83
Desktop notifications for turn completions, with per-outcome controls and keyword rules.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.