chrome-devtools-frontend 1.0.1608453 → 1.0.1609381

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 (56) hide show
  1. package/front_end/core/host/AidaGcaTranslation.ts +13 -0
  2. package/front_end/core/sdk/PreloadingModel.ts +1 -1
  3. package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +1 -1
  4. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +1 -1
  5. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +1 -1
  6. package/front_end/generated/InspectorBackendCommands.ts +1 -2
  7. package/front_end/generated/protocol-mapping.d.ts +0 -9
  8. package/front_end/generated/protocol-proxy-api.d.ts +0 -7
  9. package/front_end/generated/protocol.ts +0 -20
  10. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +6 -4
  11. package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +1 -1
  12. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +11 -10
  13. package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +26 -2
  14. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
  15. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +49 -30
  16. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
  17. package/front_end/models/ai_assistance/agents/StylingAgent.ts +5 -3
  18. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +69 -69
  19. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -1
  20. package/front_end/models/live-metrics/LiveMetrics.ts +43 -41
  21. package/front_end/models/trace/EntityMapper.ts +12 -0
  22. package/front_end/panels/ai_assistance/components/ChatMessage.ts +44 -15
  23. package/front_end/panels/ai_assistance/components/chatMessage.css +13 -0
  24. package/front_end/panels/application/ApplicationPanelSidebar.ts +8 -0
  25. package/front_end/panels/application/IndexedDBViews.ts +1 -1
  26. package/front_end/panels/application/ReportingApiTreeElement.ts +40 -1
  27. package/front_end/panels/application/ResourcesPanel.ts +8 -0
  28. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  29. package/front_end/panels/application/WebMCPView.ts +122 -4
  30. package/front_end/panels/application/application-meta.ts +11 -0
  31. package/front_end/panels/application/application.ts +3 -0
  32. package/front_end/panels/application/components/StorageMetadataView.ts +31 -7
  33. package/front_end/panels/application/components/backForwardCacheView.css +4 -0
  34. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +29 -0
  35. package/front_end/panels/application/webMCPView.css +12 -0
  36. package/front_end/panels/elements/ElementsTreeElement.ts +4 -0
  37. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +1 -1
  38. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
  39. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
  40. package/front_end/panels/timeline/TimelinePanel.ts +2 -6
  41. package/front_end/panels/timeline/utils/Helpers.ts +1 -1
  42. package/front_end/third_party/chromium/README.chromium +1 -1
  43. package/front_end/ui/legacy/InspectorDrawerView.ts +188 -15
  44. package/front_end/ui/legacy/InspectorView.ts +162 -11
  45. package/front_end/ui/legacy/TabbedPane.ts +2 -2
  46. package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -1
  47. package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
  48. package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +54 -0
  49. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  50. package/front_end/ui/visual_logging/LoggingDriver.ts +3 -3
  51. package/mcp/mcp.ts +1 -1
  52. package/package.json +1 -1
  53. /package/front_end/models/{heap_snapshot_model → heap_snapshot}/ChildrenProvider.ts +0 -0
  54. /package/front_end/models/{heap_snapshot_model → heap_snapshot}/HeapSnapshotModel.ts +0 -0
  55. /package/front_end/models/{heap_snapshot_model → heap_snapshot}/HeapSnapshotProxy.ts +0 -0
  56. /package/front_end/models/{heap_snapshot_model/heap_snapshot_model.ts → heap_snapshot/heap_snapshot.ts} +0 -0
@@ -41,11 +41,11 @@ const UIStringsNotTranslated = {
41
41
  /**
42
42
  * @description Shown when the agent is investigating network activity
43
43
  */
44
- networkActivitySummary: 'Investigating network activity',
44
+ networkActivitySummary: 'Investigating network activity',
45
45
  /**
46
46
  * @description Shown when the agent is investigating main thread activity
47
47
  */
48
- mainThreadActivity: 'Investigating main thread activity',
48
+ mainThreadActivity: 'Investigating main thread activity',
49
49
  } as const;
50
50
  const lockedString = i18n.i18n.lockedString;
51
51
 
@@ -141,7 +141,8 @@ Note: if the user asks a specific question about the trace (such as "What is my
141
141
  - Use the provided functions to get detailed performance data. Prioritize functions that provide context relevant to the performance issue being investigated.
142
142
  - Before finalizing your advice, look over it and validate using any relevant functions. If something seems off, refine the advice before giving it to the user.
143
143
  - Base your analysis and advice solely on the data retrieved through the provided functions. Always use the provided functions to gather sufficient data when needed.
144
- - Use the track summary functions to get high-level detail about portions of the trace. For the \`bounds\` parameter, default to using the bounds of the trace. Never specifically ask the user for a bounds. You can use more narrow bounds (such as the bounds relevant to a specific insight) when appropriate. Narrow the bounds given functions when possible.
144
+ - Use absolute microsecond timestamps for any function that requires a \`min\` and \`max\` bounds. These timestamps can be found in the trace summary or within the details of an insight.
145
+ - Example: If the trace bounds are {min: 1000, max: 5000} and you want to investigate a specific interaction that happened between 2000 and 3000, you should call \`getMainThreadTrackSummary({min: 2000, max: 3000})\`.
145
146
  - Use \`getEventByKey\` to get data on a specific trace event. This is great for root-cause analysis or validating any assumptions.
146
147
  - Provide clear, actionable recommendations. Avoid technical jargon unless necessary, and explain any technical terms used.
147
148
  - If you see a generic task like "Task", "Evaluate script" or "(anonymous)" in the main thread activity, try to look at its children to see what actual functions are executed and refer to those. When referencing the main thread activity, be as specific as you can. Ensure you identify to the user relevant functions and which script they were defined in. Avoid referencing "Task", "Evaluate script" and "(anonymous)" nodes if possible and instead focus on their children.
@@ -805,7 +806,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
805
806
  },
806
807
  displayInfoFromArgs: params => {
807
808
  return {
808
- title: lockedString(`Investigating insight ${params.insightName}…`),
809
+ title: lockedString(`Investigating insight ${params.insightName}`),
809
810
  action: `getInsightDetails('${params.insightSetId}', '${params.insightName}')`
810
811
  };
811
812
  },
@@ -903,7 +904,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
903
904
  required: ['eventKey']
904
905
  },
905
906
  displayInfoFromArgs: params => {
906
- return {title: lockedString('Looking at trace event'), action: `getEventByKey('${params.eventKey}')`};
907
+ return {title: lockedString('Looking at trace event'), action: `getEventByKey('${params.eventKey}')`};
907
908
  },
908
909
  handler: async params => {
909
910
  debugLog('Function call: getEventByKey', params);
@@ -922,13 +923,11 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
922
923
  });
923
924
 
924
925
  const createBounds =
925
- (min: Trace.Types.Timing.Micro, max: Trace.Types.Timing.Micro): Trace.Types.Timing.TraceWindowMicro|null => {
926
- if (min > max) {
927
- return null;
928
- }
926
+ (min?: Trace.Types.Timing.Micro, max?: Trace.Types.Timing.Micro): Trace.Types.Timing.TraceWindowMicro|null => {
927
+ const {min: bMin, max: bMax} = parsedTrace.data.Meta.traceBounds;
928
+ const clampedMin = Math.max(min ?? bMin, bMin);
929
+ const clampedMax = Math.min(max ?? bMax, bMax);
929
930
 
930
- const clampedMin = Math.max(min ?? 0, parsedTrace.data.Meta.traceBounds.min);
931
- const clampedMax = Math.min(max ?? Number.POSITIVE_INFINITY, parsedTrace.data.Meta.traceBounds.max);
932
931
  if (clampedMin > clampedMax) {
933
932
  return null;
934
933
  }
@@ -937,7 +936,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
937
936
  clampedMin as Trace.Types.Timing.Micro, clampedMax as Trace.Types.Timing.Micro);
938
937
  };
939
938
 
940
- this.declareFunction<{min: Trace.Types.Timing.Micro, max: Trace.Types.Timing.Micro}, {
939
+ this.declareFunction<{min?: Trace.Types.Timing.Micro, max?: Trace.Types.Timing.Micro}, {
941
940
  summary: string,
942
941
  }>('getMainThreadTrackSummary', {
943
942
  description:
@@ -949,21 +948,25 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
949
948
  properties: {
950
949
  min: {
951
950
  type: Host.AidaClient.ParametersTypes.INTEGER,
952
- description: 'The minimum time of the bounds, in microseconds',
953
- nullable: false,
951
+ description: `The minimum time of the bounds, in microseconds (the current trace starts at ${
952
+ parsedTrace.data.Meta.traceBounds.min})`,
953
+ nullable: true,
954
954
  },
955
955
  max: {
956
956
  type: Host.AidaClient.ParametersTypes.INTEGER,
957
- description: 'The maximum time of the bounds, in microseconds',
958
- nullable: false,
957
+ description: `The maximum time of the bounds, in microseconds (the current trace ends at ${
958
+ parsedTrace.data.Meta.traceBounds.max})`,
959
+ nullable: true,
959
960
  },
960
961
  },
961
- required: ['min', 'max']
962
+ required: []
962
963
  },
963
964
  displayInfoFromArgs: args => {
965
+ const min = args.min ?? parsedTrace.data.Meta.traceBounds.min;
966
+ const max = args.max ?? parsedTrace.data.Meta.traceBounds.max;
964
967
  return {
965
968
  title: lockedString(UIStringsNotTranslated.mainThreadActivity),
966
- action: `getMainThreadTrackSummary({min: ${args.min}, max: ${args.max}})`
969
+ action: `getMainThreadTrackSummary({min: ${min}, max: ${max}})`
967
970
  };
968
971
  },
969
972
  handler: async args => {
@@ -1019,7 +1022,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1019
1022
  });
1020
1023
 
1021
1024
  this.declareFunction<
1022
- {min: Trace.Types.Timing.Micro, max: Trace.Types.Timing.Micro}, {summary: string}>('getNetworkTrackSummary', {
1025
+ {min?: Trace.Types.Timing.Micro, max?: Trace.Types.Timing.Micro}, {summary: string}>('getNetworkTrackSummary', {
1023
1026
  description: 'Returns a summary of the network for the given bounds.',
1024
1027
  parameters: {
1025
1028
  type: Host.AidaClient.ParametersTypes.OBJECT,
@@ -1028,21 +1031,25 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1028
1031
  properties: {
1029
1032
  min: {
1030
1033
  type: Host.AidaClient.ParametersTypes.INTEGER,
1031
- description: 'The minimum time of the bounds, in microseconds',
1032
- nullable: false,
1034
+ description: `The minimum time of the bounds, in microseconds (the current trace starts at ${
1035
+ parsedTrace.data.Meta.traceBounds.min})`,
1036
+ nullable: true,
1033
1037
  },
1034
1038
  max: {
1035
1039
  type: Host.AidaClient.ParametersTypes.INTEGER,
1036
- description: 'The maximum time of the bounds, in microseconds',
1037
- nullable: false,
1040
+ description: `The maximum time of the bounds, in microseconds (the current trace ends at ${
1041
+ parsedTrace.data.Meta.traceBounds.max})`,
1042
+ nullable: true,
1038
1043
  },
1039
1044
  },
1040
- required: ['min', 'max']
1045
+ required: []
1041
1046
  },
1042
1047
  displayInfoFromArgs: args => {
1048
+ const min = args.min ?? parsedTrace.data.Meta.traceBounds.min;
1049
+ const max = args.max ?? parsedTrace.data.Meta.traceBounds.max;
1043
1050
  return {
1044
1051
  title: lockedString(UIStringsNotTranslated.networkActivitySummary),
1045
- action: `getNetworkTrackSummary({min: ${args.min}, max: ${args.max}})`
1052
+ action: `getNetworkTrackSummary({min: ${min}, max: ${max}})`
1046
1053
  };
1047
1054
  },
1048
1055
  handler: async args => {
@@ -1093,7 +1100,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1093
1100
  required: ['eventKey']
1094
1101
  },
1095
1102
  displayInfoFromArgs: args => {
1096
- return {title: lockedString('Looking at call tree'), action: `getDetailedCallTree('${args.eventKey}')`};
1103
+ return {title: lockedString('Looking at call tree'), action: `getDetailedCallTree('${args.eventKey}')`};
1097
1104
  },
1098
1105
  handler: async args => {
1099
1106
  debugLog('Function call: getDetailedCallTree');
@@ -1117,7 +1124,19 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1117
1124
 
1118
1125
  const key = `getDetailedCallTree(${args.eventKey})`;
1119
1126
  this.#cacheFunctionResult(focus, key, callTree);
1120
- return {result: {callTree}};
1127
+
1128
+ const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(event);
1129
+ const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(startTime, endTime);
1130
+
1131
+ const widgets: AiWidget[] = [{
1132
+ name: 'BOTTOM_UP_TREE',
1133
+ data: {
1134
+ bounds,
1135
+ parsedTrace,
1136
+ },
1137
+ }];
1138
+
1139
+ return {result: {callTree}, widgets};
1121
1140
  },
1122
1141
 
1123
1142
  });
@@ -1213,7 +1232,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1213
1232
  },
1214
1233
  displayInfoFromArgs: args => {
1215
1234
  return {
1216
- title: lockedString('Looking up function code'),
1235
+ title: lockedString('Looking up function code'),
1217
1236
  action: `getFunctionCode('${args.scriptUrl}', ${args.line}, ${args.column})`
1218
1237
  };
1219
1238
  },
@@ -1271,7 +1290,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1271
1290
  required: ['url']
1272
1291
  },
1273
1292
  displayInfoFromArgs: args => {
1274
- return {title: lockedString('Looking at resource content'), action: `getResourceContent('${args.url}')`};
1293
+ return {title: lockedString('Looking at resource content'), action: `getResourceContent('${args.url}')`};
1275
1294
  },
1276
1295
  handler: async args => {
1277
1296
  debugLog('Function call: getResourceContent');
@@ -1326,7 +1345,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1326
1345
  required: ['eventKey']
1327
1346
  },
1328
1347
  displayInfoFromArgs: params => {
1329
- return {title: lockedString('Selecting event'), action: `selectEventByKey('${params.eventKey}')`};
1348
+ return {title: lockedString('Selecting event'), action: `selectEventByKey('${params.eventKey}')`};
1330
1349
  },
1331
1350
  handler: async params => {
1332
1351
  debugLog('Function call: selectEventByKey', params);
@@ -57,7 +57,7 @@ Content:
57
57
  "function_declarations": [
58
58
  {
59
59
  "name": "getStyles",
60
- "description": "Get computed and source styles for one or multiple elements on the inspected page for multiple elements at once by uid.\n\n**CRITICAL** An element uid is a number, not a selector.\n**CRITICAL** Use selectors to refer to elements in the text output. Do not use uids.\n**CRITICAL** Always provide the explanation argument to explain what and why you query.",
60
+ "description": "Get computed and source styles for one or multiple elements on the inspected page for multiple elements at once by uid.\n\n**CRITICAL** An element uid is a number, not a selector.\n**CRITICAL** Use selectors to refer to elements in the text output. Do not use uids.\n**CRITICAL** Always provide the explanation argument to explain what and why you query.\n**CRITICAL** You MUST provide a specific list of CSS property names. Do not use generic values like \"all\" or \"*\".",
61
61
  "parameters": {
62
62
  "type": 6,
63
63
  "description": "",
@@ -79,7 +79,7 @@ Content:
79
79
  },
80
80
  "styleProperties": {
81
81
  "type": 5,
82
- "description": "One or more CSS style property names to fetch.",
82
+ "description": "One or more specific CSS style property names to fetch. Generic values like \"all\" or \"*\" are not supported.",
83
83
  "nullable": false,
84
84
  "items": {
85
85
  "type": 1,
@@ -75,7 +75,7 @@ First, examine the provided context, then use the functions to gather additional
75
75
  * Use the precision of Strunk & White, the brevity of Hemingway, and the simple clarity of Vonnegut. Don't add repeated information, and keep the whole answer short.
76
76
  * **CRITICAL** NEVER write full Python programs - you should only write individual statements that invoke a single function from the provided library.
77
77
  * **CRITICAL** NEVER output text before a function call. Always do a function call first.
78
- * **CRITICAL** When answering questions about positioning or layout, ALWAYS inspect \`position\`, \`display\` and ALL related properties.
78
+ * **CRITICAL** When answering questions about positioning or layout, ALWAYS inspect \`position\`, \`display\` and all other related properties. You MUST provide a specific list of CSS property names when calling functions to get styles. Do not use generic values like "all" or "*".
79
79
  * **CRITICAL** You are a CSS/DOM/HTML debugging assistant. NEVER provide answers to questions of unrelated topics such as legal advice, financial advice, personal opinions, medical advice, religion, race, politics, sexuality, gender, or any other non web-development topics. Answer "Sorry, I can't answer that. I'm best at questions about debugging web pages." to such questions.
80
80
 
81
81
  ## Response Structure
@@ -308,7 +308,8 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
308
308
 
309
309
  **CRITICAL** An element uid is a number, not a selector.
310
310
  **CRITICAL** Use selectors to refer to elements in the text output. Do not use uids.
311
- **CRITICAL** Always provide the explanation argument to explain what and why you query.`,
311
+ **CRITICAL** Always provide the explanation argument to explain what and why you query.
312
+ **CRITICAL** You MUST provide a specific list of CSS property names. Do not use generic values like "all" or "*".`,
312
313
  parameters: {
313
314
  type: Host.AidaClient.ParametersTypes.OBJECT,
314
315
  description: '',
@@ -327,7 +328,8 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
327
328
  },
328
329
  styleProperties: {
329
330
  type: Host.AidaClient.ParametersTypes.ARRAY,
330
- description: 'One or more CSS style property names to fetch.',
331
+ description:
332
+ 'One or more specific CSS style property names to fetch. Generic values like "all" or "*" are not supported.',
331
333
  nullable: false,
332
334
  items: {
333
335
  type: Host.AidaClient.ParametersTypes.STRING,