首页openclaw插件 › Slack Block Kit Bridge — 插件工具

代码插件 扫描中

Slack Block Kit Bridge — 插件工具

v0.1.0

The plugin's code, documentation, and runtime behaviour match its stated purpose (sending Slack Block Kit cards and handling interactions); it requires a Slack bot token (via config) and writes a local card store, which are expected for this functionality.

0· 0·0 当前
下载插件包 项目主页
最后更新
2026/4/6
安全扫描
VirusTotal
Pending
查看报告
OpenClaw
扫描中
high confidence
The plugin's code, documentation, and runtime behaviour match its stated purpose (sending Slack Block Kit cards and handling interactions); it requires a Slack bot token (via config) and writes a local card store, which are expected for this functionality.
安全有层次,运行前请审查代码。

版本

latestv0.1.02026/4/6
● Pending

安装命令 点击复制

官方npx clawhub@latest install openclaw-slack-blockkit-bridge
镜像加速npx clawhub@latest install openclaw-slack-blockkit-bridge --registry https://cn.clawhub-mirror.com

插件文档

openclaw-slack-blockkit-bridge

OpenClaw plugin for sending native Slack Block Kit cards and handling interactive button clicks.

Send interactive cards to Slack and handle button clicks — all driven by your OpenClaw agent.

Built-in templates (approval, task-progress, pick-one) work out of the box:

<img src="assets/approval-card.png" width="400" alt="Approval card" />

Custom Block Kit layouts let you build rich cards with images, structured content, and multiple actions:

<img src="assets/custom-card.png" width="480" alt="Custom card with images" />

Installation

openclaw plugins install openclaw-slack-blockkit-bridge

Requirements

    • OpenClaw v2026.4.2+
    • A Slack bot token with chat:write and chat:write.public scopes
Plugin versionOpenClaw version
0.1.xv2026.4.2+

Configuration

Add to your ~/.openclaw/openclaw.json under plugins.entries:

"slack-blockkit-bridge": {
  "enabled": true,
  "config": {
    "backend": "direct-slack-api",
    "deliveryMode": "live",
    "tokenFile": "/path/to/slack-bot.token",
    "allowChannels": ["YOUR_CHANNEL_ID"]
  }
}
FieldTypeDefaultDescription
backend"direct-slack-api""direct-slack-api"Delivery backend
deliveryMode"mock" \"live""mock"Set to "live" to send real messages
botTokenstringSlack bot token (prefer tokenFile)
tokenFilestringPath to a file containing the bot token
allowChannelsstring[][]Slack channel IDs the plugin is allowed to post to
requestTimeoutMsnumber10000HTTP request timeout
debugbooleanfalseEnable verbose logging

Agent exec permissions

When an agent calls gateway methods via the CLI, add openclaw to its exec allowlist in ~/.openclaw/exec-approvals.json:

{
  "defaults": {},
  "agents": {
    "main": {
      "security": "allowlist",
      "ask": "off",
      "allowlist": [
        { "host": "gateway", "bin": "/usr/local/bin/openclaw" }
      ]
    }
  }
}

Replace /usr/local/bin/openclaw with the path from which openclaw. Changes take effect immediately — no gateway restart needed.

Note: If openclaw doctor --fix rewrites the defaults block, re-check that defaults stays empty ({}). A non-empty defaults.security overrides per-agent settings in OpenClaw 4.2.

Quick Start

Send an approval card (replace YOUR_CHANNEL_ID with a Slack channel ID):

openclaw gateway call slack-blockkit-bridge.send-template --json --params '{
  "kind": "approval",
  "channel": "YOUR_CHANNEL_ID",
  "title": "Deploy to production?"
}'

Post into an existing thread:

openclaw gateway call slack-blockkit-bridge.send-template --json --params '{
  "kind": "approval",
  "channel": "YOUR_CHANNEL_ID",
  "threadTs": "1234567890.123456",
  "title": "Deploy to production?"
}'

From an agent, use the native gateway_call(method, params) tool if available, or call via exec:

openclaw gateway call slack-blockkit-bridge.health --json

Gateway methods

MethodDescription
slack-blockkit-bridge.healthReturns plugin status, active path, available templates, and config summary
slack-blockkit-bridge.send-templateSend a card from a built-in template
slack-blockkit-bridge.sendSend a raw Block Kit card
slack-blockkit-bridge.updateUpdate an existing card by cardId

Templates

send-template params

ParamRequiredDescription
kindyes"approval", "task-progress", or "pick-one"
channelyesSlack channel ID
titleyesMain question or heading
bodynoSupporting text below the title
threadTsnoPost as a reply in this thread
optionspick-one: yesButton options: { value, label, style? }. Min 2 for pick-one
postActionRenderModeno"replace" (default) or "preserve"
sessionKeynoIdentifier for correlating with a session or task
metadatanoArbitrary key-value data stored with the card
dryRunnotrue to preview the payload without sending

Template kinds

approval — Approve / Reject buttons

openclaw gateway call slack-blockkit-bridge.send-template --json --params '{
  "kind": "approval",
  "channel": "YOUR_CHANNEL_ID",
  "title": "Merge this PR?",
  "body": "Branch: feature/new-ui"
}'

task-progress — Start / Done buttons

openclaw gateway call slack-blockkit-bridge.send-template --json --params '{
  "kind": "task-progress",
  "channel": "YOUR_CHANNEL_ID",
  "title": "Start the data export now?"
}'

pick-one — Custom option buttons (min 2)

openclaw gateway call slack-blockkit-bridge.send-template --json --params '{
  "kind": "pick-one",
  "channel": "YOUR_CHANNEL_ID",
  "title": "Which environment?",
  "options": [
    { "value": "staging", "label": "Staging", "style": "primary" },
    { "value": "prod", "label": "Production", "style": "danger" }
  ]
}'

Post-action render modes

    • replace (default): card is replaced with ✅ Handled: {label} after a button click
    • preserve: original card stays visible, the chosen button is marked, a result block is appended

Custom cards (send)

For full Block Kit control, use send directly. All interactive button action_id values must start with wbk::

openclaw gateway call slack-blockkit-bridge.send --json --params '{
  "channel": "YOUR_CHANNEL_ID",
  "text": "Review request",
  "blocks": [
    {
      "type": "section",
      "text": { "type": "mrkdwn", "text": "Review request\nApprove or reject?" }
    },
    {
      "type": "actions",
      "elements": [
        { "type": "button", "action_id": "wbk:review:approve", "text": { "type": "plain_text", "text": "Approve" }, "style": "primary" },
        { "type": "button", "action_id": "wbk:review:reject", "text": { "type": "plain_text", "text": "Reject" }, "style": "danger" }
      ]
    }
  ],
  "actions": [
    { "actionId": "wbk:review:approve", "actionName": "approve" },
    { "actionId": "wbk:review:reject", "actionName": "reject" }
  ]
}'

Interaction resolution

The runtime exposes a resolveInteraction?(...) seam that lets callers customize post-click behavior without modifying the plugin:

    • override reply text for a specific action
    • suppress or replace the default handled-card update
    • supply custom blocks, metadata, or state patches
    • choose post-action render mode per card

App-specific logic (quiz grading, routing, etc.) belongs in the caller's resolver, not in this plugin.

Local development

npm run build   # compile src/*/.ts → dist/
npm test        # build test fixtures + run tests
npm pack        # build and pack for distribution

Troubleshooting

exec denied: host=gateway security=deny

Cause (OpenClaw 4.2): openclaw doctor --fix writes "security": "deny" into the defaults block of ~/.openclaw/exec-approvals.json. In 4.2, defaults.security takes priority over per-agent settings, blocking all exec calls.

Fix:

    • Clear the defaults block:
   "defaults": {}
    • Set each agent's security explicitly to prevent them from inheriting the permissive default:
   "agents": {
     "main": { "security": "allowlist", "ask": "off", "allowlist": [...] },
     "other-agent": { "security": "deny" }
   }
    • Confirm openclaw full path is in the allowlist (which openclaw).

No gateway restart needed — the file is hot-reloaded.

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务