chrome-devtools-mcp 1.4.0 → 1.5.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.
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "@modelcontextprotocol/sdk": "1.29.0",
3
- "@toon-format/toon": "^2.2.0",
4
- "chrome-devtools-frontend": "1.0.1650035",
3
+ "chrome-devtools-frontend": "1.0.1652307",
5
4
  "core-js": "3.49.0",
6
5
  "debug": "4.4.3",
7
6
  "lighthouse": "13.4.0",
8
7
  "semver": "^7.7.4",
9
8
  "urlpattern-polyfill": "^10.1.0",
10
9
  "yargs": "18.0.0",
11
- "puppeteer-core": "25.2.0"
10
+ "puppeteer-core": "25.2.1"
12
11
  }
@@ -5930,6 +5930,9 @@ class HeapSnapshotProxy extends HeapSnapshotProxyObject {
5930
5930
  aggregatesWithFilter(filter) {
5931
5931
  return this.callMethodPromise('aggregatesWithFilter', filter);
5932
5932
  }
5933
+ getDuplicateStrings() {
5934
+ return this.callMethodPromise('getDuplicateStrings');
5935
+ }
5933
5936
  aggregatesForDiff(interfaceDefinitions) {
5934
5937
  return this.callMethodPromise('aggregatesForDiff', interfaceDefinitions);
5935
5938
  }
@@ -6712,6 +6715,45 @@ class HeapSnapshotNode {
6712
6715
  value |= detachedness;
6713
6716
  this.#setDetachednessAndClassIndex(value);
6714
6717
  }
6718
+ findInternalEdgeTarget(name) {
6719
+ for (let iter = this.edges(); iter.hasNext(); iter.next()) {
6720
+ const edge = iter.edge;
6721
+ if (!edge.isInternal()) {
6722
+ continue;
6723
+ }
6724
+ if (edge.name() === name) {
6725
+ return edge.node();
6726
+ }
6727
+ }
6728
+ return undefined;
6729
+ }
6730
+ nodeValueAsBool() {
6731
+ if (this.rawType() !== this.snapshot.nodeNumberType) {
6732
+ return undefined;
6733
+ }
6734
+ if (this.rawName() !== 'bool') {
6735
+ return undefined;
6736
+ }
6737
+ const valNode = this.findInternalEdgeTarget('value');
6738
+ if (!valNode) {
6739
+ return undefined;
6740
+ }
6741
+ const rawName = valNode.rawName();
6742
+ if (rawName === 'true') {
6743
+ return true;
6744
+ }
6745
+ if (rawName === 'false') {
6746
+ return false;
6747
+ }
6748
+ return undefined;
6749
+ }
6750
+ nodeIsTruncatedString() {
6751
+ const truncNode = this.findInternalEdgeTarget('truncated');
6752
+ if (!truncNode) {
6753
+ return false;
6754
+ }
6755
+ return truncNode.nodeValueAsBool() === true;
6756
+ }
6715
6757
  }
6716
6758
  class HeapSnapshotNodeIterator {
6717
6759
  node;
@@ -6927,6 +6969,7 @@ class HeapSnapshot {
6927
6969
  nodeSyntheticType;
6928
6970
  nodeClosureType;
6929
6971
  nodeRegExpType;
6972
+ nodeNumberType;
6930
6973
  edgeFieldsCount;
6931
6974
  edgeTypeOffset;
6932
6975
  edgeNameOffset;
@@ -7001,6 +7044,7 @@ class HeapSnapshot {
7001
7044
  this.nodeSyntheticType = this.nodeTypes.indexOf('synthetic');
7002
7045
  this.nodeClosureType = this.nodeTypes.indexOf('closure');
7003
7046
  this.nodeRegExpType = this.nodeTypes.indexOf('regexp');
7047
+ this.nodeNumberType = this.nodeTypes.indexOf('number');
7004
7048
  this.edgeFieldsCount = meta.edge_fields.length;
7005
7049
  this.edgeTypeOffset = meta.edge_fields.indexOf('type');
7006
7050
  this.edgeNameOffset = meta.edge_fields.indexOf('name_or_index');
@@ -7280,6 +7324,43 @@ class HeapSnapshot {
7280
7324
  const key = filter ? filter.key : 'allObjects';
7281
7325
  return this.getAggregatesByClassKey(false, key, filter);
7282
7326
  }
7327
+ getDuplicateStrings() {
7328
+ const filter = this.createNamedFilter('duplicatedStrings');
7329
+ const groupsMap = new Map();
7330
+ const node = this.createNode(0);
7331
+ for (let i = 0; i < this.nodeCount; ++i) {
7332
+ node.nodeIndex = i * this.nodeFieldCount;
7333
+ if (filter(node)) {
7334
+ const name = node.name();
7335
+ const truncated = node.nodeIsTruncatedString();
7336
+ let group = groupsMap.get(name);
7337
+ if (!group) {
7338
+ group = {
7339
+ value: name,
7340
+ count: 0,
7341
+ totalSelfSize: 0,
7342
+ totalRetainedSize: 0,
7343
+ nodes: [],
7344
+ truncated,
7345
+ };
7346
+ groupsMap.set(name, group);
7347
+ }
7348
+ else if (truncated) {
7349
+ group.truncated = true;
7350
+ }
7351
+ group.count++;
7352
+ group.totalSelfSize += node.selfSize();
7353
+ group.totalRetainedSize += node.retainedSize();
7354
+ group.nodes.push({
7355
+ id: node.id(),
7356
+ selfSize: node.selfSize(),
7357
+ retainedSize: node.retainedSize(),
7358
+ distance: node.distance(),
7359
+ });
7360
+ }
7361
+ }
7362
+ return Array.from(groupsMap.values()).sort((a, b) => b.totalRetainedSize - a.totalRetainedSize);
7363
+ }
7283
7364
  createNodeIdFilter(minNodeId, maxNodeId) {
7284
7365
  function nodeIdFilter(node) {
7285
7366
  const id = node.id();