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,18 @@
1
+ {
2
+ "name": "browser_highlight",
3
+ "description": "高亮页面上的指定元素,便于人类观察和调试。元素会显示红色边框和阴影效果,持续到页面刷新。",
4
+ "arguments": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": {
8
+ "type": "string",
9
+ "description": "要高亮的元素选择器"
10
+ },
11
+ "color": {
12
+ "type": "string",
13
+ "description": "高亮颜色,支持CSS颜色值,默认为红色(red)"
14
+ }
15
+ },
16
+ "required": ["selector"]
17
+ }
18
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "browser_hover",
3
+ "description": "鼠标悬浮到指定元素上,用于触发 hover 效果、tooltip、下拉菜单等",
4
+ "arguments": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": {
8
+ "type": "string",
9
+ "description": "目标元素的 CSS 选择器"
10
+ }
11
+ },
12
+ "required": ["selector"]
13
+ }
14
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "browser_instrument",
3
+ "description": "向当前页面注入运行时调试探针,捕获 fetch/XHR、console error/warn、全局错误、点击、输入、路由和 storage 变化。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "headless": { "type": "boolean", "description": "无浏览器时是否以 headless 模式打开,默认 false" }
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "browser_links",
3
+ "description": "提取当前页面所有导航链接和按钮,并按类型分类(导航菜单、首页、登录、注册、管理、设置、用户、搜索、退出、帮助等)。支持SPA应用的按钮提取(不仅是a标签),支持关键词筛选和外部链接过滤。返回链接总数、按钮数、分类统计和可视区域信息。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "filter": {
8
+ "type": "string",
9
+ "description": "筛选关键词,只返回URL/文本包含该关键词的链接或按钮(支持SPA按钮文本筛选)"
10
+ },
11
+ "includeExternal": {
12
+ "type": "boolean",
13
+ "description": "是否包含外部链接,默认false"
14
+ },
15
+ "maxLinks": {
16
+ "type": "number",
17
+ "description": "最大返回链接数,默认100"
18
+ }
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "browser_locator_suggest",
3
+ "description": "基于已有 selector 命中的元素或 target 文本查找可见元素,按可访问属性生成更稳定的推荐选择器、评分、风险和 fallback 列表。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": { "type": "string", "description": "已有选择器,命中元素后基于其属性生成推荐" },
8
+ "target": { "type": "string", "description": "无 selector 时按可见文本查找目标元素" },
9
+ "sessionName": { "type": "string", "description": "浏览器会话名称" }
10
+ },
11
+ "anyOf": [
12
+ { "required": ["selector"] },
13
+ { "required": ["target"] }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "browser_locator_validate",
3
+ "description": "验证选择器稳定性,统计匹配数量、可见数量,并按 role/label/placeholder/data-testid/text/id/css/xpath 等规则输出分数、风险、警告和建议。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": { "type": "string", "description": "要验证的 Playwright/CSS/text/role 选择器" },
8
+ "sessionName": { "type": "string", "description": "浏览器会话名称" }
9
+ },
10
+ "required": ["selector"]
11
+ }
12
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "browser_network",
3
+ "description": "获取真实浏览器运行过程中采集到的网络请求记录,支持按 URL、方法、状态码和 checkpoint 过滤。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "contains": { "type": "string", "description": "URL 过滤关键字,兼容旧参数" },
8
+ "urlContains": { "type": "string", "description": "URL 过滤关键字" },
9
+ "method": { "type": "string", "description": "HTTP 方法,如 GET/POST/PUT" },
10
+ "statusMin": { "type": "number", "description": "只返回状态码大于等于该值的记录" },
11
+ "statusMax": { "type": "number", "description": "只返回状态码小于等于该值的记录" },
12
+ "since": { "type": "string", "description": "ISO 时间戳,只返回该时间之后的记录" },
13
+ "currentOnly": { "type": "boolean", "description": "是否只返回当前 checkpoint 之后的记录,默认 true" }
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "browser_network_detail",
3
+ "description": "查看本轮网络请求详情,包括请求头、响应头、请求体、响应体摘要、耗时和失败原因。输出自动脱敏。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "contains": { "type": "string", "description": "URL 过滤关键字,兼容旧参数" },
8
+ "urlContains": { "type": "string", "description": "URL 过滤关键字" },
9
+ "method": { "type": "string", "description": "HTTP 方法,如 GET/POST/PUT" },
10
+ "statusMin": { "type": "number", "description": "只返回状态码大于等于该值的记录" },
11
+ "statusMax": { "type": "number", "description": "只返回状态码小于等于该值的记录" },
12
+ "since": { "type": "string", "description": "ISO 时间戳,只返回该时间之后的记录" },
13
+ "currentOnly": { "type": "boolean", "description": "是否只返回当前 checkpoint 之后的记录,默认 true" },
14
+ "limit": { "type": "number", "description": "最多返回记录条数,默认 50" }
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "browser_open",
3
+ "description": "打开真实可视化浏览器并导航到目标 URL",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "url": { "type": "string", "description": "要打开的页面 URL" },
8
+ "headless": { "type": "boolean", "description": "是否无头模式,默认 false,建议可视化验证使用 false" }
9
+ },
10
+ "required": ["url"]
11
+ }
12
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "browser_performance_check",
3
+ "description": "采集当前页面 navigation、paint、resource、long task、CLS/LCP 和慢请求指标,并按 budgets 输出性能预算结果。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "budgets": {
8
+ "type": "object",
9
+ "description": "预算阈值,支持 domContentLoaded、load、fcp、lcp、cls、longTaskCount、resourceCount、slowRequestMs",
10
+ "properties": {
11
+ "domContentLoaded": { "type": "number" },
12
+ "load": { "type": "number" },
13
+ "fcp": { "type": "number" },
14
+ "lcp": { "type": "number" },
15
+ "cls": { "type": "number" },
16
+ "longTaskCount": { "type": "number" },
17
+ "resourceCount": { "type": "number" },
18
+ "slowRequestMs": { "type": "number" }
19
+ }
20
+ },
21
+ "slowRequestMs": { "type": "number", "description": "慢请求阈值毫秒,默认 1000;可覆盖 budgets.slowRequestMs" },
22
+ "sessionName": { "type": "string", "description": "浏览器会话名称,默认当前活跃会话" }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "browser_press_key",
3
+ "description": "在当前页面或指定元素上按下键盘按键,支持单个按键或组合键",
4
+ "arguments": {
5
+ "type": "object",
6
+ "properties": {
7
+ "key": {
8
+ "type": "string",
9
+ "description": "按键名称,如 Enter、Escape、Tab、ArrowDown、Backspace、a、Control+c 等"
10
+ },
11
+ "selector": {
12
+ "type": "string",
13
+ "description": "可选,在指定元素上按键(先聚焦再按键)"
14
+ }
15
+ },
16
+ "required": ["key"]
17
+ }
18
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "browser_quick_fix",
3
+ "description": "快速修复验证闭环。自动尝试常见修复策略(等待加载、滚动到元素、强制可见、移除遮挡、注入JS等),每步验证是否修复成功。返回修复尝试记录、最终状态、建议的下一步操作。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": {
8
+ "type": "string",
9
+ "description": "目标元素选择器(必填)"
10
+ },
11
+ "problem": {
12
+ "type": "string",
13
+ "description": "问题描述:not_found(元素未找到)、not_visible(不可见)、not_interactable(不可交互)、click_failed(点击失败)、type_failed(输入失败)、js_error(JS错误)",
14
+ "enum": ["not_found", "not_visible", "not_interactable", "click_failed", "type_failed", "js_error"]
15
+ },
16
+ "maxAttempts": {
17
+ "type": "number",
18
+ "description": "最大修复尝试次数,默认5"
19
+ },
20
+ "waitStrategy": {
21
+ "type": "string",
22
+ "description": "等待策略:smart(智能等待)、fixed(固定等待)、none(不等待)",
23
+ "enum": ["smart", "fixed", "none"],
24
+ "default": "smart"
25
+ }
26
+ },
27
+ "required": ["selector"]
28
+ }
29
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "browser_screenshot",
3
+ "description": "对真实浏览器当前页面截图并保存到 MCP 服务目录。默认遮挡密码、token、apiKey 等敏感输入框。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": { "type": "string", "description": "截图文件名,不含扩展名" },
8
+ "redactSelectors": {
9
+ "type": "array",
10
+ "description": "需要额外遮挡的 CSS 选择器列表",
11
+ "items": { "type": "string" }
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "browser_scroll",
3
+ "description": "滚动页面或元素到指定位置,支持 scrollIntoView 和像素滚动",
4
+ "arguments": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": {
8
+ "type": "string",
9
+ "description": "要滚动到的目标元素选择器,与 scrollIntoView 配合使用"
10
+ },
11
+ "scrollIntoView": {
12
+ "type": "boolean",
13
+ "description": "是否滚动到 selector 指定的元素,默认 true(指定 selector 时)"
14
+ },
15
+ "x": {
16
+ "type": "number",
17
+ "description": "横向滚动像素值(不指定 selector 时使用)"
18
+ },
19
+ "y": {
20
+ "type": "number",
21
+ "description": "纵向滚动像素值(不指定 selector 时使用)"
22
+ },
23
+ "behavior": {
24
+ "type": "string",
25
+ "enum": ["auto", "smooth"],
26
+ "description": "滚动行为,默认 auto"
27
+ }
28
+ },
29
+ "required": []
30
+ }
31
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "browser_select",
3
+ "description": "在下拉框(select元素)中选择选项,支持按value值、按label文本、按索引选择。",
4
+ "arguments": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": {
8
+ "type": "string",
9
+ "description": "select元素的选择器"
10
+ },
11
+ "value": {
12
+ "type": "string",
13
+ "description": "要选择的option的value值"
14
+ },
15
+ "label": {
16
+ "type": "string",
17
+ "description": "要选择的option的显示文本"
18
+ },
19
+ "index": {
20
+ "type": "number",
21
+ "description": "要选择的option的索引(从0开始)"
22
+ }
23
+ },
24
+ "required": ["selector"]
25
+ }
26
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "browser_session_close",
3
+ "description": "关闭并删除指定浏览器会话。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": { "type": "string", "description": "要关闭的会话名称" },
8
+ "sessionName": { "type": "string", "description": "会话名称别名" }
9
+ },
10
+ "required": ["name"]
11
+ }
12
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "browser_session_create",
3
+ "description": "创建或复用一个命名浏览器会话。每个会话拥有独立浏览器上下文、cookie、localStorage、console、network、errors 和 events。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": { "type": "string", "description": "会话名称,如 free-user、pro-user" },
8
+ "sessionName": { "type": "string", "description": "会话名称别名" },
9
+ "url": { "type": "string", "description": "创建后打开的 URL" },
10
+ "headless": { "type": "boolean", "description": "是否无头模式,默认 false" },
11
+ "extensionPath": { "type": "string", "description": "要加载的 Chrome 扩展目录路径。提供后使用持久化上下文并强制 headless=false" },
12
+ "loadExtensionPath": { "type": "string", "description": "extensionPath 的别名,要加载的 Chrome 扩展目录路径" },
13
+ "timeout": { "type": "number", "description": "导航超时时间,默认 30000ms" }
14
+ },
15
+ "required": ["name"]
16
+ }
17
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "browser_session_switch",
3
+ "description": "切换当前活跃浏览器会话。后续未指定 sessionName 的浏览器工具会作用于该会话。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": { "type": "string", "description": "要切换到的会话名称" },
8
+ "sessionName": { "type": "string", "description": "会话名称别名" }
9
+ },
10
+ "required": ["name"]
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "browser_sessions",
3
+ "description": "列出当前所有浏览器会话,显示活跃会话、URL、创建时间、最后使用时间和 trace 状态。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {}
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "browser_snapshot",
3
+ "description": "获取当前真实浏览器页面的 URL、标题、可见文本、表单元素与按钮快照",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {}
7
+ }
8
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "browser_step",
3
+ "description": "记录当前验证步骤证据:截图、DOM 简要快照、本轮统一错误摘要。用于形成可追溯证据链。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "label": { "type": "string", "description": "步骤名称,如 login-after-submit" },
8
+ "screenshot": { "type": "boolean", "description": "是否截图,默认 true" },
9
+ "snapshot": { "type": "boolean", "description": "是否采集 DOM 简要快照,默认 true" },
10
+ "includeWarnings": { "type": "boolean", "description": "错误摘要是否包含 warning" },
11
+ "redactSelectors": {
12
+ "type": "array",
13
+ "description": "截图中额外遮挡的 CSS 选择器",
14
+ "items": { "type": "string" }
15
+ }
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "browser_storage",
3
+ "description": "查看当前页面 localStorage、sessionStorage 或 cookie,辅助定位登录态和状态问题",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "scope": { "type": "string", "description": "localStorage、sessionStorage、cookies 或 all,默认 all" }
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "browser_trace_start",
3
+ "description": "开始录制 Playwright Trace,用于生成可回放的浏览器调试证据包。建议在 browser_flow 前调用。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": { "type": "string", "description": "Trace 名称,不含扩展名" },
8
+ "screenshots": { "type": "boolean", "description": "是否记录每步截图,默认 true" },
9
+ "snapshots": { "type": "boolean", "description": "是否记录 DOM 快照,默认 true" },
10
+ "sources": { "type": "boolean", "description": "是否记录源码,默认 false" },
11
+ "headless": { "type": "boolean", "description": "无浏览器时是否以 headless 模式打开,默认 false" }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "browser_trace_stop",
3
+ "description": "停止 Playwright Trace 录制并保存 trace.zip,可用 Playwright Trace Viewer 回放。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": { "type": "string", "description": "保存的 Trace 文件名,不含扩展名;默认使用 start 时的名称" }
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "browser_traverse_menu",
3
+ "description": "自动遍历页面的导航菜单,逐级点击一级/二级/三级菜单项,每步检查控制台错误、页面错误和网络错误,验证每个功能链路是否正常。自动发现标准nav容器、侧边栏、UI框架菜单(Ant Design/Element UI等),未找到时降级扫描全页面链接。返回每个点击项的访问状态、URL变化、页面标题和错误信息。适用于功能回归测试和页面健康检查。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "maxDepth": {
8
+ "type": "number",
9
+ "description": "最大遍历深度(1=仅一级,2=含二级,3=含三级),默认3"
10
+ },
11
+ "maxItems": {
12
+ "type": "number",
13
+ "description": "最大点击次数,防止无限遍历,默认30"
14
+ },
15
+ "waitMs": {
16
+ "type": "number",
17
+ "description": "每次点击后的等待时间(毫秒),默认500"
18
+ },
19
+ "includeSubMenus": {
20
+ "type": "boolean",
21
+ "description": "是否自动展开并点击子菜单,默认true"
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "browser_type",
3
+ "description": "在真实浏览器中向指定 CSS 选择器输入文本",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": { "type": "string", "description": "CSS 选择器" },
8
+ "text": { "type": "string", "description": "要输入的文本" }
9
+ },
10
+ "required": ["selector", "text"]
11
+ }
12
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "browser_verify_fix",
3
+ "description": "修复验证闭环工具。记录修复前状态(错误数、元素状态),执行修复操作(browser_click/type/wait等),验证修复后状态,对比前后差异,确认修复是否生效。返回 before/after 对比、fixStatus、verificationResult、nextAction。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": {
8
+ "type": "string",
9
+ "description": "目标元素选择器(必填)"
10
+ },
11
+ "fixAction": {
12
+ "type": "string",
13
+ "description": "修复动作类型:click(点击)、type(输入)、wait(等待)、scroll(滚动)、quick_fix(自动修复)、none(仅验证不修复)",
14
+ "enum": ["click", "type", "wait", "scroll", "quick_fix", "none"],
15
+ "default": "quick_fix"
16
+ },
17
+ "fixValue": {
18
+ "type": "string",
19
+ "description": "修复动作值(type时为输入文本,wait时为毫秒数,scroll时为距离)"
20
+ },
21
+ "verificationCriteria": {
22
+ "type": "object",
23
+ "description": "验证标准",
24
+ "properties": {
25
+ "noNewErrors": { "type": "boolean", "description": "要求无新错误,默认true" },
26
+ "elementVisible": { "type": "boolean", "description": "要求元素可见" },
27
+ "elementInteractable": { "type": "boolean", "description": "要求元素可交互" },
28
+ "textContains": { "type": "string", "description": "要求页面包含文本" },
29
+ "urlChanged": { "type": "boolean", "description": "要求URL发生变化" }
30
+ }
31
+ },
32
+ "timeout": {
33
+ "type": "number",
34
+ "description": "验证超时时间(毫秒),默认10000"
35
+ }
36
+ },
37
+ "required": ["selector"]
38
+ }
39
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "browser_visual_baseline",
3
+ "description": "为当前页面或指定元素创建视觉回归基线 PNG,默认全页截图并遮挡密码、token、apiKey 等敏感输入。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": { "type": "string", "description": "基线名称,不含扩展名" },
8
+ "selector": { "type": "string", "description": "可选 CSS 选择器;指定后只截取该元素" },
9
+ "fullPage": { "type": "boolean", "description": "是否全页截图,默认 true;selector 存在时忽略" },
10
+ "maskSelectors": {
11
+ "type": "array",
12
+ "description": "截图前额外遮挡/脱敏的 CSS 选择器列表",
13
+ "items": { "type": "string" }
14
+ },
15
+ "sessionName": { "type": "string", "description": "浏览器会话名称,默认当前活跃会话" }
16
+ },
17
+ "required": ["name"]
18
+ }
19
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "browser_visual_compare",
3
+ "description": "截取当前页面 actual PNG,与同名视觉基线对比并生成 diff PNG,返回 diffPixels、diffRatio、passed 和产物路径。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": { "type": "string", "description": "要对比的基线名称,不含扩展名" },
8
+ "selector": { "type": "string", "description": "可选 CSS 选择器;需与基线截图范围一致" },
9
+ "fullPage": { "type": "boolean", "description": "是否全页截图,默认 true;selector 存在时忽略" },
10
+ "maskSelectors": {
11
+ "type": "array",
12
+ "description": "截图前额外遮挡/脱敏的 CSS 选择器列表,用于忽略动态区域",
13
+ "items": { "type": "string" }
14
+ },
15
+ "maxDiffPixelRatio": { "type": "number", "description": "允许的最大差异像素比例,默认 0.01" },
16
+ "sessionName": { "type": "string", "description": "浏览器会话名称,默认当前活跃会话" }
17
+ },
18
+ "required": ["name"]
19
+ }
20
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "browser_visual_report",
3
+ "description": "列出视觉回归基线、actual、diff 产物和最近比较结果。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {}
7
+ }
8
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "browser_wait",
3
+ "description": "等待真实浏览器达到指定状态:元素出现/隐藏、文本出现、URL 包含、加载状态或固定时间。用于稳定异步流程。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "selector": { "type": "string", "description": "要等待的 CSS 选择器" },
8
+ "state": { "type": "string", "description": "选择器状态:attached/detached/visible/hidden,默认 visible" },
9
+ "text": { "type": "string", "description": "要等待出现的页面文本" },
10
+ "exact": { "type": "boolean", "description": "文本是否精确匹配,默认 false" },
11
+ "nth": { "type": "number", "description": "当文本匹配多个元素时选择第几个,默认 0" },
12
+ "urlContains": { "type": "string", "description": "等待当前 URL 包含该字符串" },
13
+ "loadState": { "type": "string", "description": "等待加载状态:load/domcontentloaded/networkidle" },
14
+ "ms": { "type": "number", "description": "固定等待毫秒数" },
15
+ "timeout": { "type": "number", "description": "超时时间,默认 10000ms" }
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "debug_investigate",
3
+ "description": "输入问题症状,自动汇总本轮 errors、events、network_detail、DOM 可见错误、storage、artifacts,并输出假设、证据链和下一步修复/复测建议。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "symptom": { "type": "string", "description": "问题现象,例如:点击 AI 要点后 403" },
8
+ "expected": { "type": "string", "description": "期望结果,例如:生成 AI 要点" },
9
+ "focus": { "type": "string", "description": "关注的 URL/API 关键字,例如 /api/ai/summarize" },
10
+ "urlContains": { "type": "string", "description": "focus 的别名,按 URL 过滤网络和事件" },
11
+ "statusMin": { "type": "number", "description": "只关注状态码大于等于该值的网络记录" },
12
+ "limit": { "type": "number", "description": "网络和事件最多返回条数,默认 20/50" },
13
+ "includeStorage": { "type": "boolean", "description": "是否包含 storage 脱敏快照,默认 true" },
14
+ "includeArtifacts": { "type": "boolean", "description": "是否包含 artifacts 列表,默认 true" }
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "error_fix_suggestion",
3
+ "description": "基于 errorSummary 和 contextFiles 返回最多 3 个最小修复建议;不自动改码。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "errorSummary": { "description": "错误摘要,可为字符串或对象" },
8
+ "contextFiles": { "type": "array", "items": { "type": "string" } },
9
+ "file": { "type": "string" }
10
+ },
11
+ "required": ["errorSummary"]
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "error_summary_md",
3
+ "description": "将错误聚合结果输出为 500 字以内 Markdown 摘要,不包含完整日志、重复堆栈或完整响应体。",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "evidence": { "type": "object" },
8
+ "limit": { "type": "number" }
9
+ }
10
+ }
11
+ }