ChanningYuan / dsh-dingtalk

Listed

DingTalk IM channel plugin for DeepSeek Harness (dsh): chats drive local dsh agents, replies return as markdown messages

mainOther View source

Installation

npx -y @deepseek-ai/dsh plugin --profile web add github:ChanningYuan/dsh-dingtalk

This installation command is an unverified starting point generated from the GitHub repository address.

README

Maintainer-authored documentation snapshot.

View on GitHub ↗
Commit d5c5057Synced Aug 17, 2026

dsh-dingtalk

DingTalk IM channel plugin for DeepSeek Harness (dsh):在钉钉里驱动本机 DSH Agent。

PoC-0 阶段:当前只打通最小链路——钉钉私聊/群 @ 文本进 → 本机 dsh agent 执行 → 结果以一条 markdown 消息发回。AI Card 流式、审批/提问/计划交互卡片、扫码建应用、npx 一键安装在后续里程碑(见规划)。

工作原理

  • 入向:钉钉 Stream 模式 WebSocket 长连接(dingtalk-stream SDK),免公网回调地址。
  • 会话:一个钉钉会话 ↔ 一个 DSH session(绑定表持久化在 ~/.dsh-dingtalk/bindings.json,dsh 重启后自动 resume 原会话)。
  • 出向:订阅 DSH session/event,聚合当轮 assistant/message 文本,turn/end 时经会话的 sessionWebhook 发一条 markdown。
  • 复用自 dingtalk-openclaw-connector(MIT)的 Stream 接入与消息发送模式;DSH 桥接层架构参考 dsh-lark 的模块划分(结构化宿主契约,不依赖未发布的宿主包)。

前置条件

  1. Node.js ≥ 22,已能运行 dsh web(DeepSeek Harness ≥ 0.1.0-rc.6)。
  2. 一个钉钉企业内部应用机器人:开启 Stream 模式,拿到 clientId(AppKey)/ clientSecret(AppSecret),机器人已发布到组织。

安装与运行(PoC)

# 1. 构建
pnpm install
pnpm build

# 2. 装进 dsh 的 web profile(在本仓库父目录执行)
dsh plugin --profile web add ./dsh-dingtalk

# 3. 配置凭据(二选一)
#    a. 环境变量(最快)
export DINGTALK_CLIENT_ID=dingxxxxxx
export DINGTALK_CLIENT_SECRET=xxxxxxxx
#    b. 或 patch 配置:编辑 $DSH_HOME/cordis.patch.yml 追加
#       - id: dingtalk-channel
#         config:
#           clientId: dingxxxxxx
#           clientSecret: xxxxxxxx
#           allowedSenders: [你的staffId]

# 4. 重启 dsh web,日志出现 [dsh-dingtalk] channel up 即就绪
dsh web

钉钉里私聊机器人(或群里 @ 它)发一句话,等 Agent 跑完收 markdown 回复。

配置项

默认说明
clientId / clientSecret空(读 env)钉钉应用凭据
workspace~/dsh-dingtalk-workspaceAgent 会话工作目录(绝对路径)
markdownTitleDSH回复消息的卡片标题
allowedSenders[](不限制)发件人 staffId 白名单,PoC 建议只配自己
debugfalseStream SDK 调试日志

PoC-0 已知边界

  • 工具审批不回钉钉:Agent 若触发需审批的工具,需去 dsh web UI 批准(审批卡片在 M1 完整版实现)。先用只读任务测试。
  • 无流式:一轮只回一条 markdown;执行过程可在 dsh web 会话页同步观看。
  • 仅文本消息;图片/文件忽略。
  • sessionWebhook 有时效:长时间任务结束后 webhook 可能过期导致回复失败(日志可见),下条消息恢复。

License

MIT

Repository information

Language
TypeScript
License
Not reported
Last updated
Aug 17, 2026, 8:05 AM

Install deliberately

Review source code, permissions, lifecycle hooks, dependencies and network access. Test untrusted plugins in an isolated environment.