trace-mcp 1.6.0 → 1.6.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
@@ -2501,6 +2501,10 @@ function detectWorkspaces(rootPath) {
2501
2501
  function buildMultiRootWorkspaces(parentDir, childRoots) {
2502
2502
  const workspaces = [];
2503
2503
  for (const childRoot of childRoots) {
2504
+ if (!fs2.existsSync(childRoot)) {
2505
+ logger.warn({ childRoot }, "Skipping missing multi-root child directory");
2506
+ continue;
2507
+ }
2504
2508
  const relPath = path2.relative(parentDir, childRoot).replace(/\\/g, "/");
2505
2509
  const childName = path2.basename(childRoot);
2506
2510
  workspaces.push({ name: childName, path: relPath });
@@ -4795,12 +4799,15 @@ var FilePersister = class {
4795
4799
  }
4796
4800
  if (ext.symbols.length > 0) {
4797
4801
  const insertedIds = store.insertSymbols(fileId, ext.symbols);
4798
- const trigramBatch = ext.symbols.map((sym, i) => ({
4799
- id: insertedIds[i],
4800
- name: sym.name,
4801
- fqn: sym.fqn ?? null
4802
- }));
4803
- indexTrigramsBatch(store.db, trigramBatch);
4802
+ const trigramBySymbolId = /* @__PURE__ */ new Map();
4803
+ for (let i = 0; i < ext.symbols.length; i++) {
4804
+ trigramBySymbolId.set(ext.symbols[i].symbolId, {
4805
+ id: insertedIds[i],
4806
+ name: ext.symbols[i].name,
4807
+ fqn: ext.symbols[i].fqn ?? null
4808
+ });
4809
+ }
4810
+ indexTrigramsBatch(store.db, [...trigramBySymbolId.values()]);
4804
4811
  }
4805
4812
  if (ext.otherEdges.length > 0) this.storeRawEdges(ext.otherEdges);
4806
4813
  if (ext.importEdges.length > 0) {
@@ -4816,11 +4823,15 @@ var FilePersister = class {
4816
4823
  for (const fwResult of ext.frameworkExtracts) {
4817
4824
  if (fwResult.symbols.length > 0) {
4818
4825
  const fwIds = store.insertSymbols(fileId, fwResult.symbols);
4819
- indexTrigramsBatch(store.db, fwResult.symbols.map((sym, i) => ({
4820
- id: fwIds[i],
4821
- name: sym.name,
4822
- fqn: sym.fqn ?? null
4823
- })));
4826
+ const fwTrigramBySymbolId = /* @__PURE__ */ new Map();
4827
+ for (let i = 0; i < fwResult.symbols.length; i++) {
4828
+ fwTrigramBySymbolId.set(fwResult.symbols[i].symbolId, {
4829
+ id: fwIds[i],
4830
+ name: fwResult.symbols[i].name,
4831
+ fqn: fwResult.symbols[i].fqn ?? null
4832
+ });
4833
+ }
4834
+ indexTrigramsBatch(store.db, [...fwTrigramBySymbolId.values()]);
4824
4835
  }
4825
4836
  if (fwResult.edges?.length) {
4826
4837
  this.storeRawEdges(fwResult.edges);
@@ -27728,7 +27739,7 @@ function registerSessionTools(server, ctx) {
27728
27739
  }
27729
27740
 
27730
27741
  // src/server/server.ts
27731
- var PKG_VERSION = true ? "1.6.0" : "0.0.0-dev";
27742
+ var PKG_VERSION = true ? "1.6.1" : "0.0.0-dev";
27732
27743
  function j2(value) {
27733
27744
  return JSON.stringify(value, (_key, val) => val === null || val === void 0 ? void 0 : val);
27734
27745
  }