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
|
@@ -7,7 +7,7 @@ import * as Platform from '../../../core/platform/platform.js';
|
|
|
7
7
|
import * as Handlers from '../handlers/handlers.js';
|
|
8
8
|
import * as Helpers from '../helpers/helpers.js';
|
|
9
9
|
import type * as Lantern from '../lantern/lantern.js';
|
|
10
|
-
import
|
|
10
|
+
import * as Types from '../types/types.js';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
InsightCategory,
|
|
@@ -199,7 +199,7 @@ function computeWasteWithGraph(
|
|
|
199
199
|
|
|
200
200
|
function computeMetricSavings(
|
|
201
201
|
http1Requests: Types.Events.SyntheticNetworkRequest[], context: InsightSetContext): MetricSavings|undefined {
|
|
202
|
-
if (!context.navigation || !context.lantern) {
|
|
202
|
+
if (!context.navigation || !('lantern' in context) || !context.lantern) {
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -234,7 +234,11 @@ export function generateInsight(data: Handlers.Types.HandlerData, context: Insig
|
|
|
234
234
|
const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);
|
|
235
235
|
|
|
236
236
|
const entityMappings = data.NetworkRequests.entityMappings;
|
|
237
|
-
|
|
237
|
+
let firstPartyUrl = data.Meta.mainFrameURL;
|
|
238
|
+
if (context.navigation && !Types.Events.isSoftNavigationStart(context.navigation)) {
|
|
239
|
+
firstPartyUrl = context.navigation.args.data?.documentLoaderURL ?? firstPartyUrl;
|
|
240
|
+
}
|
|
241
|
+
|
|
238
242
|
const firstPartyEntity = Handlers.Helpers.getEntityForUrl(firstPartyUrl, entityMappings);
|
|
239
243
|
const http1Requests = determineHttp1Requests(contextRequests, entityMappings, firstPartyEntity ?? null);
|
|
240
244
|
|
|
@@ -674,7 +674,7 @@ export function isNetworkDependencyTreeInsight(model: InsightModel): model is Ne
|
|
|
674
674
|
|
|
675
675
|
export function generateInsight(
|
|
676
676
|
data: Handlers.Types.HandlerData, context: InsightSetContext): NetworkDependencyTreeInsightModel {
|
|
677
|
-
if (!context.navigation) {
|
|
677
|
+
if (!context.navigation || !('navigationId' in context)) {
|
|
678
678
|
return finalize({
|
|
679
679
|
rootNodes: [],
|
|
680
680
|
maxTime: 0 as Types.Timing.Micro,
|
|
@@ -178,7 +178,7 @@ function finalize(partialModel: PartialInsightModel<RenderBlockingInsightModel>)
|
|
|
178
178
|
|
|
179
179
|
export function generateInsight(
|
|
180
180
|
data: Handlers.Types.HandlerData, context: InsightSetContext): RenderBlockingInsightModel {
|
|
181
|
-
if (!context.navigation) {
|
|
181
|
+
if (!context.navigation || !('navigationId' in context)) {
|
|
182
182
|
return finalize({
|
|
183
183
|
renderBlockingRequests: [],
|
|
184
184
|
});
|
|
@@ -6,7 +6,7 @@ import * as i18n from '../../../core/i18n/i18n.js';
|
|
|
6
6
|
import * as ThirdPartyWeb from '../../../third_party/third-party-web/third-party-web.js';
|
|
7
7
|
import * as Extras from '../extras/extras.js';
|
|
8
8
|
import * as Handlers from '../handlers/handlers.js';
|
|
9
|
-
import
|
|
9
|
+
import * as Types from '../types/types.js';
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
12
|
InsightCategory,
|
|
@@ -82,7 +82,10 @@ export function generateInsight(
|
|
|
82
82
|
data: Handlers.Types.HandlerData, context: InsightSetContext): ThirdPartiesInsightModel {
|
|
83
83
|
const entitySummaries = Extras.ThirdParties.summarizeByThirdParty(data as Handlers.Types.HandlerData, context.bounds);
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
let firstPartyUrl = data.Meta.mainFrameURL;
|
|
86
|
+
if (context.navigation && !Types.Events.isSoftNavigationStart(context.navigation)) {
|
|
87
|
+
firstPartyUrl = context.navigation.args.data?.documentLoaderURL ?? firstPartyUrl;
|
|
88
|
+
}
|
|
86
89
|
const firstPartyEntity = ThirdPartyWeb.ThirdPartyWeb.getEntity(firstPartyUrl) ||
|
|
87
90
|
Handlers.Helpers.makeUpEntity(data.Renderer.entityMappings.createdEntityCache, firstPartyUrl);
|
|
88
91
|
|
|
@@ -11,7 +11,8 @@ import type * as Models from './Models.js';
|
|
|
11
11
|
/**
|
|
12
12
|
* Context for the portion of the trace an insight should look at.
|
|
13
13
|
*/
|
|
14
|
-
export type InsightSetContext =
|
|
14
|
+
export type InsightSetContext =
|
|
15
|
+
InsightSetContextWithoutNavigation|InsightSetContextWithNavigation|InsightSetContextWithSoftNavigation;
|
|
15
16
|
|
|
16
17
|
export interface InsightSetContextWithoutNavigation {
|
|
17
18
|
options: Types.Configuration.ParseOptions;
|
|
@@ -29,6 +30,13 @@ export interface InsightSetContextWithNavigation {
|
|
|
29
30
|
lantern?: LanternContext;
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
export interface InsightSetContextWithSoftNavigation {
|
|
34
|
+
options: Types.Configuration.ParseOptions;
|
|
35
|
+
bounds: Types.Timing.TraceWindowMicro;
|
|
36
|
+
frameId: string;
|
|
37
|
+
navigation: Types.Events.SoftNavigationStart;
|
|
38
|
+
}
|
|
39
|
+
|
|
32
40
|
export interface LanternContext {
|
|
33
41
|
requests: Array<Lantern.Types.NetworkRequest<Types.Events.SyntheticNetworkRequest>>;
|
|
34
42
|
graph: Lantern.Graph.Node<Types.Events.SyntheticNetworkRequest>;
|
|
@@ -93,10 +101,7 @@ export type InsightModel<UIStrings extends Record<string, string> = Record<strin
|
|
|
93
101
|
*/
|
|
94
102
|
wastedBytes?: number,
|
|
95
103
|
frameId?: string,
|
|
96
|
-
|
|
97
|
-
* If this insight is attached to a navigation, this stores its ID.
|
|
98
|
-
*/
|
|
99
|
-
navigation?: Types.Events.NavigationStart,
|
|
104
|
+
navigation?: Types.Events.NavigationStart | Types.Events.SoftNavigationStart,
|
|
100
105
|
/** This is lazily-generated because some insights may create many overlays. */
|
|
101
106
|
createOverlays?: () => Types.Overlays.Overlay[],
|
|
102
107
|
};
|
|
@@ -120,7 +125,7 @@ export interface InsightSet {
|
|
|
120
125
|
model: InsightModels;
|
|
121
126
|
/** Contains errors for all insights that had an internal error. */
|
|
122
127
|
modelErrors: InsightModelErrors;
|
|
123
|
-
navigation?: Types.Events.NavigationStart;
|
|
128
|
+
navigation?: Types.Events.NavigationStart|Types.Events.SoftNavigationStart;
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
/**
|
|
@@ -42,6 +42,10 @@ export interface Configuration {
|
|
|
42
42
|
* from the model, but the contents will be empty.
|
|
43
43
|
*/
|
|
44
44
|
enableAnimationsFrameHandler: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether soft-navs are used in the model/insights.
|
|
47
|
+
*/
|
|
48
|
+
enableSoftNavigation: boolean;
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
export const defaults = (): Configuration => ({
|
|
@@ -49,6 +53,7 @@ export const defaults = (): Configuration => ({
|
|
|
49
53
|
debugMode: false,
|
|
50
54
|
maxInvalidationEventsPerEvent: 20,
|
|
51
55
|
enableAnimationsFrameHandler: false,
|
|
56
|
+
enableSoftNavigation: true,
|
|
52
57
|
});
|
|
53
58
|
|
|
54
59
|
/**
|
|
@@ -46,7 +46,9 @@ export class SourceMapsResolver extends EventTarget {
|
|
|
46
46
|
parsedTrace: Trace.TraceModel.ParsedTrace,
|
|
47
47
|
entityMapper?: Trace.EntityMapper.EntityMapper,
|
|
48
48
|
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding =
|
|
49
|
-
|
|
49
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
50
|
+
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance(),
|
|
51
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
50
52
|
targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance(),
|
|
51
53
|
) {
|
|
52
54
|
super();
|
|
@@ -92,7 +92,9 @@ export class IgnoreListManager extends Common.ObjectWrapper.ObjectWrapper<EventT
|
|
|
92
92
|
Root.DevToolsContext.globalInstance().set(
|
|
93
93
|
IgnoreListManager,
|
|
94
94
|
new IgnoreListManager(
|
|
95
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
95
96
|
opts.settings ?? Common.Settings.Settings.instance(),
|
|
97
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
96
98
|
opts.targetManager ?? SDK.TargetManager.TargetManager.instance()));
|
|
97
99
|
}
|
|
98
100
|
|
|
@@ -503,6 +503,7 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
503
503
|
return this.#disableEdit;
|
|
504
504
|
}
|
|
505
505
|
|
|
506
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
506
507
|
isIgnoreListed(ignoreListManager: IgnoreListManager = IgnoreListManager.instance()): boolean {
|
|
507
508
|
return ignoreListManager.isUserOrSourceMapIgnoreListedUISourceCode(this);
|
|
508
509
|
}
|
|
@@ -608,6 +609,7 @@ export class UILocation {
|
|
|
608
609
|
return this.columnNumber - other.columnNumber;
|
|
609
610
|
}
|
|
610
611
|
|
|
612
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
611
613
|
isIgnoreListed(ignoreListManager: IgnoreListManager = IgnoreListManager.instance()): boolean {
|
|
612
614
|
return this.uiSourceCode.isIgnoreListed(ignoreListManager);
|
|
613
615
|
}
|
|
@@ -326,9 +326,13 @@ export function workspaceDiff({forceNew}: {forceNew?: boolean} = {}): WorkspaceD
|
|
|
326
326
|
Root.DevToolsContext.globalInstance().set(
|
|
327
327
|
WorkspaceDiffImpl,
|
|
328
328
|
new WorkspaceDiffImpl(
|
|
329
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
329
330
|
Workspace.Workspace.WorkspaceImpl.instance(),
|
|
331
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
330
332
|
Persistence.Persistence.PersistenceImpl.instance(),
|
|
333
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
331
334
|
Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance(),
|
|
335
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
332
336
|
Common.Settings.Settings.instance(),
|
|
333
337
|
));
|
|
334
338
|
}
|
|
@@ -734,8 +734,8 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
734
734
|
void this.#startConversation(text, imageInput, multimodalInputType);
|
|
735
735
|
};
|
|
736
736
|
|
|
737
|
-
const seenSetting =
|
|
738
|
-
|
|
737
|
+
const seenSetting = Common.Settings.Settings.instance().resolve(
|
|
738
|
+
AiAssistanceModel.AiUtils.aiAssistanceV2OptInChangeDialogSeenSettingDescriptor);
|
|
739
739
|
if (!seenSetting.get()) {
|
|
740
740
|
OptInChangeDialog.show({
|
|
741
741
|
onGotIt: () => {
|
|
@@ -1751,7 +1751,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1751
1751
|
parts: [],
|
|
1752
1752
|
id: crypto.randomUUID(),
|
|
1753
1753
|
};
|
|
1754
|
-
let step: Step = {
|
|
1754
|
+
let step: Step = {state: {type: 'in_progress'}};
|
|
1755
1755
|
|
|
1756
1756
|
/**
|
|
1757
1757
|
* Commits the step to props only if necessary.
|
|
@@ -1771,7 +1771,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1771
1771
|
let announcedAnswerLoading = false;
|
|
1772
1772
|
let announcedAnswerReady = false;
|
|
1773
1773
|
for await (const data of items) {
|
|
1774
|
-
step.requestApproval = undefined;
|
|
1775
1774
|
switch (data.type) {
|
|
1776
1775
|
case AiAssistanceModel.AiAgent.ResponseType.USER_QUERY: {
|
|
1777
1776
|
this.#messages.push({
|
|
@@ -1797,7 +1796,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1797
1796
|
break;
|
|
1798
1797
|
}
|
|
1799
1798
|
case AiAssistanceModel.AiAgent.ResponseType.QUERYING: {
|
|
1800
|
-
step = {
|
|
1799
|
+
step = {state: {type: 'in_progress'}};
|
|
1801
1800
|
if (!systemMessage.parts.length) {
|
|
1802
1801
|
commitStep();
|
|
1803
1802
|
}
|
|
@@ -1808,7 +1807,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1808
1807
|
step.title = lockedString(UIStringsNotTranslate.analyzingData);
|
|
1809
1808
|
step.contextDetails = data.details;
|
|
1810
1809
|
step.widgets = data.widgets;
|
|
1811
|
-
step.
|
|
1810
|
+
step.state = {type: 'completed'};
|
|
1812
1811
|
commitStep();
|
|
1813
1812
|
break;
|
|
1814
1813
|
}
|
|
@@ -1818,7 +1817,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1818
1817
|
break;
|
|
1819
1818
|
}
|
|
1820
1819
|
case AiAssistanceModel.AiAgent.ResponseType.THOUGHT: {
|
|
1821
|
-
step.
|
|
1820
|
+
step.state = {type: 'completed'};
|
|
1822
1821
|
step.thought = data.thought;
|
|
1823
1822
|
commitStep();
|
|
1824
1823
|
break;
|
|
@@ -1837,24 +1836,25 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1837
1836
|
break;
|
|
1838
1837
|
}
|
|
1839
1838
|
case AiAssistanceModel.AiAgent.ResponseType.SIDE_EFFECT: {
|
|
1840
|
-
step.isLoading = false;
|
|
1841
1839
|
step.code ??= data.code;
|
|
1842
|
-
step.
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
data.
|
|
1846
|
-
|
|
1847
|
-
|
|
1840
|
+
step.state = {
|
|
1841
|
+
type: 'needs_approval',
|
|
1842
|
+
sideEffectDialog: {
|
|
1843
|
+
description: data.description,
|
|
1844
|
+
onAnswer: (result: boolean) => {
|
|
1845
|
+
data.confirm(result);
|
|
1846
|
+
step.state = {type: 'completed'};
|
|
1847
|
+
this.requestUpdate();
|
|
1848
|
+
},
|
|
1848
1849
|
},
|
|
1849
1850
|
};
|
|
1850
1851
|
commitStep();
|
|
1851
1852
|
break;
|
|
1852
1853
|
}
|
|
1853
1854
|
case AiAssistanceModel.AiAgent.ResponseType.ACTION: {
|
|
1854
|
-
step.
|
|
1855
|
+
step.state = data.canceled ? {type: 'canceled'} : {type: 'completed'};
|
|
1855
1856
|
step.code ??= data.code;
|
|
1856
1857
|
step.output ??= data.output;
|
|
1857
|
-
step.canceled = data.canceled;
|
|
1858
1858
|
step.widgets ??= data.widgets;
|
|
1859
1859
|
commitStep();
|
|
1860
1860
|
break;
|
|
@@ -1890,12 +1890,12 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1890
1890
|
// TODO(crbug.com/463323934): Remove specially handling this case.
|
|
1891
1891
|
if (systemMessage.parts.length > 1) {
|
|
1892
1892
|
const firstPart = systemMessage.parts[0];
|
|
1893
|
-
if (firstPart.type === 'step' && firstPart.step.
|
|
1893
|
+
if (firstPart.type === 'step' && firstPart.step.state.type === 'in_progress' && !firstPart.step.thought &&
|
|
1894
1894
|
!firstPart.step.code && !firstPart.step.contextDetails) {
|
|
1895
1895
|
systemMessage.parts.shift();
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
|
-
step.
|
|
1898
|
+
step.state = {type: 'completed'};
|
|
1899
1899
|
break;
|
|
1900
1900
|
}
|
|
1901
1901
|
case AiAssistanceModel.AiAgent.ResponseType.ERROR: {
|
|
@@ -1905,9 +1905,9 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1905
1905
|
const lastStep = lastPart.step;
|
|
1906
1906
|
// Mark the last step as cancelled to make the UI feel better.
|
|
1907
1907
|
if (data.error === AiAssistanceModel.AiAgent.ErrorType.ABORT) {
|
|
1908
|
-
lastStep.
|
|
1908
|
+
lastStep.state = {type: 'canceled'};
|
|
1909
1909
|
// If error happens while the step is still loading remove it.
|
|
1910
|
-
} else if (lastStep.
|
|
1910
|
+
} else if (lastStep.state.type === 'in_progress') {
|
|
1911
1911
|
systemMessage.parts.pop();
|
|
1912
1912
|
}
|
|
1913
1913
|
}
|
|
@@ -1923,10 +1923,10 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1923
1923
|
|
|
1924
1924
|
case AiAssistanceModel.AiAgent.ResponseType.CONTEXT_CHANGE: {
|
|
1925
1925
|
this.#handleConversationContextChange(data.context);
|
|
1926
|
-
step.
|
|
1926
|
+
step.state = {type: 'completed'};
|
|
1927
1927
|
step.widgets = data.widgets;
|
|
1928
1928
|
commitStep();
|
|
1929
|
-
step = {
|
|
1929
|
+
step = {state: {type: 'in_progress'}};
|
|
1930
1930
|
break;
|
|
1931
1931
|
}
|
|
1932
1932
|
}
|
|
@@ -166,13 +166,6 @@ Common.Settings.registerSettingExtension({
|
|
|
166
166
|
},
|
|
167
167
|
});
|
|
168
168
|
|
|
169
|
-
Common.Settings.registerSettingExtension({
|
|
170
|
-
category: Common.Settings.SettingCategory.AI,
|
|
171
|
-
settingName: 'ai-assistance-v2-opt-in-change-dialog-seen',
|
|
172
|
-
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
173
|
-
defaultValue: false,
|
|
174
|
-
});
|
|
175
|
-
|
|
176
169
|
UI.ActionRegistration.registerActionExtension({
|
|
177
170
|
actionId: 'freestyler.main-menu',
|
|
178
171
|
contextTypes(): [] {
|
|
@@ -802,6 +802,10 @@ export class ChatInput extends UI.Widget.Widget implements SDK.TargetManager.Obs
|
|
|
802
802
|
const imageInput = !this.#imageInput?.isLoading && this.#imageInput?.data ?
|
|
803
803
|
{inlineData: {data: this.#imageInput.data, mimeType: this.#imageInput.mimeType}} :
|
|
804
804
|
undefined;
|
|
805
|
+
const text = this.#textAreaRef.value?.value?.trim() ?? '';
|
|
806
|
+
if (!text && !imageInput) {
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
805
809
|
this.onTextSubmit(this.#textAreaRef.value?.value ?? '', imageInput, this.#imageInput?.inputType);
|
|
806
810
|
this.#imageInput = undefined;
|
|
807
811
|
this.#historyOffset = -1;
|
|
@@ -423,23 +423,65 @@ const UIStringsNotTranslate = {
|
|
|
423
423
|
inspectedFileNames: 'Inspected file names',
|
|
424
424
|
} as const;
|
|
425
425
|
|
|
426
|
+
/**
|
|
427
|
+
* Payload and confirmation handler for side-effect operations requiring user approval.
|
|
428
|
+
*/
|
|
429
|
+
export interface ConfirmSideEffectDialog {
|
|
430
|
+
/**
|
|
431
|
+
* Human-readable description explaining the pending side-effect action, or null if omitted.
|
|
432
|
+
*/
|
|
433
|
+
description: string|null;
|
|
434
|
+
/**
|
|
435
|
+
* Callback invoked when the user resolves the dialog (true to confirm, false to decline).
|
|
436
|
+
*/
|
|
437
|
+
onAnswer: (result: boolean) => void;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Represents the execution state of an individual agent action step:
|
|
442
|
+
* - `in_progress`: The step is actively querying context or parsing stream content.
|
|
443
|
+
* - `needs_approval`: The step is awaiting user confirmation for a side-effecting operation.
|
|
444
|
+
* - `canceled`: The step was canceled before execution.
|
|
445
|
+
* - `completed`: The step completed execution successfully.
|
|
446
|
+
*/
|
|
447
|
+
export type StepState = {
|
|
448
|
+
type: 'in_progress',
|
|
449
|
+
}|{type: 'needs_approval', sideEffectDialog: ConfirmSideEffectDialog}|{type: 'canceled'}|{type: 'completed'};
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Represents an individual execution step within an agent response.
|
|
453
|
+
*/
|
|
426
454
|
export interface Step {
|
|
427
|
-
|
|
455
|
+
/**
|
|
456
|
+
* The current lifecycle state of this step.
|
|
457
|
+
*/
|
|
458
|
+
state: StepState;
|
|
459
|
+
/**
|
|
460
|
+
* The agent's intermediate thought or rationale for taking this step.
|
|
461
|
+
*/
|
|
428
462
|
thought?: string;
|
|
463
|
+
/**
|
|
464
|
+
* The human-readable title describing the step action.
|
|
465
|
+
*/
|
|
429
466
|
title?: string;
|
|
467
|
+
/**
|
|
468
|
+
* Executable JavaScript code generated or executed in this step.
|
|
469
|
+
*/
|
|
430
470
|
code?: string;
|
|
471
|
+
/**
|
|
472
|
+
* Raw string output or data returned by code execution.
|
|
473
|
+
*/
|
|
431
474
|
output?: string;
|
|
475
|
+
/**
|
|
476
|
+
* Visual widgets rendered alongside this step (e.g. core web vitals, network traces).
|
|
477
|
+
*/
|
|
432
478
|
widgets?: AiWidget[];
|
|
433
|
-
|
|
434
|
-
|
|
479
|
+
/**
|
|
480
|
+
* Context item details gathered or inspected during this step.
|
|
481
|
+
*/
|
|
435
482
|
contextDetails?: [AiAssistanceModel.AiAgent.ContextDetail, ...AiAssistanceModel.AiAgent.ContextDetail[]];
|
|
436
483
|
}
|
|
437
484
|
|
|
438
|
-
export interface ConfirmSideEffectDialog {
|
|
439
|
-
description: string|null;
|
|
440
|
-
onAnswer: (result: boolean) => void;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
485
|
export const enum ChatMessageEntity {
|
|
444
486
|
MODEL = 'model',
|
|
445
487
|
USER = 'user',
|
|
@@ -651,7 +693,7 @@ export function titleForStep(step: Step): string {
|
|
|
651
693
|
}
|
|
652
694
|
|
|
653
695
|
function renderTitle(step: Step): Lit.LitTemplate {
|
|
654
|
-
const paused = step.
|
|
696
|
+
const paused = step.state.type === 'needs_approval' ?
|
|
655
697
|
html`<span class="paused">${lockedString(UIStringsNotTranslate.paused)}: </span>` :
|
|
656
698
|
Lit.nothing;
|
|
657
699
|
|
|
@@ -665,8 +707,9 @@ function renderStepCode(step: Step): Lit.LitTemplate {
|
|
|
665
707
|
|
|
666
708
|
// If there is no "output" yet, it means we didn't execute the code yet (e.g. maybe it is still waiting for confirmation from the user)
|
|
667
709
|
// thus we show "Code to execute" text rather than "Code executed" text on the heading of the code block.
|
|
668
|
-
const codeHeadingText = (step.output &&
|
|
669
|
-
|
|
710
|
+
const codeHeadingText = (step.output && step.state.type !== 'canceled') ?
|
|
711
|
+
lockedString(UIStringsNotTranslate.codeExecuted) :
|
|
712
|
+
lockedString(UIStringsNotTranslate.codeToExecute);
|
|
670
713
|
|
|
671
714
|
// If there is output, we don't show notice on this code block and instead show
|
|
672
715
|
// it in the data returned code block.
|
|
@@ -705,7 +748,8 @@ function renderStepDetails({
|
|
|
705
748
|
markdownRenderer: MarkdownLitRenderer,
|
|
706
749
|
isLast: boolean,
|
|
707
750
|
}): Lit.LitTemplate {
|
|
708
|
-
const sideEffects =
|
|
751
|
+
const sideEffects =
|
|
752
|
+
isLast && step.state.type === 'needs_approval' ? renderSideEffectConfirmationUi(step) : Lit.nothing;
|
|
709
753
|
const thought = step.thought ? html`<p>${renderTextAsMarkdown(step.thought, markdownRenderer)}</p>` : Lit.nothing;
|
|
710
754
|
|
|
711
755
|
// clang-format off
|
|
@@ -781,12 +825,12 @@ function renderWalkthroughSidebarButton(
|
|
|
781
825
|
<devtools-button
|
|
782
826
|
.variant=${variant}
|
|
783
827
|
.size=${Buttons.Button.Size.SMALL}
|
|
784
|
-
.title=${lastStep.
|
|
828
|
+
.title=${lastStep.state.type === 'in_progress' ? titleForStep(lastStep) : title}
|
|
785
829
|
.accessibleLabel=${accessibleLabel}
|
|
786
830
|
.jslogContext=${walkthrough.isExpanded ? 'ai-hide-walkthrough-sidebar' : 'ai-show-walkthrough-sidebar'}
|
|
787
831
|
data-show-walkthrough
|
|
788
832
|
@click=${() => {
|
|
789
|
-
if(walkthrough.activeSidebarMessage?.id === input.message.id && walkthrough.isExpanded) {
|
|
833
|
+
if (walkthrough.activeSidebarMessage?.id === input.message.id && walkthrough.isExpanded) {
|
|
790
834
|
walkthrough.onToggle(false, message as ModelChatMessage);
|
|
791
835
|
} else {
|
|
792
836
|
// Can't just toggle the visibility here; we need to ensure we
|
|
@@ -848,7 +892,7 @@ function renderWalkthroughUI(input: ChatMessageViewInput, steps: Step[]): Lit.Li
|
|
|
848
892
|
}
|
|
849
893
|
|
|
850
894
|
function renderSideEffectStepsUI(input: ChatMessageViewInput, steps: Step[]): Lit.LitTemplate {
|
|
851
|
-
const sideEffectSteps = steps.filter(s => s.
|
|
895
|
+
const sideEffectSteps = steps.filter(s => s.state.type === 'needs_approval' || s.state.type === 'canceled');
|
|
852
896
|
if (sideEffectSteps.length === 0) {
|
|
853
897
|
return Lit.nothing;
|
|
854
898
|
}
|
|
@@ -858,7 +902,6 @@ function renderSideEffectStepsUI(input: ChatMessageViewInput, steps: Step[]): Li
|
|
|
858
902
|
<div class="side-effect-container">
|
|
859
903
|
${renderStep({
|
|
860
904
|
step,
|
|
861
|
-
isLoading: input.isLoading,
|
|
862
905
|
markdownRenderer: input.markdownRenderer,
|
|
863
906
|
isLast: true,
|
|
864
907
|
})}
|
|
@@ -867,25 +910,27 @@ function renderSideEffectStepsUI(input: ChatMessageViewInput, steps: Step[]): Li
|
|
|
867
910
|
// clang-format on
|
|
868
911
|
}
|
|
869
912
|
|
|
870
|
-
function renderStepBadge({step,
|
|
913
|
+
function renderStepBadge({step, isLast}: {
|
|
871
914
|
step: Step,
|
|
872
|
-
isLoading: boolean,
|
|
873
915
|
isLast: boolean,
|
|
874
916
|
}): Lit.LitTemplate {
|
|
875
|
-
if (
|
|
917
|
+
if (isLast && step.state.type === 'in_progress') {
|
|
876
918
|
return html`<devtools-spinner aria-label=${lockedString(UIStringsNotTranslate.inProgress)}></devtools-spinner>`;
|
|
877
919
|
}
|
|
878
920
|
|
|
879
921
|
let iconName = 'checkmark';
|
|
880
922
|
let ariaLabel: string|undefined = lockedString(UIStringsNotTranslate.completed);
|
|
881
923
|
let role: 'button'|undefined = 'button';
|
|
882
|
-
if (step.
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
924
|
+
if (step.state.type === 'needs_approval') {
|
|
925
|
+
if (!isLast) {
|
|
926
|
+
console.error('A step in needs_approval state must be the last step.');
|
|
927
|
+
}
|
|
886
928
|
role = undefined;
|
|
887
929
|
ariaLabel = lockedString(UIStringsNotTranslate.paused);
|
|
888
930
|
iconName = 'pause-circle';
|
|
931
|
+
} else if (step.state.type === 'canceled') {
|
|
932
|
+
ariaLabel = lockedString(UIStringsNotTranslate.aborted);
|
|
933
|
+
iconName = 'cross';
|
|
889
934
|
}
|
|
890
935
|
|
|
891
936
|
return html`<devtools-icon
|
|
@@ -896,26 +941,25 @@ function renderStepBadge({step, isLoading, isLast}: {
|
|
|
896
941
|
></devtools-icon>`;
|
|
897
942
|
}
|
|
898
943
|
|
|
899
|
-
export function renderStep({step,
|
|
944
|
+
export function renderStep({step, markdownRenderer, isLast}: {
|
|
900
945
|
step: Step,
|
|
901
|
-
isLoading: boolean,
|
|
902
946
|
markdownRenderer: MarkdownLitRenderer,
|
|
903
947
|
isLast: boolean,
|
|
904
948
|
}): Lit.LitTemplate {
|
|
905
949
|
const stepClasses = Lit.Directives.classMap({
|
|
906
950
|
step: true,
|
|
907
|
-
empty: !step.thought && !step.code && !step.contextDetails &&
|
|
908
|
-
paused:
|
|
909
|
-
canceled:
|
|
951
|
+
empty: !step.thought && !step.code && !step.contextDetails && step.state.type !== 'needs_approval',
|
|
952
|
+
paused: step.state.type === 'needs_approval',
|
|
953
|
+
canceled: step.state.type === 'canceled',
|
|
910
954
|
});
|
|
911
955
|
// clang-format off
|
|
912
956
|
return html`
|
|
913
957
|
<details class=${stepClasses}
|
|
914
958
|
jslog=${VisualLogging.expand('step').track({click: true})}
|
|
915
|
-
.open=${
|
|
959
|
+
.open=${step.state.type === 'needs_approval'}>
|
|
916
960
|
<summary>
|
|
917
961
|
<div class="summary">
|
|
918
|
-
${renderStepBadge({ step,
|
|
962
|
+
${renderStepBadge({ step, isLast })}
|
|
919
963
|
${renderTitle(step)}
|
|
920
964
|
<devtools-icon
|
|
921
965
|
class="arrow"
|
|
@@ -1755,16 +1799,17 @@ async function renderWidgets(
|
|
|
1755
1799
|
}
|
|
1756
1800
|
|
|
1757
1801
|
function renderSideEffectConfirmationUi(step: Step): Lit.LitTemplate {
|
|
1758
|
-
if (
|
|
1802
|
+
if (step.state.type !== 'needs_approval') {
|
|
1759
1803
|
return Lit.nothing;
|
|
1760
1804
|
}
|
|
1805
|
+
const dialog = step.state.sideEffectDialog;
|
|
1761
1806
|
|
|
1762
1807
|
// clang-format off
|
|
1763
1808
|
return html`<div
|
|
1764
1809
|
class="side-effect-confirmation"
|
|
1765
1810
|
jslog=${VisualLogging.section('side-effect-confirmation')}
|
|
1766
1811
|
>
|
|
1767
|
-
${
|
|
1812
|
+
${dialog.description ? html`<p>${dialog.description}</p>` : Lit.nothing}
|
|
1768
1813
|
<div class="side-effect-buttons-container">
|
|
1769
1814
|
<devtools-button
|
|
1770
1815
|
.data=${
|
|
@@ -1773,7 +1818,7 @@ function renderSideEffectConfirmationUi(step: Step): Lit.LitTemplate {
|
|
|
1773
1818
|
jslogContext: 'decline-execute-code',
|
|
1774
1819
|
} as Buttons.Button.ButtonData
|
|
1775
1820
|
}
|
|
1776
|
-
@click=${() =>
|
|
1821
|
+
@click=${() => dialog.onAnswer(false)}
|
|
1777
1822
|
>${lockedString(
|
|
1778
1823
|
UIStringsNotTranslate.declineActionRequestApproval,
|
|
1779
1824
|
)}</devtools-button>
|
|
@@ -1785,7 +1830,7 @@ function renderSideEffectConfirmationUi(step: Step): Lit.LitTemplate {
|
|
|
1785
1830
|
iconName: 'play',
|
|
1786
1831
|
} as Buttons.Button.ButtonData
|
|
1787
1832
|
}
|
|
1788
|
-
@click=${() =>
|
|
1833
|
+
@click=${() => dialog.onAnswer(true)}
|
|
1789
1834
|
>${
|
|
1790
1835
|
lockedString(UIStringsNotTranslate.confirmActionRequestApproval)
|
|
1791
1836
|
}</devtools-button>
|
|
@@ -206,7 +206,7 @@ export const DEFAULT_VIEW = (
|
|
|
206
206
|
// Ensure that we render steps but not ones that need approval; a
|
|
207
207
|
// step that needs approval is always rendered into the main chat
|
|
208
208
|
// view regardless of if the walkthrough is open or not.
|
|
209
|
-
const renderableSteps = allSteps.filter(s =>
|
|
209
|
+
const renderableSteps = allSteps.filter(s => s.state.type !== 'needs_approval');
|
|
210
210
|
|
|
211
211
|
// clang-format off
|
|
212
212
|
const stepsOutput = renderableSteps.length > 0 ? html`
|
|
@@ -222,7 +222,6 @@ export const DEFAULT_VIEW = (
|
|
|
222
222
|
<div class="step-wrapper">
|
|
223
223
|
${renderStep({
|
|
224
224
|
step,
|
|
225
|
-
isLoading: input.isLoading,
|
|
226
225
|
markdownRenderer: input.markdownRenderer,
|
|
227
226
|
isLast: index === renderableSteps.length - 1,
|
|
228
227
|
})}
|