官方包 · 自动化与基础设施

Dify 插件:实时事件、推送通知与审批

Dify 的工具插件,提供四个可用于工作流和 Agent 的工具:发布事件到频道、发送推送通知、请人批准某个步骤,以及读取对方的回答。

GitHub 版本许可证

最快的方式:装好 Hibira 插件,粘贴一段提示词

在你的 AI 编程助手装好插件,再粘贴提示词。助手会帮你登录、需要时创建免费应用、写好代码并发送测试事件。 GitHub ↗

  1. 安装插件

    claude plugin marketplace add hibira-io/agent-plugin
    claude plugin install hibira@hibira
  2. 粘贴这段提示词

    Add Hibira Dify (hibira-io/dify) to this project.
    Follow https://hibira.io/guides/dify, adapted to how this project is already set up.
    If I have no Hibira app yet, create a Free one that allows http://localhost so I can test right away.
    Keep the app key and secret in environment variables, add placeholders to .env.example, and never commit real values or send the secret to a browser.
    When you are done, send a test event, show me it arriving, and list the files you changed.

想自己动手? 下方的步骤如下:

  1. 安装
  2. 配置
  3. 请求审批

其他 AI 工具与插件内容 →

  • Request Approval 会给对方发送一次性链接,用来批准或选择一个选项,并可在节点内等待回答,最长 9 分钟。Get Approval 可以稍后读取回答。
  • 每个工具也能在 Dify Agent 中使用,由模型填入频道、消息或问题。
  • Send Push Notification 按 interest 或用户 ID 推送到 iOS、Android 和网页设备。
  • 请求使用 App secret 签名,secret 本身不会被发送。插件只与 Hibira API 通信,不存储任何数据。
审批链接在手机上打开的页面:“Refund order #1042 for $89?”,下方有 Approve、Reject 按钮和可选的留言框。
审批链接在手机上打开的页面:“Refund order #1042 for $89?”,下方有 Approve、Reject 按钮和可选的留言框。

登录后,示例代码会自动填入您的集群主机。 登录

  1. 安装

    Plugins → Install plugin → Marketplace → Hibira
      or: Install plugin → Local package file →
          hibira-0.1.0.difypkg from github.com/hibira-io/dify/releases
    Dify 的工具页面:Hibira 插件已安装并完成授权,包含 Publish Event、Send Push Notification、Request Approval 和 Get Approval 四个动作。
    Dify 的工具页面:Hibira 插件已安装并完成授权,包含 Publish Event、Send Push Notification、Request Approval 和 Get Approval 四个动作。
  2. 配置

    Tools → Hibira → API Key Authorization Configuration
      App ID:            YOUR_APP_ID
      Key:               YOUR_APP_KEY
      Secret:            YOUR_APP_SECRET
      Push Instance ID:  optional, for push notifications
      Push Secret Key:   optional
    Dify 中的 Hibira 授权配置:已填入 App ID、Key 和 Secret,以及可选的 Push Instance ID 和 Push Secret Key。
    Dify 中的 Hibira 授权配置:已填入 App ID、Key 和 Secret,以及可选的 Push Instance ID 和 Push Secret Key。
  3. 请求审批

    Start (order, amount)
    → Hibira → Publish Event
        Channels:  orders      Event:  refund-requested
    → Hibira → Request Approval
        Question:  Refund order {{order}} for {{amount}}?
        Options:   Refund, Decline
        Wait for Answer (Minutes):  5
    → IF text starts with Approved → Hibira → Send Push Notification
    退款工作流在 Dify 运行后:Publish Event、Request Approval、Approved?、Send Push Notification 和 End 全部为绿色,结果为 Approved: Refund。
    退款工作流在 Dify 运行后:Publish Event、Request Approval、Approved?、Send Push Notification 和 End 全部为绿色,结果为 Approved: Refund。

开始之前

  • 审批适用于在 Hibira 控制台中创建的应用。回答链接只能使用一次,并在你设定的时间后失效。
  • Wait for Answer 设为 0 时,Request Approval 会立即返回,回答链接在 url 中。把链接发给对方,再用 Get Approval 等待回答。
  • Send Push Notification 需要 App 的 Push 标签页中的 Push Instance ID 和 Push Secret Key。

请使用控制台中应用的 Key;Secret 只放在你的服务器上。频道、事件与授权端点的用法与 Pusher 完全相同。 免费创建账号 →