chrome-devtools-frontend 1.0.1732418 → 1.0.1733843

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 (146) hide show
  1. package/docs/get_the_code.md +1 -73
  2. package/front_end/Tests.js +0 -5
  3. package/front_end/core/host/AidaClientTypes.ts +24 -3
  4. package/front_end/core/host/AidaGcaTranslation.ts +29 -1
  5. package/front_end/core/platform/browser/HostRuntime.ts +5 -1
  6. package/front_end/core/sdk/DOMModel.ts +8 -3
  7. package/front_end/design_system_tokens.css +5 -0
  8. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +2 -2
  9. package/front_end/generated/InspectorBackendCommands.ts +5 -5
  10. package/front_end/generated/SupportedCSSProperties.ts +8 -2
  11. package/front_end/generated/protocol.ts +29 -7
  12. package/front_end/models/ai-utils/debug.ts +127 -22
  13. package/front_end/models/ai_assistance/AiConversation.ts +1 -0
  14. package/front_end/models/ai_assistance/README.md +1 -1
  15. package/front_end/models/ai_assistance/agents/AiAgent.ts +69 -11
  16. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
  17. package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +4 -3
  18. package/front_end/models/ai_assistance/contexts/LighthouseContext.snapshot.txt +4 -2
  19. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +6 -0
  20. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +2 -0
  21. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +1 -1
  22. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +26 -26
  23. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -1
  24. package/front_end/models/ai_code_completion/ai_code_completion.ts +11 -2
  25. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -1
  26. package/front_end/models/ai_code_generation/ai_code_generation.ts +11 -2
  27. package/front_end/models/trace/LanternComputationData.ts +4 -0
  28. package/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +126 -1
  29. package/front_end/models/trace/lantern/types/Lantern.ts +3 -0
  30. package/front_end/models/web_mcp/WebMCPModel.ts +1 -1
  31. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +65 -15
  32. package/front_end/panels/ai_assistance/ExternalHandler.ts +1 -1
  33. package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +4 -4
  34. package/front_end/panels/ai_assistance/components/chatMessage.css +4 -5
  35. package/front_end/panels/ai_assistance/components/exploreWidget.css +3 -3
  36. package/front_end/panels/application/backgroundServiceView.css +2 -2
  37. package/front_end/panels/application/components/reportsGrid.css +1 -1
  38. package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
  39. package/front_end/panels/application/components/trustTokensView.css +1 -1
  40. package/front_end/panels/application/deviceBoundSessionsView.css +1 -1
  41. package/front_end/panels/application/frameDetailsReportView.css +0 -4
  42. package/front_end/panels/application/indexedDBViews.css +0 -4
  43. package/front_end/panels/application/resourcesPanel.css +0 -13
  44. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +3 -3
  45. package/front_end/panels/application/serviceWorkersView.css +3 -2
  46. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +346 -286
  47. package/front_end/panels/comments/CommentsPane.ts +2 -11
  48. package/front_end/panels/common/CommentThreadWidget.ts +11 -3
  49. package/front_end/panels/common/CommentsOverlayWidget.ts +3 -2
  50. package/front_end/panels/console/consoleContextSelector.css +1 -1
  51. package/front_end/panels/console/consolePinPane.css +1 -1
  52. package/front_end/panels/console/consolePrompt.css +4 -2
  53. package/front_end/panels/console/consoleView.css +1 -1
  54. package/front_end/panels/elements/ComputedStyleWidget.ts +8 -19
  55. package/front_end/panels/elements/PropertyRenderer.ts +7 -27
  56. package/front_end/panels/elements/StylePropertyTreeElement.ts +61 -72
  57. package/front_end/panels/elements/components/cssPropertyDocsView.css +1 -1
  58. package/front_end/panels/elements/components/elementsBreadcrumbs.css +1 -1
  59. package/front_end/panels/elements/components/stylePropertyEditor.css +1 -5
  60. package/front_end/panels/elements/layoutPane.css +1 -1
  61. package/front_end/panels/elements/metricsSidebarPane.css +2 -2
  62. package/front_end/panels/elements/propertiesWidget.css +0 -5
  63. package/front_end/panels/elements/stylesSidebarPane.css +3 -2
  64. package/front_end/panels/emulation/deviceModeView.css +3 -3
  65. package/front_end/panels/event_listeners/eventListenersView.css +1 -1
  66. package/front_end/panels/explain/components/consoleInsight.css +2 -2
  67. package/front_end/panels/issues/issuesTree.css +10 -7
  68. package/front_end/panels/layer_viewer/layerTreeOutline.css +1 -1
  69. package/front_end/panels/lighthouse/LighthousePanel.ts +16 -1
  70. package/front_end/panels/lighthouse/lighthousePanel.css +1 -1
  71. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +10 -6
  72. package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +1 -26
  73. package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +1 -1
  74. package/front_end/panels/media/playerListView.css +11 -8
  75. package/front_end/panels/media/playerMessagesView.css +9 -5
  76. package/front_end/panels/network/NetworkWaterfallColumn.ts +92 -55
  77. package/front_end/panels/network/networkConfigView.css +3 -3
  78. package/front_end/panels/network/networkLogView.css +5 -4
  79. package/front_end/panels/network/networkManageCustomHeadersView.css +1 -1
  80. package/front_end/panels/network/networkTimingTable.css +4 -8
  81. package/front_end/panels/network/requestPayloadView.css +1 -1
  82. package/front_end/panels/performance_monitor/performanceMonitor.css +1 -1
  83. package/front_end/panels/profiler/ModuleUIStrings.ts +12 -0
  84. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +114 -18
  85. package/front_end/panels/protocol_monitor/JSONEditor.css +4 -3
  86. package/front_end/panels/recorder/createRecordingView.css +2 -2
  87. package/front_end/panels/recorder/stepEditor.css +1 -1
  88. package/front_end/panels/recorder/stepView.css +0 -7
  89. package/front_end/panels/recorder/timelineSection.css +1 -1
  90. package/front_end/panels/screencast/screencastView.css +1 -1
  91. package/front_end/panels/search/searchResultsPane.css +1 -1
  92. package/front_end/panels/security/mainView.css +2 -2
  93. package/front_end/panels/security/originView.css +1 -1
  94. package/front_end/panels/settings/AISettingsTab.ts +1 -0
  95. package/front_end/panels/sources/NavigatorView.ts +120 -49
  96. package/front_end/panels/sources/breakpointsView.css +3 -3
  97. package/front_end/panels/sources/components/HeadersView.css +2 -2
  98. package/front_end/panels/sources/watchExpressionsSidebarPane.css +2 -1
  99. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +30 -10
  100. package/front_end/panels/timeline/TimelinePanel.ts +24 -3
  101. package/front_end/panels/timeline/components/metricCard.css +1 -1
  102. package/front_end/panels/timeline/components/networkRequestTooltip.css +2 -2
  103. package/front_end/panels/timeline/components/relatedInsightChips.css +1 -1
  104. package/front_end/panels/timeline/timelineFlameChartView.css +4 -4
  105. package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -2
  106. package/front_end/panels/timeline/timelineMiniMap.css +3 -2
  107. package/front_end/panels/web_audio/WebAudioModel.ts +14 -5
  108. package/front_end/panels/web_audio/WebAudioView.ts +34 -1
  109. package/front_end/panels/web_audio/webAudio.css +17 -3
  110. package/front_end/panels/webauthn/webauthnPane.css +2 -4
  111. package/front_end/panels/whats_new/ReleaseNoteText.ts +19 -1
  112. package/front_end/panels/whats_new/ReleaseNoteView.ts +15 -1
  113. package/front_end/panels/whats_new/releaseNoteView.css +49 -0
  114. package/front_end/third_party/chromium/README.chromium +1 -1
  115. package/front_end/third_party/puppeteer-replay/README.chromium +9 -1
  116. package/front_end/third_party/puppeteer-replay/package/lib/main.d.ts +2 -2
  117. package/front_end/ui/components/buttons/button.css +0 -1
  118. package/front_end/ui/components/diff_view/diffView.css +1 -1
  119. package/front_end/ui/components/markdown_view/codeBlock.css +4 -4
  120. package/front_end/ui/components/markdown_view/markdownView.css +3 -7
  121. package/front_end/ui/components/panel_feedback/panelFeedback.css +3 -2
  122. package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +1 -1
  123. package/front_end/ui/components/suggestion_input/suggestionInput.css +2 -2
  124. package/front_end/ui/components/switch/switch.css +2 -1
  125. package/front_end/ui/legacy/TabbedPane.ts +1 -1
  126. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +10 -3
  127. package/front_end/ui/legacy/components/inline_editor/colorSwatch.css +1 -2
  128. package/front_end/ui/legacy/components/perf_ui/chartViewport.css +1 -1
  129. package/front_end/ui/legacy/components/perf_ui/filmStripView.css +1 -1
  130. package/front_end/ui/legacy/components/perf_ui/flameChart.css +5 -3
  131. package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +7 -4
  132. package/front_end/ui/legacy/components/perf_ui/pieChart.css +0 -1
  133. package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
  134. package/front_end/ui/legacy/inspectorCommon.css +11 -27
  135. package/front_end/ui/legacy/listWidget.css +1 -1
  136. package/front_end/ui/legacy/progressIndicator.css +1 -2
  137. package/front_end/ui/legacy/reportView.css +5 -2
  138. package/front_end/ui/legacy/searchableView.css +3 -2
  139. package/front_end/ui/legacy/suggestBox.css +2 -1
  140. package/front_end/ui/legacy/tabbedPane.css +8 -5
  141. package/front_end/ui/legacy/treeoutline.css +1 -1
  142. package/front_end/ui/legacy/viewContainers.css +1 -1
  143. package/front_end/ui/visual_logging/KnownContextValues.ts +11 -0
  144. package/package.json +1 -1
  145. package/front_end/models/ai_code_completion/debug.ts +0 -33
  146. package/front_end/models/ai_code_generation/debug.ts +0 -33
@@ -139,7 +139,7 @@ To aid debugging, you can enable the AI Assistance logging. This setting is stor
139
139
  1. Load up your local DevTools in Canary
140
140
  2. Load the AI Assistance Panel
141
141
  3. Open DevTools on DevTools.
142
- 4. In the console, run `setDebugAiAssistanceEnabled(true)`.
142
+ 4. In the console, run `setDevToolsAIDebug({assistance: true})`.
143
143
 
144
144
  Now, when interacting with the AI and sending requests, you will see output logged to the console. You can use the `debugLog` helper to add your own logging as you are building out your feature.
145
145
 
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Host from '../../../core/host/host.js';
6
- import type * as Platform from '../../../core/platform/platform.js';
6
+ import * as Platform from '../../../core/platform/platform.js';
7
7
  import * as Root from '../../../core/root/root.js';
8
8
  import * as SDK from '../../../core/sdk/sdk.js';
9
9
  import type * as TextUtils from '../../../core/text_utils/text_utils.js';
@@ -22,7 +22,7 @@ import {
22
22
  type ToolName,
23
23
  } from '../tools/Tool.js';
24
24
 
25
- const {debugLog, isStructuredLogEnabled} = AiUtils.Debug;
25
+ const {debugLog, isDebugMode} = AiUtils.Debug;
26
26
 
27
27
  type UrlString = Platform.DevToolsPath.UrlString;
28
28
  const MAX_SUGGESTION_LENGTH = 200;
@@ -239,6 +239,7 @@ export interface SideEffectResponse extends ToolCallEvent {
239
239
  confirm: (decision: PermissionDecision) => void;
240
240
  permissionPrompt?: PermissionPrompt;
241
241
  permissionTitle?: string;
242
+ toolName?: string;
242
243
  }
243
244
 
244
245
  /**
@@ -261,6 +262,10 @@ export interface ContextChangeResponse {
261
262
  * to emit UI telemetry.
262
263
  */
263
264
  toolName?: string;
265
+ /**
266
+ * True when the call skipped a permission prompt via `AlwaysAllowedTools`.
267
+ */
268
+ autoApproved?: boolean;
264
269
  }
265
270
 
266
271
  interface SerializedSideEffectResponse extends Omit<SideEffectResponse, 'confirm'> {}
@@ -302,6 +307,10 @@ export interface ActionResponse extends ToolCallEvent {
302
307
  * `ai-v2-learn-skill` visual logging events.
303
308
  */
304
309
  loadedSkills?: string[];
310
+ /**
311
+ * True when the call skipped a permission prompt via `AlwaysAllowedTools`.
312
+ */
313
+ autoApproved?: boolean;
305
314
  }
306
315
 
307
316
  /**
@@ -1155,7 +1164,7 @@ export abstract class AiAgent<T> {
1155
1164
  request = this.buildRequest(outcome.functionResponses, Host.AidaClient.Role.ROLE_UNSPECIFIED);
1156
1165
  }
1157
1166
 
1158
- if (isStructuredLogEnabled()) {
1167
+ if (isDebugMode()) {
1159
1168
  dispatchAiAssistanceDoneEvent();
1160
1169
  }
1161
1170
  return;
@@ -1178,6 +1187,8 @@ export abstract class AiAgent<T> {
1178
1187
  rpcId: Host.AidaClient.RpcGlobalId|undefined,
1179
1188
  ): AsyncGenerator<ResponseData, void, void> {
1180
1189
  if (!textResponse) {
1190
+ debugLog('[AiAgent] Model returned an empty text response without tool calls:',
1191
+ {step: stepIndex + 1, rpcId, functionCalls});
1181
1192
  yield this.#createErrorResponse(ErrorType.UNKNOWN);
1182
1193
  return;
1183
1194
  }
@@ -1285,6 +1296,7 @@ export abstract class AiAgent<T> {
1285
1296
  context: result.context,
1286
1297
  widgets: result.widgets,
1287
1298
  toolName: functionCall.name,
1299
+ autoApproved: result.autoApproved,
1288
1300
  };
1289
1301
  return {type: 'contextChanged'};
1290
1302
  }
@@ -1351,7 +1363,12 @@ export abstract class AiAgent<T> {
1351
1363
  result: unknown,
1352
1364
  widgets?: AiWidget[],
1353
1365
  loadedSkills?: string[],
1354
- }|{error: string}|{context: ConversationContext<unknown>, description: string, widgets?: AiWidget[]}> {
1366
+ }|{error: string}|{
1367
+ context: ConversationContext<unknown>,
1368
+ description: string,
1369
+ widgets?: AiWidget[],
1370
+ autoApproved?: boolean,
1371
+ }> {
1355
1372
  const callId = crypto.randomUUID();
1356
1373
  const call = this.#functionDeclarations.get(name);
1357
1374
  if (!call) {
@@ -1398,14 +1415,43 @@ export abstract class AiAgent<T> {
1398
1415
  return Boolean(allowedOriginResult && 'blocked' in allowedOriginResult);
1399
1416
  };
1400
1417
 
1418
+ const isAlwaysAllowed = call.permissionPrompt === PermissionPrompt.ALLOW_ONCE_OR_ALWAYS &&
1419
+ Boolean(this.#alwaysAllowedTools?.isAllowed(name as ToolName));
1420
+
1401
1421
  // Turns an error thrown by the handler into an error result, so the other
1402
1422
  // calls in the same model response still run and the history keeps their
1403
- // results.
1423
+ // results. Races the handler against the abort signal so a hung tool call
1424
+ // does not block the agent loop after the user aborts the run.
1404
1425
  const runHandler = async(handlerOptions?: FunctionHandlerOptions): Promise<ToolResult<unknown>> => {
1426
+ const signal = handlerOptions?.signal;
1427
+ if (signal?.aborted) {
1428
+ return {error: 'Aborted'};
1429
+ }
1405
1430
  try {
1406
- const isAlwaysAllowed = call.permissionPrompt === PermissionPrompt.ALLOW_ONCE_OR_ALWAYS &&
1407
- this.#alwaysAllowedTools?.isAllowed(name as ToolName);
1408
- return await call.handler(args, isAlwaysAllowed ? {...handlerOptions, approved: true} : handlerOptions);
1431
+ const handlerPromise =
1432
+ call.handler(args, isAlwaysAllowed ? {...handlerOptions, approved: true} : handlerOptions);
1433
+ if (!signal) {
1434
+ return await handlerPromise;
1435
+ }
1436
+ if (signal.aborted) {
1437
+ return {error: 'Aborted'};
1438
+ }
1439
+ return await new Promise<ToolResult<unknown>>((resolve, reject) => {
1440
+ const onAbort = (): void => {
1441
+ resolve({error: 'Aborted'});
1442
+ };
1443
+ signal.addEventListener('abort', onAbort, {once: true});
1444
+ handlerPromise.then(
1445
+ value => {
1446
+ signal.removeEventListener('abort', onAbort);
1447
+ resolve(value);
1448
+ },
1449
+ err => {
1450
+ signal.removeEventListener('abort', onAbort);
1451
+ reject(err);
1452
+ },
1453
+ );
1454
+ });
1409
1455
  } catch (err) {
1410
1456
  debugLog(`[AiAgent] Tool '${name}' threw:`, err);
1411
1457
  return {error: `Error: ${err instanceof Error ? err.message : String(err)}`};
@@ -1413,6 +1459,9 @@ export abstract class AiAgent<T> {
1413
1459
  };
1414
1460
 
1415
1461
  let result = await runHandler(options);
1462
+ if (options?.signal?.aborted) {
1463
+ return {error: 'Aborted'};
1464
+ }
1416
1465
 
1417
1466
  // Check 1: After first handler execution.
1418
1467
  // Navigation could have occurred during the async handler execution.
@@ -1457,6 +1506,7 @@ export abstract class AiAgent<T> {
1457
1506
  javascriptCode,
1458
1507
  permissionPrompt: call.permissionPrompt,
1459
1508
  permissionTitle: call.permissionTitle,
1509
+ toolName: name,
1460
1510
  };
1461
1511
 
1462
1512
  let decision = PermissionDecision.REJECT;
@@ -1494,6 +1544,9 @@ export abstract class AiAgent<T> {
1494
1544
  ...options,
1495
1545
  approved: true,
1496
1546
  });
1547
+ if (options?.signal?.aborted) {
1548
+ return {error: 'Aborted'};
1549
+ }
1497
1550
 
1498
1551
  // Check 3: After second handler execution (approved run).
1499
1552
  // Navigation could have occurred during the async execution of the approved action.
@@ -1511,6 +1564,7 @@ export abstract class AiAgent<T> {
1511
1564
  widgets: result.widgets,
1512
1565
  canceled: false,
1513
1566
  toolName: name,
1567
+ autoApproved: isAlwaysAllowed,
1514
1568
  ...(result.loadedSkills ? {loadedSkills: result.loadedSkills} : {}),
1515
1569
  };
1516
1570
  }
@@ -1529,7 +1583,10 @@ export abstract class AiAgent<T> {
1529
1583
  debugLog(`[AiAgent] Tool '${name}' result:`, result);
1530
1584
 
1531
1585
  if ('context' in result) {
1532
- return result;
1586
+ return {
1587
+ ...result,
1588
+ autoApproved: isAlwaysAllowed,
1589
+ };
1533
1590
  }
1534
1591
 
1535
1592
  return result as {result: unknown, widgets?: AiWidget[]};
@@ -1560,13 +1617,14 @@ export abstract class AiAgent<T> {
1560
1617
  };
1561
1618
  }
1562
1619
 
1563
- if (isStructuredLogEnabled() && aidaResponse) {
1620
+ if (isDebugMode() && aidaResponse) {
1564
1621
  this.#structuredLog.push({
1565
1622
  request: structuredClone(request),
1566
1623
  aidaResponse,
1567
1624
  });
1568
1625
  try {
1569
- localStorage.setItem('aiAssistanceStructuredLog', JSON.stringify(this.#structuredLog));
1626
+ Platform.HostRuntime.HOST_RUNTIME.getLocalStorage()?.setItem('aiAssistanceStructuredLog',
1627
+ JSON.stringify(this.#structuredLog));
1570
1628
  } catch (err) {
1571
1629
  console.warn('Failed to write to local storage "aiAssistanceStructuredLog":', err);
1572
1630
  }
@@ -368,7 +368,8 @@ Content:
368
368
  "action": "console.log('hello');",
369
369
  "output": "hello",
370
370
  "canceled": false,
371
- "toolName": "executeJavaScript"
371
+ "toolName": "executeJavaScript",
372
+ "autoApproved": false
372
373
  },
373
374
  {
374
375
  "type": "querying"
@@ -127,16 +127,17 @@ ${await this.describe()}`;
127
127
  const textChildNodes = childNodes.filter(childNode => childNode.nodeType() === SDK.DOMModel.NodeType.TEXT_NODE);
128
128
  const elementChildNodes =
129
129
  childNodes.filter(childNode => childNode.nodeType() === SDK.DOMModel.NodeType.ELEMENT_NODE);
130
+ const formattedChildren =
131
+ elementChildNodes.map(node => `\`${node.simpleSelector()}\` (uid=${node.backendNodeId()})`).join(', ');
130
132
  switch (elementChildNodes.length) {
131
133
  case 0:
132
134
  output += '\n* It doesn\'t have any child element nodes';
133
135
  break;
134
136
  case 1:
135
- output += `\n* It only has 1 child element node: \`${elementChildNodes[0].simpleSelector()}\``;
137
+ output += `\n* It only has 1 child element node: ${formattedChildren}`;
136
138
  break;
137
139
  default:
138
- output += `\n* It has ${elementChildNodes.length} child element nodes: ${
139
- elementChildNodes.map(node => `\`${node.simpleSelector()}\` (uid=${node.backendNodeId()})`).join(', ')}`;
140
+ output += `\n* It has ${elementChildNodes.length} child element nodes: ${formattedChildren}`;
140
141
  }
141
142
 
142
143
  switch (textChildNodes.length) {
@@ -10,6 +10,7 @@ Lighthouse Version: 1.0.0
10
10
  - Accessibility: 50
11
11
 
12
12
  ## Failing audits
13
+ Only audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.
13
14
 
14
15
  ### Accessibility (categoryId: "accessibility")
15
16
  - Accessibility Audit: 50
@@ -25,7 +26,7 @@ Content:
25
26
  [
26
27
  {
27
28
  "title": "Lighthouse report",
28
- "text": "# Lighthouse Report:\n# Lighthouse Report Summary\nURL: https://example.com\nFetch Time: 2026-03-12\nLighthouse Version: 1.0.0\n\n## Category Scores\n- Accessibility: 50\n\n## Failing audits\n\n### Accessibility (categoryId: \"accessibility\")\n- Accessibility Audit: 50\n# Audits for Accessibility\n\nThe following audits in this category have a score below 90 and may need attention:\n- **Accessibility Audit**: 50 (Fail)\n * Description of accessibility audit"
29
+ "text": "# Lighthouse Report:\n# Lighthouse Report Summary\nURL: https://example.com\nFetch Time: 2026-03-12\nLighthouse Version: 1.0.0\n\n## Category Scores\n- Accessibility: 50\n\n## Failing audits\nOnly audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.\n\n### Accessibility (categoryId: \"accessibility\")\n- Accessibility Audit: 50\n# Audits for Accessibility\n\nThe following audits in this category have a score below 90 and may need attention:\n- **Accessibility Audit**: 50 (Fail)\n * Description of accessibility audit"
29
30
  }
30
31
  ]
31
32
  === end content
@@ -41,6 +42,7 @@ Lighthouse Version: 1.0.0
41
42
  - Accessibility: 50
42
43
 
43
44
  ## Failing audits
45
+ Only audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.
44
46
 
45
47
  ### Accessibility (categoryId: "accessibility")
46
48
  - Accessibility Audit: 50
@@ -51,7 +53,7 @@ Content:
51
53
  [
52
54
  {
53
55
  "title": "Lighthouse report",
54
- "text": "# Lighthouse Report Summary\nURL: https://example.com\nFetch Time: 2026-03-12\nLighthouse Version: 1.0.0\n\n## Category Scores\n- Accessibility: 50\n\n## Failing audits\n\n### Accessibility (categoryId: \"accessibility\")\n- Accessibility Audit: 50"
56
+ "text": "# Lighthouse Report Summary\nURL: https://example.com\nFetch Time: 2026-03-12\nLighthouse Version: 1.0.0\n\n## Category Scores\n- Accessibility: 50\n\n## Failing audits\nOnly audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.\n\n### Accessibility (categoryId: \"accessibility\")\n- Accessibility Audit: 50"
55
57
  }
56
58
  ]
57
59
  === end content
@@ -10,6 +10,7 @@ Lighthouse Version: 12.0.0
10
10
  - Accessibility: 100
11
11
 
12
12
  ## Failing audits
13
+ Only audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.
13
14
 
14
15
  ### Performance (categoryId: "performance")
15
16
  - First Audit: 80
@@ -197,6 +198,7 @@ Mode: navigation
197
198
  - Agentic Browsing: 1/2 audits passed
198
199
 
199
200
  ## Failing audits
201
+ Only audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.
200
202
 
201
203
  ### Performance (categoryId: "performance")
202
204
  - First Audit: 80
@@ -216,6 +218,7 @@ Lighthouse Version: 12.0.0
216
218
  - Performance: 50
217
219
 
218
220
  ## Failing audits
221
+ Only audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.
219
222
 
220
223
  ### Performance (categoryId: "performance")
221
224
  - First Audit: 80
@@ -232,6 +235,7 @@ The following audits in this category errored:
232
235
  * An audit that threw an error during execution.
233
236
  * Error: Audit execution timed out
234
237
  === end content
238
+
235
239
  Title: LighthouseFormatter excludes hidden audits
236
240
  Content:
237
241
  # Lighthouse Report Summary
@@ -243,6 +247,7 @@ Lighthouse Version: 12.0.0
243
247
  - Performance: 100
244
248
 
245
249
  ## Failing audits
250
+ Only audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.
246
251
 
247
252
  ### Performance (categoryId: "performance")
248
253
  - No failing audits.
@@ -325,6 +330,7 @@ Lighthouse Version: 12.0.0
325
330
  - Performance: 80
326
331
 
327
332
  ## Failing audits
333
+ Only audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.
328
334
 
329
335
  ### Agentic Browsing (categoryId: "agentic-browsing")
330
336
  - No audits scored below 90, but these informative audits report findings:
@@ -58,6 +58,8 @@ export class LighthouseFormatter {
58
58
  }
59
59
  lines.push('');
60
60
  lines.push('## Failing audits');
61
+ lines.push(
62
+ 'Only audit titles and scores are listed below. Load the `lighthouse` skill and call `getLighthouseAudits` with the relevant `categoryId` to retrieve full audit descriptions, diagnostics, and failing elements.');
61
63
  for (const [categoryId, category] of Object.entries(report.categories)) {
62
64
  lines.push('');
63
65
  lines.push(`### ${category.title} (categoryId: "${categoryId}")`);
@@ -950,7 +950,7 @@ Increasing the image compression factor could improve this image’s download si
950
950
  - Optimizations:
951
951
  This image file is larger than it needs to be (2048x1356) for its displayed dimensions (200x132). Use responsive images to reduce the image download size. (Est 41.4 kB)
952
952
 
953
- ## Estimated savings: FCP 0 ms, LCP 100 ms
953
+ ## Estimated savings: FCP 0 ms, LCP 0 ms
954
954
 
955
955
  ## External resources:
956
956
  - https://developer.chrome.com/docs/performance/insights/image-delivery
@@ -478,19 +478,6 @@ Metrics (lab / observed):
478
478
  - CLS: 0.31, event: (eventKey: c-13074, ts: 59729100192)
479
479
  Metrics (field / real users): n/a – no data for this page in CrUX
480
480
  Available insights:
481
- - insight name: Cache
482
- 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).
483
- relevant trace bounds: {min: 59728702014µs, max: 59728867430µs}
484
- estimated metric savings: FCP 0 ms, LCP 150 ms
485
- estimated wasted bytes: 971.5 kB
486
- example question: What caching strategies can I apply to improve my page performance?
487
- - insight name: ImageDelivery
488
- description: Reducing the download time of images can improve the perceived load time of the page and LCP. [Learn more about optimizing image size](https://developer.chrome.com/docs/performance/insights/image-delivery).
489
- relevant trace bounds: {min: 59728701403µs, max: 59729395208µs}
490
- estimated metric savings: FCP 0 ms, LCP 100 ms
491
- estimated wasted bytes: 2 MB
492
- example question: What should I do to improve and optimize the time taken to fetch and display images on the page?
493
- example question: Are all images on my site optimized?
494
481
  - insight name: LCPBreakdown
495
482
  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.
496
483
  relevant trace bounds: {min: 59728649746µs, max: 59729312744µs}
@@ -508,6 +495,13 @@ Available insights:
508
495
  relevant trace bounds: {min: 59729100192µs, max: 59730317334µs}
509
496
  example question: Help me optimize my CLS score
510
497
  example question: How can I prevent layout shifts on this page?
498
+ - insight name: ImageDelivery
499
+ description: Reducing the download time of images can improve the perceived load time of the page and LCP. [Learn more about optimizing image size](https://developer.chrome.com/docs/performance/insights/image-delivery).
500
+ relevant trace bounds: {min: 59728701403µs, max: 59729395208µs}
501
+ estimated metric savings: FCP 0 ms, LCP 0 ms
502
+ estimated wasted bytes: 2 MB
503
+ example question: What should I do to improve and optimize the time taken to fetch and display images on the page?
504
+ example question: Are all images on my site optimized?
511
505
  - insight name: DocumentLatency
512
506
  description: Your first network request is the most important. [Reduce its latency](https://developer.chrome.com/docs/performance/insights/document-latency) by avoiding redirects, ensuring a fast server response, and enabling text compression.
513
507
  relevant trace bounds: {min: 59728651057µs, max: 59728790724µs}
@@ -524,6 +518,12 @@ Available insights:
524
518
  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.
525
519
  relevant trace bounds: {min: 59728701403µs, max: 59729465969µs}
526
520
  example question: Which third parties are having the largest impact on my page performance?
521
+ - insight name: Cache
522
+ 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).
523
+ relevant trace bounds: {min: 59728702014µs, max: 59728867430µs}
524
+ estimated metric savings: FCP 0 ms, LCP 0 ms
525
+ estimated wasted bytes: 971.5 kB
526
+ example question: What caching strategies can I apply to improve my page performance?
527
527
  - insight name: CharacterSet
528
528
  description: A character encoding declaration is required. It can be done with a meta charset tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header. [Learn more about declaring the character encoding](https://developer.chrome.com/docs/insights/charset/).
529
529
  relevant trace bounds: {min: 59728651057µs, max: 59728790724µs}
@@ -562,19 +562,6 @@ Metrics (field / real users):
562
562
  - The scope indicates if the data came from the entire origin, or a specific url
563
563
  - Lab metrics describe how this specific page load performed, while field metrics are an aggregation of results from real-world users. Best practice is to prioritize metrics that are bad in field data. Lab metrics may be better or worse than fields metrics depending on the developer's machine, network, or the actions performed while tracing.
564
564
  Available insights:
565
- - insight name: Cache
566
- 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).
567
- relevant trace bounds: {min: 59728702014µs, max: 59728867430µs}
568
- estimated metric savings: FCP 0 ms, LCP 150 ms
569
- estimated wasted bytes: 971.5 kB
570
- example question: What caching strategies can I apply to improve my page performance?
571
- - insight name: ImageDelivery
572
- description: Reducing the download time of images can improve the perceived load time of the page and LCP. [Learn more about optimizing image size](https://developer.chrome.com/docs/performance/insights/image-delivery).
573
- relevant trace bounds: {min: 59728701403µs, max: 59729395208µs}
574
- estimated metric savings: FCP 0 ms, LCP 100 ms
575
- estimated wasted bytes: 2 MB
576
- example question: What should I do to improve and optimize the time taken to fetch and display images on the page?
577
- example question: Are all images on my site optimized?
578
565
  - insight name: LCPBreakdown
579
566
  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.
580
567
  relevant trace bounds: {min: 59728649746µs, max: 59729312744µs}
@@ -592,6 +579,13 @@ Available insights:
592
579
  relevant trace bounds: {min: 59729100192µs, max: 59730317334µs}
593
580
  example question: Help me optimize my CLS score
594
581
  example question: How can I prevent layout shifts on this page?
582
+ - insight name: ImageDelivery
583
+ description: Reducing the download time of images can improve the perceived load time of the page and LCP. [Learn more about optimizing image size](https://developer.chrome.com/docs/performance/insights/image-delivery).
584
+ relevant trace bounds: {min: 59728701403µs, max: 59729395208µs}
585
+ estimated metric savings: FCP 0 ms, LCP 0 ms
586
+ estimated wasted bytes: 2 MB
587
+ example question: What should I do to improve and optimize the time taken to fetch and display images on the page?
588
+ example question: Are all images on my site optimized?
595
589
  - insight name: DocumentLatency
596
590
  description: Your first network request is the most important. [Reduce its latency](https://developer.chrome.com/docs/performance/insights/document-latency) by avoiding redirects, ensuring a fast server response, and enabling text compression.
597
591
  relevant trace bounds: {min: 59728651057µs, max: 59728790724µs}
@@ -608,6 +602,12 @@ Available insights:
608
602
  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.
609
603
  relevant trace bounds: {min: 59728701403µs, max: 59729465969µs}
610
604
  example question: Which third parties are having the largest impact on my page performance?
605
+ - insight name: Cache
606
+ 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).
607
+ relevant trace bounds: {min: 59728702014µs, max: 59728867430µs}
608
+ estimated metric savings: FCP 0 ms, LCP 0 ms
609
+ estimated wasted bytes: 971.5 kB
610
+ example question: What caching strategies can I apply to improve my page performance?
611
611
  - insight name: CharacterSet
612
612
  description: A character encoding declaration is required. It can be done with a meta charset tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header. [Learn more about declaring the character encoding](https://developer.chrome.com/docs/insights/charset/).
613
613
  relevant trace bounds: {min: 59728651057µs, max: 59728790724µs}
@@ -4,8 +4,9 @@
4
4
 
5
5
  import * as Host from '../../core/host/host.js';
6
6
  import * as Root from '../../core/root/root.js';
7
+ import * as AiUtils from '../ai-utils/ai-utils.js';
7
8
 
8
- import {debugLog} from './debug.js';
9
+ const {debugCodeGenCompleteLog: debugLog} = AiUtils.Debug;
9
10
 
10
11
  /**
11
12
  * TODO(b/404796739): Remove these definitions of AgentOptions and RequestOptions and
@@ -2,5 +2,14 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- export * from './debug.js';
6
- export * as AiCodeCompletion from './AiCodeCompletion.js';
5
+ import * as AiUtils from '../ai-utils/ai-utils.js';
6
+
7
+ import * as AiCodeCompletion from './AiCodeCompletion.js';
8
+
9
+ export function debugLog(...log: unknown[]): void {
10
+ AiUtils.Debug.debugCodeGenCompleteLog(...log);
11
+ }
12
+
13
+ export {
14
+ AiCodeCompletion,
15
+ };
@@ -4,8 +4,9 @@
4
4
 
5
5
  import * as Host from '../../core/host/host.js';
6
6
  import * as Root from '../../core/root/root.js';
7
+ import * as AiUtils from '../ai-utils/ai-utils.js';
7
8
 
8
- import {debugLog} from './debug.js';
9
+ const {debugCodeGenCompleteLog: debugLog} = AiUtils.Debug;
9
10
 
10
11
  export const basePreamble =
11
12
  `You are a highly skilled senior software engineer with deep expertise across multiple web technologies and programming languages, including JavaScript, TypeScript, HTML, and CSS.
@@ -2,5 +2,14 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- export * from './debug.js';
6
- export * as AiCodeGeneration from './AiCodeGeneration.js';
5
+ import * as AiUtils from '../ai-utils/ai-utils.js';
6
+
7
+ import * as AiCodeGeneration from './AiCodeGeneration.js';
8
+
9
+ export function debugLog(...log: unknown[]): void {
10
+ AiUtils.Debug.debugCodeGenCompleteLog(...log);
11
+ }
12
+
13
+ export {
14
+ AiCodeGeneration,
15
+ };
@@ -39,6 +39,8 @@ function createProcessedNavigation(
39
39
  return metricScore.event.ts;
40
40
  };
41
41
  const lcpScore = scores.get(Handlers.ModelHandlers.PageLoadMetrics.MetricName.LCP);
42
+ const navigationId = navigation.args.data?.navigationId;
43
+ const lcpRequest = navigationId ? data.LargestImagePaint?.lcpRequestByNavigationId.get(navigationId) : undefined;
42
44
  return {
43
45
  timestamps: {
44
46
  firstContentfulPaint: getTimestamp(Handlers.ModelHandlers.PageLoadMetrics.MetricName.FCP),
@@ -46,6 +48,8 @@ function createProcessedNavigation(
46
48
  },
47
49
  largestContentfulPaintEvt:
48
50
  lcpScore && Handlers.ModelHandlers.PageLoadMetrics.metricIsLCP(lcpScore) ? lcpScore.event : undefined,
51
+ lcpRequestId: lcpRequest?.args.data.requestId,
52
+ lcpImageUrl: lcpRequest?.args.data.url,
49
53
  };
50
54
  }
51
55