chrome-devtools-mcp 0.25.0 → 0.26.0
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/README.md +1 -1
- package/build/src/ToolHandler.js +188 -0
- package/build/src/bin/chrome-devtools-cli-options.js +1 -1
- package/build/src/bin/chrome-devtools-mcp-main.js +4 -3
- package/build/src/bin/chrome-devtools.js +0 -2
- package/build/src/index.js +9 -164
- package/build/src/telemetry/ClearcutLogger.js +27 -0
- package/build/src/telemetry/errors.js +14 -0
- package/build/src/telemetry/types.js +0 -8
- package/build/src/third_party/THIRD_PARTY_NOTICES +9 -11
- package/build/src/third_party/bundled-packages.json +2 -2
- package/build/src/third_party/devtools-formatter-worker.js +31 -33
- package/build/src/third_party/devtools-heap-snapshot-worker.js +42 -44
- package/build/src/third_party/index.js +1560 -1074
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +4236 -4219
- package/build/src/tools/input.js +28 -7
- package/build/src/tools/lighthouse.js +7 -7
- package/build/src/version.js +1 -1
- package/package.json +6 -6
|
@@ -2644,10 +2644,8 @@ var ExperimentName;
|
|
|
2644
2644
|
(function (ExperimentName) {
|
|
2645
2645
|
ExperimentName["ALL"] = "*";
|
|
2646
2646
|
ExperimentName["CAPTURE_NODE_CREATION_STACKS"] = "capture-node-creation-stacks";
|
|
2647
|
-
ExperimentName["LIVE_HEAP_PROFILE"] = "live-heap-profile";
|
|
2648
2647
|
ExperimentName["PROTOCOL_MONITOR"] = "protocol-monitor";
|
|
2649
2648
|
ExperimentName["TIMELINE_INVALIDATION_TRACKING"] = "timeline-invalidation-tracking";
|
|
2650
|
-
ExperimentName["FONT_EDITOR"] = "font-editor";
|
|
2651
2649
|
ExperimentName["INSTRUMENTATION_BREAKPOINTS"] = "instrumentation-breakpoints";
|
|
2652
2650
|
ExperimentName["USE_SOURCE_MAP_SCOPES"] = "use-source-map-scopes";
|
|
2653
2651
|
ExperimentName["TIMELINE_DEBUG_MODE"] = "timeline-debug-mode";
|
|
@@ -3347,12 +3345,12 @@ pp$9.isSimpleAssignTarget = function (expr) {
|
|
|
3347
3345
|
};
|
|
3348
3346
|
var pp$8 = Parser$1.prototype;
|
|
3349
3347
|
pp$8.parseTopLevel = function (node) {
|
|
3350
|
-
var exports
|
|
3348
|
+
var exports = Object.create(null);
|
|
3351
3349
|
if (!node.body) {
|
|
3352
3350
|
node.body = [];
|
|
3353
3351
|
}
|
|
3354
3352
|
while (this.type !== types$1.eof) {
|
|
3355
|
-
var stmt = this.parseStatement(null, true, exports
|
|
3353
|
+
var stmt = this.parseStatement(null, true, exports);
|
|
3356
3354
|
node.body.push(stmt);
|
|
3357
3355
|
}
|
|
3358
3356
|
if (this.inModule) {
|
|
@@ -3410,7 +3408,7 @@ pp$8.isAsyncFunction = function () {
|
|
|
3410
3408
|
(next + 8 === this.input.length ||
|
|
3411
3409
|
!(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00));
|
|
3412
3410
|
};
|
|
3413
|
-
pp$8.parseStatement = function (context, topLevel, exports
|
|
3411
|
+
pp$8.parseStatement = function (context, topLevel, exports) {
|
|
3414
3412
|
var starttype = this.type, node = this.startNode(), kind;
|
|
3415
3413
|
if (this.isLet(context)) {
|
|
3416
3414
|
starttype = types$1._var;
|
|
@@ -3467,7 +3465,7 @@ pp$8.parseStatement = function (context, topLevel, exports$1) {
|
|
|
3467
3465
|
this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
|
|
3468
3466
|
}
|
|
3469
3467
|
}
|
|
3470
|
-
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports
|
|
3468
|
+
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports);
|
|
3471
3469
|
default:
|
|
3472
3470
|
if (this.isAsyncFunction()) {
|
|
3473
3471
|
if (context) {
|
|
@@ -4144,11 +4142,11 @@ function checkKeyName(node, name) {
|
|
|
4144
4142
|
return !computed && (key.type === "Identifier" && key.name === name ||
|
|
4145
4143
|
key.type === "Literal" && key.value === name);
|
|
4146
4144
|
}
|
|
4147
|
-
pp$8.parseExportAllDeclaration = function (node, exports
|
|
4145
|
+
pp$8.parseExportAllDeclaration = function (node, exports) {
|
|
4148
4146
|
if (this.options.ecmaVersion >= 11) {
|
|
4149
4147
|
if (this.eatContextual("as")) {
|
|
4150
4148
|
node.exported = this.parseModuleExportName();
|
|
4151
|
-
this.checkExport(exports
|
|
4149
|
+
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
4152
4150
|
}
|
|
4153
4151
|
else {
|
|
4154
4152
|
node.exported = null;
|
|
@@ -4162,30 +4160,30 @@ pp$8.parseExportAllDeclaration = function (node, exports$1) {
|
|
|
4162
4160
|
this.semicolon();
|
|
4163
4161
|
return this.finishNode(node, "ExportAllDeclaration");
|
|
4164
4162
|
};
|
|
4165
|
-
pp$8.parseExport = function (node, exports
|
|
4163
|
+
pp$8.parseExport = function (node, exports) {
|
|
4166
4164
|
this.next();
|
|
4167
4165
|
if (this.eat(types$1.star)) {
|
|
4168
|
-
return this.parseExportAllDeclaration(node, exports
|
|
4166
|
+
return this.parseExportAllDeclaration(node, exports);
|
|
4169
4167
|
}
|
|
4170
4168
|
if (this.eat(types$1._default)) {
|
|
4171
|
-
this.checkExport(exports
|
|
4169
|
+
this.checkExport(exports, "default", this.lastTokStart);
|
|
4172
4170
|
node.declaration = this.parseExportDefaultDeclaration();
|
|
4173
4171
|
return this.finishNode(node, "ExportDefaultDeclaration");
|
|
4174
4172
|
}
|
|
4175
4173
|
if (this.shouldParseExportStatement()) {
|
|
4176
4174
|
node.declaration = this.parseExportDeclaration(node);
|
|
4177
4175
|
if (node.declaration.type === "VariableDeclaration") {
|
|
4178
|
-
this.checkVariableExport(exports
|
|
4176
|
+
this.checkVariableExport(exports, node.declaration.declarations);
|
|
4179
4177
|
}
|
|
4180
4178
|
else {
|
|
4181
|
-
this.checkExport(exports
|
|
4179
|
+
this.checkExport(exports, node.declaration.id, node.declaration.id.start);
|
|
4182
4180
|
}
|
|
4183
4181
|
node.specifiers = [];
|
|
4184
4182
|
node.source = null;
|
|
4185
4183
|
}
|
|
4186
4184
|
else {
|
|
4187
4185
|
node.declaration = null;
|
|
4188
|
-
node.specifiers = this.parseExportSpecifiers(exports
|
|
4186
|
+
node.specifiers = this.parseExportSpecifiers(exports);
|
|
4189
4187
|
if (this.eatContextual("from")) {
|
|
4190
4188
|
if (this.type !== types$1.string) {
|
|
4191
4189
|
this.unexpected();
|
|
@@ -4230,57 +4228,57 @@ pp$8.parseExportDefaultDeclaration = function () {
|
|
|
4230
4228
|
return declaration;
|
|
4231
4229
|
}
|
|
4232
4230
|
};
|
|
4233
|
-
pp$8.checkExport = function (exports
|
|
4234
|
-
if (!exports
|
|
4231
|
+
pp$8.checkExport = function (exports, name, pos) {
|
|
4232
|
+
if (!exports) {
|
|
4235
4233
|
return;
|
|
4236
4234
|
}
|
|
4237
4235
|
if (typeof name !== "string") {
|
|
4238
4236
|
name = name.type === "Identifier" ? name.name : name.value;
|
|
4239
4237
|
}
|
|
4240
|
-
if (hasOwn(exports
|
|
4238
|
+
if (hasOwn(exports, name)) {
|
|
4241
4239
|
this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
|
|
4242
4240
|
}
|
|
4243
|
-
exports
|
|
4241
|
+
exports[name] = true;
|
|
4244
4242
|
};
|
|
4245
|
-
pp$8.checkPatternExport = function (exports
|
|
4243
|
+
pp$8.checkPatternExport = function (exports, pat) {
|
|
4246
4244
|
var type = pat.type;
|
|
4247
4245
|
if (type === "Identifier") {
|
|
4248
|
-
this.checkExport(exports
|
|
4246
|
+
this.checkExport(exports, pat, pat.start);
|
|
4249
4247
|
}
|
|
4250
4248
|
else if (type === "ObjectPattern") {
|
|
4251
4249
|
for (var i = 0, list = pat.properties; i < list.length; i += 1) {
|
|
4252
4250
|
var prop = list[i];
|
|
4253
|
-
this.checkPatternExport(exports
|
|
4251
|
+
this.checkPatternExport(exports, prop);
|
|
4254
4252
|
}
|
|
4255
4253
|
}
|
|
4256
4254
|
else if (type === "ArrayPattern") {
|
|
4257
4255
|
for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
|
|
4258
4256
|
var elt = list$1[i$1];
|
|
4259
4257
|
if (elt) {
|
|
4260
|
-
this.checkPatternExport(exports
|
|
4258
|
+
this.checkPatternExport(exports, elt);
|
|
4261
4259
|
}
|
|
4262
4260
|
}
|
|
4263
4261
|
}
|
|
4264
4262
|
else if (type === "Property") {
|
|
4265
|
-
this.checkPatternExport(exports
|
|
4263
|
+
this.checkPatternExport(exports, pat.value);
|
|
4266
4264
|
}
|
|
4267
4265
|
else if (type === "AssignmentPattern") {
|
|
4268
|
-
this.checkPatternExport(exports
|
|
4266
|
+
this.checkPatternExport(exports, pat.left);
|
|
4269
4267
|
}
|
|
4270
4268
|
else if (type === "RestElement") {
|
|
4271
|
-
this.checkPatternExport(exports
|
|
4269
|
+
this.checkPatternExport(exports, pat.argument);
|
|
4272
4270
|
}
|
|
4273
4271
|
else if (type === "ParenthesizedExpression") {
|
|
4274
|
-
this.checkPatternExport(exports
|
|
4272
|
+
this.checkPatternExport(exports, pat.expression);
|
|
4275
4273
|
}
|
|
4276
4274
|
};
|
|
4277
|
-
pp$8.checkVariableExport = function (exports
|
|
4278
|
-
if (!exports
|
|
4275
|
+
pp$8.checkVariableExport = function (exports, decls) {
|
|
4276
|
+
if (!exports) {
|
|
4279
4277
|
return;
|
|
4280
4278
|
}
|
|
4281
4279
|
for (var i = 0, list = decls; i < list.length; i += 1) {
|
|
4282
4280
|
var decl = list[i];
|
|
4283
|
-
this.checkPatternExport(exports
|
|
4281
|
+
this.checkPatternExport(exports, decl.id);
|
|
4284
4282
|
}
|
|
4285
4283
|
};
|
|
4286
4284
|
pp$8.shouldParseExportStatement = function () {
|
|
@@ -4291,14 +4289,14 @@ pp$8.shouldParseExportStatement = function () {
|
|
|
4291
4289
|
this.isLet() ||
|
|
4292
4290
|
this.isAsyncFunction();
|
|
4293
4291
|
};
|
|
4294
|
-
pp$8.parseExportSpecifier = function (exports
|
|
4292
|
+
pp$8.parseExportSpecifier = function (exports) {
|
|
4295
4293
|
var node = this.startNode();
|
|
4296
4294
|
node.local = this.parseModuleExportName();
|
|
4297
4295
|
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
4298
|
-
this.checkExport(exports
|
|
4296
|
+
this.checkExport(exports, node.exported, node.exported.start);
|
|
4299
4297
|
return this.finishNode(node, "ExportSpecifier");
|
|
4300
4298
|
};
|
|
4301
|
-
pp$8.parseExportSpecifiers = function (exports
|
|
4299
|
+
pp$8.parseExportSpecifiers = function (exports) {
|
|
4302
4300
|
var nodes = [], first = true;
|
|
4303
4301
|
this.expect(types$1.braceL);
|
|
4304
4302
|
while (!this.eat(types$1.braceR)) {
|
|
@@ -4311,7 +4309,7 @@ pp$8.parseExportSpecifiers = function (exports$1) {
|
|
|
4311
4309
|
else {
|
|
4312
4310
|
first = false;
|
|
4313
4311
|
}
|
|
4314
|
-
nodes.push(this.parseExportSpecifier(exports
|
|
4312
|
+
nodes.push(this.parseExportSpecifier(exports));
|
|
4315
4313
|
}
|
|
4316
4314
|
return nodes;
|
|
4317
4315
|
};
|
|
@@ -761,50 +761,6 @@ var HeapSnapshotModel$1 = /*#__PURE__*/Object.freeze({
|
|
|
761
761
|
baseUnreachableDistance: baseUnreachableDistance
|
|
762
762
|
});
|
|
763
763
|
|
|
764
|
-
// Copyright 2025 The Chromium Authors
|
|
765
|
-
class WritableDevToolsContext {
|
|
766
|
-
#instances = new Map();
|
|
767
|
-
get(ctor) {
|
|
768
|
-
const instance = this.#instances.get(ctor);
|
|
769
|
-
if (!instance) {
|
|
770
|
-
throw new Error(`No instance for ${ctor.name}. Ensure the bootstrapper creates it.`);
|
|
771
|
-
}
|
|
772
|
-
return instance;
|
|
773
|
-
}
|
|
774
|
-
has(ctor) {
|
|
775
|
-
return this.#instances.has(ctor);
|
|
776
|
-
}
|
|
777
|
-
set(ctor, instance) {
|
|
778
|
-
this.#instances.set(ctor, instance);
|
|
779
|
-
}
|
|
780
|
-
delete(ctor) {
|
|
781
|
-
this.#instances.delete(ctor);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
let gInstance = null;
|
|
785
|
-
function globalInstance() {
|
|
786
|
-
if (!gInstance) {
|
|
787
|
-
gInstance = new WritableDevToolsContext();
|
|
788
|
-
}
|
|
789
|
-
return gInstance;
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
// Copyright 2026 The Chromium Authors
|
|
793
|
-
var ExperimentName;
|
|
794
|
-
(function (ExperimentName) {
|
|
795
|
-
ExperimentName["ALL"] = "*";
|
|
796
|
-
ExperimentName["CAPTURE_NODE_CREATION_STACKS"] = "capture-node-creation-stacks";
|
|
797
|
-
ExperimentName["LIVE_HEAP_PROFILE"] = "live-heap-profile";
|
|
798
|
-
ExperimentName["PROTOCOL_MONITOR"] = "protocol-monitor";
|
|
799
|
-
ExperimentName["TIMELINE_INVALIDATION_TRACKING"] = "timeline-invalidation-tracking";
|
|
800
|
-
ExperimentName["FONT_EDITOR"] = "font-editor";
|
|
801
|
-
ExperimentName["INSTRUMENTATION_BREAKPOINTS"] = "instrumentation-breakpoints";
|
|
802
|
-
ExperimentName["USE_SOURCE_MAP_SCOPES"] = "use-source-map-scopes";
|
|
803
|
-
ExperimentName["TIMELINE_DEBUG_MODE"] = "timeline-debug-mode";
|
|
804
|
-
ExperimentName["DURABLE_MESSAGES"] = "durable-messages";
|
|
805
|
-
ExperimentName["JPEG_XL"] = "jpeg-xl";
|
|
806
|
-
})(ExperimentName || (ExperimentName = {}));
|
|
807
|
-
|
|
808
764
|
// Copyright 2020 The Chromium Authors
|
|
809
765
|
const BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
810
766
|
const BASE64_CODES = new Uint8Array(123);
|
|
@@ -2850,6 +2806,48 @@ const LAYOUT_LINES_HIGHLIGHT_COLOR = [127, 32, 210];
|
|
|
2850
2806
|
Mask: Legacy.fromRGBA([248, 249, 249, 1]),
|
|
2851
2807
|
});
|
|
2852
2808
|
|
|
2809
|
+
// Copyright 2025 The Chromium Authors
|
|
2810
|
+
class WritableDevToolsContext {
|
|
2811
|
+
#instances = new Map();
|
|
2812
|
+
get(ctor) {
|
|
2813
|
+
const instance = this.#instances.get(ctor);
|
|
2814
|
+
if (!instance) {
|
|
2815
|
+
throw new Error(`No instance for ${ctor.name}. Ensure the bootstrapper creates it.`);
|
|
2816
|
+
}
|
|
2817
|
+
return instance;
|
|
2818
|
+
}
|
|
2819
|
+
has(ctor) {
|
|
2820
|
+
return this.#instances.has(ctor);
|
|
2821
|
+
}
|
|
2822
|
+
set(ctor, instance) {
|
|
2823
|
+
this.#instances.set(ctor, instance);
|
|
2824
|
+
}
|
|
2825
|
+
delete(ctor) {
|
|
2826
|
+
this.#instances.delete(ctor);
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
let gInstance = null;
|
|
2830
|
+
function globalInstance() {
|
|
2831
|
+
if (!gInstance) {
|
|
2832
|
+
gInstance = new WritableDevToolsContext();
|
|
2833
|
+
}
|
|
2834
|
+
return gInstance;
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
// Copyright 2026 The Chromium Authors
|
|
2838
|
+
var ExperimentName;
|
|
2839
|
+
(function (ExperimentName) {
|
|
2840
|
+
ExperimentName["ALL"] = "*";
|
|
2841
|
+
ExperimentName["CAPTURE_NODE_CREATION_STACKS"] = "capture-node-creation-stacks";
|
|
2842
|
+
ExperimentName["PROTOCOL_MONITOR"] = "protocol-monitor";
|
|
2843
|
+
ExperimentName["TIMELINE_INVALIDATION_TRACKING"] = "timeline-invalidation-tracking";
|
|
2844
|
+
ExperimentName["INSTRUMENTATION_BREAKPOINTS"] = "instrumentation-breakpoints";
|
|
2845
|
+
ExperimentName["USE_SOURCE_MAP_SCOPES"] = "use-source-map-scopes";
|
|
2846
|
+
ExperimentName["TIMELINE_DEBUG_MODE"] = "timeline-debug-mode";
|
|
2847
|
+
ExperimentName["DURABLE_MESSAGES"] = "durable-messages";
|
|
2848
|
+
ExperimentName["JPEG_XL"] = "jpeg-xl";
|
|
2849
|
+
})(ExperimentName || (ExperimentName = {}));
|
|
2850
|
+
|
|
2853
2851
|
// Copyright 2021 The Chromium Authors
|
|
2854
2852
|
class ObjectWrapper {
|
|
2855
2853
|
listeners;
|