chrome-devtools-frontend 1.0.1514545 → 1.0.1515446

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 (77) hide show
  1. package/AUTHORS +1 -0
  2. package/docs/committers_policy.md +1 -1
  3. package/docs/contributing/infrastructure.md +101 -5
  4. package/front_end/Images/gdp-logo-dark.png +0 -0
  5. package/front_end/Images/gdp-logo-light.png +0 -0
  6. package/front_end/core/common/Settings.ts +11 -32
  7. package/front_end/global_typings/global_defs.d.ts +15 -1
  8. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +22 -23
  9. package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +6 -7
  10. package/front_end/models/ai_assistance/ai_assistance.ts +3 -0
  11. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +77 -2
  12. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +76 -10
  13. package/front_end/models/cpu_profile/ProfileTreeModel.ts +1 -1
  14. package/front_end/models/extensions/ExtensionPanel.ts +4 -0
  15. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +5 -1
  16. package/front_end/models/trace/helpers/Trace.ts +1 -1
  17. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +6 -7
  18. package/front_end/panels/ai_assistance/components/ChatView.ts +1 -2
  19. package/front_end/panels/common/GdpSignUpDialog.ts +2 -6
  20. package/front_end/panels/common/gdpSignUpDialog.css +6 -14
  21. package/front_end/panels/console/ConsoleView.ts +4 -0
  22. package/front_end/panels/elements/ElementsPanel.ts +4 -0
  23. package/front_end/panels/elements/StylePropertiesSection.ts +4 -4
  24. package/front_end/panels/network/NetworkConfigView.ts +1 -1
  25. package/front_end/panels/network/NetworkLogView.ts +2 -2
  26. package/front_end/panels/network/components/HeaderSectionRow.ts +2 -3
  27. package/front_end/panels/profiler/HeapProfileView.ts +1 -3
  28. package/front_end/panels/profiler/HeapSnapshotView.ts +5 -1
  29. package/front_end/panels/profiler/ProfileDataGrid.ts +4 -0
  30. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +7 -29
  31. package/front_end/panels/profiler/ProfileView.ts +4 -0
  32. package/front_end/panels/recorder/components/CreateRecordingView.ts +2 -2
  33. package/front_end/panels/search/SearchView.ts +219 -205
  34. package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
  35. package/front_end/panels/settings/SettingsScreen.ts +1 -1
  36. package/front_end/panels/settings/components/SyncSection.ts +2 -6
  37. package/front_end/panels/settings/components/syncSection.css +11 -4
  38. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -3
  39. package/front_end/panels/sources/SourcesView.ts +4 -0
  40. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
  41. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +6 -3
  42. package/front_end/panels/timeline/CountersGraph.ts +5 -5
  43. package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
  44. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +4 -3
  45. package/front_end/panels/timeline/TimelineFlameChartView.ts +9 -4
  46. package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
  47. package/front_end/panels/timeline/TimelinePanel.ts +4 -3
  48. package/front_end/panels/timeline/TimelineTreeView.ts +6 -2
  49. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -1
  50. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -2
  51. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +6 -6
  52. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +2 -2
  53. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -3
  54. package/front_end/panels/timeline/utils/utils.ts +0 -8
  55. package/front_end/{panels/timeline/utils → services/tracing}/FreshRecording.ts +1 -1
  56. package/front_end/services/tracing/tracing.ts +2 -0
  57. package/front_end/ui/legacy/Dialog.ts +38 -13
  58. package/front_end/ui/legacy/InspectorView.ts +7 -9
  59. package/front_end/ui/legacy/SearchableView.ts +73 -55
  60. package/front_end/ui/legacy/SettingsUI.ts +5 -5
  61. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +1 -4
  62. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +5 -5
  63. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +2 -2
  64. package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +2 -2
  65. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +1 -4
  66. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
  67. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -2
  68. package/front_end/ui/legacy/components/source_frame/JSONView.ts +10 -10
  69. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -0
  70. package/front_end/ui/legacy/components/source_frame/XMLView.ts +4 -0
  71. package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -4
  72. package/front_end/ui/legacy/searchableView.css +0 -4
  73. package/package.json +1 -1
  74. package/front_end/Images/src/gdp-logo-standalone.svg +0 -9
  75. /package/front_end/{panels/timeline/utils → models/ai_assistance/performance}/AICallTree.ts +0 -0
  76. /package/front_end/{panels/timeline/utils → models/ai_assistance/performance}/AIContext.ts +0 -0
  77. /package/front_end/{panels/timeline/utils/InsightAIContext.ts → models/ai_assistance/performance/AIQueries.ts} +0 -0
package/AUTHORS CHANGED
@@ -14,6 +14,7 @@
14
14
  AbdAlRahman Gad <abdobngad@gmail.com>
15
15
  Ajay Panthagani <ajaypanthagani321@gmail.com>
16
16
  Alesandro Ortiz <alesandro@alesandroortiz.com>
17
+ Alex Ho <wjhe1016@gmail.com>
17
18
  Alexander Stammbach <alexander@stammbach.io>
18
19
  Alexey Rodionov <fluorescent.hallucinogen@gmail.com>
19
20
  Ameen Basha <ameenbasha111@gmail.com>
@@ -29,7 +29,7 @@ Once you get approval from the existing committers, you'll be added to [chrome-d
29
29
 
30
30
  In the most unfavorable circumstances, the process could extend up to two weeks. Maintain your commitment to writing patches. Even in the uncommon instances where a nomination fails, the objection is frequently something specific to resolve, such as "more patches" or "not enough people are familiar with this person's work."
31
31
 
32
- Two-factor authentication is a requirement for adding your account as a committer. If you haven't done so already, you'll need to set up a security key on your account.
32
+ Two-factor authentication is a requirement for adding your account as a committer. If you haven't done so already, you'll need to set up a security key on your account. For more information about this requirement see [Gerrit ReAuth](https://chromium.googlesource.com/chromium/src/+/main/docs/gerrit_reauth.md).
33
33
 
34
34
  # **Maintaining committer status**
35
35
 
@@ -88,6 +88,12 @@ file in the `infra/config` branch contains the logic that determines
88
88
  which builders are needed to verify a CQ. See `custom_locationsfilters`
89
89
  for the current logic.
90
90
 
91
+ Some of the filters currently in use are:
92
+ - `cpp_debug_extension` builders only trigger on changes related to the extension
93
+ - `dtf_check_no_bundle` builder only trigger on GN changes
94
+ - all other builders will not trigger if only documentation files are updated
95
+
96
+
91
97
  ## Branch cutting process
92
98
 
93
99
  At the end of every release cycle Chromium will cut a new branch for the current release.
@@ -139,11 +145,101 @@ To toggle this behaviour you need to edit `buckets/try.star` file ([example](htt
139
145
  dictionary together with the desired experiment rate percentage; remove it
140
146
  from the list to make it a regular builder
141
147
 
142
- ## Controlling when a builder runs
143
- // TODO
148
+ ## Adding a new builder in CQ
149
+
150
+ To add a new try-builder edit the `buckets/try.start` file to call one of the
151
+ existing functions that generate builder definitions:
152
+ - `try_builder` used for builder with recipes that do not orchestrate other
153
+ builders:
154
+ - build only builders (`dtf_check_no_bundle`)
155
+ - chromium builders (`devtools_frontend_linux_blink_light_rel_fastbuild`)
156
+ - `try_pair` used for builders with orchestrating recipes (delegates to a
157
+ compilator builder before delegating testing to swarming)
158
+
159
+ Alternatively define your own builder function and call it for the instances you
160
+ need (see `presubmit_builder` and `cpp_debug_extension_try`).
161
+
162
+ You will need add your new builder to the `cq_builders.devtools_builders` list.
144
163
 
145
- ## Adding a new builder
146
- // TODO
164
+ To control the CL blocking behaviour of your builder see above.
165
+
166
+ To control if the builder should be not present in the CQ for branches, add your
167
+ builder to `cq_builders.chromium_builders` list.
168
+
169
+ ## Adding a new builder in CI
170
+
171
+ To add a new try-builder edit the `buckets/ci.start` file to add a new
172
+ `builder_descriptor` to the `builders` of `generate_ci_configs` function call.
173
+
174
+ In your descriptor decide for the name of builder, the recipe, any other custom
175
+ properties you might need and for which configurations (consoles) to include
176
+ your builder (`ci` stands for the main waterfall console). [Example](https://chromium.googlesource.com/devtools/devtools-frontend/+/refs/heads/infra/config/buckets/ci.star#:~:text=name%20%3D%20%22-,Linux,-Compile%20Debug%22%2C).
147
177
 
148
178
  ## Anatomy of a CQ build
149
- // TODO
179
+
180
+ In CQ the builders that get most attention are `dtf_*_rel` builders. These builders
181
+ run the devtools/trybot_tester recipe and are responsible with building DevTools
182
+ Frontend and running our tests.
183
+
184
+ Below is a detailed description of what happens in such a build:
185
+ - The recipe will perform the `bot_update` and `gclient runhooks` step where
186
+ the tip-of-tree for devtools-frontend gets checked out, your changes get
187
+ patched on top of it and dependencies get updated.
188
+ - The compilator bot get triggered (`initialization` step)
189
+ - We wait for the compilator bot to finish. This bot is responsible for
190
+ the actual build of devtools-frontend.
191
+ - It does a `bot_update` of its own
192
+ - Generates the GN files (`gn` step)
193
+ - Compiles (`compile`) the project
194
+ - Reads the e2e_non_hosted test lists
195
+ - Creates a CAS archive with project and the compilation output
196
+ - Ouputs the `compilator_properties`
197
+ - Once the compilator is done we read the `compilator_properties` to find
198
+ - the `cas_digest` to be used when triggering tests on swarming
199
+ - the `e2e_non_hosted_test_list` for sharding the e2e tests execution
200
+ - Write the e2e test list at the location where building would have written it
201
+ - The default test run phase starts at `Run tests` step:
202
+ - We trigger all tests on swarming in parallel (`Trigger Tests`) substep.
203
+ - For all types of tests we calculate the command we want to run on swarming
204
+ and trigger a task with that command and the collected CAS digest
205
+ - Before calculating the command for e2e test we read the test list and
206
+ and split it in a number of shards. Each shard will have the allocated
207
+ tests specified in the command.
208
+ - We wait for all swarming task to complete
209
+ - Next we re-run the failed tests in attemt to exonerate their initial
210
+ failures (`Flake exonaration attempt` step):
211
+ - We query ResultDB for any tests that might have failed
212
+ - We collect the failed test names and contruct new commands to re-run
213
+ them on new swarming tasks
214
+ - We wait for all swarming task to complete
215
+ - Finally we will stress test the tests that were added/modified by the
216
+ current CL in the `Detect flakes in new tests` step
217
+ - Run `git diff` to determine which tests were added/modifed
218
+ - Construct the command to be run on swatming
219
+ - Trigger and wait for the swarming tasks to finish
220
+ - Calculate the outcome of the builder:
221
+ - fail the builder if tests failed in the default run and the exoneration
222
+ run was unsuccesful
223
+ - fail the builder if tests failed in the deflaking phase
224
+ - otherwise report build as passing
225
+
226
+ ### Common build failures
227
+
228
+ The first place where a build usualy fails is on `bot_update` and this usually
229
+ happens because your changes cannot be applied on top of the current tip-of-tree.
230
+ Rebase your CL and solve any merge conflicts and this failure will go away.
231
+
232
+ Another common failure is a compilation failure. You can insepct the compilator
233
+ builder (`dtf_*_compiler_rel`) separately by following the link next to the
234
+ `compilator steps` step.
235
+
236
+ If you have too many tests failing in the default phase the exoneration phase
237
+ gets skipped.
238
+
239
+ A test might not get exonerated in your build even if your CL does not touch
240
+ anything related to it. The exoneration phase will re-run previously faling
241
+ tests a number of times and at any point the test passes the tests gets
242
+ exonerated. Therefore a test can have a recent history of getting exonerated
243
+ even if it consitently failed 4 times out of 5 runs for some time. Try to
244
+ correlate your failure with a luci-analysys report on this test and skip it
245
+ untill the flakiness gets resolved.
@@ -133,7 +133,6 @@ export class Settings {
133
133
  * If you are creating a setting that you expect the user to control, and
134
134
  * sync, prefer {@see createSetting}
135
135
  */
136
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
137
136
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
138
137
  moduleSetting<T = any>(settingName: string): Setting<T> {
139
138
  const setting = this.moduleSettings.get(settingName) as Setting<T>;
@@ -589,7 +588,6 @@ export class Setting<V> {
589
588
  }
590
589
  }
591
590
 
592
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
593
591
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
594
592
  export class RegExpSetting extends Setting<any> {
595
593
  #regexFlags: string|undefined;
@@ -643,6 +641,9 @@ export class RegExpSetting extends Setting<any> {
643
641
  }
644
642
  }
645
643
 
644
+ // The VersionController does a lot of mapping and restructuring which often need
645
+ // typecasting to any, allow it in there
646
+ /* eslint-disable @typescript-eslint/no-explicit-any */
646
647
  export class VersionController {
647
648
  static readonly GLOBAL_VERSION_SETTING_NAME = 'inspectorVersion';
648
649
  static readonly SYNCED_VERSION_SETTING_NAME = 'syncedInspectorVersion';
@@ -798,16 +799,16 @@ export class VersionController {
798
799
 
799
800
  const newSetting = Settings.instance().createSetting(newName, {});
800
801
  const newValue = newSetting.get() || {};
801
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
802
+
802
803
  // @ts-expect-error
803
804
  newValue.vertical = newValue.vertical || {};
804
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
805
+
805
806
  // @ts-expect-error
806
807
  newValue.vertical.showMode = showMode;
807
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
808
+
808
809
  // @ts-expect-error
809
810
  newValue.horizontal = newValue.horizontal || {};
810
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
811
+
811
812
  // @ts-expect-error
812
813
  newValue.horizontal.showMode = showMode;
813
814
  newSetting.set(newValue);
@@ -888,7 +889,7 @@ export class VersionController {
888
889
  const newList = [];
889
890
  for (let i = 0; i < list.length; ++i) {
890
891
  const value = list[i];
891
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
892
+
892
893
  const device: Record<string, any> = {};
893
894
  device['title'] = value['title'];
894
895
  device['type'] = 'unknown';
@@ -930,8 +931,6 @@ export class VersionController {
930
931
  }
931
932
 
932
933
  updateVersionFrom14To15(): void {
933
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
934
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
935
934
  const setting = Settings.instance().createLocalSetting<any>('workspaceExcludedFolders', {});
936
935
  const oldValue = setting.get();
937
936
  const newValue: Record<string, string[]> = {};
@@ -945,8 +944,6 @@ export class VersionController {
945
944
  }
946
945
 
947
946
  updateVersionFrom15To16(): void {
948
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
949
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
950
947
  const setting = Settings.instance().createSetting<any>('InspectorView.panelOrder', {});
951
948
  const tabOrders = setting.get();
952
949
  for (const key of Object.keys(tabOrders)) {
@@ -956,8 +953,6 @@ export class VersionController {
956
953
  }
957
954
 
958
955
  updateVersionFrom16To17(): void {
959
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
960
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
961
956
  const setting = Settings.instance().createSetting<any>('networkConditionsCustomProfiles', []);
962
957
  const oldValue = setting.get();
963
958
  const newValue = [];
@@ -976,8 +971,6 @@ export class VersionController {
976
971
  }
977
972
 
978
973
  updateVersionFrom17To18(): void {
979
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
980
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
981
974
  const setting = Settings.instance().createLocalSetting<any>('workspaceExcludedFolders', {});
982
975
  const oldValue = setting.get();
983
976
  const newValue: Record<string, string> = {};
@@ -997,8 +990,6 @@ export class VersionController {
997
990
 
998
991
  updateVersionFrom18To19(): void {
999
992
  const defaultColumns = {status: true, type: true, initiator: true, size: true, time: true};
1000
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
1001
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1002
993
  const visibleColumnSettings = Settings.instance().createSetting<any>('networkLogColumnsVisibility', defaultColumns);
1003
994
  const visibleColumns = visibleColumnSettings.get();
1004
995
  visibleColumns.name = true;
@@ -1034,8 +1025,6 @@ export class VersionController {
1034
1025
  }
1035
1026
 
1036
1027
  updateVersionFrom21To22(): void {
1037
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
1038
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1039
1028
  const breakpointsSetting = Settings.instance().createLocalSetting<any>('breakpoints', []);
1040
1029
  const breakpoints = breakpointsSetting.get();
1041
1030
  for (const breakpoint of breakpoints) {
@@ -1058,8 +1047,7 @@ export class VersionController {
1058
1047
 
1059
1048
  updateVersionFrom24To25(): void {
1060
1049
  const defaultColumns = {status: true, type: true, initiator: true, size: true, time: true};
1061
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
1062
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1050
+
1063
1051
  const networkLogColumnsSetting = Settings.instance().createSetting<any>('networkLogColumns', defaultColumns);
1064
1052
  const columns = networkLogColumnsSetting.get();
1065
1053
  delete columns.product;
@@ -1071,8 +1059,6 @@ export class VersionController {
1071
1059
  const urls = Object.keys(oldSetting.get());
1072
1060
  const textFilter = urls.map(url => `-url:${url}`).join(' ');
1073
1061
  if (textFilter) {
1074
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
1075
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1076
1062
  const textFilterSetting = Settings.instance().createSetting<any>('console.textFilter', '');
1077
1063
  const suffix = textFilterSetting.get() ? ` ${textFilterSetting.get()}` : '';
1078
1064
  textFilterSetting.set(`${textFilter}${suffix}`);
@@ -1082,8 +1068,6 @@ export class VersionController {
1082
1068
 
1083
1069
  updateVersionFrom26To27(): void {
1084
1070
  function renameKeyInObjectSetting(settingName: string, from: string, to: string): void {
1085
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
1086
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1087
1071
  const setting = Settings.instance().createSetting<any>(settingName, {});
1088
1072
  const value = setting.get();
1089
1073
  if (from in value) {
@@ -1115,8 +1099,6 @@ export class VersionController {
1115
1099
 
1116
1100
  updateVersionFrom28To29(): void {
1117
1101
  function renameKeyInObjectSetting(settingName: string, from: string, to: string): void {
1118
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
1119
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1120
1102
  const setting = Settings.instance().createSetting<any>(settingName, {});
1121
1103
  const value = setting.get();
1122
1104
  if (from in value) {
@@ -1171,7 +1153,6 @@ export class VersionController {
1171
1153
  // know on which resource type the given breakpoint was set, we just assume
1172
1154
  // 'script' here to keep things simple.
1173
1155
 
1174
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1175
1156
  const breakpointsSetting = Settings.instance().createLocalSetting<any>('breakpoints', []);
1176
1157
  const breakpoints = breakpointsSetting.get();
1177
1158
  for (const breakpoint of breakpoints) {
@@ -1181,12 +1162,11 @@ export class VersionController {
1181
1162
  }
1182
1163
 
1183
1164
  updateVersionFrom32To33(): void {
1184
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1185
1165
  const previouslyViewedFilesSetting = Settings.instance().createLocalSetting<any>('previouslyViewedFiles', []);
1186
1166
  let previouslyViewedFiles = previouslyViewedFilesSetting.get();
1187
1167
 
1188
1168
  // Discard old 'previouslyViewedFiles' items that don't have a 'url' property.
1189
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1169
+
1190
1170
  previouslyViewedFiles = previouslyViewedFiles.filter((previouslyViewedFile: any) => 'url' in previouslyViewedFile);
1191
1171
 
1192
1172
  // Introduce the new 'resourceTypeName' property on previously viewed files.
@@ -1213,7 +1193,6 @@ export class VersionController {
1213
1193
  const logpointPrefix = '/** DEVTOOLS_LOGPOINT */ console.log(';
1214
1194
  const logpointSuffix = ')';
1215
1195
 
1216
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1217
1196
  const breakpointsSetting = Settings.instance().createLocalSetting<any>('breakpoints', []);
1218
1197
  const breakpoints = breakpointsSetting.get();
1219
1198
  for (const breakpoint of breakpoints) {
@@ -1234,7 +1213,6 @@ export class VersionController {
1234
1213
  const logpointPrefix = '/** DEVTOOLS_LOGPOINT */ console.log(';
1235
1214
  const logpointSuffix = ')';
1236
1215
 
1237
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1238
1216
  const breakpointsSetting = Settings.instance().createLocalSetting<any>('breakpoints', []);
1239
1217
  const breakpoints = breakpointsSetting.get();
1240
1218
  for (const breakpoint of breakpoints) {
@@ -1466,6 +1444,7 @@ export class VersionController {
1466
1444
  }
1467
1445
  }
1468
1446
  }
1447
+ /* eslint-enable @typescript-eslint/no-explicit-any */
1469
1448
 
1470
1449
  export const enum SettingStorageType {
1471
1450
  /** Persists with the active Chrome profile but also syncs the settings across devices via Chrome Sync. */
@@ -12,7 +12,7 @@ declare module '*.css.js' {
12
12
  export default styles;
13
13
  }
14
14
 
15
- // Types for the Scheduler API.
15
+ // [start] Types for the Scheduler API.
16
16
  // These are taken from
17
17
  // https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wicg-task-scheduling
18
18
  // but modified because within Chrome we can use the API without worrying that
@@ -66,3 +66,17 @@ interface Window {
66
66
  interface WorkerGlobalScope {
67
67
  readonly scheduler?: Scheduler;
68
68
  }
69
+ // [end] Types for the Scheduler API.
70
+
71
+ // [start] Type definition for EyeDropper
72
+
73
+ interface EyeDropper {
74
+ open: (options?: {signal?: AbortSignal}) => Promise<{sRGBHex: string}>;
75
+ }
76
+
77
+ interface Window {
78
+ // eslint-disable-next-line @typescript-eslint/naming-convention
79
+ EyeDropper: {new(): EyeDropper};
80
+ }
81
+
82
+ // [end] Type definition for EyeDropper
@@ -9,7 +9,7 @@ import * as i18n from '../../../core/i18n/i18n.js';
9
9
  import * as Platform from '../../../core/platform/platform.js';
10
10
  import * as Root from '../../../core/root/root.js';
11
11
  import * as SDK from '../../../core/sdk/sdk.js';
12
- import * as TimelineUtils from '../../../panels/timeline/utils/utils.js';
12
+ import * as Tracing from '../../../services/tracing/tracing.js';
13
13
  import * as Trace from '../../trace/trace.js';
14
14
  import type {ConversationType} from '../AiHistoryStorage.js';
15
15
  import {
@@ -18,6 +18,8 @@ import {
18
18
  } from '../data_formatters/PerformanceInsightFormatter.js';
19
19
  import {PerformanceTraceFormatter} from '../data_formatters/PerformanceTraceFormatter.js';
20
20
  import {debugLog} from '../debug.js';
21
+ import {AICallTree} from '../performance/AICallTree.js';
22
+ import {AgentFocus} from '../performance/AIContext.js';
21
23
 
22
24
  import {
23
25
  type AgentOptions,
@@ -156,23 +158,23 @@ enum ScorePriority {
156
158
  DEFAULT = 1,
157
159
  }
158
160
 
159
- export class PerformanceTraceContext extends ConversationContext<TimelineUtils.AIContext.AgentFocus> {
161
+ export class PerformanceTraceContext extends ConversationContext<AgentFocus> {
160
162
  static full(parsedTrace: Trace.TraceModel.ParsedTrace): PerformanceTraceContext {
161
- return new PerformanceTraceContext(TimelineUtils.AIContext.AgentFocus.full(parsedTrace));
163
+ return new PerformanceTraceContext(AgentFocus.full(parsedTrace));
162
164
  }
163
165
 
164
166
  static fromInsight(parsedTrace: Trace.TraceModel.ParsedTrace, insight: Trace.Insights.Types.InsightModel):
165
167
  PerformanceTraceContext {
166
- return new PerformanceTraceContext(TimelineUtils.AIContext.AgentFocus.fromInsight(parsedTrace, insight));
168
+ return new PerformanceTraceContext(AgentFocus.fromInsight(parsedTrace, insight));
167
169
  }
168
170
 
169
- static fromCallTree(callTree: TimelineUtils.AICallTree.AICallTree): PerformanceTraceContext {
170
- return new PerformanceTraceContext(TimelineUtils.AIContext.AgentFocus.fromCallTree(callTree));
171
+ static fromCallTree(callTree: AICallTree): PerformanceTraceContext {
172
+ return new PerformanceTraceContext(AgentFocus.fromCallTree(callTree));
171
173
  }
172
174
 
173
- #focus: TimelineUtils.AIContext.AgentFocus;
175
+ #focus: AgentFocus;
174
176
 
175
- constructor(focus: TimelineUtils.AIContext.AgentFocus) {
177
+ constructor(focus: AgentFocus) {
176
178
  super();
177
179
  this.#focus = focus;
178
180
  }
@@ -182,7 +184,7 @@ export class PerformanceTraceContext extends ConversationContext<TimelineUtils.A
182
184
  return `trace-${min}-${max}`;
183
185
  }
184
186
 
185
- override getItem(): TimelineUtils.AIContext.AgentFocus {
187
+ override getItem(): AgentFocus {
186
188
  return this.#focus;
187
189
  }
188
190
 
@@ -226,13 +228,13 @@ type PerformanceConversationType =
226
228
  * One agent instance handles one conversation. Create a new agent
227
229
  * instance for a new conversation.
228
230
  */
229
- export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus> {
231
+ export class PerformanceAgent extends AiAgent<AgentFocus> {
230
232
  // TODO: would make more sense on AgentOptions
231
233
  #conversationType: PerformanceConversationType;
232
234
  #formatter: PerformanceTraceFormatter|null = null;
233
235
  #lastInsightForEnhancedQuery: Trace.Insights.Types.InsightModel|undefined;
234
236
  #eventsSerializer = new Trace.EventsSerializer.EventsSerializer();
235
- #lastFocusHandledForContextDetails: TimelineUtils.AIContext.AgentFocus|null = null;
237
+ #lastFocusHandledForContextDetails: AgentFocus|null = null;
236
238
 
237
239
  constructor(opts: AgentOptions, conversationType: PerformanceConversationType) {
238
240
  super(opts);
@@ -250,8 +252,7 @@ export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus
250
252
  *
251
253
  * The record key is the result of a function's displayInfoFromArgs.
252
254
  */
253
- #functionCallCacheForFocus =
254
- new Map<TimelineUtils.AIContext.AgentFocus, Record<string, Host.AidaClient.RequestFact>>();
255
+ #functionCallCacheForFocus = new Map<AgentFocus, Record<string, Host.AidaClient.RequestFact>>();
255
256
 
256
257
  #networkDataDescriptionFact: Host.AidaClient.RequestFact = {
257
258
  text: TraceEventFormatter.networkDataFormatDescription,
@@ -305,8 +306,7 @@ export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus
305
306
  }
306
307
 
307
308
  async *
308
- handleContextDetails(context: ConversationContext<TimelineUtils.AIContext.AgentFocus>|null):
309
- AsyncGenerator<ContextResponse, void, void> {
309
+ handleContextDetails(context: ConversationContext<AgentFocus>|null): AsyncGenerator<ContextResponse, void, void> {
310
310
  if (!context) {
311
311
  return;
312
312
  }
@@ -368,8 +368,7 @@ export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus
368
368
  return super.parseTextResponse(response);
369
369
  }
370
370
 
371
- override async enhanceQuery(query: string, context: ConversationContext<TimelineUtils.AIContext.AgentFocus>|null):
372
- Promise<string> {
371
+ override async enhanceQuery(query: string, context: ConversationContext<AgentFocus>|null): Promise<string> {
373
372
  if (!context) {
374
373
  this.clearDeclaredFunctions();
375
374
  return query;
@@ -426,7 +425,7 @@ export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus
426
425
  }
427
426
 
428
427
  override async * run(initialQuery: string, options: {
429
- selected: ConversationContext<TimelineUtils.AIContext.AgentFocus>|null,
428
+ selected: ConversationContext<AgentFocus>|null,
430
429
  signal?: AbortSignal,
431
430
  }): AsyncGenerator<ResponseData, void, void> {
432
431
  const focus = options.selected?.getItem();
@@ -518,7 +517,7 @@ export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus
518
517
  });
519
518
  }
520
519
 
521
- #addFacts(focus: TimelineUtils.AIContext.AgentFocus): void {
520
+ #addFacts(focus: AgentFocus): void {
522
521
  this.addFact(this.#callFrameDataDescriptionFact);
523
522
  this.addFact(this.#networkDataDescriptionFact);
524
523
 
@@ -543,7 +542,7 @@ export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus
543
542
  }
544
543
  }
545
544
 
546
- #cacheFunctionResult(focus: TimelineUtils.AIContext.AgentFocus, key: string, result: string): void {
545
+ #cacheFunctionResult(focus: AgentFocus, key: string, result: string): void {
547
546
  const fact: Host.AidaClient.RequestFact = {
548
547
  text: `This is the result of calling ${key}:\n${result}`,
549
548
  metadata: {source: key, score: ScorePriority.DEFAULT},
@@ -553,7 +552,7 @@ export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus
553
552
  this.#functionCallCacheForFocus.set(focus, cache);
554
553
  }
555
554
 
556
- #declareFunctions(context: ConversationContext<TimelineUtils.AIContext.AgentFocus>): void {
555
+ #declareFunctions(context: ConversationContext<AgentFocus>): void {
557
556
  const focus = context.getItem();
558
557
  const {parsedTrace, insightSet} = focus.data;
559
558
 
@@ -786,7 +785,7 @@ export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus
786
785
  return {error: 'Invalid eventKey'};
787
786
  }
788
787
 
789
- const tree = TimelineUtils.AICallTree.AICallTree.fromEvent(event, parsedTrace);
788
+ const tree = AICallTree.fromEvent(event, parsedTrace);
790
789
  const callTree = tree ? this.#formatter.formatCallTree(tree) : 'No call tree found';
791
790
 
792
791
  const key = `getDetailedCallTree(${args.eventKey})`;
@@ -796,7 +795,7 @@ export class PerformanceAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus
796
795
 
797
796
  });
798
797
 
799
- const isFresh = TimelineUtils.FreshRecording.Tracker.instance().recordingIsFresh(parsedTrace);
798
+ const isFresh = Tracing.FreshRecording.Tracker.instance().recordingIsFresh(parsedTrace);
800
799
  const hasScriptContents =
801
800
  parsedTrace.metadata.enhancedTraceVersion && parsedTrace.data.Scripts.scripts.some(s => s.content);
802
801
 
@@ -5,7 +5,8 @@
5
5
  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
- import type * as TimelineUtils from '../../../panels/timeline/utils/utils.js';
8
+ import type {AICallTree} from '../performance/AICallTree.js';
9
+ import type {AgentFocus} from '../performance/AIContext.js';
9
10
 
10
11
  import {AiAgent, type ContextResponse, type ConversationContext, type RequestOptions, ResponseType} from './AiAgent.js';
11
12
  import {PerformanceTraceContext} from './PerformanceAgent.js';
@@ -87,7 +88,7 @@ The 'calculatePosition' function, taking 80ms, is a potential bottleneck.
87
88
  Consider optimizing the position calculation logic or reducing the frequency of calls to improve animation performance.
88
89
  `;
89
90
 
90
- export class PerformanceAnnotationsAgent extends AiAgent<TimelineUtils.AIContext.AgentFocus> {
91
+ export class PerformanceAnnotationsAgent extends AiAgent<AgentFocus> {
91
92
  override preamble = callTreePreamble;
92
93
 
93
94
  get clientFeature(): Host.AidaClient.ClientFeature {
@@ -109,8 +110,7 @@ export class PerformanceAnnotationsAgent extends AiAgent<TimelineUtils.AIContext
109
110
  }
110
111
 
111
112
  async *
112
- handleContextDetails(context: ConversationContext<TimelineUtils.AIContext.AgentFocus>|null):
113
- AsyncGenerator<ContextResponse, void, void> {
113
+ handleContextDetails(context: ConversationContext<AgentFocus>|null): AsyncGenerator<ContextResponse, void, void> {
114
114
  if (!context) {
115
115
  return;
116
116
  }
@@ -134,8 +134,7 @@ export class PerformanceAnnotationsAgent extends AiAgent<TimelineUtils.AIContext
134
134
  };
135
135
  }
136
136
 
137
- override async enhanceQuery(query: string, context: ConversationContext<TimelineUtils.AIContext.AgentFocus>|null):
138
- Promise<string> {
137
+ override async enhanceQuery(query: string, context: ConversationContext<AgentFocus>|null): Promise<string> {
139
138
  if (!context) {
140
139
  return query;
141
140
  }
@@ -153,7 +152,7 @@ export class PerformanceAnnotationsAgent extends AiAgent<TimelineUtils.AIContext
153
152
  /**
154
153
  * Used in the Performance panel to automatically generate a label for a selected entry.
155
154
  */
156
- async generateAIEntryLabel(callTree: TimelineUtils.AICallTree.AICallTree): Promise<string> {
155
+ async generateAIEntryLabel(callTree: AICallTree): Promise<string> {
157
156
  const context = PerformanceTraceContext.fromCallTree(callTree);
158
157
  const response = await Array.fromAsync(this.run(AI_LABEL_GENERATION_PROMPT, {selected: context}));
159
158
  const lastResponse = response.at(-1);
@@ -23,3 +23,6 @@ export * from './data_formatters/PerformanceTraceFormatter.js';
23
23
  export * from './data_formatters/UnitFormatters.js';
24
24
  export * from './ConversationHandler.js';
25
25
  export * from './injected.js';
26
+ export * from './performance/AICallTree.js';
27
+ export * from './performance/AIContext.js';
28
+ export * from './performance/AIQueries.js';