chrome-devtools-frontend 1.0.1616061 → 1.0.1621064
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/AUTHORS +1 -0
- package/docs/checklist/README.md +8 -7
- package/eslint.config.mjs +7 -0
- package/front_end/core/common/Object.ts +11 -2
- package/front_end/core/dom_extension/DOMExtension.ts +11 -8
- package/front_end/core/host/AidaClient.ts +8 -0
- package/front_end/core/host/AidaGcaTranslation.ts +1 -0
- package/front_end/core/host/UserMetrics.ts +0 -1
- package/front_end/core/platform/api/HostRuntime.ts +2 -2
- package/front_end/core/platform/browser/HostRuntime.ts +4 -2
- package/front_end/core/platform/node/HostRuntime.ts +2 -2
- package/front_end/core/root/ExperimentNames.ts +0 -1
- package/front_end/core/sdk/NetworkManager.ts +30 -4
- package/front_end/core/sdk/NetworkRequest.ts +2 -10
- package/front_end/core/sdk/Resource.ts +2 -1
- package/front_end/core/sdk/ServerSentEventsProtocol.ts +1 -1
- package/front_end/core/sdk/TraceObject.ts +7 -2
- package/front_end/entrypoint_template.html +1 -2
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +119 -15
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -2
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +43 -33
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +2 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +9 -6
- package/front_end/entrypoints/main/MainImpl.ts +0 -2
- package/front_end/generated/InspectorBackendCommands.ts +8 -7
- package/front_end/generated/SupportedCSSProperties.js +119 -100
- package/front_end/generated/protocol-mapping.d.ts +1 -9
- package/front_end/generated/protocol-proxy-api.d.ts +1 -9
- package/front_end/generated/protocol.ts +24 -1
- package/front_end/legacy/legacy-defs.d.ts +1 -1
- package/front_end/models/ai_assistance/AiConversation.ts +1 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +39 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -0
- package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +28 -16
- package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +512 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +112 -145
- package/front_end/models/ai_assistance/agents/README.md +0 -5
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +9 -16
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +19 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +48 -13
- package/front_end/models/bindings/SymbolizedError.ts +95 -8
- package/front_end/models/emulation/DeviceModeModel.ts +42 -13
- package/front_end/models/emulation/EmulatedDevices.ts +1 -1
- package/front_end/models/issues_manager/IssuesManager.ts +13 -6
- package/front_end/models/issues_manager/IssuesManagerEvents.ts +1 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +1 -0
- package/front_end/models/stack_trace/DetailedErrorStackParser.ts +49 -10
- package/front_end/models/stack_trace/ErrorStackParser.ts +18 -0
- package/front_end/models/stack_trace/StackTraceModel.ts +5 -1
- package/front_end/models/text_utils/ContentData.ts +71 -10
- package/front_end/models/trace/types/File.ts +8 -1
- package/front_end/models/web_mcp/WebMCPModel.ts +22 -0
- package/front_end/models/workspace/UISourceCode.ts +4 -4
- package/front_end/panels/accessibility/ARIAAttributesView.ts +4 -4
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +3 -2
- package/front_end/panels/accessibility/SourceOrderView.ts +4 -4
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatInput.ts +66 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +144 -21
- package/front_end/panels/ai_assistance/components/ChatView.ts +43 -8
- package/front_end/panels/ai_assistance/components/ExportForAgentsDialog.ts +1 -0
- package/front_end/panels/ai_assistance/components/WalkthroughUtils.ts +74 -0
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +34 -5
- package/front_end/panels/ai_assistance/components/chatMessage.css +11 -0
- package/front_end/panels/ai_assistance/components/walkthroughView.css +7 -0
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +1 -1
- package/front_end/panels/application/CookieItemsView.ts +8 -9
- package/front_end/panels/application/DOMStorageItemsView.ts +3 -3
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +7 -0
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +21 -0
- package/front_end/panels/application/DeviceBoundSessionsView.ts +2 -2
- package/front_end/panels/application/ExtensionStorageItemsView.ts +1 -1
- package/front_end/panels/application/KeyValueStorageItemsView.ts +32 -14
- package/front_end/panels/application/ResourcesPanel.ts +5 -5
- package/front_end/panels/application/StorageItemsToolbar.ts +0 -19
- package/front_end/panels/application/WebMCPView.ts +285 -86
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +4 -4
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +4 -4
- package/front_end/panels/application/webMCPView.css +261 -182
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +9 -5
- package/front_end/panels/changes/ChangesSidebar.ts +2 -2
- package/front_end/panels/changes/ChangesView.ts +9 -14
- package/front_end/panels/console/ConsolePanel.ts +10 -3
- package/front_end/panels/console/ConsoleSidebar.ts +5 -5
- package/front_end/panels/console/ConsoleView.ts +11 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -19
- package/front_end/panels/coverage/CoverageView.ts +4 -5
- package/front_end/panels/elements/ElementsPanel.ts +9 -12
- package/front_end/panels/elements/ElementsSidebarPane.ts +4 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +61 -0
- package/front_end/panels/elements/ElementsTreeOutline.ts +46 -0
- package/front_end/panels/elements/LayersWidget.ts +2 -2
- package/front_end/panels/elements/MetricsSidebarPane.ts +5 -4
- package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +11 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -1
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +19 -20
- package/front_end/panels/elements/components/ElementsBreadcrumbsUtils.ts +29 -29
- package/front_end/panels/elements/components/QueryContainer.ts +5 -6
- package/front_end/panels/elements/components/components.ts +0 -2
- package/front_end/panels/emulation/MediaQueryInspector.ts +4 -7
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +4 -7
- package/front_end/panels/layer_viewer/Layers3DView.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseStartView.ts +2 -2
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +47 -66
- package/front_end/panels/network/NetworkConfigView.ts +11 -11
- package/front_end/panels/network/RequestConditionsDrawer.ts +6 -4
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +4 -5
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +6 -9
- package/front_end/panels/profiler/HeapProfileView.ts +29 -4
- package/front_end/panels/profiler/ProfilesPanel.ts +1 -1
- package/front_end/panels/protocol_monitor/JSONEditor.css +8 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +7 -2
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +6 -4
- package/front_end/panels/recorder/components/ControlButton.ts +4 -4
- package/front_end/panels/recorder/components/StepView.ts +6 -6
- package/front_end/panels/search/SearchView.ts +4 -7
- package/front_end/panels/sources/DebuggerPausedMessage.ts +18 -22
- package/front_end/panels/sources/SourcesView.ts +1 -1
- package/front_end/panels/sources/TabbedEditorContainer.ts +2 -2
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +24 -20
- package/front_end/panels/timeline/StatusDialog.ts +5 -8
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +10 -0
- package/front_end/panels/timeline/TimelineLoader.ts +3 -4
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +2 -2
- package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +2 -0
- package/front_end/panels/timeline/components/TimelineSummary.ts +9 -1
- package/front_end/panels/timeline/components/timelineSummary.css +4 -0
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +2 -2
- package/front_end/panels/timeline/thirdPartyTreeView.css +8 -1
- package/front_end/panels/web_audio/WebAudioView.ts +5 -4
- package/front_end/panels/whats_new/ReleaseNoteText.ts +9 -9
- package/front_end/panels/whats_new/resources/WNDT.md +9 -6
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +41 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.d.ts +13 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.js +21 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +52 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +25 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/third_party/urlpattern-polyfill/urlpattern-polyfill.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/third_party/urlpattern-polyfill/urlpattern-polyfill.js +853 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +91 -11
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +1046 -33
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +41 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.d.ts +13 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.js +21 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +52 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +25 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/third_party/urlpattern-polyfill/urlpattern-polyfill.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/third_party/urlpattern-polyfill/urlpattern-polyfill.js +805 -0
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +91 -11
- package/front_end/third_party/puppeteer/package/package.json +3 -2
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +53 -11
- package/front_end/third_party/puppeteer/package/src/api/Extension.ts +29 -1
- package/front_end/third_party/puppeteer/package/src/bidi/ElementHandle.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/cdp/ElementHandle.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Extension.ts +9 -2
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +59 -0
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +6 -1
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +26 -0
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +0 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +2 -1
- package/front_end/third_party/web-vitals/README.chromium +2 -2
- package/front_end/third_party/web-vitals/package/README.md +21 -10
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js +2 -4
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +1 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +4 -0
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +44 -39
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +25 -19
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +1 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/doubleRAF.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getActivationStart.js +1 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.js +16 -18
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +2 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +1 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/whenActivated.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/whenIdleOrHidden.js +11 -7
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +4 -0
- package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +1 -2
- package/front_end/third_party/web-vitals/package/dist/modules/types.js +0 -1
- package/front_end/third_party/web-vitals/package/package.json +24 -27
- package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +2 -7
- package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +1 -2
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +49 -43
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +27 -24
- package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +1 -2
- package/front_end/third_party/web-vitals/package/src/lib/doubleRAF.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getActivationStart.ts +1 -2
- package/front_end/third_party/web-vitals/package/src/lib/getLoadState.ts +21 -20
- package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +2 -3
- package/front_end/third_party/web-vitals/package/src/lib/observe.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +2 -4
- package/front_end/third_party/web-vitals/package/src/lib/whenActivated.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/whenIdleOrHidden.ts +13 -7
- package/front_end/third_party/web-vitals/package/src/onCLS.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/types/inp.ts +4 -0
- package/front_end/third_party/web-vitals/package/src/types.ts +1 -2
- package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +13 -74
- package/front_end/third_party/web-vitals/rebuild.sh +3 -3
- package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +0 -1
- package/front_end/ui/components/icon_button/iconButton.css +1 -0
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +6 -6
- package/front_end/ui/components/lists/list.css +4 -0
- package/front_end/ui/legacy/Dialog.ts +21 -2
- package/front_end/ui/legacy/SoftContextMenu.ts +3 -3
- package/front_end/ui/legacy/SplitWidget.ts +9 -9
- package/front_end/ui/legacy/TabbedPane.ts +12 -12
- package/front_end/ui/legacy/View.ts +24 -22
- package/front_end/ui/legacy/ViewManager.ts +12 -12
- package/front_end/ui/legacy/ViewRegistration.ts +2 -2
- package/front_end/ui/legacy/Widget.ts +165 -119
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +10 -5
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +9 -6
- package/front_end/ui/legacy/components/utils/Linkifier.ts +37 -11
- package/front_end/ui/legacy/components/utils/jsUtils.css +1 -0
- package/front_end/ui/legacy/inspectorCommon.css +0 -6
- package/front_end/ui/lit/render.ts +11 -9
- package/front_end/ui/visual_logging/KnownContextValues.ts +36 -0
- package/package.json +1 -1
- package/front_end/Images/src/dots-circle.svg +0 -10
- package/front_end/panels/elements/components/Helper.ts +0 -35
- package/front_end/third_party/web-vitals/package/dist/modules/types/polyfills.d.ts +0 -4
- package/front_end/third_party/web-vitals/package/dist/modules/types/polyfills.js +0 -16
- package/front_end/third_party/web-vitals/package/src/types/polyfills.ts +0 -24
|
@@ -8,7 +8,6 @@ import * as i18n from '../../../core/i18n/i18n.js';
|
|
|
8
8
|
import * as Platform from '../../../core/platform/platform.js';
|
|
9
9
|
import * as Root from '../../../core/root/root.js';
|
|
10
10
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
11
|
-
import type * as Protocol from '../../../generated/protocol.js';
|
|
12
11
|
import * as Tracing from '../../../services/tracing/tracing.js';
|
|
13
12
|
import * as Annotations from '../../annotations/annotations.js';
|
|
14
13
|
import * as Logs from '../../logs/logs.js';
|
|
@@ -53,8 +52,8 @@ const lockedString = i18n.i18n.lockedString;
|
|
|
53
52
|
* Labels used to identify specific periods or categories in the trace for getting main thread summary.
|
|
54
53
|
* Supports hardcoded phases, dynamic navigation IDs (`NAVIGATION_X`), and insight models.
|
|
55
54
|
*/
|
|
56
|
-
type MainThreadSectionLabel = 'nav-to-lcp'|'lcp-ttfb'|'lcp-render-delay'|'trace-bounds'|'NO_NAVIGATION'|
|
|
57
|
-
|
|
55
|
+
export type MainThreadSectionLabel = 'nav-to-lcp'|'lcp-ttfb'|'lcp-render-delay'|'trace-bounds'|'NO_NAVIGATION'|
|
|
56
|
+
`NAVIGATION_${string}`|keyof Trace.Insights.Types.InsightModels;
|
|
58
57
|
|
|
59
58
|
/**
|
|
60
59
|
* WARNING: preamble defined in code is only used when userTier is
|
|
@@ -62,11 +61,10 @@ type MainThreadSectionLabel = 'nav-to-lcp'|'lcp-ttfb'|'lcp-render-delay'|'trace-
|
|
|
62
61
|
* chrome_preambles.gcl). Sync local changes with the server-side.
|
|
63
62
|
*/
|
|
64
63
|
|
|
65
|
-
const
|
|
64
|
+
const GREEN_DEV_ANNOTATIONS_INSTRUCTIONS = `
|
|
66
65
|
- CRITICAL: You also have access to functions called addElementAnnotation and addNeworkRequestAnnotation,
|
|
67
|
-
which should be used to highlight elements and network requests (respectively)
|
|
66
|
+
which should be used to highlight elements and network requests (respectively).
|
|
68
67
|
|
|
69
|
-
const greenDevAdditionalAnnotationsGuidelines = `
|
|
70
68
|
- CRITICAL: Each time an element or a network request is mentioned, you MUST ALSO call the functions
|
|
71
69
|
addElementAnnotation (for an element) or addNeworkRequestAnnotation (for a network request).
|
|
72
70
|
- CRITICAL: Don't add more than one annotation per element or network request.
|
|
@@ -75,6 +73,24 @@ const greenDevAdditionalAnnotationsGuidelines = `
|
|
|
75
73
|
- The annotationMessage should be descriptive and relevant to why the element or network request is being highlighted.
|
|
76
74
|
`;
|
|
77
75
|
|
|
76
|
+
const GREEN_DEV_FRESH_TRACE_ANNOTATIONS_INSTRUCTIONS = `
|
|
77
|
+
When referring to an element for which you know the nodeId, always call the function addElementAnnotation, specifying
|
|
78
|
+
the id and an annotation reason.
|
|
79
|
+
When referring to a network request for which you know the eventKey for, always call the function
|
|
80
|
+
addNetworkRequestAnnotation, specifying the id and an annotation reason.
|
|
81
|
+
- CRITICAL: Each time you add an annotating link you MUST ALSO call the function addElementAnnotation.
|
|
82
|
+
- CRITICAL: Each time you describe an element or network request as being problematic you MUST call the function
|
|
83
|
+
addElementAnnotation and specify an annotation reason.
|
|
84
|
+
- CRITICAL: Each time you describe a network request as being problematic you MUST call the function
|
|
85
|
+
addNetworkRequestAnnotation and specify an annotation reason.
|
|
86
|
+
- CRITICAL: If you spot ANY of the following problems:
|
|
87
|
+
- Render-blocking elements/network requests.
|
|
88
|
+
- Significant long task (especially on main thread).
|
|
89
|
+
- Layout shifts (e.g. due to unsized images).
|
|
90
|
+
... then you MUST call addNetworkRequestAnnotation for ALL network requests and addaddElementAnnotation for all
|
|
91
|
+
elements described in your conclusion.
|
|
92
|
+
`;
|
|
93
|
+
|
|
78
94
|
/**
|
|
79
95
|
* Preamble clocks in at ~1341 tokens.
|
|
80
96
|
* The prose is around 4.5 chars per token.
|
|
@@ -82,9 +98,7 @@ const greenDevAdditionalAnnotationsGuidelines = `
|
|
|
82
98
|
*
|
|
83
99
|
* Check token length in https://aistudio.google.com/
|
|
84
100
|
*/
|
|
85
|
-
const
|
|
86
|
-
const annotationsEnabled = Annotations.AnnotationRepository.annotationsEnabled();
|
|
87
|
-
return `You are an assistant, expert in web performance and highly skilled with Chrome DevTools.
|
|
101
|
+
const preamble = `You are an assistant, expert in web performance and highly skilled with Chrome DevTools.
|
|
88
102
|
|
|
89
103
|
Your primary goal is to provide actionable advice to web developers about their web page by using the Chrome Performance Panel and analyzing a trace. You may need to diagnose problems yourself, or you may be given direction for what to focus on by the user.
|
|
90
104
|
|
|
@@ -94,8 +108,6 @@ Always call getInsightDetails to gather more data on an insight or the actual LC
|
|
|
94
108
|
|
|
95
109
|
You have functions available to learn more about the trace. Use these to confirm hypotheses, or to further explore the trace when diagnosing performance issues.
|
|
96
110
|
|
|
97
|
-
${annotationsEnabled ? greenDevAdditionalAnnotationsFunction : ''}
|
|
98
|
-
|
|
99
111
|
You will be given bounds representing a time range within the trace. Bounds include a min and a max time in microseconds. max is always bigger than min in a bounds.
|
|
100
112
|
|
|
101
113
|
The 3 main performance metrics are:
|
|
@@ -146,15 +158,14 @@ Note: if the user asks a specific question about the trace (such as "What is my
|
|
|
146
158
|
|
|
147
159
|
## Guidelines
|
|
148
160
|
|
|
149
|
-
- You must call \`
|
|
150
|
-
- Dig Deeper: Before replying, you should really dig into the main thread activity to uncover what the performance issues actually are.
|
|
151
|
-
- No Shortcutting: Even if the initial facts contain specific line numbers or function names, you are not allowed to reply using only that information. You MUST call \`
|
|
152
|
-
- Look for Aggregated Cost: Performance issues are not always caused by a single "Long Task". Many small, frequent events (like unthrottled \`mousemove\` or \`scroll\` handlers) can add up to significant main thread blockage. Use the Bottom-Up summary in \`
|
|
161
|
+
- You must call \`getMainThreadTrackSummaryByLabel\` (with the relevant label) to investigate the main thread activity before giving the user a reply or suggesting solutions for any performance problem or insight. This applies even if you already have some information about that period from \`getInsightDetails\` or the initial trace summary.
|
|
162
|
+
- Dig Deeper: Before replying, you should really dig into the main thread activity to uncover what the performance issues actually are. Do not solely rely on the information from the initial data; ensure you identify the root cause before suggesting solutions.
|
|
163
|
+
- No Shortcutting: Even if the initial facts contain specific line numbers or function names, you are not allowed to reply using only that information. You MUST call \`getMainThreadTrackSummaryByLabel\` to inspect its context before describing it to the user.
|
|
164
|
+
- Look for Aggregated Cost: Performance issues are not always caused by a single "Long Task". Many small, frequent events (like unthrottled \`mousemove\` or \`scroll\` handlers) can add up to significant main thread blockage. Use the Bottom-Up summary in \`getMainThreadTrackSummaryByLabel\` to identify functions with high total time, even if they are not associated with a Long Task.
|
|
153
165
|
- Use the provided functions to get detailed performance data. Prioritize functions that provide context relevant to the performance issue being investigated.
|
|
154
166
|
- Before finalizing your advice, look over it and validate using any relevant functions. If something seems off, refine the advice before giving it to the user.
|
|
155
167
|
- Base your analysis and advice solely on the data retrieved through the provided functions. Always use the provided functions to gather sufficient data when needed.
|
|
156
168
|
- Use absolute microsecond timestamps for any function that requires a \`min\` and \`max\` bounds. These timestamps can be found in the trace summary or within the details of an insight.
|
|
157
|
-
- Example: If the trace bounds are {min: 1000, max: 5000} and you want to investigate a specific interaction that happened between 2000 and 3000, you should call \`getMainThreadTrackSummary({min: 2000, max: 3000})\`.
|
|
158
169
|
- Available labels for \`getMainThreadTrackSummaryByLabel\` include:
|
|
159
170
|
- \`trace-bounds\` (entire trace)
|
|
160
171
|
- \`nav-to-lcp\` (navigation to LCP)
|
|
@@ -168,8 +179,6 @@ Note: if the user asks a specific question about the trace (such as "What is my
|
|
|
168
179
|
- Structure your response using markdown headings and bullet points for improved readability.
|
|
169
180
|
- Be direct and to the point. Avoid unnecessary introductory phrases or filler content. Focus on delivering actionable advice efficiently.
|
|
170
181
|
|
|
171
|
-
${annotationsEnabled ? greenDevAdditionalAnnotationsGuidelines : ''}
|
|
172
|
-
|
|
173
182
|
## Strict Constraints
|
|
174
183
|
|
|
175
184
|
Adhere to the following critical requirements:
|
|
@@ -181,13 +190,12 @@ Adhere to the following critical requirements:
|
|
|
181
190
|
- Ensure comprehensive data retrieval through function calls to provide accurate and complete recommendations.
|
|
182
191
|
- If the user asks a specific question about web performance that doesn't have anything to do with the trace, don't call any functions and be succinct in your answer.
|
|
183
192
|
- Before suggesting changing the format of an image, consider what format it is already in. For example, if the mime type is image/webp, do not suggest to the user that the image is converted to WebP, as the image is already in that format.
|
|
184
|
-
- Do not mention the functions you call to gather information about the trace (e.g., \`getEventByKey\`, \`
|
|
193
|
+
- Do not mention the functions you call to gather information about the trace (e.g., \`getEventByKey\`, \`getMainThreadTrackSummaryByLabel\`) in your output. These are internal implementation details that should be hidden from the user.
|
|
185
194
|
- Do not mention that you are an AI, or refer to yourself in the third person. You are simulating a performance expert.
|
|
186
195
|
- If asked about sensitive topics (religion, race, politics, sexuality, gender, etc.), respond with: "My expertise is limited to website performance analysis. I cannot provide information on that topic.".
|
|
187
196
|
- Do not provide answers on non-web-development topics, such as legal, financial, medical, or personal advice.
|
|
188
197
|
- Use the precision of Strunk & White, the brevity of Hemingway, and the simple clarity of Vonnegut. Don't add repeated information, and keep the whole answer short.
|
|
189
198
|
`;
|
|
190
|
-
};
|
|
191
199
|
|
|
192
200
|
const extraPreambleWhenNotExternal = `Additional notes:
|
|
193
201
|
|
|
@@ -199,38 +207,14 @@ When referring to a trace event that has a corresponding \`eventKey\`, annotate
|
|
|
199
207
|
When asking the user to make a choice between options, output a list of choices at the end of your text response. The format is \`SUGGESTIONS: ["suggestion1", "suggestion2", "suggestion3"]\`. This MUST start on a newline, and be a single line.
|
|
200
208
|
`;
|
|
201
209
|
|
|
202
|
-
const
|
|
203
|
-
const annotationsEnabled = Annotations.AnnotationRepository.annotationsEnabled();
|
|
204
|
-
const greenDevAdditionalGuidelineFreshTrace = `
|
|
205
|
-
When referring to an element for which you know the nodeId, always call the function addElementAnnotation, specifying
|
|
206
|
-
the id and an annotation reason.
|
|
207
|
-
When referring to a network request for which you know the eventKey for, always call the function
|
|
208
|
-
addNetworkRequestAnnotation, specifying the id and an annotation reason.
|
|
209
|
-
- CRITICAL: Each time you add an annotating link you MUST ALSO call the function addElementAnnotation.
|
|
210
|
-
- CRITICAL: Each time you describe an element or network request as being problematic you MUST call the function
|
|
211
|
-
addElementAnnotation and specify an annotation reason.
|
|
212
|
-
- CRITICAL: Each time you describe a network request as being problematic you MUST call the function
|
|
213
|
-
addNetworkRequestAnnotation and specify an annotation reason.
|
|
214
|
-
- CRITICAL: If you spot ANY of the following problems:
|
|
215
|
-
- Render-blocking elements/network requests.
|
|
216
|
-
- Significant long task (especially on main thread).
|
|
217
|
-
- Layout shifts (e.g. due to unsized images).
|
|
218
|
-
... then you MUST call addNetworkRequestAnnotation for ALL network requests and addaddElementAnnotation for all
|
|
219
|
-
elements described in your conclusion.
|
|
220
|
-
`;
|
|
221
|
-
|
|
222
|
-
const extraPreambleWhenFreshTrace = `Additional notes:
|
|
210
|
+
const freshTracePreamble = `Additional notes:
|
|
223
211
|
|
|
224
212
|
When referring to an element for which you know the nodeId, annotate your output using markdown link syntax:
|
|
225
213
|
- For example, if nodeId is 23: [LCP element](#node-23)
|
|
226
214
|
- This link will reveal the element in the Elements panel
|
|
227
215
|
- Never mention node or nodeId when referring to the element, and especially not in the link text.
|
|
228
216
|
- When referring to the LCP, it's useful to also mention what the LCP element is via its nodeId. Use the markdown link syntax to do so.
|
|
229
|
-
|
|
230
|
-
${annotationsEnabled ? greenDevAdditionalGuidelineFreshTrace : ''}`;
|
|
231
|
-
|
|
232
|
-
return extraPreambleWhenFreshTrace;
|
|
233
|
-
};
|
|
217
|
+
`;
|
|
234
218
|
|
|
235
219
|
enum ScorePriority {
|
|
236
220
|
REQUIRED = 3,
|
|
@@ -367,11 +351,47 @@ export class PerformanceTraceContext extends ConversationContext<AgentFocus> {
|
|
|
367
351
|
// 16k Tokens * ~4 char per token.
|
|
368
352
|
const MAX_FUNCTION_RESULT_BYTE_LENGTH = 16384 * 4;
|
|
369
353
|
|
|
354
|
+
const STATIC_LABEL_NAMES: Record<string, string> = {
|
|
355
|
+
'nav-to-lcp': 'navigation to LCP',
|
|
356
|
+
'lcp-ttfb': 'LCP to TTFB',
|
|
357
|
+
'lcp-render-delay': 'LCP render delay',
|
|
358
|
+
'trace-bounds': 'the entire trace',
|
|
359
|
+
NO_NAVIGATION: 'the period before the first navigation',
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Converts the label name we use in the code to a human readable one that is
|
|
364
|
+
* shown to the user.
|
|
365
|
+
*/
|
|
366
|
+
export function getLabelName(label: MainThreadSectionLabel, focus: AgentFocus): string {
|
|
367
|
+
if (STATIC_LABEL_NAMES[label]) {
|
|
368
|
+
return STATIC_LABEL_NAMES[label];
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
const {parsedTrace} = focus;
|
|
372
|
+
const insightSetById = parsedTrace.insights?.get(label as Trace.Types.Events.NavigationId);
|
|
373
|
+
if (insightSetById) {
|
|
374
|
+
return `navigation to ${insightSetById.url.href}`;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// Go through all the insights we have to find the first one that matches to find the title.
|
|
378
|
+
// TODO(b/505291090): make it easier to look up Insight titles from a key.
|
|
379
|
+
for (const insightSet of parsedTrace.insights?.values() ?? []) {
|
|
380
|
+
const model = insightSet.model[label as keyof Trace.Insights.Types.InsightModels];
|
|
381
|
+
if (model) {
|
|
382
|
+
return `${model.title} insight`;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return label;
|
|
387
|
+
}
|
|
388
|
+
|
|
370
389
|
/**
|
|
371
390
|
* One agent instance handles one conversation. Create a new agent
|
|
372
391
|
* instance for a new conversation.
|
|
373
392
|
*/
|
|
374
393
|
export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
394
|
+
readonly preamble = preamble;
|
|
375
395
|
#formatter: PerformanceTraceFormatter|null = null;
|
|
376
396
|
#lastEventForEnhancedQuery: Trace.Types.Events.Event|undefined;
|
|
377
397
|
#lastInsightForEnhancedQuery: Trace.Insights.Types.InsightModel|undefined;
|
|
@@ -394,7 +414,15 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
394
414
|
metadata: {source: 'devtools', score: ScorePriority.CRITICAL}
|
|
395
415
|
};
|
|
396
416
|
#freshTraceExtraPreambleFact: Host.AidaClient.RequestFact = {
|
|
397
|
-
text:
|
|
417
|
+
text: freshTracePreamble,
|
|
418
|
+
metadata: {source: 'devtools', score: ScorePriority.CRITICAL}
|
|
419
|
+
};
|
|
420
|
+
#greenDevAnnotationsFact: Host.AidaClient.RequestFact = {
|
|
421
|
+
text: GREEN_DEV_ANNOTATIONS_INSTRUCTIONS,
|
|
422
|
+
metadata: {source: 'devtools', score: ScorePriority.CRITICAL}
|
|
423
|
+
};
|
|
424
|
+
#greenDevFreshTraceAnnotationsFact: Host.AidaClient.RequestFact = {
|
|
425
|
+
text: GREEN_DEV_FRESH_TRACE_ANNOTATIONS_INSTRUCTIONS,
|
|
398
426
|
metadata: {source: 'devtools', score: ScorePriority.CRITICAL}
|
|
399
427
|
};
|
|
400
428
|
#networkDataDescriptionFact: Host.AidaClient.RequestFact = {
|
|
@@ -416,6 +444,8 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
416
444
|
this.#networkDataDescriptionFact,
|
|
417
445
|
this.#freshTraceExtraPreambleFact,
|
|
418
446
|
this.#notExternalExtraPreambleFact,
|
|
447
|
+
this.#greenDevAnnotationsFact,
|
|
448
|
+
this.#greenDevFreshTraceAnnotationsFact,
|
|
419
449
|
]);
|
|
420
450
|
|
|
421
451
|
/**
|
|
@@ -425,20 +455,6 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
425
455
|
*/
|
|
426
456
|
#additionalSelectionsForQuery: string[] = [];
|
|
427
457
|
|
|
428
|
-
/**
|
|
429
|
-
* The CWV widget is shown when we analyze the trace summary, but we don't
|
|
430
|
-
* want to show it on every single "Analyzing data..." pill, as we show one
|
|
431
|
-
* after every prompt. So we make sure for a given Insight Set (which is based on navigation)
|
|
432
|
-
* we only show it once.
|
|
433
|
-
*/
|
|
434
|
-
#hasShownWidgetForInsightSet = new WeakSet<Trace.Insights.Types.InsightSet>();
|
|
435
|
-
#hasShownWidgetForCallTree = new WeakSet<AICallTree>();
|
|
436
|
-
#hasShownWidgetForInsight = new WeakSet<Trace.Insights.Types.InsightModel>();
|
|
437
|
-
|
|
438
|
-
get preamble(): string {
|
|
439
|
-
return buildPreamble();
|
|
440
|
-
}
|
|
441
|
-
|
|
442
458
|
get clientFeature(): Host.AidaClient.ClientFeature {
|
|
443
459
|
return Host.AidaClient.ClientFeature.CHROME_PERFORMANCE_FULL_AGENT;
|
|
444
460
|
}
|
|
@@ -497,35 +513,31 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
497
513
|
|
|
498
514
|
// Case 1: Specific task (call tree) -> timeline summary & bottom up tree widgets
|
|
499
515
|
if (focus.callTree) {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
});
|
|
520
|
-
this.#hasShownWidgetForCallTree.add(focus.callTree);
|
|
521
|
-
}
|
|
516
|
+
const event = focus.callTree.selectedNode?.event;
|
|
517
|
+
if (event) {
|
|
518
|
+
const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMicroSeconds(event);
|
|
519
|
+
const bounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(startTime, endTime);
|
|
520
|
+
widgets.push({
|
|
521
|
+
name: 'TIMELINE_RANGE_SUMMARY',
|
|
522
|
+
data: {
|
|
523
|
+
bounds,
|
|
524
|
+
parsedTrace: focus.parsedTrace,
|
|
525
|
+
track: 'main',
|
|
526
|
+
},
|
|
527
|
+
});
|
|
528
|
+
widgets.push({
|
|
529
|
+
name: 'BOTTOM_UP_TREE',
|
|
530
|
+
data: {
|
|
531
|
+
bounds,
|
|
532
|
+
parsedTrace: focus.parsedTrace,
|
|
533
|
+
},
|
|
534
|
+
});
|
|
522
535
|
}
|
|
523
536
|
return widgets;
|
|
524
537
|
}
|
|
525
538
|
|
|
526
539
|
// Case 2: LCP Insight -> LCP breakdown & CWV widgets
|
|
527
|
-
if (focus.insight && Trace.Insights.Models.LCPBreakdown.isLCPBreakdownInsight(focus.insight)
|
|
528
|
-
!this.#hasShownWidgetForInsight.has(focus.insight)) {
|
|
540
|
+
if (focus.insight && Trace.Insights.Models.LCPBreakdown.isLCPBreakdownInsight(focus.insight)) {
|
|
529
541
|
widgets.push({
|
|
530
542
|
name: 'PERF_INSIGHT',
|
|
531
543
|
data: {
|
|
@@ -533,12 +545,11 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
533
545
|
insightData: focus.insight,
|
|
534
546
|
},
|
|
535
547
|
});
|
|
536
|
-
this.#hasShownWidgetForInsight.add(focus.insight);
|
|
537
548
|
}
|
|
538
549
|
|
|
539
550
|
// Case 3: Whole Trace or insight other than LCP -> CWV widget
|
|
540
551
|
const primaryInsightSet = focus.primaryInsightSet;
|
|
541
|
-
if (primaryInsightSet
|
|
552
|
+
if (primaryInsightSet) {
|
|
542
553
|
widgets.push({
|
|
543
554
|
name: 'CORE_VITALS',
|
|
544
555
|
data: {
|
|
@@ -546,7 +557,6 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
546
557
|
insightSetKey: primaryInsightSet.id,
|
|
547
558
|
},
|
|
548
559
|
});
|
|
549
|
-
this.#hasShownWidgetForInsightSet.add(primaryInsightSet);
|
|
550
560
|
}
|
|
551
561
|
|
|
552
562
|
return widgets;
|
|
@@ -799,9 +809,17 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
799
809
|
this.addFact(this.#notExternalExtraPreambleFact);
|
|
800
810
|
}
|
|
801
811
|
|
|
812
|
+
const annotationsEnabled = Annotations.AnnotationRepository.annotationsEnabled();
|
|
813
|
+
if (annotationsEnabled) {
|
|
814
|
+
this.addFact(this.#greenDevAnnotationsFact);
|
|
815
|
+
}
|
|
816
|
+
|
|
802
817
|
const isFresh = Tracing.FreshRecording.Tracker.instance().recordingIsFresh(focus.parsedTrace);
|
|
803
818
|
if (isFresh) {
|
|
804
819
|
this.addFact(this.#freshTraceExtraPreambleFact);
|
|
820
|
+
if (annotationsEnabled) {
|
|
821
|
+
this.addFact(this.#greenDevFreshTraceAnnotationsFact);
|
|
822
|
+
}
|
|
805
823
|
}
|
|
806
824
|
|
|
807
825
|
this.addFact(this.#callFrameDataDescriptionFact);
|
|
@@ -901,7 +919,6 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
901
919
|
#declareFunctions(context: PerformanceTraceContext): void {
|
|
902
920
|
const focus = context.getItem();
|
|
903
921
|
const {parsedTrace} = focus;
|
|
904
|
-
const processedNodeIds = new Set<Protocol.DOM.BackendNodeId>();
|
|
905
922
|
|
|
906
923
|
this.declareFunction<{insightSetId: string, insightName: string}, {details: string}>('getInsightDetails', {
|
|
907
924
|
description:
|
|
@@ -958,9 +975,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
958
975
|
const lcpEvent = lcpMetric?.event;
|
|
959
976
|
if (lcpEvent && Trace.Types.Events.isAnyLargestContentfulPaintCandidate(lcpEvent)) {
|
|
960
977
|
const nodeId = lcpEvent.args.data?.nodeId;
|
|
961
|
-
|
|
962
|
-
// We do want to show the widget for the same node again, if it's within a new walkthrough.
|
|
963
|
-
if (nodeId && !processedNodeIds.has(nodeId)) {
|
|
978
|
+
if (nodeId) {
|
|
964
979
|
const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
965
980
|
const domModel = target?.model(SDK.DOMModel.DOMModel);
|
|
966
981
|
if (domModel) {
|
|
@@ -987,7 +1002,6 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
987
1002
|
networkRequest,
|
|
988
1003
|
},
|
|
989
1004
|
});
|
|
990
|
-
processedNodeIds.add(nodeId);
|
|
991
1005
|
}
|
|
992
1006
|
}
|
|
993
1007
|
}
|
|
@@ -1058,53 +1072,6 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
1058
1072
|
clampedMin as Trace.Types.Timing.Micro, clampedMax as Trace.Types.Timing.Micro);
|
|
1059
1073
|
};
|
|
1060
1074
|
|
|
1061
|
-
this.declareFunction<{min?: Trace.Types.Timing.Micro, max?: Trace.Types.Timing.Micro}, {
|
|
1062
|
-
summary: string,
|
|
1063
|
-
}>('getMainThreadTrackSummary', {
|
|
1064
|
-
description:
|
|
1065
|
-
'Returns a summary of the main thread for the given bounds. The result includes a top-down summary, bottom-up summary, third-parties summary, and a list of related insights for the events within the given bounds.',
|
|
1066
|
-
parameters: {
|
|
1067
|
-
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
1068
|
-
description: '',
|
|
1069
|
-
nullable: false,
|
|
1070
|
-
properties: {
|
|
1071
|
-
min: {
|
|
1072
|
-
type: Host.AidaClient.ParametersTypes.INTEGER,
|
|
1073
|
-
description: `The minimum time of the bounds, in microseconds (the current trace starts at ${
|
|
1074
|
-
parsedTrace.data.Meta.traceBounds.min})`,
|
|
1075
|
-
nullable: true,
|
|
1076
|
-
},
|
|
1077
|
-
max: {
|
|
1078
|
-
type: Host.AidaClient.ParametersTypes.INTEGER,
|
|
1079
|
-
description: `The maximum time of the bounds, in microseconds (the current trace ends at ${
|
|
1080
|
-
parsedTrace.data.Meta.traceBounds.max})`,
|
|
1081
|
-
nullable: true,
|
|
1082
|
-
},
|
|
1083
|
-
},
|
|
1084
|
-
required: []
|
|
1085
|
-
},
|
|
1086
|
-
displayInfoFromArgs: args => {
|
|
1087
|
-
const min = args.min ?? parsedTrace.data.Meta.traceBounds.min;
|
|
1088
|
-
const max = args.max ?? parsedTrace.data.Meta.traceBounds.max;
|
|
1089
|
-
return {
|
|
1090
|
-
title: lockedString(UIStringsNotTranslated.mainThreadActivity),
|
|
1091
|
-
action: `getMainThreadTrackSummary({min: ${min}, max: ${max}})`
|
|
1092
|
-
};
|
|
1093
|
-
},
|
|
1094
|
-
handler: async args => {
|
|
1095
|
-
debugLog('Function call: getMainThreadTrackSummary');
|
|
1096
|
-
|
|
1097
|
-
const bounds = createBounds(args.min, args.max);
|
|
1098
|
-
if (!bounds) {
|
|
1099
|
-
return {error: 'invalid bounds'};
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
const key = `getMainThreadTrackSummary({min: ${bounds.min}, max: ${bounds.max}})`;
|
|
1103
|
-
return await this.#handleMainThreadTrackSummary(bounds, focus, 'getMainThreadTrackSummary', key);
|
|
1104
|
-
},
|
|
1105
|
-
|
|
1106
|
-
});
|
|
1107
|
-
|
|
1108
1075
|
this.declareFunction<{label: MainThreadSectionLabel}, {summary: string}>('getMainThreadTrackSummaryByLabel', {
|
|
1109
1076
|
description:
|
|
1110
1077
|
'Returns a focused, detailed summary of the main thread for a predefined labeled period. Use this to get more relevant detail than the initial trace summary before diagnosing issues.',
|
|
@@ -1123,8 +1090,9 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
1123
1090
|
required: ['label']
|
|
1124
1091
|
},
|
|
1125
1092
|
displayInfoFromArgs: args => {
|
|
1093
|
+
const labelName = getLabelName(args.label, focus);
|
|
1126
1094
|
return {
|
|
1127
|
-
title: lockedString(UIStringsNotTranslated.mainThreadActivity),
|
|
1095
|
+
title: lockedString(`${UIStringsNotTranslated.mainThreadActivity}: ${labelName}`),
|
|
1128
1096
|
action: `getMainThreadTrackSummaryByLabel('${args.label}')`
|
|
1129
1097
|
};
|
|
1130
1098
|
},
|
|
@@ -1531,10 +1499,9 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
1531
1499
|
return parsedTrace.data.Meta.traceBounds;
|
|
1532
1500
|
}
|
|
1533
1501
|
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
}
|
|
1502
|
+
const insightSetById = parsedTrace.insights?.get(label as Trace.Types.Events.NavigationId);
|
|
1503
|
+
if (insightSetById) {
|
|
1504
|
+
return insightSetById.bounds;
|
|
1538
1505
|
}
|
|
1539
1506
|
|
|
1540
1507
|
if (insightSet) {
|
|
@@ -43,11 +43,6 @@ The agent can request additional data by calling functions. Here is the data the
|
|
|
43
43
|
- **Arguments**: `eventKey` (string)
|
|
44
44
|
- **Data Returned to Agent**: The full JSON representation of the specific trace event.
|
|
45
45
|
|
|
46
|
-
#### `getMainThreadTrackSummary`
|
|
47
|
-
- **Arguments**: `min` (integer, optional), `max` (integer, optional)
|
|
48
|
-
- **Data Returned to Agent**: A comprehensive text summary of main thread activity *within the specified bounds*.
|
|
49
|
-
- **Note**: This differs from the initial "Main Thread Activity Data" fact as it is scoped to the provided time range and includes significantly more data: a **top-down tree**, a **bottom-up tree**, a **third-parties summary**, and a list of **related insights** for events in that range.
|
|
50
|
-
|
|
51
46
|
#### `getNetworkTrackSummary`
|
|
52
47
|
- **Arguments**: `min` (integer, optional), `max` (integer, optional)
|
|
53
48
|
- **Data Returned to Agent**: A text summary of network requests and activity within the bounds.
|
|
@@ -47,14 +47,7 @@ const UIStringsNotTranslate = {
|
|
|
47
47
|
|
|
48
48
|
const lockedString = i18n.i18n.lockedString;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* WARNING: preamble defined in code is only used when userTier is
|
|
53
|
-
* TESTERS. Otherwise, a server-side preamble is used (see
|
|
54
|
-
* chrome_preambles.gcl). Sync local changes with the server-side.
|
|
55
|
-
*/
|
|
56
|
-
/* clang-format off */
|
|
57
|
-
let preamble = `You are the most advanced CSS/DOM/HTML debugging assistant integrated into Chrome DevTools.
|
|
50
|
+
const preamble = `You are the most advanced CSS/DOM/HTML debugging assistant integrated into Chrome DevTools.
|
|
58
51
|
You always suggest considering the best web development practices and the newest platform features such as view transitions.
|
|
59
52
|
The user selected a DOM element in the browser's DevTools and sends a query about the page or the selected DOM element.
|
|
60
53
|
First, examine the provided context, then use the functions to gather additional context and resolve the user request.
|
|
@@ -92,9 +85,7 @@ If the user asks a question that requires an investigation of a problem, use thi
|
|
|
92
85
|
- [Suggestion 1]
|
|
93
86
|
- [Suggestion 2]`;
|
|
94
87
|
|
|
95
|
-
|
|
96
|
-
if (greenDevEmulationEnabled) {
|
|
97
|
-
preamble += `
|
|
88
|
+
const emulationInstructions = `
|
|
98
89
|
# Emulation and Screenshots
|
|
99
90
|
|
|
100
91
|
* If asked to verify whether the page is visually broken or if there are display problems with specific devices, use the \`activateDeviceEmulation\` tool. This tool will activate emulation for a specified device and capture a screenshot.
|
|
@@ -127,10 +118,6 @@ When referring to an element for which you know the nodeId, annotate your output
|
|
|
127
118
|
- Always prefix the nodeId with the 'node-' prefix when using the markdown syntax.
|
|
128
119
|
- This link will reveal the element in the Elements panel
|
|
129
120
|
- Never mention node or nodeId when referring to the element, and especially not in the link text.`;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return preamble;
|
|
133
|
-
}
|
|
134
121
|
|
|
135
122
|
/* clang-format on */
|
|
136
123
|
|
|
@@ -242,7 +229,7 @@ export class NodeContext extends ConversationContext<SDK.DOMModel.DOMNode> {
|
|
|
242
229
|
* instance for a new conversation.
|
|
243
230
|
*/
|
|
244
231
|
export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
|
|
245
|
-
preamble =
|
|
232
|
+
readonly preamble = preamble;
|
|
246
233
|
readonly clientFeature = Host.AidaClient.ClientFeature.CHROME_STYLING_AGENT;
|
|
247
234
|
get userTier(): string|undefined {
|
|
248
235
|
const greenDevEmulationEnabled = Greendev.Prototypes.instance().isEnabled('emulationCapabilities');
|
|
@@ -278,6 +265,7 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
|
|
|
278
265
|
#createExtensionScope: CreateExtensionScopeFunction;
|
|
279
266
|
#greenDevEmulationScreenshot: string|null = null;
|
|
280
267
|
#greenDevEmulationAxTree: string|null = null;
|
|
268
|
+
#hasAddedEmulationInstructions = false;
|
|
281
269
|
#currentTurnId = 0;
|
|
282
270
|
|
|
283
271
|
constructor(opts: ExecuteJsAgentOptions) {
|
|
@@ -821,6 +809,11 @@ export class StylingAgent extends AiAgent<SDK.DOMModel.DOMNode> {
|
|
|
821
809
|
this.#greenDevEmulationAxTree = null;
|
|
822
810
|
}
|
|
823
811
|
|
|
812
|
+
if (Greendev.Prototypes.instance().isEnabled('emulationCapabilities') && !this.#hasAddedEmulationInstructions) {
|
|
813
|
+
multimodalInputEnhancementQuery = emulationInstructions + '\n' + multimodalInputEnhancementQuery;
|
|
814
|
+
this.#hasAddedEmulationInstructions = true;
|
|
815
|
+
}
|
|
816
|
+
|
|
824
817
|
const elementEnchancementQuery = selectedElement ?
|
|
825
818
|
`# Inspected element\n\n${
|
|
826
819
|
await StylingAgent.describeElement(selectedElement.getItem())}\n\n# User request\n\n` :
|
|
@@ -9,6 +9,7 @@ import * as BreakpointDebuggerAgent from './agents/BreakpointDebuggerAgent.js';
|
|
|
9
9
|
import * as ContextSelectionAgent from './agents/ContextSelectionAgent.js';
|
|
10
10
|
import * as ConversationSummaryAgent from './agents/ConversationSummaryAgent.js';
|
|
11
11
|
import * as FileAgent from './agents/FileAgent.js';
|
|
12
|
+
import * as GreenDevAgent from './agents/GreenDevAgent.js';
|
|
12
13
|
import * as NetworkAgent from './agents/NetworkAgent.js';
|
|
13
14
|
import * as PatchAgent from './agents/PatchAgent.js';
|
|
14
15
|
import * as PerformanceAgent from './agents/PerformanceAgent.js';
|
|
@@ -53,6 +54,7 @@ export {
|
|
|
53
54
|
ExtensionScope,
|
|
54
55
|
FileAgent,
|
|
55
56
|
FileFormatter,
|
|
57
|
+
GreenDevAgent,
|
|
56
58
|
Injected,
|
|
57
59
|
LighthouseFormatter,
|
|
58
60
|
NetworkAgent,
|
|
@@ -134,6 +134,9 @@ const console = {
|
|
|
134
134
|
};`;
|
|
135
135
|
/* clang-format on */
|
|
136
136
|
|
|
137
|
+
const MIN_CHARACTER_THRESHOLD = 5;
|
|
138
|
+
const EMPTY_RESPONSE_DIFF_THRESHOLD = 3;
|
|
139
|
+
|
|
137
140
|
/**
|
|
138
141
|
* The AiCodeCompletion class is responsible for fetching code completion suggestions
|
|
139
142
|
* from the AIDA backend.
|
|
@@ -142,6 +145,7 @@ export class AiCodeCompletion {
|
|
|
142
145
|
#stopSequences: string[];
|
|
143
146
|
#renderingTimeout?: number;
|
|
144
147
|
#aidaRequestCache?: CachedRequest;
|
|
148
|
+
#lastEmptyResponseText?: string;
|
|
145
149
|
// TODO(b/445394511): Remove panel from the class
|
|
146
150
|
#panel: ContextFlavor;
|
|
147
151
|
#callbacks?: Callbacks;
|
|
@@ -316,14 +320,28 @@ export class AiCodeCompletion {
|
|
|
316
320
|
response: Host.AidaClient.CompletionResponse | null,
|
|
317
321
|
fromCache: boolean,
|
|
318
322
|
}> {
|
|
323
|
+
const combinedText = prefix + suffix;
|
|
324
|
+
if (combinedText.length < MIN_CHARACTER_THRESHOLD) {
|
|
325
|
+
return {response: null, fromCache: false};
|
|
326
|
+
}
|
|
327
|
+
if (this.#lastEmptyResponseText) {
|
|
328
|
+
if (Math.abs(combinedText.length - this.#lastEmptyResponseText.length) < EMPTY_RESPONSE_DIFF_THRESHOLD) {
|
|
329
|
+
return {response: null, fromCache: false};
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
319
333
|
const request = this.#buildRequest(prefix, suffix, inferenceLanguage, additionalFiles);
|
|
320
334
|
const {response, fromCache} = await this.#completeCodeCached(request);
|
|
321
335
|
|
|
322
336
|
debugLog('At cursor position', cursorPositionAtRequest, {request, response, fromCache});
|
|
323
|
-
if (!response) {
|
|
337
|
+
if (!response || response.generatedSamples.length === 0) {
|
|
338
|
+
this.#lastEmptyResponseText = combinedText;
|
|
324
339
|
return {response: null, fromCache: false};
|
|
325
340
|
}
|
|
326
341
|
|
|
342
|
+
// Clear on successful response
|
|
343
|
+
this.#lastEmptyResponseText = undefined;
|
|
344
|
+
|
|
327
345
|
return {response, fromCache};
|
|
328
346
|
}
|
|
329
347
|
|