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

@the-next-ai/bot-gateway

v1.0.0

Published

A pluggable cross-IM bot gateway built with Fastify.

Downloads

210

Readme

Bot Gateway

English

Bot Gateway 是一个基于 Fastify 的可插拔跨 IM Bot 网关。它把不同 IM 平台的入站消息归一化为 GatewayEvent,让外部 Agent 通过 HTTP、WebSocket 或 stdio 消费事件,再把统一的 OutboundIntent 渲染回对应平台。

网关不内置业务 Agent。你的 Agent 运行在网关外部,负责产品逻辑、LLM 调用、工作流执行和事件确认。

架构

  • ChannelAdapter 负责平台差异、入站归一化和出站渲染。
  • Transport 负责 IM 平台侧连接方式:webhook、long polling、websocket 或 outgoing webhook。
  • AgentProtocol 负责外部 Agent 接入方式:HTTP、WebSocket 或 stdio。
  • Runtime 负责平台无关可靠性:去重、队列、会话映射、限流、重试、审计和用量计量。

快速开始

npm install
npm run dev

HTTP 服务默认监听 0.0.0.0:3000

不启动 HTTP 服务时使用 stdio 模式:

npm run dev:stdio

构建和验证:

npm test
npm run build

安装已发布包:

npm install @the-next-ai/bot-gateway
npx @the-next-ai/bot-gateway
npx -p @the-next-ai/bot-gateway bot-gateway-stdio

本地运行状态默认存储在 .bot-gateway-state/。可以通过环境变量覆盖:

BOT_GATEWAY_STATE_DIR=/secure/path/bot-gateway-state npm run dev

生产环境建议替换为数据库和加密凭证存储。

文档

支持的平台

Bot Gateway 已包含或预留 Weixin iLink、Telegram、Slack、Discord、LINE、飞书、钉钉、WeCom 和 iMessage 的 adapter。各平台能力取决于具体 adapter 实现,当前状态和示例见使用指南与 Agent 接入指南。

License

MIT. See LICENSE.