chrome-devtools-frontend 1.0.1598808 → 1.0.1601661

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 (161) hide show
  1. package/.agents/README.md +13 -0
  2. package/{agents/prompts/creating-a-model.md → .agents/skills/creating-a-model/SKILL.md} +7 -1
  3. package/{agents/prompts/devtools-imports.md → .agents/skills/devtools-imports/SKILL.md} +10 -5
  4. package/{agents/prompts/merging-devtools-module.md → .agents/skills/merging-devtools-module/SKILL.md} +5 -0
  5. package/{agents/prompts/ui-widgets.md → .agents/skills/ui-widgets/SKILL.md} +5 -0
  6. package/{agents/prompts/verification.md → .agents/skills/verification/SKILL.md} +5 -0
  7. package/front_end/core/common/Settings.ts +24 -1
  8. package/front_end/core/dom_extension/DOMExtension.ts +1 -0
  9. package/front_end/core/host/AidaClient.ts +5 -2
  10. package/front_end/core/host/AidaGcaTranslation.ts +377 -0
  11. package/front_end/core/host/GcaTypes.ts +520 -0
  12. package/front_end/core/host/UserMetrics.ts +0 -3
  13. package/front_end/core/host/host.ts +4 -0
  14. package/front_end/core/root/ExperimentNames.ts +0 -3
  15. package/front_end/core/sdk/CPUThrottlingManager.ts +12 -9
  16. package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
  17. package/front_end/core/sdk/SourceMap.ts +4 -2
  18. package/front_end/entrypoints/main/MainImpl.ts +1 -12
  19. package/front_end/generated/Deprecation.ts +16 -0
  20. package/front_end/generated/InspectorBackendCommands.ts +4 -6
  21. package/front_end/generated/protocol.ts +46 -77
  22. package/front_end/models/ai_assistance/AiConversation.ts +49 -22
  23. package/front_end/models/ai_assistance/AiHistoryStorage.snapshot.txt +1 -1
  24. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -0
  25. package/front_end/models/ai_assistance/ConversationHandler.ts +16 -11
  26. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +76 -36
  27. package/front_end/models/ai_assistance/agents/AiAgent.ts +26 -2
  28. package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +0 -1
  29. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +11 -0
  30. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +39 -0
  31. package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +53 -12
  32. package/front_end/models/ai_assistance/agents/FileAgent.ts +0 -15
  33. package/front_end/models/ai_assistance/agents/NetworkAgent.ts +0 -5
  34. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +57 -0
  35. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +87 -15
  36. package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +0 -10
  37. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -6
  38. package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -5
  39. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  40. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +84 -0
  41. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +172 -0
  42. package/front_end/models/breakpoints/BreakpointManager.ts +20 -12
  43. package/front_end/models/emulation/DeviceModeModel.ts +5 -1
  44. package/front_end/models/emulation/EmulatedDevices.ts +3 -2
  45. package/front_end/models/javascript_metadata/NativeFunctions.js +60 -0
  46. package/front_end/models/lighthouse/LighthouseReporterTypes.ts +104 -10
  47. package/front_end/models/lighthouse/RunTypes.ts +42 -0
  48. package/front_end/models/lighthouse/lighthouse.ts +2 -0
  49. package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +59 -35
  50. package/front_end/models/stack_trace/StackTrace.ts +5 -0
  51. package/front_end/models/stack_trace/StackTraceImpl.ts +7 -1
  52. package/front_end/models/stack_trace/StackTraceModel.ts +2 -1
  53. package/front_end/models/stack_trace/stack_trace.ts +4 -0
  54. package/front_end/models/trace/ModelImpl.ts +4 -0
  55. package/front_end/models/trace/helpers/SamplesIntegrator.ts +1 -8
  56. package/front_end/models/trace/types/Configuration.ts +0 -5
  57. package/front_end/panels/accessibility/AccessibilityNodeView.ts +7 -3
  58. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +163 -74
  59. package/front_end/panels/ai_assistance/ExportConversation.ts +25 -0
  60. package/front_end/panels/ai_assistance/ai_assistance.ts +2 -0
  61. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -0
  62. package/front_end/panels/ai_assistance/components/ChatMessage.ts +120 -32
  63. package/front_end/panels/ai_assistance/components/ChatView.ts +44 -0
  64. package/front_end/panels/ai_assistance/components/ExportForAgentsDialog.ts +240 -0
  65. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +4 -12
  66. package/front_end/panels/ai_assistance/components/StylingAgentMarkdownRenderer.ts +5 -27
  67. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +115 -17
  68. package/front_end/panels/ai_assistance/components/chatMessage.css +65 -1
  69. package/front_end/panels/ai_assistance/components/chatView.css +8 -0
  70. package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +82 -0
  71. package/front_end/panels/ai_assistance/components/walkthroughView.css +9 -1
  72. package/front_end/panels/animation/AnimationTimeline.ts +5 -5
  73. package/front_end/panels/application/AppManifestView.ts +13 -7
  74. package/front_end/panels/application/FrameDetailsView.ts +4 -4
  75. package/front_end/panels/application/preloading/PreloadingView.ts +2 -4
  76. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +6 -3
  77. package/front_end/panels/application/preloading/components/PreloadingString.ts +15 -2
  78. package/front_end/panels/application/preloading/helper/PreloadingForward.ts +31 -2
  79. package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +3 -2
  80. package/front_end/panels/common/DOMLinkifier.ts +10 -8
  81. package/front_end/panels/console/ConsoleView.ts +24 -2
  82. package/front_end/panels/console/ConsoleViewMessage.ts +22 -23
  83. package/front_end/panels/console/console.ts +0 -2
  84. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +5 -5
  85. package/front_end/panels/elements/ElementsTreeElement.ts +2 -3
  86. package/front_end/panels/elements/PropertiesWidget.ts +5 -3
  87. package/front_end/panels/elements/StandaloneStylesContainer.ts +21 -9
  88. package/front_end/panels/elements/StylePropertiesSection.ts +98 -50
  89. package/front_end/panels/elements/StylePropertyTreeElement.ts +38 -4
  90. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +43 -35
  91. package/front_end/panels/elements/StylesSidebarPane.ts +154 -24
  92. package/front_end/panels/elements/components/ComputedStyleTrace.ts +3 -2
  93. package/front_end/panels/event_listeners/EventListenersView.ts +16 -4
  94. package/front_end/panels/explain/components/ConsoleInsight.ts +6 -9
  95. package/front_end/panels/explain/explain-meta.ts +5 -0
  96. package/front_end/panels/issues/AffectedResourcesView.ts +5 -9
  97. package/front_end/panels/issues/AffectedSelectivePermissionsInterventionView.ts +1 -1
  98. package/front_end/panels/lighthouse/LighthouseController.ts +154 -164
  99. package/front_end/panels/lighthouse/LighthousePanel.ts +5 -9
  100. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +1 -0
  101. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +9 -6
  102. package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -6
  103. package/front_end/panels/lighthouse/LighthouseStatusView.ts +32 -8
  104. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +7 -3
  105. package/front_end/panels/network/NetworkDataGridNode.ts +34 -0
  106. package/front_end/panels/network/NetworkLogViewColumns.ts +10 -0
  107. package/front_end/panels/network/RequestPayloadView.ts +4 -1
  108. package/front_end/panels/network/RequestTimingView.ts +8 -2
  109. package/front_end/panels/performance_monitor/performanceMonitor.css +6 -4
  110. package/front_end/panels/recorder/RecorderController.ts +52 -14
  111. package/front_end/panels/recorder/components/RecordingView.ts +2 -1
  112. package/front_end/panels/recorder/models/RecordingStorage.ts +15 -20
  113. package/front_end/panels/sensors/SensorsView.ts +333 -157
  114. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +18 -4
  115. package/front_end/panels/sources/DebuggerPausedMessage.ts +6 -6
  116. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -3
  117. package/front_end/panels/sources/NavigatorView.ts +11 -7
  118. package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
  119. package/front_end/panels/sources/SourcesPanel.ts +12 -34
  120. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +5 -1
  121. package/front_end/panels/sources/sources-meta.ts +6 -0
  122. package/front_end/panels/timeline/StatusDialog.ts +159 -83
  123. package/front_end/panels/timeline/ThirdPartyTreeView.ts +6 -2
  124. package/front_end/panels/timeline/TimelineController.ts +0 -4
  125. package/front_end/panels/timeline/TimelineDetailsView.ts +35 -3
  126. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +6 -1
  127. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +9 -4
  128. package/front_end/panels/timeline/TimelinePanel.ts +36 -11
  129. package/front_end/panels/timeline/TimelineTreeView.ts +14 -3
  130. package/front_end/panels/timeline/TimelineUIUtils.ts +5 -57
  131. package/front_end/panels/timeline/components/InteractionBreakdown.ts +2 -1
  132. package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -2
  133. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +3 -7
  134. package/front_end/panels/timeline/components/Sidebar.ts +11 -19
  135. package/front_end/panels/timeline/components/SidebarInsightsTab.ts +2 -1
  136. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +60 -27
  137. package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +66 -0
  138. package/front_end/panels/timeline/components/TimelineSummary.ts +7 -19
  139. package/front_end/panels/timeline/components/components.ts +2 -0
  140. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +55 -28
  141. package/front_end/panels/timeline/components/insights/NodeLink.ts +3 -3
  142. package/front_end/panels/timeline/components/insights/baseInsightComponent.css +7 -0
  143. package/front_end/panels/timeline/components/insights/insights.ts +0 -2
  144. package/front_end/panels/timeline/components/timelineRangeSummaryView.css +20 -0
  145. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +7 -7
  146. package/front_end/panels/timeline/timeline-meta.ts +11 -0
  147. package/front_end/panels/timeline/timelineDetailsView.css +0 -9
  148. package/front_end/third_party/chromium/README.chromium +1 -1
  149. package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +11 -2
  150. package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +11 -2
  151. package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +65 -4
  152. package/front_end/ui/kit/link/link.css +2 -2
  153. package/front_end/ui/legacy/Widget.ts +5 -3
  154. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +7 -2
  155. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +57 -35
  156. package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +1 -0
  157. package/front_end/ui/visual_logging/KnownContextValues.ts +6 -1
  158. package/package.json +1 -1
  159. package/agents/prompts/README.md +0 -18
  160. package/front_end/panels/timeline/components/insights/InsightRenderer.ts +0 -93
  161. /package/front_end/{panels/console → models/stack_trace}/ErrorStackParser.ts +0 -0
@@ -54,6 +54,14 @@ export const UIStrings = {
54
54
  * @description Warning displayed to developers when a data: URL is assigned to SVGUseElement to let them know that the support is deprecated.
55
55
  */
56
56
  DataUrlInSvgUse: "Support for data: URLs in SVGUseElement is deprecated and it will be removed in the future.",
57
+ /**
58
+ * @description Warning displayed to developers when document.createEvent() is called with 'KeyboardEvents', which is a non-standard event interface that will be removed.
59
+ */
60
+ DocumentCreateEventKeyboardEvents: "document.createEvent('KeyboardEvents') is deprecated and will be removed. Use `new KeyboardEvent()` instead.",
61
+ /**
62
+ * @description Warning displayed to developers when document.createEvent() is called with 'TransitionEvent', which is a non-standard event interface that will be removed.
63
+ */
64
+ DocumentCreateEventTransitionEvent: "document.createEvent('TransitionEvent') is deprecated and will be removed. Use `new TransitionEvent()` instead.",
57
65
  /**
58
66
  * @description Translation is not needed, this will never be exposed in production code.
59
67
  */
@@ -313,6 +321,14 @@ export const DEPRECATIONS_METADATA: Partial<Record<string, DeprecationDescriptor
313
321
  "chromeStatusFeature": 5128825141198848,
314
322
  "milestone": 119
315
323
  },
324
+ "DocumentCreateEventKeyboardEvents": {
325
+ "chromeStatusFeature": 5095987863486464,
326
+ "milestone": 151
327
+ },
328
+ "DocumentCreateEventTransitionEvent": {
329
+ "chromeStatusFeature": 5095987863486464,
330
+ "milestone": 151
331
+ },
316
332
  "IdentityInCanMakePaymentEvent": {
317
333
  "chromeStatusFeature": 5190978431352832
318
334
  },
@@ -134,9 +134,7 @@ inspectorBackend.registerType("Audits.StylesheetLoadingIssueDetails", [{"name":
134
134
  inspectorBackend.registerType("Audits.PropertyRuleIssueDetails", [{"name": "sourceCodeLocation", "type": "object", "optional": false, "description": "Source code position of the property rule.", "typeRef": "Audits.SourceCodeLocation"}, {"name": "propertyRuleIssueReason", "type": "string", "optional": false, "description": "Reason why the property rule was discarded.", "typeRef": "Audits.PropertyRuleIssueReason"}, {"name": "propertyValue", "type": "string", "optional": true, "description": "The value of the property rule property that failed to parse", "typeRef": null}]);
135
135
  inspectorBackend.registerType("Audits.UserReidentificationIssueDetails", [{"name": "type", "type": "string", "optional": false, "description": "", "typeRef": "Audits.UserReidentificationIssueType"}, {"name": "request", "type": "object", "optional": true, "description": "Applies to BlockedFrameNavigation and BlockedSubresource issue types.", "typeRef": "Audits.AffectedRequest"}, {"name": "sourceCodeLocation", "type": "object", "optional": true, "description": "Applies to NoisedCanvasReadback issue type.", "typeRef": "Audits.SourceCodeLocation"}]);
136
136
  inspectorBackend.registerType("Audits.PermissionElementIssueDetails", [{"name": "issueType", "type": "string", "optional": false, "description": "", "typeRef": "Audits.PermissionElementIssueType"}, {"name": "type", "type": "string", "optional": true, "description": "The value of the type attribute.", "typeRef": null}, {"name": "nodeId", "type": "number", "optional": true, "description": "The node ID of the <permission> element.", "typeRef": "DOM.BackendNodeId"}, {"name": "isWarning", "type": "boolean", "optional": true, "description": "True if the issue is a warning, false if it is an error.", "typeRef": null}, {"name": "permissionName", "type": "string", "optional": true, "description": "Fields for message construction: Used for messages that reference a specific permission name", "typeRef": null}, {"name": "occluderNodeInfo", "type": "string", "optional": true, "description": "Used for messages about occlusion", "typeRef": null}, {"name": "occluderParentNodeInfo", "type": "string", "optional": true, "description": "Used for messages about occluder's parent", "typeRef": null}, {"name": "disableReason", "type": "string", "optional": true, "description": "Used for messages about activation disabled reason", "typeRef": null}]);
137
- inspectorBackend.registerType("Audits.AdScriptIdentifier", [{"name": "scriptId", "type": "string", "optional": false, "description": "The script's v8 identifier.", "typeRef": "Runtime.ScriptId"}, {"name": "debuggerId", "type": "string", "optional": false, "description": "v8's debugging id for the v8::Context.", "typeRef": "Runtime.UniqueDebuggerId"}, {"name": "name", "type": "string", "optional": false, "description": "The script's url (or generated name based on id if inline script).", "typeRef": null}]);
138
- inspectorBackend.registerType("Audits.AdAncestry", [{"name": "adAncestryChain", "type": "array", "optional": false, "description": "The ad-script in the stack when the offending script was loaded. This is recursive down to the root script that was tagged due to the filterlist rule.", "typeRef": "Audits.AdScriptIdentifier"}, {"name": "rootScriptFilterlistRule", "type": "string", "optional": true, "description": "The filterlist rule that caused the root (last) script in `adAncestry` to be ad-tagged.", "typeRef": null}]);
139
- inspectorBackend.registerType("Audits.SelectivePermissionsInterventionIssueDetails", [{"name": "apiName", "type": "string", "optional": false, "description": "Which API was intervened on.", "typeRef": null}, {"name": "adAncestry", "type": "object", "optional": false, "description": "Why the ad script using the API is considered an ad.", "typeRef": "Audits.AdAncestry"}, {"name": "stackTrace", "type": "object", "optional": true, "description": "The stack trace at the time of the intervention.", "typeRef": "Runtime.StackTrace"}]);
137
+ inspectorBackend.registerType("Audits.SelectivePermissionsInterventionIssueDetails", [{"name": "apiName", "type": "string", "optional": false, "description": "Which API was intervened on.", "typeRef": null}, {"name": "adAncestry", "type": "object", "optional": false, "description": "Why the ad script using the API is considered an ad.", "typeRef": "Network.AdAncestry"}, {"name": "stackTrace", "type": "object", "optional": true, "description": "The stack trace at the time of the intervention.", "typeRef": "Runtime.StackTrace"}]);
140
138
  inspectorBackend.registerType("Audits.InspectorIssueDetails", [{"name": "cookieIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieIssueDetails"}, {"name": "mixedContentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.MixedContentIssueDetails"}, {"name": "blockedByResponseIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BlockedByResponseIssueDetails"}, {"name": "heavyAdIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.HeavyAdIssueDetails"}, {"name": "contentSecurityPolicyIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ContentSecurityPolicyIssueDetails"}, {"name": "sharedArrayBufferIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedArrayBufferIssueDetails"}, {"name": "corsIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CorsIssueDetails"}, {"name": "attributionReportingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.AttributionReportingIssueDetails"}, {"name": "quirksModeIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.QuirksModeIssueDetails"}, {"name": "partitioningBlobURLIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PartitioningBlobURLIssueDetails"}, {"name": "navigatorUserAgentIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.NavigatorUserAgentIssueDetails"}, {"name": "genericIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.GenericIssueDetails"}, {"name": "deprecationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.DeprecationIssueDetails"}, {"name": "clientHintIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ClientHintIssueDetails"}, {"name": "federatedAuthRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthRequestIssueDetails"}, {"name": "bounceTrackingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.BounceTrackingIssueDetails"}, {"name": "cookieDeprecationMetadataIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.CookieDeprecationMetadataIssueDetails"}, {"name": "stylesheetLoadingIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.StylesheetLoadingIssueDetails"}, {"name": "propertyRuleIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PropertyRuleIssueDetails"}, {"name": "federatedAuthUserInfoRequestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.FederatedAuthUserInfoRequestIssueDetails"}, {"name": "sharedDictionaryIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SharedDictionaryIssueDetails"}, {"name": "elementAccessibilityIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ElementAccessibilityIssueDetails"}, {"name": "sriMessageSignatureIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SRIMessageSignatureIssueDetails"}, {"name": "unencodedDigestIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UnencodedDigestIssueDetails"}, {"name": "connectionAllowlistIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.ConnectionAllowlistIssueDetails"}, {"name": "userReidentificationIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.UserReidentificationIssueDetails"}, {"name": "permissionElementIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PermissionElementIssueDetails"}, {"name": "performanceIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.PerformanceIssueDetails"}, {"name": "selectivePermissionsInterventionIssueDetails", "type": "object", "optional": true, "description": "", "typeRef": "Audits.SelectivePermissionsInterventionIssueDetails"}]);
141
139
  inspectorBackend.registerType("Audits.InspectorIssue", [{"name": "code", "type": "string", "optional": false, "description": "", "typeRef": "Audits.InspectorIssueCode"}, {"name": "details", "type": "object", "optional": false, "description": "", "typeRef": "Audits.InspectorIssueDetails"}, {"name": "issueId", "type": "string", "optional": true, "description": "A unique id for this issue. May be omitted if no other entity (e.g. exception, CDP message, etc.) is referencing this issue.", "typeRef": "Audits.IssueId"}]);
142
140
 
@@ -319,7 +317,7 @@ inspectorBackend.registerType("CSS.CSSPropertyRule", [{"name": "styleSheetId", "
319
317
  inspectorBackend.registerType("CSS.CSSFunctionParameter", [{"name": "name", "type": "string", "optional": false, "description": "The parameter name.", "typeRef": null}, {"name": "type", "type": "string", "optional": false, "description": "The parameter type.", "typeRef": null}]);
320
318
  inspectorBackend.registerType("CSS.CSSFunctionConditionNode", [{"name": "media", "type": "object", "optional": true, "description": "Media query for this conditional block. Only one type of condition should be set.", "typeRef": "CSS.CSSMedia"}, {"name": "containerQueries", "type": "object", "optional": true, "description": "Container query for this conditional block. Only one type of condition should be set.", "typeRef": "CSS.CSSContainerQuery"}, {"name": "supports", "type": "object", "optional": true, "description": "@supports CSS at-rule condition. Only one type of condition should be set.", "typeRef": "CSS.CSSSupports"}, {"name": "navigation", "type": "object", "optional": true, "description": "@navigation condition. Only one type of condition should be set.", "typeRef": "CSS.CSSNavigation"}, {"name": "children", "type": "array", "optional": false, "description": "Block body.", "typeRef": "CSS.CSSFunctionNode"}, {"name": "conditionText", "type": "string", "optional": false, "description": "The condition text.", "typeRef": null}]);
321
319
  inspectorBackend.registerType("CSS.CSSFunctionNode", [{"name": "condition", "type": "object", "optional": true, "description": "A conditional block. If set, style should not be set.", "typeRef": "CSS.CSSFunctionConditionNode"}, {"name": "style", "type": "object", "optional": true, "description": "Values set by this node. If set, condition should not be set.", "typeRef": "CSS.CSSStyle"}]);
322
- inspectorBackend.registerType("CSS.CSSFunctionRule", [{"name": "name", "type": "object", "optional": false, "description": "Name of the function.", "typeRef": "CSS.Value"}, {"name": "styleSheetId", "type": "string", "optional": true, "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.", "typeRef": "DOM.StyleSheetId"}, {"name": "origin", "type": "string", "optional": false, "description": "Parent stylesheet's origin.", "typeRef": "CSS.StyleSheetOrigin"}, {"name": "parameters", "type": "array", "optional": false, "description": "List of parameters.", "typeRef": "CSS.CSSFunctionParameter"}, {"name": "children", "type": "array", "optional": false, "description": "Function body.", "typeRef": "CSS.CSSFunctionNode"}]);
320
+ inspectorBackend.registerType("CSS.CSSFunctionRule", [{"name": "name", "type": "object", "optional": false, "description": "Name of the function.", "typeRef": "CSS.Value"}, {"name": "styleSheetId", "type": "string", "optional": true, "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.", "typeRef": "DOM.StyleSheetId"}, {"name": "origin", "type": "string", "optional": false, "description": "Parent stylesheet's origin.", "typeRef": "CSS.StyleSheetOrigin"}, {"name": "parameters", "type": "array", "optional": false, "description": "List of parameters.", "typeRef": "CSS.CSSFunctionParameter"}, {"name": "children", "type": "array", "optional": false, "description": "Function body.", "typeRef": "CSS.CSSFunctionNode"}, {"name": "originTreeScopeNodeId", "type": "number", "optional": true, "description": "The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.", "typeRef": "DOM.BackendNodeId"}]);
323
321
  inspectorBackend.registerType("CSS.CSSKeyframeRule", [{"name": "styleSheetId", "type": "string", "optional": true, "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.", "typeRef": "DOM.StyleSheetId"}, {"name": "origin", "type": "string", "optional": false, "description": "Parent stylesheet's origin.", "typeRef": "CSS.StyleSheetOrigin"}, {"name": "keyText", "type": "object", "optional": false, "description": "Associated key text.", "typeRef": "CSS.Value"}, {"name": "style", "type": "object", "optional": false, "description": "Associated style declaration.", "typeRef": "CSS.CSSStyle"}]);
324
322
  inspectorBackend.registerType("CSS.StyleDeclarationEdit", [{"name": "styleSheetId", "type": "string", "optional": false, "description": "The css style sheet identifier.", "typeRef": "DOM.StyleSheetId"}, {"name": "range", "type": "object", "optional": false, "description": "The range of the style text in the enclosing stylesheet.", "typeRef": "CSS.SourceRange"}, {"name": "text", "type": "string", "optional": false, "description": "New style text.", "typeRef": null}]);
325
323
 
@@ -928,6 +926,8 @@ inspectorBackend.registerType("Network.DirectUDPSocketOptions", [{"name": "remot
928
926
  inspectorBackend.registerType("Network.DirectUDPMessage", [{"name": "data", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "remoteAddr", "type": "string", "optional": true, "description": "Null for connected mode.", "typeRef": null}, {"name": "remotePort", "type": "number", "optional": true, "description": "Null for connected mode. Expected to be unsigned integer.", "typeRef": null}]);
929
927
  inspectorBackend.registerType("Network.ConnectTiming", [{"name": "requestTime", "type": "number", "optional": false, "description": "Timing's requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for the same request (but not for redirected requests).", "typeRef": null}]);
930
928
  inspectorBackend.registerType("Network.ClientSecurityState", [{"name": "initiatorIsSecureContext", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "initiatorIPAddressSpace", "type": "string", "optional": false, "description": "", "typeRef": "Network.IPAddressSpace"}, {"name": "localNetworkAccessRequestPolicy", "type": "string", "optional": false, "description": "", "typeRef": "Network.LocalNetworkAccessRequestPolicy"}]);
929
+ inspectorBackend.registerType("Network.AdScriptIdentifier", [{"name": "scriptId", "type": "string", "optional": false, "description": "The script's V8 identifier.", "typeRef": "Runtime.ScriptId"}, {"name": "debuggerId", "type": "string", "optional": false, "description": "V8's debugging ID for the v8::Context.", "typeRef": "Runtime.UniqueDebuggerId"}, {"name": "name", "type": "string", "optional": false, "description": "The script's url (or generated name based on id if inline script).", "typeRef": null}]);
930
+ inspectorBackend.registerType("Network.AdAncestry", [{"name": "ancestryChain", "type": "array", "optional": false, "description": "A chain of `AdScriptIdentifier`s representing the ancestry of an ad script that led to the creation of a resource or element. The chain is ordered from the script itself (lowest level) up to its root ancestor that was flagged by a filter list.", "typeRef": "Network.AdScriptIdentifier"}, {"name": "rootScriptFilterlistRule", "type": "string", "optional": true, "description": "The filter list rule that caused the root (last) script in `ancestryChain` to be tagged as an ad.", "typeRef": null}]);
931
931
  inspectorBackend.registerType("Network.CrossOriginOpenerPolicyStatus", [{"name": "value", "type": "string", "optional": false, "description": "", "typeRef": "Network.CrossOriginOpenerPolicyValue"}, {"name": "reportOnlyValue", "type": "string", "optional": false, "description": "", "typeRef": "Network.CrossOriginOpenerPolicyValue"}, {"name": "reportingEndpoint", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "reportOnlyReportingEndpoint", "type": "string", "optional": true, "description": "", "typeRef": null}]);
932
932
  inspectorBackend.registerType("Network.CrossOriginEmbedderPolicyStatus", [{"name": "value", "type": "string", "optional": false, "description": "", "typeRef": "Network.CrossOriginEmbedderPolicyValue"}, {"name": "reportOnlyValue", "type": "string", "optional": false, "description": "", "typeRef": "Network.CrossOriginEmbedderPolicyValue"}, {"name": "reportingEndpoint", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "reportOnlyReportingEndpoint", "type": "string", "optional": true, "description": "", "typeRef": null}]);
933
933
  inspectorBackend.registerType("Network.ContentSecurityPolicyStatus", [{"name": "effectiveDirectives", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "isEnforced", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "source", "type": "string", "optional": false, "description": "", "typeRef": "Network.ContentSecurityPolicySource"}]);
@@ -1143,8 +1143,6 @@ inspectorBackend.registerCommand("Page.setInterceptFileChooserDialog", [{"name":
1143
1143
  inspectorBackend.registerCommand("Page.setPrerenderingAllowed", [{"name": "isAllowed", "type": "boolean", "optional": false, "description": "", "typeRef": null}], [], "Enable/disable prerendering manually. This command is a short-term solution for https://crbug.com/1440085. See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA for more details. TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets.");
1144
1144
  inspectorBackend.registerCommand("Page.getAnnotatedPageContent", [{"name": "includeActionableInformation", "type": "boolean", "optional": true, "description": "Whether to include actionable information. Defaults to true.", "typeRef": null}], ["content"], "Get the annotated page content for the main frame. This is an experimental command that is subject to change.");
1145
1145
  inspectorBackend.registerType("Page.AdFrameStatus", [{"name": "adFrameType", "type": "string", "optional": false, "description": "", "typeRef": "Page.AdFrameType"}, {"name": "explanations", "type": "array", "optional": true, "description": "", "typeRef": "Page.AdFrameExplanation"}]);
1146
- inspectorBackend.registerType("Page.AdScriptId", [{"name": "scriptId", "type": "string", "optional": false, "description": "Script Id of the script which caused a script or frame to be labelled as an ad.", "typeRef": "Runtime.ScriptId"}, {"name": "debuggerId", "type": "string", "optional": false, "description": "Id of scriptId's debugger.", "typeRef": "Runtime.UniqueDebuggerId"}]);
1147
- inspectorBackend.registerType("Page.AdScriptAncestry", [{"name": "ancestryChain", "type": "array", "optional": false, "description": "A chain of `AdScriptId`s representing the ancestry of an ad script that led to the creation of a frame. The chain is ordered from the script itself (lower level) up to its root ancestor that was flagged by filterlist.", "typeRef": "Page.AdScriptId"}, {"name": "rootScriptFilterlistRule", "type": "string", "optional": true, "description": "The filterlist rule that caused the root (last) script in `ancestryChain` to be ad-tagged. Only populated if the rule is available.", "typeRef": null}]);
1148
1146
  inspectorBackend.registerType("Page.PermissionsPolicyBlockLocator", [{"name": "frameId", "type": "string", "optional": false, "description": "", "typeRef": "Page.FrameId"}, {"name": "blockReason", "type": "string", "optional": false, "description": "", "typeRef": "Page.PermissionsPolicyBlockReason"}]);
1149
1147
  inspectorBackend.registerType("Page.PermissionsPolicyFeatureState", [{"name": "feature", "type": "string", "optional": false, "description": "", "typeRef": "Page.PermissionsPolicyFeature"}, {"name": "allowed", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "locator", "type": "object", "optional": true, "description": "", "typeRef": "Page.PermissionsPolicyBlockLocator"}]);
1150
1148
  inspectorBackend.registerType("Page.OriginTrialToken", [{"name": "origin", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "matchSubDomains", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "trialName", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "expiryTime", "type": "number", "optional": false, "description": "", "typeRef": "Network.TimeSinceEpoch"}, {"name": "isThirdParty", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "usageRestriction", "type": "string", "optional": false, "description": "", "typeRef": "Page.OriginTrialUsageRestriction"}]);
@@ -1533,44 +1533,6 @@ export namespace Audits {
1533
1533
  disableReason?: string;
1534
1534
  }
1535
1535
 
1536
- /**
1537
- * Metadata about the ad script that was on the stack that caused the current
1538
- * script in the `AdAncestry` to be considered ad related.
1539
- */
1540
- export interface AdScriptIdentifier {
1541
- /**
1542
- * The script's v8 identifier.
1543
- */
1544
- scriptId: Runtime.ScriptId;
1545
- /**
1546
- * v8's debugging id for the v8::Context.
1547
- */
1548
- debuggerId: Runtime.UniqueDebuggerId;
1549
- /**
1550
- * The script's url (or generated name based on id if inline script).
1551
- */
1552
- name: string;
1553
- }
1554
-
1555
- /**
1556
- * Providence about how an ad script was determined to be such. It is an ad
1557
- * because its url matched a filterlist rule, or because some other ad script
1558
- * was on the stack when this script was loaded.
1559
- */
1560
- export interface AdAncestry {
1561
- /**
1562
- * The ad-script in the stack when the offending script was loaded. This is
1563
- * recursive down to the root script that was tagged due to the filterlist
1564
- * rule.
1565
- */
1566
- adAncestryChain: AdScriptIdentifier[];
1567
- /**
1568
- * The filterlist rule that caused the root (last) script in
1569
- * `adAncestry` to be ad-tagged.
1570
- */
1571
- rootScriptFilterlistRule?: string;
1572
- }
1573
-
1574
1536
  /**
1575
1537
  * The issue warns about blocked calls to privacy sensitive APIs via the
1576
1538
  * Selective Permissions Intervention.
@@ -1583,7 +1545,7 @@ export namespace Audits {
1583
1545
  /**
1584
1546
  * Why the ad script using the API is considered an ad.
1585
1547
  */
1586
- adAncestry: AdAncestry;
1548
+ adAncestry: Network.AdAncestry;
1587
1549
  /**
1588
1550
  * The stack trace at the time of the intervention.
1589
1551
  */
@@ -3740,6 +3702,10 @@ export namespace CSS {
3740
3702
  * Function body.
3741
3703
  */
3742
3704
  children: CSSFunctionNode[];
3705
+ /**
3706
+ * The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.
3707
+ */
3708
+ originTreeScopeNodeId?: DOM.BackendNodeId;
3743
3709
  }
3744
3710
 
3745
3711
  /**
@@ -11498,6 +11464,46 @@ export namespace Network {
11498
11464
  localNetworkAccessRequestPolicy: LocalNetworkAccessRequestPolicy;
11499
11465
  }
11500
11466
 
11467
+ /**
11468
+ * Identifies the script on the stack that caused a resource or element to be
11469
+ * labeled as an ad. For resources, this indicates the context that triggered
11470
+ * the fetch. For elements, this indicates the context that caused the element
11471
+ * to be appended to the DOM.
11472
+ */
11473
+ export interface AdScriptIdentifier {
11474
+ /**
11475
+ * The script's V8 identifier.
11476
+ */
11477
+ scriptId: Runtime.ScriptId;
11478
+ /**
11479
+ * V8's debugging ID for the v8::Context.
11480
+ */
11481
+ debuggerId: Runtime.UniqueDebuggerId;
11482
+ /**
11483
+ * The script's url (or generated name based on id if inline script).
11484
+ */
11485
+ name: string;
11486
+ }
11487
+
11488
+ /**
11489
+ * Encapsulates the script ancestry and the root script filter list rule that
11490
+ * caused the resource or element to be labeled as an ad.
11491
+ */
11492
+ export interface AdAncestry {
11493
+ /**
11494
+ * A chain of `AdScriptIdentifier`s representing the ancestry of an ad
11495
+ * script that led to the creation of a resource or element. The chain is
11496
+ * ordered from the script itself (lowest level) up to its root ancestor
11497
+ * that was flagged by a filter list.
11498
+ */
11499
+ ancestryChain: AdScriptIdentifier[];
11500
+ /**
11501
+ * The filter list rule that caused the root (last) script in
11502
+ * `ancestryChain` to be tagged as an ad.
11503
+ */
11504
+ rootScriptFilterlistRule?: string;
11505
+ }
11506
+
11501
11507
  export const enum CrossOriginOpenerPolicyValue {
11502
11508
  SameOrigin = 'SameOrigin',
11503
11509
  SameOriginAllowPopups = 'SameOriginAllowPopups',
@@ -14319,43 +14325,6 @@ export namespace Page {
14319
14325
  explanations?: AdFrameExplanation[];
14320
14326
  }
14321
14327
 
14322
- /**
14323
- * Identifies the script which caused a script or frame to be labelled as an
14324
- * ad.
14325
- */
14326
- export interface AdScriptId {
14327
- /**
14328
- * Script Id of the script which caused a script or frame to be labelled as
14329
- * an ad.
14330
- */
14331
- scriptId: Runtime.ScriptId;
14332
- /**
14333
- * Id of scriptId's debugger.
14334
- */
14335
- debuggerId: Runtime.UniqueDebuggerId;
14336
- }
14337
-
14338
- /**
14339
- * Encapsulates the script ancestry and the root script filterlist rule that
14340
- * caused the frame to be labelled as an ad. Only created when `ancestryChain`
14341
- * is not empty.
14342
- */
14343
- export interface AdScriptAncestry {
14344
- /**
14345
- * A chain of `AdScriptId`s representing the ancestry of an ad script that
14346
- * led to the creation of a frame. The chain is ordered from the script
14347
- * itself (lower level) up to its root ancestor that was flagged by
14348
- * filterlist.
14349
- */
14350
- ancestryChain: AdScriptId[];
14351
- /**
14352
- * The filterlist rule that caused the root (last) script in
14353
- * `ancestryChain` to be ad-tagged. Only populated if the rule is
14354
- * available.
14355
- */
14356
- rootScriptFilterlistRule?: string;
14357
- }
14358
-
14359
14328
  /**
14360
14329
  * Indicates whether the frame is a secure context and why it is the case.
14361
14330
  */
@@ -15618,7 +15587,7 @@ export namespace Page {
15618
15587
  * stack) to more distant ancestors (that created the immediately preceding
15619
15588
  * script). Only sent if frame is labelled as an ad and ids are available.
15620
15589
  */
15621
- adScriptAncestry?: AdScriptAncestry;
15590
+ adScriptAncestry?: Network.AdAncestry;
15622
15591
  }
15623
15592
 
15624
15593
  export interface GetFrameTreeResponse extends ProtocolResponseWithError {
@@ -3,12 +3,15 @@
3
3
  // found in the LICENSE file.
4
4
  import * as Common from '../../core/common/common.js';
5
5
  import * as Host from '../../core/host/host.js';
6
+ import * as Platform from '../../core/platform/platform.js';
6
7
  import * as Root from '../../core/root/root.js';
7
8
  import * as SDK from '../../core/sdk/sdk.js';
9
+ import type * as LHModel from '../../models/lighthouse/lighthouse.js';
8
10
  import type * as Trace from '../../models/trace/trace.js';
9
11
  import * as Greendev from '../greendev/greendev.js';
10
12
  import type * as NetworkTimeCalculator from '../network_time_calculator/network_time_calculator.js';
11
13
 
14
+ import {AccessibilityAgent, AccessibilityContext} from './agents/AccessibilityAgent.js';
12
15
  import {
13
16
  type AiAgent,
14
17
  type ContextDetail,
@@ -29,6 +32,7 @@ import {AiHistoryStorage, ConversationType, type SerializedConversation} from '.
29
32
  import type {ChangeManager} from './ChangeManager.js';
30
33
 
31
34
  export const NOT_FOUND_IMAGE_DATA = '';
35
+ export const CONTEXT_TITLE = 'Analyzing data';
32
36
  const MAX_TITLE_LENGTH = 80;
33
37
 
34
38
  export function generateContextDetailsMarkdown(details: ContextDetail[]): string {
@@ -39,6 +43,20 @@ export function generateContextDetailsMarkdown(details: ContextDetail[]): string
39
43
  }
40
44
  return detailsMarkdown.join('\n\n');
41
45
  }
46
+ export interface AiConversationOptions {
47
+ type: ConversationType;
48
+ data?: ResponseData[];
49
+ id?: string;
50
+ isReadOnly?: boolean;
51
+ aidaClient?: Host.AidaClient.AidaClient;
52
+ changeManager?: ChangeManager;
53
+ isExternal?: boolean;
54
+ performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
55
+ onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>;
56
+ networkTimeCalculator?: NetworkTimeCalculator.NetworkTransferTimeCalculator;
57
+ lighthouseRecording?: () => Promise<LHModel.ReporterTypes.ReportJSON|null>;
58
+ }
59
+
42
60
  export class AiConversation {
43
61
  static fromSerializedConversation(serializedConversation: SerializedConversation): AiConversation {
44
62
  const history = serializedConversation.history.map(entry => {
@@ -47,17 +65,13 @@ export class AiConversation {
47
65
  }
48
66
  return entry;
49
67
  });
50
- return new AiConversation(
51
- serializedConversation.type,
52
- history,
53
- serializedConversation.id,
54
- true,
55
- undefined,
56
- undefined,
57
- serializedConversation.isExternal,
58
- undefined,
59
- undefined,
60
- );
68
+ return new AiConversation({
69
+ type: serializedConversation.type,
70
+ data: history,
71
+ id: serializedConversation.id,
72
+ isReadOnly: true,
73
+ isExternal: serializedConversation.isExternal,
74
+ });
61
75
  }
62
76
 
63
77
  readonly id: string;
@@ -77,26 +91,30 @@ export class AiConversation {
77
91
  #contexts: Array<ConversationContext<unknown>> = [];
78
92
 
79
93
  #performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
94
+ #lighthouseRecording?: () => Promise<LHModel.ReporterTypes.ReportJSON|null>;
80
95
  #onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>;
81
96
  #networkTimeCalculator?: NetworkTimeCalculator.NetworkTransferTimeCalculator;
82
97
 
83
- constructor(
84
- type: ConversationType,
85
- data: ResponseData[] = [],
86
- id: string = crypto.randomUUID(),
98
+ constructor(options: AiConversationOptions) {
99
+ const {
100
+ type,
101
+ data = [],
102
+ id = crypto.randomUUID(),
87
103
  isReadOnly = true,
88
- aidaClient: Host.AidaClient.AidaClient = new Host.AidaClient.AidaClient(),
89
- changeManager?: ChangeManager,
104
+ aidaClient = new Host.AidaClient.AidaClient(),
105
+ changeManager,
90
106
  isExternal = false,
91
- performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>,
92
- onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>,
93
- networkTimeCalculator?: NetworkTimeCalculator.NetworkTransferTimeCalculator,
94
- ) {
107
+ performanceRecordAndReload,
108
+ onInspectElement,
109
+ networkTimeCalculator,
110
+ lighthouseRecording,
111
+ } = options;
95
112
  this.#changeManager = changeManager;
96
113
  this.#aidaClient = aidaClient;
97
114
  this.#performanceRecordAndReload = performanceRecordAndReload;
98
115
  this.#onInspectElement = onInspectElement;
99
116
  this.#networkTimeCalculator = networkTimeCalculator;
117
+ this.#lighthouseRecording = lighthouseRecording;
100
118
 
101
119
  this.id = id;
102
120
  this.#isReadOnly = isReadOnly;
@@ -155,6 +173,8 @@ export class AiConversation {
155
173
  this.#updateAgent(ConversationType.NETWORK);
156
174
  } else if (updateContext instanceof PerformanceTraceContext) {
157
175
  this.#updateAgent(ConversationType.PERFORMANCE);
176
+ } else if (updateContext instanceof AccessibilityContext) {
177
+ this.#updateAgent(ConversationType.ACCESSIBILITY);
158
178
  }
159
179
  }
160
180
  }
@@ -205,7 +225,7 @@ export class AiConversation {
205
225
  break;
206
226
  }
207
227
  case ResponseType.CONTEXT: {
208
- contentParts.push(`### ${item.title}`);
228
+ contentParts.push(`### ${CONTEXT_TITLE}`);
209
229
  if (item.details && item.details.length > 0) {
210
230
  contentParts.push(generateContextDetailsMarkdown(item.details));
211
231
  }
@@ -314,6 +334,7 @@ export class AiConversation {
314
334
  sessionId: this.id,
315
335
  changeManager: this.#changeManager,
316
336
  performanceRecordAndReload: this.#performanceRecordAndReload,
337
+ lighthouseRecording: this.#lighthouseRecording,
317
338
  onInspectElement: this.#onInspectElement,
318
339
  networkTimeCalculator: this.#networkTimeCalculator,
319
340
  allowedOrigin: this.allowedOrigin,
@@ -343,10 +364,16 @@ export class AiConversation {
343
364
  }
344
365
  break;
345
366
  }
367
+ case ConversationType.ACCESSIBILITY: {
368
+ this.#agent = new AccessibilityAgent(options);
369
+ break;
370
+ }
346
371
  case ConversationType.NONE: {
347
372
  this.#agent = new ContextSelectionAgent(options);
348
373
  break;
349
374
  }
375
+ default:
376
+ Platform.assertNever(type, 'Unknown conversation type');
350
377
  }
351
378
  }
352
379
 
@@ -12,7 +12,7 @@ What is the color of the sky?
12
12
 
13
13
  ## AI
14
14
 
15
- ### Analyzing context
15
+ ### Analyzing data
16
16
 
17
17
  **Detail 1:**
18
18
  ````
@@ -14,6 +14,7 @@ export const enum ConversationType {
14
14
  NETWORK = 'drjones-network-request',
15
15
  PERFORMANCE = 'drjones-performance-full',
16
16
  BREAKPOINT = 'breakpoint',
17
+ ACCESSIBILITY = 'accessibility',
17
18
  }
18
19
 
19
20
  export interface SerializedConversation {
@@ -19,7 +19,7 @@ import {
19
19
  import {NetworkAgent, RequestContext} from './agents/NetworkAgent.js';
20
20
  import type {PerformanceTraceContext} from './agents/PerformanceAgent.js';
21
21
  import {NodeContext, StylingAgent} from './agents/StylingAgent.js';
22
- import {AiConversation} from './AiConversation.js';
22
+ import {AiConversation, CONTEXT_TITLE} from './AiConversation.js';
23
23
  import {
24
24
  ConversationType,
25
25
  } from './AiHistoryStorage.js';
@@ -210,15 +210,14 @@ export class ConversationHandler extends Common.ObjectWrapper.ObjectWrapper<Even
210
210
  selected: NodeContext|PerformanceTraceContext|RequestContext|null,
211
211
  }): AsyncGenerator<ExternalRequestResponse, ExternalRequestResponse> {
212
212
  const {conversationType, aiAgent, prompt, selected} = opts;
213
- const conversation = new AiConversation(
214
- conversationType,
215
- [],
216
- aiAgent.sessionId,
217
- /* isReadOnly */ true,
218
- this.#aidaClient,
219
- undefined,
220
- /* isExternal */ true,
221
- );
213
+ const conversation = new AiConversation({
214
+ type: conversationType,
215
+ data: [],
216
+ id: aiAgent.sessionId,
217
+ isReadOnly: true,
218
+ aidaClient: this.#aidaClient,
219
+ isExternal: true,
220
+ });
222
221
  return yield* this.#doExternalConversation({conversation, prompt, selected});
223
222
  }
224
223
 
@@ -235,12 +234,18 @@ export class ConversationHandler extends Common.ObjectWrapper.ObjectWrapper<Even
235
234
  if (data.type !== ResponseType.ANSWER || data.complete) {
236
235
  devToolsLogs.push(data);
237
236
  }
238
- if (data.type === ResponseType.CONTEXT || data.type === ResponseType.TITLE) {
237
+ if (data.type === ResponseType.TITLE) {
239
238
  yield {
240
239
  type: ExternalRequestResponseType.NOTIFICATION,
241
240
  message: data.title,
242
241
  };
243
242
  }
243
+ if (data.type === ResponseType.CONTEXT) {
244
+ yield {
245
+ type: ExternalRequestResponseType.NOTIFICATION,
246
+ message: CONTEXT_TITLE,
247
+ };
248
+ }
244
249
  if (data.type === ResponseType.SIDE_EFFECT) {
245
250
  data.confirm(true);
246
251
  }