mirror of
https://github.com/ChromeDevTools/chrome-devtools-mcp.git
synced 2026-09-14 19:45:30 +08:00
feat: agentic browsing in lighthouse (#1931)
pending https://github.com/GoogleChrome/lighthouse/pull/16980 --------- Co-authored-by: Lusa Zhan <lusazhan@chromium.org> Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->
|
||||
|
||||
# Chrome DevTools MCP Tool Reference (~7005 cl100k_base tokens)
|
||||
# Chrome DevTools MCP Tool Reference (~7010 cl100k_base tokens)
|
||||
|
||||
- **[Input automation](#input-automation)** (9 tools)
|
||||
- [`click`](#click)
|
||||
@@ -346,7 +346,7 @@ so returned values have to be JSON-serializable.
|
||||
|
||||
### `lighthouse_audit`
|
||||
|
||||
**Description:** Get Lighthouse score and reports for accessibility, SEO and best practices. This excludes performance. For performance audits, run [`performance_start_trace`](#performance_start_trace)
|
||||
**Description:** Get Lighthouse score and reports for accessibility, SEO, best practices, and agentic browsing. This excludes performance. For performance audits, run [`performance_start_trace`](#performance_start_trace)
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
Generated
+49
-30
@@ -35,7 +35,7 @@
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"globals": "^17.0.0",
|
||||
"lighthouse": "13.1.0",
|
||||
"lighthouse": "13.2.0",
|
||||
"prettier": "^3.6.2",
|
||||
"puppeteer": "24.42.0",
|
||||
"rollup": "4.60.2",
|
||||
@@ -559,6 +559,7 @@
|
||||
"integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@hono/node-server": "^1.19.9",
|
||||
"ajv": "^8.17.1",
|
||||
@@ -637,6 +638,7 @@
|
||||
"integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
@@ -660,6 +662,7 @@
|
||||
"integrity": "sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
@@ -673,6 +676,7 @@
|
||||
"integrity": "sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@opentelemetry/semantic-conventions": "1.28.0"
|
||||
},
|
||||
@@ -699,6 +703,7 @@
|
||||
"integrity": "sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@opentelemetry/api-logs": "0.57.2",
|
||||
"@types/shimmer": "^1.2.0",
|
||||
@@ -1129,6 +1134,7 @@
|
||||
"integrity": "sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@opentelemetry/core": "1.30.1",
|
||||
"@opentelemetry/semantic-conventions": "1.28.0"
|
||||
@@ -1156,6 +1162,7 @@
|
||||
"integrity": "sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@opentelemetry/core": "1.30.1",
|
||||
"@opentelemetry/resources": "1.30.1",
|
||||
@@ -1184,6 +1191,7 @@
|
||||
"integrity": "sha512-R5R9tb2AXs2IRLNKLBJDynhkfmx7mX0vi8NkhZb3gUkPWHn6HXk5J8iQ/dql0U3ApfWym4kXXmBDRGO+oeOfjg==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
@@ -1205,9 +1213,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@paulirish/trace_engine": {
|
||||
"version": "0.0.61",
|
||||
"resolved": "https://registry.npmjs.org/@paulirish/trace_engine/-/trace_engine-0.0.61.tgz",
|
||||
"integrity": "sha512-/O08DwmUqIlJjUSPSZbNF8lWnlxaMsIOV6sS+uDKCxBd5i1psAmjEoG3JAqR6+nHD8X+YY474NW7SxUH/K+/kQ==",
|
||||
"version": "0.0.64",
|
||||
"resolved": "https://registry.npmjs.org/@paulirish/trace_engine/-/trace_engine-0.0.64.tgz",
|
||||
"integrity": "sha512-M1krpfOXJcIQPb6TI6iA+9hHRPv3AxFNHPp/iewzUqbfPL5VnTAqkt6xyqwVGmsuQrko7nV1O3MvLZ3SXfPxbA==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
@@ -2301,6 +2309,7 @@
|
||||
"integrity": "sha512-HDQH9O/47Dxi1ceDhBXdaldtf/WV9yRYMjbjCuNk3qnaTD564qwv61Y7+gTxwxRKzSrgO5uhtw584igXVuuZkA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.59.1",
|
||||
"@typescript-eslint/types": "8.59.1",
|
||||
@@ -2827,6 +2836,7 @@
|
||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -3152,9 +3162,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axe-core": {
|
||||
"version": "4.11.2",
|
||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.11.2.tgz",
|
||||
"integrity": "sha512-byD6KPdvo72y/wj2T/4zGEvvlis+PsZsn/yPS3pEO+sFpcrqRpX/TJCxvVaEsNeMrfQbCr7w163YqoD9IYwHXw==",
|
||||
"version": "4.11.4",
|
||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.11.4.tgz",
|
||||
"integrity": "sha512-KunSNx+TVpkAw/6ULfhnx+HWRecjqZGTOyquAoWHYLRSdK1tB5Ihce1ZW+UY3fj33bYAFWPu7W/GRSmmrCGuxA==",
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"engines": {
|
||||
@@ -3884,7 +3894,8 @@
|
||||
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1595872.tgz",
|
||||
"integrity": "sha512-kRfgp8vWVjBu/fbYCiVFiOqsCk3CrMKEo3WbgGT2NXK2dG7vawWPBljixajVgGK9II8rDO9G0oD0zLt3I1daRg==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause"
|
||||
"license": "BSD-3-Clause",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "8.0.4",
|
||||
@@ -4255,6 +4266,7 @@
|
||||
"integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.8.0",
|
||||
"@eslint-community/regexpp": "^4.12.1",
|
||||
@@ -4425,6 +4437,7 @@
|
||||
"integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@rtsao/scc": "^1.1.0",
|
||||
"array-includes": "^3.1.9",
|
||||
@@ -4695,6 +4708,7 @@
|
||||
"integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"accepts": "^2.0.0",
|
||||
"body-parser": "^2.2.1",
|
||||
@@ -5471,6 +5485,7 @@
|
||||
"integrity": "sha512-am5zfg3yu6sqn5yjKBNqhnTX7Cv+m00ox+7jbaKkrLMRJ4rAdldd1xPd/JzbBWspqaQv6RSTrgFN95EsfhC+7w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
}
|
||||
@@ -6340,19 +6355,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lighthouse": {
|
||||
"version": "13.1.0",
|
||||
"resolved": "https://registry.npmjs.org/lighthouse/-/lighthouse-13.1.0.tgz",
|
||||
"integrity": "sha512-H3Qi4fJBXbaCTdE3XzdONq6kH5wMoG4v5sv+1BgG4H+0nivSo35eTp/yryHEU7G4xepUJmmlvjS10OWGHFwU+Q==",
|
||||
"version": "13.2.0",
|
||||
"resolved": "https://registry.npmjs.org/lighthouse/-/lighthouse-13.2.0.tgz",
|
||||
"integrity": "sha512-Ra4GsuF+iPRMPUUAARD+zqFMLatr8lI9U3FnFaftsTAcIsi++oAXszlgrcFTpkJk7HYdYQRnhn57EuYUPgQCkQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@paulirish/trace_engine": "0.0.61",
|
||||
"@paulirish/trace_engine": "0.0.64",
|
||||
"@sentry/node": "^9.28.1",
|
||||
"axe-core": "^4.11.2",
|
||||
"axe-core": "^4.11.4",
|
||||
"chrome-launcher": "^1.2.1",
|
||||
"configstore": "^7.0.0",
|
||||
"csp_evaluator": "1.1.5",
|
||||
"devtools-protocol": "0.0.1608973",
|
||||
"devtools-protocol": "0.0.1621552",
|
||||
"enquirer": "^2.3.6",
|
||||
"http-link-header": "^1.1.1",
|
||||
"intl-messageformat": "^10.5.3",
|
||||
@@ -6363,12 +6378,12 @@
|
||||
"lodash-es": "^4.17.21",
|
||||
"lookup-closest-locale": "6.2.0",
|
||||
"open": "^8.4.0",
|
||||
"puppeteer-core": "^24.40.0",
|
||||
"puppeteer-core": "^24.42.0",
|
||||
"robots-parser": "^3.0.1",
|
||||
"speedline-core": "^1.4.3",
|
||||
"third-party-web": "^0.29.0",
|
||||
"tldts-icann": "^7.0.27",
|
||||
"web-features": "^3.21.0",
|
||||
"tldts-icann": "^7.0.29",
|
||||
"web-features": "^3.25.0",
|
||||
"ws": "^7.0.0",
|
||||
"yargs": "^17.3.1",
|
||||
"yargs-parser": "^21.0.0"
|
||||
@@ -6426,9 +6441,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lighthouse/node_modules/devtools-protocol": {
|
||||
"version": "0.0.1608973",
|
||||
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1608973.tgz",
|
||||
"integrity": "sha512-Tpm17fxYzt+J7VrGdc1k8YdRqS3YV7se/M6KeemEqvUbq/n7At1rWVuXMxQgpWkdwSdIEKYbU//Bve+Shm4YNQ==",
|
||||
"version": "0.0.1621552",
|
||||
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1621552.tgz",
|
||||
"integrity": "sha512-uaHF17cjNtGKOVZUoh8W0PGuEwR3pWzY5kz3sj7PK8N/SyBKG3cPnQIehVDDJkSdph6Omv+GlP7GdM/b4DTgJQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
@@ -7731,6 +7746,7 @@
|
||||
"integrity": "sha512-J9qZyW++QK/09NyN/zeO0dG/1GdGfyp9lV8ajHnRVLfo/uFsbji5mHnDgn/qYdUHyCkM2N+8VyspgZclfAh0eQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/estree": "1.0.8"
|
||||
},
|
||||
@@ -8685,20 +8701,20 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tldts-core": {
|
||||
"version": "7.0.28",
|
||||
"resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.0.28.tgz",
|
||||
"integrity": "sha512-7W5Efjhsc3chVdFhqtaU0KtK32J37Zcr9RKtID54nG+tIpcY79CQK/veYPODxtD/LJ4Lue66jvrQzIX2Z2/pUQ==",
|
||||
"version": "7.0.29",
|
||||
"resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.0.29.tgz",
|
||||
"integrity": "sha512-W99NuU7b1DcG3uJ3v9k9VztCH3WialNbBkBft5wCs8V8mexu0XQqaZEYb9l9RNNzK8+3EJ9PKWB0/RUtTQ/o+Q==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tldts-icann": {
|
||||
"version": "7.0.28",
|
||||
"resolved": "https://registry.npmjs.org/tldts-icann/-/tldts-icann-7.0.28.tgz",
|
||||
"integrity": "sha512-brkN3yIgYTzBpSxB71XYBwUMDgutmKmA+6TWzgGD/EPcvCc6LHMTRaYj9ik1u3BxhSW53qIK/7cgjA2rF7BgbA==",
|
||||
"version": "7.0.29",
|
||||
"resolved": "https://registry.npmjs.org/tldts-icann/-/tldts-icann-7.0.29.tgz",
|
||||
"integrity": "sha512-+nmAzuVPQO6j50dVE1/c8tnTGEyvvfU1+/6EWF1C6YZQ2M+qH/LfIet0pWHFkKphZIOvjQHdk2NqLKduGTjRDA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tldts-core": "^7.0.28"
|
||||
"tldts-core": "^7.0.29"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
@@ -8886,6 +8902,7 @@
|
||||
"integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
@@ -8961,6 +8978,7 @@
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"napi-postinstall": "^0.3.0"
|
||||
},
|
||||
@@ -9017,9 +9035,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/web-features": {
|
||||
"version": "3.22.1",
|
||||
"resolved": "https://registry.npmjs.org/web-features/-/web-features-3.22.1.tgz",
|
||||
"integrity": "sha512-aHlGO8NhNf19aQH5yWd6gFMEWZZh0W91bRMBlNLTaEASF0Ko1Rm4KnY/9rV69lYd9LyQTaJQBVae4PtDxfFJdg==",
|
||||
"version": "3.25.0",
|
||||
"resolved": "https://registry.npmjs.org/web-features/-/web-features-3.25.0.tgz",
|
||||
"integrity": "sha512-p4feOVUn9DU/xUdcGcM+GLWY1OPDXaTWbPNvI1jqPRg+UTQEl4RzEiRtLw1IBd5GE/XApcOYXr7ZRuWw6DR2MA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
@@ -9377,6 +9395,7 @@
|
||||
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"globals": "^17.0.0",
|
||||
"lighthouse": "13.1.0",
|
||||
"lighthouse": "13.2.0",
|
||||
"prettier": "^3.6.2",
|
||||
"puppeteer": "24.42.0",
|
||||
"rollup": "4.60.2",
|
||||
|
||||
@@ -397,7 +397,7 @@ export const commands: Commands = {
|
||||
},
|
||||
lighthouse_audit: {
|
||||
description:
|
||||
'Get Lighthouse score and reports for accessibility, SEO and best practices. This excludes performance. For performance audits, run performance_start_trace',
|
||||
'Get Lighthouse score and reports for accessibility, SEO, best practices, and agentic browsing. This excludes performance. For performance audits, run performance_start_trace',
|
||||
category: 'Debugging',
|
||||
args: {
|
||||
mode: {
|
||||
|
||||
@@ -120,7 +120,7 @@ SOFTWARE.
|
||||
|
||||
Name: axe-core
|
||||
URL: https://www.deque.com/axe/
|
||||
Version: 4.11.2
|
||||
Version: 4.11.4
|
||||
License: MPL-2.0
|
||||
|
||||
Mozilla Public License, version 2.0
|
||||
@@ -1556,7 +1556,7 @@ SOFTWARE.
|
||||
|
||||
Name: puppeteer-core
|
||||
URL: https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer-core
|
||||
Version: 24.40.0
|
||||
Version: 24.42.0
|
||||
License: Apache-2.0
|
||||
|
||||
-------------------- DEPENDENCY DIVIDER --------------------
|
||||
@@ -1622,7 +1622,7 @@ SOFTWARE.
|
||||
|
||||
Name: tldts-core
|
||||
URL: https://github.com/remusao/tldts#readme
|
||||
Version: 7.0.27
|
||||
Version: 7.0.29
|
||||
License: MIT
|
||||
|
||||
Copyright (c) 2017 Thomas Parisot, 2018 Rémi Berson
|
||||
@@ -1644,7 +1644,7 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTH
|
||||
|
||||
Name: tldts-icann
|
||||
URL: https://github.com/remusao/tldts#readme
|
||||
Version: 7.0.27
|
||||
Version: 7.0.29
|
||||
License: MIT
|
||||
|
||||
Copyright (c) 2017 Thomas Parisot, 2018 Rémi Berson
|
||||
@@ -1686,7 +1686,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
Name: web-features
|
||||
URL: git+https://github.com/web-platform-dx/web-features.git
|
||||
Version: 3.21.0
|
||||
Version: 3.25.0
|
||||
License: Apache-2.0
|
||||
|
||||
Apache License
|
||||
|
||||
Vendored
+5
-2
@@ -59,16 +59,19 @@ import {
|
||||
snapshot as snapshotImpl,
|
||||
navigation as navigationImpl,
|
||||
generateReport as generateReportImpl,
|
||||
agenticBrowsingConfig as agenticBrowsingConfigImpl,
|
||||
} from './lighthouse-devtools-mcp-bundle.js';
|
||||
|
||||
export const agenticBrowsingConfig = agenticBrowsingConfigImpl;
|
||||
|
||||
export const snapshot = snapshotImpl as (
|
||||
page: Page,
|
||||
options: {flags?: Flags},
|
||||
options: {flags?: Flags; config?: object},
|
||||
) => Promise<RunnerResult>;
|
||||
export const navigation = navigationImpl as (
|
||||
page: Page,
|
||||
url: string,
|
||||
options: {flags?: Flags},
|
||||
options: {flags?: Flags; config?: object},
|
||||
) => Promise<RunnerResult>;
|
||||
export const generateReport = generateReportImpl as (
|
||||
lhr: Result,
|
||||
|
||||
+10198
-8752
File diff suppressed because it is too large
Load Diff
+15
-8
@@ -14,6 +14,7 @@ import {
|
||||
type Flags,
|
||||
type RunnerResult,
|
||||
type OutputMode,
|
||||
agenticBrowsingConfig,
|
||||
} from '../third_party/index.js';
|
||||
|
||||
import {ToolCategory} from './categories.js';
|
||||
@@ -22,7 +23,7 @@ import {definePageTool} from './ToolDefinition.js';
|
||||
|
||||
export const lighthouseAudit = definePageTool({
|
||||
name: 'lighthouse_audit',
|
||||
description: `Get Lighthouse score and reports for accessibility, SEO and best practices. This excludes performance. For performance audits, run ${startTrace.name}`,
|
||||
description: `Get Lighthouse score and reports for accessibility, SEO, best practices, and agentic browsing. This excludes performance. For performance audits, run ${startTrace.name}`,
|
||||
annotations: {
|
||||
category: ToolCategory.DEBUGGING,
|
||||
readOnlyHint: false,
|
||||
@@ -46,7 +47,12 @@ export const lighthouseAudit = definePageTool({
|
||||
blockedByDialog: true,
|
||||
handler: async (request, response, context) => {
|
||||
const page = request.page;
|
||||
const categories = ['accessibility', 'seo', 'best-practices'];
|
||||
const categories = [
|
||||
'accessibility',
|
||||
'seo',
|
||||
'best-practices',
|
||||
'agentic-browsing',
|
||||
];
|
||||
const formats = ['json', 'html'] as OutputMode[];
|
||||
const {
|
||||
mode = 'navigation',
|
||||
@@ -83,16 +89,17 @@ export const lighthouseAudit = definePageTool({
|
||||
};
|
||||
}
|
||||
|
||||
const options: {flags: Flags; config?: object} = {
|
||||
flags,
|
||||
config: agenticBrowsingConfig,
|
||||
};
|
||||
|
||||
let result: RunnerResult | undefined;
|
||||
try {
|
||||
if (mode === 'navigation') {
|
||||
result = await navigation(page.pptrPage, page.pptrPage.url(), {
|
||||
flags,
|
||||
});
|
||||
result = await navigation(page.pptrPage, page.pptrPage.url(), options);
|
||||
} else {
|
||||
result = await snapshot(page.pptrPage, {
|
||||
flags,
|
||||
});
|
||||
result = await snapshot(page.pptrPage, options);
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
|
||||
Reference in New Issue
Block a user