chrome-devtools-frontend 1.0.1726686 → 1.0.1730971
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/rules/tests/test-strict-assertions-and-literal-expectations.md +1 -1
- package/.agents/rules/tests/test-view-and-presenter-isolation.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-accessibility-and-semantic-html.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-declarative-child-widget-composition.md +5 -5
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-localization-and-uistrings-hygiene.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +3 -3
- package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +2 -2
- package/.agents/skills/code-review/SKILL.md +63 -12
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +38 -10
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +1 -0
- package/.agents/skills/ui-widgets/SKILL.md +8 -2
- package/.agents/skills/write-ai-eval-test/SKILL.md +106 -0
- package/AUTHORS +2 -0
- package/DIR_METADATA +1 -2
- package/README.md +48 -26
- package/config/typescript/tsconfig.base.json +1 -0
- package/config/typescript/tsconfig.eslint.json +1 -0
- package/docs/contributing/changes.md +25 -0
- package/docs/ui_engineering.md +13 -4
- package/eslint.config.mjs +323 -41
- package/front_end/core/common/Color.ts +7 -7
- package/front_end/core/common/ParsedURL.ts +3 -3
- package/front_end/core/common/ResolverBase.ts +3 -3
- package/front_end/core/common/SegmentedRange.ts +3 -3
- package/front_end/core/common/SimpleHistoryManager.ts +14 -14
- package/front_end/core/common/Trie.ts +3 -3
- package/front_end/core/common/VersionController.ts +7 -7
- package/front_end/core/host/InspectorFrontendHost.ts +2 -2
- package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -1
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +4 -0
- package/front_end/core/host/UserMetricsEnums.ts +2 -1
- package/front_end/core/platform/StringUtilities.ts +54 -13
- package/front_end/core/platform/node/HostRuntime.ts +13 -7
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +4 -5
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/AccessibilityModel.ts +5 -5
- package/front_end/core/sdk/AnimationModel.ts +17 -19
- package/front_end/core/sdk/CPUProfilerModel.ts +3 -3
- package/front_end/core/sdk/CPUThrottlingManager.ts +7 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +73 -13
- package/front_end/core/sdk/CSSMetadata.ts +7 -7
- package/front_end/core/sdk/CSSModel.ts +33 -33
- package/front_end/core/sdk/CSSProperty.ts +5 -5
- package/front_end/core/sdk/CSSRule.ts +6 -6
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +4 -4
- package/front_end/core/sdk/Connections.ts +16 -16
- package/front_end/core/sdk/ConsoleModel.ts +44 -47
- package/front_end/core/sdk/CookieParser.ts +11 -11
- package/front_end/core/sdk/EmulationModel.ts +35 -36
- package/front_end/core/sdk/EventBreakpointsModel.ts +11 -11
- package/front_end/core/sdk/FrameManager.ts +16 -16
- package/front_end/core/sdk/IsolateManager.ts +2 -2
- package/front_end/core/sdk/IssuesModel.ts +2 -2
- package/front_end/core/sdk/OverlayModel.ts +19 -19
- package/front_end/core/sdk/PageResourceLoader.ts +14 -16
- package/front_end/core/sdk/RemoteObject.ts +9 -9
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/RuntimeModel.ts +7 -7
- package/front_end/core/sdk/Script.ts +6 -6
- package/front_end/core/sdk/ServiceWorkerManager.ts +36 -10
- package/front_end/core/sdk/SourceMap.ts +18 -20
- package/front_end/core/sdk/SourceMapManager.ts +2 -2
- package/front_end/core/sdk/TargetManager.ts +2 -2
- package/front_end/devtools_compatibility.js +7 -3
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +2 -2
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +203 -115
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +1 -3
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +36 -12
- package/front_end/models/ai_assistance/AiConversation.ts +8 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +137 -62
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +149 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +269 -42
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +3 -0
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +9 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +13 -2
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +23 -7
- package/front_end/models/ai_assistance/tools/Tool.ts +7 -5
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +22 -24
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +60 -60
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +24 -24
- package/front_end/models/bindings/DefaultScriptMapping.ts +8 -8
- package/front_end/models/bindings/FileUtils.ts +13 -13
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +3 -3
- package/front_end/models/bindings/ResourceScriptMapping.ts +23 -23
- package/front_end/models/comment_manager/CommentManager.ts +3 -3
- package/front_end/models/comment_manager/CommentThread.ts +50 -5
- package/front_end/models/cpu_profile/CPUProfileDataModel.ts +14 -14
- package/front_end/models/cpu_profile/ProfileTreeModel.ts +4 -4
- package/front_end/models/elements/StyleChanges.ts +38 -0
- package/front_end/models/emulation/EmulatedDevices.ts +12 -12
- package/front_end/models/har/HARFormat.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.ts +5 -1
- package/front_end/models/lighthouse/LighthouseReporterTypes.ts +57 -3
- package/front_end/models/lighthouse/RunTypes.ts +9 -1
- package/front_end/models/logs/LogManager.ts +2 -2
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +3 -0
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +24 -24
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +6 -0
- package/front_end/models/persistence/NetworkPersistenceManager.ts +8 -3
- package/front_end/models/trace/LanternComputationData.ts +37 -11
- package/front_end/models/trace/Processor.ts +2 -1
- package/front_end/models/trace/extras/TraceTree.ts +36 -10
- package/front_end/models/trace/handlers/InitiatorsHandler.ts +27 -34
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -6
- package/front_end/models/trace/handlers/SamplesHandler.ts +9 -6
- package/front_end/models/workspace/FileManager.ts +6 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +4 -4
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +8 -1
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +15 -17
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/ExternalHandler.ts +10 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -22
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +19 -23
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +2 -2
- package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +23 -9
- package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +37 -17
- package/front_end/panels/animation/animationTimeline.css +19 -3
- package/front_end/panels/application/AppManifestView.ts +1 -2
- package/front_end/panels/application/ApplicationPanelSidebar.ts +143 -128
- package/front_end/panels/application/DOMStorageItemsView.ts +14 -14
- package/front_end/panels/application/DeviceBoundSessionsView.ts +10 -13
- package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -4
- package/front_end/panels/application/IndexedDBViews.ts +8 -4
- package/front_end/panels/application/KeyValueStorageItemsView.ts +4 -5
- package/front_end/panels/application/PrivateVerificationTokensView.ts +53 -0
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +12 -8
- package/front_end/panels/application/ServiceWorkersView.ts +1 -2
- package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
- package/front_end/panels/application/StorageView.ts +2 -2
- package/front_end/panels/application/WebMCPView.ts +91 -109
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/StorageMetadataView.ts +6 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +70 -37
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +3 -3
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +12 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +10 -11
- package/front_end/panels/application/privateVerificationTokensView.css +20 -0
- package/front_end/panels/application/serviceWorkersView.css +2 -2
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +24 -24
- package/front_end/panels/changes/ChangesSidebar.ts +5 -5
- package/front_end/panels/changes/ChangesView.ts +10 -11
- package/front_end/panels/comments/CommentsPane.ts +292 -102
- package/front_end/panels/comments/commentsPane.css +93 -12
- package/front_end/panels/common/CommentThreadWidget.ts +69 -0
- package/front_end/panels/common/CommentsOverlayWidget.ts +108 -29
- package/front_end/panels/common/CommentsStatusBarPill.ts +17 -6
- package/front_end/panels/common/DOMLinkifier.ts +37 -12
- package/front_end/panels/common/ExtensionPanel.ts +13 -4
- package/front_end/panels/common/ExtensionServer.ts +27 -3
- package/front_end/panels/common/PersistenceUtils.ts +3 -3
- package/front_end/panels/common/commentThreadWidget.css +25 -1
- package/front_end/panels/common/common-meta.ts +10 -0
- package/front_end/panels/console/ConsolePinPane.ts +13 -15
- package/front_end/panels/console/ConsolePrompt.ts +173 -95
- package/front_end/panels/console/ConsoleSidebar.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +75 -79
- package/front_end/panels/console/ConsoleViewMessage.ts +52 -4
- package/front_end/panels/console/SymbolizedErrorWidget.ts +8 -4
- package/front_end/panels/console/consolePrompt.css +1 -1
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/console_counters/WarningErrorCounter.ts +3 -4
- package/front_end/panels/coverage/CoverageListView.ts +2 -2
- package/front_end/panels/coverage/CoverageView.ts +20 -5
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +4 -3
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewStartView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewUnusedDeclarations.ts +8 -8
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +2 -3
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +4 -5
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +6 -7
- package/front_end/panels/elements/CSSValueTraceView.ts +3 -3
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -2
- package/front_end/panels/elements/ComputedStyleWidget.ts +15 -14
- package/front_end/panels/elements/DOMTreeElementWidget.ts +5 -4
- package/front_end/panels/elements/DOMTreeWidget.ts +2 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +1 -0
- package/front_end/panels/elements/EventListenersWidget.ts +2 -2
- package/front_end/panels/elements/LayoutPane.ts +2 -2
- package/front_end/panels/elements/PlatformFontsWidget.ts +3 -3
- package/front_end/panels/elements/PropertiesWidget.ts +9 -10
- package/front_end/panels/elements/PropertyRenderer.ts +72 -11
- package/front_end/panels/elements/StandaloneStylesContainer.ts +5 -10
- package/front_end/panels/elements/StyleEditorWidget.ts +30 -16
- package/front_end/panels/elements/StylePropertiesSection.ts +93 -44
- package/front_end/panels/elements/StylePropertyTreeElement.ts +230 -302
- package/front_end/panels/elements/StylesContainer.ts +2 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -13
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +66 -37
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +51 -41
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +75 -65
- package/front_end/panels/elements/components/CSSQuery.ts +112 -74
- package/front_end/panels/elements/components/CSSVariableValueView.ts +109 -68
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +64 -45
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +35 -28
- package/front_end/panels/elements/components/QueryContainer.ts +104 -74
- package/front_end/panels/elements/components/accessibilityTreeNode.css +22 -20
- package/front_end/panels/elements/components/computedStyleProperty.css +2 -0
- package/front_end/panels/elements/components/cssHintDetailsView.css +23 -21
- package/front_end/panels/elements/components/cssPropertyDocsView.css +38 -36
- package/front_end/panels/elements/components/cssVariableValueView.css +42 -40
- package/front_end/panels/elements/components/elementsTreeExpandButton.css +5 -2
- package/front_end/panels/elements/components/queryContainer.css +23 -21
- package/front_end/panels/elements/stylesSidebarPane.css +3 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +2 -2
- package/front_end/panels/emulation/MediaQueryInspector.ts +9 -10
- package/front_end/panels/emulation/mediaQueryInspector.css +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +2 -2
- package/front_end/panels/issues/AffectedCookiesView.ts +144 -101
- package/front_end/panels/issues/AffectedDescendantsWithinSelectElementView.ts +83 -31
- package/front_end/panels/issues/AffectedDirectivesView.ts +218 -135
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +84 -34
- package/front_end/panels/issues/AffectedElementsView.ts +86 -23
- package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +2 -2
- package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +2 -2
- package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +36 -11
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +135 -58
- package/front_end/panels/issues/AffectedSourcesView.ts +49 -28
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +3 -4
- package/front_end/panels/issues/CorsIssueDetailsView.ts +490 -269
- package/front_end/panels/issues/GenericIssueDetailsView.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +63 -48
- package/front_end/panels/issues/IssueView.ts +14 -18
- package/front_end/panels/issues/components/ElementsPanelLink.ts +70 -34
- package/front_end/panels/issues/components/HideIssuesMenu.ts +56 -32
- package/front_end/panels/issues/components/elementsPanelLink.css +10 -6
- package/front_end/panels/issues/components/hideIssuesMenu.css +16 -14
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/issues/issuesTree.css +4 -4
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -6
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +12 -13
- package/front_end/panels/lighthouse/lighthouseStartView.css +1 -1
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +159 -161
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorView.ts +228 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +32 -41
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +2 -2
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector.ts +2 -0
- package/front_end/panels/media/EventDisplayTable.ts +2 -2
- package/front_end/panels/media/MainView.ts +132 -66
- package/front_end/panels/media/PlayerDetailView.ts +32 -14
- package/front_end/panels/media/PlayerListView.ts +83 -23
- package/front_end/panels/media/PlayerPropertiesView.ts +2 -2
- package/front_end/panels/media/TickingFlameChart.ts +153 -63
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +615 -464
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +43 -0
- package/front_end/panels/network/EventSourceMessagesView.ts +3 -3
- package/front_end/panels/network/NetworkConfigView.ts +6 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
- package/front_end/panels/network/NetworkItemView.ts +27 -26
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +236 -97
- package/front_end/panels/network/NetworkOverview.ts +8 -10
- package/front_end/panels/network/RequestConditionsDrawer.ts +8 -4
- package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +2 -4
- package/front_end/panels/network/RequestHTMLView.ts +26 -7
- package/front_end/panels/network/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/RequestInitiatorView.ts +21 -22
- package/front_end/panels/network/RequestPayloadView.ts +2 -16
- package/front_end/panels/network/RequestPreviewView.ts +5 -5
- package/front_end/panels/network/RequestTimingView.ts +6 -6
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +5 -6
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +4 -3
- package/front_end/panels/network/ShowMoreDetailsWidget.ts +11 -12
- package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
- package/front_end/panels/network/networkLogView.css +2 -2
- package/front_end/panels/network/networkManageCustomHeadersView.css +27 -6
- package/front_end/panels/network/requestConditionsDrawer.css +1 -1
- package/front_end/panels/network/requestInitiatorView.css +5 -3
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -2
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -2
- package/front_end/panels/profiler/HeapTimelineOverview.ts +77 -15
- package/front_end/panels/profiler/IsolateSelector.ts +258 -187
- package/front_end/panels/profiler/ProfileLauncherView.ts +7 -29
- package/front_end/panels/profiler/profileLauncherView.css +6 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -5
- package/front_end/panels/recorder/ControlButton.ts +1 -1
- package/front_end/panels/recorder/RecordingListView.ts +2 -4
- package/front_end/panels/recorder/RecordingView.ts +1 -2
- package/front_end/panels/recorder/SelectorPicker.ts +2 -4
- package/front_end/panels/recorder/StepView.ts +24 -10
- package/front_end/panels/recorder/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/recordingView.css +1 -1
- package/front_end/panels/screencast/ScreencastApp.ts +1 -1
- package/front_end/panels/search/SearchResultsPane.ts +11 -12
- package/front_end/panels/search/SearchView.ts +8 -10
- package/front_end/panels/security/SecurityPanel.ts +1 -8
- package/front_end/panels/security/SecurityPanelSidebar.ts +2 -2
- package/front_end/panels/security/mainView.css +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -2
- package/front_end/panels/settings/AISettingsTab.ts +1 -1
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +34 -20
- package/front_end/panels/settings/EditFileSystemView.ts +2 -2
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +375 -197
- package/front_end/panels/settings/KeybindsSettingsTab.ts +570 -414
- package/front_end/panels/settings/SettingsScreen.ts +312 -114
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -2
- package/front_end/panels/settings/aiSettingsTab.css +1 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +924 -578
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +9 -2
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +39 -0
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +37 -8
- package/front_end/panels/settings/settingsScreen.css +0 -24
- package/front_end/panels/sources/BreakpointEditDialog.ts +9 -6
- package/front_end/panels/sources/BreakpointsView.ts +25 -4
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
- package/front_end/panels/sources/GoToLineQuickOpen.ts +8 -8
- package/front_end/panels/sources/NavigatorView.ts +521 -439
- package/front_end/panels/sources/PersistenceActions.ts +11 -12
- package/front_end/panels/sources/ProfilePlugin.ts +28 -17
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -4
- package/front_end/panels/sources/SourcesNavigator.ts +9 -9
- package/front_end/panels/sources/SourcesPanel.ts +2 -2
- package/front_end/panels/sources/SourcesView.ts +3 -3
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
- package/front_end/panels/sources/components/HeadersView.ts +1 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +5 -6
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +73 -34
- package/front_end/panels/timeline/IsolateSelector.ts +25 -37
- package/front_end/panels/timeline/StatusDialog.ts +5 -7
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +10 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +40 -21
- package/front_end/panels/timeline/TimelineEventOverview.ts +130 -34
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineMiniMap.ts +255 -103
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +19 -11
- package/front_end/panels/timeline/TimelinePanel.ts +1 -0
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +11 -12
- package/front_end/panels/timeline/TimelineTreeView.ts +240 -122
- package/front_end/panels/timeline/TimelineUIUtils.ts +12 -0
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +5 -4
- package/front_end/panels/timeline/components/DetailsView.ts +97 -65
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +2 -2
- package/front_end/panels/timeline/components/MetricCard.ts +2 -2
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +11 -12
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +57 -50
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +2 -2
- package/front_end/panels/timeline/components/Sidebar.ts +161 -109
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +33 -12
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +3 -0
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +11 -11
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +6 -7
- package/front_end/panels/timeline/components/networkTrackWidget.css +24 -22
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +15 -10
- package/front_end/panels/timeline/overlays/components/entryLabelOverlay.css +1 -1
- package/front_end/panels/timeline/timelinePanel.css +5 -0
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/web_audio/WebAudioView.ts +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/legacy-javascript/README.chromium +2 -2
- package/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +2 -2
- package/front_end/third_party/legacy-javascript/package.json +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1983 -2022
- package/front_end/third_party/lighthouse/locales/ar-XB.json +157 -142
- package/front_end/third_party/lighthouse/locales/ar.json +157 -142
- package/front_end/third_party/lighthouse/locales/bg.json +154 -139
- package/front_end/third_party/lighthouse/locales/ca.json +157 -142
- package/front_end/third_party/lighthouse/locales/cs.json +148 -133
- package/front_end/third_party/lighthouse/locales/da.json +153 -138
- package/front_end/third_party/lighthouse/locales/de.json +152 -137
- package/front_end/third_party/lighthouse/locales/el.json +153 -138
- package/front_end/third_party/lighthouse/locales/en-GB.json +160 -145
- package/front_end/third_party/lighthouse/locales/en-US.json +239 -218
- package/front_end/third_party/lighthouse/locales/en-XL.json +239 -218
- package/front_end/third_party/lighthouse/locales/es-419.json +150 -135
- package/front_end/third_party/lighthouse/locales/es.json +149 -134
- package/front_end/third_party/lighthouse/locales/fi.json +151 -136
- package/front_end/third_party/lighthouse/locales/fil.json +154 -139
- package/front_end/third_party/lighthouse/locales/fr.json +150 -135
- package/front_end/third_party/lighthouse/locales/he.json +160 -145
- package/front_end/third_party/lighthouse/locales/hi.json +156 -141
- package/front_end/third_party/lighthouse/locales/hr.json +154 -139
- package/front_end/third_party/lighthouse/locales/hu.json +111 -96
- package/front_end/third_party/lighthouse/locales/id.json +153 -138
- package/front_end/third_party/lighthouse/locales/it.json +153 -138
- package/front_end/third_party/lighthouse/locales/ja.json +150 -135
- package/front_end/third_party/lighthouse/locales/ko.json +42 -27
- package/front_end/third_party/lighthouse/locales/lt.json +152 -137
- package/front_end/third_party/lighthouse/locales/lv.json +93 -78
- package/front_end/third_party/lighthouse/locales/nl.json +149 -134
- package/front_end/third_party/lighthouse/locales/no.json +152 -137
- package/front_end/third_party/lighthouse/locales/pl.json +153 -138
- package/front_end/third_party/lighthouse/locales/pt-PT.json +152 -137
- package/front_end/third_party/lighthouse/locales/pt.json +157 -142
- package/front_end/third_party/lighthouse/locales/ro.json +149 -134
- package/front_end/third_party/lighthouse/locales/ru.json +76 -61
- package/front_end/third_party/lighthouse/locales/sk.json +153 -138
- package/front_end/third_party/lighthouse/locales/sl.json +149 -134
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +151 -136
- package/front_end/third_party/lighthouse/locales/sr.json +151 -136
- package/front_end/third_party/lighthouse/locales/sv.json +152 -137
- package/front_end/third_party/lighthouse/locales/ta.json +156 -141
- package/front_end/third_party/lighthouse/locales/te.json +157 -142
- package/front_end/third_party/lighthouse/locales/th.json +111 -96
- package/front_end/third_party/lighthouse/locales/tr.json +153 -138
- package/front_end/third_party/lighthouse/locales/uk.json +149 -134
- package/front_end/third_party/lighthouse/locales/vi.json +162 -147
- package/front_end/third_party/lighthouse/locales/zh-HK.json +150 -135
- package/front_end/third_party/lighthouse/locales/zh-TW.json +154 -139
- package/front_end/third_party/lighthouse/locales/zh.json +152 -137
- package/front_end/third_party/lighthouse/report/bundle.d.ts +9 -8
- package/front_end/third_party/lighthouse/report/bundle.js +10 -10
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -7
- package/front_end/tsconfig.compatibility.json +1 -0
- package/front_end/tsconfig.json +3 -2
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +0 -2
- package/front_end/ui/components/dialogs/typeToAllowDialog.css +0 -4
- package/front_end/ui/components/icon_button/fileSourceIcon.css +1 -1
- package/front_end/ui/components/input/textInput.css +1 -1
- package/front_end/ui/components/lists/List.ts +26 -14
- package/front_end/ui/components/menus/menus.ts +0 -2
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +351 -138
- package/front_end/ui/components/survey_link/surveyLink.css +3 -3
- package/front_end/ui/components/switch/switch.css +6 -6
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +2 -3
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +53 -4
- package/front_end/ui/components/tree_outline/treeOutline.css +7 -7
- package/front_end/ui/helpers/OpenInNewTab.ts +8 -3
- package/front_end/ui/legacy/EmptyWidget.ts +4 -4
- package/front_end/ui/legacy/ForwardedInputEventHandler.ts +2 -2
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/KeyboardShortcut.ts +7 -7
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +198 -66
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +71 -68
- package/front_end/ui/legacy/View.ts +7 -4
- package/front_end/ui/legacy/ViewManager.ts +49 -37
- package/front_end/ui/legacy/Widget.ts +32 -12
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -3
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +8 -8
- package/front_end/ui/legacy/components/inline_editor/BezierUI.ts +8 -9
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/cssAngleSwatch.css +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +45 -11
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +10 -12
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +102 -29
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +148 -122
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +20 -14
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -1
- package/front_end/ui/legacy/components/source_frame/FontView.ts +29 -5
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +79 -12
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +20 -2
- package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +6 -10
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +11 -11
- package/front_end/ui/legacy/components/source_frame/fontView.css +7 -0
- package/front_end/ui/legacy/components/source_frame/imageView.css +7 -0
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +14 -3
- package/front_end/ui/legacy/components/utils/Linkifier.ts +126 -2
- package/front_end/ui/legacy/emptyWidget.css +2 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -3
- package/front_end/ui/legacy/smallBubble.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +6 -0
- package/front_end/ui/lit/Directives.ts +35 -18
- package/front_end/ui/lit/lit.ts +0 -2
- package/front_end/ui/lit/render.ts +0 -7
- package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
- package/package.json +1 -1
- package/vpython.toml +8 -0
- package/vpython.toml.uv.lock +3 -0
- package/.agents/skills/review-models-core/SKILL.md +0 -73
- package/.agents/skills/review-tests/SKILL.md +0 -67
- package/.agents/skills/review-ui-widgets/SKILL.md +0 -115
- package/front_end/generated/ARIAProperties.ts +0 -2686
- package/front_end/ui/components/menus/README.md +0 -119
- package/front_end/ui/components/menus/SelectMenu.ts +0 -473
- package/front_end/ui/components/menus/selectMenu.css +0 -54
- package/front_end/ui/components/menus/selectMenuButton.css +0 -108
|
@@ -26,6 +26,7 @@ const {debugLog, isStructuredLogEnabled} = AiUtils.Debug;
|
|
|
26
26
|
|
|
27
27
|
type UrlString = Platform.DevToolsPath.UrlString;
|
|
28
28
|
const MAX_SUGGESTION_LENGTH = 200;
|
|
29
|
+
export const SUGGEST_FOLLOW_UPS_FUNCTION_NAME = 'suggestFollowUps';
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* The types of event in the response stream that `AiConversation#run()`
|
|
@@ -61,7 +62,8 @@ const MAX_SUGGESTION_LENGTH = 200;
|
|
|
61
62
|
* ## Events for one tool call
|
|
62
63
|
*
|
|
63
64
|
* `AiAgent#callFunction()` yields these. All events for one call carry the
|
|
64
|
-
* same `callId`.
|
|
65
|
+
* same `callId`. The `suggestFollowUps` function never yields tool call UI
|
|
66
|
+
* events (`TITLE`, `THOUGHT`, `ACTION`).
|
|
65
67
|
*
|
|
66
68
|
* ```
|
|
67
69
|
* TITLE?, THOUGHT? from the tool's displayInfoFromArgs()
|
|
@@ -85,7 +87,11 @@ const MAX_SUGGESTION_LENGTH = 200;
|
|
|
85
87
|
* every function call in a response as one `MODEL` turn. The next request
|
|
86
88
|
* carries one `functionResponse` per call, in the same order. A denied call
|
|
87
89
|
* gets a response that says it did not run. After a context change, each call
|
|
88
|
-
* that did not run gets a "Not executed" response.
|
|
90
|
+
* that did not run gets a "Not executed" response. In the final response,
|
|
91
|
+
* `suggestFollowUps` is not recorded in the history. When called prematurely
|
|
92
|
+
* alongside other tools, its suggestions are ignored and it receives a
|
|
93
|
+
* `functionResponse` instructing the model to call `suggestFollowUps` only in
|
|
94
|
+
* the final response.
|
|
89
95
|
*
|
|
90
96
|
* ## Saved history
|
|
91
97
|
*
|
|
@@ -229,10 +235,7 @@ export interface ThoughtResponse extends ToolCallEvent {
|
|
|
229
235
|
export interface SideEffectResponse extends ToolCallEvent {
|
|
230
236
|
type: ResponseType.SIDE_EFFECT;
|
|
231
237
|
description: string|null;
|
|
232
|
-
|
|
233
|
-
* No agent sets this field. The code comes from the preceding `ACTION`.
|
|
234
|
-
*/
|
|
235
|
-
code?: string;
|
|
238
|
+
javascriptCode?: string;
|
|
236
239
|
confirm: (decision: PermissionDecision) => void;
|
|
237
240
|
permissionPrompt?: PermissionPrompt;
|
|
238
241
|
permissionTitle?: string;
|
|
@@ -277,7 +280,7 @@ export interface ActionResponse extends ToolCallEvent {
|
|
|
277
280
|
* code, such as `executeJavaScript`. For other tools it is a readable form of
|
|
278
281
|
* the call.
|
|
279
282
|
*/
|
|
280
|
-
|
|
283
|
+
action?: string;
|
|
281
284
|
/**
|
|
282
285
|
* The tool's result, error message, or the denial message. Missing on the
|
|
283
286
|
* code-only `ACTION` that precedes an approval prompt.
|
|
@@ -672,16 +675,18 @@ export interface FunctionDeclaration<Args extends Record<string, unknown>, Retur
|
|
|
672
675
|
* - `title`: the step heading, sent as `TITLE`.
|
|
673
676
|
* - `thought`: optional explanation shown in the step, sent as `THOUGHT`.
|
|
674
677
|
* - `action`: the text shown in the step's code box, sent as
|
|
675
|
-
* `ACTION.
|
|
676
|
-
* `
|
|
677
|
-
*
|
|
678
|
-
*
|
|
678
|
+
* `ACTION.action`. It is a readable form of the call, for example
|
|
679
|
+
* `getInsightDetails('NAVIGATION_0', 'LCPBreakdown')`, and is never
|
|
680
|
+
* executed.
|
|
681
|
+
* - `javascriptCode`: the exact JavaScript the tool runs in the page, sent
|
|
682
|
+
* as `SIDE_EFFECT.javascriptCode` and shown in the permission prompt.
|
|
683
|
+
* Only set by tools that execute JavaScript, such as `executeJavaScript`.
|
|
679
684
|
* - `suggestions`: `AiAgent` does not use this field.
|
|
680
685
|
*/
|
|
681
686
|
displayInfoFromArgs?: (
|
|
682
687
|
args: Args,
|
|
683
688
|
) => {
|
|
684
|
-
title?: string, thought?: string, action?: string, suggestions?: [string, ...string[]],
|
|
689
|
+
title?: string, thought?: string, action?: string, javascriptCode?: string, suggestions?: [string, ...string[]],
|
|
685
690
|
};
|
|
686
691
|
/**
|
|
687
692
|
* Choices the permission prompt offers when the handler returns
|
|
@@ -951,10 +956,7 @@ export abstract class AiAgent<T> {
|
|
|
951
956
|
for (const line of lines) {
|
|
952
957
|
const trimmed = line.trim();
|
|
953
958
|
if (trimmed.startsWith('SUGGESTIONS:')) {
|
|
954
|
-
|
|
955
|
-
suggestions = sanitizeSuggestions(trimmed.substring('SUGGESTIONS:'.length).trim());
|
|
956
|
-
} catch {
|
|
957
|
-
}
|
|
959
|
+
suggestions = sanitizeSuggestions(trimmed.substring('SUGGESTIONS:'.length).trim());
|
|
958
960
|
} else {
|
|
959
961
|
answerLines.push(line);
|
|
960
962
|
}
|
|
@@ -964,10 +966,7 @@ export abstract class AiAgent<T> {
|
|
|
964
966
|
// the case where the suggestions are part of the last line of the answer.
|
|
965
967
|
if (!suggestions && answerLines.at(-1)?.includes('SUGGESTIONS:')) {
|
|
966
968
|
const [answer, suggestionsText] = answerLines[answerLines.length - 1].split('SUGGESTIONS:', 2);
|
|
967
|
-
|
|
968
|
-
suggestions = sanitizeSuggestions(suggestionsText.trim());
|
|
969
|
-
} catch {
|
|
970
|
-
}
|
|
969
|
+
suggestions = sanitizeSuggestions(suggestionsText.trim());
|
|
971
970
|
answerLines[answerLines.length - 1] = answer;
|
|
972
971
|
}
|
|
973
972
|
|
|
@@ -1118,36 +1117,18 @@ export abstract class AiAgent<T> {
|
|
|
1118
1117
|
|
|
1119
1118
|
this.#history.push(request.current_message);
|
|
1120
1119
|
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
this.#history.push({
|
|
1129
|
-
parts: [{
|
|
1130
|
-
text: parsedResponse.answer,
|
|
1131
|
-
}],
|
|
1132
|
-
role: Host.AidaClient.Role.MODEL,
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistanceAnswerReceived);
|
|
1136
|
-
yield await this.finalizeAnswer({
|
|
1137
|
-
type: ResponseType.ANSWER,
|
|
1138
|
-
text: parsedResponse.answer,
|
|
1139
|
-
suggestions: parsedResponse.suggestions,
|
|
1140
|
-
complete: true,
|
|
1141
|
-
rpcId,
|
|
1142
|
-
});
|
|
1143
|
-
if (!functionCalls) {
|
|
1144
|
-
break;
|
|
1145
|
-
}
|
|
1120
|
+
// If the model calls other tools alongside suggestFollowUps, the investigation is still in progress,
|
|
1121
|
+
// so premature suggestions are discarded until the concluding turn.
|
|
1122
|
+
const hasOtherFunctionCalls =
|
|
1123
|
+
Boolean(functionCalls?.some(call => call.name !== SUGGEST_FOLLOW_UPS_FUNCTION_NAME));
|
|
1124
|
+
if (!functionCalls || !hasOtherFunctionCalls) {
|
|
1125
|
+
yield* this.#handleFinalResponse(i, textResponse, functionCalls, rpcId);
|
|
1126
|
+
break;
|
|
1146
1127
|
}
|
|
1147
1128
|
|
|
1148
|
-
if (
|
|
1149
|
-
|
|
1150
|
-
|
|
1129
|
+
if (textResponse) {
|
|
1130
|
+
const parsedResponse = this.parseTextResponse(textResponse);
|
|
1131
|
+
yield await this.#createCompletedAnswer(parsedResponse.answer, rpcId);
|
|
1151
1132
|
}
|
|
1152
1133
|
|
|
1153
1134
|
debugLog(`[AiAgent] Step ${i + 1}: Model requested function calls:`, functionCalls);
|
|
@@ -1180,6 +1161,64 @@ export abstract class AiAgent<T> {
|
|
|
1180
1161
|
return;
|
|
1181
1162
|
}
|
|
1182
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* Handles the final model response of a run when no further tool calls need
|
|
1166
|
+
* to execute.
|
|
1167
|
+
*
|
|
1168
|
+
* - If `textResponse` is empty, yields an `UNKNOWN` error.
|
|
1169
|
+
* - Otherwise, records the answer as a `MODEL` turn in `#history` (excluding
|
|
1170
|
+
* `suggestFollowUps`) and yields a completed `ANSWER` with follow-up
|
|
1171
|
+
* suggestions.
|
|
1172
|
+
*/
|
|
1173
|
+
async *
|
|
1174
|
+
#handleFinalResponse(
|
|
1175
|
+
stepIndex: number,
|
|
1176
|
+
textResponse: string,
|
|
1177
|
+
functionCalls: FunctionCalls|undefined,
|
|
1178
|
+
rpcId: Host.AidaClient.RpcGlobalId|undefined,
|
|
1179
|
+
): AsyncGenerator<ResponseData, void, void> {
|
|
1180
|
+
if (!textResponse) {
|
|
1181
|
+
yield this.#createErrorResponse(ErrorType.UNKNOWN);
|
|
1182
|
+
return;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
const lastSuggestCall = functionCalls?.findLast(call => call.name === SUGGEST_FOLLOW_UPS_FUNCTION_NAME);
|
|
1186
|
+
const followUpSuggestions = sanitizeSuggestionsList(lastSuggestCall?.args?.suggestions);
|
|
1187
|
+
const parsedResponse = this.parseTextResponse(textResponse);
|
|
1188
|
+
debugLog(`[AiAgent] Step ${stepIndex + 1}: Model returned text response:`, parsedResponse.answer);
|
|
1189
|
+
this.#history.push({
|
|
1190
|
+
parts: [{
|
|
1191
|
+
text: parsedResponse.answer,
|
|
1192
|
+
}],
|
|
1193
|
+
role: Host.AidaClient.Role.MODEL,
|
|
1194
|
+
});
|
|
1195
|
+
// Fall back to text-parsed `SUGGESTIONS:` while server-side preambles still
|
|
1196
|
+
// emit text directives.
|
|
1197
|
+
// TODO(b/568697679): Remove `parsedResponse.suggestions` fallback once
|
|
1198
|
+
// `suggestFollowUps` is deployed and the server-side preamble is updated.
|
|
1199
|
+
const suggestions = followUpSuggestions ?? parsedResponse.suggestions;
|
|
1200
|
+
yield await this.#createCompletedAnswer(parsedResponse.answer, rpcId, suggestions);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Records the `AiAssistanceAnswerReceived` user metric and builds a
|
|
1205
|
+
* completed `ANSWER` response through `finalizeAnswer()`.
|
|
1206
|
+
*/
|
|
1207
|
+
async #createCompletedAnswer(
|
|
1208
|
+
text: string,
|
|
1209
|
+
rpcId?: Host.AidaClient.RpcGlobalId,
|
|
1210
|
+
suggestions?: [string, ...string[]],
|
|
1211
|
+
): Promise<AnswerResponse> {
|
|
1212
|
+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiAssistanceAnswerReceived);
|
|
1213
|
+
return await this.finalizeAnswer({
|
|
1214
|
+
type: ResponseType.ANSWER,
|
|
1215
|
+
text,
|
|
1216
|
+
suggestions,
|
|
1217
|
+
complete: true,
|
|
1218
|
+
rpcId,
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1183
1222
|
/**
|
|
1184
1223
|
* Runs every function call in one model response, one after another, in the
|
|
1185
1224
|
* order the model returned them.
|
|
@@ -1204,6 +1243,19 @@ export abstract class AiAgent<T> {
|
|
|
1204
1243
|
const functionResponses: Host.AidaClient.Part[] = [];
|
|
1205
1244
|
try {
|
|
1206
1245
|
for (const [index, functionCall] of functionCalls.entries()) {
|
|
1246
|
+
if (functionCall.name === SUGGEST_FOLLOW_UPS_FUNCTION_NAME) {
|
|
1247
|
+
functionResponses.push({
|
|
1248
|
+
functionResponse: {
|
|
1249
|
+
name: functionCall.name,
|
|
1250
|
+
response: {
|
|
1251
|
+
result:
|
|
1252
|
+
'Ignored: call suggestFollowUps only in the final response after all other tool calls complete.',
|
|
1253
|
+
},
|
|
1254
|
+
},
|
|
1255
|
+
});
|
|
1256
|
+
continue;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1207
1259
|
const allowedOriginResult = this.#allowedOrigin?.();
|
|
1208
1260
|
if (allowedOriginResult && 'blocked' in allowedOriginResult) {
|
|
1209
1261
|
// Stop if the page navigated before the origin was locked.
|
|
@@ -1318,10 +1370,12 @@ export abstract class AiAgent<T> {
|
|
|
1318
1370
|
}
|
|
1319
1371
|
debugLog(`[AiAgent] Executing tool '${name}' with args:`, args);
|
|
1320
1372
|
|
|
1321
|
-
let
|
|
1373
|
+
let action;
|
|
1374
|
+
let javascriptCode;
|
|
1322
1375
|
if (call.displayInfoFromArgs) {
|
|
1323
|
-
const {title, thought, action:
|
|
1324
|
-
|
|
1376
|
+
const {title, thought, action: callAction, javascriptCode: callJavascriptCode} = call.displayInfoFromArgs(args);
|
|
1377
|
+
action = callAction;
|
|
1378
|
+
javascriptCode = callJavascriptCode;
|
|
1325
1379
|
if (title) {
|
|
1326
1380
|
yield {
|
|
1327
1381
|
type: ResponseType.TITLE,
|
|
@@ -1367,11 +1421,11 @@ export abstract class AiAgent<T> {
|
|
|
1367
1421
|
}
|
|
1368
1422
|
|
|
1369
1423
|
if ('requiresApproval' in result) {
|
|
1370
|
-
if (
|
|
1424
|
+
if (action) {
|
|
1371
1425
|
yield {
|
|
1372
1426
|
type: ResponseType.ACTION,
|
|
1373
1427
|
callId,
|
|
1374
|
-
|
|
1428
|
+
action,
|
|
1375
1429
|
canceled: false,
|
|
1376
1430
|
};
|
|
1377
1431
|
}
|
|
@@ -1400,6 +1454,7 @@ export abstract class AiAgent<T> {
|
|
|
1400
1454
|
callId,
|
|
1401
1455
|
confirm: sideEffectConfirmationPromiseWithResolvers.resolve,
|
|
1402
1456
|
description: result.description,
|
|
1457
|
+
javascriptCode,
|
|
1403
1458
|
permissionPrompt: call.permissionPrompt,
|
|
1404
1459
|
permissionTitle: call.permissionTitle,
|
|
1405
1460
|
};
|
|
@@ -1417,7 +1472,7 @@ export abstract class AiAgent<T> {
|
|
|
1417
1472
|
yield {
|
|
1418
1473
|
type: ResponseType.ACTION,
|
|
1419
1474
|
callId,
|
|
1420
|
-
|
|
1475
|
+
action,
|
|
1421
1476
|
output: 'Error: User denied code execution with side effects.',
|
|
1422
1477
|
canceled: true,
|
|
1423
1478
|
};
|
|
@@ -1451,7 +1506,7 @@ export abstract class AiAgent<T> {
|
|
|
1451
1506
|
yield {
|
|
1452
1507
|
type: ResponseType.ACTION,
|
|
1453
1508
|
callId,
|
|
1454
|
-
|
|
1509
|
+
action,
|
|
1455
1510
|
output: typeof result.result === 'string' ? result.result : JSON.stringify(result.result),
|
|
1456
1511
|
widgets: result.widgets,
|
|
1457
1512
|
canceled: false,
|
|
@@ -1464,7 +1519,7 @@ export abstract class AiAgent<T> {
|
|
|
1464
1519
|
yield {
|
|
1465
1520
|
type: ResponseType.ACTION,
|
|
1466
1521
|
callId,
|
|
1467
|
-
|
|
1522
|
+
action,
|
|
1468
1523
|
output: result.error,
|
|
1469
1524
|
canceled: false,
|
|
1470
1525
|
toolName: name,
|
|
@@ -1542,13 +1597,16 @@ export abstract class AiAgent<T> {
|
|
|
1542
1597
|
}
|
|
1543
1598
|
|
|
1544
1599
|
/**
|
|
1545
|
-
*
|
|
1546
|
-
*
|
|
1547
|
-
*
|
|
1548
|
-
*
|
|
1600
|
+
* Validates and sanitizes raw follow-up suggestions from the model (either
|
|
1601
|
+
* `args.suggestions` from a `suggestFollowUps` tool call or a `JSON.parse`d
|
|
1602
|
+
* `SUGGESTIONS:` text directive).
|
|
1603
|
+
*
|
|
1604
|
+
* Expects `parsed` to be a `string[]`, but accepts `unknown` because model
|
|
1605
|
+
* output is untrusted. Returns non-empty string items with whitespace
|
|
1606
|
+
* collapsed and each item truncated to `MAX_SUGGESTION_LENGTH`, or
|
|
1607
|
+
* `undefined` if `parsed` is not an array or no valid items remain.
|
|
1549
1608
|
*/
|
|
1550
|
-
export function
|
|
1551
|
-
const parsed = JSON.parse(suggestions);
|
|
1609
|
+
export function sanitizeSuggestionsList(parsed: unknown): [string, ...string[]]|undefined {
|
|
1552
1610
|
if (!Array.isArray(parsed)) {
|
|
1553
1611
|
return undefined;
|
|
1554
1612
|
}
|
|
@@ -1570,6 +1628,23 @@ export function sanitizeSuggestions(suggestions: string): [string, ...string[]]|
|
|
|
1570
1628
|
return sanitized as [string, ...string[]];
|
|
1571
1629
|
}
|
|
1572
1630
|
|
|
1631
|
+
/**
|
|
1632
|
+
* Parses `suggestions` as a JSON array and returns its non-empty string items,
|
|
1633
|
+
* with whitespace collapsed and each item truncated to `MAX_SUGGESTION_LENGTH`.
|
|
1634
|
+
* Returns `undefined` if `suggestions` is not valid JSON, not an array, or no
|
|
1635
|
+
* items remain.
|
|
1636
|
+
*
|
|
1637
|
+
* TODO(b/568697679): Remove this JSON-string wrapper and consolidate into a
|
|
1638
|
+
* single function once legacy `SUGGESTIONS:` text parsing is removed.
|
|
1639
|
+
*/
|
|
1640
|
+
export function sanitizeSuggestions(suggestions: string): [string, ...string[]]|undefined {
|
|
1641
|
+
try {
|
|
1642
|
+
return sanitizeSuggestionsList(JSON.parse(suggestions));
|
|
1643
|
+
} catch {
|
|
1644
|
+
return undefined;
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1573
1648
|
/**
|
|
1574
1649
|
* Maps AIDA-specific client error instances to user-facing ErrorType enums.
|
|
1575
1650
|
* This handles AIDA API failure modes such as quota exhaustion or blockages.
|
|
@@ -196,11 +196,11 @@ export class JavascriptExecutor {
|
|
|
196
196
|
sideEffect: boolean,
|
|
197
197
|
canceled: boolean,
|
|
198
198
|
}> {
|
|
199
|
-
const functionDeclaration = `async function ($0) {
|
|
199
|
+
const functionDeclaration = `async function ($0, data) {
|
|
200
200
|
try {
|
|
201
201
|
${action}
|
|
202
202
|
;
|
|
203
|
-
return
|
|
203
|
+
return data;
|
|
204
204
|
} catch (error) {
|
|
205
205
|
return error;
|
|
206
206
|
}
|
|
@@ -78,7 +78,7 @@ Content:
|
|
|
78
78
|
"properties": {
|
|
79
79
|
"code": {
|
|
80
80
|
"type": 1,
|
|
81
|
-
"description": "JavaScript code snippet to run on the inspected page. Make sure the code is formatted for readability.\n\n# Instructions\n\n* To return data, define a top-level `data` variable and populate it with data you want to get. Only JSON-serializable objects can be assigned to `data`.\n* $0 refers to the currently selected DOM node (or document body if none selected).\n* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.\n* **CRITICAL** Variables from previous function calls are not available in subsequent calls.\n* **CRITICAL** Keep code concise (max 40 lines, 120 characters per line, and 2,500 characters). Split complex logic into multiple steps.\n* **CRITICAL** Network requests (e.g., fetch, XMLHttpRequest) are disabled and cannot be made.\n\nFor example, to query DOM elements:\n\n```\nconst data = {\n title: document.title,\n elementText: $0?.textContent?.trim(),\n childCount: $0?.children.length,\n};\n```\n"
|
|
81
|
+
"description": "JavaScript code snippet to run on the inspected page. Make sure the code is formatted for readability.\n\n# Instructions\n\n* To return data, define a top-level `data` variable and populate it with data you want to get. Only JSON-serializable objects can be assigned to `data`.\n* $0 refers to the currently selected DOM node (or document body if none selected).\n* **CRITICAL** Do not call `console` methods (e.g., `console.log`, `console.warn`, `console.error`) by default when returning data via `data`.\n* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.\n* **CRITICAL** Variables from previous function calls are not available in subsequent calls.\n* **CRITICAL** Keep code concise (max 40 lines, 120 characters per line, and 2,500 characters). Split complex logic into multiple steps.\n* **CRITICAL** Network requests (e.g., fetch, XMLHttpRequest) are disabled and cannot be made.\n\nFor example, to query DOM elements:\n\n```\nconst data = {\n title: document.title,\n elementText: $0?.textContent?.trim(),\n childCount: $0?.children.length,\n};\n```\n"
|
|
82
82
|
},
|
|
83
83
|
"explanation": {
|
|
84
84
|
"type": 1,
|
|
@@ -365,7 +365,7 @@ Content:
|
|
|
365
365
|
{
|
|
366
366
|
"type": "action",
|
|
367
367
|
"callId": "00000000-0000-0000-0000-000000000001",
|
|
368
|
-
"
|
|
368
|
+
"action": "console.log('hello');",
|
|
369
369
|
"output": "hello",
|
|
370
370
|
"canceled": false,
|
|
371
371
|
"toolName": "executeJavaScript"
|
|
@@ -44,7 +44,7 @@ The following audits in this category have a score below 90 and may need attenti
|
|
|
44
44
|
* **Wasted Bytes**: 1 kB
|
|
45
45
|
* **Node**: div.main
|
|
46
46
|
* **Node path**: 1,HTML,1,BODY,5,DIV
|
|
47
|
-
* **Location**: https://example.com/script.js:
|
|
47
|
+
* **Location**: https://example.com/script.js:11:5
|
|
48
48
|
- Item:
|
|
49
49
|
* **URL**: https://example.com/style.css
|
|
50
50
|
* **Wasted Bytes**: 512 B
|
|
@@ -92,7 +92,7 @@ The following audits in this category have a score below 90 and may need attenti
|
|
|
92
92
|
- Item:
|
|
93
93
|
* **Failing Elements**: html
|
|
94
94
|
* **Failing Elements path**: 1,HTML
|
|
95
|
-
* **Failing Elements explanation**: Fix all of the following:
|
|
95
|
+
* **Failing Elements explanation**: Fix all of the following: Document does not have a main landmark
|
|
96
96
|
=== end content
|
|
97
97
|
|
|
98
98
|
Title: LighthouseFormatter formats table details with subItems
|
|
@@ -144,3 +144,150 @@ Content:
|
|
|
144
144
|
### Accessibility (categoryId: "accessibility")
|
|
145
145
|
- No failing audits.
|
|
146
146
|
=== end content
|
|
147
|
+
|
|
148
|
+
Title: LighthouseFormatter formats 0-based source locations as 1-based
|
|
149
|
+
Content:
|
|
150
|
+
# Audits for Accessibility
|
|
151
|
+
Category description.
|
|
152
|
+
|
|
153
|
+
The following audits in this category have a score below 90 and may need attention:
|
|
154
|
+
- **Buttons do not have an accessible name**: 0
|
|
155
|
+
* Audit description.
|
|
156
|
+
|
|
157
|
+
- Item:
|
|
158
|
+
* **Location**: https://example.com/app.js:1:0
|
|
159
|
+
- Item:
|
|
160
|
+
* **Location**: https://example.com/no-line.js
|
|
161
|
+
=== end content
|
|
162
|
+
|
|
163
|
+
Title: LighthouseFormatter collapses multi-line values onto a single line
|
|
164
|
+
Content:
|
|
165
|
+
# Audits for Accessibility
|
|
166
|
+
Category description spanning two lines.
|
|
167
|
+
|
|
168
|
+
The following audits in this category have a score below 90 and may need attention:
|
|
169
|
+
- **Buttons do not have an accessible name**: 0
|
|
170
|
+
* Audit description spanning two lines.
|
|
171
|
+
|
|
172
|
+
- Item:
|
|
173
|
+
* **Failing Elements**: button
|
|
174
|
+
* **Failing Elements explanation**: Fix any of the following: Element does not have inner text; aria-label attribute does not exist
|
|
175
|
+
* **Schema**: { "type": "object", "properties": {} }
|
|
176
|
+
=== end content
|
|
177
|
+
|
|
178
|
+
Title: LighthouseFormatter formats audit explanations and warnings
|
|
179
|
+
Content:
|
|
180
|
+
# Audits for Agentic Browsing
|
|
181
|
+
|
|
182
|
+
The following audits in this category have a score below 90 and may need attention:
|
|
183
|
+
- **llms.txt is valid**: 0
|
|
184
|
+
* Checks whether /llms.txt exists and is valid.
|
|
185
|
+
* Explanation: Failed to fetch https://example.com/llms.txt: HTTP 404 Not Found
|
|
186
|
+
* Warning: First warning message
|
|
187
|
+
* Warning: Second warning spanning two lines
|
|
188
|
+
=== end content
|
|
189
|
+
|
|
190
|
+
Title: LighthouseFormatter includes gatherMode and fraction-scored categories in summary
|
|
191
|
+
Content:
|
|
192
|
+
# Lighthouse Report Summary
|
|
193
|
+
URL: https://example.com
|
|
194
|
+
Fetch Time: 2025-01-01T00:00:00.000Z
|
|
195
|
+
Lighthouse Version: 12.0.0
|
|
196
|
+
Mode: navigation
|
|
197
|
+
|
|
198
|
+
## Category Scores
|
|
199
|
+
- Performance: 80
|
|
200
|
+
- Agentic Browsing: 1/2 audits passed
|
|
201
|
+
=== end content
|
|
202
|
+
|
|
203
|
+
Title: LighthouseFormatter surfaces errored audits
|
|
204
|
+
Content:
|
|
205
|
+
## Failing audits
|
|
206
|
+
|
|
207
|
+
### Performance (categoryId: "performance")
|
|
208
|
+
- First Audit: 80
|
|
209
|
+
- Errored Audit: Error (Audit execution timed out)
|
|
210
|
+
|
|
211
|
+
# Audits for Performance
|
|
212
|
+
|
|
213
|
+
The following audits in this category have a score below 90 and may need attention:
|
|
214
|
+
- **First Audit**: 80 (1.2s)
|
|
215
|
+
* Description of first audit
|
|
216
|
+
|
|
217
|
+
The following audits in this category errored:
|
|
218
|
+
- **Errored Audit**: Error
|
|
219
|
+
* An audit that threw an error during execution.
|
|
220
|
+
* Error: Audit execution timed out
|
|
221
|
+
=== end content
|
|
222
|
+
Title: LighthouseFormatter excludes hidden audits
|
|
223
|
+
Content:
|
|
224
|
+
## Failing audits
|
|
225
|
+
|
|
226
|
+
### Performance (categoryId: "performance")
|
|
227
|
+
- No failing audits.
|
|
228
|
+
|
|
229
|
+
# Audits for Performance
|
|
230
|
+
|
|
231
|
+
All audits in this category passed (score >= 90).
|
|
232
|
+
=== end content
|
|
233
|
+
|
|
234
|
+
Title: LighthouseFormatter formats list details with list-section, table, and node items
|
|
235
|
+
Content:
|
|
236
|
+
# Audits for Performance
|
|
237
|
+
|
|
238
|
+
The following audits in this category have a score below 90 and may need attention:
|
|
239
|
+
- **LCP breakdown**: 30
|
|
240
|
+
* Each subpath has specific improvement strategies.
|
|
241
|
+
|
|
242
|
+
- Item:
|
|
243
|
+
* **Subpart**: Time to first byte
|
|
244
|
+
* **Duration**: 120 ms
|
|
245
|
+
- Item:
|
|
246
|
+
* **Subpart**: Element render delay
|
|
247
|
+
* **Duration**: 480 ms
|
|
248
|
+
|
|
249
|
+
**LCP Element**
|
|
250
|
+
The largest contentful paint element on the page.
|
|
251
|
+
- **Element**: Hero Heading
|
|
252
|
+
- **Element selector**: main > h1.hero
|
|
253
|
+
- **Element path**: 1,HTML,1,BODY,0,MAIN,0,H1
|
|
254
|
+
- **Element explanation**: Fix any of the following: Element is delayed by render-blocking script
|
|
255
|
+
=== end content
|
|
256
|
+
|
|
257
|
+
Title: LighthouseFormatter formats checklist details and wrapped text/url values
|
|
258
|
+
Content:
|
|
259
|
+
# Audits for Performance
|
|
260
|
+
|
|
261
|
+
The following audits in this category have a score below 90 and may need attention:
|
|
262
|
+
- **LCP request discovery**: 40
|
|
263
|
+
* Optimize LCP by making the LCP image discoverable from the HTML immediately.
|
|
264
|
+
|
|
265
|
+
- fetchpriority=high should be applied: Failed
|
|
266
|
+
- Request is discoverable in initial document: Passed
|
|
267
|
+
- lazy load not applied: Passed
|
|
268
|
+
|
|
269
|
+
**LCP Resource**
|
|
270
|
+
https://example.com/hero.jpg
|
|
271
|
+
|
|
272
|
+
**Note**
|
|
273
|
+
Add fetchpriority="high" to the image element.
|
|
274
|
+
|
|
275
|
+
- Item:
|
|
276
|
+
* **Resource**: https://example.com/hero.jpg
|
|
277
|
+
* **Advice**: Preload this image
|
|
278
|
+
=== end content
|
|
279
|
+
|
|
280
|
+
Title: LighthouseFormatter formats network-tree details inside a list section
|
|
281
|
+
Content:
|
|
282
|
+
# Audits for Performance
|
|
283
|
+
|
|
284
|
+
The following audits in this category have a score below 90 and may need attention:
|
|
285
|
+
- **Network dependency tree**: 0
|
|
286
|
+
* Avoid chaining critical requests.
|
|
287
|
+
|
|
288
|
+
Maximum critical path latency: 650 ms
|
|
289
|
+
- https://example.com/ (200 ms, 4.1 kB) (longest chain)
|
|
290
|
+
- https://example.com/styles.css (450 ms, 8.2 kB) (longest chain)
|
|
291
|
+
- https://example.com/font.woff2 (650 ms, 16.4 kB) (longest chain)
|
|
292
|
+
- https://example.com/app.js (400 ms, 2 kB)
|
|
293
|
+
=== end content
|