{
  "id": "slack",
  "name": "Slack",
  "description": "Full-featured Slack workspace bot, streaming, search, and collaboration channel",
  "version": "0.2.0",
  "kind": "channel",
  "main": "src/index.js",
  "channels": [
    "slack"
  ],
  "engines": {
    "xopc": ">=0.0.465"
  },
  "contracts": {
    "channels": [
      "slack"
    ],
    "tools": [
      "slack_list_channels",
      "slack_read_messages",
      "slack_search_messages",
      "slack_download_file",
      "slack_member_info",
      "slack_emoji_list",
      "slack_list_pins",
      "slack_send_message",
      "slack_manage_message",
      "slack_manage_conversation"
    ]
  },
  "channelContributions": {
    "slack": {
      "label": "Slack",
      "description": "Full-featured Slack channel over Socket Mode or HTTP Request URLs",
      "order": 60,
      "configPath": "channels.slack",
      "docsPath": "/channels/slack",
      "capabilities": {
        "login": true,
        "pairing": true,
        "threads": true
      },
      "configSchema": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false
          },
          "mode": {
            "type": "string",
            "enum": ["socket", "http"],
            "default": "socket"
          },
          "postAs": {
            "type": "string",
            "enum": ["bot", "user"],
            "default": "bot"
          },
          "dmPolicy": {
            "type": "string",
            "enum": ["pairing", "allowlist", "open", "disabled"],
            "default": "pairing"
          },
          "allowFrom": {
            "type": "array",
            "items": { "type": "string" }
          },
          "groupPolicy": {
            "type": "string",
            "enum": ["allowlist", "open", "disabled"],
            "default": "allowlist"
          },
          "groupAllowFrom": {
            "type": "array",
            "items": { "type": "string" }
          },
          "botToken": {
            "type": "string",
            "title": "Bot Token (xoxb-)",
            "format": "password",
            "pattern": "^(?:xoxe\\.)?xoxb-\\S+$",
            "x-hidden": true
          },
          "appToken": {
            "type": "string",
            "title": "App Token (xapp-)",
            "format": "password",
            "pattern": "^(?:xoxe\\.)?xapp-\\S+$",
            "x-hidden": true
          },
          "signingSecret": {
            "type": "string",
            "title": "Signing Secret (HTTP mode)",
            "format": "password",
            "x-hidden": true
          },
          "userToken": {
            "type": "string",
            "title": "User Token (xoxp-, optional)",
            "format": "password",
            "pattern": "^(?:xoxe\\.)?xoxp-\\S+$",
            "x-hidden": true
          },
          "webhookPath": {
            "type": "string",
            "default": "/slack/events"
          },
          "credentialIdentity": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9]+:[A-Z][A-Z0-9]+$",
            "x-hidden": true
          }
        }
      },
      "uiHints": {
        "botToken": { "sensitive": true },
        "appToken": { "sensitive": true },
        "signingSecret": { "sensitive": true },
        "userToken": { "sensitive": true },
        "groupAllowFrom": { "label": "Allowed channel senders" }
      },
      "actions": {
        "setup.manual": {
          "label": "Configure Slack",
          "result": "form"
        }
      },
      "i18n": {
        "zh": {
          "description": "全功能 Slack 渠道（支持 Socket Mode / HTTP、流式卡片、附件语音、审批与消息检索）",
          "actions": {
            "setup.manual": {
              "label": "配置 Slack"
            }
          }
        }
      }
    }
  }
}
