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
|
@@ -1334,6 +1334,7 @@ export namespace Audits {
|
|
|
1334
1334
|
TooManyRequests = 'TooManyRequests',
|
|
1335
1335
|
WellKnownHttpNotFound = 'WellKnownHttpNotFound',
|
|
1336
1336
|
WellKnownNoResponse = 'WellKnownNoResponse',
|
|
1337
|
+
WellKnownBlockedByConnectionAllowlist = 'WellKnownBlockedByConnectionAllowlist',
|
|
1337
1338
|
WellKnownInvalidResponse = 'WellKnownInvalidResponse',
|
|
1338
1339
|
WellKnownListEmpty = 'WellKnownListEmpty',
|
|
1339
1340
|
WellKnownInvalidContentType = 'WellKnownInvalidContentType',
|
|
@@ -1341,6 +1342,7 @@ export namespace Audits {
|
|
|
1341
1342
|
WellKnownTooBig = 'WellKnownTooBig',
|
|
1342
1343
|
ConfigHttpNotFound = 'ConfigHttpNotFound',
|
|
1343
1344
|
ConfigNoResponse = 'ConfigNoResponse',
|
|
1345
|
+
ConfigBlockedByConnectionAllowlist = 'ConfigBlockedByConnectionAllowlist',
|
|
1344
1346
|
ConfigInvalidResponse = 'ConfigInvalidResponse',
|
|
1345
1347
|
ConfigInvalidContentType = 'ConfigInvalidContentType',
|
|
1346
1348
|
IdpNotPotentiallyTrustworthy = 'IdpNotPotentiallyTrustworthy',
|
|
@@ -1350,11 +1352,13 @@ export namespace Audits {
|
|
|
1350
1352
|
InvalidSigninResponse = 'InvalidSigninResponse',
|
|
1351
1353
|
AccountsHttpNotFound = 'AccountsHttpNotFound',
|
|
1352
1354
|
AccountsNoResponse = 'AccountsNoResponse',
|
|
1355
|
+
AccountsBlockedByConnectionAllowlist = 'AccountsBlockedByConnectionAllowlist',
|
|
1353
1356
|
AccountsInvalidResponse = 'AccountsInvalidResponse',
|
|
1354
1357
|
AccountsListEmpty = 'AccountsListEmpty',
|
|
1355
1358
|
AccountsInvalidContentType = 'AccountsInvalidContentType',
|
|
1356
1359
|
IdTokenHttpNotFound = 'IdTokenHttpNotFound',
|
|
1357
1360
|
IdTokenNoResponse = 'IdTokenNoResponse',
|
|
1361
|
+
IdTokenBlockedByConnectionAllowlist = 'IdTokenBlockedByConnectionAllowlist',
|
|
1358
1362
|
IdTokenInvalidResponse = 'IdTokenInvalidResponse',
|
|
1359
1363
|
IdTokenIdpErrorResponse = 'IdTokenIdpErrorResponse',
|
|
1360
1364
|
IdTokenCrossSiteIdpErrorResponse = 'IdTokenCrossSiteIdpErrorResponse',
|
|
@@ -10270,11 +10274,6 @@ export namespace Network {
|
|
|
10270
10274
|
*/
|
|
10271
10275
|
export type RequestId = OpaqueIdentifier<string, 'Protocol.Network.RequestId'>;
|
|
10272
10276
|
|
|
10273
|
-
/**
|
|
10274
|
-
* Unique intercepted request identifier.
|
|
10275
|
-
*/
|
|
10276
|
-
export type InterceptionId = OpaqueIdentifier<string, 'Protocol.Network.InterceptionId'>;
|
|
10277
|
-
|
|
10278
10277
|
/**
|
|
10279
10278
|
* Network level fetch failure reason.
|
|
10280
10279
|
*/
|
|
@@ -11384,34 +11383,6 @@ export namespace Network {
|
|
|
11384
11383
|
password?: string;
|
|
11385
11384
|
}
|
|
11386
11385
|
|
|
11387
|
-
/**
|
|
11388
|
-
* Stages of the interception to begin intercepting. Request will intercept before the request is
|
|
11389
|
-
* sent. Response will intercept after the response is received.
|
|
11390
|
-
*/
|
|
11391
|
-
export const enum InterceptionStage {
|
|
11392
|
-
Request = 'Request',
|
|
11393
|
-
HeadersReceived = 'HeadersReceived',
|
|
11394
|
-
}
|
|
11395
|
-
|
|
11396
|
-
/**
|
|
11397
|
-
* Request pattern for interception.
|
|
11398
|
-
*/
|
|
11399
|
-
export interface RequestPattern {
|
|
11400
|
-
/**
|
|
11401
|
-
* Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is
|
|
11402
|
-
* backslash. Omitting is equivalent to `"*"`.
|
|
11403
|
-
*/
|
|
11404
|
-
urlPattern?: string;
|
|
11405
|
-
/**
|
|
11406
|
-
* If set, only requests for matching resource types will be intercepted.
|
|
11407
|
-
*/
|
|
11408
|
-
resourceType?: ResourceType;
|
|
11409
|
-
/**
|
|
11410
|
-
* Stage at which to begin intercepting requests. Default is Request.
|
|
11411
|
-
*/
|
|
11412
|
-
interceptionStage?: InterceptionStage;
|
|
11413
|
-
}
|
|
11414
|
-
|
|
11415
11386
|
/**
|
|
11416
11387
|
* Information about a signed exchange signature.
|
|
11417
11388
|
* https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1
|
|
@@ -12144,6 +12115,7 @@ export namespace Network {
|
|
|
12144
12115
|
SigningQuotaExceeded = 'SigningQuotaExceeded',
|
|
12145
12116
|
RefreshedAsWaiter = 'RefreshedAsWaiter',
|
|
12146
12117
|
TransientSigningError = 'TransientSigningError',
|
|
12118
|
+
InScopeRefreshNotYetNeeded = 'InScopeRefreshNotYetNeeded',
|
|
12147
12119
|
}
|
|
12148
12120
|
|
|
12149
12121
|
/**
|
|
@@ -12152,9 +12124,11 @@ export namespace Network {
|
|
|
12152
12124
|
export interface RefreshEventDetails {
|
|
12153
12125
|
/**
|
|
12154
12126
|
* The result of a refresh.
|
|
12127
|
+
* LINT_SKIP.IfChange(DeviceBoundSessionRefreshResult)
|
|
12155
12128
|
*/
|
|
12156
12129
|
refreshResult: RefreshEventDetailsRefreshResult;
|
|
12157
12130
|
/**
|
|
12131
|
+
* LINT_SKIP.ThenChange(//net/device_bound_sessions/refresh_result.h:DeviceBoundSessionRefreshResult,//content/browser/devtools/protocol/network_handler.cc:DeviceBoundSessionRefreshResult)
|
|
12158
12132
|
* If there was a fetch attempt, the result of that.
|
|
12159
12133
|
*/
|
|
12160
12134
|
fetchResult?: DeviceBoundSessionFetchResult;
|
|
@@ -12275,44 +12249,6 @@ export namespace Network {
|
|
|
12275
12249
|
result: boolean;
|
|
12276
12250
|
}
|
|
12277
12251
|
|
|
12278
|
-
export interface ContinueInterceptedRequestRequest {
|
|
12279
|
-
interceptionId: InterceptionId;
|
|
12280
|
-
/**
|
|
12281
|
-
* If set this causes the request to fail with the given reason. Passing `Aborted` for requests
|
|
12282
|
-
* marked with `isNavigationRequest` also cancels the navigation. Must not be set in response
|
|
12283
|
-
* to an authChallenge.
|
|
12284
|
-
*/
|
|
12285
|
-
errorReason?: ErrorReason;
|
|
12286
|
-
/**
|
|
12287
|
-
* If set the requests completes using with the provided base64 encoded raw response, including
|
|
12288
|
-
* HTTP status line and headers etc... Must not be set in response to an authChallenge.
|
|
12289
|
-
*/
|
|
12290
|
-
rawResponse?: binary;
|
|
12291
|
-
/**
|
|
12292
|
-
* If set the request url will be modified in a way that's not observable by page. Must not be
|
|
12293
|
-
* set in response to an authChallenge.
|
|
12294
|
-
*/
|
|
12295
|
-
url?: string;
|
|
12296
|
-
/**
|
|
12297
|
-
* If set this allows the request method to be overridden. Must not be set in response to an
|
|
12298
|
-
* authChallenge.
|
|
12299
|
-
*/
|
|
12300
|
-
method?: string;
|
|
12301
|
-
/**
|
|
12302
|
-
* If set this allows postData to be set. Must not be set in response to an authChallenge.
|
|
12303
|
-
*/
|
|
12304
|
-
postData?: string;
|
|
12305
|
-
/**
|
|
12306
|
-
* If set this allows the request headers to be changed. Must not be set in response to an
|
|
12307
|
-
* authChallenge.
|
|
12308
|
-
*/
|
|
12309
|
-
headers?: Headers;
|
|
12310
|
-
/**
|
|
12311
|
-
* Response to a requestIntercepted with an authChallenge. Must not be set otherwise.
|
|
12312
|
-
*/
|
|
12313
|
-
authChallengeResponse?: AuthChallengeResponse;
|
|
12314
|
-
}
|
|
12315
|
-
|
|
12316
12252
|
export interface DeleteCookiesRequest {
|
|
12317
12253
|
/**
|
|
12318
12254
|
* Name of the cookies to remove.
|
|
@@ -12533,32 +12469,6 @@ export namespace Network {
|
|
|
12533
12469
|
base64Encoded: boolean;
|
|
12534
12470
|
}
|
|
12535
12471
|
|
|
12536
|
-
export interface GetResponseBodyForInterceptionRequest {
|
|
12537
|
-
/**
|
|
12538
|
-
* Identifier for the intercepted request to get body for.
|
|
12539
|
-
*/
|
|
12540
|
-
interceptionId: InterceptionId;
|
|
12541
|
-
}
|
|
12542
|
-
|
|
12543
|
-
export interface GetResponseBodyForInterceptionResponse extends ProtocolResponseWithError {
|
|
12544
|
-
/**
|
|
12545
|
-
* Response body.
|
|
12546
|
-
*/
|
|
12547
|
-
body: string;
|
|
12548
|
-
/**
|
|
12549
|
-
* True, if content was sent as base64.
|
|
12550
|
-
*/
|
|
12551
|
-
base64Encoded: boolean;
|
|
12552
|
-
}
|
|
12553
|
-
|
|
12554
|
-
export interface TakeResponseBodyForInterceptionAsStreamRequest {
|
|
12555
|
-
interceptionId: InterceptionId;
|
|
12556
|
-
}
|
|
12557
|
-
|
|
12558
|
-
export interface TakeResponseBodyForInterceptionAsStreamResponse extends ProtocolResponseWithError {
|
|
12559
|
-
stream: IO.StreamHandle;
|
|
12560
|
-
}
|
|
12561
|
-
|
|
12562
12472
|
export interface ReplayXHRRequest {
|
|
12563
12473
|
/**
|
|
12564
12474
|
* Identifier of XHR to replay.
|
|
@@ -12706,14 +12616,6 @@ export namespace Network {
|
|
|
12706
12616
|
enabled: boolean;
|
|
12707
12617
|
}
|
|
12708
12618
|
|
|
12709
|
-
export interface SetRequestInterceptionRequest {
|
|
12710
|
-
/**
|
|
12711
|
-
* Requests matching any of these patterns will be forwarded and wait for the corresponding
|
|
12712
|
-
* continueInterceptedRequest call.
|
|
12713
|
-
*/
|
|
12714
|
-
patterns: RequestPattern[];
|
|
12715
|
-
}
|
|
12716
|
-
|
|
12717
12619
|
export interface SetUserAgentOverrideRequest {
|
|
12718
12620
|
/**
|
|
12719
12621
|
* User agent to use.
|
|
@@ -12921,68 +12823,6 @@ export namespace Network {
|
|
|
12921
12823
|
encodedDataLength: number;
|
|
12922
12824
|
}
|
|
12923
12825
|
|
|
12924
|
-
/**
|
|
12925
|
-
* Details of an intercepted HTTP request, which must be either allowed, blocked, modified or
|
|
12926
|
-
* mocked.
|
|
12927
|
-
* Deprecated, use Fetch.requestPaused instead.
|
|
12928
|
-
* @deprecated
|
|
12929
|
-
*/
|
|
12930
|
-
export interface RequestInterceptedEvent {
|
|
12931
|
-
/**
|
|
12932
|
-
* Each request the page makes will have a unique id, however if any redirects are encountered
|
|
12933
|
-
* while processing that fetch, they will be reported with the same id as the original fetch.
|
|
12934
|
-
* Likewise if HTTP authentication is needed then the same fetch id will be used.
|
|
12935
|
-
*/
|
|
12936
|
-
interceptionId: InterceptionId;
|
|
12937
|
-
request: Request;
|
|
12938
|
-
/**
|
|
12939
|
-
* The id of the frame that initiated the request.
|
|
12940
|
-
*/
|
|
12941
|
-
frameId: Page.FrameId;
|
|
12942
|
-
/**
|
|
12943
|
-
* How the requested resource will be used.
|
|
12944
|
-
*/
|
|
12945
|
-
resourceType: ResourceType;
|
|
12946
|
-
/**
|
|
12947
|
-
* Whether this is a navigation request, which can abort the navigation completely.
|
|
12948
|
-
*/
|
|
12949
|
-
isNavigationRequest: boolean;
|
|
12950
|
-
/**
|
|
12951
|
-
* Set if the request is a navigation that will result in a download.
|
|
12952
|
-
* Only present after response is received from the server (i.e. HeadersReceived stage).
|
|
12953
|
-
*/
|
|
12954
|
-
isDownload?: boolean;
|
|
12955
|
-
/**
|
|
12956
|
-
* Redirect location, only sent if a redirect was intercepted.
|
|
12957
|
-
*/
|
|
12958
|
-
redirectUrl?: string;
|
|
12959
|
-
/**
|
|
12960
|
-
* Details of the Authorization Challenge encountered. If this is set then
|
|
12961
|
-
* continueInterceptedRequest must contain an authChallengeResponse.
|
|
12962
|
-
*/
|
|
12963
|
-
authChallenge?: AuthChallenge;
|
|
12964
|
-
/**
|
|
12965
|
-
* Response error if intercepted at response stage or if redirect occurred while intercepting
|
|
12966
|
-
* request.
|
|
12967
|
-
*/
|
|
12968
|
-
responseErrorReason?: ErrorReason;
|
|
12969
|
-
/**
|
|
12970
|
-
* Response code if intercepted at response stage or if redirect occurred while intercepting
|
|
12971
|
-
* request or auth retry occurred.
|
|
12972
|
-
*/
|
|
12973
|
-
responseStatusCode?: integer;
|
|
12974
|
-
/**
|
|
12975
|
-
* Response headers if intercepted at the response stage or if redirect occurred while
|
|
12976
|
-
* intercepting request or auth retry occurred.
|
|
12977
|
-
*/
|
|
12978
|
-
responseHeaders?: Headers;
|
|
12979
|
-
/**
|
|
12980
|
-
* If the intercepted request had a corresponding requestWillBeSent event fired for it, then
|
|
12981
|
-
* this requestId will be the same as the requestId present in the requestWillBeSent event.
|
|
12982
|
-
*/
|
|
12983
|
-
requestId?: RequestId;
|
|
12984
|
-
}
|
|
12985
|
-
|
|
12986
12826
|
/**
|
|
12987
12827
|
* Fired if request ended up loading from cache.
|
|
12988
12828
|
*/
|
|
@@ -13334,7 +13174,7 @@ export namespace Network {
|
|
|
13334
13174
|
*/
|
|
13335
13175
|
export interface DirectTCPSocketAbortedEvent {
|
|
13336
13176
|
identifier: RequestId;
|
|
13337
|
-
errorMessage:
|
|
13177
|
+
errorMessage: ErrorReason;
|
|
13338
13178
|
timestamp: MonotonicTime;
|
|
13339
13179
|
}
|
|
13340
13180
|
|
|
@@ -13407,7 +13247,7 @@ export namespace Network {
|
|
|
13407
13247
|
*/
|
|
13408
13248
|
export interface DirectUDPSocketAbortedEvent {
|
|
13409
13249
|
identifier: RequestId;
|
|
13410
|
-
errorMessage:
|
|
13250
|
+
errorMessage: ErrorReason;
|
|
13411
13251
|
timestamp: MonotonicTime;
|
|
13412
13252
|
}
|
|
13413
13253
|
|
|
@@ -4,6 +4,7 @@
|
|
|
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 * as Trace from '../trace/trace.js';
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
AiAgent,
|
|
@@ -28,6 +29,7 @@ const SKILL_DISPLAY_NAMES: Record<SkillName, string> = {
|
|
|
28
29
|
styling: 'CSS and styling',
|
|
29
30
|
network: 'Network requests',
|
|
30
31
|
accessibility: 'Accessibility',
|
|
32
|
+
performance: 'Performance',
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
const preamble = `You are the most advanced unified AI assistant integrated into Chrome DevTools.
|
|
@@ -59,6 +61,7 @@ If the user asks a question that requires an investigation or debugging, use thi
|
|
|
59
61
|
|
|
60
62
|
export interface AiAgent2Options extends ExecuteJsAgentOptions {
|
|
61
63
|
lighthouseRecording?: (overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
|
|
64
|
+
performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
export class AiAgent2 extends AiAgent<unknown> {
|
|
@@ -72,6 +75,7 @@ export class AiAgent2 extends AiAgent<unknown> {
|
|
|
72
75
|
readonly #allowedOrigin?: () => AllowedOriginResult;
|
|
73
76
|
readonly #lighthouseRecording?:
|
|
74
77
|
(overrides?: LHModel.RunTypes.RunOverrides) => Promise<LHModel.ReporterTypes.ReportJSON|null>;
|
|
78
|
+
readonly #performanceRecordAndReload?: () => Promise<Trace.TraceModel.ParsedTrace>;
|
|
75
79
|
|
|
76
80
|
get options(): RequestOptions {
|
|
77
81
|
return {};
|
|
@@ -84,13 +88,14 @@ export class AiAgent2 extends AiAgent<unknown> {
|
|
|
84
88
|
super(opts);
|
|
85
89
|
this.#changes = opts.changeManager ?? new ChangeManager(opts.targetManager);
|
|
86
90
|
this.#lighthouseRecording = opts.lighthouseRecording;
|
|
91
|
+
this.#performanceRecordAndReload = opts.performanceRecordAndReload;
|
|
87
92
|
this.#execJs = opts.execJs ?? executeJsCode;
|
|
88
93
|
this.#allowedOrigin = opts.allowedOrigin;
|
|
89
94
|
this.#declaredTools.add('learnSkills');
|
|
90
95
|
this.declareFunction<{skills: SkillName[]}>('learnSkills', {
|
|
91
96
|
description: () => {
|
|
92
97
|
const unloadedSkills = Object.keys(SKILLS).filter(name => !this.#activeSkills.has(name as SkillName));
|
|
93
|
-
return `Loads the specified skills to gain access to their specialized tools. Call this
|
|
98
|
+
return `Loads the specified skills to gain access to their specialized tools. Call this ONLY for skills listed under Available skills that are not yet loaded. Do not call this for skills that are already loaded. Available skills that are not yet loaded: ${
|
|
94
99
|
unloadedSkills.join(', ')}.`;
|
|
95
100
|
},
|
|
96
101
|
parameters: {
|
|
@@ -103,7 +108,7 @@ export class AiAgent2 extends AiAgent<unknown> {
|
|
|
103
108
|
type: Host.AidaClient.ParametersTypes.STRING,
|
|
104
109
|
description: 'Skill name',
|
|
105
110
|
},
|
|
106
|
-
description: 'List of skill names to load',
|
|
111
|
+
description: 'List of unloaded skill names to load',
|
|
107
112
|
},
|
|
108
113
|
},
|
|
109
114
|
required: ['skills'],
|
|
@@ -154,6 +159,7 @@ ${skillsManifest}
|
|
|
154
159
|
|
|
155
160
|
You must call \`learnSkills\` to load a skill before you can use its tools.
|
|
156
161
|
If the user's request requires a skill that is not currently loaded, you MUST call \`learnSkills\` to load that skill first, instead of attempting to solve the query using tools from other skills.
|
|
162
|
+
Do NOT call \`learnSkills\` for skills that are already loaded.
|
|
157
163
|
|
|
158
164
|
User query: ${enhancedQuery}`;
|
|
159
165
|
}
|
|
@@ -182,7 +188,8 @@ User query: ${enhancedQuery}`;
|
|
|
182
188
|
debugLog(`AiAgent2: Attempting to load skill ${name}`);
|
|
183
189
|
if (this.#activeSkills.has(name)) {
|
|
184
190
|
debugLog(`AiAgent2: Skill ${name} is already loaded`);
|
|
185
|
-
response += `Skill ${
|
|
191
|
+
response += `Error: Skill '${
|
|
192
|
+
name}' is already loaded. Call its tools directly instead of invoking learnSkills for '${name}' again.\n`;
|
|
186
193
|
continue;
|
|
187
194
|
}
|
|
188
195
|
|
|
@@ -234,6 +241,7 @@ User query: ${enhancedQuery}`;
|
|
|
234
241
|
getTarget: () => this.targetManager.primaryPageTarget(),
|
|
235
242
|
getEstablishedOrigin: () => this.#getConversationOrigin(),
|
|
236
243
|
lighthouseRecording: this.#lighthouseRecording,
|
|
244
|
+
performanceRecordAndReload: this.#performanceRecordAndReload,
|
|
237
245
|
};
|
|
238
246
|
return tool.handler(args, context, options);
|
|
239
247
|
},
|
|
@@ -128,6 +128,7 @@ export class AiConversation {
|
|
|
128
128
|
networkTimeCalculator,
|
|
129
129
|
lighthouseRecording,
|
|
130
130
|
aiHistoryStorage = AiHistoryStorage.instance(),
|
|
131
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
131
132
|
targetManager = SDK.TargetManager.TargetManager.instance(),
|
|
132
133
|
} = options;
|
|
133
134
|
this.#changeManager = changeManager;
|
|
@@ -55,6 +55,7 @@ export class AiHistoryStorage extends Common.ObjectWrapper.ObjectWrapper<EventTy
|
|
|
55
55
|
#maxStorageSize: number;
|
|
56
56
|
|
|
57
57
|
constructor(
|
|
58
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
58
59
|
settings: Common.Settings.Settings = Common.Settings.Settings.instance(),
|
|
59
60
|
maxStorageSize = DEFAULT_MAX_STORAGE_SIZE,
|
|
60
61
|
) {
|
|
@@ -232,11 +233,13 @@ export class AiHistoryStorage extends Common.ObjectWrapper.ObjectWrapper<EventTy
|
|
|
232
233
|
): AiHistoryStorage {
|
|
233
234
|
const {forceNew, maxStorageSize, settings} = opts;
|
|
234
235
|
if (!Root.DevToolsContext.globalInstance().has(AiHistoryStorage) || forceNew) {
|
|
235
|
-
Root.DevToolsContext.globalInstance().set(
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
Root.DevToolsContext.globalInstance().set(
|
|
237
|
+
AiHistoryStorage,
|
|
238
|
+
new AiHistoryStorage(
|
|
239
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
240
|
+
settings ?? Common.Settings.Settings.instance(),
|
|
241
|
+
maxStorageSize,
|
|
242
|
+
));
|
|
240
243
|
}
|
|
241
244
|
return Root.DevToolsContext.globalInstance().get(AiHistoryStorage);
|
|
242
245
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
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 Host from '../../core/host/host.js';
|
|
7
|
+
import * as Root from '../../core/root/root.js';
|
|
8
|
+
|
|
9
|
+
import type {DisabledReason} from './AiUtils.js';
|
|
10
|
+
|
|
11
|
+
export const enum Events {
|
|
12
|
+
CHANGED = 'Changed',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface EventTypes {
|
|
16
|
+
[Events.CHANGED]: void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Wrapper around a plain {@link Common.Settings.Setting} for AI features whose availability
|
|
21
|
+
* can change dynamically over the lifetime of a DevTools session (e.g., due to changes in
|
|
22
|
+
* AIDA availability, network connectivity, authentication, or enterprise policy).
|
|
23
|
+
*
|
|
24
|
+
* This wrapper listens to {@link Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED} and emits
|
|
25
|
+
* {@link Events.CHANGED} when either the underlying setting value changes or when AIDA status
|
|
26
|
+
* changes, allowing UI components to dynamically react without polluting the plain `Setting`
|
|
27
|
+
* class with dynamic availability state.
|
|
28
|
+
*/
|
|
29
|
+
export class AiSetting<ValueT> extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
30
|
+
#setting?: Common.Settings.Setting<ValueT>;
|
|
31
|
+
readonly #descriptor: Common.Settings.ConditionalSettingDescriptor<ValueT, DisabledReason[]>;
|
|
32
|
+
readonly #hostConfigTracker: Host.AidaClient.HostConfigTracker;
|
|
33
|
+
readonly #settings: Common.Settings.Settings;
|
|
34
|
+
readonly #boundOnSettingChanged = this.#onSettingChanged.bind(this);
|
|
35
|
+
readonly #boundOnAidaAvailabilityChanged = this.#onAidaAvailabilityChanged.bind(this);
|
|
36
|
+
|
|
37
|
+
constructor(
|
|
38
|
+
descriptor: Common.Settings.ConditionalSettingDescriptor<ValueT, DisabledReason[]>,
|
|
39
|
+
hostConfigTracker: Host.AidaClient.HostConfigTracker,
|
|
40
|
+
settings: Common.Settings.Settings,
|
|
41
|
+
) {
|
|
42
|
+
super();
|
|
43
|
+
this.#descriptor = descriptor;
|
|
44
|
+
this.#hostConfigTracker = hostConfigTracker;
|
|
45
|
+
this.#settings = settings;
|
|
46
|
+
|
|
47
|
+
this.#hostConfigTracker.addEventListener(
|
|
48
|
+
Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED,
|
|
49
|
+
this.#boundOnAidaAvailabilityChanged,
|
|
50
|
+
);
|
|
51
|
+
this.#tryResolveSetting();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
#tryResolveSetting(): void {
|
|
55
|
+
const result = this.#settings.maybeResolve(this.#descriptor as
|
|
56
|
+
Common.Settings.ConditionalSettingDescriptor<unknown, DisabledReason[]>);
|
|
57
|
+
if ('setting' in result) {
|
|
58
|
+
if (this.#setting !== result.setting) {
|
|
59
|
+
if (this.#setting) {
|
|
60
|
+
this.#setting.removeChangeListener(this.#boundOnSettingChanged);
|
|
61
|
+
}
|
|
62
|
+
this.#setting = result.setting as Common.Settings.Setting<ValueT>;
|
|
63
|
+
this.#setting.addChangeListener(this.#boundOnSettingChanged);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get unavailable(): boolean {
|
|
69
|
+
const availability = this.#descriptor.isAvailable(Root.Runtime.hostConfig);
|
|
70
|
+
return availability.status === Common.Settings.SettingAvailability.UNAVAILABLE;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get disabled(): boolean {
|
|
74
|
+
const availability = this.#descriptor.isAvailable(Root.Runtime.hostConfig);
|
|
75
|
+
return availability.status === Common.Settings.SettingAvailability.DISABLED;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get disabledReasons(): DisabledReason[] {
|
|
79
|
+
const availability = this.#descriptor.isAvailable(Root.Runtime.hostConfig);
|
|
80
|
+
if (availability.status === Common.Settings.SettingAvailability.DISABLED) {
|
|
81
|
+
return availability.reason;
|
|
82
|
+
}
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
getIfNotDisabled(): ValueT|undefined {
|
|
87
|
+
if (this.disabled || this.unavailable) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
return this.#setting?.get();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
setIfNotDisabled(value: ValueT): void {
|
|
94
|
+
if (this.disabled || this.unavailable) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.#setting?.set(value);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#onSettingChanged(): void {
|
|
101
|
+
this.dispatchEventToListeners(Events.CHANGED);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
#onAidaAvailabilityChanged(): void {
|
|
105
|
+
this.#tryResolveSetting();
|
|
106
|
+
this.dispatchEventToListeners(Events.CHANGED);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -72,6 +72,53 @@ export const consoleInsightsEnabledSettingDescriptor:
|
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
+
function isAiAssistanceFeatureAvailable(config?: Root.Runtime.HostConfig): boolean {
|
|
76
|
+
return Boolean(config?.aidaAvailability?.enabled &&
|
|
77
|
+
(config?.devToolsFreestyler?.enabled || config?.devToolsAiAssistanceNetworkAgent?.enabled ||
|
|
78
|
+
config?.devToolsAiAssistancePerformanceAgent?.enabled ||
|
|
79
|
+
config?.devToolsAiAssistanceFileAgent?.enabled || config?.devToolsAiAssistanceStorageAgent?.enabled));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const aiAssistanceEnabledSettingDescriptor:
|
|
83
|
+
Common.Settings.ConditionalSettingDescriptor<boolean, DisabledReason[]> = {
|
|
84
|
+
name: 'ai-assistance-enabled',
|
|
85
|
+
type: Common.Settings.SettingType.BOOLEAN,
|
|
86
|
+
defaultValue: false,
|
|
87
|
+
isAvailable: (config?: Root.Runtime.HostConfig): Common.Settings.SettingAvailabilityStatus<DisabledReason[]> => {
|
|
88
|
+
if (!isAiAssistanceFeatureAvailable(config)) {
|
|
89
|
+
return {
|
|
90
|
+
status: Common.Settings.SettingAvailability.UNAVAILABLE,
|
|
91
|
+
reason: [DisabledReason.NOT_SUPPORTED],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const reasons: DisabledReason[] = [];
|
|
95
|
+
if (isGeoRestricted(config)) {
|
|
96
|
+
reasons.push(DisabledReason.GEO_RESTRICTED);
|
|
97
|
+
}
|
|
98
|
+
if (isPolicyRestricted(config)) {
|
|
99
|
+
reasons.push(DisabledReason.POLICY_RESTRICTED);
|
|
100
|
+
}
|
|
101
|
+
if (isLocaleRestricted()) {
|
|
102
|
+
reasons.push(DisabledReason.WRONG_LOCALE);
|
|
103
|
+
}
|
|
104
|
+
if (reasons.length > 0) {
|
|
105
|
+
return {
|
|
106
|
+
status: Common.Settings.SettingAvailability.DISABLED,
|
|
107
|
+
reason: reasons,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
status: Common.Settings.SettingAvailability.AVAILABLE,
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const aiAssistanceV2OptInChangeDialogSeenSettingDescriptor: Common.Settings.SettingDescriptor<boolean> = {
|
|
117
|
+
name: 'ai-assistance-v2-opt-in-change-dialog-seen',
|
|
118
|
+
type: Common.Settings.SettingType.BOOLEAN,
|
|
119
|
+
defaultValue: false,
|
|
120
|
+
};
|
|
121
|
+
|
|
75
122
|
export function isGeminiBranding(): boolean {
|
|
76
123
|
return !!Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled;
|
|
77
124
|
}
|
|
@@ -31,6 +31,7 @@ export class ChangeManager {
|
|
|
31
31
|
new Map<SDK.CSSModel.CSSModel, Map<Protocol.Page.FrameId, Protocol.DOM.StyleSheetId>>();
|
|
32
32
|
readonly #stylesheetChanges = new Map<Protocol.DOM.StyleSheetId, Change[]>();
|
|
33
33
|
|
|
34
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
34
35
|
constructor(targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance()) {
|
|
35
36
|
this.#targetManager = targetManager;
|
|
36
37
|
this.#targetManager.addModelListener(
|
|
@@ -7,12 +7,12 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
8
|
import * as Protocol from '../../generated/protocol.js';
|
|
9
9
|
|
|
10
|
+
import {getOrCreateIsolatedWorld} from './agents/ExecuteJavascript.js';
|
|
10
11
|
import type {ChangeManager} from './ChangeManager.js';
|
|
11
12
|
import {
|
|
12
13
|
AI_ASSISTANCE_CSS_CLASS_NAME,
|
|
13
14
|
type FreestyleCallbackArgs,
|
|
14
15
|
FREESTYLER_BINDING_NAME,
|
|
15
|
-
FREESTYLER_WORLD_NAME,
|
|
16
16
|
freestylerBinding,
|
|
17
17
|
injectedFunctions,
|
|
18
18
|
} from './injected.js';
|
|
@@ -66,24 +66,15 @@ export class ExtensionScope {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
async install(): Promise<void> {
|
|
69
|
+
const isolatedWorldContext = await getOrCreateIsolatedWorld(this.target, this.frameId);
|
|
69
70
|
const runtimeModel = this.target.model(SDK.RuntimeModel.RuntimeModel);
|
|
70
|
-
const pageAgent = this.target.pageAgent();
|
|
71
|
-
|
|
72
|
-
// This returns previously created world if it exists for the frame.
|
|
73
|
-
const {executionContextId} =
|
|
74
|
-
await pageAgent.invoke_createIsolatedWorld({frameId: this.frameId, worldName: FREESTYLER_WORLD_NAME});
|
|
75
|
-
|
|
76
|
-
const isolatedWorldContext = runtimeModel?.executionContext(executionContextId);
|
|
77
|
-
if (!isolatedWorldContext) {
|
|
78
|
-
throw new Error('Execution context is not found for executing code');
|
|
79
|
-
}
|
|
80
71
|
|
|
81
72
|
const handler = this.#bindingCalled.bind(this, isolatedWorldContext);
|
|
82
73
|
runtimeModel?.addEventListener(SDK.RuntimeModel.Events.BindingCalled, handler);
|
|
83
74
|
this.#listeners.push(handler);
|
|
84
75
|
await this.target.runtimeAgent().invoke_addBinding({
|
|
85
76
|
name: FREESTYLER_BINDING_NAME,
|
|
86
|
-
executionContextId,
|
|
77
|
+
executionContextId: isolatedWorldContext.id,
|
|
87
78
|
});
|
|
88
79
|
await this.#simpleEval(isolatedWorldContext, freestylerBinding);
|
|
89
80
|
await this.#simpleEval(isolatedWorldContext, injectedFunctions);
|
|
@@ -14,6 +14,7 @@ import type * as Trace from '../../trace/trace.js';
|
|
|
14
14
|
import type * as Workspace from '../../workspace/workspace.js';
|
|
15
15
|
import {areOriginsEquivalent, extractContextOrigin, isOpaqueOrigin} from '../AiOrigins.js';
|
|
16
16
|
import {debugLog, isStructuredLogEnabled} from '../debug.js';
|
|
17
|
+
import type {ContextHandlerResult, DataHandlerResult} from '../tools/Tool.js';
|
|
17
18
|
|
|
18
19
|
const MAX_SUGGESTION_LENGTH = 200;
|
|
19
20
|
|
|
@@ -391,23 +392,11 @@ export type AiWidget = ComputedStyleAiWidget|CoreVitalsAiWidget|StylePropertiesA
|
|
|
391
392
|
LighthouseReportAiWidget|TimelineEventSummaryAiWidget|NetworkRequestGeneralHeadersAiWidget|SourceCodeAiWidget|
|
|
392
393
|
SourceFilesListAiWidget|NetworkRequestsListAiWidget|NetworkTrackAiWidget;
|
|
393
394
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
*/
|
|
400
|
-
description: string|null,
|
|
401
|
-
}|{
|
|
402
|
-
result: Result,
|
|
403
|
-
widgets?: AiWidget[],
|
|
404
|
-
}|{
|
|
405
|
-
context: ConversationContext<unknown>,
|
|
406
|
-
description: string,
|
|
407
|
-
widgets?: AiWidget[],
|
|
408
|
-
}|{
|
|
409
|
-
error: string,
|
|
410
|
-
};
|
|
395
|
+
/**
|
|
396
|
+
* @deprecated Used for v1 agents. Once v2 is shipped, this can be removed.
|
|
397
|
+
* Use `DataHandlerResult` or `ContextHandlerResult` from `Tool.js` instead.
|
|
398
|
+
*/
|
|
399
|
+
export type ToolResult<ResultType> = DataHandlerResult<ResultType>|ContextHandlerResult;
|
|
411
400
|
|
|
412
401
|
export interface FunctionHandlerOptions {
|
|
413
402
|
/**
|
|
@@ -442,7 +431,7 @@ export interface FunctionDeclaration<Args extends Record<string, unknown>, Retur
|
|
|
442
431
|
/**
|
|
443
432
|
* Function implementation that the LLM will try to execute,
|
|
444
433
|
*/
|
|
445
|
-
handler(args: Args, options?: FunctionHandlerOptions): Promise<
|
|
434
|
+
handler(args: Args, options?: FunctionHandlerOptions): Promise<ToolResult<ReturnType>>;
|
|
446
435
|
}
|
|
447
436
|
|
|
448
437
|
interface AidaFetchResult {
|
|
@@ -521,6 +510,7 @@ export abstract class AiAgent<T> {
|
|
|
521
510
|
this.confirmSideEffect = opts.confirmSideEffectForTest ?? (() => Promise.withResolvers());
|
|
522
511
|
this.#history = opts.history ?? [];
|
|
523
512
|
this.#allowedOrigin = opts.allowedOrigin;
|
|
513
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
524
514
|
this.#targetManager = opts.targetManager ?? SDK.TargetManager.TargetManager.instance();
|
|
525
515
|
}
|
|
526
516
|
|
|
@@ -759,6 +749,9 @@ export abstract class AiAgent<T> {
|
|
|
759
749
|
await this.preRun();
|
|
760
750
|
|
|
761
751
|
const enhancedQuery = await this.enhanceQuery(initialQuery, options.selected, multimodalInput?.type);
|
|
752
|
+
if (!enhancedQuery.trim() && !multimodalInput) {
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
762
755
|
Host.userMetrics.freestylerQueryLength(enhancedQuery.length);
|
|
763
756
|
|
|
764
757
|
let query: Host.AidaClient.Part|Host.AidaClient.Part[];
|
|
@@ -114,7 +114,9 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
114
114
|
|
|
115
115
|
constructor(opts: ContextSelectionAgentOptions) {
|
|
116
116
|
super(opts);
|
|
117
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
117
118
|
this.#networkLog = opts.networkLog ?? Logs.NetworkLog.NetworkLog.instance();
|
|
119
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
118
120
|
this.#workspace = opts.workspace ?? Workspace.Workspace.WorkspaceImpl.instance();
|
|
119
121
|
this.#performanceRecordAndReload = opts.performanceRecordAndReload;
|
|
120
122
|
this.#lighthouseRecording = opts.lighthouseRecording;
|
|
@@ -562,6 +564,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
562
564
|
* coming from SourceMaps (usually only one) as that has simple code and
|
|
563
565
|
* usually is what the user authored.
|
|
564
566
|
*/
|
|
567
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
565
568
|
static getUISourceCodes(workspace: Workspace.Workspace.WorkspaceImpl = Workspace.Workspace.WorkspaceImpl.instance()):
|
|
566
569
|
Workspace.UISourceCode.UISourceCode[] {
|
|
567
570
|
const projects =
|