chrome-devtools-frontend 1.0.1675430 → 1.0.1678416
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/WATCHLISTS +0 -4
- package/front_end/core/common/EventTarget.ts +0 -5
- package/front_end/core/common/Settings.ts +0 -66
- package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -0
- package/front_end/core/host/UserMetrics.ts +5 -0
- package/front_end/core/root/Runtime.ts +5 -5
- package/front_end/core/sdk/CSSMetadata.ts +5 -9
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +16 -34
- package/front_end/core/sdk/DebuggerModel.ts +92 -57
- package/front_end/core/sdk/EmulationModel.ts +2 -1
- package/front_end/core/sdk/NetworkManager.ts +16 -2
- package/front_end/core/sdk/OverlayModel.ts +19 -9
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +10 -4
- package/front_end/core/sdk/ResourceTreeModel.ts +20 -1
- package/front_end/core/sdk/SDKSettings.ts +117 -0
- package/front_end/core/sdk/Script.ts +9 -53
- package/front_end/core/sdk/sdk-meta.ts +0 -431
- package/front_end/devtools_compatibility.js +1 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +213 -23
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +6 -5
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +14 -15
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +157 -0
- package/front_end/entrypoints/main/MainImpl.ts +32 -0
- package/front_end/entrypoints/shell/shell.ts +0 -1
- package/front_end/foundation/Universe.ts +8 -0
- package/front_end/generated/InspectorBackendCommands.ts +8 -8
- package/front_end/generated/SupportedCSSProperties.ts +53 -4
- package/front_end/generated/protocol-mapping.d.ts +27 -21
- package/front_end/generated/protocol-proxy-api.d.ts +22 -17
- package/front_end/generated/protocol.ts +43 -18
- package/front_end/models/ai_assistance/AiAgent2.ts +47 -2
- package/front_end/models/ai_assistance/AiConversation.ts +22 -5
- package/front_end/models/ai_assistance/README.md +52 -26
- package/front_end/models/ai_assistance/agents/AiAgent.ts +54 -8
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +7 -194
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +21 -87
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +24 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +124 -0
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +100 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +69 -1
- package/front_end/models/ai_assistance/skills/README.md +63 -1
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +4 -0
- package/front_end/models/ai_assistance/skills/accessibility.md +7 -0
- package/front_end/models/ai_assistance/skills/performance.md +15 -1
- package/front_end/models/ai_assistance/skills/sources.md +16 -0
- package/front_end/models/ai_assistance/skills/storage.md +31 -0
- package/front_end/models/ai_assistance/tools/GetDetailedCallTree.ts +107 -0
- package/front_end/models/ai_assistance/tools/GetFunctionCode.ts +122 -0
- package/front_end/models/ai_assistance/tools/GetResourceContent.ts +127 -0
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +101 -0
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +83 -0
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +106 -0
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +104 -0
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +95 -0
- package/front_end/models/ai_assistance/tools/ListSources.ts +116 -0
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +89 -0
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +90 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +26 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +22 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +4 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +3 -201
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -0
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -49
- package/front_end/models/comment_manager/CommentManager.ts +141 -0
- package/front_end/models/comment_manager/comment_manager.ts +9 -0
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +27 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +10 -2
- package/front_end/models/issues_manager/descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +6 -6
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -8
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +2 -2
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/persistence/persistence-meta.ts +9 -9
- package/front_end/models/trace/types/TraceEvents.ts +36 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -3
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +25 -0
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +36 -36
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +9 -0
- package/front_end/panels/accessibility/AccessibilityStrings.ts +168 -168
- package/front_end/panels/accessibility/SourceOrderView.ts +7 -7
- package/front_end/panels/accessibility/accessibility-meta.ts +2 -2
- package/front_end/panels/accessibility/accessibility.ts +2 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +92 -12
- package/front_end/panels/ai_assistance/components/chatMessage.css +6 -0
- package/front_end/panels/application/ApplicationPanelSidebar.ts +10 -4
- package/front_end/panels/application/IndexedDBViews.ts +65 -63
- package/front_end/panels/application/StorageView.ts +116 -45
- package/front_end/panels/application/WebMCPView.ts +16 -7
- package/front_end/panels/application/application-meta.ts +11 -0
- package/front_end/panels/application/components/AdsView.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +5 -5
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/ExtensionPanel.ts +9 -8
- package/front_end/panels/common/ExtensionServer.ts +21 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +16 -16
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +5 -6
- package/front_end/panels/common/PersistenceUtils.ts +2 -2
- package/front_end/panels/common/common.ts +0 -97
- package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -2
- package/front_end/panels/console/ConsolePanel.ts +4 -0
- package/front_end/panels/console/ConsolePinPane.ts +2 -2
- package/front_end/panels/console/ConsolePrompt.ts +12 -0
- package/front_end/panels/console/ConsoleView.ts +31 -20
- package/front_end/panels/console/ConsoleViewMessage.ts +37 -13
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewModel.ts +1 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +455 -372
- package/front_end/panels/elements/LayoutPane.ts +2 -8
- package/front_end/panels/elements/StylePropertyTreeElement.ts +16 -15
- package/front_end/panels/elements/elements-meta.ts +152 -10
- package/front_end/panels/elements/elements.ts +0 -2
- package/front_end/panels/emulation/DeviceModeView.ts +9 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +8 -4
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +25 -14
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -2
- package/front_end/panels/media/PlayerMessagesView.ts +149 -68
- package/front_end/panels/network/BinaryResourceView.ts +134 -81
- package/front_end/panels/network/EventSourceMessagesView.ts +10 -10
- package/front_end/panels/network/FetchHeaderCommenting.ts +291 -0
- package/front_end/panels/network/NetworkConfigView.ts +10 -10
- package/front_end/panels/network/NetworkDataGridNode.ts +14 -14
- package/front_end/panels/network/NetworkItemView.ts +27 -28
- package/front_end/panels/network/NetworkLogView.ts +137 -38
- package/front_end/panels/network/NetworkLogViewColumns.ts +35 -35
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +1 -1
- package/front_end/panels/network/NetworkPanel.ts +2 -2
- package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
- package/front_end/panels/network/RequestCookiesView.ts +4 -4
- package/front_end/panels/network/RequestHeadersView.ts +5 -5
- package/front_end/panels/network/RequestPayloadView.ts +4 -3
- package/front_end/panels/network/RequestTimingView.ts +8 -8
- package/front_end/panels/network/ResourceChunkView.ts +1 -1
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -1
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +16 -16
- package/front_end/panels/network/binaryResourceView.css +14 -12
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +2 -2
- package/front_end/panels/network/components/HeaderSectionRow.ts +1 -1
- package/front_end/panels/network/components/RequestTrustTokensView.ts +2 -2
- package/front_end/panels/network/network-meta.ts +1 -1
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +0 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -2
- package/front_end/panels/profiler/heapProfiler.css +0 -9
- package/front_end/panels/recorder/RecorderPanel.ts +2 -3
- package/front_end/panels/screencast/ScreencastView.ts +148 -138
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -2
- package/front_end/panels/sources/BreakpointsView.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +10 -59
- package/front_end/panels/sources/NavigatorView.ts +2 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/sources/SourcesPanel.ts +23 -73
- package/front_end/panels/sources/SourcesView.ts +248 -157
- package/front_end/panels/sources/TabbedEditorContainer.ts +118 -23
- package/front_end/panels/sources/UISourceCodeFrame.ts +5 -9
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -2
- package/front_end/panels/sources/sources-meta.ts +52 -0
- package/front_end/panels/timeline/TimelineController.ts +36 -64
- package/front_end/panels/timeline/TimelinePanel.ts +11 -8
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -2
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
- package/front_end/panels/timeline/timelinePanel.css +0 -10
- package/front_end/panels/utils/utils.ts +7 -7
- package/front_end/services/tracing/PerformanceTracing.ts +5 -17
- package/front_end/third_party/chromium/README.chromium +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/package.json +2 -2
- package/front_end/third_party/codemirror.next/rebuild.sh +4 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +430 -35
- package/front_end/ui/comments/CommentOverlayManager.ts +635 -0
- package/front_end/ui/comments/CommentsOverlayWidget.ts +134 -0
- package/front_end/ui/comments/comments.ts +4 -0
- package/front_end/ui/comments/commentsOverlay.css +49 -0
- package/front_end/{panels/common → ui/components/dialogs}/FreDialog.ts +6 -6
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +96 -0
- package/front_end/ui/components/dialogs/dialogs.ts +4 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -3
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionDisclaimer.ts +13 -13
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -6
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionTeaser.ts +43 -46
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +22 -26
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationTeaser.ts +10 -10
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts +5 -5
- package/front_end/ui/components/text_editor/text_editor.ts +4 -0
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +0 -56
- package/front_end/ui/legacy/View.ts +10 -4
- package/front_end/ui/legacy/Widget.ts +10 -1
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +2 -1
- package/front_end/ui/legacy/components/color_picker/ContrastOverlay.ts +5 -4
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +11 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +507 -209
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +5 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -16
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +5 -12
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +38 -20
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +12 -2
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +3 -3
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +37 -6
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +22 -4
- package/front_end/ui/settings/SettingUIRegistration.ts +55 -6
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/mcp/mcp.ts +6 -1
- package/package.json +6 -6
- package/front_end/Images/toolbarResizerVertical.png +0 -0
- package/front_end/emulated_devices/MotoG4-landscape.svg +0 -155
- package/front_end/emulated_devices/MotoG4-portrait.svg +0 -155
- package/front_end/emulated_devices/Nexus5X-landscape.svg +0 -19
- package/front_end/emulated_devices/Nexus5X-portrait.svg +0 -19
- package/front_end/emulated_devices/Nexus6P-landscape.svg +0 -50
- package/front_end/emulated_devices/Nexus6P-portrait.svg +0 -54
- package/front_end/emulated_devices/google-nest-hub-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nest-hub-max-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/iPad-landscape.svg +0 -73
- package/front_end/emulated_devices/iPad-portrait.svg +0 -76
- package/front_end/emulated_devices/iPhone5-landscape.svg +0 -99
- package/front_end/emulated_devices/iPhone5-portrait.svg +0 -83
- package/front_end/emulated_devices/iPhone6-landscape.svg +0 -111
- package/front_end/emulated_devices/iPhone6-portrait.svg +0 -116
- package/front_end/emulated_devices/iPhone6Plus-landscape.svg +0 -118
- package/front_end/emulated_devices/iPhone6Plus-portrait.svg +0 -116
- package/front_end/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/README.md +0 -9
- package/front_end/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/optimized_images.gni +0 -53
- package/front_end/models/ai_assistance/agents/README.md +0 -136
- package/front_end/panels/elements/ElementsTreeOutlineRenderer.ts +0 -89
- package/front_end/ui/legacy/components/object_ui/object_ui-meta.ts +0 -27
- /package/front_end/{panels/common → ui/components/dialogs}/freDialog.css +0 -0
- /package/front_end/{panels/common/common.css → ui/components/dialogs/typeToAllowDialog.css} +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionDisclaimer.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationUpgradeDialog.css +0 -0
|
@@ -14,12 +14,11 @@ import * as Tracing from '../../../services/tracing/tracing.js';
|
|
|
14
14
|
import * as Logs from '../../logs/logs.js';
|
|
15
15
|
import * as Trace from '../../trace/trace.js';
|
|
16
16
|
import {canResourceContentsBeReadForTrace} from '../AiOrigins.js';
|
|
17
|
-
import type {PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
18
|
-
import {sanitizeHeaders} from '../data_formatters/NetworkRequestFormatter.js';
|
|
17
|
+
import type {MainThreadSectionLabel, PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
19
18
|
import {
|
|
20
19
|
PerformanceInsightFormatter,
|
|
21
20
|
} from '../data_formatters/PerformanceInsightFormatter.js';
|
|
22
|
-
import {PerformanceTraceFormatter} from '../data_formatters/PerformanceTraceFormatter.js';
|
|
21
|
+
import {formatEventForAI, PerformanceTraceFormatter} from '../data_formatters/PerformanceTraceFormatter.js';
|
|
23
22
|
import {debugLog} from '../debug.js';
|
|
24
23
|
import {AICallTree} from '../performance/AICallTree.js';
|
|
25
24
|
import type {AgentFocus} from '../performance/AIContext.js';
|
|
@@ -49,13 +48,6 @@ const UIStringsNotTranslated = {
|
|
|
49
48
|
} as const;
|
|
50
49
|
const lockedString = i18n.i18n.lockedString;
|
|
51
50
|
|
|
52
|
-
/**
|
|
53
|
-
* Labels used to identify specific periods or categories in the trace for getting main thread summary.
|
|
54
|
-
* Supports hardcoded phases, dynamic navigation IDs (`NAVIGATION_X`), and insight models.
|
|
55
|
-
*/
|
|
56
|
-
export type MainThreadSectionLabel = 'nav-to-lcp'|'lcp-ttfb'|'lcp-render-delay'|'trace-bounds'|'NO_NAVIGATION'|
|
|
57
|
-
`NAVIGATION_${string}`|keyof Trace.Insights.Types.InsightModels;
|
|
58
|
-
|
|
59
51
|
/**
|
|
60
52
|
* WARNING: preamble defined in code is only used when userTier is
|
|
61
53
|
* TESTERS. Otherwise, a server-side preamble is used (see
|
|
@@ -196,14 +188,6 @@ enum ScorePriority {
|
|
|
196
188
|
// 16k Tokens * ~4 char per token.
|
|
197
189
|
const MAX_FUNCTION_RESULT_BYTE_LENGTH = 16384 * 4;
|
|
198
190
|
|
|
199
|
-
const STATIC_LABEL_NAMES: Record<string, string> = {
|
|
200
|
-
'nav-to-lcp': 'navigation to LCP',
|
|
201
|
-
'lcp-ttfb': 'LCP to TTFB',
|
|
202
|
-
'lcp-render-delay': 'LCP render delay',
|
|
203
|
-
'trace-bounds': 'the entire trace',
|
|
204
|
-
NO_NAVIGATION: 'the period before the first navigation',
|
|
205
|
-
};
|
|
206
|
-
|
|
207
191
|
function getInsightModel(
|
|
208
192
|
model: Trace.Insights.Types.InsightModels,
|
|
209
193
|
key: string,
|
|
@@ -214,33 +198,6 @@ function getInsightModel(
|
|
|
214
198
|
return undefined;
|
|
215
199
|
}
|
|
216
200
|
|
|
217
|
-
/**
|
|
218
|
-
* Converts the label name we use in the code to a human readable one that is
|
|
219
|
-
* shown to the user.
|
|
220
|
-
*/
|
|
221
|
-
export function getLabelName(label: MainThreadSectionLabel, focus: AgentFocus): string {
|
|
222
|
-
if (Object.prototype.hasOwnProperty.call(STATIC_LABEL_NAMES, label)) {
|
|
223
|
-
return STATIC_LABEL_NAMES[label];
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
const {parsedTrace} = focus;
|
|
227
|
-
const insightSetById = parsedTrace.insights?.get(label as Trace.Types.Events.NavigationId);
|
|
228
|
-
if (insightSetById) {
|
|
229
|
-
return `navigation to ${insightSetById.url.href}`;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Go through all the insights we have to find the first one that matches to find the title.
|
|
233
|
-
// TODO(b/505291090): make it easier to look up Insight titles from a key.
|
|
234
|
-
for (const insightSet of parsedTrace.insights?.values() ?? []) {
|
|
235
|
-
const model = getInsightModel(insightSet.model, label);
|
|
236
|
-
if (model) {
|
|
237
|
-
return `${model.title} insight`;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return label;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
201
|
export interface PerformanceAgentOptions extends AgentOptions {
|
|
245
202
|
tracker?: Tracing.FreshRecording.Tracker;
|
|
246
203
|
networkLog?: Logs.NetworkLog.NetworkLog;
|
|
@@ -816,9 +773,8 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
816
773
|
const insightSet = parsedTrace.insights?.get(params.insightSetId);
|
|
817
774
|
if (!insightSet) {
|
|
818
775
|
const valid = ([...parsedTrace.insights?.values() ?? []])
|
|
819
|
-
.map(
|
|
820
|
-
|
|
821
|
-
this.#formatter?.serializeBounds(insightSet.bounds)}`)
|
|
776
|
+
.map(insightSet => `id: ${insightSet.id}, url: ${insightSet.url}, bounds: ${
|
|
777
|
+
this.#formatter?.serializeBounds(insightSet.bounds)}`)
|
|
822
778
|
.join('; ');
|
|
823
779
|
return {error: `Invalid insight set id. Valid insight set ids are: ${valid}`};
|
|
824
780
|
}
|
|
@@ -939,20 +895,6 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
939
895
|
},
|
|
940
896
|
});
|
|
941
897
|
|
|
942
|
-
const createBounds =
|
|
943
|
-
(min?: Trace.Types.Timing.Micro, max?: Trace.Types.Timing.Micro): Trace.Types.Timing.TraceWindowMicro|null => {
|
|
944
|
-
const {min: bMin, max: bMax} = parsedTrace.data.Meta.traceBounds;
|
|
945
|
-
const clampedMin = Math.max(min ?? bMin, bMin);
|
|
946
|
-
const clampedMax = Math.min(max ?? bMax, bMax);
|
|
947
|
-
|
|
948
|
-
if (clampedMin > clampedMax) {
|
|
949
|
-
return null;
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
return Trace.Helpers.Timing.traceWindowFromMicroSeconds(
|
|
953
|
-
clampedMin as Trace.Types.Timing.Micro, clampedMax as Trace.Types.Timing.Micro);
|
|
954
|
-
};
|
|
955
|
-
|
|
956
898
|
this.declareFunction<{label: MainThreadSectionLabel}, {summary: string}>('getMainThreadTrackSummaryByLabel', {
|
|
957
899
|
description:
|
|
958
900
|
'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.',
|
|
@@ -971,7 +913,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
971
913
|
required: ['label'],
|
|
972
914
|
},
|
|
973
915
|
displayInfoFromArgs: args => {
|
|
974
|
-
const labelName = getLabelName(args.label
|
|
916
|
+
const labelName = context.getLabelName(args.label);
|
|
975
917
|
return {
|
|
976
918
|
title: lockedString(`${UIStringsNotTranslated.mainThreadActivity}: ${labelName}`),
|
|
977
919
|
action: `getMainThreadTrackSummaryByLabel('${args.label}')`,
|
|
@@ -980,7 +922,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
980
922
|
handler: async args => {
|
|
981
923
|
debugLog('Function call: getMainThreadTrackSummaryByLabel');
|
|
982
924
|
|
|
983
|
-
const bounds =
|
|
925
|
+
const bounds = context.getBoundsForLabel(args.label);
|
|
984
926
|
if (!bounds) {
|
|
985
927
|
return {error: `Invalid label: ${args.label}`};
|
|
986
928
|
}
|
|
@@ -1028,7 +970,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
1028
970
|
throw new Error('missing formatter');
|
|
1029
971
|
}
|
|
1030
972
|
|
|
1031
|
-
const bounds = createBounds(args.min, args.max);
|
|
973
|
+
const bounds = context.createBounds(args.min, args.max);
|
|
1032
974
|
if (!bounds) {
|
|
1033
975
|
return {error: 'invalid bounds'};
|
|
1034
976
|
}
|
|
@@ -1326,67 +1268,6 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
1326
1268
|
});
|
|
1327
1269
|
}
|
|
1328
1270
|
|
|
1329
|
-
#getBoundsForLabel(label: MainThreadSectionLabel, focus: AgentFocus): Trace.Types.Timing.TraceWindowMicro|null {
|
|
1330
|
-
const {parsedTrace} = focus;
|
|
1331
|
-
const insightSet = focus.primaryInsightSet;
|
|
1332
|
-
|
|
1333
|
-
if (label === 'nav-to-lcp') {
|
|
1334
|
-
if (insightSet) {
|
|
1335
|
-
const lcp = Trace.Insights.Common.getLCP(insightSet);
|
|
1336
|
-
if (lcp) {
|
|
1337
|
-
return Trace.Helpers.Timing.traceWindowFromMicroSeconds(
|
|
1338
|
-
insightSet.bounds.min, lcp.event.ts as Trace.Types.Timing.Micro);
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
return null;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
if (label === 'lcp-ttfb') {
|
|
1345
|
-
if (insightSet) {
|
|
1346
|
-
const subparts = insightSet.model.LCPBreakdown?.subparts;
|
|
1347
|
-
if (subparts?.ttfb) {
|
|
1348
|
-
return subparts.ttfb;
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
return null;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
if (label === 'lcp-render-delay') {
|
|
1355
|
-
if (insightSet) {
|
|
1356
|
-
const subparts = insightSet.model.LCPBreakdown?.subparts;
|
|
1357
|
-
if (subparts?.renderDelay) {
|
|
1358
|
-
return subparts.renderDelay;
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
return null;
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
if (label === 'trace-bounds') {
|
|
1365
|
-
return parsedTrace.data.Meta.traceBounds;
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
const insightSetById = parsedTrace.insights?.get(label as Trace.Types.Events.NavigationId);
|
|
1369
|
-
if (insightSetById) {
|
|
1370
|
-
return insightSetById.bounds;
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
if (insightSet) {
|
|
1374
|
-
const model = getInsightModel(insightSet.model, label);
|
|
1375
|
-
if (model) {
|
|
1376
|
-
return Trace.Insights.Common.insightBounds(model, insightSet.bounds);
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1380
|
-
for (const is of parsedTrace.insights?.values() ?? []) {
|
|
1381
|
-
const model = getInsightModel(is.model, label);
|
|
1382
|
-
if (model) {
|
|
1383
|
-
return Trace.Insights.Common.insightBounds(model, is.bounds);
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
return null;
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
1271
|
async #getNetworkRequestImageData(lcpRequest: Trace.Types.Events.SyntheticNetworkRequest):
|
|
1391
1272
|
Promise<TextUtils.ContentData.ContentData|undefined> {
|
|
1392
1273
|
const target = this.targetManager.primaryPageTarget();
|
|
@@ -1408,71 +1289,3 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
1408
1289
|
return undefined;
|
|
1409
1290
|
}
|
|
1410
1291
|
}
|
|
1411
|
-
|
|
1412
|
-
/**
|
|
1413
|
-
* Serializes a trace event to a JSON string for AI consumption,
|
|
1414
|
-
* ensuring sensitive data (like headers and raw script source code)
|
|
1415
|
-
* is sanitized or redacted.
|
|
1416
|
-
*/
|
|
1417
|
-
function formatEventForAI(event: Trace.Types.Events.Event): string {
|
|
1418
|
-
if (Trace.Types.Events.isSyntheticNetworkRequest(event)) {
|
|
1419
|
-
return JSON.stringify({
|
|
1420
|
-
...event,
|
|
1421
|
-
args: {
|
|
1422
|
-
...event.args,
|
|
1423
|
-
data: {
|
|
1424
|
-
...event.args.data,
|
|
1425
|
-
responseHeaders: event.args.data.responseHeaders ? sanitizeHeaders(event.args.data.responseHeaders) : null,
|
|
1426
|
-
},
|
|
1427
|
-
},
|
|
1428
|
-
});
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
if (Trace.Types.Events.isResourceReceiveResponse(event)) {
|
|
1432
|
-
return JSON.stringify({
|
|
1433
|
-
...event,
|
|
1434
|
-
args: {
|
|
1435
|
-
...event.args,
|
|
1436
|
-
data: {
|
|
1437
|
-
...event.args.data,
|
|
1438
|
-
headers: event.args.data.headers ? sanitizeHeaders(event.args.data.headers) : undefined,
|
|
1439
|
-
},
|
|
1440
|
-
},
|
|
1441
|
-
});
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
if (Trace.Types.Events.isRundownScriptSource(event)) {
|
|
1445
|
-
// Redact sensitive cross-origin script source text.
|
|
1446
|
-
const safeData: Omit<Trace.Types.Events.RundownScriptSource['args']['data'], 'sourceText'> = {
|
|
1447
|
-
isolate: event.args.data.isolate,
|
|
1448
|
-
scriptId: event.args.data.scriptId,
|
|
1449
|
-
length: event.args.data.length,
|
|
1450
|
-
};
|
|
1451
|
-
return JSON.stringify({
|
|
1452
|
-
...event,
|
|
1453
|
-
args: {
|
|
1454
|
-
...event.args,
|
|
1455
|
-
data: safeData,
|
|
1456
|
-
},
|
|
1457
|
-
});
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
if (Trace.Types.Events.isRundownScriptSourceLarge(event)) {
|
|
1461
|
-
// Redact sensitive cross-origin script source text.
|
|
1462
|
-
const safeData: Omit<Trace.Types.Events.RundownScriptSourceLarge['args']['data'], 'sourceText'> = {
|
|
1463
|
-
isolate: event.args.data.isolate,
|
|
1464
|
-
scriptId: event.args.data.scriptId,
|
|
1465
|
-
splitIndex: event.args.data.splitIndex,
|
|
1466
|
-
splitCount: event.args.data.splitCount,
|
|
1467
|
-
};
|
|
1468
|
-
return JSON.stringify({
|
|
1469
|
-
...event,
|
|
1470
|
-
args: {
|
|
1471
|
-
...event.args,
|
|
1472
|
-
data: safeData,
|
|
1473
|
-
},
|
|
1474
|
-
});
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
return JSON.stringify(event);
|
|
1478
|
-
}
|
|
@@ -14,8 +14,7 @@ import {
|
|
|
14
14
|
type AgentOptions,
|
|
15
15
|
AiAgent,
|
|
16
16
|
type ContextResponse,
|
|
17
|
-
ConversationContext,
|
|
18
|
-
type ConversationSuggestions,
|
|
17
|
+
type ConversationContext,
|
|
19
18
|
type RequestOptions,
|
|
20
19
|
ResponseType,
|
|
21
20
|
} from './AiAgent.js';
|
|
@@ -68,7 +67,7 @@ function isSamePrimaryPageOrigin(targetManager: SDK.TargetManager.TargetManager,
|
|
|
68
67
|
return isSamePageOrigin(primaryPageTarget, context);
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
export function isSamePageOrigin(target: SDK.Target.Target|null, context?: ConversationContext<
|
|
70
|
+
export function isSamePageOrigin(target: SDK.Target.Target|null, context?: ConversationContext<unknown>): boolean {
|
|
72
71
|
if (!target || !context) {
|
|
73
72
|
return false;
|
|
74
73
|
}
|
|
@@ -85,84 +84,6 @@ function resolveTargetOrigins(context?: ConversationContext<StorageItem>, origin
|
|
|
85
84
|
return uniqueOrigins.slice(0, MAX_TARGET_ORIGINS);
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
export class StorageContext extends ConversationContext<StorageItem> {
|
|
89
|
-
#item: StorageItem;
|
|
90
|
-
|
|
91
|
-
constructor(item: StorageItem) {
|
|
92
|
-
super();
|
|
93
|
-
this.#item = item;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
override getURL(): string {
|
|
97
|
-
return this.#item.primaryTargetOrigin;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
override getItem(): StorageItem {
|
|
101
|
-
return this.#item;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
override getTitle(): string {
|
|
105
|
-
if (this.#item instanceof CookieItem) {
|
|
106
|
-
if (this.#item.name) {
|
|
107
|
-
return `cookie: ${this.#item.name}${this.#item.origin ? ` ${this.#item.origin}` : ''}`;
|
|
108
|
-
}
|
|
109
|
-
return `cookies${this.#item.isGenericContext ? '' : `: ${this.#item.origin}`}`;
|
|
110
|
-
}
|
|
111
|
-
if (this.#item instanceof DOMStorageItem) {
|
|
112
|
-
if (this.#item.key) {
|
|
113
|
-
return `entry: ${this.#item.key}${this.#item.origin ? ` ${this.#item.origin}` : ''}`;
|
|
114
|
-
}
|
|
115
|
-
const prefix = this.#item.type === 'localStorage' ? 'local storage' : 'session storage';
|
|
116
|
-
return `${prefix}${this.#item.isGenericContext ? '' : `: ${this.#item.origin}`}`;
|
|
117
|
-
}
|
|
118
|
-
return `Storage: ${this.getOrigin()}`;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
override async getSuggestions(): Promise<ConversationSuggestions|undefined> {
|
|
122
|
-
if (this.#item instanceof CookieItem) {
|
|
123
|
-
if (this.#item.name) {
|
|
124
|
-
return [
|
|
125
|
-
{
|
|
126
|
-
title: 'Why is this cookie set?',
|
|
127
|
-
jslogContext: 'storage-cookie',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
title: 'Explain the value of this cookie',
|
|
131
|
-
jslogContext: 'storage-cookie',
|
|
132
|
-
},
|
|
133
|
-
];
|
|
134
|
-
}
|
|
135
|
-
return [
|
|
136
|
-
{
|
|
137
|
-
title: 'Explain the cookies set by this page',
|
|
138
|
-
jslogContext: 'storage-cookie',
|
|
139
|
-
},
|
|
140
|
-
];
|
|
141
|
-
}
|
|
142
|
-
if (this.#item instanceof DOMStorageItem) {
|
|
143
|
-
if (this.#item.key) {
|
|
144
|
-
return [
|
|
145
|
-
{
|
|
146
|
-
title: 'What is the purpose of this storage entry?',
|
|
147
|
-
jslogContext: 'storage-domstorage',
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
title: 'Explain the value of this storage entry',
|
|
151
|
-
jslogContext: 'storage-domstorage',
|
|
152
|
-
},
|
|
153
|
-
];
|
|
154
|
-
}
|
|
155
|
-
return [
|
|
156
|
-
{
|
|
157
|
-
title: 'Explain these storage items',
|
|
158
|
-
jslogContext: 'storage-domstorage',
|
|
159
|
-
},
|
|
160
|
-
];
|
|
161
|
-
}
|
|
162
|
-
return undefined;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
87
|
// Maximum character length of values allowed.
|
|
167
88
|
const MAX_NUM_CHAR_LENGTH = 10000;
|
|
168
89
|
|
|
@@ -281,7 +202,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
|
|
|
281
202
|
},
|
|
282
203
|
|
|
283
204
|
handler: async args => {
|
|
284
|
-
this.
|
|
205
|
+
this.setServerSideLoggingActive(false);
|
|
285
206
|
if (!isSamePrimaryPageOrigin(this.targetManager, this.context)) {
|
|
286
207
|
return {error: 'No origin available or not allowed.'};
|
|
287
208
|
}
|
|
@@ -367,7 +288,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
|
|
|
367
288
|
},
|
|
368
289
|
|
|
369
290
|
handler: async (args, options) => {
|
|
370
|
-
this.
|
|
291
|
+
this.setServerSideLoggingActive(false);
|
|
371
292
|
if (!isSamePrimaryPageOrigin(this.targetManager, this.context)) {
|
|
372
293
|
return {error: 'No origin available or not allowed.'};
|
|
373
294
|
}
|
|
@@ -467,7 +388,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
|
|
|
467
388
|
};
|
|
468
389
|
},
|
|
469
390
|
handler: async args => {
|
|
470
|
-
this.
|
|
391
|
+
this.setServerSideLoggingActive(false);
|
|
471
392
|
if (!isSamePrimaryPageOrigin(this.targetManager, this.context)) {
|
|
472
393
|
return {error: 'No origin available or not allowed.'};
|
|
473
394
|
}
|
|
@@ -527,7 +448,7 @@ export class StorageAgent extends AiAgent<StorageItem> {
|
|
|
527
448
|
};
|
|
528
449
|
},
|
|
529
450
|
handler: async (args, options) => {
|
|
530
|
-
this.
|
|
451
|
+
this.setServerSideLoggingActive(false);
|
|
531
452
|
if (!isSamePrimaryPageOrigin(this.targetManager, this.context)) {
|
|
532
453
|
return {error: 'No origin available or not allowed.'};
|
|
533
454
|
}
|
|
@@ -657,6 +578,19 @@ export class StorageAgent extends AiAgent<StorageItem> {
|
|
|
657
578
|
result: {
|
|
658
579
|
usageBreakdown,
|
|
659
580
|
},
|
|
581
|
+
widgets: [
|
|
582
|
+
{
|
|
583
|
+
name: 'STORAGE_BREAKDOWN',
|
|
584
|
+
data: {
|
|
585
|
+
totalUsageBytes: response.usage,
|
|
586
|
+
totalQuotaBytes: response.quota,
|
|
587
|
+
usageBreakdown: rawUsageBreakdown.map(entry => ({
|
|
588
|
+
storageType: entry.storageType,
|
|
589
|
+
bytes: entry.rawUsage,
|
|
590
|
+
})),
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
],
|
|
660
594
|
};
|
|
661
595
|
},
|
|
662
596
|
});
|
|
@@ -684,9 +618,9 @@ export class StorageAgent extends AiAgent<StorageItem> {
|
|
|
684
618
|
protected override async preRun(): Promise<void> {
|
|
685
619
|
const item = this.context?.getItem();
|
|
686
620
|
if (item instanceof CookieItem && Boolean(item.name)) {
|
|
687
|
-
this.
|
|
621
|
+
this.setServerSideLoggingActive(false);
|
|
688
622
|
} else if (item instanceof DOMStorageItem && Boolean(item.key)) {
|
|
689
|
-
this.
|
|
623
|
+
this.setServerSideLoggingActive(false);
|
|
690
624
|
}
|
|
691
625
|
}
|
|
692
626
|
|
|
@@ -22,6 +22,7 @@ import * as DOMNodeContext from './contexts/DOMNodeContext.js';
|
|
|
22
22
|
import * as FileContext from './contexts/FileContext.js';
|
|
23
23
|
import * as PerformanceTraceContext from './contexts/PerformanceTraceContext.js';
|
|
24
24
|
import * as RequestContext from './contexts/RequestContext.js';
|
|
25
|
+
import * as StorageContext from './contexts/StorageContext.js';
|
|
25
26
|
import * as ConversationSummary from './ConversationSummary.js';
|
|
26
27
|
import * as FileFormatter from './data_formatters/FileFormatter.js';
|
|
27
28
|
import * as LighthouseFormatter from './data_formatters/LighthouseFormatter.js';
|
|
@@ -39,13 +40,24 @@ import * as AIQueries from './performance/AIQueries.js';
|
|
|
39
40
|
import * as PerformanceAnnotations from './PerformanceAnnotations.js';
|
|
40
41
|
import * as StorageItem from './StorageItem.js';
|
|
41
42
|
import * as ExecuteJavaScript from './tools/ExecuteJavaScript.js';
|
|
43
|
+
import * as GetDetailedCallTree from './tools/GetDetailedCallTree.js';
|
|
42
44
|
import * as GetElementAccessibilityDetails from './tools/GetElementAccessibilityDetails.js';
|
|
45
|
+
import * as GetFunctionCode from './tools/GetFunctionCode.js';
|
|
43
46
|
import * as GetLighthouseAudits from './tools/GetLighthouseAudits.js';
|
|
44
47
|
import * as GetNetworkRequestDetails from './tools/GetNetworkRequestDetails.js';
|
|
48
|
+
import * as GetResourceContent from './tools/GetResourceContent.js';
|
|
49
|
+
import * as GetSourceContent from './tools/GetSourceContent.js';
|
|
45
50
|
import * as GetStyles from './tools/GetStyles.js';
|
|
51
|
+
import * as GetTraceEventByKey from './tools/GetTraceEventByKey.js';
|
|
52
|
+
import * as GetTraceMainThreadSummary from './tools/GetTraceMainThreadSummary.js';
|
|
53
|
+
import * as GetTraceNetworkSummary from './tools/GetTraceNetworkSummary.js';
|
|
46
54
|
import * as ListNetworkRequests from './tools/ListNetworkRequests.js';
|
|
55
|
+
import * as ListPageOrigins from './tools/ListPageOrigins.js';
|
|
56
|
+
import * as ListSources from './tools/ListSources.js';
|
|
47
57
|
import * as RecordPerformanceTrace from './tools/RecordPerformanceTrace.js';
|
|
48
58
|
import * as ResolveDevtoolsNodePath from './tools/ResolveDevtoolsNodePath.js';
|
|
59
|
+
import * as RunLighthouse from './tools/RunLighthouse.js';
|
|
60
|
+
import * as SelectTraceEventByKey from './tools/SelectTraceEventByKey.js';
|
|
49
61
|
import * as Tool from './tools/Tool.js';
|
|
50
62
|
import * as ToolRegistry from './tools/ToolRegistry.js';
|
|
51
63
|
|
|
@@ -74,13 +86,22 @@ export {
|
|
|
74
86
|
FileAgent,
|
|
75
87
|
FileContext,
|
|
76
88
|
FileFormatter,
|
|
89
|
+
GetDetailedCallTree,
|
|
77
90
|
GetElementAccessibilityDetails,
|
|
91
|
+
GetFunctionCode,
|
|
78
92
|
GetLighthouseAudits,
|
|
79
93
|
GetNetworkRequestDetails,
|
|
94
|
+
GetResourceContent,
|
|
95
|
+
GetSourceContent,
|
|
80
96
|
GetStyles,
|
|
97
|
+
GetTraceEventByKey,
|
|
98
|
+
GetTraceMainThreadSummary,
|
|
99
|
+
GetTraceNetworkSummary,
|
|
81
100
|
Injected,
|
|
82
101
|
LighthouseFormatter,
|
|
83
102
|
ListNetworkRequests,
|
|
103
|
+
ListPageOrigins,
|
|
104
|
+
ListSources,
|
|
84
105
|
NetworkAgent,
|
|
85
106
|
NetworkRequestFormatter,
|
|
86
107
|
PerformanceAgent,
|
|
@@ -91,7 +112,10 @@ export {
|
|
|
91
112
|
RecordPerformanceTrace,
|
|
92
113
|
RequestContext,
|
|
93
114
|
ResolveDevtoolsNodePath,
|
|
115
|
+
RunLighthouse,
|
|
116
|
+
SelectTraceEventByKey,
|
|
94
117
|
StorageAgent,
|
|
118
|
+
StorageContext,
|
|
95
119
|
StorageItem,
|
|
96
120
|
StylingAgent,
|
|
97
121
|
Tool,
|
|
@@ -23,6 +23,13 @@ import {PerformanceTraceFormatter} from '../data_formatters/PerformanceTraceForm
|
|
|
23
23
|
import type {AICallTree} from '../performance/AICallTree.js';
|
|
24
24
|
import {AgentFocus} from '../performance/AIContext.js';
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Labels used to identify specific periods or categories in the trace for getting main thread summary.
|
|
28
|
+
* Supports hardcoded phases, dynamic navigation IDs (`NAVIGATION_X`), and insight models.
|
|
29
|
+
*/
|
|
30
|
+
export type MainThreadSectionLabel = 'nav-to-lcp'|'lcp-ttfb'|'lcp-render-delay'|'trace-bounds'|'NO_NAVIGATION'|
|
|
31
|
+
`NAVIGATION_${string}`|keyof Trace.Insights.Types.InsightModels;
|
|
32
|
+
|
|
26
33
|
/**
|
|
27
34
|
* The conversation context for AI queries regarding performance traces.
|
|
28
35
|
* Encapsulates the user's active trace selection/focus and handles formatting
|
|
@@ -339,4 +346,121 @@ export class PerformanceTraceContext extends ConversationContext<AgentFocus> {
|
|
|
339
346
|
|
|
340
347
|
return details.length > 0 ? (details as [ContextDetail, ...ContextDetail[]]) : null;
|
|
341
348
|
}
|
|
349
|
+
|
|
350
|
+
getBoundsForLabel(label: MainThreadSectionLabel): Trace.Types.Timing.TraceWindowMicro|null {
|
|
351
|
+
const focus = this.#focus;
|
|
352
|
+
const {parsedTrace} = focus;
|
|
353
|
+
const insightSet = focus.primaryInsightSet;
|
|
354
|
+
|
|
355
|
+
if (label === 'nav-to-lcp') {
|
|
356
|
+
if (insightSet) {
|
|
357
|
+
const lcp = Trace.Insights.Common.getLCP(insightSet);
|
|
358
|
+
if (lcp) {
|
|
359
|
+
return Trace.Helpers.Timing.traceWindowFromMicroSeconds(insightSet.bounds.min,
|
|
360
|
+
lcp.event.ts as Trace.Types.Timing.Micro);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return null;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (label === 'lcp-ttfb') {
|
|
367
|
+
if (insightSet) {
|
|
368
|
+
const subparts = insightSet.model.LCPBreakdown?.subparts;
|
|
369
|
+
if (subparts?.ttfb) {
|
|
370
|
+
return subparts.ttfb;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (label === 'lcp-render-delay') {
|
|
377
|
+
if (insightSet) {
|
|
378
|
+
const subparts = insightSet.model.LCPBreakdown?.subparts;
|
|
379
|
+
if (subparts?.renderDelay) {
|
|
380
|
+
return subparts.renderDelay;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return null;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (label === 'trace-bounds') {
|
|
387
|
+
return parsedTrace.data.Meta.traceBounds;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const insightSetById = parsedTrace.insights?.get(label as Trace.Types.Events.NavigationId);
|
|
391
|
+
if (insightSetById) {
|
|
392
|
+
return insightSetById.bounds;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
if (insightSet) {
|
|
396
|
+
const model = getInsightModel(insightSet.model, label);
|
|
397
|
+
if (model) {
|
|
398
|
+
return Trace.Insights.Common.insightBounds(model, insightSet.bounds);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
for (const is of parsedTrace.insights?.values() ?? []) {
|
|
403
|
+
const model = getInsightModel(is.model, label);
|
|
404
|
+
if (model) {
|
|
405
|
+
return Trace.Insights.Common.insightBounds(model, is.bounds);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return null;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
getLabelName(label: MainThreadSectionLabel): string {
|
|
413
|
+
return getLabelName(label, this.#focus.parsedTrace);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
createBounds(min?: number, max?: number): Trace.Types.Timing.TraceWindowMicro|null {
|
|
417
|
+
const {min: bMin, max: bMax} = this.#focus.parsedTrace.data.Meta.traceBounds;
|
|
418
|
+
const clampedMin = Math.round(Math.max(min ?? bMin, bMin));
|
|
419
|
+
const clampedMax = Math.round(Math.min(max ?? bMax, bMax));
|
|
420
|
+
|
|
421
|
+
if (clampedMin > clampedMax) {
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return Trace.Helpers.Timing.traceWindowFromMicroSeconds(clampedMin as Trace.Types.Timing.Micro,
|
|
426
|
+
clampedMax as Trace.Types.Timing.Micro);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const STATIC_LABEL_NAMES: Record<string, string> = {
|
|
431
|
+
'nav-to-lcp': 'navigation to LCP',
|
|
432
|
+
'lcp-ttfb': 'LCP to TTFB',
|
|
433
|
+
'lcp-render-delay': 'LCP render delay',
|
|
434
|
+
'trace-bounds': 'the entire trace',
|
|
435
|
+
NO_NAVIGATION: 'the period before the first navigation',
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
function getInsightModel(
|
|
439
|
+
model: Trace.Insights.Types.InsightModels,
|
|
440
|
+
key: string,
|
|
441
|
+
): Trace.Insights.Types.InsightModels[keyof Trace.Insights.Types.InsightModels]|undefined {
|
|
442
|
+
if (Object.prototype.hasOwnProperty.call(model, key)) {
|
|
443
|
+
return model[key as keyof Trace.Insights.Types.InsightModels];
|
|
444
|
+
}
|
|
445
|
+
return undefined;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function getLabelName(label: MainThreadSectionLabel, parsedTrace: Trace.TraceModel.ParsedTrace): string {
|
|
449
|
+
if (Object.prototype.hasOwnProperty.call(STATIC_LABEL_NAMES, label)) {
|
|
450
|
+
return STATIC_LABEL_NAMES[label];
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
const insightSetById = parsedTrace.insights?.get(label as Trace.Types.Events.NavigationId);
|
|
454
|
+
if (insightSetById) {
|
|
455
|
+
return `navigation to ${insightSetById.url.href}`;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
for (const insightSet of parsedTrace.insights?.values() ?? []) {
|
|
459
|
+
const model = getInsightModel(insightSet.model, label);
|
|
460
|
+
if (model) {
|
|
461
|
+
return `${model.title} insight`;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return label;
|
|
342
466
|
}
|