chrome-devtools-frontend 1.0.1565595 → 1.0.1567721

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 (201) hide show
  1. package/docs/contributing/performance.md +24 -0
  2. package/front_end/Images/src/lock-person.svg +1 -0
  3. package/front_end/core/common/Base64.ts +21 -2
  4. package/front_end/core/common/ResourceType.ts +7 -0
  5. package/front_end/core/host/InspectorFrontendHostStub.ts +3 -0
  6. package/front_end/core/host/UserMetrics.ts +20 -0
  7. package/front_end/core/root/Runtime.ts +5 -0
  8. package/front_end/core/sdk/DOMModel.ts +32 -2
  9. package/front_end/core/sdk/NetworkManager.ts +16 -3
  10. package/front_end/core/sdk/ResourceTreeModel.ts +11 -6
  11. package/front_end/entrypoints/main/MainImpl.ts +1 -7
  12. package/front_end/generated/Deprecation.ts +0 -8
  13. package/front_end/generated/InspectorBackendCommands.ts +10 -1
  14. package/front_end/generated/SupportedCSSProperties.js +48 -62
  15. package/front_end/generated/protocol-mapping.d.ts +4 -0
  16. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  17. package/front_end/generated/protocol.ts +203 -0
  18. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -1
  19. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +98 -105
  20. package/front_end/models/emulation/DeviceModeModel.ts +1 -1
  21. package/front_end/models/formatter/FormatterWorkerPool.ts +8 -6
  22. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -9
  23. package/front_end/models/persistence/PersistenceImpl.ts +8 -0
  24. package/front_end/models/text_utils/TextUtils.snapshot.txt +83 -0
  25. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -1
  26. package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +28 -4
  27. package/front_end/panels/ai_assistance/components/ChatView.ts +52 -169
  28. package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +27 -8
  29. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +19 -4
  30. package/front_end/panels/application/ApplicationPanelSidebar.ts +29 -0
  31. package/front_end/panels/application/ApplicationPanelTreeElement.ts +12 -0
  32. package/front_end/panels/application/DeviceBoundSessionsModel.ts +169 -0
  33. package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +219 -0
  34. package/front_end/panels/application/DeviceBoundSessionsView.ts +1096 -0
  35. package/front_end/panels/application/ResourcesPanel.ts +19 -0
  36. package/front_end/panels/application/application.ts +6 -0
  37. package/front_end/panels/application/deviceBoundSessionsView.css +27 -0
  38. package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +115 -0
  39. package/front_end/panels/common/aiCodeGenerationUpgradeDialog.css +79 -0
  40. package/front_end/panels/common/common.ts +1 -0
  41. package/front_end/panels/console/ConsoleInsightTeaser.ts +41 -8
  42. package/front_end/panels/console/ConsoleViewMessage.ts +20 -13
  43. package/front_end/panels/elements/ElementsTreeOutline.ts +13 -0
  44. package/front_end/panels/elements/MetricsSidebarPane.ts +3 -1
  45. package/front_end/panels/issues/AffectedSourcesView.ts +0 -1
  46. package/front_end/panels/issues/IssuesPane.ts +0 -4
  47. package/front_end/panels/network/RequestTimingView.ts +5 -20
  48. package/front_end/panels/network/networkTimingTable.css +5 -5
  49. package/front_end/panels/recorder/components/StepEditor.ts +15 -8
  50. package/front_end/panels/security/SecurityPanelSidebar.ts +0 -1
  51. package/front_end/panels/settings/AISettingsTab.ts +31 -2
  52. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +8 -6
  53. package/front_end/panels/sources/UISourceCodeFrame.ts +9 -3
  54. package/front_end/panels/timeline/TimelinePanel.ts +12 -4
  55. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +1 -1
  56. package/front_end/third_party/chromium/README.chromium +1 -1
  57. package/front_end/third_party/puppeteer/README.chromium +2 -2
  58. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +9 -2
  59. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +8 -0
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +8 -0
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +2 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +2 -2
  68. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +3 -1
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +3 -3
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts +1 -0
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js +1 -0
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +1 -0
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +33 -31
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts +2 -2
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js +1 -4
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +7 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts +2 -2
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +13 -4
  104. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +62 -42
  105. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +9 -2
  106. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +8 -0
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +8 -0
  111. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +2 -1
  113. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +2 -2
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +3 -1
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +3 -3
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts +1 -0
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js +1 -0
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js.map +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +1 -0
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +33 -31
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts +2 -2
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js +1 -4
  138. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +7 -1
  140. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
  142. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts +2 -2
  144. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
  145. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
  146. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  147. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/types.d.ts +13 -4
  149. package/front_end/third_party/puppeteer/package/package.json +3 -3
  150. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +11 -3
  151. package/front_end/third_party/puppeteer/package/src/api/Page.ts +9 -0
  152. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +3 -3
  153. package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +3 -1
  154. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -0
  155. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +3 -5
  156. package/front_end/third_party/puppeteer/package/src/bidi/core/UserContext.ts +2 -0
  157. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +1 -0
  158. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +43 -45
  159. package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +3 -11
  160. package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +12 -0
  161. package/front_end/third_party/puppeteer/package/src/common/Cookie.ts +2 -2
  162. package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
  163. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  164. package/front_end/third_party/source-map-scopes-codec/README.chromium +2 -5
  165. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +1 -1
  166. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +1 -1
  167. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +1 -1
  168. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +1 -1
  169. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +1 -1
  170. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +1 -1
  171. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +1 -1
  172. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +1 -1
  173. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +1 -1
  174. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +1 -1
  175. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts +130 -0
  176. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts.map +1 -0
  177. package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
  178. package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
  179. package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +1 -1
  180. package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +1 -1
  181. package/front_end/third_party/source-map-scopes-codec/package/src/codec.js +4 -0
  182. package/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +1 -1
  183. package/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +4 -0
  184. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +30 -13
  185. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -1
  186. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +35 -17
  187. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +1 -1
  188. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +1 -1
  189. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +1 -1
  190. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +2 -2
  191. package/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +1 -1
  192. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js +7 -0
  193. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js.map +1 -0
  194. package/front_end/third_party/source-map-scopes-codec/package/src/util.ts +1 -1
  195. package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +8 -1
  196. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +4 -0
  197. package/front_end/ui/visual_logging/KnownContextValues.ts +13 -0
  198. package/mcp/mcp.ts +1 -0
  199. package/package.json +1 -2
  200. package/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +0 -8
  201. /package/front_end/third_party/source-map-scopes-codec/package/src/{scopes.d.ts → scopes.ts} +0 -0
@@ -77,37 +77,29 @@ const getGreenDevAdditionalWidgetGuidelines = (): string => {
77
77
 
78
78
  if (widgetsFromFunctionCalls) {
79
79
  return `
80
- - CRITICAL: You have access to three functions for adding rich, interactive widgets to your response:
81
- \`addInsightWidget\`, \`addNetworkRequestWidget\`, and \`addFlameChartWidget\`.
82
- You MUST use these functions whenever you refer to a corresponding entity.
83
-
84
- - **\`addInsightWidget({insightType: '...'})\`**:
85
- - **When to use**: Call this function every time you mention a specific performance insight (e.g., LCP, INP,
86
- CLS culprits).
87
- - **Purpose**: It embeds an interactive widget that provides a detailed breakdown and visualization of the
88
- insight.
89
- - **Example**: If you are explaining the causes of a poor LCP score, you MUST also call
90
- \`addInsightWidget({insightType: 'LCPBreakdown'})\`. This provides the user with the data to explore
91
- alongside your explanation.
92
- - **\`addNetworkRequestWidget({eventKey: '...'})\`**:
80
+ - CRITICAL: You have access to a function for adding rich, interactive widgets to your response: \`addWidget\`.
81
+ You MUST use this function whenever you refer to a corresponding entity.
82
+
83
+ - **\`addWidget({widget: {type: 'insight', insightType: '...'}})\`**:
84
+ - **When to use**: Call this function every time you mention a specific performance insight (e.g., LCP, INP, CLS culprits).
85
+ - **Purpose**: It embeds an interactive widget that provides a detailed breakdown and visualization of the insight.
86
+ - **Example**: If you are explaining the causes of a poor LCP score, you MUST also call \`addWidget({widget: {type: 'insight', insightType: 'LCPBreakdown'}})\`.
87
+
88
+ - **\`addWidget({widget: {type: 'network-request', eventKey: '...'}})\`**:
93
89
  - **When to use**: Call this function whenever you discuss a specific network request.
94
- - **Purpose**: It adds a widget displaying the full details of the network request, such as its timing,
95
- headers, and priority.
96
- - **Critical**: The eventKey should be the trace event key (only the number, no letters prefix or -) of that
97
- script's network request.
98
- - **Example**: If you identify a render-blocking script, you MUST also call
99
- \`addNetworkRequestWidget({eventKey: '...'})\` with the trace event key (only the number, no letters prefix
100
- or -) of that script's network request.
101
- - **\`addFlameChartWidget({start: ..., end: ...})\`**:
102
- - **When to use**: Call this function to highlight a specific time range within the trace, especially when
103
- discussing long tasks, specific events, or periods of high activity.
90
+ - **Purpose**: It adds a widget displaying the full details of the network request, such as its timing, headers, and priority.
91
+ - **Critical**: The eventKey should be the trace event key (only the number, no letters prefix or -) of that script's network request.
92
+ - **Example**: If you identify a render-blocking script, you MUST also call \`addWidget({widget: {type: 'network-request', eventKey: '...'}})\`.
93
+
94
+ - **\`addWidget({widget: {type: 'flamechart', start: ..., end: ...}})\`**:
95
+ - **When to use**: Call this function to highlight a specific time range within the trace, especially when discussing long tasks, specific events, or periods of high activity.
104
96
  - **Purpose**: It embeds a focused flame chart visualization for the given time range (in microseconds).
105
- - **Example**: If you find a long task that is blocking the main thread, you MUST also call
106
- \`addFlameChartWidget({start: 123456, end: 789012})\`. This provides the user with the data to explore
107
- alongside your explanation.
97
+ - **Example**: If you find a long task that is blocking the main thread, you MUST also call \`addWidget({widget: {type: 'flamechart', start: 123456, end: 789012}})\`.
98
+
108
99
  - **General Rules**:
109
- - You MUST call these functions as soon as you identify the entity you are discussing.
100
+ - You MUST call this function as soon as you identify the entity you are discussing.
110
101
  - Do NOT add more than one widget for the same insight, network request, or time range to avoid redundancy.
102
+ - If you have already shown a widget for any specific insight, network request, or time range, do not show it again.
111
103
  `;
112
104
  }
113
105
 
@@ -1247,104 +1239,105 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1247
1239
  }
1248
1240
 
1249
1241
  if (Root.Runtime.hostConfig.devToolsGreenDevUi?.enabled) {
1250
- this.declareFunction<{insightType: Trace.Insights.Types.InsightKeys}>('addInsightWidget', {
1242
+ this.declareFunction<
1243
+ {
1244
+ type: 'insight' | 'network-request' | 'flamechart',
1245
+ insightType?: Trace.Insights.Types.InsightKeys,
1246
+ eventKey?: number,
1247
+ start?: number,
1248
+ end?: number,
1249
+ },
1250
+ object|{error: string}>('addWidget', {
1251
1251
  description:
1252
- 'Adds an insight widget to the response. When mentioning an insight, call this function to also display an appropriate widget.',
1252
+ 'Adds an insight widget to the response. When mentioning an insight, call this function to also display an appropriate widget. Use this as much as possible to provide a better user experience.',
1253
1253
  parameters: {
1254
1254
  type: Host.AidaClient.ParametersTypes.OBJECT,
1255
1255
  description: '',
1256
1256
  nullable: false,
1257
1257
  properties: {
1258
- insightType: {
1258
+ type: {
1259
1259
  type: Host.AidaClient.ParametersTypes.STRING,
1260
- description:
1261
- 'The name of the insight. Only use the insight names given in the "Available insights" list.',
1260
+ description: 'The type of the widget to add. Possible values: insight, network-request, flamechart',
1262
1261
  nullable: false,
1263
1262
  },
1264
- },
1265
- },
1266
- handler: async _params => {
1267
- ArtifactsManager.instance().addArtifact({type: 'insight', insightType: _params.insightType});
1268
- return {result: {success: true}};
1269
- },
1270
- });
1271
-
1272
- this.declareFunction<{eventKey: string}, object|{error: string}>('addNetworkRequestWidget', {
1273
- description:
1274
- 'Adds a network request widget to the response. When mentioning a network request, call this function with its trace event key.',
1275
- parameters: {
1276
- type: Host.AidaClient.ParametersTypes.OBJECT,
1277
- description: '',
1278
- nullable: false,
1279
- properties: {
1263
+ insightType: {
1264
+ type: Host.AidaClient.ParametersTypes.STRING,
1265
+ description: 'The type of the insight widget. Include for insight widgets.',
1266
+ nullable: true,
1267
+ },
1280
1268
  eventKey: {
1281
1269
  type: Host.AidaClient.ParametersTypes.STRING,
1282
- description: 'The trace event key for the network request.',
1283
- nullable: false,
1270
+ description: 'The event key for the network request widget. Include for network request widgets.',
1271
+ nullable: true,
1284
1272
  },
1285
- },
1286
- },
1287
- handler: async _params => {
1288
- const rawTraceEvent =
1289
- Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents().at(
1290
- Number(_params.eventKey));
1291
- // Get the trace event object if it is available.
1292
- // If the trace is uploaded, we need to use the synthetic event.
1293
- if (rawTraceEvent && Trace.Types.Events.isSyntheticNetworkRequest(rawTraceEvent)) {
1294
- const rawTraceEventId = rawTraceEvent?.args?.data?.requestId;
1295
- const rawTraceEventUrl = rawTraceEvent?.args?.data?.url;
1296
- const networkRequest = rawTraceEvent ? Logs.NetworkLog.NetworkLog.instance()
1297
- .requestsForId(rawTraceEventId)
1298
- .find(r => r.url() === rawTraceEventUrl) :
1299
- null;
1300
- if (networkRequest) {
1301
- ArtifactsManager.instance().addArtifact({type: 'network-request', request: networkRequest});
1302
- return {result: {success: true}};
1303
- }
1304
- }
1305
-
1306
- const syntheticRequest =
1307
- Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().syntheticEventForRawEventIndex(
1308
- Number(_params.eventKey));
1309
-
1310
- if (syntheticRequest && Trace.Types.Events.isSyntheticNetworkRequest(syntheticRequest)) {
1311
- ArtifactsManager.instance().addArtifact({
1312
- type: 'network-request',
1313
- request: syntheticRequest,
1314
- });
1315
- return {result: {success: true}};
1316
- }
1317
-
1318
- return {result: {error: 'Could not find network request'}};
1319
- },
1320
- });
1321
-
1322
- this.declareFunction<{start: number, end: number}, object|{error: string}>('addFlameChartWidget', {
1323
- description: 'Adds a flame chart widget to the response.',
1324
- parameters: {
1325
- type: Host.AidaClient.ParametersTypes.OBJECT,
1326
- description: '',
1327
- nullable: false,
1328
- properties: {
1329
1273
  start: {
1330
1274
  type: Host.AidaClient.ParametersTypes.INTEGER,
1331
- description: 'The start time of the flame chart in microseconds.',
1332
- nullable: false,
1275
+ description: 'The start time for the flame chart widget. Include for flame chart widgets.',
1276
+ nullable: true,
1333
1277
  },
1334
1278
  end: {
1335
1279
  type: Host.AidaClient.ParametersTypes.INTEGER,
1336
- description: 'The end time of the flame chart in microseconds.',
1337
- nullable: false,
1280
+ description: 'The end time for the flame chart widget. Include for flame chart widgets.',
1281
+ nullable: true,
1338
1282
  },
1339
1283
  },
1340
1284
  },
1341
- handler: async _params => {
1342
- ArtifactsManager.instance().addArtifact({
1343
- type: 'flamechart',
1344
- start: Trace.Types.Timing.Micro(_params.start),
1345
- end: Trace.Types.Timing.Micro(_params.end),
1346
- });
1347
- return {result: {success: true}};
1285
+ handler: async params => {
1286
+ switch (params.type) {
1287
+ case 'insight':
1288
+ if (!params.insightType) {
1289
+ return {error: 'Missing insightType for insight widget'};
1290
+ }
1291
+ ArtifactsManager.instance().addArtifact({type: 'insight', insightType: params.insightType});
1292
+ return {result: {success: true}};
1293
+ case 'network-request': {
1294
+ if (!params.eventKey) {
1295
+ return {error: 'Missing eventKey for network-request widget'};
1296
+ }
1297
+ const rawTraceEvent =
1298
+ Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents().at(
1299
+ Number(params.eventKey));
1300
+ // Get the trace event object if it is available.
1301
+ // If the trace is uploaded, we need to use the synthetic event.
1302
+ if (rawTraceEvent && Trace.Types.Events.isSyntheticNetworkRequest(rawTraceEvent)) {
1303
+ const rawTraceEventId = rawTraceEvent?.args?.data?.requestId;
1304
+ const rawTraceEventUrl = rawTraceEvent?.args?.data?.url;
1305
+ const networkRequest = rawTraceEvent ? Logs.NetworkLog.NetworkLog.instance()
1306
+ .requestsForId(rawTraceEventId)
1307
+ .find(r => r.url() === rawTraceEventUrl) :
1308
+ null;
1309
+ if (networkRequest) {
1310
+ ArtifactsManager.instance().addArtifact({type: 'network-request', request: networkRequest});
1311
+ return {result: {success: true}};
1312
+ }
1313
+ }
1314
+
1315
+ const syntheticRequest = Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager()
1316
+ .syntheticEventForRawEventIndex(Number(params.eventKey));
1317
+
1318
+ if (syntheticRequest && Trace.Types.Events.isSyntheticNetworkRequest(syntheticRequest)) {
1319
+ ArtifactsManager.instance().addArtifact({
1320
+ type: 'network-request',
1321
+ request: syntheticRequest,
1322
+ });
1323
+ return {result: {success: true}};
1324
+ }
1325
+
1326
+ return {result: {error: 'Could not find network request'}};
1327
+ }
1328
+ case 'flamechart':
1329
+ if (params.start === undefined || params.end === undefined) {
1330
+ return {error: 'Missing start or end for flamechart widget'};
1331
+ }
1332
+ ArtifactsManager.instance().addArtifact({
1333
+ type: 'flamechart',
1334
+ start: Trace.Types.Timing.Micro(params.start),
1335
+ end: Trace.Types.Timing.Micro(params.end),
1336
+ });
1337
+ return {result: {success: true}};
1338
+ default:
1339
+ return {error: 'Invalid widget type'};
1340
+ }
1348
1341
  },
1349
1342
  });
1350
1343
  }
@@ -122,7 +122,7 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
122
122
  this.#preferredSize = new Geometry.Size(1, 1);
123
123
  this.#initialized = false;
124
124
  this.#appliedDeviceSize = new Geometry.Size(1, 1);
125
- this.#appliedDeviceScaleFactor = window.devicePixelRatio;
125
+ this.#appliedDeviceScaleFactor = globalThis.devicePixelRatio;
126
126
  this.#appliedUserAgentType = UA.DESKTOP;
127
127
 
128
128
  this.#scaleSetting = Common.Settings.Settings.instance().createSetting('emulation.device-scale', 1);
@@ -13,15 +13,18 @@ let formatterWorkerPoolInstance: FormatterWorkerPool|undefined;
13
13
  export class FormatterWorkerPool {
14
14
  private taskQueue: Task[];
15
15
  private workerTasks: Map<PlatformApi.HostRuntime.Worker, Task|null>;
16
+ private entrypointURL: string;
16
17
 
17
- constructor() {
18
+ constructor(entrypointURL?: string) {
18
19
  this.taskQueue = [];
19
20
  this.workerTasks = new Map();
21
+ this.entrypointURL =
22
+ entrypointURL ?? import.meta.resolve('../../entrypoints/formatter_worker/formatter_worker-entrypoint.js');
20
23
  }
21
24
 
22
- static instance(): FormatterWorkerPool {
23
- if (!formatterWorkerPoolInstance) {
24
- formatterWorkerPoolInstance = new FormatterWorkerPool();
25
+ static instance(opts?: {forceNew: true, entrypointURL: string}): FormatterWorkerPool {
26
+ if (!formatterWorkerPoolInstance || opts?.forceNew) {
27
+ formatterWorkerPoolInstance = new FormatterWorkerPool(opts?.entrypointURL);
25
28
  }
26
29
 
27
30
  return formatterWorkerPoolInstance;
@@ -44,8 +47,7 @@ export class FormatterWorkerPool {
44
47
  }
45
48
 
46
49
  private createWorker(): PlatformApi.HostRuntime.Worker {
47
- const worker = Platform.HostRuntime.HOST_RUNTIME.createWorker(
48
- new URL('../../entrypoints/formatter_worker/formatter_worker-entrypoint.js', import.meta.url).toString());
50
+ const worker = Platform.HostRuntime.HOST_RUNTIME.createWorker(this.entrypointURL);
49
51
  worker.onmessage = this.onWorkerMessage.bind(this, worker);
50
52
  worker.onerror = this.onWorkerError.bind(this, worker);
51
53
  return worker;
@@ -170,7 +170,7 @@ export const NativeFunctions = [
170
170
  {
171
171
  name: "set",
172
172
  signatures: [["key","value"]],
173
- receivers: ["Map","WeakMap","CrashReportStorage"]
173
+ receivers: ["Map","WeakMap","CrashReportContext"]
174
174
  },
175
175
  {
176
176
  name: "set",
@@ -1493,7 +1493,7 @@ export const NativeFunctions = [
1493
1493
  {
1494
1494
  name: "item",
1495
1495
  signatures: [["index"]],
1496
- receivers: ["CSSRuleList","CSSStyleDeclaration","DOMRectList","DOMStringList","DOMTokenList","FileList","HTMLCollectionBase","HTMLCollectionOf","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","NodeListOf","Plugin","PluginArray","SpeechRecognitionResult","SpeechRecognitionResultList","StyleSheetList","TouchList","HTMLCollection","SpeechGrammarList"]
1496
+ receivers: ["CSSRuleList","CSSStyleDeclaration","DOMRectList","DOMStringList","DOMTokenList","FileList","HTMLCollectionBase","HTMLCollectionOf","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","NodeListOf","Plugin","PluginArray","SpeechRecognitionResult","SpeechRecognitionResultList","StyleSheetList","TouchList","TimelineTriggerRangeList","HTMLCollection","SpeechGrammarList"]
1497
1497
  },
1498
1498
  {
1499
1499
  name: "item",
@@ -1575,7 +1575,7 @@ export const NativeFunctions = [
1575
1575
  {
1576
1576
  name: "delete",
1577
1577
  signatures: [["key"]],
1578
- receivers: ["Map","WeakMap"]
1578
+ receivers: ["Map","WeakMap","CrashReportContext"]
1579
1579
  },
1580
1580
  {
1581
1581
  name: "delete",
@@ -1998,11 +1998,6 @@ export const NativeFunctions = [
1998
1998
  signatures: [["start","end"]],
1999
1999
  receivers: ["SourceBuffer"]
2000
2000
  },
2001
- {
2002
- name: "remove",
2003
- signatures: [["key"]],
2004
- receivers: ["CrashReportStorage"]
2005
- },
2006
2001
  {
2007
2002
  name: "remove",
2008
2003
  signatures: [["?options"]],
@@ -3863,7 +3858,7 @@ export const NativeFunctions = [
3863
3858
  {
3864
3859
  name: "initialize",
3865
3860
  signatures: [["length"]],
3866
- receivers: ["CrashReportStorage"]
3861
+ receivers: ["CrashReportContext"]
3867
3862
  },
3868
3863
  {
3869
3864
  name: "initialize",
@@ -285,6 +285,14 @@ export class PersistenceImpl extends Common.ObjectWrapper.ObjectWrapper<EventTyp
285
285
  return bindings.get(uiSourceCode) || null;
286
286
  }
287
287
 
288
+ /**
289
+ * Returns whether the UISourceCode has editable content - either its project
290
+ * supports file content changes, or it has a persistence binding to a file system.
291
+ */
292
+ hasEditableContent(uiSourceCode: Workspace.UISourceCode.UISourceCode): boolean {
293
+ return uiSourceCode.project().canSetFileContent() || this.binding(uiSourceCode) !== null;
294
+ }
295
+
288
296
  subscribeForBindingEvent(uiSourceCode: Workspace.UISourceCode.UISourceCode, listener: () => void): void {
289
297
  this.#subscribedBindingEventListeners.set(uiSourceCode, listener);
290
298
  }
@@ -0,0 +1,83 @@
1
+ Title: TextUtils BalancedJSONTokenizer matches quotes
2
+ Content:
3
+ Parsing {"odd back slashes with text around":"tes\\\"t"}
4
+ {"odd back slashes with text around":"tes\\\"t"}
5
+ Parsing {"escaped double quotes":"\"test\""}
6
+ {"escaped double quotes":"\"test\""}
7
+ Parsing {"escaped back slash before double quote":"test\\"}
8
+ {"escaped back slash before double quote":"test\\"}
9
+ Parsing {"1":2}
10
+ {"1":2}
11
+ Parsing {"":""}
12
+ {"":""}
13
+ Parsing {"nested brackets":{}}
14
+ {"nested brackets":{}}
15
+ Parsing {"nested brackets with double quotes":{"":""}}
16
+ {"nested brackets with double quotes":{"":""}}
17
+ Parsing {"etc":{"\\":"\""}}
18
+ {"etc":{"\\":"\""}}
19
+ Parsing {"etc":{"\\\\":"\\"}}
20
+ {"etc":{"\\\\":"\\"}}
21
+ Parsing {"etc":{"\\\\\"":"\\\\\""}}
22
+ {"etc":{"\\\\\"":"\\\\\""}}
23
+ === end content
24
+
25
+ Title: TextUtils BalancedJSONTokenizer matches sequence using one shot
26
+ Content:
27
+ Parsing {"one":"one"}
28
+ {"one":"one"}
29
+ Parsing [{"one":"one"},{"two":"two"}]
30
+ [{"one":"one"}
31
+ Parsing [{"one":"one"},{"two":"two"},{"three":"three"}]
32
+ [{"one":"one"}
33
+ === end content
34
+
35
+ Title: TextUtils BalancedJSONTokenizer matches sequence using multiple
36
+ Content:
37
+ Parsing {"one":"one"}
38
+ {"one":"one"}
39
+ Parsing [{"one":"one"},{"two":"two"}]
40
+ [{"one":"one"},{"two":"two"}
41
+ Parsing [{"one":"one"},{"two":"two"},{"three":"three"}]
42
+ [{"one":"one"},{"two":"two"},{"three":"three"}
43
+ === end content
44
+
45
+ Title: TextUtils BalancedJSONTokenizer incremental writes
46
+ Content:
47
+ Running at once:
48
+ [{"odd back slashes with text around":"tes\\\"t"},{"escaped double quotes":"\"test\""},{"escaped back slash before double quote":"test\\"},{"1":2},{"":""},{"nested brackets":{}},{"nested brackets with double quotes":{"":""}},{"etc":{"\\":"\""}},{"etc":{"\\\\":"\\"}},{"etc":{"\\\\\"":"\\\\\""}}
49
+ Running by 3:
50
+ [{"odd back slashes with text around":"tes\\\"t"}
51
+ ,{"escaped double quotes":"\"test\""}
52
+ ,{"escaped back slash before double quote":"test\\"}
53
+ ,{"1":2}
54
+ ,{"":""}
55
+ ,{"nested brackets":{}}
56
+ ,{"nested brackets with double quotes":{"":""}}
57
+ ,{"etc":{"\\":"\""}}
58
+ ,{"etc":{"\\\\":"\\"}}
59
+ ,{"etc":{"\\\\\"":"\\\\\""}}
60
+ Running by 15:
61
+ [{"odd back slashes with text around":"tes\\\"t"}
62
+ ,{"escaped double quotes":"\"test\""}
63
+ ,{"escaped back slash before double quote":"test\\"},{"1":2}
64
+ ,{"":""}
65
+ ,{"nested brackets":{}}
66
+ ,{"nested brackets with double quotes":{"":""}}
67
+ ,{"etc":{"\\":"\""}}
68
+ ,{"etc":{"\\\\":"\\"}}
69
+ ,{"etc":{"\\\\\"":"\\\\\""}}
70
+ Running by 50:
71
+ [{"odd back slashes with text around":"tes\\\"t"}
72
+ ,{"escaped double quotes":"\"test\""}
73
+ ,{"escaped back slash before double quote":"test\\"},{"1":2}
74
+ ,{"":""},{"nested brackets":{}}
75
+ ,{"nested brackets with double quotes":{"":""}},{"etc":{"\\":"\""}}
76
+ ,{"etc":{"\\\\":"\\"}},{"etc":{"\\\\\"":"\\\\\""}}
77
+ === end content
78
+
79
+ Title: TextUtils BalancedJSONTokenizer garbage after object
80
+ Content:
81
+ Parsing [{a: 'b'}], {'x': {a: 'b'}}
82
+ [{a: 'b'}
83
+ === end content
@@ -148,7 +148,6 @@ UI.ActionRegistration.registerActionExtension({
148
148
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
149
149
  title: i18nLazyString(UIStrings.debugWithAi),
150
150
  configurableBindings: false,
151
- featurePromotionId: 'ai-assistance',
152
151
  async loadActionDelegate() {
153
152
  const AiAssistance = await loadAiAssistanceModule();
154
153
  return new AiAssistance.ActionDelegate();
@@ -5,14 +5,17 @@
5
5
  import './CollapsibleAssistanceContentWidget.js';
6
6
  import './PerformanceAgentFlameChart.js';
7
7
 
8
+ import * as Common from '../../../core/common/common.js';
8
9
  import * as AiAssistanceModel from '../../../models/ai_assistance/ai_assistance.js';
9
10
  import * as Logs from '../../../models/logs/logs.js';
10
11
  import * as NetworkTimeCalculator from '../../../models/network_time_calculator/network_time_calculator.js';
11
12
  import * as Trace from '../../../models/trace/trace.js';
12
13
  import * as UI from '../../../ui/legacy/legacy.js';
13
14
  import * as Lit from '../../../ui/lit/lit.js';
15
+ import * as NetworkForward from '../../network/forward/forward.js';
14
16
  import * as Network from '../../network/network.js';
15
17
  import * as Insights from '../../timeline/components/insights/insights.js';
18
+ import * as Timeline from '../../timeline/timeline.js';
16
19
 
17
20
  import artifactsViewerStyles from './artifactsViewer.css.js';
18
21
  import type * as PerformanceAgentFlameChart from './PerformanceAgentFlameChart.js';
@@ -39,7 +42,14 @@ export function renderArtifact(
39
42
  }
40
43
 
41
44
  return html`
42
- <devtools-collapsible-assistance-content-widget .data=${{headerText: `Insight - ${componentName}`}}>
45
+ <devtools-collapsible-assistance-content-widget .data=${{
46
+ headerText: `Insight - ${componentName}`,
47
+ onReveal: () => {
48
+ void UI.InspectorView.InspectorView.instance().showPanel('timeline').then(() => {
49
+ Timeline.TimelinePanel.TimelinePanel.instance().revealInsight(insightModel);
50
+ });
51
+ },
52
+ }}>
43
53
  ${insightRenderer.renderInsightToWidgetElement(parsedTrace, insightSet, insightModel, componentName, {
44
54
  selected: true,
45
55
  isAIAssistanceContext: true,
@@ -59,8 +69,16 @@ export function renderArtifact(
59
69
  }
60
70
  return html`
61
71
  <devtools-collapsible-assistance-content-widget
62
- .data=${{headerText: `Network Request: ${
63
- sdkRequest.url().length > 80 ? sdkRequest.url().slice(0, 80) + '...' : sdkRequest.url()}`}}>
72
+ .data=${{
73
+ headerText: `Network Request: ${
74
+ sdkRequest.url().length > 80 ? sdkRequest.url().slice(0, 80) + '...' : sdkRequest.url()}`,
75
+ onReveal: () => {
76
+ void UI.InspectorView.InspectorView.instance().showPanel('network').then(() => {
77
+ void Common.Revealer.reveal(NetworkForward.UIRequestLocation.UIRequestLocation.tab(
78
+ sdkRequest, NetworkForward.UIRequestLocation.UIRequestTabs.TIMING));
79
+ });
80
+ },
81
+ }}>
64
82
  <devtools-widget class="actions" .widgetConfig=${UI.Widget.widgetConfig(Network.RequestTimingView.RequestTimingView, {
65
83
  request: sdkRequest,
66
84
  calculator,
@@ -71,7 +89,13 @@ export function renderArtifact(
71
89
  }
72
90
  case 'flamechart': {
73
91
  return html`
74
- <devtools-collapsible-assistance-content-widget .data=${{headerText: `Flamechart`}}>
92
+ <devtools-collapsible-assistance-content-widget .data=${{
93
+ headerText: `Flamechart`,
94
+ onReveal: () => {
95
+ // eslint-disable-next-line no-console
96
+ console.log('Reveal flamechart', artifact.start, artifact.end);
97
+ },
98
+ }}>
75
99
  <devtools-performance-agent-flame-chart .data=${{
76
100
  parsedTrace,
77
101
  start: artifact.start,