ai-mind-map 1.11.4 → 1.11.6
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 +3 -0
- package/dist/index.js.map +1 -1
- package/dist/knowledge-graph/graph.d.ts +14 -0
- package/dist/knowledge-graph/graph.d.ts.map +1 -1
- package/dist/knowledge-graph/graph.js +18 -0
- package/dist/knowledge-graph/graph.js.map +1 -1
- package/dist/knowledge-graph/indexer.d.ts.map +1 -1
- package/dist/knowledge-graph/indexer.js +46 -55
- package/dist/knowledge-graph/indexer.js.map +1 -1
- package/dist/tools/filesystem-tools.d.ts +24 -0
- package/dist/tools/filesystem-tools.d.ts.map +1 -0
- package/dist/tools/filesystem-tools.js +632 -0
- package/dist/tools/filesystem-tools.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Mind Map — Filesystem MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Lightweight filesystem utilities that work WITHOUT triggering graph indexing.
|
|
5
|
+
* These tools provide raw file and directory access, complementing the
|
|
6
|
+
* knowledge-graph-powered tools with fast, no-dependency operations.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* - mindmap_list_dir — Directory listing (no indexing)
|
|
10
|
+
* - mindmap_read_lines — Read specific line ranges with optional graph context
|
|
11
|
+
* - mindmap_project_summary — One-call project overview before indexing
|
|
12
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { readFileSync, readdirSync, statSync, existsSync, } from 'node:fs';
|
|
15
|
+
import { resolve, relative, extname, basename, join, isAbsolute } from 'node:path';
|
|
16
|
+
const defaultEstimator = {
|
|
17
|
+
estimate: (text) => Math.ceil(text.length / 4),
|
|
18
|
+
};
|
|
19
|
+
// ============================================================
|
|
20
|
+
// Helpers
|
|
21
|
+
// ============================================================
|
|
22
|
+
function mcpText(result) {
|
|
23
|
+
return {
|
|
24
|
+
content: [{ type: 'text', text: JSON.stringify(result) }],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function ok(data, estimator) {
|
|
28
|
+
const serialised = JSON.stringify(data);
|
|
29
|
+
const tokens = estimator.estimate(serialised);
|
|
30
|
+
return { success: true, data, tokenCount: tokens, tokensSaved: 0 };
|
|
31
|
+
}
|
|
32
|
+
function fail(message) {
|
|
33
|
+
return { success: false, data: null, tokenCount: 0, tokensSaved: 0, message };
|
|
34
|
+
}
|
|
35
|
+
// ============================================================
|
|
36
|
+
// Constants
|
|
37
|
+
// ============================================================
|
|
38
|
+
/** Directories to always skip during project summary scan */
|
|
39
|
+
const SKIP_DIRS = new Set([
|
|
40
|
+
'node_modules', '.git', '.svn', '.hg', '__pycache__', '.next', '.nuxt',
|
|
41
|
+
'dist', 'build', '.cache', '.tox', '.mypy_cache', '.pytest_cache',
|
|
42
|
+
'venv', '.venv', 'env', '.env', 'coverage', '.nyc_output',
|
|
43
|
+
'.idea', '.vscode', '.vs', 'vendor', 'target', 'bin', 'obj',
|
|
44
|
+
'.gradle', '.dart_tool', '.pub-cache', 'Pods',
|
|
45
|
+
'.gemini', '.cursor', 'antigravity',
|
|
46
|
+
'output', 'out', 'outputs', '.output',
|
|
47
|
+
'models', 'model', 'checkpoints', 'weights',
|
|
48
|
+
'logs', 'tmp', 'temp', '.tmp',
|
|
49
|
+
'LibreSprite', 'blobs',
|
|
50
|
+
'site-packages', 'lib', 'Lib', 'Scripts', 'Include',
|
|
51
|
+
'standalone-env', 'python_embeded', 'python_embedded',
|
|
52
|
+
'electron', '.launcher',
|
|
53
|
+
]);
|
|
54
|
+
/** Binary/large file extensions to skip for summary */
|
|
55
|
+
const BINARY_EXTENSIONS = new Set([
|
|
56
|
+
'.png', '.jpg', '.jpeg', '.gif', '.bmp', '.ico', '.svg', '.webp',
|
|
57
|
+
'.mp3', '.mp4', '.wav', '.avi', '.mov', '.mkv',
|
|
58
|
+
'.zip', '.tar', '.gz', '.rar', '.7z',
|
|
59
|
+
'.pdf', '.doc', '.docx', '.xls', '.xlsx',
|
|
60
|
+
'.exe', '.dll', '.so', '.dylib', '.bin',
|
|
61
|
+
'.woff', '.woff2', '.ttf', '.eot', '.otf',
|
|
62
|
+
'.pyc', '.pyo', '.class', '.o', '.obj',
|
|
63
|
+
'.sqlite', '.db', '.sqlite3',
|
|
64
|
+
'.safetensors', '.onnx', '.pt', '.pth', '.h5',
|
|
65
|
+
'.lock', '.ase', '.aseprite', '.gpl', '.pcx',
|
|
66
|
+
]);
|
|
67
|
+
/** Project type detection from marker files */
|
|
68
|
+
const PROJECT_MARKERS = {
|
|
69
|
+
'package.json': 'Node.js/TypeScript',
|
|
70
|
+
'tsconfig.json': 'TypeScript',
|
|
71
|
+
'requirements.txt': 'Python',
|
|
72
|
+
'setup.py': 'Python',
|
|
73
|
+
'pyproject.toml': 'Python',
|
|
74
|
+
'Pipfile': 'Python',
|
|
75
|
+
'Cargo.toml': 'Rust',
|
|
76
|
+
'go.mod': 'Go',
|
|
77
|
+
'build.gradle': 'Java/Kotlin',
|
|
78
|
+
'pom.xml': 'Java',
|
|
79
|
+
'Gemfile': 'Ruby',
|
|
80
|
+
'composer.json': 'PHP',
|
|
81
|
+
'CMakeLists.txt': 'C/C++',
|
|
82
|
+
'Makefile': 'C/C++',
|
|
83
|
+
};
|
|
84
|
+
/** .csproj and .sln detected separately via extension */
|
|
85
|
+
const DOTNET_EXTENSIONS = new Set(['.csproj', '.sln', '.fsproj', '.vbproj']);
|
|
86
|
+
/** Common entry point filenames */
|
|
87
|
+
const ENTRY_POINTS = new Set([
|
|
88
|
+
'index.ts', 'index.js', 'index.tsx', 'index.jsx',
|
|
89
|
+
'main.ts', 'main.js', 'main.py', 'main.go', 'main.rs',
|
|
90
|
+
'app.ts', 'app.js', 'app.py',
|
|
91
|
+
'App.tsx', 'App.jsx', 'App.vue', 'App.svelte',
|
|
92
|
+
'App.xaml.cs', 'Program.cs',
|
|
93
|
+
'server.ts', 'server.js',
|
|
94
|
+
'cli.ts', 'cli.js', 'cli.py',
|
|
95
|
+
'manage.py', 'wsgi.py', 'asgi.py',
|
|
96
|
+
'mod.rs', 'lib.rs',
|
|
97
|
+
]);
|
|
98
|
+
/** Max lines per read request */
|
|
99
|
+
const MAX_LINES_PER_REQUEST = 500;
|
|
100
|
+
/** Default lines if endLine is omitted */
|
|
101
|
+
const DEFAULT_LINE_WINDOW = 200;
|
|
102
|
+
/** Max entries when walking for project summary */
|
|
103
|
+
const MAX_WALK_ENTRIES = 10_000;
|
|
104
|
+
/** Max depth for compact directory tree */
|
|
105
|
+
const MAX_TREE_DEPTH = 3;
|
|
106
|
+
/** Max entries in compact directory tree */
|
|
107
|
+
const MAX_TREE_DISPLAY_ENTRIES = 50;
|
|
108
|
+
// ============================================================
|
|
109
|
+
// Internal Utilities
|
|
110
|
+
// ============================================================
|
|
111
|
+
/**
|
|
112
|
+
* Resolve a potentially relative path against the project root.
|
|
113
|
+
* Returns null if the resolved path is outside the project root (security).
|
|
114
|
+
*
|
|
115
|
+
* @param allowAbsolute - When true, absolute input paths are returned directly
|
|
116
|
+
* without checking against projectRoot. Used by list_dir and read_lines
|
|
117
|
+
* so they work before the target project has been indexed.
|
|
118
|
+
*/
|
|
119
|
+
function resolvePath(inputPath, projectRoot, allowAbsolute = false) {
|
|
120
|
+
// If allowAbsolute and the input is already an absolute path, use it directly
|
|
121
|
+
if (allowAbsolute && isAbsolute(inputPath)) {
|
|
122
|
+
return resolve(inputPath); // normalize separators
|
|
123
|
+
}
|
|
124
|
+
const resolved = resolve(projectRoot, inputPath);
|
|
125
|
+
// Security: prevent directory traversal outside project
|
|
126
|
+
const normalizedResolved = resolved.replace(/\\/g, '/');
|
|
127
|
+
const normalizedRoot = projectRoot.replace(/\\/g, '/');
|
|
128
|
+
if (!normalizedResolved.startsWith(normalizedRoot)) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return resolved;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Parse a .gitignore file into a set of directory/file names to ignore.
|
|
135
|
+
* Only handles simple patterns (no globs with ** or negation).
|
|
136
|
+
*/
|
|
137
|
+
function parseGitignoreSimple(gitignorePath) {
|
|
138
|
+
const names = new Set();
|
|
139
|
+
try {
|
|
140
|
+
const content = readFileSync(gitignorePath, 'utf-8');
|
|
141
|
+
for (const rawLine of content.split('\n')) {
|
|
142
|
+
const line = rawLine.trim();
|
|
143
|
+
if (!line || line.startsWith('#'))
|
|
144
|
+
continue;
|
|
145
|
+
// Strip trailing slashes and leading slashes
|
|
146
|
+
const clean = line.replace(/^\/+/, '').replace(/\/+$/, '');
|
|
147
|
+
// Only handle simple name patterns (no wildcards)
|
|
148
|
+
if (clean && !clean.includes('*') && !clean.includes('?') && !clean.includes('[')) {
|
|
149
|
+
names.add(clean);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// .gitignore doesn't exist or can't be read — that's fine
|
|
155
|
+
}
|
|
156
|
+
return names;
|
|
157
|
+
}
|
|
158
|
+
function listDirectory(dirPath, includeHidden) {
|
|
159
|
+
const rawEntries = readdirSync(dirPath, { withFileTypes: true });
|
|
160
|
+
const entries = [];
|
|
161
|
+
let totalFiles = 0;
|
|
162
|
+
let totalDirs = 0;
|
|
163
|
+
for (const entry of rawEntries) {
|
|
164
|
+
// Skip hidden entries unless requested
|
|
165
|
+
if (!includeHidden && entry.name.startsWith('.'))
|
|
166
|
+
continue;
|
|
167
|
+
const fullPath = join(dirPath, entry.name);
|
|
168
|
+
try {
|
|
169
|
+
const stat = statSync(fullPath);
|
|
170
|
+
if (entry.isDirectory()) {
|
|
171
|
+
// Count immediate children (non-recursive)
|
|
172
|
+
let childCount = 0;
|
|
173
|
+
try {
|
|
174
|
+
childCount = readdirSync(fullPath).length;
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
childCount = 0;
|
|
178
|
+
}
|
|
179
|
+
entries.push({
|
|
180
|
+
name: entry.name,
|
|
181
|
+
type: 'dir',
|
|
182
|
+
childCount,
|
|
183
|
+
});
|
|
184
|
+
totalDirs++;
|
|
185
|
+
}
|
|
186
|
+
else if (entry.isFile()) {
|
|
187
|
+
entries.push({
|
|
188
|
+
name: entry.name,
|
|
189
|
+
type: 'file',
|
|
190
|
+
sizeBytes: stat.size,
|
|
191
|
+
});
|
|
192
|
+
totalFiles++;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
// Permission denied or broken symlink — skip
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// Sort: directories first, then files, alphabetically within each group
|
|
200
|
+
entries.sort((a, b) => {
|
|
201
|
+
if (a.type !== b.type)
|
|
202
|
+
return a.type === 'dir' ? -1 : 1;
|
|
203
|
+
return a.name.localeCompare(b.name);
|
|
204
|
+
});
|
|
205
|
+
return { path: dirPath, entries, totalFiles, totalDirs };
|
|
206
|
+
}
|
|
207
|
+
function readLines(filePath, startLine, endLine, includeContext, graph) {
|
|
208
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
209
|
+
const allLines = content.split('\n');
|
|
210
|
+
const totalLines = allLines.length;
|
|
211
|
+
// Normalise line range (1-indexed)
|
|
212
|
+
const effectiveStart = Math.max(1, startLine);
|
|
213
|
+
let effectiveEnd;
|
|
214
|
+
if (endLine !== undefined) {
|
|
215
|
+
effectiveEnd = Math.min(endLine, totalLines);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
effectiveEnd = Math.min(effectiveStart + DEFAULT_LINE_WINDOW - 1, totalLines);
|
|
219
|
+
}
|
|
220
|
+
// Cap at MAX_LINES_PER_REQUEST
|
|
221
|
+
if (effectiveEnd - effectiveStart + 1 > MAX_LINES_PER_REQUEST) {
|
|
222
|
+
effectiveEnd = effectiveStart + MAX_LINES_PER_REQUEST - 1;
|
|
223
|
+
}
|
|
224
|
+
const lines = allLines.slice(effectiveStart - 1, effectiveEnd);
|
|
225
|
+
// Graph context: find containing symbol
|
|
226
|
+
let containingSymbol;
|
|
227
|
+
if (includeContext && graph) {
|
|
228
|
+
try {
|
|
229
|
+
const nodes = graph.getFileStructure(filePath);
|
|
230
|
+
if (nodes && nodes.length > 0) {
|
|
231
|
+
// Find the most specific (smallest range) symbol containing the start line
|
|
232
|
+
let bestMatch = null;
|
|
233
|
+
let bestRange = Infinity;
|
|
234
|
+
for (const node of nodes) {
|
|
235
|
+
if (node.type !== 'file' &&
|
|
236
|
+
node.startLine <= effectiveStart &&
|
|
237
|
+
node.endLine >= effectiveStart) {
|
|
238
|
+
const range = node.endLine - node.startLine;
|
|
239
|
+
if (range < bestRange) {
|
|
240
|
+
bestRange = range;
|
|
241
|
+
bestMatch = node;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (bestMatch) {
|
|
246
|
+
containingSymbol = {
|
|
247
|
+
name: bestMatch.name,
|
|
248
|
+
type: bestMatch.type,
|
|
249
|
+
signature: bestMatch.signature,
|
|
250
|
+
startLine: bestMatch.startLine,
|
|
251
|
+
endLine: bestMatch.endLine,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
// Graph not indexed yet or file not in graph — that's fine
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
filePath,
|
|
262
|
+
startLine: effectiveStart,
|
|
263
|
+
endLine: effectiveEnd,
|
|
264
|
+
totalLines,
|
|
265
|
+
lines,
|
|
266
|
+
...(containingSymbol ? { containingSymbol } : {}),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Walk directory tree recursively, respecting skip-dirs and entry cap.
|
|
271
|
+
*/
|
|
272
|
+
function walkDirectory(rootPath, currentPath, gitignoreNames, state, depth = 0) {
|
|
273
|
+
if (state.entriesWalked >= MAX_WALK_ENTRIES) {
|
|
274
|
+
state.truncated = true;
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
let entries;
|
|
278
|
+
try {
|
|
279
|
+
entries = readdirSync(currentPath, { withFileTypes: true, encoding: 'utf-8' });
|
|
280
|
+
}
|
|
281
|
+
catch {
|
|
282
|
+
return; // Can't read directory
|
|
283
|
+
}
|
|
284
|
+
for (const entry of entries) {
|
|
285
|
+
if (state.entriesWalked >= MAX_WALK_ENTRIES) {
|
|
286
|
+
state.truncated = true;
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
// Skip hidden entries
|
|
290
|
+
if (entry.name.startsWith('.'))
|
|
291
|
+
continue;
|
|
292
|
+
state.entriesWalked++;
|
|
293
|
+
const fullPath = join(currentPath, entry.name);
|
|
294
|
+
if (entry.isDirectory()) {
|
|
295
|
+
// Skip known dirs and gitignore-listed dirs
|
|
296
|
+
if (SKIP_DIRS.has(entry.name) || gitignoreNames.has(entry.name))
|
|
297
|
+
continue;
|
|
298
|
+
state.totalDirs++;
|
|
299
|
+
walkDirectory(rootPath, fullPath, gitignoreNames, state, depth + 1);
|
|
300
|
+
}
|
|
301
|
+
else if (entry.isFile()) {
|
|
302
|
+
state.totalFiles++;
|
|
303
|
+
const ext = extname(entry.name).toLowerCase();
|
|
304
|
+
// Count by extension (skip binary)
|
|
305
|
+
if (ext && !BINARY_EXTENSIONS.has(ext)) {
|
|
306
|
+
state.languages[ext] = (state.languages[ext] || 0) + 1;
|
|
307
|
+
}
|
|
308
|
+
else if (!ext) {
|
|
309
|
+
// Extensionless files
|
|
310
|
+
state.languages['(no ext)'] = (state.languages['(no ext)'] || 0) + 1;
|
|
311
|
+
}
|
|
312
|
+
// Detect entry points
|
|
313
|
+
if (ENTRY_POINTS.has(entry.name)) {
|
|
314
|
+
const relPath = relative(rootPath, fullPath).replace(/\\/g, '/');
|
|
315
|
+
state.entryPoints.push(relPath);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Build a compact directory tree string (max depth, max entries).
|
|
322
|
+
*/
|
|
323
|
+
function buildCompactTree(rootPath, currentPath, gitignoreNames, prefix = '', depth = 0, counter = { count: 0 }) {
|
|
324
|
+
if (depth > MAX_TREE_DEPTH || counter.count >= MAX_TREE_DISPLAY_ENTRIES)
|
|
325
|
+
return '';
|
|
326
|
+
let entries;
|
|
327
|
+
try {
|
|
328
|
+
entries = readdirSync(currentPath, { withFileTypes: true, encoding: 'utf-8' });
|
|
329
|
+
}
|
|
330
|
+
catch {
|
|
331
|
+
return '';
|
|
332
|
+
}
|
|
333
|
+
// Separate dirs and files, skip hidden and ignored
|
|
334
|
+
const dirs = [];
|
|
335
|
+
const files = [];
|
|
336
|
+
for (const entry of entries) {
|
|
337
|
+
if (entry.name.startsWith('.'))
|
|
338
|
+
continue;
|
|
339
|
+
if (entry.isDirectory()) {
|
|
340
|
+
if (!SKIP_DIRS.has(entry.name) && !gitignoreNames.has(entry.name)) {
|
|
341
|
+
dirs.push(entry.name);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
else if (entry.isFile()) {
|
|
345
|
+
files.push(entry.name);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
dirs.sort();
|
|
349
|
+
files.sort();
|
|
350
|
+
let result = '';
|
|
351
|
+
const allItems = [...dirs.map(d => ({ name: d, isDir: true })), ...files.map(f => ({ name: f, isDir: false }))];
|
|
352
|
+
for (let i = 0; i < allItems.length; i++) {
|
|
353
|
+
if (counter.count >= MAX_TREE_DISPLAY_ENTRIES) {
|
|
354
|
+
result += `${prefix}... (truncated)\n`;
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
const item = allItems[i];
|
|
358
|
+
const isLast = i === allItems.length - 1;
|
|
359
|
+
const connector = isLast ? '└── ' : '├── ';
|
|
360
|
+
const childPrefix = isLast ? ' ' : '│ ';
|
|
361
|
+
counter.count++;
|
|
362
|
+
result += `${prefix}${connector}${item.name}${item.isDir ? '/' : ''}\n`;
|
|
363
|
+
if (item.isDir) {
|
|
364
|
+
result += buildCompactTree(rootPath, join(currentPath, item.name), gitignoreNames, prefix + childPrefix, depth + 1, counter);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return result;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Detect project type from marker files in the root.
|
|
371
|
+
*/
|
|
372
|
+
function detectProjectType(projectPath) {
|
|
373
|
+
const types = [];
|
|
374
|
+
// Check marker files
|
|
375
|
+
for (const [file, type] of Object.entries(PROJECT_MARKERS)) {
|
|
376
|
+
if (existsSync(join(projectPath, file))) {
|
|
377
|
+
if (!types.includes(type))
|
|
378
|
+
types.push(type);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
// Check for .csproj/.sln files
|
|
382
|
+
try {
|
|
383
|
+
const rootEntries = readdirSync(projectPath);
|
|
384
|
+
for (const entry of rootEntries) {
|
|
385
|
+
const ext = extname(entry).toLowerCase();
|
|
386
|
+
if (DOTNET_EXTENSIONS.has(ext) && !types.includes('C#/.NET')) {
|
|
387
|
+
types.push('C#/.NET');
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
catch {
|
|
393
|
+
// Can't read directory
|
|
394
|
+
}
|
|
395
|
+
return types.length > 0 ? types : ['Unknown'];
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Read key config file summaries.
|
|
399
|
+
*/
|
|
400
|
+
function readConfigSummary(projectPath) {
|
|
401
|
+
const summary = {};
|
|
402
|
+
// package.json
|
|
403
|
+
const pkgPath = join(projectPath, 'package.json');
|
|
404
|
+
if (existsSync(pkgPath)) {
|
|
405
|
+
try {
|
|
406
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
407
|
+
summary['package.json'] = {
|
|
408
|
+
name: pkg.name ?? null,
|
|
409
|
+
version: pkg.version ?? null,
|
|
410
|
+
scripts: pkg.scripts ? Object.keys(pkg.scripts) : [],
|
|
411
|
+
dependencyCount: pkg.dependencies ? Object.keys(pkg.dependencies).length : 0,
|
|
412
|
+
devDependencyCount: pkg.devDependencies ? Object.keys(pkg.devDependencies).length : 0,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
catch {
|
|
416
|
+
summary['package.json'] = { error: 'Failed to parse' };
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
// .gitignore rules
|
|
420
|
+
const gitignorePath = join(projectPath, '.gitignore');
|
|
421
|
+
if (existsSync(gitignorePath)) {
|
|
422
|
+
try {
|
|
423
|
+
const lines = readFileSync(gitignorePath, 'utf-8')
|
|
424
|
+
.split('\n')
|
|
425
|
+
.filter(l => l.trim() && !l.trim().startsWith('#'));
|
|
426
|
+
summary['.gitignore'] = { ruleCount: lines.length, rules: lines.slice(0, 20) };
|
|
427
|
+
}
|
|
428
|
+
catch {
|
|
429
|
+
// skip
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
// Cargo.toml
|
|
433
|
+
const cargoPath = join(projectPath, 'Cargo.toml');
|
|
434
|
+
if (existsSync(cargoPath)) {
|
|
435
|
+
try {
|
|
436
|
+
const content = readFileSync(cargoPath, 'utf-8');
|
|
437
|
+
const nameMatch = content.match(/^name\s*=\s*"([^"]+)"/m);
|
|
438
|
+
const versionMatch = content.match(/^version\s*=\s*"([^"]+)"/m);
|
|
439
|
+
summary['Cargo.toml'] = {
|
|
440
|
+
name: nameMatch?.[1] ?? null,
|
|
441
|
+
version: versionMatch?.[1] ?? null,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
catch {
|
|
445
|
+
// skip
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
// pyproject.toml
|
|
449
|
+
const pyprojectPath = join(projectPath, 'pyproject.toml');
|
|
450
|
+
if (existsSync(pyprojectPath)) {
|
|
451
|
+
try {
|
|
452
|
+
const content = readFileSync(pyprojectPath, 'utf-8');
|
|
453
|
+
const nameMatch = content.match(/^name\s*=\s*"([^"]+)"/m);
|
|
454
|
+
const versionMatch = content.match(/^version\s*=\s*"([^"]+)"/m);
|
|
455
|
+
summary['pyproject.toml'] = {
|
|
456
|
+
name: nameMatch?.[1] ?? null,
|
|
457
|
+
version: versionMatch?.[1] ?? null,
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
catch {
|
|
461
|
+
// skip
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
// go.mod
|
|
465
|
+
const goModPath = join(projectPath, 'go.mod');
|
|
466
|
+
if (existsSync(goModPath)) {
|
|
467
|
+
try {
|
|
468
|
+
const content = readFileSync(goModPath, 'utf-8');
|
|
469
|
+
const moduleMatch = content.match(/^module\s+(\S+)/m);
|
|
470
|
+
const goMatch = content.match(/^go\s+(\S+)/m);
|
|
471
|
+
summary['go.mod'] = {
|
|
472
|
+
module: moduleMatch?.[1] ?? null,
|
|
473
|
+
goVersion: goMatch?.[1] ?? null,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
catch {
|
|
477
|
+
// skip
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return summary;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Estimate indexing time based on file count.
|
|
484
|
+
*/
|
|
485
|
+
function estimateIndexTime(totalFiles) {
|
|
486
|
+
if (totalFiles < 50)
|
|
487
|
+
return '<5 seconds';
|
|
488
|
+
if (totalFiles < 200)
|
|
489
|
+
return '5-15 seconds';
|
|
490
|
+
if (totalFiles < 500)
|
|
491
|
+
return '15-30 seconds';
|
|
492
|
+
if (totalFiles < 1000)
|
|
493
|
+
return '30-60 seconds';
|
|
494
|
+
if (totalFiles < 5000)
|
|
495
|
+
return '1-3 minutes';
|
|
496
|
+
return '3+ minutes';
|
|
497
|
+
}
|
|
498
|
+
// ============================================================
|
|
499
|
+
// Registration
|
|
500
|
+
// ============================================================
|
|
501
|
+
/**
|
|
502
|
+
* Register Filesystem tools — lightweight file/directory operations
|
|
503
|
+
* that work without triggering graph indexing.
|
|
504
|
+
*/
|
|
505
|
+
export function registerFilesystemTools(server, graph, config, estimator = defaultEstimator) {
|
|
506
|
+
// ── mindmap_list_dir ──────────────────────────────────────────
|
|
507
|
+
server.tool('mindmap_list_dir', 'List directory contents without triggering indexing. Returns files and directories with sizes and child counts. ' +
|
|
508
|
+
'Directories are sorted first, then files, alphabetically.', {
|
|
509
|
+
path: z.string().describe('Absolute or relative path to directory'),
|
|
510
|
+
includeHidden: z.boolean().default(false).describe('Include hidden files/dirs (starting with .)'),
|
|
511
|
+
}, async ({ path: inputPath, includeHidden }) => {
|
|
512
|
+
try {
|
|
513
|
+
const resolved = resolvePath(inputPath, config.projectRoot, true);
|
|
514
|
+
if (!resolved) {
|
|
515
|
+
return mcpText(fail(`Path "${inputPath}" resolves outside the project root`));
|
|
516
|
+
}
|
|
517
|
+
if (!existsSync(resolved)) {
|
|
518
|
+
return mcpText(fail(`Directory not found: ${resolved}`));
|
|
519
|
+
}
|
|
520
|
+
const stat = statSync(resolved);
|
|
521
|
+
if (!stat.isDirectory()) {
|
|
522
|
+
return mcpText(fail(`Not a directory: ${resolved}`));
|
|
523
|
+
}
|
|
524
|
+
const result = listDirectory(resolved, includeHidden);
|
|
525
|
+
return mcpText(ok(result, estimator));
|
|
526
|
+
}
|
|
527
|
+
catch (err) {
|
|
528
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
529
|
+
return mcpText(fail(`Failed to list directory: ${msg}`));
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
// ── mindmap_read_lines ────────────────────────────────────────
|
|
533
|
+
server.tool('mindmap_read_lines', 'Read specific lines from a file (1-indexed, inclusive). Optionally includes the containing symbol ' +
|
|
534
|
+
'(function/class) from the knowledge graph if indexed. Capped at 500 lines per request.', {
|
|
535
|
+
filePath: z.string().describe('Absolute or relative path to file'),
|
|
536
|
+
startLine: z.number().int().min(1).default(1).describe('First line to read (1-indexed)'),
|
|
537
|
+
endLine: z.number().int().min(1).optional().describe('Last line to read (1-indexed, inclusive). Omit to read 200 lines from startLine'),
|
|
538
|
+
includeContext: z.boolean().default(true).describe('Include the containing symbol name from the graph if indexed'),
|
|
539
|
+
}, async ({ filePath: inputPath, startLine, endLine, includeContext }) => {
|
|
540
|
+
try {
|
|
541
|
+
const resolved = resolvePath(inputPath, config.projectRoot, true);
|
|
542
|
+
if (!resolved) {
|
|
543
|
+
return mcpText(fail(`Path "${inputPath}" resolves outside the project root`));
|
|
544
|
+
}
|
|
545
|
+
if (!existsSync(resolved)) {
|
|
546
|
+
return mcpText(fail(`File not found: ${resolved}`));
|
|
547
|
+
}
|
|
548
|
+
const stat = statSync(resolved);
|
|
549
|
+
if (!stat.isFile()) {
|
|
550
|
+
return mcpText(fail(`Not a file: ${resolved}`));
|
|
551
|
+
}
|
|
552
|
+
const result = readLines(resolved, startLine, endLine, includeContext, graph);
|
|
553
|
+
return mcpText(ok(result, estimator));
|
|
554
|
+
}
|
|
555
|
+
catch (err) {
|
|
556
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
557
|
+
return mcpText(fail(`Failed to read file: ${msg}`));
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
// ── mindmap_project_summary ───────────────────────────────────
|
|
561
|
+
server.tool('mindmap_project_summary', 'Get a complete project overview in a single call — WITHOUT indexing. ' +
|
|
562
|
+
'Detects project type, counts files by language, builds a compact directory tree, ' +
|
|
563
|
+
'finds entry points, and reads key config files. Works instantly on any project.', {
|
|
564
|
+
projectPath: z.string().describe('Absolute path to the project root'),
|
|
565
|
+
}, async ({ projectPath }) => {
|
|
566
|
+
try {
|
|
567
|
+
if (!existsSync(projectPath)) {
|
|
568
|
+
return mcpText(fail(`Project path not found: ${projectPath}`));
|
|
569
|
+
}
|
|
570
|
+
const stat = statSync(projectPath);
|
|
571
|
+
if (!stat.isDirectory()) {
|
|
572
|
+
return mcpText(fail(`Not a directory: ${projectPath}`));
|
|
573
|
+
}
|
|
574
|
+
// Parse .gitignore for extra skip rules
|
|
575
|
+
const gitignoreNames = parseGitignoreSimple(join(projectPath, '.gitignore'));
|
|
576
|
+
// Walk the directory tree
|
|
577
|
+
const state = {
|
|
578
|
+
totalFiles: 0,
|
|
579
|
+
totalDirs: 0,
|
|
580
|
+
languages: {},
|
|
581
|
+
entryPoints: [],
|
|
582
|
+
entriesWalked: 0,
|
|
583
|
+
truncated: false,
|
|
584
|
+
};
|
|
585
|
+
walkDirectory(projectPath, projectPath, gitignoreNames, state);
|
|
586
|
+
// Sort languages by count (descending)
|
|
587
|
+
const sortedLanguages = {};
|
|
588
|
+
const langEntries = Object.entries(state.languages).sort((a, b) => b[1] - a[1]);
|
|
589
|
+
for (const [ext, count] of langEntries) {
|
|
590
|
+
sortedLanguages[ext] = count;
|
|
591
|
+
}
|
|
592
|
+
// Detect project type
|
|
593
|
+
const projectTypes = detectProjectType(projectPath);
|
|
594
|
+
// Derive project name
|
|
595
|
+
let projectName = basename(projectPath);
|
|
596
|
+
const pkgPath = join(projectPath, 'package.json');
|
|
597
|
+
if (existsSync(pkgPath)) {
|
|
598
|
+
try {
|
|
599
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
600
|
+
if (pkg.name)
|
|
601
|
+
projectName = pkg.name;
|
|
602
|
+
}
|
|
603
|
+
catch {
|
|
604
|
+
// use directory name
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
// Build compact directory tree
|
|
608
|
+
const directoryTree = buildCompactTree(projectPath, projectPath, gitignoreNames);
|
|
609
|
+
// Read config summaries
|
|
610
|
+
const configSummary = readConfigSummary(projectPath);
|
|
611
|
+
const result = {
|
|
612
|
+
projectPath,
|
|
613
|
+
projectName,
|
|
614
|
+
projectType: projectTypes,
|
|
615
|
+
totalFiles: state.totalFiles,
|
|
616
|
+
totalDirs: state.totalDirs,
|
|
617
|
+
languages: sortedLanguages,
|
|
618
|
+
directoryTree: directoryTree || '(empty)',
|
|
619
|
+
entryPoints: state.entryPoints,
|
|
620
|
+
configSummary,
|
|
621
|
+
estimatedIndexTime: estimateIndexTime(state.totalFiles),
|
|
622
|
+
...(state.truncated ? { truncated: true, note: `Scan capped at ${MAX_WALK_ENTRIES} entries` } : {}),
|
|
623
|
+
};
|
|
624
|
+
return mcpText(ok(result, estimator));
|
|
625
|
+
}
|
|
626
|
+
catch (err) {
|
|
627
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
628
|
+
return mcpText(fail(`Failed to generate project summary: ${msg}`));
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
//# sourceMappingURL=filesystem-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem-tools.js","sourceRoot":"","sources":["../../src/tools/filesystem-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,GAEX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAO,UAAU,EAAE,MAAM,WAAW,CAAC;AAcxF,MAAM,gBAAgB,GAAoB;IACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;CAC/C,CAAC;AAEF,+DAA+D;AAC/D,UAAU;AACV,+DAA+D;AAE/D,SAAS,OAAO,CAAC,MAAkB;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;KACnE,CAAC;AACJ,CAAC;AAED,SAAS,EAAE,CAAC,IAAa,EAAE,SAA0B;IACnD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,SAAS,CAAC,QAA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