dsh-im-hub
A multi-platform IM gateway for DeepSeek Harness (dsh) — Feishu (Lark), WeCom (WeChat Work), and Telegram. Turn your dsh agent into a chat assistant reachable from the messaging apps you already use.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ThreeBody6666/dsh-im-hub说明文档
阅读完整 README ↗dsh-im-hub
DeepSeek Harness (dsh) 的多平台 IM 网关插件:把 dsh 智能体接入 飞书(Lark)、企业微信(WeCom) 和 Telegram,让你在平时用的聊天软件里直接和智能体对话。
每个会话一个智能体、多轮上下文、白名单访问控制、空闲自动回收。默认无需公网地址(飞书长连接 / Telegram 长轮询;企业微信走 HTTP 回调)。
特性
- 飞书 / Lark — 官方 WebSocket 长连接(
/callback/ws/endpoint+ protobuf 帧、客户端主动 ping 保活、3 秒事件应答、message_id 幂等去重),或 webhook 模式。默认模式不需要公网地址;国际版 Lark 通过adapters.lark配置(open.larksuite.com)。 - 企业微信 — 应用消息回调,完整实现
WXBizMsgCrypt(AES-256-CBC 解密 + SHA1 验签),并通过消息 API 主动回复。 - Telegram — Bot API 长轮询(
getUpdates),超长消息自动按 4096 字符分片。 - Mock 适配器 — 无需任何真实平台凭据,通过 stdin + 本地 HTTP 端点即可测试。
- 每个聊天一个 agent 会话:保留上下文、同一聊天串行处理(不交错)、空闲超时后自动释放。
- 所有适配器强制白名单(
allowedUserIds);留空 = 允许所有人(生产环境请务必配置)。 - 聊天内命令:
/help、/reset、/status、/model。
安装
# 从 Git 仓库安装(需要 prepare 脚本 + 构建授权)或 npm 包:
dsh plugin --profile im add github:yourname/dsh-im-hub
# 从本地源码安装(开发调试):
dsh plugin --profile im add link:D:/projects/dsh-im-hub
这会创建一个 headless profile im,bundle 为 @deepseek-ai/dsh-base + dsh-im-hub。启动:
dsh --profile im
配置
插件行默认禁用。在 profile 自己的 cordis.patch.yml($DSH_HOME/profiles/im/cordis.patch.yml)中启用:
- id: im-gateway
disabled: false
config:
adapters:
telegram:
enabled: true
token: '123456:ABC-DEF...'
allowedUserIds: [123456789] # Telegram 数字用户 id;留空 = 所有人
完整配置项:
| 键 | 默认值 | 说明 |
|---|---|---|
adapters.telegram.enabled | false | 启用 Telegram Bot API 适配器(长轮询)。 |