chrome-devtools-frontend 1.0.1664496 → 1.0.1665921

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 (407) hide show
  1. package/.agents/skills/devtools-testing-guidance/SKILL.md +48 -0
  2. package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +3 -3
  3. package/.agents/skills/repro-flaky-tests/SKILL.md +2 -2
  4. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +7 -1
  5. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +2 -0
  6. package/.agents/skills/version-control/SKILL.md +4 -3
  7. package/docs/ui_engineering.md +89 -0
  8. package/eslint.config.mjs +9 -2
  9. package/front_end/Images/rollup.config.mjs +1 -1
  10. package/front_end/Tests.js +15 -16
  11. package/front_end/core/common/Gzip.ts +2 -2
  12. package/front_end/core/common/Settings.ts +4 -20
  13. package/front_end/core/common/Srcset.ts +1 -1
  14. package/front_end/core/common/VersionController.ts +1 -1
  15. package/front_end/core/host/AidaClient.ts +19 -4
  16. package/front_end/core/host/AidaGcaTranslation.ts +2 -2
  17. package/front_end/core/host/GcaClient.ts +2 -2
  18. package/front_end/core/host/GdpClient.ts +3 -3
  19. package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
  20. package/front_end/core/host/ResourceLoader.ts +15 -15
  21. package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -2
  22. package/front_end/core/protocol_client/InspectorBackend.ts +1 -1
  23. package/front_end/core/root/Runtime.ts +0 -1
  24. package/front_end/core/sdk/CSSMatchedStyles.ts +78 -3
  25. package/front_end/core/sdk/CSSMetadata.ts +17 -12
  26. package/front_end/core/sdk/CSSProperty.ts +1 -1
  27. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +2 -2
  28. package/front_end/core/sdk/CSSRule.ts +3 -3
  29. package/front_end/core/sdk/CSSStyleSheetHeader.ts +3 -3
  30. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
  31. package/front_end/core/sdk/Connections.ts +1 -1
  32. package/front_end/core/sdk/DebuggerModel.ts +13 -13
  33. package/front_end/core/sdk/NetworkManager.ts +19 -19
  34. package/front_end/core/sdk/NetworkRequest.ts +57 -57
  35. package/front_end/core/sdk/OverlayModel.ts +1 -1
  36. package/front_end/core/sdk/PageResourceLoader.ts +2 -2
  37. package/front_end/core/sdk/RehydratingConnection.ts +5 -5
  38. package/front_end/core/sdk/ScreenCaptureModel.ts +1 -1
  39. package/front_end/core/sdk/Script.ts +2 -2
  40. package/front_end/core/sdk/ServerTiming.ts +7 -7
  41. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +1 -1
  42. package/front_end/core/sdk/ServiceWorkerManager.ts +11 -11
  43. package/front_end/core/sdk/SourceMapScopeChainEntry.ts +2 -2
  44. package/front_end/core/sdk/SourceMapScopesInfo.ts +1 -1
  45. package/front_end/core/sdk/StorageKeyManager.ts +1 -1
  46. package/front_end/core/sdk/sdk-meta.ts +98 -98
  47. package/front_end/devtools_compatibility.js +15 -13
  48. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +4 -8
  49. package/front_end/entrypoints/main/MainImpl.ts +2 -3
  50. package/front_end/entrypoints/main/main-meta.ts +1 -16
  51. package/front_end/entrypoints/shell/shell.ts +1 -0
  52. package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
  53. package/front_end/foundation/README.md +1 -1
  54. package/front_end/foundation/Universe.test.api.ts +73 -0
  55. package/front_end/foundation/Universe.ts +22 -0
  56. package/front_end/generated/InspectorBackendCommands.ts +2 -2
  57. package/front_end/generated/SupportedCSSProperties.js +1 -1
  58. package/front_end/generated/protocol.ts +19 -0
  59. package/front_end/models/ai_assistance/AiAgent2.ts +1 -1
  60. package/front_end/models/ai_assistance/AiConversation.ts +1 -1
  61. package/front_end/models/ai_assistance/BuiltInAi.ts +1 -1
  62. package/front_end/models/ai_assistance/ChangeManager.ts +0 -70
  63. package/front_end/models/ai_assistance/ExtensionScope.ts +2 -36
  64. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +9 -9
  65. package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -2
  66. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +4 -4
  67. package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +1 -1
  68. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +21 -21
  69. package/front_end/models/ai_assistance/agents/StorageAgent.ts +4 -4
  70. package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
  71. package/front_end/models/ai_assistance/ai_assistance.ts +0 -5
  72. package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +11 -4
  73. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +8 -2
  74. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +14 -11
  75. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +2 -2
  76. package/front_end/models/ai_assistance/performance/AICallTree.ts +2 -2
  77. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +1 -1
  78. package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +9 -2
  79. package/front_end/models/ai_assistance/tools/GetStyles.ts +4 -4
  80. package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +2 -5
  81. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -2
  82. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -2
  83. package/front_end/models/badges/badges-meta.ts +27 -0
  84. package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -3
  85. package/front_end/models/bindings/ContentProviderBasedProject.ts +1 -1
  86. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +6 -7
  87. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +5 -4
  88. package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +72 -29
  89. package/front_end/models/bindings/ResourceMapping.ts +38 -32
  90. package/front_end/models/bindings/ResourceScriptMapping.ts +5 -7
  91. package/front_end/models/breakpoints/BreakpointManager.ts +2 -1
  92. package/front_end/models/har/Writer.ts +2 -2
  93. package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +1 -1
  94. package/front_end/models/issues_manager/GenericIssue.ts +1 -1
  95. package/front_end/models/issues_manager/IssuesManager.ts +14 -5
  96. package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +1 -1
  97. package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +2 -2
  98. package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +13 -2
  99. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  100. package/front_end/models/live-metrics/LiveMetrics.ts +22 -5
  101. package/front_end/models/live-metrics/web-vitals-injected/rollup.config.mjs +1 -1
  102. package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +10 -4
  103. package/front_end/models/logs/logs-meta.ts +23 -16
  104. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +2 -2
  105. package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
  106. package/front_end/models/persistence/IsolatedFileSystemManager.ts +1 -1
  107. package/front_end/models/source_map_scopes/NamesResolver.ts +104 -86
  108. package/front_end/models/source_map_scopes/ScopeChainModel.ts +6 -2
  109. package/front_end/models/stack_trace/StackTraceModel.ts +1 -1
  110. package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +1 -1
  111. package/front_end/models/trace/handlers/UserTimingsHandler.ts +17 -6
  112. package/front_end/models/trace/helpers/SamplesIntegrator.ts +1 -1
  113. package/front_end/models/trace/helpers/Timing.ts +1 -1
  114. package/front_end/models/trace/insights/Common.ts +1 -1
  115. package/front_end/models/trace/insights/DocumentLatency.ts +3 -3
  116. package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
  117. package/front_end/models/trace/insights/ModernHTTP.ts +1 -1
  118. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +2 -2
  119. package/front_end/models/workspace_diff/WorkspaceDiff.ts +14 -9
  120. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +2 -15
  121. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -2
  122. package/front_end/panels/ai_assistance/components/ChatInput.ts +23 -19
  123. package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -18
  124. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -35
  125. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
  126. package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
  127. package/front_end/panels/ai_assistance/components/ImageResize.ts +74 -0
  128. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +2 -2
  129. package/front_end/panels/animation/AnimationGroupPreviewUI.ts +28 -29
  130. package/front_end/panels/animation/AnimationTimeline.ts +3 -3
  131. package/front_end/panels/animation/animationTimeline.css +0 -2
  132. package/front_end/panels/application/AppManifestView.ts +1 -1
  133. package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -1
  134. package/front_end/panels/application/CookieItemsView.ts +1 -1
  135. package/front_end/panels/application/CrashReportContextView.ts +3 -3
  136. package/front_end/panels/application/DeviceBoundSessionsModel.ts +1 -1
  137. package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +1 -1
  138. package/front_end/panels/application/DeviceBoundSessionsView.ts +1 -1
  139. package/front_end/panels/application/IndexedDBViews.ts +1 -1
  140. package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -1
  141. package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
  142. package/front_end/panels/application/ServiceWorkersView.ts +6 -6
  143. package/front_end/panels/application/StorageBucketsTreeElement.ts +1 -1
  144. package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
  145. package/front_end/panels/application/WebMCPView.ts +7 -5
  146. package/front_end/panels/application/components/AdsView.ts +21 -6
  147. package/front_end/panels/application/components/BackForwardCacheView.ts +2 -2
  148. package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
  149. package/front_end/panels/application/components/StorageMetadataView.ts +1 -1
  150. package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
  151. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +2 -1
  152. package/front_end/panels/application/preloading/components/PreloadingString.ts +3 -3
  153. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -1
  154. package/front_end/panels/autofill/AutofillView.ts +1 -1
  155. package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
  156. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +2 -2
  157. package/front_end/panels/changes/ChangesSidebar.ts +2 -2
  158. package/front_end/panels/changes/ChangesView.ts +4 -5
  159. package/front_end/panels/changes/CombinedDiffView.ts +3 -3
  160. package/front_end/panels/changes/changes-meta.ts +2 -2
  161. package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
  162. package/front_end/panels/common/AiCodeGenerationTeaser.ts +3 -3
  163. package/front_end/panels/common/BadgeNotification.ts +8 -8
  164. package/front_end/panels/common/DOMLinkifier.ts +1 -1
  165. package/front_end/panels/common/GdpSignUpDialog.ts +2 -2
  166. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
  167. package/front_end/panels/common/aiCodeCompletionDisclaimer.css +0 -1
  168. package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
  169. package/front_end/panels/console/ConsolePinPane.ts +3 -3
  170. package/front_end/panels/console/ConsolePrompt.ts +6 -4
  171. package/front_end/panels/console/ConsoleSidebar.ts +8 -10
  172. package/front_end/panels/console_counters/WarningErrorCounter.ts +10 -11
  173. package/front_end/panels/coverage/CoverageView.ts +2 -2
  174. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
  175. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +1 -1
  176. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
  177. package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
  178. package/front_end/panels/elements/ComputedStyleWidget.ts +3 -2
  179. package/front_end/panels/elements/ElementsTreeElement.ts +3 -3
  180. package/front_end/panels/elements/EventListenersWidget.ts +1 -3
  181. package/front_end/panels/elements/LayoutPane.ts +23 -13
  182. package/front_end/panels/elements/StandaloneStylesContainer.ts +7 -7
  183. package/front_end/panels/elements/StylePropertiesSection.ts +33 -5
  184. package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -5
  185. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +6 -6
  186. package/front_end/panels/elements/StylesSidebarPane.ts +4 -3
  187. package/front_end/panels/elements/elements-meta.ts +18 -2
  188. package/front_end/panels/emulation/DeviceModeToolbar.ts +100 -40
  189. package/front_end/panels/emulation/DeviceModeView.ts +5 -4
  190. package/front_end/panels/emulation/MediaQueryInspector.ts +35 -19
  191. package/front_end/panels/event_listeners/EventListenersView.ts +4 -4
  192. package/front_end/panels/explain/components/ConsoleInsight.ts +8 -9
  193. package/front_end/panels/explain/explain-meta.ts +3 -3
  194. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +135 -167
  195. package/front_end/panels/layer_viewer/Layers3DView.ts +10 -23
  196. package/front_end/panels/layer_viewer/layer_viewer-meta.ts +27 -0
  197. package/front_end/panels/lighthouse/LighthouseController.ts +44 -55
  198. package/front_end/panels/lighthouse/LighthousePanel.ts +9 -9
  199. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +2 -2
  200. package/front_end/panels/lighthouse/LighthouseStartView.ts +9 -12
  201. package/front_end/panels/lighthouse/LighthouseStatusView.ts +33 -33
  202. package/front_end/panels/lighthouse/RadioSetting.ts +1 -1
  203. package/front_end/panels/lighthouse/lighthouse-meta.ts +131 -1
  204. package/front_end/panels/media/EventDisplayTable.ts +67 -94
  205. package/front_end/panels/media/PlayerListView.ts +1 -1
  206. package/front_end/panels/media/eventDisplayTable.css +9 -4
  207. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +5 -5
  208. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
  209. package/front_end/panels/network/EventSourceMessagesView.ts +98 -107
  210. package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
  211. package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -1
  212. package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
  213. package/front_end/panels/network/RequestCookiesView.ts +2 -2
  214. package/front_end/panels/network/RequestHeadersView.ts +5 -5
  215. package/front_end/panels/network/RequestPayloadView.ts +4 -4
  216. package/front_end/panels/network/RequestTimingView.ts +2 -2
  217. package/front_end/panels/network/components/DirectSocketConnectionView.ts +1 -1
  218. package/front_end/panels/network/eventSourceMessagesView.css +12 -3
  219. package/front_end/panels/network/networkTimingTable.css +2 -2
  220. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
  221. package/front_end/panels/profiler/BottomUpProfileDataGrid.ts +25 -29
  222. package/front_end/panels/profiler/HeapProfileView.ts +308 -247
  223. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +13 -3
  224. package/front_end/panels/profiler/HeapSnapshotView.ts +30 -10
  225. package/front_end/panels/profiler/HeapTimelineOverview.ts +5 -2
  226. package/front_end/panels/profiler/ProfileDataGrid.ts +128 -157
  227. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +17 -5
  228. package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
  229. package/front_end/panels/profiler/TopDownProfileDataGrid.ts +17 -21
  230. package/front_end/panels/profiler/profilesPanel.css +9 -13
  231. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
  232. package/front_end/panels/recorder/CreateRecordingView.ts +4 -4
  233. package/front_end/panels/recorder/RecorderPanel.ts +6 -6
  234. package/front_end/panels/recorder/RecordingView.ts +1 -1
  235. package/front_end/panels/recorder/ReplaySection.ts +1 -1
  236. package/front_end/panels/recorder/StepView.ts +1 -1
  237. package/front_end/panels/recorder/injected/rollup.config.mjs +1 -1
  238. package/front_end/panels/search/SearchView.ts +1 -1
  239. package/front_end/panels/security/SecurityPanel.ts +54 -41
  240. package/front_end/panels/sensors/LocationsSettingsTab.ts +246 -233
  241. package/front_end/panels/sensors/SensorsView.ts +1 -1
  242. package/front_end/panels/settings/AISettingsTab.ts +11 -10
  243. package/front_end/panels/settings/SettingsScreen.ts +29 -24
  244. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
  245. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +5 -5
  246. package/front_end/panels/sources/BreakpointEditDialog.ts +2 -2
  247. package/front_end/panels/sources/BreakpointsView.ts +1 -1
  248. package/front_end/panels/sources/CallStackSidebarPane.ts +2 -2
  249. package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -2
  250. package/front_end/panels/sources/DebuggerPlugin.ts +25 -22
  251. package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -1
  252. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +7 -5
  253. package/front_end/panels/sources/sources-meta.ts +1 -1
  254. package/front_end/panels/timeline/CountersGraph.ts +1 -2
  255. package/front_end/panels/timeline/ExtensionTrackAppender.ts +1 -1
  256. package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
  257. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -2
  258. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -4
  259. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +1 -1
  260. package/front_end/panels/timeline/TimelinePanel.ts +53 -81
  261. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +10 -3
  262. package/front_end/panels/timeline/TimelineUIUtils.ts +18 -4
  263. package/front_end/panels/timeline/TrackConfigBanner.ts +1 -1
  264. package/front_end/panels/timeline/components/ExportTraceOptions.ts +1 -1
  265. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +8 -9
  266. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
  267. package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +1 -1
  268. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +2 -2
  269. package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +1 -1
  270. package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +1 -1
  271. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
  272. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -0
  273. package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +13 -8
  274. package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +1 -0
  275. package/front_end/panels/timeline/timeline-meta.ts +169 -0
  276. package/front_end/panels/timeline/timelineFlameChartView.css +5 -0
  277. package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
  278. package/front_end/panels/whats_new/ReleaseNoteText.ts +9 -9
  279. package/front_end/panels/whats_new/resources/WNDT.md +7 -8
  280. package/front_end/third_party/chromium/README.chromium +1 -1
  281. package/front_end/third_party/web-vitals/README.chromium +2 -2
  282. package/front_end/third_party/web-vitals/package/README.md +120 -19
  283. package/front_end/third_party/web-vitals/package/attribution.d.ts +16 -0
  284. package/front_end/third_party/web-vitals/package/attribution.js +18 -0
  285. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +1 -1
  286. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +1 -7
  287. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +53 -32
  288. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +2 -2
  289. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +43 -12
  290. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +1 -1
  291. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +21 -3
  292. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +1 -1
  293. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +30 -24
  294. package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.d.ts +3 -0
  295. package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.js +18 -0
  296. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +2 -1
  297. package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +18 -2
  298. package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +1 -0
  299. package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.js +1 -0
  300. package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.d.ts +1 -1
  301. package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
  302. package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.d.ts +1 -1
  303. package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.js +7 -7
  304. package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +1 -1
  305. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -1
  306. package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +4 -1
  307. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +7 -3
  308. package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +20 -11
  309. package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.js +8 -3
  310. package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.d.ts +3 -1
  311. package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +19 -4
  312. package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +1 -1
  313. package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.d.ts +3 -0
  314. package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js +38 -0
  315. package/front_end/third_party/web-vitals/package/dist/modules/lib/whenIdleOrHidden.js +5 -1
  316. package/front_end/third_party/web-vitals/package/dist/modules/onCLS.d.ts +1 -1
  317. package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +30 -11
  318. package/front_end/third_party/web-vitals/package/dist/modules/onFCP.d.ts +1 -1
  319. package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +36 -4
  320. package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +1 -1
  321. package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +42 -22
  322. package/front_end/third_party/web-vitals/package/dist/modules/onLCP.d.ts +1 -1
  323. package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +109 -30
  324. package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.d.ts +1 -1
  325. package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +25 -7
  326. package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +24 -1
  327. package/front_end/third_party/web-vitals/package/dist/modules/types/fcp.d.ts +1 -1
  328. package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +14 -6
  329. package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +1 -1
  330. package/front_end/third_party/web-vitals/package/dist/modules/types/ttfb.d.ts +2 -2
  331. package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +26 -4
  332. package/front_end/third_party/web-vitals/package/package.json +21 -22
  333. package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +1 -1
  334. package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +62 -39
  335. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +52 -15
  336. package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +25 -7
  337. package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +43 -37
  338. package/front_end/third_party/web-vitals/package/src/lib/{polyfills/getFirstHiddenTimePolyfill.ts → FCPEntryManager.ts} +4 -14
  339. package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +22 -2
  340. package/front_end/third_party/web-vitals/package/src/lib/LCPEntryManager.ts +1 -0
  341. package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
  342. package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
  343. package/front_end/third_party/web-vitals/package/src/lib/getLoadState.ts +11 -12
  344. package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +1 -1
  345. package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +4 -1
  346. package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +24 -11
  347. package/front_end/third_party/web-vitals/package/src/lib/initUnique.ts +12 -4
  348. package/front_end/third_party/web-vitals/package/src/lib/observe.ts +26 -5
  349. package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +1 -1
  350. package/front_end/third_party/web-vitals/package/src/lib/softNavs.ts +48 -0
  351. package/front_end/third_party/web-vitals/package/src/lib/whenIdleOrHidden.ts +12 -4
  352. package/front_end/third_party/web-vitals/package/src/onCLS.ts +75 -18
  353. package/front_end/third_party/web-vitals/package/src/onFCP.ts +66 -7
  354. package/front_end/third_party/web-vitals/package/src/onINP.ts +100 -39
  355. package/front_end/third_party/web-vitals/package/src/onLCP.ts +169 -34
  356. package/front_end/third_party/web-vitals/package/src/onTTFB.ts +50 -13
  357. package/front_end/third_party/web-vitals/package/src/types/base.ts +31 -10
  358. package/front_end/third_party/web-vitals/package/src/types/fcp.ts +1 -1
  359. package/front_end/third_party/web-vitals/package/src/types/inp.ts +14 -6
  360. package/front_end/third_party/web-vitals/package/src/types/lcp.ts +1 -1
  361. package/front_end/third_party/web-vitals/package/src/types/ttfb.ts +2 -2
  362. package/front_end/third_party/web-vitals/package/src/types.ts +32 -9
  363. package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +11 -11
  364. package/front_end/third_party/web-vitals/rebuild.sh +2 -2
  365. package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +2 -0
  366. package/front_end/ui/components/buttons/Button.ts +16 -0
  367. package/front_end/ui/components/dialogs/Dialog.ts +1 -1
  368. package/front_end/ui/components/highlighting/HighlightManager.ts +6 -1
  369. package/front_end/ui/components/highlighting/highlighting.ts +1 -1
  370. package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
  371. package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
  372. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +2 -2
  373. package/front_end/ui/components/settings/SettingCheckbox.ts +12 -7
  374. package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +2 -2
  375. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +6 -6
  376. package/front_end/ui/components/text_editor/javascript.ts +3 -1
  377. package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
  378. package/front_end/ui/legacy/ContextMenu.ts +12 -2
  379. package/front_end/ui/legacy/ListControl.ts +1 -1
  380. package/front_end/ui/legacy/SelectMenu.docs.ts +17 -19
  381. package/front_end/ui/legacy/Toolbar.ts +4 -1
  382. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  383. package/front_end/ui/legacy/components/color_picker/spectrum.css +1 -2
  384. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  385. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +50 -4
  386. package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +3 -1
  387. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +4 -4
  388. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -7
  389. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +14 -11
  390. package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +1 -1
  391. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +15 -5
  392. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -4
  393. package/front_end/ui/legacy/components/utils/Linkifier.ts +5 -1
  394. package/front_end/ui/lit/render.ts +1 -1
  395. package/front_end/ui/settings/SettingUIRegistration.ts +8 -3
  396. package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
  397. package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
  398. package/inspector_overlay/main.ts +1 -1
  399. package/mcp/mcp.ts +5 -4
  400. package/package.json +13 -13
  401. package/front_end/models/ai_assistance/AgentProject.ts +0 -261
  402. package/front_end/models/ai_assistance/agents/PatchAgent.ts +0 -306
  403. package/front_end/models/issues_manager/CheckFormsIssuesTrigger.ts +0 -45
  404. package/front_end/models/text_utils/text_utils.ts +0 -5
  405. package/front_end/panels/ai_assistance/PatchWidget.ts +0 -867
  406. package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +0 -368
  407. package/front_end/panels/ai_assistance/selectWorkspaceDialog.css +0 -92
@@ -28,7 +28,7 @@ export const enum ResponseType {
28
28
  ERROR = 'error',
29
29
  QUERYING = 'querying',
30
30
  USER_QUERY = 'user-query',
31
- CONTEXT_CHANGE = 'context-change'
31
+ CONTEXT_CHANGE = 'context-change',
32
32
  }
33
33
 
34
34
  export const enum ErrorType {
@@ -38,6 +38,7 @@ export const enum ErrorType {
38
38
  BLOCK = 'block',
39
39
  CROSS_ORIGIN = 'cross-origin',
40
40
  QUOTA = 'quota',
41
+ PAYLOAD_TOO_LARGE = 'payload-too-large',
41
42
  }
42
43
 
43
44
  export const enum MultimodalInputType {
@@ -806,6 +807,9 @@ export abstract class AiAgent<T> {
806
807
  } else if (err instanceof Host.AidaClient.AidaQuotaError ||
807
808
  (err instanceof Error && err.message.toLowerCase().includes('quota'))) {
808
809
  error = ErrorType.QUOTA;
810
+ } else if (err instanceof Host.AidaClient.AidaPayloadTooLargeError ||
811
+ (err instanceof Error && /payload size exceeds the limit/i.test(err.message))) {
812
+ error = ErrorType.PAYLOAD_TOO_LARGE;
809
813
  }
810
814
  yield this.#createErrorResponse(error);
811
815
 
@@ -1096,7 +1100,11 @@ export abstract class AiAgent<T> {
1096
1100
  request: structuredClone(request),
1097
1101
  aidaResponse,
1098
1102
  });
1099
- localStorage.setItem('aiAssistanceStructuredLog', JSON.stringify(this.#structuredLog));
1103
+ try {
1104
+ localStorage.setItem('aiAssistanceStructuredLog', JSON.stringify(this.#structuredLog));
1105
+ } catch (err) {
1106
+ console.warn('Failed to write to local storage "aiAssistanceStructuredLog":', err);
1107
+ }
1100
1108
  }
1101
1109
  }
1102
1110
 
@@ -402,9 +402,9 @@ export class ContextSelectionAgent extends AiAgent<never> {
402
402
  return {
403
403
  context: PerformanceTraceContext.fromParsedTrace(result),
404
404
  description: 'User recorded a performance trace',
405
- widgets: [{name: 'PERFORMANCE_TRACE', data: {parsedTrace: result}}]
405
+ widgets: [{name: 'PERFORMANCE_TRACE', data: {parsedTrace: result}}],
406
406
  };
407
- }
407
+ },
408
408
  });
409
409
 
410
410
  type LHSupportedRunMode = Extract<LHModel.RunTypes.RunMode, 'navigation'|'snapshot'>;
@@ -426,7 +426,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
426
426
  description:
427
427
  'The mode to run Lighthouse in. Your ONLY options are "navigation" or "snapshot". You should determine this based on the user\'s question. If the user is asking specifically about accessibility, you can run in "snapshot" mode which avoids reloading the page. If the user asks for a full Lighthouse report, you should run in "navigation" mode which is the default. These are the only options you can pass.',
428
428
  nullable: false,
429
- }
429
+ },
430
430
  },
431
431
  },
432
432
  displayInfoFromArgs: args => {
@@ -454,7 +454,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
454
454
  description: 'User has selected a Lighthouse report',
455
455
  widgets: [{name: 'LIGHTHOUSE_REPORT', data: {report: result}}],
456
456
  };
457
- }
457
+ },
458
458
  });
459
459
 
460
460
  this.declareFunction<Record<string, never>>('inspectDom', {
@@ -12,7 +12,7 @@ import {debugLog} from '../debug.js';
12
12
  import {EvaluateAction, formatError, SideEffectError} from '../EvaluateAction.js';
13
13
  import {FREESTYLER_WORLD_NAME} from '../injected.js';
14
14
 
15
- import type {AgentOptions as BaseAgentOptions, FunctionCallHandlerResult, FunctionHandlerOptions,} from './AiAgent.js';
15
+ import type {AgentOptions as BaseAgentOptions, FunctionCallHandlerResult, FunctionHandlerOptions} from './AiAgent.js';
16
16
 
17
17
  const lockedString = i18n.i18n.lockedString;
18
18
 
@@ -269,20 +269,20 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
269
269
 
270
270
  #notExternalExtraPreambleFact: Host.AidaClient.RequestFact = {
271
271
  text: extraPreambleWhenNotExternal,
272
- metadata: {source: 'devtools', score: ScorePriority.CRITICAL}
272
+ metadata: {source: 'devtools', score: ScorePriority.CRITICAL},
273
273
  };
274
274
  #freshTraceExtraPreambleFact: Host.AidaClient.RequestFact = {
275
275
  text: freshTracePreamble,
276
- metadata: {source: 'devtools', score: ScorePriority.CRITICAL}
276
+ metadata: {source: 'devtools', score: ScorePriority.CRITICAL},
277
277
  };
278
278
 
279
279
  #networkDataDescriptionFact: Host.AidaClient.RequestFact = {
280
280
  text: PerformanceTraceFormatter.networkDataFormatDescription,
281
- metadata: {source: 'devtools', score: ScorePriority.CRITICAL}
281
+ metadata: {source: 'devtools', score: ScorePriority.CRITICAL},
282
282
  };
283
283
  #callFrameDataDescriptionFact: Host.AidaClient.RequestFact = {
284
284
  text: PerformanceTraceFormatter.callFrameDataFormatDescription,
285
- metadata: {source: 'devtools', score: ScorePriority.CRITICAL}
285
+ metadata: {source: 'devtools', score: ScorePriority.CRITICAL},
286
286
  };
287
287
  #traceFacts: Host.AidaClient.RequestFact[] = [];
288
288
 
@@ -790,14 +790,14 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
790
790
  type: Host.AidaClient.ParametersTypes.STRING,
791
791
  description: 'The name of the insight. Only use the insight names given in the "Available insights" list.',
792
792
  nullable: false,
793
- }
793
+ },
794
794
  },
795
- required: ['insightSetId', 'insightName']
795
+ required: ['insightSetId', 'insightName'],
796
796
  },
797
797
  displayInfoFromArgs: params => {
798
798
  return {
799
799
  title: lockedString(`Investigating insight ${params.insightName}`),
800
- action: `getInsightDetails('${params.insightSetId}', '${params.insightName}')`
800
+ action: `getInsightDetails('${params.insightSetId}', '${params.insightName}')`,
801
801
  };
802
802
  },
803
803
  handler: async params => {
@@ -896,9 +896,9 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
896
896
  type: Host.AidaClient.ParametersTypes.STRING,
897
897
  description: 'The key for the event.',
898
898
  nullable: false,
899
- }
899
+ },
900
900
  },
901
- required: ['eventKey']
901
+ required: ['eventKey'],
902
902
  },
903
903
  displayInfoFromArgs: params => {
904
904
  return {title: lockedString('Looking at trace event'), action: `getEventByKey('${params.eventKey}')`};
@@ -957,13 +957,13 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
957
957
  nullable: false,
958
958
  },
959
959
  },
960
- required: ['label']
960
+ required: ['label'],
961
961
  },
962
962
  displayInfoFromArgs: args => {
963
963
  const labelName = getLabelName(args.label, focus);
964
964
  return {
965
965
  title: lockedString(`${UIStringsNotTranslated.mainThreadActivity}: ${labelName}`),
966
- action: `getMainThreadTrackSummaryByLabel('${args.label}')`
966
+ action: `getMainThreadTrackSummaryByLabel('${args.label}')`,
967
967
  };
968
968
  },
969
969
  handler: async args => {
@@ -979,8 +979,8 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
979
979
  },
980
980
  });
981
981
 
982
- this.declareFunction<
983
- {min?: Trace.Types.Timing.Micro, max?: Trace.Types.Timing.Micro}, {summary: string}>('getNetworkTrackSummary', {
982
+ this.declareFunction<{min?: Trace.Types.Timing.Micro, max?: Trace.Types.Timing.Micro},
983
+ {summary: string}>('getNetworkTrackSummary', {
984
984
  description: 'Returns a summary of the network for the given bounds.',
985
985
  parameters: {
986
986
  type: Host.AidaClient.ParametersTypes.OBJECT,
@@ -1000,14 +1000,14 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1000
1000
  nullable: true,
1001
1001
  },
1002
1002
  },
1003
- required: []
1003
+ required: [],
1004
1004
  },
1005
1005
  displayInfoFromArgs: args => {
1006
1006
  const min = args.min ?? parsedTrace.data.Meta.traceBounds.min;
1007
1007
  const max = args.max ?? parsedTrace.data.Meta.traceBounds.max;
1008
1008
  return {
1009
1009
  title: lockedString(UIStringsNotTranslated.networkActivitySummary),
1010
- action: `getNetworkTrackSummary({min: ${min}, max: ${max}})`
1010
+ action: `getNetworkTrackSummary({min: ${min}, max: ${max}})`,
1011
1011
  };
1012
1012
  },
1013
1013
  handler: async args => {
@@ -1059,7 +1059,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1059
1059
  nullable: false,
1060
1060
  },
1061
1061
  },
1062
- required: ['eventKey']
1062
+ required: ['eventKey'],
1063
1063
  },
1064
1064
  displayInfoFromArgs: args => {
1065
1065
  return {title: lockedString('Looking at call tree'), action: `getDetailedCallTree('${args.eventKey}')`};
@@ -1137,12 +1137,12 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1137
1137
  nullable: false,
1138
1138
  },
1139
1139
  },
1140
- required: ['scriptUrl', 'line', 'column']
1140
+ required: ['scriptUrl', 'line', 'column'],
1141
1141
  },
1142
1142
  displayInfoFromArgs: args => {
1143
1143
  return {
1144
1144
  title: lockedString('Looking up function code'),
1145
- action: `getFunctionCode('${args.scriptUrl}', ${args.line}, ${args.column})`
1145
+ action: `getFunctionCode('${args.scriptUrl}', ${args.line}, ${args.column})`,
1146
1146
  };
1147
1147
  },
1148
1148
  handler: async args => {
@@ -1211,7 +1211,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1211
1211
  nullable: false,
1212
1212
  },
1213
1213
  },
1214
- required: ['url']
1214
+ required: ['url'],
1215
1215
  },
1216
1216
  displayInfoFromArgs: args => {
1217
1217
  return {title: lockedString('Looking at resource content'), action: `getResourceContent('${args.url}')`};
@@ -1285,9 +1285,9 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1285
1285
  type: Host.AidaClient.ParametersTypes.STRING,
1286
1286
  description: 'The key for the event.',
1287
1287
  nullable: false,
1288
- }
1288
+ },
1289
1289
  },
1290
- required: ['eventKey']
1290
+ required: ['eventKey'],
1291
1291
  },
1292
1292
  displayInfoFromArgs: params => {
1293
1293
  return {title: lockedString('Selecting event'), action: `selectEventByKey('${params.eventKey}')`};
@@ -253,7 +253,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
253
253
  type: Host.AidaClient.ParametersTypes.STRING,
254
254
  description: 'Optional. Specific storageKey to to list keys for.',
255
255
  nullable: true,
256
- }
256
+ },
257
257
  },
258
258
  required: ['type', 'origin'],
259
259
  },
@@ -330,7 +330,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
330
330
  type: Host.AidaClient.ParametersTypes.STRING,
331
331
  description: 'Optional. Specific storageKey partition to get values for.',
332
332
  nullable: true,
333
- }
333
+ },
334
334
  },
335
335
  required: ['type', 'keys', 'origin'],
336
336
  },
@@ -415,7 +415,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
415
415
  type: Host.AidaClient.ParametersTypes.STRING,
416
416
  description: 'Origin to list cookies for.',
417
417
  nullable: false,
418
- }
418
+ },
419
419
  },
420
420
  required: ['origin'],
421
421
  },
@@ -467,7 +467,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
467
467
  type: Host.AidaClient.ParametersTypes.STRING,
468
468
  description: 'The specific origin the cookies belong to.',
469
469
  nullable: false,
470
- }
470
+ },
471
471
  },
472
472
  required: ['cookieNames', 'origin'],
473
473
  },
@@ -17,7 +17,7 @@ import {
17
17
  type ConversationContext,
18
18
  MultimodalInputType,
19
19
  type RequestOptions,
20
- ResponseType
20
+ ResponseType,
21
21
  } from './AiAgent.js';
22
22
  import {
23
23
  type CreateExtensionScopeFunction,
@@ -1,14 +1,11 @@
1
1
  // Copyright 2023 The Chromium Authors
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
-
5
- import * as AgentProject from './AgentProject.js';
6
4
  import * as AccessibilityAgent from './agents/AccessibilityAgent.js';
7
5
  import * as AiAgent from './agents/AiAgent.js';
8
6
  import * as ContextSelectionAgent from './agents/ContextSelectionAgent.js';
9
7
  import * as FileAgent from './agents/FileAgent.js';
10
8
  import * as NetworkAgent from './agents/NetworkAgent.js';
11
- import * as PatchAgent from './agents/PatchAgent.js';
12
9
  import * as PerformanceAgent from './agents/PerformanceAgent.js';
13
10
  import * as StorageAgent from './agents/StorageAgent.js';
14
11
  import * as StylingAgent from './agents/StylingAgent.js';
@@ -53,7 +50,6 @@ import * as ToolRegistry from './tools/ToolRegistry.js';
53
50
  export {
54
51
  AccessibilityAgent,
55
52
  AccessibilityContext,
56
- AgentProject,
57
53
  AiAgent,
58
54
  AiAgent2,
59
55
  AICallTree,
@@ -84,7 +80,6 @@ export {
84
80
  ListNetworkRequests,
85
81
  NetworkAgent,
86
82
  NetworkRequestFormatter,
87
- PatchAgent,
88
83
  PerformanceAgent,
89
84
  PerformanceAnnotations,
90
85
  PerformanceInsightFormatter,
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Bindings from '../../bindings/bindings.js';
6
+ import * as Logs from '../../logs/logs.js';
6
7
  import * as NetworkTimeCalculator from '../../network_time_calculator/network_time_calculator.js';
7
8
  import type * as Workspace from '../../workspace/workspace.js';
8
9
 
@@ -51,12 +52,18 @@ export class FileFormatter {
51
52
 
52
53
  #file: Workspace.UISourceCode.UISourceCode;
53
54
  #debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding;
54
- constructor(file: Workspace.UISourceCode.UISourceCode,
55
- debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding =
56
- Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()) {
55
+ #networkLog: Logs.NetworkLog.NetworkLog;
56
+ constructor(
57
+ file: Workspace.UISourceCode.UISourceCode,
58
+ debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding =
59
+ Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance(),
60
+ networkLog: Logs.NetworkLog.NetworkLog = Logs.NetworkLog.NetworkLog.instance(),
61
+ ) {
57
62
  this.#file = file;
58
63
  this.#debuggerWorkspaceBinding = debuggerWorkspaceBinding;
64
+ this.#networkLog = networkLog;
59
65
  }
66
+
60
67
  formatFile(): string {
61
68
  const sourceMapDetails = FileFormatter.formatSourceMapDetails(this.#file, this.#debuggerWorkspaceBinding);
62
69
  const lines = [
@@ -69,7 +76,7 @@ export class FileFormatter {
69
76
  const calculator = new NetworkTimeCalculator.NetworkTransferTimeCalculator();
70
77
  calculator.updateBoundaries(resource.request);
71
78
  lines.push(`Request initiator chain:
72
- ${new NetworkRequestFormatter(resource.request, calculator).formatRequestInitiatorChain()}`);
79
+ ${new NetworkRequestFormatter(resource.request, calculator, this.#networkLog).formatRequestInitiatorChain()}`);
73
80
  }
74
81
  lines.push(`File content:
75
82
  ${this.#formatFileContent()}`);
@@ -131,10 +131,16 @@ export class NetworkRequestFormatter {
131
131
  return lines.length > 0 ? `${lines.join('\n')}\n` : '';
132
132
  }
133
133
 
134
+ readonly #networkLog: Logs.NetworkLog.NetworkLog;
135
+
134
136
  constructor(
135
- request: SDK.NetworkRequest.NetworkRequest, calculator: NetworkTimeCalculator.NetworkTransferTimeCalculator) {
137
+ request: SDK.NetworkRequest.NetworkRequest,
138
+ calculator: NetworkTimeCalculator.NetworkTransferTimeCalculator,
139
+ networkLog: Logs.NetworkLog.NetworkLog = Logs.NetworkLog.NetworkLog.instance(),
140
+ ) {
136
141
  this.#request = request;
137
142
  this.#calculator = calculator;
143
+ this.#networkLog = networkLog;
138
144
  }
139
145
 
140
146
  formatRequestHeaders(): string {
@@ -199,7 +205,7 @@ Request initiator chain:\n${this.formatRequestInitiatorChain()}`;
199
205
  const allowedOrigin = Common.ParsedURL.ParsedURL.extractOrigin(this.#request.url());
200
206
  let initiatorChain = '';
201
207
  let lineStart = '- URL: ';
202
- const graph = Logs.NetworkLog.NetworkLog.instance().initiatorGraphForRequest(this.#request);
208
+ const graph = this.#networkLog.initiatorGraphForRequest(this.#request);
203
209
 
204
210
  for (const initiator of Array.from(graph.initiators).reverse()) {
205
211
  initiatorChain = initiatorChain + lineStart +
@@ -149,16 +149,16 @@ export class PerformanceInsightFormatter {
149
149
  case 'DuplicatedJavaScript':
150
150
  return [
151
151
  {title: 'How do I deduplicate the identified scripts in my bundle?'},
152
- {title: 'Which duplicated JavaScript modules are the most problematic?'}
152
+ {title: 'Which duplicated JavaScript modules are the most problematic?'},
153
153
  ];
154
154
  case 'FontDisplay':
155
155
  return [
156
- {title: 'How can I update my CSS to avoid layout shifts caused by incorrect `font-display` properties?'}
156
+ {title: 'How can I update my CSS to avoid layout shifts caused by incorrect `font-display` properties?'},
157
157
  ];
158
158
  case 'ForcedReflow':
159
159
  return [
160
160
  {title: 'How can I avoid forced reflows and layout thrashing?'},
161
- {title: 'What is forced reflow and why is it problematic?'}
161
+ {title: 'What is forced reflow and why is it problematic?'},
162
162
  ];
163
163
  case 'ImageDelivery':
164
164
  return [
@@ -167,25 +167,28 @@ export class PerformanceInsightFormatter {
167
167
  ];
168
168
  case 'INPBreakdown':
169
169
  return [
170
- {title: 'Suggest fixes for my longest interaction'}, {title: 'Why is a large INP score problematic?'},
171
- {title: 'What\'s the biggest contributor to my longest interaction?'}
170
+ {title: 'Suggest fixes for my longest interaction'},
171
+ {title: 'Why is a large INP score problematic?'},
172
+ {title: 'What\'s the biggest contributor to my longest interaction?'},
172
173
  ];
173
174
  case 'LCPDiscovery':
174
175
  return [
175
- {title: 'Suggest fixes to reduce my LCP'}, {title: 'What can I do to reduce my LCP discovery time?'},
176
- {title: 'Why is LCP discovery time important?'}
176
+ {title: 'Suggest fixes to reduce my LCP'},
177
+ {title: 'What can I do to reduce my LCP discovery time?'},
178
+ {title: 'Why is LCP discovery time important?'},
177
179
  ];
178
180
  case 'LCPBreakdown':
179
181
  return [
180
- {title: 'Help me optimize my LCP score'}, {title: 'Which LCP subpart was most problematic?'},
181
- {title: 'What can I do to reduce the LCP time for this page load?'}
182
+ {title: 'Help me optimize my LCP score'},
183
+ {title: 'Which LCP subpart was most problematic?'},
184
+ {title: 'What can I do to reduce the LCP time for this page load?'},
182
185
  ];
183
186
  case 'NetworkDependencyTree':
184
187
  return [{title: 'How do I optimize my network dependency tree?'}];
185
188
  case 'RenderBlocking':
186
189
  return [
187
190
  {title: 'Show me the most impactful render-blocking requests that I should focus on'},
188
- {title: 'How can I reduce the number of render-blocking requests?'}
191
+ {title: 'How can I reduce the number of render-blocking requests?'},
189
192
  ];
190
193
  case 'SlowCSSSelector':
191
194
  return [{title: 'How can I optimize my CSS to increase the performance of CSS selectors?'}];
@@ -355,7 +358,7 @@ ${shiftsFormatted.join('\n')}`;
355
358
 
356
359
  ${this.#traceFormatter.formatNetworkRequests([documentRequest], {
357
360
  verbose: true,
358
- customTitle: 'Document network request'
361
+ customTitle: 'Document network request',
359
362
  })}
360
363
 
361
364
  The result of the checks for this insight are:
@@ -670,7 +670,7 @@ export class PerformanceTraceFormatter {
670
670
  mimeType,
671
671
  responseHeaders,
672
672
  syntheticData,
673
- protocol
673
+ protocol,
674
674
  } = request.args.data;
675
675
  const parsedTrace = this.#parsedTrace;
676
676
 
@@ -949,7 +949,7 @@ The order of headers corresponds to an internal fixed list. If a header is not p
949
949
  startLine: contextStartLine,
950
950
  startColumn: contextStartColumn,
951
951
  endLine: contextEndLine,
952
- endColumn: contextEndColumn
952
+ endColumn: contextEndColumn,
953
953
  } = code.rangeWithContext;
954
954
  const name = code.functionBounds.name || '(anonymous)';
955
955
  const url = code.functionBounds.uiSourceCode.url();
@@ -33,6 +33,7 @@ export class AICallTree {
33
33
  public selectedNode: Trace.Extras.TraceTree.Node|null,
34
34
  public rootNode: Trace.Extras.TraceTree.TopDownRootNode,
35
35
  public parsedTrace: Trace.TraceModel.ParsedTrace,
36
+ public workspace: Workspace.Workspace.WorkspaceImpl = Workspace.Workspace.WorkspaceImpl.instance(),
36
37
  ) {
37
38
  }
38
39
 
@@ -336,8 +337,7 @@ export class AICallTree {
336
337
  const selfTimeStr = roundToTenths(node.selfTime);
337
338
 
338
339
  // 6. URL Index
339
- const location = SourceMapsResolver.SourceMapsResolver.codeLocationForEntry(
340
- parsedTrace, event, Workspace.Workspace.WorkspaceImpl.instance());
340
+ const location = SourceMapsResolver.SourceMapsResolver.codeLocationForEntry(parsedTrace, event, this.workspace);
341
341
  const url = location?.url;
342
342
  let urlIndexStr = '';
343
343
  if (url) {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Host from '../../../core/host/host.js';
6
6
  import * as Root from '../../../core/root/root.js';
7
- import type {FunctionCallHandlerResult, FunctionHandlerOptions,} from '../agents/AiAgent.js';
7
+ import type {FunctionCallHandlerResult, FunctionHandlerOptions} from '../agents/AiAgent.js';
8
8
  import {JavascriptExecutor} from '../agents/ExecuteJavascript.js';
9
9
 
10
10
  import {
@@ -38,6 +38,12 @@ export class GetNetworkRequestDetailsTool implements
38
38
  readonly description =
39
39
  'Retrieves the full headers, timing, status, and body details of a specific network request by ID.';
40
40
 
41
+ readonly #networkLog?: Logs.NetworkLog.NetworkLog;
42
+
43
+ constructor(networkLog?: Logs.NetworkLog.NetworkLog) {
44
+ this.#networkLog = networkLog;
45
+ }
46
+
41
47
  readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetNetworkRequestDetailsArgs> = {
42
48
  type: Host.AidaClient.ParametersTypes.OBJECT,
43
49
  description: 'Arguments for retrieving detailed information about a specific network request.',
@@ -81,7 +87,8 @@ export class GetNetworkRequestDetailsTool implements
81
87
  };
82
88
  }
83
89
 
84
- const request = Logs.NetworkLog.NetworkLog.instance().requests().find(req => {
90
+ const networkLog = this.#networkLog ?? Logs.NetworkLog.NetworkLog.instance();
91
+ const request = networkLog.requests().find(req => {
85
92
  if (req.requestId() !== args.id) {
86
93
  return false;
87
94
  }
@@ -102,7 +109,7 @@ export class GetNetworkRequestDetailsTool implements
102
109
  }
103
110
 
104
111
  const calculator = new NetworkTimeCalculator.NetworkTransferTimeCalculator();
105
- const formatter = new NetworkRequestFormatter(request, calculator);
112
+ const formatter = new NetworkRequestFormatter(request, calculator, networkLog);
106
113
  const formattedDetails = await formatter.formatNetworkRequest();
107
114
 
108
115
  return {
@@ -58,11 +58,11 @@ export class GetStylesTool implements
58
58
  nullable: false,
59
59
  items: {
60
60
  type: Host.AidaClient.ParametersTypes.STRING,
61
- description: 'A CSS style property name to retrieve. For example, \'background-color\'.'
62
- }
61
+ description: 'A CSS style property name to retrieve. For example, \'background-color\'.',
62
+ },
63
63
  },
64
64
  },
65
- required: ['explanation', 'elements', 'styleProperties']
65
+ required: ['explanation', 'elements', 'styleProperties'],
66
66
  };
67
67
 
68
68
  displayInfoFromArgs(params: GetStylesArgs): {
@@ -123,7 +123,7 @@ export class GetStylesTool implements
123
123
  backendNodeId: node.backendNodeId(),
124
124
  matchedCascade: matchedStyles,
125
125
  properties: params.styleProperties,
126
- }
126
+ },
127
127
  });
128
128
  for (const prop of params.styleProperties) {
129
129
  result[uid].computed[prop] = styles.get(prop);
@@ -47,10 +47,6 @@ export class ListNetworkRequestsTool implements
47
47
  this.#networkLog = networkLog;
48
48
  }
49
49
 
50
- #getNetworkLog(): Logs.NetworkLog.NetworkLog {
51
- return this.#networkLog ?? Logs.NetworkLog.NetworkLog.instance();
52
- }
53
-
54
50
  readonly parameters: Host.AidaClient.FunctionObjectParam<never> = {
55
51
  type: Host.AidaClient.ParametersTypes.OBJECT,
56
52
  description: '',
@@ -89,9 +85,10 @@ export class ListNetworkRequestsTool implements
89
85
  };
90
86
  }
91
87
 
88
+ const networkLog = this.#networkLog ?? Logs.NetworkLog.NetworkLog.instance();
92
89
  let hasCrossOriginRequest = false;
93
90
  const requestsToShow: SDK.NetworkRequest.NetworkRequest[] = [];
94
- for (const request of this.#getNetworkLog().requests()) {
91
+ for (const request of networkLog.requests()) {
95
92
  // To prevent cross-origin prompt injection attacks, HAR-imported requests
96
93
  // are assigned a virtual origin (e.g., `imported-har://${domain}`) rather than
97
94
  // sharing the origin of live pages.
@@ -284,7 +284,7 @@ export class AiCodeCompletion {
284
284
  seconds,
285
285
  nanos,
286
286
  },
287
- }
287
+ },
288
288
  },
289
289
  },
290
290
  });
@@ -300,7 +300,7 @@ export class AiCodeCompletion {
300
300
  user_acceptance: {
301
301
  sample: {
302
302
  sample_id: sampleId,
303
- }
303
+ },
304
304
  },
305
305
  },
306
306
  });
@@ -134,7 +134,7 @@ export class AiCodeGeneration {
134
134
  seconds,
135
135
  nanos,
136
136
  },
137
- }
137
+ },
138
138
  },
139
139
  },
140
140
  });
@@ -150,7 +150,7 @@ export class AiCodeGeneration {
150
150
  user_acceptance: {
151
151
  sample: {
152
152
  sample_id: sampleId,
153
- }
153
+ },
154
154
  },
155
155
  },
156
156
  });
@@ -0,0 +1,27 @@
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 Common from '../../core/common/common.js';
6
+ import * as i18n from '../../core/i18n/i18n.js';
7
+
8
+ const UIStrings = {
9
+ /**
10
+ * @description Label for a checkbox in the settings UI. Allows developers to opt-in/opt-out
11
+ * of receiving Google Developer Program (GDP) badges based on their activity in Chrome DevTools.
12
+ */
13
+ earnBadges: 'Earn badges',
14
+ } as const;
15
+
16
+ const str_ = i18n.i18n.registerUIStrings('models/badges/badges-meta.ts', UIStrings);
17
+ const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
18
+
19
+ Common.Settings.registerSettingExtension({
20
+ category: Common.Settings.SettingCategory.ACCOUNT,
21
+ settingName: 'receive-gdp-badges',
22
+ settingType: Common.Settings.SettingType.BOOLEAN,
23
+ storageType: Common.Settings.SettingStorageType.SYNCED,
24
+ title: i18nLazyString(UIStrings.earnBadges),
25
+ defaultValue: false,
26
+ reloadRequired: true,
27
+ });
@@ -13,18 +13,19 @@ import {
13
13
  type LiveLocationPool,
14
14
  LiveLocationWithPool,
15
15
  } from './LiveLocation.js';
16
- import type {ResourceMapping} from './ResourceMapping.js';
16
+ import type {CSSLocationUpdater, ResourceMapping} from './ResourceMapping.js';
17
17
  import {SASSSourceMapping} from './SASSSourceMapping.js';
18
18
  import {StylesSourceMapping} from './StylesSourceMapping.js';
19
19
 
20
- export class CSSWorkspaceBinding implements SDK.TargetManager.SDKModelObserver<SDK.CSSModel.CSSModel> {
20
+ export class CSSWorkspaceBinding implements SDK.TargetManager.SDKModelObserver<SDK.CSSModel.CSSModel>,
21
+ CSSLocationUpdater {
21
22
  readonly #resourceMapping: ResourceMapping;
22
23
  readonly #modelToInfo: Map<SDK.CSSModel.CSSModel, ModelInfo>;
23
24
  readonly #liveLocationPromises: Set<Promise<unknown>>;
24
25
 
25
26
  constructor(resourceMapping: ResourceMapping, targetManager: SDK.TargetManager.TargetManager) {
26
27
  this.#resourceMapping = resourceMapping;
27
- this.#resourceMapping.cssWorkspaceBinding = this;
28
+ this.#resourceMapping.cssLocationUpdater = this;
28
29
  this.#modelToInfo = new Map();
29
30
  targetManager.observeModels(SDK.CSSModel.CSSModel, this);
30
31
 
@@ -10,7 +10,7 @@ import * as Workspace from '../workspace/workspace.js';
10
10
 
11
11
  const UIStrings = {
12
12
  /**
13
- * @description Error message that is displayed in the Sources panel when can't be loaded.
13
+ * @description Error message displayed in the Sources panel when a file can't be loaded.
14
14
  */
15
15
  unknownErrorLoadingFile: 'Unknown error loading file',
16
16
  } as const;