dsh-plugin-wecom
DeepSeek Harness (dsh) plugin: WeCom (WeChat Work) smart-robot integration over the long-connection (WebSocket) API. Per-session agents, idempotent msgid dedup, stream/markdown replies, media download/upload, whitelist, welcome/feedback events.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:awol2005ex3/dsh-wecom说明文档
阅读完整 README ↗快速启动(控制台配置)
安装后,打开 DSH 控制台 → 插件 → wecom → 配置:
- botId:企微智能机器人 Bot ID(API 模式 → 长连接页面获取)。
- secret:Bot Secret(仅创建时显示一次,
role('secret')脱敏存储)。 - preset:Agent 使用的 DSH preset 名称(默认
standard)。 - replyMode:
markdown或stream(默认stream)。
另外,浏览器端会挂一个「⚙ 企微」入口(侧边栏 footer,缺失时回退为浮动按钮), 可在页面内直接读写上述配置,无需重启 host。
配置面板的 RPC 通道(harness 0.1.5+)
宿主端通过 connection.fetch.register() 注册两条 exact 路由:
| 路径 | 方法 | 作用 |
|---|---|---|
/api/wecom-rpc/get | POST | 读取当前配置(secret 回传 *** 占位) |
/api/wecom-rpc/update | POST | 写入配置补丁(patch 语义,未提供的字段保持原值) |
⚠ 不要用
connection.rpc.handle():0.1.5 起它在内部访问owner.webServer, 而 connection 插件的 fiber 不再 injectwebServer,cordis 4 会抛cannot get property "webServer" without inject;错误被 connection 吞掉, host 无日志,浏览器只表现为transport failure ... HTTP 405。
配置面板的 RPC 通道(harness 0.1.5+)
宿主端通过 connection.fetch.register() 注册两条 exact 路由:
| 路径 | 方法 | 作用 |
|---|---|---|
/api/wecom-rpc/get | POST | 读取当前配置(secret 回传 *** 占位) |
/api/wecom-rpc/update | POST | 写入配置补丁(patch 语义,未提供的字段保持原值) |
⚠ 不要用
connection.rpc.handle():0.1.5 起它在内部访问owner.webServer, 而 connection 插件的 fiber 不再 injectwebServer,cordis 4 会抛cannot get property "webServer" without inject;错误被 connection 吞掉, host 无日志,浏览器只表现为transport failure ... HTTP 405。
配置字段
| 字段 | 类型 | 默认 | 说明 |
|---|---|---|---|
botId | string | — | 企微机器人 Bot ID(必填) |
secret | string | — | Bot Secret(必填,role('secret') 脱敏) |
preset | string | 'standard' | DSH preset 名称 |
replyMode | `'markdown' | 'stream'` | 'stream' |
sessionTtlMs | number | 1800000 | 会话空闲超时(毫秒,最小值 60000) |
welcomeText | string | — | 进入会话欢迎语(markdown),留空使用默认文案 |