chrome-devtools-frontend 1.0.1588580 → 1.0.1589336
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/docs/ui_engineering.md +2 -2
- package/front_end/core/common/AppProvider.ts +1 -2
- package/front_end/core/common/Color.ts +19 -20
- package/front_end/core/common/ParsedURL.ts +3 -3
- package/front_end/core/common/Progress.ts +5 -5
- package/front_end/core/common/Settings.ts +2 -2
- package/front_end/core/dom_extension/DOMExtension.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -11
- package/front_end/core/host/UserMetrics.ts +1 -1
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -2
- package/front_end/core/sdk/CSSMatchedStyles.ts +1 -1
- package/front_end/core/sdk/CSSProperty.ts +38 -0
- package/front_end/core/sdk/CSSRule.ts +4 -9
- package/front_end/core/sdk/ChildTargetManager.ts +1 -1
- package/front_end/core/sdk/CookieModel.ts +0 -1
- package/front_end/core/sdk/DOMModel.ts +40 -7
- package/front_end/core/sdk/EmulationModel.ts +3 -3
- package/front_end/core/sdk/NetworkRequest.ts +1 -1
- package/front_end/core/sdk/PageResourceLoader.ts +11 -6
- package/front_end/core/sdk/PerformanceMetricsModel.ts +2 -2
- package/front_end/core/sdk/ResourceTreeModel.ts +2 -6
- package/front_end/core/sdk/SourceMap.ts +2 -3
- package/front_end/core/sdk/SourceMapManager.ts +1 -2
- package/front_end/entrypoint_template.html +1 -1
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +6 -16
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +4 -2
- package/front_end/entrypoints/main/main-meta.ts +0 -3
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +0 -2
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiConversation.ts +20 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +7 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +28 -26
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -5
- package/front_end/models/emulation/DeviceModeModel.ts +0 -3
- package/front_end/models/emulation/EmulatedDevices.ts +0 -2
- package/front_end/models/extensions/ExtensionAPI.ts +2 -2
- package/front_end/models/har/Importer.ts +0 -1
- package/front_end/models/har/Log.ts +2 -11
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -5
- package/front_end/models/logs/NetworkLog.ts +0 -2
- package/front_end/models/network_time_calculator/NetworkTimeCalculator.ts +4 -1
- package/front_end/models/text_utils/TextUtils.ts +0 -9
- package/front_end/models/trace/LanternComputationData.ts +1 -6
- package/front_end/models/trace/helpers/Trace.ts +1 -4
- package/front_end/models/trace/lantern/types/Lantern.ts +6 -6
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +7 -6
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +0 -5
- package/front_end/panels/application/BackgroundServiceView.ts +0 -2
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +0 -1
- package/front_end/panels/application/IndexedDBViews.ts +19 -23
- package/front_end/panels/application/OriginTrialTreeView.ts +3 -3
- package/front_end/panels/application/components/BackForwardCacheView.ts +1 -1
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +3 -4
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +76 -19
- package/front_end/panels/common/aiCodeGenerationTeaser.css +11 -0
- package/front_end/panels/console/ConsoleSidebar.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +4 -0
- package/front_end/panels/elements/ComputedStyleWidget.ts +34 -20
- package/front_end/panels/elements/ElementsTreeElement.ts +9 -1
- package/front_end/panels/elements/ImagePreviewPopover.ts +0 -2
- package/front_end/panels/elements/MarkerDecorator.ts +0 -2
- package/front_end/panels/elements/StylePropertiesSection.ts +32 -3
- package/front_end/panels/elements/StylePropertyTreeElement.ts +4 -8
- package/front_end/panels/elements/StylesSidebarPane.ts +0 -85
- package/front_end/panels/emulation/emulation-meta.ts +0 -2
- package/front_end/panels/event_listeners/EventListenersUtils.ts +0 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +0 -5
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +1 -3
- package/front_end/panels/media/EventDisplayTable.ts +0 -2
- package/front_end/panels/media/PlayerMessagesView.ts +4 -6
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +18 -6
- package/front_end/panels/network/EventSourceMessagesView.ts +0 -2
- package/front_end/panels/network/NetworkLogViewColumns.ts +0 -2
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +3 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -2
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
- package/front_end/panels/network/RequestInitiatorView.ts +74 -69
- package/front_end/panels/network/RequestPayloadView.ts +6 -3
- package/front_end/panels/network/ResourceChunkView.ts +0 -2
- package/front_end/panels/network/components/ResponseHeaderSection.ts +3 -1
- package/front_end/panels/network/network-meta.ts +0 -2
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -9
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +0 -2
- package/front_end/panels/profiler/LiveHeapProfileView.ts +0 -12
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +14 -1
- package/front_end/panels/profiler/ProfileView.ts +0 -35
- package/front_end/panels/profiler/profiler-meta.ts +0 -1
- package/front_end/panels/recorder/components/StepView.ts +0 -1
- package/front_end/panels/screencast/ScreencastView.ts +2 -2
- package/front_end/panels/search/SearchResultsPane.ts +3 -2
- package/front_end/panels/security/SecurityPanel.ts +0 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +27 -9
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +1 -2
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +2 -2
- package/front_end/panels/settings/emulation/utils/UserAgentMetadata.ts +1 -1
- package/front_end/panels/settings/settings-meta.ts +0 -3
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +6 -0
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -5
- package/front_end/panels/sources/sources-meta.ts +0 -9
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +1 -1
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +5 -2
- package/front_end/panels/timeline/TimelinePanel.ts +0 -7
- package/front_end/panels/timeline/TimelineTreeView.ts +8 -10
- package/front_end/panels/timeline/TimelineUIUtils.ts +11 -3
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +0 -1
- package/front_end/panels/timeline/utils/Treemap.ts +0 -4
- package/front_end/panels/whats_new/whats_new-meta.ts +0 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +1 -2
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +1 -12
- package/front_end/ui/components/icon_button/IconButton.ts +2 -2
- package/front_end/ui/components/issue_counter/IssueCounter.ts +6 -6
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +4 -0
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +11 -6
- package/front_end/ui/legacy/ContextMenu.ts +1 -17
- package/front_end/ui/legacy/EmptyWidget.ts +4 -4
- package/front_end/ui/legacy/Fragment.ts +2 -4
- package/front_end/ui/legacy/SoftContextMenu.ts +1 -15
- package/front_end/ui/legacy/TabbedPane.ts +2 -2
- package/front_end/ui/legacy/Treeoutline.ts +16 -9
- package/front_end/ui/legacy/UIUtils.ts +1 -4
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +6 -3
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +0 -2
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +0 -1
- package/front_end/ui/legacy/components/quick_open/quick_open-meta.ts +0 -2
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +3 -2
- package/front_end/ui/legacy/components/utils/ImagePreview.ts +3 -3
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
|
@@ -19,8 +19,8 @@ export class PerformanceMetricsModel extends SDKModel<void> {
|
|
|
19
19
|
['RecalcStyleCount', MetricMode.CUMULATIVE_COUNT],
|
|
20
20
|
]);
|
|
21
21
|
readonly #metricData = new Map<string, {
|
|
22
|
-
lastValue
|
|
23
|
-
lastTimestamp
|
|
22
|
+
lastValue?: number,
|
|
23
|
+
lastTimestamp?: number,
|
|
24
24
|
}>();
|
|
25
25
|
|
|
26
26
|
constructor(target: Target) {
|
|
@@ -646,13 +646,11 @@ export class ResourceTreeFrame {
|
|
|
646
646
|
#childFrames = new Set<ResourceTreeFrame>();
|
|
647
647
|
resourcesMap = new Map<Platform.DevToolsPath.UrlString, Resource>();
|
|
648
648
|
backForwardCacheDetails: {
|
|
649
|
-
restoredFromCache: boolean|undefined,
|
|
650
649
|
explanations: Protocol.Page.BackForwardCacheNotRestoredExplanation[],
|
|
651
|
-
|
|
650
|
+
restoredFromCache?: boolean,
|
|
651
|
+
explanationsTree?: Protocol.Page.BackForwardCacheNotRestoredExplanationTree,
|
|
652
652
|
} = {
|
|
653
|
-
restoredFromCache: undefined,
|
|
654
653
|
explanations: [],
|
|
655
|
-
explanationsTree: undefined,
|
|
656
654
|
};
|
|
657
655
|
|
|
658
656
|
constructor(
|
|
@@ -725,9 +723,7 @@ export class ResourceTreeFrame {
|
|
|
725
723
|
this.#crossOriginIsolatedContextType = framePayload.crossOriginIsolatedContextType;
|
|
726
724
|
this.#gatedAPIFeatures = framePayload.gatedAPIFeatures;
|
|
727
725
|
this.backForwardCacheDetails = {
|
|
728
|
-
restoredFromCache: undefined,
|
|
729
726
|
explanations: [],
|
|
730
|
-
explanationsTree: undefined,
|
|
731
727
|
};
|
|
732
728
|
|
|
733
729
|
const mainResource = this.resourcesMap.get(this.#url);
|
|
@@ -89,10 +89,10 @@ export class SourceMapEntry {
|
|
|
89
89
|
readonly lineNumber: number;
|
|
90
90
|
readonly columnNumber: number;
|
|
91
91
|
readonly sourceIndex?: number;
|
|
92
|
-
readonly sourceURL
|
|
92
|
+
readonly sourceURL?: Platform.DevToolsPath.UrlString;
|
|
93
93
|
readonly sourceLineNumber: number;
|
|
94
94
|
readonly sourceColumnNumber: number;
|
|
95
|
-
readonly name
|
|
95
|
+
readonly name?: string;
|
|
96
96
|
|
|
97
97
|
constructor(
|
|
98
98
|
lineNumber: number, columnNumber: number, sourceIndex?: number, sourceURL?: Platform.DevToolsPath.UrlString,
|
|
@@ -248,7 +248,6 @@ export class SourceMap {
|
|
|
248
248
|
sourceURL: this.sourceURLs()[callsite.sourceIndex],
|
|
249
249
|
sourceLineNumber: callsite.line,
|
|
250
250
|
sourceColumnNumber: callsite.column,
|
|
251
|
-
name: undefined,
|
|
252
251
|
};
|
|
253
252
|
}
|
|
254
253
|
const mappings = this.mappings();
|
|
@@ -93,7 +93,6 @@ export class SourceMapManager<T extends FrameAssociated> extends Common.ObjectWr
|
|
|
93
93
|
let clientData: ClientData|null = {
|
|
94
94
|
relativeSourceURL,
|
|
95
95
|
relativeSourceMapURL,
|
|
96
|
-
sourceMap: undefined,
|
|
97
96
|
sourceMapPromise: Promise.resolve(undefined),
|
|
98
97
|
};
|
|
99
98
|
if (this.#isEnabled) {
|
|
@@ -225,7 +224,7 @@ interface ClientData {
|
|
|
225
224
|
// Stores the raw sourceMappingURL as provided by V8. These are not guaranteed to
|
|
226
225
|
// be valid URLs and will be checked and resolved once `attachSourceMap` is called.
|
|
227
226
|
relativeSourceMapURL: string;
|
|
228
|
-
sourceMap
|
|
227
|
+
sourceMap?: SourceMap;
|
|
229
228
|
sourceMapPromise: Promise<SourceMap|undefined>;
|
|
230
229
|
}
|
|
231
230
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
http-equiv="Content-Security-Policy"
|
|
19
19
|
content="default-src 'self' devtools: data:; style-src 'self' 'unsafe-inline' devtools:; object-src 'none'; script-src
|
|
20
20
|
'self' https://chrome-devtools-frontend.appspot.com; img-src 'self' data:; frame-src * data:; connect-src data:
|
|
21
|
-
https://chromeuxreport.googleapis.com 'self' devtools
|
|
21
|
+
https://chromeuxreport.googleapis.com 'self' devtools: ws://127.0.0.1:*;">
|
|
22
22
|
<meta name="referrer" content="no-referrer">
|
|
23
23
|
<script type="module" src="./entrypoints/%ENTRYPOINT_NAME%/%ENTRYPOINT_NAME%.js"></script>
|
|
24
24
|
<link href="./application_tokens.css" rel="stylesheet">
|
|
@@ -20,32 +20,22 @@ export class CSSFormatter {
|
|
|
20
20
|
#lineEndings!: number[];
|
|
21
21
|
#lastLine: number;
|
|
22
22
|
#state: {
|
|
23
|
-
eatWhitespace
|
|
24
|
-
seenProperty
|
|
25
|
-
inPropertyValue
|
|
26
|
-
afterClosingBrace
|
|
23
|
+
eatWhitespace?: boolean,
|
|
24
|
+
seenProperty?: boolean,
|
|
25
|
+
inPropertyValue?: boolean,
|
|
26
|
+
afterClosingBrace?: boolean,
|
|
27
27
|
};
|
|
28
28
|
constructor(builder: FormattedContentBuilder) {
|
|
29
29
|
this.#builder = builder;
|
|
30
30
|
this.#lastLine = -1;
|
|
31
|
-
this.#state = {
|
|
32
|
-
eatWhitespace: undefined,
|
|
33
|
-
seenProperty: undefined,
|
|
34
|
-
inPropertyValue: undefined,
|
|
35
|
-
afterClosingBrace: undefined,
|
|
36
|
-
};
|
|
31
|
+
this.#state = {};
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
format(text: string, lineEndings: number[], fromOffset: number, toOffset: number): void {
|
|
40
35
|
this.#lineEndings = lineEndings;
|
|
41
36
|
this.#fromOffset = fromOffset;
|
|
42
37
|
this.#toOffset = toOffset;
|
|
43
|
-
this.#state = {
|
|
44
|
-
eatWhitespace: undefined,
|
|
45
|
-
seenProperty: undefined,
|
|
46
|
-
inPropertyValue: undefined,
|
|
47
|
-
afterClosingBrace: undefined,
|
|
48
|
-
};
|
|
38
|
+
this.#state = {};
|
|
49
39
|
this.#lastLine = -1;
|
|
50
40
|
const tokenize = createTokenizer('text/css');
|
|
51
41
|
const oldEnforce = this.#builder.setEnforceSpaceBetweenWords(false);
|
|
@@ -36,8 +36,10 @@ export class HeapSnapshotWorkerDispatcher {
|
|
|
36
36
|
async dispatchMessage({data, ports}:
|
|
37
37
|
{data: HeapSnapshotModel.HeapSnapshotModel.WorkerCommand, ports: readonly MessagePort[]}):
|
|
38
38
|
Promise<void> {
|
|
39
|
-
const response: DispatcherResponse =
|
|
40
|
-
|
|
39
|
+
const response: DispatcherResponse = {
|
|
40
|
+
callId: data.callId,
|
|
41
|
+
result: null,
|
|
42
|
+
};
|
|
41
43
|
try {
|
|
42
44
|
switch (data.disposition) {
|
|
43
45
|
case 'createLoader':
|
|
@@ -867,7 +867,6 @@ UI.ContextMenu.registerProvider({
|
|
|
867
867
|
async loadProvider() {
|
|
868
868
|
return new Components.Linkifier.ContentProviderContextMenuProvider();
|
|
869
869
|
},
|
|
870
|
-
experiment: undefined,
|
|
871
870
|
});
|
|
872
871
|
|
|
873
872
|
UI.ContextMenu.registerProvider({
|
|
@@ -879,7 +878,6 @@ UI.ContextMenu.registerProvider({
|
|
|
879
878
|
async loadProvider() {
|
|
880
879
|
return new UI.LinkContextMenuProvider.LinkContextMenuProvider();
|
|
881
880
|
},
|
|
882
|
-
experiment: undefined,
|
|
883
881
|
});
|
|
884
882
|
|
|
885
883
|
UI.ContextMenu.registerProvider({
|
|
@@ -891,7 +889,6 @@ UI.ContextMenu.registerProvider({
|
|
|
891
889
|
async loadProvider() {
|
|
892
890
|
return new Components.Linkifier.LinkContextMenuProvider();
|
|
893
891
|
},
|
|
894
|
-
experiment: undefined,
|
|
895
892
|
});
|
|
896
893
|
|
|
897
894
|
UI.Toolbar.registerToolbarItem({
|
|
@@ -187,13 +187,11 @@ export class NodeConnectionsView extends UI.Widget.VBox implements UI.ListWidget
|
|
|
187
187
|
if (!match) {
|
|
188
188
|
return {
|
|
189
189
|
valid: false,
|
|
190
|
-
errorMessage: undefined,
|
|
191
190
|
};
|
|
192
191
|
}
|
|
193
192
|
const port = parseInt(match[2], 10);
|
|
194
193
|
return {
|
|
195
194
|
valid: port <= 65535,
|
|
196
|
-
errorMessage: undefined,
|
|
197
195
|
};
|
|
198
196
|
}
|
|
199
197
|
}
|
|
@@ -503,7 +503,7 @@ inspectorBackend.registerEnum("Emulation.VirtualTimePolicy", {Advance: "advance"
|
|
|
503
503
|
inspectorBackend.registerEnum("Emulation.SensorType", {AbsoluteOrientation: "absolute-orientation", Accelerometer: "accelerometer", AmbientLight: "ambient-light", Gravity: "gravity", Gyroscope: "gyroscope", LinearAcceleration: "linear-acceleration", Magnetometer: "magnetometer", RelativeOrientation: "relative-orientation"});
|
|
504
504
|
inspectorBackend.registerEnum("Emulation.PressureSource", {Cpu: "cpu"});
|
|
505
505
|
inspectorBackend.registerEnum("Emulation.PressureState", {Nominal: "nominal", Fair: "fair", Serious: "serious", Critical: "critical"});
|
|
506
|
-
inspectorBackend.registerEnum("Emulation.DisabledImageType", {Avif: "avif", Webp: "webp"});
|
|
506
|
+
inspectorBackend.registerEnum("Emulation.DisabledImageType", {Avif: "avif", Jxl: "jxl", Webp: "webp"});
|
|
507
507
|
inspectorBackend.registerEvent("Emulation.virtualTimeBudgetExpired", []);
|
|
508
508
|
inspectorBackend.registerCommand("Emulation.canEmulate", [], ["result"], "Tells whether emulation is supported.");
|
|
509
509
|
inspectorBackend.registerCommand("Emulation.clearDeviceMetricsOverride", [], [], "Clears the overridden device metrics.");
|
|
@@ -286,6 +286,19 @@ export class AiConversation {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
this.#type = type;
|
|
289
|
+
|
|
290
|
+
// We need to filter out the function calls
|
|
291
|
+
// as the LLM tries to call the existing ones.
|
|
292
|
+
const history =
|
|
293
|
+
this.#agent?.history
|
|
294
|
+
.map(content => {
|
|
295
|
+
return {
|
|
296
|
+
...content,
|
|
297
|
+
parts: content.parts.filter(part => !('functionCall' in part) && !('functionResponse' in part)),
|
|
298
|
+
};
|
|
299
|
+
})
|
|
300
|
+
.filter(content => content.parts.length > 0);
|
|
301
|
+
|
|
289
302
|
const options = {
|
|
290
303
|
aidaClient: this.#aidaClient,
|
|
291
304
|
serverSideLoggingEnabled: isAiAssistanceServerSideLoggingEnabled(),
|
|
@@ -294,6 +307,7 @@ export class AiConversation {
|
|
|
294
307
|
performanceRecordAndReload: this.#performanceRecordAndReload,
|
|
295
308
|
onInspectElement: this.#onInspectElement,
|
|
296
309
|
networkTimeCalculator: this.#networkTimeCalculator,
|
|
310
|
+
history,
|
|
297
311
|
};
|
|
298
312
|
switch (type) {
|
|
299
313
|
case ConversationType.STYLING: {
|
|
@@ -404,6 +418,12 @@ Time: ${micros(time)}`;
|
|
|
404
418
|
multimodalInput?: MultimodalInput,
|
|
405
419
|
} = {},
|
|
406
420
|
): AsyncGenerator<ResponseData, void, void> {
|
|
421
|
+
if (this.isBlockedByOrigin) {
|
|
422
|
+
// This error should not be reached. If it happens, some
|
|
423
|
+
// invariants do not hold anymore.
|
|
424
|
+
throw new Error('cross-origin context data should not be included');
|
|
425
|
+
}
|
|
426
|
+
|
|
407
427
|
const userQuery: UserQuery = {
|
|
408
428
|
type: ResponseType.USER_QUERY,
|
|
409
429
|
query: initialQuery,
|
|
@@ -141,6 +141,7 @@ export interface AgentOptions {
|
|
|
141
141
|
sessionId?: string;
|
|
142
142
|
confirmSideEffectForTest?: typeof Promise.withResolvers;
|
|
143
143
|
onInspectElement?: () => Promise<SDK.DOMModel.DOMNode|null>;
|
|
144
|
+
history?: Host.AidaClient.Content[];
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
export interface ParsedAnswer {
|
|
@@ -311,7 +312,7 @@ export abstract class AiAgent<T> {
|
|
|
311
312
|
*/
|
|
312
313
|
protected context?: ConversationContext<T>;
|
|
313
314
|
|
|
314
|
-
#history: Host.AidaClient.Content[]
|
|
315
|
+
#history: Host.AidaClient.Content[];
|
|
315
316
|
|
|
316
317
|
#facts: Set<Host.AidaClient.RequestFact> = new Set<Host.AidaClient.RequestFact>();
|
|
317
318
|
|
|
@@ -326,6 +327,7 @@ export abstract class AiAgent<T> {
|
|
|
326
327
|
}
|
|
327
328
|
this.#sessionId = opts.sessionId ?? crypto.randomUUID();
|
|
328
329
|
this.confirmSideEffect = opts.confirmSideEffectForTest ?? (() => Promise.withResolvers());
|
|
330
|
+
this.#history = opts.history ?? [];
|
|
329
331
|
}
|
|
330
332
|
|
|
331
333
|
async enhanceQuery(query: string, selected: ConversationContext<T>|null, multimodalInputType?: MultimodalInputType):
|
|
@@ -338,6 +340,10 @@ export abstract class AiAgent<T> {
|
|
|
338
340
|
return this.#facts;
|
|
339
341
|
}
|
|
340
342
|
|
|
343
|
+
get history(): Host.AidaClient.Content[] {
|
|
344
|
+
return [...this.#history];
|
|
345
|
+
}
|
|
346
|
+
|
|
341
347
|
/**
|
|
342
348
|
* Add a fact which will be sent for any subsequent requests.
|
|
343
349
|
* Returns the new list of all facts.
|
|
@@ -72,7 +72,7 @@ Content:
|
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"name": "selectSourceFile",
|
|
75
|
-
"description": "Selects a source file. Use this when asked about files on the page.",
|
|
75
|
+
"description": "Selects a source file. Use this when asked about files on the page. Use listSourceFiles if you don't know the full path name.",
|
|
76
76
|
"parameters": {
|
|
77
77
|
"type": 6,
|
|
78
78
|
"description": "",
|
|
@@ -83,7 +83,7 @@ Content:
|
|
|
83
83
|
"properties": {
|
|
84
84
|
"name": {
|
|
85
85
|
"type": 1,
|
|
86
|
-
"description": "The name of the file you want to select.",
|
|
86
|
+
"description": "The full path name of the file you want to select.",
|
|
87
87
|
"nullable": false
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -191,23 +191,27 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
191
191
|
displayInfoFromArgs: () => {
|
|
192
192
|
return {
|
|
193
193
|
title: lockedString('Listing source requests…'),
|
|
194
|
-
action: '
|
|
194
|
+
action: 'listSourceFiles()',
|
|
195
195
|
};
|
|
196
196
|
},
|
|
197
197
|
handler: async () => {
|
|
198
|
-
|
|
198
|
+
// We get multiple of the same file name
|
|
199
|
+
// so we create a set and the pick based
|
|
200
|
+
// on heuristics in the select function
|
|
201
|
+
const files = new Set();
|
|
199
202
|
for (const file of this.#getUISourceCodes()) {
|
|
200
|
-
files.
|
|
203
|
+
files.add(file.fullDisplayName());
|
|
201
204
|
}
|
|
202
205
|
|
|
203
206
|
return {
|
|
204
|
-
result: files,
|
|
207
|
+
result: [...files],
|
|
205
208
|
};
|
|
206
209
|
},
|
|
207
210
|
});
|
|
208
211
|
|
|
209
212
|
this.declareFunction<{name: string}>('selectSourceFile', {
|
|
210
|
-
description:
|
|
213
|
+
description:
|
|
214
|
+
`Selects a source file. Use this when asked about files on the page. Use listSourceFiles if you don't know the full path name.`,
|
|
211
215
|
parameters: {
|
|
212
216
|
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
213
217
|
description: '',
|
|
@@ -216,7 +220,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
216
220
|
properties: {
|
|
217
221
|
name: {
|
|
218
222
|
type: Host.AidaClient.ParametersTypes.STRING,
|
|
219
|
-
description: 'The name of the file you want to select.',
|
|
223
|
+
description: 'The full path name of the file you want to select.',
|
|
220
224
|
nullable: false,
|
|
221
225
|
},
|
|
222
226
|
},
|
|
@@ -228,17 +232,21 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
228
232
|
};
|
|
229
233
|
},
|
|
230
234
|
handler: async params => {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
// In some cases we get multiple files
|
|
236
|
+
// use the heuristics bellow to pick the better one
|
|
237
|
+
const files = this.#getUISourceCodes().filter(file => file.fullDisplayName() === params.name);
|
|
238
|
+
|
|
239
|
+
if (files.length === 0) {
|
|
240
|
+
return {
|
|
241
|
+
error: 'Unable to find file.',
|
|
242
|
+
};
|
|
238
243
|
}
|
|
239
244
|
|
|
245
|
+
// This help us pick the file that is resolved source map.
|
|
246
|
+
const file = files.find(f => f.contentType().isFromSourceMap()) ?? files[0];
|
|
240
247
|
return {
|
|
241
|
-
|
|
248
|
+
context: new FileContext(file),
|
|
249
|
+
description: 'User selected a source file',
|
|
242
250
|
};
|
|
243
251
|
},
|
|
244
252
|
});
|
|
@@ -307,22 +315,16 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
307
315
|
});
|
|
308
316
|
}
|
|
309
317
|
|
|
310
|
-
#getUISourceCodes = ():
|
|
318
|
+
#getUISourceCodes = (): Workspace.UISourceCode.UISourceCode[] => {
|
|
311
319
|
const workspace = Workspace.Workspace.WorkspaceImpl.instance();
|
|
312
|
-
const projects =
|
|
313
|
-
|
|
314
|
-
case Workspace.Workspace.projectTypes.Network:
|
|
315
|
-
case Workspace.Workspace.projectTypes.FileSystem:
|
|
316
|
-
case Workspace.Workspace.projectTypes.ConnectableFileSystem:
|
|
317
|
-
return true;
|
|
318
|
-
|
|
319
|
-
default:
|
|
320
|
-
return false;
|
|
321
|
-
}
|
|
322
|
-
});
|
|
320
|
+
const projects =
|
|
321
|
+
workspace.projects().filter(project => project.type() === Workspace.Workspace.projectTypes.Network);
|
|
323
322
|
const uiSourceCodes = [];
|
|
324
323
|
for (const project of projects) {
|
|
325
324
|
for (const uiSourceCode of project.uiSourceCodes()) {
|
|
325
|
+
if (uiSourceCode.isIgnoreListed()) {
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
326
328
|
uiSourceCodes.push(uiSourceCode);
|
|
327
329
|
}
|
|
328
330
|
}
|
|
@@ -434,7 +434,7 @@ export class DebuggerLanguagePluginManager implements
|
|
|
434
434
|
private async evaluateOnCallFrame(
|
|
435
435
|
callFrame: SDK.DebuggerModel.CallFrame, options: SDK.RuntimeModel.EvaluationOptions): Promise<{
|
|
436
436
|
object: SDK.RemoteObject.RemoteObject,
|
|
437
|
-
exceptionDetails
|
|
437
|
+
exceptionDetails?: Protocol.Runtime.ExceptionDetails,
|
|
438
438
|
}|{
|
|
439
439
|
error: string,
|
|
440
440
|
}|null> {
|
|
@@ -460,9 +460,9 @@ export class DebuggerLanguagePluginManager implements
|
|
|
460
460
|
try {
|
|
461
461
|
const object = await plugin.evaluate(expression, location, this.stopIdForCallFrame(callFrame));
|
|
462
462
|
if (object) {
|
|
463
|
-
return {object: await wrapRemoteObject(callFrame, object, plugin)
|
|
463
|
+
return {object: await wrapRemoteObject(callFrame, object, plugin)};
|
|
464
464
|
}
|
|
465
|
-
return {object: new SDK.RemoteObject.LocalJSONObject(undefined)
|
|
465
|
+
return {object: new SDK.RemoteObject.LocalJSONObject(undefined)};
|
|
466
466
|
} catch (error) {
|
|
467
467
|
if (error instanceof FormattingError) {
|
|
468
468
|
const {exception: object, exceptionDetails} = error;
|
|
@@ -794,14 +794,12 @@ export class DebuggerLanguagePluginManager implements
|
|
|
794
794
|
if (uiLocation) {
|
|
795
795
|
return {
|
|
796
796
|
uiSourceCode: uiLocation.uiSourceCode,
|
|
797
|
-
url: undefined,
|
|
798
797
|
name,
|
|
799
798
|
line: uiLocation.lineNumber,
|
|
800
799
|
column: uiLocation.columnNumber ?? -1,
|
|
801
800
|
};
|
|
802
801
|
}
|
|
803
802
|
return {
|
|
804
|
-
uiSourceCode: undefined,
|
|
805
803
|
url: fallback.url,
|
|
806
804
|
name: fallback.functionName,
|
|
807
805
|
line: fallback.lineNumber,
|
|
@@ -700,9 +700,6 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
700
700
|
positionX,
|
|
701
701
|
positionY,
|
|
702
702
|
dontSetVisibleSize: true,
|
|
703
|
-
displayFeature: undefined,
|
|
704
|
-
devicePosture: undefined,
|
|
705
|
-
screenOrientation: undefined,
|
|
706
703
|
};
|
|
707
704
|
if (displayFeature) {
|
|
708
705
|
metrics.displayFeature = displayFeature;
|
|
@@ -385,7 +385,7 @@ declare global {
|
|
|
385
385
|
injectedScriptId: number, targetWindow?: Window) => void;
|
|
386
386
|
buildExtensionAPIInjectedScript(
|
|
387
387
|
extensionInfo: ExtensionDescriptor, inspectedTabId: string, themeName: string, keysToForward: number[],
|
|
388
|
-
testHook
|
|
388
|
+
testHook?: (extensionServer: unknown, extensionAPI: unknown) => unknown): string;
|
|
389
389
|
chrome: PublicAPI.Chrome.DevTools.Chrome;
|
|
390
390
|
webInspector?: APIImpl.InspectorExtensionAPI;
|
|
391
391
|
}
|
|
@@ -432,7 +432,7 @@ namespace APIImpl {
|
|
|
432
432
|
export interface EventSink<ListenerT extends Callable> extends PublicAPI.Chrome.DevTools.EventSink<ListenerT> {
|
|
433
433
|
_type: string;
|
|
434
434
|
_listeners: ListenerT[];
|
|
435
|
-
_customDispatch
|
|
435
|
+
_customDispatch?: (this: EventSink<ListenerT>, request: {arguments: unknown[]}) => unknown;
|
|
436
436
|
|
|
437
437
|
_fire(..._vararg: Parameters<ListenerT>): void;
|
|
438
438
|
_dispatch(request: {arguments: unknown[]}): void;
|
|
@@ -162,7 +162,6 @@ export class Importer {
|
|
|
162
162
|
const includedRequestCookies = entry.request.cookies.map(
|
|
163
163
|
cookie => ({
|
|
164
164
|
cookie: this.fillCookieFromHARCookie(SDK.Cookie.Type.REQUEST, cookie),
|
|
165
|
-
exemptionReason: undefined,
|
|
166
165
|
}),
|
|
167
166
|
);
|
|
168
167
|
request.setIncludedRequestCookies(includedRequestCookies);
|
|
@@ -120,15 +120,11 @@ export class Entry {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
const entry: EntryDTO = {
|
|
123
|
-
_connectionId: undefined,
|
|
124
|
-
_fromCache: undefined,
|
|
125
123
|
_initiator: exportedInitiator,
|
|
126
124
|
_priority: harEntry.request.priority(),
|
|
127
125
|
_resourceType: harEntry.request.resourceType().name(),
|
|
128
|
-
_webSocketMessages: undefined,
|
|
129
126
|
cache: {},
|
|
130
127
|
connection,
|
|
131
|
-
pageref: undefined,
|
|
132
128
|
request: await harEntry.buildRequest(),
|
|
133
129
|
response: harEntry.buildResponse(),
|
|
134
130
|
// IPv6 address should not have square brackets per (https://tools.ietf.org/html/rfc2373#section-2.2).
|
|
@@ -195,7 +191,6 @@ export class Entry {
|
|
|
195
191
|
this.request.includedRequestCookies().map(includedRequestCookie => includedRequestCookie.cookie)),
|
|
196
192
|
headersSize: headersText ? headersText.length : -1,
|
|
197
193
|
bodySize: await this.requestBodySize(),
|
|
198
|
-
postData: undefined,
|
|
199
194
|
};
|
|
200
195
|
const postData = await this.buildPostData();
|
|
201
196
|
if (postData) {
|
|
@@ -232,11 +227,10 @@ export class Entry {
|
|
|
232
227
|
}
|
|
233
228
|
|
|
234
229
|
private buildContent(): Content {
|
|
235
|
-
const content =
|
|
230
|
+
const content: Content = {
|
|
236
231
|
size: this.request.resourceSize,
|
|
237
232
|
mimeType: this.request.mimeType || 'x-unknown',
|
|
238
|
-
|
|
239
|
-
} as Content);
|
|
233
|
+
};
|
|
240
234
|
const compression = this.responseCompression;
|
|
241
235
|
if (typeof compression === 'number') {
|
|
242
236
|
content.compression = compression;
|
|
@@ -261,7 +255,6 @@ export class Entry {
|
|
|
261
255
|
wait: 0,
|
|
262
256
|
receive: 0,
|
|
263
257
|
_blocked_queueing: -1,
|
|
264
|
-
_blocked_proxy: undefined,
|
|
265
258
|
};
|
|
266
259
|
|
|
267
260
|
const queuedTime = (issueTime < startTime) ? startTime - issueTime : -1;
|
|
@@ -373,8 +366,6 @@ export class Entry {
|
|
|
373
366
|
expires: cookie.expiresDate(Log.pseudoWallTime(this.request, this.request.startTime)),
|
|
374
367
|
httpOnly: cookie.httpOnly(),
|
|
375
368
|
secure: cookie.secure(),
|
|
376
|
-
sameSite: undefined,
|
|
377
|
-
partitionKey: undefined,
|
|
378
369
|
};
|
|
379
370
|
if (cookie.sameSite()) {
|
|
380
371
|
c.sameSite = cookie.sameSite();
|
|
@@ -6789,10 +6789,6 @@ export const NativeFunctions = [
|
|
|
6789
6789
|
name: "MouseEvent",
|
|
6790
6790
|
signatures: [["type","?eventInitDict"]]
|
|
6791
6791
|
},
|
|
6792
|
-
{
|
|
6793
|
-
name: "OverscrollEvent",
|
|
6794
|
-
signatures: [["type","bubbles","?eventInitDict"]]
|
|
6795
|
-
},
|
|
6796
6792
|
{
|
|
6797
6793
|
name: "PageTransitionEvent",
|
|
6798
6794
|
signatures: [["type","?eventInitDict"]]
|
|
@@ -8936,7 +8932,7 @@ export const NativeFunctions = [
|
|
|
8936
8932
|
},
|
|
8937
8933
|
{
|
|
8938
8934
|
name: "framebufferTexturePixelLocalStorageWEBGL",
|
|
8939
|
-
signatures: [["plane","texture","level","layer"]]
|
|
8935
|
+
signatures: [["plane","texture","level","layer","usage"]]
|
|
8940
8936
|
},
|
|
8941
8937
|
{
|
|
8942
8938
|
name: "framebufferPixelLocalClearValuefvWEBGL",
|
|
@@ -159,7 +159,6 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
|
|
|
159
159
|
initiatorInfo = {
|
|
160
160
|
info: null,
|
|
161
161
|
chain: null,
|
|
162
|
-
request: undefined,
|
|
163
162
|
};
|
|
164
163
|
this.#initiatorData.set(request, initiatorInfo);
|
|
165
164
|
return initiatorInfo;
|
|
@@ -170,7 +169,6 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
|
|
|
170
169
|
const initiatorInfo: InitiatorData = existingInitiatorData || {
|
|
171
170
|
info: null,
|
|
172
171
|
chain: null,
|
|
173
|
-
request: undefined,
|
|
174
172
|
};
|
|
175
173
|
|
|
176
174
|
let type = SDK.NetworkRequest.InitiatorType.OTHER;
|
|
@@ -212,7 +212,10 @@ export class NetworkTimeCalculator extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
212
212
|
const leftLabel = hasLatency ? i18n.TimeUtilities.secondsToString(request.latency) : rightLabel;
|
|
213
213
|
|
|
214
214
|
if (request.timing) {
|
|
215
|
-
return {
|
|
215
|
+
return {
|
|
216
|
+
left: leftLabel,
|
|
217
|
+
right: rightLabel,
|
|
218
|
+
};
|
|
216
219
|
}
|
|
217
220
|
|
|
218
221
|
let tooltip;
|
|
@@ -107,14 +107,11 @@ export class FilterParser {
|
|
|
107
107
|
if (this.keys.indexOf((parsedKey as string)) !== -1) {
|
|
108
108
|
parsedFilters.push({
|
|
109
109
|
key: parsedKey,
|
|
110
|
-
regex: undefined,
|
|
111
110
|
text: parsedValue,
|
|
112
111
|
negative: Boolean(startsWithMinus),
|
|
113
112
|
});
|
|
114
113
|
} else {
|
|
115
114
|
parsedFilters.push({
|
|
116
|
-
key: undefined,
|
|
117
|
-
regex: undefined,
|
|
118
115
|
text: `${parsedKey}:${parsedValue}`,
|
|
119
116
|
negative: Boolean(startsWithMinus),
|
|
120
117
|
});
|
|
@@ -124,15 +121,11 @@ export class FilterParser {
|
|
|
124
121
|
const parsedRegex = captureGroups[1];
|
|
125
122
|
try {
|
|
126
123
|
parsedFilters.push({
|
|
127
|
-
key: undefined,
|
|
128
124
|
regex: new RegExp((parsedRegex as string), 'im'),
|
|
129
|
-
text: undefined,
|
|
130
125
|
negative: Boolean(startsWithMinus),
|
|
131
126
|
});
|
|
132
127
|
} catch {
|
|
133
128
|
parsedFilters.push({
|
|
134
|
-
key: undefined,
|
|
135
|
-
regex: undefined,
|
|
136
129
|
text: `/${parsedRegex}/`,
|
|
137
130
|
negative: Boolean(startsWithMinus),
|
|
138
131
|
});
|
|
@@ -141,8 +134,6 @@ export class FilterParser {
|
|
|
141
134
|
const startsWithMinus = captureGroups[0];
|
|
142
135
|
const parsedText = captureGroups[1];
|
|
143
136
|
parsedFilters.push({
|
|
144
|
-
key: undefined,
|
|
145
|
-
regex: undefined,
|
|
146
137
|
text: parsedText,
|
|
147
138
|
negative: Boolean(startsWithMinus),
|
|
148
139
|
});
|
|
@@ -193,12 +193,7 @@ function createLanternRequest(
|
|
|
193
193
|
priority: request.args.data.priority,
|
|
194
194
|
frameId: request.args.data.frame,
|
|
195
195
|
fromWorker,
|
|
196
|
-
serverResponseTime: request.args.data.lrServerResponseTime
|
|
197
|
-
// Set later.
|
|
198
|
-
redirects: undefined,
|
|
199
|
-
redirectSource: undefined,
|
|
200
|
-
redirectDestination: undefined,
|
|
201
|
-
initiatorRequest: undefined,
|
|
196
|
+
serverResponseTime: request.args.data.lrServerResponseTime,
|
|
202
197
|
};
|
|
203
198
|
}
|
|
204
199
|
|
|
@@ -615,10 +615,7 @@ function getRawLineAndColumnNumbersForEvent(event: Types.Events.Event): {
|
|
|
615
615
|
columnNumber?: number,
|
|
616
616
|
} {
|
|
617
617
|
if (!event.args?.data) {
|
|
618
|
-
return {
|
|
619
|
-
lineNumber: undefined,
|
|
620
|
-
columnNumber: undefined,
|
|
621
|
-
};
|
|
618
|
+
return {};
|
|
622
619
|
}
|
|
623
620
|
let lineNumber: number|undefined = undefined;
|
|
624
621
|
let columnNumber: number|undefined = undefined;
|