chrome-devtools-frontend 1.0.1545096 → 1.0.1547571

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 (301) hide show
  1. package/.stylelintrc.json +5 -1
  2. package/docs/contributing/infrastructure.md +2 -2
  3. package/docs/styleguide/ux/styles.md +1 -1
  4. package/eslint.config.mjs +2 -1
  5. package/front_end/Images/generate-css-vars.js +1 -1
  6. package/front_end/Images/src/arrow-down.svg +8 -1
  7. package/front_end/Images/src/arrow-up.svg +8 -1
  8. package/front_end/core/common/common.ts +0 -2
  9. package/front_end/core/host/AidaClient.ts +1 -1
  10. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  11. package/front_end/core/host/UserMetrics.ts +0 -5
  12. package/front_end/core/i18n/collect-ui-strings.js +1 -1
  13. package/front_end/core/i18n/generate-locales-js.js +1 -1
  14. package/front_end/core/platform/HostRuntime.ts +25 -0
  15. package/front_end/core/platform/KeyboardUtilities.ts +2 -2
  16. package/front_end/core/platform/StringUtilities.ts +1 -1
  17. package/front_end/core/platform/api/HostRuntime.ts +45 -0
  18. package/front_end/core/platform/api/api.ts +7 -0
  19. package/front_end/core/{common/Worker.ts → platform/browser/HostRuntime.ts} +27 -12
  20. package/front_end/core/platform/browser/browser.ts +7 -0
  21. package/front_end/core/platform/node/HostRuntime.ts +85 -0
  22. package/front_end/core/platform/node/node.ts +7 -0
  23. package/front_end/core/platform/platform.ts +2 -2
  24. package/front_end/core/sdk/AnimationModel.ts +1 -1
  25. package/front_end/core/sdk/CSSModel.ts +1 -1
  26. package/front_end/core/sdk/CSSProperty.ts +1 -1
  27. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +1 -1
  28. package/front_end/core/sdk/ConsoleModel.ts +1 -1
  29. package/front_end/core/sdk/Cookie.ts +1 -1
  30. package/front_end/core/sdk/DOMModel.ts +2 -2
  31. package/front_end/core/sdk/DebuggerModel.ts +1 -1
  32. package/front_end/core/sdk/NetworkManager.ts +6 -0
  33. package/front_end/core/sdk/PreloadingModel.ts +1 -1
  34. package/front_end/core/sdk/RemoteObject.ts +1 -1
  35. package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
  36. package/front_end/core/sdk/Script.ts +4 -4
  37. package/front_end/core/sdk/SourceMapScopesInfo.ts +141 -23
  38. package/front_end/core/sdk/Target.ts +5 -14
  39. package/front_end/core/sdk/TargetManager.ts +26 -4
  40. package/front_end/core/sdk/sdk-meta.ts +62 -0
  41. package/front_end/devtools_compatibility.js +0 -1
  42. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +2 -2
  43. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +15 -18
  44. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +8 -5
  45. package/front_end/entrypoints/main/ExecutionContextSelector.ts +1 -1
  46. package/front_end/entrypoints/main/MainImpl.ts +4 -4
  47. package/front_end/foundation/Universe.ts +2 -2
  48. package/front_end/generated/Deprecation.ts +26 -0
  49. package/front_end/generated/InspectorBackendCommands.ts +5 -4
  50. package/front_end/generated/SupportedCSSProperties.js +17 -15
  51. package/front_end/generated/protocol-mapping.d.ts +2 -0
  52. package/front_end/generated/protocol-proxy-api.d.ts +4 -0
  53. package/front_end/generated/protocol.ts +19 -29
  54. package/front_end/models/ai_assistance/AiConversation.ts +268 -0
  55. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -172
  56. package/front_end/models/ai_assistance/BuiltInAi.ts +131 -134
  57. package/front_end/models/ai_assistance/ChangeManager.ts +9 -0
  58. package/front_end/models/ai_assistance/ConversationHandler.ts +27 -52
  59. package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -8
  60. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +6 -2
  61. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
  62. package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -19
  63. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  64. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +313 -313
  65. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +8 -6
  66. package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +33 -33
  67. package/front_end/models/ai_assistance/performance/AICallTree.ts +9 -3
  68. package/front_end/models/bindings/CSSWorkspaceBinding.ts +5 -3
  69. package/front_end/models/bindings/SASSSourceMapping.ts +6 -4
  70. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +10 -7
  71. package/front_end/models/crux-manager/CrUXManager.ts +7 -4
  72. package/front_end/models/formatter/FormatterWorkerPool.ts +9 -7
  73. package/front_end/models/har/Importer.ts +1 -1
  74. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +1 -1
  75. package/front_end/models/issues_manager/GenericIssue.ts +12 -9
  76. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  77. package/front_end/models/persistence/AutomaticFileSystemManager.ts +1 -1
  78. package/front_end/models/trace/handlers/SamplesHandler.ts +3 -0
  79. package/front_end/models/trace/helpers/Trace.ts +13 -0
  80. package/front_end/models/trace/types/TraceEvents.ts +2 -1
  81. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -0
  82. package/front_end/models/workspace/IgnoreListManager.ts +1 -2
  83. package/front_end/models/workspace/UISourceCode.ts +50 -0
  84. package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
  85. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +86 -159
  86. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +8 -0
  87. package/front_end/panels/ai_assistance/components/ChatView.ts +56 -33
  88. package/front_end/panels/animation/AnimationTimeline.ts +0 -8
  89. package/front_end/panels/application/ExtensionStorageModel.ts +1 -1
  90. package/front_end/panels/application/FrameDetailsView.ts +64 -36
  91. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  92. package/front_end/panels/application/components/components.ts +0 -2
  93. package/front_end/panels/common/AiCodeGenerationTeaser.ts +80 -0
  94. package/front_end/panels/common/common.ts +2 -1
  95. package/front_end/panels/console/ConsoleInsightTeaser.ts +166 -100
  96. package/front_end/panels/console/ConsolePrompt.ts +4 -2
  97. package/front_end/panels/console/ConsoleViewMessage.ts +77 -29
  98. package/front_end/panels/console/ConsoleViewport.ts +2 -3
  99. package/front_end/panels/console/consoleInsightTeaser.css +1 -0
  100. package/front_end/panels/coverage/CoverageModel.ts +2 -2
  101. package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
  102. package/front_end/panels/elements/ElementsPanel.ts +1 -1
  103. package/front_end/panels/elements/ElementsTreeOutline.ts +17 -7
  104. package/front_end/panels/elements/NodeStackTraceWidget.ts +6 -5
  105. package/front_end/panels/elements/StylePropertyTreeElement.ts +24 -21
  106. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  107. package/front_end/panels/elements/cssValueTraceView.css +1 -1
  108. package/front_end/panels/elements/elements-meta.ts +1 -0
  109. package/front_end/panels/explain/components/ConsoleInsight.ts +44 -57
  110. package/front_end/panels/explain/components/consoleInsight.css +46 -1
  111. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -2
  112. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +19 -0
  113. package/front_end/panels/network/RequestConditionsDrawer.ts +116 -42
  114. package/front_end/panels/network/networkLogView.css +11 -0
  115. package/front_end/panels/network/networkTimingTable.css +8 -6
  116. package/front_end/panels/network/requestConditionsDrawer.css +10 -1
  117. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
  118. package/front_end/panels/profiler/HeapSnapshotProxy.ts +15 -14
  119. package/front_end/panels/profiler/ProfilesPanel.ts +1 -2
  120. package/front_end/panels/recorder/components/StepEditor.ts +1 -1
  121. package/front_end/panels/security/SecurityPanelSidebar.ts +1 -3
  122. package/front_end/panels/settings/KeybindsSettingsTab.ts +21 -22
  123. package/front_end/panels/sources/CSSPlugin.ts +1 -1
  124. package/front_end/panels/sources/CoveragePlugin.ts +5 -5
  125. package/front_end/panels/sources/DebuggerPlugin.ts +2 -2
  126. package/front_end/panels/sources/NavigatorView.ts +1 -1
  127. package/front_end/panels/sources/Plugin.ts +1 -1
  128. package/front_end/panels/sources/ProfilePlugin.ts +22 -14
  129. package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
  130. package/front_end/panels/sources/UISourceCodeFrame.ts +2 -1
  131. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +10 -2
  132. package/front_end/panels/sources/sources-meta.ts +0 -62
  133. package/front_end/panels/timeline/README.md +1 -9
  134. package/front_end/panels/timeline/ThreadAppender.ts +0 -7
  135. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
  136. package/front_end/panels/timeline/TimelinePanel.ts +8 -8
  137. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -1
  138. package/front_end/panels/timeline/components/ExportTraceOptions.ts +15 -1
  139. package/front_end/panels/timeline/components/LiveMetricsView.ts +37 -1
  140. package/front_end/panels/timeline/components/exportTraceOptions.css +11 -2
  141. package/front_end/panels/timeline/enable-easter-egg.js +1 -1
  142. package/front_end/panels/timeline/utils/Treemap.ts +1 -1
  143. package/front_end/third_party/chromium/README.chromium +1 -1
  144. package/front_end/third_party/puppeteer/README.chromium +2 -2
  145. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
  146. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  147. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +57 -0
  148. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  149. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
  153. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +1 -0
  156. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
  157. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js +1 -0
  158. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +1 -6
  161. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +0 -4
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +18 -23
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  168. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +16 -0
  169. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +9 -73
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -3
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +8 -1
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -10
  193. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +80 -81
  194. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
  195. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  196. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +52 -0
  197. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  198. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  201. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
  202. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +1 -0
  205. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
  206. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js +1 -0
  207. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
  208. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +1 -6
  210. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +0 -4
  212. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +18 -23
  214. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  215. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  216. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  217. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +16 -0
  218. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  219. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
  220. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  221. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +6 -69
  222. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  228. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -3
  229. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +8 -1
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -10
  240. package/front_end/third_party/puppeteer/package/package.json +3 -3
  241. package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +79 -0
  242. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +1 -1
  243. package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -2
  244. package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
  245. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +1 -9
  246. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +21 -31
  247. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +18 -0
  248. package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +6 -72
  249. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -4
  250. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +7 -2
  251. package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +14 -0
  252. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  253. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  254. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
  255. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -0
  256. package/front_end/ui/components/text_editor/javascript.ts +1 -1
  257. package/front_end/ui/legacy/ARIAUtils.ts +2 -2
  258. package/front_end/ui/legacy/ActionRegistration.ts +11 -0
  259. package/front_end/ui/legacy/ListWidget.ts +51 -18
  260. package/front_end/ui/legacy/ReportView.ts +1 -1
  261. package/front_end/ui/legacy/SoftDropDown.ts +2 -2
  262. package/front_end/ui/legacy/TabbedPane.ts +3 -3
  263. package/front_end/ui/legacy/TextPrompt.ts +3 -2
  264. package/front_end/ui/legacy/Treeoutline.ts +3 -2
  265. package/front_end/ui/legacy/UIUtils.ts +11 -10
  266. package/front_end/ui/legacy/Widget.ts +3 -2
  267. package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +1 -1
  268. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +5 -4
  269. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +87 -111
  270. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +62 -39
  271. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
  272. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -2
  273. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -9
  274. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +41 -13
  275. package/front_end/ui/legacy/components/utils/jsUtils.css +28 -0
  276. package/front_end/ui/legacy/inspectorCommon.css +2 -2
  277. package/front_end/ui/legacy/legacy.ts +2 -0
  278. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  279. package/front_end/ui/visual_logging/LoggingConfig.ts +2 -1
  280. package/inspector_overlay/tool_window_controls.ts +4 -1
  281. package/mcp/mcp.ts +1 -1
  282. package/package.json +2 -3
  283. package/front_end/panels/application/components/StackTrace.ts +0 -239
  284. package/front_end/panels/application/components/stackTraceLinkButton.css +0 -16
  285. package/front_end/panels/application/components/stackTraceRow.css +0 -50
  286. package/front_end/panels/explain/components/consoleInsightSourcesList.css +0 -51
  287. package/front_end/ui/components/docs/README.md +0 -6
  288. package/front_end/ui/components/docs/building-ui-documentation/ComponentEvents.md +0 -54
  289. package/front_end/ui/components/docs/building-ui-documentation/ComponentPerformance.md +0 -136
  290. package/front_end/ui/components/docs/building-ui-documentation/CreatingComponents.md +0 -242
  291. package/front_end/ui/components/docs/building-ui-documentation/README.md +0 -23
  292. package/front_end/ui/components/docs/building-ui-documentation/StylingComponents.md +0 -66
  293. package/front_end/ui/components/docs/building-ui-documentation/TestingComponents.md +0 -111
  294. package/front_end/ui/components/docs/component_docs.ts +0 -24
  295. package/front_end/ui/components/docs/component_docs_styles.css +0 -53
  296. package/front_end/ui/components/docs/create_breadcrumbs.ts +0 -44
  297. package/front_end/ui/components/docs/slider/basic.html +0 -20
  298. package/front_end/ui/components/docs/switch/basic.html +0 -20
  299. /package/front_end/models/issues_manager/descriptions/{genericFormAriaLabelledByToNonExistingId.md → genericFormAriaLabelledByToNonExistingIdError.md} +0 -0
  300. /package/front_end/models/issues_manager/descriptions/{genericFormLabelHasNeitherForNorNestedInput.md → genericFormLabelHasNeitherForNorNestedInputError.md} +0 -0
  301. /package/front_end/{core/platform → ui/legacy}/DOMUtilities.ts +0 -0
@@ -5,9 +5,7 @@
5
5
 
6
6
  import * as Common from '../../core/common/common.js';
7
7
 
8
- import {type ContextDetail, type ResponseData, ResponseType, type SerializedResponseData} from './agents/AiAgent.js';
9
-
10
- const MAX_TITLE_LENGTH = 80;
8
+ import {ResponseType, type SerializedResponseData} from './agents/AiAgent.js';
11
9
 
12
10
  export const enum ConversationType {
13
11
  STYLING = 'freestyler',
@@ -16,8 +14,6 @@ export const enum ConversationType {
16
14
  PERFORMANCE = 'drjones-performance-full',
17
15
  }
18
16
 
19
- export const NOT_FOUND_IMAGE_DATA = '';
20
-
21
17
  export interface SerializedConversation {
22
18
  id: string;
23
19
  type: ConversationType;
@@ -35,173 +31,6 @@ export interface SerializedImage {
35
31
  data: string;
36
32
  }
37
33
 
38
- export class Conversation {
39
- readonly id: string;
40
- readonly type: ConversationType;
41
- #isReadOnly: boolean;
42
- readonly history: ResponseData[];
43
- #isExternal: boolean;
44
-
45
- static generateContextDetailsMarkdown(details: ContextDetail[]): string {
46
- const detailsMarkdown: string[] = [];
47
- for (const detail of details) {
48
- const text = `\`\`\`\`${detail.codeLang || ''}\n${detail.text.trim()}\n\`\`\`\``;
49
- detailsMarkdown.push(`**${detail.title}:**\n${text}`);
50
- }
51
- return detailsMarkdown.join('\n\n');
52
- }
53
-
54
- constructor(
55
- type: ConversationType, data: ResponseData[] = [], id: string = crypto.randomUUID(), isReadOnly = true,
56
- isExternal = false) {
57
- this.type = type;
58
- this.id = id;
59
- this.#isReadOnly = isReadOnly;
60
- this.#isExternal = isExternal;
61
- this.history = this.#reconstructHistory(data);
62
- }
63
-
64
- get isReadOnly(): boolean {
65
- return this.#isReadOnly;
66
- }
67
-
68
- get title(): string|undefined {
69
- const query = this.history.find(response => response.type === ResponseType.USER_QUERY)?.query;
70
-
71
- if (!query) {
72
- return;
73
- }
74
-
75
- if (this.#isExternal) {
76
- return `[External] ${query.substring(0, MAX_TITLE_LENGTH - 11)}${
77
- query.length > MAX_TITLE_LENGTH - 11 ? '…' : ''}`;
78
- }
79
- return `${query.substring(0, MAX_TITLE_LENGTH)}${query.length > MAX_TITLE_LENGTH ? '…' : ''}`;
80
- }
81
-
82
- get isEmpty(): boolean {
83
- return this.history.length === 0;
84
- }
85
-
86
- #reconstructHistory(historyWithoutImages: ResponseData[]): ResponseData[] {
87
- const imageHistory = AiHistoryStorage.instance().getImageHistory();
88
- if (imageHistory && imageHistory.length > 0) {
89
- const history: ResponseData[] = [];
90
- for (const data of historyWithoutImages) {
91
- if (data.type === ResponseType.USER_QUERY && data.imageId) {
92
- const image = imageHistory.find(item => item.id === data.imageId);
93
- const inlineData = image ? {data: image.data, mimeType: image.mimeType} :
94
- {data: NOT_FOUND_IMAGE_DATA, mimeType: 'image/jpeg'};
95
- history.push({...data, imageInput: {inlineData}});
96
- } else {
97
- history.push(data);
98
- }
99
- }
100
- return history;
101
- }
102
- return historyWithoutImages;
103
- }
104
-
105
- getConversationMarkdown(): string {
106
- const contentParts: string[] = [];
107
- contentParts.push(
108
- '# Exported Chat from Chrome DevTools AI Assistance\n\n' +
109
- `**Export Timestamp (UTC):** ${new Date().toISOString()}\n\n` +
110
- '---',
111
- );
112
- for (const item of this.history) {
113
- switch (item.type) {
114
- case ResponseType.USER_QUERY: {
115
- contentParts.push(`## User\n\n${item.query}`);
116
- if (item.imageInput) {
117
- contentParts.push('User attached an image');
118
- }
119
- contentParts.push('## AI');
120
- break;
121
- }
122
- case ResponseType.CONTEXT: {
123
- contentParts.push(`### ${item.title}`);
124
- if (item.details && item.details.length > 0) {
125
- contentParts.push(Conversation.generateContextDetailsMarkdown(item.details));
126
- }
127
- break;
128
- }
129
- case ResponseType.TITLE: {
130
- contentParts.push(`### ${item.title}`);
131
- break;
132
- }
133
- case ResponseType.THOUGHT: {
134
- contentParts.push(`${item.thought}`);
135
- break;
136
- }
137
- case ResponseType.ACTION: {
138
- // We want to export only actions with output field
139
- if (!item.output) {
140
- break;
141
- }
142
- if (item.code) {
143
- contentParts.push(`**Code executed:**\n\`\`\`\n${item.code.trim()}\n\`\`\``);
144
- }
145
- contentParts.push(`**Data returned:**\n\`\`\`\n${item.output}\n\`\`\``);
146
- break;
147
- }
148
- case ResponseType.ANSWER: {
149
- if (item.complete) {
150
- contentParts.push(`### Answer\n\n${item.text.trim()}`);
151
- }
152
- break;
153
- }
154
- }
155
- }
156
- return contentParts.join('\n\n');
157
- }
158
-
159
- archiveConversation(): void {
160
- this.#isReadOnly = true;
161
- }
162
-
163
- async addHistoryItem(item: ResponseData): Promise<void> {
164
- this.history.push(item);
165
- await AiHistoryStorage.instance().upsertHistoryEntry(this.serialize());
166
- if (item.type === ResponseType.USER_QUERY) {
167
- if (item.imageId && item.imageInput && 'inlineData' in item.imageInput) {
168
- const inlineData = item.imageInput.inlineData;
169
- await AiHistoryStorage.instance().upsertImage(
170
- {id: item.imageId, data: inlineData.data, mimeType: inlineData.mimeType});
171
- }
172
- }
173
- }
174
-
175
- serialize(): SerializedConversation {
176
- return {
177
- id: this.id,
178
- history: this.history.map(item => {
179
- if (item.type === ResponseType.USER_QUERY) {
180
- return {...item, imageInput: undefined};
181
- }
182
- // Remove the `confirm()`-function because `structuredClone()` throws on functions
183
- if (item.type === ResponseType.SIDE_EFFECT) {
184
- return {...item, confirm: undefined};
185
- }
186
- return item;
187
- }),
188
- type: this.type,
189
- isExternal: this.#isExternal,
190
- };
191
- }
192
-
193
- static fromSerializedConversation(serializedConversation: SerializedConversation): Conversation {
194
- const history = serializedConversation.history.map(entry => {
195
- if (entry.type === ResponseType.SIDE_EFFECT) {
196
- return {...entry, confirm: () => {}};
197
- }
198
- return entry;
199
- });
200
- return new Conversation(
201
- serializedConversation.type, history, serializedConversation.id, true, serializedConversation.isExternal);
202
- }
203
- }
204
-
205
34
  let instance: AiHistoryStorage|null = null;
206
35
 
207
36
  const DEFAULT_MAX_STORAGE_SIZE = 50 * 1024 * 1024;
@@ -6,15 +6,12 @@ import * as Host from '../../core/host/host.js';
6
6
  import * as Root from '../../core/root/root.js';
7
7
 
8
8
  let builtInAiInstance: BuiltInAi|undefined;
9
- let availability: LanguageModelAvailability|undefined;
10
- let hasGpu: boolean|undefined;
11
- let isFirstRun = true;
12
9
 
13
10
  export interface LanguageModel {
14
11
  promptStreaming: (arg0: string, opts?: {
15
12
  signal?: AbortSignal,
16
13
  }) => AsyncGenerator<string>;
17
- clone: () => LanguageModel;
14
+ clone: () => Promise<LanguageModel>;
18
15
  destroy: () => void;
19
16
  }
20
17
 
@@ -27,155 +24,112 @@ export const enum LanguageModelAvailability {
27
24
  }
28
25
 
29
26
  export class BuiltInAi {
30
- #consoleInsightsSession: LanguageModel;
27
+ #availability: LanguageModelAvailability|null = null;
28
+ #hasGpu: boolean;
29
+ #consoleInsightsSession?: LanguageModel;
30
+ initDoneForTesting: Promise<void>;
31
31
 
32
- static async getLanguageModelAvailability(): Promise<LanguageModelAvailability> {
32
+ static instance(): BuiltInAi {
33
+ if (builtInAiInstance === undefined) {
34
+ builtInAiInstance = new BuiltInAi();
35
+ }
36
+ return builtInAiInstance;
37
+ }
38
+
39
+ constructor() {
40
+ this.#hasGpu = this.#isGpuAvailable();
41
+ this.initDoneForTesting =
42
+ this.getLanguageModelAvailability().then(() => this.initialize()).then(() => this.#sendAvailabilityMetrics());
43
+ }
44
+
45
+ async getLanguageModelAvailability(): Promise<LanguageModelAvailability> {
33
46
  if (!Root.Runtime.hostConfig.devToolsAiPromptApi?.enabled) {
34
- return LanguageModelAvailability.DISABLED;
47
+ this.#availability = LanguageModelAvailability.DISABLED;
48
+ return this.#availability;
35
49
  }
36
50
  try {
37
51
  // @ts-expect-error
38
- availability = await window.LanguageModel.availability({expectedOutputs: [{type: 'text', languages: ['en']}]}) as
39
- LanguageModelAvailability;
40
- return availability;
52
+ this.#availability = await window.LanguageModel.availability(
53
+ {expectedOutputs: [{type: 'text', languages: ['en']}]}) as LanguageModelAvailability;
41
54
  } catch {
42
- return LanguageModelAvailability.UNAVAILABLE;
55
+ this.#availability = LanguageModelAvailability.UNAVAILABLE;
43
56
  }
57
+ return this.#availability;
44
58
  }
45
59
 
46
- static cachedIsAvailable(): boolean {
47
- return availability === LanguageModelAvailability.AVAILABLE &&
48
- (hasGpu || Boolean(Root.Runtime.hostConfig.devToolsAiPromptApi?.allowWithoutGpu));
49
- }
50
-
51
- static isGpuAvailable(): boolean {
52
- const hasGpuHelper = (): boolean => {
53
- const canvas = document.createElement('canvas');
54
- try {
55
- const webgl = canvas.getContext('webgl');
56
- if (!webgl) {
57
- return false;
58
- }
59
- const debugInfo = webgl.getExtension('WEBGL_debug_renderer_info');
60
- if (!debugInfo) {
61
- return false;
62
- }
63
- const renderer = webgl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
64
- if (renderer.includes('SwiftShader')) {
65
- return false;
66
- }
67
- } catch {
60
+ #isGpuAvailable(): boolean {
61
+ const canvas = document.createElement('canvas');
62
+ try {
63
+ const webgl = canvas.getContext('webgl');
64
+ if (!webgl) {
68
65
  return false;
69
66
  }
70
- return true;
71
- };
72
-
73
- if (hasGpu !== undefined) {
74
- return hasGpu;
67
+ const debugInfo = webgl.getExtension('WEBGL_debug_renderer_info');
68
+ if (!debugInfo) {
69
+ return false;
70
+ }
71
+ const renderer = webgl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
72
+ if (renderer.includes('SwiftShader')) {
73
+ return false;
74
+ }
75
+ } catch {
76
+ return false;
75
77
  }
76
- hasGpu = hasGpuHelper();
77
- return hasGpu;
78
+ return true;
78
79
  }
79
80
 
80
- private constructor(consoleInsightsSession: LanguageModel) {
81
- this.#consoleInsightsSession = consoleInsightsSession;
81
+ hasSession(): boolean {
82
+ return Boolean(this.#consoleInsightsSession);
82
83
  }
83
84
 
84
- static async instance(): Promise<BuiltInAi|undefined> {
85
- if (builtInAiInstance === undefined) {
86
- if (isFirstRun) {
87
- const languageModelAvailability = await BuiltInAi.getLanguageModelAvailability();
88
- const hasGpu = BuiltInAi.isGpuAvailable();
89
- if (hasGpu) {
90
- switch (languageModelAvailability) {
91
- case LanguageModelAvailability.UNAVAILABLE:
92
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.UNAVAILABLE_HAS_GPU);
93
- break;
94
- case LanguageModelAvailability.DOWNLOADABLE:
95
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DOWNLOADABLE_HAS_GPU);
96
- break;
97
- case LanguageModelAvailability.DOWNLOADING:
98
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DOWNLOADING_HAS_GPU);
99
- break;
100
- case LanguageModelAvailability.AVAILABLE:
101
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.AVAILABLE_HAS_GPU);
102
- break;
103
- case LanguageModelAvailability.DISABLED:
104
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DISABLED_HAS_GPU);
105
- break;
106
- }
107
- } else {
108
- switch (languageModelAvailability) {
109
- case LanguageModelAvailability.UNAVAILABLE:
110
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.UNAVAILABLE_NO_GPU);
111
- break;
112
- case LanguageModelAvailability.DOWNLOADABLE:
113
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DOWNLOADABLE_NO_GPU);
114
- break;
115
- case LanguageModelAvailability.DOWNLOADING:
116
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DOWNLOADING_NO_GPU);
117
- break;
118
- case LanguageModelAvailability.AVAILABLE:
119
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.AVAILABLE_NO_GPU);
120
- break;
121
- case LanguageModelAvailability.DISABLED:
122
- Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DISABLED_NO_GPU);
123
- break;
124
- }
125
- }
126
- isFirstRun = false;
127
- if (!Root.Runtime.hostConfig.devToolsAiPromptApi?.allowWithoutGpu && !hasGpu) {
128
- return undefined;
129
- }
130
- if (languageModelAvailability !== LanguageModelAvailability.AVAILABLE) {
131
- return undefined;
132
- }
133
- } else {
134
- if (!Root.Runtime.hostConfig.devToolsAiPromptApi?.allowWithoutGpu && !BuiltInAi.isGpuAvailable()) {
135
- return undefined;
136
- }
137
- if ((await BuiltInAi.getLanguageModelAvailability()) !== LanguageModelAvailability.AVAILABLE) {
138
- return undefined;
139
- }
140
- }
85
+ async initialize(): Promise<void> {
86
+ if (!Root.Runtime.hostConfig.devToolsAiPromptApi?.allowWithoutGpu && !this.#hasGpu) {
87
+ return;
88
+ }
89
+ if (this.#availability !== LanguageModelAvailability.AVAILABLE) {
90
+ return;
91
+ }
92
+ await this.#createSession();
93
+ }
94
+
95
+ async #createSession(): Promise<void> {
96
+ try {
97
+ // @ts-expect-error
98
+ this.#consoleInsightsSession = await window.LanguageModel.create({
99
+ initialPrompts: [{
100
+ role: 'system',
101
+ content: `
102
+ You are an expert web developer. Your goal is to help a human web developer who
103
+ is using Chrome DevTools to debug a web site or web app. The Chrome DevTools
104
+ console is showing a message which is either an error or a warning. Please help
105
+ the user understand the problematic console message.
141
106
 
142
- try {
143
- // @ts-expect-error
144
- const consoleInsightsSession = await window.LanguageModel.create({
145
- initialPrompts: [{
146
- role: 'system',
147
- content: `
148
- You are an expert web developer. Your goal is to help a human web developer who
149
- is using Chrome DevTools to debug a web site or web app. The Chrome DevTools
150
- console is showing a message which is either an error or a warning. Please help
151
- the user understand the problematic console message.
152
-
153
- Your instructions are as follows:
154
- - Explain the reason why the error or warning is showing up.
155
- - The explanation has a maximum length of 200 characters. Anything beyond this
156
- length will be cut off. Make sure that your explanation is at most 200 characters long.
157
- - Your explanation should not end in the middle of a sentence.
158
- - Your explanation should consist of a single paragraph only. Do not include any
159
- headings or code blocks. Only write a single paragraph of text.
160
- - Your response should be concise and to the point. Avoid lengthy explanations
161
- or unnecessary details.
162
- `
163
- }],
164
- expectedInputs: [{
165
- type: 'text',
166
- languages: ['en'],
167
- }],
168
- expectedOutputs: [{
169
- type: 'text',
170
- languages: ['en'],
171
- }],
172
- }) as LanguageModel;
173
- builtInAiInstance = new BuiltInAi(consoleInsightsSession);
174
- } catch {
175
- return undefined;
107
+ Your instructions are as follows:
108
+ - Explain the reason why the error or warning is showing up.
109
+ - The explanation has a maximum length of 200 characters. Anything beyond this
110
+ length will be cut off. Make sure that your explanation is at most 200 characters long.
111
+ - Your explanation should not end in the middle of a sentence.
112
+ - Your explanation should consist of a single paragraph only. Do not include any
113
+ headings or code blocks. Only write a single paragraph of text.
114
+ - Your response should be concise and to the point. Avoid lengthy explanations
115
+ or unnecessary details.
116
+ `
117
+ }],
118
+ expectedInputs: [{
119
+ type: 'text',
120
+ languages: ['en'],
121
+ }],
122
+ expectedOutputs: [{
123
+ type: 'text',
124
+ languages: ['en'],
125
+ }],
126
+ });
127
+ if (this.#availability !== LanguageModelAvailability.AVAILABLE) {
128
+ void this.getLanguageModelAvailability();
176
129
  }
130
+ } catch (e) {
131
+ console.error('Error when creating LanguageModel session', e.message);
177
132
  }
178
- return builtInAiInstance;
179
133
  }
180
134
 
181
135
  static removeInstance(): void {
@@ -183,6 +137,9 @@ export class BuiltInAi {
183
137
  }
184
138
 
185
139
  async * getConsoleInsight(prompt: string, abortController: AbortController): AsyncGenerator<string> {
140
+ if (!this.#consoleInsightsSession) {
141
+ return;
142
+ }
186
143
  // Clone the session to start a fresh conversation for each answer. Otherwise
187
144
  // previous dialog would pollute the context resulting in worse answers.
188
145
  let session: LanguageModel|null = null;
@@ -200,4 +157,44 @@ export class BuiltInAi {
200
157
  }
201
158
  }
202
159
  }
160
+
161
+ #sendAvailabilityMetrics(): void {
162
+ if (this.#hasGpu) {
163
+ switch (this.#availability) {
164
+ case LanguageModelAvailability.UNAVAILABLE:
165
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.UNAVAILABLE_HAS_GPU);
166
+ break;
167
+ case LanguageModelAvailability.DOWNLOADABLE:
168
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DOWNLOADABLE_HAS_GPU);
169
+ break;
170
+ case LanguageModelAvailability.DOWNLOADING:
171
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DOWNLOADING_HAS_GPU);
172
+ break;
173
+ case LanguageModelAvailability.AVAILABLE:
174
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.AVAILABLE_HAS_GPU);
175
+ break;
176
+ case LanguageModelAvailability.DISABLED:
177
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DISABLED_HAS_GPU);
178
+ break;
179
+ }
180
+ } else {
181
+ switch (this.#availability) {
182
+ case LanguageModelAvailability.UNAVAILABLE:
183
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.UNAVAILABLE_NO_GPU);
184
+ break;
185
+ case LanguageModelAvailability.DOWNLOADABLE:
186
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DOWNLOADABLE_NO_GPU);
187
+ break;
188
+ case LanguageModelAvailability.DOWNLOADING:
189
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DOWNLOADING_NO_GPU);
190
+ break;
191
+ case LanguageModelAvailability.AVAILABLE:
192
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.AVAILABLE_NO_GPU);
193
+ break;
194
+ case LanguageModelAvailability.DISABLED:
195
+ Host.userMetrics.builtInAiAvailability(Host.UserMetrics.BuiltInAiAvailability.DISABLED_NO_GPU);
196
+ break;
197
+ }
198
+ }
199
+ }
203
200
  }
@@ -35,6 +35,15 @@ export class ChangeManager {
35
35
  readonly #stylesheetChanges = new Map<Protocol.CSS.StyleSheetId, Change[]>();
36
36
  readonly #backupStylesheetChanges = new Map<Protocol.CSS.StyleSheetId, Change[]>();
37
37
 
38
+ constructor() {
39
+ SDK.TargetManager.TargetManager.instance().addModelListener(
40
+ SDK.ResourceTreeModel.ResourceTreeModel,
41
+ SDK.ResourceTreeModel.Events.PrimaryPageChanged,
42
+ this.clear,
43
+ this,
44
+ );
45
+ }
46
+
38
47
  async stashChanges(): Promise<void> {
39
48
  for (const [cssModel, stylesheetMap] of this.#cssModelToStylesheetId.entries()) {
40
49
  const stylesheetIds = Array.from(stylesheetMap.values());