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

@beboping/bebop

v0.1.1

Published

Distributed AI agent gateway with remote node execution

Readme

Bebop

Bebop 是一个多通道 AI Agent 网关,基于 Claude Agent SDK 构建。

它把以下能力组合在一起:

  • 多通道消息接入(当前内置 Telegram)
  • Agent 路由与执行
  • 会话持久化
  • 网关控制面(WebSocket RPC + 事件)
  • 设备配对与节点能力调用

当前架构

Telegram / CLI / Device / Node
            |
            v
      @bebop/transport  <->  @bebop/devices
            |
            v
        @bebop/gateway
      /      |       \
     v       v        v
@bebop/channels  @bebop/routing  @bebop/agents
                                |
                                v
                         @bebop/sessions
                                |
                                v
                        @bebop/node-registry

运行入口 src/main.ts 会:

  1. 启动 gateway
  2. 自动启动一个本地 @bebop/node-host 连接到 gateway

Monorepo 包

| 包 | 状态 | 说明 | |---|---|---| | @bebop/gateway | 已实现 | 网关装配与生命周期、RPC handlers、事件广播 | | @bebop/channels | 已实现 | 渠道抽象与 Telegram 驱动、入站/出站管线 | | @bebop/routing | 已实现 | 8 级优先匹配路由 | | @bebop/agents | 已实现 | Claude Agent SDK 封装、配置解析、流式事件 | | @bebop/sessions | 已实现 | Session key、JSONL 持久化、exec 队列、锁 | | @bebop/transport | 已实现 | WebSocket 帧协议 + JSONL socket IPC | | @bebop/devices | 已实现 | 设备身份、配对、token 生命周期、RPC handlers | | @bebop/node-registry | 已实现 | 节点注册、invoke、MCP 工具生成、策略校验 | | @bebop/node-host | 已实现 | 节点侧运行时、system.* 执行与审批 | | @bebop/media | 已实现 | 媒体下载/存储/清理/转写 | | @bebop/logger | 已实现 | 结构化日志 | | @bebop/cli | 已实现 | TUI 与管理命令 |

快速开始

前置条件

  • Node.js >=22
  • pnpm >=10
  • ANTHROPIC_API_KEY
  • (可选)TELEGRAM_BOT_TOKEN
  • (推荐)BEBOP_GATEWAY_TOKEN

安装

pnpm install

启动

BEBOP_GATEWAY_TOKEN=your-token \
TELEGRAM_BOT_TOKEN=your-telegram-bot-token \
pnpm start

说明:

  • 如果未设置 TELEGRAM_BOT_TOKEN,gateway 仍会启动,但不会创建 Telegram channel。
  • 默认端口来自 BEBOP_PORT(未设置时使用 transport 默认端口)。

CLI 示例

# 查看网关状态
pnpm cli status --token your-token

# 查看健康状态
pnpm cli health --token your-token

# 启动 TUI
pnpm cli tui --token your-token

配置模型(BebopConfig

@bebop/gateway 当前配置结构:

interface BebopConfig {
  port?: number;
  bindMode?: BindMode;
  dataDir?: string;
  auth?: GatewayAuthConfig;

  agents: AgentConfig[];
  agentDefaults?: AgentDefaultsConfig;

  bindings: RoutingBinding[];
  defaultAgentId: string;
  dmScope?: DmScope;
  identityLinks?: Record<string, string[]>;

  channels: {
    telegram?: TelegramChannelConfig[];
  };

  execPolicy?: ExecQueueConfig;
  nodePolicy?: NodeCommandPolicyConfig;
  deviceBaseDir?: string;
}

最小示例:

import type { BebopConfig } from "@bebop/gateway";

const config: BebopConfig = {
  port: 18789,
  auth: { token: process.env.BEBOP_GATEWAY_TOKEN },
  channels: {
    telegram: [{ id: "tg-main", token: process.env.TELEGRAM_BOT_TOKEN! }],
  },
  agents: [
    {
      id: "jarvis",
      model: "sonnet",
      systemPrompt: "You are a helpful assistant.",
    },
  ],
  bindings: [
    {
      agentId: "jarvis",
      match: { channel: "tg-main", accountId: "*" },
    },
  ],
  defaultAgentId: "jarvis",
  dmScope: "main",
};

数据目录

未显式配置时:

  • gateway data dir: ~/.bebop/data
  • sessions: ~/.bebop/data/sessions
  • device pairing/token: ~/.bebop/devices
  • node-host config: ~/.bebop/node.json
  • CLI config: ~/.bebop/cli.json

常用开发命令

pnpm typecheck
pnpm lint
pnpm lint:fix
pnpm test
pnpm test:coverage

进一步阅读

  • packages/gateway/README.md
  • packages/channels/README.md
  • packages/agents/README.md
  • packages/sessions/README.md
  • packages/transport/README.md
  • packages/node-registry/README.md
  • packages/node-host/README.md
  • packages/devices/README.md
  • packages/cli/README.md