{
  "id": "telegram",
  "name": "Telegram Channel",
  "description": "Bundled Telegram Bot channel (private workspace sources; ships inside @xopcai/xopc dist/)",
  "version": "0.0.196",
  "kind": "channel",
  "main": "src/index.js",
  "channels": [
    "telegram"
  ],
  "channelContributions": {
    "telegram": {
      "label": "Telegram",
      "description": "Telegram Bot API channel",
      "docsPath": "/channels/telegram",
      "order": 10,
      "configPath": "channels.telegram",
      "capabilities": {
        "login": false,
        "pairing": true,
        "doctor": true,
        "multiAccount": true,
        "streaming": true,
        "media": true
      },
      "actions": {
        "doctor.run": {
          "label": "Diagnose",
          "description": "Check Bot API connectivity and token validity.",
          "result": "diagnostics"
        },
        "setup.start": {
          "label": "Configure",
          "description": "Set up Telegram private chat with a bot token.",
          "result": "form"
        }
      },
      "uiHints": {
        "accounts.*.botToken": {
          "sensitive": true,
          "help": "Telegram bot token"
        },
        "enabled": {
          "tags": [
            "basic"
          ]
        },
        "accounts": {
          "advanced": true
        },
        "defaults": {
          "advanced": true
        },
        "accounts.default.botToken": {
          "tags": [
            "basic"
          ],
          "sensitive": true,
          "help": "Telegram bot token"
        },
        "accounts.default.dmPolicy": {
          "tags": [
            "basic"
          ]
        },
        "accounts.default.allowFrom": {
          "tags": [
            "basic"
          ],
          "help": "Telegram user ids allowed for private chat when DM policy is pairing or allowlist."
        },
        "accounts.default.groupPolicy": {
          "tags": [
            "basic"
          ]
        },
        "accounts.default.groupAllowFrom": {
          "tags": [
            "basic"
          ],
          "help": "Telegram user ids allowed in groups when group policy is allowlist."
        },
        "accounts.default.streaming.mode": {
          "tags": [
            "basic"
          ]
        }
      },
      "configSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false,
            "title": "Enabled"
          },
          "debug": {
            "type": "boolean",
            "default": false,
            "title": "Debug"
          },
          "accounts": {
            "type": "object",
            "title": "Accounts",
            "additionalProperties": true,
            "properties": {
              "default": {
                "type": "object",
                "title": "default",
                "additionalProperties": true,
                "properties": {
                  "accountId": {
                    "type": "string",
                    "title": "Account ID"
                  },
                  "name": {
                    "type": "string",
                    "title": "Name"
                  },
                  "enabled": {
                    "type": "boolean",
                    "default": true,
                    "title": "Enabled"
                  },
                  "botToken": {
                    "type": "string",
                    "format": "password",
                    "title": "Bot token"
                  },
                  "tokenFile": {
                    "type": "string",
                    "title": "Token file"
                  },
                  "allowFrom": {
                    "type": "array",
                    "items": {
                      "type": [
                        "string",
                        "number"
                      ]
                    },
                    "title": "DM allow list"
                  },
                  "groupAllowFrom": {
                    "type": "array",
                    "items": {
                      "type": [
                        "string",
                        "number"
                      ]
                    },
                    "title": "Group allow list"
                  },
                  "dmPolicy": {
                    "type": "string",
                    "enum": [
                      "pairing",
                      "allowlist",
                      "open",
                      "disabled"
                    ],
                    "default": "pairing",
                    "title": "DM policy"
                  },
                  "groupPolicy": {
                    "type": "string",
                    "enum": [
                      "open",
                      "disabled",
                      "allowlist"
                    ],
                    "default": "open",
                    "title": "Group policy"
                  },
                  "replyToMode": {
                    "type": "string",
                    "enum": [
                      "off",
                      "first",
                      "all"
                    ],
                    "default": "off",
                    "title": "Reply-to mode"
                  },
                  "streaming": {
                    "type": "object",
                    "title": "Streaming",
                    "additionalProperties": true,
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": [
                          "off",
                          "partial",
                          "block"
                        ],
                        "default": "partial",
                        "title": "Mode"
                      }
                    }
                  },
                  "historyLimit": {
                    "type": "number",
                    "default": 50,
                    "title": "History limit"
                  },
                  "textChunkLimit": {
                    "type": "number",
                    "default": 4000,
                    "title": "Text chunk limit"
                  },
                  "proxy": {
                    "type": "string",
                    "title": "Proxy"
                  },
                  "apiRoot": {
                    "type": "string",
                    "title": "API root"
                  }
                }
              }
            }
          },
          "defaults": {
            "type": "object",
            "title": "Account defaults",
            "additionalProperties": false,
            "properties": {
              "dmPolicy": {
                "type": "string",
                "enum": [
                  "pairing",
                  "allowlist",
                  "open",
                  "disabled"
                ],
                "default": "pairing",
                "title": "DM policy"
              },
              "groupPolicy": {
                "type": "string",
                "enum": [
                  "open",
                  "disabled",
                  "allowlist"
                ],
                "default": "open",
                "title": "Group policy"
              },
              "replyToMode": {
                "type": "string",
                "enum": [
                  "off",
                  "first",
                  "all"
                ],
                "default": "off",
                "title": "Reply-to mode"
              },
              "streaming": {
                "type": "object",
                "title": "Streaming",
                "additionalProperties": true,
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "off",
                      "partial",
                      "block"
                    ],
                    "default": "partial",
                    "title": "Mode"
                  }
                }
              },
              "historyLimit": {
                "type": "number",
                "default": 50,
                "title": "History limit"
              },
              "textChunkLimit": {
                "type": "number",
                "default": 4000,
                "title": "Text chunk limit"
              },
              "proxy": {
                "type": "string",
                "title": "Proxy"
              },
              "apiRoot": {
                "type": "string",
                "title": "API root"
              }
            }
          }
        }
      },
      "i18n": {
        "zh": {
          "label": "Telegram",
          "description": "Telegram Bot API 消息通道",
          "configSchema": {
            "properties": {
              "enabled": {
                "title": "启用"
              },
              "debug": {
                "title": "调试"
              },
              "accounts": {
                "title": "账号",
                "properties": {
                  "default": {
                    "title": "默认账号",
                    "properties": {
                      "accountId": {
                        "title": "账号 ID"
                      },
                      "name": {
                        "title": "名称"
                      },
                      "enabled": {
                        "title": "启用"
                      },
                      "botToken": {
                        "title": "Bot Token"
                      },
                      "tokenFile": {
                        "title": "Token 文件"
                      },
                      "allowFrom": {
                        "title": "私聊允许列表"
                      },
                      "groupAllowFrom": {
                        "title": "群聊允许列表"
                      },
                      "dmPolicy": {
                        "title": "私聊策略"
                      },
                      "groupPolicy": {
                        "title": "群聊策略"
                      },
                      "replyToMode": {
                        "title": "回复模式"
                      },
                      "streaming": {
                        "title": "流式输出",
                        "properties": {
                          "mode": {
                            "title": "模式"
                          }
                        }
                      },
                      "historyLimit": {
                        "title": "历史条数"
                      },
                      "textChunkLimit": {
                        "title": "文本分块上限"
                      },
                      "proxy": {
                        "title": "代理"
                      },
                      "apiRoot": {
                        "title": "API 根地址"
                      }
                    }
                  }
                }
              },
              "defaults": {
                "title": "账号默认值",
                "properties": {
                  "dmPolicy": {
                    "title": "私聊策略"
                  },
                  "groupPolicy": {
                    "title": "群聊策略"
                  },
                  "replyToMode": {
                    "title": "回复模式"
                  },
                  "streaming": {
                    "title": "流式输出",
                    "properties": {
                      "mode": {
                        "title": "模式"
                      }
                    }
                  },
                  "historyLimit": {
                    "title": "历史条数"
                  },
                  "textChunkLimit": {
                    "title": "文本分块上限"
                  },
                  "proxy": {
                    "title": "代理"
                  },
                  "apiRoot": {
                    "title": "API 根地址"
                  }
                }
              }
            }
          },
          "uiHints": {
            "accounts.*.botToken": {
              "help": "Telegram Bot Token"
            },
            "accounts.default.botToken": {
              "help": "Telegram Bot Token"
            },
            "accounts.default.allowFrom": {
              "help": "私聊策略为 pairing 或 allowlist 时允许的 Telegram 用户 ID。"
            },
            "accounts.default.groupAllowFrom": {
              "help": "群聊策略为 allowlist 时允许的 Telegram 用户 ID。"
            }
          },
          "actions": {
            "doctor.run": {
              "label": "诊断"
            },
            "setup.start": {
              "label": "配置",
              "description": "填写 Bot Token，默认启用私聊。",
              "result": "form"
            }
          }
        }
      },
      "ui": {
        "card": {
          "summaryFields": [
            "accounts.default.dmPolicy",
            "accounts.default.streaming.mode"
          ]
        }
      }
    }
  },
  "channelEnvVars": {
    "telegram": [
      "TELEGRAM_BOT_TOKEN"
    ]
  },
  "activation": {
    "onChannels": [
      "telegram"
    ],
    "onCapabilities": [
      "channel"
    ]
  },
  "setup": {
    "providers": [],
    "requiresRuntime": true
  },
  "engines": {
    "xopc": ">=0.0.106 <1.0.0"
  },
  "contracts": {
    "channels": [
      "telegram"
    ]
  }
}
