chrome-devtools-frontend 1.0.1652307 → 1.0.1656291

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 (267) hide show
  1. package/.agents/skills/fixing-skipped-tests/SKILL.md +32 -0
  2. package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
  3. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +116 -0
  4. package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +82 -0
  5. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +123 -0
  6. package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +125 -0
  7. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +75 -0
  8. package/AUTHORS +1 -0
  9. package/config/owner/COMMON_OWNERS +0 -4
  10. package/docs/get_the_code.md +1 -2
  11. package/docs/playbook.md +1 -1
  12. package/docs/ui_engineering.md +3 -1
  13. package/eslint.config.mjs +0 -5
  14. package/front_end/Tests.js +1 -0
  15. package/front_end/core/common/Settings.ts +47 -30
  16. package/front_end/core/sdk/CPUThrottlingManager.ts +23 -167
  17. package/front_end/core/sdk/CSSMetadata.ts +23 -0
  18. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
  19. package/front_end/core/sdk/ConsoleModel.ts +13 -11
  20. package/front_end/core/sdk/DOMDebuggerModel.ts +11 -5
  21. package/front_end/core/sdk/DOMModel.ts +4 -0
  22. package/front_end/core/sdk/EmulationModel.ts +4 -0
  23. package/front_end/core/sdk/EventBreakpointsModel.ts +9 -5
  24. package/front_end/core/sdk/IsolateManager.ts +6 -6
  25. package/front_end/core/sdk/ResourceTreeModel.ts +8 -5
  26. package/front_end/core/sdk/TargetManager.ts +17 -0
  27. package/front_end/entrypoints/devtools_app/devtools_app.ts +0 -1
  28. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
  29. package/front_end/entrypoints/main/MainImpl.ts +12 -42
  30. package/front_end/foundation/Universe.ts +116 -3
  31. package/front_end/generated/InspectorBackendCommands.ts +11 -6
  32. package/front_end/generated/SupportedCSSProperties.js +124 -34
  33. package/front_end/generated/protocol-mapping.d.ts +8 -0
  34. package/front_end/generated/protocol-proxy-api.d.ts +15 -0
  35. package/front_end/generated/protocol.ts +94 -1
  36. package/front_end/models/ai_assistance/AiConversation.ts +2 -7
  37. package/front_end/models/ai_assistance/README.md +4 -3
  38. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
  39. package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +1 -1
  40. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
  41. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +13 -320
  42. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
  43. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -358
  44. package/front_end/models/ai_assistance/ai_assistance.ts +6 -8
  45. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
  46. package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +0 -1
  47. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +0 -2
  48. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
  49. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
  50. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
  51. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -14
  52. package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
  53. package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
  54. package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
  55. package/front_end/models/ai_assistance/tools/README.md +21 -1
  56. package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
  57. package/front_end/models/ai_assistance/tools/Tool.ts +6 -1
  58. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -2
  59. package/front_end/models/autofill_manager/AutofillManager.ts +6 -15
  60. package/front_end/models/bindings/NetworkProject.ts +4 -8
  61. package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
  62. package/front_end/models/emulation/DeviceModeModel.ts +24 -0
  63. package/front_end/models/emulation/EmulatedDevices.ts +108 -0
  64. package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
  65. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
  66. package/front_end/models/issues_manager/IssuesManager.ts +10 -6
  67. package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
  68. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  69. package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
  70. package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
  71. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
  72. package/front_end/models/logs/LogManager.ts +25 -10
  73. package/front_end/models/logs/NetworkLog.ts +24 -19
  74. package/front_end/models/persistence/AutomaticFileSystemManager.ts +14 -13
  75. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +26 -14
  76. package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
  77. package/front_end/models/persistence/IsolatedFileSystemManager.ts +22 -11
  78. package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
  79. package/front_end/models/persistence/PersistenceImpl.ts +4 -5
  80. package/front_end/models/project_settings/ProjectSettingsModel.ts +12 -11
  81. package/front_end/models/trace/EntityMapper.ts +1 -1
  82. package/front_end/models/trace/handlers/ScreenshotsHandler.ts +14 -59
  83. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +12 -38
  84. package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
  85. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
  86. package/front_end/panels/application/DeviceBoundSessionsView.ts +15 -3
  87. package/front_end/panels/application/FrameDetailsView.ts +2 -1
  88. package/front_end/panels/application/IndexedDBViews.ts +38 -36
  89. package/front_end/panels/application/ServiceWorkersView.ts +23 -16
  90. package/front_end/panels/application/components/AdsView.ts +4 -0
  91. package/front_end/panels/autofill/AutofillView.ts +1 -1
  92. package/front_end/panels/autofill/autofill-meta.ts +3 -2
  93. package/front_end/panels/common/CPUThrottlingOption.ts +142 -0
  94. package/front_end/panels/common/ThrottlingUtils.ts +9 -4
  95. package/front_end/panels/common/common.ts +1 -1
  96. package/front_end/panels/console/ConsoleViewMessage.ts +45 -0
  97. package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
  98. package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
  99. package/front_end/panels/elements/ElementsPanel.ts +0 -74
  100. package/front_end/panels/elements/ElementsTreeOutline.ts +5 -4
  101. package/front_end/panels/emulation/DeviceModeToolbar.ts +46 -45
  102. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
  103. package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
  104. package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
  105. package/front_end/panels/layers/LayersPanel.ts +1 -1
  106. package/front_end/panels/mobile_throttling/CalibrationController.ts +6 -5
  107. package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +1 -1
  108. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +40 -13
  109. package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +13 -17
  110. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +79 -30
  111. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
  112. package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
  113. package/front_end/panels/network/NetworkLogView.ts +28 -9
  114. package/front_end/panels/network/NetworkPanel.ts +1 -63
  115. package/front_end/panels/network/RequestInitiatorView.ts +29 -4
  116. package/front_end/panels/network/components/HeaderSectionRow.css +9 -7
  117. package/front_end/panels/network/components/HeaderSectionRow.ts +20 -1
  118. package/front_end/panels/network/components/RequestHeaderSection.css +5 -3
  119. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -2
  120. package/front_end/panels/network/components/RequestHeadersView.css +1 -1
  121. package/front_end/panels/network/network.ts +2 -0
  122. package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
  123. package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
  124. package/front_end/panels/security/SecurityPanel.ts +36 -23
  125. package/front_end/panels/settings/SettingsScreen.ts +18 -103
  126. package/front_end/panels/settings/settings-meta.ts +0 -24
  127. package/front_end/panels/timeline/TimelineController.ts +3 -2
  128. package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
  129. package/front_end/panels/timeline/TimelinePanel.ts +52 -11
  130. package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +20 -18
  131. package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
  132. package/front_end/panels/timeline/components/MetricCard.ts +18 -18
  133. package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
  134. package/front_end/panels/timeline/components/metricCard.css +4 -4
  135. package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -0
  136. package/front_end/panels/utils/utils.ts +25 -24
  137. package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
  138. package/front_end/panels/whats_new/resources/WNDT.md +1 -1
  139. package/front_end/third_party/chromium/README.chromium +1 -1
  140. package/front_end/third_party/puppeteer/README.chromium +2 -2
  141. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +34 -55
  142. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +96 -83
  143. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +10 -1
  144. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.d.ts.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.js.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +3 -2
  152. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.d.ts +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.js +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +2 -1
  162. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.js.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -2
  166. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +5 -2
  168. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +23 -13
  173. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +4 -1
  176. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Input.js +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.d.ts.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.js.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +3 -41
  183. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
  184. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +4 -2
  188. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts +5 -0
  190. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts.map +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js +5 -5
  196. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js.map +1 -1
  197. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/types.d.ts +34 -55
  200. package/front_end/third_party/puppeteer/package/package.json +4 -4
  201. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
  202. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -3
  203. package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +3 -1
  204. package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +3 -2
  205. package/front_end/third_party/puppeteer/package/src/api/Realm.ts +1 -2
  206. package/front_end/third_party/puppeteer/package/src/api/Target.ts +1 -1
  207. package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +1 -2
  208. package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +3 -1
  209. package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +1 -3
  210. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +13 -3
  211. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +1 -1
  212. package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +24 -13
  213. package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +4 -1
  214. package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +1 -1
  215. package/front_end/third_party/puppeteer/package/src/cdp/LifecycleWatcher.ts +1 -4
  216. package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +2 -4
  217. package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -76
  218. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +1 -4
  219. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -1
  220. package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +5 -0
  221. package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
  222. package/front_end/third_party/puppeteer/package/src/util/httpUtils.ts +5 -5
  223. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  224. package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -1
  225. package/front_end/ui/components/dialogs/Dialog.ts +3 -0
  226. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +0 -7
  227. package/front_end/ui/helpers/OpenInNewTab.ts +15 -7
  228. package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
  229. package/front_end/ui/legacy/ListWidget.ts +12 -0
  230. package/front_end/ui/legacy/SplitWidget.ts +12 -11
  231. package/front_end/ui/legacy/TabbedPane.ts +1 -108
  232. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -0
  233. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +192 -139
  234. package/front_end/ui/legacy/components/data_grid/DataGridExporter.ts +89 -0
  235. package/front_end/ui/legacy/components/data_grid/dataGrid.css +10 -0
  236. package/front_end/ui/legacy/components/data_grid/data_grid.ts +3 -1
  237. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
  238. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
  239. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +89 -40
  240. package/front_end/ui/legacy/treeoutline.css +1 -1
  241. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  242. package/package.json +4 -3
  243. package/front_end/Images/navigationControls.png +0 -0
  244. package/front_end/Images/navigationControls_2x.png +0 -0
  245. package/front_end/Images/popoverArrows.png +0 -0
  246. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -746
  247. package/front_end/entrypoints/greendev_floaty/floaty.css +0 -301
  248. package/front_end/entrypoints/greendev_floaty/floaty.html +0 -38
  249. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -415
  250. package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +0 -834
  251. package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +0 -53
  252. package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +0 -117
  253. package/front_end/models/annotations/AnnotationRepository.ts +0 -238
  254. package/front_end/models/annotations/AnnotationType.ts +0 -10
  255. package/front_end/models/annotations/README.md +0 -7
  256. package/front_end/models/annotations/annotations.ts +0 -6
  257. package/front_end/models/greendev/Prototypes.ts +0 -68
  258. package/front_end/models/greendev/README.md +0 -5
  259. package/front_end/models/greendev/greendev.ts +0 -5
  260. package/front_end/panels/common/Annotation.ts +0 -184
  261. package/front_end/panels/common/AnnotationManager.ts +0 -208
  262. package/front_end/panels/common/annotation.css +0 -40
  263. package/front_end/panels/greendev/GreenDevPanel.css +0 -282
  264. package/front_end/panels/greendev/GreenDevPanel.ts +0 -364
  265. package/front_end/panels/greendev/GreenDevShared.ts +0 -13
  266. package/front_end/panels/greendev/greendev-meta.ts +0 -52
  267. package/front_end/panels/greendev/greendev.ts +0 -9
@@ -5,10 +5,6 @@
5
5
  import * as Host from '../../../core/host/host.js';
6
6
  import * as Root from '../../../core/root/root.js';
7
7
  import * as SDK from '../../../core/sdk/sdk.js';
8
- import * as Protocol from '../../../generated/protocol.js';
9
- import * as Greendev from '../../../models/greendev/greendev.js';
10
- import * as Annotations from '../../annotations/annotations.js';
11
- import * as Emulation from '../../emulation/emulation.js';
12
8
  import {ChangeManager} from '../ChangeManager.js';
13
9
  import {ExtensionScope} from '../ExtensionScope.js';
14
10
  import {AI_ASSISTANCE_CSS_CLASS_NAME} from '../injected.js';
@@ -19,8 +15,6 @@ import {
19
15
  AiAgent,
20
16
  type ContextResponse,
21
17
  type ConversationContext,
22
- type FunctionCallHandlerResult,
23
- type MultimodalInput,
24
18
  MultimodalInputType,
25
19
  type RequestOptions,
26
20
  ResponseType
@@ -69,40 +63,6 @@ If the user asks a question that requires an investigation of a problem, use thi
69
63
  - [Suggestion 1]
70
64
  - [Suggestion 2]`;
71
65
 
72
- const emulationInstructions = `
73
- # Emulation and Screenshots
74
-
75
- * If asked to verify whether the page is visually broken or if there are display problems with specific devices, use the \`activateDeviceEmulation\` tool. This tool will activate emulation for a specified device and capture a screenshot.
76
- * **DEVICE SELECTION**: You must choose the most closely related device match from the allowed list.
77
- * If the user asks about a specific device (e.g., "iPhone 6"), choose the closest match (e.g., "iPhone 6/7/8").
78
- * If the user specifies a generic category (e.g., "Android phone", "iPhone", "Samsung"), choose the device with the highest version number available in that category (e.g., "Pixel 7" or "Samsung Galaxy S20" for Android, "iPhone 14 Pro Max" for iPhone).
79
- * **VISION DEFICIENCY**: If the user asks about checking for color blindness or vision issues, you can pass an optional \`visionDeficiency\` parameter to \`activateDeviceEmulation\`. Allowed values are: 'blurredVision', 'reducedContrast', 'achromatopsia', 'deuteranopia', 'protanopia', 'tritanopia'.
80
- * **IMPORTANT**: This is a **TWO-STEP** process.
81
- * **STEP 1**: Call \`activateDeviceEmulation\`. After calling this tool, YOU MUST STOP and tell the user that the screenshot has been captured and ask them whether they would like you to focus on specific sections of the screenshot or review it all for possible problems.
82
- * **STEP 2**: The captured screenshot will be automatically attached to the user's **NEXT** query.
83
- * **CRITICAL**: DO NOT try to investigate/analyze the page state or element visibility automatically. But, after the user has requested to analyze the page, you can prompt the user to select one of the problematic elements if they want to diagnose further.
84
- * **CRITICAL**: The output of the analysis should only be in json form (no supplemental text) and the json should list the problems found on the device, with a short description of the problem. If identical problems are identified acress multiple devices, feel free to combine sections.
85
- * **CRITICAL**: ALWAYS escape single and double quotes within the json output strings (\' and \").
86
- *
87
- * Example (with no duplication):
88
-
89
- [
90
- {
91
- "Problem": "Element not resizing",
92
- "Element": "Hero banner",
93
- "NodeId": "23",
94
- "Details": "The \"hero\" element is not resizing because... etc etc."
95
- }
96
- ]
97
-
98
- # Additional notes:
99
-
100
- When referring to an element for which you know the nodeId, annotate your output using markdown link syntax:
101
- - For example, if nodeId is 23: ([link](#node-23))
102
- - Always prefix the nodeId with the 'node-' prefix when using the markdown syntax.
103
- - This link will reveal the element in the Elements panel
104
- - Never mention node or nodeId when referring to the element, and especially not in the link text.`;
105
-
106
66
  /* clang-format on */
107
67
 
108
68
  const promptForScreenshot =
@@ -144,8 +104,7 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
144
104
  readonly preamble = preamble;
145
105
  readonly clientFeature = Host.AidaClient.ClientFeature.CHROME_STYLING_AGENT;
146
106
  get userTier(): string|undefined {
147
- const greenDevEmulationEnabled = Greendev.Prototypes.instance().isEnabled('emulationCapabilities');
148
- return greenDevEmulationEnabled ? 'TESTERS' : Root.Runtime.hostConfig.devToolsFreestyler?.userTier;
107
+ return Root.Runtime.hostConfig.devToolsFreestyler?.userTier;
149
108
  }
150
109
  get executionMode(): Root.Runtime.HostConfigFreestylerExecutionMode {
151
110
  return Root.Runtime.hostConfig.devToolsFreestyler?.executionMode ??
@@ -170,9 +129,6 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
170
129
 
171
130
  #changes: ChangeManager;
172
131
  #createExtensionScope: CreateExtensionScopeFunction;
173
- #greenDevEmulationScreenshot: string|null = null;
174
- #greenDevEmulationAxTree: string|null = null;
175
- #hasAddedEmulationInstructions = false;
176
132
 
177
133
  constructor(opts: ExecuteJsAgentOptions) {
178
134
  super(opts);
@@ -226,314 +182,12 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
226
182
  ),
227
183
  });
228
184
 
229
- if (Annotations.AnnotationRepository.annotationsEnabled()) {
230
- this.declareFunction<{
231
- elementId: string,
232
- annotationMessage: string,
233
- }>('addElementAnnotation', {
234
- description: 'Adds a visual annotation in the Elements panel, attached to a node with ' +
235
- 'the specific UID provided. Use it to highlight nodes in the Elements panel ' +
236
- 'and provide contextual suggestions to the user related to their queries.',
237
- parameters: {
238
- type: Host.AidaClient.ParametersTypes.OBJECT,
239
- description: '',
240
- nullable: false,
241
- properties: {
242
- elementId: {
243
- type: Host.AidaClient.ParametersTypes.STRING,
244
- description: 'The UID of the element to annotate.',
245
- nullable: false,
246
- },
247
- annotationMessage: {
248
- type: Host.AidaClient.ParametersTypes.STRING,
249
- description: 'The message the annotation should show to the user.',
250
- nullable: false,
251
- },
252
- },
253
- required: ['elementId', 'annotationMessage']
254
- },
255
- handler: async params => {
256
- return await this.addElementAnnotation(params.elementId, params.annotationMessage);
257
- },
258
- });
259
- }
260
-
261
- this.declareFunction<{
262
- deviceName: string,
263
- visionDeficiency?: string,
264
- }>('activateDeviceEmulation', {
265
- description:
266
- 'Sets emulation viewing mode for a specific device and optionally enables vision deficiency emulation.',
267
- parameters: {
268
- type: Host.AidaClient.ParametersTypes.OBJECT,
269
- description: '',
270
- nullable: false,
271
- properties: {
272
- deviceName: {
273
- type: Host.AidaClient.ParametersTypes.STRING,
274
- description:
275
- 'The name of the device to emulate. Allowed values: Pixel 3 XL, Pixel 7, Samsung Galaxy S8+, Samsung Galaxy S20 Ultra, Surface Pro 7, Surface Duo, Galaxy Z Fold 5, Asus Zenbook Fold, Samsung Galaxy A51/71, Nest Hub Max, Nest Hub, iPhone 4, iPhone 5/SE, iPhone 6/7/8, iPhone SE, iPhone XR, iPhone 12 Pro, iPhone 14 Pro Max, iPad Mini, iPad Air, iPad Pro.',
276
- nullable: false,
277
- },
278
- visionDeficiency: {
279
- type: Host.AidaClient.ParametersTypes.STRING,
280
- description:
281
- 'Optional vision deficiency to emulate. Allowed values: blurredVision, reducedContrast, achromatopsia, deuteranopia, protanopia, tritanopia.',
282
- nullable: true,
283
- },
284
- },
285
- required: ['deviceName']
286
- },
287
- handler: async params => {
288
- return await this.activateDeviceEmulation(params.deviceName, params.visionDeficiency);
289
- },
290
- });
291
- }
292
-
293
- /**
294
- * Clears styling-agent-specific caches and state.
295
- * Resets cached emulation data (screenshots, accessibility tree) and the
296
- * instructions flag to ensure they are re-evaluated in subsequent queries.
297
- */
298
- override clearCache(): void {
299
- super.clearCache();
300
- // Reset emulation state so that subsequent queries will re-initialize
301
- // emulation details and fetch fresh data.
302
- this.#greenDevEmulationScreenshot = null;
303
- this.#greenDevEmulationAxTree = null;
304
- this.#hasAddedEmulationInstructions = false;
305
185
  }
306
186
 
307
187
  override preambleFeatures(): string[] {
308
188
  return ['function_calling'];
309
189
  }
310
190
 
311
- #getSelectedNode(): SDK.DOMModel.DOMNode|null {
312
- return this.context?.getItem() ?? null;
313
- }
314
-
315
- async addElementAnnotation(elementId: string, annotationMessage: string):
316
- Promise<FunctionCallHandlerResult<unknown>> {
317
- if (!Annotations.AnnotationRepository.annotationsEnabled()) {
318
- console.warn('Received agent request to add annotation with annotations disabled');
319
- return {error: 'Annotations are not currently enabled'};
320
- }
321
-
322
- // eslint-disable-next-line no-console
323
- console.log(
324
- `AI AGENT EVENT: Styling Agent adding annotation for element ${elementId} with message '${annotationMessage}'`);
325
- const selectedNode = this.#getSelectedNode();
326
- if (!selectedNode) {
327
- return {error: 'Error: Unable to find currently selected element.'};
328
- }
329
- const domModel = selectedNode.domModel();
330
- const backendNodeId = Number(elementId) as Protocol.DOM.BackendNodeId;
331
- const nodeMap = await domModel.pushNodesByBackendIdsToFrontend(new Set([backendNodeId]));
332
- const node = nodeMap?.get(backendNodeId);
333
-
334
- if (!node) {
335
- return {error: `Error: Could not find the element with backendNodeId=${elementId}`};
336
- }
337
-
338
- Annotations.AnnotationRepository.instance().addElementsAnnotation(annotationMessage, node);
339
-
340
- return {
341
- result: `Annotation added for element ${elementId}: ${annotationMessage}`,
342
- };
343
- }
344
-
345
- async #compressScreenshot(base64Data: string): Promise<string> {
346
- return await new Promise((resolve, reject) => {
347
- const img = new Image();
348
- img.onload = () => {
349
- // eslint-disable-next-line @devtools/no-imperative-dom-api
350
- const canvas = document.createElement('canvas');
351
- const maxDimension = 2000;
352
- let scale = 1;
353
- if (img.width > maxDimension || img.height > maxDimension) {
354
- scale = maxDimension / Math.max(img.width, img.height);
355
- }
356
- canvas.width = img.width * scale;
357
- canvas.height = img.height * scale;
358
-
359
- const ctx = canvas.getContext('2d');
360
- if (!ctx) {
361
- reject(new Error('Could not get canvas context'));
362
- return;
363
- }
364
- ctx.imageSmoothingEnabled = true;
365
- ctx.imageSmoothingQuality = 'high';
366
- ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
367
- const dataUrl = canvas.toDataURL('image/jpeg', 0.9);
368
- resolve(dataUrl.split(',')[1]);
369
- };
370
- img.onerror = e => reject(new Error('Image load error: ' + e));
371
- img.src = 'data:image/png;base64,' + base64Data;
372
- });
373
- }
374
-
375
- async activateDeviceEmulation(deviceName: string, visionDeficiency?: string):
376
- Promise<FunctionCallHandlerResult<unknown>> {
377
- const greenDevEmulationEnabled = Greendev.Prototypes.instance().isEnabled('emulationCapabilities');
378
- if (!greenDevEmulationEnabled) {
379
- return {error: `GreenDev emulation capabilities not enabled`};
380
- }
381
-
382
- // eslint-disable-next-line no-console
383
- console.log('activateDeviceEmulation called with device:', deviceName, 'visionDeficiency:', visionDeficiency);
384
-
385
- this.#greenDevEmulationScreenshot = null;
386
- this.#greenDevEmulationAxTree = null;
387
-
388
- const emulatedDevicesList = Emulation.EmulatedDevices.EmulatedDevicesList.instance();
389
- const device = emulatedDevicesList.standard().find(d => d.title === deviceName);
390
-
391
- if (!device) {
392
- return {
393
- error: `Could not find device "${deviceName}" in the list of emulated devices.`,
394
- };
395
- }
396
-
397
- const deviceModeModel = Emulation.DeviceModeModel.DeviceModeModel.instance();
398
-
399
- const verticalMode = device.modesForOrientation(Emulation.EmulatedDevices.Vertical)[0];
400
- if (!verticalMode) {
401
- return {
402
- error: `Could not find vertical mode for "${deviceName}".`,
403
- };
404
- }
405
- deviceModeModel.emulate(Emulation.DeviceModeModel.Type.Device, device, verticalMode);
406
-
407
- // Get the selected node early to use for both vision deficiency and wait mechanism.
408
- const selectedNode = this.#getSelectedNode();
409
-
410
- // Apply vision deficiency if provided (and turn it off when not provided).
411
- try {
412
- if (selectedNode) {
413
- const target = selectedNode.domModel().target();
414
- const emulationModel = target.model(SDK.EmulationModel.EmulationModel);
415
- if (emulationModel) {
416
- let type = Protocol.Emulation.SetEmulatedVisionDeficiencyRequestType.None;
417
- if (visionDeficiency && visionDeficiency !== 'none') {
418
- type = visionDeficiency as Protocol.Emulation.SetEmulatedVisionDeficiencyRequestType;
419
- }
420
- await target.emulationAgent().invoke_setEmulatedVisionDeficiency({type});
421
- }
422
- } else {
423
- console.error('No selected node context to retrieve EmulationModel.');
424
- }
425
- } catch {
426
- return {
427
- error: `Unable to apply vision deficiency "${visionDeficiency}".`,
428
- };
429
- }
430
-
431
- // Wait for the layout to settle after emulation changes.
432
- // We use a double requestAnimationFrame to ensure at least one frame is rendered.
433
- if (selectedNode) {
434
- try {
435
- const code = 'await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))';
436
- // We use throwOnSideEffect: false because this is a benign wait, not a modification of the page state relevant to the user.
437
- await this.#execJs(code, {throwOnSideEffect: false, contextNode: selectedNode});
438
- } catch (e) {
439
- console.error('Failed to wait for layout settle:', e);
440
- }
441
- }
442
-
443
- const orientation = device.orientationByName(Emulation.EmulatedDevices.Vertical);
444
- const width = orientation.width;
445
-
446
- // TODO(finnur): Investigate better screen capture alternatives (that can do the whole page).
447
- let documentHeight = 2000;
448
- if (selectedNode) {
449
- try {
450
- const heightJs = 'document.body.scrollHeight';
451
- const result = await this.#execJs(heightJs, {throwOnSideEffect: false, contextNode: selectedNode});
452
- const parsedHeight = Number(result);
453
- if (!isNaN(parsedHeight)) {
454
- documentHeight = Math.min(parsedHeight, 2000);
455
- }
456
- } catch (e) {
457
- console.error('Failed to get document height:', e);
458
- }
459
- }
460
-
461
- // Specify a clip capping the height to the top 5000px.
462
- const clip: Protocol.Page.Viewport = {
463
- x: 0,
464
- y: 0,
465
- width,
466
- height: documentHeight,
467
- scale: 1,
468
- };
469
-
470
- // Capture using the clip. fullSize must be false when clip is used.
471
- const screenshot = await deviceModeModel.captureScreenshot(false, clip);
472
-
473
- if (!screenshot) {
474
- return {
475
- error: `Emulation for ${deviceName} activated, but failed to capture screenshot.`,
476
- };
477
- }
478
-
479
- try {
480
- this.#greenDevEmulationScreenshot = await this.#compressScreenshot(screenshot);
481
- } catch (e) {
482
- console.error('Screenshot compression failed, using original', e);
483
- this.#greenDevEmulationScreenshot = screenshot;
484
- }
485
-
486
- try {
487
- if (selectedNode) {
488
- const accessibilityModel = selectedNode.domModel().target().model(SDK.AccessibilityModel.AccessibilityModel);
489
- if (accessibilityModel) {
490
- await accessibilityModel.resumeModel();
491
- const axResponse = await accessibilityModel.agent.invoke_getFullAXTree({});
492
- if (!axResponse.getError()) {
493
- this.#greenDevEmulationAxTree = JSON.stringify(axResponse.nodes);
494
- } else {
495
- console.error('Failed to capture Accessibility Tree:', axResponse.getError());
496
- }
497
- }
498
- }
499
- } catch (e) {
500
- console.error('Exception capturing Accessibility Tree:', e);
501
- }
502
-
503
- let resultMsg = `Emulation for ${deviceName} activated and screenshot has been captured.`;
504
- if (visionDeficiency) {
505
- resultMsg += ` Vision deficiency "${visionDeficiency}" was also applied.`;
506
- }
507
- resultMsg += ' Ready for analysis.';
508
-
509
- return {
510
- result: resultMsg,
511
- };
512
- }
513
-
514
- override popPendingMultimodalInput(): MultimodalInput|undefined {
515
- const greenDevEmulationEnabled = Greendev.Prototypes.instance().isEnabled('emulationCapabilities');
516
- if (!greenDevEmulationEnabled) {
517
- return undefined;
518
- }
519
-
520
- if (this.#greenDevEmulationScreenshot) {
521
- const data = this.#greenDevEmulationScreenshot;
522
- this.#greenDevEmulationScreenshot = null;
523
- return {
524
- type: MultimodalInputType.SCREENSHOT,
525
- input: {
526
- inlineData: {
527
- data,
528
- mimeType: 'image/jpeg',
529
- },
530
- },
531
- id: crypto.randomUUID(),
532
- };
533
- }
534
- return undefined;
535
- }
536
-
537
191
  override async *
538
192
  handleContextDetails(selectedElement: ConversationContext<SDK.DOMModel.DOMNode>|null):
539
193
  AsyncGenerator<ContextResponse, void, void> {
@@ -551,19 +205,9 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
551
205
  override async enhanceQuery(
552
206
  query: string, selectedElement: ConversationContext<SDK.DOMModel.DOMNode>|null,
553
207
  multimodalInputType?: MultimodalInputType): Promise<string> {
554
- let multimodalInputEnhancementQuery =
208
+ const multimodalInputEnhancementQuery =
555
209
  this.multimodalInputEnabled && multimodalInputType ? MULTIMODAL_ENHANCEMENT_PROMPTS[multimodalInputType] : '';
556
210
 
557
- if (this.#greenDevEmulationAxTree) {
558
- multimodalInputEnhancementQuery += '\n# Accessibility Tree\n\n' + this.#greenDevEmulationAxTree;
559
- this.#greenDevEmulationAxTree = null;
560
- }
561
-
562
- if (Greendev.Prototypes.instance().isEnabled('emulationCapabilities') && !this.#hasAddedEmulationInstructions) {
563
- multimodalInputEnhancementQuery = emulationInstructions + '\n' + multimodalInputEnhancementQuery;
564
- this.#hasAddedEmulationInstructions = true;
565
- }
566
-
567
211
  const promptDetails = selectedElement ? await selectedElement.getPromptDetails() : null;
568
212
  const elementEnchancementQuery = promptDetails ? `${promptDetails}\n\n# User request\n\n` : '';
569
213
  return `${multimodalInputEnhancementQuery}${elementEnchancementQuery}QUERY: ${query}`;
@@ -7,9 +7,6 @@ import * as AccessibilityAgent from './agents/AccessibilityAgent.js';
7
7
  import * as AiAgent from './agents/AiAgent.js';
8
8
  import * as ContextSelectionAgent from './agents/ContextSelectionAgent.js';
9
9
  import * as FileAgent from './agents/FileAgent.js';
10
- import * as GreenDevAgent from './agents/GreenDevAgent.js';
11
- import * as GreenDevAgentAntigravityCliSocketClient from './agents/GreenDevAgentAntigravityCliSocketClient.js';
12
- import * as GreenDevAgentGeminiCliSocketClient from './agents/GreenDevAgentGeminiCliSocketClient.js';
13
10
  import * as NetworkAgent from './agents/NetworkAgent.js';
14
11
  import * as PatchAgent from './agents/PatchAgent.js';
15
12
  import * as PerformanceAgent from './agents/PerformanceAgent.js';
@@ -25,6 +22,7 @@ import * as ChangeManager from './ChangeManager.js';
25
22
  import * as AccessibilityContext from './contexts/AccessibilityContext.js';
26
23
  import * as DOMNodeContext from './contexts/DOMNodeContext.js';
27
24
  import * as FileContext from './contexts/FileContext.js';
25
+ import * as PerformanceTraceContext from './contexts/PerformanceTraceContext.js';
28
26
  import * as RequestContext from './contexts/RequestContext.js';
29
27
  import * as ConversationSummary from './ConversationSummary.js';
30
28
  import * as FileFormatter from './data_formatters/FileFormatter.js';
@@ -43,11 +41,12 @@ import * as AIQueries from './performance/AIQueries.js';
43
41
  import * as PerformanceAnnotations from './PerformanceAnnotations.js';
44
42
  import * as StorageItem from './StorageItem.js';
45
43
  import * as ExecuteJavaScript from './tools/ExecuteJavaScript.js';
44
+ import * as GetElementAccessibilityDetails from './tools/GetElementAccessibilityDetails.js';
46
45
  import * as GetLighthouseAudits from './tools/GetLighthouseAudits.js';
47
46
  import * as GetNetworkRequestDetails from './tools/GetNetworkRequestDetails.js';
48
47
  import * as GetStyles from './tools/GetStyles.js';
49
48
  import * as ListNetworkRequests from './tools/ListNetworkRequests.js';
50
- import * as ResolveLighthousePath from './tools/ResolveLighthousePath.js';
49
+ import * as ResolveDevtoolsNodePath from './tools/ResolveDevtoolsNodePath.js';
51
50
  import * as Tool from './tools/Tool.js';
52
51
  import * as ToolRegistry from './tools/ToolRegistry.js';
53
52
 
@@ -76,12 +75,10 @@ export {
76
75
  FileAgent,
77
76
  FileContext,
78
77
  FileFormatter,
78
+ GetElementAccessibilityDetails,
79
79
  GetLighthouseAudits,
80
80
  GetNetworkRequestDetails,
81
81
  GetStyles,
82
- GreenDevAgent,
83
- GreenDevAgentAntigravityCliSocketClient,
84
- GreenDevAgentGeminiCliSocketClient,
85
82
  Injected,
86
83
  LighthouseFormatter,
87
84
  ListNetworkRequests,
@@ -91,9 +88,10 @@ export {
91
88
  PerformanceAgent,
92
89
  PerformanceAnnotations,
93
90
  PerformanceInsightFormatter,
91
+ PerformanceTraceContext,
94
92
  PerformanceTraceFormatter,
95
93
  RequestContext,
96
- ResolveLighthousePath,
94
+ ResolveDevtoolsNodePath,
97
95
  StorageAgent,
98
96
  StorageItem,
99
97
  StylingAgent,