chrome-devtools-frontend 1.0.1684555 → 1.0.1689415
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/gerrit-cli/SKILL.md +29 -8
- package/.agents/skills/gerrit-cli/references/commands.md +51 -18
- package/.agents/skills/gerrit-cli/references/workflows.md +6 -6
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +43 -70
- package/config/typescript/tsconfig.base.json +1 -0
- package/config/typescript/tsconfig.eslint.json +9 -0
- package/docs/contributing/issues.md +1 -1
- package/docs/styleguide/ux/writing.md +2 -2
- package/eslint.config.mjs +18 -10
- package/front_end/core/common/Base64.ts +1 -1
- package/front_end/core/common/Color.ts +28 -6
- package/front_end/core/common/ColorConverter.ts +12 -0
- package/front_end/core/common/Console.ts +2 -1
- package/front_end/core/common/Object.ts +2 -2
- package/front_end/core/common/ResourceType.ts +12 -13
- package/front_end/core/common/Revealer.ts +1 -1
- package/front_end/core/common/Settings.ts +2 -2
- package/front_end/core/common/TextDictionary.ts +2 -2
- package/front_end/core/common/Throttler.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -2
- package/front_end/core/host/UserMetrics.ts +51 -37
- package/front_end/core/host/host.ts +1 -1
- package/front_end/core/i18n/i18nImpl.ts +1 -1
- package/front_end/core/platform/HostRuntime.ts +3 -3
- package/front_end/core/platform/KeyboardUtilities.ts +1 -1
- package/front_end/core/protocol_client/InspectorBackend.ts +7 -6
- package/front_end/core/root/Runtime.ts +4 -2
- package/front_end/core/sdk/AnimationModel.ts +1 -1
- package/front_end/core/sdk/CPUThrottlingManager.ts +198 -0
- package/front_end/core/sdk/CSSMetadata.ts +11 -6
- package/front_end/core/sdk/CSSPropertyParser.ts +5 -3
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +90 -59
- package/front_end/core/sdk/ConsoleModel.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +3 -3
- package/front_end/core/sdk/DebuggerModel.ts +1 -1
- package/front_end/core/sdk/EmulationModel.ts +5 -0
- package/front_end/core/sdk/LayerTreeBase.ts +1 -1
- package/front_end/core/sdk/NetworkManager.ts +1 -1
- package/front_end/core/sdk/README.md +40 -0
- package/front_end/core/sdk/RehydratingConnection.ts +1 -1
- package/front_end/core/sdk/RemoteObject.ts +1 -1
- package/front_end/core/sdk/ResourceTreeModel.ts +2 -2
- package/front_end/core/sdk/SDKModel.ts +1 -1
- package/front_end/core/sdk/SDKSettings.ts +6 -0
- package/front_end/core/sdk/Script.ts +2 -1
- package/front_end/core/sdk/SecurityOrigin.ts +48 -0
- package/front_end/core/sdk/ServiceWorkerManager.ts +75 -17
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/core/text_utils/ContentData.ts +1 -1
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +3 -1
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -1
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +2 -2
- package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +1 -1
- package/front_end/entrypoints/inspector_main/nodeIcon.css +1 -1
- package/front_end/entrypoints/inspector_main/outermostTargetSelector.css +3 -3
- package/front_end/entrypoints/inspector_main/renderingOptions.css +3 -3
- package/front_end/entrypoints/js_app/js_app.ts +25 -9
- package/front_end/entrypoints/node_app/app/nodeConnectionsPanel.css +5 -5
- package/front_end/entrypoints/node_app/node_app.ts +1 -1
- package/front_end/generated/ARIAProperties.ts +39 -1
- package/front_end/generated/InspectorBackendCommands.ts +2 -1
- package/front_end/generated/SupportedCSSProperties.ts +60 -119
- package/front_end/generated/protocol-mapping.d.ts +9 -0
- package/front_end/generated/protocol-proxy-api.d.ts +7 -0
- package/front_end/generated/protocol.ts +12 -2
- package/front_end/models/ai_assistance/AiAgent2.ts +13 -7
- package/front_end/models/ai_assistance/AiConversation.ts +8 -17
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +2 -2
- package/front_end/models/ai_assistance/AiUtils.ts +16 -0
- package/front_end/models/ai_assistance/EvaluateAction.ts +1 -1
- package/front_end/models/ai_assistance/README.md +1 -1
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +2 -3
- package/front_end/models/ai_assistance/agents/AiAgent.ts +29 -6
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +4 -3
- package/front_end/models/ai_assistance/agents/FileAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +7 -5
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +9 -7
- package/front_end/models/ai_assistance/ai_assistance.ts +8 -0
- package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +16 -1
- package/front_end/models/ai_assistance/contexts/FileContext.ts +6 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +150 -325
- package/front_end/models/ai_assistance/injected.ts +5 -3
- package/front_end/models/ai_assistance/performance/AIContext.ts +1 -1
- package/front_end/models/ai_assistance/skills/README.md +1 -1
- package/front_end/models/ai_assistance/skills/accessibility.md +19 -10
- package/front_end/models/ai_assistance/skills/network.md +13 -7
- package/front_end/models/ai_assistance/skills/performance.md +22 -16
- package/front_end/models/ai_assistance/skills/sources.md +13 -7
- package/front_end/models/ai_assistance/skills/storage.md +19 -18
- package/front_end/models/ai_assistance/skills/styling.md +30 -37
- package/front_end/models/ai_assistance/tools/CookieUtils.ts +120 -0
- package/front_end/models/ai_assistance/tools/DOMStorageUtils.ts +53 -4
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +8 -32
- package/front_end/models/ai_assistance/tools/GetCookieValues.ts +146 -0
- package/front_end/models/ai_assistance/tools/GetDetailedCallTree.ts +11 -9
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +17 -5
- package/front_end/models/ai_assistance/tools/GetFunctionCode.ts +12 -11
- package/front_end/models/ai_assistance/tools/GetInsightDetails.ts +11 -11
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +3 -2
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +3 -3
- package/front_end/models/ai_assistance/tools/GetResourceContent.ts +12 -12
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +3 -2
- package/front_end/models/ai_assistance/tools/GetStorageBreakdown.ts +132 -0
- package/front_end/models/ai_assistance/tools/GetStorageValues.ts +17 -4
- package/front_end/models/ai_assistance/tools/GetStyles.ts +3 -3
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +9 -8
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +13 -14
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +12 -10
- package/front_end/models/ai_assistance/tools/ListCookies.ts +93 -0
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +15 -6
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +3 -3
- package/front_end/models/ai_assistance/tools/ListSources.ts +5 -3
- package/front_end/models/ai_assistance/tools/ListStorageKeys.ts +16 -4
- package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +3 -2
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +4 -3
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +9 -9
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +9 -8
- package/front_end/models/ai_assistance/tools/Tool.ts +21 -11
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +41 -8
- package/front_end/models/badges/AiExplorerBadge.ts +3 -3
- package/front_end/models/badges/CodeWhispererBadge.ts +2 -2
- package/front_end/models/badges/DOMDetectiveBadge.ts +3 -3
- package/front_end/models/badges/SpeedsterBadge.ts +3 -3
- package/front_end/models/badges/StarterBadge.ts +4 -4
- package/front_end/models/bindings/CompilerScriptMapping.ts +11 -2
- package/front_end/models/bindings/ContentProviderBasedProject.ts +3 -2
- package/front_end/models/breakpoints/BreakpointManager.ts +1 -1
- package/front_end/models/emulation/EmulatedDevices.ts +2 -2
- package/front_end/models/formatter/FormatterWorkerPool.ts +2 -2
- package/front_end/models/formatter/ScriptFormatter.ts +1 -2
- package/front_end/models/geometry/GeometryImpl.ts +2 -2
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +1 -1
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +3 -2
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -5
- package/front_end/models/issues_manager/GenericIssue.ts +18 -18
- package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +1 -1
- package/front_end/models/javascript_metadata/{NativeFunctions.js → NativeFunctions.ts} +25 -9
- package/front_end/models/live-metrics/LiveMetrics.ts +9 -3
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +58 -6
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +2 -62
- package/front_end/models/network_time_calculator/RequestTimeRanges.ts +2 -2
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
- package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
- package/front_end/models/persistence/NetworkPersistenceManager.ts +35 -6
- package/front_end/models/stack_trace/StackTraceImpl.ts +2 -2
- package/front_end/models/trace/LanternComputationData.ts +2 -3
- package/front_end/models/trace/extras/StackTraceForEvent.ts +3 -2
- package/front_end/models/trace/extras/ThirdParties.ts +9 -9
- package/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +7 -4
- package/front_end/models/trace/handlers/FramesHandler.ts +3 -3
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
- package/front_end/models/trace/handlers/SamplesHandler.ts +4 -2
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +1 -1
- package/front_end/models/trace/handlers/WarningsHandler.ts +2 -2
- package/front_end/models/trace/helpers/Network.ts +3 -3
- package/front_end/models/trace/helpers/Trace.ts +1 -1
- package/front_end/models/trace/insights/CLSCulprits.ts +2 -1
- package/front_end/models/trace/insights/Cache.ts +3 -1
- package/front_end/models/trace/insights/CharacterSet.ts +3 -1
- package/front_end/models/trace/insights/DOMSize.ts +3 -1
- package/front_end/models/trace/insights/DocumentLatency.ts +3 -1
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -1
- package/front_end/models/trace/insights/FontDisplay.ts +2 -1
- package/front_end/models/trace/insights/ForcedReflow.ts +2 -1
- package/front_end/models/trace/insights/INPBreakdown.ts +3 -1
- package/front_end/models/trace/insights/ImageDelivery.ts +3 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +3 -1
- package/front_end/models/trace/insights/LCPDiscovery.ts +3 -1
- package/front_end/models/trace/insights/LegacyJavaScript.ts +3 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +2 -1
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +5 -4
- package/front_end/models/trace/insights/SlowCSSSelector.ts +3 -1
- package/front_end/models/trace/insights/ThirdParties.ts +5 -3
- package/front_end/models/trace/insights/Viewport.ts +2 -1
- package/front_end/models/trace/lantern/simulation/Constants.ts +34 -2
- package/front_end/models/trace/lantern/simulation/DNSCache.ts +1 -1
- package/front_end/models/trace/types/TraceEvents.ts +8 -3
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +2 -1
- package/front_end/models/workspace/WorkspaceImpl.ts +18 -2
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +686 -2
- package/front_end/panels/accessibility/accessibilityNode.css +4 -4
- package/front_end/panels/accessibility/accessibilityProperties.css +1 -1
- package/front_end/panels/accessibility/accessibilitySidebarView.css +2 -2
- package/front_end/panels/accessibility/axBreadcrumbs.css +13 -13
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +14 -14
- package/front_end/panels/ai_assistance/ExternalHandler.ts +1 -1
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +3 -2
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -1
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/chatInput.css +12 -12
- package/front_end/panels/ai_assistance/components/chatMessage.css +16 -16
- package/front_end/panels/ai_assistance/components/chatView.css +2 -2
- package/front_end/panels/ai_assistance/components/exploreWidget.css +1 -1
- package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +4 -0
- package/front_end/panels/ai_assistance/components/walkthroughView.css +6 -6
- package/front_end/panels/animation/animationTimeline.css +62 -62
- package/front_end/panels/application/ApplicationPanelSidebar.ts +6 -1
- package/front_end/panels/application/BackgroundServiceView.ts +290 -252
- package/front_end/panels/application/WebMCPView.ts +15 -7
- package/front_end/panels/application/appManifestView.css +5 -5
- package/front_end/panels/application/backgroundServiceView.css +18 -2
- package/front_end/panels/application/components/AdsView.ts +100 -4
- package/front_end/panels/application/components/adsView.css +8 -5
- package/front_end/panels/application/components/backForwardCacheView.css +5 -5
- package/front_end/panels/application/components/bounceTrackingMitigationsView.css +1 -1
- package/front_end/panels/application/components/endpointsGrid.css +1 -1
- package/front_end/panels/application/components/permissionsPolicySection.css +1 -1
- package/front_end/panels/application/components/protocolHandlersView.css +6 -6
- package/front_end/panels/application/components/reportsGrid.css +1 -1
- package/front_end/panels/application/components/serviceWorkerRouterView.css +4 -4
- package/front_end/panels/application/components/trustTokensView.css +7 -7
- package/front_end/panels/application/cookieItemsView.css +3 -3
- package/front_end/panels/application/deviceBoundSessionsView.css +3 -3
- package/front_end/panels/application/frameDetailsReportView.css +11 -11
- package/front_end/panels/application/indexedDBViews.css +7 -7
- package/front_end/panels/application/originTrialTokenRows.css +2 -2
- package/front_end/panels/application/originTrialTreeView.css +3 -3
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.css +2 -2
- package/front_end/panels/application/preloading/components/preloadingDetailsReportView.css +1 -1
- package/front_end/panels/application/preloading/components/preloadingDisabledInfobar.css +2 -2
- package/front_end/panels/application/preloading/components/preloadingGrid.css +2 -2
- package/front_end/panels/application/preloading/components/usedPreloadingView.css +7 -7
- package/front_end/panels/application/preloading/preloadingView.css +1 -1
- package/front_end/panels/application/preloading/preloadingViewDropDown.css +3 -3
- package/front_end/panels/application/serviceWorkerCacheViews.css +5 -5
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +12 -12
- package/front_end/panels/application/serviceWorkersView.css +15 -16
- package/front_end/panels/application/storageView.css +5 -5
- package/front_end/panels/application/webMCPView.css +9 -9
- package/front_end/panels/autofill/autofillView.css +4 -4
- package/front_end/panels/browser_debugger/categorizedBreakpointsSidebarPane.css +4 -4
- package/front_end/panels/browser_debugger/domBreakpointsSidebarPane.css +5 -3
- package/front_end/panels/browser_debugger/xhrBreakpointsSidebarPane.css +4 -4
- package/front_end/panels/changes/changesSidebar.css +1 -1
- package/front_end/panels/changes/changesView.css +1 -1
- package/front_end/panels/changes/combinedDiffView.css +1 -1
- package/front_end/panels/common/CPUThrottlingOption.ts +5 -10
- package/front_end/panels/common/badgeNotification.css +2 -2
- package/front_end/panels/common/domLinkifier.css +1 -1
- package/front_end/panels/common/gdpSignUpDialog.css +3 -3
- package/front_end/panels/common/geminiRebrandPromoDialog.css +1 -1
- package/front_end/panels/console/ConsolePrompt.ts +6 -3
- package/front_end/panels/console/ConsoleView.ts +6 -3
- package/front_end/panels/console/ConsoleViewMessage.ts +3 -1
- package/front_end/panels/console/console-meta.ts +5 -24
- package/front_end/panels/console/consoleContextSelector.css +2 -2
- package/front_end/panels/console/consolePinPane.css +9 -9
- package/front_end/panels/console/consolePrompt.css +5 -5
- package/front_end/panels/console/consoleView.css +39 -39
- package/front_end/panels/coverage/coverageListView.css +2 -2
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +34 -34
- package/front_end/panels/css_overview/cssOverviewProcessingView.css +5 -5
- package/front_end/panels/css_overview/cssOverviewSidebarPanel.css +1 -1
- package/front_end/panels/css_overview/cssOverviewStartView.css +17 -17
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +209 -62
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +4 -4
- package/front_end/panels/elements/DOMTreeContextMenu.ts +59 -54
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +130 -94
- package/front_end/panels/elements/ElementsTreeOutline.ts +1751 -363
- package/front_end/panels/elements/ShortcutTreeElement.ts +6 -3
- package/front_end/panels/elements/StylePropertiesSection.ts +65 -8
- package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +143 -8
- package/front_end/panels/elements/classesPaneWidget.css +6 -6
- package/front_end/panels/elements/components/stylePropertyEditor.css +7 -7
- package/front_end/panels/elements/computedStyleWidget.css +1 -1
- package/front_end/panels/elements/elementStatePaneWidget.css +8 -8
- package/front_end/panels/elements/elements-meta.ts +14 -0
- package/front_end/panels/elements/elementsPanel.css +4 -4
- package/front_end/panels/elements/elementsTreeOutline.css +222 -38
- package/front_end/panels/elements/layersWidget.css +4 -4
- package/front_end/panels/elements/layoutPane.css +18 -18
- package/front_end/panels/elements/metricsSidebarPane.css +11 -11
- package/front_end/panels/elements/platformFontsWidget.css +5 -5
- package/front_end/panels/elements/propertiesWidget.css +2 -2
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +20 -20
- package/front_end/panels/elements/stylesSidebarPane.css +37 -20
- package/front_end/panels/emulation/deviceModeView.css +49 -49
- package/front_end/panels/emulation/mediaQueryInspector.css +18 -18
- package/front_end/panels/event_listeners/eventListenersView.css +1 -1
- package/front_end/panels/explain/components/consoleInsight.css +29 -29
- package/front_end/panels/issues/components/elementsPanelLink.css +2 -2
- package/front_end/panels/issues/components/hideIssuesMenu.css +1 -1
- package/front_end/panels/issues/issuesPane.css +2 -2
- package/front_end/panels/issues/issuesTree.css +50 -50
- package/front_end/panels/layer_viewer/Layers3DView.ts +9 -10
- package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
- package/front_end/panels/layer_viewer/layerTreeOutline.css +2 -2
- package/front_end/panels/layer_viewer/layers3DView.css +1 -1
- package/front_end/panels/layer_viewer/paintProfiler.css +1 -1
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +2 -2
- package/front_end/panels/media/playerListView.css +9 -9
- package/front_end/panels/media/playerMessagesView.css +8 -8
- package/front_end/panels/media/playerPropertiesView.css +6 -6
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +9 -9
- package/front_end/panels/network/NetworkDataGridNode.ts +1 -0
- package/front_end/panels/network/NetworkPanel.ts +9 -4
- package/front_end/panels/network/RequestConditionsDrawer.ts +12 -12
- package/front_end/panels/network/RequestPayloadView.ts +78 -26
- package/front_end/panels/network/binaryResourceView.css +1 -1
- package/front_end/panels/network/components/EditableSpan.css +3 -3
- package/front_end/panels/network/components/HeaderSectionRow.css +14 -14
- package/front_end/panels/network/components/RequestHeaderSection.css +7 -7
- package/front_end/panels/network/components/RequestHeadersView.css +18 -18
- package/front_end/panels/network/components/RequestTrustTokensView.css +1 -1
- package/front_end/panels/network/network-meta.ts +9 -9
- package/front_end/panels/network/networkConfigView.css +11 -11
- package/front_end/panels/network/networkLogView.css +35 -35
- package/front_end/panels/network/networkManageCustomHeadersView.css +1 -1
- package/front_end/panels/network/networkPanel.css +7 -7
- package/front_end/panels/network/networkTimingTable.css +13 -13
- package/front_end/panels/network/requestConditionsDrawer.css +4 -4
- package/front_end/panels/network/requestCookiesView.css +5 -5
- package/front_end/panels/network/requestDeviceBoundSessionsView.css +1 -1
- package/front_end/panels/network/requestHTMLView.css +1 -1
- package/front_end/panels/network/requestHeadersTree.css +19 -19
- package/front_end/panels/network/requestInitiatorView.css +1 -1
- package/front_end/panels/network/requestInitiatorViewTree.css +3 -3
- package/front_end/panels/network/requestPayloadTree.css +5 -5
- package/front_end/panels/network/requestPayloadView.css +1 -1
- package/front_end/panels/network/resourceChunkView.css +3 -3
- package/front_end/panels/network/signedExchangeInfoTree.css +6 -6
- package/front_end/panels/profiler/heapProfiler.css +15 -15
- package/front_end/panels/profiler/profileLauncherView.css +10 -10
- package/front_end/panels/recorder/RecordingView.ts +1 -1
- package/front_end/panels/recorder/StepEditor.ts +86 -7
- package/front_end/panels/recorder/TimelineSection.ts +2 -1
- package/front_end/panels/recorder/createRecordingView.css +17 -17
- package/front_end/panels/recorder/extensionView.css +5 -5
- package/front_end/panels/recorder/injected/RecordingClient.ts +1 -1
- package/front_end/panels/recorder/models/SchemaUtils.ts +2 -2
- package/front_end/panels/recorder/models/ScreenshotStorage.ts +1 -1
- package/front_end/panels/recorder/recorderPanel.css +7 -7
- package/front_end/panels/recorder/recordingListView.css +12 -12
- package/front_end/panels/recorder/recordingView.css +47 -47
- package/front_end/panels/recorder/stepEditor.css +2 -2
- package/front_end/panels/recorder/stepView.css +20 -20
- package/front_end/panels/recorder/timelineSection.css +9 -9
- package/front_end/panels/screencast/screencastView.css +12 -12
- package/front_end/panels/search/searchResultsPane.css +10 -10
- package/front_end/panels/search/searchView.css +9 -9
- package/front_end/panels/security/SecurityPanel.ts +84 -54
- package/front_end/panels/security/mainView.css +26 -26
- package/front_end/panels/security/originView.css +15 -15
- package/front_end/panels/sensors/locationsSettingsTab.css +6 -6
- package/front_end/panels/sensors/sensors.css +28 -28
- package/front_end/panels/settings/components/syncSection.css +5 -5
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +13 -13
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +16 -16
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +2 -2
- package/front_end/panels/settings/keybindsSettingsTab.css +2 -2
- package/front_end/panels/settings/settingsScreen.css +5 -5
- package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
- package/front_end/panels/sources/breakpointEditDialog.css +9 -9
- package/front_end/panels/sources/breakpointsView.css +25 -25
- package/front_end/panels/sources/callStackSidebarPane.css +10 -10
- package/front_end/panels/sources/components/HeadersView.css +6 -6
- package/front_end/panels/sources/debuggerPausedMessage.css +4 -4
- package/front_end/panels/sources/dialog.css +2 -2
- package/front_end/panels/sources/navigatorTree.css +2 -2
- package/front_end/panels/sources/navigatorView.css +2 -2
- package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
- package/front_end/panels/sources/sourcesNavigator.css +1 -1
- package/front_end/panels/sources/sourcesPanel.css +2 -2
- package/front_end/panels/sources/sourcesView.css +1 -1
- package/front_end/panels/sources/threadsSidebarPane.css +5 -5
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +8 -8
- package/front_end/panels/timeline/TimelineDetailsView.ts +9 -21
- package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -5
- package/front_end/panels/timeline/TimelineMiniMap.ts +3 -3
- package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
- package/front_end/panels/timeline/components/breadcrumbsUI.css +3 -3
- package/front_end/panels/timeline/components/exportTraceOptions.css +1 -1
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +13 -13
- package/front_end/panels/timeline/components/ignoreListSetting.css +3 -3
- package/front_end/panels/timeline/components/liveMetricsView.css +39 -39
- package/front_end/panels/timeline/components/metricCard.css +20 -20
- package/front_end/panels/timeline/components/networkRequestDetails.css +9 -9
- package/front_end/panels/timeline/components/networkRequestTooltip.css +14 -14
- package/front_end/panels/timeline/components/networkTrackWidget.css +2 -2
- package/front_end/panels/timeline/components/originMap.css +4 -4
- package/front_end/panels/timeline/components/relatedInsightChips.css +1 -1
- package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +4 -4
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +5 -5
- package/front_end/panels/timeline/components/sidebarSingleInsightSet.css +1 -1
- package/front_end/panels/timeline/components/timelineSummary.css +4 -4
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +4 -4
- package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +6 -6
- package/front_end/panels/timeline/overlays/components/TimeRangeOverlay.ts +1 -1
- package/front_end/panels/timeline/thirdPartyTreeView.css +5 -5
- package/front_end/panels/timeline/timeline-meta.ts +0 -6
- package/front_end/panels/timeline/timelineDetailsView.css +11 -11
- package/front_end/panels/timeline/timelinePanel.css +20 -20
- package/front_end/panels/timeline/timelineTreeView.css +8 -8
- package/front_end/panels/webauthn/webauthnPane.css +6 -6
- package/front_end/panels/whats_new/ReleaseNoteText.ts +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/i18n/i18n-impl.ts +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +42 -8
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +15 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +14 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js +23 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js +77 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +16 -2
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +36 -1
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/Poller.ts +86 -6
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/web-vitals/README.chromium +2 -2
- package/front_end/third_party/web-vitals/package/README.md +22 -7
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +6 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +30 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +14 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +19 -13
- package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.d.ts +1 -1
- 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/initMetric.d.ts +3 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js +3 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +15 -1
- package/front_end/third_party/web-vitals/package/package.json +1 -2
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +9 -2
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +36 -5
- package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +21 -15
- package/front_end/third_party/web-vitals/package/src/lib/doubleRAF.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/softNavs.ts +4 -1
- package/front_end/third_party/web-vitals/package/src/types/lcp.ts +16 -1
- package/front_end/third_party/web-vitals/rebuild.sh +3 -3
- package/front_end/ui/comments/CommentAnchorResolver.ts +15 -4
- package/front_end/ui/comments/commentsOverlay.css +6 -5
- package/front_end/ui/components/adorners/Adorner.ts +1 -1
- package/front_end/ui/components/adorners/adorner.css +6 -6
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/buttons/button.css +9 -9
- package/front_end/ui/components/buttons/floatingButton.css +2 -2
- package/front_end/ui/components/buttons/textButton.css +12 -12
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/dialog.css +1 -1
- package/front_end/ui/components/diff_view/diffView.css +3 -3
- package/front_end/ui/components/expandable_list/expandableList.css +9 -9
- package/front_end/ui/components/highlighting/HighlightElement.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +4 -0
- package/front_end/ui/components/icon_button/iconButton.css +2 -2
- package/front_end/ui/components/input/checkbox.css +8 -8
- package/front_end/ui/components/input/textInput.css +3 -3
- package/front_end/ui/components/issue_counter/issueLinkIcon.css +2 -2
- package/front_end/ui/components/linkifier/linkifierImpl.css +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +1 -1
- package/front_end/ui/components/markdown_view/codeBlock.css +2 -2
- package/front_end/ui/components/markdown_view/markdownView.css +7 -7
- package/front_end/ui/components/menus/menuGroup.css +2 -2
- package/front_end/ui/components/menus/menuItem.css +2 -2
- package/front_end/ui/components/menus/selectMenu.css +2 -2
- package/front_end/ui/components/menus/selectMenuButton.css +4 -4
- package/front_end/ui/components/panel_feedback/panelFeedback.css +15 -15
- package/front_end/ui/components/panel_feedback/previewToggle.css +2 -2
- package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +7 -7
- package/front_end/ui/components/report_view/report.css +3 -3
- package/front_end/ui/components/report_view/reportSectionDivider.css +1 -1
- package/front_end/ui/components/report_view/reportValue.css +1 -1
- package/front_end/ui/components/request_link_icon/requestLinkIcon.css +2 -2
- package/front_end/ui/components/settings/settingCheckbox.css +6 -6
- package/front_end/ui/components/text_editor/TextEditor.ts +3 -1
- package/front_end/ui/components/text_editor/config.ts +16 -4
- package/front_end/ui/kit/icons/icon.css +4 -4
- package/front_end/ui/kit/link/link.css +1 -1
- package/front_end/ui/legacy/ActionRegistration.ts +23 -23
- package/front_end/ui/legacy/Dialog.ts +1 -1
- package/front_end/ui/legacy/DockController.ts +3 -3
- package/front_end/ui/legacy/EmptyWidget.ts +13 -34
- package/front_end/ui/legacy/FilterBar.ts +4 -4
- package/front_end/ui/legacy/Infobar.ts +2 -2
- package/front_end/ui/legacy/InspectorDrawerView.ts +6 -6
- package/front_end/ui/legacy/InspectorView.ts +19 -26
- package/front_end/ui/legacy/ListWidget.ts +7 -7
- package/front_end/ui/legacy/PlusButton.ts +1 -3
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +6 -6
- package/front_end/ui/legacy/SearchableView.ts +16 -16
- package/front_end/ui/legacy/SoftContextMenu.ts +8 -8
- package/front_end/ui/legacy/SoftDropDown.ts +1 -1
- package/front_end/ui/legacy/SuggestBox.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +10 -10
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/Toolbar.ts +5 -5
- package/front_end/ui/legacy/Treeoutline.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +80 -20
- package/front_end/ui/legacy/ViewManager.ts +1 -1
- package/front_end/ui/legacy/ViewRegistration.ts +7 -7
- package/front_end/ui/legacy/Widget.ts +5 -5
- package/front_end/ui/legacy/checkboxTextLabel.css +3 -3
- package/front_end/ui/legacy/components/color_picker/ColorFormatSpec.ts +16 -0
- package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +1 -0
- package/front_end/ui/legacy/components/color_picker/spectrum.css +90 -90
- package/front_end/ui/legacy/components/cookie_table/cookiesTable.css +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +26 -28
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +3 -7
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +13 -13
- package/front_end/ui/legacy/components/inline_editor/colorSwatch.css +7 -7
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +5 -5
- package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +18 -18
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +104 -86
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +8 -6
- package/front_end/ui/legacy/components/object_ui/objectPopover.css +4 -4
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +6 -6
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +28 -11
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +0 -4
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +4 -4
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +6 -6
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +7 -7
- package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +11 -11
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +6 -6
- package/front_end/ui/legacy/components/perf_ui/timelineGrid.css +5 -5
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +3 -3
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/imageView.css +1 -1
- package/front_end/ui/legacy/components/source_frame/jsonView.css +1 -1
- package/front_end/ui/legacy/components/source_frame/resourceSourceFrame.css +1 -1
- package/front_end/ui/legacy/components/source_frame/xmlTree.css +3 -3
- package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
- package/front_end/ui/legacy/components/utils/jsUtils.css +10 -10
- package/front_end/ui/legacy/dropTarget.css +2 -2
- package/front_end/ui/legacy/emptyWidget.css +6 -0
- package/front_end/ui/legacy/filter.css +19 -19
- package/front_end/ui/legacy/infobar.css +2 -2
- package/front_end/ui/legacy/inspectorCommon.css +67 -67
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
- package/front_end/ui/legacy/listWidget.css +5 -5
- package/front_end/ui/legacy/progressIndicator.css +4 -4
- package/front_end/ui/legacy/reportView.css +7 -7
- package/front_end/ui/legacy/searchableView.css +5 -5
- package/front_end/ui/legacy/smallBubble.css +3 -3
- package/front_end/ui/legacy/softContextMenu.css +4 -4
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/splitWidget.css +9 -31
- package/front_end/ui/legacy/suggestBox.css +4 -4
- package/front_end/ui/legacy/tabbedPane.css +17 -17
- package/front_end/ui/legacy/textPrompt.css +2 -2
- package/front_end/ui/legacy/toolbar.css +4 -4
- package/front_end/ui/legacy/treeoutline.css +14 -14
- package/front_end/ui/legacy/viewContainers.css +6 -6
- package/front_end/ui/settings/ConsoleSettings.ts +34 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +12 -0
- package/inspector_overlay/common.ts +12 -12
- package/inspector_overlay/css_grid_label_helpers.ts +16 -17
- package/inspector_overlay/drag_resize_handler.ts +2 -2
- package/inspector_overlay/highlight_common.ts +11 -13
- package/inspector_overlay/highlight_container_query.ts +2 -2
- package/inspector_overlay/highlight_flex_common.ts +6 -7
- package/inspector_overlay/highlight_grid_common.ts +3 -3
- package/inspector_overlay/highlight_isolated_element.ts +12 -3
- package/inspector_overlay/highlight_scroll_snap.ts +2 -2
- package/inspector_overlay/loadCSS.rollup.js +0 -1
- package/inspector_overlay/testing/InspectorOverlayHelpers.ts +13 -13
- package/inspector_overlay/tool_green_dev_anchors.ts +3 -3
- package/inspector_overlay/tool_highlight.ts +9 -9
- package/inspector_overlay/tool_paused.ts +4 -4
- package/inspector_overlay/tool_persistent.ts +11 -11
- package/inspector_overlay/tool_screenshot.ts +7 -7
- package/inspector_overlay/tool_source_order.ts +4 -4
- package/inspector_overlay/tool_viewport_size.ts +3 -3
- package/inspector_overlay/tool_window_controls.ts +4 -4
- package/mcp/mcp.ts +1 -0
- package/package.json +2 -2
- package/front_end/generated/protocol-tsconfig.json +0 -10
- package/front_end/panels/js_timeline/DIR_METADATA +0 -3
- package/front_end/panels/js_timeline/js_timeline-meta.ts +0 -193
- package/front_end/panels/js_timeline/js_timeline.ts +0 -1
- /package/front_end/entrypoints/{formatter_worker/FormatterActions.ts → formatter_actions/formatter_actions.ts} +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as Host from '../../../core/host/host.js';
|
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
+
import * as SDK from '../../../core/sdk/sdk.js';
|
|
8
|
+
import type {FunctionHandlerOptions} from '../agents/AiAgent.js';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
type CookieDetails,
|
|
12
|
+
getCookiesForOrigin,
|
|
13
|
+
resolveAllowedTargetOrigins,
|
|
14
|
+
} from './CookieUtils.js';
|
|
15
|
+
import {
|
|
16
|
+
type BaseToolCapability,
|
|
17
|
+
type DataHandlerResult,
|
|
18
|
+
type DataTool,
|
|
19
|
+
type OriginLockCapability,
|
|
20
|
+
type ServerLoggingCapability,
|
|
21
|
+
ToolAnnotation,
|
|
22
|
+
type ToolArgs,
|
|
23
|
+
ToolName,
|
|
24
|
+
} from './Tool.js';
|
|
25
|
+
|
|
26
|
+
const lockedString = i18n.i18n.lockedString;
|
|
27
|
+
|
|
28
|
+
// Maximum character length allowed per cookie value to prevent oversized cookies
|
|
29
|
+
// from exceeding the LLM context window.
|
|
30
|
+
export const MAX_NUM_CHAR_LENGTH = 10000;
|
|
31
|
+
|
|
32
|
+
export interface GetCookieValuesArgs extends ToolArgs {
|
|
33
|
+
cookieNames: string[];
|
|
34
|
+
origins?: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface GetCookieValuesResult {
|
|
38
|
+
cookiesByOrigin: Record<string, {cookies?: CookieDetails[], error?: string}>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class GetCookieValuesTool implements DataTool<GetCookieValuesArgs, GetCookieValuesResult,
|
|
42
|
+
BaseToolCapability&OriginLockCapability&ServerLoggingCapability> {
|
|
43
|
+
readonly name: ToolName = ToolName.GET_COOKIE_VALUES;
|
|
44
|
+
readonly description: string =
|
|
45
|
+
'Retrieve the values and detailed metadata of specific cookies by their names across origins.';
|
|
46
|
+
|
|
47
|
+
readonly annotations: ToolAnnotation[] = [ToolAnnotation.REDACT_FROM_HISTORY];
|
|
48
|
+
|
|
49
|
+
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetCookieValuesArgs> = {
|
|
50
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
51
|
+
description: '',
|
|
52
|
+
nullable: false,
|
|
53
|
+
properties: {
|
|
54
|
+
cookieNames: {
|
|
55
|
+
type: Host.AidaClient.ParametersTypes.ARRAY,
|
|
56
|
+
description: 'A list of cookie names to retrieve values and metadata for.',
|
|
57
|
+
items: {type: Host.AidaClient.ParametersTypes.STRING, description: 'A cookie name.'},
|
|
58
|
+
nullable: false,
|
|
59
|
+
},
|
|
60
|
+
origins: {
|
|
61
|
+
type: Host.AidaClient.ParametersTypes.ARRAY,
|
|
62
|
+
description: 'Optional list of origins the cookies belong to. Defaults to the current page origin if omitted.',
|
|
63
|
+
items: {type: Host.AidaClient.ParametersTypes.STRING, description: 'An origin URL.'},
|
|
64
|
+
nullable: true,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
required: ['cookieNames'],
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
displayInfoFromArgs(args: GetCookieValuesArgs): {
|
|
71
|
+
title: string,
|
|
72
|
+
action: string,
|
|
73
|
+
} {
|
|
74
|
+
return {
|
|
75
|
+
title: lockedString('Reading cookie values and metadata'),
|
|
76
|
+
action: `getCookieValues(${JSON.stringify(args?.cookieNames ?? [])}, ${JSON.stringify(args?.origins ?? [])})`,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async handler(
|
|
81
|
+
args: GetCookieValuesArgs,
|
|
82
|
+
context: BaseToolCapability&OriginLockCapability&ServerLoggingCapability,
|
|
83
|
+
options?: FunctionHandlerOptions,
|
|
84
|
+
): Promise<DataHandlerResult<GetCookieValuesResult>> {
|
|
85
|
+
context.disableLogging();
|
|
86
|
+
|
|
87
|
+
if (!args || !Array.isArray(args.cookieNames) || args.cookieNames.length === 0) {
|
|
88
|
+
return {error: 'No cookie names provided.'};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
92
|
+
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
93
|
+
const targetOriginsResult = resolveAllowedTargetOrigins(args?.origins, context, targetManager);
|
|
94
|
+
if ('error' in targetOriginsResult) {
|
|
95
|
+
return {error: targetOriginsResult.error};
|
|
96
|
+
}
|
|
97
|
+
const {targetOrigins, primaryPageTarget} = targetOriginsResult;
|
|
98
|
+
|
|
99
|
+
if (options?.approved !== true) {
|
|
100
|
+
const cookieString = args.cookieNames.map(name => `\`${name}\``).join(', ');
|
|
101
|
+
const targetsDesc = targetOrigins.join(', ');
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
requiresApproval: true,
|
|
105
|
+
description: lockedString(
|
|
106
|
+
`The AI wants to access the value(s) and metadata of cookie(s) ${cookieString} on ${targetsDesc}.`),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const cookiesByOrigin: GetCookieValuesResult['cookiesByOrigin'] = {};
|
|
111
|
+
|
|
112
|
+
await Promise.all(targetOrigins.map(async origin => {
|
|
113
|
+
const result = await getCookiesForOrigin(origin, targetManager, primaryPageTarget);
|
|
114
|
+
if ('error' in result) {
|
|
115
|
+
cookiesByOrigin[origin] = {error: result.error};
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const matchingCookies = result.cookies.filter(c => args.cookieNames.includes(c.name()));
|
|
120
|
+
const cookieData: CookieDetails[] = matchingCookies.map(cookie => {
|
|
121
|
+
const value = cookie.value();
|
|
122
|
+
const truncatedValue =
|
|
123
|
+
value.length > MAX_NUM_CHAR_LENGTH ? value.substring(0, MAX_NUM_CHAR_LENGTH) + '... <truncated>' : value;
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
name: cookie.name(),
|
|
127
|
+
value: truncatedValue,
|
|
128
|
+
domain: cookie.domain(),
|
|
129
|
+
path: cookie.path(),
|
|
130
|
+
expires: cookie.expires(),
|
|
131
|
+
size: cookie.size(),
|
|
132
|
+
secure: cookie.secure(),
|
|
133
|
+
sameSite: cookie.sameSite(),
|
|
134
|
+
partitioned: cookie.partitioned(),
|
|
135
|
+
priority: cookie.priority(),
|
|
136
|
+
sourcePort: cookie.sourcePort(),
|
|
137
|
+
sourceScheme: cookie.sourceScheme(),
|
|
138
|
+
};
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
cookiesByOrigin[origin] = {cookies: cookieData};
|
|
142
|
+
}));
|
|
143
|
+
|
|
144
|
+
return {result: {cookiesByOrigin}};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
import * as Host from '../../../core/host/host.js';
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import * as Trace from '../../trace/trace.js';
|
|
8
|
-
import {PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
9
8
|
import {AICallTree} from '../performance/AICallTree.js';
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
type BaseToolCapability,
|
|
13
12
|
type DataHandlerResult,
|
|
14
13
|
type DataTool,
|
|
14
|
+
type PerformanceTraceCapability,
|
|
15
15
|
type ToolArgs,
|
|
16
16
|
ToolName,
|
|
17
17
|
} from './Tool.js';
|
|
@@ -26,9 +26,11 @@ export interface GetDetailedCallTreeArgs extends ToolArgs {
|
|
|
26
26
|
eventKey: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export class GetDetailedCallTreeTool implements
|
|
30
|
-
|
|
31
|
-
readonly
|
|
29
|
+
export class GetDetailedCallTreeTool implements
|
|
30
|
+
DataTool<GetDetailedCallTreeArgs, string, BaseToolCapability&PerformanceTraceCapability> {
|
|
31
|
+
readonly name: ToolName = ToolName.GET_DETAILED_CALL_TREE;
|
|
32
|
+
readonly description: string =
|
|
33
|
+
'Retrieves a bottom-up call tree and execution breakdown for a specific main thread event by its eventKey.';
|
|
32
34
|
|
|
33
35
|
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetDetailedCallTreeArgs> = {
|
|
34
36
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
@@ -56,10 +58,10 @@ export class GetDetailedCallTreeTool implements DataTool<GetDetailedCallTreeArgs
|
|
|
56
58
|
|
|
57
59
|
async handler(
|
|
58
60
|
params: GetDetailedCallTreeArgs,
|
|
59
|
-
capabilities: BaseToolCapability,
|
|
61
|
+
capabilities: BaseToolCapability&PerformanceTraceCapability,
|
|
60
62
|
): Promise<DataHandlerResult<string>> {
|
|
61
|
-
const
|
|
62
|
-
if (!
|
|
63
|
+
const performanceTraceContext = capabilities.getPerformanceTraceContext();
|
|
64
|
+
if (!performanceTraceContext) {
|
|
63
65
|
return {error: 'Performance trace context is not available.'};
|
|
64
66
|
}
|
|
65
67
|
|
|
@@ -67,7 +69,7 @@ export class GetDetailedCallTreeTool implements DataTool<GetDetailedCallTreeArgs
|
|
|
67
69
|
return {error: 'Missing arg: eventKey'};
|
|
68
70
|
}
|
|
69
71
|
|
|
70
|
-
const focus =
|
|
72
|
+
const focus = performanceTraceContext.getItem();
|
|
71
73
|
const event = focus.lookupEvent(params.eventKey);
|
|
72
74
|
if (!event) {
|
|
73
75
|
return {error: 'Invalid eventKey'};
|
|
@@ -78,7 +80,7 @@ export class GetDetailedCallTreeTool implements DataTool<GetDetailedCallTreeArgs
|
|
|
78
80
|
return {error: 'No call tree found'};
|
|
79
81
|
}
|
|
80
82
|
|
|
81
|
-
const formatter =
|
|
83
|
+
const formatter = performanceTraceContext.createFormatter();
|
|
82
84
|
const callTree = await formatter.formatCallTree(tree);
|
|
83
85
|
|
|
84
86
|
const bounds = Trace.Helpers.Timing.traceWindowFromEvent(event);
|
|
@@ -35,9 +35,9 @@ export interface GetElementAccessibilityDetailsArgs extends ToolArgs {
|
|
|
35
35
|
*/
|
|
36
36
|
export class GetElementAccessibilityDetailsTool implements
|
|
37
37
|
DataTool<GetElementAccessibilityDetailsArgs, string, BaseToolCapability&TargetCapability&OriginLockCapability> {
|
|
38
|
-
readonly name = ToolName.GET_ELEMENT_ACCESSIBILITY_DETAILS;
|
|
39
|
-
readonly description =
|
|
40
|
-
'
|
|
38
|
+
readonly name: ToolName = ToolName.GET_ELEMENT_ACCESSIBILITY_DETAILS;
|
|
39
|
+
readonly description: string =
|
|
40
|
+
'Retrieves detailed accessibility properties (computed role, accessible name, name source, ARIA attributes, ignored state) and a DOM tree snapshot for an element by backend node ID.';
|
|
41
41
|
|
|
42
42
|
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetElementAccessibilityDetailsArgs> = {
|
|
43
43
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
@@ -118,17 +118,29 @@ export class GetElementAccessibilityDetailsTool implements
|
|
|
118
118
|
return {error: 'Error: AX node details not found.'};
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
const
|
|
121
|
+
const result = {
|
|
122
122
|
role: axNode.role()?.value,
|
|
123
123
|
name: axNode.name()?.value,
|
|
124
|
+
nameSource: axNode.name()?.sources?.[0]?.type,
|
|
124
125
|
properties: axNode.properties()?.map(p => ({name: p.name, value: p.value?.value})) ?? [],
|
|
126
|
+
ariaAttributes: resolved.attributes()
|
|
127
|
+
.filter(attr => attr.name.startsWith('aria-') || attr.name === 'role')
|
|
128
|
+
.reduce(
|
|
129
|
+
(acc, attr) => {
|
|
130
|
+
acc[attr.name] = attr.value;
|
|
131
|
+
return acc;
|
|
132
|
+
},
|
|
133
|
+
{} as Record<string, string>),
|
|
134
|
+
isIgnored: axNode.ignored(),
|
|
135
|
+
ignoredReasons: axNode.ignoredReasons()?.map(p => ({name: p.name, value: p.value?.value})) ?? [],
|
|
136
|
+
backendNodeId: resolved.backendNodeId(),
|
|
125
137
|
};
|
|
126
138
|
|
|
127
139
|
// Take a snapshot of the resolved node's DOM structure. This is required
|
|
128
140
|
// by the DOM_TREE UI widget to render the element's local tree in the AI response panel.
|
|
129
141
|
const snapshot = await resolved.takeSnapshot();
|
|
130
142
|
return {
|
|
131
|
-
result: JSON.stringify(
|
|
143
|
+
result: JSON.stringify(result, null, 2),
|
|
132
144
|
widgets: [{
|
|
133
145
|
name: 'DOM_TREE',
|
|
134
146
|
data: {
|
|
@@ -6,12 +6,12 @@ import * as Host from '../../../core/host/host.js';
|
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import type * as Platform from '../../../core/platform/platform.js';
|
|
8
8
|
import {canResourceContentsBeReadForTrace} from '../AiOrigins.js';
|
|
9
|
-
import {PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
type BaseToolCapability,
|
|
13
12
|
type DataHandlerResult,
|
|
14
13
|
type DataTool,
|
|
14
|
+
type PerformanceTraceCapability,
|
|
15
15
|
type ToolArgs,
|
|
16
16
|
ToolName,
|
|
17
17
|
} from './Tool.js';
|
|
@@ -28,10 +28,11 @@ export interface GetFunctionCodeArgs extends ToolArgs {
|
|
|
28
28
|
column: number;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export class GetFunctionCodeTool implements
|
|
32
|
-
|
|
33
|
-
readonly
|
|
34
|
-
|
|
31
|
+
export class GetFunctionCodeTool implements
|
|
32
|
+
DataTool<GetFunctionCodeArgs, string, BaseToolCapability&PerformanceTraceCapability> {
|
|
33
|
+
readonly name: ToolName = ToolName.GET_FUNCTION_CODE;
|
|
34
|
+
readonly description: string =
|
|
35
|
+
'Retrieves the code for a function defined at the given location. The result is annotated with the runtime performance of each line of code.';
|
|
35
36
|
|
|
36
37
|
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetFunctionCodeArgs> = {
|
|
37
38
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
@@ -69,14 +70,14 @@ export class GetFunctionCodeTool implements DataTool<GetFunctionCodeArgs, string
|
|
|
69
70
|
|
|
70
71
|
async handler(
|
|
71
72
|
params: GetFunctionCodeArgs,
|
|
72
|
-
capabilities: BaseToolCapability,
|
|
73
|
+
capabilities: BaseToolCapability&PerformanceTraceCapability,
|
|
73
74
|
): Promise<DataHandlerResult<string>> {
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
75
|
+
const performanceTraceContext = capabilities.getPerformanceTraceContext();
|
|
76
|
+
if (!performanceTraceContext) {
|
|
76
77
|
return {error: 'Performance trace context is not available.'};
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
if (
|
|
80
|
+
if (performanceTraceContext.getOrigin().startsWith('imported-trace://')) {
|
|
80
81
|
return {error: 'Cannot use this tool on an imported file.'};
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -84,7 +85,7 @@ export class GetFunctionCodeTool implements DataTool<GetFunctionCodeArgs, string
|
|
|
84
85
|
return {error: 'Missing arg: scriptUrl'};
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
const allowedOrigin =
|
|
88
|
+
const allowedOrigin = performanceTraceContext.getOrigin();
|
|
88
89
|
if (!canResourceContentsBeReadForTrace(params.scriptUrl, allowedOrigin)) {
|
|
89
90
|
return {error: 'Script not found'};
|
|
90
91
|
}
|
|
@@ -97,7 +98,7 @@ export class GetFunctionCodeTool implements DataTool<GetFunctionCodeArgs, string
|
|
|
97
98
|
return {error: 'Missing arg: column'};
|
|
98
99
|
}
|
|
99
100
|
|
|
100
|
-
const formatter =
|
|
101
|
+
const formatter = performanceTraceContext.createFormatter();
|
|
101
102
|
const url = params.scriptUrl as Platform.DevToolsPath.UrlString;
|
|
102
103
|
const code = await formatter.resolveFunctionCodeAtLocation(url, params.line, params.column);
|
|
103
104
|
if (!code) {
|
|
@@ -9,7 +9,6 @@ import * as TextUtils from '../../../core/text_utils/text_utils.js';
|
|
|
9
9
|
import * as Logs from '../../logs/logs.js';
|
|
10
10
|
import * as Trace from '../../trace/trace.js';
|
|
11
11
|
import type {AiWidget} from '../agents/AiAgent.js';
|
|
12
|
-
import {PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
13
12
|
import {PerformanceInsightFormatter} from '../data_formatters/PerformanceInsightFormatter.js';
|
|
14
13
|
import {debugLog} from '../debug.js';
|
|
15
14
|
|
|
@@ -18,6 +17,7 @@ import {
|
|
|
18
17
|
type DataHandlerResult,
|
|
19
18
|
type DataTool,
|
|
20
19
|
MAX_FUNCTION_RESULT_BYTE_LENGTH,
|
|
20
|
+
type PerformanceTraceCapability,
|
|
21
21
|
type TargetCapability,
|
|
22
22
|
type ToolArgs,
|
|
23
23
|
ToolName,
|
|
@@ -54,10 +54,10 @@ export interface GetInsightDetailsArgs extends ToolArgs {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export class GetInsightDetailsTool implements
|
|
57
|
-
DataTool<GetInsightDetailsArgs, string, BaseToolCapability&TargetCapability> {
|
|
58
|
-
readonly name = ToolName.GET_INSIGHT_DETAILS;
|
|
59
|
-
readonly description =
|
|
60
|
-
'
|
|
57
|
+
DataTool<GetInsightDetailsArgs, string, BaseToolCapability&TargetCapability&PerformanceTraceCapability> {
|
|
58
|
+
readonly name: ToolName = ToolName.GET_INSIGHT_DETAILS;
|
|
59
|
+
readonly description: string =
|
|
60
|
+
'Retrieves detailed metrics, subpart timing breakdowns, related DOM elements, and diagnostic data for a performance insight (e.g., \'LCPBreakdown\', \'LCPDiscovery\', \'RenderBlocking\', \'CLSCulprits\', \'INPBreakdown\', \'ThirdParties\'). Use this before commenting on any specific performance issue.';
|
|
61
61
|
|
|
62
62
|
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetInsightDetailsArgs> = {
|
|
63
63
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
@@ -156,10 +156,10 @@ export class GetInsightDetailsTool implements
|
|
|
156
156
|
|
|
157
157
|
async handler(
|
|
158
158
|
params: GetInsightDetailsArgs,
|
|
159
|
-
capabilities: BaseToolCapability&TargetCapability,
|
|
159
|
+
capabilities: BaseToolCapability&TargetCapability&PerformanceTraceCapability,
|
|
160
160
|
): Promise<DataHandlerResult<string>> {
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
161
|
+
const performanceTraceContext = capabilities.getPerformanceTraceContext();
|
|
162
|
+
if (!performanceTraceContext) {
|
|
163
163
|
return {error: 'Performance trace context is not available.'};
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -167,12 +167,12 @@ export class GetInsightDetailsTool implements
|
|
|
167
167
|
return {error: 'Missing required arguments: insightSetId and insightName must be provided.'};
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
const focus =
|
|
170
|
+
const focus = performanceTraceContext.getItem();
|
|
171
171
|
const parsedTrace = focus.parsedTrace;
|
|
172
172
|
|
|
173
173
|
const insightSet = parsedTrace.insights?.get(params.insightSetId);
|
|
174
174
|
if (!insightSet) {
|
|
175
|
-
const formatter =
|
|
175
|
+
const formatter = performanceTraceContext.createFormatter();
|
|
176
176
|
const valid = ([...parsedTrace.insights?.values() ?? []])
|
|
177
177
|
.map(insightSet => `id: ${insightSet.id}, url: ${insightSet.url}, bounds: ${
|
|
178
178
|
formatter.serializeBounds(insightSet.bounds)}`)
|
|
@@ -205,7 +205,7 @@ export class GetInsightDetailsTool implements
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
const widgets: AiWidget[] = [];
|
|
208
|
-
const isImportedTrace =
|
|
208
|
+
const isImportedTrace = performanceTraceContext.getOrigin().startsWith('imported-trace://');
|
|
209
209
|
if (!isImportedTrace) {
|
|
210
210
|
const domTreeWidget = await this.#generateDOMTreeWidget(insight, insightSet, capabilities.getTarget());
|
|
211
211
|
if (domTreeWidget) {
|
|
@@ -21,8 +21,9 @@ export interface GetLighthouseAuditsArgs extends ToolArgs {
|
|
|
21
21
|
|
|
22
22
|
export class GetLighthouseAuditsTool implements
|
|
23
23
|
DataTool<GetLighthouseAuditsArgs, {audits: string}, BaseToolCapability&LighthouseReportCapability> {
|
|
24
|
-
readonly name = ToolName.GET_LIGHTHOUSE_AUDITS;
|
|
25
|
-
readonly description =
|
|
24
|
+
readonly name: ToolName = ToolName.GET_LIGHTHOUSE_AUDITS;
|
|
25
|
+
readonly description: string =
|
|
26
|
+
'Retrieves audit results and diagnostic details from the active Lighthouse report for a specific category (e.g., \'accessibility\').';
|
|
26
27
|
|
|
27
28
|
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetLighthouseAuditsArgs> = {
|
|
28
29
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
@@ -34,8 +34,8 @@ export interface GetNetworkRequestDetailsArgs extends ToolArgs {
|
|
|
34
34
|
*/
|
|
35
35
|
export class GetNetworkRequestDetailsTool implements
|
|
36
36
|
DataTool<GetNetworkRequestDetailsArgs, unknown, BaseToolCapability&OriginLockCapability> {
|
|
37
|
-
readonly name = ToolName.GET_NETWORK_REQUEST_DETAILS;
|
|
38
|
-
readonly description =
|
|
37
|
+
readonly name: ToolName = ToolName.GET_NETWORK_REQUEST_DETAILS;
|
|
38
|
+
readonly description: string =
|
|
39
39
|
'Retrieves the full headers, timing, status, and body details of a specific network request by ID.';
|
|
40
40
|
|
|
41
41
|
readonly #networkLog?: Logs.NetworkLog.NetworkLog;
|
|
@@ -51,7 +51,7 @@ export class GetNetworkRequestDetailsTool implements
|
|
|
51
51
|
properties: {
|
|
52
52
|
id: {
|
|
53
53
|
type: Host.AidaClient.ParametersTypes.STRING,
|
|
54
|
-
description: 'The
|
|
54
|
+
description: 'The unique requestId obtained from listNetworkRequests.',
|
|
55
55
|
nullable: false,
|
|
56
56
|
},
|
|
57
57
|
},
|
|
@@ -9,12 +9,12 @@ import * as Root from '../../../core/root/root.js';
|
|
|
9
9
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
10
10
|
import * as TextUtils from '../../../core/text_utils/text_utils.js';
|
|
11
11
|
import {canResourceContentsBeReadForTrace} from '../AiOrigins.js';
|
|
12
|
-
import {PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
13
12
|
|
|
14
13
|
import {
|
|
15
14
|
type BaseToolCapability,
|
|
16
15
|
type DataHandlerResult,
|
|
17
16
|
type DataTool,
|
|
17
|
+
type PerformanceTraceCapability,
|
|
18
18
|
type TargetCapability,
|
|
19
19
|
type ToolArgs,
|
|
20
20
|
ToolName,
|
|
@@ -30,11 +30,11 @@ export interface GetResourceContentArgs extends ToolArgs {
|
|
|
30
30
|
url: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export class GetResourceContentTool implements
|
|
34
|
-
|
|
35
|
-
readonly name = ToolName.GET_RESOURCE_CONTENT;
|
|
36
|
-
readonly description =
|
|
37
|
-
'
|
|
33
|
+
export class GetResourceContentTool implements DataTool<
|
|
34
|
+
GetResourceContentArgs, {content: string}, BaseToolCapability&TargetCapability&PerformanceTraceCapability> {
|
|
35
|
+
readonly name: ToolName = ToolName.GET_RESOURCE_CONTENT;
|
|
36
|
+
readonly description: string =
|
|
37
|
+
'Retrieves the content of the resource with the given url. Only use this for text resource types.';
|
|
38
38
|
|
|
39
39
|
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetResourceContentArgs> = {
|
|
40
40
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
@@ -62,23 +62,23 @@ export class GetResourceContentTool implements
|
|
|
62
62
|
|
|
63
63
|
async handler(
|
|
64
64
|
params: GetResourceContentArgs,
|
|
65
|
-
capabilities: BaseToolCapability&TargetCapability,
|
|
65
|
+
capabilities: BaseToolCapability&TargetCapability&PerformanceTraceCapability,
|
|
66
66
|
): Promise<DataHandlerResult<{content: string}>> {
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
67
|
+
const performanceTraceContext = capabilities.getPerformanceTraceContext();
|
|
68
|
+
if (!performanceTraceContext) {
|
|
69
69
|
return {error: 'Performance trace context is not available.'};
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
if (
|
|
72
|
+
if (performanceTraceContext.getOrigin().startsWith('imported-trace://')) {
|
|
73
73
|
return {error: 'Cannot use this tool on an imported file.'};
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
const allowedOrigin =
|
|
76
|
+
const allowedOrigin = performanceTraceContext.getOrigin();
|
|
77
77
|
if (!canResourceContentsBeReadForTrace(params.url, allowedOrigin)) {
|
|
78
78
|
return {error: 'Resource not found'};
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
const focus =
|
|
81
|
+
const focus = performanceTraceContext.getItem();
|
|
82
82
|
const {parsedTrace} = focus;
|
|
83
83
|
|
|
84
84
|
let content: string;
|
|
@@ -34,8 +34,9 @@ export interface GetSourceContentArgs extends ToolArgs {
|
|
|
34
34
|
*/
|
|
35
35
|
export class GetSourceContentTool implements
|
|
36
36
|
DataTool<GetSourceContentArgs, {content: string}, BaseToolCapability&OriginLockCapability> {
|
|
37
|
-
readonly name = ToolName.GET_SOURCE_CONTENT;
|
|
38
|
-
readonly description =
|
|
37
|
+
readonly name: ToolName = ToolName.GET_SOURCE_CONTENT;
|
|
38
|
+
readonly description: string =
|
|
39
|
+
'Retrieves the formatted content and metadata of a source file by its numeric ID obtained from listSources.';
|
|
39
40
|
|
|
40
41
|
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetSourceContentArgs> = {
|
|
41
42
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as Host from '../../../core/host/host.js';
|
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
+
import * as SDK from '../../../core/sdk/sdk.js';
|
|
8
|
+
import {bytes} from '../data_formatters/UnitFormatters.js';
|
|
9
|
+
|
|
10
|
+
import {getCookiesForOrigin, resolveAllowedTargetOrigins} from './CookieUtils.js';
|
|
11
|
+
import {calculateDOMStoragesUsage, resolveDOMStorages} from './DOMStorageUtils.js';
|
|
12
|
+
import {
|
|
13
|
+
type BaseToolCapability,
|
|
14
|
+
type DataHandlerResult,
|
|
15
|
+
type DataTool,
|
|
16
|
+
type OriginLockCapability,
|
|
17
|
+
ToolName,
|
|
18
|
+
} from './Tool.js';
|
|
19
|
+
|
|
20
|
+
const lockedString = i18n.i18n.lockedString;
|
|
21
|
+
|
|
22
|
+
export interface StorageBreakdownEntry {
|
|
23
|
+
storageType: string;
|
|
24
|
+
usage: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface GetStorageBreakdownResult {
|
|
28
|
+
usageBreakdown: StorageBreakdownEntry[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class GetStorageBreakdownTool implements
|
|
32
|
+
DataTool<Record<string, never>, GetStorageBreakdownResult, BaseToolCapability&OriginLockCapability> {
|
|
33
|
+
readonly name: ToolName = ToolName.GET_STORAGE_BREAKDOWN;
|
|
34
|
+
readonly description: string =
|
|
35
|
+
'Retrieves total storage usage and quota breakdown across all storage types (IndexedDB, CacheStorage, LocalStorage, SessionStorage, cookies) for the top-level page origin.';
|
|
36
|
+
|
|
37
|
+
readonly parameters: Host.AidaClient.FunctionObjectParam<never> = {
|
|
38
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
39
|
+
description: '',
|
|
40
|
+
nullable: false,
|
|
41
|
+
properties: {},
|
|
42
|
+
required: [],
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
displayInfoFromArgs(): {
|
|
46
|
+
title: string,
|
|
47
|
+
action: string,
|
|
48
|
+
} {
|
|
49
|
+
return {
|
|
50
|
+
title: lockedString('Retrieving storage breakdown'),
|
|
51
|
+
action: 'getStorageBreakdown()',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async handler(
|
|
56
|
+
_args: Record<string, never>,
|
|
57
|
+
context: BaseToolCapability&OriginLockCapability,
|
|
58
|
+
): Promise<DataHandlerResult<GetStorageBreakdownResult>> {
|
|
59
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
60
|
+
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
61
|
+
|
|
62
|
+
const targetResolution = resolveAllowedTargetOrigins(undefined, context, targetManager);
|
|
63
|
+
if ('error' in targetResolution) {
|
|
64
|
+
return {error: targetResolution.error};
|
|
65
|
+
}
|
|
66
|
+
const {targetOrigins, primaryPageTarget} = targetResolution;
|
|
67
|
+
const pageOrigin = targetOrigins[0];
|
|
68
|
+
|
|
69
|
+
const mainStorageKey =
|
|
70
|
+
primaryPageTarget.model(SDK.StorageKeyManager.StorageKeyManager)?.mainStorageKey() || undefined;
|
|
71
|
+
|
|
72
|
+
const localStorages =
|
|
73
|
+
resolveDOMStorages(pageOrigin, 'localStorage', targetManager, primaryPageTarget, mainStorageKey);
|
|
74
|
+
const sessionStorages =
|
|
75
|
+
resolveDOMStorages(pageOrigin, 'sessionStorage', targetManager, primaryPageTarget, mainStorageKey);
|
|
76
|
+
|
|
77
|
+
const [response, localStorageBytes, sessionStorageBytes, cookieResult] = await Promise.all([
|
|
78
|
+
primaryPageTarget.storageAgent().invoke_getUsageAndQuota({origin: pageOrigin}),
|
|
79
|
+
calculateDOMStoragesUsage(localStorages),
|
|
80
|
+
calculateDOMStoragesUsage(sessionStorages),
|
|
81
|
+
getCookiesForOrigin(pageOrigin, targetManager, primaryPageTarget),
|
|
82
|
+
]);
|
|
83
|
+
|
|
84
|
+
if (response.getError()) {
|
|
85
|
+
return {error: response.getError() || 'Unknown CDP error'};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let cookieBytes = 0;
|
|
89
|
+
if ('cookies' in cookieResult) {
|
|
90
|
+
for (const cookie of cookieResult.cookies) {
|
|
91
|
+
cookieBytes += cookie.size();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const rawUsageBreakdown: Array<{storageType: string, rawUsage: number}> =
|
|
96
|
+
(response.usageBreakdown ?? []).filter(entry => entry.usage > 0).map(entry => ({
|
|
97
|
+
storageType: entry.storageType,
|
|
98
|
+
rawUsage: entry.usage,
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
rawUsageBreakdown.push(
|
|
102
|
+
{storageType: 'local_storage', rawUsage: localStorageBytes},
|
|
103
|
+
{storageType: 'session_storage', rawUsage: sessionStorageBytes},
|
|
104
|
+
{storageType: 'cookies', rawUsage: cookieBytes},
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
rawUsageBreakdown.sort((a, b) => b.rawUsage - a.rawUsage);
|
|
108
|
+
const usageBreakdown = rawUsageBreakdown.map(entry => ({
|
|
109
|
+
storageType: entry.storageType,
|
|
110
|
+
usage: bytes(entry.rawUsage),
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
return {
|
|
114
|
+
result: {
|
|
115
|
+
usageBreakdown,
|
|
116
|
+
},
|
|
117
|
+
widgets: [
|
|
118
|
+
{
|
|
119
|
+
name: 'STORAGE_BREAKDOWN',
|
|
120
|
+
data: {
|
|
121
|
+
totalUsageBytes: response.usage,
|
|
122
|
+
totalQuotaBytes: response.quota,
|
|
123
|
+
usageBreakdown: rawUsageBreakdown.map(entry => ({
|
|
124
|
+
storageType: entry.storageType,
|
|
125
|
+
bytes: entry.rawUsage,
|
|
126
|
+
})),
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|