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

@yuzhf/oneainexus-openclaw-connector

v0.1.8

Published

OpenClaw channel plugin for oneainexus-openclaw-chat

Downloads

56

Readme

oneainexu-openclaw-connector

oneainexu-openclaw-connector 是一个 OpenClaw channel 插件,用于把 OpenClaw 和 oneainexus-openclaw-chat 通过 Oneainexus Chat SDK 连接起来。

功能

  • 提供 oneainexus channel
  • 支持 direct chat
  • 支持文本与媒体消息透传
  • 支持基于 session:<sessionId> 的目标路由
  • 支持多账号配置

安装

发布到 npm 后,在 OpenClaw 的运行环境中安装:

npm install @yuzhf/oneainexus-openclaw-connector

如果你使用的是本地包或私有源,也可以按实际包名安装。

插件入口

本插件在 package.json 中声明了 OpenClaw 扩展信息:

  • 扩展入口:./dist/index.js
  • setup 入口:./dist/setup-entry.js
  • channel id:oneainexus

通常只要在 OpenClaw 所在环境安装该包,OpenClaw 就可以识别这个 channel 插件。

配置方式

主配置使用 channels.oneainexus.accounts

最小必填项:

  • apiEndpoint
  • clientId
  • clientSecret

可选项:

  • name
  • enabled
  • wsPath
  • dmPolicy
  • allowFrom

最小配置示例

{
  "channels": {
    "oneainexus": {
      "accounts": {
        "default": {
          "enabled": true,
          "apiEndpoint": "https://your-chat-gateway.example.com",
          "clientId": "your-client-id",
          "clientSecret": "your-client-secret"
        }
      }
    }
  }
}

完整配置示例

{
  "channels": {
    "oneainexus": {
      "accounts": {
        "default": {
          "name": "prod",
          "enabled": true,
          "apiEndpoint": "https://your-chat-gateway.example.com",
          "wsPath": "/oneainexus-talk/api/_ws.ws",
          "clientId": "your-client-id",
          "clientSecret": "your-client-secret",
          "dmPolicy": "open",
          "allowFrom": []
        }
      }
    }
  }
}

多账号示例

{
  "channels": {
    "oneainexus": {
      "accounts": {
        "default": {
          "name": "prod",
          "enabled": true,
          "apiEndpoint": "https://chat-prod.example.com",
          "clientId": "prod-client-id",
          "clientSecret": "prod-client-secret"
        },
        "staging": {
          "name": "staging",
          "enabled": true,
          "apiEndpoint": "https://chat-staging.example.com",
          "clientId": "staging-client-id",
          "clientSecret": "staging-client-secret",
          "wsPath": "/oneainexus-talk/api/_ws.ws"
        }
      }
    }
  }
}

字段说明

apiEndpoint

Oneainexus Chat 网关的 HTTP 基地址。

wsPath

WebSocket 路径,可选。默认值是:

/oneainexus-talk/api/_ws.ws

clientId

SDK 使用的客户端标识。

clientSecret

SDK 使用的客户端密钥。

enabled

账号是否启用。未配置时默认按启用处理。

dmPolicy

私聊策略,默认值是 open

allowFrom

来源白名单列表。

目标格式

当前 channel 的显式目标格式为:

session:<sessionId>

例如:

session:abc123

如果只传 abc123,插件也会自动规范化为 session:abc123

运行流程

  1. OpenClaw 启动并加载插件
  2. 插件读取 channels.oneainexus.accounts
  3. 连接到 Oneainexus Chat 网关
  4. 接收来自 SDK 的 chat 消息
  5. 将消息路由到 OpenClaw 对话会话
  6. 把 OpenClaw 的回复再发回对应的 sessionId

发布后接入建议

  1. 先确认 oneainexus-openclaw-chat 服务地址可访问
  2. 准备一组有效的 clientIdclientSecret
  3. 在 OpenClaw 运行环境中安装本插件
  4. 在 OpenClaw 主配置中增加 channels.oneainexus.accounts.default
  5. 重启 OpenClaw 并检查该 channel 账号是否连接成功

常见问题

1. 账号没有连上

优先检查:

  • apiEndpoint 是否可访问
  • wsPath 是否正确
  • clientId / clientSecret 是否有效

2. 找不到目标会话

优先检查发送目标是否是:

session:<sessionId>

3. 多账号时走错账号

如果未显式指定账号,默认优先使用 default,没有 default 时使用第一个账号。

开发

npm install
npm run build

类型检查:

npm run typecheck