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

@ynhcj/xiaoyi

v2.5.4

Published

XiaoYi channel plugin for OpenClaw

Readme

@ynhcj/xiaoyichannel

XiaoYi channel plugin for OpenClaw with A2A protocol support.

Features

  • WebSocket-based connection to XiaoYi servers
  • AK/SK authentication mechanism
  • A2A (Agent-to-Agent) message protocol support
  • Automatic reconnection with exponential backoff
  • Heartbeat mechanism for connection health monitoring
  • Full integration with OpenClaw's message routing and session management

Installation

Install the plugin in your OpenClaw project:

openclaw plugins install @ynhcj/[email protected]

Configuration

After installation, add the XiaoYi channel configuration to your openclaw.json (or .openclawd.json):

{
  "channels": {
    "xiaoyi": {
      "enabled": true,
      "accounts": {
        "default": {
          "enabled": true,
          "wsUrl": "wss://hag.com/ws/link",
          "ak": "your-access-key",
          "sk": "your-secret-key",
          "agentId": "your-agent-id"
        }
      }
    }
  },
  "agents": {
    "bindings": [
      {
        "agentId": "main",
        "match": {
          "channel": "xiaoyi",
          "accountId": "default"
        }
      }
    ]
  }
}

Configuration Parameters

  • wsUrl: WebSocket server URL (e.g., wss://hag.com/ws/link)
  • ak: Access Key for authentication
  • sk: Secret Key for authentication
  • agentId: Your agent identifier

Multiple Accounts

You can configure multiple XiaoYi accounts:

{
  "channels": {
    "xiaoyi": {
      "enabled": true,
      "accounts": {
        "account1": {
          "enabled": true,
          "wsUrl": "wss://hag.com/ws/link",
          "ak": "ak1",
          "sk": "sk1",
          "agentId": "agent1"
        },
        "account2": {
          "enabled": true,
          "wsUrl": "wss://hag.com/ws/link",
          "ak": "ak2",
          "sk": "sk2",
          "agentId": "agent2"
        }
      }
    }
  }
}

A2A Protocol

This plugin implements the A2A (Agent-to-Agent) message protocol as specified in the Huawei Message Stream documentation.

Message Structure

Incoming Request Message:

{
  "sessionId": "session-123",
  "messageId": "msg-456",
  "timestamp": 1234567890,
  "sender": {
    "id": "user-id",
    "name": "User Name",
    "type": "user"
  },
  "content": {
    "type": "text",
    "text": "Hello, agent!"
  }
}

Outgoing Response Message:

{
  "sessionId": "session-123",
  "messageId": "msg-789",
  "timestamp": 1234567891,
  "agentId": "your-agent-id",
  "sender": {
    "id": "your-agent-id",
    "name": "OpenClaw Agent",
    "type": "agent"
  },
  "content": {
    "type": "text",
    "text": "Hello! How can I help you?"
  },
  "status": "success"
}

Authentication

The plugin uses AK/SK authentication as specified in the Huawei Push Message documentation.

The authentication signature is generated using HMAC-SHA256:

signature = HMAC-SHA256(SK, "ak={AK}&timestamp={TIMESTAMP}")

Connection Management

The plugin automatically manages WebSocket connections with the following features:

  • Automatic Reconnection: Reconnects automatically on connection loss with exponential backoff
  • Heartbeat Monitoring: Sends ping messages every 30 seconds to keep the connection alive
  • Connection Health: Monitors connection status and reports health via OpenClaw's status system
  • Max Retry Limit: Stops reconnection attempts after 10 failed attempts

Session Management

The plugin integrates with OpenClaw's session management system:

  • Sessions are scoped by sessionId from incoming A2A messages
  • Each conversation maintains its own session context
  • Session keys are automatically generated based on OpenClaw's configuration

Usage

Once configured, the plugin will:

  1. Automatically connect to the XiaoYi WebSocket server on startup
  2. Authenticate using the provided AK/SK credentials
  3. Receive incoming messages via WebSocket
  4. Route messages to the appropriate OpenClaw agent
  5. Send agent responses back through the WebSocket connection

Troubleshooting

Connection Issues

Check the OpenClaw logs for connection status:

openclaw logs

Authentication Failures

Verify your AK/SK credentials are correct and have the necessary permissions.

Message Delivery

Ensure your agentId is correctly configured and matches your XiaoYi account settings.

Development

To build the plugin from source:

npm install
npm run build

License

MIT

Support

For issues and questions, please visit the GitHub repository.