{
  "id": "infoflow-openclaw-plugin",
  "channels": [
    "infoflow"
  ],
  "contracts": {
    "tools": [
      "infoflow_send",
      "infoflow_recall",
      "infoflow_cron",
      "infoflow_bos_upload",
      "infoflow_bos_get_url",
      "infoflow_leave_group",
      "infoflow_get_message",
      "infoflow_get_group_history",
      "infoflow_switch_mode",
      "infoflow_group",
      "infoflow_personal_auth",
      "infoflow_get_contacts",
      "infoflow_msg_summary",
      "infoflow_import_summary",
      "infoflow_calendar",
      "infoflow_meeting"
    ],
    "bundled-channel-entry": true
  },
  "permissions": {
    "childProcess": {
      "enabled": true,
      "commands": [
        "openclaw"
      ],
      "justification": "需要调用 openclaw 命令来创建定时任务（infoflow_cron 工具）"
    }
  },
  "channelConfigs": {
    "infoflow": {
      "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": true,
            "description": "是否启用当前 Infoflow 账号"
          },
          "name": {
            "type": "string",
            "description": "账号展示名称，仅用于控制面板区分账号"
          },
          "apiHost": {
            "type": "string",
            "default": "https://apiin.im.baidu.com",
            "description": "如流发送 API 域名"
          },
          "connectionMode": {
            "type": "string",
            "enum": [
              "webhook",
              "websocket"
            ],
            "default": "webhook",
            "description": "消息接收模式，默认 webhook"
          },
          "wsGateway": {
            "type": "string",
            "default": "infoflow-open-gateway.weiyun.baidu.com",
            "description": "WebSocket 网关域名，仅 websocket 模式使用"
          },
          "wsConnectDomain": {
            "type": "string",
            "description": "WebSocket 连接域名，用于 Phase 2 实际 WS 握手（不填则使用服务端返回的地址，内网环境可配置此项）"
          },
          "robot2cApiHost": {
            "type": "string",
            "default": "https://open-ruliu.baidu-int.com/open-plat/api/v1",
            "description": "如流个人 API（Robot2C）网关地址，用于用户身份 API 能力（infoflow_personal_auth、infoflow_get_contacts 等）"
          },
          "robotId": {
            "type": "string",
            "description": "无需手动填写，自动发现。如流机器人实际 ID（首次被 @ 时从消息体中提取，用于忽略自身消息）"
          },
          "dashboardUrl": {
            "type": "string",
            "description": "Dashboard 访问地址，用于任务深链接"
          },
          "checkToken": {
            "type": "string",
            "description": "Webhook 校验 token，仅 webhook 模式必填"
          },
          "encodingAESKey": {
            "type": "string",
            "description": "Webhook 加密密钥，仅 webhook 模式必填"
          },
          "appKey": {
            "type": "string",
            "description": "如流应用 AppKey"
          },
          "appSecret": {
            "type": "string",
            "description": "如流应用 AppSecret"
          },
          "robotName": {
            "type": "string",
            "description": "群聊中用于识别 @机器人的显示名"
          },
          "appAgentId": {
            "type": "integer",
            "minimum": 1,
            "description": "如流应用 ID，私聊撤回依赖该字段"
          },
          "dmPolicy": {
            "type": "string",
            "enum": [
              "open",
              "pairing",
              "allowlist"
            ],
            "default": "open",
            "description": "单聊访问策略"
          },
          "allowFrom": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "单聊白名单，dmPolicy=allowlist 时生效"
          },
          "groupPolicy": {
            "type": "string",
            "enum": [
              "open",
              "allowlist",
              "disabled"
            ],
            "default": "open",
            "description": "群聊访问策略"
          },
          "groupAllowFrom": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "群聊白名单，groupPolicy=allowlist 时生效"
          },
          "requireMention": {
            "type": "boolean",
            "default": true,
            "description": "未显式设置 replyMode 时，是否要求先 @机器人"
          },
          "replyMode": {
            "type": "string",
            "enum": [
              "ignore",
              "record",
              "mention-only"
            ],
            "description": "群聊回复模式"
          },
          "groupSessionMode": {
            "type": "string",
            "enum": [
              "group",
              "user"
            ],
            "default": "group",
            "description": "群聊会话拆分模式：group=按群，user=按群+人"
          },
          "followUp": {
            "type": "boolean",
            "default": false,
            "description": "机器人回复后是否允许一段时间内连续追问"
          },
          "followUpWindow": {
            "type": "integer",
            "minimum": 0,
            "default": 300,
            "description": "追问窗口时长（秒）"
          },
          "dmMessageFormat": {
            "type": "string",
            "enum": [
              "text",
              "markdown",
              "streaming-card",
              "streaming-markdown"
            ],
            "default": "markdown",
            "description": "单聊回复格式"
          },
          "groupMessageFormat": {
            "type": "string",
            "enum": [
              "text",
              "markdown",
              "streaming-card",
              "streaming-markdown"
            ],
            "default": "markdown",
            "description": "群聊回复格式；markdown、streaming-card、streaming-markdown 不支持引用回复"
          },
          "processingHint": {
            "type": "boolean",
            "default": false,
            "description": "处理较慢时先发送一条“收到啦”提示"
          },
          "processingHintDelay": {
            "type": "integer",
            "minimum": 0,
            "default": 1,
            "description": "发送处理中提示前的等待秒数"
          },
          "textChunkLimit": {
            "type": "integer",
            "minimum": 1,
            "default": 1800,
            "description": "长消息拆分的单段字符上限"
          },
          "defaultTo": {
            "type": "string",
            "description": "主动发送或兼容场景的默认目标，例如 alice 或 group:12345"
          },
          "privateDataDir": {
            "type": "string",
            "default": "plugins/infoflow-private",
            "description": "插件私有数据目录，相对 OpenClaw stateDir"
          },
          "cronRelay": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": true,
                "description": "是否把 OpenClaw cron 运行结果转发到如流"
              },
              "includeAlreadyDelivered": {
                "type": "boolean",
                "default": false,
                "description": "是否也转发已由 OpenClaw delivery 投递过的任务"
              },
              "prefix": {
                "type": "string",
                "default": "【定时任务】",
                "description": "定时任务转发前缀"
              },
              "pollIntervalMs": {
                "type": "integer",
                "minimum": 500,
                "default": 2000,
                "description": "cron 运行日志轮询间隔（毫秒）"
              }
            }
          },
          "defaultAccount": {
            "type": "string",
            "description": "多账号模式下的默认账号 ID"
          },
          "groups": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "replyMode": {
                  "type": "string",
                  "enum": [
                    "ignore",
                    "record",
                    "mention-only"
                  ],
                  "description": "群级回复模式覆盖"
                },
                "groupSessionMode": {
                  "type": "string",
                  "enum": [
                    "group",
                    "user"
                  ],
                  "default": "group",
                  "description": "群聊会话拆分模式：group=按群，user=按群+人"
                },
                "followUp": {
                  "type": "boolean",
                  "default": false,
                  "description": "机器人回复后是否允许一段时间内连续追问"
                },
                "followUpWindow": {
                  "type": "integer",
                  "minimum": 0,
                  "default": 300,
                  "description": "追问窗口时长（秒）"
                },
                "systemPrompt": {
                  "type": "string",
                  "description": "该群专属的附加系统提示词"
                }
              }
            }
          },
          "accounts": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": true,
                  "description": "是否启用当前 Infoflow 账号"
                },
                "name": {
                  "type": "string",
                  "description": "账号展示名称，仅用于控制面板区分账号"
                },
                "apiHost": {
                  "type": "string",
                  "default": "https://apiin.im.baidu.com",
                  "description": "如流发送 API 域名"
                },
                "connectionMode": {
                  "type": "string",
                  "enum": [
                    "webhook",
                    "websocket"
                  ],
                  "default": "webhook",
                  "description": "消息接收模式，默认 webhook"
                },
                "wsGateway": {
                  "type": "string",
                  "default": "infoflow-open-gateway.weiyun.baidu.com",
                  "description": "WebSocket 网关域名，仅 websocket 模式使用"
                },
                "wsConnectDomain": {
                  "type": "string",
                  "description": "WebSocket 连接域名，用于 Phase 2 实际 WS 握手（不填则使用服务端返回的地址，内网环境可配置此项）"
                },
                "robotId": {
                  "type": "string",
                  "description": "无需手动填写，自动发现。如流机器人实际 ID（首次被 @ 时从消息体中提取，用于忽略自身消息）"
                },
                "dashboardUrl": {
                  "type": "string",
                  "description": "Dashboard 访问地址，用于任务深链接"
                },
                "checkToken": {
                  "type": "string",
                  "description": "Webhook 校验 token，仅 webhook 模式必填"
                },
                "encodingAESKey": {
                  "type": "string",
                  "description": "Webhook 加密密钥，仅 webhook 模式必填"
                },
                "appKey": {
                  "type": "string",
                  "description": "如流应用 AppKey"
                },
                "appSecret": {
                  "type": "string",
                  "description": "如流应用 AppSecret"
                },
                "robotName": {
                  "type": "string",
                  "description": "群聊中用于识别 @机器人的显示名"
                },
                "appAgentId": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "如流应用 ID，私聊撤回依赖该字段"
                },
                "dmPolicy": {
                  "type": "string",
                  "enum": [
                    "open",
                    "pairing",
                    "allowlist"
                  ],
                  "default": "open",
                  "description": "单聊访问策略"
                },
                "allowFrom": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "单聊白名单，dmPolicy=allowlist 时生效"
                },
                "groupPolicy": {
                  "type": "string",
                  "enum": [
                    "open",
                    "allowlist",
                    "disabled"
                  ],
                  "default": "open",
                  "description": "群聊访问策略"
                },
                "groupAllowFrom": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "群聊白名单，groupPolicy=allowlist 时生效"
                },
                "requireMention": {
                  "type": "boolean",
                  "default": true,
                  "description": "未显式设置 replyMode 时，是否要求先 @机器人"
                },
                "replyMode": {
                  "type": "string",
                  "enum": [
                    "ignore",
                    "record",
                    "mention-only"
                  ],
                  "description": "群聊回复模式"
                },
                "groupSessionMode": {
                  "type": "string",
                  "enum": [
                    "group",
                    "user"
                  ],
                  "default": "group",
                  "description": "群聊会话拆分模式：group=按群，user=按群+人"
                },
                "followUp": {
                  "type": "boolean",
                  "default": false,
                  "description": "机器人回复后是否允许一段时间内连续追问"
                },
                "followUpWindow": {
                  "type": "integer",
                  "minimum": 0,
                  "default": 300,
                  "description": "追问窗口时长（秒）"
                },
                "dmMessageFormat": {
                  "type": "string",
                  "enum": [
                    "text",
                    "markdown",
                    "streaming-card",
                    "streaming-markdown"
                  ],
                  "default": "markdown",
                  "description": "单聊回复格式"
                },
                "groupMessageFormat": {
                  "type": "string",
                  "enum": [
                    "text",
                    "markdown",
                    "streaming-card",
                    "streaming-markdown"
                  ],
                  "default": "markdown",
                  "description": "群聊回复格式；markdown、streaming-card、streaming-markdown 不支持引用回复"
                },
                "processingHint": {
                  "type": "boolean",
                  "default": false,
                  "description": "处理较慢时先发送一条”收到啦”提示"
                },
                "processingHintDelay": {
                  "type": "integer",
                  "minimum": 0,
                  "default": 1,
                  "description": "发送处理中提示前的等待秒数"
                },
                "textChunkLimit": {
                  "type": "integer",
                  "minimum": 1,
                  "default": 1800,
                  "description": "长消息拆分的单段字符上限"
                },
                "defaultTo": {
                  "type": "string",
                  "description": "主动发送或兼容场景的默认目标，例如 alice 或 group:12345"
                },
                "privateDataDir": {
                  "type": "string",
                  "default": "plugins/infoflow-private",
                  "description": "插件私有数据目录，相对 OpenClaw stateDir"
                },
                "cronRelay": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "default": true,
                      "description": "是否把 OpenClaw cron 运行结果转发到如流"
                    },
                    "includeAlreadyDelivered": {
                      "type": "boolean",
                      "default": false,
                      "description": "是否也转发已由 OpenClaw delivery 投递过的任务"
                    },
                    "prefix": {
                      "type": "string",
                      "default": "【定时任务】",
                      "description": "定时任务转发前缀"
                    },
                    "pollIntervalMs": {
                      "type": "integer",
                      "minimum": 500,
                      "default": 2000,
                      "description": "cron 运行日志轮询间隔（毫秒）"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "uiHints": {
        "appKey": {
          "label": "AppKey",
          "help": "如流应用的 AppKey。"
        },
        "appSecret": {
          "label": "AppSecret",
          "help": "如流应用的 AppSecret。",
          "sensitive": true
        },
        "connectionMode": {
          "label": "接收模式",
          "help": "默认 websocket，本地开发无需公网域名。"
        },
        "wsGateway": {
          "label": "WS 网关",
          "help": "仅 websocket 模式使用。",
          "advanced": true
        },
        "apiHost": {
          "label": "API 域名",
          "help": "发送消息使用的 REST API 域名。",
          "advanced": true
        },
        "checkToken": {
          "label": "Webhook Token",
          "help": "仅 webhook 模式需要。",
          "sensitive": true,
          "advanced": true
        },
        "encodingAESKey": {
          "label": "Webhook AES Key",
          "help": "仅 webhook 模式需要。",
          "sensitive": true,
          "advanced": true
        },
        "enabled": {
          "label": "启用通道",
          "help": "关闭后停止该账号的收发。"
        },
        "name": {
          "label": "账号名称",
          "help": "仅用于控制台展示。"
        },
        "robotName": {
          "label": "机器人名称",
          "help": "用于识别群里是否 @到了机器人。"
        },
        "appAgentId": {
          "label": "应用 ID",
          "help": "私聊撤回消息需要该值。"
        },
        "dmPolicy": {
          "label": "单聊策略"
        },
        "allowFrom": {
          "label": "单聊白名单",
          "placeholder": "alice"
        },
        "groupPolicy": {
          "label": "群聊策略"
        },
        "groupAllowFrom": {
          "label": "群聊白名单",
          "placeholder": "12345678"
        },
        "requireMention": {
          "label": "要求先 @机器人",
          "help": "只在未显式设置 replyMode 时作为推导条件。"
        },
        "replyMode": {
          "label": "回复模式",
          "help": "不填则沿用现有兼容推导逻辑。"
        },
        "groupSessionMode": {
          "label": "群聊会话模式",
          "help": "group=整个群共用 session，user=群内每人独立 session。"
        },
        "followUp": {
          "label": "允许追问窗口"
        },
        "followUpWindow": {
          "label": "追问窗口秒数"
        },
        "dmMessageFormat": {
          "label": "单聊消息格式",
          "help": "支持普通文本、Markdown，或如流流式卡片。"
        },
        "groupMessageFormat": {
          "label": "群聊消息格式",
          "help": "支持普通文本、Markdown，或如流流式卡片；markdown、streaming-card、streaming-markdown 不带引用回复。"
        },
        "processingHint": {
          "label": "处理中提示"
        },
        "processingHintDelay": {
          "label": "提示延迟秒数"
        },
        "textChunkLimit": {
          "label": "拆分长度上限",
          "advanced": true
        },
        "defaultTo": {
          "label": "默认目标",
          "help": "仅主动发送和兼容场景使用；infoflow_cron 不依赖该值。",
          "advanced": true,
          "placeholder": "alice 或 group:12345"
        },
        "privateDataDir": {
          "label": "私有数据目录",
          "help": "cron 可观测文件会写到该目录下，例如 cron-relay-status.md 和 cron-relay-state.json。",
          "advanced": true
        },
        "cronRelay.enabled": {
          "label": "启用定时转发",
          "help": "开启后会把状态摘要写入私有数据目录，便于直接查看执行结果。",
          "advanced": true
        },
        "cronRelay.includeAlreadyDelivered": {
          "label": "包含已投递任务",
          "advanced": true
        },
        "cronRelay.prefix": {
          "label": "定时前缀",
          "advanced": true
        },
        "cronRelay.pollIntervalMs": {
          "label": "定时轮询间隔",
          "help": "影响 relay 扫描 cron runs 和刷新状态摘要文件的频率。",
          "advanced": true
        },
        "defaultAccount": {
          "label": "默认账号",
          "advanced": true
        },
        "groups": {
          "label": "群级覆盖",
          "help": "按 groupId 配置群级策略覆盖。",
          "advanced": true,
          "itemTemplate": {
            "replyMode": "mention-only",
            "groupSessionMode": "group",
            "followUp": false,
            "followUpWindow": 300
          }
        },
        "accounts": {
          "label": "多账号配置",
          "help": "按账号 ID 配置额外机器人。",
          "advanced": true,
          "itemTemplate": {
            "enabled": true,
            "connectionMode": "webhook",
            "apiHost": "https://apiin.im.baidu.com",
            "wsGateway": "infoflow-open-gateway.weiyun.baidu.com",
            "groupSessionMode": "group",
            "followUp": false,
            "followUpWindow": 300,
            "processingHint": false,
            "processingHintDelay": 1,
            "dmMessageFormat": "markdown",
            "groupMessageFormat": "markdown",
            "textChunkLimit": 1800
          }
        }
      }
    }
  },
  "configSchema": {
    "jsonSchema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    }
  }
}
