awol2005ex3/dsh-wecom0

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.

包名
dsh-plugin-wecom
版本
0.1.2-rc.1
许可证
Apache-2.0
最近更新
2026年9月10日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:awol2005ex3/dsh-wecom

快速启动(控制台配置)

安装后,打开 DSH 控制台 → 插件 → wecom → 配置:

  1. botId:企微智能机器人 Bot ID(API 模式 → 长连接页面获取)。
  2. secret:Bot Secret(仅创建时显示一次,role('secret') 脱敏存储)。
  3. preset:Agent 使用的 DSH preset 名称(默认 standard)。
  4. replyModemarkdownstream(默认 stream)。

另外,浏览器端会挂一个「⚙ 企微」入口(侧边栏 footer,缺失时回退为浮动按钮), 可在页面内直接读写上述配置,无需重启 host。

配置面板的 RPC 通道(harness 0.1.5+)

宿主端通过 connection.fetch.register() 注册两条 exact 路由:

路径方法作用
/api/wecom-rpc/getPOST读取当前配置(secret 回传 *** 占位)
/api/wecom-rpc/updatePOST写入配置补丁(patch 语义,未提供的字段保持原值)

不要用 connection.rpc.handle():0.1.5 起它在内部访问 owner.webServer, 而 connection 插件的 fiber 不再 inject webServer,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/getPOST读取当前配置(secret 回传 *** 占位)
/api/wecom-rpc/updatePOST写入配置补丁(patch 语义,未提供的字段保持原值)

不要用 connection.rpc.handle():0.1.5 起它在内部访问 owner.webServer, 而 connection 插件的 fiber 不再 inject webServer,cordis 4 会抛 cannot get property "webServer" without inject;错误被 connection 吞掉, host 无日志,浏览器只表现为 transport failure ... HTTP 405

配置字段

字段类型默认说明
botIdstring企微机器人 Bot ID(必填)
secretstringBot Secret(必填,role('secret') 脱敏)
presetstring'standard'DSH preset 名称
replyMode`'markdown''stream'`'stream'
sessionTtlMsnumber1800000会话空闲超时(毫秒,最小值 60000)
welcomeTextstring进入会话欢迎语(markdown),留空使用默认文案