chrome-devtools-frontend 1.0.1592362 → 1.0.1593959

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 (143) hide show
  1. package/docs/contributing/settings-experiments-features.md +75 -100
  2. package/front_end/Images/src/tab-move.svg +1 -0
  3. package/front_end/application_tokens.css +4 -4
  4. package/front_end/core/host/UserMetrics.ts +1 -2
  5. package/front_end/core/root/ExperimentNames.ts +0 -1
  6. package/front_end/entrypoints/main/MainImpl.ts +0 -6
  7. package/front_end/generated/InspectorBackendCommands.ts +8 -5
  8. package/front_end/generated/SupportedCSSProperties.js +2 -2
  9. package/front_end/generated/protocol-mapping.d.ts +14 -0
  10. package/front_end/generated/protocol-proxy-api.d.ts +10 -0
  11. package/front_end/generated/protocol.ts +106 -0
  12. package/front_end/models/ai_assistance/agents/AiAgent.ts +24 -1
  13. package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +26 -86
  14. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +14 -4
  15. package/front_end/models/ai_assistance/agents/StylingAgent.ts +16 -2
  16. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +1 -0
  17. package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
  18. package/front_end/models/issues_manager/IssuesManager.ts +0 -5
  19. package/front_end/models/issues_manager/issues_manager.ts +0 -4
  20. package/front_end/models/javascript_metadata/NativeFunctions.js +10 -6
  21. package/front_end/models/lighthouse/lighthouse.ts +9 -0
  22. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +5 -3
  23. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +29 -6
  24. package/front_end/panels/ai_assistance/README.md +61 -0
  25. package/front_end/panels/ai_assistance/components/ChatMessage.ts +141 -27
  26. package/front_end/panels/ai_assistance/components/ChatView.ts +5 -1
  27. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +19 -7
  28. package/front_end/panels/ai_assistance/components/chatMessage.css +30 -0
  29. package/front_end/panels/ai_assistance/components/walkthroughView.css +12 -7
  30. package/front_end/panels/animation/AnimationGroupPreviewUI.ts +1 -1
  31. package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +1 -0
  32. package/front_end/panels/application/components/BackForwardCacheView.ts +4 -2
  33. package/front_end/panels/autofill/AutofillView.ts +1 -1
  34. package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +161 -154
  35. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +1 -0
  36. package/front_end/panels/browser_debugger/domBreakpointsSidebarPane.css +58 -36
  37. package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +3 -0
  38. package/front_end/panels/common/AiCodeGenerationTeaser.ts +3 -0
  39. package/front_end/panels/console/ConsoleViewMessage.ts +1 -0
  40. package/front_end/panels/console/consoleView.css +7 -2
  41. package/front_end/panels/elements/ComputedStyleWidget.ts +5 -1
  42. package/front_end/panels/elements/ElementsTreeElement.ts +1 -0
  43. package/front_end/panels/elements/LayoutPane.ts +8 -7
  44. package/front_end/panels/elements/StandaloneStylesContainer.ts +254 -0
  45. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -6
  46. package/front_end/panels/elements/StylesSidebarPane.ts +79 -0
  47. package/front_end/panels/elements/components/ComputedStyleTrace.ts +4 -0
  48. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  49. package/front_end/panels/elements/components/StylePropertyEditor.ts +2 -1
  50. package/front_end/panels/elements/components/computedStyleProperty.css +1 -1
  51. package/front_end/panels/elements/elements.ts +2 -0
  52. package/front_end/panels/emulation/DeviceModeToolbar.ts +181 -66
  53. package/front_end/panels/issues/HiddenIssuesRow.ts +1 -1
  54. package/front_end/panels/issues/IssueKindView.ts +2 -1
  55. package/front_end/panels/issues/IssueView.ts +2 -4
  56. package/front_end/panels/issues/IssuesPane.ts +2 -2
  57. package/front_end/panels/lighthouse/LighthouseController.ts +3 -3
  58. package/front_end/panels/lighthouse/LighthousePanel.ts +9 -5
  59. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +5 -5
  60. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +7 -8
  61. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +4 -3
  62. package/front_end/panels/lighthouse/lighthouse.ts +0 -2
  63. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
  64. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
  65. package/front_end/panels/media/PlayerListView.ts +1 -1
  66. package/front_end/panels/network/NetworkLogViewColumns.ts +2 -1
  67. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
  68. package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
  69. package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
  70. package/front_end/panels/recorder/components/StepEditor.ts +3 -3
  71. package/front_end/panels/settings/KeybindsSettingsTab.ts +2 -1
  72. package/front_end/panels/sources/components/HeadersView.ts +2 -2
  73. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +1 -1
  74. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +1 -1
  75. package/front_end/third_party/chromium/README.chromium +1 -1
  76. package/front_end/third_party/puppeteer/README.chromium +2 -2
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Navigation.d.ts.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Navigation.js +1 -0
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Navigation.js.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +1 -1
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +1 -0
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +6 -6
  95. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Navigation.d.ts.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Navigation.js +1 -0
  97. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Navigation.js.map +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +1 -1
  101. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +1 -0
  104. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  106. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  107. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  110. package/front_end/third_party/puppeteer/package/package.json +4 -4
  111. package/front_end/third_party/puppeteer/package/src/bidi/core/Navigation.ts +1 -0
  112. package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +1 -1
  113. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +1 -1
  114. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +1 -0
  115. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  116. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  117. package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
  118. package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
  119. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +1 -1
  120. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -1
  121. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +1 -1
  122. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +1 -1
  123. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +1 -1
  124. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +2 -2
  125. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +7 -12
  126. package/front_end/ui/components/tree_outline/TreeOutline.ts +6 -2
  127. package/front_end/ui/components/tree_outline/treeOutline.css +5 -0
  128. package/front_end/ui/legacy/ListControl.ts +5 -3
  129. package/front_end/ui/legacy/ListWidget.ts +1 -1
  130. package/front_end/ui/legacy/SoftContextMenu.ts +2 -1
  131. package/front_end/ui/legacy/SuggestBox.ts +4 -0
  132. package/front_end/ui/legacy/TextPrompt.ts +1 -1
  133. package/front_end/ui/legacy/Treeoutline.ts +1 -0
  134. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +4 -2
  135. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
  136. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +31 -0
  137. package/front_end/ui/visual_logging/KnownContextValues.ts +16 -0
  138. package/inspector_overlay/highlight_grid_common.ts +11 -8
  139. package/package.json +1 -1
  140. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +0 -78
  141. package/front_end/models/issues_manager/LowTextContrastIssue.ts +0 -63
  142. package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +0 -91
  143. /package/front_end/{panels → models}/lighthouse/LighthouseReporterTypes.ts +0 -0
@@ -1221,6 +1221,7 @@ export namespace Audits {
1221
1221
  AutofillAndManualTextPolicyControlledFeaturesInfo = 'AutofillAndManualTextPolicyControlledFeaturesInfo',
1222
1222
  AutofillPolicyControlledFeatureInfo = 'AutofillPolicyControlledFeatureInfo',
1223
1223
  ManualTextPolicyControlledFeatureInfo = 'ManualTextPolicyControlledFeatureInfo',
1224
+ FormModelContextParameterMissingTitleAndDescription = 'FormModelContextParameterMissingTitleAndDescription',
1224
1225
  }
1225
1226
 
1226
1227
  /**
@@ -3033,6 +3034,11 @@ export namespace CSS {
3033
3034
  * The array enumerates @starting-style at-rules starting with the innermost one, going outwards.
3034
3035
  */
3035
3036
  startingStyles?: CSSStartingStyle[];
3037
+ /**
3038
+ * @navigation CSS at-rule array.
3039
+ * The array enumerates @navigation at-rules starting with the innermost one, going outwards.
3040
+ */
3041
+ navigations?: CSSNavigation[];
3036
3042
  }
3037
3043
 
3038
3044
  /**
@@ -3047,6 +3053,7 @@ export namespace CSS {
3047
3053
  ScopeRule = 'ScopeRule',
3048
3054
  StyleRule = 'StyleRule',
3049
3055
  StartingStyleRule = 'StartingStyleRule',
3056
+ NavigationRule = 'NavigationRule',
3050
3057
  }
3051
3058
 
3052
3059
  /**
@@ -3342,6 +3349,29 @@ export namespace CSS {
3342
3349
  styleSheetId?: DOM.StyleSheetId;
3343
3350
  }
3344
3351
 
3352
+ /**
3353
+ * CSS Navigation at-rule descriptor.
3354
+ */
3355
+ export interface CSSNavigation {
3356
+ /**
3357
+ * Navigation rule text.
3358
+ */
3359
+ text: string;
3360
+ /**
3361
+ * Whether the navigation condition is satisfied.
3362
+ */
3363
+ active?: boolean;
3364
+ /**
3365
+ * The associated rule header range in the enclosing stylesheet (if
3366
+ * available).
3367
+ */
3368
+ range?: SourceRange;
3369
+ /**
3370
+ * Identifier of the stylesheet containing this object (if exists).
3371
+ */
3372
+ styleSheetId?: DOM.StyleSheetId;
3373
+ }
3374
+
3345
3375
  /**
3346
3376
  * CSS Scope at-rule descriptor.
3347
3377
  */
@@ -3676,6 +3706,10 @@ export namespace CSS {
3676
3706
  * @supports CSS at-rule condition. Only one type of condition should be set.
3677
3707
  */
3678
3708
  supports?: CSSSupports;
3709
+ /**
3710
+ * @navigation condition. Only one type of condition should be set.
3711
+ */
3712
+ navigation?: CSSNavigation;
3679
3713
  /**
3680
3714
  * Block body.
3681
3715
  */
@@ -4165,6 +4199,19 @@ export namespace CSS {
4165
4199
  supports: CSSSupports;
4166
4200
  }
4167
4201
 
4202
+ export interface SetNavigationTextRequest {
4203
+ styleSheetId: DOM.StyleSheetId;
4204
+ range: SourceRange;
4205
+ text: string;
4206
+ }
4207
+
4208
+ export interface SetNavigationTextResponse extends ProtocolResponseWithError {
4209
+ /**
4210
+ * The resulting CSS Navigation rule after modification.
4211
+ */
4212
+ navigation: CSSNavigation;
4213
+ }
4214
+
4168
4215
  export interface SetScopeTextRequest {
4169
4216
  styleSheetId: DOM.StyleSheetId;
4170
4217
  range: SourceRange;
@@ -7205,6 +7252,14 @@ export namespace Emulation {
7205
7252
  * Scrollbar type. Default: `default`.
7206
7253
  */
7207
7254
  scrollbarType?: SetDeviceMetricsOverrideRequestScrollbarType;
7255
+ /**
7256
+ * If set to true, enables screen orientation lock emulation, which
7257
+ * intercepts screen.orientation.lock() calls from the page and reports
7258
+ * orientation changes via screenOrientationLockChanged events. This is
7259
+ * useful for emulating mobile device orientation lock behavior in
7260
+ * responsive design mode.
7261
+ */
7262
+ screenOrientationLockEmulation?: boolean;
7208
7263
  }
7209
7264
 
7210
7265
  export interface SetDevicePostureOverrideRequest {
@@ -7547,6 +7602,57 @@ export namespace Emulation {
7547
7602
  screenInfo: ScreenInfo;
7548
7603
  }
7549
7604
 
7605
+ export interface UpdateScreenRequest {
7606
+ /**
7607
+ * Target screen identifier.
7608
+ */
7609
+ screenId: ScreenId;
7610
+ /**
7611
+ * Offset of the left edge of the screen in pixels.
7612
+ */
7613
+ left?: integer;
7614
+ /**
7615
+ * Offset of the top edge of the screen in pixels.
7616
+ */
7617
+ top?: integer;
7618
+ /**
7619
+ * The width of the screen in pixels.
7620
+ */
7621
+ width?: integer;
7622
+ /**
7623
+ * The height of the screen in pixels.
7624
+ */
7625
+ height?: integer;
7626
+ /**
7627
+ * Specifies the screen's work area.
7628
+ */
7629
+ workAreaInsets?: WorkAreaInsets;
7630
+ /**
7631
+ * Specifies the screen's device pixel ratio.
7632
+ */
7633
+ devicePixelRatio?: number;
7634
+ /**
7635
+ * Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270.
7636
+ */
7637
+ rotation?: integer;
7638
+ /**
7639
+ * Specifies the screen's color depth in bits.
7640
+ */
7641
+ colorDepth?: integer;
7642
+ /**
7643
+ * Specifies the descriptive label for the screen.
7644
+ */
7645
+ label?: string;
7646
+ /**
7647
+ * Indicates whether the screen is internal to the device or external, attached to the device. Default is false.
7648
+ */
7649
+ isInternal?: boolean;
7650
+ }
7651
+
7652
+ export interface UpdateScreenResponse extends ProtocolResponseWithError {
7653
+ screenInfo: ScreenInfo;
7654
+ }
7655
+
7550
7656
  export interface RemoveScreenRequest {
7551
7657
  screenId: ScreenId;
7552
7658
  }
@@ -5,6 +5,7 @@
5
5
  import * as Host from '../../../core/host/host.js';
6
6
  import * as Root from '../../../core/root/root.js';
7
7
  import type * as SDK from '../../../core/sdk/sdk.js';
8
+ import type * as Protocol from '../../../generated/protocol.js';
8
9
  import * as Greendev from '../../greendev/greendev.js';
9
10
  import {debugLog, isStructuredLogEnabled} from '../debug.js';
10
11
 
@@ -84,6 +85,7 @@ export interface ThoughtResponse {
84
85
 
85
86
  export interface SideEffectResponse {
86
87
  type: ResponseType.SIDE_EFFECT;
88
+ description: string|null;
87
89
  code?: string;
88
90
  confirm: (confirm: boolean) => void;
89
91
  }
@@ -105,6 +107,7 @@ export interface ActionResponse {
105
107
  code?: string;
106
108
  output?: string;
107
109
  canceled: boolean;
110
+ widgets?: AiWidget[];
108
111
  }
109
112
 
110
113
  export interface QueryingResponse {
@@ -215,10 +218,29 @@ export abstract class ConversationContext<T> {
215
218
  }
216
219
  }
217
220
 
221
+ export interface ComputedStyleAiWidget {
222
+ name: 'COMPUTED_STYLES';
223
+ data: {
224
+ computedStyles: Map<string, string>,
225
+ backendNodeId: Protocol.DOM.BackendNodeId,
226
+ matchedCascade: SDK.CSSMatchedStyles.CSSMatchedStyles,
227
+ // The subset of CSS properties that the AI looked up.
228
+ properties: string[],
229
+ };
230
+ }
231
+ // This type will grow as we add more widgets.
232
+ export type AiWidget = ComputedStyleAiWidget;
233
+
218
234
  export type FunctionCallHandlerResult<Result> = {
219
235
  requiresApproval: true,
236
+ /**
237
+ * Provides extra description of what the required
238
+ * approval is requesting.
239
+ */
240
+ description: string|null,
220
241
  }|{
221
242
  result: Result,
243
+ widgets?: AiWidget[],
222
244
  }|{
223
245
  context: ConversationContext<unknown>,
224
246
  description: string,
@@ -259,7 +281,6 @@ export interface FunctionDeclaration<Args extends Record<string, unknown>, Retur
259
281
  /**
260
282
  * Function implementation that the LLM will try to execute,
261
283
  */
262
-
263
284
  handler(args: Args, options?: FunctionHandlerOptions): Promise<FunctionCallHandlerResult<ReturnType>>;
264
285
  }
265
286
 
@@ -738,6 +759,7 @@ export abstract class AiAgent<T> {
738
759
  yield {
739
760
  type: ResponseType.SIDE_EFFECT,
740
761
  confirm: sideEffectConfirmationPromiseWithResolvers.resolve,
762
+ description: result.description,
741
763
  };
742
764
 
743
765
  const approvedRun = await sideEffectConfirmationPromiseWithResolvers.promise;
@@ -764,6 +786,7 @@ export abstract class AiAgent<T> {
764
786
  type: ResponseType.ACTION,
765
787
  code,
766
788
  output: typeof result.result === 'string' ? result.result : JSON.stringify(result.result),
789
+ widgets: result.widgets,
767
790
  canceled: false,
768
791
  };
769
792
  }
@@ -4,6 +4,7 @@
4
4
 
5
5
  import type * as Common from '../../../core/common/common.js';
6
6
  import * as Host from '../../../core/host/host.js';
7
+ import * as i18n from '../../../core/i18n/i18n.js';
7
8
  import type * as Platform from '../../../core/platform/platform.js';
8
9
  import * as SDK from '../../../core/sdk/sdk.js';
9
10
  import * as Bindings from '../../bindings/bindings.js';
@@ -31,6 +32,8 @@ import {
31
32
  removeOverlay,
32
33
  } from './BreakpointDebuggerAgentOverlay.js';
33
34
 
35
+ const lockedString = i18n.i18n.lockedString;
36
+
34
37
  // This is a temporary agent for a GreenDev prototype.
35
38
  // The preamble is not on the server and you should not build on top of this.
36
39
  const preamble = `You are an expert Root Cause Analysis (RCA) specialist.
@@ -52,17 +55,18 @@ You have two modes of operation that you can switch between and control:
52
55
  6. **Step**: Use 'stepInto' to investigate function calls on the current line. Use 'stepOut' to return to the caller. Use 'stepOver' to move to the next line.
53
56
  7. **Trace Back**: If the current function isn't the root cause, use 'getCallStack' to find the caller, and repeat the analysis there.
54
57
  8. **Root Cause**: Explain exactly how the runtime state contradicts the expected logic and point to the specific line of code that is the root cause.
55
- 9. **Test Fix**: Use the 'testFixInConsole' tool to run a JavaScript snippet in the current execution context to test your fix before making permanent changes. This will overwrite the problematic function or state. Follow the instructions to get the user's approval.
56
- 10. **Verify**: IMMEDIATELY AFTER 'testFixInConsole' succeeds, you MUST call 'waitForUserActionToTriggerBreakpoint' (to pause and inspect) or 'resume' (if no inspection is needed), AND ask the user to trigger the buggy action again to verify the fix.
57
- 11. **Patch**: Once the fix is successfully verified by the user, you MUST use the 'suggestFix' tool to apply the patch to the source code file. Provide the URL, the exact original code to change, and the new code. Finish the execution then.
58
+ 9. **Apply Fix**: Use the 'testFixInConsole' tool to overwrite the problematic code in the current session.
59
+ 10. **Verify**: The fix is applied but NOT verified. You MUST run the code again to verify the fix worked.
60
+ 11. **Finish**: If the fix worked, you may output the solution and finish the execution.
58
61
 
59
62
  **Rules**:
60
- - **NEVER FINISH** execution until you have found the root cause or answer.
63
+ - **NEVER FINISH** execution until you have found the root cause and verified the fix.
61
64
  - **ACTION OVER TALK**: If you need the user to trigger a breakpoint, do NOT just ask them in text. You **MUST** call 'waitForUserActionToTriggerBreakpoint'. This tool will block and wait for the user to act.
62
65
  - **STATIC MODE**: If you are in STATIC MODE and need to see variables: 1. 'setBreakpoint', 2. 'waitForUserActionToTriggerBreakpoint'. **DO NOT STOP** to ask the user. Investigate code and set breakpoints to find the root cause.
63
66
  - **ALREADY PAUSED?**: If 'setBreakpoint' warns you that you are already paused, **DO NOT** call 'waitForUserActionToTriggerBreakpoint'. Start inspecting immediately. You can set more breakpoints while paused, but to call 'waitForUserActionToTriggerBreakpoint' again you MUST be in static state.
64
67
  - **USE TOOLS EXCESSIVELY**: checking one thing is often not enough. Check everything you can thinks of.
65
68
  - **CHECK LOCATION**: If you are not sure where you are, call 'getExecutionLocation' after 'waitForUserActionToTriggerBreakpoint' or any step command to confirm where you are.
69
+ - **INITIAL CONTEXT**: The breakpoint provided in the context is ALREADY SET. Do NOT set it again. Start by setting additional breakpoints if needed, or, if no additional breakpoints within the code you see make sense, call 'waitForUserActionToTriggerBreakpoint'.
66
70
 
67
71
  **Execution Control when you are currently on a breakpoint**:
68
72
  - **stepInto**: ESSENTIAL for entering function calls on the current line. Use this heavily when you suspect the issue is inside a called function.
@@ -121,8 +125,10 @@ export class BreakpointDebuggerAgent extends AiAgent<Workspace.UISourceCode.UILo
121
125
  required: ['url', 'lineNumber'],
122
126
  },
123
127
  displayInfoFromArgs: (args: {url: string, lineNumber: number}) => {
128
+ const uiSourceCode = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(
129
+ args.url as Platform.DevToolsPath.UrlString);
124
130
  return {
125
- title: `Reading function source for ${args.url}:${args.lineNumber}`,
131
+ title: `Reading function source for ${uiSourceCode?.displayName()}:${args.lineNumber}`,
126
132
  };
127
133
  },
128
134
  handler: async (args: {url: string, lineNumber: number}) => {
@@ -155,8 +161,10 @@ export class BreakpointDebuggerAgent extends AiAgent<Workspace.UISourceCode.UILo
155
161
  required: ['url', 'lineNumber', 'direction'],
156
162
  },
157
163
  displayInfoFromArgs: (args: {url: string, lineNumber: number, direction: 'before'|'after'}) => {
164
+ const uiSourceCode = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(
165
+ args.url as Platform.DevToolsPath.UrlString);
158
166
  return {
159
- title: `Reading code ${args.direction} ${args.url}:${args.lineNumber}`,
167
+ title: `Reading code ${args.direction} ${uiSourceCode?.displayName()}:${args.lineNumber}`,
160
168
  };
161
169
  },
162
170
  handler: async (args: {url: string, lineNumber: number, direction: 'before'|'after'}) => {
@@ -240,8 +248,10 @@ export class BreakpointDebuggerAgent extends AiAgent<Workspace.UISourceCode.UILo
240
248
  required: ['url', 'lineNumber'],
241
249
  },
242
250
  displayInfoFromArgs: (args: {url: string, lineNumber: number}) => {
251
+ const uiSourceCode = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(
252
+ args.url as Platform.DevToolsPath.UrlString);
243
253
  return {
244
- title: `Setting breakpoint at ${args.url}:${args.lineNumber}`,
254
+ title: `Setting breakpoint at ${uiSourceCode?.displayName() ?? args.url}:${args.lineNumber}`,
245
255
  };
246
256
  },
247
257
  handler: async (args: {url: string, lineNumber: number}) => {
@@ -269,8 +279,10 @@ export class BreakpointDebuggerAgent extends AiAgent<Workspace.UISourceCode.UILo
269
279
  required: ['url', 'lineNumber'],
270
280
  },
271
281
  displayInfoFromArgs: (args: {url: string, lineNumber: number}) => {
282
+ const uiSourceCode = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(
283
+ args.url as Platform.DevToolsPath.UrlString);
272
284
  return {
273
- title: `Removing breakpoint at ${args.url}:${args.lineNumber}`,
285
+ title: `Removing breakpoint at ${uiSourceCode?.displayName() ?? args.url}:${args.lineNumber}`,
274
286
  };
275
287
  },
276
288
  handler: async (args: {url: string, lineNumber: number}) => {
@@ -429,7 +441,7 @@ export class BreakpointDebuggerAgent extends AiAgent<Workspace.UISourceCode.UILo
429
441
 
430
442
  this.declareFunction('testFixInConsole', {
431
443
  description:
432
- 'Tests a JavaScript code snippet in the current execution context to overwrite the problematic code or state. Use this to verify the fix works before patching the source file.',
444
+ 'Tests a JavaScript code snippet in the current execution context to overwrite the problematic code or state. After running this, verify the fix worked.',
433
445
  parameters: {
434
446
  type: Host.AidaClient.ParametersTypes.OBJECT,
435
447
  description: 'Provide the code to evaluate to test the fix',
@@ -458,7 +470,10 @@ export class BreakpointDebuggerAgent extends AiAgent<Workspace.UISourceCode.UILo
458
470
  return {error: 'Fix rejected by the user.'};
459
471
  }
460
472
  if (!options?.approved) {
461
- return {requiresApproval: true};
473
+ return {
474
+ requiresApproval: true,
475
+ description: lockedString('This code may modify page content. Continue?'),
476
+ };
462
477
  }
463
478
 
464
479
  const targetManager = SDK.TargetManager.TargetManager.instance();
@@ -498,86 +513,11 @@ export class BreakpointDebuggerAgent extends AiAgent<Workspace.UISourceCode.UILo
498
513
  return {
499
514
  result: {
500
515
  status:
501
- 'Code evaluated successfully. You MUST now call waitForUserActionToTriggerBreakpoint or resume, and ask the user to trigger the action again to verify the fix.'
516
+ 'Code evaluated successfully. Fix applied. PROCEED TO VERIFICATION: Call "resume" and ask the user to "run the code again" to verify.'
502
517
  }
503
518
  };
504
519
  },
505
520
  });
506
-
507
- this.declareFunction('suggestFix', {
508
- description:
509
- 'Suggests a JavaScript code snippet to fix the root cause of the issue and applies it to the source code file if the user approves. Call this function AFTER you have verified the fix works using testFixInConsole.',
510
- parameters: {
511
- type: Host.AidaClient.ParametersTypes.OBJECT,
512
- description: 'Provide the fix to the user',
513
- properties: {
514
- url: {
515
- type: Host.AidaClient.ParametersTypes.STRING,
516
- description: 'The URL of the file to fix.',
517
- },
518
- originalCode: {
519
- type: Host.AidaClient.ParametersTypes.STRING,
520
- description:
521
- 'The exact original code to replace. Must match the file content exactly, including whitespace.',
522
- },
523
- suggestion: {
524
- type: Host.AidaClient.ParametersTypes.STRING,
525
- description: 'The new JavaScript code to replace the original code with.',
526
- },
527
- explanation: {
528
- type: Host.AidaClient.ParametersTypes.STRING,
529
- description: 'Explanation for why this code fixes the issue.',
530
- },
531
- },
532
- required: ['url', 'originalCode', 'suggestion', 'explanation'],
533
- },
534
- displayInfoFromArgs: (args: {suggestion: string, explanation: string}) => {
535
- return {
536
- title: 'Suggesting a fix',
537
- thought: args.explanation,
538
- action: args.suggestion,
539
- };
540
- },
541
- handler: async (
542
- args: {url: string, originalCode: string, suggestion: string, explanation: string},
543
- options?: FunctionHandlerOptions) => {
544
- debugLog('suggestFix requested', args);
545
- if (options?.approved === false) {
546
- return {error: 'Fix rejected by the user.'};
547
- }
548
- if (!options?.approved) {
549
- return {requiresApproval: true};
550
- }
551
-
552
- const uiSourceCode = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(
553
- args.url as Platform.DevToolsPath.UrlString);
554
- if (!uiSourceCode) {
555
- return {error: `File not found: ${args.url}`};
556
- }
557
-
558
- const contentData = await uiSourceCode.requestContentData();
559
- if ('error' in contentData || !contentData.isTextContent) {
560
- return {error: `Could not read content for file: ${args.url}`};
561
- }
562
-
563
- let currentContent = uiSourceCode.workingCopy();
564
- if (!uiSourceCode.isDirty()) {
565
- currentContent = contentData.text;
566
- }
567
-
568
- if (!currentContent.includes(args.originalCode)) {
569
- return {
570
- error: 'originalCode not found in the file. Ensure the originalCode is an exact match including whitespace.'
571
- };
572
- }
573
-
574
- const newContent = currentContent.replace(args.originalCode, args.suggestion);
575
- uiSourceCode.setWorkingCopy(newContent);
576
- uiSourceCode.commitWorkingCopy();
577
-
578
- return {result: {status: 'Fix applied to the source file successfully.'}};
579
- },
580
- });
581
521
  }
582
522
 
583
523
  async #getFunctionSource(args: {url: string, lineNumber: number}):
@@ -123,6 +123,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
123
123
  url: request.url(),
124
124
  statusCode: request.statusCode,
125
125
  duration: i18n.TimeUtilities.secondsToString(request.duration),
126
+ transferSize: i18n.ByteUtilities.formatBytesToKb(request.transferSize),
126
127
  });
127
128
  }
128
129
 
@@ -290,14 +291,23 @@ export class ContextSelectionAgent extends AiAgent<never> {
290
291
  },
291
292
  displayInfoFromArgs: () => {
292
293
  return {
293
- title: lockedString('Please select an element on the page'),
294
- action: 'selectElement()',
294
+ title: lockedString('Select an element on the page or in the Elements panel'),
295
295
  };
296
296
  },
297
- handler: async () => {
297
+ handler: async (_params, options) => {
298
298
  if (!this.#onInspectElement) {
299
- return {error: 'The inspect element action is not available.'};
299
+ return {
300
+ error: 'The inspect element action is not available.',
301
+ };
302
+ }
303
+
304
+ if (!options?.approved) {
305
+ return {
306
+ requiresApproval: true,
307
+ description: null,
308
+ };
300
309
  }
310
+
301
311
  const node = await this.#onInspectElement();
302
312
  if (node) {
303
313
  return {
@@ -18,6 +18,7 @@ import {FREESTYLER_WORLD_NAME} from '../injected.js';
18
18
  import {
19
19
  type AgentOptions as BaseAgentOptions,
20
20
  AiAgent,
21
+ type ComputedStyleAiWidget,
21
22
  type ContextResponse,
22
23
  ConversationContext,
23
24
  type ConversationSuggestions,
@@ -325,7 +326,7 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
325
326
  };
326
327
  },
327
328
  handler: async params => {
328
- return await this.getStyles(params.elements, params.styleProperties);
329
+ return await this.#getStyles(params.elements, params.styleProperties);
329
330
  },
330
331
  });
331
332
 
@@ -606,7 +607,9 @@ const data = {
606
607
  return this.context?.getItem() ?? null;
607
608
  }
608
609
 
609
- async getStyles(elements: number[], properties: string[]): Promise<FunctionCallHandlerResult<unknown>> {
610
+ async #getStyles(elements: number[], properties: string[]): Promise<FunctionCallHandlerResult<unknown>> {
611
+ const widgets: ComputedStyleAiWidget[] = [];
612
+
610
613
  const result:
611
614
  Record<string, {computed: Record<string, string|undefined>, authored: Record<string, string|undefined>}> = {};
612
615
  for (const uid of elements) {
@@ -630,6 +633,15 @@ const data = {
630
633
  if (!matchedStyles) {
631
634
  return {error: 'Error: Could not get authored styles.'};
632
635
  }
636
+ widgets.push({
637
+ name: 'COMPUTED_STYLES',
638
+ data: {
639
+ computedStyles: styles,
640
+ backendNodeId: node.backendNodeId(),
641
+ matchedCascade: matchedStyles,
642
+ properties,
643
+ }
644
+ });
633
645
  for (const prop of properties) {
634
646
  result[uid].computed[prop] = styles.get(prop);
635
647
  }
@@ -647,6 +659,7 @@ const data = {
647
659
  }
648
660
  return {
649
661
  result: JSON.stringify(result, null, 2),
662
+ widgets,
650
663
  };
651
664
  }
652
665
 
@@ -701,6 +714,7 @@ const data = {
701
714
 
702
715
  return {
703
716
  requiresApproval: true,
717
+ description: lockedString('This code may modify page content. Continue?'),
704
718
  };
705
719
  }
706
720
  if (result.canceled) {
@@ -363,4 +363,5 @@ export class AiCodeCompletion {
363
363
  export const enum ContextFlavor {
364
364
  CONSOLE = 'console', // generated code can contain console specific APIs like `$0`.
365
365
  SOURCES = 'sources',
366
+ STYLES = 'styles',
366
367
  }
@@ -17,7 +17,6 @@ import {HeavyAdIssue} from './HeavyAdIssue.js';
17
17
  import {Issue, IssueCategory, IssueKind, unionIssueKind} from './Issue.js';
18
18
  import type {EventTypes as IssuesManagerEventsTypes, IssueAddedEvent} from './IssuesManager.js';
19
19
  import {Events as IssuesManagerEvents} from './IssuesManagerEvents.js';
20
- import {LowTextContrastIssue} from './LowTextContrastIssue.js';
21
20
  import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
22
21
  import {MixedContentIssue} from './MixedContentIssue.js';
23
22
  import {PartitioningBlobURLIssue} from './PartitioningBlobURLIssue.js';
@@ -64,7 +63,6 @@ export class AggregatedIssue extends Issue {
64
63
  #cspIssues = new Set<ContentSecurityPolicyIssue>();
65
64
  #deprecationIssues = new Set<DeprecationIssue>();
66
65
  #issueKind = IssueKind.IMPROVEMENT;
67
- #lowContrastIssues = new Set<LowTextContrastIssue>();
68
66
  #cookieDeprecationMetadataIssues = new Set<CookieDeprecationMetadataIssue>();
69
67
  #mixedContentIssues = new Set<MixedContentIssue>();
70
68
  #partitioningBlobURLIssues = new Set<PartitioningBlobURLIssue>();
@@ -142,10 +140,6 @@ export class AggregatedIssue extends Issue {
142
140
  return this.#deprecationIssues;
143
141
  }
144
142
 
145
- getLowContrastIssues(): Iterable<LowTextContrastIssue> {
146
- return this.#lowContrastIssues;
147
- }
148
-
149
143
  override requests(): Iterable<Protocol.Audits.AffectedRequest> {
150
144
  return this.#affectedRequests.values();
151
145
  }
@@ -267,9 +261,6 @@ export class AggregatedIssue extends Issue {
267
261
  if (issue instanceof SharedArrayBufferIssue) {
268
262
  this.#sharedArrayBufferIssues.add(issue);
269
263
  }
270
- if (issue instanceof LowTextContrastIssue) {
271
- this.#lowContrastIssues.add(issue);
272
- }
273
264
  if (issue instanceof CorsIssue) {
274
265
  this.#corsIssues.add(issue);
275
266
  }
@@ -22,7 +22,6 @@ import {GenericIssue} from './GenericIssue.js';
22
22
  import {HeavyAdIssue} from './HeavyAdIssue.js';
23
23
  import type {Issue, IssueKind} from './Issue.js';
24
24
  import {Events} from './IssuesManagerEvents.js';
25
- import {LowTextContrastIssue} from './LowTextContrastIssue.js';
26
25
  import {MixedContentIssue} from './MixedContentIssue.js';
27
26
  import {PartitioningBlobURLIssue} from './PartitioningBlobURLIssue.js';
28
27
  import {PermissionElementIssue} from './PermissionElementIssue.js';
@@ -81,10 +80,6 @@ const issueCodeHandlers = new Map<
81
80
  Protocol.Audits.InspectorIssueCode.SharedDictionaryIssue,
82
81
  SharedDictionaryIssue.fromInspectorIssue,
83
82
  ],
84
- [
85
- Protocol.Audits.InspectorIssueCode.LowTextContrastIssue,
86
- LowTextContrastIssue.fromInspectorIssue,
87
- ],
88
83
  [
89
84
  Protocol.Audits.InspectorIssueCode.CorsIssue,
90
85
  CorsIssue.fromInspectorIssue,
@@ -7,7 +7,6 @@ import * as CheckFormsIssuesTrigger from './CheckFormsIssuesTrigger.js';
7
7
  import * as ClientHintIssue from './ClientHintIssue.js';
8
8
  import * as ConnectionAllowlistIssue from './ConnectionAllowlistIssue.js';
9
9
  import * as ContentSecurityPolicyIssue from './ContentSecurityPolicyIssue.js';
10
- import * as ContrastCheckTrigger from './ContrastCheckTrigger.js';
11
10
  import * as CookieDeprecationMetadataIssue from './CookieDeprecationMetadataIssue.js';
12
11
  import * as CookieIssue from './CookieIssue.js';
13
12
  import * as CorsIssue from './CorsIssue.js';
@@ -21,7 +20,6 @@ import * as Issue from './Issue.js';
21
20
  import * as IssueAggregator from './IssueAggregator.js';
22
21
  import * as IssueResolver from './IssueResolver.js';
23
22
  import * as IssuesManager from './IssuesManager.js';
24
- import * as LowTextContrastIssue from './LowTextContrastIssue.js';
25
23
  import * as MarkdownIssueDescription from './MarkdownIssueDescription.js';
26
24
  import * as MixedContentIssue from './MixedContentIssue.js';
27
25
  import * as PartitioningBlobURLIssue from './PartitioningBlobURLIssue.js';
@@ -42,7 +40,6 @@ export {
42
40
  ClientHintIssue,
43
41
  ConnectionAllowlistIssue,
44
42
  ContentSecurityPolicyIssue,
45
- ContrastCheckTrigger,
46
43
  CookieDeprecationMetadataIssue,
47
44
  CookieIssue,
48
45
  CorsIssue,
@@ -56,7 +53,6 @@ export {
56
53
  IssueAggregator,
57
54
  IssueResolver,
58
55
  IssuesManager,
59
- LowTextContrastIssue,
60
56
  MarkdownIssueDescription,
61
57
  MixedContentIssue,
62
58
  PartitioningBlobURLIssue,
@@ -7221,6 +7221,10 @@ export const NativeFunctions = [
7221
7221
  name: "OffscreenCanvas",
7222
7222
  signatures: [["width","height"]]
7223
7223
  },
7224
+ {
7225
+ name: "OverscrollEvent",
7226
+ signatures: [["type","?eventInitDict"]]
7227
+ },
7224
7228
  {
7225
7229
  name: "setValueAndClosePopup",
7226
7230
  signatures: [["numberValue","stringValue","is_keyboard_event"]]
@@ -7322,16 +7326,16 @@ export const NativeFunctions = [
7322
7326
  signatures: [["type","eventInitDict"]]
7323
7327
  },
7324
7328
  {
7325
- name: "registerTool",
7326
- signatures: [["params"]]
7329
+ name: "provideContext",
7330
+ signatures: [["?options"]]
7327
7331
  },
7328
7332
  {
7329
- name: "unregisterTool",
7330
- signatures: [["tool_name"]]
7333
+ name: "registerTool",
7334
+ signatures: [["tool"]]
7331
7335
  },
7332
7336
  {
7333
- name: "provideContext",
7334
- signatures: [["params"]]
7337
+ name: "unregisterTool",
7338
+ signatures: [["name"]]
7335
7339
  },
7336
7340
  {
7337
7341
  name: "SnapEvent",
@@ -0,0 +1,9 @@
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 ReporterTypes from './LighthouseReporterTypes.js';
6
+
7
+ export {
8
+ ReporterTypes,
9
+ };