chrome-devtools-frontend 1.0.1581449 → 1.0.1582745

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 (95) hide show
  1. package/agents/prompts/merging-devtools-module.md +144 -0
  2. package/agents/prompts/ui-widgets.md +351 -0
  3. package/agents/prompts/verification.md +2 -1
  4. package/docs/contributing/README.md +5 -6
  5. package/docs/contributing/changes.md +1 -2
  6. package/docs/styleguide/ux/README.md +1 -1
  7. package/front_end/core/sdk/OverlayModel.ts +4 -2
  8. package/front_end/core/sdk/RemoteObject.ts +7 -1
  9. package/front_end/core/sdk/StorageKeyManager.ts +6 -1
  10. package/front_end/core/sdk/Target.ts +4 -2
  11. package/front_end/entrypoint_template.html +5 -1
  12. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +31 -40
  13. package/front_end/entrypoints/greendev_floaty/floaty.css +41 -1
  14. package/front_end/entrypoints/greendev_floaty/floaty.html +8 -1
  15. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +5 -5
  16. package/front_end/entrypoints/node_app/app/NodeMain.ts +19 -1
  17. package/front_end/entrypoints/node_app/node_app.ts +34 -0
  18. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  19. package/front_end/generated/SupportedCSSProperties.js +2 -0
  20. package/front_end/generated/protocol.ts +0 -6
  21. package/front_end/models/ai_assistance/AiConversation.ts +10 -0
  22. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -0
  23. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +26 -4
  24. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +85 -7
  25. package/front_end/models/ai_assistance/agents/NetworkAgent.ts +2 -6
  26. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +66 -2
  27. package/front_end/models/computed_style/ComputedStyleModel.ts +26 -0
  28. package/front_end/models/greendev/Prototypes.ts +1 -10
  29. package/front_end/models/issues_manager/ConnectionAllowlistIssue.ts +75 -0
  30. package/front_end/models/issues_manager/CookieIssue.ts +0 -28
  31. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +0 -30
  32. package/front_end/models/issues_manager/IssuesManager.ts +5 -0
  33. package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
  34. package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidHeader.md +12 -0
  35. package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
  36. package/front_end/models/issues_manager/descriptions/connectionAllowlistItemNotInnerList.md +12 -0
  37. package/front_end/models/issues_manager/descriptions/connectionAllowlistMoreThanOneList.md +7 -0
  38. package/front_end/models/issues_manager/descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
  39. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  40. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +93 -6
  41. package/front_end/panels/ai_assistance/components/ChatInput.ts +8 -4
  42. package/front_end/panels/application/ApplicationPanelSidebar.ts +13 -11
  43. package/front_end/panels/application/DOMStorageModel.ts +1 -1
  44. package/front_end/panels/application/ResourcesPanel.ts +10 -5
  45. package/front_end/panels/application/preloading/PreloadingView.ts +8 -1
  46. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +4 -1
  47. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +2 -1
  48. package/front_end/panels/application/preloading/components/PreloadingString.ts +12 -3
  49. package/front_end/panels/application/preloading/helper/PreloadingForward.ts +14 -0
  50. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +37 -3
  51. package/front_end/panels/changes/ChangesSidebar.ts +2 -6
  52. package/front_end/panels/common/AiCodeCompletionTeaser.ts +13 -3
  53. package/front_end/panels/common/aiCodeCompletionTeaser.css +6 -0
  54. package/front_end/panels/console/ConsoleSidebar.ts +3 -11
  55. package/front_end/panels/console_counters/WarningErrorCounter.ts +16 -10
  56. package/front_end/panels/elements/ComputedStyleWidget.ts +55 -37
  57. package/front_end/panels/elements/PlatformFontsWidget.ts +23 -10
  58. package/front_end/panels/greendev/GreenDevPanel.css +42 -1
  59. package/front_end/panels/greendev/GreenDevPanel.ts +30 -1
  60. package/front_end/panels/lighthouse/LighthouseStartView.ts +3 -5
  61. package/front_end/panels/lighthouse/lighthouseStartView.css +6 -0
  62. package/front_end/panels/network/NetworkLogView.ts +6 -6
  63. package/front_end/panels/network/RequestInitiatorView.ts +27 -19
  64. package/front_end/panels/network/RequestTimingView.ts +1 -1
  65. package/front_end/panels/settings/AISettingsTab.ts +1 -5
  66. package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -3
  67. package/front_end/panels/settings/SettingsScreen.ts +0 -51
  68. package/front_end/panels/sources/OutlineQuickOpen.ts +19 -0
  69. package/front_end/panels/timeline/AnimationsTrackAppender.ts +4 -1
  70. package/front_end/panels/timeline/InteractionsTrackAppender.ts +1 -1
  71. package/front_end/panels/timeline/TimelinePanel.ts +25 -0
  72. package/front_end/panels/timeline/TimelineUIUtils.ts +13 -16
  73. package/front_end/third_party/chromium/README.chromium +1 -1
  74. package/front_end/third_party/lighthouse/README.chromium +2 -2
  75. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +145 -144
  76. package/front_end/third_party/lighthouse/report/bundle.js +12 -5
  77. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -2
  78. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -1
  79. package/front_end/ui/legacy/ListControl.ts +28 -1
  80. package/front_end/ui/legacy/Toolbar.ts +4 -4
  81. package/front_end/ui/legacy/Treeoutline.ts +5 -5
  82. package/front_end/ui/legacy/UIUtils.ts +26 -10
  83. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -13
  84. package/front_end/ui/legacy/components/utils/Linkifier.ts +4 -7
  85. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  86. package/inspector_overlay/main.ts +18 -3
  87. package/inspector_overlay/tool_green_dev_anchors.css +54 -0
  88. package/inspector_overlay/tool_green_dev_anchors.ts +164 -0
  89. package/inspector_overlay/tool_persistent.ts +14 -0
  90. package/package.json +1 -1
  91. package/docs/contributing/design.md +0 -166
  92. package/docs/design_guidelines.md +0 -1
  93. package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataHttpNotFound.md +0 -1
  94. package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataInvalidResponse.md +0 -1
  95. package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataNoResponse.md +0 -1
@@ -12,6 +12,7 @@ import '../../entrypoints/main/main-meta.js';
12
12
  import * as Common from '../../core/common/common.js';
13
13
  import * as Host from '../../core/host/host.js';
14
14
  import * as i18n from '../../core/i18n/i18n.js';
15
+ import type * as Platform from '../../core/platform/platform.js';
15
16
  import type * as ExperimentNames from '../../core/root/ExperimentNames.js';
16
17
  import * as Root from '../../core/root/root.js';
17
18
  import * as SDK from '../../core/sdk/sdk.js';
@@ -71,6 +72,15 @@ class GreenDevFloaty {
71
72
  });
72
73
  }
73
74
 
75
+ const learnMoreLink = doc.querySelector('.learn-more-link');
76
+ if (learnMoreLink) {
77
+ learnMoreLink.addEventListener('click', event => {
78
+ event.preventDefault();
79
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
80
+ 'https://developer.chrome.com/docs/devtools/ai-assistance' as Platform.DevToolsPath.UrlString);
81
+ });
82
+ }
83
+
74
84
  const nodeDescriptionElement = doc.querySelector('.green-dev-floaty-dialog-node-description') as HTMLDivElement;
75
85
  nodeDescriptionElement?.addEventListener('mousemove', () => {
76
86
  if (this.#node) {
@@ -81,8 +91,8 @@ class GreenDevFloaty {
81
91
  if (this.#node && this.#backendNodeId) {
82
92
  const msg = JSON.stringify({
83
93
  id: 9999,
84
- method: 'Overlay.setShowGreenDevFloatyAnchor',
85
- params: {greenDevFloatyHighlightConfig: {backendNodeId: this.#backendNodeId}}
94
+ method: 'Overlay.setShowInspectedElementAnchor',
95
+ params: {inspectedElementAnchorConfig: {backendNodeId: this.#backendNodeId}}
86
96
  });
87
97
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.sendMessageToBackend(msg);
88
98
  }
@@ -147,15 +157,8 @@ class GreenDevFloaty {
147
157
  handlePanelRequest = (event: Common.EventTarget.EventTargetEvent<number>): void => {
148
158
  pendingActivationSessionId = event.data;
149
159
  this.#sendActivatePanelMessage(pendingActivationSessionId, 0);
150
-
151
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
152
- if ((window as any).DevToolsAPI?.sendMessageToEmbedder) {
153
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
154
- (window as any).DevToolsAPI.sendMessageToEmbedder('openDevTools', [], () => {});
155
- } else {
156
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
157
- (Host.InspectorFrontendHost.InspectorFrontendHostInstance as any).sendMessageToEmbedder('openDevTools', []);
158
- }
160
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
161
+ 'magic:open-devtools' as Platform.DevToolsPath.UrlString);
159
162
  };
160
163
 
161
164
  readonly #maxActivationRetries = 10;
@@ -183,13 +186,16 @@ class GreenDevFloaty {
183
186
  }
184
187
 
185
188
  handleRestoreEvent(event: Common.EventTarget.EventTargetEvent<number>): void {
189
+ const sessionId = event.data;
186
190
  // Only the main DevTools window (which is NOT a floaty window) should broadcast the restore request.
187
191
  if (!this.#isFloatyWindow) {
188
- const sessionId = event.data;
189
192
  this.#syncChannel.postMessage({type: 'restore-floaty', sessionId});
193
+ } else if (this.#backendNodeId === sessionId) {
194
+ // If a floaty window receives a restore request for its own session,
195
+ // it should bring itself to the front.
196
+ console.error('[GreenDev] Calling bringToFront for session ' + sessionId);
197
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.bringToFront();
190
198
  }
191
- // If a floaty window receives a restore request for its own session,
192
- // it should bring itself to the front. This is handled in #onSyncMessage.
193
199
  }
194
200
 
195
201
  setNode(node: SDK.DOMModel.DOMNode): void {
@@ -228,8 +234,8 @@ class GreenDevFloaty {
228
234
  if (this.#backendNodeId) {
229
235
  const msg = JSON.stringify({
230
236
  id: 9999,
231
- method: 'Overlay.setShowGreenDevFloatyAnchor',
232
- params: {greenDevFloatyHighlightConfig: {backendNodeId: this.#backendNodeId}}
237
+ method: 'Overlay.setShowInspectedElementAnchor',
238
+ params: {inspectedElementAnchorConfig: {backendNodeId: this.#backendNodeId}}
233
239
  });
234
240
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.sendMessageToBackend(msg);
235
241
  }
@@ -248,6 +254,10 @@ class GreenDevFloaty {
248
254
  return messages;
249
255
  }
250
256
 
257
+ #formatError(errorMessage: string): string {
258
+ return `Error: '${errorMessage}' - Protip: to use AI features you need to be signed in.`;
259
+ }
260
+
251
261
  runConversation = async(): Promise<void> => {
252
262
  if (!this.#textField || !this.#node) {
253
263
  return;
@@ -270,7 +280,7 @@ class GreenDevFloaty {
270
280
  nodeDescription: document.querySelector('.green-dev-floaty-dialog-node-description')?.textContent,
271
281
  });
272
282
 
273
- const {content: aiContent} = this.#addMessageInternal('Thinking...', false);
283
+ const aiContent = this.#addMessageInternal('Thinking...', false);
274
284
  this.#syncChannel.postMessage({
275
285
  type: 'new-message',
276
286
  text: 'Thinking...',
@@ -291,9 +301,9 @@ class GreenDevFloaty {
291
301
  {type: 'update-last-message', text: result.text, sessionId: this.#backendNodeId});
292
302
  break;
293
303
  case ResponseType.ERROR:
294
- aiContent.textContent = `Error: ${result.error}`;
304
+ aiContent.textContent = this.#formatError(result.error);
295
305
  this.#syncChannel.postMessage(
296
- {type: 'update-last-message', text: `Error: ${result.error}`, sessionId: this.#backendNodeId});
306
+ {type: 'update-last-message', text: this.#formatError(result.error), sessionId: this.#backendNodeId});
297
307
  break;
298
308
  case ResponseType.SIDE_EFFECT:
299
309
  result.confirm(true);
@@ -310,7 +320,7 @@ class GreenDevFloaty {
310
320
  }
311
321
  };
312
322
 
313
- #addMessageInternal(text: string, isUser: boolean): {content: HTMLDivElement, details?: HTMLDivElement} {
323
+ #addMessageInternal(text: string, isUser: boolean): HTMLDivElement {
314
324
  const messageElement = document.createElement('div');
315
325
  messageElement.className = `message ${isUser ? 'user-message' : 'ai-message'}`;
316
326
 
@@ -319,30 +329,11 @@ class GreenDevFloaty {
319
329
  content.textContent = text;
320
330
  messageElement.appendChild(content);
321
331
 
322
- let details: HTMLDivElement|undefined;
323
- if (!isUser) {
324
- details = document.createElement('div');
325
- details.className = 'message-details';
326
- details.style.display = 'none';
327
- messageElement.appendChild(details);
328
-
329
- const toggle = document.createElement('div');
330
- toggle.className = 'message-details-toggle';
331
- toggle.textContent = 'Show details';
332
- toggle.onclick = () => {
333
- if (details) {
334
- const isHidden = details.style.display === 'none';
335
- details.style.display = isHidden ? 'block' : 'none';
336
- toggle.textContent = isHidden ? 'Hide details' : 'Show details';
337
- }
338
- };
339
- messageElement.appendChild(toggle);
340
- }
341
332
  if (this.#chatContainer) {
342
333
  this.#chatContainer.appendChild(messageElement);
343
334
  this.#chatContainer.scrollTop = this.#chatContainer.scrollHeight;
344
335
  }
345
- return {content, details};
336
+ return content;
346
337
  }
347
338
  }
348
339
 
@@ -251,8 +251,48 @@ html, body {
251
251
  }
252
252
 
253
253
  .green-dev-floaty-disclaimer {
254
- font-size: 13px;
254
+ font-size: 15px;
255
255
  color: #666;
256
256
  text-align: center;
257
257
  margin-top: 8px;
258
+ position: relative; /* For tooltip positioning */
259
+ }
260
+
261
+ .disclaimer-link {
262
+ color: #666; /* Match text color */
263
+ text-decoration: underline;
264
+ cursor: pointer;
265
+ }
266
+
267
+ .disclaimer-tooltip {
268
+ display: none;
269
+ position: absolute;
270
+ bottom: 100%; /* Position above */
271
+ left: 50%;
272
+ transform: translateX(-50%);
273
+ width: 300px;
274
+ padding: 12px;
275
+ background-color: #fff;
276
+ border: 1px solid #ccc;
277
+ border-radius: 8px;
278
+ box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
279
+ z-index: 1000;
280
+ text-align: left;
281
+ font-size: 14px;
282
+ line-height: 1.4;
283
+ color: #333;
284
+ }
285
+
286
+ .disclaimer-link:hover + .disclaimer-tooltip,
287
+ .disclaimer-tooltip:hover {
288
+ display: block;
289
+ }
290
+
291
+ .learn-more-link {
292
+ color: #0b57d0;
293
+ text-decoration: none;
294
+ }
295
+
296
+ .learn-more-link:hover {
297
+ text-decoration: underline;
258
298
  }
@@ -23,7 +23,14 @@
23
23
  <input type="text" class="green-dev-floaty-dialog-text-field" placeholder="Why is this not centered?">
24
24
  <button class="green-dev-floaty-dialog-play-button"></button>
25
25
  </div>
26
- <div class="green-dev-floaty-disclaimer">Relevant data is sent to Google</div>
26
+ <div class="green-dev-floaty-disclaimer">
27
+ <span class="disclaimer-link">Relevant data</span> is sent to Google
28
+ <div class="disclaimer-tooltip">
29
+ Chat messages and any data the inspected page can access via Web APIs are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won't always get it right.
30
+ <br><br>
31
+ <a href="https://developer.chrome.com/docs/devtools/ai-assistance" class="learn-more-link">Learn about AI in DevTools</a>
32
+ </div>
33
+ </div>
27
34
  </div>
28
35
  </div>
29
36
  </div>
@@ -66,8 +66,8 @@ class GreenDevFloaty {
66
66
  // Refresh the anchor by re-sending the show command.
67
67
  const msg = JSON.stringify({
68
68
  id: 9999,
69
- method: 'Overlay.setShowGreenDevFloatyAnchor',
70
- params: {greenDevFloatyHighlightConfig: {backendNodeId: this.#backendNodeId}}
69
+ method: 'Overlay.setShowInspectedElementAnchor',
70
+ params: {inspectedElementAnchorConfig: {backendNodeId: this.#backendNodeId}}
71
71
  });
72
72
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.sendMessageToBackend(msg);
73
73
  }
@@ -186,7 +186,7 @@ class GreenDevFloaty {
186
186
  aiContent.textContent = result.text;
187
187
  break;
188
188
  case ResponseType.ERROR:
189
- aiContent.textContent = `Error: ${result.error}`;
189
+ aiContent.textContent = `Error: '${result.error}' - Protip: to use AI features you need to be signed in.`;
190
190
  break;
191
191
  case ResponseType.THOUGHT:
192
192
  if (aiDetails) {
@@ -403,8 +403,8 @@ async function init(): Promise<void> {
403
403
  if (backendNodeId) {
404
404
  const msg = JSON.stringify({
405
405
  id: 9999,
406
- method: 'Overlay.setShowGreenDevFloatyAnchor',
407
- params: {greenDevFloatyHighlightConfig: {backendNodeId}}
406
+ method: 'Overlay.setShowInspectedElementAnchor',
407
+ params: {inspectedElementAnchorConfig: {backendNodeId}}
408
408
  });
409
409
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.sendMessageToBackend(msg);
410
410
  }
@@ -107,7 +107,7 @@ export class NodeChildTargetManager extends SDK.SDKModel.SDKModel<void> implemen
107
107
  targetDestroyed(_event: Protocol.Target.TargetDestroyedEvent): void {
108
108
  }
109
109
 
110
- attachedToTarget({sessionId, targetInfo}: Protocol.Target.AttachedToTargetEvent): void {
110
+ async attachedToTarget({sessionId, targetInfo}: Protocol.Target.AttachedToTargetEvent): Promise<void> {
111
111
  let target: SDK.Target.Target;
112
112
  if (targetInfo.type === 'node_worker') {
113
113
  target = this.#targetManager.createTarget(
@@ -124,6 +124,24 @@ export class NodeChildTargetManager extends SDK.SDKModel.SDKModel<void> implemen
124
124
  }
125
125
  this.#childTargets.set(sessionId, target);
126
126
  void target.runtimeAgent().invoke_runIfWaitingForDebugger();
127
+ await this.#initializeStorage(target);
128
+ }
129
+
130
+ async #initializeStorage(target: SDK.Target.Target): Promise<void> {
131
+ const storageAgent = target.storageAgent();
132
+ const response = await storageAgent.invoke_getStorageKey({});
133
+
134
+ const storageKey = response.storageKey;
135
+ if (response.getError() || !storageKey) {
136
+ console.error(`Failed to get storage key for target ${target.id()}: ${response.getError()}`);
137
+ return;
138
+ }
139
+
140
+ const storageKeyManager = target.model(SDK.StorageKeyManager.StorageKeyManager);
141
+ if (storageKeyManager) {
142
+ storageKeyManager.setMainStorageKey(storageKey);
143
+ storageKeyManager.updateStorageKeys(new Set([storageKey]));
144
+ }
127
145
  }
128
146
 
129
147
  detachedFromTarget({sessionId}: Protocol.Target.DetachedFromTargetEvent): void {
@@ -9,6 +9,7 @@ import '../../panels/network/network-meta.js';
9
9
  import * as Common from '../../core/common/common.js';
10
10
  import * as i18n from '../../core/i18n/i18n.js';
11
11
  import * as Root from '../../core/root/root.js';
12
+ import type * as Resources from '../../panels/application/application.js';
12
13
  import type * as Sources from '../../panels/sources/sources.js';
13
14
  import * as UI from '../../ui/legacy/legacy.js';
14
15
  import * as Main from '../main/main.js';
@@ -39,6 +40,14 @@ const UIStrings = {
39
40
  * @description Command for showing the 'Node' tool in the Network Navigator View, which is part of the Sources tool
40
41
  */
41
42
  showNode: 'Show Node',
43
+ /**
44
+ * @description Text in Application Panel Sidebar of the Application panel
45
+ */
46
+ application: 'Application',
47
+ /**
48
+ * @description Command for showing the 'Application' tool
49
+ */
50
+ showApplication: 'Show Application',
42
51
  } as const;
43
52
 
44
53
  const str_ = i18n.i18n.registerUIStrings('entrypoints/node_app/node_app.ts', UIStrings);
@@ -78,6 +87,31 @@ UI.ViewManager.registerViewExtension({
78
87
  },
79
88
  });
80
89
 
90
+ let loadedResourcesModule: (typeof Resources|undefined);
91
+
92
+ async function loadResourcesModule(): Promise<typeof Resources> {
93
+ if (!loadedResourcesModule) {
94
+ loadedResourcesModule = await import('../../panels/application/application.js');
95
+ }
96
+ return loadedResourcesModule;
97
+ }
98
+
99
+ UI.ViewManager.registerViewExtension({
100
+ location: UI.ViewManager.ViewLocationValues.PANEL,
101
+ id: 'resources',
102
+ title: i18nLazyString(UIStrings.application),
103
+ commandPrompt: i18nLazyString(UIStrings.showApplication),
104
+ order: 70,
105
+ async loadView() {
106
+ const Resources = await loadResourcesModule();
107
+ return Resources.ResourcesPanel.ResourcesPanel.instance({
108
+ forceNew: true,
109
+ mode: 'node',
110
+ });
111
+ },
112
+ tags: [],
113
+ });
114
+
81
115
  // @ts-expect-error Exposed for legacy layout tests
82
116
  self.runtime = Root.Runtime.Runtime.instance({forceNew: true});
83
117
  Common.Runnable.registerEarlyInitializationRunnable(NodeMainImpl.instance);
@@ -84,7 +84,7 @@ inspectorBackend.registerEnum("Audits.UnencodedDigestError", {MalformedDictionar
84
84
  inspectorBackend.registerEnum("Audits.ConnectionAllowlistError", {InvalidHeader: "InvalidHeader", MoreThanOneList: "MoreThanOneList", ItemNotInnerList: "ItemNotInnerList", InvalidAllowlistItemType: "InvalidAllowlistItemType", ReportingEndpointNotToken: "ReportingEndpointNotToken", InvalidUrlPattern: "InvalidUrlPattern"});
85
85
  inspectorBackend.registerEnum("Audits.GenericIssueErrorType", {FormLabelForNameError: "FormLabelForNameError", FormDuplicateIdForInputError: "FormDuplicateIdForInputError", FormInputWithNoLabelError: "FormInputWithNoLabelError", FormAutocompleteAttributeEmptyError: "FormAutocompleteAttributeEmptyError", FormEmptyIdAndNameAttributesForInputError: "FormEmptyIdAndNameAttributesForInputError", FormAriaLabelledByToNonExistingIdError: "FormAriaLabelledByToNonExistingIdError", FormInputAssignedAutocompleteValueToIdOrNameAttributeError: "FormInputAssignedAutocompleteValueToIdOrNameAttributeError", FormLabelHasNeitherForNorNestedInputError: "FormLabelHasNeitherForNorNestedInputError", FormLabelForMatchesNonExistingIdError: "FormLabelForMatchesNonExistingIdError", FormInputHasWrongButWellIntendedAutocompleteValueError: "FormInputHasWrongButWellIntendedAutocompleteValueError", ResponseWasBlockedByORB: "ResponseWasBlockedByORB", NavigationEntryMarkedSkippable: "NavigationEntryMarkedSkippable", AutofillAndManualTextPolicyControlledFeaturesInfo: "AutofillAndManualTextPolicyControlledFeaturesInfo", AutofillPolicyControlledFeatureInfo: "AutofillPolicyControlledFeatureInfo", ManualTextPolicyControlledFeatureInfo: "ManualTextPolicyControlledFeatureInfo"});
86
86
  inspectorBackend.registerEnum("Audits.ClientHintIssueReason", {MetaTagAllowListInvalidOrigin: "MetaTagAllowListInvalidOrigin", MetaTagModifiedHTML: "MetaTagModifiedHTML"});
87
- inspectorBackend.registerEnum("Audits.FederatedAuthRequestIssueReason", {ShouldEmbargo: "ShouldEmbargo", TooManyRequests: "TooManyRequests", WellKnownHttpNotFound: "WellKnownHttpNotFound", WellKnownNoResponse: "WellKnownNoResponse", WellKnownInvalidResponse: "WellKnownInvalidResponse", WellKnownListEmpty: "WellKnownListEmpty", WellKnownInvalidContentType: "WellKnownInvalidContentType", ConfigNotInWellKnown: "ConfigNotInWellKnown", WellKnownTooBig: "WellKnownTooBig", ConfigHttpNotFound: "ConfigHttpNotFound", ConfigNoResponse: "ConfigNoResponse", ConfigInvalidResponse: "ConfigInvalidResponse", ConfigInvalidContentType: "ConfigInvalidContentType", ClientMetadataHttpNotFound: "ClientMetadataHttpNotFound", ClientMetadataNoResponse: "ClientMetadataNoResponse", ClientMetadataInvalidResponse: "ClientMetadataInvalidResponse", ClientMetadataInvalidContentType: "ClientMetadataInvalidContentType", IdpNotPotentiallyTrustworthy: "IdpNotPotentiallyTrustworthy", DisabledInSettings: "DisabledInSettings", DisabledInFlags: "DisabledInFlags", ErrorFetchingSignin: "ErrorFetchingSignin", InvalidSigninResponse: "InvalidSigninResponse", AccountsHttpNotFound: "AccountsHttpNotFound", AccountsNoResponse: "AccountsNoResponse", AccountsInvalidResponse: "AccountsInvalidResponse", AccountsListEmpty: "AccountsListEmpty", AccountsInvalidContentType: "AccountsInvalidContentType", IdTokenHttpNotFound: "IdTokenHttpNotFound", IdTokenNoResponse: "IdTokenNoResponse", IdTokenInvalidResponse: "IdTokenInvalidResponse", IdTokenIdpErrorResponse: "IdTokenIdpErrorResponse", IdTokenCrossSiteIdpErrorResponse: "IdTokenCrossSiteIdpErrorResponse", IdTokenInvalidRequest: "IdTokenInvalidRequest", IdTokenInvalidContentType: "IdTokenInvalidContentType", ErrorIdToken: "ErrorIdToken", Canceled: "Canceled", RpPageNotVisible: "RpPageNotVisible", SilentMediationFailure: "SilentMediationFailure", ThirdPartyCookiesBlocked: "ThirdPartyCookiesBlocked", NotSignedInWithIdp: "NotSignedInWithIdp", MissingTransientUserActivation: "MissingTransientUserActivation", ReplacedByActiveMode: "ReplacedByActiveMode", InvalidFieldsSpecified: "InvalidFieldsSpecified", RelyingPartyOriginIsOpaque: "RelyingPartyOriginIsOpaque", TypeNotMatching: "TypeNotMatching", UiDismissedNoEmbargo: "UiDismissedNoEmbargo", CorsError: "CorsError", SuppressedBySegmentationPlatform: "SuppressedBySegmentationPlatform"});
87
+ inspectorBackend.registerEnum("Audits.FederatedAuthRequestIssueReason", {ShouldEmbargo: "ShouldEmbargo", TooManyRequests: "TooManyRequests", WellKnownHttpNotFound: "WellKnownHttpNotFound", WellKnownNoResponse: "WellKnownNoResponse", WellKnownInvalidResponse: "WellKnownInvalidResponse", WellKnownListEmpty: "WellKnownListEmpty", WellKnownInvalidContentType: "WellKnownInvalidContentType", ConfigNotInWellKnown: "ConfigNotInWellKnown", WellKnownTooBig: "WellKnownTooBig", ConfigHttpNotFound: "ConfigHttpNotFound", ConfigNoResponse: "ConfigNoResponse", ConfigInvalidResponse: "ConfigInvalidResponse", ConfigInvalidContentType: "ConfigInvalidContentType", IdpNotPotentiallyTrustworthy: "IdpNotPotentiallyTrustworthy", DisabledInSettings: "DisabledInSettings", DisabledInFlags: "DisabledInFlags", ErrorFetchingSignin: "ErrorFetchingSignin", InvalidSigninResponse: "InvalidSigninResponse", AccountsHttpNotFound: "AccountsHttpNotFound", AccountsNoResponse: "AccountsNoResponse", AccountsInvalidResponse: "AccountsInvalidResponse", AccountsListEmpty: "AccountsListEmpty", AccountsInvalidContentType: "AccountsInvalidContentType", IdTokenHttpNotFound: "IdTokenHttpNotFound", IdTokenNoResponse: "IdTokenNoResponse", IdTokenInvalidResponse: "IdTokenInvalidResponse", IdTokenIdpErrorResponse: "IdTokenIdpErrorResponse", IdTokenCrossSiteIdpErrorResponse: "IdTokenCrossSiteIdpErrorResponse", IdTokenInvalidRequest: "IdTokenInvalidRequest", IdTokenInvalidContentType: "IdTokenInvalidContentType", ErrorIdToken: "ErrorIdToken", Canceled: "Canceled", RpPageNotVisible: "RpPageNotVisible", SilentMediationFailure: "SilentMediationFailure", NotSignedInWithIdp: "NotSignedInWithIdp", MissingTransientUserActivation: "MissingTransientUserActivation", ReplacedByActiveMode: "ReplacedByActiveMode", RelyingPartyOriginIsOpaque: "RelyingPartyOriginIsOpaque", TypeNotMatching: "TypeNotMatching", UiDismissedNoEmbargo: "UiDismissedNoEmbargo", CorsError: "CorsError", SuppressedBySegmentationPlatform: "SuppressedBySegmentationPlatform"});
88
88
  inspectorBackend.registerEnum("Audits.FederatedAuthUserInfoRequestIssueReason", {NotSameOrigin: "NotSameOrigin", NotIframe: "NotIframe", NotPotentiallyTrustworthy: "NotPotentiallyTrustworthy", NoAPIPermission: "NoApiPermission", NotSignedInWithIdp: "NotSignedInWithIdp", NoAccountSharingPermission: "NoAccountSharingPermission", InvalidConfigOrWellKnown: "InvalidConfigOrWellKnown", InvalidAccountsResponse: "InvalidAccountsResponse", NoReturningUserFromFetchedAccounts: "NoReturningUserFromFetchedAccounts"});
89
89
  inspectorBackend.registerEnum("Audits.PartitioningBlobURLInfo", {BlockedCrossPartitionFetching: "BlockedCrossPartitionFetching", EnforceNoopenerForNavigation: "EnforceNoopenerForNavigation"});
90
90
  inspectorBackend.registerEnum("Audits.ElementAccessibilityIssueReason", {DisallowedSelectChild: "DisallowedSelectChild", DisallowedOptGroupChild: "DisallowedOptGroupChild", NonPhrasingContentOptionChild: "NonPhrasingContentOptionChild", InteractiveContentOptionChild: "InteractiveContentOptionChild", InteractiveContentLegendChild: "InteractiveContentLegendChild", InteractiveContentSummaryDescendant: "InteractiveContentSummaryDescendant"});
@@ -4552,6 +4552,7 @@ export const generatedProperties = [
4552
4552
  "uppercase",
4553
4553
  "lowercase",
4554
4554
  "full-width",
4555
+ "full-size-kana",
4555
4556
  "none",
4556
4557
  "math-auto"
4557
4558
  ],
@@ -7048,6 +7049,7 @@ export const generatedPropertyValues = {
7048
7049
  "uppercase",
7049
7050
  "lowercase",
7050
7051
  "full-width",
7052
+ "full-size-kana",
7051
7053
  "none",
7052
7054
  "math-auto"
7053
7055
  ]
@@ -1292,10 +1292,6 @@ export namespace Audits {
1292
1292
  ConfigNoResponse = 'ConfigNoResponse',
1293
1293
  ConfigInvalidResponse = 'ConfigInvalidResponse',
1294
1294
  ConfigInvalidContentType = 'ConfigInvalidContentType',
1295
- ClientMetadataHttpNotFound = 'ClientMetadataHttpNotFound',
1296
- ClientMetadataNoResponse = 'ClientMetadataNoResponse',
1297
- ClientMetadataInvalidResponse = 'ClientMetadataInvalidResponse',
1298
- ClientMetadataInvalidContentType = 'ClientMetadataInvalidContentType',
1299
1295
  IdpNotPotentiallyTrustworthy = 'IdpNotPotentiallyTrustworthy',
1300
1296
  DisabledInSettings = 'DisabledInSettings',
1301
1297
  DisabledInFlags = 'DisabledInFlags',
@@ -1317,11 +1313,9 @@ export namespace Audits {
1317
1313
  Canceled = 'Canceled',
1318
1314
  RpPageNotVisible = 'RpPageNotVisible',
1319
1315
  SilentMediationFailure = 'SilentMediationFailure',
1320
- ThirdPartyCookiesBlocked = 'ThirdPartyCookiesBlocked',
1321
1316
  NotSignedInWithIdp = 'NotSignedInWithIdp',
1322
1317
  MissingTransientUserActivation = 'MissingTransientUserActivation',
1323
1318
  ReplacedByActiveMode = 'ReplacedByActiveMode',
1324
- InvalidFieldsSpecified = 'InvalidFieldsSpecified',
1325
1319
  RelyingPartyOriginIsOpaque = 'RelyingPartyOriginIsOpaque',
1326
1320
  TypeNotMatching = 'TypeNotMatching',
1327
1321
  UiDismissedNoEmbargo = 'UiDismissedNoEmbargo',
@@ -55,6 +55,7 @@ export class AiConversation {
55
55
  undefined,
56
56
  undefined,
57
57
  serializedConversation.isExternal,
58
+ undefined,
58
59
  );
59
60
  }
60
61
 
@@ -74,6 +75,9 @@ export class AiConversation {
74
75
 
75
76
  #contexts: Array<ConversationContext<unknown>> = [];
76
77
 
78
+ #performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
79
+ #onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>;
80
+
77
81
  constructor(
78
82
  type: ConversationType,
79
83
  data: ResponseData[] = [],
@@ -82,9 +86,13 @@ export class AiConversation {
82
86
  aidaClient: Host.AidaClient.AidaClient = new Host.AidaClient.AidaClient(),
83
87
  changeManager?: ChangeManager,
84
88
  isExternal = false,
89
+ performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>,
90
+ onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>,
85
91
  ) {
86
92
  this.#changeManager = changeManager;
87
93
  this.#aidaClient = aidaClient;
94
+ this.#performanceRecordAndReload = performanceRecordAndReload;
95
+ this.#onInspectElement = onInspectElement;
88
96
 
89
97
  this.id = id;
90
98
  this.#isReadOnly = isReadOnly;
@@ -278,6 +286,8 @@ export class AiConversation {
278
286
  serverSideLoggingEnabled: isAiAssistanceServerSideLoggingEnabled(),
279
287
  sessionId: this.id,
280
288
  changeManager: this.#changeManager,
289
+ performanceRecordAndReload: this.#performanceRecordAndReload,
290
+ onInspectElement: this.#onInspectElement,
281
291
  };
282
292
  switch (type) {
283
293
  case ConversationType.STYLING: {
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Host from '../../../core/host/host.js';
6
6
  import * as Root from '../../../core/root/root.js';
7
+ import type * as SDK from '../../../core/sdk/sdk.js';
7
8
  import {debugLog, isStructuredLogEnabled} from '../debug.js';
8
9
 
9
10
  export const enum ResponseType {
@@ -133,6 +134,7 @@ export interface AgentOptions {
133
134
  serverSideLoggingEnabled?: boolean;
134
135
  sessionId?: string;
135
136
  confirmSideEffectForTest?: typeof Promise.withResolvers;
137
+ onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>;
136
138
  }
137
139
 
138
140
  export interface ParsedAnswer {
@@ -31,7 +31,7 @@ Content:
31
31
  "function_declarations": [
32
32
  {
33
33
  "name": "listNetworkRequests",
34
- "description": "Gives a list of network requests including URL, status code, and duration in ms",
34
+ "description": "Gives a list of network requests including URL, status code, and duration in ms.",
35
35
  "parameters": {
36
36
  "type": 6,
37
37
  "description": "",
@@ -42,7 +42,7 @@ Content:
42
42
  },
43
43
  {
44
44
  "name": "selectNetworkRequest",
45
- "description": "From the list of selected request select one to debug",
45
+ "description": "Selects a specific network request to further provide information about. Use this when asked about network requests issues.",
46
46
  "parameters": {
47
47
  "type": 6,
48
48
  "description": "",
@@ -72,7 +72,7 @@ Content:
72
72
  },
73
73
  {
74
74
  "name": "selectSourceFile",
75
- "description": "Returns a list of all files in the project.",
75
+ "description": "Selects a source file. Use this when asked about files on the page.",
76
76
  "parameters": {
77
77
  "type": 6,
78
78
  "description": "",
@@ -83,11 +83,33 @@ Content:
83
83
  "properties": {
84
84
  "name": {
85
85
  "type": 1,
86
- "description": "The name of the file",
86
+ "description": "The name of the file you want to select.",
87
87
  "nullable": false
88
88
  }
89
89
  }
90
90
  }
91
+ },
92
+ {
93
+ "name": "performanceRecordAndReload",
94
+ "description": "Records a new performance trace, to help debug performance issue.",
95
+ "parameters": {
96
+ "type": 6,
97
+ "description": "",
98
+ "nullable": true,
99
+ "required": [],
100
+ "properties": {}
101
+ }
102
+ },
103
+ {
104
+ "name": "inspectDom",
105
+ "description": "Prompts user to select a DOM element from the page. Use this when you don't know which element is selected.",
106
+ "parameters": {
107
+ "type": 6,
108
+ "description": "",
109
+ "nullable": true,
110
+ "required": [],
111
+ "properties": {}
112
+ }
91
113
  }
92
114
  ],
93
115
  "options": {},