chrome-devtools-frontend 1.0.1717196 → 1.0.1721762

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 (381) hide show
  1. package/.agents/rules/models-and-core/core-ai-agent-context-and-prompt-discipline.md +29 -0
  2. package/.agents/rules/models-and-core/core-cdp-and-extension-error-handling.md +34 -0
  3. package/.agents/rules/models-and-core/core-gn-build-and-module-layering.md +23 -0
  4. package/.agents/rules/models-and-core/core-runtime-neutrality-and-platform-utils.md +28 -0
  5. package/.agents/rules/models-and-core/core-sdk-model-and-target-lifecycle.md +35 -0
  6. package/.agents/rules/models-and-core/core-security-origin-and-capability-guards.md +33 -0
  7. package/.agents/rules/models-and-core/core-settings-and-storage-migration.md +31 -0
  8. package/.agents/rules/models-and-core/core-sourcemap-and-workspace-mapping.md +28 -0
  9. package/.agents/rules/models-and-core/core-trace-engine-handler-invariants.md +32 -0
  10. package/.agents/rules/models-and-core/core-trace-insight-models-and-timing-types.md +28 -0
  11. package/.agents/rules/tests/test-cleanup-mutated-globals-and-widgets.md +40 -0
  12. package/.agents/rules/tests/test-deterministic-async-synchronization.md +30 -0
  13. package/.agents/rules/tests/test-modular-hooks-and-test-universe.md +38 -0
  14. package/.agents/rules/tests/test-public-api-and-encapsulation.md +30 -0
  15. package/.agents/rules/tests/test-shared-fixture-and-helper-reuse.md +29 -0
  16. package/.agents/rules/tests/test-single-responsibility-and-conciseness.md +37 -0
  17. package/.agents/rules/tests/test-strict-assertions-and-literal-expectations.md +31 -0
  18. package/.agents/rules/tests/test-type-safe-mocks-and-events.md +30 -0
  19. package/.agents/rules/tests/test-view-and-presenter-isolation.md +32 -0
  20. package/.agents/rules/ui-and-widgets/ui-accessibility-and-semantic-html.md +32 -0
  21. package/.agents/rules/ui-and-widgets/ui-await-update-complete-post-render.md +30 -0
  22. package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +27 -0
  23. package/.agents/rules/ui-and-widgets/ui-declarative-child-widget-composition.md +29 -0
  24. package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +33 -0
  25. package/.agents/rules/ui-and-widgets/ui-localization-and-uistrings-hygiene.md +36 -0
  26. package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +32 -0
  27. package/.agents/rules/ui-and-widgets/ui-panel-and-meta-registration.md +35 -0
  28. package/.agents/rules/ui-and-widgets/ui-performance-and-flamechart-rendering.md +34 -0
  29. package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +31 -0
  30. package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +34 -0
  31. package/.agents/rules/ui-and-widgets/ui-security-and-output-sanitization.md +28 -0
  32. package/.agents/rules/ui-and-widgets/ui-type-safety-and-exhaustiveness.md +37 -0
  33. package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +35 -0
  34. package/.agents/rules/ui-and-widgets/ui-visual-logging-instrumentation.md +29 -0
  35. package/.agents/rules/ui-and-widgets/ui-weak-dom-references-and-observer-cleanup.md +29 -0
  36. package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +38 -0
  37. package/.agents/skills/code-review/SKILL.md +3 -0
  38. package/.agents/skills/devtools-testing-guidance/SKILL.md +5 -2
  39. package/.agents/skills/review-models-core/SKILL.md +73 -0
  40. package/.agents/skills/review-tests/SKILL.md +67 -0
  41. package/.agents/skills/review-ui-widgets/SKILL.md +115 -0
  42. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +73 -9
  43. package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +27 -3
  44. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +32 -2
  45. package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +37 -7
  46. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +6 -5
  47. package/.agents/skills/ui-widgets/SKILL.md +11 -9
  48. package/AUTHORS +3 -0
  49. package/DIR_METADATA +51 -1
  50. package/docs/ui_engineering.md +34 -0
  51. package/eslint.config.mjs +63 -21
  52. package/front_end/core/common/Settings.ts +5 -0
  53. package/front_end/core/host/UserMetricsEnums.ts +1 -0
  54. package/front_end/core/platform/api/HostRuntime.ts +1 -0
  55. package/front_end/core/platform/browser/HostRuntime.ts +10 -0
  56. package/front_end/core/platform/node/HostRuntime.ts +1 -0
  57. package/front_end/core/sdk/CSSMatchedStyles.ts +60 -20
  58. package/front_end/core/sdk/CSSModel.ts +21 -0
  59. package/front_end/core/sdk/CSSProperty.ts +2 -2
  60. package/front_end/core/sdk/CSSPropertyParser.ts +11 -2
  61. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +28 -9
  62. package/front_end/core/sdk/DOMModel.ts +1 -1
  63. package/front_end/core/sdk/DebuggerModel.ts +3 -0
  64. package/front_end/core/sdk/EmulationModel.ts +40 -39
  65. package/front_end/core/sdk/NetworkManager.ts +10 -3
  66. package/front_end/core/sdk/NetworkRequest.ts +21 -0
  67. package/front_end/core/sdk/OverlayModel.ts +2 -8
  68. package/front_end/core/sdk/PrivateVerificationTokensModel.ts +79 -0
  69. package/front_end/core/sdk/RuntimeModel.ts +8 -3
  70. package/front_end/core/sdk/SecurityOrigin.ts +1 -1
  71. package/front_end/core/sdk/SourceMapCache.ts +20 -15
  72. package/front_end/core/sdk/SourceMapManager.ts +28 -9
  73. package/front_end/core/sdk/TargetManager.ts +7 -4
  74. package/front_end/core/sdk/WebAuthnModel.ts +11 -2
  75. package/front_end/core/sdk/sdk.ts +2 -0
  76. package/front_end/devtools_compatibility.js +1 -0
  77. package/front_end/entrypoints/inspector_main/InspectorMain.ts +0 -2
  78. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +10 -0
  79. package/front_end/entrypoints/main/GlobalAiButton.ts +1 -1
  80. package/front_end/entrypoints/main/MainImpl.ts +5 -2
  81. package/front_end/foundation/Universe.ts +1 -1
  82. package/front_end/generated/Deprecation.ts +4 -7
  83. package/front_end/generated/InspectorBackendCommands.ts +4 -4
  84. package/front_end/generated/SupportedCSSProperties.ts +89 -17
  85. package/front_end/generated/protocol-mapping.d.ts +1 -0
  86. package/front_end/generated/protocol-proxy-api.d.ts +1 -0
  87. package/front_end/generated/protocol.ts +6 -3
  88. package/front_end/models/{ai_assistance → ai-utils}/AiHistoryStorage.ts +6 -5
  89. package/front_end/models/{ai_assistance → ai-utils}/AiUtils.ts +14 -2
  90. package/front_end/models/{ai_assistance → ai-utils}/BuiltInAi.ts +1 -1
  91. package/front_end/models/ai-utils/ai-utils.ts +17 -0
  92. package/front_end/models/ai_assistance/AiAgent2.ts +14 -6
  93. package/front_end/models/ai_assistance/AiConversation.ts +37 -24
  94. package/front_end/models/ai_assistance/AlwaysAllowedTools.ts +107 -0
  95. package/front_end/models/ai_assistance/ConversationSummary.ts +2 -1
  96. package/front_end/models/ai_assistance/PerformanceAnnotations.ts +3 -1
  97. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +12 -5
  98. package/front_end/models/ai_assistance/agents/AiAgent.ts +261 -127
  99. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +12 -6
  100. package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +3 -1
  101. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +1 -1
  102. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -1
  103. package/front_end/models/ai_assistance/ai_assistance.ts +9 -10
  104. package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +27 -6
  105. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +2 -9
  106. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +3 -3
  107. package/front_end/models/ai_assistance/skills/sources.md +3 -1
  108. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +1 -0
  109. package/front_end/models/ai_assistance/tools/GetCookieValues.ts +1 -0
  110. package/front_end/models/ai_assistance/tools/GetInsightDetails.ts +3 -1
  111. package/front_end/models/ai_assistance/tools/GetSourceContent.ts +46 -4
  112. package/front_end/models/ai_assistance/tools/GetStorageValues.ts +1 -0
  113. package/front_end/models/ai_assistance/tools/RunLighthouse.ts +6 -3
  114. package/front_end/models/ai_assistance/tools/Tool.ts +11 -1
  115. package/front_end/models/bindings/CompilerScriptMapping.ts +40 -8
  116. package/front_end/models/bindings/ResourceScriptMapping.ts +1 -1
  117. package/front_end/models/breakpoints/BreakpointManager.ts +0 -4
  118. package/front_end/models/change_tracker/ChangeTracker.ts +2 -0
  119. package/front_end/models/comment_manager/CommentManager.ts +12 -0
  120. package/front_end/models/comment_manager/CommentThread.ts +34 -1
  121. package/front_end/models/computed_style/ComputedStyleModel.ts +1 -0
  122. package/front_end/models/elements/ChangeTrackingUtils.ts +37 -0
  123. package/front_end/models/elements/DOMChanges.ts +24 -36
  124. package/front_end/models/elements/StyleChanges.ts +97 -0
  125. package/front_end/models/elements/elements.ts +4 -0
  126. package/front_end/models/emulation/DeviceModeModel.ts +19 -0
  127. package/front_end/models/issues_manager/GenericIssue.ts +18 -0
  128. package/front_end/models/issues_manager/descriptions/genericGeolocationPromptWithoutUserGesture.md +5 -0
  129. package/front_end/models/javascript_metadata/NativeFunctions.ts +11 -5
  130. package/front_end/models/lighthouse/RunTypes.ts +16 -0
  131. package/front_end/models/stack_trace/StackTraceModel.ts +24 -3
  132. package/front_end/models/trace/EventsSerializer.ts +35 -2
  133. package/front_end/models/trace/extras/TraceTree.ts +2 -7
  134. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +17 -21
  135. package/front_end/models/trace/helpers/SyntheticEvents.ts +4 -2
  136. package/front_end/models/trace/helpers/Timing.ts +11 -22
  137. package/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +12 -8
  138. package/front_end/models/trace/types/File.ts +20 -3
  139. package/front_end/models/trace/types/TraceEvents.ts +8 -3
  140. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +37 -2
  141. package/front_end/panels/ai_assistance/README.md +4 -2
  142. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +1 -1
  143. package/front_end/panels/ai_assistance/ai_assistance.ts +2 -0
  144. package/front_end/panels/ai_assistance/components/ChatInput.ts +5 -43
  145. package/front_end/panels/ai_assistance/components/ChatMessage.ts +52 -147
  146. package/front_end/panels/ai_assistance/components/ChatView.ts +28 -3
  147. package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +151 -0
  148. package/front_end/panels/ai_assistance/components/RelevantDataDisclaimer.ts +73 -0
  149. package/front_end/panels/ai_assistance/components/chatInput.css +0 -59
  150. package/front_end/panels/ai_assistance/components/chatMessage.css +0 -47
  151. package/front_end/panels/ai_assistance/components/chatView.css +5 -30
  152. package/front_end/panels/ai_assistance/components/permissionPrompt.css +55 -0
  153. package/front_end/panels/ai_assistance/components/relevantDataDisclaimer.css +35 -0
  154. package/front_end/panels/application/AppManifestView.ts +1 -4
  155. package/front_end/panels/application/ApplicationPanelSidebar.ts +3 -7
  156. package/front_end/panels/application/BackgroundServiceView.ts +8 -8
  157. package/front_end/panels/application/IndexedDBViews.ts +102 -73
  158. package/front_end/panels/application/OpenedWindowDetailsView.ts +167 -130
  159. package/front_end/panels/application/ServiceWorkerCacheViews.ts +288 -346
  160. package/front_end/panels/application/StorageBucketsTreeElement.ts +22 -27
  161. package/front_end/panels/application/StorageItemsToolbar.ts +2 -2
  162. package/front_end/panels/application/components/StorageMetadataView.ts +207 -160
  163. package/front_end/panels/application/openedWindowDetailsView.css +7 -30
  164. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
  165. package/front_end/panels/changes/changesView.css +0 -6
  166. package/front_end/panels/comments/CommentsPane.ts +7 -3
  167. package/front_end/panels/comments/comments-meta.ts +1 -1
  168. package/front_end/panels/common/CommentThreadWidget.ts +67 -25
  169. package/front_end/panels/common/CommentsOverlayWidget.ts +13 -0
  170. package/front_end/panels/console/ConsoleInsightTeaser.ts +5 -1
  171. package/front_end/panels/console/ConsolePinPane.ts +1 -1
  172. package/front_end/panels/console/ConsoleView.ts +1 -0
  173. package/front_end/panels/elements/CSSValueTraceView.ts +5 -5
  174. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +14 -6
  175. package/front_end/panels/elements/ComputedStyleWidget.ts +14 -5
  176. package/front_end/panels/elements/DOMTreeElementWidget.ts +2 -2
  177. package/front_end/panels/elements/DOMTreeWidget.ts +7 -3
  178. package/front_end/panels/elements/EventListenersWidget.ts +1 -1
  179. package/front_end/panels/elements/LayersWidget.ts +1 -1
  180. package/front_end/panels/elements/PropertyRenderer.ts +178 -10
  181. package/front_end/panels/elements/StandaloneStylesContainer.ts +33 -6
  182. package/front_end/panels/elements/StylePropertiesSection.ts +1 -0
  183. package/front_end/panels/elements/StylePropertyTreeElement.ts +295 -116
  184. package/front_end/panels/elements/StylesContainer.ts +2 -0
  185. package/front_end/panels/elements/StylesSidebarPane.ts +34 -16
  186. package/front_end/panels/elements/components/QueryContainer.ts +1 -1
  187. package/front_end/panels/elements/elementStatePaneWidget.css +1 -1
  188. package/front_end/panels/elements/stylePropertiesTreeOutline.css +7 -2
  189. package/front_end/panels/elements/stylesSidebarPane.css +4 -0
  190. package/front_end/panels/emulation/DeviceModeToolbar.ts +57 -25
  191. package/front_end/panels/emulation/DeviceModeView.ts +27 -1
  192. package/front_end/panels/emulation/InspectedPagePlaceholder.ts +6 -0
  193. package/front_end/panels/emulation/MediaQueryInspector.ts +14 -4
  194. package/front_end/panels/emulation/deviceModeView.css +3 -3
  195. package/front_end/panels/explain/components/ConsoleInsight.ts +2 -3
  196. package/front_end/panels/explain/explain-meta.ts +1 -1
  197. package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +67 -34
  198. package/front_end/panels/issues/issues.ts +2 -0
  199. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +7 -3
  200. package/front_end/panels/lighthouse/LighthouseController.ts +29 -22
  201. package/front_end/panels/lighthouse/LighthousePanel.ts +5 -6
  202. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +24 -16
  203. package/front_end/panels/media/PlayerMessagesView.ts +1 -1
  204. package/front_end/panels/mobile_throttling/CPUThrottlingSelector.ts +1 -1
  205. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +45 -15
  206. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +3 -3
  207. package/front_end/panels/network/BinaryResourceView.ts +54 -50
  208. package/front_end/panels/network/RequestHeadersView.ts +6 -2
  209. package/front_end/panels/network/RequestPreviewView.ts +28 -5
  210. package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -0
  211. package/front_end/panels/network/components/EditableSpan.ts +11 -30
  212. package/front_end/panels/network/components/HeaderSectionRow.ts +2 -2
  213. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +10 -6
  214. package/front_end/panels/profiler/HeapDetachedElementsView.ts +112 -22
  215. package/front_end/panels/profiler/HeapProfileView.ts +3 -3
  216. package/front_end/panels/profiler/HeapSnapshotView.ts +12 -2
  217. package/front_end/panels/profiler/HeapTimelineOverview.ts +16 -2
  218. package/front_end/panels/profiler/profiler.ts +0 -2
  219. package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
  220. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -1
  221. package/front_end/panels/recorder/CreateRecordingView.ts +1 -1
  222. package/front_end/panels/recorder/RecordingView.ts +3 -3
  223. package/front_end/panels/recorder/ReplaySection.ts +1 -1
  224. package/front_end/panels/screencast/ScreencastApp.ts +83 -57
  225. package/front_end/panels/screencast/ScreencastView.ts +76 -45
  226. package/front_end/panels/screencast/screencastView.css +1 -1
  227. package/front_end/panels/settings/AISettingsTab.ts +107 -4
  228. package/front_end/panels/settings/aiSettingsTab.css +53 -0
  229. package/front_end/panels/settings/settings-meta.ts +1 -1
  230. package/front_end/panels/settings/settingsScreen.css +0 -4
  231. package/front_end/panels/sources/BreakpointEditDialog.ts +3 -6
  232. package/front_end/panels/sources/BreakpointsView.ts +2 -2
  233. package/front_end/panels/sources/DebuggerPlugin.ts +7 -0
  234. package/front_end/panels/sources/NavigatorView.ts +61 -18
  235. package/front_end/panels/sources/SourcesNavigator.ts +22 -7
  236. package/front_end/panels/sources/SourcesPanel.ts +1 -0
  237. package/front_end/panels/timeline/CountersGraph.ts +1 -1
  238. package/front_end/panels/timeline/README.md +12 -0
  239. package/front_end/panels/timeline/StatusDialog.ts +1 -1
  240. package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -3
  241. package/front_end/panels/timeline/TimelineCommentController.ts +346 -0
  242. package/front_end/panels/timeline/TimelineDetailsView.ts +24 -1
  243. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +34 -30
  244. package/front_end/panels/timeline/TimelineFlameChartView.ts +24 -10
  245. package/front_end/panels/timeline/TimelinePanel.ts +12 -5
  246. package/front_end/panels/timeline/TimelineTreeView.ts +28 -6
  247. package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
  248. package/front_end/panels/timeline/components/fieldSettingsDialog.css +2 -2
  249. package/front_end/panels/timeline/components/insights/baseInsightComponent.css +1 -1
  250. package/front_end/panels/timeline/overlays/components/entriesLinkOverlay.css +2 -2
  251. package/front_end/panels/timeline/overlays/components/entryLabelOverlay.css +9 -9
  252. package/front_end/panels/timeline/timeline-meta.ts +2 -2
  253. package/front_end/panels/timeline/timeline.ts +4 -0
  254. package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -2
  255. package/front_end/panels/timeline/timelinePanel.css +2 -2
  256. package/front_end/panels/timeline/utils/EntryNodes.ts +1 -1
  257. package/front_end/panels/web_audio/WebAudioView.ts +7 -4
  258. package/front_end/third_party/chromium/README.chromium +1 -1
  259. package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
  260. package/front_end/third_party/codemirror.next/chunk/angular.js.map +1 -1
  261. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  262. package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
  263. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
  264. package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
  265. package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
  266. package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
  267. package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
  268. package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
  269. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
  270. package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
  271. package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
  272. package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
  273. package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
  274. package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
  275. package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
  276. package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
  277. package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
  278. package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
  279. package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
  280. package/front_end/third_party/codemirror.next/chunk/vue.js.map +1 -1
  281. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
  282. package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
  283. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
  284. package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
  285. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  286. package/front_end/third_party/codemirror.next/rollup.config.mjs +1 -1
  287. package/front_end/third_party/puppeteer/README.chromium +2 -2
  288. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +42 -12
  289. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +154 -26
  290. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts +47 -7
  291. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  292. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js +56 -4
  293. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js.map +1 -1
  294. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +6 -4
  295. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
  296. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +5 -2
  297. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
  298. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts +3 -3
  299. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  300. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.js.map +1 -1
  301. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +2 -1
  302. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
  303. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +23 -11
  304. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
  305. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts +3 -3
  306. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  307. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js +1 -2
  308. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js.map +1 -1
  309. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts +13 -7
  310. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  311. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +26 -11
  312. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
  313. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +2 -1
  314. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
  315. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
  316. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  317. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js +69 -13
  318. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js.map +1 -1
  319. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts +10 -0
  320. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  321. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
  322. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
  323. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js.map +1 -1
  324. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  325. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  326. package/front_end/third_party/puppeteer/package/lib/types.d.ts +42 -12
  327. package/front_end/third_party/puppeteer/package/package.json +4 -4
  328. package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +103 -11
  329. package/front_end/third_party/puppeteer/package/src/api/Page.ts +11 -6
  330. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +4 -4
  331. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +26 -14
  332. package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +7 -7
  333. package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +40 -18
  334. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +2 -3
  335. package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +87 -14
  336. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +10 -0
  337. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  338. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  339. package/front_end/tsconfig.json +1 -1
  340. package/front_end/ui/comments/CommentAnchorResolver.ts +1 -1
  341. package/front_end/ui/components/buttons/Button.ts +29 -18
  342. package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +1 -1
  343. package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +94 -39
  344. package/front_end/ui/components/dialogs/dialog.css +1 -1
  345. package/front_end/ui/components/menus/menuItem.css +11 -0
  346. package/front_end/ui/components/text_editor/AccessiblePlaceholder.ts +1 -1
  347. package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +1 -1
  348. package/front_end/ui/components/text_editor/config.ts +2 -1
  349. package/front_end/ui/components/text_editor/javascript.ts +2 -1
  350. package/front_end/ui/legacy/InspectorView.ts +4 -2
  351. package/front_end/ui/legacy/SplitWidget.ts +23 -24
  352. package/front_end/ui/legacy/TabbedPane.ts +9 -1
  353. package/front_end/ui/legacy/UIUtils.ts +60 -40
  354. package/front_end/ui/legacy/components/color_picker/spectrum.css +2 -2
  355. package/front_end/ui/legacy/components/data_grid/dataGrid.css +9 -0
  356. package/front_end/ui/legacy/components/inline_editor/CSSAngle.ts +0 -1
  357. package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +5 -7
  358. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +1 -1
  359. package/front_end/ui/legacy/components/perf_ui/PieChart.ts +11 -0
  360. package/front_end/ui/legacy/components/perf_ui/chartViewport.css +4 -4
  361. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +6 -0
  362. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +1 -1
  363. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +38 -13
  364. package/front_end/ui/legacy/dropTarget.css +1 -1
  365. package/front_end/ui/legacy/statusBar.css +7 -0
  366. package/front_end/ui/legacy/tabbedPane.css +0 -7
  367. package/front_end/ui/visual_logging/KnownContextValues.ts +55 -0
  368. package/inspector_overlay/main.ts +2 -15
  369. package/inspector_overlay/tool_persistent.ts +0 -14
  370. package/mcp/mcp.ts +3 -0
  371. package/package.json +1 -1
  372. package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +0 -142
  373. package/front_end/panels/ai_assistance/components/StylingAgentMarkdownRenderer.ts +0 -178
  374. package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +0 -147
  375. package/front_end/panels/profiler/heapDetachedElementsDataGrid.css +0 -14
  376. package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +0 -62
  377. package/front_end/ui/components/legacy_wrapper/legacy_wrapper.ts +0 -8
  378. package/inspector_overlay/tool_green_dev_anchors.css +0 -54
  379. package/inspector_overlay/tool_green_dev_anchors.ts +0 -164
  380. /package/front_end/models/{ai_assistance → ai-utils}/AiSetting.ts +0 -0
  381. /package/front_end/models/{ai_assistance → ai-utils}/debug.ts +0 -0
@@ -1180,6 +1180,7 @@ export namespace ProtocolMapping {
1180
1180
  /**
1181
1181
  * Trigger autofill on a form identified by the fieldId.
1182
1182
  * If the field and related form cannot be autofilled, returns an error.
1183
+ * Returns once the values have been applied to the form fields.
1183
1184
  */
1184
1185
  'Autofill.trigger': {
1185
1186
  paramsType: [Protocol.Autofill.TriggerRequest];
@@ -446,6 +446,7 @@ declare namespace ProtocolProxyApi {
446
446
  /**
447
447
  * Trigger autofill on a form identified by the fieldId.
448
448
  * If the field and related form cannot be autofilled, returns an error.
449
+ * Returns once the values have been applied to the form fields.
449
450
  */
450
451
  invoke_trigger(params: Protocol.Autofill.TriggerRequest): Promise<Protocol.ProtocolResponseWithError>;
451
452
 
@@ -2679,9 +2679,10 @@ export namespace Browser {
2679
2679
 
2680
2680
  export interface AddMockCameraRequest {
2681
2681
  /**
2682
- * Required non-empty identifier for the mock camera. This is mapped to an
2683
- * internal virtual-device identifier and is not the MediaDeviceInfo.deviceId
2684
- * exposed to the page.
2682
+ * Required non-empty identifier for the mock camera within the current
2683
+ * DevTools session. Different sessions can use the same identifier
2684
+ * without replacing each other's cameras. This is not the
2685
+ * MediaDeviceInfo.deviceId exposed to the page.
2685
2686
  */
2686
2687
  deviceId: string;
2687
2688
  }
@@ -12304,6 +12305,7 @@ export namespace Network {
12304
12305
  RefreshedAsWaiter = 'RefreshedAsWaiter',
12305
12306
  TransientSigningError = 'TransientSigningError',
12306
12307
  InScopeRefreshNotYetNeeded = 'InScopeRefreshNotYetNeeded',
12308
+ Canceled = 'Canceled',
12307
12309
  }
12308
12310
 
12309
12311
  /**
@@ -14848,6 +14850,7 @@ export namespace Page {
14848
14850
  SyncXhr = 'sync-xhr',
14849
14851
  Tools = 'tools',
14850
14852
  Translator = 'translator',
14853
+ UnboundedElement = 'unbounded-element',
14851
14854
  Unload = 'unload',
14852
14855
  Usb = 'usb',
14853
14856
  UsbUnrestricted = 'usb-unrestricted',
@@ -6,8 +6,6 @@
6
6
  import * as Common from '../../core/common/common.js';
7
7
  import * as Root from '../../core/root/root.js';
8
8
 
9
- import {ResponseType, type SerializedResponseData} from './agents/AiAgent.js';
10
-
11
9
  export const enum ConversationType {
12
10
  NONE = 'none',
13
11
  STYLING = 'freestyler',
@@ -18,10 +16,13 @@ export const enum ConversationType {
18
16
  STORAGE = 'storage',
19
17
  }
20
18
 
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ export type SerializedResponseItem = Record<string, any>;
21
+
21
22
  export interface SerializedConversation {
22
23
  id: string;
23
24
  type: ConversationType;
24
- history: SerializedResponseData[];
25
+ history: SerializedResponseItem[];
25
26
  }
26
27
 
27
28
  export interface SerializedImage {
@@ -108,9 +109,9 @@ export class AiHistoryStorage extends Common.ObjectWrapper.ObjectWrapper<EventTy
108
109
  return structuredClone(this.#recentPromptsSetting.get());
109
110
  }
110
111
 
111
- #getImageIdsFromHistory(history: SerializedResponseData[]): string[] {
112
+ #getImageIdsFromHistory(history: SerializedResponseItem[]): string[] {
112
113
  return history.flatMap(item => {
113
- if (item.type === ResponseType.USER_QUERY && item.imageId) {
114
+ if (item.type === 'user-query' && typeof item.imageId === 'string' && item.imageId) {
114
115
  return [item.imageId];
115
116
  }
116
117
  return [];
@@ -5,10 +5,19 @@
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as Host from '../../core/host/host.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
+ import type * as Platform from '../../core/platform/platform.js';
8
9
  import * as Root from '../../core/root/root.js';
9
10
 
10
11
  import {debugLog} from './debug.js';
11
12
 
13
+ /**
14
+ * The Google legal troubleshooter form that users are sent to when they
15
+ * report a legal issue with AI generated content.
16
+ */
17
+ export const REPORT_LEGAL_ISSUE_URL =
18
+ 'https://support.google.com/legal/troubleshooter/1114905?hl=en#ts=1115658%2C13380504' as
19
+ Platform.DevToolsPath.UrlString;
20
+
12
21
  export const enum DisabledReason {
13
22
  GEO_RESTRICTED = 'geo-restricted',
14
23
  POLICY_RESTRICTED = 'policy-restricted',
@@ -126,6 +135,10 @@ export function isNaturalLanguageInterfaceEnabled(): boolean {
126
135
  return Boolean(Root.Runtime.hostConfig.devToolsAiNaturalLanguageInterface?.enabled);
127
136
  }
128
137
 
138
+ export function isAiV2Enabled(): boolean {
139
+ return Boolean(Root.Runtime.hostConfig.devToolsAiV2Architecture?.enabled);
140
+ }
141
+
129
142
  /**
130
143
  * Returns true if context selection / dynamic context switching is enabled.
131
144
  *
@@ -138,8 +151,7 @@ export function isNaturalLanguageInterfaceEnabled(): boolean {
138
151
  * removed in the future when V2 ships permanently and the V1 architecture is removed.
139
152
  */
140
153
  export function isContextSelectionEnabled(): boolean {
141
- return Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceContextSelectionAgent?.enabled) ||
142
- Boolean(Root.Runtime.hostConfig.devToolsAiV2Architecture?.enabled);
154
+ return Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceContextSelectionAgent?.enabled) || isAiV2Enabled();
143
155
  }
144
156
 
145
157
  /**
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Chromium Authors. All rights reserved.
1
+ // Copyright 2025 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
@@ -0,0 +1,17 @@
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 AiHistoryStorage from './AiHistoryStorage.js';
6
+ import * as AiSetting from './AiSetting.js';
7
+ import * as AiUtils from './AiUtils.js';
8
+ import * as BuiltInAi from './BuiltInAi.js';
9
+ import * as Debug from './debug.js';
10
+
11
+ export {
12
+ AiHistoryStorage,
13
+ AiSetting,
14
+ AiUtils,
15
+ BuiltInAi,
16
+ Debug,
17
+ };
@@ -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 * as SDK from '../../core/sdk/sdk.js';
8
+ import * as AiUtils from '../ai-utils/ai-utils.js';
8
9
  import type * as LHModel from '../lighthouse/lighthouse.js';
9
10
  import type * as Trace from '../trace/trace.js';
10
11
 
@@ -23,7 +24,6 @@ import {ChangeManager} from './ChangeManager.js';
23
24
  import {DOMNodeContext} from './contexts/DOMNodeContext.js';
24
25
  import {LighthouseContext} from './contexts/LighthouseContext.js';
25
26
  import {PerformanceTraceContext} from './contexts/PerformanceTraceContext.js';
26
- import {debugLog} from './debug.js';
27
27
  import {ExtensionScope} from './ExtensionScope.js';
28
28
  import type {Skill, SkillName} from './skills/Skill.js';
29
29
  import {SKILLS} from './skills/SkillRegistry.js';
@@ -36,6 +36,8 @@ import {
36
36
  } from './tools/Tool.js';
37
37
  import {ToolRegistry} from './tools/ToolRegistry.js';
38
38
 
39
+ const {debugLog} = AiUtils.Debug;
40
+
39
41
  const SKILL_DISPLAY_NAMES: Record<SkillName, string> = {
40
42
  styling: 'CSS and styling',
41
43
  network: 'Network requests',
@@ -82,7 +84,7 @@ export interface AiAgent2Options extends ExecuteJsAgentOptions {
82
84
  * Supplies the origin lock state for the conversation.
83
85
  */
84
86
  originLock: () => OriginLockState;
85
- lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
87
+ lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.RunTypes.RunResult>;
86
88
  performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
87
89
  }
88
90
 
@@ -201,8 +203,7 @@ export class AiAgent2 extends AiAgent<unknown> {
201
203
  #changes: ChangeManager;
202
204
  #execJs: typeof executeJsCode;
203
205
  readonly #originLock: () => OriginLockState;
204
- readonly #lighthouseRecording?:
205
- (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
206
+ readonly #lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.RunTypes.RunResult>;
206
207
  readonly #performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
207
208
 
208
209
  get options(): RequestOptions {
@@ -297,8 +298,15 @@ export class AiAgent2 extends AiAgent<unknown> {
297
298
  };
298
299
  },
299
300
  handler: async args => {
301
+ const previouslyLoaded = new Set(this.#activeSkills);
300
302
  const result = await this.learnSkill(args.skills);
301
- return {result};
303
+ // The LLM may hallucinate skill names. Filter out any skills that were not newly activated.
304
+ const loadedSkills =
305
+ [...new Set(args.skills)].filter(skill => !previouslyLoaded.has(skill) && this.#activeSkills.has(skill));
306
+ return {
307
+ result,
308
+ loadedSkills: loadedSkills.length > 0 ? loadedSkills : undefined,
309
+ };
302
310
  },
303
311
  });
304
312
  }
@@ -443,7 +451,7 @@ User query: ${enhancedQuery}`;
443
451
  getTarget: () => this.#getTarget(),
444
452
  getOriginLock: () => this.#originLock(),
445
453
  getLighthouseReport: () => (this.context instanceof LighthouseContext ? this.context.getItem() : null),
446
- runLighthouse: async overrides => await (this.#lighthouseRecording?.(overrides) ?? null),
454
+ runLighthouse: async overrides => await (this.#lighthouseRecording?.(overrides) ?? {status: 'failed'}),
447
455
  getPerformanceTraceContext: () => (this.context instanceof PerformanceTraceContext ? this.context : null),
448
456
  performanceRecordAndReload: this.#performanceRecordAndReload,
449
457
  disableLogging: () => {
@@ -8,6 +8,7 @@ import * as Root from '../../core/root/root.js';
8
8
  import * as SDK from '../../core/sdk/sdk.js';
9
9
  import type * as LHModel from '../../models/lighthouse/lighthouse.js';
10
10
  import type * as Trace from '../../models/trace/trace.js';
11
+ import * as AiUtils from '../ai-utils/ai-utils.js';
11
12
  import type * as NetworkTimeCalculator from '../network_time_calculator/network_time_calculator.js';
12
13
 
13
14
  import {AccessibilityAgent} from './agents/AccessibilityAgent.js';
@@ -21,6 +22,7 @@ import {
21
22
  type MultimodalInput,
22
23
  type ResponseData,
23
24
  ResponseType,
25
+ type SerializedResponseData,
24
26
  type UserQuery,
25
27
  } from './agents/AiAgent.js';
26
28
  import {ContextSelectionAgent} from './agents/ContextSelectionAgent.js';
@@ -30,8 +32,7 @@ import {PerformanceAgent} from './agents/PerformanceAgent.js';
30
32
  import {StorageAgent} from './agents/StorageAgent.js';
31
33
  import {StylingAgent} from './agents/StylingAgent.js';
32
34
  import {AiAgent2} from './AiAgent2.js';
33
- import {AiHistoryStorage, ConversationType, type SerializedConversation} from './AiHistoryStorage.js';
34
- import {isContextSelectionEnabled} from './AiUtils.js';
35
+ import type {AlwaysAllowedTools} from './AlwaysAllowedTools.js';
35
36
  import type {ChangeManager} from './ChangeManager.js';
36
37
  import {DOMNodeContext} from './contexts/DOMNodeContext.js';
37
38
  import {FileContext} from './contexts/FileContext.js';
@@ -42,6 +43,10 @@ import {StorageContext} from './contexts/StorageContext.js';
42
43
  import {type OriginLockState, ToolAnnotation} from './tools/Tool.js';
43
44
  import {ToolRegistry} from './tools/ToolRegistry.js';
44
45
 
46
+ type AiHistoryStorage = AiUtils.AiHistoryStorage.AiHistoryStorage;
47
+ type ConversationType = AiUtils.AiHistoryStorage.ConversationType;
48
+ type SerializedConversation = AiUtils.AiHistoryStorage.SerializedConversation;
49
+
45
50
  export const NOT_FOUND_IMAGE_DATA = '';
46
51
  export const CONTEXT_TITLE = 'Analyzing data';
47
52
  const MAX_TITLE_LENGTH = 80;
@@ -74,14 +79,15 @@ export interface AiConversationOptions {
74
79
  performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
75
80
  onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>;
76
81
  networkTimeCalculator?: NetworkTimeCalculator.NetworkTransferTimeCalculator;
77
- lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
82
+ lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.RunTypes.RunResult>;
78
83
  aiHistoryStorage?: AiHistoryStorage;
84
+ alwaysAllowedTools?: AlwaysAllowedTools;
79
85
  targetManager?: SDK.TargetManager.TargetManager;
80
86
  }
81
87
 
82
88
  export class AiConversation {
83
89
  static fromSerializedConversation(serializedConversation: SerializedConversation): AiConversation {
84
- const history = serializedConversation.history.map(entry => {
90
+ const history = (serializedConversation.history as SerializedResponseData[]).map(entry => {
85
91
  if (entry.type === ResponseType.SIDE_EFFECT) {
86
92
  return {...entry, confirm: () => {}};
87
93
  }
@@ -112,11 +118,12 @@ export class AiConversation {
112
118
  #contexts: Array<ConversationContext<unknown>> = [];
113
119
 
114
120
  #performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
115
- #lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
121
+ #lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.RunTypes.RunResult>;
116
122
  #onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>;
117
123
  #networkTimeCalculator?: NetworkTimeCalculator.NetworkTransferTimeCalculator;
118
124
  readonly #aiHistoryStorage: AiHistoryStorage;
119
125
  readonly #targetManager: SDK.TargetManager.TargetManager;
126
+ readonly #alwaysAllowedTools?: AlwaysAllowedTools;
120
127
 
121
128
  constructor(options: AiConversationOptions) {
122
129
  const {
@@ -130,9 +137,10 @@ export class AiConversation {
130
137
  onInspectElement,
131
138
  networkTimeCalculator,
132
139
  lighthouseRecording,
133
- aiHistoryStorage = AiHistoryStorage.instance(),
140
+ aiHistoryStorage = AiUtils.AiHistoryStorage.AiHistoryStorage.instance(),
134
141
  // eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
135
142
  targetManager = SDK.TargetManager.TargetManager.instance(),
143
+ alwaysAllowedTools,
136
144
  } = options;
137
145
  this.#changeManager = changeManager;
138
146
  this.#aidaClient = aidaClient;
@@ -142,6 +150,7 @@ export class AiConversation {
142
150
  this.#lighthouseRecording = lighthouseRecording;
143
151
  this.#aiHistoryStorage = aiHistoryStorage;
144
152
  this.#targetManager = targetManager;
153
+ this.#alwaysAllowedTools = alwaysAllowedTools;
145
154
 
146
155
  this.id = id;
147
156
  this.#isReadOnly = isReadOnly;
@@ -155,7 +164,8 @@ export class AiConversation {
155
164
  }
156
165
 
157
166
  static titleForSerialized(serialized: SerializedConversation): string|undefined {
158
- const query = serialized.history.find(item => item.type === ResponseType.USER_QUERY)?.query;
167
+ const query =
168
+ (serialized.history as SerializedResponseData[]).find(item => item.type === ResponseType.USER_QUERY)?.query;
159
169
  if (!query) {
160
170
  return undefined;
161
171
  }
@@ -189,8 +199,8 @@ export class AiConversation {
189
199
  setContext(updateContext: ConversationContext<unknown>|null): void {
190
200
  if (!updateContext) {
191
201
  this.#contexts = [];
192
- if (isContextSelectionEnabled()) {
193
- this.#updateAgent(ConversationType.NONE);
202
+ if (AiUtils.AiUtils.isContextSelectionEnabled()) {
203
+ this.#updateAgent(AiUtils.AiHistoryStorage.ConversationType.NONE);
194
204
  }
195
205
 
196
206
  return;
@@ -198,19 +208,19 @@ export class AiConversation {
198
208
 
199
209
  this.#contexts = [updateContext];
200
210
 
201
- if (isContextSelectionEnabled()) {
211
+ if (AiUtils.AiUtils.isContextSelectionEnabled()) {
202
212
  if (updateContext instanceof FileContext) {
203
- this.#updateAgent(ConversationType.FILE);
213
+ this.#updateAgent(AiUtils.AiHistoryStorage.ConversationType.FILE);
204
214
  } else if (updateContext instanceof DOMNodeContext) {
205
- this.#updateAgent(ConversationType.STYLING);
215
+ this.#updateAgent(AiUtils.AiHistoryStorage.ConversationType.STYLING);
206
216
  } else if (updateContext instanceof RequestContext) {
207
- this.#updateAgent(ConversationType.NETWORK);
217
+ this.#updateAgent(AiUtils.AiHistoryStorage.ConversationType.NETWORK);
208
218
  } else if (updateContext instanceof PerformanceTraceContext) {
209
- this.#updateAgent(ConversationType.PERFORMANCE);
219
+ this.#updateAgent(AiUtils.AiHistoryStorage.ConversationType.PERFORMANCE);
210
220
  } else if (updateContext instanceof LighthouseContext) {
211
- this.#updateAgent(ConversationType.ACCESSIBILITY);
221
+ this.#updateAgent(AiUtils.AiHistoryStorage.ConversationType.ACCESSIBILITY);
212
222
  } else if (updateContext instanceof StorageContext) {
213
- this.#updateAgent(ConversationType.STORAGE);
223
+ this.#updateAgent(AiUtils.AiHistoryStorage.ConversationType.STORAGE);
214
224
  }
215
225
  }
216
226
  }
@@ -337,6 +347,7 @@ export class AiConversation {
337
347
  ...item,
338
348
  output: shouldRedact ? '<redacted>' : item.output,
339
349
  widgets: undefined,
350
+ loadedSkills: undefined,
340
351
  };
341
352
  }
342
353
  default:
@@ -379,7 +390,8 @@ export class AiConversation {
379
390
  // In legacy V1 architecture, agents are recreated when switching conversation types.
380
391
  // Discard conversation history when transitioning away from Storage to prevent
381
392
  // sensitive data (e.g. cookies or storage items) from leaking into subsequent agent queries.
382
- const isTransitioningFromStorage = previousType === ConversationType.STORAGE && type !== ConversationType.STORAGE;
393
+ const isTransitioningFromStorage = previousType === AiUtils.AiHistoryStorage.ConversationType.STORAGE &&
394
+ type !== AiUtils.AiHistoryStorage.ConversationType.STORAGE;
383
395
  const history = isTransitioningFromStorage ? [] : this.#filterHistoryForNewAgent();
384
396
 
385
397
  const baseOptions = {
@@ -393,6 +405,7 @@ export class AiConversation {
393
405
  lighthouseRecording: this.#lighthouseRecording,
394
406
  history,
395
407
  targetManager: this.#targetManager,
408
+ alwaysAllowedTools: this.#alwaysAllowedTools,
396
409
  };
397
410
 
398
411
  this.#agent = Root.Runtime.hostConfig.devToolsAiV2Architecture?.enabled ? new AiAgent2({
@@ -407,19 +420,19 @@ export class AiConversation {
407
420
 
408
421
  #createV1Agent(type: ConversationType, options: AgentOptions): AiAgent<unknown> {
409
422
  switch (type) {
410
- case ConversationType.STYLING:
423
+ case AiUtils.AiHistoryStorage.ConversationType.STYLING:
411
424
  return new StylingAgent(options);
412
- case ConversationType.NETWORK:
425
+ case AiUtils.AiHistoryStorage.ConversationType.NETWORK:
413
426
  return new NetworkAgent(options);
414
- case ConversationType.FILE:
427
+ case AiUtils.AiHistoryStorage.ConversationType.FILE:
415
428
  return new FileAgent(options);
416
- case ConversationType.PERFORMANCE:
429
+ case AiUtils.AiHistoryStorage.ConversationType.PERFORMANCE:
417
430
  return new PerformanceAgent(options);
418
- case ConversationType.ACCESSIBILITY:
431
+ case AiUtils.AiHistoryStorage.ConversationType.ACCESSIBILITY:
419
432
  return new AccessibilityAgent(options);
420
- case ConversationType.STORAGE:
433
+ case AiUtils.AiHistoryStorage.ConversationType.STORAGE:
421
434
  return new StorageAgent(options);
422
- case ConversationType.NONE:
435
+ case AiUtils.AiHistoryStorage.ConversationType.NONE:
423
436
  return new ContextSelectionAgent(options);
424
437
  default:
425
438
  Platform.assertNever(type, 'Unknown conversation type');
@@ -0,0 +1,107 @@
1
+ // Copyright 2026 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as Common from '../../core/common/common.js';
6
+ import * as AiUtils from '../ai-utils/ai-utils.js';
7
+
8
+ import type {ToolName} from './tools/Tool.js';
9
+
10
+ /**
11
+ * AI tools the user allowed with "Yes, always allow".
12
+ */
13
+ export const alwaysAllowedToolsSettingDescriptor: Common.Settings.SettingDescriptor<ToolName[]> = {
14
+ name: 'ai-assistance-always-allowed-tools',
15
+ type: Common.Settings.SettingType.ARRAY,
16
+ defaultValue: [],
17
+ };
18
+
19
+ export const enum Events {
20
+ TOOLS_CHANGED = 'ToolsChanged',
21
+ }
22
+
23
+ export interface EventTypes {
24
+ [Events.TOOLS_CHANGED]: void;
25
+ }
26
+
27
+ export class AlwaysAllowedTools extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
28
+ readonly #impl: Impl;
29
+
30
+ constructor(settings: Common.Settings.Settings) {
31
+ super();
32
+ const onChange = (): void => this.dispatchEventToListeners(Events.TOOLS_CHANGED);
33
+ this.#impl =
34
+ AiUtils.AiUtils.isNaturalLanguageInterfaceEnabled() ? new SettingImpl(settings, onChange) : new DisabledImpl();
35
+ }
36
+
37
+ isAllowed(toolName: ToolName): boolean {
38
+ return this.#impl.isAllowed(toolName);
39
+ }
40
+
41
+ allow(toolName: ToolName): void {
42
+ this.#impl.allow(toolName);
43
+ }
44
+
45
+ remove(toolName: ToolName): void {
46
+ this.#impl.remove(toolName);
47
+ }
48
+
49
+ list(): readonly ToolName[] {
50
+ return this.#impl.list();
51
+ }
52
+ }
53
+
54
+ interface Impl {
55
+ isAllowed(toolName: ToolName): boolean;
56
+ allow(toolName: ToolName): void;
57
+ remove(toolName: ToolName): void;
58
+ list(): readonly ToolName[];
59
+ }
60
+
61
+ /**
62
+ * Actual implementation.
63
+ */
64
+ class SettingImpl implements Impl {
65
+ readonly #setting: Common.Settings.Setting<ToolName[]>;
66
+
67
+ constructor(settings: Common.Settings.Settings, onChange: () => void) {
68
+ this.#setting = settings.resolve(alwaysAllowedToolsSettingDescriptor);
69
+ this.#setting.addChangeListener(onChange);
70
+ }
71
+
72
+ isAllowed(toolName: ToolName): boolean {
73
+ return this.#setting.get().includes(toolName);
74
+ }
75
+
76
+ allow(toolName: ToolName): void {
77
+ this.#setting.set([...new Set([...this.#setting.get(), toolName])]);
78
+ }
79
+
80
+ remove(toolName: ToolName): void {
81
+ const toolNames = this.#setting.get().filter(tn => tn !== toolName);
82
+ this.#setting.set([...new Set(toolNames)]);
83
+ }
84
+
85
+ list(): readonly ToolName[] {
86
+ return [...new Set(this.#setting.get())];
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Fake implementation when natural language interface is disabled.
92
+ */
93
+ class DisabledImpl implements Impl {
94
+ isAllowed(): boolean {
95
+ return false;
96
+ }
97
+
98
+ allow(): void {
99
+ }
100
+
101
+ remove(): void {
102
+ }
103
+
104
+ list(): readonly ToolName[] {
105
+ return [];
106
+ }
107
+ }
@@ -4,8 +4,9 @@
4
4
 
5
5
  import * as Host from '../../core/host/host.js';
6
6
  import * as Root from '../../core/root/root.js';
7
+ import * as AiUtils from '../ai-utils/ai-utils.js';
7
8
 
8
- import {runOneShotPrompt} from './AiUtils.js';
9
+ const {runOneShotPrompt} = AiUtils.AiUtils;
9
10
 
10
11
  const preamble = `### Role
11
12
  You are a Conversation Summarizer. Your task is to take a transcript of a conversation between a user and a DevTools AI agent and produce a succinct, actionable Markdown summary. This summary will be used to help apply fixes in an IDE, so it must capture all relevant technical details, findings, and proposed code changes without any conversational fluff.
@@ -4,10 +4,12 @@
4
4
 
5
5
  import * as Host from '../../core/host/host.js';
6
6
  import * as Root from '../../core/root/root.js';
7
+ import * as AiUtils from '../ai-utils/ai-utils.js';
7
8
 
8
- import {runOneShotPrompt} from './AiUtils.js';
9
9
  import type {AICallTree} from './performance/AICallTree.js';
10
10
 
11
+ const {runOneShotPrompt} = AiUtils.AiUtils;
12
+
11
13
  const callTreePreamble = `You are an expert performance analyst embedded within Chrome DevTools.
12
14
  You meticulously examine web application behavior captured by the Chrome DevTools Performance Panel and Chrome tracing.
13
15
  You will receive a structured text representation of a call tree, derived from a user-selected call frame within a performance trace's flame chart.
@@ -6,10 +6,10 @@ import * as Host from '../../../core/host/host.js';
6
6
  import * as i18n from '../../../core/i18n/i18n.js';
7
7
  import * as Root from '../../../core/root/root.js';
8
8
  import * as SDK from '../../../core/sdk/sdk.js';
9
+ import * as AiUtils from '../../ai-utils/ai-utils.js';
9
10
  import type * as LHModel from '../../lighthouse/lighthouse.js';
10
11
  import {ChangeManager} from '../ChangeManager.js';
11
12
  import {LighthouseFormatter} from '../data_formatters/LighthouseFormatter.js';
12
- import {debugLog} from '../debug.js';
13
13
  import {ExtensionScope} from '../ExtensionScope.js';
14
14
  import {
15
15
  type OriginLockState,
@@ -31,6 +31,8 @@ import {
31
31
  executeJsCode,
32
32
  } from './ExecuteJavascript.js';
33
33
 
34
+ const {debugLog} = AiUtils.Debug;
35
+
34
36
  /**
35
37
  * WARNING: preamble defined in code is only used when userTier is
36
38
  * TESTERS. Otherwise, a server-side preamble is used (see
@@ -88,8 +90,7 @@ If the user asks a question that requires an investigation of a problem, use thi
88
90
  export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON> {
89
91
  readonly preamble: string = preamble;
90
92
  readonly clientFeature: Host.AidaClient.ClientFeature = Host.AidaClient.ClientFeature.CHROME_ACCESSIBILITY_AGENT;
91
- readonly #lighthouseRecording?:
92
- (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
93
+ readonly #lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.RunTypes.RunResult>;
93
94
 
94
95
  #execJs: typeof executeJsCode;
95
96
  #changes: ChangeManager;
@@ -300,14 +301,20 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
300
301
  if (!this.#lighthouseRecording) {
301
302
  return {error: 'Lighthouse recording is not available.'};
302
303
  }
303
- const report = await this.#lighthouseRecording({
304
+ const result = await this.#lighthouseRecording({
304
305
  mode: 'snapshot',
305
306
  categoryIds: ['accessibility'],
306
307
  isAIControlled: true,
307
308
  });
308
- if (!report) {
309
+ if (result.status === 'cancelled') {
310
+ return {
311
+ error: 'The user cancelled the accessibility audits. Do not run them again unless the user asks you to.',
312
+ };
313
+ }
314
+ if (result.status === 'failed') {
309
315
  return {error: 'Failed to run accessibility audits.'};
310
316
  }
317
+ const {report} = result;
311
318
  const audits = new LighthouseFormatter().audits(report, 'accessibility');
312
319
  return {
313
320
  result: {audits},