iwgt 2.4.1 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "2.0",
3
- "generatedAt": "2025-10-07T10:40:08.913Z",
3
+ "generatedAt": "2025-10-07T12:42:07.444Z",
4
4
  "description": "Справочник по библиотеке common.v2.js для InSales - набор готовых скриптов для разработки шаблонов",
5
5
  "installation": {
6
6
  "method": "liquid_tag",
@@ -4,7 +4,7 @@
4
4
  "description": "Liquid фильтры InSales",
5
5
  "totalCategories": 7,
6
6
  "totalFilters": 53,
7
- "generatedAt": "2025-10-07T10:40:08.856Z"
7
+ "generatedAt": "2025-10-07T12:42:07.430Z"
8
8
  },
9
9
  "categories": [
10
10
  {
@@ -4,7 +4,7 @@
4
4
  "description": "Liquid переменные InSales",
5
5
  "totalCategories": 19,
6
6
  "totalVariables": 436,
7
- "generatedAt": "2025-10-07T10:40:06.557Z"
7
+ "generatedAt": "2025-10-07T12:42:07.176Z"
8
8
  },
9
9
  "categories": [
10
10
  {
@@ -68,21 +68,26 @@ const httpServer = createServer(async (req, res) => {
68
68
  // SSE endpoint
69
69
  if (req.url === '/sse' && req.method === 'GET') {
70
70
  console.log('📡 New SSE connection established');
71
- // Настройка SSE заголовков
72
- res.writeHead(200, {
73
- 'Content-Type': 'text/event-stream',
74
- 'Cache-Control': 'no-cache',
75
- 'Connection': 'keep-alive',
76
- });
77
- // Создаем новый MCP сервер для этого соединения
78
- const widgetServer = new WidgetServer();
79
- const transport = new SSEServerTransport('/message', res);
80
- await widgetServer['server'].connect(transport);
81
- // Обработка закрытия соединения
82
- req.on('close', () => {
83
- console.log('📡 SSE connection closed');
84
- transport.close();
85
- });
71
+ try {
72
+ // Создаем новый MCP сервер для этого соединения
73
+ const widgetServer = new WidgetServer();
74
+ const transport = new SSEServerTransport('/message', res);
75
+ // Инициализируем сервер (без stdio транспорта)
76
+ // await widgetServer.run(); // Не вызываем run(), так как он создает stdio транспорт
77
+ // Подключаем транспорт
78
+ await widgetServer['server'].connect(transport);
79
+ console.log('✅ MCP server connected via SSE');
80
+ // Обработка закрытия соединения
81
+ req.on('close', () => {
82
+ console.log('📡 SSE connection closed');
83
+ transport.close();
84
+ });
85
+ }
86
+ catch (error) {
87
+ console.error('❌ Error initializing MCP server:', error);
88
+ res.writeHead(500, { 'Content-Type': 'application/json' });
89
+ res.end(JSON.stringify({ error: 'Failed to initialize MCP server' }));
90
+ }
86
91
  return;
87
92
  }
88
93
  // Message endpoint для отправки сообщений
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iwgt",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
4
4
  "description": "MCP server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,4 +26,4 @@
26
26
  "glob": "^11.0.3",
27
27
  "zod": "^3.23.8"
28
28
  }
29
- }
29
+ }