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

@zhin.js/adapter-napcat

v3.0.2

Published

Zhin.js adapter for NapCatQQ (OneBot11 superset with go-cqhttp & NapCat extensions)

Readme

@zhin.js/adapter-napcat

QQ 群助手 + 可选 @AI — 先在 demo.zhin.dev 或 Sandbox 调试,再接 NapCat。启用 AI:npx zhin setup --ai。接入本适配器:npx zhin setup --adapters

Zhin.js NapCatQQ 适配器,支持 OneBot11 标准 + go-cqhttp 扩展 + NapCat 独有 API。

功能特性

  • 完整 OneBot v11 协议兼容 + go-cqhttp 扩展 + NapCat 独有 API(92+ 接口)
  • 单一适配器context: napcat,通过 connection 选择连接方式
  • 正向 WebSocketconnection: ws):应用连 NapCat 的 WS
  • 反向 WebSocketconnection: wss):应用开 WS 服务端,NapCat 连上来
  • HTTP API + POST 上报connection: http):出站 HTTP 调用,入站 webhook
  • Access Token 认证支持(Bearer / HMAC 签名)
  • 自动重连机制(WS)与心跳检测
  • 群聊和私聊消息处理
  • 入站消息去重与 bot 自发消息过滤
  • Typing Indicator(处理中提示:群聊表情回应 / 私聊输入状态)
  • 41 个 AI 工具(群管、戳一戳、表情回应、精华消息、群公告、AI 语音等)
  • Console 管理页面(/console/napcat
  • Agent Prompt 贡献器(deferred 任务自动优选 napcat 工具)

安装

pnpm add @zhin.js/adapter-napcat ws

反向 WS / HTTP 模式需同时启用 @zhin.js/host-router

配置

所有 Endpoint 使用 同一 context:napcat,通过 connection 区分连接方式。

正向 WebSocket(connection: ws)

plugins:
  - "@zhin.js/adapter-napcat"

endpoints:
  - context: napcat
    connection: ws
    name: my-bot
    url: "ws://127.0.0.1:3001"
    access_token: "${NAPCAT_TOKEN}"
    reconnect_interval: 5000
    heartbeat_interval: 30000

反向 WebSocket(connection: wss)

plugins:
  - "@zhin.js/host-router"
  - "@zhin.js/adapter-napcat"

endpoints:
  - context: napcat
    connection: wss
    name: my-bot
    path: "/napcat/ws"
    access_token: "${NAPCAT_TOKEN}"
    heartbeat_interval: 30000

HTTP API + POST 上报(connection: http)

plugins:
  - "@zhin.js/host-router"
  - "@zhin.js/adapter-napcat"

endpoints:
  - context: napcat
    connection: http
    name: my-bot
    http_url: "http://127.0.0.1:3000"
    post_path: "/napcat/post"
    access_token: "${NAPCAT_TOKEN}"
    poll_interval: 30000

Typing Indicator(处理中提示)

endpoints:
  - context: napcat
    connection: ws
    name: my-bot
    url: "ws://127.0.0.1:3001"
    typingIndicator:
      enabled: true
      defaultEmoji: "128516"
      privateConfig:
        type: "message"
        message: "正在思考中..."
      groupConfig:
        type: "reaction"
        emoji: "128516"

NapCat 独有能力

相比标准 OneBot11 适配器,NapCat 额外支持:

  • 戳一戳(群聊 / 私聊)
  • 表情回应(贴表情)
  • 合并 / 单条消息转发
  • 精华消息管理
  • 群公告管理
  • 群文件管理
  • AI 语音 TTS
  • 图片 OCR 文字识别
  • 小程序卡片签名
  • 个人资料 / 头像 / 签名修改
  • 在线状态设置
  • 消息历史查询
  • 英译中翻译

AI 工具

full-bot L4 参考

examples/full-bot 默认加载本适配器(endpoints 段需自行填写 ONEBOT11_* 后取消注释)。

  • 入站 → ZhinAgent → 出站走 Adapter.sendMessage 统一链路
  • 契约测试:plugins/adapters/napcat/tests/l4-contract.test.ts + integration.test.ts(adapter-harness)
  • CI:L4_SKIP_PLATFORM=1 跳过实机;本地验证不设该变量并可配置 ONEBOT11_WS_URL

详见 full-bot ACCEPTANCE.md