sliverp/DeepSeek-harness-wecom ↗★ 3
deepseek-harness-wecom
用于 DeepSeek Harness 的 WeCom AI Bot 文本、图片和文件通道桥接
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:sliverp/DeepSeek-harness-wecom说明文档
阅读完整 README ↗DeepSeek Harness 企微插件
中文 | English
这是一个独立的树外 DeepSeek Harness 通道插件,通过企业微信官方 WebSocket 长连接 SDK,把企微智能机器人连接到可持久化的 Harness agent。
功能
- 使用官方
@wecom/aibot-node-sdk长连接 SDK - Bot ID + Secret 鉴权、心跳保活和断线重连
- 支持单聊、群聊文本消息
- 支持图文混排消息
- 使用官方接口下载并 AES 解密企微图片、文件和视频
- 把图片保存为 Harness 持久附件
- 把解密后的入站文件保存到工作区之外,并通过绝对路径交给 Agent 工具
- 当前模型不支持图片输入时自动降级为文本元数据,不让整轮失败
- 支持文本、内联图片回复;其他图片格式通过临时素材上传后主动发送
- 提供仅当前企微回合可用的
wecom_send_file工具,并校验工作目录范围和文件大小 - 通过官方流式回复字段发送企微 Markdown
- 每个单聊或群聊对应一个独立、可恢复的 Harness 会话
- 挂载 Harness agent preset,使企微会话与网页会话使用相同的工具、提示词和技能组合
- 网页已打开同一会话时安全复用 live Agent,不创建第二个 session writer
/new、/reset会切换到新的持久会话,旧会话历史保留- 可配置转发当前 agent preset 注册的 Harness 斜杠命令,默认开放
/compact、/goal、/plan - 同会话消息串行处理、消息排重、发送重试和超时保护
- 单聊/群聊可分别配置开放、白名单或禁用
- 内置
/bot-ping、/bot-image-test、/bot-file-test、/bot-help、/bot-status、/bot-cancel - 可为企微
enter_chat事件配置欢迎语 - Secret 通过 Harness 凭据服务解析,不进入插件配置
环境要求
- Node.js 22.19 或更高版本
- pnpm 11
- DeepSeek Harness 0.1.0-rc.6 或更高版本
- 已开启长连接并取得 Bot ID、Secret 的企微智能机器人
安装
从 GitHub 安装到 web profile:
pnpm dsh plugin --profile web add github:sliverp/DeepSeek-harness-wecom
从本地检出安装:
pnpm dsh plugin --profile web add /absolute/path/to/DeepSeek-harness-wecom
配置
Bot ID 由启动环境提供,Secret 保存到 WECOM_BOT_SECRET 凭据引用。开发时也可以直接通过环境变量注入:
export WECOM_BOT_ID='your-bot-id'
export WECOM_BOT_SECRET='your-bot-secret'
pnpm dsh --profile web
组合包会读取 WECOM_BOT_ID,通过 ctx.credentials 解析 WECOM_BOT_SECRET,并默认让 agent 使用启动目录作为工作目录。可以用 DSH_WECOM_CWD 覆盖工作目录。
长期使用时,建议把 WECOM_BOT_ID 放到 ,并通过 Harness 凭据设置界面保存 。不要把任何真实凭据提交到 Git。