validpilot-oss 1.1.0

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.
Files changed (97) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +196 -0
  3. package/bin/validpilot.js +173 -0
  4. package/brain/error_aggregator.js +203 -0
  5. package/core/artifacts.js +44 -0
  6. package/core/config.js +37 -0
  7. package/core/redaction.js +39 -0
  8. package/core/report.js +42 -0
  9. package/core/result.js +29 -0
  10. package/core/security.js +57 -0
  11. package/engines/chrome_mcp_adapter.js +319 -0
  12. package/engines/playwright_adapter.js +421 -0
  13. package/examples/demo/README.md +58 -0
  14. package/examples/demo/diagnostic-error-flow.json +22 -0
  15. package/examples/demo/diagnostic-error.html +29 -0
  16. package/examples/demo/flow.json +27 -0
  17. package/examples/demo/index.html +29 -0
  18. package/hands/browser_operator.js +67 -0
  19. package/hands/evidence_collector.js +97 -0
  20. package/package.json +55 -0
  21. package/rules/suggested-rules.json +237 -0
  22. package/server.js +5376 -0
  23. package/standalone-start.js +43 -0
  24. package/start-http.js +45 -0
  25. package/tools/ai_debug_investigate.json +30 -0
  26. package/tools/benchmark_run.json +37 -0
  27. package/tools/browser_a11y_check.json +21 -0
  28. package/tools/browser_artifacts.json +8 -0
  29. package/tools/browser_artifacts_clear.json +11 -0
  30. package/tools/browser_assert.json +16 -0
  31. package/tools/browser_batch.json +61 -0
  32. package/tools/browser_click.json +11 -0
  33. package/tools/browser_console.json +26 -0
  34. package/tools/browser_cookies.json +38 -0
  35. package/tools/browser_debug_report.json +11 -0
  36. package/tools/browser_diagnose.json +23 -0
  37. package/tools/browser_dom.json +11 -0
  38. package/tools/browser_element_status.json +26 -0
  39. package/tools/browser_errors.json +17 -0
  40. package/tools/browser_errors_aggregate.json +12 -0
  41. package/tools/browser_errors_clear.json +8 -0
  42. package/tools/browser_eval.json +11 -0
  43. package/tools/browser_events.json +15 -0
  44. package/tools/browser_events_clear.json +8 -0
  45. package/tools/browser_find_element.json +30 -0
  46. package/tools/browser_find_page.json +22 -0
  47. package/tools/browser_flow.json +38 -0
  48. package/tools/browser_har_export.json +17 -0
  49. package/tools/browser_highlight.json +18 -0
  50. package/tools/browser_hover.json +14 -0
  51. package/tools/browser_instrument.json +10 -0
  52. package/tools/browser_links.json +21 -0
  53. package/tools/browser_locator_suggest.json +16 -0
  54. package/tools/browser_locator_validate.json +12 -0
  55. package/tools/browser_network.json +16 -0
  56. package/tools/browser_network_detail.json +17 -0
  57. package/tools/browser_open.json +12 -0
  58. package/tools/browser_performance_check.json +25 -0
  59. package/tools/browser_press_key.json +18 -0
  60. package/tools/browser_quick_fix.json +29 -0
  61. package/tools/browser_screenshot.json +15 -0
  62. package/tools/browser_scroll.json +31 -0
  63. package/tools/browser_select.json +26 -0
  64. package/tools/browser_session_close.json +12 -0
  65. package/tools/browser_session_create.json +17 -0
  66. package/tools/browser_session_switch.json +12 -0
  67. package/tools/browser_sessions.json +8 -0
  68. package/tools/browser_snapshot.json +8 -0
  69. package/tools/browser_step.json +18 -0
  70. package/tools/browser_storage.json +10 -0
  71. package/tools/browser_trace_start.json +14 -0
  72. package/tools/browser_trace_stop.json +10 -0
  73. package/tools/browser_traverse_menu.json +25 -0
  74. package/tools/browser_type.json +12 -0
  75. package/tools/browser_verify_fix.json +39 -0
  76. package/tools/browser_visual_baseline.json +19 -0
  77. package/tools/browser_visual_compare.json +20 -0
  78. package/tools/browser_visual_report.json +8 -0
  79. package/tools/browser_wait.json +18 -0
  80. package/tools/debug_investigate.json +17 -0
  81. package/tools/error_fix_suggestion.json +13 -0
  82. package/tools/error_summary_md.json +11 -0
  83. package/tools/fix_verify.json +13 -0
  84. package/tools/mcp_health_check.json +8 -0
  85. package/tools/mcp_self_test.json +12 -0
  86. package/tools/screenshot_diff.json +16 -0
  87. package/tools/validation_check.json +20 -0
  88. package/tools/validation_decision.json +24 -0
  89. package/tools/validation_element.json +13 -0
  90. package/tools/validation_flow.json +12 -0
  91. package/tools/validation_matrix.json +27 -0
  92. package/tools/validation_quick_run.json +13 -0
  93. package/tools/validation_report.json +10 -0
  94. package/tools/validation_report_export.json +8 -0
  95. package/tools/validation_run.json +35 -0
  96. package/tools/validation_start.json +12 -0
  97. package/tools/validation_suite_run.json +17 -0
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ValidPilot OSS MCP 独立启动脚本
4
+ * 用于手动测试和调试MCP服务器
5
+ *
6
+ * 使用方法:
7
+ * node e:\daima\bibichajian\.trae\validpilot-oss\standalone-start.js
8
+ */
9
+ const path = require('path');
10
+ const { spawn } = require('child_process');
11
+
12
+ const serverPath = path.join(__dirname, 'server.js');
13
+
14
+ console.log('=== ValidPilot OSS MCP 独立启动 ===');
15
+ console.log('服务器路径:', serverPath);
16
+ console.log('工具数量: 60');
17
+ console.log('');
18
+
19
+ // 启动MCP服务器(stdio模式)
20
+ const server = spawn('node', [serverPath], {
21
+ stdio: ['pipe', 'pipe', 'pipe'],
22
+ env: { ...process.env, NODE_ENV: 'development' }
23
+ });
24
+
25
+ server.stdout.on('data', (data) => {
26
+ console.log('[stdout]', data.toString());
27
+ });
28
+
29
+ server.stderr.on('data', (data) => {
30
+ console.log('[stderr]', data.toString());
31
+ });
32
+
33
+ server.on('error', (err) => {
34
+ console.error('启动失败:', err.message);
35
+ });
36
+
37
+ server.on('close', (code) => {
38
+ console.log('服务器关闭,退出码:', code);
39
+ });
40
+
41
+ // 保持进程运行
42
+ process.stdin.resume();
43
+ console.log('服务器已启动,按 Ctrl+C 关闭');
package/start-http.js ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ValidPilot OSS MCP - HTTP模式外部启动脚本
4
+ *
5
+ * 使用方法:
6
+ * node start-http.js
7
+ * MCP_HTTP_PORT=3556 node start-http.js
8
+ *
9
+ * 健康检查:
10
+ * curl http://localhost:3456/health
11
+ *
12
+ * 测试:
13
+ * node test-http2.js
14
+ */
15
+
16
+ const { spawn } = require('child_process');
17
+ const path = require('path');
18
+
19
+ const PORT = process.env.MCP_HTTP_PORT || 3456;
20
+
21
+ console.log('=== ValidPilot OSS MCP HTTP Server ===');
22
+ console.log('端口:', PORT);
23
+ console.log('启动中...\n');
24
+
25
+ const server = spawn(process.execPath, [path.join(__dirname, 'server.js')], {
26
+ stdio: 'inherit',
27
+ env: {
28
+ ...process.env,
29
+ MCP_MODE: 'http',
30
+ MCP_HTTP_PORT: String(PORT)
31
+ }
32
+ });
33
+
34
+ server.on('error', (err) => {
35
+ console.error('启动失败:', err.message);
36
+ process.exit(1);
37
+ });
38
+
39
+ server.on('close', (code) => {
40
+ console.log(`\n服务器退出,代码: ${code}`);
41
+ process.exit(code || 0);
42
+ });
43
+
44
+ process.on('SIGINT', () => server.kill('SIGINT'));
45
+ process.on('SIGTERM', () => server.kill('SIGTERM'));
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "ai_debug_investigate",
3
+ "description": "AI 驱动的自动调试调查工具。收集浏览器错误、控制台错误、网络错误,使用 AI 模型进行根因分析、生成修复方案、评估修复安全性,并将成功经验写入知识库。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "symptom": {
8
+ "type": "string",
9
+ "description": "错误症状描述,如 '点击提交按钮无响应' 或 'Cannot read properties of undefined'"
10
+ },
11
+ "url": {
12
+ "type": "string",
13
+ "description": "要检查的页面 URL(可选,默认使用当前页面)"
14
+ },
15
+ "includeAiFix": {
16
+ "type": "boolean",
17
+ "description": "是否包含 AI 修复方案生成",
18
+ "default": true
19
+ },
20
+ "maxIterations": {
21
+ "type": "integer",
22
+ "description": "OPAR 循环最大迭代次数",
23
+ "default": 3,
24
+ "minimum": 1,
25
+ "maximum": 5
26
+ }
27
+ },
28
+ "required": ["symptom"]
29
+ }
30
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "benchmark_run",
3
+ "description": "执行 MCP 工具的性能基准测试。对指定的工具多次调用并记录每次耗时,结果保存到 benchmarks/ 目录。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "tool": {
8
+ "type": "string",
9
+ "description": "要测试的工具名称,如 browser_errors_aggregate"
10
+ },
11
+ "args": {
12
+ "type": "object",
13
+ "description": "传递给工具的参数字典",
14
+ "default": {}
15
+ },
16
+ "runs": {
17
+ "type": "integer",
18
+ "description": "执行次数",
19
+ "default": 5,
20
+ "minimum": 1,
21
+ "maximum": 50
22
+ },
23
+ "warmup": {
24
+ "type": "integer",
25
+ "description": "预热执行次数(不计入统计)",
26
+ "default": 1,
27
+ "minimum": 0,
28
+ "maximum": 5
29
+ },
30
+ "name": {
31
+ "type": "string",
32
+ "description": "基准测试名称(用于保存文件名),默认自动生成"
33
+ }
34
+ },
35
+ "required": ["tool"]
36
+ }
37
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "browser_a11y_check",
3
+ "description": "使用 axe-core 对当前页面执行可访问性检查,支持限定扫描范围、排除区域和规则标签过滤,返回 violations 摘要。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": { "type": "string", "description": "可选 CSS 选择器;指定后只扫描该区域" },
8
+ "excludeSelectors": {
9
+ "type": "array",
10
+ "description": "排除扫描的 CSS 选择器列表",
11
+ "items": { "type": "string" }
12
+ },
13
+ "tags": {
14
+ "type": "array",
15
+ "description": "axe runOnly 标签,如 wcag2a、wcag2aa、best-practice",
16
+ "items": { "type": "string" }
17
+ },
18
+ "sessionName": { "type": "string", "description": "浏览器会话名称,默认当前活跃会话" }
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "browser_artifacts",
3
+ "description": "列出当前 MCP 浏览器验证产生的证据产物:截图、trace.zip、HAR、HTML reports、visual 视觉产物、日志文件和当前 checkpoint。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {}
7
+ }
8
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "browser_artifacts_clear",
3
+ "description": "清理截图、Trace、HAR、reports 和 visual 证据产物。默认不清理 MCP 日志,默认清理 visual 产物。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "includeLogs": { "type": "boolean", "description": "是否同时清空 validation.log,默认 false" },
8
+ "includeVisual": { "type": "boolean", "description": "是否清理 visual 产物,默认 true" }
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "browser_assert",
3
+ "description": "对当前真实浏览器页面执行标准断言:URL、文本、元素可见/隐藏、本轮无错误。返回每条断言的通过/失败详情。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "urlContains": { "type": "string", "description": "断言当前 URL 包含该字符串" },
8
+ "textContains": { "type": "string", "description": "断言页面可见文本包含该内容" },
9
+ "selectorVisible": { "type": "string", "description": "断言指定 CSS 选择器可见" },
10
+ "selectorHidden": { "type": "string", "description": "断言指定 CSS 选择器不可见" },
11
+ "noErrors": { "type": "boolean", "description": "断言当前 checkpoint 后无统一错误" },
12
+ "includeErrors": { "type": "boolean", "description": "失败或输出时是否附带统一错误详情" },
13
+ "timeout": { "type": "number", "description": "读取页面文本的超时时间,默认 5000ms" }
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "browser_batch",
3
+ "description": "批量执行多个浏览器操作,每个步骤包含type(操作类型: click/type/hover/scroll/screenshot等)、selector(选择器)、text(输入文本)等参数。支持最多20个操作。",
4
+ "arguments": {
5
+ "type": "object",
6
+ "properties": {
7
+ "steps": {
8
+ "type": "array",
9
+ "description": "操作步骤数组,每个步骤包含type、selector、text等参数",
10
+ "items": {
11
+ "type": "object",
12
+ "properties": {
13
+ "type": {
14
+ "type": "string",
15
+ "enum": ["click", "type", "hover", "scroll", "screenshot", "wait", "press_key", "select"],
16
+ "description": "操作类型"
17
+ },
18
+ "selector": {
19
+ "type": "string",
20
+ "description": "元素选择器"
21
+ },
22
+ "text": {
23
+ "type": "string",
24
+ "description": "输入文本(type操作时使用)"
25
+ },
26
+ "value": {
27
+ "type": "string",
28
+ "description": "下拉选项值(select操作时使用)"
29
+ },
30
+ "key": {
31
+ "type": "string",
32
+ "description": "按键名称(press_key操作时使用)"
33
+ },
34
+ "ms": {
35
+ "type": "number",
36
+ "description": "等待毫秒数(wait操作时使用)"
37
+ },
38
+ "direction": {
39
+ "type": "string",
40
+ "description": "滚动方向(scroll操作时使用)"
41
+ },
42
+ "distance": {
43
+ "type": "number",
44
+ "description": "滚动距离(scroll操作时使用)"
45
+ },
46
+ "name": {
47
+ "type": "string",
48
+ "description": "截图名称(screenshot操作时使用)"
49
+ }
50
+ },
51
+ "required": ["type"]
52
+ }
53
+ },
54
+ "maxSteps": {
55
+ "type": "number",
56
+ "description": "最大操作步骤数,默认20"
57
+ }
58
+ },
59
+ "required": ["steps"]
60
+ }
61
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "browser_click",
3
+ "description": "在真实浏览器中点击指定 CSS 选择器元素",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": { "type": "string", "description": "CSS 选择器" }
8
+ },
9
+ "required": ["selector"]
10
+ }
11
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "browser_console",
3
+ "description": "查看浏览器控制台日志,支持按类型过滤(level: log/warning/error/debug/info),按时间范围过滤(since: ISO时间戳或时间描述如'5m'),限制返回数量(limit)。",
4
+ "arguments": {
5
+ "type": "object",
6
+ "properties": {
7
+ "level": {
8
+ "type": "string",
9
+ "enum": ["log", "warning", "error", "debug", "info", "all"],
10
+ "description": "控制台日志级别过滤,默认为all"
11
+ },
12
+ "since": {
13
+ "type": "string",
14
+ "description": "时间过滤起始点,ISO时间戳或时间描述(如'5m'表示最近5分钟)"
15
+ },
16
+ "limit": {
17
+ "type": "number",
18
+ "description": "返回日志数量限制,默认50"
19
+ },
20
+ "urlContains": {
21
+ "type": "string",
22
+ "description": "按URL关键字过滤"
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "browser_cookies",
3
+ "description": "查看和管理浏览器Cookie。支持获取所有Cookie、按域名筛选、设置Cookie、清除Cookie。返回Cookie总数、每个Cookie的详细信息(名称、值、域名、路径、过期时间、安全标志等)。调试时可快速查看登录态、Token等认证信息。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "action": {
8
+ "type": "string",
9
+ "description": "操作类型:get(获取Cookie,默认)、clear(清除所有Cookie)、set(设置Cookie)",
10
+ "enum": ["get", "clear", "set"],
11
+ "default": "get"
12
+ },
13
+ "domain": {
14
+ "type": "string",
15
+ "description": "按域名筛选Cookie,如 .example.com(仅action=get时生效)"
16
+ },
17
+ "name": {
18
+ "type": "string",
19
+ "description": "按名称筛选Cookie(仅action=get时生效)"
20
+ },
21
+ "cookie": {
22
+ "type": "object",
23
+ "description": "要设置的Cookie对象,包含 name、value 属性,可选 domain、path、expires 等(仅action=set时生效)",
24
+ "properties": {
25
+ "name": { "type": "string", "description": "Cookie名称" },
26
+ "value": { "type": "string", "description": "Cookie值" },
27
+ "domain": { "type": "string", "description": "Cookie域名" },
28
+ "path": { "type": "string", "description": "Cookie路径,默认/" },
29
+ "expires": { "type": "number", "description": "过期时间戳(秒)" },
30
+ "httpOnly": { "type": "boolean", "description": "是否仅HTTP访问" },
31
+ "secure": { "type": "boolean", "description": "是否仅HTTPS传输" },
32
+ "sameSite": { "type": "string", "description": "SameSite策略" }
33
+ },
34
+ "required": ["name", "value"]
35
+ }
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "browser_debug_report",
3
+ "description": "生成当前浏览器调试报告,汇总页面状态、错误日志、网络错误、可选 DOM 与存储信息",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "includeDom": { "type": "boolean", "description": "是否包含页面文本和元素摘要,默认 true" },
8
+ "includeStorage": { "type": "boolean", "description": "是否包含存储信息,默认 false" }
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "browser_diagnose",
3
+ "description": "自动诊断浏览器错误根因。分析控制台错误、页面错误、网络错误、元素状态、JS执行状态,定位问题根源(如元素未加载、JS未执行、网络超时、权限不足等)。返回诊断报告含 rootCause、confidence、suggestedFixes、affectedElements。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": {
8
+ "type": "string",
9
+ "description": "目标元素选择器,诊断该元素相关的错误(可选,不传则诊断整个页面)"
10
+ },
11
+ "errorType": {
12
+ "type": "string",
13
+ "description": "聚焦诊断的错误类型:all(全部)、js(JS错误)、network(网络错误)、element(元素问题)、interaction(交互失败)",
14
+ "enum": ["all", "js", "network", "element", "interaction"],
15
+ "default": "all"
16
+ },
17
+ "includeStackTrace": {
18
+ "type": "boolean",
19
+ "description": "是否包含JS错误堆栈分析,默认true"
20
+ }
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "browser_dom",
3
+ "description": "查询当前页面中指定 DOM 元素的可见性、文本、属性、样式和位置",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": { "type": "string", "description": "CSS 选择器" }
8
+ },
9
+ "required": ["selector"]
10
+ }
11
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "browser_element_status",
3
+ "description": "诊断元素状态(可见性、可交互性、加载状态、遮挡情况、事件绑定)。快速判断元素为何无法点击/输入,返回具体原因(如被遮挡、不可见、disabled、未加载、动画中、z-index问题等)和修复建议。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": {
8
+ "type": "string",
9
+ "description": "要诊断的元素选择器(必填)"
10
+ },
11
+ "checkEvents": {
12
+ "type": "boolean",
13
+ "description": "是否检查元素事件绑定(click/keydown/change等),默认true"
14
+ },
15
+ "checkVisibility": {
16
+ "type": "boolean",
17
+ "description": "是否详细检查可见性(opacity、display、visibility、clip-path),默认true"
18
+ },
19
+ "checkInteractability": {
20
+ "type": "boolean",
21
+ "description": "是否检查可交互性(disabled、readonly、pointer-events),默认true"
22
+ }
23
+ },
24
+ "required": ["selector"]
25
+ }
26
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "browser_errors",
3
+ "description": "统一查看真实浏览器验证中的本轮错误日志:Console Error、PageError、请求失败、HTTP 4xx/5xx、MCP 服务错误日志。默认只统计当前 checkpoint 之后的新错误,避免历史错误污染。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "includeWarnings": { "type": "boolean", "description": "是否包含 warning/warn 日志,默认 false" },
8
+ "limit": { "type": "number", "description": "MCP 服务错误日志最多返回条数,默认 50" },
9
+ "since": { "type": "string", "description": "ISO 时间戳,只返回该时间之后的错误" },
10
+ "currentOnly": { "type": "boolean", "description": "是否只返回当前 checkpoint 之后的错误,默认 true" },
11
+ "urlContains": { "type": "string", "description": "只返回 URL 包含该关键字的网络错误" },
12
+ "method": { "type": "string", "description": "只返回指定 HTTP 方法的网络错误,如 GET/POST" },
13
+ "statusMin": { "type": "number", "description": "只返回状态码大于等于该值的网络记录" },
14
+ "statusMax": { "type": "number", "description": "只返回状态码小于等于该值的网络记录" }
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "browser_errors_aggregate",
3
+ "description": "收集或接收浏览器 Console/Network/PageError/DOM 摘要,去重聚合并返回 Top errors;默认不返回完整日志。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "limit": { "type": "number", "description": "Top errors 数量,默认 5" },
8
+ "includeCurrentPage": { "type": "boolean", "description": "是否优先读取当前页面低 Token 证据,默认 true" },
9
+ "evidence": { "type": "object", "description": "可选外部证据摘要" }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "browser_errors_clear",
3
+ "description": "清空当前浏览器运行时 Console/PageError/Network 错误日志并创建新的验证 checkpoint,用于隔离本轮验证错误。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {}
7
+ }
8
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "browser_eval",
3
+ "description": "在当前浏览器页面执行调试 JavaScript 表达式并返回可序列化结果。返回值会自动脱敏 token、password、apiKey、Authorization 等敏感字段。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "expression": { "type": "string", "description": "要执行的 JavaScript 表达式或函数体" }
8
+ },
9
+ "required": ["expression"]
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "browser_events",
3
+ "description": "查看 browser_instrument 捕获的运行时事件流,支持按事件类型、URL、方法、状态码过滤。输出会自动脱敏。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "type": { "type": "string", "description": "事件类型,如 fetch_start/fetch_end/xhr_end/click/input/console/window_error/unhandledrejection/route/storage_set" },
8
+ "urlContains": { "type": "string", "description": "只返回页面 URL 或请求 URL 包含该关键字的事件" },
9
+ "method": { "type": "string", "description": "只返回指定 HTTP 方法的 fetch/xhr 事件" },
10
+ "statusMin": { "type": "number", "description": "只返回状态码大于等于该值的网络事件" },
11
+ "since": { "type": "string", "description": "ISO 时间戳,只返回该时间之后的事件" },
12
+ "limit": { "type": "number", "description": "最多返回事件条数,默认 100" }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "browser_events_clear",
3
+ "description": "清空 browser_instrument 捕获的运行时事件并创建新的事件 checkpoint。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {}
7
+ }
8
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "browser_find_element",
3
+ "description": "智能元素定位基础版:按文本描述或角色查找页面元素,返回CSS选择器、置信度、元素信息。多策略匹配(精确文本>包含文本>placeholder>aria-label>title/alt>模糊匹配),只返回可见元素,结果按置信度降序排列。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "text": {
8
+ "type": "string",
9
+ "description": "要查找的元素文本"
10
+ },
11
+ "role": {
12
+ "type": "string",
13
+ "description": "元素角色:button/link/input/textbox/checkbox/radio/combobox 等(可选)"
14
+ },
15
+ "tagName": {
16
+ "type": "string",
17
+ "description": "标签名过滤,如 button/a/input/div 等(可选)"
18
+ },
19
+ "onlyVisible": {
20
+ "type": "boolean",
21
+ "description": "只返回可见元素,默认 true"
22
+ },
23
+ "limit": {
24
+ "type": "number",
25
+ "description": "返回数量,默认 5"
26
+ }
27
+ },
28
+ "required": ["text"]
29
+ }
30
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "browser_find_page",
3
+ "description": "智能发现页面:根据目标关键词(login/signup/home/dashboard/admin/settings/profile等)快速定位页面。检测方式按优先级:①URL路径匹配;②页面标题匹配;③CSS选择器匹配;④SPA按钮文本匹配;⑤导航区域文本匹配;⑥页面可见文本匹配。支持SPA应用(React/Vue/Angular)的按钮导航发现。返回匹配方式、匹配分数、相关链接和按钮(含selector可直接click)、建议导航URL。参数navigate=true可自动导航到发现的页面。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "target": {
8
+ "type": "string",
9
+ "description": "目标页面类型:login / signup / home / dashboard / admin / settings / profile / search / cart / checkout / forgot-password / reset-password / logout / all"
10
+ },
11
+ "navigate": {
12
+ "type": "boolean",
13
+ "description": "是否导航到发现的页面(如果还没在目标页面),默认false"
14
+ },
15
+ "baseUrl": {
16
+ "type": "string",
17
+ "description": "基础URL,用于尝试常见路径。不指定时从当前页面URL推导"
18
+ }
19
+ },
20
+ "required": ["target"]
21
+ }
22
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "browser_flow",
3
+ "description": "按步骤执行真实浏览器流程,并为每一步自动保存截图/DOM/错误证据。适合登录、保存配置、创建项目等完整闭环验证。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "clearErrors": { "type": "boolean", "description": "开始前是否清空本轮错误并创建 checkpoint,默认 true" },
8
+ "continueOnError": { "type": "boolean", "description": "步骤失败后是否继续执行,默认 false" },
9
+ "headless": { "type": "boolean", "description": "无浏览器时是否以 headless 模式打开,默认 false" },
10
+ "steps": {
11
+ "type": "array",
12
+ "description": "流程步骤列表",
13
+ "items": {
14
+ "type": "object",
15
+ "properties": {
16
+ "type": { "type": "string", "description": "步骤类型:open/click/type/wait/assert/eval/clearErrors" },
17
+ "name": { "type": "string", "description": "步骤名称,用于证据文件命名" },
18
+ "url": { "type": "string", "description": "open 步骤目标 URL" },
19
+ "selector": { "type": "string", "description": "click/type/wait 步骤 CSS 选择器" },
20
+ "text": { "type": "string", "description": "type 输入文本或 wait 等待文本" },
21
+ "expression": { "type": "string", "description": "eval 步骤 JS 表达式" },
22
+ "urlContains": { "type": "string", "description": "wait/assert URL 包含断言" },
23
+ "textContains": { "type": "string", "description": "assert 页面文本包含断言" },
24
+ "selectorVisible": { "type": "string", "description": "assert 元素可见断言" },
25
+ "selectorHidden": { "type": "string", "description": "assert 元素隐藏断言" },
26
+ "noErrors": { "type": "boolean", "description": "assert 当前 checkpoint 后无错误" },
27
+ "timeout": { "type": "number", "description": "等待/断言超时时间" },
28
+ "evidence": { "type": "boolean", "description": "该步骤后是否保存证据,默认 true" },
29
+ "screenshot": { "type": "boolean", "description": "该步骤证据是否截图,默认 true" },
30
+ "snapshot": { "type": "boolean", "description": "该步骤证据是否采集 DOM 快照,默认 true" }
31
+ },
32
+ "required": ["type"]
33
+ }
34
+ }
35
+ },
36
+ "required": ["steps"]
37
+ }
38
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "browser_har_export",
3
+ "description": "将当前采集的网络记录导出为简化 HAR JSON 文件,包含请求/响应头、请求/响应体摘要、状态码和耗时。输出自动脱敏。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": { "type": "string", "description": "导出的 HAR 文件名,不含扩展名" },
8
+ "contains": { "type": "string", "description": "URL 过滤关键字,兼容旧参数" },
9
+ "urlContains": { "type": "string", "description": "URL 过滤关键字" },
10
+ "method": { "type": "string", "description": "HTTP 方法,如 GET/POST/PUT" },
11
+ "statusMin": { "type": "number", "description": "只导出状态码大于等于该值的记录" },
12
+ "statusMax": { "type": "number", "description": "只导出状态码小于等于该值的记录" },
13
+ "since": { "type": "string", "description": "ISO 时间戳,只导出该时间之后的记录" },
14
+ "currentOnly": { "type": "boolean", "description": "是否只导出当前 checkpoint 之后的记录,默认 true" }
15
+ }
16
+ }
17
+ }