Skip to content

Commit fad90e7

Browse files
committed
fix(options): исправлен импорт PluginDetails, реализована многоязычность (i18n) для страницы настроек, обновлены компоненты и добавлены en/ru переводы
1 parent 2087bc9 commit fad90e7

113 files changed

Lines changed: 14235 additions & 39 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

chrome-extension/manifest.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ const packageJson = JSON.parse(readFileSync('./package.json', 'utf8'));
2121
const manifest = {
2222
manifest_version: 3,
2323
default_locale: 'en',
24-
name: '__MSG_extensionName__',
24+
name: 'Agent Plugins Platform',
2525
browser_specific_settings: {
2626
gecko: {
27-
id: 'example@example.com',
27+
id: 'agent-plugins@example.com',
2828
strict_min_version: '109.0',
2929
},
3030
},
3131
version: packageJson.version,
32-
description: '__MSG_extensionDescription__',
32+
description: 'Browser extension for Python plugin execution using Pyodide and MCP protocol',
3333
host_permissions: ['<all_urls>'],
3434
permissions: ['storage', 'scripting', 'tabs', 'notifications', 'sidePanel'],
3535
options_page: 'options/index.html',
@@ -38,7 +38,6 @@ const manifest = {
3838
type: 'module',
3939
},
4040
action: {
41-
default_popup: 'popup/index.html',
4241
default_icon: 'icon-34.png',
4342
},
4443
chrome_url_overrides: {
@@ -72,7 +71,16 @@ const manifest = {
7271
devtools_page: 'devtools/index.html',
7372
web_accessible_resources: [
7473
{
75-
resources: ['*.js', '*.css', '*.svg', 'icon-128.png', 'icon-34.png'],
74+
resources: [
75+
'*.js',
76+
'*.css',
77+
'*.svg',
78+
'icon-128.png',
79+
'icon-34.png',
80+
'plugins/*',
81+
'pyodide/*',
82+
'wheels/*'
83+
],
7684
matches: ['*://*/*'],
7785
},
7886
],
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "Google Helper",
3+
"version": "1.0.0",
4+
"description": "Помощник для работы с Google сервисами",
5+
"author": "APP Team",
6+
"main_server": "mcp_server.py",
7+
"host_permissions": [
8+
"*://*.google.com/*",
9+
"*://*.google.ru/*"
10+
],
11+
"icon": "icon.svg"
12+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Google Helper MCP Server
4+
Помощник для работы с Google сервисами
5+
"""
6+
7+
import sys
8+
import json
9+
import asyncio
10+
from typing import Any, Dict
11+
12+
class GoogleHelper:
13+
def __init__(self):
14+
self.name = "Google Helper"
15+
self.version = "1.0.0"
16+
17+
async def handle_request(self, request: Dict[str, Any]) -> Dict[str, Any]:
18+
"""Обрабатывает входящие запросы"""
19+
method = request.get('method', '')
20+
21+
if method == 'ping':
22+
return await self.ping()
23+
elif method == 'analyze_search':
24+
return await self.analyze_search(request.get('params', {}))
25+
else:
26+
return {
27+
'error': {
28+
'code': -32601,
29+
'message': f'Method {method} not found'
30+
}
31+
}
32+
33+
async def ping(self) -> Dict[str, Any]:
34+
"""Простой ping для проверки работы плагина"""
35+
return {
36+
'result': {
37+
'message': 'Google Helper готов к работе!',
38+
'status': 'ok'
39+
}
40+
}
41+
42+
async def analyze_search(self, params: Dict[str, Any]) -> Dict[str, Any]:
43+
"""Анализирует поисковые результаты"""
44+
query = params.get('query', 'unknown')
45+
46+
# Имитируем анализ
47+
await asyncio.sleep(1.5)
48+
49+
return {
50+
'result': {
51+
'query': query,
52+
'analysis': {
53+
'title': 'Анализ поиска Google',
54+
'summary': f'Анализ результатов для запроса: {query}',
55+
'recommendations': [
56+
'Используйте кавычки для точного поиска',
57+
'Добавьте site: для поиска по конкретному сайту'
58+
]
59+
}
60+
}
61+
}
62+
63+
async def main():
64+
"""Основная функция"""
65+
plugin = GoogleHelper()
66+
67+
# Отправляем приветственное сообщение
68+
welcome = {
69+
'type': 'notification',
70+
'method': 'plugin_ready',
71+
'params': {
72+
'name': plugin.name,
73+
'version': plugin.version,
74+
'message': 'Google Helper готов к работе!'
75+
}
76+
}
77+
78+
sys.stdout.write(json.dumps(welcome) + '\n')
79+
sys.stdout.flush()
80+
81+
# Основной цикл обработки запросов
82+
while True:
83+
try:
84+
line = sys.stdin.readline()
85+
if not line:
86+
break
87+
88+
request = json.loads(line.strip())
89+
response = await plugin.handle_request(request)
90+
91+
# Добавляем ID запроса к ответу
92+
if 'id' in request:
93+
response['id'] = request['id']
94+
95+
sys.stdout.write(json.dumps(response) + '\n')
96+
sys.stdout.flush()
97+
98+
except json.JSONDecodeError as e:
99+
error_response = {
100+
'error': {
101+
'code': -32700,
102+
'message': f'Parse error: {str(e)}'
103+
}
104+
}
105+
if 'id' in request:
106+
error_response['id'] = request['id']
107+
sys.stdout.write(json.dumps(error_response) + '\n')
108+
sys.stdout.flush()
109+
110+
except Exception as e:
111+
error_response = {
112+
'error': {
113+
'code': -32603,
114+
'message': f'Internal error: {str(e)}'
115+
}
116+
}
117+
if 'id' in request:
118+
error_response['id'] = request['id']
119+
sys.stdout.write(json.dumps(error_response) + '\n')
120+
sys.stdout.flush()
121+
122+
if __name__ == '__main__':
123+
asyncio.run(main())
Lines changed: 65 additions & 0 deletions
Loading
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "Ozon Analyzer",
3+
"version": "1.0.0",
4+
"description": "Анализатор товаров Ozon с проверкой соответствия описания и состава",
5+
"author": "APP Team",
6+
"main_server": "mcp_server.py",
7+
"host_permissions": [
8+
"*://*.ozon.ru/*",
9+
"http://localhost/*",
10+
"http://127.0.0.1/*"
11+
],
12+
"icon": "icon.svg",
13+
"permissions": ["activeTab", "scripting"],
14+
"ai_models": {
15+
"basic_analysis": "gemini-flash",
16+
"detailed_comparison": "gemini-pro",
17+
"deep_analysis": "gemini-25",
18+
"scraping_fallback": "gemini-flash"
19+
},
20+
"settings": {
21+
"enable_deep_analysis": true,
22+
"auto_request_deep_analysis": true
23+
}
24+
}

0 commit comments

Comments
 (0)