chrome-devtools-frontend 1.0.1650232 → 1.0.1650677

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 (265) hide show
  1. package/.agents/skills/version-control/SKILL.md +5 -1
  2. package/config/typescript/tsconfig.base.json +1 -0
  3. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  4. package/front_end/core/host/UserMetrics.ts +0 -11
  5. package/front_end/devtools_compatibility.js +1 -2
  6. package/front_end/foundation/Universe.ts +7 -0
  7. package/front_end/models/ai_assistance/AiAgent2.ts +11 -1
  8. package/front_end/models/ai_assistance/README.md +4 -0
  9. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +2 -0
  10. package/front_end/models/ai_assistance/agents/AiAgent.ts +3 -0
  11. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +2 -0
  12. package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
  13. package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
  14. package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
  15. package/front_end/models/ai_assistance/skills/accessibility.md +13 -0
  16. package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +54 -0
  17. package/front_end/models/ai_assistance/tools/ResolveLighthousePath.ts +124 -0
  18. package/front_end/models/ai_assistance/tools/Tool.ts +12 -2
  19. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -0
  20. package/front_end/models/persistence/NetworkPersistenceManager.ts +9 -1
  21. package/front_end/panels/ai_assistance/components/ChatMessage.ts +3 -11
  22. package/front_end/panels/common/ExtensionServer.ts +70 -50
  23. package/front_end/panels/elements/ElementsPanel.ts +1 -1
  24. package/front_end/panels/js_timeline/js_timeline-meta.ts +1 -2
  25. package/front_end/panels/network/RequestHeadersView.ts +2 -2
  26. package/front_end/panels/network/components/RequestHeadersView.css +1 -0
  27. package/front_end/panels/network/components/ResponseHeaderSection.css +5 -1
  28. package/front_end/panels/recorder/testing/RecorderHelpers.ts +2 -0
  29. package/front_end/panels/timeline/timeline-meta.ts +1 -1
  30. package/front_end/third_party/chromium/README.chromium +1 -1
  31. package/front_end/third_party/puppeteer/README.chromium +2 -2
  32. package/front_end/third_party/puppeteer/package/README.md +14 -0
  33. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +60 -24
  34. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +271 -164
  35. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +2 -6
  36. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
  37. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js +2 -2
  38. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
  39. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +2 -2
  40. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
  41. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js +11 -7
  42. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js.map +1 -1
  43. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts.map +1 -1
  44. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js +3 -10
  45. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js.map +1 -1
  46. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +9 -4
  47. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
  48. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +4 -4
  49. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
  50. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.d.ts +13 -0
  51. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.d.ts.map +1 -1
  52. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.js +14 -0
  53. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.js.map +1 -1
  54. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js +5 -5
  55. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
  56. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +2 -2
  57. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
  58. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +3 -3
  59. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
  60. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js +5 -3
  61. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js.map +1 -1
  62. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserContext.js +6 -6
  63. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserContext.js.map +1 -1
  64. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts +1 -1
  65. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
  66. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +3 -3
  67. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
  68. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Deserializer.js +2 -2
  69. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Deserializer.js.map +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ExposedFunction.js +6 -6
  71. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ExposedFunction.js.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js +1 -1
  73. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js.map +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +1 -0
  75. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +3 -0
  77. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js +1 -1
  79. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
  81. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js +11 -0
  83. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.js +4 -4
  86. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.js.map +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js +3 -3
  88. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +13 -2
  91. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
  92. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/BrowserConnector.js +2 -2
  93. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/BrowserConnector.js.map +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js +2 -2
  95. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Coverage.js +2 -2
  97. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Coverage.js.map +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ElementHandle.js +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ElementHandle.js.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.d.ts +1 -0
  101. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.js +25 -4
  103. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.js.map +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExecutionContext.js +3 -3
  105. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExecutionContext.js.map +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Extension.d.ts.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Extension.js +9 -11
  108. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Extension.js.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +3 -3
  110. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +7 -7
  113. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/JSHandle.js +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/JSHandle.js.map +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts +3 -1
  119. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +18 -10
  121. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +1 -0
  123. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js +17 -11
  125. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js +3 -3
  127. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js +28 -10
  130. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js.map +1 -1
  131. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js +10 -6
  133. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
  134. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.d.ts +3 -0
  135. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  136. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.js +20 -5
  137. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.js.map +1 -1
  138. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.d.ts.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +11 -0
  140. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js +2 -2
  142. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/CallbackRegistry.js +2 -2
  144. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/CallbackRegistry.js.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Configuration.d.ts +4 -2
  146. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Configuration.d.ts.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts +26 -13
  148. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts +1 -6
  150. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js +24 -33
  152. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +2 -2
  154. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts +8 -1
  156. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +8 -1
  158. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.d.ts +2 -0
  160. package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.d.ts.map +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.js +4 -2
  162. package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/TextContent.d.ts.map +1 -1
  168. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/TextContent.js +15 -5
  169. package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/TextContent.js.map +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts +5 -1
  171. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +17 -16
  173. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +14 -9
  176. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/FirefoxLauncher.js +2 -2
  178. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/FirefoxLauncher.js.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js +2 -2
  180. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/PipeTransport.js +3 -3
  182. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/PipeTransport.js.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +20 -0
  184. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +38 -9
  186. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.d.ts +7 -0
  188. package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.d.ts.map +1 -0
  189. package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.js +16 -0
  190. package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.js.map +1 -0
  191. package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.d.ts +1 -0
  192. package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.d.ts.map +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.js +3 -8
  194. package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.js.map +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
  196. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
  197. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js.map +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/types.d.ts +60 -24
  201. package/front_end/third_party/puppeteer/package/package.json +4 -4
  202. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +4 -8
  203. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -2
  204. package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +10 -10
  205. package/front_end/third_party/puppeteer/package/src/api/JSHandle.ts +3 -10
  206. package/front_end/third_party/puppeteer/package/src/api/Page.ts +14 -8
  207. package/front_end/third_party/puppeteer/package/src/api/WebWorker.ts +30 -0
  208. package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +5 -5
  209. package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +2 -2
  210. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +3 -3
  211. package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +5 -3
  212. package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +6 -6
  213. package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +4 -4
  214. package/front_end/third_party/puppeteer/package/src/bidi/Deserializer.ts +2 -2
  215. package/front_end/third_party/puppeteer/package/src/bidi/ExposedFunction.ts +6 -6
  216. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -1
  217. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +4 -0
  218. package/front_end/third_party/puppeteer/package/src/bidi/Realm.ts +1 -1
  219. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +11 -0
  220. package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +6 -4
  221. package/front_end/third_party/puppeteer/package/src/cdp/Binding.ts +3 -3
  222. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +14 -2
  223. package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +2 -2
  224. package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +2 -2
  225. package/front_end/third_party/puppeteer/package/src/cdp/Coverage.ts +2 -2
  226. package/front_end/third_party/puppeteer/package/src/cdp/ElementHandle.ts +1 -1
  227. package/front_end/third_party/puppeteer/package/src/cdp/EmulationManager.ts +36 -4
  228. package/front_end/third_party/puppeteer/package/src/cdp/ExecutionContext.ts +3 -3
  229. package/front_end/third_party/puppeteer/package/src/cdp/Extension.ts +16 -17
  230. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +3 -3
  231. package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +12 -7
  232. package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +1 -1
  233. package/front_end/third_party/puppeteer/package/src/cdp/JSHandle.ts +1 -1
  234. package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +22 -11
  235. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +18 -10
  236. package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +3 -3
  237. package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +37 -12
  238. package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +11 -9
  239. package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +33 -5
  240. package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +11 -0
  241. package/front_end/third_party/puppeteer/package/src/common/BrowserWebSocketTransport.ts +2 -2
  242. package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +2 -2
  243. package/front_end/third_party/puppeteer/package/src/common/Configuration.ts +4 -2
  244. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +26 -13
  245. package/front_end/third_party/puppeteer/package/src/common/Debug.ts +30 -40
  246. package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +2 -2
  247. package/front_end/third_party/puppeteer/package/src/common/util.ts +9 -1
  248. package/front_end/third_party/puppeteer/package/src/environment.ts +7 -3
  249. package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
  250. package/front_end/third_party/puppeteer/package/src/injected/TextContent.ts +15 -5
  251. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +23 -23
  252. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +19 -13
  253. package/front_end/third_party/puppeteer/package/src/node/FirefoxLauncher.ts +2 -2
  254. package/front_end/third_party/puppeteer/package/src/node/NodeWebSocketTransport.ts +2 -2
  255. package/front_end/third_party/puppeteer/package/src/node/PipeTransport.ts +3 -3
  256. package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +44 -9
  257. package/front_end/third_party/puppeteer/package/src/node-env-setup.ts +18 -0
  258. package/front_end/third_party/puppeteer/package/src/puppeteer-core.ts +5 -9
  259. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  260. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  261. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
  262. package/front_end/tsconfig.json +1 -2
  263. package/inspector_overlay/tsconfig.json +3 -10
  264. package/mcp/tsconfig.json +1 -5
  265. package/package.json +1 -2
@@ -1,10 +1,14 @@
1
1
  ---
2
2
  name: devtools-version-control
3
- description: Use when managing branches, creating and uploading CLs, or handling stacked changes in the DevTools Gerrit-based workflow.
3
+ description: Use when starting a new task, creating a branch, switching branches, managing branches, creating and uploading CLs, or handling stacked changes in the DevTools Gerrit-based workflow. ALWAYS use this instead of running standard git checkout/switch commands for branch creation.
4
4
  ---
5
5
 
6
6
  # DevTools Version Control
7
7
 
8
+ > [!IMPORTANT]
9
+ > **DO NOT use standard Git commands like `git checkout -b` or `git switch -c` to create branches.**
10
+ > In Chrome DevTools, you MUST always use `git new-branch <branch-name>` (or `git new-branch --upstream_current <branch-name>` for stacked CLs). Standard commands fail to configure the correct upstream tracking branch required by `depot_tools` and Gerrit.
11
+
8
12
  ## Overview
9
13
  Chrome DevTools uses Gerrit for code review. The standard workflow is **one branch per Change List (CL)** and **one commit per branch**. Instead of multiple commits, you amend your single commit locally.
10
14
 
@@ -18,6 +18,7 @@
18
18
  "noFallthroughCasesInSwitch": true,
19
19
 
20
20
  "experimentalDecorators": true,
21
+ "allowSyntheticDefaultImports": true,
21
22
 
22
23
  "composite": true,
23
24
  "declaration": true,
@@ -556,6 +556,5 @@ export const enum EnumeratedHistogram {
556
556
  LighthouseCategoryUsed = 'DevTools.LighthouseCategoryUsed',
557
557
  SwatchActivated = 'DevTools.SwatchActivated',
558
558
  BuiltInAiAvailability = 'DevTools.BuiltInAiAvailability',
559
- ExtensionEvalTarget = 'DevTools.ExtensionEvalTarget',
560
559
  // LINT.ThenChange(/front_end/devtools_compatibility.js:EnumeratedHistogram)
561
560
  }
@@ -254,10 +254,6 @@ export class UserMetrics {
254
254
  'DevTools.Insights.ShortTeaserGenerationTime', timeInMilliseconds);
255
255
  }
256
256
 
257
- extensionEvalTarget(target: ExtensionEvalTarget): void {
258
- InspectorFrontendHostInstance.recordEnumeratedHistogram(
259
- EnumeratedHistogram.ExtensionEvalTarget, target, ExtensionEvalTarget.MAX_VALUE);
260
- }
261
257
  }
262
258
 
263
259
  /**
@@ -1197,10 +1193,3 @@ export const enum BuiltInAiAvailability {
1197
1193
  DISABLED_NO_GPU = 9,
1198
1194
  MAX_VALUE = 10,
1199
1195
  }
1200
-
1201
- export const enum ExtensionEvalTarget {
1202
- WEB_PAGE = 0,
1203
- SAME_EXTENSION = 1,
1204
- OTHER_EXTENSION = 2,
1205
- MAX_VALUE = 3,
1206
- }
@@ -444,8 +444,7 @@
444
444
  TimelineNavigationSettingState: 'DevTools.TimelineNavigationSettingState',
445
445
  SyncSetting: 'DevTools.SyncSetting',
446
446
  SwatchActivated: 'DevTools.SwatchActivated',
447
- BuiltInAiAvailability: 'DevTools.BuiltInAiAvailability',
448
- ExtensionEvalTarget: 'DevTools.ExtensionEvalTarget'
447
+ BuiltInAiAvailability: 'DevTools.BuiltInAiAvailability'
449
448
  // LINT.ThenChange(/front_end/core/host/InspectorFrontendHostAPI.ts:EnumeratedHistogram)
450
449
  };
451
450
 
@@ -14,6 +14,9 @@ export interface CreationOptions {
14
14
  }
15
15
 
16
16
  export class Universe {
17
+ // TODO(crbug.com/493763857): Once a singleton is no longer a singleton (i.e. it has no 'instance')
18
+ // static method, we can move it out of the `DevToolsContext` and store it
19
+ // directly on the `Universe`.
17
20
  readonly context: Root.DevToolsContext.DevToolsContext;
18
21
 
19
22
  constructor(options: CreationOptions) {
@@ -59,4 +62,8 @@ export class Universe {
59
62
  resourceMapping, targetManager, ignoreListManager, workspace);
60
63
  context.set(Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding, debuggerWorkspaceBinding);
61
64
  }
65
+
66
+ get pageResourceLoader(): SDK.PageResourceLoader.PageResourceLoader {
67
+ return this.context.get(SDK.PageResourceLoader.PageResourceLoader);
68
+ }
62
69
  }
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Host from '../../core/host/host.js';
6
6
  import * as SDK from '../../core/sdk/sdk.js';
7
+ import type * as LHModel from '../lighthouse/lighthouse.js';
7
8
 
8
9
  import {
9
10
  AiAgent,
@@ -27,6 +28,7 @@ import {ToolRegistry} from './tools/ToolRegistry.js';
27
28
  const SKILL_DISPLAY_NAMES: Record<SkillName, string> = {
28
29
  styling: 'CSS and styling',
29
30
  network: 'Network requests',
31
+ accessibility: 'Accessibility',
30
32
  };
31
33
 
32
34
  const preamble = `You are the most advanced unified AI assistant integrated into Chrome DevTools.
@@ -56,6 +58,10 @@ If the user asks a question that requires an investigation or debugging, use thi
56
58
  * **CRITICAL**: Do not write full Python programs or other scripts to interact with the environment. Only invoke the allowed tools.
57
59
  * **CRITICAL**: Do not expose raw, internal system identifiers (such as database IDs, internal node paths, or event keys) directly to the user. Use descriptive names instead.`;
58
60
 
61
+ export interface AiAgent2Options extends ExecuteJsAgentOptions {
62
+ lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
63
+ }
64
+
59
65
  export class AiAgent2 extends AiAgent<unknown> {
60
66
  // TODO: The static preamble is a placeholder and will eventually live server-side.
61
67
  readonly preamble = preamble;
@@ -65,6 +71,8 @@ export class AiAgent2 extends AiAgent<unknown> {
65
71
  #changes = new ChangeManager();
66
72
  #execJs: typeof executeJsCode;
67
73
  readonly #allowedOrigin?: () => AllowedOriginResult;
74
+ readonly #lighthouseRecording?:
75
+ (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
68
76
 
69
77
  get options(): RequestOptions {
70
78
  return {};
@@ -73,8 +81,9 @@ export class AiAgent2 extends AiAgent<unknown> {
73
81
  readonly #activeSkills = new Set<SkillName>();
74
82
  readonly #declaredTools = new Set<string>();
75
83
 
76
- constructor(opts: ExecuteJsAgentOptions) {
84
+ constructor(opts: AiAgent2Options) {
77
85
  super(opts);
86
+ this.#lighthouseRecording = opts.lighthouseRecording;
78
87
  this.#execJs = opts.execJs ?? executeJsCode;
79
88
  this.#allowedOrigin = opts.allowedOrigin;
80
89
  this.#declaredTools.add('learnSkills');
@@ -224,6 +233,7 @@ User query: ${enhancedQuery}`;
224
233
  getExecutionContextNode: () => this.context instanceof DOMNodeContext ? this.context.getItem() : null,
225
234
  getTarget: () => SDK.TargetManager.TargetManager.instance().primaryPageTarget(),
226
235
  getEstablishedOrigin: () => this.#getConversationOrigin(),
236
+ lighthouseRecording: this.#lighthouseRecording,
227
237
  };
228
238
  return tool.handler(args, context, options);
229
239
  },
@@ -105,6 +105,10 @@ To aid debugging, you can enable the AI Assistance logging. This setting is stor
105
105
 
106
106
  Now, when interacting with the AI and sending requests, you will see output logged to the console. You can use the `debugLog` helper to add your own logging as you are building out your feature.
107
107
 
108
+ ### Testing the Accessibility Skill
109
+
110
+ The accessibility skill (`accessibility.md`) relies on an active Lighthouse report. Before interacting with the agent using this skill, ensure you have run a Lighthouse audit on the page you are inspecting so that the `getLighthouseAudits` tool can retrieve the report data.
111
+
108
112
  ## Security & Origin Isolation
109
113
 
110
114
  To prevent prompt injection attacks and cross-origin data leaks, the AI Assistance panel enforces strict origin-lock boundaries:
@@ -483,6 +483,8 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
483
483
  name: 'DOM_TREE',
484
484
  data: {
485
485
  root: snapshot,
486
+ title: i18n.i18n.lockedString('Element details'),
487
+ accessibleRevealLabel: i18n.i18n.lockedString('Reveal element'),
486
488
  },
487
489
  });
488
490
 
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Host from '../../../core/host/host.js';
6
6
  import type {UrlString} from '../../../core/platform/DevToolsPath.js';
7
+ import type * as Platform from '../../../core/platform/platform.js';
7
8
  import * as Root from '../../../core/root/root.js';
8
9
  import type * as SDK from '../../../core/sdk/sdk.js';
9
10
  import type * as Protocol from '../../../generated/protocol.js';
@@ -274,6 +275,8 @@ export interface DomTreeAiWidget {
274
275
  name: 'DOM_TREE';
275
276
  data: {
276
277
  root: SDK.DOMModel.DOMNodeSnapshot,
278
+ title: Platform.UIString.LocalizedString,
279
+ accessibleRevealLabel: Platform.UIString.LocalizedString,
277
280
  networkRequest?: {
278
281
  url: string,
279
282
  size: number,
@@ -1051,6 +1051,8 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1051
1051
  data: {
1052
1052
  root: snapshot,
1053
1053
  networkRequest,
1054
+ title: lockedString('LCP element'),
1055
+ accessibleRevealLabel: lockedString('Reveal LCP element'),
1054
1056
  },
1055
1057
  });
1056
1058
  }
@@ -43,9 +43,11 @@ import * as AIQueries from './performance/AIQueries.js';
43
43
  import * as PerformanceAnnotations from './PerformanceAnnotations.js';
44
44
  import * as StorageItem from './StorageItem.js';
45
45
  import * as ExecuteJavaScript from './tools/ExecuteJavaScript.js';
46
+ import * as GetLighthouseAudits from './tools/GetLighthouseAudits.js';
46
47
  import * as GetNetworkRequestDetails from './tools/GetNetworkRequestDetails.js';
47
48
  import * as GetStyles from './tools/GetStyles.js';
48
49
  import * as ListNetworkRequests from './tools/ListNetworkRequests.js';
50
+ import * as ResolveLighthousePath from './tools/ResolveLighthousePath.js';
49
51
  import * as Tool from './tools/Tool.js';
50
52
  import * as ToolRegistry from './tools/ToolRegistry.js';
51
53
 
@@ -74,6 +76,7 @@ export {
74
76
  FileAgent,
75
77
  FileContext,
76
78
  FileFormatter,
79
+ GetLighthouseAudits,
77
80
  GetNetworkRequestDetails,
78
81
  GetStyles,
79
82
  GreenDevAgent,
@@ -90,6 +93,7 @@ export {
90
93
  PerformanceInsightFormatter,
91
94
  PerformanceTraceFormatter,
92
95
  RequestContext,
96
+ ResolveLighthousePath,
93
97
  StorageAgent,
94
98
  StorageItem,
95
99
  StylingAgent,
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  // This will become a union type as we add more skills (e.g. 'styling' | 'network').
6
- export type SkillName = 'styling'|'network';
6
+ export type SkillName = 'styling'|'network'|'accessibility';
7
7
 
8
8
  export interface Skill {
9
9
  name: SkillName;
@@ -2,6 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import {skill as accessibilitySkill} from './accessibility.skill.js';
5
6
  import {skill as networkSkill} from './network.skill.js';
6
7
  import type {Skill, SkillName} from './Skill.js';
7
8
  import {skill as stylingSkill} from './styling.skill.js';
@@ -9,4 +10,5 @@ import {skill as stylingSkill} from './styling.skill.js';
9
10
  export const SKILLS: Record<SkillName, Skill> = {
10
11
  styling: stylingSkill,
11
12
  network: networkSkill,
13
+ accessibility: accessibilitySkill,
12
14
  };
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: accessibility
3
+ description: Accessibility audits and report querying.
4
+ allowed-tools:
5
+ - getLighthouseAudits
6
+ - resolveLighthousePath
7
+ - getStyles
8
+ ---
9
+ You are an expert accessibility debugging assistant.
10
+ Use getLighthouseAudits to query details from the active report.
11
+
12
+ * ALWAYS use resolveLighthousePath to resolve failing element paths to backend node IDs.
13
+ * Once resolved, use getStyles on the backend node ID to inspect layout and styling properties.
@@ -0,0 +1,54 @@
1
+ // Copyright 2026 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as Host from '../../../core/host/host.js';
6
+ import type * as LHModel from '../../lighthouse/lighthouse.js';
7
+ import type {FunctionCallHandlerResult} from '../agents/AiAgent.js';
8
+ import {AccessibilityContext} from '../contexts/AccessibilityContext.js';
9
+ import {LighthouseFormatter} from '../data_formatters/LighthouseFormatter.js';
10
+
11
+ import {type BaseToolCapability, type Tool, type ToolArgs, ToolName} from './Tool.js';
12
+
13
+ export interface GetLighthouseAuditsArgs extends ToolArgs {
14
+ categoryId: LHModel.RunTypes.CategoryId;
15
+ }
16
+
17
+ export class GetLighthouseAuditsTool implements Tool<GetLighthouseAuditsArgs, {audits: string}, BaseToolCapability> {
18
+ readonly name = ToolName.GET_LIGHTHOUSE_AUDITS;
19
+ readonly description = 'Returns the audits for a specific Lighthouse category.';
20
+
21
+ readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetLighthouseAuditsArgs> = {
22
+ type: Host.AidaClient.ParametersTypes.OBJECT,
23
+ description: 'Arguments for retrieving Lighthouse category audits.',
24
+ nullable: false,
25
+ properties: {
26
+ categoryId: {
27
+ type: Host.AidaClient.ParametersTypes.STRING,
28
+ description: 'The category of audits to retrieve. E.g. "accessibility".',
29
+ nullable: false,
30
+ },
31
+ },
32
+ required: ['categoryId'],
33
+ };
34
+
35
+ displayInfoFromArgs(params: GetLighthouseAuditsArgs): {title: string, action: string} {
36
+ return {
37
+ title: `Getting Lighthouse audits for ${params.categoryId}`,
38
+ action: `getLighthouseAudits('${params.categoryId}')`,
39
+ };
40
+ }
41
+
42
+ async handler(params: GetLighthouseAuditsArgs,
43
+ context: BaseToolCapability): Promise<FunctionCallHandlerResult<{audits: string}>> {
44
+ if (!(context.conversationContext instanceof AccessibilityContext)) {
45
+ return {error: 'Error: Active context is not a Lighthouse report.'};
46
+ }
47
+ const report = context.conversationContext.getItem();
48
+ const audits = new LighthouseFormatter().audits(report, params.categoryId);
49
+ return {
50
+ result: {audits},
51
+ widgets: [{name: 'LIGHTHOUSE_REPORT', data: {report}}],
52
+ };
53
+ }
54
+ }
@@ -0,0 +1,124 @@
1
+ // Copyright 2026 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as Host from '../../../core/host/host.js';
6
+ import * as SDK from '../../../core/sdk/sdk.js';
7
+ import type {FunctionCallHandlerResult} from '../agents/AiAgent.js';
8
+ import {DOMNodeContext} from '../contexts/DOMNodeContext.js';
9
+
10
+ import {
11
+ type BaseToolCapability,
12
+ type OriginLockCapability,
13
+ type TargetCapability,
14
+ type Tool,
15
+ type ToolArgs,
16
+ ToolName,
17
+ } from './Tool.js';
18
+
19
+ /**
20
+ * Arguments for resolving a Lighthouse path to a backend node ID.
21
+ */
22
+ export interface ResolveLighthousePathArgs extends ToolArgs {
23
+ /**
24
+ * A Lighthouse-style element path.
25
+ * This is typically a comma-separated list of child indices and tag names
26
+ * representing the path from the root to the target element (e.g., "1,HTML,1,BODY").
27
+ */
28
+ path: string;
29
+ explanation: string;
30
+ }
31
+
32
+ /**
33
+ * A tool that resolves a Lighthouse-style element path to a backend node ID.
34
+ *
35
+ * This is used by the AI assistant to identify specific DOM nodes referred to in
36
+ * Lighthouse reports. It ensures the resolved node belongs to the locked origin.
37
+ */
38
+ export class ResolveLighthousePathTool implements
39
+ Tool<ResolveLighthousePathArgs, {backendNodeId: number}, BaseToolCapability&TargetCapability&OriginLockCapability> {
40
+ readonly name = ToolName.RESOLVE_LIGHTHOUSE_PATH;
41
+ readonly description = 'Resolves a Lighthouse path to a backend node ID.';
42
+
43
+ readonly parameters: Host.AidaClient.FunctionObjectParam<keyof ResolveLighthousePathArgs> = {
44
+ type: Host.AidaClient.ParametersTypes.OBJECT,
45
+ description: 'Arguments for resolving a Lighthouse path to a backend node ID.',
46
+ nullable: false,
47
+ properties: {
48
+ explanation: {
49
+ type: Host.AidaClient.ParametersTypes.STRING,
50
+ description: 'Reason for requesting this resolution.',
51
+ nullable: false,
52
+ },
53
+ path: {
54
+ type: Host.AidaClient.ParametersTypes.STRING,
55
+ description: 'Lighthouse path string.',
56
+ nullable: false,
57
+ },
58
+ },
59
+ required: ['explanation', 'path'],
60
+ };
61
+
62
+ displayInfoFromArgs(params: ResolveLighthousePathArgs): {
63
+ title: string,
64
+ thought: string,
65
+ action: string,
66
+ } {
67
+ return {
68
+ title: 'Resolving element path',
69
+ thought: params.explanation,
70
+ action: `resolveLighthousePath('${params.path}')`,
71
+ };
72
+ }
73
+
74
+ /**
75
+ * Handles the resolution request.
76
+ *
77
+ * It retrieves the node path using the target's DOMModel and verifies
78
+ * that the node's origin matches the established origin lock to prevent
79
+ * access to nodes from other origins.
80
+ */
81
+ async handler(
82
+ params: ResolveLighthousePathArgs,
83
+ context: BaseToolCapability&TargetCapability&OriginLockCapability,
84
+ ): Promise<FunctionCallHandlerResult<{backendNodeId: number}>> {
85
+ const establishedOrigin = context.getEstablishedOrigin();
86
+ if (!establishedOrigin) {
87
+ return {error: 'Error: Origin lock is not established.'};
88
+ }
89
+
90
+ const target = context.getTarget();
91
+ const domModel = target?.model(SDK.DOMModel.DOMModel);
92
+ if (!domModel) {
93
+ return {error: 'Error: Inspected target not found.'};
94
+ }
95
+
96
+ let nodeId;
97
+ try {
98
+ // Resolves the Lighthouse path (a representation of the path to a node)
99
+ // and ensures the node is loaded into the frontend DOM model, returning its ID.
100
+ nodeId = await domModel.pushNodeByPathToFrontend(params.path);
101
+ } catch {
102
+ return {error: 'Error: Could not find node by path.'};
103
+ }
104
+ if (!nodeId) {
105
+ return {error: 'Error: Could not find node by path.'};
106
+ }
107
+
108
+ const node = domModel.nodeForId(nodeId);
109
+ if (!node) {
110
+ return {error: 'Error: Could not retrieve resolved node.'};
111
+ }
112
+
113
+ const nodeContext = new DOMNodeContext(node);
114
+ // Security check: Ensure the resolved node belongs to the same origin
115
+ // that this AI assistance session is locked to, preventing cross-origin access.
116
+ if (!nodeContext.isOriginAllowed(establishedOrigin)) {
117
+ return {error: 'Error: Node does not belong to the locked origin.'};
118
+ }
119
+
120
+ return {
121
+ result: {backendNodeId: node.backendNodeId()},
122
+ };
123
+ }
124
+ }
@@ -4,6 +4,7 @@
4
4
 
5
5
  import type * as Host from '../../../core/host/host.js';
6
6
  import type * as SDK from '../../../core/sdk/sdk.js';
7
+ import type * as LHModel from '../../lighthouse/lighthouse.js';
7
8
  import type {ConversationContext, FunctionCallHandlerResult, FunctionHandlerOptions} from '../agents/AiAgent.js';
8
9
  import type {executeJsCode} from '../agents/ExecuteJavascript.js';
9
10
  import type {ChangeManager} from '../ChangeManager.js';
@@ -72,12 +73,19 @@ export interface OriginLockCapability {
72
73
  getEstablishedOrigin(): string|undefined;
73
74
  }
74
75
 
76
+ /**
77
+ * Capability for tools that need to run or query Lighthouse audits.
78
+ */
79
+ export interface LighthouseCapability {
80
+ lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
81
+ }
82
+
75
83
  /**
76
84
  * Unified context interface providing all capabilities available in the project.
77
85
  * Used by the agent to pass a complete context to any tool type-safely.
78
86
  */
79
- export type AllToolsContext =
80
- BaseToolCapability&PageExecutionCapability&StyleMutationCapability&TargetCapability&OriginLockCapability;
87
+ export type AllToolsContext = BaseToolCapability&PageExecutionCapability&StyleMutationCapability&TargetCapability&
88
+ OriginLockCapability&LighthouseCapability;
81
89
 
82
90
  /**
83
91
  * Base argument type for AI Tools.
@@ -89,6 +97,8 @@ export const enum ToolName {
89
97
  GET_STYLES = 'getStyles',
90
98
  LIST_NETWORK_REQUESTS = 'listNetworkRequests',
91
99
  GET_NETWORK_REQUEST_DETAILS = 'getNetworkRequestDetails',
100
+ GET_LIGHTHOUSE_AUDITS = 'getLighthouseAudits',
101
+ RESOLVE_LIGHTHOUSE_PATH = 'resolveLighthousePath',
92
102
  }
93
103
 
94
104
  /**
@@ -3,9 +3,11 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import {ExecuteJavaScriptTool} from './ExecuteJavaScript.js';
6
+ import {GetLighthouseAuditsTool} from './GetLighthouseAudits.js';
6
7
  import {GetNetworkRequestDetailsTool} from './GetNetworkRequestDetails.js';
7
8
  import {GetStylesTool} from './GetStyles.js';
8
9
  import {ListNetworkRequestsTool} from './ListNetworkRequests.js';
10
+ import {ResolveLighthousePathTool} from './ResolveLighthousePath.js';
9
11
  import {type AllToolsContext, type Tool, type ToolArgs, ToolName} from './Tool.js';
10
12
 
11
13
  /**
@@ -21,6 +23,8 @@ export const TOOLS = {
21
23
  [ToolName.GET_STYLES]: new GetStylesTool(),
22
24
  [ToolName.LIST_NETWORK_REQUESTS]: new ListNetworkRequestsTool(),
23
25
  [ToolName.GET_NETWORK_REQUEST_DETAILS]: new GetNetworkRequestDetailsTool(),
26
+ [ToolName.GET_LIGHTHOUSE_AUDITS]: new GetLighthouseAuditsTool(),
27
+ [ToolName.RESOLVE_LIGHTHOUSE_PATH]: new ResolveLighthousePathTool(),
24
28
  };
25
29
 
26
30
  /**
@@ -888,6 +888,10 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
888
888
  }
889
889
 
890
890
  handleHeaderInterception(interceptedRequest: SDK.NetworkManager.InterceptedRequest): Protocol.Fetch.HeaderEntry[] {
891
+ if (NetworkPersistenceManager.isForbiddenNetworkUrl(interceptedRequest.request.url as
892
+ Platform.DevToolsPath.UrlString)) {
893
+ return [];
894
+ }
891
895
  let result: Protocol.Fetch.HeaderEntry[] = interceptedRequest.responseHeaders || [];
892
896
  // 'rawPathFromUrl()''s return value is already (singly-)encoded, so we can
893
897
  // treat it as an 'EncodedPathString' here.
@@ -914,8 +918,12 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
914
918
  if (!this.#active || (method === 'OPTIONS')) {
915
919
  return;
916
920
  }
921
+ const requestUrl = interceptedRequest.request.url as Platform.DevToolsPath.UrlString;
922
+ if (NetworkPersistenceManager.isForbiddenNetworkUrl(requestUrl)) {
923
+ return;
924
+ }
917
925
  const proj = this.#project as FileSystem;
918
- const path = this.fileUrlFromNetworkUrl(interceptedRequest.request.url as Platform.DevToolsPath.UrlString);
926
+ const path = this.fileUrlFromNetworkUrl(requestUrl);
919
927
  const fileSystemUISourceCode = proj.uiSourceCodeForURL(path);
920
928
  let responseHeaders = this.handleHeaderInterception(interceptedRequest);
921
929
  if (!fileSystemUISourceCode && !responseHeaders.length) {
@@ -223,10 +223,6 @@ const UIStringsNotTranslate = {
223
223
  * @description Accessible label for the reveal button in the render-blocking requests widget.
224
224
  */
225
225
  revealRenderBlockingBreakdown: 'Reveal render-blocking requests',
226
- /**
227
- * @description Accessible label for the reveal button in the LCP element widget.
228
- */
229
- revealLcpElement: 'Reveal LCP element',
230
226
  /**
231
227
  * @description Accessible label for the reveal button in the performance summary widget.
232
228
  */
@@ -291,10 +287,6 @@ const UIStringsNotTranslate = {
291
287
  * @description Title for the 3rd parties widget.
292
288
  */
293
289
  thirdParties: '3rd parties',
294
- /**
295
- * @description Title for the LCP element widget.
296
- */
297
- lcpElement: 'LCP element',
298
290
  /**
299
291
  * @description Title for the performance summary widget.
300
292
  */
@@ -987,7 +979,7 @@ interface WidgetMakerResponse {
987
979
  // Can be null if the widget is only used to add the Reveal CTA.
988
980
  title: Lit.LitTemplate|Platform.UIString.LocalizedString|null;
989
981
  jslogContext?: string;
990
- accessibleRevealLabel: string;
982
+ accessibleRevealLabel: Platform.UIString.LocalizedString;
991
983
  }
992
984
 
993
985
  const nodeCache = new Map<Protocol.DOM.BackendNodeId, SDK.DOMModel.DOMNode>();
@@ -1620,8 +1612,8 @@ async function makeDomTreeWidget(widgetData: DomTreeAiWidget): Promise<WidgetMak
1620
1612
  return {
1621
1613
  renderedWidget,
1622
1614
  revealable: new SDK.DOMModel.DeferredDOMNode(root.domModel().target(), root.backendNodeId()),
1623
- accessibleRevealLabel: lockedString(UIStringsNotTranslate.revealLcpElement),
1624
- title: lockedString(UIStringsNotTranslate.lcpElement),
1615
+ accessibleRevealLabel: widgetData.data.accessibleRevealLabel,
1616
+ title: widgetData.data.title,
1625
1617
  jslogContext: 'dom-snapshot',
1626
1618
  };
1627
1619
  }