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

opencode-qq-yz

v0.1.6

Published

QQ bot (C2C) <-> opencode bridge plugin. Fork of opencode-qq 0.1.0 with OpenCode 2.x compatibility patch, /model command, and 3-tier model auto-fallback with 12h auto-restore.

Readme

opencode-qq-yz 0.1.1

QQ bot (C2C) ↔ OpenCode bridge plugin. Fork of [email protected], packaged as [email protected].

QQ 单聊 ↔ opencode 桥接插件。[email protected] 的修复分叉,发布为 [email protected]。

相比 0.1.0 新增 / 修复

| 项 | 内容 | |---|---| | 名称/版本 | opencode-qq 0.1.0 → opencode-qq-yz 0.1.1,插件 id 同步改 opencode-qq-yz | | OpenCode 2.x 兼容 | 不依赖 v1 input.client;全走 opencode-cli.exe api;CLI 路径动态扫描最高版本,桌面版升级不 ENOENT | | session.create 模型形状 | model: { id, providerID }(修正 400 Bad Request) | | 3 层模型自动链 | model → secondaryModel → fallbackModel;模型不可用自动下沉,单条消息内重试到底 | | 模型“不通”判定 | 429/402、provider.quota、free-limit/quota/usage limit/Insufficient Balance、任何模型层报错、建会话失败、90s 无回复 | | 12h 自动恢复 | 停在兜底档 retryMinutes(默认 720) 后,按优先级真实探测首选→第二选,通了自动切回并重置会话;后台每 60s 检查 + 下条消息触发 | | /model 命令 | /model 编号可选菜单;/model <编号> 选择;/model providerID/modelID 精确切换;/model list [kw] 搜索;手动切换重定义首选、保留第二/兜底、重置会话 | | 模型诊断 /diag (0.1.3+) | 对链上每个模型真实探测 + 当前档位/角色 + 自动切换状态 + 12h 恢复倒计时 | | /status | 兜底时显示 (兜底模式) |

不包含任何凭据。 appId/appSecret/模型配置全在用户自己的 opencode-qq.json。

安装

方式 A:npm(发布后)

npm i [email protected]

在 ~/.config/opencode/opencode.jsonc(或项目 opencode.jsonc)的 plugin 数组加 "opencode-qq-yz"。

方式 B:本地 tarball(无需 npm registry)

npm i ./opencode-qq-yz-0.1.1.tgz      # npm pack 产物
# opencode.jsonc plugin 数组里用 "opencode-qq-yz"

方式 C:git

# opencode.jsonc plugin 数组加本仓库地址或本地 clone 路径

方式 D:本地目录

plugin 数组加绝对路径 "D:/path/to/opencode-qq-yz"。

重启 opencode(opencode-cli.exe service restart)。确认:opencode-cli.exe plugin list → opencode-qq-yz 0.1.1。

配置

~/.config/opencode/opencode-qq.json(沿用原文件名,现有配置可复用;不要提交此文件):

{
  "appId": "你的QQ机器人AppID",
  "appSecret": "你的QQ机器人AppSecret",
  "model": "opencode/seaglass-alpha-free",
  "secondaryModel": "opencode/deepseek-v4.1-flash-free",
  "fallbackModel": "alibaba-cn/qwen-flash",
  "autoFallback": true,
  "retryMinutes": 720
}
  • model:首选,格式 providerID/modelID
  • secondaryModel:第二选择;可省略(退化为 2 层)
  • fallbackModel:两个都不通时的兜底;可省略(退化为更少层)
  • autoFallback:false 关闭自动切换,默认 true
  • retryMinutes:停在兜底后多久自动探测恢复,默认 720(12h)

模型在建会话时定死,任何切档/回切自动重置会话。QQ 网关单例:同一 AppID 只能一个实例连网关。

绑定 QQ 凭据(安装时自动扫码)

opencode-qq-yz 自带 postinstall:npm i opencode-qq-yz 时自动运行 node bin/setup.mjs,用 @tencent-connect/qqbot-connector(已作为依赖自动装好)打印二维码,用手机 QQ 扫码绑定,凭据写入 opencode-qq.json(保留已有 model/fallbackModel/secondaryModel/retryMinutes 等,无 BOM)。

# 看到二维码(npm 默认抑制脚本输出,加这个):
npm i opencode-qq-yz --foreground-scripts
# 跳过安装时扫码(CI / 已手动配置 / 离线):
QQ_BOT_SKIP_BIND=1 npm i opencode-qq-yz
# 改扫码超时(默认 120000ms,超时不影响安装):
QQ_BOT_QR_TIMEOUT=60000 npm i opencode-qq-yz --foreground-scripts

非致命 + 非阻塞:已检测到 appId+appSecret(或环境 QQ_BOT_APPID+QQ_BOT_APPSECRET)→ 跳过;CI/npm_config_ignore_scripts/QQ_BOT_SKIP_BIND → 跳过;扫码未返回/超时/缺依赖 → 打印提示、npm install 仍成功(postinstall 退出码 0,强制 process.exit,不卡死);已绑定/失败不覆盖已有凭据。绑定是终端二维码(非 PNG 文件)。

已经安装后 / 重新绑定,单独运行:

npx opencode-qq-yz-setup        # 同一脚本;此时手动调用失败会返回非 0,但仍不动已有凭据

或手动填 appId/appSecret(不要提交),或设环境变量 QQ_BOT_APPID/QQ_BOT_APPSECRET。

@tencent-connect/qqbot-nodejs(腾讯官方 QQ SDK)不是本绑定依赖,本插件自带 QQ 网关;用的是 @tencent-connect/qqbot-connector 扫码取 appId/appSecret。

行为

  • 收到 QQ 消息 → 建/续会话 → 模型回复 → 发回 QQ(支持图片、引用、流式、被动回复、远程审批 #n y/n)
  • 命令:/new /status /help /model ...

兼容性 / 风险

  • 面向 OpenCode 2.x(实测 2.4.2/2.4.3)。升级 opencode 后若插件失效,本包已不硬编码 CLI 版本目录;仍需保证 opencode-cli.exe api 接口形状未变。
  • 与原 opencode-qq 互斥(同 AppID 不要两个插件同时连网关)。
  • 许可 MIT;原作 opencode-qq 作者 aaawzb。

发布(维护者)

cd opencode-qq-yz
npm pack                 # → opencode-qq-yz-0.1.1.tgz
npm publish              # 需 npm login;scope 无,发布为 opencode-qq-yz