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

@houchenyang/nexus

v1.0.2

Published

OpenClaw channel plugin for connecting to Nexus Gateway

Downloads

279

Readme

Nexus Channel

OpenClaw 插件,用于连接 Nexus Gateway 网关服务。

这是 OpenClaw Nexus 项目的客户端插件组件。

功能

  • WebSocket 长连接,自动重连
  • 心跳保活
  • 消息收发与回复
  • 支持流式回复

安装

方式一:npm 安装

openclaw plugins install @houchenyang/nexus

方式二:本地安装

# 克隆或下载到 extensions 目录
git clone https://github.com/hcy050617/openclaw-nexus.git ~/.openclaw/extensions/nexus

# 安装依赖并编译
cd ~/.openclaw/extensions/nexus
pnpm install
pnpm build

配置

~/.openclaw/openclaw.json 中添加配置:

{
  "channels": {
    "nexus": {
      "enabled": true,
      "serverUrl": "ws://your-server:17392/bot-ws",
      "botId": "my-bot",
      "botName": "My Bot",
      "token": ""
    }
  },
  "plugins": {
    "entries": {
      "nexus": {
        "enabled": true
      }
    }
  }
}

配置说明

| 字段 | 类型 | 说明 | |------|------|------| | enabled | boolean | 是否启用 | | serverUrl | string | Nexus Gateway WebSocket 地址 | | botId | string | Bot 唯一标识 | | botName | string | Bot 显示名称 | | token | string | 连接令牌(可选) |

使用命令

# 启用插件
openclaw config set plugins.entries.nexus.enabled true

# 配置连接
openclaw config set channels.nexus.enabled true
openclaw config set channels.nexus.serverUrl "ws://your-server:17392/bot-ws"
openclaw config set channels.nexus.botId "my-bot"
openclaw config set channels.nexus.botName "My Bot"
openclaw config set channels.nexus.token "your-bot-token"

# 重启
openclaw gateway restart

WebSocket 协议

注册

Bot 连接后发送注册消息:

{
  "type": "register",
  "botId": "my-bot",
  "botName": "My Bot",
  "token": ""
}

接收消息

Gateway 转发用户消息:

{
  "type": "chat",
  "id": "msg-xxx",
  "content": "你好",
  "from": "用户名",
  "timestamp": 1706600000000
}

回复消息

Bot 发送回复:

{
  "type": "reply",
  "id": "reply-xxx",
  "replyTo": "msg-xxx",
  "content": "回复内容",
  "done": true,
  "timestamp": 1706600001000
}

支持流式回复,done: false 表示未完成。

心跳

// Gateway -> Bot
{"type": "ping"}

// Bot -> Gateway
{"type": "pong"}

文件结构

nexus-channel/
├── index.ts              # 插件入口
├── package.json          # 包配置
├── openclaw.plugin.json  # 插件元数据
├── tsconfig.json         # TypeScript 配置
└── src/
    ├── accounts.ts       # 账户解析
    ├── bot.ts            # 消息处理
    ├── channel.ts        # Channel 插件定义
    ├── openclaw.d.ts     # 类型声明
    ├── monitor.ts        # WebSocket 连接监控
    ├── outbound.ts       # 出站适配器
    ├── probe.ts          # 连接探测
    ├── reply-dispatcher.ts # 回复分发器
    ├── runtime.ts        # 运行时管理
    ├── send.ts           # 发送消息
    └── types.ts          # 类型定义

相关项目

License

MIT