chrome-devtools-frontend 1.0.1599001 → 1.0.1601661

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 (128) hide show
  1. package/.agents/skills/verification/SKILL.md +1 -1
  2. package/front_end/core/common/Settings.ts +24 -1
  3. package/front_end/core/dom_extension/DOMExtension.ts +1 -0
  4. package/front_end/core/host/AidaClient.ts +5 -2
  5. package/front_end/core/host/AidaGcaTranslation.ts +377 -0
  6. package/front_end/core/host/GcaTypes.ts +3 -1
  7. package/front_end/core/host/UserMetrics.ts +0 -2
  8. package/front_end/core/host/host.ts +2 -0
  9. package/front_end/core/root/ExperimentNames.ts +0 -2
  10. package/front_end/core/sdk/CPUThrottlingManager.ts +12 -9
  11. package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
  12. package/front_end/core/sdk/SourceMap.ts +4 -2
  13. package/front_end/entrypoints/main/MainImpl.ts +1 -10
  14. package/front_end/generated/Deprecation.ts +16 -0
  15. package/front_end/generated/InspectorBackendCommands.ts +5 -7
  16. package/front_end/generated/protocol.ts +47 -79
  17. package/front_end/models/ai_assistance/AiConversation.ts +37 -21
  18. package/front_end/models/ai_assistance/ConversationHandler.ts +8 -9
  19. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +75 -20
  20. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +11 -0
  21. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +38 -0
  22. package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +55 -13
  23. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +57 -0
  24. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +41 -3
  25. package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -0
  26. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  27. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +84 -0
  28. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +172 -0
  29. package/front_end/models/breakpoints/BreakpointManager.ts +20 -12
  30. package/front_end/models/issues_manager/SharedDictionaryIssue.ts +5 -15
  31. package/front_end/models/issues_manager/descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
  32. package/front_end/models/javascript_metadata/NativeFunctions.js +52 -0
  33. package/front_end/models/lighthouse/LighthouseReporterTypes.ts +104 -10
  34. package/front_end/models/lighthouse/RunTypes.ts +2 -1
  35. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +59 -35
  36. package/front_end/models/stack_trace/StackTrace.ts +5 -0
  37. package/front_end/models/stack_trace/StackTraceImpl.ts +7 -1
  38. package/front_end/models/stack_trace/StackTraceModel.ts +2 -1
  39. package/front_end/models/stack_trace/stack_trace.ts +4 -0
  40. package/front_end/panels/accessibility/AccessibilityNodeView.ts +7 -3
  41. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +79 -69
  42. package/front_end/panels/ai_assistance/ExportConversation.ts +25 -0
  43. package/front_end/panels/ai_assistance/ai_assistance.ts +2 -0
  44. package/front_end/panels/ai_assistance/components/ChatMessage.ts +13 -12
  45. package/front_end/panels/ai_assistance/components/ChatView.ts +44 -0
  46. package/front_end/panels/ai_assistance/components/ExportForAgentsDialog.ts +240 -0
  47. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +4 -12
  48. package/front_end/panels/ai_assistance/components/StylingAgentMarkdownRenderer.ts +5 -27
  49. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +115 -17
  50. package/front_end/panels/ai_assistance/components/chatMessage.css +4 -1
  51. package/front_end/panels/ai_assistance/components/chatView.css +8 -0
  52. package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +82 -0
  53. package/front_end/panels/ai_assistance/components/walkthroughView.css +9 -1
  54. package/front_end/panels/animation/AnimationTimeline.ts +5 -5
  55. package/front_end/panels/application/AppManifestView.ts +13 -7
  56. package/front_end/panels/application/FrameDetailsView.ts +4 -4
  57. package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +3 -2
  58. package/front_end/panels/common/DOMLinkifier.ts +10 -8
  59. package/front_end/panels/console/ConsoleView.ts +24 -2
  60. package/front_end/panels/console/ConsoleViewMessage.ts +22 -23
  61. package/front_end/panels/console/console.ts +0 -2
  62. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +5 -5
  63. package/front_end/panels/elements/ElementsTreeElement.ts +2 -3
  64. package/front_end/panels/elements/PropertiesWidget.ts +5 -3
  65. package/front_end/panels/elements/StandaloneStylesContainer.ts +21 -9
  66. package/front_end/panels/elements/StylePropertiesSection.ts +98 -50
  67. package/front_end/panels/elements/StylePropertyTreeElement.ts +38 -4
  68. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +43 -35
  69. package/front_end/panels/elements/StylesSidebarPane.ts +154 -24
  70. package/front_end/panels/elements/components/ComputedStyleTrace.ts +3 -2
  71. package/front_end/panels/event_listeners/EventListenersView.ts +16 -4
  72. package/front_end/panels/explain/components/ConsoleInsight.ts +6 -9
  73. package/front_end/panels/explain/explain-meta.ts +5 -0
  74. package/front_end/panels/issues/AffectedResourcesView.ts +5 -9
  75. package/front_end/panels/issues/AffectedSelectivePermissionsInterventionView.ts +1 -1
  76. package/front_end/panels/lighthouse/LighthouseController.ts +6 -2
  77. package/front_end/panels/lighthouse/LighthousePanel.ts +3 -2
  78. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +1 -0
  79. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +9 -6
  80. package/front_end/panels/lighthouse/LighthouseStatusView.ts +29 -5
  81. package/front_end/panels/network/NetworkDataGridNode.ts +34 -0
  82. package/front_end/panels/network/NetworkLogViewColumns.ts +10 -0
  83. package/front_end/panels/network/RequestPayloadView.ts +4 -1
  84. package/front_end/panels/network/RequestTimingView.ts +8 -2
  85. package/front_end/panels/performance_monitor/performanceMonitor.css +6 -4
  86. package/front_end/panels/recorder/RecorderController.ts +52 -14
  87. package/front_end/panels/recorder/components/RecordingView.ts +2 -1
  88. package/front_end/panels/recorder/models/RecordingStorage.ts +15 -20
  89. package/front_end/panels/sensors/SensorsView.ts +310 -144
  90. package/front_end/panels/sources/DebuggerPausedMessage.ts +6 -6
  91. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -3
  92. package/front_end/panels/sources/NavigatorView.ts +11 -7
  93. package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
  94. package/front_end/panels/sources/SourcesPanel.ts +12 -34
  95. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +5 -1
  96. package/front_end/panels/sources/sources-meta.ts +6 -0
  97. package/front_end/panels/timeline/ThirdPartyTreeView.ts +6 -2
  98. package/front_end/panels/timeline/TimelineDetailsView.ts +35 -3
  99. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +6 -1
  100. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +9 -4
  101. package/front_end/panels/timeline/TimelinePanel.ts +7 -9
  102. package/front_end/panels/timeline/TimelineTreeView.ts +14 -3
  103. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -57
  104. package/front_end/panels/timeline/components/InteractionBreakdown.ts +2 -1
  105. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +3 -7
  106. package/front_end/panels/timeline/components/Sidebar.ts +10 -18
  107. package/front_end/panels/timeline/components/SidebarInsightsTab.ts +1 -0
  108. package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +66 -0
  109. package/front_end/panels/timeline/components/TimelineSummary.ts +7 -19
  110. package/front_end/panels/timeline/components/components.ts +2 -0
  111. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -0
  112. package/front_end/panels/timeline/components/insights/NodeLink.ts +3 -3
  113. package/front_end/panels/timeline/components/timelineRangeSummaryView.css +20 -0
  114. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +7 -7
  115. package/front_end/panels/timeline/timelineDetailsView.css +0 -9
  116. package/front_end/third_party/chromium/README.chromium +1 -1
  117. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +11 -2
  118. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +11 -2
  119. package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +65 -4
  120. package/front_end/ui/kit/link/link.css +2 -2
  121. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +7 -2
  122. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +57 -35
  123. package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +1 -0
  124. package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
  125. package/package.json +1 -1
  126. package/front_end/models/issues_manager/descriptions/sharedDictionaryUseErrorNoCorpCrossOriginNoCorsRequest.md +0 -3
  127. package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorNoCorpCossOriginNoCorsRequest.md +0 -3
  128. /package/front_end/{panels/console → models/stack_trace}/ErrorStackParser.ts +0 -0
@@ -6,11 +6,13 @@ import * as Host from '../../../core/host/host.js';
6
6
  import * as i18n from '../../../core/i18n/i18n.js';
7
7
  import * as Root from '../../../core/root/root.js';
8
8
  import type * as SDK from '../../../core/sdk/sdk.js';
9
+ import type * as LHModel from '../../lighthouse/lighthouse.js';
9
10
  import * as Logs from '../../logs/logs.js';
10
11
  import * as NetworkTimeCalculator from '../../network_time_calculator/network_time_calculator.js';
11
12
  import type * as Trace from '../../trace/trace.js';
12
13
  import * as Workspace from '../../workspace/workspace.js';
13
14
 
15
+ import {AccessibilityContext} from './AccessibilityAgent.js';
14
16
  import {
15
17
  type AgentOptions,
16
18
  AiAgent,
@@ -80,15 +82,18 @@ export class ContextSelectionAgent extends AiAgent<never> {
80
82
  readonly #performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
81
83
  readonly #onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>;
82
84
  readonly #networkTimeCalculator?: NetworkTimeCalculator.NetworkTransferTimeCalculator;
85
+ readonly #lighthouseRecording?: (() => Promise<LHModel.ReporterTypes.ReportJSON|null>);
83
86
  #allowedOrigin: () => string | undefined;
84
87
 
85
88
  constructor(opts: AgentOptions&{
86
89
  performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>,
87
90
  onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>,
88
91
  networkTimeCalculator?: NetworkTimeCalculator.NetworkTransferTimeCalculator,
92
+ lighthouseRecording?: () => Promise<LHModel.ReporterTypes.ReportJSON|null>,
89
93
  }) {
90
94
  super(opts);
91
95
  this.#performanceRecordAndReload = opts.performanceRecordAndReload;
96
+ this.#lighthouseRecording = opts.lighthouseRecording;
92
97
  this.#onInspectElement = opts.onInspectElement;
93
98
  this.#networkTimeCalculator = opts.networkTimeCalculator;
94
99
  this.#allowedOrigin = opts.allowedOrigin ?? (() => undefined);
@@ -283,6 +288,39 @@ export class ContextSelectionAgent extends AiAgent<never> {
283
288
  }
284
289
  });
285
290
 
291
+ this.declareFunction('runLighthouseAudits', {
292
+ description: 'Records a Lighthouse audit on the current page, to help debug accessibility issues.',
293
+ parameters: {
294
+ type: Host.AidaClient.ParametersTypes.OBJECT,
295
+ description: '',
296
+ nullable: true,
297
+ required: [],
298
+ properties: {},
299
+ },
300
+ displayInfoFromArgs: () => {
301
+ return {
302
+ title: 'Auditing your page with Lighthouse…',
303
+ action: 'runLighthouseAudits()',
304
+ };
305
+ },
306
+ handler: async () => {
307
+ if (!this.#lighthouseRecording) {
308
+ return {
309
+ error: 'Lighthouse report is not available.',
310
+ };
311
+ }
312
+ const result = await this.#lighthouseRecording();
313
+ if (!result) {
314
+ return {error: 'Failed to generate Lighthouse report.'};
315
+ }
316
+
317
+ return {
318
+ context: new AccessibilityContext(result),
319
+ description: 'User has selected a Lighthouse report',
320
+ };
321
+ }
322
+ });
323
+
286
324
  this.declareFunction<Record<string, never>>('inspectDom', {
287
325
  description:
288
326
  `Prompts user to select a DOM element from the page. Use this when you don't know which element is selected.`,
@@ -7,19 +7,61 @@ import * as Root from '../../../core/root/root.js';
7
7
 
8
8
  import {AiAgent, type ContextResponse, ConversationContext, type RequestOptions, ResponseType} from './AiAgent.js';
9
9
 
10
- const preamble =
11
- `You are an expert technical assistant specializing in summarizing debugging conversations from Chrome DevTools.
12
- You will receive a markdown-formatted transcript of a conversation between a user and a DevTools AI assistant.
13
- Your goal is to produce a succinct, structured summary that a local AI agent in the user's IDE can use to apply code fixes.
14
-
15
- Focus on extracting:
16
- 1. **Core Issue:** The primary problem or question the user was investigating.
17
- 2. **Diagnostic Findings:** Key technical details discovered (e.g., specific functions, bottlenecks, error messages, URLs, or CSS properties).
18
- 3. **Proposed Solution:** The specific changes or optimizations recommended by the DevTools assistant.
19
- 4. **Actionable Steps:** A clear, step-by-step list of instructions for the IDE agent to implement the fix.
20
-
21
- Maintain a professional, technical, and extremely concise tone. Avoid conversational filler or introductory/concluding remarks.
22
- The output must be structured markdown.`;
10
+ const preamble = `### Role
11
+ You are a Performance Expert. Your task is to extract a diagnostic narrative from raw DevTools logs and present it as a self-contained, actionable Markdown summary. You provide high-density technical analysis without conversational fluff.
12
+
13
+ ### Critical Constraints
14
+ - **Persona:** Do not mention that you are an AI or refer to yourself in the third person.
15
+ - **Domain Scope:** Do not provide answers on non-web-development topics (e.g., legal, financial, medical, or personal advice).
16
+ - **Sensitive Topics:** If the conversation history touches on sensitive topics (religion, race, politics, sexuality, gender, etc.), respond only with: "My expertise is limited to website performance analysis. I cannot provide information on that topic."
17
+ - **Data Portability:** The recipient of this summary does NOT have access to the raw logs.
18
+ - **No UIDs/Internal IDs:** Never refer to elements by internal IDs (e.g., \`uid=123\`).
19
+ - **Standard Selectors:** Identify elements using HTML tags, classes, or IDs (e.g., \`button.submit-form\`).
20
+ - **No Metadata:** Remove internal constants like \`NAVIGATION_0\` or \`INSIGHT_0\`.
21
+ - **No Process Narration:** Do not describe internal "thinking" or API calls. Skip phrases like "The agent investigated..." or "The user then asked...". Jump straight to the findings.
22
+
23
+ ### Objectives
24
+ 1. **Identify Intent:** Define the core technical goal of the session.
25
+ 2. **Value-Only Diagnostics:** List only the technical data points discovered. Omit steps that didn't yield a result.
26
+ 3. **Focus on Code Intent:** When code is executed in the logs, summarize the **purpose** and the **result**. Do not include the raw JavaScript unless it is a specific fix for the user to implement.
27
+ 4. **Actionable Recommendations:** Provide specific code/strategy fixes based on the findings.
28
+
29
+ ### Formatting Rules
30
+ - **Header:** Use ## [Brief Topic Title]
31
+ - **Context:** Describe the target element/page and the core metric being analyzed.
32
+ - **Diagnostics:** A bulleted list of technical findings.
33
+ - **Tabular Data:** Use a **Markdown Table** for any lists of URLs, metrics, or comparison data.
34
+ - **Code Fixes:** Use fenced code blocks for suggested CSS/JS optimizations.
35
+
36
+ ---
37
+
38
+ ### Example (Few-Shot)
39
+
40
+ **User Input:** "The agent analyzed the page and found three render-blocking CSS files: app.css (36ms) and fonts.css (80ms). It also checked UID 456 which is a div.hero."
41
+
42
+ **Desired Agent Output:**
43
+ ## Performance Analysis: web.dev Home
44
+
45
+ **Context**
46
+ Analysis of the web.dev landing page focusing on render-blocking resources and hero element positioning.
47
+
48
+ **Diagnostics**
49
+ The following resources were identified as render-blocking:
50
+
51
+ | Resource URL | Load Duration |
52
+ | :--- | :--- |
53
+ | \`app.css\` | 36 ms |
54
+ | \`fonts.css\` | 80 ms |
55
+
56
+ **Actionable Findings**
57
+ * **Hero Element:** The \`div.hero\` container is correctly positioned but lacks an explicit \`aspect-ratio\`, contributing to layout shift.
58
+ * **Optimization:** Inline critical CSS from \`app.css\` to improve First Contentful Paint.
59
+
60
+ ---
61
+
62
+ ### Tone & Style
63
+ - Professional, objective, and dense.
64
+ - Past tense for actions; Present tense for technical facts.`;
23
65
 
24
66
  export class ConversationSummaryContext extends ConversationContext<string> {
25
67
  #conversation: string;
@@ -0,0 +1,57 @@
1
+ Title: PerformanceAgent PerformanceAgent – call tree focus run generates an answer
2
+ Content:
3
+ [
4
+ {
5
+ "type": "context",
6
+ "details": [
7
+ {
8
+ "title": "Trace details",
9
+ "text": "Trace summary:\nURL: https://web.dev/\nTrace bounds: {min: 465455241690, max: 465460435979}\nCPU throttling: 1x\nNetwork throttling: No throttling\n\n# Available insight sets\n\nThe following is a list of insight sets. An insight set covers a specific part of the trace, split by navigations. The insights within each insight set are specific to that part of the trace. Be sure to consider the insight set id and bounds when calling functions. If no specific insight set or navigation is mentioned, assume the user is referring to the first one.\n\n## insight set id: NO_NAVIGATION\n\nURL: https://web.dev/\nBounds: {min: 465455241690, max: 465456489730}\nMetrics (lab / observed):\n - CLS: 0.00\nMetrics (field / real users): n/a – no data for this page in CrUX\nAvailable insights:\n - insight name: ThirdParties\n description: 3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page's content.\n relevant trace bounds: {min: 465456492168, max: 465460052616}\n example question: Which third parties are having the largest impact on my page performance?\n\n## insight set id: NAVIGATION_1\n\nURL: https://web.dev/\nBounds: {min: 465456489730, max: 465460435979}\nMetrics (lab / observed):\n - LCP: 676 ms, event: (eventKey: r-21246, ts: 465457166052), nodeId: 1680\n - LCP breakdown:\n - TTFB: 553 ms, bounds: {min: 465456489730, max: 465457042737}\n - Render delay: 123 ms, bounds: {min: 465457042737, max: 465457166052}\n - CLS: 0.02, event: (eventKey: s-14250, ts: 465457121239)\nMetrics (field / real users): n/a – no data for this page in CrUX\nAvailable insights:\n - insight name: RenderBlocking\n description: Requests are blocking the page's initial render, which may delay LCP. [Deferring or inlining](https://developer.chrome.com/docs/performance/insights/render-blocking) can move these network requests out of the critical path.\n relevant trace bounds: {min: 465457046567, max: 465457086893}\n estimated metric savings: FCP 118 ms, LCP 118 ms\n example question: Show me the most impactful render-blocking requests that I should focus on\n example question: How can I reduce the number of render-blocking requests?\n - insight name: LCPBreakdown\n description: Each [subpart has specific improvement strategies](https://developer.chrome.com/docs/performance/insights/lcp-breakdown). Ideally, most of the LCP time should be spent on loading the resources, not within delays.\n relevant trace bounds: {min: 465456489730, max: 465457166052}\n example question: Help me optimize my LCP score\n example question: Which LCP phase was most problematic?\n example question: What can I do to reduce the LCP time for this page load?\n - insight name: CLSCulprits\n description: Layout shifts occur when elements move absent any user interaction. [Investigate the causes of layout shifts](https://developer.chrome.com/docs/performance/insights/cls-culprit), such as elements being added, removed, or their fonts changing as the page loads.\n relevant trace bounds: {min: 465457121239, max: 465459012394}\n example question: Help me optimize my CLS score\n example question: How can I prevent layout shifts on this page?\n - insight name: NetworkDependencyTree\n description: [Avoid chaining critical requests](https://developer.chrome.com/docs/performance/insights/network-dependency-tree) by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load.\n relevant trace bounds: {min: 465456490723, max: 465458472724}\n example question: How do I optimize my network dependency tree?\n - insight name: DOMSize\n description: A large DOM can increase the duration of style calculations and layout reflows, impacting page responsiveness. A large DOM will also increase memory usage. [Learn how to avoid an excessive DOM size](https://developer.chrome.com/docs/performance/insights/dom-size).\n relevant trace bounds: {min: 465458287196, max: 465458340745}\n example question: How can I reduce the size of my DOM?\n - insight name: ThirdParties\n description: 3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page's content.\n relevant trace bounds: {min: 465456492168, max: 465460052616}\n example question: Which third parties are having the largest impact on my page performance?\n - insight name: ForcedReflow\n description: A forced reflow occurs when JavaScript queries geometric properties (such as offsetWidth) after styles have been invalidated by a change to the DOM state. This can result in poor performance. Learn more about [forced reflows](https://developer.chrome.com/docs/performance/insights/forced-reflow) and possible mitigations.\n relevant trace bounds: {min: 465456489730, max: 465460435979}\n example question: How can I avoid forced reflows and layout thrashing?\n example question: What is forced reflow and why is it problematic?\n - insight name: Cache\n description: A long cache lifetime can speed up repeat visits to your page. [Learn more about caching](https://developer.chrome.com/docs/performance/insights/cache).\n relevant trace bounds: {min: 465457179567, max: 465459110674}\n estimated metric savings: FCP 0 ms, LCP 0 ms\n estimated wasted bytes: 16 kB\n example question: What caching strategies can I apply to improve my page performance?\n# Critical network requests\n\n## insight set id: NO_NAVIGATION\n\nnone\n\n## insight set id: NAVIGATION_1\n\n\nNetwork requests data:\n\n\n\nallUrls = [0: https://web.dev/, 1: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2, 2: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2, 3: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2, 4: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2, 5: https://fonts.gstatic.com/s/materialicons/v142/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2, 6: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2, 7: https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2, 8: https://web.dev/_pwa/web/manifest.json, 9: https://fonts.googleapis.com/css?family=Google+Sans:400,500|Roboto:400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700&display=swap, 10: https://fonts.gstatic.com/s/googlesans/v59/4UasrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iqcsih3SAyH6cAwhX9RPjIUvbQoi-E.woff2, 11: https://fonts.googleapis.com/css2?family=Material+Icons&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block, 12: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/web/css/app.css, 13: https://web.dev/extras.css]\n\n0;s-7302;1 ms;2 ms;568 ms;569 ms;568 ms;15 ms;0.5 ms;200;text/html;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-security-policy: base-uri 'self'; object-src 'none'; script-src 'strict-dynamic' 'unsafe-inline' https: http: 'nonce-pLl1WHuNABXXiQLLmUesvDyvzBJZdE' 'unsafe-eval'; report-uri https://csp.withgoogle.com/csp/devsite/v2|content-encoding: gzip|x-content-type-options: nosniff|date: Mon, 29 Apr 2024 11:01:15 GMT|strict-transport-security: max-age=63072000; includeSubdomains; preload|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|pragma: no-cache|last-modified: Fri, 26 Apr 2024 16:43:17 GMT|server: Google Frontend|vary: Cookie, Accept-Encoding|x-frame-options: SAMEORIGIN|content-type: text/html; charset=utf-8|x-cloud-trace-context: <redacted>|cache-control: no-cache, must-revalidate|expires: 0]\n1;s-49309;1,395 ms;1,402 ms;1,415 ms;1,423 ms;28 ms;94 μs;9 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Wed, 24 Apr 2024 15:02:33 GMT|x-content-type-options: nosniff|age: 417214|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:58 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Thu, 24 Apr 2025 15:02:33 GMT]\n2;s-46519;1,348 ms;1,355 ms;1,361 ms;1,423 ms;75 ms;73 μs;62 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Mon, 29 Apr 2024 03:50:51 GMT|x-content-type-options: nosniff|age: 25516|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:41 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Tue, 29 Apr 2025 03:50:51 GMT]\n3;s-46196;1,331 ms;1,339 ms;1,355 ms;1,420 ms;89 ms;0.1 ms;65 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Fri, 26 Apr 2024 20:29:46 GMT|x-content-type-options: nosniff|age: 224781|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:39 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Sat, 26 Apr 2025 20:29:46 GMT]\n4;s-45814;1,326 ms;1,331 ms;1,348 ms;1,419 ms;93 ms;77 μs;71 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Thu, 25 Apr 2024 13:27:47 GMT|x-content-type-options: nosniff|age: 336500|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:56 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Fri, 25 Apr 2025 13:27:47 GMT]\n5;s-44751;1,286 ms;1,307 ms;1,343 ms;1,416 ms;130 ms;1 ms;73 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Fri, 26 Apr 2024 09:49:05 GMT|x-content-type-options: nosniff|age: 263222|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Mon, 08 Apr 2024 19:04:51 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Sat, 26 Apr 2025 09:49:05 GMT]\n6;s-44728;1,285 ms;1,307 ms;1,343 ms;1,406 ms;120 ms;1 ms;62 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Sun, 28 Apr 2024 21:44:44 GMT|x-content-type-options: nosniff|age: 47483|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:53 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Mon, 28 Apr 2025 21:44:44 GMT]\n7;s-44701;1,284 ms;1,300 ms;1,339 ms;1,405 ms;120 ms;0.2 ms;65 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Thu, 25 Apr 2024 09:35:28 GMT|x-content-type-options: nosniff|age: 350439|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:50 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Fri, 25 Apr 2025 09:35:28 GMT]\n8;s-43119;1,751 ms;1,751 ms;1,771 ms;1,771 ms;20 ms;27 μs;0.2 ms;200;application/json;Medium;Medium;Medium;f;unknown;t;0;[];[date: Sun, 28 Apr 2024 14:07:49 GMT|last-modified: Wed, 24 Apr 2024 11:02:59 GMT|server: Google Frontend|age: 75208|content-type: application/json|x-cloud-trace-context: <redacted>|cache-control: public, max-age=86400|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>]\n9;s-7695;557 ms;557 ms;597 ms;597 ms;40 ms;3 ms;0.6 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[date: Mon, 29 Apr 2024 11:01:15 GMT|content-encoding: gzip|x-content-type-options: nosniff|strict-transport-security: max-age=31536000|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|x-xss-protection: 0|last-modified: Mon, 29 Apr 2024 10:51:49 GMT|server: ESF|cross-origin-opener-policy: <redacted>|x-frame-options: SAMEORIGIN|content-type: text/css; charset=utf-8|access-control-allow-origin: *|cache-control: private, max-age=86400, stale-while-revalidate=604800|timing-allow-origin: *|link: <https://fonts.gstatic.com>; rel=preconnect; crossorigin|expires: Mon, 29 Apr 2024 11:01:15 GMT]\n7;s-34909;770 ms;770 ms;771 ms;776 ms;6 ms;40 μs;5 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[x-google-security-signals: <redacted>|x-google-gfe-service-trace: <redacted>|content-security-policy-report-only: <redacted>|x-google-scs-row-timestamp: <redacted>|x-google-gfe-response-code-details-trace: <redacted>|cross-origin-resource-policy: <redacted>|x-google-scs-row-key: <redacted>|content-type: font/woff2|access-control-allow-origin: *|x-google-data-version: <redacted>|cache-control: public, max-age=31536000|x-google-gfe-backend-request-info: <redacted>|x-google-dos-service-trace: <redacted>|x-google-backends: <redacted>|date: Thu, 26 Oct 2023 10:46:00 GMT|x-content-type-options: nosniff|expires: Fri, 25 Oct 2024 10:46:00 GMT|x-google-gfe-version: <redacted>|x-google-netmon-label: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-google-service: <redacted>|x-xss-protection: 0|x-google-gfe-handshake-trace: <redacted>|x-google-shellfish-status: <redacted>|last-modified: Wed, 11 May 2022 19:24:50 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|x-google-gfe-request-trace: <redacted>|accept-ranges: bytes|timing-allow-origin: *|x-google-scs-repo: <redacted>]\n10;s-11121;602 ms;602 ms;603 ms;611 ms;9 ms;27 μs;8 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Thu, 25 Apr 2024 15:44:03 GMT|x-content-type-options: nosniff|age: 328319|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 24 Apr 2024 23:37:14 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Fri, 25 Apr 2025 15:44:03 GMT]\n11;s-7703;557 ms;557 ms;597 ms;597 ms;40 ms;90 μs;0.1 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[date: Mon, 29 Apr 2024 11:01:15 GMT|content-encoding: gzip|x-content-type-options: nosniff|strict-transport-security: max-age=31536000|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|x-xss-protection: 0|last-modified: Mon, 29 Apr 2024 11:01:15 GMT|server: ESF|cross-origin-opener-policy: <redacted>|x-frame-options: SAMEORIGIN|content-type: text/css; charset=utf-8|access-control-allow-origin: *|cache-control: private, max-age=86400, stale-while-revalidate=604800|timing-allow-origin: *|link: <https://fonts.gstatic.com>; rel=preconnect; crossorigin|expires: Mon, 29 Apr 2024 11:01:15 GMT]\n5;s-11334;606 ms;606 ms;607 ms;615 ms;9 ms;30 μs;8 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;11;[];[date: Fri, 26 Apr 2024 09:49:05 GMT|x-content-type-options: nosniff|age: 263217|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Mon, 08 Apr 2024 19:04:51 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Sat, 26 Apr 2025 09:49:05 GMT]\n12;s-7722;557 ms;557 ms;562 ms;568 ms;11 ms;0.5 ms;6 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[date: Mon, 29 Apr 2024 10:56:02 GMT|content-encoding: gzip|x-content-type-options: nosniff|age: 256|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Thu, 25 Apr 2024 19:58:26 GMT|server: sffe|cross-origin-opener-policy: <redacted>|vary: Accept-Encoding|report-to: {\"group\":\"devrel-devsite\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/devrel-devsite\"}]}|content-type: text/css|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|expires: Tue, 29 Apr 2025 10:56:02 GMT]\n13;s-7737;557 ms;557 ms;561 ms;561 ms;4 ms;0.4 ms;0.2 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[content-security-policy: base-uri 'self'; object-src 'none'; script-src 'strict-dynamic' 'unsafe-inline' https: http: 'nonce-laTwEoovJjOKcMoBUjSFaYO6rrF8dU' 'unsafe-eval'; report-uri https://csp.withgoogle.com/csp/devsite/v2|content-encoding: gzip|x-content-type-options: nosniff|date: Mon, 29 Apr 2024 11:00:18 GMT|strict-transport-security: max-age=63072000; includeSubdomains; preload|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|pragma: no-cache|last-modified: Tue, 19 Mar 2024 18:37:07 GMT|server: Google Frontend|vary: Cookie, Accept-Encoding|x-frame-options: SAMEORIGIN|content-type: text/css|x-cloud-trace-context: <redacted>|cache-control: no-cache, must-revalidate|expires: 0]\n\n# Main thread bottom-up summary\n\nThis is the bottom-up summary for the entire trace. Only the top 10 activities (sorted by self time) are shown. An activity is all the aggregated time spent on the same type of work. For example, it can be all the time spent in a specific JavaScript function, or all the time spent in a specific browser rendering stage (like layout, v8 compile, parsing html). \"Self time\" represents the aggregated time spent directly in an activity, across all occurrences. \"Total time\" represents the aggregated time spent in an activity or any of its children.\n\n## insight set id: NO_NAVIGATION\n\n- self: 12 ms, total: 12 ms, source: Profiling overhead\n- self: 4 ms, total: 28 ms, source: Task\n- self: 3 ms, total: 4 ms, source: Recalculate style (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 98, column: 12)\n- self: 2 ms, total: 2 ms, source: Commit\n- self: 0.9 ms, total: 2 ms, source: Function call (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 102, column: 35)\n- self: 0.8 ms, total: 13 ms, source: Evaluate script\n- self: 0.7 ms, total: 3 ms, source: Event: pointerover\n- self: 0.1 ms, total: 1 ms, source: Xh (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 104, column: 61)\n\n## insight set id: NAVIGATION_1\n\n- self: 46 ms, total: 49 ms, source: Recalculate style\n- self: 37 ms, total: 211 ms, source: Task\n- self: 21 ms, total: 22 ms, source: Layout\n- self: 17 ms, total: 19 ms, source: Compile code\n- self: 7 ms, total: 7 ms, source: Cache script code\n- self: 6 ms, total: 26 ms, source: Function call (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 288, column: 146)\n- self: 5 ms, total: 5 ms, source: Parse stylesheet\n- self: 5 ms, total: 5 ms, source: Pre-paint\n- self: 5 ms, total: 5 ms, source: Commit\n- self: 5 ms, total: 10 ms, source: appendChild\n\n# 3rd party summary\n\n## insight set id: NO_NAVIGATION\n\n- name: Google CDN, main thread time: 1 ms, network transfer size: 0 B\n\n## insight set id: NAVIGATION_1\n\n- name: Google CDN, main thread time: 38 ms, network transfer size: 2.1 MB\n- name: web.dev, main thread time: 3 ms, network transfer size: 432.1 kB\n- name: Google Analytics, main thread time: 0.6 ms, network transfer size: 52.9 kB\n- name: Google Fonts, main thread time: 0 ms, network transfer size: 411.9 kB\n\n# Longest tasks\n\n## insight set id: NO_NAVIGATION\n\n- total time: 13 ms, event: (eventKey: r-96, ts: 465455241964)\n- total time: 2 ms, event: (eventKey: r-934, ts: 465455475572)\n- total time: 1 ms, event: (eventKey: r-2310, ts: 465455879141)\n\n## insight set id: NAVIGATION_1\n\n- total time: 18 ms, event: (eventKey: r-20182, ts: 465457150438)\n- total time: 14 ms, event: (eventKey: r-12184, ts: 465457104625)\n- total time: 12 ms, event: (eventKey: r-10779, ts: 465457087373)\n\nUser selected the following call tree:\n\n\n\n# Call tree:\n\n1;r-10779;Task;3;;;2;;\n2;r-11902;Layout;3;3;;;;;S\n\n\n# User query\n\ntest"
10
+ }
11
+ ],
12
+ "widgets": [
13
+ {
14
+ "name": "CORE_VITALS"
15
+ }
16
+ ]
17
+ },
18
+ {
19
+ "type": "querying"
20
+ },
21
+ {
22
+ "type": "answer",
23
+ "text": "This is the answer",
24
+ "complete": true,
25
+ "rpcId": 123
26
+ }
27
+ ]
28
+ === end content
29
+
30
+ Title: PerformanceAgent handleContextDetails outputs the right context for the initial query from the user
31
+ Content:
32
+ [
33
+ {
34
+ "type": "context",
35
+ "details": [
36
+ {
37
+ "title": "Trace details",
38
+ "text": "Trace summary:\nURL: https://chromedevtools.github.io/performance-stories/lcp-large-image/index.html\nTrace bounds: {min: 658799706428, max: 658804825864}\nCPU throttling: 1x\nNetwork throttling: No throttling\n\n# Available insight sets\n\nThe following is a list of insight sets. An insight set covers a specific part of the trace, split by navigations. The insights within each insight set are specific to that part of the trace. Be sure to consider the insight set id and bounds when calling functions. If no specific insight set or navigation is mentioned, assume the user is referring to the first one.\n\n## insight set id: NAVIGATION_0\n\nURL: https://chromedevtools.github.io/performance-stories/lcp-large-image/index.html\nBounds: {min: 658799738257, max: 658804825864}\nMetrics (lab / observed):\n - LCP: 110 ms, event: (eventKey: r-2399, ts: 658799847880), nodeId: 10\n - LCP breakdown:\n - TTFB: 7 ms, bounds: {min: 658799738257, max: 658799745193}\n - Load delay: 34 ms, bounds: {min: 658799745193, max: 658799778937}\n - Load duration: 12 ms, bounds: {min: 658799778937, max: 658799791032}\n - Render delay: 57 ms, bounds: {min: 658799791032, max: 658799847880}\n - CLS: 0.00\nMetrics (field / real users): n/a – no data for this page in CrUX\nAvailable insights:\n - insight name: LCPBreakdown\n description: Each [subpart has specific improvement strategies](https://developer.chrome.com/docs/performance/insights/lcp-breakdown). Ideally, most of the LCP time should be spent on loading the resources, not within delays.\n relevant trace bounds: {min: 658799738257, max: 658799847880}\n example question: Help me optimize my LCP score\n example question: Which LCP phase was most problematic?\n example question: What can I do to reduce the LCP time for this page load?\n - insight name: LCPDiscovery\n description: [Optimize LCP](https://developer.chrome.com/docs/performance/insights/lcp-discovery) by making the LCP image discoverable from the HTML immediately, and avoiding lazy-loading\n relevant trace bounds: {min: 658799745193, max: 658799793683}\n example question: Suggest fixes to reduce my LCP\n example question: What can I do to reduce my LCP discovery time?\n example question: Why is LCP discovery time important?\n - insight name: RenderBlocking\n description: Requests are blocking the page's initial render, which may delay LCP. [Deferring or inlining](https://developer.chrome.com/docs/performance/insights/render-blocking) can move these network requests out of the critical path.\n relevant trace bounds: {min: 658799775876, max: 658799791419}\n example question: Show me the most impactful render-blocking requests that I should focus on\n example question: How can I reduce the number of render-blocking requests?\n - insight name: ThirdParties\n description: 3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page's content.\n relevant trace bounds: {min: 658799775876, max: 658799807449}\n example question: Which third parties are having the largest impact on my page performance?\n - insight name: Cache\n description: A long cache lifetime can speed up repeat visits to your page. [Learn more about caching](https://developer.chrome.com/docs/performance/insights/cache).\n relevant trace bounds: {min: 658799777502, max: 658799791419}\n example question: What caching strategies can I apply to improve my page performance?\n# Critical network requests\n\nnone\n\n# Main thread bottom-up summary\n\nThis is the bottom-up summary for the entire trace. Only the top 10 activities (sorted by self time) are shown. An activity is all the aggregated time spent on the same type of work. For example, it can be all the time spent in a specific JavaScript function, or all the time spent in a specific browser rendering stage (like layout, v8 compile, parsing html). \"Self time\" represents the aggregated time spent directly in an activity, across all occurrences. \"Total time\" represents the aggregated time spent in an activity or any of its children.\n\n- self: 57 ms, total: 79 ms, source: Task\n- self: 5 ms, total: 5 ms, source: Layout\n- self: 4 ms, total: 4 ms, source: Major GC\n- self: 3 ms, total: 3 ms, source: Parse HTML\n- self: 2 ms, total: 2 ms, source: Recalculate style\n- self: 2 ms, total: 2 ms, source: Commit\n- self: 1 ms, total: 1 ms, source: C++ GC\n- self: 1 ms, total: 1 ms, source: Paint\n\n# 3rd party summary\n\n- name: GitHub, main thread time: 3 ms, network transfer size: 690 B\n- name: Google Fonts, main thread time: 0 ms, network transfer size: 1.1 kB\n- name: placeholder.com, main thread time: 0 ms, network transfer size: 65.8 kB\n\n# Longest tasks\n\n- total time: 23 ms, event: (eventKey: r-617, ts: 658799757023)\n- total time: 12 ms, event: (eventKey: r-1571, ts: 658799793885)\n- total time: 11 ms, event: (eventKey: r-1891, ts: 658799811130)\n\nUser selected the LCPBreakdown insight.\n\n\n# User query\n\ntest"
39
+ }
40
+ ],
41
+ "widgets": [
42
+ {
43
+ "name": "CORE_VITALS"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "type": "querying"
49
+ },
50
+ {
51
+ "type": "answer",
52
+ "text": "This is the answer",
53
+ "complete": true,
54
+ "rpcId": 123
55
+ }
56
+ ]
57
+ === end content
@@ -348,6 +348,32 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
348
348
  };
349
349
  #traceFacts: Host.AidaClient.RequestFact[] = [];
350
350
 
351
+ /**
352
+ * These facts do not contain page data, they are static instructions to the
353
+ * LLM, so we don't need to add them to the disclosure.
354
+ */
355
+ #factsToNeverDisclose = new Set<Host.AidaClient.RequestFact>([
356
+ this.#callFrameDataDescriptionFact,
357
+ this.#networkDataDescriptionFact,
358
+ this.#freshTraceExtraPreambleFact,
359
+ this.#notExternalExtraPreambleFact,
360
+ ]);
361
+
362
+ /**
363
+ * When we enhance the query with additional information, we need to know it
364
+ * so we can show it in the disclosure UI. This is cleared and then populated
365
+ * on each prompt.
366
+ */
367
+ #additionalSelectionsForQuery: string[] = [];
368
+
369
+ /**
370
+ * The CWV widget is shown when we analyze the trace summary, but we don't
371
+ * want to show it on every single "Analyzing data..." pill, as we show one
372
+ * after every prompt. So we make sure for a given Insight Set (which is based on navigation)
373
+ * we only show it once.
374
+ */
375
+ #hasShownWidgetForInsightSet = new WeakSet<Trace.Insights.Types.InsightSet>();
376
+
351
377
  get preamble(): string {
352
378
  return buildPreamble();
353
379
  }
@@ -376,9 +402,19 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
376
402
  return;
377
403
  }
378
404
 
405
+ const contextDisclosure: string[] = [];
406
+
407
+ for (const fact of this.currentFacts()) {
408
+ if (this.#factsToNeverDisclose.has(fact)) {
409
+ continue;
410
+ }
411
+ contextDisclosure.push(fact.text);
412
+ }
413
+ contextDisclosure.push(...this.#additionalSelectionsForQuery);
414
+
379
415
  const widgets: AiWidget[] = [];
380
416
  const primaryInsightSet = context.getItem().primaryInsightSet;
381
- if (primaryInsightSet) {
417
+ if (primaryInsightSet && !this.#hasShownWidgetForInsightSet.has(primaryInsightSet)) {
382
418
  widgets.push({
383
419
  name: 'CORE_VITALS',
384
420
  data: {
@@ -386,14 +422,15 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
386
422
  insightSetKey: primaryInsightSet.id,
387
423
  },
388
424
  });
425
+ this.#hasShownWidgetForInsightSet.add(primaryInsightSet);
389
426
  }
390
427
 
391
428
  yield {
392
429
  type: ResponseType.CONTEXT,
393
430
  details: [
394
431
  {
395
- title: 'Trace',
396
- text: this.#formatter?.formatTraceSummary() ?? '',
432
+ title: 'Trace details',
433
+ text: contextDisclosure.join('\n'),
397
434
  },
398
435
  ],
399
436
  widgets,
@@ -526,6 +563,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
526
563
  }
527
564
  }
528
565
 
566
+ this.#additionalSelectionsForQuery = selected;
529
567
  if (!selected.length) {
530
568
  return query;
531
569
  }
@@ -1073,6 +1073,7 @@ const data = {
1073
1073
  ];
1074
1074
  return answer;
1075
1075
  }
1076
+
1076
1077
  override async enhanceQuery(
1077
1078
  query: string, selectedElement: ConversationContext<SDK.DOMModel.DOMNode>|null,
1078
1079
  multimodalInputType?: MultimodalInputType): Promise<string> {
@@ -21,6 +21,7 @@ import * as BuiltInAi from './BuiltInAi.js';
21
21
  import * as ChangeManager from './ChangeManager.js';
22
22
  import * as ConversationHandler from './ConversationHandler.js';
23
23
  import * as FileFormatter from './data_formatters/FileFormatter.js';
24
+ import * as LighthouseFormatter from './data_formatters/LighthouseFormatter.js';
24
25
  import * as NetworkRequestFormatter from './data_formatters/NetworkRequestFormatter.js';
25
26
  import * as PerformanceInsightFormatter from './data_formatters/PerformanceInsightFormatter.js';
26
27
  import * as PerformanceTraceFormatter from './data_formatters/PerformanceTraceFormatter.js';
@@ -55,6 +56,7 @@ export {
55
56
  FileAgent,
56
57
  FileFormatter,
57
58
  Injected,
59
+ LighthouseFormatter,
58
60
  NetworkAgent,
59
61
  NetworkRequestFormatter,
60
62
  PatchAgent,
@@ -0,0 +1,84 @@
1
+ Title: LighthouseFormatter generates a summary
2
+ Content:
3
+ # Lighthouse Report Summary
4
+ URL: https://example.com
5
+ Fetch Time: 2025-01-01T00:00:00.000Z
6
+ Lighthouse Version: 12.0.0
7
+
8
+ ## Category Scores
9
+ - Performance: 80
10
+ - Accessibility: 100
11
+ === end content
12
+
13
+ Title: LighthouseFormatter generates audits for a category
14
+ Content:
15
+ # Audits for Performance
16
+
17
+ The following audits in this category have a score below 90 and may need attention:
18
+ - **First Audit**: 80 (1.2s)
19
+ * Description of first audit
20
+ === end content
21
+
22
+ Title: LighthouseFormatter indicates when all audits passed
23
+ Content:
24
+ # Audits for Accessibility
25
+
26
+ All audits in this category passed (score >= 90).
27
+ === end content
28
+
29
+ Title: LighthouseFormatter handles missing category
30
+ Content:
31
+ Category "seo" not found.
32
+ === end content
33
+
34
+ Title: LighthouseFormatter formats table details
35
+ Content:
36
+ # Audits for Performance
37
+
38
+ The following audits in this category have a score below 90 and may need attention:
39
+ - **Table Audit**: 50
40
+ * Audit with a table
41
+
42
+ | URL | Wasted Bytes | Node | Location |
43
+ | https://example.com/script.js | 1024 | div.main (path: 1,HTML,1,BODY,5,DIV) | https://example.com/script.js:10:5 |
44
+ | https://example.com/style.css | 512 | body > p (selector: body > p) (path: 1,HTML,1,BODY,10,P) | https://example.com/style.css |
45
+ === end content
46
+
47
+ Title: LighthouseFormatter formats opportunity details
48
+ Content:
49
+ # Audits for Performance
50
+
51
+ The following audits in this category have a score below 90 and may need attention:
52
+ - **Opportunity Audit**: 50
53
+ * Audit with an opportunity
54
+
55
+ Potential savings: 500ms, Potential savings: 2048 bytes
56
+ | URL | Wasted Bytes |
57
+ | https://example.com/large-script.js | 2048 |
58
+ === end content
59
+
60
+ Title: LighthouseFormatter formats table details with summary
61
+ Content:
62
+ # Audits for Performance
63
+
64
+ The following audits in this category have a score below 90 and may need attention:
65
+ - **Summary Audit**: 50
66
+ * Audit with a table summary
67
+
68
+ Wasted time: 100ms
69
+ Wasted bytes: 512
70
+ | Text |
71
+ | Some detail |
72
+ === end content
73
+
74
+ Title: LighthouseFormatter formats landmark-one-main audit with node explanation
75
+ Content:
76
+ # Audits for Accessibility
77
+
78
+ The following audits in this category have a score below 90 and may need attention:
79
+ - **Document does not have a main landmark.**: 0
80
+ * One main landmark helps screen reader users navigate a web page. [Learn more about landmarks](https://dequeuniversity.com/rules/axe/4.11/landmark-one-main).
81
+
82
+ | Failing Elements |
83
+ | html (selector: html) (path: 1,HTML) (explanation: Fix all of the following: Document does not have a main landmark) |
84
+ === end content
@@ -0,0 +1,172 @@
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 type * as LHModel from '../../lighthouse/lighthouse.js';
6
+
7
+ /**
8
+ * A formatter that takes a raw Lighthouse report JSON and creates a markdown
9
+ * summary for an AI Agent.
10
+ */
11
+ export class LighthouseFormatter {
12
+ /**
13
+ * Returns an overall summary and high-level overview of the Lighthouse report.
14
+ */
15
+ summary(report: LHModel.ReporterTypes.ReportJSON): string {
16
+ const lines: string[] = [];
17
+ lines.push('# Lighthouse Report Summary');
18
+ lines.push(`URL: ${report.finalDisplayedUrl}`);
19
+ lines.push(`Fetch Time: ${report.fetchTime}`);
20
+ lines.push(`Lighthouse Version: ${report.lighthouseVersion}`);
21
+ lines.push('');
22
+ lines.push('## Category Scores');
23
+ for (const category of Object.values(report.categories)) {
24
+ const score = category.score !== null ? Math.round(category.score * 100) : 'n/a';
25
+ lines.push(`- ${category.title}: ${score}`);
26
+ }
27
+ return lines.join('\n');
28
+ }
29
+
30
+ /**
31
+ * Returns a markdown list of all audits in a given category.
32
+ * Highlight failing audits (score < 90).
33
+ */
34
+ audits(report: LHModel.ReporterTypes.ReportJSON, categoryId: LHModel.RunTypes.CategoryId): string {
35
+ const category = report.categories[categoryId];
36
+ if (!category) {
37
+ return `Category "${categoryId}" not found.`;
38
+ }
39
+
40
+ const lines: string[] = [];
41
+ lines.push(`# Audits for ${category.title}`);
42
+ if (category.description) {
43
+ lines.push(`${category.description.replace(/\n/g, ' ')}`);
44
+ }
45
+ lines.push('');
46
+
47
+ const failingAudits = category.auditRefs.filter(ref => {
48
+ const audit = report.audits[ref.id];
49
+ return audit && audit.score !== null && audit.score < 0.9;
50
+ });
51
+
52
+ if (failingAudits.length === 0) {
53
+ lines.push('All audits in this category passed (score >= 90).');
54
+ return lines.join('\n');
55
+ }
56
+
57
+ lines.push('The following audits in this category have a score below 90 and may need attention:');
58
+ for (const ref of failingAudits) {
59
+ const audit = report.audits[ref.id];
60
+ if (!audit) {
61
+ continue;
62
+ }
63
+ const score = audit.score !== null ? Math.round(audit.score * 100) : 'n/a';
64
+ let line = `- **${audit.title}**: ${score}`;
65
+ if (audit.displayValue) {
66
+ line += ` (${audit.displayValue})`;
67
+ }
68
+ lines.push(line);
69
+ lines.push(` * ${audit.description.replace(/\n/g, ' ')}`);
70
+ if (audit.details) {
71
+ const formattedDetails = this.#formatDetails(audit.details);
72
+ if (formattedDetails) {
73
+ lines.push('');
74
+ lines.push(formattedDetails.split('\n').map(l => ` ${l}`).join('\n'));
75
+ }
76
+ }
77
+ }
78
+
79
+ return lines.join('\n');
80
+ }
81
+
82
+ #formatDetails(details: LHModel.ReporterTypes.DetailsJSON): string {
83
+ switch (details.type) {
84
+ case 'table': {
85
+ const lines: string[] = [];
86
+ if (details.summary) {
87
+ const summaryParts = [];
88
+ // Purposefully rule out 0 because we want to skip if there is 0 wasted time.
89
+ if (details.summary.wastedMs) {
90
+ summaryParts.push(`Wasted time: ${details.summary.wastedMs}ms`);
91
+ }
92
+ // Purposefully rule out 0 because we want to skip if there is 0 wasted time.
93
+ if (details.summary.wastedBytes) {
94
+ summaryParts.push(`Wasted bytes: ${details.summary.wastedBytes}`);
95
+ }
96
+ if (summaryParts.length > 0) {
97
+ lines.push(summaryParts.join('\n'));
98
+ }
99
+ }
100
+ lines.push(this.#formatTable(details.headings, details.items));
101
+ return lines.join('\n');
102
+ }
103
+ case 'opportunity': {
104
+ const lines: string[] = [];
105
+ const summaryParts = [];
106
+ if (details.overallSavingsMs) {
107
+ summaryParts.push(`Potential savings: ${details.overallSavingsMs}ms`);
108
+ }
109
+ if (details.overallSavingsBytes) {
110
+ summaryParts.push(`Potential savings: ${details.overallSavingsBytes} bytes`);
111
+ }
112
+ if (summaryParts.length > 0) {
113
+ lines.push(summaryParts.join(', '));
114
+ }
115
+ lines.push(this.#formatTable(details.headings, details.items));
116
+ return lines.join('\n');
117
+ }
118
+ default:
119
+ return '';
120
+ }
121
+ }
122
+
123
+ #formatTable(headings: LHModel.ReporterTypes.TableHeadingJSON[], items: Array<Record<string, unknown>>): string {
124
+ const lines: string[] = [];
125
+ lines.push(`| ${headings.map(h => h.label).join(' | ')} |`);
126
+ for (const item of items) {
127
+ const row = headings.map(h => this.#formatTableValue(item[h.key] as LHModel.ReporterTypes.TableItemValue));
128
+ lines.push(`| ${row.join(' | ')} |`);
129
+ }
130
+ return lines.join('\n');
131
+ }
132
+
133
+ #formatTableValue(value: LHModel.ReporterTypes.TableItemValue|undefined): string {
134
+ if (value === undefined || value === null) {
135
+ return '';
136
+ }
137
+ if (typeof value === 'string' || typeof value === 'number') {
138
+ return String(value);
139
+ }
140
+ if (typeof value === 'object' && 'type' in value) {
141
+ switch (value.type) {
142
+ case 'node': {
143
+ let label = value.nodeLabel || value.selector || value.snippet || '(node)';
144
+ if (value.selector) {
145
+ label += ` (selector: ${value.selector})`;
146
+ }
147
+ if (value.path) {
148
+ label += ` (path: ${value.path})`;
149
+ }
150
+ if (value.explanation) {
151
+ label += ` (explanation: ${value.explanation.replace(/\n/g, ' ')})`;
152
+ }
153
+ return label;
154
+ }
155
+ case 'source-location': {
156
+ const parts = [];
157
+ if (value.url) {
158
+ parts.push(value.url);
159
+ }
160
+ if (value.line) {
161
+ parts.push(String(value.line));
162
+ }
163
+ if (value.column) {
164
+ parts.push(String(value.column));
165
+ }
166
+ return parts.join(':');
167
+ }
168
+ }
169
+ }
170
+ return '';
171
+ }
172
+ }