{
  "id": "dingtalk",
  "name": "DingTalk",
  "description": "Full-featured DingTalk Stream bot, multimodal media, AI Card streaming, and workspace tools",
  "version": "0.2.0",
  "kind": "channel",
  "main": "src/index.js",
  "channels": [
    "dingtalk"
  ],
  "engines": {
    "xopc": ">=0.0.465"
  },
  "contracts": {
    "channels": ["dingtalk"],
    "tools": [
      "dingtalk_send_message",
      "dingtalk_recall_message",
      "dingtalk_read_observed_messages",
      "dingtalk_download_file",
      "dingtalk_get_user",
      "dingtalk_list_departments"
    ]
  },
  "channelContributions": {
    "dingtalk": {
      "label": "DingTalk",
      "description": "Full-featured DingTalk Stream channel",
      "order": 40,
      "configPath": "channels.dingtalk",
      "docsPath": "/channels/dingtalk",
      "capabilities": {
        "login": true,
        "pairing": true
      },
      "configSchema": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "enabled": { "type": "boolean", "default": false },
          "clientId": { "type": "string", "title": "Client ID", "minLength": 1, "pattern": "\\S" },
          "clientSecret": { "type": "string", "title": "Client Secret", "format": "password", "minLength": 1, "pattern": "\\S" },
          "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" } }
        }
      },
      "uiHints": {
        "clientSecret": { "sensitive": true },
        "groupAllowFrom": { "label": "Allowed group senders" }
      },
      "actions": {
        "setup.start": { "label": "Set up by QR", "result": "qr" },
        "setup.status": { "label": "Setup status", "result": "poll" },
        "setup.manual": { "label": "Enter credentials", "result": "form" },
        "setup.cancel": { "label": "Cancel setup", "result": "ok" }
      },
      "i18n": {
        "zh": {
          "label": "钉钉",
          "description": "全功能钉钉机器人通道（Stream 长连接、多模态附件/语音、AI 卡片流式、消息撤回与通讯录工具）",
          "uiHints": {
            "groupAllowFrom": { "label": "允许在群聊中触发的成员" }
          },
          "actions": {
            "setup.start": { "label": "扫码连接" },
            "setup.manual": { "label": "手动填写凭据" }
          }
        }
      }
    }
  }
}
