Преглед на файлове

fix: remove duplicated tool prefix, add author field (v3.2.0)

ShadowMan Service User преди 1 седмица
родител
ревизия
afcf28a5ee
променени са 2 файла, в които са добавени 23 реда и са изтрити 22 реда
  1. 10 10
      index.js
  2. 13 12
      manifest.json

+ 10 - 10
index.js

@@ -277,7 +277,7 @@ shadowman.events.on('telegram_update', function(update) {
 
 // ── Tools ──────────────────────────────────────────────────────────────
 
-shadowman.tools.register('telegram_send_message', function(args) {
+shadowman.tools.register('send_message', function(args) {
     if (!args.chat_id) return { success: false, error: 'chat_id is required' };
     if (!args.text) return { success: false, error: 'text is required' };
 
@@ -289,7 +289,7 @@ shadowman.tools.register('telegram_send_message', function(args) {
     return sanitizeResponse(apiCall('sendMessage', params));
 });
 
-shadowman.tools.register('telegram_send_to_owner', function(args) {
+shadowman.tools.register('send_to_owner', function(args) {
     if (!args.text) return { success: false, error: 'text is required' };
     if (!AUTHORIZED_USER_ID) return { success: false, error: 'authorized_user_id not configured' };
 
@@ -299,7 +299,7 @@ shadowman.tools.register('telegram_send_to_owner', function(args) {
     return sanitizeResponse(apiCall('sendMessage', params));
 });
 
-shadowman.tools.register('telegram_send_photo', function(args) {
+shadowman.tools.register('send_photo', function(args) {
     if (!args.chat_id) return { success: false, error: 'chat_id is required' };
     if (!args.photo) return { success: false, error: 'photo is required' };
 
@@ -310,7 +310,7 @@ shadowman.tools.register('telegram_send_photo', function(args) {
     return sanitizeResponse(apiCall('sendPhoto', params));
 });
 
-shadowman.tools.register('telegram_send_document', function(args) {
+shadowman.tools.register('send_document', function(args) {
     if (!args.chat_id) return { success: false, error: 'chat_id is required' };
     if (!args.document) return { success: false, error: 'document is required' };
 
@@ -321,7 +321,7 @@ shadowman.tools.register('telegram_send_document', function(args) {
     return sanitizeResponse(apiCall('sendDocument', params));
 });
 
-shadowman.tools.register('telegram_forward_message', function(args) {
+shadowman.tools.register('forward_message', function(args) {
     if (!args.chat_id) return { success: false, error: 'chat_id is required' };
     if (!args.from_chat_id) return { success: false, error: 'from_chat_id is required' };
     if (!args.message_id) return { success: false, error: 'message_id is required' };
@@ -333,27 +333,27 @@ shadowman.tools.register('telegram_forward_message', function(args) {
     }));
 });
 
-shadowman.tools.register('telegram_get_me', function() {
+shadowman.tools.register('get_me', function() {
     return sanitizeResponse(apiCall('getMe', {}));
 });
 
-shadowman.tools.register('telegram_get_chat', function(args) {
+shadowman.tools.register('get_chat', function(args) {
     if (!args.chat_id) return { success: false, error: 'chat_id is required' };
     return sanitizeResponse(apiCall('getChat', { chat_id: args.chat_id }));
 });
 
-shadowman.tools.register('telegram_set_webhook', function(args) {
+shadowman.tools.register('set_webhook', function(args) {
     if (!args.webhook_url) return { success: false, error: 'webhook_url is required' };
     var params = { url: args.webhook_url, allowed_updates: ['message', 'edited_message', 'callback_query'] };
     if (args.secret_token) params.secret_token = args.secret_token;
     return sanitizeResponse(apiCall('setWebhook', params));
 });
 
-shadowman.tools.register('telegram_delete_webhook', function() {
+shadowman.tools.register('delete_webhook', function() {
     return sanitizeResponse(apiCall('deleteWebhook', {}));
 });
 
-shadowman.tools.register('telegram_get_webhook_info', function() {
+shadowman.tools.register('get_webhook_info', function() {
     return sanitizeResponse(apiCall('getWebhookInfo', {}));
 });
 

+ 13 - 12
manifest.json

@@ -2,7 +2,8 @@
   "id": "telegram",
   "name": "Telegram Bot",
   "description": "Telegram Bot API integration with long polling via background worker. Messages are forwarded to the LLM and replies are sent back automatically.",
-  "version": "3.1.0",
+  "version": "3.2.0",
+  "author": "Ferenc Szontagh & Zoë",
   "runtime": "quickjs",
   "sdkVersion": 1,
   "auto_start": true,
@@ -38,7 +39,7 @@
   ],
   "tools": [
     {
-      "name": "telegram_send_message",
+      "name": "send_message",
       "description": "Send a text message to a Telegram chat",
       "parameters": {
         "type": "object",
@@ -53,7 +54,7 @@
       }
     },
     {
-      "name": "telegram_send_to_owner",
+      "name": "send_to_owner",
       "description": "Send a message to the authorized user (bot owner)",
       "parameters": {
         "type": "object",
@@ -65,7 +66,7 @@
       }
     },
     {
-      "name": "telegram_send_photo",
+      "name": "send_photo",
       "description": "Send a photo to a Telegram chat",
       "parameters": {
         "type": "object",
@@ -79,7 +80,7 @@
       }
     },
     {
-      "name": "telegram_send_document",
+      "name": "send_document",
       "description": "Send a document/file to a Telegram chat",
       "parameters": {
         "type": "object",
@@ -93,7 +94,7 @@
       }
     },
     {
-      "name": "telegram_forward_message",
+      "name": "forward_message",
       "description": "Forward a message from one chat to another",
       "parameters": {
         "type": "object",
@@ -106,12 +107,12 @@
       }
     },
     {
-      "name": "telegram_get_me",
+      "name": "get_me",
       "description": "Get bot information",
       "parameters": { "type": "object", "properties": {} }
     },
     {
-      "name": "telegram_get_chat",
+      "name": "get_chat",
       "description": "Get chat information",
       "parameters": {
         "type": "object",
@@ -122,7 +123,7 @@
       }
     },
     {
-      "name": "telegram_set_webhook",
+      "name": "set_webhook",
       "description": "Set webhook URL for the bot (alternative to polling)",
       "parameters": {
         "type": "object",
@@ -134,12 +135,12 @@
       }
     },
     {
-      "name": "telegram_delete_webhook",
+      "name": "delete_webhook",
       "description": "Delete webhook and switch to polling mode",
       "parameters": { "type": "object", "properties": {} }
     },
     {
-      "name": "telegram_get_webhook_info",
+      "name": "get_webhook_info",
       "description": "Get current webhook configuration",
       "parameters": { "type": "object", "properties": {} }
     }
@@ -149,4 +150,4 @@
     "allowStorage": true,
     "allowFiles": true
   }
-}
+}