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

openclaw-feishu-card-callback-business-handle

v0.1.0

Published

OpenClaw plugin that registers Feishu card callback payload business handlers

Readme

OpenClaw Feishu Card Callback Business Handle

这个插件为 openclaw-feishu-card-callback-bridge 注册 payload 级业务处理逻辑。当前内置 PipeChina closedispatch 两个 handler。

工作方式

business-handle 启动
  -> 注册 payload handlers: close, dispatch
bridge 收到 custom-button:close
  -> 按 payload=close 查询共享 registry
  -> 调用 business-handle 注册的 handler
  -> bridge 负责把 handler 返回结果写回飞书会话

business-handle 不注册飞书 namespace,也不直接发送 follow-up 消息。响应方式统一由 bridge 的 echoMode 控制。

安装

cd /Users/chenzeping/go/src/code.byted.org/epscp/fde-skills/common/plugins/openclaw-feishu-card-callback-business-handle
npm install --no-package-lock --silent
npm run build
openclaw plugins install "$(pwd)"

同时需要安装 bridge:

cd /Users/chenzeping/go/src/code.byted.org/epscp/fde-skills/common/plugins/openclaw-feishu-card-callback-bridge
npm run build
openclaw plugins install "$(pwd)"

配置

{
  "plugins": {
    "openclaw-feishu-card-callback-bridge": {
      "namespaces": ["custom-button"]
    },
    "openclaw-feishu-card-callback-business-handle": {
      "pipechinaApiBase": "http://118.196.94.41:32233/api/alarm"
    }
  }
}

pipechinaApiBase fallback 顺序:

  • 插件配置 pipechinaApiBase
  • 环境变量 PIPECHINA_API_BASE
  • 内置默认值 http://118.196.94.41:32233/api/alarm

内置 Handler

| Payload | 行为 | | --- | --- | | close | 调用 PipeChina /closeAlert,请求体包含 messageIdalarmId | | dispatch | 调用 PipeChina /dispatch,请求体包含 messageIdalarmIdowner |

字段提取规则:

  • alarmIdvalue.alarm_idvalue.alarmIdvalue.alarmIDvalue.id 中按顺序读取。
  • messageId 来自飞书回调里的 open_message_id
  • owner 优先使用 value.owner,否则使用点击者 operator.open_id

新增 Handler

index.ts 中注册新的 payload:

registerFeishuCardActionHandler('ack', async (ctx, extras, options) => {
  options.logger?.info?.(`ack payload received messageId=${ctx.messageId ?? ''}`);
  return {
    status: 'success',
    messageTemplate: '{senderMention} 已确认 {actionLabel}',
  };
});

卡片按钮保持 <namespace>:<payload> 格式:

{
  "tag": "button",
  "text": { "tag": "plain_text", "content": "确认" },
  "behaviors": [
    {
      "type": "callback",
      "value": {
        "action": "custom-button:ack",
        "alarm_id": "alarm-1"
      }
    }
  ]
}

构建和打包

本仓库根目录 .gitignore 会忽略插件下的 node_modules/dist/。交付前需要本地构建产物。

cd /Users/chenzeping/go/src/code.byted.org/epscp/fde-skills/common/plugins/openclaw-feishu-card-callback-business-handle
npm install --no-package-lock --silent
npm run build
npm run verify:business
npm pack --dry-run

交付前确认:

  • npm run build 通过。
  • npm run verify:business 通过。
  • dist/index.js 存在。
  • npm pack --dry-run 输出包含 dist/openclaw.plugin.jsonREADME.mdpackage.json
  • 不要提交 node_modules/dist/*.tgz