chrome-devtools-frontend 1.0.1570343 → 1.0.1571007
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/contributing/infrastructure.md +22 -0
- package/front_end/core/host/AidaClient.ts +1 -1
- package/front_end/core/root/Runtime.ts +6 -0
- package/front_end/core/sdk/DebuggerModel.ts +2 -21
- package/front_end/core/sdk/SourceMap.ts +0 -9
- package/front_end/core/sdk/SourceMapScopesInfo.ts +0 -24
- package/front_end/entrypoints/main/MainImpl.ts +14 -0
- package/front_end/models/ai_assistance/BuiltInAi.ts +5 -4
- package/front_end/panels/network/RequestConditionsDrawer.ts +0 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
|
@@ -281,6 +281,28 @@ even if it consistently failed 4 times out of 5 runs for some time. Try to
|
|
|
281
281
|
correlate your failure with a luci-analysis report on this test and skip it
|
|
282
282
|
until the flakiness gets resolved.
|
|
283
283
|
|
|
284
|
+
### Clobber a builder's cache
|
|
285
|
+
|
|
286
|
+
Builder bots utilize caching for project checkouts to speed up updates. This
|
|
287
|
+
cache includes the build output directory (`/out`). Occasionally, stale files
|
|
288
|
+
within these directories can interfere with the build process or test execution.
|
|
289
|
+
|
|
290
|
+
If you suspect a cache issue, you can clear (clobber) the cache for a specific
|
|
291
|
+
builder. This requires a local Chromium checkout to access the necessary utility
|
|
292
|
+
script.
|
|
293
|
+
|
|
294
|
+
Run the following command from the root of your Chromium checkout:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
./tools/infra/builder-cache-clobber.py -S https://chromium-swarm.appspot.com/ --builder "Stand-alone Mac-arm64" --bucket ci --project devtools-frontend
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
#### Note about caches on try bots:
|
|
301
|
+
|
|
302
|
+
Try bots (CQ) operate in tester/compilator pairs. When clearing caches, ensure
|
|
303
|
+
you target both builders in the pair. For example, if you clear the cache for
|
|
304
|
+
`dtf_mac_arm64_rel`, you must also clear it for `dtf_mac_arm64_compile_rel`.
|
|
305
|
+
|
|
284
306
|
## Luci Analysis configuration
|
|
285
307
|
|
|
286
308
|
[Luci Analysis](go/luci-analysis) is a tool that helps you understand the
|
|
@@ -79,7 +79,7 @@ export interface FunctionObjectParam<T extends string|number|symbol = string> ex
|
|
|
79
79
|
type: ParametersTypes.OBJECT;
|
|
80
80
|
// TODO: this can be also be ObjectParams
|
|
81
81
|
properties: Record<T, FunctionPrimitiveParams|FunctionArrayParam>;
|
|
82
|
-
required:
|
|
82
|
+
required: T[];
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
@@ -522,6 +522,11 @@ interface HostConfigAiAssistanceContextSelectionAgent {
|
|
|
522
522
|
enabled: boolean;
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
+
interface ConsoleInsightsTeasers {
|
|
526
|
+
enabled: boolean;
|
|
527
|
+
allowWithoutGpu: boolean;
|
|
528
|
+
}
|
|
529
|
+
|
|
525
530
|
/**
|
|
526
531
|
* The host configuration that we expect from the DevTools back-end.
|
|
527
532
|
*
|
|
@@ -570,6 +575,7 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
|
|
|
570
575
|
devToolsAiPromptApi: AiPromptApi,
|
|
571
576
|
devToolsEnableDurableMessages: DevToolsEnableDurableMessages,
|
|
572
577
|
devToolsAiAssistanceContextSelectionAgent: HostConfigAiAssistanceContextSelectionAgent,
|
|
578
|
+
devToolsConsoleInsightsTeasers: ConsoleInsightsTeasers,
|
|
573
579
|
}>;
|
|
574
580
|
|
|
575
581
|
/**
|
|
@@ -653,26 +653,6 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
653
653
|
if (this.#expandCallFramesCallback) {
|
|
654
654
|
pausedDetails.callFrames = await this.#expandCallFramesCallback.call(null, pausedDetails.callFrames);
|
|
655
655
|
}
|
|
656
|
-
|
|
657
|
-
if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.USE_SOURCE_MAP_SCOPES)) {
|
|
658
|
-
return;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
// TODO(crbug.com/40277685): Support attaching/detaching source maps after pausing.
|
|
662
|
-
// Expanding call frames via source maps here is only suitable for the experiment prototype because
|
|
663
|
-
// we block until all relevant source maps are loaded.
|
|
664
|
-
// We should change this so the "Debugger Plugin" and "Source Map" have a bottle neck where they expand
|
|
665
|
-
// call frames and that bottleneck should support attaching/detaching source maps while paused.
|
|
666
|
-
const finalFrames: CallFrame[] = [];
|
|
667
|
-
for (const frame of pausedDetails.callFrames) {
|
|
668
|
-
const sourceMap = await this.sourceMapManager().sourceMapForClientPromise(frame.script);
|
|
669
|
-
if (sourceMap?.hasScopeInfo()) {
|
|
670
|
-
finalFrames.push(...sourceMap.expandCallFrame(frame));
|
|
671
|
-
} else {
|
|
672
|
-
finalFrames.push(frame);
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
pausedDetails.callFrames = finalFrames;
|
|
676
656
|
}
|
|
677
657
|
|
|
678
658
|
resumedScript(): void {
|
|
@@ -707,7 +687,8 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
|
707
687
|
this.registerScript(script);
|
|
708
688
|
this.dispatchEventToListeners(Events.ParsedScriptSource, script);
|
|
709
689
|
|
|
710
|
-
if (
|
|
690
|
+
if ((!selectedDebugSymbol || selectedDebugSymbol.type === Protocol.Debugger.DebugSymbolsType.SourceMap) &&
|
|
691
|
+
script.sourceMapURL && !hasSyntaxError) {
|
|
711
692
|
this.#sourceMapManager.attachSourceMap(script, script.sourceURL, script.sourceMapURL);
|
|
712
693
|
}
|
|
713
694
|
|
|
@@ -770,15 +770,6 @@ export class SourceMap {
|
|
|
770
770
|
this.hasIgnoreListHint(sourceURL) === other.hasIgnoreListHint(sourceURL);
|
|
771
771
|
}
|
|
772
772
|
|
|
773
|
-
expandCallFrame(frame: CallFrame): CallFrame[] {
|
|
774
|
-
this.#ensureSourceMapProcessed();
|
|
775
|
-
if (this.#scopesInfo === null) {
|
|
776
|
-
return [frame];
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
return this.#scopesInfo.expandCallFrame(frame);
|
|
780
|
-
}
|
|
781
|
-
|
|
782
773
|
resolveScopeChain(frame: CallFrame): ScopeChainEntry[]|null {
|
|
783
774
|
this.#ensureSourceMapProcessed();
|
|
784
775
|
if (this.#scopesInfo === null) {
|
|
@@ -276,30 +276,6 @@ export class SourceMapScopesInfo {
|
|
|
276
276
|
return result;
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
/**
|
|
280
|
-
* Takes a V8 provided call frame and expands any inlined frames into virtual call frames.
|
|
281
|
-
*
|
|
282
|
-
* For call frames where nothing was inlined, the result contains only a single element,
|
|
283
|
-
* the provided frame but with the original name.
|
|
284
|
-
*
|
|
285
|
-
* For call frames where we are paused in inlined code, this function returns a list of
|
|
286
|
-
* call frames from "inner to outer". This is the call frame at index 0
|
|
287
|
-
* signifies the top of this stack trace fragment.
|
|
288
|
-
*
|
|
289
|
-
* The rest are "virtual" call frames and will have an "inlineFrameIndex" set in ascending
|
|
290
|
-
* order, so the condition `result[index] === result[index].inlineFrameIndex` always holds.
|
|
291
|
-
*/
|
|
292
|
-
expandCallFrame(callFrame: CallFrame): CallFrame[] {
|
|
293
|
-
const {originalFunctionName, inlinedFunctions} =
|
|
294
|
-
this.findInlinedFunctions(callFrame.location().lineNumber, callFrame.location().columnNumber);
|
|
295
|
-
const result: CallFrame[] = [];
|
|
296
|
-
for (const [index, fn] of inlinedFunctions.entries()) {
|
|
297
|
-
result.push(callFrame.createVirtualCallFrame(index, fn.name));
|
|
298
|
-
}
|
|
299
|
-
result.push(callFrame.createVirtualCallFrame(result.length, originalFunctionName));
|
|
300
|
-
return result;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
279
|
/**
|
|
304
280
|
* Given a generated position, this returns all the surrounding generated ranges from outer
|
|
305
281
|
* to inner.
|
|
@@ -58,6 +58,7 @@ import * as PanelCommon from '../../panels/common/common.js';
|
|
|
58
58
|
import * as Snippets from '../../panels/snippets/snippets.js';
|
|
59
59
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
60
60
|
import * as Snackbar from '../../ui/components/snackbars/snackbars.js';
|
|
61
|
+
import * as UIHelpers from '../../ui/helpers/helpers.js';
|
|
61
62
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
62
63
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
63
64
|
import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
|
|
@@ -128,6 +129,10 @@ const UIStrings = {
|
|
|
128
129
|
* @description Notification shown to the user whenever DevTools has finished downloading a local AI model.
|
|
129
130
|
*/
|
|
130
131
|
aiModelDownloaded: 'AI model downloaded',
|
|
132
|
+
/**
|
|
133
|
+
* @description A title of the menu item in the main menu leading to https://github.com/ChromeDevTools/chrome-devtools-mcp.
|
|
134
|
+
*/
|
|
135
|
+
getDevToolsMcp: 'Get `DevTools MCP`'
|
|
131
136
|
} as const;
|
|
132
137
|
const str_ = i18n.i18n.registerUIStrings('entrypoints/main/MainImpl.ts', UIStrings);
|
|
133
138
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -942,6 +947,15 @@ export class MainMenuItem implements UI.Toolbar.Provider {
|
|
|
942
947
|
|
|
943
948
|
contextMenu.defaultSection().appendAction('freestyler.main-menu', undefined, /* optional */ true);
|
|
944
949
|
|
|
950
|
+
contextMenu.defaultSection().appendItem(i18nString(UIStrings.getDevToolsMcp), () => {
|
|
951
|
+
UIHelpers.openInNewTab('https://github.com/ChromeDevTools/chrome-devtools-mcp');
|
|
952
|
+
}, {
|
|
953
|
+
additionalElement: UI.UIUtils.maybeCreateNewBadge('get-devtools-mcp'),
|
|
954
|
+
jslogContext: 'get-devtools-mcp',
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
contextMenu.defaultSection().appendSeparator();
|
|
958
|
+
|
|
945
959
|
if (dockController.dockSide() === UI.DockController.DockState.UNDOCKED) {
|
|
946
960
|
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
947
961
|
if (mainTarget && mainTarget.type() === SDK.Target.Type.FRAME) {
|
|
@@ -47,7 +47,8 @@ export class BuiltInAi extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
async getLanguageModelAvailability(): Promise<LanguageModelAvailability> {
|
|
50
|
-
if (!Root.Runtime.hostConfig.
|
|
50
|
+
if (!Root.Runtime.hostConfig.devToolsConsoleInsightsTeasers?.enabled ||
|
|
51
|
+
(Root.Runtime.hostConfig.devToolsAiPromptApi && !Root.Runtime.hostConfig.devToolsAiPromptApi.enabled)) {
|
|
51
52
|
this.#availability = LanguageModelAvailability.DISABLED;
|
|
52
53
|
return this.#availability;
|
|
53
54
|
}
|
|
@@ -74,7 +75,7 @@ export class BuiltInAi extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
isEventuallyAvailable(): boolean {
|
|
77
|
-
if (!this.#hasGpu && !Boolean(Root.Runtime.hostConfig.
|
|
78
|
+
if (!this.#hasGpu && !Boolean(Root.Runtime.hostConfig.devToolsConsoleInsightsTeasers?.allowWithoutGpu)) {
|
|
78
79
|
return false;
|
|
79
80
|
}
|
|
80
81
|
return this.#availability === LanguageModelAvailability.AVAILABLE ||
|
|
@@ -92,7 +93,7 @@ export class BuiltInAi extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
startDownloadingModel(): void {
|
|
95
|
-
if (!Root.Runtime.hostConfig.
|
|
96
|
+
if (!Root.Runtime.hostConfig.devToolsConsoleInsightsTeasers?.allowWithoutGpu && !this.#hasGpu) {
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
98
99
|
if (this.#availability !== LanguageModelAvailability.DOWNLOADABLE) {
|
|
@@ -132,7 +133,7 @@ export class BuiltInAi extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
async initialize(): Promise<void> {
|
|
135
|
-
if (!Root.Runtime.hostConfig.
|
|
136
|
+
if (!Root.Runtime.hostConfig.devToolsConsoleInsightsTeasers?.allowWithoutGpu && !this.#hasGpu) {
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
139
|
if (this.#availability !== LanguageModelAvailability.AVAILABLE &&
|
|
@@ -181,7 +181,6 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
181
181
|
render(
|
|
182
182
|
// clang-format off
|
|
183
183
|
html`
|
|
184
|
-
<style>${RequestConditionsDrawer}</style>
|
|
185
184
|
<devtools-toolbar jslog=${VisualLogging.toolbar()}>
|
|
186
185
|
<devtools-checkbox
|
|
187
186
|
?checked=${input.enabled}
|
package/package.json
CHANGED