brave-mcp 1.2.0 → 1.3.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.
@@ -642,10 +642,14 @@ class Diff {
642
642
  removedCount = 0;
643
643
  addedSize = 0;
644
644
  removedSize = 0;
645
- deletedIndexes = [];
646
- addedIndexes = [];
647
645
  countDelta;
648
646
  sizeDelta;
647
+ addedIndexes = [];
648
+ addedIds = [];
649
+ addedSelfSizes = [];
650
+ deletedIndexes = [];
651
+ deletedIds = [];
652
+ deletedSelfSizes = [];
649
653
  constructor(name) {
650
654
  this.name = name;
651
655
  }
@@ -2840,7 +2844,6 @@ var ExperimentName;
2840
2844
  ExperimentName["ALL"] = "*";
2841
2845
  ExperimentName["PROTOCOL_MONITOR"] = "protocol-monitor";
2842
2846
  ExperimentName["INSTRUMENTATION_BREAKPOINTS"] = "instrumentation-breakpoints";
2843
- ExperimentName["USE_SOURCE_MAP_SCOPES"] = "use-source-map-scopes";
2844
2847
  ExperimentName["DURABLE_MESSAGES"] = "durable-messages";
2845
2848
  ExperimentName["JPEG_XL"] = "jpeg-xl";
2846
2849
  ExperimentName["PLUS_BUTTON"] = "plus-button";
@@ -5936,6 +5939,9 @@ class HeapSnapshotProxy extends HeapSnapshotProxyObject {
5936
5939
  nodeClassKey(snapshotObjectId) {
5937
5940
  return this.callMethodPromise('nodeClassKey', snapshotObjectId);
5938
5941
  }
5942
+ nodeIndexForId(nodeId) {
5943
+ return this.callMethodPromise('nodeIndexForId', nodeId);
5944
+ }
5939
5945
  createEdgesProvider(nodeIndex) {
5940
5946
  return this.callFactoryMethod('createEdgesProvider', HeapSnapshotProviderProxy, nodeIndex);
5941
5947
  }
@@ -5996,6 +6002,9 @@ class HeapSnapshotProxy extends HeapSnapshotProxyObject {
5996
6002
  getRetainingPaths(nodeIndex, maxDepth, maxNodes, maxSiblings) {
5997
6003
  return this.callMethodPromise('getRetainingPaths', nodeIndex, maxDepth, maxNodes, maxSiblings);
5998
6004
  }
6005
+ getDominatorsOf(nodeIndex) {
6006
+ return this.callMethodPromise('getDominatorsOf', nodeIndex);
6007
+ }
5999
6008
  unignoreNodeInRetainersView(nodeIndex) {
6000
6009
  return this.callMethodPromise('unignoreNodeInRetainersView', nodeIndex);
6001
6010
  }
@@ -7064,6 +7073,16 @@ class HeapSnapshot {
7064
7073
  }
7065
7074
  this.#progress.updateStatus('Finished processing.');
7066
7075
  }
7076
+ nodeIndexForId(nodeId) {
7077
+ const nodesLength = this.nodes.length;
7078
+ const { nodes, nodeFieldCount, nodeIdOffset } = this;
7079
+ for (let nodeIndex = 0; nodeIndex < nodesLength; nodeIndex += nodeFieldCount) {
7080
+ if (nodes.getValue(nodeIndex + nodeIdOffset) === nodeId) {
7081
+ return nodeIndex;
7082
+ }
7083
+ }
7084
+ return undefined;
7085
+ }
7067
7086
  startInitStep1InSecondThread(secondWorker) {
7068
7087
  const resultsFromSecondWorker = new Promise((resolve, reject) => {
7069
7088
  const listener = (e) => {
@@ -8287,6 +8306,8 @@ class HeapSnapshot {
8287
8306
  const nodeAId = baseIds[i];
8288
8307
  if (nodeAId < nodeB.id()) {
8289
8308
  diff.deletedIndexes.push(baseIndexes[i]);
8309
+ diff.deletedIds.push(nodeAId);
8310
+ diff.deletedSelfSizes.push(baseSelfSizes[i]);
8290
8311
  diff.removedCount++;
8291
8312
  diff.removedSize += baseSelfSizes[i];
8292
8313
  ++i;
@@ -8294,6 +8315,8 @@ class HeapSnapshot {
8294
8315
  else if (nodeAId >
8295
8316
  nodeB.id()) {
8296
8317
  diff.addedIndexes.push(indexes[j]);
8318
+ diff.addedIds.push(nodeB.id());
8319
+ diff.addedSelfSizes.push(nodeB.selfSize());
8297
8320
  diff.addedCount++;
8298
8321
  diff.addedSize += nodeB.selfSize();
8299
8322
  nodeB.nodeIndex = indexes[++j];
@@ -8305,12 +8328,16 @@ class HeapSnapshot {
8305
8328
  }
8306
8329
  while (i < l) {
8307
8330
  diff.deletedIndexes.push(baseIndexes[i]);
8331
+ diff.deletedIds.push(baseIds[i]);
8332
+ diff.deletedSelfSizes.push(baseSelfSizes[i]);
8308
8333
  diff.removedCount++;
8309
8334
  diff.removedSize += baseSelfSizes[i];
8310
8335
  ++i;
8311
8336
  }
8312
8337
  while (j < m) {
8313
8338
  diff.addedIndexes.push(indexes[j]);
8339
+ diff.addedIds.push(nodeB.id());
8340
+ diff.addedSelfSizes.push(nodeB.selfSize());
8314
8341
  diff.addedCount++;
8315
8342
  diff.addedSize += nodeB.selfSize();
8316
8343
  nodeB.nodeIndex = indexes[++j];
@@ -8466,6 +8493,30 @@ class HeapSnapshot {
8466
8493
  const paths = buildForest(nodeIndex, 0);
8467
8494
  return { paths, limitsReached };
8468
8495
  }
8496
+ getDominatorsOf(nodeIndex) {
8497
+ const chain = [];
8498
+ let currentIndex = nodeIndex;
8499
+ const rootIndex = this.rootNodeIndex;
8500
+ while (currentIndex !== undefined) {
8501
+ const node = this.createNode(currentIndex);
8502
+ chain.push({
8503
+ nodeId: node.id(),
8504
+ nodeIndex: currentIndex,
8505
+ nodeName: node.name(),
8506
+ retainedSize: node.retainedSize(),
8507
+ selfSize: node.selfSize(),
8508
+ });
8509
+ if (currentIndex === rootIndex) {
8510
+ break;
8511
+ }
8512
+ const nextIndex = node.dominatorIndex();
8513
+ if (nextIndex === currentIndex) {
8514
+ break;
8515
+ }
8516
+ currentIndex = nextIndex;
8517
+ }
8518
+ return chain;
8519
+ }
8469
8520
  createAddedNodesProvider(baseSnapshotId, classKey) {
8470
8521
  const snapshotDiff = this.#snapshotDiffs[baseSnapshotId];
8471
8522
  const diffForClass = snapshotDiff[classKey];