chrome-devtools-frontend 1.0.1545096 → 1.0.1547571
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/.stylelintrc.json +5 -1
- package/docs/contributing/infrastructure.md +2 -2
- package/docs/styleguide/ux/styles.md +1 -1
- package/eslint.config.mjs +2 -1
- package/front_end/Images/generate-css-vars.js +1 -1
- package/front_end/Images/src/arrow-down.svg +8 -1
- package/front_end/Images/src/arrow-up.svg +8 -1
- package/front_end/core/common/common.ts +0 -2
- package/front_end/core/host/AidaClient.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
- package/front_end/core/host/UserMetrics.ts +0 -5
- package/front_end/core/i18n/collect-ui-strings.js +1 -1
- package/front_end/core/i18n/generate-locales-js.js +1 -1
- package/front_end/core/platform/HostRuntime.ts +25 -0
- package/front_end/core/platform/KeyboardUtilities.ts +2 -2
- package/front_end/core/platform/StringUtilities.ts +1 -1
- package/front_end/core/platform/api/HostRuntime.ts +45 -0
- package/front_end/core/platform/api/api.ts +7 -0
- package/front_end/core/{common/Worker.ts → platform/browser/HostRuntime.ts} +27 -12
- package/front_end/core/platform/browser/browser.ts +7 -0
- package/front_end/core/platform/node/HostRuntime.ts +85 -0
- package/front_end/core/platform/node/node.ts +7 -0
- package/front_end/core/platform/platform.ts +2 -2
- package/front_end/core/sdk/AnimationModel.ts +1 -1
- package/front_end/core/sdk/CSSModel.ts +1 -1
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +1 -1
- package/front_end/core/sdk/ConsoleModel.ts +1 -1
- package/front_end/core/sdk/Cookie.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +2 -2
- package/front_end/core/sdk/DebuggerModel.ts +1 -1
- package/front_end/core/sdk/NetworkManager.ts +6 -0
- package/front_end/core/sdk/PreloadingModel.ts +1 -1
- package/front_end/core/sdk/RemoteObject.ts +1 -1
- package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
- package/front_end/core/sdk/Script.ts +4 -4
- package/front_end/core/sdk/SourceMapScopesInfo.ts +141 -23
- package/front_end/core/sdk/Target.ts +5 -14
- package/front_end/core/sdk/TargetManager.ts +26 -4
- package/front_end/core/sdk/sdk-meta.ts +62 -0
- package/front_end/devtools_compatibility.js +0 -1
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +2 -2
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +15 -18
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +8 -5
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +4 -4
- package/front_end/foundation/Universe.ts +2 -2
- package/front_end/generated/Deprecation.ts +26 -0
- package/front_end/generated/InspectorBackendCommands.ts +5 -4
- package/front_end/generated/SupportedCSSProperties.js +17 -15
- package/front_end/generated/protocol-mapping.d.ts +2 -0
- package/front_end/generated/protocol-proxy-api.d.ts +4 -0
- package/front_end/generated/protocol.ts +19 -29
- package/front_end/models/ai_assistance/AiConversation.ts +268 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -172
- package/front_end/models/ai_assistance/BuiltInAi.ts +131 -134
- package/front_end/models/ai_assistance/ChangeManager.ts +9 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +27 -52
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -8
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +6 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -19
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +313 -313
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +8 -6
- package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +33 -33
- package/front_end/models/ai_assistance/performance/AICallTree.ts +9 -3
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +5 -3
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -4
- package/front_end/models/cpu_profile/CPUProfileDataModel.ts +10 -7
- package/front_end/models/crux-manager/CrUXManager.ts +7 -4
- package/front_end/models/formatter/FormatterWorkerPool.ts +9 -7
- package/front_end/models/har/Importer.ts +1 -1
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +1 -1
- package/front_end/models/issues_manager/GenericIssue.ts +12 -9
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +1 -1
- package/front_end/models/trace/handlers/SamplesHandler.ts +3 -0
- package/front_end/models/trace/helpers/Trace.ts +13 -0
- package/front_end/models/trace/types/TraceEvents.ts +2 -1
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -0
- package/front_end/models/workspace/IgnoreListManager.ts +1 -2
- package/front_end/models/workspace/UISourceCode.ts +50 -0
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +86 -159
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +8 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +56 -33
- package/front_end/panels/animation/AnimationTimeline.ts +0 -8
- package/front_end/panels/application/ExtensionStorageModel.ts +1 -1
- package/front_end/panels/application/FrameDetailsView.ts +64 -36
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/application/components/components.ts +0 -2
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +80 -0
- package/front_end/panels/common/common.ts +2 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +166 -100
- package/front_end/panels/console/ConsolePrompt.ts +4 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +77 -29
- package/front_end/panels/console/ConsoleViewport.ts +2 -3
- package/front_end/panels/console/consoleInsightTeaser.css +1 -0
- package/front_end/panels/coverage/CoverageModel.ts +2 -2
- package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +17 -7
- package/front_end/panels/elements/NodeStackTraceWidget.ts +6 -5
- package/front_end/panels/elements/StylePropertyTreeElement.ts +24 -21
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/cssValueTraceView.css +1 -1
- package/front_end/panels/elements/elements-meta.ts +1 -0
- package/front_end/panels/explain/components/ConsoleInsight.ts +44 -57
- package/front_end/panels/explain/components/consoleInsight.css +46 -1
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -2
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +19 -0
- package/front_end/panels/network/RequestConditionsDrawer.ts +116 -42
- package/front_end/panels/network/networkLogView.css +11 -0
- package/front_end/panels/network/networkTimingTable.css +8 -6
- package/front_end/panels/network/requestConditionsDrawer.css +10 -1
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotProxy.ts +15 -14
- package/front_end/panels/profiler/ProfilesPanel.ts +1 -2
- package/front_end/panels/recorder/components/StepEditor.ts +1 -1
- package/front_end/panels/security/SecurityPanelSidebar.ts +1 -3
- package/front_end/panels/settings/KeybindsSettingsTab.ts +21 -22
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/panels/sources/CoveragePlugin.ts +5 -5
- package/front_end/panels/sources/DebuggerPlugin.ts +2 -2
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/Plugin.ts +1 -1
- package/front_end/panels/sources/ProfilePlugin.ts +22 -14
- package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +2 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +10 -2
- package/front_end/panels/sources/sources-meta.ts +0 -62
- package/front_end/panels/timeline/README.md +1 -9
- package/front_end/panels/timeline/ThreadAppender.ts +0 -7
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelinePanel.ts +8 -8
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -1
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +15 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +37 -1
- package/front_end/panels/timeline/components/exportTraceOptions.css +11 -2
- package/front_end/panels/timeline/enable-easter-egg.js +1 -1
- package/front_end/panels/timeline/utils/Treemap.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +57 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +1 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +0 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +18 -23
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +9 -73
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +8 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -10
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +80 -81
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +52 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +1 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +0 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +18 -23
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +6 -69
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +8 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -10
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +79 -0
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +1 -9
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +21 -31
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +6 -72
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +7 -2
- package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +14 -0
- 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/puppeteer/puppeteer-tsconfig.json +1 -0
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -0
- package/front_end/ui/components/text_editor/javascript.ts +1 -1
- package/front_end/ui/legacy/ARIAUtils.ts +2 -2
- package/front_end/ui/legacy/ActionRegistration.ts +11 -0
- package/front_end/ui/legacy/ListWidget.ts +51 -18
- package/front_end/ui/legacy/ReportView.ts +1 -1
- package/front_end/ui/legacy/SoftDropDown.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +3 -3
- package/front_end/ui/legacy/TextPrompt.ts +3 -2
- package/front_end/ui/legacy/Treeoutline.ts +3 -2
- package/front_end/ui/legacy/UIUtils.ts +11 -10
- package/front_end/ui/legacy/Widget.ts +3 -2
- package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +5 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +87 -111
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +62 -39
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -9
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +41 -13
- package/front_end/ui/legacy/components/utils/jsUtils.css +28 -0
- package/front_end/ui/legacy/inspectorCommon.css +2 -2
- package/front_end/ui/legacy/legacy.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/front_end/ui/visual_logging/LoggingConfig.ts +2 -1
- package/inspector_overlay/tool_window_controls.ts +4 -1
- package/mcp/mcp.ts +1 -1
- package/package.json +2 -3
- package/front_end/panels/application/components/StackTrace.ts +0 -239
- package/front_end/panels/application/components/stackTraceLinkButton.css +0 -16
- package/front_end/panels/application/components/stackTraceRow.css +0 -50
- package/front_end/panels/explain/components/consoleInsightSourcesList.css +0 -51
- package/front_end/ui/components/docs/README.md +0 -6
- package/front_end/ui/components/docs/building-ui-documentation/ComponentEvents.md +0 -54
- package/front_end/ui/components/docs/building-ui-documentation/ComponentPerformance.md +0 -136
- package/front_end/ui/components/docs/building-ui-documentation/CreatingComponents.md +0 -242
- package/front_end/ui/components/docs/building-ui-documentation/README.md +0 -23
- package/front_end/ui/components/docs/building-ui-documentation/StylingComponents.md +0 -66
- package/front_end/ui/components/docs/building-ui-documentation/TestingComponents.md +0 -111
- package/front_end/ui/components/docs/component_docs.ts +0 -24
- package/front_end/ui/components/docs/component_docs_styles.css +0 -53
- package/front_end/ui/components/docs/create_breadcrumbs.ts +0 -44
- package/front_end/ui/components/docs/slider/basic.html +0 -20
- package/front_end/ui/components/docs/switch/basic.html +0 -20
- /package/front_end/models/issues_manager/descriptions/{genericFormAriaLabelledByToNonExistingId.md → genericFormAriaLabelledByToNonExistingIdError.md} +0 -0
- /package/front_end/models/issues_manager/descriptions/{genericFormLabelHasNeitherForNorNestedInput.md → genericFormLabelHasNeitherForNorNestedInputError.md} +0 -0
- /package/front_end/{core/platform → ui/legacy}/DOMUtilities.ts +0 -0
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
// Re-generate with: npm run generate-protocol-resources
|
|
7
7
|
|
|
8
8
|
export const UIStrings = {
|
|
9
|
+
/**
|
|
10
|
+
* @description This warning occurs when the website uses Attribution Reporting.
|
|
11
|
+
*/
|
|
12
|
+
AttributionReporting: "Attribution Reporting is deprecated and will be removed. See https://goo.gle/ps-status for details.",
|
|
9
13
|
/**
|
|
10
14
|
* @description We show this warning when 1) an 'authorization' header is attached to the request by scripts, 2) there is no 'authorization' in the 'access-control-allow-headers' header in the response, and 3) there is a wildcard symbol ('*') in the 'access-control-allow-header' header in the response. This is allowed now, but we're planning to reject such responses and require responses to have an 'access-control-allow-headers' containing 'authorization'.
|
|
11
15
|
*/
|
|
@@ -178,6 +182,10 @@ export const UIStrings = {
|
|
|
178
182
|
* @description Standard message when one web API is deprecated in favor of another.
|
|
179
183
|
*/
|
|
180
184
|
RangeExpand: "Range.expand() is deprecated. Please use Selection.modify() instead.",
|
|
185
|
+
/**
|
|
186
|
+
* @description A deprecation warning shown in the DevTools Issues tab. It's shown when the Storage Access API is automatically granted by Related Website Sets. The placeholder will always be the string `Related Website Sets`.
|
|
187
|
+
*/
|
|
188
|
+
RelatedWebsiteSets: "`Related Website Sets` is deprecated and will be removed. See https://privacysandbox.com/news/update-on-plans-for-privacy-sandbox-technologies/ for more details.",
|
|
181
189
|
/**
|
|
182
190
|
* @description This warning occurs when a subresource loaded by a page has a URL with an authority portion. These are disallowed.
|
|
183
191
|
*/
|
|
@@ -206,6 +214,10 @@ export const UIStrings = {
|
|
|
206
214
|
* @description A deprecation warning shown in the DevTools Issues tab. It's shown when the speech synthesis API is called before the page receives a user activation.
|
|
207
215
|
*/
|
|
208
216
|
TextToSpeech_DisallowedByAutoplay: "`speechSynthesis.speak()` without user activation is deprecated and will be removed.",
|
|
217
|
+
/**
|
|
218
|
+
* @description A deprecation warning shown in the DevTools Issues tab. It's shown when one of the Topics APIs like `document.browsingTopics()`, `<img browsingtopics>`, `<iframe browsingtopics>`, or `fetch(url, {browsingTopics: true})` are used.
|
|
219
|
+
*/
|
|
220
|
+
Topics: "The Topics API is deprecated and will be removed in a future release.",
|
|
209
221
|
/**
|
|
210
222
|
* @description A deprecation warning shown in the DevTools Issues tab. It's shown when a listener for the `unload` event is added.
|
|
211
223
|
*/
|
|
@@ -226,6 +238,10 @@ export const UIStrings = {
|
|
|
226
238
|
* @description Warning displayed to developers. It is shown when the `XMLHttpRequest` API is used in a way that it slows down the page load of the next page. The `main thread` refers to an operating systems thread used to run most of the processing of HTML documents, so please use a consistent wording.
|
|
227
239
|
*/
|
|
228
240
|
XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: "Synchronous `XMLHttpRequest` on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.",
|
|
241
|
+
/**
|
|
242
|
+
* @description Warning displayed to developers that they are using externally loaded entities in an XML document that constitutes a part of the web page. Externally loaded entities are a technical concept of XML document processing.
|
|
243
|
+
*/
|
|
244
|
+
XMLNoExternalEntities: "Externally loaded entities in XML parsing have been deprecated and will be removed from this browser soon.",
|
|
229
245
|
/**
|
|
230
246
|
* @description Warning displayed to developers that they are using either the XSLTProcessor API, or XSLT processing instructions, both of which have been deprecated and are scheduled to be removed.
|
|
231
247
|
*/
|
|
@@ -238,6 +254,9 @@ export interface DeprecationDescriptor {
|
|
|
238
254
|
}
|
|
239
255
|
|
|
240
256
|
export const DEPRECATIONS_METADATA: Partial<Record<string, DeprecationDescriptor>> = {
|
|
257
|
+
"AttributionReporting": {
|
|
258
|
+
"chromeStatusFeature": 6320639375966208
|
|
259
|
+
},
|
|
241
260
|
"AuthorizationCoveredByWildcard": {
|
|
242
261
|
"milestone": 97
|
|
243
262
|
},
|
|
@@ -319,6 +338,9 @@ export const DEPRECATIONS_METADATA: Partial<Record<string, DeprecationDescriptor
|
|
|
319
338
|
"chromeStatusFeature": 4631626228695040,
|
|
320
339
|
"milestone": 117
|
|
321
340
|
},
|
|
341
|
+
"RelatedWebsiteSets": {
|
|
342
|
+
"chromeStatusFeature": 5194473869017088
|
|
343
|
+
},
|
|
322
344
|
"RequestedSubresourceWithEmbeddedCredentials": {
|
|
323
345
|
"chromeStatusFeature": 5669008342777856
|
|
324
346
|
},
|
|
@@ -345,6 +367,10 @@ export const DEPRECATIONS_METADATA: Partial<Record<string, DeprecationDescriptor
|
|
|
345
367
|
"XHRJSONEncodingDetection": {
|
|
346
368
|
"milestone": 93
|
|
347
369
|
},
|
|
370
|
+
"XMLNoExternalEntities": {
|
|
371
|
+
"chromeStatusFeature": 6734457763659776,
|
|
372
|
+
"milestone": 144
|
|
373
|
+
},
|
|
348
374
|
"XSLT": {
|
|
349
375
|
"chromeStatusFeature": 4709671889534976,
|
|
350
376
|
"milestone": 143
|
|
@@ -81,7 +81,7 @@ inspectorBackend.registerEnum("Audits.AttributionReportingIssueType", {Permissio
|
|
|
81
81
|
inspectorBackend.registerEnum("Audits.SharedDictionaryError", {UseErrorCrossOriginNoCorsRequest: "UseErrorCrossOriginNoCorsRequest", UseErrorDictionaryLoadFailure: "UseErrorDictionaryLoadFailure", UseErrorMatchingDictionaryNotUsed: "UseErrorMatchingDictionaryNotUsed", UseErrorUnexpectedContentDictionaryHeader: "UseErrorUnexpectedContentDictionaryHeader", WriteErrorCossOriginNoCorsRequest: "WriteErrorCossOriginNoCorsRequest", WriteErrorDisallowedBySettings: "WriteErrorDisallowedBySettings", WriteErrorExpiredResponse: "WriteErrorExpiredResponse", WriteErrorFeatureDisabled: "WriteErrorFeatureDisabled", WriteErrorInsufficientResources: "WriteErrorInsufficientResources", WriteErrorInvalidMatchField: "WriteErrorInvalidMatchField", WriteErrorInvalidStructuredHeader: "WriteErrorInvalidStructuredHeader", WriteErrorInvalidTTLField: "WriteErrorInvalidTTLField", WriteErrorNavigationRequest: "WriteErrorNavigationRequest", WriteErrorNoMatchField: "WriteErrorNoMatchField", WriteErrorNonIntegerTTLField: "WriteErrorNonIntegerTTLField", WriteErrorNonListMatchDestField: "WriteErrorNonListMatchDestField", WriteErrorNonSecureContext: "WriteErrorNonSecureContext", WriteErrorNonStringIdField: "WriteErrorNonStringIdField", WriteErrorNonStringInMatchDestList: "WriteErrorNonStringInMatchDestList", WriteErrorNonStringMatchField: "WriteErrorNonStringMatchField", WriteErrorNonTokenTypeField: "WriteErrorNonTokenTypeField", WriteErrorRequestAborted: "WriteErrorRequestAborted", WriteErrorShuttingDown: "WriteErrorShuttingDown", WriteErrorTooLongIdField: "WriteErrorTooLongIdField", WriteErrorUnsupportedType: "WriteErrorUnsupportedType"});
|
|
82
82
|
inspectorBackend.registerEnum("Audits.SRIMessageSignatureError", {MissingSignatureHeader: "MissingSignatureHeader", MissingSignatureInputHeader: "MissingSignatureInputHeader", InvalidSignatureHeader: "InvalidSignatureHeader", InvalidSignatureInputHeader: "InvalidSignatureInputHeader", SignatureHeaderValueIsNotByteSequence: "SignatureHeaderValueIsNotByteSequence", SignatureHeaderValueIsParameterized: "SignatureHeaderValueIsParameterized", SignatureHeaderValueIsIncorrectLength: "SignatureHeaderValueIsIncorrectLength", SignatureInputHeaderMissingLabel: "SignatureInputHeaderMissingLabel", SignatureInputHeaderValueNotInnerList: "SignatureInputHeaderValueNotInnerList", SignatureInputHeaderValueMissingComponents: "SignatureInputHeaderValueMissingComponents", SignatureInputHeaderInvalidComponentType: "SignatureInputHeaderInvalidComponentType", SignatureInputHeaderInvalidComponentName: "SignatureInputHeaderInvalidComponentName", SignatureInputHeaderInvalidHeaderComponentParameter: "SignatureInputHeaderInvalidHeaderComponentParameter", SignatureInputHeaderInvalidDerivedComponentParameter: "SignatureInputHeaderInvalidDerivedComponentParameter", SignatureInputHeaderKeyIdLength: "SignatureInputHeaderKeyIdLength", SignatureInputHeaderInvalidParameter: "SignatureInputHeaderInvalidParameter", SignatureInputHeaderMissingRequiredParameters: "SignatureInputHeaderMissingRequiredParameters", ValidationFailedSignatureExpired: "ValidationFailedSignatureExpired", ValidationFailedInvalidLength: "ValidationFailedInvalidLength", ValidationFailedSignatureMismatch: "ValidationFailedSignatureMismatch", ValidationFailedIntegrityMismatch: "ValidationFailedIntegrityMismatch"});
|
|
83
83
|
inspectorBackend.registerEnum("Audits.UnencodedDigestError", {MalformedDictionary: "MalformedDictionary", UnknownAlgorithm: "UnknownAlgorithm", IncorrectDigestType: "IncorrectDigestType", IncorrectDigestLength: "IncorrectDigestLength"});
|
|
84
|
-
inspectorBackend.registerEnum("Audits.GenericIssueErrorType", {FormLabelForNameError: "FormLabelForNameError", FormDuplicateIdForInputError: "FormDuplicateIdForInputError", FormInputWithNoLabelError: "FormInputWithNoLabelError", FormAutocompleteAttributeEmptyError: "FormAutocompleteAttributeEmptyError", FormEmptyIdAndNameAttributesForInputError: "FormEmptyIdAndNameAttributesForInputError",
|
|
84
|
+
inspectorBackend.registerEnum("Audits.GenericIssueErrorType", {FormLabelForNameError: "FormLabelForNameError", FormDuplicateIdForInputError: "FormDuplicateIdForInputError", FormInputWithNoLabelError: "FormInputWithNoLabelError", FormAutocompleteAttributeEmptyError: "FormAutocompleteAttributeEmptyError", FormEmptyIdAndNameAttributesForInputError: "FormEmptyIdAndNameAttributesForInputError", FormAriaLabelledByToNonExistingIdError: "FormAriaLabelledByToNonExistingIdError", FormInputAssignedAutocompleteValueToIdOrNameAttributeError: "FormInputAssignedAutocompleteValueToIdOrNameAttributeError", FormLabelHasNeitherForNorNestedInputError: "FormLabelHasNeitherForNorNestedInputError", FormLabelForMatchesNonExistingIdError: "FormLabelForMatchesNonExistingIdError", FormInputHasWrongButWellIntendedAutocompleteValueError: "FormInputHasWrongButWellIntendedAutocompleteValueError", ResponseWasBlockedByORB: "ResponseWasBlockedByORB", NavigationEntryMarkedSkippable: "NavigationEntryMarkedSkippable"});
|
|
85
85
|
inspectorBackend.registerEnum("Audits.ClientHintIssueReason", {MetaTagAllowListInvalidOrigin: "MetaTagAllowListInvalidOrigin", MetaTagModifiedHTML: "MetaTagModifiedHTML"});
|
|
86
86
|
inspectorBackend.registerEnum("Audits.FederatedAuthRequestIssueReason", {ShouldEmbargo: "ShouldEmbargo", TooManyRequests: "TooManyRequests", WellKnownHttpNotFound: "WellKnownHttpNotFound", WellKnownNoResponse: "WellKnownNoResponse", WellKnownInvalidResponse: "WellKnownInvalidResponse", WellKnownListEmpty: "WellKnownListEmpty", WellKnownInvalidContentType: "WellKnownInvalidContentType", ConfigNotInWellKnown: "ConfigNotInWellKnown", WellKnownTooBig: "WellKnownTooBig", ConfigHttpNotFound: "ConfigHttpNotFound", ConfigNoResponse: "ConfigNoResponse", ConfigInvalidResponse: "ConfigInvalidResponse", ConfigInvalidContentType: "ConfigInvalidContentType", ClientMetadataHttpNotFound: "ClientMetadataHttpNotFound", ClientMetadataNoResponse: "ClientMetadataNoResponse", ClientMetadataInvalidResponse: "ClientMetadataInvalidResponse", ClientMetadataInvalidContentType: "ClientMetadataInvalidContentType", IdpNotPotentiallyTrustworthy: "IdpNotPotentiallyTrustworthy", DisabledInSettings: "DisabledInSettings", DisabledInFlags: "DisabledInFlags", ErrorFetchingSignin: "ErrorFetchingSignin", InvalidSigninResponse: "InvalidSigninResponse", AccountsHttpNotFound: "AccountsHttpNotFound", AccountsNoResponse: "AccountsNoResponse", AccountsInvalidResponse: "AccountsInvalidResponse", AccountsListEmpty: "AccountsListEmpty", AccountsInvalidContentType: "AccountsInvalidContentType", IdTokenHttpNotFound: "IdTokenHttpNotFound", IdTokenNoResponse: "IdTokenNoResponse", IdTokenInvalidResponse: "IdTokenInvalidResponse", IdTokenIdpErrorResponse: "IdTokenIdpErrorResponse", IdTokenCrossSiteIdpErrorResponse: "IdTokenCrossSiteIdpErrorResponse", IdTokenInvalidRequest: "IdTokenInvalidRequest", IdTokenInvalidContentType: "IdTokenInvalidContentType", ErrorIdToken: "ErrorIdToken", Canceled: "Canceled", RpPageNotVisible: "RpPageNotVisible", SilentMediationFailure: "SilentMediationFailure", ThirdPartyCookiesBlocked: "ThirdPartyCookiesBlocked", NotSignedInWithIdp: "NotSignedInWithIdp", MissingTransientUserActivation: "MissingTransientUserActivation", ReplacedByActiveMode: "ReplacedByActiveMode", InvalidFieldsSpecified: "InvalidFieldsSpecified", RelyingPartyOriginIsOpaque: "RelyingPartyOriginIsOpaque", TypeNotMatching: "TypeNotMatching", UiDismissedNoEmbargo: "UiDismissedNoEmbargo", CorsError: "CorsError", SuppressedBySegmentationPlatform: "SuppressedBySegmentationPlatform"});
|
|
87
87
|
inspectorBackend.registerEnum("Audits.FederatedAuthUserInfoRequestIssueReason", {NotSameOrigin: "NotSameOrigin", NotIframe: "NotIframe", NotPotentiallyTrustworthy: "NotPotentiallyTrustworthy", NoAPIPermission: "NoApiPermission", NotSignedInWithIdp: "NotSignedInWithIdp", NoAccountSharingPermission: "NoAccountSharingPermission", InvalidConfigOrWellKnown: "InvalidConfigOrWellKnown", InvalidAccountsResponse: "InvalidAccountsResponse", NoReturningUserFromFetchedAccounts: "NoReturningUserFromFetchedAccounts"});
|
|
@@ -247,7 +247,7 @@ inspectorBackend.registerCommand("CSS.resolveValues", [{"name": "values", "type"
|
|
|
247
247
|
inspectorBackend.registerCommand("CSS.getLonghandProperties", [{"name": "shorthandName", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "value", "type": "string", "optional": false, "description": "", "typeRef": null}], ["longhandProperties"], "");
|
|
248
248
|
inspectorBackend.registerCommand("CSS.getInlineStylesForNode", [{"name": "nodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.NodeId"}], ["inlineStyle", "attributesStyle"], "Returns the styles defined inline (explicitly in the \"style\" attribute and implicitly, using DOM attributes) for a DOM node identified by `nodeId`.");
|
|
249
249
|
inspectorBackend.registerCommand("CSS.getAnimatedStylesForNode", [{"name": "nodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.NodeId"}], ["animationStyles", "transitionsStyle", "inherited"], "Returns the styles coming from animations & transitions including the animation & transition styles coming from inheritance chain.");
|
|
250
|
-
inspectorBackend.registerCommand("CSS.getMatchedStylesForNode", [{"name": "nodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.NodeId"}], ["inlineStyle", "attributesStyle", "matchedCSSRules", "pseudoElements", "inherited", "inheritedPseudoElements", "cssKeyframesRules", "cssPositionTryRules", "activePositionFallbackIndex", "cssPropertyRules", "cssPropertyRegistrations", "
|
|
250
|
+
inspectorBackend.registerCommand("CSS.getMatchedStylesForNode", [{"name": "nodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.NodeId"}], ["inlineStyle", "attributesStyle", "matchedCSSRules", "pseudoElements", "inherited", "inheritedPseudoElements", "cssKeyframesRules", "cssPositionTryRules", "activePositionFallbackIndex", "cssPropertyRules", "cssPropertyRegistrations", "cssAtRules", "parentLayoutNodeId", "cssFunctionRules"], "Returns requested styles for a DOM node identified by `nodeId`.");
|
|
251
251
|
inspectorBackend.registerCommand("CSS.getEnvironmentVariables", [], ["environmentVariables"], "Returns the values of the default UA-defined environment variables used in env()");
|
|
252
252
|
inspectorBackend.registerCommand("CSS.getMediaQueries", [], ["medias"], "Returns all media queries parsed by the rendering engine.");
|
|
253
253
|
inspectorBackend.registerCommand("CSS.getPlatformFontsForNode", [{"name": "nodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.NodeId"}], ["fonts"], "Requests information about platform fonts which we used to render child TextNodes in the given node.");
|
|
@@ -305,7 +305,6 @@ inspectorBackend.registerType("CSS.CSSTryRule", [{"name": "styleSheetId", "type"
|
|
|
305
305
|
inspectorBackend.registerType("CSS.CSSPositionTryRule", [{"name": "name", "type": "object", "optional": false, "description": "The prelude dashed-ident name", "typeRef": "CSS.Value"}, {"name": "styleSheetId", "type": "string", "optional": true, "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.", "typeRef": "CSS.StyleSheetId"}, {"name": "origin", "type": "string", "optional": false, "description": "Parent stylesheet's origin.", "typeRef": "CSS.StyleSheetOrigin"}, {"name": "style", "type": "object", "optional": false, "description": "Associated style declaration.", "typeRef": "CSS.CSSStyle"}, {"name": "active", "type": "boolean", "optional": false, "description": "", "typeRef": null}]);
|
|
306
306
|
inspectorBackend.registerType("CSS.CSSKeyframesRule", [{"name": "animationName", "type": "object", "optional": false, "description": "Animation name.", "typeRef": "CSS.Value"}, {"name": "keyframes", "type": "array", "optional": false, "description": "List of keyframes.", "typeRef": "CSS.CSSKeyframeRule"}]);
|
|
307
307
|
inspectorBackend.registerType("CSS.CSSPropertyRegistration", [{"name": "propertyName", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "initialValue", "type": "object", "optional": true, "description": "", "typeRef": "CSS.Value"}, {"name": "inherits", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "syntax", "type": "string", "optional": false, "description": "", "typeRef": null}]);
|
|
308
|
-
inspectorBackend.registerType("CSS.CSSFontPaletteValuesRule", [{"name": "styleSheetId", "type": "string", "optional": true, "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.", "typeRef": "CSS.StyleSheetId"}, {"name": "origin", "type": "string", "optional": false, "description": "Parent stylesheet's origin.", "typeRef": "CSS.StyleSheetOrigin"}, {"name": "fontPaletteName", "type": "object", "optional": false, "description": "Associated font palette name.", "typeRef": "CSS.Value"}, {"name": "style", "type": "object", "optional": false, "description": "Associated style declaration.", "typeRef": "CSS.CSSStyle"}]);
|
|
309
308
|
inspectorBackend.registerType("CSS.CSSAtRule", [{"name": "type", "type": "string", "optional": false, "description": "Type of at-rule.", "typeRef": null}, {"name": "subsection", "type": "string", "optional": true, "description": "Subsection of font-feature-values, if this is a subsection.", "typeRef": null}, {"name": "name", "type": "object", "optional": true, "description": "LINT_SKIP.ThenChange(//third_party/blink/renderer/core/inspector/inspector_style_sheet.cc:FontVariantAlternatesFeatureType,//third_party/blink/renderer/core/inspector/inspector_css_agent.cc:FontVariantAlternatesFeatureType) Associated name, if applicable.", "typeRef": "CSS.Value"}, {"name": "styleSheetId", "type": "string", "optional": true, "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.", "typeRef": "CSS.StyleSheetId"}, {"name": "origin", "type": "string", "optional": false, "description": "Parent stylesheet's origin.", "typeRef": "CSS.StyleSheetOrigin"}, {"name": "style", "type": "object", "optional": false, "description": "Associated style declaration.", "typeRef": "CSS.CSSStyle"}]);
|
|
310
309
|
inspectorBackend.registerType("CSS.CSSPropertyRule", [{"name": "styleSheetId", "type": "string", "optional": true, "description": "The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.", "typeRef": "CSS.StyleSheetId"}, {"name": "origin", "type": "string", "optional": false, "description": "Parent stylesheet's origin.", "typeRef": "CSS.StyleSheetOrigin"}, {"name": "propertyName", "type": "object", "optional": false, "description": "Associated property name.", "typeRef": "CSS.Value"}, {"name": "style", "type": "object", "optional": false, "description": "Associated style declaration.", "typeRef": "CSS.CSSStyle"}]);
|
|
311
310
|
inspectorBackend.registerType("CSS.CSSFunctionParameter", [{"name": "name", "type": "string", "optional": false, "description": "The parameter name.", "typeRef": null}, {"name": "type", "type": "string", "optional": false, "description": "The parameter type.", "typeRef": null}]);
|
|
@@ -811,6 +810,8 @@ inspectorBackend.registerEvent("Network.directTCPSocketAborted", ["identifier",
|
|
|
811
810
|
inspectorBackend.registerEvent("Network.directTCPSocketClosed", ["identifier", "timestamp"]);
|
|
812
811
|
inspectorBackend.registerEvent("Network.directTCPSocketChunkSent", ["identifier", "data", "timestamp"]);
|
|
813
812
|
inspectorBackend.registerEvent("Network.directTCPSocketChunkReceived", ["identifier", "data", "timestamp"]);
|
|
813
|
+
inspectorBackend.registerEvent("Network.directUDPSocketJoinedMulticastGroup", ["identifier", "IPAddress"]);
|
|
814
|
+
inspectorBackend.registerEvent("Network.directUDPSocketLeftMulticastGroup", ["identifier", "IPAddress"]);
|
|
814
815
|
inspectorBackend.registerEvent("Network.directUDPSocketCreated", ["identifier", "options", "timestamp", "initiator"]);
|
|
815
816
|
inspectorBackend.registerEvent("Network.directUDPSocketOpened", ["identifier", "localAddr", "localPort", "timestamp", "remoteAddr", "remotePort"]);
|
|
816
817
|
inspectorBackend.registerEvent("Network.directUDPSocketAborted", ["identifier", "errorMessage", "timestamp"]);
|
|
@@ -893,7 +894,7 @@ inspectorBackend.registerType("Network.SignedExchangeInfo", [{"name": "outerResp
|
|
|
893
894
|
inspectorBackend.registerType("Network.NetworkConditions", [{"name": "urlPattern", "type": "string", "optional": false, "description": "Only matching requests will be affected by these conditions. Patterns use the URLPattern constructor string syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. If the pattern is empty, all requests are matched (including p2p connections).", "typeRef": null}, {"name": "latency", "type": "number", "optional": false, "description": "Minimum latency from request sent to response headers received (ms).", "typeRef": null}, {"name": "downloadThroughput", "type": "number", "optional": false, "description": "Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.", "typeRef": null}, {"name": "uploadThroughput", "type": "number", "optional": false, "description": "Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.", "typeRef": null}, {"name": "connectionType", "type": "string", "optional": true, "description": "Connection type if known.", "typeRef": "Network.ConnectionType"}, {"name": "packetLoss", "type": "number", "optional": true, "description": "WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.", "typeRef": null}, {"name": "packetQueueLength", "type": "number", "optional": true, "description": "WebRTC packet queue length (packet). 0 removes any queue length limitations.", "typeRef": null}, {"name": "packetReordering", "type": "boolean", "optional": true, "description": "WebRTC packetReordering feature.", "typeRef": null}]);
|
|
894
895
|
inspectorBackend.registerType("Network.BlockPattern", [{"name": "urlPattern", "type": "string", "optional": false, "description": "URL pattern to match. Patterns use the URLPattern constructor string syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. Example: `*://*:*/*.css`.", "typeRef": null}, {"name": "block", "type": "boolean", "optional": false, "description": "Whether or not to block the pattern. If false, a matching request will not be blocked even if it matches a later `BlockPattern`.", "typeRef": null}]);
|
|
895
896
|
inspectorBackend.registerType("Network.DirectTCPSocketOptions", [{"name": "noDelay", "type": "boolean", "optional": false, "description": "TCP_NODELAY option", "typeRef": null}, {"name": "keepAliveDelay", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "sendBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "receiveBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "dnsQueryType", "type": "string", "optional": true, "description": "", "typeRef": "Network.DirectSocketDnsQueryType"}]);
|
|
896
|
-
inspectorBackend.registerType("Network.DirectUDPSocketOptions", [{"name": "remoteAddr", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "remotePort", "type": "number", "optional": true, "description": "Unsigned int 16.", "typeRef": null}, {"name": "localAddr", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "localPort", "type": "number", "optional": true, "description": "Unsigned int 16.", "typeRef": null}, {"name": "dnsQueryType", "type": "string", "optional": true, "description": "", "typeRef": "Network.DirectSocketDnsQueryType"}, {"name": "sendBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "receiveBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}]);
|
|
897
|
+
inspectorBackend.registerType("Network.DirectUDPSocketOptions", [{"name": "remoteAddr", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "remotePort", "type": "number", "optional": true, "description": "Unsigned int 16.", "typeRef": null}, {"name": "localAddr", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "localPort", "type": "number", "optional": true, "description": "Unsigned int 16.", "typeRef": null}, {"name": "dnsQueryType", "type": "string", "optional": true, "description": "", "typeRef": "Network.DirectSocketDnsQueryType"}, {"name": "sendBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "receiveBufferSize", "type": "number", "optional": true, "description": "Expected to be unsigned integer.", "typeRef": null}, {"name": "multicastLoopback", "type": "boolean", "optional": true, "description": "", "typeRef": null}, {"name": "multicastTimeToLive", "type": "number", "optional": true, "description": "Unsigned int 8.", "typeRef": null}, {"name": "multicastAllowAddressSharing", "type": "boolean", "optional": true, "description": "", "typeRef": null}]);
|
|
897
898
|
inspectorBackend.registerType("Network.DirectUDPMessage", [{"name": "data", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "remoteAddr", "type": "string", "optional": true, "description": "Null for connected mode.", "typeRef": null}, {"name": "remotePort", "type": "number", "optional": true, "description": "Null for connected mode. Expected to be unsigned integer.", "typeRef": null}]);
|
|
898
899
|
inspectorBackend.registerType("Network.ConnectTiming", [{"name": "requestTime", "type": "number", "optional": false, "description": "Timing's requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for the same request (but not for redirected requests).", "typeRef": null}]);
|
|
899
900
|
inspectorBackend.registerType("Network.ClientSecurityState", [{"name": "initiatorIsSecureContext", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "initiatorIPAddressSpace", "type": "string", "optional": false, "description": "", "typeRef": "Network.IPAddressSpace"}, {"name": "privateNetworkRequestPolicy", "type": "string", "optional": false, "description": "", "typeRef": "Network.PrivateNetworkRequestPolicy"}]);
|
|
@@ -2142,8 +2142,8 @@ export const generatedProperties = [
|
|
|
2142
2142
|
"math",
|
|
2143
2143
|
"ruby",
|
|
2144
2144
|
"ruby-text",
|
|
2145
|
-
"
|
|
2146
|
-
"inline-
|
|
2145
|
+
"grid-lanes",
|
|
2146
|
+
"inline-grid-lanes"
|
|
2147
2147
|
],
|
|
2148
2148
|
"name": "display"
|
|
2149
2149
|
},
|
|
@@ -2643,6 +2643,15 @@ export const generatedProperties = [
|
|
|
2643
2643
|
],
|
|
2644
2644
|
"name": "grid-column-start"
|
|
2645
2645
|
},
|
|
2646
|
+
{
|
|
2647
|
+
"longhands": [
|
|
2648
|
+
"grid-template-areas",
|
|
2649
|
+
"grid-template-columns",
|
|
2650
|
+
"masonry-direction",
|
|
2651
|
+
"masonry-fill"
|
|
2652
|
+
],
|
|
2653
|
+
"name": "grid-lanes"
|
|
2654
|
+
},
|
|
2646
2655
|
{
|
|
2647
2656
|
"longhands": [
|
|
2648
2657
|
"grid-row-start",
|
|
@@ -3087,15 +3096,6 @@ export const generatedProperties = [
|
|
|
3087
3096
|
],
|
|
3088
3097
|
"name": "mask-type"
|
|
3089
3098
|
},
|
|
3090
|
-
{
|
|
3091
|
-
"longhands": [
|
|
3092
|
-
"grid-template-areas",
|
|
3093
|
-
"grid-template-columns",
|
|
3094
|
-
"masonry-direction",
|
|
3095
|
-
"masonry-fill"
|
|
3096
|
-
],
|
|
3097
|
-
"name": "masonry"
|
|
3098
|
-
},
|
|
3099
3099
|
{
|
|
3100
3100
|
"keywords": [
|
|
3101
3101
|
"row",
|
|
@@ -3582,7 +3582,8 @@ export const generatedProperties = [
|
|
|
3582
3582
|
},
|
|
3583
3583
|
{
|
|
3584
3584
|
"keywords": [
|
|
3585
|
-
"auto"
|
|
3585
|
+
"auto",
|
|
3586
|
+
"none"
|
|
3586
3587
|
],
|
|
3587
3588
|
"name": "position-anchor"
|
|
3588
3589
|
},
|
|
@@ -5654,8 +5655,8 @@ export const generatedPropertyValues = {
|
|
|
5654
5655
|
"math",
|
|
5655
5656
|
"ruby",
|
|
5656
5657
|
"ruby-text",
|
|
5657
|
-
"
|
|
5658
|
-
"inline-
|
|
5658
|
+
"grid-lanes",
|
|
5659
|
+
"inline-grid-lanes"
|
|
5659
5660
|
]
|
|
5660
5661
|
},
|
|
5661
5662
|
"dominant-baseline": {
|
|
@@ -6438,7 +6439,8 @@ export const generatedPropertyValues = {
|
|
|
6438
6439
|
},
|
|
6439
6440
|
"position-anchor": {
|
|
6440
6441
|
"values": [
|
|
6441
|
-
"auto"
|
|
6442
|
+
"auto",
|
|
6443
|
+
"none"
|
|
6442
6444
|
]
|
|
6443
6445
|
},
|
|
6444
6446
|
"position-area": {
|
|
@@ -376,6 +376,8 @@ export namespace ProtocolMapping {
|
|
|
376
376
|
* Fired when data is received from tcp direct socket stream.
|
|
377
377
|
*/
|
|
378
378
|
'Network.directTCPSocketChunkReceived': [Protocol.Network.DirectTCPSocketChunkReceivedEvent];
|
|
379
|
+
'Network.directUDPSocketJoinedMulticastGroup': [Protocol.Network.DirectUDPSocketJoinedMulticastGroupEvent];
|
|
380
|
+
'Network.directUDPSocketLeftMulticastGroup': [Protocol.Network.DirectUDPSocketLeftMulticastGroupEvent];
|
|
379
381
|
/**
|
|
380
382
|
* Fired upon direct_socket.UDPSocket creation.
|
|
381
383
|
*/
|
|
@@ -2797,6 +2797,10 @@ declare namespace ProtocolProxyApi {
|
|
|
2797
2797
|
*/
|
|
2798
2798
|
directTCPSocketChunkReceived(params: Protocol.Network.DirectTCPSocketChunkReceivedEvent): void;
|
|
2799
2799
|
|
|
2800
|
+
directUDPSocketJoinedMulticastGroup(params: Protocol.Network.DirectUDPSocketJoinedMulticastGroupEvent): void;
|
|
2801
|
+
|
|
2802
|
+
directUDPSocketLeftMulticastGroup(params: Protocol.Network.DirectUDPSocketLeftMulticastGroupEvent): void;
|
|
2803
|
+
|
|
2800
2804
|
/**
|
|
2801
2805
|
* Fired upon direct_socket.UDPSocket creation.
|
|
2802
2806
|
*/
|
|
@@ -1187,12 +1187,13 @@ export namespace Audits {
|
|
|
1187
1187
|
FormInputWithNoLabelError = 'FormInputWithNoLabelError',
|
|
1188
1188
|
FormAutocompleteAttributeEmptyError = 'FormAutocompleteAttributeEmptyError',
|
|
1189
1189
|
FormEmptyIdAndNameAttributesForInputError = 'FormEmptyIdAndNameAttributesForInputError',
|
|
1190
|
-
|
|
1190
|
+
FormAriaLabelledByToNonExistingIdError = 'FormAriaLabelledByToNonExistingIdError',
|
|
1191
1191
|
FormInputAssignedAutocompleteValueToIdOrNameAttributeError = 'FormInputAssignedAutocompleteValueToIdOrNameAttributeError',
|
|
1192
|
-
|
|
1192
|
+
FormLabelHasNeitherForNorNestedInputError = 'FormLabelHasNeitherForNorNestedInputError',
|
|
1193
1193
|
FormLabelForMatchesNonExistingIdError = 'FormLabelForMatchesNonExistingIdError',
|
|
1194
1194
|
FormInputHasWrongButWellIntendedAutocompleteValueError = 'FormInputHasWrongButWellIntendedAutocompleteValueError',
|
|
1195
1195
|
ResponseWasBlockedByORB = 'ResponseWasBlockedByORB',
|
|
1196
|
+
NavigationEntryMarkedSkippable = 'NavigationEntryMarkedSkippable',
|
|
1196
1197
|
}
|
|
1197
1198
|
|
|
1198
1199
|
/**
|
|
@@ -3429,29 +3430,6 @@ export namespace CSS {
|
|
|
3429
3430
|
syntax: string;
|
|
3430
3431
|
}
|
|
3431
3432
|
|
|
3432
|
-
/**
|
|
3433
|
-
* CSS font-palette-values rule representation.
|
|
3434
|
-
*/
|
|
3435
|
-
export interface CSSFontPaletteValuesRule {
|
|
3436
|
-
/**
|
|
3437
|
-
* The css style sheet identifier (absent for user agent stylesheet and user-specified
|
|
3438
|
-
* stylesheet rules) this rule came from.
|
|
3439
|
-
*/
|
|
3440
|
-
styleSheetId?: StyleSheetId;
|
|
3441
|
-
/**
|
|
3442
|
-
* Parent stylesheet's origin.
|
|
3443
|
-
*/
|
|
3444
|
-
origin: StyleSheetOrigin;
|
|
3445
|
-
/**
|
|
3446
|
-
* Associated font palette name.
|
|
3447
|
-
*/
|
|
3448
|
-
fontPaletteName: Value;
|
|
3449
|
-
/**
|
|
3450
|
-
* Associated style declaration.
|
|
3451
|
-
*/
|
|
3452
|
-
style: CSSStyle;
|
|
3453
|
-
}
|
|
3454
|
-
|
|
3455
3433
|
export const enum CSSAtRuleType {
|
|
3456
3434
|
FontFace = 'font-face',
|
|
3457
3435
|
FontFeatureValues = 'font-feature-values',
|
|
@@ -3891,10 +3869,6 @@ export namespace CSS {
|
|
|
3891
3869
|
* A list of CSS property registrations matching this node.
|
|
3892
3870
|
*/
|
|
3893
3871
|
cssPropertyRegistrations?: CSSPropertyRegistration[];
|
|
3894
|
-
/**
|
|
3895
|
-
* A font-palette-values rule matching this node.
|
|
3896
|
-
*/
|
|
3897
|
-
cssFontPaletteValuesRule?: CSSFontPaletteValuesRule;
|
|
3898
3872
|
/**
|
|
3899
3873
|
* A list of simple @rules matching this node or its pseudo-elements.
|
|
3900
3874
|
*/
|
|
@@ -11139,6 +11113,12 @@ export namespace Network {
|
|
|
11139
11113
|
* Expected to be unsigned integer.
|
|
11140
11114
|
*/
|
|
11141
11115
|
receiveBufferSize?: number;
|
|
11116
|
+
multicastLoopback?: boolean;
|
|
11117
|
+
/**
|
|
11118
|
+
* Unsigned int 8.
|
|
11119
|
+
*/
|
|
11120
|
+
multicastTimeToLive?: integer;
|
|
11121
|
+
multicastAllowAddressSharing?: boolean;
|
|
11142
11122
|
}
|
|
11143
11123
|
|
|
11144
11124
|
export interface DirectUDPMessage {
|
|
@@ -12392,6 +12372,16 @@ export namespace Network {
|
|
|
12392
12372
|
timestamp: MonotonicTime;
|
|
12393
12373
|
}
|
|
12394
12374
|
|
|
12375
|
+
export interface DirectUDPSocketJoinedMulticastGroupEvent {
|
|
12376
|
+
identifier: RequestId;
|
|
12377
|
+
IPAddress: string;
|
|
12378
|
+
}
|
|
12379
|
+
|
|
12380
|
+
export interface DirectUDPSocketLeftMulticastGroupEvent {
|
|
12381
|
+
identifier: RequestId;
|
|
12382
|
+
IPAddress: string;
|
|
12383
|
+
}
|
|
12384
|
+
|
|
12395
12385
|
/**
|
|
12396
12386
|
* Fired upon direct_socket.UDPSocket creation.
|
|
12397
12387
|
*/
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
// Copyright 2024 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 Root from '../../core/root/root.js';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
type AiAgent,
|
|
10
|
+
type ContextDetail,
|
|
11
|
+
type ConversationContext,
|
|
12
|
+
type MultimodalInput,
|
|
13
|
+
type ResponseData,
|
|
14
|
+
ResponseType
|
|
15
|
+
} from './agents/AiAgent.js';
|
|
16
|
+
import {FileAgent} from './agents/FileAgent.js';
|
|
17
|
+
import {NetworkAgent} from './agents/NetworkAgent.js';
|
|
18
|
+
import {PerformanceAgent} from './agents/PerformanceAgent.js';
|
|
19
|
+
import {StylingAgent} from './agents/StylingAgent.js';
|
|
20
|
+
import {AiHistoryStorage, ConversationType, type SerializedConversation} from './AiHistoryStorage.js';
|
|
21
|
+
import type {ChangeManager} from './ChangeManager.js';
|
|
22
|
+
|
|
23
|
+
export const NOT_FOUND_IMAGE_DATA = '';
|
|
24
|
+
const MAX_TITLE_LENGTH = 80;
|
|
25
|
+
|
|
26
|
+
export function generateContextDetailsMarkdown(details: ContextDetail[]): string {
|
|
27
|
+
const detailsMarkdown: string[] = [];
|
|
28
|
+
for (const detail of details) {
|
|
29
|
+
const text = `\`\`\`\`${detail.codeLang || ''}\n${detail.text.trim()}\n\`\`\`\``;
|
|
30
|
+
detailsMarkdown.push(`**${detail.title}:**\n${text}`);
|
|
31
|
+
}
|
|
32
|
+
return detailsMarkdown.join('\n\n');
|
|
33
|
+
}
|
|
34
|
+
export class AiConversation {
|
|
35
|
+
static fromSerializedConversation(serializedConversation: SerializedConversation): AiConversation {
|
|
36
|
+
const history = serializedConversation.history.map(entry => {
|
|
37
|
+
if (entry.type === ResponseType.SIDE_EFFECT) {
|
|
38
|
+
return {...entry, confirm: () => {}};
|
|
39
|
+
}
|
|
40
|
+
return entry;
|
|
41
|
+
});
|
|
42
|
+
return new AiConversation(
|
|
43
|
+
serializedConversation.type,
|
|
44
|
+
history,
|
|
45
|
+
serializedConversation.id,
|
|
46
|
+
true,
|
|
47
|
+
undefined,
|
|
48
|
+
undefined,
|
|
49
|
+
serializedConversation.isExternal,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
readonly id: string;
|
|
54
|
+
type: ConversationType;
|
|
55
|
+
#isReadOnly: boolean;
|
|
56
|
+
readonly history: ResponseData[];
|
|
57
|
+
#isExternal: boolean;
|
|
58
|
+
|
|
59
|
+
#aidaClient: Host.AidaClient.AidaClient;
|
|
60
|
+
#changeManager: ChangeManager|undefined;
|
|
61
|
+
#agent: AiAgent<unknown>;
|
|
62
|
+
|
|
63
|
+
constructor(
|
|
64
|
+
type: ConversationType,
|
|
65
|
+
data: ResponseData[] = [],
|
|
66
|
+
id: string = crypto.randomUUID(),
|
|
67
|
+
isReadOnly = true,
|
|
68
|
+
aidaClient: Host.AidaClient.AidaClient = new Host.AidaClient.AidaClient(),
|
|
69
|
+
changeManager?: ChangeManager,
|
|
70
|
+
isExternal = false,
|
|
71
|
+
) {
|
|
72
|
+
this.#changeManager = changeManager;
|
|
73
|
+
this.#aidaClient = aidaClient;
|
|
74
|
+
this.#agent = this.#createAgent(type);
|
|
75
|
+
|
|
76
|
+
this.type = type;
|
|
77
|
+
this.id = id;
|
|
78
|
+
this.#isReadOnly = isReadOnly;
|
|
79
|
+
this.#isExternal = isExternal;
|
|
80
|
+
this.history = this.#reconstructHistory(data);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
get isReadOnly(): boolean {
|
|
84
|
+
return this.#isReadOnly;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
get title(): string|undefined {
|
|
88
|
+
const query = this.history.find(response => response.type === ResponseType.USER_QUERY)?.query;
|
|
89
|
+
|
|
90
|
+
if (!query) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (this.#isExternal) {
|
|
95
|
+
return `[External] ${query.substring(0, MAX_TITLE_LENGTH - 11)}${
|
|
96
|
+
query.length > MAX_TITLE_LENGTH - 11 ? '…' : ''}`;
|
|
97
|
+
}
|
|
98
|
+
return `${query.substring(0, MAX_TITLE_LENGTH)}${query.length > MAX_TITLE_LENGTH ? '…' : ''}`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
get isEmpty(): boolean {
|
|
102
|
+
return this.history.length === 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
#reconstructHistory(historyWithoutImages: ResponseData[]): ResponseData[] {
|
|
106
|
+
const imageHistory = AiHistoryStorage.instance().getImageHistory();
|
|
107
|
+
if (imageHistory && imageHistory.length > 0) {
|
|
108
|
+
const history: ResponseData[] = [];
|
|
109
|
+
for (const data of historyWithoutImages) {
|
|
110
|
+
if (data.type === ResponseType.USER_QUERY && data.imageId) {
|
|
111
|
+
const image = imageHistory.find(item => item.id === data.imageId);
|
|
112
|
+
const inlineData = image ? {data: image.data, mimeType: image.mimeType} :
|
|
113
|
+
{data: NOT_FOUND_IMAGE_DATA, mimeType: 'image/jpeg'};
|
|
114
|
+
history.push({...data, imageInput: {inlineData}});
|
|
115
|
+
} else {
|
|
116
|
+
history.push(data);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return history;
|
|
120
|
+
}
|
|
121
|
+
return historyWithoutImages;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
getConversationMarkdown(): string {
|
|
125
|
+
const contentParts: string[] = [];
|
|
126
|
+
contentParts.push(
|
|
127
|
+
'# Exported Chat from Chrome DevTools AI Assistance\n\n' +
|
|
128
|
+
`**Export Timestamp (UTC):** ${new Date().toISOString()}\n\n` +
|
|
129
|
+
'---',
|
|
130
|
+
);
|
|
131
|
+
for (const item of this.history) {
|
|
132
|
+
switch (item.type) {
|
|
133
|
+
case ResponseType.USER_QUERY: {
|
|
134
|
+
contentParts.push(`## User\n\n${item.query}`);
|
|
135
|
+
if (item.imageInput) {
|
|
136
|
+
contentParts.push('User attached an image');
|
|
137
|
+
}
|
|
138
|
+
contentParts.push('## AI');
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
case ResponseType.CONTEXT: {
|
|
142
|
+
contentParts.push(`### ${item.title}`);
|
|
143
|
+
if (item.details && item.details.length > 0) {
|
|
144
|
+
contentParts.push(generateContextDetailsMarkdown(item.details));
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
case ResponseType.TITLE: {
|
|
149
|
+
contentParts.push(`### ${item.title}`);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
case ResponseType.THOUGHT: {
|
|
153
|
+
contentParts.push(`${item.thought}`);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case ResponseType.ACTION: {
|
|
157
|
+
// We want to export only actions with output field
|
|
158
|
+
if (!item.output) {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
if (item.code) {
|
|
162
|
+
contentParts.push(`**Code executed:**\n\`\`\`\n${item.code.trim()}\n\`\`\``);
|
|
163
|
+
}
|
|
164
|
+
contentParts.push(`**Data returned:**\n\`\`\`\n${item.output}\n\`\`\``);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
case ResponseType.ANSWER: {
|
|
168
|
+
if (item.complete) {
|
|
169
|
+
contentParts.push(`### Answer\n\n${item.text.trim()}`);
|
|
170
|
+
}
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return contentParts.join('\n\n');
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
archiveConversation(): void {
|
|
179
|
+
this.#isReadOnly = true;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async addHistoryItem(item: ResponseData): Promise<void> {
|
|
183
|
+
this.history.push(item);
|
|
184
|
+
await AiHistoryStorage.instance().upsertHistoryEntry(this.serialize());
|
|
185
|
+
if (item.type === ResponseType.USER_QUERY) {
|
|
186
|
+
if (item.imageId && item.imageInput && 'inlineData' in item.imageInput) {
|
|
187
|
+
const inlineData = item.imageInput.inlineData;
|
|
188
|
+
await AiHistoryStorage.instance().upsertImage({
|
|
189
|
+
id: item.imageId,
|
|
190
|
+
data: inlineData.data,
|
|
191
|
+
mimeType: inlineData.mimeType,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
serialize(): SerializedConversation {
|
|
198
|
+
return {
|
|
199
|
+
id: this.id,
|
|
200
|
+
history: this.history.map(item => {
|
|
201
|
+
if (item.type === ResponseType.USER_QUERY) {
|
|
202
|
+
return {...item, imageInput: undefined};
|
|
203
|
+
}
|
|
204
|
+
// Remove the `confirm()`-function because `structuredClone()` throws on functions
|
|
205
|
+
if (item.type === ResponseType.SIDE_EFFECT) {
|
|
206
|
+
return {...item, confirm: undefined};
|
|
207
|
+
}
|
|
208
|
+
return item;
|
|
209
|
+
}),
|
|
210
|
+
type: this.type,
|
|
211
|
+
isExternal: this.#isExternal,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
#createAgent(conversationType: ConversationType): AiAgent<unknown> {
|
|
216
|
+
const options = {
|
|
217
|
+
aidaClient: this.#aidaClient,
|
|
218
|
+
serverSideLoggingEnabled: isAiAssistanceServerSideLoggingEnabled(),
|
|
219
|
+
changeManager: this.#changeManager,
|
|
220
|
+
};
|
|
221
|
+
let agent: AiAgent<unknown>;
|
|
222
|
+
switch (conversationType) {
|
|
223
|
+
case ConversationType.STYLING: {
|
|
224
|
+
agent = new StylingAgent(options);
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
case ConversationType.NETWORK: {
|
|
228
|
+
agent = new NetworkAgent(options);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
case ConversationType.FILE: {
|
|
232
|
+
agent = new FileAgent(options);
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
case ConversationType.PERFORMANCE: {
|
|
236
|
+
agent = new PerformanceAgent(options);
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return agent;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
async *
|
|
244
|
+
run(
|
|
245
|
+
initialQuery: string,
|
|
246
|
+
options: {
|
|
247
|
+
selected: ConversationContext<unknown>|null,
|
|
248
|
+
signal?: AbortSignal,
|
|
249
|
+
},
|
|
250
|
+
multimodalInput?: MultimodalInput,
|
|
251
|
+
): AsyncGenerator<ResponseData, void, void> {
|
|
252
|
+
for await (const data of this.#agent.run(initialQuery, options, multimodalInput)) {
|
|
253
|
+
// We don't want to save partial responses to the conversation history.
|
|
254
|
+
if (data.type !== ResponseType.ANSWER || data.complete) {
|
|
255
|
+
void this.addHistoryItem(data);
|
|
256
|
+
}
|
|
257
|
+
yield data;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
get origin(): string|undefined {
|
|
262
|
+
return this.#agent.origin;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function isAiAssistanceServerSideLoggingEnabled(): boolean {
|
|
267
|
+
return !Root.Runtime.hostConfig.aidaAvailability?.disallowLogging;
|
|
268
|
+
}
|