inspect-mcp 0.1.1 → 0.2.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
@@ -257,7 +257,7 @@ var DEFAULT_MAX_FILE_SIZE_KB = 100;
257
257
  var DEFAULT_TREE_DEPTH = 6;
258
258
  var DEFAULT_HEALTH_TIMEOUT_MS = 15e3;
259
259
  var AUTO_COLLAPSE_FILE_THRESHOLD = 500;
260
- var TOOL_VERSION = "0.1.0";
260
+ var TOOL_VERSION = "0.2.0";
261
261
  function loadConfig(projectRoot) {
262
262
  const defaults = {
263
263
  collapse_dirs: DEFAULT_COLLAPSE_DIRS,
@@ -1249,19 +1249,10 @@ function getGrammarForFile(filePath) {
1249
1249
  const ext = getExtension(filePath);
1250
1250
  return EXTENSION_TO_GRAMMAR[ext] ?? null;
1251
1251
  }
1252
- var parserCache = /* @__PURE__ */ new Map();
1253
- function getOrCreateParser(grammarName) {
1254
- let p = parserCache.get(grammarName);
1255
- if (!p) {
1256
- p = createParser(grammarName);
1257
- parserCache.set(grammarName, p);
1258
- }
1259
- return p;
1260
- }
1261
1252
  async function parseSource(filePath, source) {
1262
1253
  const grammarName = getGrammarForFile(filePath);
1263
1254
  if (!grammarName) return null;
1264
- const parser = await getOrCreateParser(grammarName);
1255
+ const parser = await createParser(grammarName);
1265
1256
  return parser.parse(source);
1266
1257
  }
1267
1258
  function getExtension(filePath) {
@@ -1850,10 +1841,10 @@ var DEFAULT_CONCURRENCY = 8;
1850
1841
  function collectSourceFiles(projectRoot, config) {
1851
1842
  const files = [];
1852
1843
  const maxSizeBytes = config.max_file_size_kb * 1024;
1853
- walk(projectRoot, projectRoot, config, files, maxSizeBytes, 0);
1844
+ walk(projectRoot, projectRoot, config, files, maxSizeBytes);
1854
1845
  return files;
1855
1846
  }
1856
- function walk(dirPath, projectRoot, config, files, maxSizeBytes, depth) {
1847
+ function walk(dirPath, projectRoot, config, files, maxSizeBytes) {
1857
1848
  let entries;
1858
1849
  try {
1859
1850
  entries = fs6.readdirSync(dirPath, { withFileTypes: true });
@@ -1864,8 +1855,7 @@ function walk(dirPath, projectRoot, config, files, maxSizeBytes, depth) {
1864
1855
  const fullPath = path6.join(dirPath, entry.name);
1865
1856
  if (entry.isDirectory()) {
1866
1857
  if (config.collapse_dirs.includes(entry.name)) continue;
1867
- if (depth >= config.tree_depth) continue;
1868
- walk(fullPath, projectRoot, config, files, maxSizeBytes, depth + 1);
1858
+ walk(fullPath, projectRoot, config, files, maxSizeBytes);
1869
1859
  } else if (entry.isFile()) {
1870
1860
  const ext = path6.extname(entry.name).toLowerCase();
1871
1861
  if (!SUPPORTED_EXTENSIONS.has(ext)) continue;