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

beeworks

v1.0.42

Published

OpenClaw Beeworks channel plugin

Readme

Beeworks OpenClaw Plugin

代码路径说明

  • src/accounts.ts 负责多机器人配置解析,支持 accounts.<accountId>,并统一账户解析入口。
  • src/channel.ts OpenClaw 渠道入口。这里接入账户列表、默认账户、主动发送和 session route。
  • src/gateway-runtime.ts 网关生命周期入口。负责按账户启动和停止 webhook monitor。
  • src/monitor.ts 负责 webhook target 注册、入站 route/session 构建和 reply dispatch。
  • src/monitor-webhook.ts Beeworks webhook HTTP 入口。负责按 webhookPath 命中机器人、校验签名、执行 DM/群准入。
  • src/message.ts 解析 Beeworks 回调消息,当前以 client_id 作为企业用户主标识。
  • src/targets.ts 统一 direct/group target 格式与 label。
  • src/conversation-route.ts 统一基于 conversation_id 的 sessionKey 和出站 session route。
  • src/api.ts 负责 Beeworks HTTP API 调用和出站发送。
  • src/token.ts 按账户凭证获取和缓存 access token。
  • src/config-schema.ts 渠道配置 schema,已支持多机器人和企业准入策略。
  • index.ts 插件注册入口,向 OpenClaw 注册渠道。

当前接入规则

  • 企业用户主标识:client_id
  • DM 准入:dmPolicy + allowFrom
  • 群准入:groupPolicy + groupAllowFrom
  • 多机器人命中:
    1. 每个机器人配置独立 webhookPath
    2. webhook 请求按路径命中对应机器人

OpenClaw 使用说明

1. 单机器人配置

{
  channels: {
    beeworks: {
      enabled: true,
      defaultAccount: "main",
      accounts: {
        main: {
          name: "Main Bot",
          apiBaseUrl: "https://demo-api.beeworks.cn",
          domainId: "domain_a",
          appKey: "app_key_a",
          appSecret: "app_secret_a",
          token: "verify_token_a",
          decryptKey: "encoding_aes_key_a",
          webhookPath: "/beeworks/main/events",
          dmPolicy: "allowlist",
          allowFrom: ["client_id_1", "client_id_2"],
          groupPolicy: "allowlist",
          groupAllowFrom: ["conversation_group_1", "conversation_group_2"]
        }
      }
    }
  }
}

2. 同一个域下多个机器人配置

{
  channels: {
    beeworks: {
      enabled: true,
      defaultAccount: "bot_a",
      accounts: {
        bot_a: {
          name: "Bot A",
          apiBaseUrl: "https://demo-api.beeworks.cn",
          domainId: "same_domain",
          appKey: "app_key_a",
          appSecret: "app_secret_a",
          token: "verify_token_a",
          decryptKey: "encoding_aes_key_a",
          webhookPath: "/beeworks/bot-a/events",
          dmPolicy: "allowlist",
          allowFrom: ["client_id_a_1", "client_id_a_2"],
          groupPolicy: "allowlist",
          groupAllowFrom: ["group_conv_a_1"]
        },
        bot_b: {
          name: "Bot B",
          apiBaseUrl: "https://demo-api.beeworks.cn",
          domainId: "same_domain",
          appKey: "app_key_b",
          appSecret: "app_secret_b",
          token: "verify_token_b",
          decryptKey: "encoding_aes_key_b",
          webhookPath: "/beeworks/bot-b/events",
          dmPolicy: "open",
          groupPolicy: "open"
        }
      }
    }
  }
}

3. Beeworks 回调地址

同一个 OpenClaw 实例接多个 Beeworks 机器人时,每个机器人必须配置不同的 webhookPath

示例:

  • bot_a: /beeworks/bot-a/events
  • bot_b: /beeworks/bot-b/events

插件按路径找到对应机器人,再使用该机器人的 tokendecryptKey 验签解密。

如果多个机器人共用同一个 webhookPath,插件无法稳定区分该使用哪套凭证。

3.1 Setup / Control UI

当前插件已经提供外部 channel plugin 所需的 setupsetupWizard surface。

当前测试阶段建议使用:

  • channels.beeworks.accounts.<accountId>
  • channels.beeworks.defaultAccount

在 OpenClaw 的 setup / Control UI 里,Beeworks 至少需要配置这些字段:

  • API base URL
  • Domain ID
  • App Key
  • App Secret
  • Token
  • EncodingAESKey

可选字段:

  • Bot name
  • Webhook path

如果一个 OpenClaw 实例配置多个 Beeworks bot,而某个 bot 没有显式设置 webhookPath,运行时会回退到 /beeworks/events。因此多 bot 场景下建议为每个 bot 都显式填写唯一 webhookPath

4. OpenClaw 里的发送目标

  • 私聊:direct:<conversationId>:<client_id>
  • 群聊:group:<conversationId>

例如:

  • direct:conv_123:client_abc
  • group:conv_group_456

5. 主动发送时的路由规则

Beeworks 多机器人场景下,出站路由由两部分共同决定:

  • accountId / --account 表示用哪个机器人发
  • to 表示发给谁

也就是:

  • accountId=bot_a + to=direct:conv_123:client_abc
  • accountId=bot_b + to=direct:conv_123:client_abc

是两条不同的路由,分别代表用不同机器人给同一个用户发消息。

如果是在入站会话里回复,OpenClaw 应继承当前上下文里的 accountId,这样回复会自动走当前机器人。

如果是主动发送,必须显式指定机器人;未提供 accountId / --account 时,插件会直接报错。

主动发送示例:

openclaw message send \
  --channel beeworks \
  --account bot_a \
  --to direct:conv_123:client_abc \
  --text "你好"

群消息示例:

openclaw message send \
  --channel beeworks \
  --account bot_b \
  --to group:conv_group_456 \
  --text "通知内容"

6. 会话键语义

  • 单聊上下文按 conversation_id 隔离;client_id 仅用于出站投递目标,不参与 sessionKey。
  • 群聊上下文同样按 conversation_id 隔离,不再额外拼接 owner_id
  • 入站路由匹配使用 channel + accountId + peer(kind + conversation_id),而不是 client_id

7. 当前未实现

  • pairing 审批流
  • 多用户候选 ID 自动兼容
  • 企业目录查询