npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lihuiquan2021/dsh-relay-bot

v0.1.5-rc.21

Published

Relay chat-surface bot for DeepSeek Harness: subscribes to a relay service over WebSocket, injects app prompts, mirrors session events, uploads produced files, forwards approval asks, and answers control requests

Readme

@lihuiquan2021/dsh-relay-bot

English | 中文

Relay 转发平台线的 DSH 端插件:拨入中转服务 /ws/dsh,把 App 发来的消息注入会话、把订阅会话的事件镜像回 App、上传一轮产物、转发审批请求并把决定回注 agent、推送会话/工作区快照、应答控制操作。协议契约见 docs/PROTOCOL.md(§5/§6/§7/§8/§9),架构见 docs/ARCHITECTURE.md §3.2 与 §5.6。

以 packages/bot/feishu-bot 为模板,只替换适配层:飞书的单接管槽位换成「会话订阅集」,飞书 SDK 长连接换成 Node 内置 WebSocket 的 dsh.* 帧协议。

设置字段

Settings namespace relay(可经 cordis.yml 的 config 或设置面板配置):

| 字段 | 类型 | 说明 | |---|---|---| | serverUrl | string | 中转服务基地址,如 wss://relay.example.com | | appId | string | 中转服务签发的应用 ID | | appSecret | string | 应用密钥(role: secret,不出现在设置回读) | | enabled | boolean | 总开关;关闭时长连接保持断开 | | configured | boolean | 宿主维护:enabled 且三项连接字段齐全 | | connected | boolean | 宿主维护:WebSocket 当前已 dsh.bound |

插件 Config(组合入口的 base 层,均为可选):

| 字段 | 默认 | 说明 | |---|---|---| | serverUrl / appId / appSecret / enabled | ''/''/''/false | 连接字段 | | approvalTimeoutMs | 300000 | 未答复的审批请求超时后按 rejected 兜底 | | maxDeliveredFiles | 3 | 每轮完成时上传产物文件数的上限(0~9) | | replayWindowFrames | 80 | 每会话补投窗口,按「relay 帧」计数(约一屏/一页)——更早的内容折叠成 gap 分隔行,上滑按需分页。按帧而非按回合:一个回合可能包含数百帧工具调用与流式增量 | | replayWindowTurns | 5 | 已废弃(忽略),由 replayWindowFrames 取代 |

安装(独立包)

本包已发布到 npm,作为外部插件装进任意 DSH 的 web profile:

dsh plugin --profile web add @lihuiquan2021/dsh-relay-bot

安装后包会自动追加进该 profile 的 dsh.profile.bundles,重启 DSH 生效。桌面端在 App 的插件面板填同一个包名。

若宿主自己的 bundle patch 里仍内置 relay-bot 行(例如把本插件并入过的 fork),必须先删掉那一行再安装:两边会 insert 同一个 row id,启动时报 duplicate loader entry id: relay-bot。

硬性边界

  • 文本事件 text 按 UTF-8 字符截断到 64KB(truncateText)。
  • 入站/产物文件单文件上限 20MB,超出跳过;产物上传后以 files 事件(含 fileId)告知 App。
  • 按 clientMsgId / fileId 去重(at-least-once 重放幂等),去重集合上限 1024。
  • 注释英文、面向用户/日志的文案中文。

已知限制与后续工作

  • 本包不内置 Web 设置 UI(feishu-bot 有 src/client);连接字段目前只能经 cordis.yml 配置。后续可照抄 feishu-bot 的 client 层补设置卡片。
  • DSH 插件断线期间的 dsh.event 不本地缓冲(协议只对 App→DSH 消息做 resendSeq 补投);App 靠重连后的 dsh.sessions 快照恢复会话状态。
  • 产物文件识别沿用 feishu-bot 的「工具 presenter diff/generic-edit locations」策略,未启用 tools 服务时产物不上传。