{
  "id": "feishu-tools",
  "name": "Feishu Tools",
  "description": "Feishu/Lark tools (doc/wiki/drive/perm/bitable) for xopc agents. Activates when the Feishu channel is configured.",
  "version": "0.0.14",
  "kind": "tool",
  "main": "src/index.js",
  "channels": [
    "feishu",
    "lark"
  ],
  "channelContributions": {
    "feishu": {
      "label": "Feishu",
      "description": "Feishu/Lark messaging and workspace tools",
      "docsPath": "/channels/feishu",
      "order": 30,
      "configPath": "channels.feishu",
      "capabilities": {
        "login": true,
        "pairing": true,
        "doctor": true,
        "multiAccount": true,
        "streaming": true,
        "media": true
      },
      "configSchema": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false,
            "title": "Enabled"
          },
          "accounts": {
            "type": "object",
            "additionalProperties": true,
            "title": "Accounts"
          },
          "appId": {
            "type": "string",
            "title": "App ID"
          },
          "appSecret": {
            "type": "string",
            "format": "password",
            "title": "App secret"
          },
          "domain": {
            "type": "string",
            "enum": [
              "feishu",
              "lark"
            ],
            "default": "feishu",
            "title": "Domain"
          },
          "connectionMode": {
            "type": "string",
            "enum": [
              "websocket",
              "webhook"
            ],
            "default": "websocket",
            "title": "Connection mode"
          },
          "dmPolicy": {
            "type": "string",
            "enum": [
              "pairing",
              "allowlist",
              "open",
              "disabled"
            ],
            "default": "open",
            "title": "DM policy"
          },
          "groupPolicy": {
            "type": "string",
            "enum": [
              "open",
              "disabled",
              "allowlist"
            ],
            "default": "allowlist",
            "title": "Group policy"
          },
          "allowFrom": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "title": "Allowed DM senders"
          },
          "groupAllowFrom": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "title": "Allowed group senders"
          },
          "requireMention": {
            "type": "boolean",
            "default": true,
            "title": "Require mention in groups"
          },
          "renderMode": {
            "type": "string",
            "enum": [
              "auto",
              "raw",
              "card"
            ],
            "default": "auto",
            "title": "Render mode"
          },
          "streaming": {
            "type": "boolean",
            "default": false,
            "title": "Streaming replies"
          },
          "reactionNotifications": {
            "type": "string",
            "enum": [
              "off",
              "own",
              "all"
            ],
            "default": "own",
            "title": "Reaction notifications"
          },
          "inboundDebounceMs": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000,
            "title": "Inbound debounce (ms)"
          },
          "historyLimit": {
            "type": "number",
            "minimum": 0,
            "default": 50,
            "title": "History limit"
          },
          "textChunkLimit": {
            "type": "number",
            "minimum": 1,
            "default": 4000,
            "title": "Text chunk limit"
          },
          "webhookHost": {
            "type": "string",
            "title": "Webhook host"
          },
          "webhookPort": {
            "type": "number",
            "minimum": 1,
            "title": "Webhook port"
          },
          "webhookPath": {
            "type": "string",
            "title": "Webhook path"
          },
          "verificationToken": {
            "type": "string",
            "format": "password",
            "title": "Verification token"
          },
          "encryptKey": {
            "type": "string",
            "format": "password",
            "title": "Encrypt key"
          },
          "tools": {
            "type": "object",
            "title": "Tools",
            "additionalProperties": false,
            "properties": {
              "doc": {
                "type": "boolean",
                "title": "Doc"
              },
              "chat": {
                "type": "boolean",
                "title": "Chat"
              },
              "wiki": {
                "type": "boolean",
                "title": "Wiki"
              },
              "drive": {
                "type": "boolean",
                "title": "Drive"
              },
              "perm": {
                "type": "boolean",
                "title": "Permissions"
              },
              "bitable": {
                "type": "boolean",
                "title": "Bitable"
              },
              "scopes": {
                "type": "boolean",
                "title": "Scopes"
              }
            }
          },
          "actions": {
            "type": "object",
            "title": "Actions",
            "additionalProperties": false,
            "properties": {
              "reactions": {
                "type": "boolean",
                "title": "Reactions"
              }
            }
          },
          "blockStreamingCoalesce": {
            "type": "object",
            "title": "Block streaming coalesce",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean",
                "title": "Enabled"
              },
              "minChars": {
                "type": "number",
                "minimum": 1,
                "title": "Minimum characters"
              },
              "idleMs": {
                "type": "number",
                "minimum": 1,
                "title": "Idle milliseconds"
              }
            }
          },
          "dynamicAgentCreation": {
            "type": "object",
            "title": "Dynamic agent creation",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean",
                "title": "Enabled"
              },
              "workspaceTemplate": {
                "type": "string",
                "title": "Workspace template"
              },
              "agentDirTemplate": {
                "type": "string",
                "title": "Agent directory template"
              },
              "maxAgents": {
                "type": "number",
                "minimum": 1,
                "title": "Max agents"
              }
            }
          }
        }
      },
      "uiHints": {
        "enabled": {
          "advanced": false,
          "tags": [
            "basic"
          ]
        },
        "appId": {
          "advanced": false,
          "tags": [
            "basic"
          ]
        },
        "appSecret": {
          "advanced": false,
          "tags": [
            "basic"
          ],
          "sensitive": true
        },
        "domain": {
          "advanced": false,
          "tags": [
            "basic"
          ]
        },
        "accounts": {
          "advanced": true
        },
        "connectionMode": {
          "advanced": true
        },
        "dmPolicy": {
          "advanced": true
        },
        "groupPolicy": {
          "advanced": true
        },
        "allowFrom": {
          "advanced": true
        },
        "groupAllowFrom": {
          "advanced": true
        },
        "requireMention": {
          "advanced": true
        },
        "renderMode": {
          "advanced": true
        },
        "streaming": {
          "advanced": true
        },
        "reactionNotifications": {
          "advanced": true
        },
        "inboundDebounceMs": {
          "advanced": true
        },
        "historyLimit": {
          "advanced": true
        },
        "textChunkLimit": {
          "advanced": true
        },
        "webhookHost": {
          "advanced": true
        },
        "webhookPort": {
          "advanced": true
        },
        "webhookPath": {
          "advanced": true
        },
        "verificationToken": {
          "advanced": true,
          "sensitive": true
        },
        "encryptKey": {
          "advanced": true,
          "sensitive": true
        },
        "tools": {
          "advanced": true
        },
        "actions": {
          "advanced": true
        },
        "blockStreamingCoalesce": {
          "advanced": true
        },
        "dynamicAgentCreation": {
          "advanced": true
        },
        "accounts.*.appSecret": {
          "sensitive": true
        },
        "accounts.*.verificationToken": {
          "sensitive": true
        },
        "accounts.*.encryptKey": {
          "sensitive": true
        }
      },
      "actions": {
        "setup.start": {
          "label": "Set up by QR",
          "result": "qr"
        },
        "setup.status": {
          "label": "Setup status",
          "result": "poll"
        },
        "setup.manual": {
          "label": "Manual setup",
          "result": "form"
        },
        "doctor.run": {
          "label": "Run doctor",
          "result": "diagnostics"
        }
      },
      "i18n": {
        "zh": {
          "label": "飞书 / Lark",
          "description": "飞书 / Lark 消息通道与工作区工具",
          "configSchema": {
            "properties": {
              "enabled": {
                "title": "启用"
              },
              "accounts": {
                "title": "账号"
              },
              "appId": {
                "title": "App ID"
              },
              "appSecret": {
                "title": "App Secret"
              },
              "domain": {
                "title": "域名"
              },
              "connectionMode": {
                "title": "连接模式"
              },
              "dmPolicy": {
                "title": "私聊策略"
              },
              "groupPolicy": {
                "title": "群聊策略"
              },
              "allowFrom": {
                "title": "允许的私聊发送者"
              },
              "groupAllowFrom": {
                "title": "允许的群聊发送者"
              },
              "requireMention": {
                "title": "群聊需要 @"
              },
              "renderMode": {
                "title": "渲染模式"
              },
              "streaming": {
                "title": "流式回复"
              },
              "reactionNotifications": {
                "title": "表情回应通知"
              },
              "inboundDebounceMs": {
                "title": "入站合并延迟（毫秒）"
              },
              "historyLimit": {
                "title": "历史消息数量"
              },
              "textChunkLimit": {
                "title": "文本分块上限"
              },
              "webhookHost": {
                "title": "Webhook 主机"
              },
              "webhookPort": {
                "title": "Webhook 端口"
              },
              "webhookPath": {
                "title": "Webhook 路径"
              },
              "verificationToken": {
                "title": "Verification Token"
              },
              "encryptKey": {
                "title": "Encrypt Key"
              },
              "tools": {
                "title": "工具"
              },
              "actions": {
                "title": "操作"
              },
              "blockStreamingCoalesce": {
                "title": "块流式合并"
              },
              "dynamicAgentCreation": {
                "title": "动态 Agent 创建"
              }
            }
          },
          "actions": {
            "setup.start": {
              "label": "扫码配置"
            },
            "setup.status": {
              "label": "配置状态"
            },
            "setup.manual": {
              "label": "手动配置"
            },
            "doctor.run": {
              "label": "诊断"
            }
          }
        }
      }
    }
  },
  "activation": {
    "onChannels": [
      "feishu",
      "lark"
    ],
    "onCapabilities": [
      "tool"
    ]
  },
  "setup": {
    "providers": [],
    "requiresRuntime": true
  },
  "engines": {
    "xopc": ">=0.0.106 <1.0.0"
  },
  "contracts": {
    "channels": [
      "feishu",
      "lark"
    ]
  }
}
