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-wechat-queue

v0.2.1

Published

WeChat (iLink) channel for DeepSeek Harness with a durable serial message queue

Readme

dsh-wechat-queue

License Zero deps DSH Version

在微信里和你的 AI 助手聊天。

发文字、发图、发文件、发视频,它在微信里回你。 一条回完才处理下一条,进程死了重启接着干 —— 你的消息不会丢。

Talk to your AI agent from WeChat. Text, images, files and videos in; one reply per turn out; messages survive a restart.

把微信接入 DeepSeek Harness —— 带一个落盘的串行消息队列。 A WeChat (iLink) channel for DeepSeek Harness with a durable serial message queue.


0.2.1 更新了什么

插件行为没有变化。这次只补了开源清单要的三个仓库文件:SECURITY.md、Dependabot 配置、 package-lock.json。代码没动。

它替你挡住的三种意外

你在微信发消息
     ↓
立即写盘(JSONL)      ← ① 进程此刻被杀,消息还在
     ↓
排队,严格串行          ← ② 不会两条消息抢着跑、回复交错
     ↓
跑完这一轮             ← ③ 中途的中间片段不外发,只回最终结果
     ↓
把完整回复发给你

| 意外 | 会发生什么 | |---|---| | 进程崩了 / 你重启了电脑 | 重启后从磁盘恢复,没处理完的消息接着跑 | | 你连发三条 | 按顺序一条条处理,不会乱序、不会回复串台 | | 这一轮跑了三分钟 | 中间不刷屏,跑完一次性给你结果 |


三十秒上手

npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SteelUnion/dsh-wechat-queue

装完重启 DSH,在插件页点登录、手机扫码,就能在微信里找它说话了。


它替你省什么

| 你担心的 | 实际情况 | |---|---| | 消息会不会丢 | 不会。 每条消息一进来就写盘,进程被杀也没关系 | | 会不会回一半停住 | 不会。 攒到这一轮跑完,一次发完整回复 | | 会不会和别的消息插队 | 不会。 严格串行,一条处理完才拿下一条 | | 手机能不能收到选项弹窗 | 不能。 微信是回合制通道,所以本插件配合 dsh-confirm-gate 会自动改用文字提问 |


它解决什么(对比老插件)

用微信和你的 DSH agent 对话:发文字、发图、发文件、发视频,它在微信里回你。 一条回完才处理下一条,进程死了重启接着干。


English

A WeChat channel plugin for DeepSeek Harness. Messages are persisted to disk and processed strictly one at a time — the next message is only picked up after the previous turn has finished and been replied to. The agent replies once per turn (at turn/end), shows a native "typing" indicator, and can receive images, files and videos.

Built to replace dsh-channel-wechat, which had three structural problems: missed messages (it polled with the oldest stale bot credential), mid-turn replies (it sent every assistant/message fragment), and deadlocks (no timeout, silent catch {}).


它解决什么

| 问题 | 老插件 | 本插件 | |---|---|---| | 收不到 | listAccounts()[0] 取最旧的僵尸账号 | 登录时清空旧记录,永远只有一个 | | 中途发 | 每个 assistant/message 都发一段 | 攒到 turn/end,一次发完 | | 卡死 | runExclusive 无超时 + catch {} 静默 | 三层超时,任何终态都推进队列 |


功能

  • 严格串行:一条回完才取下一条,不会在 inbox 里堆成多个 turn
  • 落盘队列:JSONL 存盘,进程死了重启接着处理
  • 对方正在输入:轮次开始上报,结束收掉;它坏了不影响主流程
  • DSH 原生命令转发:/compact、/goal 等进队列执行,与普通消息同序
  • 接收图片 / 文件 / 视频:失败不丢文字,只在那条附件上留一句说明
  • 发送文件:回复里提到 deliverables/ 下的文件就会发过去
  • 附件声明:告诉 agent 附件的名字、大小、uid,它不用翻目录猜
  • 扫码登录面板:单账号,登录时清空旧记录

安装

dsh plugin --profile desktop add <解压后的目录>

装完完全退出 DSH 再启动,宿主才能发现插件。

首次使用需要在 GUI 插件页扫码登录,或者用环境变量临时登录:

$env:DSH_WECHAT_QUEUE_TOKEN = "<accountId>:<token>"

配置

- id: wechat-queue
  config:
    enabled: true

    # 会话工作目录。决定微信那边读到的是谁的人格。
    cwd: 'C:\path\to\your\workspace'

    # 权限:管「能不能碰文件」
    permission: 'danger-full-access'

    # Agent 预设:管「有没有工具可用」
    agentPreset: 'cordis'

    deliverTimeoutMs: 600000
    turnTimeoutMs: 600000
    queueAckText: ''

⚠️ permission 和 agentPreset 是两件事

| 配了什么 | 结果 | |---|---| | 只给 permission | 权限全开,但 agent 一个工具都没有 | | 两个都给 | 权限全开 + 工具齐全 |

只给 permission 时,agent 会说「我没有工具,请你手动跑这条命令」,而且它说的是实话。

agentPreset 不要留空串 —— 空串会回落到 profile 的默认预设,不一定是你在用的那个。


微信内命令

| 命令 | 作用 | |---|---| | /stop | 中止当前这一轮(写标记,不会卡住) | | /status | 队列状态 | | /new | 开一段新对话 | | /help | 帮助,含 DSH 原生命令列表 |

其他 /xxx 如果 DSH 认识,会进队列在轮到时执行。


发文件给微信

把文件放进 <cwd>/deliverables/,然后在回复里提到它。

<你的工作区>/
└─ deliverables/
    └─ 报告.pdf          ← 放这里,提到就会发

只有 deliverables/ 下的文件才会被自动发送。

不加这个限制的话,模型说「我读了 SOUL.md、USER.md」就会把那些文件也发出去 —— 列举路径不等于要发文件。


数据在哪

| 内容 | 位置 | |---|---| | 队列记录 | <DSH_HOME>/wechat-queue/queue-YYYY-MM-DD.jsonl | | 运行日志 | <DSH_HOME>/wechat-queue/wechat-queue-YYYY-MM-DD.log | | 轮询游标 | <DSH_HOME>/wechat-queue/cursor.txt | | 启动错误 | <DSH_HOME>/wechat-queue/startup-error.txt | | 账号凭证 | .credentials.yaml 的 wechat-queue/account |

排查先看运行日志。 GUI 启动没有终端,console.error 的输出没人看得见。


消息状态

received → queued → delivered → running → replied
                                     ├→ failed   (带 stage + error)
                                     ├→ timeout  (带 stage)
                                     └→ stopped  (被 /stop)

任何终态都会让队列推进到下一条。 这是「永不堵死」的来源。


测试

node test/zz-all.mjs

548 项,18 个套件,0 失败。

覆盖:串行与超时、状态机、JSONL 存储、四种媒体(图片/文件/视频/语音)、 文件发送与上传、预设挂载契约、事件竞态、扫码登录。


打包

node pack.mjs           # 输出 dist/dsh-wechat-queue-v<version>.zip
node pack.mjs --list    # 只列清单

零运行时依赖。 peerDependencies 只声明 @deepseek-ai/cordis, DSH 本体版本要求写在 engines.dsh。


技术要点

为什么不用 ctx.get() 做软探测:它不是软探测,用到的服务必须写进 inject,否则直接抛。

为什么 agentPresets.resolve() 必须 await:它是 async 的。不 await 会拿到一个 Promise, preset?.id 永远是 undefined,于是预设从未挂载 —— 这就是「权限全开但一个工具都没有」的原因。

为什么媒体要「先下载完再入队」:worker 是独立循环,enqueue 一完成它就可能取走交付。 图片几十毫秒赶得上,视频几秒就赶不上 —— 附件会丢掉,而且队列记录看起来一切正常。

这些坑和更多细节都在 NOTES.md。


来源声明

协议层(lib/protocol/)搬自 dsh-channel-wechat v0.2.5(MIT)。 lib/protocol/qrcode.js 是 vendored 的 qrcode-generator 2.0.4(MIT)。

详见 THIRD_PARTY_NOTICES.md。

队列层、worker、桥接层、命令转发、typing 指示器、媒体处理是本插件自己的实现。

许可

MIT。全文见 LICENSE。