trace-mcp 1.15.2 → 1.16.1

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/dist/index.js CHANGED
@@ -69015,12 +69015,30 @@ function buildGraphData(store, opts) {
69015
69015
  }
69016
69016
  return buildSingleProjectGraph(store, opts, scope, depth, granularity, hideIsolated);
69017
69017
  }
69018
+ var GRAPH_EXCLUDE_DIRS = /* @__PURE__ */ new Set([
69019
+ "node_modules",
69020
+ "vendor",
69021
+ ".git",
69022
+ "dist",
69023
+ "build",
69024
+ "__pycache__",
69025
+ ".venv",
69026
+ ".next",
69027
+ ".nuxt",
69028
+ "coverage",
69029
+ ".turbo",
69030
+ ".cache"
69031
+ ]);
69032
+ function isExcludedPath(filePath) {
69033
+ const segments = filePath.split("/");
69034
+ return segments.some((seg) => GRAPH_EXCLUDE_DIRS.has(seg));
69035
+ }
69018
69036
  function buildSingleProjectGraph(store, opts, scope, depth, granularity, hideIsolated) {
69019
69037
  let seedFiles;
69020
69038
  if (scope === "project") {
69021
- seedFiles = store.getAllFiles();
69039
+ seedFiles = store.getAllFiles().filter((f) => !isExcludedPath(f.path));
69022
69040
  } else {
69023
- const allFiles = store.getAllFiles();
69041
+ const allFiles = store.getAllFiles().filter((f) => !isExcludedPath(f.path));
69024
69042
  if (scope.includes("*")) {
69025
69043
  const isMatch = (0, import_picomatch2.default)(scope, { dot: true });
69026
69044
  seedFiles = allFiles.filter((f) => isMatch(f.path));
@@ -69057,7 +69075,7 @@ function buildFederatedGraph(mainStore, opts) {
69057
69075
  opts.granularity ?? "file",
69058
69076
  opts.hideIsolated === true
69059
69077
  );
69060
- const mainPrefix = currentRepo?.name ?? "main";
69078
+ const mainPrefix = allRepos.find((r) => r.repo_root === projectRoot)?.name ?? path46.basename(projectRoot);
69061
69079
  for (const n of mainResult.nodes) {
69062
69080
  n.repo = mainPrefix;
69063
69081
  allNodes.push(n);
@@ -69190,6 +69208,7 @@ function buildFileGraph2(store, seedFiles, depth, edgeFilter, hideIsolated, opts
69190
69208
  const vizNodeMap = /* @__PURE__ */ new Map();
69191
69209
  for (const [, file] of allFilesById) {
69192
69210
  if (vizNodeMap.has(file.path)) continue;
69211
+ if (isExcludedPath(file.path)) continue;
69193
69212
  vizNodeMap.set(file.path, {
69194
69213
  id: file.path,
69195
69214
  label: path46.basename(file.path),
@@ -69256,8 +69275,15 @@ function buildSymbolGraph(store, seedFiles, depth, edgeFilter, hideIsolated, opt
69256
69275
  }
69257
69276
  const fileNodeRefs = store.getNodeRefsBatch([...visitedFileNodes]);
69258
69277
  const connectedFileIds = /* @__PURE__ */ new Set();
69278
+ const candidateFileRefIds = [];
69279
+ for (const [, ref] of fileNodeRefs) {
69280
+ if (ref.nodeType === "file") candidateFileRefIds.push(ref.refId);
69281
+ }
69282
+ const candidateFilesMap = candidateFileRefIds.length > 0 ? store.getFilesByIds(candidateFileRefIds) : /* @__PURE__ */ new Map();
69259
69283
  for (const [nodeId, ref] of fileNodeRefs) {
69260
69284
  if (ref.nodeType === "file") {
69285
+ const file = candidateFilesMap.get(ref.refId);
69286
+ if (file && isExcludedPath(file.path)) continue;
69261
69287
  nodeIdToFileId.set(nodeId, ref.refId);
69262
69288
  connectedFileIds.add(ref.refId);
69263
69289
  }
@@ -69326,6 +69352,7 @@ function buildSymbolGraph(store, seedFiles, depth, edgeFilter, hideIsolated, opt
69326
69352
  const symbolIdToVizId = /* @__PURE__ */ new Map();
69327
69353
  for (const sym of symbolsById.values()) {
69328
69354
  const file = filesById.get(sym.file_id);
69355
+ if (file && isExcludedPath(file.path)) continue;
69329
69356
  vizNodes.push({
69330
69357
  id: sym.symbol_id,
69331
69358
  label: sym.name,
@@ -69594,7 +69621,7 @@ DATA.edges.forEach(e => {
69594
69621
  });
69595
69622
 
69596
69623
  // BFS to collect neighbors at N levels deep \u2014 returns Map<nodeId, depthLevel>
69597
- let highlightDepth = ${opts.highlightDepth ?? 1};
69624
+ let highlightDepth = ${opts?.highlightDepth ?? 1};
69598
69625
  function getNeighborsAtDepth(startId, maxDepth) {
69599
69626
  const depthMap = new Map(); // nodeId \u2192 depth level (1-based)
69600
69627
  let frontier = new Set([startId]);
@@ -78334,7 +78361,7 @@ var TopologyStore = class {
78334
78361
  };
78335
78362
 
78336
78363
  // src/server/server.ts
78337
- var PKG_VERSION = true ? "1.15.2" : "0.0.0-dev";
78364
+ var PKG_VERSION = true ? "1.16.1" : "0.0.0-dev";
78338
78365
  function j2(value) {
78339
78366
  return JSON.stringify(value, (_key, val) => val === null || val === void 0 ? void 0 : val);
78340
78367
  }