chrome-devtools-frontend 1.0.1706026 → 1.0.1709383
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/code-review/SKILL.md +121 -0
- package/AUTHORS +2 -0
- package/front_end/core/common/Color.ts +6 -0
- package/front_end/core/common/VersionController.ts +0 -53
- package/front_end/core/root/Runtime.ts +0 -41
- package/front_end/core/sdk/CSSModel.ts +57 -0
- package/front_end/core/sdk/CSSPropertyParser.ts +10 -17
- package/front_end/core/sdk/DOMModel.ts +13 -6
- package/front_end/core/sdk/DebuggerModel.ts +90 -56
- package/front_end/core/sdk/NetworkRequest.ts +70 -12
- package/front_end/core/sdk/OverlayModel.ts +47 -0
- package/front_end/core/sdk/PageResourceLoader.ts +26 -6
- package/front_end/core/sdk/SourceMap.ts +37 -9
- package/front_end/core/sdk/SourceMapScopesInfo.ts +223 -86
- package/front_end/core/text_utils/ContentData.ts +18 -1
- package/front_end/core/text_utils/TextUtils.ts +1 -1
- package/front_end/entrypoints/devtools_app/devtools_app.ts +1 -0
- package/front_end/entrypoints/heap_snapshot_worker/ContextAnalyzer.ts +102 -4
- package/front_end/entrypoints/main/MainImpl.ts +2 -21
- package/front_end/generated/InspectorBackendCommands.ts +9 -2
- package/front_end/generated/SupportedCSSProperties.ts +12 -3
- package/front_end/generated/protocol-mapping.d.ts +31 -0
- package/front_end/generated/protocol-proxy-api.d.ts +32 -0
- package/front_end/generated/protocol.ts +19 -3
- package/front_end/models/ai_assistance/AiAgent2.ts +127 -2
- package/front_end/models/ai_assistance/AiConversation.ts +2 -2
- package/front_end/models/ai_assistance/AiUtils.ts +4 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +64 -13
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +4 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +257 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -2
- package/front_end/models/ai_assistance/contexts/{AccessibilityContext.snapshot.txt → LighthouseContext.snapshot.txt} +23 -2
- package/front_end/models/ai_assistance/contexts/{AccessibilityContext.ts → LighthouseContext.ts} +24 -5
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +26 -3
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +15 -16
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +8 -18
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +2 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +81 -103
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +202 -15
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -2
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/lighthouse.md +33 -0
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +6 -0
- package/front_end/models/ai_assistance/tools/GetCookieValues.ts +3 -0
- package/front_end/models/ai_assistance/tools/GetDetailedCallTree.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetInsightDetails.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +8 -7
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetStorageBreakdown.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetStorageValues.ts +3 -0
- package/front_end/models/ai_assistance/tools/GetStyles.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +3 -1
- package/front_end/models/ai_assistance/tools/GetTraceFunctionCode.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +2 -0
- package/front_end/models/ai_assistance/tools/GetTraceResourceContent.ts +2 -0
- package/front_end/models/ai_assistance/tools/ListCookies.ts +2 -0
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +2 -0
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +2 -0
- package/front_end/models/ai_assistance/tools/ListSources.ts +2 -0
- package/front_end/models/ai_assistance/tools/ListStorageKeys.ts +2 -0
- package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +2 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +2 -0
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +20 -12
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +2 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +53 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +102 -45
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +25 -33
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +70 -49
- package/front_end/models/bindings/SourceMapStepping.ts +50 -0
- package/front_end/models/bindings/StylesSourceMapping.ts +3 -0
- package/front_end/models/bindings/bindings.ts +2 -0
- package/front_end/models/emulation/DeviceModeModel.ts +85 -62
- package/front_end/models/extensions/ExtensionEndpoint.ts +27 -6
- package/front_end/models/extensions/LanguageExtensionEndpoint.ts +106 -21
- package/front_end/models/extensions/RecorderExtensionEndpoint.ts +4 -2
- package/front_end/models/har/Importer.ts +2 -3
- package/front_end/models/javascript_metadata/NativeFunctions.ts +6 -2
- package/front_end/models/lighthouse/LighthouseReporterTypes.ts +5 -1
- package/front_end/models/persistence/NetworkPersistenceManager.ts +4 -3
- package/front_end/models/source_map_scopes/NamesResolver.ts +30 -13
- package/front_end/models/stack_trace/StackTraceImpl.ts +138 -47
- package/front_end/models/stack_trace/StackTraceModel.ts +117 -84
- package/front_end/models/stack_trace/Trie.ts +27 -0
- package/front_end/models/trace/LanternComputationData.ts +8 -0
- package/front_end/models/trace/Processor.ts +2 -1
- package/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +7 -2
- package/front_end/models/trace/lantern/graph/NetworkNode.ts +14 -0
- package/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +1 -1
- package/front_end/models/trace/lantern/simulation/ConnectionPool.ts +4 -4
- package/front_end/models/trace/lantern/simulation/Simulator.ts +6 -2
- package/front_end/models/trace/lantern/simulation/TCPConnection.ts +12 -12
- package/front_end/models/trace/lantern/types/Lantern.ts +8 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +6 -6
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +2 -2
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +6 -9
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +83 -69
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +24 -9
- package/front_end/panels/accessibility/SourceOrderView.ts +7 -3
- package/front_end/panels/accessibility/accessibilitySidebarView.css +5 -3
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +14 -12
- package/front_end/panels/ai_assistance/components/ChatInput.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +121 -13
- package/front_end/panels/ai_assistance/components/chatMessage.css +47 -0
- package/front_end/panels/application/BackgroundServiceView.ts +31 -33
- package/front_end/panels/application/IndexedDBModel.ts +8 -20
- package/front_end/panels/application/IndexedDBViews.ts +2 -6
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +8 -8
- package/front_end/panels/application/ServiceWorkersView.ts +44 -52
- package/front_end/panels/application/WebMCPView.ts +50 -50
- package/front_end/panels/application/serviceWorkersView.css +1 -1
- package/front_end/panels/comments/CommentsPane.ts +266 -0
- package/front_end/panels/comments/comments-meta.ts +47 -0
- package/front_end/panels/comments/comments.ts +9 -0
- package/front_end/panels/comments/commentsPane.css +206 -0
- package/front_end/panels/common/CommentThreadWidget.ts +30 -1
- package/front_end/panels/common/CommentsOverlayWidget.ts +42 -38
- package/front_end/panels/common/CommentsStatusBarPill.ts +3 -1
- package/front_end/panels/common/common-meta.ts +21 -9
- package/front_end/panels/console/ConsoleInsightTeaser.ts +25 -19
- package/front_end/panels/console/ConsoleViewMessage.ts +52 -23
- package/front_end/panels/console/ConsoleViewport.ts +1 -1
- package/front_end/panels/console/SymbolizedErrorWidget.ts +18 -9
- package/front_end/panels/console/console-meta.ts +1 -5
- package/front_end/panels/elements/CSSValueTraceView.ts +4 -4
- package/front_end/panels/elements/ComputedStyleWidget.ts +46 -42
- package/front_end/panels/elements/DOMPath.ts +11 -1
- package/front_end/panels/elements/DOMTreeContextMenu.ts +15 -0
- package/front_end/panels/elements/DOMTreeWidget.ts +237 -606
- package/front_end/panels/elements/ElementsPanel.ts +15 -16
- package/front_end/panels/elements/ElementsTreeElement.ts +24 -18
- package/front_end/panels/elements/EventListenersWidget.ts +5 -3
- package/front_end/panels/elements/InspectElementModeController.ts +6 -3
- package/front_end/panels/elements/LayoutPane.ts +3 -3
- package/front_end/panels/elements/PropertyRenderer.ts +132 -87
- package/front_end/panels/elements/StandaloneStylesContainer.ts +7 -3
- package/front_end/panels/elements/StylePropertiesSection.ts +49 -4
- package/front_end/panels/elements/StylePropertyTreeElement.ts +139 -36
- package/front_end/panels/elements/StylesContainer.ts +2 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +75 -16
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +2 -1
- package/front_end/panels/elements/elements-meta.ts +24 -75
- package/front_end/panels/emulation/DeviceModeToolbar.ts +5 -2
- package/front_end/panels/emulation/DeviceModeView.ts +5 -2
- package/front_end/panels/emulation/emulation-meta.ts +3 -8
- package/front_end/panels/layer_viewer/Layers3DView.ts +8 -3
- package/front_end/panels/layer_viewer/layer_viewer-meta.ts +2 -5
- package/front_end/panels/lighthouse/LighthouseController.ts +9 -4
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +13 -3
- package/front_end/panels/network/NetworkConfigView.ts +261 -190
- package/front_end/panels/network/NetworkLogView.ts +7 -5
- package/front_end/panels/network/NetworkPanel.ts +4 -3
- package/front_end/panels/network/NetworkWaterfallColumn.ts +7 -4
- package/front_end/panels/network/RequestPayloadView.ts +22 -14
- package/front_end/panels/network/network-meta.ts +23 -34
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +0 -1
- package/front_end/panels/profiler/HeapProfileView.ts +20 -24
- package/front_end/panels/profiler/ProfilesPanel.ts +8 -3
- package/front_end/panels/recorder/RecordingView.ts +42 -47
- package/front_end/panels/recorder/StepEditor.ts +1 -0
- package/front_end/panels/recorder/recordingView.css +4 -4
- package/front_end/panels/screencast/ScreencastView.ts +6 -4
- package/front_end/panels/sources/CSSPlugin.ts +11 -0
- package/front_end/panels/sources/CoveragePlugin.ts +34 -23
- package/front_end/panels/sources/NavigatorView.ts +97 -52
- package/front_end/panels/sources/Plugin.ts +15 -1
- package/front_end/panels/sources/SourcesView.ts +47 -80
- package/front_end/panels/sources/TabbedEditorContainer.ts +63 -34
- package/front_end/panels/sources/UISourceCodeFrame.ts +11 -2
- package/front_end/panels/sources/navigatorTree.css +2 -2
- package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -4
- package/front_end/panels/timeline/components/LiveMetricsView.ts +7 -20
- package/front_end/panels/timeline/components/MetricCard.ts +262 -315
- package/front_end/panels/timeline/components/liveMetricsView.css +4 -0
- package/front_end/panels/timeline/components/metricCard.css +2 -24
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +33 -17
- package/front_end/panels/timeline/overlays/components/TimeRangeOverlay.ts +182 -130
- package/front_end/panels/timeline/overlays/components/timeRangeOverlay.css +76 -74
- package/front_end/panels/whats_new/WhatsNewImpl.ts +2 -1
- package/front_end/panels/whats_new/whats_new-meta.ts +2 -5
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/web-vitals/README.chromium +2 -2
- package/front_end/third_party/web-vitals/package/README.md +5 -3
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +8 -5
- package/front_end/third_party/web-vitals/package/package.json +1 -1
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +9 -5
- package/front_end/third_party/web-vitals/rebuild.sh +2 -2
- package/front_end/ui/comments/CommentAnchorResolver.ts +17 -0
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +10 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +2 -2
- package/front_end/ui/components/text_editor/aiCodeCompletionTeaser.css +0 -11
- package/front_end/ui/components/text_editor/aiCodeGenerationTeaser.css +0 -11
- package/front_end/ui/components/text_editor/config.ts +2 -1
- package/front_end/ui/legacy/SoftDropDown.ts +17 -4
- package/front_end/ui/legacy/StackPane.ts +141 -0
- package/front_end/ui/legacy/TabbedPane.ts +67 -12
- package/front_end/ui/legacy/TextPrompt.ts +37 -7
- package/front_end/ui/legacy/Toolbar.ts +36 -14
- package/front_end/ui/legacy/Widget.ts +3 -3
- package/front_end/ui/legacy/components/inline_editor/PositionAreaEditor.ts +85 -0
- package/front_end/ui/legacy/components/inline_editor/positionAreaEditor.css +61 -0
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +93 -31
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +15 -7
- package/front_end/ui/legacy/components/utils/Linkifier.ts +25 -45
- package/front_end/ui/legacy/inspectorCommon.css +11 -0
- package/front_end/ui/legacy/legacy.ts +2 -0
- package/front_end/ui/legacy/softContextMenu.css +2 -0
- package/front_end/ui/legacy/tabbedPane.css +12 -8
- package/front_end/ui/settings/ConsoleSettings.ts +7 -0
- package/front_end/ui/settings/ElementsSettings.ts +93 -0
- package/front_end/ui/settings/EmulationSettings.ts +17 -0
- package/front_end/ui/settings/LayerViewerSettings.ts +12 -0
- package/front_end/ui/settings/NetworkSettings.ts +26 -0
- package/front_end/ui/settings/WhatsNewSettings.ts +11 -0
- package/front_end/ui/settings/settings.ts +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +17 -0
- package/inspector_overlay/highlight_anchor.ts +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,12 @@ import type * as Trace from '../../trace/trace.js';
|
|
|
13
13
|
import type * as Workspace from '../../workspace/workspace.js';
|
|
14
14
|
import {debugLog, isStructuredLogEnabled} from '../debug.js';
|
|
15
15
|
import {dispatchAiAssistanceDoneEvent} from '../DOMHelpers.js';
|
|
16
|
-
import
|
|
16
|
+
import {
|
|
17
|
+
type ContextHandlerResult,
|
|
18
|
+
type DataHandlerResult,
|
|
19
|
+
PermissionDecision,
|
|
20
|
+
type PermissionPrompt,
|
|
21
|
+
} from '../tools/Tool.js';
|
|
17
22
|
|
|
18
23
|
type UrlString = Platform.DevToolsPath.UrlString;
|
|
19
24
|
const MAX_SUGGESTION_LENGTH = 200;
|
|
@@ -100,7 +105,9 @@ export interface SideEffectResponse {
|
|
|
100
105
|
type: ResponseType.SIDE_EFFECT;
|
|
101
106
|
description: string|null;
|
|
102
107
|
code?: string;
|
|
103
|
-
confirm: (
|
|
108
|
+
confirm: (decision: PermissionDecision) => void;
|
|
109
|
+
permissionPrompt?: PermissionPrompt;
|
|
110
|
+
permissionTitle?: string;
|
|
104
111
|
}
|
|
105
112
|
export interface ContextChangeResponse {
|
|
106
113
|
type: ResponseType.CONTEXT_CHANGE;
|
|
@@ -476,6 +483,15 @@ export interface FunctionDeclaration<Args extends Record<string, unknown>, Retur
|
|
|
476
483
|
) => {
|
|
477
484
|
title?: string, thought?: string, action?: string, suggestions?: [string, ...string[]],
|
|
478
485
|
};
|
|
486
|
+
/**
|
|
487
|
+
* Choices the permission prompt offers when the handler returns
|
|
488
|
+
* `requiresApproval`. Behaves as `ALLOW_ONCE` when unset.
|
|
489
|
+
*/
|
|
490
|
+
permissionPrompt?: PermissionPrompt;
|
|
491
|
+
/**
|
|
492
|
+
* Title of the permission prompt, e.g. "Allow reading cookie values?".
|
|
493
|
+
*/
|
|
494
|
+
permissionTitle?: string;
|
|
479
495
|
/**
|
|
480
496
|
* Function implementation that the LLM will try to execute,
|
|
481
497
|
*/
|
|
@@ -755,6 +771,21 @@ export abstract class AiAgent<T> {
|
|
|
755
771
|
return this.parseTextResponseForSuggestions(response.trim());
|
|
756
772
|
}
|
|
757
773
|
|
|
774
|
+
/**
|
|
775
|
+
* Parses the text of a response that is still streaming. Only the `answer`
|
|
776
|
+
* of the result is shown, as a partial answer. By default, partial answers
|
|
777
|
+
* use the same parsing as completed answers.
|
|
778
|
+
*
|
|
779
|
+
* This hook exists so that `AiAgent2` (AI V2) can parse follow-up
|
|
780
|
+
* suggestions differently without changing the V1 agents. Remove it once
|
|
781
|
+
* AI V2 ships and the V1 agents are removed. b/568697679 explores getting
|
|
782
|
+
* suggestions from a function call instead of parsing them from text,
|
|
783
|
+
* which would remove the need for this parsing.
|
|
784
|
+
*/
|
|
785
|
+
protected parsePartialTextResponse(response: string): ParsedResponse {
|
|
786
|
+
return this.parseTextResponse(response);
|
|
787
|
+
}
|
|
788
|
+
|
|
758
789
|
protected async finalizeAnswer(answer: AnswerResponse): Promise<AnswerResponse> {
|
|
759
790
|
return answer;
|
|
760
791
|
}
|
|
@@ -846,7 +877,7 @@ export abstract class AiAgent<T> {
|
|
|
846
877
|
functionCall = fetchResult.functionCall;
|
|
847
878
|
|
|
848
879
|
if (!functionCall && !fetchResult.completed) {
|
|
849
|
-
const parsed = this.
|
|
880
|
+
const parsed = this.parsePartialTextResponse(textResponse);
|
|
850
881
|
const partialAnswer = 'answer' in parsed ? parsed.answer : '';
|
|
851
882
|
if (!partialAnswer) {
|
|
852
883
|
continue;
|
|
@@ -923,6 +954,18 @@ export abstract class AiAgent<T> {
|
|
|
923
954
|
}
|
|
924
955
|
|
|
925
956
|
if ('context' in result) {
|
|
957
|
+
// Pair the functionCall with a functionResponse so history stays valid
|
|
958
|
+
// if this agent instance is re-run after the context change (AiAgent2).
|
|
959
|
+
// The new context reaches the model through the next USER query.
|
|
960
|
+
this.#history.push({
|
|
961
|
+
parts: [{
|
|
962
|
+
functionResponse: {
|
|
963
|
+
name: functionCall.name,
|
|
964
|
+
response: {result: result.description},
|
|
965
|
+
},
|
|
966
|
+
}],
|
|
967
|
+
role: Host.AidaClient.Role.ROLE_UNSPECIFIED,
|
|
968
|
+
});
|
|
926
969
|
yield {
|
|
927
970
|
type: ResponseType.CONTEXT_CHANGE,
|
|
928
971
|
description: result.description,
|
|
@@ -1037,21 +1080,21 @@ export abstract class AiAgent<T> {
|
|
|
1037
1080
|
};
|
|
1038
1081
|
}
|
|
1039
1082
|
|
|
1040
|
-
const sideEffectConfirmationPromiseWithResolvers = this.confirmSideEffect<
|
|
1083
|
+
const sideEffectConfirmationPromiseWithResolvers = this.confirmSideEffect<PermissionDecision>();
|
|
1041
1084
|
|
|
1042
|
-
void sideEffectConfirmationPromiseWithResolvers.promise.then(
|
|
1085
|
+
void sideEffectConfirmationPromiseWithResolvers.promise.then(decision => {
|
|
1043
1086
|
Host.userMetrics.actionTaken(
|
|
1044
|
-
|
|
1045
|
-
|
|
1087
|
+
decision === PermissionDecision.REJECT ? Host.UserMetrics.Action.AiAssistanceSideEffectRejected :
|
|
1088
|
+
Host.UserMetrics.Action.AiAssistanceSideEffectConfirmed,
|
|
1046
1089
|
);
|
|
1047
1090
|
});
|
|
1048
1091
|
|
|
1049
1092
|
if (options?.signal?.aborted) {
|
|
1050
|
-
sideEffectConfirmationPromiseWithResolvers.resolve(
|
|
1093
|
+
sideEffectConfirmationPromiseWithResolvers.resolve(PermissionDecision.REJECT);
|
|
1051
1094
|
}
|
|
1052
1095
|
|
|
1053
1096
|
const onAbort = (): void => {
|
|
1054
|
-
sideEffectConfirmationPromiseWithResolvers.resolve(
|
|
1097
|
+
sideEffectConfirmationPromiseWithResolvers.resolve(PermissionDecision.REJECT);
|
|
1055
1098
|
};
|
|
1056
1099
|
|
|
1057
1100
|
options?.signal?.addEventListener('abort', onAbort, {once: true});
|
|
@@ -1060,15 +1103,17 @@ export abstract class AiAgent<T> {
|
|
|
1060
1103
|
type: ResponseType.SIDE_EFFECT,
|
|
1061
1104
|
confirm: sideEffectConfirmationPromiseWithResolvers.resolve,
|
|
1062
1105
|
description: result.description,
|
|
1106
|
+
permissionPrompt: call.permissionPrompt,
|
|
1107
|
+
permissionTitle: call.permissionTitle,
|
|
1063
1108
|
};
|
|
1064
1109
|
|
|
1065
|
-
let
|
|
1110
|
+
let decision = PermissionDecision.REJECT;
|
|
1066
1111
|
try {
|
|
1067
|
-
|
|
1112
|
+
decision = await sideEffectConfirmationPromiseWithResolvers.promise;
|
|
1068
1113
|
} finally {
|
|
1069
1114
|
options?.signal?.removeEventListener('abort', onAbort);
|
|
1070
1115
|
}
|
|
1071
|
-
if (
|
|
1116
|
+
if (decision === PermissionDecision.REJECT) {
|
|
1072
1117
|
yield {
|
|
1073
1118
|
type: ResponseType.ACTION,
|
|
1074
1119
|
code,
|
|
@@ -1193,7 +1238,13 @@ export abstract class AiAgent<T> {
|
|
|
1193
1238
|
}
|
|
1194
1239
|
}
|
|
1195
1240
|
|
|
1196
|
-
|
|
1241
|
+
/**
|
|
1242
|
+
* Parses `suggestions` as a JSON array and returns its non-empty string items,
|
|
1243
|
+
* with whitespace collapsed and each item truncated to `MAX_SUGGESTION_LENGTH`.
|
|
1244
|
+
* Returns `undefined` if the value is not an array or no items remain.
|
|
1245
|
+
* Throws if `suggestions` is not valid JSON.
|
|
1246
|
+
*/
|
|
1247
|
+
export function sanitizeSuggestions(suggestions: string): [string, ...string[]]|undefined {
|
|
1197
1248
|
const parsed = JSON.parse(suggestions);
|
|
1198
1249
|
if (!Array.isArray(parsed)) {
|
|
1199
1250
|
return undefined;
|
|
@@ -11,9 +11,9 @@ import * as Logs from '../../logs/logs.js';
|
|
|
11
11
|
import * as NetworkTimeCalculator from '../../network_time_calculator/network_time_calculator.js';
|
|
12
12
|
import type * as Trace from '../../trace/trace.js';
|
|
13
13
|
import * as Workspace from '../../workspace/workspace.js';
|
|
14
|
-
import {AccessibilityContext} from '../contexts/AccessibilityContext.js';
|
|
15
14
|
import {DOMNodeContext} from '../contexts/DOMNodeContext.js';
|
|
16
15
|
import {FileContext} from '../contexts/FileContext.js';
|
|
16
|
+
import {LighthouseContext} from '../contexts/LighthouseContext.js';
|
|
17
17
|
import {PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
18
18
|
import {RequestContext} from '../contexts/RequestContext.js';
|
|
19
19
|
import {StorageContext} from '../contexts/StorageContext.js';
|
|
@@ -444,7 +444,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
return {
|
|
447
|
-
context: new
|
|
447
|
+
context: new LighthouseContext(result),
|
|
448
448
|
description: 'User has selected a Lighthouse report',
|
|
449
449
|
widgets: [{name: 'LIGHTHOUSE_REPORT', data: {report: result}}],
|
|
450
450
|
};
|
|
@@ -8,6 +8,7 @@ import * as Platform from '../../../core/platform/platform.js';
|
|
|
8
8
|
import * as Root from '../../../core/root/root.js';
|
|
9
9
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
10
10
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
11
|
+
import {isNaturalLanguageInterfaceEnabled} from '../AiUtils.js';
|
|
11
12
|
import type {ChangeManager} from '../ChangeManager.js';
|
|
12
13
|
import {EvaluateAction, formatError, SideEffectError} from '../EvaluateAction.js';
|
|
13
14
|
import {FREESTYLER_WORLD_CSP, FREESTYLER_WORLD_NAME} from '../injected.js';
|
|
@@ -162,7 +163,9 @@ export class JavascriptExecutor {
|
|
|
162
163
|
|
|
163
164
|
return {
|
|
164
165
|
requiresApproval: true,
|
|
165
|
-
description:
|
|
166
|
+
description: isNaturalLanguageInterfaceEnabled() ?
|
|
167
|
+
lockedString('AI assistance wants to execute JavaScript code. This code may modify page content.') :
|
|
168
|
+
lockedString('This code may modify page content. Continue?'),
|
|
166
169
|
};
|
|
167
170
|
}
|
|
168
171
|
if (result.canceled) {
|
|
@@ -6,7 +6,183 @@ Content:
|
|
|
6
6
|
"details": [
|
|
7
7
|
{
|
|
8
8
|
"title": "Trace details",
|
|
9
|
-
"text": "Trace summary:\nURL: https://web.dev/\nTrace bounds: {min: 465455241690µs, max: 465460435979µs}\nCPU throttling: 1x\nNetwork throttling: No throttling\n\n# Available insight sets\n\nThe following is a list of insight sets. An insight set covers a specific part of the trace, split by navigations. The insights within each insight set are specific to that part of the trace. Be sure to consider the insight set id and bounds when calling functions. If no specific insight set or navigation is mentioned, assume the user is referring to the first one.\n\n## insight set id: NO_NAVIGATION\n\nURL: https://web.dev/\nBounds: {min: 465455241690µs, max: 465456489729µs}\nMetrics (lab / observed):\n - CLS: 0.00\nMetrics (field / real users): n/a – no data for this page in CrUX\nAvailable insights:\n - insight name: ThirdParties\n description: 3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page’s content.\n relevant trace bounds: {min: 465456492168µs, max: 465460052616µs}\n example question: Which third parties are having the largest impact on my page performance?\n\n## insight set id: NAVIGATION_1\n\nURL: https://web.dev/\nBounds: {min: 465456489730µs, max: 465460435979µs}\nMetrics (lab / observed):\n - LCP: 676 ms, event: (eventKey: r-21246, ts: 465457166052), nodeId: 1680\n - LCP breakdown:\n - TTFB: 553 ms, bounds: {min: 465456489730µs, max: 465457042737µs}\n - Render delay: 123 ms, bounds: {min: 465457042737µs, max: 465457166052µs}\n - CLS: 0.02, event: (eventKey: s-14250, ts: 465457121239)\nMetrics (field / real users): n/a – no data for this page in CrUX\nAvailable insights:\n - insight name: RenderBlocking\n description: Requests are blocking the page’s initial render, which may delay LCP. [Deferring or inlining](https://developer.chrome.com/docs/performance/insights/render-blocking) can move these network requests out of the critical path.\n relevant trace bounds: {min: 465457046567µs, max: 465457086893µs}\n estimated metric savings: FCP 118 ms, LCP 118 ms\n example question: Show me the most impactful render-blocking requests that I should focus on\n example question: How can I reduce the number of render-blocking requests?\n - insight name: LCPBreakdown\n description: Each [subpart has specific improvement strategies](https://developer.chrome.com/docs/performance/insights/lcp-breakdown). Ideally, most of the LCP time should be spent on loading the resources, not within delays.\n relevant trace bounds: {min: 465456489730µs, max: 465457166052µs}\n example question: Help me optimize my LCP score\n example question: Which LCP subpart was most problematic?\n example question: What can I do to reduce the LCP time for this page load?\n - insight name: CLSCulprits\n description: Layout shifts occur when elements move absent any user interaction. [Investigate the causes of layout shifts](https://developer.chrome.com/docs/performance/insights/cls-culprit), such as elements being added, removed, or their fonts changing as the page loads.\n relevant trace bounds: {min: 465457121239µs, max: 465459012394µs}\n example question: Help me optimize my CLS score\n example question: How can I prevent layout shifts on this page?\n - insight name: NetworkDependencyTree\n description: [Avoid chaining critical requests](https://developer.chrome.com/docs/performance/insights/network-dependency-tree) by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load\n relevant trace bounds: {min: 465456490723µs, max: 465458472724µs}\n example question: How do I optimize my network dependency tree?\n - insight name: DOMSize\n description: A large DOM can increase the duration of style calculations and layout reflows, impacting page responsiveness. A large DOM will also increase memory usage. [Learn how to avoid an excessive DOM size](https://developer.chrome.com/docs/performance/insights/dom-size).\n relevant trace bounds: {min: 465458287196µs, max: 465458340745µs}\n example question: How can I reduce the size of my DOM?\n - insight name: ThirdParties\n description: 3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page’s content.\n relevant trace bounds: {min: 465456492168µs, max: 465460052616µs}\n example question: Which third parties are having the largest impact on my page performance?\n - insight name: ForcedReflow\n description: A forced reflow occurs when JavaScript queries geometric properties (such as offsetWidth) after styles have been invalidated by a change to the DOM state. This can result in poor performance. Learn more about [forced reflows](https://developer.chrome.com/docs/performance/insights/forced-reflow) and possible mitigations.\n relevant trace bounds: {min: 465456489730µs, max: 465460435979µs}\n example question: How can I avoid forced reflows and layout thrashing?\n example question: What is forced reflow and why is it problematic?\n - insight name: Cache\n description: A long cache lifetime can speed up repeat visits to your page. [Learn more about caching](https://developer.chrome.com/docs/performance/insights/cache).\n relevant trace bounds: {min: 465457179567µs, max: 465459110674µs}\n estimated metric savings: FCP 0 ms, LCP 0 ms\n estimated wasted bytes: 16 kB\n example question: What caching strategies can I apply to improve my page performance?\n# Critical network requests\n\n## insight set id: NO_NAVIGATION\n\nnone\n\n## insight set id: NAVIGATION_1\n\n\nNetwork requests data:\n\n\n\nallUrls = [0: https://web.dev/, 1: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2, 2: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2, 3: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2, 4: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2, 5: https://fonts.gstatic.com/s/materialicons/v142/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2, 6: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2, 7: https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2, 8: https://web.dev/_pwa/web/manifest.json, 9: https://fonts.googleapis.com/css?family=Google+Sans:400,500|Roboto:400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700&display=swap, 10: https://fonts.gstatic.com/s/googlesans/v59/4UasrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iqcsih3SAyH6cAwhX9RPjIUvbQoi-E.woff2, 11: https://fonts.googleapis.com/css2?family=Material+Icons&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block, 12: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/web/css/app.css, 13: https://web.dev/extras.css]\n\n0;s-7302;1 ms;2 ms;568 ms;569 ms;568 ms;15 ms;0.5 ms;200;text/html;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-security-policy: base-uri 'self'; object-src 'none'; script-src 'strict-dynamic' 'unsafe-inline' https: http: 'nonce-pLl1WHuNABXXiQLLmUesvDyvzBJZdE' 'unsafe-eval'; report-uri https://csp.withgoogle.com/csp/devsite/v2|content-encoding: gzip|x-content-type-options: nosniff|date: Mon, 29 Apr 2024 11:01:15 GMT|strict-transport-security: max-age=63072000; includeSubdomains; preload|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|pragma: no-cache|last-modified: Fri, 26 Apr 2024 16:43:17 GMT|server: Google Frontend|vary: Cookie, Accept-Encoding|x-frame-options: SAMEORIGIN|content-type: text/html; charset=utf-8|x-cloud-trace-context: <redacted>|cache-control: no-cache, must-revalidate|expires: 0]\n1;s-49309;1,395 ms;1,402 ms;1,415 ms;1,423 ms;28 ms;94 μs;9 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Wed, 24 Apr 2024 15:02:33 GMT|x-content-type-options: nosniff|age: 417214|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:58 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Thu, 24 Apr 2025 15:02:33 GMT]\n2;s-46519;1,348 ms;1,355 ms;1,361 ms;1,423 ms;75 ms;73 μs;62 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Mon, 29 Apr 2024 03:50:51 GMT|x-content-type-options: nosniff|age: 25516|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:41 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Tue, 29 Apr 2025 03:50:51 GMT]\n3;s-46196;1,331 ms;1,339 ms;1,355 ms;1,420 ms;89 ms;0.1 ms;65 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Fri, 26 Apr 2024 20:29:46 GMT|x-content-type-options: nosniff|age: 224781|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:39 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Sat, 26 Apr 2025 20:29:46 GMT]\n4;s-45814;1,326 ms;1,331 ms;1,348 ms;1,419 ms;93 ms;77 μs;71 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Thu, 25 Apr 2024 13:27:47 GMT|x-content-type-options: nosniff|age: 336500|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:56 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Fri, 25 Apr 2025 13:27:47 GMT]\n5;s-44751;1,286 ms;1,307 ms;1,343 ms;1,416 ms;130 ms;1 ms;73 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Fri, 26 Apr 2024 09:49:05 GMT|x-content-type-options: nosniff|age: 263222|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Mon, 08 Apr 2024 19:04:51 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Sat, 26 Apr 2025 09:49:05 GMT]\n6;s-44728;1,285 ms;1,307 ms;1,343 ms;1,406 ms;120 ms;1 ms;62 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Sun, 28 Apr 2024 21:44:44 GMT|x-content-type-options: nosniff|age: 47483|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:53 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Mon, 28 Apr 2025 21:44:44 GMT]\n7;s-44701;1,284 ms;1,300 ms;1,339 ms;1,405 ms;120 ms;0.2 ms;65 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Thu, 25 Apr 2024 09:35:28 GMT|x-content-type-options: nosniff|age: 350439|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 11 May 2022 19:24:50 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Fri, 25 Apr 2025 09:35:28 GMT]\n8;s-43119;1,751 ms;1,751 ms;1,771 ms;1,771 ms;20 ms;27 μs;0.2 ms;200;application/json;Medium;Medium;Medium;f;unknown;t;0;[];[date: Sun, 28 Apr 2024 14:07:49 GMT|last-modified: Wed, 24 Apr 2024 11:02:59 GMT|server: Google Frontend|age: 75208|content-type: application/json|x-cloud-trace-context: <redacted>|cache-control: public, max-age=86400|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>]\n9;s-7695;557 ms;557 ms;597 ms;597 ms;40 ms;3 ms;0.6 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[date: Mon, 29 Apr 2024 11:01:15 GMT|content-encoding: gzip|x-content-type-options: nosniff|strict-transport-security: max-age=31536000|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|x-xss-protection: 0|last-modified: Mon, 29 Apr 2024 10:51:49 GMT|server: ESF|cross-origin-opener-policy: <redacted>|x-frame-options: SAMEORIGIN|content-type: text/css; charset=utf-8|access-control-allow-origin: *|cache-control: private, max-age=86400, stale-while-revalidate=604800|timing-allow-origin: *|link: <https://fonts.gstatic.com>; rel=preconnect; crossorigin|expires: Mon, 29 Apr 2024 11:01:15 GMT]\n7;s-34909;770 ms;770 ms;771 ms;776 ms;6 ms;40 μs;5 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[x-google-security-signals: <redacted>|x-google-gfe-service-trace: <redacted>|content-security-policy-report-only: <redacted>|x-google-scs-row-timestamp: <redacted>|x-google-gfe-response-code-details-trace: <redacted>|cross-origin-resource-policy: <redacted>|x-google-scs-row-key: <redacted>|content-type: font/woff2|access-control-allow-origin: *|x-google-data-version: <redacted>|cache-control: public, max-age=31536000|x-google-gfe-backend-request-info: <redacted>|x-google-dos-service-trace: <redacted>|x-google-backends: <redacted>|date: Thu, 26 Oct 2023 10:46:00 GMT|x-content-type-options: nosniff|expires: Fri, 25 Oct 2024 10:46:00 GMT|x-google-gfe-version: <redacted>|x-google-netmon-label: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-google-service: <redacted>|x-xss-protection: 0|x-google-gfe-handshake-trace: <redacted>|x-google-shellfish-status: <redacted>|last-modified: Wed, 11 May 2022 19:24:50 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|x-google-gfe-request-trace: <redacted>|accept-ranges: bytes|timing-allow-origin: *|x-google-scs-repo: <redacted>]\n10;s-11121;602 ms;602 ms;603 ms;611 ms;9 ms;27 μs;8 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[date: Thu, 25 Apr 2024 15:44:03 GMT|x-content-type-options: nosniff|age: 328319|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Wed, 24 Apr 2024 23:37:14 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Fri, 25 Apr 2025 15:44:03 GMT]\n11;s-7703;557 ms;557 ms;597 ms;597 ms;40 ms;90 μs;0.1 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[date: Mon, 29 Apr 2024 11:01:15 GMT|content-encoding: gzip|x-content-type-options: nosniff|strict-transport-security: max-age=31536000|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|x-xss-protection: 0|last-modified: Mon, 29 Apr 2024 11:01:15 GMT|server: ESF|cross-origin-opener-policy: <redacted>|x-frame-options: SAMEORIGIN|content-type: text/css; charset=utf-8|access-control-allow-origin: *|cache-control: private, max-age=86400, stale-while-revalidate=604800|timing-allow-origin: *|link: <https://fonts.gstatic.com>; rel=preconnect; crossorigin|expires: Mon, 29 Apr 2024 11:01:15 GMT]\n5;s-11334;606 ms;606 ms;607 ms;615 ms;9 ms;30 μs;8 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;11;[];[date: Fri, 26 Apr 2024 09:49:05 GMT|x-content-type-options: nosniff|age: 263217|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Mon, 08 Apr 2024 19:04:51 GMT|server: sffe|cross-origin-opener-policy: <redacted>|report-to: {\"group\":\"apps-themes\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/apps-themes\"}]}|content-type: font/woff2|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|timing-allow-origin: *|expires: Sat, 26 Apr 2025 09:49:05 GMT]\n12;s-7722;557 ms;557 ms;562 ms;568 ms;11 ms;0.5 ms;6 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[date: Mon, 29 Apr 2024 10:56:02 GMT|content-encoding: gzip|x-content-type-options: nosniff|age: 256|content-security-policy-report-only: <redacted>|cross-origin-resource-policy: <redacted>|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|last-modified: Thu, 25 Apr 2024 19:58:26 GMT|server: sffe|cross-origin-opener-policy: <redacted>|vary: Accept-Encoding|report-to: {\"group\":\"devrel-devsite\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/devrel-devsite\"}]}|content-type: text/css|access-control-allow-origin: *|cache-control: public, max-age=31536000|accept-ranges: bytes|expires: Tue, 29 Apr 2025 10:56:02 GMT]\n13;s-7737;557 ms;557 ms;561 ms;561 ms;4 ms;0.4 ms;0.2 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[content-security-policy: base-uri 'self'; object-src 'none'; script-src 'strict-dynamic' 'unsafe-inline' https: http: 'nonce-laTwEoovJjOKcMoBUjSFaYO6rrF8dU' 'unsafe-eval'; report-uri https://csp.withgoogle.com/csp/devsite/v2|content-encoding: gzip|x-content-type-options: nosniff|date: Mon, 29 Apr 2024 11:00:18 GMT|strict-transport-security: max-age=63072000; includeSubdomains; preload|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|pragma: no-cache|last-modified: Tue, 19 Mar 2024 18:37:07 GMT|server: Google Frontend|vary: Cookie, Accept-Encoding|x-frame-options: SAMEORIGIN|content-type: text/css|x-cloud-trace-context: <redacted>|cache-control: no-cache, must-revalidate|expires: 0]\n\n# Main thread bottom-up summary\n\nThis is the bottom-up summary for the entire trace. Only the top 10 activities (sorted by self time) are shown. An activity is all the aggregated time spent on the same type of work. For example, it can be all the time spent in a specific JavaScript function, or all the time spent in a specific browser rendering stage (like layout, v8 compile, parsing html). \"Self time\" represents the aggregated time spent directly in an activity, across all occurrences. \"Total time\" represents the aggregated time spent in an activity or any of its children.\n\n## insight set id: NO_NAVIGATION\n\n- self: 12 ms, total: 12 ms, source: Profiling overhead\n- self: 4 ms, total: 28 ms, source: Task\n- self: 3 ms, total: 4 ms, source: Recalculate style (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 98, column: 12)\n- self: 2 ms, total: 2 ms, source: Commit\n- self: 0.9 ms, total: 2 ms, source: Function call (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 102, column: 35)\n- self: 0.8 ms, total: 13 ms, source: Evaluate script\n- self: 0.7 ms, total: 3 ms, source: Event: pointerover\n- self: 0.1 ms, total: 1 ms, source: Xh (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 104, column: 61)\n\n## insight set id: NAVIGATION_1\n\n- self: 46 ms, total: 49 ms, source: Recalculate style\n- self: 37 ms, total: 211 ms, source: Task\n- self: 21 ms, total: 22 ms, source: Layout\n- self: 17 ms, total: 19 ms, source: Compile code\n- self: 7 ms, total: 7 ms, source: Cache script code\n- self: 6 ms, total: 26 ms, source: Function call (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 288, column: 146)\n- self: 5 ms, total: 5 ms, source: Parse stylesheet\n- self: 5 ms, total: 5 ms, source: Pre-paint\n- self: 5 ms, total: 5 ms, source: Commit\n- self: 5 ms, total: 10 ms, source: appendChild\n\n# 3rd party summary\n\n## insight set id: NO_NAVIGATION\n\n- name: Google CDN, main thread time: 1 ms, network transfer size: 0 B\n\n## insight set id: NAVIGATION_1\n\n- name: Google CDN, main thread time: 38 ms, network transfer size: 990 B\n- name: web.dev, main thread time: 3 ms, network transfer size: 84.3 kB\n- name: Google Analytics, main thread time: 0.6 ms, network transfer size: 52.9 kB\n- name: Google Fonts, main thread time: 0 ms, network transfer size: 42.2 kB\n\n# Longest tasks\n\n## insight set id: NO_NAVIGATION\n\n- total time: 13 ms, event: (eventKey: r-96, ts: 465455241964)\n- total time: 2 ms, event: (eventKey: r-934, ts: 465455475572)\n- total time: 1 ms, event: (eventKey: r-2310, ts: 465455879141)\n\n## insight set id: NAVIGATION_1\n\n- total time: 18 ms, event: (eventKey: r-20182, ts: 465457150438)\n- total time: 14 ms, event: (eventKey: r-12184, ts: 465457104625)\n- total time: 12 ms, event: (eventKey: r-10779, ts: 465457087373)\n\nUser selected the following call tree:\n\n\n\n# Call tree:\n\n1;r-10779;Task;3;;;2;;\n2;r-11902;Layout;3;3;;;;;S\n\n\n# User query\n\ntest"
|
|
9
|
+
"text": [
|
|
10
|
+
"Trace summary:",
|
|
11
|
+
"URL: https://web.dev/",
|
|
12
|
+
"Trace bounds: {min: 465455241690µs, max: 465460435979µs}",
|
|
13
|
+
"CPU throttling: 1x",
|
|
14
|
+
"Network throttling: No throttling",
|
|
15
|
+
"",
|
|
16
|
+
"# Available insight sets",
|
|
17
|
+
"",
|
|
18
|
+
"The following is a list of insight sets. An insight set covers a specific part of the trace, split by navigations. The insights within each insight set are specific to that part of the trace. Be sure to consider the insight set id and bounds when calling functions. If no specific insight set or navigation is mentioned, assume the user is referring to the first one.",
|
|
19
|
+
"",
|
|
20
|
+
"## insight set id: NO_NAVIGATION",
|
|
21
|
+
"",
|
|
22
|
+
"URL: https://web.dev/",
|
|
23
|
+
"Bounds: {min: 465455241690µs, max: 465456489729µs}",
|
|
24
|
+
"Metrics (lab / observed):",
|
|
25
|
+
" - CLS: 0.00",
|
|
26
|
+
"Metrics (field / real users): n/a – no data for this page in CrUX",
|
|
27
|
+
"Available insights:",
|
|
28
|
+
" - insight name: ThirdParties",
|
|
29
|
+
" description: 3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page’s content.",
|
|
30
|
+
" relevant trace bounds: {min: 465456492168µs, max: 465460052616µs}",
|
|
31
|
+
" example question: Which third parties are having the largest impact on my page performance?",
|
|
32
|
+
"",
|
|
33
|
+
"## insight set id: NAVIGATION_1",
|
|
34
|
+
"",
|
|
35
|
+
"URL: https://web.dev/",
|
|
36
|
+
"Bounds: {min: 465456489730µs, max: 465460435979µs}",
|
|
37
|
+
"Metrics (lab / observed):",
|
|
38
|
+
" - LCP: 676 ms, event: (eventKey: r-21246, ts: 465457166052), nodeId: 1680",
|
|
39
|
+
" - LCP breakdown:",
|
|
40
|
+
" - TTFB: 553 ms, bounds: {min: 465456489730µs, max: 465457042737µs}",
|
|
41
|
+
" - Render delay: 123 ms, bounds: {min: 465457042737µs, max: 465457166052µs}",
|
|
42
|
+
" - CLS: 0.02, event: (eventKey: s-14250, ts: 465457121239)",
|
|
43
|
+
"Metrics (field / real users): n/a – no data for this page in CrUX",
|
|
44
|
+
"Available insights:",
|
|
45
|
+
" - insight name: RenderBlocking",
|
|
46
|
+
" description: Requests are blocking the page’s initial render, which may delay LCP. [Deferring or inlining](https://developer.chrome.com/docs/performance/insights/render-blocking) can move these network requests out of the critical path.",
|
|
47
|
+
" relevant trace bounds: {min: 465457046567µs, max: 465457086893µs}",
|
|
48
|
+
" estimated metric savings: FCP 116 ms, LCP 116 ms",
|
|
49
|
+
" example question: Show me the most impactful render-blocking requests that I should focus on",
|
|
50
|
+
" example question: How can I reduce the number of render-blocking requests?",
|
|
51
|
+
" - insight name: LCPBreakdown",
|
|
52
|
+
" description: Each [subpart has specific improvement strategies](https://developer.chrome.com/docs/performance/insights/lcp-breakdown). Ideally, most of the LCP time should be spent on loading the resources, not within delays.",
|
|
53
|
+
" relevant trace bounds: {min: 465456489730µs, max: 465457166052µs}",
|
|
54
|
+
" example question: Help me optimize my LCP score",
|
|
55
|
+
" example question: Which LCP subpart was most problematic?",
|
|
56
|
+
" example question: What can I do to reduce the LCP time for this page load?",
|
|
57
|
+
" - insight name: CLSCulprits",
|
|
58
|
+
" description: Layout shifts occur when elements move absent any user interaction. [Investigate the causes of layout shifts](https://developer.chrome.com/docs/performance/insights/cls-culprit), such as elements being added, removed, or their fonts changing as the page loads.",
|
|
59
|
+
" relevant trace bounds: {min: 465457121239µs, max: 465459012394µs}",
|
|
60
|
+
" example question: Help me optimize my CLS score",
|
|
61
|
+
" example question: How can I prevent layout shifts on this page?",
|
|
62
|
+
" - insight name: NetworkDependencyTree",
|
|
63
|
+
" description: [Avoid chaining critical requests](https://developer.chrome.com/docs/performance/insights/network-dependency-tree) by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load",
|
|
64
|
+
" relevant trace bounds: {min: 465456490723µs, max: 465458472724µs}",
|
|
65
|
+
" example question: How do I optimize my network dependency tree?",
|
|
66
|
+
" - insight name: DOMSize",
|
|
67
|
+
" description: A large DOM can increase the duration of style calculations and layout reflows, impacting page responsiveness. A large DOM will also increase memory usage. [Learn how to avoid an excessive DOM size](https://developer.chrome.com/docs/performance/insights/dom-size).",
|
|
68
|
+
" relevant trace bounds: {min: 465458287196µs, max: 465458340745µs}",
|
|
69
|
+
" example question: How can I reduce the size of my DOM?",
|
|
70
|
+
" - insight name: ThirdParties",
|
|
71
|
+
" description: 3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page’s content.",
|
|
72
|
+
" relevant trace bounds: {min: 465456492168µs, max: 465460052616µs}",
|
|
73
|
+
" example question: Which third parties are having the largest impact on my page performance?",
|
|
74
|
+
" - insight name: ForcedReflow",
|
|
75
|
+
" description: A forced reflow occurs when JavaScript queries geometric properties (such as offsetWidth) after styles have been invalidated by a change to the DOM state. This can result in poor performance. Learn more about [forced reflows](https://developer.chrome.com/docs/performance/insights/forced-reflow) and possible mitigations.",
|
|
76
|
+
" relevant trace bounds: {min: 465456489730µs, max: 465460435979µs}",
|
|
77
|
+
" example question: How can I avoid forced reflows and layout thrashing?",
|
|
78
|
+
" example question: What is forced reflow and why is it problematic?",
|
|
79
|
+
" - insight name: Cache",
|
|
80
|
+
" description: A long cache lifetime can speed up repeat visits to your page. [Learn more about caching](https://developer.chrome.com/docs/performance/insights/cache).",
|
|
81
|
+
" relevant trace bounds: {min: 465457179567µs, max: 465459110674µs}",
|
|
82
|
+
" estimated metric savings: FCP 0 ms, LCP 0 ms",
|
|
83
|
+
" estimated wasted bytes: 16 kB",
|
|
84
|
+
" example question: What caching strategies can I apply to improve my page performance?",
|
|
85
|
+
"# Critical network requests",
|
|
86
|
+
"",
|
|
87
|
+
"## insight set id: NO_NAVIGATION",
|
|
88
|
+
"",
|
|
89
|
+
"none",
|
|
90
|
+
"",
|
|
91
|
+
"## insight set id: NAVIGATION_1",
|
|
92
|
+
"",
|
|
93
|
+
"",
|
|
94
|
+
"Network requests data:",
|
|
95
|
+
"",
|
|
96
|
+
"",
|
|
97
|
+
"",
|
|
98
|
+
"allUrls = [0: https://web.dev/, 1: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2, 2: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2, 3: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2, 4: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2, 5: https://fonts.gstatic.com/s/materialicons/v142/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2, 6: https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2, 7: https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2, 8: https://web.dev/_pwa/web/manifest.json, 9: https://fonts.googleapis.com/css?family=Google+Sans:400,500|Roboto:400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700&display=swap, 10: https://fonts.gstatic.com/s/googlesans/v59/4UasrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iqcsih3SAyH6cAwhX9RPjIUvbQoi-E.woff2, 11: https://fonts.googleapis.com/css2?family=Material+Icons&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block, 12: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/web/css/app.css, 13: https://web.dev/extras.css]",
|
|
99
|
+
"",
|
|
100
|
+
"0;s-7302;1 ms;2 ms;568 ms;569 ms;568 ms;15 ms;0.5 ms;200;text/html;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-security-policy: base-uri 'self'; object-src 'none'; script-src 'strict-dynamic' 'unsafe-inline' https: http: 'nonce-pLl1WHuNABXXiQLLmUesvDyvzBJZdE' 'unsafe-eval'; report-uri https://csp.withgoogle.com/csp/devsite/v2|content-encoding: gzip|x-content-type-options: nosniff|date: Mon, 29 Apr 2024 11:01:15 GMT|strict-transport-security: max-age=63072000; includeSubdomains; preload|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|pragma: no-cache|last-modified: Fri, 26 Apr 2024 16:43:17 GMT|server: Google Frontend|vary: Cookie, Accept-Encoding|x-frame-options: SAMEORIGIN|content-type: text/html; charset=utf-8|x-cloud-trace-context: <redacted>|cache-control: no-cache, must-revalidate|expires: 0]",
|
|
101
|
+
"1;s-49309;1,395 ms;1,402 ms;1,415 ms;1,423 ms;28 ms;94 μs;9 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-length: <redacted>|last-modified: Wed, 11 May 2022 19:24:58 GMT|content-type: font/woff2|cache-control: public, max-age=31536000|expires: Thu, 24 Apr 2025 15:02:33 GMT]",
|
|
102
|
+
"2;s-46519;1,348 ms;1,355 ms;1,361 ms;1,423 ms;75 ms;73 μs;62 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-length: <redacted>|last-modified: Wed, 11 May 2022 19:24:41 GMT|content-type: font/woff2|cache-control: public, max-age=31536000|expires: Tue, 29 Apr 2025 03:50:51 GMT]",
|
|
103
|
+
"3;s-46196;1,331 ms;1,339 ms;1,355 ms;1,420 ms;89 ms;0.1 ms;65 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-length: <redacted>|last-modified: Wed, 11 May 2022 19:24:39 GMT|content-type: font/woff2|cache-control: public, max-age=31536000|expires: Sat, 26 Apr 2025 20:29:46 GMT]",
|
|
104
|
+
"4;s-45814;1,326 ms;1,331 ms;1,348 ms;1,419 ms;93 ms;77 μs;71 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-length: <redacted>|last-modified: Wed, 11 May 2022 19:24:56 GMT|content-type: font/woff2|cache-control: public, max-age=31536000|expires: Fri, 25 Apr 2025 13:27:47 GMT]",
|
|
105
|
+
"5;s-44751;1,286 ms;1,307 ms;1,343 ms;1,416 ms;130 ms;1 ms;73 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-length: <redacted>|last-modified: Mon, 08 Apr 2024 19:04:51 GMT|content-type: font/woff2|cache-control: public, max-age=31536000|expires: Sat, 26 Apr 2025 09:49:05 GMT]",
|
|
106
|
+
"6;s-44728;1,285 ms;1,307 ms;1,343 ms;1,406 ms;120 ms;1 ms;62 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-length: <redacted>|last-modified: Wed, 11 May 2022 19:24:53 GMT|content-type: font/woff2|cache-control: public, max-age=31536000|expires: Mon, 28 Apr 2025 21:44:44 GMT]",
|
|
107
|
+
"7;s-44701;1,284 ms;1,300 ms;1,339 ms;1,405 ms;120 ms;0.2 ms;65 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-length: <redacted>|last-modified: Wed, 11 May 2022 19:24:50 GMT|content-type: font/woff2|cache-control: public, max-age=31536000|expires: Fri, 25 Apr 2025 09:35:28 GMT]",
|
|
108
|
+
"8;s-43119;1,751 ms;1,751 ms;1,771 ms;1,771 ms;20 ms;27 μs;0.2 ms;200;application/json;Medium;Medium;Medium;f;unknown;t;0;[];[date: Sun, 28 Apr 2024 14:07:49 GMT|last-modified: Wed, 24 Apr 2024 11:02:59 GMT|server: Google Frontend|age: 75208|content-type: application/json|x-cloud-trace-context: <redacted>|cache-control: public, max-age=86400|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>]",
|
|
109
|
+
"9;s-7695;557 ms;557 ms;597 ms;597 ms;40 ms;3 ms;0.6 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[last-modified: Mon, 29 Apr 2024 10:51:49 GMT|content-type: text/css; charset=utf-8|cache-control: private, max-age=86400, stale-while-revalidate=604800|expires: Mon, 29 Apr 2024 11:01:15 GMT]",
|
|
110
|
+
"7;s-34909;770 ms;770 ms;771 ms;776 ms;6 ms;40 μs;5 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-type: font/woff2|cache-control: public, max-age=31536000|expires: Fri, 25 Oct 2024 10:46:00 GMT|content-length: <redacted>|last-modified: Wed, 11 May 2022 19:24:50 GMT]",
|
|
111
|
+
"10;s-11121;602 ms;602 ms;603 ms;611 ms;9 ms;27 μs;8 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;;[];[content-length: <redacted>|last-modified: Wed, 24 Apr 2024 23:37:14 GMT|content-type: font/woff2|cache-control: public, max-age=31536000|expires: Fri, 25 Apr 2025 15:44:03 GMT]",
|
|
112
|
+
"11;s-7703;557 ms;557 ms;597 ms;597 ms;40 ms;90 μs;0.1 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[last-modified: Mon, 29 Apr 2024 11:01:15 GMT|content-type: text/css; charset=utf-8|cache-control: private, max-age=86400, stale-while-revalidate=604800|expires: Mon, 29 Apr 2024 11:01:15 GMT]",
|
|
113
|
+
"5;s-11334;606 ms;606 ms;607 ms;615 ms;9 ms;30 μs;8 ms;200;font/woff2;VeryHigh;VeryHigh;VeryHigh;f;unknown;t;11;[];[content-length: <redacted>|last-modified: Mon, 08 Apr 2024 19:04:51 GMT|content-type: font/woff2|cache-control: public, max-age=31536000|expires: Sat, 26 Apr 2025 09:49:05 GMT]",
|
|
114
|
+
"12;s-7722;557 ms;557 ms;562 ms;568 ms;11 ms;0.5 ms;6 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[content-length: <redacted>|last-modified: Thu, 25 Apr 2024 19:58:26 GMT|content-type: text/css|cache-control: public, max-age=31536000|expires: Tue, 29 Apr 2025 10:56:02 GMT]",
|
|
115
|
+
"13;s-7737;557 ms;557 ms;561 ms;561 ms;4 ms;0.4 ms;0.2 ms;200;text/css;VeryHigh;VeryHigh;VeryHigh;t;unknown;t;0;[];[content-security-policy: base-uri 'self'; object-src 'none'; script-src 'strict-dynamic' 'unsafe-inline' https: http: 'nonce-laTwEoovJjOKcMoBUjSFaYO6rrF8dU' 'unsafe-eval'; report-uri https://csp.withgoogle.com/csp/devsite/v2|content-encoding: gzip|x-content-type-options: nosniff|date: Mon, 29 Apr 2024 11:00:18 GMT|strict-transport-security: max-age=63072000; includeSubdomains; preload|alt-svc: h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000|content-length: <redacted>|x-xss-protection: 0|pragma: no-cache|last-modified: Tue, 19 Mar 2024 18:37:07 GMT|server: Google Frontend|vary: Cookie, Accept-Encoding|x-frame-options: SAMEORIGIN|content-type: text/css|x-cloud-trace-context: <redacted>|cache-control: no-cache, must-revalidate|expires: 0]",
|
|
116
|
+
"",
|
|
117
|
+
"# Main thread bottom-up summary",
|
|
118
|
+
"",
|
|
119
|
+
"This is the bottom-up summary for the entire trace. Only the top 10 activities (sorted by self time) are shown. An activity is all the aggregated time spent on the same type of work. For example, it can be all the time spent in a specific JavaScript function, or all the time spent in a specific browser rendering stage (like layout, v8 compile, parsing html). \"Self time\" represents the aggregated time spent directly in an activity, across all occurrences. \"Total time\" represents the aggregated time spent in an activity or any of its children.",
|
|
120
|
+
"",
|
|
121
|
+
"## insight set id: NO_NAVIGATION",
|
|
122
|
+
"",
|
|
123
|
+
"- self: 12 ms, total: 12 ms, source: Profiling overhead",
|
|
124
|
+
"- self: 4 ms, total: 28 ms, source: Task",
|
|
125
|
+
"- self: 3 ms, total: 4 ms, source: Recalculate style (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 98, column: 12)",
|
|
126
|
+
"- self: 2 ms, total: 2 ms, source: Commit",
|
|
127
|
+
"- self: 0.9 ms, total: 2 ms, source: Function call (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 102, column: 35)",
|
|
128
|
+
"- self: 0.8 ms, total: 13 ms, source: Evaluate script",
|
|
129
|
+
"- self: 0.7 ms, total: 3 ms, source: Event: pointerover",
|
|
130
|
+
"- self: 0.1 ms, total: 1 ms, source: Xh (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 104, column: 61)",
|
|
131
|
+
"",
|
|
132
|
+
"## insight set id: NAVIGATION_1",
|
|
133
|
+
"",
|
|
134
|
+
"- self: 46 ms, total: 49 ms, source: Recalculate style",
|
|
135
|
+
"- self: 37 ms, total: 211 ms, source: Task",
|
|
136
|
+
"- self: 21 ms, total: 22 ms, source: Layout",
|
|
137
|
+
"- self: 17 ms, total: 19 ms, source: Compile code",
|
|
138
|
+
"- self: 7 ms, total: 7 ms, source: Cache script code",
|
|
139
|
+
"- self: 6 ms, total: 26 ms, source: Function call (url: https://www.gstatic.com/devrel-devsite/prod/vafe2e13ca17bb026e70df42a2ead1c8192750e86a12923a88eda839025dabf95/js/devsite_app_module.js, line: 288, column: 146)",
|
|
140
|
+
"- self: 5 ms, total: 5 ms, source: Parse stylesheet",
|
|
141
|
+
"- self: 5 ms, total: 5 ms, source: Pre-paint",
|
|
142
|
+
"- self: 5 ms, total: 5 ms, source: Commit",
|
|
143
|
+
"- self: 5 ms, total: 10 ms, source: appendChild",
|
|
144
|
+
"",
|
|
145
|
+
"# 3rd party summary",
|
|
146
|
+
"",
|
|
147
|
+
"## insight set id: NO_NAVIGATION",
|
|
148
|
+
"",
|
|
149
|
+
"- name: Google CDN, main thread time: 1 ms, network transfer size: 0 B",
|
|
150
|
+
"",
|
|
151
|
+
"## insight set id: NAVIGATION_1",
|
|
152
|
+
"",
|
|
153
|
+
"- name: Google CDN, main thread time: 38 ms, network transfer size: 990 B",
|
|
154
|
+
"- name: web.dev, main thread time: 3 ms, network transfer size: 84.3 kB",
|
|
155
|
+
"- name: Google Analytics, main thread time: 0.6 ms, network transfer size: 52.9 kB",
|
|
156
|
+
"- name: Google Fonts, main thread time: 0 ms, network transfer size: 42.2 kB",
|
|
157
|
+
"",
|
|
158
|
+
"# Longest tasks",
|
|
159
|
+
"",
|
|
160
|
+
"## insight set id: NO_NAVIGATION",
|
|
161
|
+
"",
|
|
162
|
+
"- total time: 13 ms, event: (eventKey: r-96, ts: 465455241964)",
|
|
163
|
+
"- total time: 2 ms, event: (eventKey: r-934, ts: 465455475572)",
|
|
164
|
+
"- total time: 1 ms, event: (eventKey: r-2310, ts: 465455879141)",
|
|
165
|
+
"",
|
|
166
|
+
"## insight set id: NAVIGATION_1",
|
|
167
|
+
"",
|
|
168
|
+
"- total time: 18 ms, event: (eventKey: r-20182, ts: 465457150438)",
|
|
169
|
+
"- total time: 14 ms, event: (eventKey: r-12184, ts: 465457104625)",
|
|
170
|
+
"- total time: 12 ms, event: (eventKey: r-10779, ts: 465457087373)",
|
|
171
|
+
"",
|
|
172
|
+
"User selected the following call tree:",
|
|
173
|
+
"",
|
|
174
|
+
"",
|
|
175
|
+
"",
|
|
176
|
+
"# Call tree:",
|
|
177
|
+
"",
|
|
178
|
+
"1;r-10779;Task;3;;;2;;",
|
|
179
|
+
"2;r-11902;Layout;3;3;;;;;S",
|
|
180
|
+
"",
|
|
181
|
+
"",
|
|
182
|
+
"# User query",
|
|
183
|
+
"",
|
|
184
|
+
"test"
|
|
185
|
+
]
|
|
10
186
|
}
|
|
11
187
|
],
|
|
12
188
|
"widgets": [
|
|
@@ -38,7 +214,86 @@ Content:
|
|
|
38
214
|
"details": [
|
|
39
215
|
{
|
|
40
216
|
"title": "Trace details",
|
|
41
|
-
"text":
|
|
217
|
+
"text": [
|
|
218
|
+
"Trace summary:",
|
|
219
|
+
"URL: https://chromedevtools.github.io/performance-stories/lcp-large-image/index.html",
|
|
220
|
+
"Trace bounds: {min: 658799706428µs, max: 658804825864µs}",
|
|
221
|
+
"CPU throttling: 1x",
|
|
222
|
+
"Network throttling: No throttling",
|
|
223
|
+
"",
|
|
224
|
+
"# Available insight sets",
|
|
225
|
+
"",
|
|
226
|
+
"The following is a list of insight sets. An insight set covers a specific part of the trace, split by navigations. The insights within each insight set are specific to that part of the trace. Be sure to consider the insight set id and bounds when calling functions. If no specific insight set or navigation is mentioned, assume the user is referring to the first one.",
|
|
227
|
+
"",
|
|
228
|
+
"## insight set id: NAVIGATION_0",
|
|
229
|
+
"",
|
|
230
|
+
"URL: https://chromedevtools.github.io/performance-stories/lcp-large-image/index.html",
|
|
231
|
+
"Bounds: {min: 658799738257µs, max: 658804825864µs}",
|
|
232
|
+
"Metrics (lab / observed):",
|
|
233
|
+
" - LCP: 110 ms, event: (eventKey: r-2399, ts: 658799847880), nodeId: 10",
|
|
234
|
+
" - LCP breakdown:",
|
|
235
|
+
" - TTFB: 7 ms, bounds: {min: 658799738257µs, max: 658799745193µs}",
|
|
236
|
+
" - Load delay: 34 ms, bounds: {min: 658799745193µs, max: 658799778937µs}",
|
|
237
|
+
" - Load duration: 12 ms, bounds: {min: 658799778937µs, max: 658799791032µs}",
|
|
238
|
+
" - Render delay: 57 ms, bounds: {min: 658799791032µs, max: 658799847880µs}",
|
|
239
|
+
" - CLS: 0.00",
|
|
240
|
+
"Metrics (field / real users): n/a – no data for this page in CrUX",
|
|
241
|
+
"Available insights:",
|
|
242
|
+
" - insight name: LCPBreakdown",
|
|
243
|
+
" description: Each [subpart has specific improvement strategies](https://developer.chrome.com/docs/performance/insights/lcp-breakdown). Ideally, most of the LCP time should be spent on loading the resources, not within delays.",
|
|
244
|
+
" relevant trace bounds: {min: 658799738257µs, max: 658799847880µs}",
|
|
245
|
+
" example question: Help me optimize my LCP score",
|
|
246
|
+
" example question: Which LCP subpart was most problematic?",
|
|
247
|
+
" example question: What can I do to reduce the LCP time for this page load?",
|
|
248
|
+
" - insight name: LCPDiscovery",
|
|
249
|
+
" description: [Optimize LCP](https://developer.chrome.com/docs/performance/insights/lcp-discovery) by making the LCP image discoverable from the HTML immediately, and avoiding lazy-loading",
|
|
250
|
+
" relevant trace bounds: {min: 658799745193µs, max: 658799793683µs}",
|
|
251
|
+
" example question: Suggest fixes to reduce my LCP",
|
|
252
|
+
" example question: What can I do to reduce my LCP discovery time?",
|
|
253
|
+
" example question: Why is LCP discovery time important?",
|
|
254
|
+
" - insight name: RenderBlocking",
|
|
255
|
+
" description: Requests are blocking the page’s initial render, which may delay LCP. [Deferring or inlining](https://developer.chrome.com/docs/performance/insights/render-blocking) can move these network requests out of the critical path.",
|
|
256
|
+
" relevant trace bounds: {min: 658799775876µs, max: 658799791419µs}",
|
|
257
|
+
" example question: Show me the most impactful render-blocking requests that I should focus on",
|
|
258
|
+
" example question: How can I reduce the number of render-blocking requests?",
|
|
259
|
+
" - insight name: Cache",
|
|
260
|
+
" description: A long cache lifetime can speed up repeat visits to your page. [Learn more about caching](https://developer.chrome.com/docs/performance/insights/cache).",
|
|
261
|
+
" relevant trace bounds: {min: 658799777502µs, max: 658799791419µs}",
|
|
262
|
+
" example question: What caching strategies can I apply to improve my page performance?",
|
|
263
|
+
"# Critical network requests",
|
|
264
|
+
"",
|
|
265
|
+
"none",
|
|
266
|
+
"",
|
|
267
|
+
"# Main thread bottom-up summary",
|
|
268
|
+
"",
|
|
269
|
+
"This is the bottom-up summary for the entire trace. Only the top 10 activities (sorted by self time) are shown. An activity is all the aggregated time spent on the same type of work. For example, it can be all the time spent in a specific JavaScript function, or all the time spent in a specific browser rendering stage (like layout, v8 compile, parsing html). \"Self time\" represents the aggregated time spent directly in an activity, across all occurrences. \"Total time\" represents the aggregated time spent in an activity or any of its children.",
|
|
270
|
+
"",
|
|
271
|
+
"- self: 57 ms, total: 79 ms, source: Task",
|
|
272
|
+
"- self: 5 ms, total: 5 ms, source: Layout",
|
|
273
|
+
"- self: 4 ms, total: 4 ms, source: Major GC",
|
|
274
|
+
"- self: 3 ms, total: 3 ms, source: Parse HTML",
|
|
275
|
+
"- self: 2 ms, total: 2 ms, source: Recalculate style",
|
|
276
|
+
"- self: 2 ms, total: 2 ms, source: Commit",
|
|
277
|
+
"- self: 1 ms, total: 1 ms, source: C++ GC",
|
|
278
|
+
"- self: 1 ms, total: 1 ms, source: Paint",
|
|
279
|
+
"",
|
|
280
|
+
"# 3rd party summary",
|
|
281
|
+
"",
|
|
282
|
+
"- name: GitHub, main thread time: 3 ms, network transfer size: 0 B",
|
|
283
|
+
"",
|
|
284
|
+
"# Longest tasks",
|
|
285
|
+
"",
|
|
286
|
+
"- total time: 23 ms, event: (eventKey: r-617, ts: 658799757023)",
|
|
287
|
+
"- total time: 12 ms, event: (eventKey: r-1571, ts: 658799793885)",
|
|
288
|
+
"- total time: 11 ms, event: (eventKey: r-1891, ts: 658799811130)",
|
|
289
|
+
"",
|
|
290
|
+
"User selected the LCPBreakdown insight.",
|
|
291
|
+
"",
|
|
292
|
+
"",
|
|
293
|
+
"# User query",
|
|
294
|
+
"",
|
|
295
|
+
"test"
|
|
296
|
+
]
|
|
42
297
|
}
|
|
43
298
|
],
|
|
44
299
|
"widgets": [
|
|
@@ -816,7 +816,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
816
816
|
}
|
|
817
817
|
|
|
818
818
|
// TODO(b/425270067): Format in the same way that "Summary" detail tab does.
|
|
819
|
-
const details = formatEventForAI(event);
|
|
819
|
+
const details = formatEventForAI(event, parsedTrace);
|
|
820
820
|
|
|
821
821
|
const key = `getEventByKey('${params.eventKey}')`;
|
|
822
822
|
this.#cacheFunctionResult(focus, key, details);
|
|
@@ -16,9 +16,9 @@ import * as AiSetting from './AiSetting.js';
|
|
|
16
16
|
import * as AiUtils from './AiUtils.js';
|
|
17
17
|
import * as BuiltInAi from './BuiltInAi.js';
|
|
18
18
|
import * as ChangeManager from './ChangeManager.js';
|
|
19
|
-
import * as AccessibilityContext from './contexts/AccessibilityContext.js';
|
|
20
19
|
import * as DOMNodeContext from './contexts/DOMNodeContext.js';
|
|
21
20
|
import * as FileContext from './contexts/FileContext.js';
|
|
21
|
+
import * as LighthouseContext from './contexts/LighthouseContext.js';
|
|
22
22
|
import * as PerformanceTraceContext from './contexts/PerformanceTraceContext.js';
|
|
23
23
|
import * as RequestContext from './contexts/RequestContext.js';
|
|
24
24
|
import * as StorageContext from './contexts/StorageContext.js';
|
|
@@ -73,7 +73,6 @@ import * as ToolRegistry from './tools/ToolRegistry.js';
|
|
|
73
73
|
|
|
74
74
|
export {
|
|
75
75
|
AccessibilityAgent,
|
|
76
|
-
AccessibilityContext,
|
|
77
76
|
AiAgent,
|
|
78
77
|
AiAgent2,
|
|
79
78
|
AICallTree,
|
|
@@ -114,6 +113,7 @@ export {
|
|
|
114
113
|
GetTraceNetworkSummary,
|
|
115
114
|
GetTraceResourceContent,
|
|
116
115
|
Injected,
|
|
116
|
+
LighthouseContext,
|
|
117
117
|
LighthouseFormatter,
|
|
118
118
|
ListCookies,
|
|
119
119
|
ListNetworkRequests,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Title:
|
|
1
|
+
Title: LighthouseContext should return prompt details correctly
|
|
2
2
|
Content:
|
|
3
3
|
# Lighthouse Report:
|
|
4
4
|
# Lighthouse Report Summary
|
|
@@ -15,7 +15,7 @@ The following audits in this category have a score below 90 and may need attenti
|
|
|
15
15
|
* Description of accessibility audit
|
|
16
16
|
=== end content
|
|
17
17
|
|
|
18
|
-
Title:
|
|
18
|
+
Title: LighthouseContext should return user facing details correctly
|
|
19
19
|
Content:
|
|
20
20
|
[
|
|
21
21
|
{
|
|
@@ -24,3 +24,24 @@ Content:
|
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
26
|
=== end content
|
|
27
|
+
|
|
28
|
+
Title: LighthouseContext with AI V2 architecture enabled returns only the report summary as prompt details
|
|
29
|
+
Content:
|
|
30
|
+
# Lighthouse Report Summary
|
|
31
|
+
URL: https://example.com
|
|
32
|
+
Fetch Time: 2026-03-12
|
|
33
|
+
Lighthouse Version: 1.0.0
|
|
34
|
+
|
|
35
|
+
## Category Scores
|
|
36
|
+
- Accessibility: 50
|
|
37
|
+
=== end content
|
|
38
|
+
|
|
39
|
+
Title: LighthouseContext with AI V2 architecture enabled returns the report summary as user facing details
|
|
40
|
+
Content:
|
|
41
|
+
[
|
|
42
|
+
{
|
|
43
|
+
"title": "Lighthouse report",
|
|
44
|
+
"text": "# Lighthouse Report Summary\nURL: https://example.com\nFetch Time: 2026-03-12\nLighthouse Version: 1.0.0\n\n## Category Scores\n- Accessibility: 50"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
=== end content
|