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

dsh-claw

v0.1.0

Published

Messaging-platform bridge for DeepSeek Harness, with Telegram administration and streaming conversations.

Readme

dsh-claw

English

dsh-claw 把 DeepSeek Harness 接入消息平台。当前版本实现 Telegram,并把平台收发、管理员操作、Harness Session 控制和流式输出拆成通用接口,后续接入微信或飞书时不需要改动 Conversation 生命周期。

行为

同一个 Telegram Bot 可以加入任意多个群组、超级群组或频道。每个聊天对应一个独立的持久化 Harness Session,因此即使共用同一个 Bot,各群聊的历史、模型选择、cwd 和 agent 活动也互相隔离。Telegram chat id 是外部 Conversation id,管理员配置的目录决定 Harness Workspace。Bot 私聊只用于管理,不会成为模型对话。

第一个在 Bot 私聊中发送 /register 的 Telegram 用户成为管理员,其他用户不能覆盖该身份。新发现的群组或频道保持待配置状态,管理员必须先通过 /cwd 指定首次工作目录;第一条获准的普通消息随后创建 Session、挂接对应 Workspace 并启动 agent。

助手输出从持久化的 assistant/chunkassistant/messageturn/end Session 事件投影而来。Telegram 先收到可编辑的处理中消息,再按配置的最小间隔更新文本;最终完整答复会按 Telegram 消息长度限制分段。临时 Bot API 错误使用 retry_after 和有界重试。

Telegram 照片和图片文档(pngjpegwebpgif)使用 DSH 原生多模态准入。Adapter 在配置的下载上限内获取字节,随后由 ctx.attachments 解码、校验并持久化全部图片;Session 最终收到保持顺序的 image block,caption 文本位于图片之后。所选模型在声明输入模态时必须包含 image。

其他 Telegram 文档保存在绑定 Workspace 的 .dsh/telegram_attachment/ 目录中,文件名由内容哈希和清理后的原始名称组成。同一条已记录用户消息会告诉模型这些 workspace-relative path,因此工具可以读取文件,同时不引入平台专属绝对路径或未记录上下文。

Telegram 报告 Bot 离开或被移出群组/频道时,对应 Harness Session 会自动归档,从普通 Workspace 分组中隐藏,但不会删除日志。管理员也可以显式执行 /archive

要求

  • DeepSeek Harness 0.1.0-rc.6
  • Node.js ^22.19.0>=24.0.0
  • @BotFather 获取的 Telegram Bot token。
  • 设置面板需要 DSH Web;Host 接入在浏览器未打开时仍会运行。

如需接收群组中的普通消息,请通过 BotFather 关闭 Bot privacy mode,或把 Bot 设为群管理员。频道必须授予 Bot 管理员权限,Bot 才能收到 channel_post 更新。

安装

把插件安装到 Web profile 并重启 DSH:

dsh plugin --profile web add dsh-claw
dsh web

打开 设置 → 通用设置 → 消息平台,填写 Bot token,启用 Telegram 并保存。Provider 会先验证 token 再开始长轮询,面板会显示实时启动结果。

DSH 设置中的消息平台入口

DSH 设置页只需要填写一个 Telegram Bot Token。通过 @BotFather 创建 Bot,把获得的 token 粘贴到这里并启用 Telegram 即可。群聊与 Session、Workspace 的映射随后在 Bot 中管理;不同群聊不需要分别配置 token。

本地开发:

pnpm install
pnpm run verify
dsh plugin --profile web add link:$PWD
pnpm run watch

Host 代码变更需要重启 DSH;浏览器代码可通过 DSH client HMR 加载。

Telegram 配置流程

同一个 Bot 可以服务多个群聊,同时为每个群聊保持独立 Session。把 Bot 加入各个群聊后,必须先在 Bot 私聊中为该群聊设置 cwd,才能开始第一次对话。如果群聊尚未配置就发送消息,Bot 会回复管理员需要在私聊中执行的完整 /cwd 指令。

| Bot 私聊管理 | 隔离的群聊 Session | |---|---| | 在 Bot 私聊中设置群聊 cwd | 群聊在设置 cwd 前被阻止,配置后使用独立 Session 对话 |

  1. 私聊 Bot,并由管理员账号发送 /register
  2. 创建 Telegram 群组或频道并加入 Bot;Telegram 不允许 Bot 代替用户创建群组或频道。
  3. 在群组/频道中发送 /id,也可以在 Bot 私聊中执行 /conversations
  4. 在 Bot 私聊中执行 /cwd <conversation-id> <绝对路径>
  5. 在群组/频道中发送普通消息;对应 Harness Session 会在第一条获准消息到达时创建。

可用指令:

| 指令 | 使用位置 | 效果 | |---|---|---| | /register | Bot 私聊 | 占用尚未注册的管理员槽位。 | | /conversations | 管理员私聊 | 列出已发现 Conversation、状态、cwd 和 Session id。 | | /models | 管理员私聊 | 列出已注册的 provider/model,并标记默认模型。 | | /model <id> <provider> <model> [effort] | 管理员私聊 | 预设或切换一个 Conversation 的模型;下一次模型请求开始生效。 | | /cwd <id> <path> | 管理员私聊 | 在 Session 创建前设置工作目录;目录必须已经存在。 | | /rename <id> <title> | 管理员私聊 | 预设或写入基于日志的 Harness Session 名称。 | | /archive <id> | 管理员私聊 | 归档映射的 Harness Session。 | | /id | 群组、频道或私聊 | 显示平台 Conversation id。 | | /help | 任意聊天 | 显示当前界面可用的指令。 |

第一条获准消息创建 Session 后,cwd 不可修改。需要其他 Workspace 时,请创建新的 Telegram 群组或频道。

模型选择会随 Conversation binding 持久化。预设的路由用于创建 Session;实时切换会在 prompt assembly 和 request routing 之间以同一份选择生效,因此正在执行的请求不会跨模型拆分。不填写 effort 或传入 default 时使用所选 Provider 的默认 reasoning 行为。

配置与安全

Bot token 是 role('secret') 设置字段。设置 RPC 和浏览器状态只暴露 token 是否已配置,面板只能写入、不能读回 token。token 仍保存在 Harness 设置文档中,静态安全依赖该文件的主机权限,并未加密。

设置 RPC 仅允许 loopback 浏览器访问。管理员身份、已发现 Conversation 元数据、cwd 映射、Session id 和归档状态都保存在 claw 设置 namespace。需要重置管理员时,先禁用 Telegram,再从设置文档的该 namespace 删除 administrator 字段,然后重新启动 Provider。

/cwd 同时承担 Conversation 批准操作:没有管理员指定目录的群组或频道不能提交模型输入。批准后,只要 Telegram 把成员消息投递给 Bot,该 Conversation 中的成员都可以发起对话。

扩展接口

公开的 dsh-claw/platform export 定义 Provider factory、输入事件、opaque 平台 id、消息编辑、typing 状态和日志接口。后续 Provider 只需把平台 wire event 翻译成这些接口;ClawBridge 继续统一负责管理员指令、一对一 Conversation/Session 映射、归档语义和流式输出。

Provider 设置统一放在 platforms 下,Telegram 是第一个成员。微信或飞书支持可以新增自己的 Provider schema 和面板字段,而无需改变已有 Telegram binding。

已知限制

  • 当前支持文本、照片和 Telegram 文档;音视频、reaction、thread/topic 和回调键盘尚未接入。
  • Telegram 会把 media group 的成员作为独立 update 投递;当前版本把每个成员作为独立 prompt,不猜测相册何时完整。
  • Telegram 提供 Bot 成员状态变化,但不提供完整 chat 清单。因此,Bot 收到 my_chat_memberleftkicked 状态时会自动归档;Telegram 没有发送删除更新时可使用 /archive
  • 流式 Markdown 在生成完成前可能不完整,因此当前以纯文本发送。最终答复保留内容和换行,但不会生成 Telegram formatting entity。
  • 同一个 Bot token 同时只能由一个长轮询进程使用。

模型体验

已配置 Telegram Conversation 中获准的消息会作为带身份的普通用户消息进入 agent inbox,并在到达模型前记录为 user/message。图片会在该事件追加前成为持久化 DSH attachment reference;图文混合 prompt 保持 Telegram 图片顺序,并把 caption 文本放在图片之后,与 DSH Web 准入一致。非图片文档保存在 Workspace 中,其相对路径出现在同一条日志消息内。插件不会向 prompt 注入 Telegram 专属元数据。助手流式输出只是 Session 日志的投影,不会产生新的模型可见事件。

许可证

MIT