sliverp/DeepSeek-harness-dingtalk ↗★ 1
deepseek-harness-dingtalk
DingTalk Stream text, image, and file channel bridge for DeepSeek Harness
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:sliverp/DeepSeek-harness-dingtalk说明文档
阅读完整 README ↗DeepSeek Harness 钉钉插件
基于钉钉官方 dingtalk-stream SDK 的 DeepSeek Harness 长连接通道。无需公网 IP 或回调服务器,使用 Client ID 和 Client Secret 即可连接应用机器人。
功能
- 官方 Stream WebSocket 长连接、心跳和自动重连
- 单聊和群聊访问策略与白名单
- 普通文字、Markdown、富文本、语音转写、图片和普通文件输入
- 通过官方
downloadCodeAPI 下载图片与文件;普通文件安全保存到当前 Agent 工作目录 - 根据模型能力启用图片多模态输入,文本模型得到附件说明
- 模型回复使用钉钉原生 Markdown,生成图片和工作目录文件可上传发送
- 完整 Harness Agent Loop:工具调用会正常解析、执行并以结构化事件持久化,只发送最终可见回复
- 每个钉钉会话独立、可恢复的 Harness 会话;恢复原 Agent preset,并复用已有 live Agent
/new、Harness 注册斜命令,以及/bot-ping、/bot-help、/bot-image-test、/bot-file-test、/bot-status、/bot-cancel- Client Secret 通过 Harness 凭据服务解析
安装
pnpm dsh plugin --profile web add github:sliverp/DeepSeek-harness-dingtalk
本地开发版本:
pnpm dsh plugin --profile web add /absolute/path/to/DeepSeek-harness-dingtalk
钉钉开放平台配置
- 打开钉钉开放平台,进入「应用开发」。
- 创建企业内部应用并添加机器人能力;也可以使用官方「一键创建 OpenClaw 机器人应用」。
- 在「凭证与基础信息」复制 Client ID(原 AppKey)和 Client Secret(原 AppSecret)。
- 把 Client ID 写入
DINGTALK_CLIENT_ID,把 Client Secret 保存为 Harness 凭据DINGTALK_CLIENT_SECRET。
开发时可从环境变量注入:
export DINGTALK_CLIENT_ID='ding_your-client-id'
export DINGTALK_CLIENT_SECRET='your-client-secret'
pnpm dsh --profile web
长期运行时,建议把 Client ID 放在 ~/.dsh/.env,并通过 Harness 凭据设置界面保存 Client Secret。不要把真实凭据提交到 Git。
配置
安装包默认添加:
- id: dingtalk-channel
name: deepseek-harness-dingtalk
config:
clientId: !!js process.env.DINGTALK_CLIENT_ID
clientSecretRef: DINGTALK_CLIENT_SECRET
cwd: !!js process.env.DSH_DINGTALK_CWD ?? process.cwd()
agentPreset: standard
生产环境建议改为白名单:
singlePolicy: allowlist
singleAllowFrom: [staff-id-1]
groupPolicy: allowlist
groupAllowChats: [conversation-id-1]
imageInputMode: auto
maxInboundFileBytes: 20971520
maxOutboundFileBytes: 20971520
访问策略可选 open、allowlist、disabled。机器人收到第一条消息后,可从钉钉回调中的发送者和会话标识配置白名单。
验证
启动后向机器人发送: