manifest.json 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. {
  2. "id": "telegram",
  3. "name": "Telegram Bot",
  4. "description": "Telegram Bot API integration with long polling via background worker. Messages are forwarded to the LLM and replies are sent back automatically.",
  5. "version": "3.1.0",
  6. "runtime": "quickjs",
  7. "sdkVersion": 1,
  8. "auto_start": true,
  9. "config": [
  10. {
  11. "key": "bot_token",
  12. "label": "Telegram Bot API token (from @BotFather)",
  13. "secret": true
  14. },
  15. {
  16. "key": "authorized_user_id",
  17. "label": "Authorized Telegram user ID (only this user can interact with the bot)",
  18. "secret": false
  19. },
  20. {
  21. "key": "polling_enabled",
  22. "label": "Enable long polling (recommended for private use, no public URL needed)",
  23. "secret": false,
  24. "default": "true"
  25. },
  26. {
  27. "key": "polling_interval",
  28. "label": "Polling interval in milliseconds (recommended: 2000-5000)",
  29. "secret": false,
  30. "default": "2000"
  31. },
  32. {
  33. "key": "polling_timeout",
  34. "label": "Long polling timeout in seconds (recommended: 25-30)",
  35. "secret": false,
  36. "default": "30"
  37. }
  38. ],
  39. "tools": [
  40. {
  41. "name": "telegram_send_message",
  42. "description": "Send a text message to a Telegram chat",
  43. "parameters": {
  44. "type": "object",
  45. "properties": {
  46. "chat_id": { "type": "string", "description": "Target chat ID or @username" },
  47. "text": { "type": "string", "description": "Message text (1-4096 characters)" },
  48. "parse_mode": { "type": "string", "description": "Text formatting mode", "enum": ["HTML", "Markdown", "MarkdownV2"] },
  49. "disable_notification": { "type": "boolean", "description": "Send silently" },
  50. "reply_to_message_id": { "type": "integer", "description": "Reply to message ID" }
  51. },
  52. "required": ["chat_id", "text"]
  53. }
  54. },
  55. {
  56. "name": "telegram_send_to_owner",
  57. "description": "Send a message to the authorized user (bot owner)",
  58. "parameters": {
  59. "type": "object",
  60. "properties": {
  61. "text": { "type": "string", "description": "Message text (1-4096 characters)" },
  62. "parse_mode": { "type": "string", "description": "Text formatting mode", "enum": ["HTML", "Markdown", "MarkdownV2"] }
  63. },
  64. "required": ["text"]
  65. }
  66. },
  67. {
  68. "name": "telegram_send_photo",
  69. "description": "Send a photo to a Telegram chat",
  70. "parameters": {
  71. "type": "object",
  72. "properties": {
  73. "chat_id": { "type": "string", "description": "Target chat ID" },
  74. "photo": { "type": "string", "description": "Photo URL or file_id" },
  75. "caption": { "type": "string", "description": "Photo caption" },
  76. "parse_mode": { "type": "string", "description": "Caption formatting mode", "enum": ["HTML", "Markdown", "MarkdownV2"] }
  77. },
  78. "required": ["chat_id", "photo"]
  79. }
  80. },
  81. {
  82. "name": "telegram_send_document",
  83. "description": "Send a document/file to a Telegram chat",
  84. "parameters": {
  85. "type": "object",
  86. "properties": {
  87. "chat_id": { "type": "string", "description": "Target chat ID" },
  88. "document": { "type": "string", "description": "Document URL or file_id" },
  89. "caption": { "type": "string", "description": "Document caption" },
  90. "parse_mode": { "type": "string", "description": "Caption formatting mode", "enum": ["HTML", "Markdown", "MarkdownV2"] }
  91. },
  92. "required": ["chat_id", "document"]
  93. }
  94. },
  95. {
  96. "name": "telegram_forward_message",
  97. "description": "Forward a message from one chat to another",
  98. "parameters": {
  99. "type": "object",
  100. "properties": {
  101. "chat_id": { "type": "string", "description": "Target chat ID" },
  102. "from_chat_id": { "type": "string", "description": "Source chat ID" },
  103. "message_id": { "type": "integer", "description": "Message ID to forward" }
  104. },
  105. "required": ["chat_id", "from_chat_id", "message_id"]
  106. }
  107. },
  108. {
  109. "name": "telegram_get_me",
  110. "description": "Get bot information",
  111. "parameters": { "type": "object", "properties": {} }
  112. },
  113. {
  114. "name": "telegram_get_chat",
  115. "description": "Get chat information",
  116. "parameters": {
  117. "type": "object",
  118. "properties": {
  119. "chat_id": { "type": "string", "description": "Chat ID" }
  120. },
  121. "required": ["chat_id"]
  122. }
  123. },
  124. {
  125. "name": "telegram_set_webhook",
  126. "description": "Set webhook URL for the bot (alternative to polling)",
  127. "parameters": {
  128. "type": "object",
  129. "properties": {
  130. "webhook_url": { "type": "string", "description": "Public HTTPS URL for webhook" },
  131. "secret_token": { "type": "string", "description": "Optional secret token for verification" }
  132. },
  133. "required": ["webhook_url"]
  134. }
  135. },
  136. {
  137. "name": "telegram_delete_webhook",
  138. "description": "Delete webhook and switch to polling mode",
  139. "parameters": { "type": "object", "properties": {} }
  140. },
  141. {
  142. "name": "telegram_get_webhook_info",
  143. "description": "Get current webhook configuration",
  144. "parameters": { "type": "object", "properties": {} }
  145. }
  146. ],
  147. "permissions": {
  148. "allowNetwork": true,
  149. "allowStorage": true,
  150. "allowFiles": true
  151. }
  152. }