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

@rowger_go/chatu

v2.0.0

Published

OpenClaw Channel SDK - Build custom channel plugins

Downloads

454

Readme

OpenClaw Chatu 频道插件

CI npm version npm downloads License: MIT Node.js

English | 中文

官方 OpenClaw 频道插件,通过 HTTP/WebSocket 连接任意网站。

什么是 Chatu 频道?

Chatu 是一个灵活的频道插件,让 OpenClaw 能与任意基于 HTTP/WebSocket 的消息服务通信。它提供了一个通用接口,将 OpenClaw 接入自定义 Web 应用。

快速开始

1. 安装

# 从 npm 安装(推荐)
openclaw plugins install @rowger_go/chatu

# 或从源码安装(用于开发)
git clone https://github.com/chatu-ai/webhub.git
cd webhub
npm install
npm run build
openclaw plugins install -l .

2. 配置

# 启用并配置频道
openclaw config set channels.chatu.enabled true
openclaw config set channels.chatu.apiUrl "https://your-api.example.com"
openclaw config set channels.chatu.channelId "<channelId>"
openclaw config set channels.chatu.accessToken "your-access-token"

# 重启网关以应用更改
openclaw gateway restart

3. 验证

# 检查插件状态
openclaw plugins list | grep chatu

# 查看日志
openclaw logs

📖 详细配置说明请参见下方的配置指南

功能特性

  • 🔌 通用 HTTP/WebSocket 连接
  • 🔐 基于 Token 的安全认证
  • 📝 支持文本、图片和文件附件
  • 👥 私信和群聊支持
  • 🔄 消息编辑和撤回
  • 💬 回复线程

配置选项

基础配置

| 选项 | 类型 | 必填 | 默认值 | 说明 | |------|------|------|--------|------| | enabled | boolean | 否 | true | 启用/禁用频道 | | apiUrl | string | | — | WebHub 服务基础 URL | | channelId | string | | — | WebHub 频道 ID(通常为 UUID) | | secret | string | 二选一 | — | 频道密钥(wh_secret_xxx),用于注册 | | accessToken | string | 二选一 | — | 访问凭证(wh_xxxxxxx) | | timeout | number | 否 | 30000 | 请求超时时间(毫秒) |

配置示例

单账户:

{
  "channels": {
    "chatu": {
      "enabled": true,
      "apiUrl": "https://api.example.com",
      "channelId": "<channelId>",
      "accessToken": "your-token",
      "timeout": 30000
    }
  }
}

多账户:

{
  "channels": {
    "chatu": {
      "accounts": {
        "work": {
          "accountId": "work",
          "apiUrl": "https://work-api.example.com",
          "channelId": "<channelId>",
          "accessToken": "work-token"
        },
        "personal": {
          "accountId": "personal",
          "apiUrl": "https://personal-api.example.com",
          "channelId": "<channelId>",
          "accessToken": "personal-token"
        }
      }
    }
  }
}

💡 分步配置说明请参见配置指南

配置指南

第一步:验证插件状态

安装后,验证插件已加载:

# 检查插件状态
openclaw plugins list | grep chatu

预期输出:

│ Chatu   │ chatu  │ loaded  │ ~/path/to/webhub/dist/index.js  │ 0.1.0 │

第二步:配置频道

方式 A:使用 CLI 命令(推荐)

# 启用频道
openclaw config set channels.chatu.enabled true

# 设置 API URL
openclaw config set channels.chatu.apiUrl "https://your-api.example.com"

# 设置频道 ID(从 WebHub 管理界面获取)
openclaw config set channels.chatu.channelId "<channelId>"

# 设置访问凭证
openclaw config set channels.chatu.accessToken "your-access-token"

# 设置超时时间(可选,默认 30000ms)
openclaw config set channels.chatu.timeout 30000

方式 B:直接编辑配置文件

编辑 ~/.openclaw/openclaw.json

{
  "channels": {
    "chatu": {
      "enabled": true,
      "apiUrl": "https://your-api.example.com",
      "channelId": "<channelId>",
      "accessToken": "your-access-token",
      "timeout": 30000
    }
  }
}

方式 C:多账户配置

管理多个账户:

# 配置工作账户
openclaw config set channels.chatu.accounts.work.accountId "work"
openclaw config set channels.chatu.accounts.work.apiUrl "https://work-api.example.com"
openclaw config set channels.chatu.accounts.work.accessToken "work-token"

# 配置个人账户
openclaw config set channels.chatu.accounts.personal.accountId "personal"
openclaw config set channels.chatu.accounts.personal.apiUrl "https://personal-api.example.com"
openclaw config set channels.chatu.accounts.personal.accessToken "personal-token"

第三步:重启网关

配置完成后,重启 OpenClaw 网关以加载更改:

# 重启网关
openclaw gateway restart

# 或手动停止后启动
openclaw gateway stop
openclaw gateway start

第四步:验证配置

# 检查频道配置
openclaw config get channels.chatu

# 查看网关日志
openclaw logs | tail -50

# 检查 OpenClaw 健康状态
openclaw health

开发模式

使用热重载进行插件开发:

# 1. 以开发模式安装
cd /path/to/webhub
openclaw plugins install -l .

# 2. 启动 TypeScript 监听模式(修改时自动编译)
npm run watch

# 3. 正常配置(参见第二步)

# 4. 代码更改后,重启网关
openclaw gateway restart

# 5. 查看调试日志
openclaw logs

故障排除

插件未加载?

  • 检查插件是否已安装:openclaw plugins list
  • 确认 dist/ 目录存在且包含编译后的文件
  • 安装后重启网关:openclaw gateway restart

配置未生效?

  • 验证配置:openclaw config get channels.chatu
  • 检查 ~/.openclaw/openclaw.json 中的语法错误
  • 查看网关日志中的错误:openclaw logs

连接问题?

  • 确认 apiUrl 可访问
  • 检查 accessToken 是否有效
  • 如需要可增加超时时间:openclaw config set channels.chatu.timeout 60000
  • 查看日志获取详细错误信息

文档

详细文档请参见:

发布到 npm

本项目使用 GitHub Actions 自动发布到 npm。详见发布工作流说明

设置 npm 发布所需的 Secret:

  1. 登录 npmjs.com 并生成一个 Automation 类型的 Access Token
  2. 在 GitHub 仓库设置中添加 Secret:Settings → Secrets and variables → Actions → New repository secret
  3. Secret 名称:NPM_TOKEN,值填入你的 npm Access Token

发布方式:

# 升级补丁版本并发布(如 0.1.0 → 0.1.1)
npm run release:patch

# 升级次要版本并发布(如 0.1.0 → 0.2.0)
npm run release:minor

# 升级主版本并发布(如 0.1.0 → 1.0.0)
npm run release:major

运行 release:* 脚本会自动更新 package.json 版本号、创建 git tag,并触发 GitHub Actions 发布到 npm。

许可证

MIT