chrome-devtools-frontend 1.0.1669021 → 1.0.1672557
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.
- package/.agents/skills/fixing-skipped-tests/SKILL.md +6 -6
- package/.agents/skills/gerrit-cli/SKILL.md +4 -10
- package/.agents/skills/gerrit-cli/references/commands.md +45 -2
- package/.agents/skills/gerrit-cli/references/workflows.md +7 -0
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +34 -152
- package/config/typescript/tsconfig.eslint.json +1 -1
- package/docs/contributing/settings-experiments-features.md +2 -8
- package/docs/ecosystem/automatic_workspace_folders.md +0 -19
- package/eslint.config.mjs +5 -5
- package/front_end/core/common/Lazy.ts +3 -3
- package/front_end/core/common/SettingRegistration.ts +0 -7
- package/front_end/core/common/Settings.ts +0 -38
- package/front_end/core/host/UserMetrics.ts +187 -953
- package/front_end/core/host/UserMetricsEnums.ts +949 -0
- package/front_end/core/root/Runtime.ts +21 -138
- package/front_end/core/sdk/CSSMetadata.ts +70 -65
- package/front_end/core/sdk/CategorizedBreakpoint.ts +0 -1
- package/front_end/core/sdk/ChildTargetManager.ts +0 -2
- package/front_end/core/sdk/EmulationModel.ts +0 -2
- package/front_end/core/sdk/EventBreakpointsModel.ts +0 -4
- package/front_end/core/sdk/NetworkManager.ts +0 -3
- package/front_end/core/sdk/PageResourceLoader.ts +9 -9
- package/front_end/core/sdk/RehydratingConnection.ts +52 -4
- package/front_end/core/sdk/Target.ts +0 -4
- package/front_end/devtools_compatibility.js +886 -0
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +7 -6
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +0 -1
- package/front_end/entrypoints/main/MainImpl.ts +18 -22
- package/front_end/foundation/Universe.ts +7 -2
- package/front_end/generated/InspectorBackendCommands.ts +3 -10
- package/front_end/generated/{SupportedCSSProperties.js → SupportedCSSProperties.ts} +16 -0
- package/front_end/generated/protocol-mapping.d.ts +0 -42
- package/front_end/generated/protocol-proxy-api.d.ts +0 -38
- package/front_end/generated/protocol.ts +9 -169
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -3
- package/front_end/models/ai_assistance/AiConversation.ts +1 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +8 -5
- package/front_end/models/ai_assistance/AiSetting.ts +108 -0
- package/front_end/models/ai_assistance/AiUtils.ts +47 -0
- package/front_end/models/ai_assistance/ChangeManager.ts +1 -0
- package/front_end/models/ai_assistance/ExtensionScope.ts +3 -12
- package/front_end/models/ai_assistance/agents/AiAgent.ts +11 -18
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -0
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +42 -17
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -2
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +253 -155
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +12 -6
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +3 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +4 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -0
- package/front_end/models/ai_assistance/injected.ts +1 -0
- package/front_end/models/ai_assistance/performance/AICallTree.ts +1 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/performance.md +10 -0
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +52 -5
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +5 -4
- package/front_end/models/ai_assistance/tools/GetStyles.ts +5 -4
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +5 -4
- package/front_end/models/ai_assistance/tools/README.md +1 -1
- package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +63 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -5
- package/front_end/models/ai_assistance/tools/Tool.ts +118 -24
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +2 -0
- package/front_end/models/badges/UserBadges.ts +2 -0
- package/front_end/models/bindings/NetworkProject.ts +5 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -0
- package/front_end/models/bindings/ResourceUtils.ts +3 -0
- package/front_end/models/crux-manager/CrUXManager.ts +1 -0
- package/front_end/models/emulation/DeviceModeModel.ts +140 -7
- package/front_end/models/emulation/EmulatedDevices.ts +246 -793
- package/front_end/models/issues_manager/IssuesManager.ts +10 -2
- package/front_end/models/live-metrics/LiveMetrics.ts +41 -9
- package/front_end/models/logs/LogManager.ts +8 -5
- package/front_end/models/logs/NetworkLog.ts +1 -0
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +21 -3
- package/front_end/models/persistence/NetworkPersistenceManager.ts +6 -0
- package/front_end/models/project_settings/ProjectSettingsModel.ts +8 -12
- package/front_end/models/trace/Processor.ts +42 -10
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +12 -19
- package/front_end/models/trace/handlers/MetaHandler.ts +38 -5
- package/front_end/models/trace/insights/CLSCulprits.ts +1 -2
- package/front_end/models/trace/insights/CharacterSet.ts +1 -1
- package/front_end/models/trace/insights/Common.ts +21 -2
- package/front_end/models/trace/insights/DocumentLatency.ts +1 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +7 -6
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +7 -3
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/ThirdParties.ts +5 -2
- package/front_end/models/trace/insights/types.ts +11 -6
- package/front_end/models/trace/types/Configuration.ts +5 -0
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +3 -1
- package/front_end/models/workspace/IgnoreListManager.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +2 -0
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +4 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -22
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -7
- package/front_end/panels/ai_assistance/components/ChatInput.ts +4 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +79 -34
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +1 -2
- package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -106
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +1 -1
- package/front_end/panels/application/application.ts +0 -10
- package/front_end/panels/application/components/components.ts +0 -4
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +0 -5
- package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +6 -12
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +5 -3
- package/front_end/panels/console/ConsoleFormat.ts +2 -62
- package/front_end/panels/console/ConsoleViewMessage.ts +14 -7
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -2
- package/front_end/panels/emulation/AdvancedApp.ts +1 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +83 -69
- package/front_end/panels/emulation/DeviceModeView.ts +4 -134
- package/front_end/panels/emulation/DeviceModeWrapper.ts +52 -69
- package/front_end/panels/emulation/MediaQueryInspector.ts +2 -2
- package/front_end/panels/emulation/emulation-meta.ts +12 -12
- package/front_end/panels/issues/IssuesPane.ts +3 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +17 -21
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +206 -126
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
- package/front_end/panels/mobile_throttling/CalibrationController.ts +1 -1
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +3 -3
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +6 -6
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +14 -12
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +13 -13
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +10 -10
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +28 -28
- package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +6 -6
- package/front_end/panels/network/RequestHeadersView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +243 -144
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +52 -29
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +21 -35
- package/front_end/panels/network/resourceChunkView.css +41 -36
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +21 -12
- package/front_end/panels/profiler/profiler.ts +4 -0
- package/front_end/panels/recorder/RecorderPanel.ts +6 -14
- package/front_end/panels/sensors/LocationsSettingsTab.ts +7 -7
- package/front_end/panels/settings/AISettingsTab.ts +75 -31
- package/front_end/panels/settings/SettingsScreen.ts +8 -13
- package/front_end/panels/settings/components/SyncSection.ts +3 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +650 -18
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +18 -0
- package/front_end/panels/settings/settings-meta.ts +0 -1
- package/front_end/panels/sources/CategorizedBreakpointL10n.ts +0 -2
- package/front_end/panels/sources/DebuggerPausedMessage.ts +11 -5
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +12 -9
- package/front_end/panels/sources/SourcesPanel.ts +19 -17
- package/front_end/panels/sources/SourcesView.ts +191 -96
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -5
- package/front_end/panels/timeline/TimelinePanel.ts +2 -0
- package/front_end/panels/timeline/TimelineUIUtils.ts +15 -0
- package/front_end/panels/timeline/components/CWVMetrics.ts +16 -3
- package/front_end/panels/timeline/components/cwvMetrics.css +4 -0
- package/front_end/panels/timeline/components/liveMetricsView.css +0 -17
- package/front_end/panels/timeline/components/metricValueStyles.css +17 -0
- package/front_end/panels/timeline/timeline-meta.ts +3 -5
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1332 -193
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +64 -15
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +65 -16
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +50 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +8 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +16 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js +11 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js +5 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts +27 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js +12 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +5 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +64 -15
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +50 -7
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +9 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +9 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Dialog.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +24 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +11 -6
- package/front_end/third_party/puppeteer/package/src/cdp/Dialog.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/common/Debug.ts +30 -5
- package/front_end/third_party/puppeteer/package/src/common/util.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +6 -4
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/tsconfig.compatibility.json +2 -1
- package/front_end/tsconfig.json +1 -1
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +4 -7
- package/front_end/ui/components/settings/settings.ts +1 -2
- package/front_end/ui/legacy/Treeoutline.ts +52 -30
- package/front_end/ui/legacy/components/object_ui/CSSStyleSanitizer.ts +74 -0
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +6 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +47 -54
- package/front_end/ui/legacy/components/object_ui/object_ui.ts +2 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -27
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +10 -12
- package/front_end/ui/settings/SettingUIRegistration.ts +0 -8
- package/front_end/ui/visual_logging/KnownContextValues.ts +37 -0
- package/inspector_overlay/tsconfig.json +8 -2
- package/package.json +3 -2
- package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +0 -47
- package/front_end/core/sdk/CSSModel.test.api.ts +0 -102
- package/front_end/core/sdk/DOMModel.test.api.ts +0 -104
- package/front_end/foundation/Universe.test.api.ts +0 -73
- package/front_end/panels/application/SharedStorageEventsView.ts +0 -128
- package/front_end/panels/application/SharedStorageItemsView.ts +0 -179
- package/front_end/panels/application/SharedStorageListTreeElement.ts +0 -65
- package/front_end/panels/application/SharedStorageModel.ts +0 -249
- package/front_end/panels/application/SharedStorageTreeElement.ts +0 -40
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +0 -191
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +0 -133
- package/front_end/panels/application/components/sharedStorageAccessGrid.css +0 -29
- package/front_end/panels/application/components/sharedStorageMetadataView.css +0 -29
- package/front_end/panels/application/sharedStorageEventsView.css +0 -9
- package/front_end/panels/network/OriginalResourceChunkView.ts +0 -340
- package/front_end/panels/network/originalResourceChunkView.css +0 -49
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +0 -47
- package/front_end/ui/components/settings/settingDeprecationWarning.css +0 -14
- /package/front_end/generated/{ARIAProperties.js → ARIAProperties.ts} +0 -0
|
@@ -70,7 +70,7 @@ Content:
|
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"name": "executeJavaScript",
|
|
73
|
-
"description": "This function allows you to run JavaScript code on the inspected page to access the element styles and page content.\nCall this function to gather additional information or modify the page state. Call this function enough times to investigate the user request.",
|
|
73
|
+
"description": "This function allows you to run JavaScript code on the inspected page to access the element styles and page content.\nCall this function to gather additional information or modify the page state. Call this function enough times to investigate the user request. Note: You cannot make network requests using this function.",
|
|
74
74
|
"parameters": {
|
|
75
75
|
"type": 6,
|
|
76
76
|
"description": "",
|
|
@@ -78,7 +78,7 @@ Content:
|
|
|
78
78
|
"properties": {
|
|
79
79
|
"code": {
|
|
80
80
|
"type": 1,
|
|
81
|
-
"description": "JavaScript code snippet to run on the inspected page. Make sure the code is formatted for readability.\n\n# Instructions\n\n* To return data, define a top-level `data` variable and populate it with data you want to get. Only JSON-serializable objects can be assigned to `data`.\n* If you modify styles on an element, ALWAYS call the pre-defined global `async setElementStyles(el: Element, styles: object)` function. This function is an internal mechanism for you and should never be presented as a command/advice to the user.\n* **CRITICAL** Only get styles that might be relevant to the user request.\n* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.\n* **CRITICAL** Consider that `data` variable from the previous function calls are not available in a new function call.\n\nFor example, the code to change element styles:\n\n```\nawait setElementStyles($0, {\n color: 'blue',\n});\n```\n\nFor example, the code to get overlapping elements:\n\n```\nconst data = {\n overlappingElements: Array.from(document.querySelectorAll('*'))\n .filter(el => {\n const rect = el.getBoundingClientRect();\n const popupRect = $0.getBoundingClientRect();\n return (\n el !== $0 &&\n rect.left < popupRect.right &&\n rect.right > popupRect.left &&\n rect.top < popupRect.bottom &&\n rect.bottom > popupRect.top\n );\n })\n .map(el => ({\n tagName: el.tagName,\n id: el.id,\n className: el.className,\n zIndex: window.getComputedStyle(el)['z-index']\n }))\n};\n```\n"
|
|
81
|
+
"description": "JavaScript code snippet to run on the inspected page. Make sure the code is formatted for readability.\n\n# Instructions\n\n* To return data, define a top-level `data` variable and populate it with data you want to get. Only JSON-serializable objects can be assigned to `data`.\n* If you modify styles on an element, ALWAYS call the pre-defined global `async setElementStyles(el: Element, styles: object)` function. This function is an internal mechanism for you and should never be presented as a command/advice to the user.\n* **CRITICAL** Only get styles that might be relevant to the user request.\n* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.\n* **CRITICAL** Consider that `data` variable from the previous function calls are not available in a new function call.\n* **CRITICAL** Keep code concise (max 40 lines and 2,500 characters). Split complex logic into multiple steps.\n* **CRITICAL** Network requests (e.g., fetch, XMLHttpRequest) are disabled and cannot be made.\n\nFor example, the code to change element styles:\n\n```\nawait setElementStyles($0, {\n color: 'blue',\n});\n```\n\nFor example, the code to get overlapping elements:\n\n```\nconst data = {\n overlappingElements: Array.from(document.querySelectorAll('*'))\n .filter(el => {\n const rect = el.getBoundingClientRect();\n const popupRect = $0.getBoundingClientRect();\n return (\n el !== $0 &&\n rect.left < popupRect.right &&\n rect.right > popupRect.left &&\n rect.top < popupRect.bottom &&\n rect.bottom > popupRect.top\n );\n })\n .map(el => ({\n tagName: el.tagName,\n id: el.id,\n className: el.className,\n zIndex: window.getComputedStyle(el)['z-index']\n }))\n};\n```\n"
|
|
82
82
|
},
|
|
83
83
|
"explanation": {
|
|
84
84
|
"type": 1,
|
|
@@ -13,6 +13,7 @@ import * as AiAgent2 from './AiAgent2.js';
|
|
|
13
13
|
import * as AiConversation from './AiConversation.js';
|
|
14
14
|
import * as AiHistoryStorage from './AiHistoryStorage.js';
|
|
15
15
|
import * as AiOrigins from './AiOrigins.js';
|
|
16
|
+
import * as AiSetting from './AiSetting.js';
|
|
16
17
|
import * as AiUtils from './AiUtils.js';
|
|
17
18
|
import * as BuiltInAi from './BuiltInAi.js';
|
|
18
19
|
import * as ChangeManager from './ChangeManager.js';
|
|
@@ -43,6 +44,7 @@ import * as GetLighthouseAudits from './tools/GetLighthouseAudits.js';
|
|
|
43
44
|
import * as GetNetworkRequestDetails from './tools/GetNetworkRequestDetails.js';
|
|
44
45
|
import * as GetStyles from './tools/GetStyles.js';
|
|
45
46
|
import * as ListNetworkRequests from './tools/ListNetworkRequests.js';
|
|
47
|
+
import * as RecordPerformanceTrace from './tools/RecordPerformanceTrace.js';
|
|
46
48
|
import * as ResolveDevtoolsNodePath from './tools/ResolveDevtoolsNodePath.js';
|
|
47
49
|
import * as Tool from './tools/Tool.js';
|
|
48
50
|
import * as ToolRegistry from './tools/ToolRegistry.js';
|
|
@@ -58,6 +60,7 @@ export {
|
|
|
58
60
|
AiHistoryStorage,
|
|
59
61
|
AiOrigins,
|
|
60
62
|
AIQueries,
|
|
63
|
+
AiSetting,
|
|
61
64
|
AiUtils,
|
|
62
65
|
BuiltInAi,
|
|
63
66
|
ChangeManager,
|
|
@@ -85,6 +88,7 @@ export {
|
|
|
85
88
|
PerformanceInsightFormatter,
|
|
86
89
|
PerformanceTraceContext,
|
|
87
90
|
PerformanceTraceFormatter,
|
|
91
|
+
RecordPerformanceTrace,
|
|
88
92
|
RequestContext,
|
|
89
93
|
ResolveDevtoolsNodePath,
|
|
90
94
|
StorageAgent,
|
|
@@ -31,10 +31,12 @@ import {AgentFocus} from '../performance/AIContext.js';
|
|
|
31
31
|
export class PerformanceTraceContext extends ConversationContext<AgentFocus> {
|
|
32
32
|
static fromParsedTrace(
|
|
33
33
|
parsedTrace: Trace.TraceModel.ParsedTrace,
|
|
34
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
34
35
|
targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance(),
|
|
35
36
|
freshRecordingTracker: Tracing.FreshRecording.Tracker = Tracing.FreshRecording.Tracker.instance(),
|
|
36
37
|
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding =
|
|
37
|
-
|
|
38
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
39
|
+
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()): PerformanceTraceContext {
|
|
38
40
|
return new PerformanceTraceContext(
|
|
39
41
|
AgentFocus.fromParsedTrace(parsedTrace),
|
|
40
42
|
targetManager,
|
|
@@ -44,11 +46,12 @@ export class PerformanceTraceContext extends ConversationContext<AgentFocus> {
|
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
static fromInsight(parsedTrace: Trace.TraceModel.ParsedTrace, insight: Trace.Insights.Types.InsightModel,
|
|
49
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
47
50
|
targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance(),
|
|
48
51
|
freshRecordingTracker: Tracing.FreshRecording.Tracker = Tracing.FreshRecording.Tracker.instance(),
|
|
49
52
|
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding =
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
54
|
+
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()): PerformanceTraceContext {
|
|
52
55
|
return new PerformanceTraceContext(
|
|
53
56
|
AgentFocus.fromInsight(parsedTrace, insight),
|
|
54
57
|
targetManager,
|
|
@@ -58,11 +61,12 @@ export class PerformanceTraceContext extends ConversationContext<AgentFocus> {
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
static fromCallTree(callTree: AICallTree,
|
|
64
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
61
65
|
targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance(),
|
|
62
66
|
freshRecordingTracker: Tracing.FreshRecording.Tracker = Tracing.FreshRecording.Tracker.instance(),
|
|
63
67
|
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding =
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
69
|
+
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()): PerformanceTraceContext {
|
|
66
70
|
return new PerformanceTraceContext(
|
|
67
71
|
AgentFocus.fromCallTree(callTree),
|
|
68
72
|
targetManager,
|
|
@@ -77,10 +81,12 @@ export class PerformanceTraceContext extends ConversationContext<AgentFocus> {
|
|
|
77
81
|
readonly #debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding;
|
|
78
82
|
|
|
79
83
|
constructor(focus: AgentFocus,
|
|
84
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
80
85
|
targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance(),
|
|
81
86
|
freshRecordingTracker: Tracing.FreshRecording.Tracker = Tracing.FreshRecording.Tracker.instance(),
|
|
82
87
|
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding =
|
|
83
|
-
|
|
88
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
89
|
+
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()) {
|
|
84
90
|
super();
|
|
85
91
|
this.#focus = focus;
|
|
86
92
|
this.#targetManager = targetManager;
|
|
@@ -56,7 +56,9 @@ export class FileFormatter {
|
|
|
56
56
|
constructor(
|
|
57
57
|
file: Workspace.UISourceCode.UISourceCode,
|
|
58
58
|
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding =
|
|
59
|
-
|
|
59
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
60
|
+
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance(),
|
|
61
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
60
62
|
networkLog: Logs.NetworkLog.NetworkLog = Logs.NetworkLog.NetworkLog.instance(),
|
|
61
63
|
) {
|
|
62
64
|
this.#file = file;
|
|
@@ -136,6 +136,7 @@ export class NetworkRequestFormatter {
|
|
|
136
136
|
constructor(
|
|
137
137
|
request: SDK.NetworkRequest.NetworkRequest,
|
|
138
138
|
calculator: NetworkTimeCalculator.NetworkTransferTimeCalculator,
|
|
139
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
139
140
|
networkLog: Logs.NetworkLog.NetworkLog = Logs.NetworkLog.NetworkLog.instance(),
|
|
140
141
|
) {
|
|
141
142
|
this.#request = request;
|
|
@@ -14,8 +14,8 @@ import {bytes, millis} from './UnitFormatters.js';
|
|
|
14
14
|
/**
|
|
15
15
|
* For a given frame ID and navigation ID, returns the LCP Event and the LCP Request, if the resource was an image.
|
|
16
16
|
*/
|
|
17
|
-
function getLCPData(
|
|
18
|
-
|
|
17
|
+
function getLCPData(parsedTrace: Trace.TraceModel.ParsedTrace, frameId: string,
|
|
18
|
+
navigation: Trace.Types.Events.NavigationStart|Trace.Types.Events.SoftNavigationStart): {
|
|
19
19
|
lcpEvent: Trace.Types.Events.LargestContentfulPaintCandidate,
|
|
20
20
|
metricScore: Trace.Handlers.ModelHandlers.PageLoadMetrics.LCPMetricScore,
|
|
21
21
|
lcpRequest?: Trace.Types.Events.SyntheticNetworkRequest,
|
|
@@ -34,7 +34,8 @@ function getLCPData(
|
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const navigationId =
|
|
37
|
+
const navigationId =
|
|
38
|
+
Trace.Types.Events.isSoftNavigationStart(navigation) ? undefined : navigation.args.data?.navigationId;
|
|
38
39
|
|
|
39
40
|
return {
|
|
40
41
|
lcpEvent,
|
package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt
CHANGED
|
@@ -574,7 +574,7 @@ The following is a list of insight sets. An insight set covers a specific part o
|
|
|
574
574
|
## insight set id: NAVIGATION_0
|
|
575
575
|
|
|
576
576
|
URL: http://localhost:8080/render-blocking
|
|
577
|
-
Bounds: {min: 171607579779µs, max:
|
|
577
|
+
Bounds: {min: 171607579779µs, max: 171613750570µs}
|
|
578
578
|
Metrics (lab / observed):
|
|
579
579
|
- LCP: 1317 ms, event: (eventKey: r-6686, ts: 171608897210), nodeId: 10
|
|
580
580
|
- LCP breakdown:
|
|
@@ -57,6 +57,7 @@ export class PerformanceTraceFormatter {
|
|
|
57
57
|
// In environments outside DevTools (like the MCP server or some tests),
|
|
58
58
|
// CrUXManager.instance() can fail due to uninitialized global settings/storage.
|
|
59
59
|
try {
|
|
60
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
60
61
|
this.#cruxManager = CrUXManager.CrUXManager.instance();
|
|
61
62
|
} catch {
|
|
62
63
|
this.#cruxManager = null;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
export const AI_ASSISTANCE_CSS_CLASS_NAME = 'ai-style-change';
|
|
14
14
|
export const FREESTYLER_WORLD_NAME = 'DevTools AI Assistance';
|
|
15
|
+
export const FREESTYLER_WORLD_CSP = 'connect-src \'none\'';
|
|
15
16
|
export const FREESTYLER_BINDING_NAME = '__freestyler';
|
|
16
17
|
|
|
17
18
|
export interface FreestyleCallbackArgs {
|
|
@@ -33,6 +33,7 @@ export class AICallTree {
|
|
|
33
33
|
public selectedNode: Trace.Extras.TraceTree.Node|null,
|
|
34
34
|
public rootNode: Trace.Extras.TraceTree.TopDownRootNode,
|
|
35
35
|
public parsedTrace: Trace.TraceModel.ParsedTrace,
|
|
36
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
36
37
|
public workspace: Workspace.Workspace.WorkspaceImpl = Workspace.Workspace.WorkspaceImpl.instance(),
|
|
37
38
|
) {
|
|
38
39
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
// This will become a union type as we add more skills (e.g. 'styling' | 'network').
|
|
6
|
-
export type SkillName = 'styling'|'network'|'accessibility';
|
|
6
|
+
export type SkillName = 'styling'|'network'|'accessibility'|'performance';
|
|
7
7
|
|
|
8
8
|
export interface Skill {
|
|
9
9
|
name: SkillName;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import {skill as accessibilitySkill} from './accessibility.skill.js';
|
|
6
6
|
import {skill as networkSkill} from './network.skill.js';
|
|
7
|
+
import {skill as performanceSkill} from './performance.skill.js';
|
|
7
8
|
import type {Skill, SkillName} from './Skill.js';
|
|
8
9
|
import {skill as stylingSkill} from './styling.skill.js';
|
|
9
10
|
|
|
@@ -11,4 +12,5 @@ export const SKILLS: Record<SkillName, Skill> = {
|
|
|
11
12
|
styling: stylingSkill,
|
|
12
13
|
network: networkSkill,
|
|
13
14
|
accessibility: accessibilitySkill,
|
|
15
|
+
performance: performanceSkill,
|
|
14
16
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance
|
|
3
|
+
description: Web performance analysis, trace inspection, and trace recording.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- recordPerformanceTrace
|
|
6
|
+
---
|
|
7
|
+
You are an expert web performance assistant integrated into Chrome DevTools.
|
|
8
|
+
Your goal is to help users analyze, measure, and improve web page performance.
|
|
9
|
+
|
|
10
|
+
Use `recordPerformanceTrace` to record a new performance trace when requested by the user or when live measurement is required.
|
|
@@ -2,20 +2,27 @@
|
|
|
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
|
|
|
5
|
+
import * as Common from '../../../core/common/common.js';
|
|
5
6
|
import * as Host from '../../../core/host/host.js';
|
|
6
7
|
import * as Root from '../../../core/root/root.js';
|
|
7
|
-
import
|
|
8
|
+
import * as Formatter from '../../formatter/formatter.js';
|
|
9
|
+
import type {FunctionHandlerOptions} from '../agents/AiAgent.js';
|
|
8
10
|
import {JavascriptExecutor} from '../agents/ExecuteJavascript.js';
|
|
9
11
|
|
|
10
12
|
import {
|
|
11
13
|
type BaseToolCapability,
|
|
14
|
+
type DataHandlerResult,
|
|
15
|
+
type DataTool,
|
|
12
16
|
type PageExecutionCapability,
|
|
13
17
|
type StyleMutationCapability,
|
|
14
|
-
type Tool,
|
|
15
18
|
type ToolArgs,
|
|
16
19
|
ToolName,
|
|
17
20
|
} from './Tool.js';
|
|
18
21
|
|
|
22
|
+
const MAX_FORMATTED_LINES = 40;
|
|
23
|
+
const MAX_LINE_LENGTH = 120;
|
|
24
|
+
const MAX_TOTAL_CHARACTERS = 2500;
|
|
25
|
+
|
|
19
26
|
export interface ExecuteJavaScriptArgs extends ToolArgs {
|
|
20
27
|
code: string;
|
|
21
28
|
explanation: string;
|
|
@@ -23,11 +30,39 @@ export interface ExecuteJavaScriptArgs extends ToolArgs {
|
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
export class ExecuteJavaScriptTool implements
|
|
26
|
-
|
|
33
|
+
DataTool<ExecuteJavaScriptArgs, unknown, BaseToolCapability&PageExecutionCapability&StyleMutationCapability> {
|
|
27
34
|
readonly name = ToolName.EXECUTE_JAVASCRIPT;
|
|
28
35
|
|
|
29
36
|
readonly description =
|
|
30
|
-
'This function allows you to run JavaScript code on the inspected page to access the element styles and page content.\nCall this function to gather additional information or modify the page state. Call this function enough times to investigate the user request.';
|
|
37
|
+
'This function allows you to run JavaScript code on the inspected page to access the element styles and page content.\nCall this function to gather additional information or modify the page state. Call this function enough times to investigate the user request. Note: You cannot make network requests using this function.';
|
|
38
|
+
|
|
39
|
+
static async validateAndFormatCode(code: string): Promise<{formattedCode?: string, error?: string}> {
|
|
40
|
+
try {
|
|
41
|
+
const formatted = await Formatter.ScriptFormatter.formatScriptContent(
|
|
42
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
43
|
+
Common.Settings.Settings.instance(),
|
|
44
|
+
'text/javascript',
|
|
45
|
+
code,
|
|
46
|
+
' ',
|
|
47
|
+
);
|
|
48
|
+
const formattedCode = formatted.formattedContent;
|
|
49
|
+
const lines = formattedCode.split('\n');
|
|
50
|
+
const maxLineLen = Math.max(...lines.map(line => line.length));
|
|
51
|
+
|
|
52
|
+
if (lines.length > MAX_FORMATTED_LINES || maxLineLen > MAX_LINE_LENGTH ||
|
|
53
|
+
formattedCode.length > MAX_TOTAL_CHARACTERS) {
|
|
54
|
+
return {
|
|
55
|
+
error: `Error: JavaScript code exceeds maximum allowed size ` +
|
|
56
|
+
`(max ${MAX_FORMATTED_LINES} formatted lines, ${MAX_LINE_LENGTH} chars/line, ${
|
|
57
|
+
MAX_TOTAL_CHARACTERS} total chars). ` +
|
|
58
|
+
`Please split your logic into smaller function calls.`,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return {formattedCode};
|
|
62
|
+
} catch {
|
|
63
|
+
return {error: 'Error: JavaScript code snippet contains invalid syntax.'};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
31
66
|
|
|
32
67
|
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof ExecuteJavaScriptArgs> = {
|
|
33
68
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
@@ -46,6 +81,8 @@ export class ExecuteJavaScriptTool implements
|
|
|
46
81
|
* **CRITICAL** Only get styles that might be relevant to the user request.
|
|
47
82
|
* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.
|
|
48
83
|
* **CRITICAL** Consider that \`data\` variable from the previous function calls are not available in a new function call.
|
|
84
|
+
* **CRITICAL** Keep code concise (max 40 lines and 2,500 characters). Split complex logic into multiple steps.
|
|
85
|
+
* **CRITICAL** Network requests (e.g., fetch, XMLHttpRequest) are disabled and cannot be made.
|
|
49
86
|
|
|
50
87
|
For example, the code to change element styles:
|
|
51
88
|
|
|
@@ -109,12 +146,22 @@ const data = {
|
|
|
109
146
|
params: ExecuteJavaScriptArgs,
|
|
110
147
|
context: BaseToolCapability&PageExecutionCapability&StyleMutationCapability,
|
|
111
148
|
options?: FunctionHandlerOptions,
|
|
112
|
-
): Promise<
|
|
149
|
+
): Promise<DataHandlerResult<unknown>> {
|
|
113
150
|
const executionNode = context.getExecutionContextNode();
|
|
114
151
|
if (!executionNode) {
|
|
115
152
|
return {error: 'Error: Could not find the context node for execution.'};
|
|
116
153
|
}
|
|
117
154
|
|
|
155
|
+
if (Root.Runtime.hostConfig.devToolsAiV2Architecture?.enabled) {
|
|
156
|
+
const validationResult = await ExecuteJavaScriptTool.validateAndFormatCode(params.code);
|
|
157
|
+
if (validationResult.error) {
|
|
158
|
+
return {error: validationResult.error};
|
|
159
|
+
}
|
|
160
|
+
if (validationResult.formattedCode) {
|
|
161
|
+
params.code = validationResult.formattedCode;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
118
165
|
const executionMode = Root.Runtime.hostConfig.devToolsFreestyler?.executionMode ??
|
|
119
166
|
Root.Runtime.HostConfigFreestylerExecutionMode.ALL_SCRIPTS;
|
|
120
167
|
|
|
@@ -6,14 +6,14 @@ import * as Host from '../../../core/host/host.js';
|
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
8
8
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
9
|
-
import type {FunctionCallHandlerResult} from '../agents/AiAgent.js';
|
|
10
9
|
import {DOMNodeContext} from '../contexts/DOMNodeContext.js';
|
|
11
10
|
|
|
12
11
|
import {
|
|
13
12
|
type BaseToolCapability,
|
|
13
|
+
type DataHandlerResult,
|
|
14
|
+
type DataTool,
|
|
14
15
|
type OriginLockCapability,
|
|
15
16
|
type TargetCapability,
|
|
16
|
-
type Tool,
|
|
17
17
|
type ToolArgs,
|
|
18
18
|
ToolName,
|
|
19
19
|
} from './Tool.js';
|
|
@@ -34,7 +34,7 @@ export interface GetElementAccessibilityDetailsArgs extends ToolArgs {
|
|
|
34
34
|
* for a resolved element backend node ID. It also returns a DOM snapshot of the element's subtree.
|
|
35
35
|
*/
|
|
36
36
|
export class GetElementAccessibilityDetailsTool implements
|
|
37
|
-
|
|
37
|
+
DataTool<GetElementAccessibilityDetailsArgs, string, BaseToolCapability&TargetCapability&OriginLockCapability> {
|
|
38
38
|
readonly name = ToolName.GET_ELEMENT_ACCESSIBILITY_DETAILS;
|
|
39
39
|
readonly description =
|
|
40
40
|
'Get detailed accessibility information for an element on the inspected page by its backend node ID.';
|
|
@@ -79,7 +79,7 @@ export class GetElementAccessibilityDetailsTool implements
|
|
|
79
79
|
async handler(
|
|
80
80
|
params: GetElementAccessibilityDetailsArgs,
|
|
81
81
|
context: BaseToolCapability&TargetCapability&OriginLockCapability,
|
|
82
|
-
): Promise<
|
|
82
|
+
): Promise<DataHandlerResult<string>> {
|
|
83
83
|
const establishedOrigin = context.getEstablishedOrigin();
|
|
84
84
|
if (!establishedOrigin) {
|
|
85
85
|
return {error: 'Error: Origin lock is not established.'};
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Host from '../../../core/host/host.js';
|
|
6
6
|
import type * as LHModel from '../../lighthouse/lighthouse.js';
|
|
7
|
-
import type {FunctionCallHandlerResult} from '../agents/AiAgent.js';
|
|
8
7
|
import {AccessibilityContext} from '../contexts/AccessibilityContext.js';
|
|
9
8
|
import {LighthouseFormatter} from '../data_formatters/LighthouseFormatter.js';
|
|
10
9
|
|
|
11
|
-
import {type BaseToolCapability, type
|
|
10
|
+
import {type BaseToolCapability, type DataHandlerResult, type DataTool, type ToolArgs, ToolName} from './Tool.js';
|
|
12
11
|
|
|
13
12
|
export interface GetLighthouseAuditsArgs extends ToolArgs {
|
|
14
13
|
categoryId: LHModel.RunTypes.CategoryId;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
export class GetLighthouseAuditsTool implements
|
|
16
|
+
export class GetLighthouseAuditsTool implements
|
|
17
|
+
DataTool<GetLighthouseAuditsArgs, {audits: string}, BaseToolCapability> {
|
|
18
18
|
readonly name = ToolName.GET_LIGHTHOUSE_AUDITS;
|
|
19
19
|
readonly description = 'Returns the audits for a specific Lighthouse category.';
|
|
20
20
|
|
|
@@ -40,7 +40,7 @@ export class GetLighthouseAuditsTool implements Tool<GetLighthouseAuditsArgs, {a
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
async handler(params: GetLighthouseAuditsArgs,
|
|
43
|
-
context: BaseToolCapability): Promise<
|
|
43
|
+
context: BaseToolCapability): Promise<DataHandlerResult<{audits: string}>> {
|
|
44
44
|
if (!(context.conversationContext instanceof AccessibilityContext)) {
|
|
45
45
|
return {error: 'Error: Active context is not a Lighthouse report.'};
|
|
46
46
|
}
|
|
@@ -6,15 +6,15 @@ import * as Host from '../../../core/host/host.js';
|
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import * as Logs from '../../logs/logs.js';
|
|
8
8
|
import * as NetworkTimeCalculator from '../../network_time_calculator/network_time_calculator.js';
|
|
9
|
-
import type {FunctionCallHandlerResult} from '../agents/AiAgent.js';
|
|
10
9
|
import {isOpaqueOrigin} from '../AiOrigins.js';
|
|
11
10
|
import {getRequestContextOrigin} from '../contexts/RequestContext.js';
|
|
12
11
|
import {NetworkRequestFormatter} from '../data_formatters/NetworkRequestFormatter.js';
|
|
13
12
|
|
|
14
13
|
import {
|
|
15
14
|
type BaseToolCapability,
|
|
15
|
+
type DataHandlerResult,
|
|
16
|
+
type DataTool,
|
|
16
17
|
type OriginLockCapability,
|
|
17
|
-
type Tool,
|
|
18
18
|
type ToolArgs,
|
|
19
19
|
ToolName,
|
|
20
20
|
} from './Tool.js';
|
|
@@ -33,7 +33,7 @@ export interface GetNetworkRequestDetailsArgs extends ToolArgs {
|
|
|
33
33
|
* The details include request/response headers, status code, timings, and the response body.
|
|
34
34
|
*/
|
|
35
35
|
export class GetNetworkRequestDetailsTool implements
|
|
36
|
-
|
|
36
|
+
DataTool<GetNetworkRequestDetailsArgs, unknown, BaseToolCapability&OriginLockCapability> {
|
|
37
37
|
readonly name = ToolName.GET_NETWORK_REQUEST_DETAILS;
|
|
38
38
|
readonly description =
|
|
39
39
|
'Retrieves the full headers, timing, status, and body details of a specific network request by ID.';
|
|
@@ -75,7 +75,7 @@ export class GetNetworkRequestDetailsTool implements
|
|
|
75
75
|
async handler(
|
|
76
76
|
args: GetNetworkRequestDetailsArgs,
|
|
77
77
|
context: BaseToolCapability&OriginLockCapability,
|
|
78
|
-
): Promise<
|
|
78
|
+
): Promise<DataHandlerResult<unknown>> {
|
|
79
79
|
// A conversation is locked to an origin once the first query is made.
|
|
80
80
|
// We only allow inspecting requests matching the conversation's established origin.
|
|
81
81
|
const origin = context.getEstablishedOrigin();
|
|
@@ -87,6 +87,7 @@ export class GetNetworkRequestDetailsTool implements
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
90
91
|
const networkLog = this.#networkLog ?? Logs.NetworkLog.NetworkLog.instance();
|
|
91
92
|
const request = networkLog.requests().find(req => {
|
|
92
93
|
if (req.requestId() !== args.id) {
|
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
import * as Host from '../../../core/host/host.js';
|
|
6
6
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
7
7
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
8
|
-
import type {ComputedStyleAiWidget,
|
|
8
|
+
import type {ComputedStyleAiWidget, FunctionHandlerOptions} from '../agents/AiAgent.js';
|
|
9
9
|
import {DOMNodeContext} from '../contexts/DOMNodeContext.js';
|
|
10
10
|
import {debugLog} from '../debug.js';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
type BaseToolCapability,
|
|
14
|
+
type DataHandlerResult,
|
|
15
|
+
type DataTool,
|
|
14
16
|
type OriginLockCapability,
|
|
15
17
|
type TargetCapability,
|
|
16
|
-
type Tool,
|
|
17
18
|
type ToolArgs,
|
|
18
19
|
ToolName,
|
|
19
20
|
} from './Tool.js';
|
|
@@ -25,7 +26,7 @@ export interface GetStylesArgs extends ToolArgs {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export class GetStylesTool implements
|
|
28
|
-
|
|
29
|
+
DataTool<GetStylesArgs, unknown, BaseToolCapability&TargetCapability&OriginLockCapability> {
|
|
29
30
|
readonly name = ToolName.GET_STYLES;
|
|
30
31
|
readonly description =
|
|
31
32
|
`Get computed and source styles for one or multiple elements on the inspected page for multiple elements at once by uid.
|
|
@@ -81,7 +82,7 @@ export class GetStylesTool implements
|
|
|
81
82
|
params: GetStylesArgs,
|
|
82
83
|
context: BaseToolCapability&TargetCapability&OriginLockCapability,
|
|
83
84
|
_options?: FunctionHandlerOptions,
|
|
84
|
-
): Promise<
|
|
85
|
+
): Promise<DataHandlerResult<unknown>> {
|
|
85
86
|
const widgets: ComputedStyleAiWidget[] = [];
|
|
86
87
|
const result:
|
|
87
88
|
Record<string, {computed: Record<string, string|undefined>, authored: Record<string, string|undefined>}> = {};
|
|
@@ -6,15 +6,15 @@ import * as Host from '../../../core/host/host.js';
|
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import type * as SDK from '../../../core/sdk/sdk.js';
|
|
8
8
|
import * as Logs from '../../logs/logs.js';
|
|
9
|
-
import type {FunctionCallHandlerResult} from '../agents/AiAgent.js';
|
|
10
9
|
import {isOpaqueOrigin} from '../AiOrigins.js';
|
|
11
10
|
import {getRequestContextOrigin} from '../contexts/RequestContext.js';
|
|
12
11
|
import {formatBytesToKb, seconds} from '../data_formatters/UnitFormatters.js';
|
|
13
12
|
|
|
14
13
|
import {
|
|
15
14
|
type BaseToolCapability,
|
|
15
|
+
type DataHandlerResult,
|
|
16
|
+
type DataTool,
|
|
16
17
|
type OriginLockCapability,
|
|
17
|
-
type Tool,
|
|
18
18
|
ToolName,
|
|
19
19
|
} from './Tool.js';
|
|
20
20
|
|
|
@@ -37,7 +37,7 @@ interface NetworkRequestSummary {
|
|
|
37
37
|
* Filters the list by the conversation's established origin to prevent cross-origin data exposure.
|
|
38
38
|
*/
|
|
39
39
|
export class ListNetworkRequestsTool implements
|
|
40
|
-
|
|
40
|
+
DataTool<Record<string, never>, unknown, BaseToolCapability&OriginLockCapability> {
|
|
41
41
|
readonly name = ToolName.LIST_NETWORK_REQUESTS;
|
|
42
42
|
readonly description = 'Gives a list of network requests including URL, status code, and duration.';
|
|
43
43
|
|
|
@@ -72,7 +72,7 @@ export class ListNetworkRequestsTool implements
|
|
|
72
72
|
async handler(
|
|
73
73
|
_params: Record<string, never>,
|
|
74
74
|
context: BaseToolCapability&OriginLockCapability,
|
|
75
|
-
): Promise<
|
|
75
|
+
): Promise<DataHandlerResult<unknown>> {
|
|
76
76
|
const requests: NetworkRequestSummary[] = [];
|
|
77
77
|
// A conversation is locked to an origin once the first query is made.
|
|
78
78
|
// We only allow inspecting requests matching the conversation's established origin.
|
|
@@ -85,6 +85,7 @@ export class ListNetworkRequestsTool implements
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
88
89
|
const networkLog = this.#networkLog ?? Logs.NetworkLog.NetworkLog.instance();
|
|
89
90
|
let hasCrossOriginRequest = false;
|
|
90
91
|
const requestsToShow: SDK.NetworkRequest.NetworkRequest[] = [];
|
|
@@ -25,7 +25,7 @@ The Agent (e.g., `AiAgent2`) builds the complete dependency union (`AllToolsCapa
|
|
|
25
25
|
|
|
26
26
|
## Returning UI Widgets
|
|
27
27
|
|
|
28
|
-
Tools can return rich UI components (widgets) to be rendered directly in the AI Assistance panel alongside text results. To do this, include the widget payload in the `widgets` field of the returned `
|
|
28
|
+
Tools can return rich UI components (widgets) to be rendered directly in the AI Assistance panel alongside text results. To do this, include the widget payload in the `widgets` field of the returned `ToolDataResult` or `ToolContextResult`:
|
|
29
29
|
|
|
30
30
|
```typescript
|
|
31
31
|
return {
|
|
@@ -0,0 +1,63 @@
|
|
|
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 Host from '../../../core/host/host.js';
|
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
+
import {PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
8
|
+
import type {AgentFocus} from '../performance/AIContext.js';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
type BaseToolCapability,
|
|
12
|
+
type ContextHandlerResult,
|
|
13
|
+
type ContextTool,
|
|
14
|
+
type PerformanceRecordingCapability,
|
|
15
|
+
ToolName,
|
|
16
|
+
} from './Tool.js';
|
|
17
|
+
|
|
18
|
+
const UIStringsNotTranslate = {
|
|
19
|
+
recordingPerformanceTrace: 'Recording a performance trace',
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
const lockedString = i18n.i18n.lockedString;
|
|
23
|
+
|
|
24
|
+
export class RecordPerformanceTraceTool implements
|
|
25
|
+
ContextTool<Record<string, never>, AgentFocus, BaseToolCapability&PerformanceRecordingCapability> {
|
|
26
|
+
readonly name = ToolName.RECORD_PERFORMANCE_TRACE;
|
|
27
|
+
readonly description = 'Records a new performance trace to measure, analyze, and debug page performance.';
|
|
28
|
+
|
|
29
|
+
readonly parameters: Host.AidaClient.FunctionObjectParam<never> = {
|
|
30
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
31
|
+
description: 'Parameters for recording a performance trace.',
|
|
32
|
+
nullable: false,
|
|
33
|
+
properties: {},
|
|
34
|
+
required: [],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
displayInfoFromArgs(): {
|
|
38
|
+
title: string,
|
|
39
|
+
action: string,
|
|
40
|
+
} {
|
|
41
|
+
return {
|
|
42
|
+
title: lockedString(UIStringsNotTranslate.recordingPerformanceTrace),
|
|
43
|
+
action: 'recordPerformanceTrace()',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async handler(_params: Record<string, never>, capabilities: BaseToolCapability&PerformanceRecordingCapability):
|
|
48
|
+
Promise<ContextHandlerResult<AgentFocus>> {
|
|
49
|
+
if (!capabilities.performanceRecordAndReload) {
|
|
50
|
+
return {error: 'Performance recording is not available.'};
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const result = await capabilities.performanceRecordAndReload();
|
|
54
|
+
return {
|
|
55
|
+
context: PerformanceTraceContext.fromParsedTrace(result),
|
|
56
|
+
description: 'User recorded a performance trace',
|
|
57
|
+
widgets: [{name: 'PERFORMANCE_TRACE', data: {parsedTrace: result}}],
|
|
58
|
+
};
|
|
59
|
+
} catch (err) {
|
|
60
|
+
return {error: `Failed to record performance trace: ${err instanceof Error ? err.message : String(err)}`};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Host from '../../../core/host/host.js';
|
|
6
6
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
7
|
-
import type {FunctionCallHandlerResult} from '../agents/AiAgent.js';
|
|
8
7
|
import {DOMNodeContext} from '../contexts/DOMNodeContext.js';
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
type BaseToolCapability,
|
|
11
|
+
type DataHandlerResult,
|
|
12
|
+
type DataTool,
|
|
12
13
|
type OriginLockCapability,
|
|
13
14
|
type TargetCapability,
|
|
14
|
-
type Tool,
|
|
15
15
|
type ToolArgs,
|
|
16
16
|
ToolName,
|
|
17
17
|
} from './Tool.js';
|
|
@@ -36,8 +36,8 @@ export interface ResolveDevtoolsNodePathArgs extends ToolArgs {
|
|
|
36
36
|
* Lighthouse reports or other sources using node paths. It ensures the resolved node
|
|
37
37
|
* belongs to the locked origin.
|
|
38
38
|
*/
|
|
39
|
-
export class ResolveDevtoolsNodePathTool implements
|
|
40
|
-
|
|
39
|
+
export class ResolveDevtoolsNodePathTool implements DataTool<ResolveDevtoolsNodePathArgs, {backendNodeId: number},
|
|
40
|
+
BaseToolCapability&TargetCapability&OriginLockCapability> {
|
|
41
41
|
readonly name = ToolName.RESOLVE_DEVTOOLS_NODE_PATH;
|
|
42
42
|
readonly description = 'Resolves a DevTools node path to a backend node ID.';
|
|
43
43
|
|
|
@@ -82,7 +82,7 @@ export class ResolveDevtoolsNodePathTool implements Tool<ResolveDevtoolsNodePath
|
|
|
82
82
|
async handler(
|
|
83
83
|
params: ResolveDevtoolsNodePathArgs,
|
|
84
84
|
context: BaseToolCapability&TargetCapability&OriginLockCapability,
|
|
85
|
-
): Promise<
|
|
85
|
+
): Promise<DataHandlerResult<{backendNodeId: number}>> {
|
|
86
86
|
const establishedOrigin = context.getEstablishedOrigin();
|
|
87
87
|
if (!establishedOrigin) {
|
|
88
88
|
return {error: 'Error: Origin lock is not established.'};
|