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

@nautilis/dsh-plugin-weixin

v0.11.2

Published

WeChat (微信) channel for DeepSeek Harness — messaging bridge via iLink Bot API with built-in access control.

Readme

@nautilis/dsh-plugin-weixin

DeepSeek Harness(DSH)用的微信通道插件 —— 在微信里收发消息,由 DSH 会话里的 agent 来回复。

底层走微信 iLink Bot API 的 HTTP 长轮询,全部在本地运行,不需要公网地址,也不需要配 webhook。

功能

| 功能 | 说明 | |---|---| | 收发文本 | 微信消息转发给 agent,回复原路发回 | | 接收图片/文件 | 自动下载、解密并落到 inbox,agent 直接读文件 | | 发送图片/文件 | weixin_reply 带本地绝对路径即可,图片发照片、其它发文件附件 | | 引用消息还原 | 对方引用旧消息时,agent 能看到被引用的内容 | | 正在输入 | 对方在消息进来到回复发出之间看到「正在输入」 | | 访问控制 | 配对码 / 白名单 / 关闭三种策略,只有放行的人能触达你的会话 | | 图片自动切视觉模型 | 收到图片时只对该步切视觉模型读图,纯文本仍用会话所选模型 |

工具与技能

工具(agent 可直接调用):

  • weixin_reply — 回复微信。参数 user_id(来自入站消息头)、text、可选 files(本地绝对路径,图片发照片、其它发文件附件)。
  • weixin_login — 扫码登录/状态/清除/改 baseurl。action="qr" 取码展示,action="poll" 轮询确认并保存凭据。
  • weixin_access — 访问控制:status / pair / deny / allow / remove / policy / set

技能(用户在 GUI 里可发起,agent 执行):

  • weixin-configure — 登录与通道状态。
  • weixin-access — 配对、白名单、私聊策略。

安装

本包是一个「bundle」:dsh.bundle.patch 指向 cordis.patch.yml,后者把插件这一行插入 profile 组合。dsh plugin add 安装时会自动把它接进 dsh.profile.bundles

# 从本仓库 checkout 安装
dsh plugin --profile web add file:$(pwd)

# 或发布后按名安装
dsh plugin --profile web add @nautilis/dsh-plugin-weixin

首次 dsh plugin 会初始化 profile(web 模板 = dsh-base + dsh-web-app)。 本插件没有运行时依赖——qrcode 已打包进 lib/index.js(仅构建期 devDependency)。

从源码构建

lib/index.js 是构建产物(已随仓库提供)。改 src/ 后重新构建:

bun run build    # 等价于: bun build src/index.ts --outdir lib --target=node --external '@deepseek-ai/*'

构建需要一次 bun install(或 npm install)以取得 qrcode 这个 devDependency;产物 lib/index.js 自包含, 运行时不依赖它。

配置

在 profile 的 cordis.patch.yml(或本包 cordis.patch.yml)里给 weixin-channel 这一行配 config:

| 字段 | 默认值 | 说明 | |---|---|---| | routing | last | 入站消息投递到哪个活会话:last(最近创建)/ first(最早)/ session(用 sessionId 指定) | | sessionId | null | routing: "session" 时投递到的精确会话 id | | baseUrl | https://ilinkai.weixin.qq.com/ | iLink API 基地址 | | visionModel | deepseek-v4-flash-vision-exp | 收到图片时自动切到该模型读图;设为 null/"" 关闭自动切换 | | visionProvider | deepseek-official | 上述视觉模型的 provider |

示例(投递到固定会话):

- insert:
    - id: weixin-channel
      name: '@nautilis/dsh-plugin-weixin'
      config:
        routing: session
        sessionId: session-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

使用流程

  1. 装好后启动 dsh web,打开一个会话(routing: last 会把微信消息投进最近创建的那个会话)。
  2. 在 GUI 里发起 weixin-configure 技能(或让 agent 调 weixin_login action="qr"),扫码登录。
  3. 在微信里给 bot 发一条消息,它会回一个配对码。
  4. 让 agent 调 weixin_access action="pair" code=<配对码> 放行。
  5. 之后微信消息会以 [微信消息] 用户: <id> 的形式注入会话,agent 用 weixin_reply 回复。

说明

  • weixin_reply 只需 user_idcontext_token 由插件内部按用户缓存,不暴露给模型。
  • DSH 是多会话的,没有「单一活跃会话」。默认投到最近创建的会话,可用 routing/sessionId 配置。
  • 登录通过 weixin_login 工具完成,QR 与轮询都在工具内部处理。
  • 状态目录默认 ~/.dsh/channels/weixin/,可用 WEIXIN_STATE_DIR 覆盖。
  • 收到图片自动切视觉模型:入站消息带图片时,只对该步切到 visionModel(默认 deepseek-v4-flash-vision-exp)以读图,纯文本仍用会话所选模型。⚠️ 这 hook 了 DSH 内部的 agent/pre-step + agent/request seam(且硬编码了视觉模型路由),DSH 升级可能有变动;可用 visionModel: null 关闭。调试touch ~/.dsh/channels/weixin/debug-vision 后,自动切换的 pre-step/request 决策会写到 ~/.dsh/channels/weixin/vision-debug.log;删掉即停。

License

MIT。CDN 加解密链路与消息体格式移植自 Tencent/openclaw-weixin(MIT)。