chrome-devtools-frontend 1.0.1675430 → 1.0.1676824

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 (225) hide show
  1. package/WATCHLISTS +0 -4
  2. package/front_end/core/common/Settings.ts +0 -66
  3. package/front_end/core/root/Runtime.ts +0 -5
  4. package/front_end/core/sdk/CSSMetadata.ts +5 -9
  5. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +8 -28
  6. package/front_end/core/sdk/DebuggerModel.ts +50 -30
  7. package/front_end/core/sdk/ResourceTreeModel.ts +20 -1
  8. package/front_end/core/sdk/Script.ts +9 -53
  9. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +213 -23
  10. package/front_end/entrypoints/main/MainImpl.ts +31 -0
  11. package/front_end/generated/InspectorBackendCommands.ts +3 -1
  12. package/front_end/generated/SupportedCSSProperties.ts +21 -4
  13. package/front_end/generated/protocol-mapping.d.ts +14 -0
  14. package/front_end/generated/protocol-proxy-api.d.ts +10 -0
  15. package/front_end/generated/protocol.ts +35 -0
  16. package/front_end/models/ai_assistance/AiAgent2.ts +11 -0
  17. package/front_end/models/ai_assistance/AiConversation.ts +22 -5
  18. package/front_end/models/ai_assistance/README.md +52 -26
  19. package/front_end/models/ai_assistance/agents/AiAgent.ts +54 -8
  20. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
  21. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +7 -194
  22. package/front_end/models/ai_assistance/agents/StorageAgent.ts +8 -87
  23. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
  24. package/front_end/models/ai_assistance/ai_assistance.ts +16 -0
  25. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +124 -0
  26. package/front_end/models/ai_assistance/contexts/StorageContext.ts +111 -0
  27. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +69 -1
  28. package/front_end/models/ai_assistance/skills/README.md +63 -1
  29. package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
  30. package/front_end/models/ai_assistance/skills/SkillRegistry.ts +4 -0
  31. package/front_end/models/ai_assistance/skills/performance.md +8 -0
  32. package/front_end/models/ai_assistance/skills/sources.md +16 -0
  33. package/front_end/models/ai_assistance/skills/storage.md +31 -0
  34. package/front_end/models/ai_assistance/tools/GetSourceContent.ts +101 -0
  35. package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +83 -0
  36. package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +106 -0
  37. package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +104 -0
  38. package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +81 -0
  39. package/front_end/models/ai_assistance/tools/ListSources.ts +116 -0
  40. package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +90 -0
  41. package/front_end/models/ai_assistance/tools/Tool.ts +22 -1
  42. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +14 -0
  43. package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -0
  44. package/front_end/models/bindings/CompilerScriptMapping.ts +4 -0
  45. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
  46. package/front_end/models/bindings/ResourceScriptMapping.ts +3 -201
  47. package/front_end/models/bindings/SASSSourceMapping.ts +6 -0
  48. package/front_end/models/breakpoints/BreakpointManager.ts +2 -49
  49. package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +27 -0
  50. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +10 -2
  51. package/front_end/models/issues_manager/descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
  52. package/front_end/models/issues_manager/descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
  53. package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
  54. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  55. package/front_end/models/persistence/IsolatedFileSystem.ts +7 -8
  56. package/front_end/models/persistence/IsolatedFileSystemManager.ts +2 -2
  57. package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
  58. package/front_end/models/persistence/persistence-meta.ts +9 -9
  59. package/front_end/models/trace/types/TraceEvents.ts +36 -0
  60. package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -3
  61. package/front_end/panels/accessibility/AccessibilityNodeView.ts +36 -36
  62. package/front_end/panels/accessibility/AccessibilityStrings.ts +168 -168
  63. package/front_end/panels/accessibility/SourceOrderView.ts +7 -7
  64. package/front_end/panels/accessibility/accessibility-meta.ts +2 -2
  65. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
  66. package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +2 -3
  67. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
  68. package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -2
  69. package/front_end/panels/application/IndexedDBViews.ts +65 -63
  70. package/front_end/panels/application/WebMCPView.ts +16 -7
  71. package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +5 -5
  72. package/front_end/panels/common/BadgeNotification.ts +8 -8
  73. package/front_end/panels/common/ExtensionServer.ts +21 -1
  74. package/front_end/panels/common/GdpSignUpDialog.ts +16 -16
  75. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +5 -6
  76. package/front_end/panels/common/PersistenceUtils.ts +2 -2
  77. package/front_end/panels/common/common.ts +0 -97
  78. package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -2
  79. package/front_end/panels/console/ConsolePinPane.ts +2 -2
  80. package/front_end/panels/console/ConsoleView.ts +20 -19
  81. package/front_end/panels/elements/LayoutPane.ts +2 -8
  82. package/front_end/panels/event_listeners/EventListenersView.ts +8 -4
  83. package/front_end/panels/issues/AffectedTrackingSitesView.ts +25 -14
  84. package/front_end/panels/media/PlayerMessagesView.ts +149 -68
  85. package/front_end/panels/network/NetworkPanel.ts +1 -1
  86. package/front_end/panels/network/RequestPayloadView.ts +1 -0
  87. package/front_end/panels/profiler/HeapSnapshotView.ts +0 -2
  88. package/front_end/panels/profiler/heapProfiler.css +0 -9
  89. package/front_end/panels/recorder/RecorderPanel.ts +2 -3
  90. package/front_end/panels/screencast/ScreencastView.ts +148 -138
  91. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -2
  92. package/front_end/panels/sources/DebuggerPlugin.ts +9 -58
  93. package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
  94. package/front_end/panels/sources/UISourceCodeFrame.ts +3 -8
  95. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -2
  96. package/front_end/panels/timeline/TimelineController.ts +36 -64
  97. package/front_end/panels/timeline/TimelinePanel.ts +11 -8
  98. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -2
  99. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
  100. package/front_end/panels/timeline/timelinePanel.css +0 -10
  101. package/front_end/panels/utils/utils.ts +7 -7
  102. package/front_end/services/tracing/PerformanceTracing.ts +5 -17
  103. package/front_end/third_party/chromium/README.chromium +1 -1
  104. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  105. package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
  106. package/front_end/third_party/codemirror.next/package.json +2 -2
  107. package/front_end/third_party/codemirror.next/rebuild.sh +4 -1
  108. package/front_end/ui/comments/CommentAnchorResolver.ts +436 -10
  109. package/front_end/ui/comments/CommentManager.ts +640 -0
  110. package/front_end/ui/comments/CommentsOverlayWidget.ts +121 -0
  111. package/front_end/ui/comments/comments.ts +4 -0
  112. package/front_end/ui/comments/commentsOverlay.css +49 -0
  113. package/front_end/{panels/common → ui/components/dialogs}/FreDialog.ts +6 -6
  114. package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +96 -0
  115. package/front_end/ui/components/dialogs/dialogs.ts +4 -0
  116. package/front_end/ui/components/settings/SettingCheckbox.ts +3 -3
  117. package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionDisclaimer.ts +13 -13
  118. package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -6
  119. package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionTeaser.ts +43 -46
  120. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +22 -26
  121. package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationTeaser.ts +10 -10
  122. package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts +5 -5
  123. package/front_end/ui/components/text_editor/text_editor.ts +4 -0
  124. package/front_end/ui/legacy/Toolbar.ts +1 -1
  125. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +11 -3
  126. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +270 -162
  127. package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +5 -0
  128. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -16
  129. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +5 -12
  130. package/front_end/ui/legacy/components/source_frame/JSONView.ts +8 -1
  131. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -2
  132. package/front_end/ui/settings/SettingUIRegistration.ts +55 -6
  133. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  134. package/mcp/mcp.ts +6 -1
  135. package/package.json +1 -1
  136. package/front_end/Images/toolbarResizerVertical.png +0 -0
  137. package/front_end/emulated_devices/MotoG4-landscape.svg +0 -155
  138. package/front_end/emulated_devices/MotoG4-portrait.svg +0 -155
  139. package/front_end/emulated_devices/Nexus5X-landscape.svg +0 -19
  140. package/front_end/emulated_devices/Nexus5X-portrait.svg +0 -19
  141. package/front_end/emulated_devices/Nexus6P-landscape.svg +0 -50
  142. package/front_end/emulated_devices/Nexus6P-portrait.svg +0 -54
  143. package/front_end/emulated_devices/google-nest-hub-horizontal.png +0 -0
  144. package/front_end/emulated_devices/google-nest-hub-max-horizontal.png +0 -0
  145. package/front_end/emulated_devices/google-nexus-5-horizontal-default-1x.png +0 -0
  146. package/front_end/emulated_devices/google-nexus-5-horizontal-default-2x.png +0 -0
  147. package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-1x.png +0 -0
  148. package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-2x.png +0 -0
  149. package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-1x.png +0 -0
  150. package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-2x.png +0 -0
  151. package/front_end/emulated_devices/google-nexus-5-vertical-default-1x.png +0 -0
  152. package/front_end/emulated_devices/google-nexus-5-vertical-default-2x.png +0 -0
  153. package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-1x.png +0 -0
  154. package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-2x.png +0 -0
  155. package/front_end/emulated_devices/google-nexus-5-vertical-navigation-1x.png +0 -0
  156. package/front_end/emulated_devices/google-nexus-5-vertical-navigation-2x.png +0 -0
  157. package/front_end/emulated_devices/google-nexus-5x-horizontal-default-1x.png +0 -0
  158. package/front_end/emulated_devices/google-nexus-5x-horizontal-default-2x.png +0 -0
  159. package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-1x.png +0 -0
  160. package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-2x.png +0 -0
  161. package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-1x.png +0 -0
  162. package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-2x.png +0 -0
  163. package/front_end/emulated_devices/google-nexus-5x-vertical-default-1x.png +0 -0
  164. package/front_end/emulated_devices/google-nexus-5x-vertical-default-2x.png +0 -0
  165. package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-1x.png +0 -0
  166. package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-2x.png +0 -0
  167. package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-1x.png +0 -0
  168. package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-2x.png +0 -0
  169. package/front_end/emulated_devices/iPad-landscape.svg +0 -73
  170. package/front_end/emulated_devices/iPad-portrait.svg +0 -76
  171. package/front_end/emulated_devices/iPhone5-landscape.svg +0 -99
  172. package/front_end/emulated_devices/iPhone5-portrait.svg +0 -83
  173. package/front_end/emulated_devices/iPhone6-landscape.svg +0 -111
  174. package/front_end/emulated_devices/iPhone6-portrait.svg +0 -116
  175. package/front_end/emulated_devices/iPhone6Plus-landscape.svg +0 -118
  176. package/front_end/emulated_devices/iPhone6Plus-portrait.svg +0 -116
  177. package/front_end/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
  178. package/front_end/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
  179. package/front_end/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
  180. package/front_end/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
  181. package/front_end/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
  182. package/front_end/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
  183. package/front_end/emulated_devices/optimized/README.md +0 -9
  184. package/front_end/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
  185. package/front_end/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
  186. package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
  187. package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
  188. package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
  189. package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
  190. package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
  191. package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
  192. package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
  193. package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
  194. package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
  195. package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
  196. package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
  197. package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
  198. package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
  199. package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
  200. package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
  201. package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
  202. package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
  203. package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
  204. package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
  205. package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
  206. package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
  207. package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
  208. package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
  209. package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
  210. package/front_end/emulated_devices/optimized/iPad-landscape.avif +0 -0
  211. package/front_end/emulated_devices/optimized/iPad-portrait.avif +0 -0
  212. package/front_end/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
  213. package/front_end/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
  214. package/front_end/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
  215. package/front_end/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
  216. package/front_end/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
  217. package/front_end/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
  218. package/front_end/emulated_devices/optimized/optimized_images.gni +0 -53
  219. package/front_end/models/ai_assistance/agents/README.md +0 -136
  220. /package/front_end/{panels/common → ui/components/dialogs}/freDialog.css +0 -0
  221. /package/front_end/{panels/common/common.css → ui/components/dialogs/typeToAllowDialog.css} +0 -0
  222. /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionDisclaimer.css +0 -0
  223. /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionTeaser.css +0 -0
  224. /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationTeaser.css +0 -0
  225. /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationUpgradeDialog.css +0 -0
@@ -14,8 +14,7 @@ import {
14
14
  type AgentOptions,
15
15
  AiAgent,
16
16
  type ContextResponse,
17
- ConversationContext,
18
- type ConversationSuggestions,
17
+ type ConversationContext,
19
18
  type RequestOptions,
20
19
  ResponseType,
21
20
  } from './AiAgent.js';
@@ -68,7 +67,7 @@ function isSamePrimaryPageOrigin(targetManager: SDK.TargetManager.TargetManager,
68
67
  return isSamePageOrigin(primaryPageTarget, context);
69
68
  }
70
69
 
71
- export function isSamePageOrigin(target: SDK.Target.Target|null, context?: ConversationContext<StorageItem>): boolean {
70
+ export function isSamePageOrigin(target: SDK.Target.Target|null, context?: ConversationContext<unknown>): boolean {
72
71
  if (!target || !context) {
73
72
  return false;
74
73
  }
@@ -85,84 +84,6 @@ function resolveTargetOrigins(context?: ConversationContext<StorageItem>, origin
85
84
  return uniqueOrigins.slice(0, MAX_TARGET_ORIGINS);
86
85
  }
87
86
 
88
- export class StorageContext extends ConversationContext<StorageItem> {
89
- #item: StorageItem;
90
-
91
- constructor(item: StorageItem) {
92
- super();
93
- this.#item = item;
94
- }
95
-
96
- override getURL(): string {
97
- return this.#item.primaryTargetOrigin;
98
- }
99
-
100
- override getItem(): StorageItem {
101
- return this.#item;
102
- }
103
-
104
- override getTitle(): string {
105
- if (this.#item instanceof CookieItem) {
106
- if (this.#item.name) {
107
- return `cookie: ${this.#item.name}${this.#item.origin ? ` ${this.#item.origin}` : ''}`;
108
- }
109
- return `cookies${this.#item.isGenericContext ? '' : `: ${this.#item.origin}`}`;
110
- }
111
- if (this.#item instanceof DOMStorageItem) {
112
- if (this.#item.key) {
113
- return `entry: ${this.#item.key}${this.#item.origin ? ` ${this.#item.origin}` : ''}`;
114
- }
115
- const prefix = this.#item.type === 'localStorage' ? 'local storage' : 'session storage';
116
- return `${prefix}${this.#item.isGenericContext ? '' : `: ${this.#item.origin}`}`;
117
- }
118
- return `Storage: ${this.getOrigin()}`;
119
- }
120
-
121
- override async getSuggestions(): Promise<ConversationSuggestions|undefined> {
122
- if (this.#item instanceof CookieItem) {
123
- if (this.#item.name) {
124
- return [
125
- {
126
- title: 'Why is this cookie set?',
127
- jslogContext: 'storage-cookie',
128
- },
129
- {
130
- title: 'Explain the value of this cookie',
131
- jslogContext: 'storage-cookie',
132
- },
133
- ];
134
- }
135
- return [
136
- {
137
- title: 'Explain the cookies set by this page',
138
- jslogContext: 'storage-cookie',
139
- },
140
- ];
141
- }
142
- if (this.#item instanceof DOMStorageItem) {
143
- if (this.#item.key) {
144
- return [
145
- {
146
- title: 'What is the purpose of this storage entry?',
147
- jslogContext: 'storage-domstorage',
148
- },
149
- {
150
- title: 'Explain the value of this storage entry',
151
- jslogContext: 'storage-domstorage',
152
- },
153
- ];
154
- }
155
- return [
156
- {
157
- title: 'Explain these storage items',
158
- jslogContext: 'storage-domstorage',
159
- },
160
- ];
161
- }
162
- return undefined;
163
- }
164
- }
165
-
166
87
  // Maximum character length of values allowed.
167
88
  const MAX_NUM_CHAR_LENGTH = 10000;
168
89
 
@@ -281,7 +202,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
281
202
  },
282
203
 
283
204
  handler: async args => {
284
- this.disableServerSideLogging();
205
+ this.setServerSideLoggingActive(false);
285
206
  if (!isSamePrimaryPageOrigin(this.targetManager, this.context)) {
286
207
  return {error: 'No origin available or not allowed.'};
287
208
  }
@@ -367,7 +288,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
367
288
  },
368
289
 
369
290
  handler: async (args, options) => {
370
- this.disableServerSideLogging();
291
+ this.setServerSideLoggingActive(false);
371
292
  if (!isSamePrimaryPageOrigin(this.targetManager, this.context)) {
372
293
  return {error: 'No origin available or not allowed.'};
373
294
  }
@@ -467,7 +388,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
467
388
  };
468
389
  },
469
390
  handler: async args => {
470
- this.disableServerSideLogging();
391
+ this.setServerSideLoggingActive(false);
471
392
  if (!isSamePrimaryPageOrigin(this.targetManager, this.context)) {
472
393
  return {error: 'No origin available or not allowed.'};
473
394
  }
@@ -527,7 +448,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
527
448
  };
528
449
  },
529
450
  handler: async (args, options) => {
530
- this.disableServerSideLogging();
451
+ this.setServerSideLoggingActive(false);
531
452
  if (!isSamePrimaryPageOrigin(this.targetManager, this.context)) {
532
453
  return {error: 'No origin available or not allowed.'};
533
454
  }
@@ -684,9 +605,9 @@ export class StorageAgent extends AiAgent<StorageItem> {
684
605
  protected override async preRun(): Promise<void> {
685
606
  const item = this.context?.getItem();
686
607
  if (item instanceof CookieItem && Boolean(item.name)) {
687
- this.disableServerSideLogging();
608
+ this.setServerSideLoggingActive(false);
688
609
  } else if (item instanceof DOMStorageItem && Boolean(item.key)) {
689
- this.disableServerSideLogging();
610
+ this.setServerSideLoggingActive(false);
690
611
  }
691
612
  }
692
613
 
@@ -365,7 +365,8 @@ Content:
365
365
  "type": "action",
366
366
  "code": "console.log('hello');",
367
367
  "output": "hello",
368
- "canceled": false
368
+ "canceled": false,
369
+ "toolName": "executeJavaScript"
369
370
  },
370
371
  {
371
372
  "type": "querying"
@@ -22,6 +22,7 @@ import * as DOMNodeContext from './contexts/DOMNodeContext.js';
22
22
  import * as FileContext from './contexts/FileContext.js';
23
23
  import * as PerformanceTraceContext from './contexts/PerformanceTraceContext.js';
24
24
  import * as RequestContext from './contexts/RequestContext.js';
25
+ import * as StorageContext from './contexts/StorageContext.js';
25
26
  import * as ConversationSummary from './ConversationSummary.js';
26
27
  import * as FileFormatter from './data_formatters/FileFormatter.js';
27
28
  import * as LighthouseFormatter from './data_formatters/LighthouseFormatter.js';
@@ -42,10 +43,17 @@ import * as ExecuteJavaScript from './tools/ExecuteJavaScript.js';
42
43
  import * as GetElementAccessibilityDetails from './tools/GetElementAccessibilityDetails.js';
43
44
  import * as GetLighthouseAudits from './tools/GetLighthouseAudits.js';
44
45
  import * as GetNetworkRequestDetails from './tools/GetNetworkRequestDetails.js';
46
+ import * as GetSourceContent from './tools/GetSourceContent.js';
45
47
  import * as GetStyles from './tools/GetStyles.js';
48
+ import * as GetTraceEventByKey from './tools/GetTraceEventByKey.js';
49
+ import * as GetTraceMainThreadSummary from './tools/GetTraceMainThreadSummary.js';
50
+ import * as GetTraceNetworkSummary from './tools/GetTraceNetworkSummary.js';
46
51
  import * as ListNetworkRequests from './tools/ListNetworkRequests.js';
52
+ import * as ListPageOrigins from './tools/ListPageOrigins.js';
53
+ import * as ListSources from './tools/ListSources.js';
47
54
  import * as RecordPerformanceTrace from './tools/RecordPerformanceTrace.js';
48
55
  import * as ResolveDevtoolsNodePath from './tools/ResolveDevtoolsNodePath.js';
56
+ import * as SelectTraceEventByKey from './tools/SelectTraceEventByKey.js';
49
57
  import * as Tool from './tools/Tool.js';
50
58
  import * as ToolRegistry from './tools/ToolRegistry.js';
51
59
 
@@ -77,10 +85,16 @@ export {
77
85
  GetElementAccessibilityDetails,
78
86
  GetLighthouseAudits,
79
87
  GetNetworkRequestDetails,
88
+ GetSourceContent,
80
89
  GetStyles,
90
+ GetTraceEventByKey,
91
+ GetTraceMainThreadSummary,
92
+ GetTraceNetworkSummary,
81
93
  Injected,
82
94
  LighthouseFormatter,
83
95
  ListNetworkRequests,
96
+ ListPageOrigins,
97
+ ListSources,
84
98
  NetworkAgent,
85
99
  NetworkRequestFormatter,
86
100
  PerformanceAgent,
@@ -91,7 +105,9 @@ export {
91
105
  RecordPerformanceTrace,
92
106
  RequestContext,
93
107
  ResolveDevtoolsNodePath,
108
+ SelectTraceEventByKey,
94
109
  StorageAgent,
110
+ StorageContext,
95
111
  StorageItem,
96
112
  StylingAgent,
97
113
  Tool,
@@ -23,6 +23,13 @@ import {PerformanceTraceFormatter} from '../data_formatters/PerformanceTraceForm
23
23
  import type {AICallTree} from '../performance/AICallTree.js';
24
24
  import {AgentFocus} from '../performance/AIContext.js';
25
25
 
26
+ /**
27
+ * Labels used to identify specific periods or categories in the trace for getting main thread summary.
28
+ * Supports hardcoded phases, dynamic navigation IDs (`NAVIGATION_X`), and insight models.
29
+ */
30
+ export type MainThreadSectionLabel = 'nav-to-lcp'|'lcp-ttfb'|'lcp-render-delay'|'trace-bounds'|'NO_NAVIGATION'|
31
+ `NAVIGATION_${string}`|keyof Trace.Insights.Types.InsightModels;
32
+
26
33
  /**
27
34
  * The conversation context for AI queries regarding performance traces.
28
35
  * Encapsulates the user's active trace selection/focus and handles formatting
@@ -339,4 +346,121 @@ export class PerformanceTraceContext extends ConversationContext<AgentFocus> {
339
346
 
340
347
  return details.length > 0 ? (details as [ContextDetail, ...ContextDetail[]]) : null;
341
348
  }
349
+
350
+ getBoundsForLabel(label: MainThreadSectionLabel): Trace.Types.Timing.TraceWindowMicro|null {
351
+ const focus = this.#focus;
352
+ const {parsedTrace} = focus;
353
+ const insightSet = focus.primaryInsightSet;
354
+
355
+ if (label === 'nav-to-lcp') {
356
+ if (insightSet) {
357
+ const lcp = Trace.Insights.Common.getLCP(insightSet);
358
+ if (lcp) {
359
+ return Trace.Helpers.Timing.traceWindowFromMicroSeconds(insightSet.bounds.min,
360
+ lcp.event.ts as Trace.Types.Timing.Micro);
361
+ }
362
+ }
363
+ return null;
364
+ }
365
+
366
+ if (label === 'lcp-ttfb') {
367
+ if (insightSet) {
368
+ const subparts = insightSet.model.LCPBreakdown?.subparts;
369
+ if (subparts?.ttfb) {
370
+ return subparts.ttfb;
371
+ }
372
+ }
373
+ return null;
374
+ }
375
+
376
+ if (label === 'lcp-render-delay') {
377
+ if (insightSet) {
378
+ const subparts = insightSet.model.LCPBreakdown?.subparts;
379
+ if (subparts?.renderDelay) {
380
+ return subparts.renderDelay;
381
+ }
382
+ }
383
+ return null;
384
+ }
385
+
386
+ if (label === 'trace-bounds') {
387
+ return parsedTrace.data.Meta.traceBounds;
388
+ }
389
+
390
+ const insightSetById = parsedTrace.insights?.get(label as Trace.Types.Events.NavigationId);
391
+ if (insightSetById) {
392
+ return insightSetById.bounds;
393
+ }
394
+
395
+ if (insightSet) {
396
+ const model = getInsightModel(insightSet.model, label);
397
+ if (model) {
398
+ return Trace.Insights.Common.insightBounds(model, insightSet.bounds);
399
+ }
400
+ }
401
+
402
+ for (const is of parsedTrace.insights?.values() ?? []) {
403
+ const model = getInsightModel(is.model, label);
404
+ if (model) {
405
+ return Trace.Insights.Common.insightBounds(model, is.bounds);
406
+ }
407
+ }
408
+
409
+ return null;
410
+ }
411
+
412
+ getLabelName(label: MainThreadSectionLabel): string {
413
+ return getLabelName(label, this.#focus.parsedTrace);
414
+ }
415
+
416
+ createBounds(min?: number, max?: number): Trace.Types.Timing.TraceWindowMicro|null {
417
+ const {min: bMin, max: bMax} = this.#focus.parsedTrace.data.Meta.traceBounds;
418
+ const clampedMin = Math.round(Math.max(min ?? bMin, bMin));
419
+ const clampedMax = Math.round(Math.min(max ?? bMax, bMax));
420
+
421
+ if (clampedMin > clampedMax) {
422
+ return null;
423
+ }
424
+
425
+ return Trace.Helpers.Timing.traceWindowFromMicroSeconds(clampedMin as Trace.Types.Timing.Micro,
426
+ clampedMax as Trace.Types.Timing.Micro);
427
+ }
428
+ }
429
+
430
+ const STATIC_LABEL_NAMES: Record<string, string> = {
431
+ 'nav-to-lcp': 'navigation to LCP',
432
+ 'lcp-ttfb': 'LCP to TTFB',
433
+ 'lcp-render-delay': 'LCP render delay',
434
+ 'trace-bounds': 'the entire trace',
435
+ NO_NAVIGATION: 'the period before the first navigation',
436
+ };
437
+
438
+ function getInsightModel(
439
+ model: Trace.Insights.Types.InsightModels,
440
+ key: string,
441
+ ): Trace.Insights.Types.InsightModels[keyof Trace.Insights.Types.InsightModels]|undefined {
442
+ if (Object.prototype.hasOwnProperty.call(model, key)) {
443
+ return model[key as keyof Trace.Insights.Types.InsightModels];
444
+ }
445
+ return undefined;
446
+ }
447
+
448
+ function getLabelName(label: MainThreadSectionLabel, parsedTrace: Trace.TraceModel.ParsedTrace): string {
449
+ if (Object.prototype.hasOwnProperty.call(STATIC_LABEL_NAMES, label)) {
450
+ return STATIC_LABEL_NAMES[label];
451
+ }
452
+
453
+ const insightSetById = parsedTrace.insights?.get(label as Trace.Types.Events.NavigationId);
454
+ if (insightSetById) {
455
+ return `navigation to ${insightSetById.url.href}`;
456
+ }
457
+
458
+ for (const insightSet of parsedTrace.insights?.values() ?? []) {
459
+ const model = getInsightModel(insightSet.model, label);
460
+ if (model) {
461
+ return `${model.title} insight`;
462
+ }
463
+ }
464
+
465
+ return label;
342
466
  }
@@ -0,0 +1,111 @@
1
+ // Copyright 2026 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as Common from '../../../core/common/common.js';
6
+ import type * as SDK from '../../../core/sdk/sdk.js';
7
+ import {
8
+ ConversationContext,
9
+ type ConversationSuggestions,
10
+ } from '../agents/AiAgent.js';
11
+ import {areOriginsEquivalent} from '../AiOrigins.js';
12
+ import {CookieItem, DOMStorageItem, type StorageItem} from '../StorageItem.js';
13
+
14
+ export class StorageContext extends ConversationContext<StorageItem> {
15
+ #item: StorageItem;
16
+
17
+ constructor(item: StorageItem) {
18
+ super();
19
+ this.#item = item;
20
+ }
21
+
22
+ override getURL(): string {
23
+ return this.#item.primaryTargetOrigin;
24
+ }
25
+
26
+ override getItem(): StorageItem {
27
+ return this.#item;
28
+ }
29
+
30
+ override getTitle(): string {
31
+ if (this.#item instanceof CookieItem) {
32
+ if (this.#item.name) {
33
+ return `cookie: ${this.#item.name}${this.#item.origin ? ` ${this.#item.origin}` : ''}`;
34
+ }
35
+ return `cookies${this.#item.isGenericContext ? '' : `: ${this.#item.origin}`}`;
36
+ }
37
+ if (this.#item instanceof DOMStorageItem) {
38
+ if (this.#item.key) {
39
+ return `entry: ${this.#item.key}${this.#item.origin ? ` ${this.#item.origin}` : ''}`;
40
+ }
41
+ const prefix = this.#item.type === 'localStorage' ? 'local storage' : 'session storage';
42
+ return `${prefix}${this.#item.isGenericContext ? '' : `: ${this.#item.origin}`}`;
43
+ }
44
+ return `Storage: ${this.getOrigin()}`;
45
+ }
46
+
47
+ /**
48
+ * @override
49
+ */
50
+ override isLoggingEnabled(): boolean {
51
+ if (this.#item instanceof CookieItem && Boolean(this.#item.name)) {
52
+ return false;
53
+ }
54
+ if (this.#item instanceof DOMStorageItem && Boolean(this.#item.key)) {
55
+ return false;
56
+ }
57
+ return true;
58
+ }
59
+
60
+ override async getSuggestions(): Promise<ConversationSuggestions|undefined> {
61
+ if (this.#item instanceof CookieItem) {
62
+ if (this.#item.name) {
63
+ return [
64
+ {
65
+ title: 'Why is this cookie set?',
66
+ jslogContext: 'storage-cookie',
67
+ },
68
+ {
69
+ title: 'Explain the value of this cookie',
70
+ jslogContext: 'storage-cookie',
71
+ },
72
+ ];
73
+ }
74
+ return [
75
+ {
76
+ title: 'Explain the cookies set by this page',
77
+ jslogContext: 'storage-cookie',
78
+ },
79
+ ];
80
+ }
81
+ if (this.#item instanceof DOMStorageItem) {
82
+ if (this.#item.key) {
83
+ return [
84
+ {
85
+ title: 'What is the purpose of this storage entry?',
86
+ jslogContext: 'storage-domstorage',
87
+ },
88
+ {
89
+ title: 'Explain the value of this storage entry',
90
+ jslogContext: 'storage-domstorage',
91
+ },
92
+ ];
93
+ }
94
+ return [
95
+ {
96
+ title: 'Explain these storage items',
97
+ jslogContext: 'storage-domstorage',
98
+ },
99
+ ];
100
+ }
101
+ return undefined;
102
+ }
103
+ }
104
+
105
+ export function isSamePageOrigin(target: SDK.Target.Target|null, allowedOrigin: string): boolean {
106
+ if (!target) {
107
+ return false;
108
+ }
109
+ const pageOrigin = Common.ParsedURL.ParsedURL.extractOrigin(target.inspectedURL());
110
+ return pageOrigin !== '' && areOriginsEquivalent(pageOrigin, allowedOrigin);
111
+ }
@@ -11,7 +11,7 @@ import type {AICallTree} from '../performance/AICallTree.js';
11
11
  import type {AgentFocus} from '../performance/AIContext.js';
12
12
  import {AIQueries} from '../performance/AIQueries.js';
13
13
 
14
- import {NetworkRequestFormatter} from './NetworkRequestFormatter.js';
14
+ import {NetworkRequestFormatter, sanitizeHeaders} from './NetworkRequestFormatter.js';
15
15
  import {PerformanceInsightFormatter} from './PerformanceInsightFormatter.js';
16
16
  import {bytes, micros, millis} from './UnitFormatters.js';
17
17
 
@@ -1036,3 +1036,71 @@ The order of headers corresponds to an internal fixed list. If a header is not p
1036
1036
  ].join('\n\n');
1037
1037
  }
1038
1038
  }
1039
+
1040
+ /**
1041
+ * Serializes a trace event to a JSON string for AI consumption,
1042
+ * ensuring sensitive data (like headers and raw script source code)
1043
+ * is sanitized or redacted.
1044
+ */
1045
+ export function formatEventForAI(event: Trace.Types.Events.Event): string {
1046
+ if (Trace.Types.Events.isSyntheticNetworkRequest(event)) {
1047
+ return JSON.stringify({
1048
+ ...event,
1049
+ args: {
1050
+ ...event.args,
1051
+ data: {
1052
+ ...event.args.data,
1053
+ responseHeaders: event.args.data.responseHeaders ? sanitizeHeaders(event.args.data.responseHeaders) : null,
1054
+ },
1055
+ },
1056
+ });
1057
+ }
1058
+
1059
+ if (Trace.Types.Events.isResourceReceiveResponse(event)) {
1060
+ return JSON.stringify({
1061
+ ...event,
1062
+ args: {
1063
+ ...event.args,
1064
+ data: {
1065
+ ...event.args.data,
1066
+ headers: event.args.data.headers ? sanitizeHeaders(event.args.data.headers) : undefined,
1067
+ },
1068
+ },
1069
+ });
1070
+ }
1071
+
1072
+ if (Trace.Types.Events.isRundownScriptSource(event)) {
1073
+ // Redact sensitive cross-origin script source text.
1074
+ const safeData: Omit<Trace.Types.Events.RundownScriptSource['args']['data'], 'sourceText'> = {
1075
+ isolate: event.args.data.isolate,
1076
+ scriptId: event.args.data.scriptId,
1077
+ length: event.args.data.length,
1078
+ };
1079
+ return JSON.stringify({
1080
+ ...event,
1081
+ args: {
1082
+ ...event.args,
1083
+ data: safeData,
1084
+ },
1085
+ });
1086
+ }
1087
+
1088
+ if (Trace.Types.Events.isRundownScriptSourceLarge(event)) {
1089
+ // Redact sensitive cross-origin script source text.
1090
+ const safeData: Omit<Trace.Types.Events.RundownScriptSourceLarge['args']['data'], 'sourceText'> = {
1091
+ isolate: event.args.data.isolate,
1092
+ scriptId: event.args.data.scriptId,
1093
+ splitIndex: event.args.data.splitIndex,
1094
+ splitCount: event.args.data.splitCount,
1095
+ };
1096
+ return JSON.stringify({
1097
+ ...event,
1098
+ args: {
1099
+ ...event.args,
1100
+ data: safeData,
1101
+ },
1102
+ });
1103
+ }
1104
+
1105
+ return JSON.stringify(event);
1106
+ }
@@ -10,7 +10,7 @@ Example:
10
10
  ```markdown
11
11
  ---
12
12
  name: styling
13
- allowed-tools: [search_web]
13
+ allowed-tools: [executeJavaScript]
14
14
  ---
15
15
  You are a CSS expert...
16
16
  ```
@@ -38,3 +38,65 @@ To use a skill in TypeScript:
38
38
  2. Register it in `SkillRegistry.ts`.
39
39
 
40
40
  Types are provided globally in `front_end/global_typings/global_defs.d.ts` via a wildcard module declaration (`*.skill.js`). This avoids the need to generate `tsconfig.json` files for the generated skills.
41
+
42
+ ## Building a skill for AIv2
43
+
44
+ _Note: some of this is a bit rough around the edges and subject to change as we build V2 out._
45
+
46
+ If you want to add a new skill to DevTools AI v2 you should:
47
+
48
+ Firstly, consider if we need it or not. Can we test the AI to see how it can handle relevant prompts without a new skill? (We are currently working on eval architecture to make this easier in the future too).
49
+
50
+ Assuming we do want it, then we should create the new skill in `models/ai_assistance/skills/<NAME>.md`.
51
+
52
+ This skill must have YAML frontmatter that defines its name and description, and optionally any tools that it is allowed to call (more on tools below):
53
+
54
+ ```
55
+ ---
56
+ name: performance
57
+ description: Web performance analysis, trace inspection, and trace recording.
58
+ allowed-tools:
59
+ - recordPerformanceTrace
60
+ ---
61
+
62
+ <body of the skill goes here>
63
+ ```
64
+
65
+ The name and description are important. These are given to the AI in its context window so it knows that this tool exists and understands when to use it. You should think carefully about producing a very clear description and ideally evaluate this to check if the AI uses the tool in the right scenarios.
66
+
67
+ To have the skill built as JavaScript and available to the AI:
68
+
69
+ 1. Update `models/ai_assistance/skills/BUILD.gn` to add the new skill file as a source.
70
+ 2. Update `models/ai_assistance/skills/Skill.ts` to add the new skill name to the `SkillName` union type.
71
+ 3. Update `models/ai_assistance/skills/SkillRegistry.ts` to import the generated skill file and register it in the `SKILLS` object.
72
+ 4. Add the generated skill file (`front_end/models/ai_assistance/skills/<NAME>.skill.js`) to the list of release sources in `config/gni/devtools_grd_files.gni`.
73
+
74
+ If your skill does not need to call any tools, then you are done. The AI can now learn your skill and use it.
75
+
76
+ ### Using existing tools
77
+
78
+ If your new skill needs to use tools that are already implemented:
79
+
80
+ 1. **Find the tool name**: Locate the tool's registration name in the `ToolName` enum (e.g., `executeJavaScript`, `listNetworkRequests`, `getStyles`) from `models/ai_assistance/tools/Tool.ts`.
81
+ 2. **Bind the tool to the skill**: Add the tool name to the `allowed-tools` list in your skill's Markdown frontmatter:
82
+ ```yaml
83
+ ---
84
+ name: my-skill
85
+ allowed-tools:
86
+ - executeJavaScript
87
+ ---
88
+ ```
89
+
90
+ By doing this you ensure that if the AI learns you skill, those functions are learned and added to the active conversation for the AI to invoke.
91
+
92
+ Even if other skills list the tool you need, you should list it also. Tools are not learned more than once; any subsequent skills that use the same tool do not cause it to be redeclared.
93
+
94
+ ### Implementing and binding tools
95
+
96
+ If your new skill requires tools that do not exist yet, you should:
97
+
98
+ 1. Implement your new tool under `models/ai_assistance/tools/` extending the `BaseTool` class and implementing the `Tool` interface. Use the existing tools as guidance.
99
+ 2. Register the tool in the build system:
100
+ - Add the tool's source file to the `sources` list in `models/ai_assistance/BUILD.gn`.
101
+ - Import and register it inside `models/ai_assistance/tools/ToolRegistry.ts`.
102
+ 3. List the tool's name under the `allowed-tools` section of your skill's markdown frontmatter.
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  // This will become a union type as we add more skills (e.g. 'styling' | 'network').
6
- export type SkillName = 'styling'|'network'|'accessibility'|'performance';
6
+ export type SkillName = 'styling'|'network'|'accessibility'|'performance'|'storage'|'sources';
7
7
 
8
8
  export interface Skill {
9
9
  name: SkillName;
@@ -6,6 +6,8 @@ import {skill as accessibilitySkill} from './accessibility.skill.js';
6
6
  import {skill as networkSkill} from './network.skill.js';
7
7
  import {skill as performanceSkill} from './performance.skill.js';
8
8
  import type {Skill, SkillName} from './Skill.js';
9
+ import {skill as sourcesSkill} from './sources.skill.js';
10
+ import {skill as storageSkill} from './storage.skill.js';
9
11
  import {skill as stylingSkill} from './styling.skill.js';
10
12
 
11
13
  export const SKILLS: Record<SkillName, Skill> = {
@@ -13,4 +15,6 @@ export const SKILLS: Record<SkillName, Skill> = {
13
15
  network: networkSkill,
14
16
  accessibility: accessibilitySkill,
15
17
  performance: performanceSkill,
18
+ storage: storageSkill,
19
+ sources: sourcesSkill,
16
20
  };
@@ -3,8 +3,16 @@ name: performance
3
3
  description: Web performance analysis, trace inspection, and trace recording.
4
4
  allowed-tools:
5
5
  - recordPerformanceTrace
6
+ - getTraceEventByKey
7
+ - selectTraceEventByKey
8
+ - getTraceMainThreadSummary
9
+ - getTraceNetworkSummary
6
10
  ---
7
11
  You are an expert web performance assistant integrated into Chrome DevTools.
8
12
  Your goal is to help users analyze, measure, and improve web page performance.
9
13
 
10
14
  Use `recordPerformanceTrace` to record a new performance trace when requested by the user or when live measurement is required.
15
+ - Trace events in the provided insights or summaries may have an `eventKey`. Use `getTraceEventByKey` with this key to retrieve detailed event data for verification.
16
+ - If the user asks to see, locate, or show a specific event, use `selectTraceEventByKey` to reveal and select it in the Flamechart.
17
+ - Use `getTraceMainThreadSummary` to get a bottom-up activity summary of the main thread for a specific labeled period.
18
+ - Use `getTraceNetworkSummary` to get a summary of network requests within a specific microsecond time range.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: sources
3
+ description: Analyzing workspace sources, inspecting code files, reading script contents, and viewing files in the workspace.
4
+ allowed-tools:
5
+ - listSources
6
+ - getSourceContent
7
+ ---
8
+ You are the most advanced source code analysis and debugging assistant integrated into Chrome DevTools.
9
+ Provide a comprehensive analysis of source files, focusing on areas crucial for a software engineer. Your analysis should include:
10
+ * Briefly explain the purpose and architecture of the file or script.
11
+ * Analyze code blocks to identify potential bugs, logic issues, or areas for optimization.
12
+ * Walk through execution flow if requested, pointing to key lines or functions.
13
+
14
+ # Considerations
15
+ * Never leak sensitive user data or API keys found in source code files. Redact or generalize them in your analysis.
16
+ * Provide clean code snippets and direct line references where helpful.