@thinkingos/vsl-mcp-server 1.3.4 → 1.3.6

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.
package/bin/setup.js CHANGED
@@ -42,7 +42,7 @@ function ok(msg) { log(`${C.green}✅ ${msg}${C.reset}`); }
42
42
  function warn(msg) { log(`${C.yellow}⚠️ ${msg}${C.reset}`); }
43
43
  function fail(msg) { log(`${C.red}❌ ${msg}${C.reset}`); }
44
44
  function info(msg) { log(`${C.blue}ℹ️ ${msg}${C.reset}`); }
45
- function step(n, msg) { log(`\n${C.bold}${C.cyan}Шаг ${n}.${C.reset} ${C.bold}${msg}${C.reset}`); }
45
+ function step(n, msg) { log(`\n${C.bold}${C.cyan}Step ${n}.${C.reset} ${C.bold}${msg}${C.reset}`); }
46
46
 
47
47
  // ─── Readline helpers ─────────────────────────────────────────────────────────
48
48
 
@@ -65,18 +65,18 @@ async function askYesNo(question, defaultAnswer = 'y') {
65
65
  // ─── Step 1: Node.js version check ───────────────────────────────────────────
66
66
 
67
67
  function checkNodeVersion() {
68
- step(1, 'Проверка Node.js');
68
+ step(1, 'Checking Node.js');
69
69
 
70
70
  const major = parseInt(process.versions.node.split('.')[0], 10);
71
71
  const full = process.versions.node;
72
72
 
73
73
  if (major >= 18) {
74
- ok(`Node.js v${full} — подходит (>= 18)`);
74
+ ok(`Node.js v${full} — OK (>= 18)`);
75
75
  return true;
76
76
  } else {
77
- fail(`Node.js v${full} — требуется >= 18`);
78
- log(` Установите Node.js 18+: ${C.dim}https://nodejs.org/${C.reset}`);
79
- log(` Или используйте nvm: ${C.dim}nvm install 18 && nvm use 18${C.reset}`);
77
+ fail(`Node.js v${full} — requires >= 18`);
78
+ log(` Install Node.js 18+: ${C.dim}https://nodejs.org/${C.reset}`);
79
+ log(` Or use nvm: ${C.dim}nvm install 18 && nvm use 18${C.reset}`);
80
80
  return false;
81
81
  }
82
82
  }
@@ -115,42 +115,42 @@ function checkChromiumInstalled() {
115
115
  }
116
116
 
117
117
  async function setupPlaywright() {
118
- step(2, 'Playwright (для браузерных инструментов)');
118
+ step(2, 'Playwright (for browser tools)');
119
119
 
120
120
  // Проверяем, установлен ли playwright как пакет
121
121
  const pwPackageInstalled = checkPlaywrightInstalled();
122
122
 
123
123
  if (!pwPackageInstalled) {
124
- info('Playwright не установлен как пакет');
125
- const installPw = await askYesNo('📦 Установить Playwright?');
124
+ info('Playwright is not installed as a package');
125
+ const installPw = await askYesNo('📦 Install Playwright?');
126
126
  if (!installPw) {
127
- warn('Пропущено. Статические страницы (HTTP-режим) будут работать без Playwright.');
128
- info(`Установить позже: ${C.dim}npm install playwright && npx playwright install chromium${C.reset}`);
127
+ warn('Skipped. Static pages (HTTP mode) will work without Playwright.');
128
+ info(`Install later: ${C.dim}npm install playwright && npx playwright install chromium${C.reset}`);
129
129
  return false;
130
130
  }
131
131
 
132
- log(` ${C.dim}Устанавливаю playwright...${C.reset}`);
132
+ log(` ${C.dim}Installing playwright...${C.reset}`);
133
133
  try {
134
134
  execSync('npm install playwright', { stdio: 'inherit', timeout: 120000 });
135
- ok('Playwright пакет установлен');
135
+ ok('Playwright package installed');
136
136
  } catch (error) {
137
- fail(`Не удалось установить playwright: ${error.message}`);
137
+ fail(`Failed to install playwright: ${error.message}`);
138
138
  return false;
139
139
  }
140
140
  } else {
141
- ok('Playwright пакет уже установлен');
141
+ ok('Playwright package is already installed');
142
142
  }
143
143
 
144
144
  // Проверяем, установлен ли chromium браузер
145
- info('Проверяю браузер chromium...');
145
+ info('Checking chromium browser...');
146
146
  try {
147
147
  // Просто пробуем установить — если уже установлен, playwright скажет "already installed"
148
148
  log(` ${C.dim}npx playwright install chromium...${C.reset}`);
149
149
  execSync('npx playwright install chromium', { stdio: 'inherit', timeout: 180000 });
150
- ok('Chromium готов');
150
+ ok('Chromium is ready');
151
151
  } catch (error) {
152
- warn(`Не удалось установить chromium: ${error.message}`);
153
- info(`Попробуйте вручную: ${C.dim}npx playwright install chromium${C.reset}`);
152
+ warn(`Failed to install chromium: ${error.message}`);
153
+ info(`Try manually: ${C.dim}npx playwright install chromium${C.reset}`);
154
154
  return false;
155
155
  }
156
156
 
@@ -173,7 +173,7 @@ function loadOrCreateConfig(configPath) {
173
173
  try {
174
174
  return JSON.parse(readFileSync(configPath, 'utf-8'));
175
175
  } catch {
176
- warn('Не удалось прочитать существующий config.json, создаю новый');
176
+ warn('Failed to read existing config.json, creating a new one');
177
177
  }
178
178
  }
179
179
  return {};
@@ -186,7 +186,7 @@ function saveConfig(configPath, config) {
186
186
  // ─── Step 6: Output agent instructions ───────────────────────────────────────
187
187
 
188
188
  function printAgentInstructions(visionConfig) {
189
- step(6, 'Подключение к агенту');
189
+ step(6, 'Connecting to your agent');
190
190
 
191
191
  const mcpServerPath = join(process.cwd(), 'dist', 'index.js');
192
192
  const hasLocalDist = existsSync(mcpServerPath);
@@ -218,10 +218,10 @@ function printAgentInstructions(visionConfig) {
218
218
 
219
219
  log('');
220
220
  log(`${C.bold}═══════════════════════════════════════════════════════════${C.reset}`);
221
- log(`${C.bold} Настройка MCP-сервера в вашем агенте${C.reset}`);
221
+ log(`${C.bold} Configure MCP server in your agent${C.reset}`);
222
222
  log(`${C.bold}═══════════════════════════════════════════════════════════${C.reset}`);
223
223
  log('');
224
- log(`${C.bold}Local (stdio) конфигурация:${C.reset}`);
224
+ log(`${C.bold}Local (stdio) configuration:${C.reset}`);
225
225
  log('');
226
226
  log(` ${C.bold}Server Name:${C.reset} vsl`);
227
227
 
@@ -242,7 +242,7 @@ function printAgentInstructions(visionConfig) {
242
242
  }
243
243
 
244
244
  log('');
245
- log(`${C.dim}── Или JSON-конфиг ──${C.reset}`);
245
+ log(`${C.dim}── Or JSON config ──${C.reset}`);
246
246
  log('');
247
247
 
248
248
  const jsonConfig = {
@@ -259,14 +259,14 @@ function printAgentInstructions(visionConfig) {
259
259
  log(` ${C.dim}${JSON.stringify(jsonConfig, null, 2).split('\n').join('\n ')}${C.reset}`);
260
260
 
261
261
  log('');
262
- log(`${C.dim}── Куда вставить ──${C.reset}`);
262
+ log(`${C.dim}── Where to paste ──${C.reset}`);
263
263
  log('');
264
264
  log(` ${C.bold}Cline:${C.reset} VS Code → Settings → Cline → MCP Servers → Add Server`);
265
265
  log(` ${C.bold}Claude Desktop:${C.reset} ~/Library/Application Support/Claude/claude_desktop_config.json`);
266
266
  log(` ${C.bold}TaoCoder:${C.reset} .taocoder/mcp.json`);
267
267
  log(` ${C.bold}Cursor:${C.reset} .cursor/mcp.json`);
268
268
  log('');
269
- log(`${C.dim}💡 Если вы настроили vision через ~/.vsl/config.json, env vars можно не указывать.${C.reset}`);
269
+ log(`${C.dim}💡 If you configured vision via ~/.vsl/config.json, you don\'t need to specify env vars.${C.reset}`);
270
270
  log('');
271
271
  }
272
272
 
@@ -274,13 +274,13 @@ function printAgentInstructions(visionConfig) {
274
274
 
275
275
  async function main() {
276
276
  log('');
277
- log(`${C.bold}🚀 VSL MCP Server — установка${C.reset}`);
277
+ log(`${C.bold}🚀 VSL MCP Server — Setup${C.reset}`);
278
278
  log('');
279
- log('Этот скрипт поможет вам:');
280
- log(' 1. Проверить Node.js');
281
- log(' 2. Установить Playwright (для браузерных инструментов)');
282
- log(' 3. Сохранить конфигурацию');
283
- log(' 4. Получить инструкции для подключения к агенту');
279
+ log('This script will help you:');
280
+ log(' 1. Check Node.js');
281
+ log(' 2. Install Playwright (for browser tools)');
282
+ log(' 3. Save configuration');
283
+ log(' 4. Get instructions for connecting to your agent');
284
284
  log('');
285
285
 
286
286
  // Шаг 1: Node.js
@@ -292,23 +292,23 @@ async function main() {
292
292
  await setupPlaywright();
293
293
 
294
294
  // Шаг 3: Сохранение конфига
295
- step(3, 'Сохранение конфигурации');
295
+ step(3, 'Saving configuration');
296
296
 
297
297
  const configPath = join(ensureConfigDir(), 'config.json');
298
298
  const config = loadOrCreateConfig(configPath);
299
299
  saveConfig(configPath, config);
300
- ok(`Конфигурация сохранена: ${configPath}`);
300
+ ok(`Configuration saved: ${configPath}`);
301
301
 
302
302
  // Шаг 4: Инструкции
303
303
  printAgentInstructions(null);
304
304
 
305
305
  // Финал
306
- log(`${C.bold}✨ Готово!${C.reset}`);
306
+ log(`${C.bold}✨ Done!${C.reset}`);
307
307
  log('');
308
- log('Далее:');
309
- log(` 1. Добавьте MCP-сервер в ваш агент (инструкции выше)`);
310
- log(` 2. Перезапустите агент`);
311
- log(` 3. Используйте инструменты: vsl_read_page, vsl_get_snapshot, vsl_execute_action, ...`);
308
+ log('Next steps:');
309
+ log(` 1. Add the MCP server to your agent (instructions above)`);
310
+ log(` 2. Restart your agent`);
311
+ log(` 3. Use tools: vsl_read_page, vsl_get_snapshot, vsl_execute_action, ...`);
312
312
  log('');
313
313
 
314
314
  rl.close();
@@ -316,7 +316,7 @@ async function main() {
316
316
 
317
317
  // Запуск
318
318
  main().catch((error) => {
319
- fail(`Ошибка: ${error.message}`);
319
+ fail(`Error: ${error.message}`);
320
320
  rl.close();
321
321
  process.exit(1);
322
322
  });
package/dist/index.js CHANGED
@@ -3865,10 +3865,84 @@ async function handleExecuteAction(args, browser, session, sessionId) {
3865
3865
  const selector = `[data-vsl-id="${localId}"], #${localId}, .${localId}`;
3866
3866
  page = await browser.getPage(sessionId);
3867
3867
  const target = targetFrame || page;
3868
+ const actionsRequiringElement = ["click", "fill", "type", "check", "uncheck", "upload", "select", "hover", "focus", "blur", "clear"];
3869
+ if (actionsRequiringElement.includes(args.action)) {
3870
+ try {
3871
+ const expectedTag = resolvedId.match(/^([a-z][a-z0-9]*(?:_[a-z][a-z0-9]*)*)_/)?.[1] || "";
3872
+ const elementValidation = await target.evaluate(({ sel, expectedTag: expectedTag2 }) => {
3873
+ const el = document.querySelector(sel);
3874
+ if (!el) return { exists: false, valid: false, actualTag: "" };
3875
+ const actualTag = el.tagName.toLowerCase();
3876
+ return { exists: true, valid: actualTag === expectedTag2, actualTag };
3877
+ }, { sel: selector, expectedTag });
3878
+ if (!elementValidation.exists) {
3879
+ const extraction = await extractDomTree(browser, sessionId);
3880
+ const input = {
3881
+ viewport: extraction.viewport,
3882
+ url: snapshotUrl || "",
3883
+ title: "",
3884
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3885
+ scroll: extraction.scroll
3886
+ };
3887
+ session.snapshotFromElements(extraction.elements, input);
3888
+ await injectVslIdsIntoDom(browser, extraction.elements, /* @__PURE__ */ new Map(), sessionId);
3889
+ const revalidation = await target.evaluate(({ sel, expectedTag: expectedTag2 }) => {
3890
+ const el = document.querySelector(sel);
3891
+ if (!el) return { exists: false, valid: false, actualTag: "" };
3892
+ const actualTag = el.tagName.toLowerCase();
3893
+ return { exists: true, valid: actualTag === expectedTag2, actualTag };
3894
+ }, { sel: selector, expectedTag });
3895
+ if (!revalidation.exists) {
3896
+ return {
3897
+ status: "error",
3898
+ error: `Element not found after re-injection: ${args.target_id} (selector: ${selector})`
3899
+ };
3900
+ }
3901
+ if (!revalidation.valid) {
3902
+ return {
3903
+ status: "error",
3904
+ error: `Tag mismatch after re-injection: expected ${expectedTag}, got ${revalidation.actualTag} for ${args.target_id}`
3905
+ };
3906
+ }
3907
+ } else if (!elementValidation.valid) {
3908
+ const extraction = await extractDomTree(browser, sessionId);
3909
+ const input = {
3910
+ viewport: extraction.viewport,
3911
+ url: snapshotUrl || "",
3912
+ title: "",
3913
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3914
+ scroll: extraction.scroll
3915
+ };
3916
+ session.snapshotFromElements(extraction.elements, input);
3917
+ await injectVslIdsIntoDom(browser, extraction.elements, /* @__PURE__ */ new Map(), sessionId);
3918
+ const revalidation = await target.evaluate(({ sel, expectedTag: expectedTag2 }) => {
3919
+ const el = document.querySelector(sel);
3920
+ if (!el) return { exists: false, valid: false, actualTag: "" };
3921
+ const actualTag = el.tagName.toLowerCase();
3922
+ return { exists: true, valid: actualTag === expectedTag2, actualTag };
3923
+ }, { sel: selector, expectedTag });
3924
+ if (!revalidation.valid) {
3925
+ return {
3926
+ status: "error",
3927
+ error: `Tag mismatch after re-injection: expected ${expectedTag}, got ${revalidation.actualTag} for ${args.target_id}`
3928
+ };
3929
+ }
3930
+ }
3931
+ } catch (validationError) {
3932
+ console.warn(`[VSL] Element validation skipped (target.evaluate not available): ${validationError}`);
3933
+ }
3934
+ }
3868
3935
  switch (args.action) {
3869
3936
  case "click": {
3870
3937
  try {
3871
- await target.locator(selector).click({ timeout: 5e3 });
3938
+ const clickElementCount = await target.locator(selector).count();
3939
+ if (clickElementCount === 0) {
3940
+ return {
3941
+ status: "error",
3942
+ error: `Element not found for click: ${args.target_id} (selector: ${selector})`
3943
+ };
3944
+ }
3945
+ await target.locator(selector).click({ timeout: 1e3 });
3872
3946
  } catch (locatorError) {
3873
3947
  let findObjectById2 = function(objects, targetId) {
3874
3948
  for (const obj of objects) {
@@ -3921,7 +3995,14 @@ async function handleExecuteAction(args, browser, session, sessionId) {
3921
3995
  error: "value is required for type action"
3922
3996
  };
3923
3997
  }
3924
- await target.locator(selector).fill(args.value, { timeout: 5e3 });
3998
+ const fillElementCount = await target.locator(selector).count();
3999
+ if (fillElementCount === 0) {
4000
+ return {
4001
+ status: "error",
4002
+ error: `Element not found for fill: ${args.target_id} (selector: ${selector})`
4003
+ };
4004
+ }
4005
+ await target.locator(selector).fill(args.value, { timeout: 1e3 });
3925
4006
  break;
3926
4007
  case "scroll": {
3927
4008
  const DEFAULT_SCROLL_AMOUNT = 500;
@@ -4150,7 +4231,14 @@ async function handleExecuteAction(args, browser, session, sessionId) {
4150
4231
  error: "value must contain at least one file path"
4151
4232
  };
4152
4233
  }
4153
- await target.locator(selector).setInputFiles(filePaths.length === 1 ? filePaths[0] : filePaths);
4234
+ const uploadElementCount = await target.locator(selector).count();
4235
+ if (uploadElementCount === 0) {
4236
+ return {
4237
+ status: "error",
4238
+ error: `Element not found for upload: ${args.target_id} (selector: ${selector})`
4239
+ };
4240
+ }
4241
+ await target.locator(selector).setInputFiles(filePaths.length === 1 ? filePaths[0] : filePaths, { timeout: 1e3 });
4154
4242
  const result2 = {
4155
4243
  status: "success",
4156
4244
  data: {
@@ -4444,6 +4532,16 @@ async function handleExecuteAction(args, browser, session, sessionId) {
4444
4532
  await page.reload({ timeout: args.timeout || 5e3 });
4445
4533
  break;
4446
4534
  }
4535
+ case "check":
4536
+ case "uncheck": {
4537
+ const shouldBeChecked = args.action === "check";
4538
+ if (shouldBeChecked) {
4539
+ await target.locator(selector).check({ timeout: 1e3 });
4540
+ } else {
4541
+ await target.locator(selector).uncheck({ timeout: 1e3 });
4542
+ }
4543
+ break;
4544
+ }
4447
4545
  default:
4448
4546
  return {
4449
4547
  status: "error",
@@ -5420,59 +5518,59 @@ async function handleClickCoordinates(args, browser, session, sessionId) {
5420
5518
  var VSL_TOOLS = [
5421
5519
  {
5422
5520
  name: "vsl_get_snapshot",
5423
- description: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0438\u0439 VSL snapshot \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B. \u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 VSL JSON \u0441 \u0441\u0435\u043C\u0430\u043D\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u043E\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432. VSL (Visual Scene Language) \u2014 \u044D\u0442\u043E JSON-\u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B, \u0433\u0434\u0435 \u043A\u0430\u0436\u0434\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0438\u043C\u0435\u0435\u0442: id (\u0443\u043D\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 btn_123), type (button/input/link/text/image), text (\u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435), bbox ([x,y,width,height]), children (\u0432\u043B\u043E\u0436\u0435\u043D\u043D\u044B\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B). \u041F\u0440\u0438\u043C\u0435\u0440: { viewport:{width:1920,height:1080}, objects:[{id:btn_1,type:button,text:\u0412\u043E\u0439\u0442\u0438,bbox:[100,200,80,30]},{id:inp_2,type:input,text:,bbox:[100,250,200,30]}] }. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435: \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u0435 snapshot, \u043D\u0430\u0439\u0434\u0438\u0442\u0435 \u043D\u0443\u0436\u043D\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043F\u043E id, \u0437\u0430\u0442\u0435\u043C \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 vsl_execute_action \u0434\u043B\u044F \u0432\u0437\u0430\u0438\u043C\u043E\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F. Lazy text loading (DEC-026): \u0442\u0435\u043A\u0441\u0442\u044B \u0434\u043B\u0438\u043D\u043D\u0435\u0435 200 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0437\u0430\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F \u043D\u0430 txt_preview (\u043F\u0435\u0440\u0432\u044B\u0435 ~50 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432) + txt_ref (\u0441\u0441\u044B\u043B\u043A\u0430 \u0432\u0438\u0434\u0430 tb_001). \u041F\u043E\u043B\u043D\u044B\u0435 \u0442\u0435\u043A\u0441\u0442\u044B \u0445\u0440\u0430\u043D\u044F\u0442\u0441\u044F \u0432 text_blocks map. \u0414\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 vsl_get_text_block. \u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B: detail_level (low/medium/high) \u0434\u043B\u044F \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u0438 \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432, ttl (\u043C\u0441) \u0434\u043B\u044F \u043A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",
5521
+ description: "Get the current VSL snapshot of the page. Returns a VSL JSON with the semantic structure of elements. VSL (Visual Scene Language) is a JSON representation of the page where each element has: id (unique identifier, e.g. btn_123), type (button/input/link/text/image), text (text content), bbox ([x,y,width,height]), children (nested elements). Example: { viewport:{width:1920,height:1080}, objects:[{id:btn_1,type:button,text:Sign in,bbox:[100,200,80,30]},{id:inp_2,type:input,text:,bbox:[100,250,200,30]}] }. Usage: get the snapshot, find the desired element by id, then use vsl_execute_action to interact. Lazy text loading (DEC-026): texts longer than 200 characters are automatically replaced with txt_preview (first ~50 characters) + txt_ref (reference like tb_001). Full texts are stored in the text_blocks map. Use vsl_get_text_block to retrieve the full text. Parameters: detail_level (low/medium/high) for object filtering, ttl (ms) for caching.",
5424
5522
  inputSchema: {
5425
5523
  type: "object",
5426
5524
  properties: {
5427
5525
  url: {
5428
5526
  type: "string",
5429
- description: "URL \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B (\u043E\u043F\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u043E, \u0435\u0441\u043B\u0438 \u043D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D \u2014 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u0442\u0435\u043A\u0443\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430)"
5527
+ description: "Page URL (optional, if not specified \u2014 uses the current page)"
5430
5528
  },
5431
5529
  detail_level: {
5432
5530
  type: "string",
5433
5531
  enum: ["low", "medium", "high"],
5434
- description: "\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0434\u0435\u0442\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 snapshot. 'low': \u0442\u043E\u043B\u044C\u043A\u043E \u0438\u043D\u0442\u0435\u0440\u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B (\u043A\u043D\u043E\u043F\u043A\u0438, \u0441\u0441\u044B\u043B\u043A\u0438, \u0438\u043D\u043F\u0443\u0442\u044B). 'medium': \u0438\u043D\u0442\u0435\u0440\u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 + \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440\u044B (default). 'high': \u0432\u0441\u0435 \u043E\u0431\u044A\u0435\u043A\u0442\u044B (\u043F\u043E\u043B\u043D\u044B\u0439 DOM). Default: 'medium'."
5532
+ description: "Snapshot detail level. 'low': interactive elements only (buttons, links, inputs). 'medium': interactive + containers (default). 'high': all objects (full DOM). Default: 'medium'."
5435
5533
  },
5436
5534
  ttl: {
5437
5535
  type: "number",
5438
- description: "TTL \u043A\u044D\u0448\u0430 \u0432 \u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430\u0445 (default: 5000 = 5s). \u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 0 \u0434\u043B\u044F \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u043A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F."
5536
+ description: "Cache TTL in milliseconds (default: 5000 = 5s). Set to 0 to disable caching."
5439
5537
  },
5440
5538
  full: {
5441
5539
  type: "boolean",
5442
- description: "\u041F\u043E\u043B\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C: \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0435\u0441\u044C \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0431\u0435\u0437 \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432 (\u0437\u0430\u043C\u0435\u043D\u0430 \u0443\u0434\u0430\u043B\u0451\u043D\u043D\u043E\u0433\u043E \u0442\u0443\u043B\u0430 \u043F\u043E\u043B\u043D\u043E\u0433\u043E \u0441\u043D\u0430\u043F\u0448\u043E\u0442\u0430)"
5540
+ description: "Full mode: returns the entire document without filters (replacement for the removed full snapshot tool)"
5443
5541
  }
5444
5542
  }
5445
5543
  }
5446
5544
  },
5447
5545
  {
5448
5546
  name: "vsl_execute_action",
5449
- description: '\u0412\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0430\u0434 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u043C VSL. \u041D\u0430\u0439\u0434\u0438\u0442\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043F\u043E id \u0432 snapshot (vsl_get_snapshot), \u0437\u0430\u0442\u0435\u043C \u0432\u044B\u0437\u043E\u0432\u0438\u0442\u0435 \u044D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u044B\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F: click (\u043A\u043B\u0438\u043A \u043F\u043E \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0443), type (\u0432\u0432\u043E\u0434 \u0442\u0435\u043A\u0441\u0442\u0430, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 value), fill (\u0430\u043B\u0438\u0430\u0441 type, \u0432\u0432\u043E\u0434 \u0442\u0435\u043A\u0441\u0442\u0430, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 value), scroll (\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0430, \u0444\u043E\u0440\u043C\u0430\u0442: "up", "down", "left", "right" \u0438\u043B\u0438 "dir:amount", \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 "down:300"), select (\u0432\u044B\u0431\u043E\u0440 \u043E\u043F\u0446\u0438\u0438, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 value), hover, focus, blur, check, uncheck, press (\u043D\u0430\u0436\u0430\u0442\u0438\u0435 \u043A\u043B\u0430\u0432\u0438\u0448\u0438 \u043D\u0430 \u043A\u043B\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 value \u2014 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 "Enter", "Tab", "Escape", "ArrowDown", "ArrowUp", "Space", "Backspace". \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u0434\u043B\u044F \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0438 \u0444\u043E\u0440\u043C \u0447\u0435\u0440\u0435\u0437 Enter, \u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 Tab, \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u044F \u043C\u043E\u0434\u0430\u043B\u043E\u043A \u0447\u0435\u0440\u0435\u0437 Escape \u0438 \u0442.\u0434.), upload (\u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0444\u0430\u0439\u043B\u0430, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 value \u2014 \u043F\u0443\u0442\u044C \u043A \u0444\u0430\u0439\u043B\u0443 \u0438\u043B\u0438 \u0441\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0442\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043F\u044F\u0442\u0443\u044E). \u041F\u0440\u0438\u043C\u0435\u0440: {action:click, target_id:btn_1} \u0438\u043B\u0438 {action:type, target_id:inp_2, value:hello@mail.com} \u0438\u043B\u0438 {action:fill, target_id:inp_2, value:hello@mail.com} \u0438\u043B\u0438 {action:press, target_id:inp_1, value:Enter} \u0438\u043B\u0438 {action:upload, target_id:file_input_0, value:/path/to/file.pdf}. \u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 return_state=true \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 diff \u0438 snapshot \u043F\u043E\u0441\u043B\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F.',
5547
+ description: 'Execute an action on a VSL element. Find the element by id in the snapshot (vsl_get_snapshot), then call this action. Supported actions: click (click on element), type (enter text, requires value), fill (alias for type, enter text, requires value), scroll (scroll, format: "up", "down", "left", "right" or "dir:amount", e.g. "down:300"), select (select option, requires value), hover, focus, blur, check, uncheck, press (press a keyboard key, requires value \u2014 key name, e.g. "Enter", "Tab", "Escape", "ArrowDown", "ArrowUp", "Space", "Backspace". Used for submitting forms via Enter, navigating via Tab, closing modals via Escape, etc.), upload (file upload, requires value \u2014 file path or comma-separated list of paths). Example: {action:click, target_id:btn_1} or {action:type, target_id:inp_2, value:hello@mail.com} or {action:fill, target_id:inp_2, value:hello@mail.com} or {action:press, target_id:inp_1, value:Enter} or {action:upload, target_id:file_input_0, value:/path/to/file.pdf}. Parameter return_state=true returns diff and snapshot after the action.',
5450
5548
  inputSchema: {
5451
5549
  type: "object",
5452
5550
  properties: {
5453
5551
  action: {
5454
5552
  type: "string",
5455
- description: "\u0418\u043C\u044F \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F (click, type, fill, scroll, select, \u0438 \u0434\u0440.)"
5553
+ description: "Action name (click, type, fill, scroll, select, etc.)"
5456
5554
  },
5457
5555
  target_id: {
5458
5556
  type: "string",
5459
- description: "ID \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430-\u0446\u0435\u043B\u0438 \u0432 VSL JSON"
5557
+ description: "Target element ID in VSL JSON"
5460
5558
  },
5461
5559
  value: {
5462
5560
  type: "string",
5463
- description: "\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043B\u044F \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0442\u0435\u043A\u0441\u0442 \u0434\u043B\u044F type/fill, \u043E\u043F\u0446\u0438\u044F \u0434\u043B\u044F select)"
5561
+ description: "Value for the action (e.g. text for type/fill, option for select)"
5464
5562
  },
5465
5563
  return_state: {
5466
5564
  type: "boolean",
5467
- description: "\u0415\u0441\u043B\u0438 true, \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 diff \u0438 snapshot \u043F\u043E\u0441\u043B\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F. \u041F\u043E\u043B\u0435\u0437\u043D\u043E \u0434\u043B\u044F \u043E\u0442\u0441\u043B\u0435\u0436\u0438\u0432\u0430\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439 DOM \u0431\u0435\u0437 \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u0432\u044B\u0437\u043E\u0432\u0430 vsl_get_diff. Default: true \u2014 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043B\u044F \u044D\u043A\u043E\u043D\u043E\u043C\u0438\u0438 \u0445\u043E\u0434\u043E\u0432 \u0430\u0433\u0435\u043D\u0442\u0430. \u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 false \u0434\u043B\u044F \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F."
5565
+ description: "If true, returns diff and snapshot after the action. Useful for tracking DOM changes without an additional vsl_get_diff call. Default: true \u2014 always return state to save agent steps. Set to false to disable."
5468
5566
  },
5469
5567
  timeout: {
5470
5568
  type: "number",
5471
- description: "\u0422\u0430\u0439\u043C\u0430\u0443\u0442 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F \u0432 \u043C\u0441 (\u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F download)"
5569
+ description: "Download completion timeout in ms (only for download action)"
5472
5570
  },
5473
5571
  save_path: {
5474
5572
  type: "string",
5475
- description: "\u041F\u0443\u0442\u044C \u0434\u043B\u044F \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F \u0441\u043A\u0430\u0447\u0430\u043D\u043D\u043E\u0433\u043E \u0444\u0430\u0439\u043B\u0430 (\u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F download)"
5573
+ description: "Path to save the downloaded file (only for download action)"
5476
5574
  }
5477
5575
  },
5478
5576
  required: ["action", "target_id"]
@@ -5480,13 +5578,13 @@ var VSL_TOOLS = [
5480
5578
  },
5481
5579
  {
5482
5580
  name: "vsl_navigate",
5483
- description: '\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043F\u043E URL \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u0434\u043B\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u043D\u043E\u0432\u043E\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u0435\u0440\u0435\u0434 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435\u043C snapshot. \u041F\u0440\u0438\u043C\u0435\u0440: {url:"https://example.com"}. \u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 {status:"success"} \u0438\u043B\u0438 {status:"error", message:"..."}. \u041F\u043E\u0441\u043B\u0435 \u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0432\u044B\u0437\u043E\u0432\u0438\u0442\u0435 vsl_get_snapshot \u0434\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u044B \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.',
5581
+ description: 'Navigate to a URL in the browser. Use this to open a new page before getting a snapshot. Example: {url:"https://example.com"}. Returns {status:"success"} or {status:"error", message:"..."}. After navigation, call vsl_get_snapshot to get the page structure.',
5484
5582
  inputSchema: {
5485
5583
  type: "object",
5486
5584
  properties: {
5487
5585
  url: {
5488
5586
  type: "string",
5489
- description: "URL \u0434\u043B\u044F \u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438"
5587
+ description: "URL to navigate to"
5490
5588
  }
5491
5589
  },
5492
5590
  required: ["url"]
@@ -5494,7 +5592,7 @@ var VSL_TOOLS = [
5494
5592
  },
5495
5593
  {
5496
5594
  name: "vsl_clear_cache",
5497
- description: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043A\u044D\u0448 VSL snapshot. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043A\u043E\u0433\u0434\u0430 \u043D\u0443\u0436\u043D\u043E \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0441\u0432\u0435\u0436\u0438\u0439 snapshot \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0441 \u043D\u0443\u043B\u044F (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u043F\u043E\u0441\u043B\u0435 \u0437\u043D\u0430\u0447\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0445 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435 \u0438\u043B\u0438 \u043F\u0440\u0438 \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0435 \u043D\u0430 \u0434\u0440\u0443\u0433\u043E\u0439 \u0441\u0430\u0439\u0442). \u041F\u0440\u0438\u043C\u0435\u0440: {}. \u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0432\u044B\u0437\u043E\u0432 vsl_get_snapshot \u0441\u043E\u0437\u0434\u0430\u0441\u0442 \u043D\u043E\u0432\u044B\u0439 snapshot.",
5595
+ description: "Clear the VSL snapshot cache. Use when you need a fresh snapshot from scratch (e.g. after significant page changes or when switching to a different site). Example: {}. The next vsl_get_snapshot call will create a new snapshot.",
5498
5596
  inputSchema: {
5499
5597
  type: "object",
5500
5598
  properties: {}
@@ -5502,17 +5600,17 @@ var VSL_TOOLS = [
5502
5600
  },
5503
5601
  {
5504
5602
  name: "vsl_get_visual",
5505
- description: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C visual fragment (\u0441\u043A\u0440\u0438\u043D\u0448\u043E\u0442) \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64 WebP. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u0434\u043B\u044F \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0441\u043B\u043E\u0436\u043D\u043E \u043A\u043B\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E \u0442\u0435\u043A\u0441\u0442\u0443 (\u0438\u043A\u043E\u043D\u043A\u0438, \u0433\u0440\u0430\u0444\u0438\u043A\u0438, \u043A\u0430\u0441\u0442\u043E\u043C\u043D\u044B\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044B). \u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 {mediaType:image/webp, data:base64data}. \u041F\u0440\u0438\u043C\u0435\u0440: {element_id: img_5}. \u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 auto_refresh=true \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u044F\u0435\u0442 snapshot \u043F\u0435\u0440\u0435\u0434 \u043F\u043E\u0438\u0441\u043A\u043E\u043C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430. \u0412\u0410\u0416\u041D\u041E: \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E \u0441 ID \u0438\u0437 vsl_get_snapshot (browser DOM). \u041D\u0415 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u0441 ID \u0438\u0437 vsl_read_page (semantic IDs) \u2014 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 vsl_get_snapshot \u0434\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u044B\u0445 ID.",
5603
+ description: "Get a visual fragment (screenshot) of an element in base64 WebP format. Use for elements that are hard to classify by text alone (icons, charts, custom widgets). Returns {mediaType:image/webp, data:base64data}. Example: {element_id: img_5}. Parameter auto_refresh=true automatically refreshes the snapshot before searching for the element. IMPORTANT: works only with IDs from vsl_get_snapshot (browser DOM). Does NOT work with IDs from vsl_read_page (semantic IDs) \u2014 use vsl_get_snapshot to get compatible IDs.",
5506
5604
  inputSchema: {
5507
5605
  type: "object",
5508
5606
  properties: {
5509
5607
  element_id: {
5510
5608
  type: "string",
5511
- description: "ID \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0432 VSL JSON"
5609
+ description: "Element ID in VSL JSON"
5512
5610
  },
5513
5611
  auto_refresh: {
5514
5612
  type: "boolean",
5515
- description: "\u0415\u0441\u043B\u0438 true, \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u044F\u0435\u0442 snapshot \u043F\u0435\u0440\u0435\u0434 \u043F\u043E\u0438\u0441\u043A\u043E\u043C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430. \u041F\u043E\u043B\u0435\u0437\u043D\u043E \u043F\u043E\u0441\u043B\u0435 \u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0438\u0437\u043C\u0435\u043D\u044F\u044E\u0442 DOM. Default: false."
5613
+ description: "If true, automatically refreshes the snapshot before searching for the element. Useful after navigation or actions that modify the DOM. Default: false."
5516
5614
  }
5517
5615
  },
5518
5616
  required: ["element_id"]
@@ -5520,17 +5618,17 @@ var VSL_TOOLS = [
5520
5618
  },
5521
5619
  {
5522
5620
  name: "vsl_read_page",
5523
- description: '\u0427\u0442\u0435\u043D\u0438\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043D\u0438\u0446. \u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044E: \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u0447\u0435\u0440\u0435\u0437 HTTP (\u0431\u044B\u0441\u0442\u0440\u043E), SPA \u0440\u0435\u043D\u0434\u0435\u0440\u044F\u0442\u0441\u044F \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440. readable=true \u0444\u0438\u043B\u044C\u0442\u0440\u0443\u0435\u0442 \u0448\u0443\u043C (\u043D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044F, \u0444\u0443\u0442\u0435\u0440\u044B, cookie-\u0431\u0430\u043D\u043D\u0435\u0440\u044B) \u0434\u043B\u044F \u0447\u0438\u0441\u0442\u043E\u0433\u043E \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0430. \u041F\u0440\u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u044B\u0445 \u0432\u044B\u0437\u043E\u0432\u0430\u0445 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 diff (\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F), \u0430 \u043D\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442. \u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 detail_level (low/medium/high) \u0444\u0438\u043B\u044C\u0442\u0440\u0443\u0435\u0442 \u043E\u0431\u044A\u0435\u043A\u0442\u044B \u0432 snapshot: low \u2014 \u0442\u043E\u043B\u044C\u043A\u043E \u0438\u043D\u0442\u0435\u0440\u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B (\u043A\u043D\u043E\u043F\u043A\u0438, \u0441\u0441\u044B\u043B\u043A\u0438, \u0438\u043D\u043F\u0443\u0442\u044B), medium \u2014 \u0438\u043D\u0442\u0435\u0440\u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 + \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440\u044B (\u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E), high \u2014 \u0432\u0441\u0435 \u043E\u0431\u044A\u0435\u043A\u0442\u044B. \u0412 metadata \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044F vsl_estimated_tokens \u2014 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u043A\u0435\u043D\u043E\u0432 \u0432 VSL snapshot \u0434\u043B\u044F \u043E\u0446\u0435\u043D\u043A\u0438 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430. \u041F\u0440\u0438\u043C\u0435\u0440: {url:"https://example.com", readable:true, detail_level:"medium"}. \u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 snapshot \u0438 diff \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438.',
5621
+ description: 'Read web pages. Automatically determines the strategy: static pages are read via HTTP (fast), SPAs are rendered via browser. readable=true filters noise (navigation, footers, cookie banners) for clean content. On repeated calls, returns diff (changes) instead of full content. Parameter detail_level (low/medium/high) filters objects in the snapshot: low \u2014 interactive elements only (buttons, links, inputs), medium \u2014 interactive + containers (default), high \u2014 all objects. Metadata includes vsl_estimated_tokens \u2014 the number of tokens in the VSL snapshot for context estimation. Example: {url:"https://example.com", readable:true, detail_level:"medium"}. Returns snapshot and diff automatically.',
5524
5622
  inputSchema: {
5525
5623
  type: "object",
5526
5624
  properties: {
5527
5625
  url: {
5528
5626
  type: "string",
5529
- description: "URL \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F"
5627
+ description: "Page URL to read"
5530
5628
  },
5531
5629
  readable: {
5532
5630
  type: "boolean",
5533
- description: "Readable-\u0440\u0435\u0436\u0438\u043C: \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u0448\u0443\u043C\u0430 (nav, footer, cookie banners) \u0434\u043B\u044F \u0447\u0438\u0441\u0442\u043E\u0433\u043E \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0430"
5631
+ description: "Readable mode: filter noise (nav, footer, cookie banners) for clean content"
5534
5632
  }
5535
5633
  },
5536
5634
  required: ["url"]
@@ -5538,13 +5636,13 @@ var VSL_TOOLS = [
5538
5636
  },
5539
5637
  {
5540
5638
  name: "vsl_get_text_block",
5541
- description: '\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043F\u043E\u043B\u043D\u044B\u0439 \u0442\u0435\u043A\u0441\u0442 \u043F\u043E txt_ref \u0438\u0437 lazy text loading (M1.7). \u041A\u043E\u0433\u0434\u0430 \u0442\u0435\u043A\u0441\u0442 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 > 200 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432, \u0432 VSL JSON \u0445\u0440\u0430\u043D\u0438\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E txt_preview (\u043F\u0435\u0440\u0432\u044B\u0435 ~50 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432) \u0438 txt_ref (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, tb_001). \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u044D\u0442\u043E\u0442 tool \u0434\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430. \u041F\u0440\u0438\u043C\u0435\u0440: {block_id: "tb_001"}. \u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 {block_id, text} \u0441 \u043F\u043E\u043B\u043D\u044B\u043C \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u044B\u043C.',
5639
+ description: `Get the full text by txt_ref from lazy text loading (M1.7). When an element's text exceeds 200 characters, only txt_preview (first ~50 characters) and txt_ref (e.g. tb_001) are stored in the VSL JSON. Use this tool to retrieve the full text. Example: {block_id: "tb_001"}. Returns {block_id, text} with the full content.`,
5542
5640
  inputSchema: {
5543
5641
  type: "object",
5544
5642
  properties: {
5545
5643
  block_id: {
5546
5644
  type: "string",
5547
- description: "ID \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E \u0431\u043B\u043E\u043A\u0430 \u0438\u0437 txt_ref \u043F\u043E\u043B\u044F VSL \u043E\u0431\u044A\u0435\u043A\u0442\u0430 (\u0444\u043E\u0440\u043C\u0430\u0442 tb_xxx)"
5645
+ description: "Text block ID from the txt_ref field of a VSL object (format: tb_xxx)"
5548
5646
  }
5549
5647
  },
5550
5648
  required: ["block_id"]
@@ -5552,30 +5650,30 @@ var VSL_TOOLS = [
5552
5650
  },
5553
5651
  {
5554
5652
  name: "vsl_click_coordinates",
5555
- description: '\u0412\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043C\u043D\u043E\u0436\u0435\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0435 \u043A\u043B\u0438\u043A\u0438 \u043F\u043E \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430\u043C \u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0446\u0435\u043B\u0435\u0432\u043E\u0433\u043E \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430. \u041A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B (x, y) \u0437\u0430\u0434\u0430\u044E\u0442\u0441\u044F \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445 \u043E\u0442 \u043B\u0435\u0432\u043E\u0433\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u0433\u043E \u0443\u0433\u043B\u0430 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 (\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 bbox \u0438\u0437 snapshot). \u041F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0434\u0435\u0440\u0436\u043A\u0438 \u043C\u0435\u0436\u0434\u0443 \u043A\u043B\u0438\u043A\u0430\u043C\u0438. \u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 diff + snapshot + screenshot \u043F\u043E\u0441\u043B\u0435 \u0432\u0441\u0435\u0445 \u043A\u043B\u0438\u043A\u043E\u0432. \u041F\u0440\u0438\u043C\u0435\u0440: {target_id: "iframe_2", clicks: [{x: 50, y: 50, delay_after_ms: 500}, {x: 150, y: 50}]}.',
5653
+ description: 'Perform multiple clicks at coordinates relative to a target element. Coordinates (x, y) are specified in pixels from the top-left corner of the element (use bbox from snapshot). Supports delays between clicks. Returns diff + snapshot + screenshot after all clicks. Example: {target_id: "iframe_2", clicks: [{x: 50, y: 50, delay_after_ms: 500}, {x: 150, y: 50}]}.',
5556
5654
  inputSchema: {
5557
5655
  type: "object",
5558
5656
  properties: {
5559
5657
  target_id: {
5560
5658
  type: "string",
5561
- description: "ID \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0432 VSL JSON (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, iframe_2 \u0434\u043B\u044F reCAPTCHA challenge iframe)"
5659
+ description: "Element ID in VSL JSON (e.g. iframe_2 for reCAPTCHA challenge iframe)"
5562
5660
  },
5563
5661
  clicks: {
5564
5662
  type: "array",
5565
- description: "\u041C\u0430\u0441\u0441\u0438\u0432 \u043A\u043B\u0438\u043A\u043E\u0432. \u041A\u0430\u0436\u0434\u044B\u0439 \u043A\u043B\u0438\u043A: {x: number, y: number, delay_after_ms?: number}. \u041A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445 \u043E\u0442 \u043B\u0435\u0432\u043E\u0433\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u0433\u043E \u0443\u0433\u043B\u0430 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430.",
5663
+ description: "Array of clicks. Each click: {x: number, y: number, delay_after_ms?: number}. Coordinates in pixels from the top-left corner of the element.",
5566
5664
  items: {
5567
5665
  type: "object",
5568
5666
  properties: {
5569
- x: { type: "number", description: "X \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430 (pixels \u043E\u0442 \u043B\u0435\u0432\u043E\u0433\u043E \u043A\u0440\u0430\u044F \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430)" },
5570
- y: { type: "number", description: "Y \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430 (pixels \u043E\u0442 \u0432\u0435\u0440\u0445\u043D\u0435\u0433\u043E \u043A\u0440\u0430\u044F \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430)" },
5571
- delay_after_ms: { type: "number", description: "\u0417\u0430\u0434\u0435\u0440\u0436\u043A\u0430 \u043F\u043E\u0441\u043B\u0435 \u043A\u043B\u0438\u043A\u0430 (\u043C\u0441)" }
5667
+ x: { type: "number", description: "X coordinate (pixels from left edge of element)" },
5668
+ y: { type: "number", description: "Y coordinate (pixels from top edge of element)" },
5669
+ delay_after_ms: { type: "number", description: "Delay after click (ms)" }
5572
5670
  },
5573
5671
  required: ["x", "y"]
5574
5672
  }
5575
5673
  },
5576
5674
  return_state: {
5577
5675
  type: "boolean",
5578
- description: "\u0415\u0441\u043B\u0438 true (default), \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 diff + snapshot + screenshot \u043F\u043E\u0441\u043B\u0435 \u0432\u0441\u0435\u0445 \u043A\u043B\u0438\u043A\u043E\u0432."
5676
+ description: "If true (default), returns diff + snapshot + screenshot after all clicks."
5579
5677
  }
5580
5678
  },
5581
5679
  required: ["target_id", "clicks"]
@@ -5669,13 +5767,13 @@ var VSL_RESOURCES = [
5669
5767
  {
5670
5768
  uri: "vsl://current",
5671
5769
  name: "Current VSL Snapshot",
5672
- description: "\u0422\u0435\u043A\u0443\u0449\u0438\u0439 VSL snapshot \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B. \u0421\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043F\u043E\u043B\u043D\u0443\u044E \u0441\u0435\u043C\u0430\u043D\u0442\u0438\u0447\u0435\u0441\u043A\u0443\u044E \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0443 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432.",
5770
+ description: "Current VSL snapshot of the page. Contains the full semantic structure of elements.",
5673
5771
  mimeType: "application/json"
5674
5772
  },
5675
5773
  {
5676
5774
  uri: "vsl://diff",
5677
5775
  name: "Latest VSL Diff",
5678
- description: "\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 VSL diff \u0441 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0433\u043E snapshot. \u0421\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F (added/modified/removed).",
5776
+ description: "Latest VSL diff since the previous snapshot. Contains only changes (added/modified/removed).",
5679
5777
  mimeType: "application/json"
5680
5778
  }
5681
5779
  ];
@@ -6488,7 +6586,7 @@ var SessionManager = class {
6488
6586
  };
6489
6587
 
6490
6588
  // src/version.ts
6491
- var VSL_MCP_SERVER_VERSION = "1.3.4";
6589
+ var VSL_MCP_SERVER_VERSION = "1.3.6";
6492
6590
 
6493
6591
  // src/index.ts
6494
6592
  async function main() {