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-weixin-ilink

v1.1.0

Published

Zhin.js Weixin iLink (ClawBot) adapter for Plugin Runtime (long-poll)

Readme

@zhin.js/adapter-weixin-ilink

通过微信 iLink Endpoint API(ClawBot 灰度入口)接入个人微信,支持文本与全量媒体收发。Plugin Runtime 约定式 defineAdapter(长轮询入站,无 host-router / Koa)。

协议实现移植自 Tencent/openclaw-weixin(MIT),已去除 OpenClaw 耦合,bot_agent 默认为 Zhin.js/<version>

与 wechat-mp 的区别

| 项 | weixin-ilink | wechat-mp | |---|---|---| | 账号类型 | 个人微信(ClawBot) | 微信公众号 | | 入站 | 长轮询 getupdatesEndpoint.emit(...) | Webhook(httpHostToken) | | 登录 | 扫码 / 侧车凭证 / botToken | AppId/Secret/Token | | 群聊 | 不支持(仅私聊) | 支持 |

可与 @zhin.js/adapter-wechat-mp 同时启用

前置条件

  • 微信客户端需已灰度 ClawBot 入口(最新版微信 + 灰度资格)
  • Node.js ^20.19.0 或 >=22.12.0

最小配置

plugins:
  weixin-ilink:
    # botAgent: "Zhin.js/1.0.0"
    # longPollTimeoutMs: 35000
    # baseUrl: https://ilinkai.weixin.qq.com
    endpoints:
      - name: my-wechat
        # botToken: "..."                 # 或环境变量 WEIXIN_ILINK_TOKEN

botToken 也可保存在侧车文件(不进 git):

data/weixin-ilink/<bot-name>.json

登录流程

  1. 首次启动无凭证时,调用 get_bot_qrcode 并在日志中打印二维码内容
  2. 用户用微信扫码确认
  3. 后台轮询 get_qrcode_status 直至 confirmed,写入 data/weixin-ilink/<name>.json
  4. 调用 notifyStart 后进入长轮询

Console 扫码面板(旧 loginAssist + host-router)已从生产路径移除;优先用 botToken / 侧车凭证。

出站说明

回复必须携带入站时缓存的 context_token(按 endpointId + peerUserId)。若用户久未发消息导致 token 缺失,出站会拒绝并打 warn。

出站经 Runtime:OutboundMessageServiceendpoint.send({ conversation, payload })conversation 为入站归一化出的 ConversationRef,kind 恒为 privateid 即对端 user_id)。

图文限制:微信单条消息不支持图文混排。适配器会自动:

  • 出站:先单独发文本,再发纯媒体(不带 caption)
  • 入站:文字与媒体路径写入同一条 gateway content 文本

故障排查

| 现象 | 可能原因 | |---|---| | 无法扫码 / 无 ClawBot 入口 | 未灰度;需最新微信 + 灰度资格 | | 二维码过期 | 重启适配器重新获取 | | 发不出消息 | 缺少 context_token;让用户先发一条消息 | | errcode -14 | 会话过期,适配器自动暂停 1 小时后重试 |

文档