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

@easbot/gateway

v0.3.23

Published

EASBot Gateway - AI Agent Server and Multi-channel Integration Platform - 支持 WebSocket、HTTP、Discord、Telegram、Slack 等多渠道集成

Readme

English | 中文

@easbot/gateway

EASBot Gateway - AI Agent 服务器与多渠道集成平台

特性

  • 多渠道集成:支持 WebSocket、HTTP、Discord、Telegram、Slack、飞书、公众号 / 企业微信、iLink 个人微信等
  • Agent 核心:基于 AI SDK 的 Agent 运行时
  • 会话管理:支持多会话、多 Agent 并发
  • 消息路由:智能消息路由和格式转换
  • 事件系统:完善的事件驱动架构
  • 插件系统:可扩展的插件机制

安装

pnpm add @easbot/gateway

快速开始

启动服务器

import { createGateway } from '@easbot/gateway';

const gateway = createGateway({
  server: {
    port: 4096,
    websocket: true,
  },
  agents: [
    {
      id: 'main',
      model: 'anthropic/claude-3-5-sonnet',
    },
  ],
});

await gateway.start();

WebSocket 客户端

import { GatewayClient } from '@easbot/gateway';

const client = new GatewayClient('ws://localhost:4096');
await client.connect();

await client.sendMessage({
  agent: 'main',
  message: '你好!',
});

client.on('message', (msg) => {
  console.log('收到:', msg.content);
});

Telegram Bot

const gateway = createGateway({
  telegram: {
    botToken: process.env.TELEGRAM_BOT_TOKEN,
  },
  agents: [{ id: 'main' }],
});

await gateway.start();

渠道配置

WebSocket

{
  server: {
    port: 4096,
    path: '/ws',
  }
}

HTTP

{
  server: {
    http: {
      port: 4097,
      path: '/api',
    }
  }
}

Discord

{
  discord: {
    botToken: 'YOUR_BOT_TOKEN',
    guildId: 'YOUR_GUILD_ID',
  }
}

Telegram

{
  telegram: {
    botToken: 'YOUR_BOT_TOKEN',
  }
}

Slack

{
  slack: {
    botToken: 'xoxb-...',
    signingSecret: 'YOUR_SIGNING_SECRET',
  }
}

Weixin (iLink 个人微信)

⚠️ 与 wechat(公众号 / 企业微信)不同 —— Weixin 走 iLink 个人号协议,一次只能托管一个微信用户。详见 docs/channel/weixin.md

{
  weixin: {
    enabled: true,
    // token / userId 不在配置里,通过 `easbot weixin login` 扫码写入 account.json
  }
}
# 1. 扫码绑定个人微信
easbot weixin login

# 2. 启动 Gateway(自动接管 weixin channel)
easbot gateway start

# 3. 陌生用户给 bot 发消息后,管理员授权配对码
easbot weixin access pair 123456

login / access pair 都是独立 CLI 进程;Gateway 通过 fs.watch 自动 reload,无需重启。

API 文档

Gateway

主网关类,管理所有渠道和 Agent。

const gateway = createGateway(config);
await gateway.start();
await gateway.stop();

GatewayClient

WebSocket 客户端,用于连接 Gateway。

const client = new GatewayClient(url);
await client.connect();
await client.sendMessage(message);
client.disconnect();

Agent

Agent 实例配置。

interface AgentConfig {
  id: string;
  model: string;
  systemPrompt?: string;
  tools?: Tool[];
}

开发

# 安装依赖
pnpm install

# 构建
pnpm build

# 测试
pnpm test

# 类型检查
pnpm type-check

许可证

MIT