@execufunction/mcp-server 0.2.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.
- package/README.md +182 -0
- package/dist/exfClient.d.ts +565 -0
- package/dist/exfClient.d.ts.map +1 -0
- package/dist/exfClient.js +595 -0
- package/dist/exfClient.js.map +1 -0
- package/dist/gitService.d.ts +121 -0
- package/dist/gitService.d.ts.map +1 -0
- package/dist/gitService.js +451 -0
- package/dist/gitService.js.map +1 -0
- package/dist/incrementalIndexer.d.ts +42 -0
- package/dist/incrementalIndexer.d.ts.map +1 -0
- package/dist/incrementalIndexer.js +445 -0
- package/dist/incrementalIndexer.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1868 -0
- package/dist/index.js.map +1 -0
- package/dist/localIndexer.d.ts +33 -0
- package/dist/localIndexer.d.ts.map +1 -0
- package/dist/localIndexer.js +323 -0
- package/dist/localIndexer.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Incremental Indexer
|
|
4
|
+
*
|
|
5
|
+
* Git-aware indexing that only uploads changed files.
|
|
6
|
+
* Falls back to full index for non-git directories or first-time index.
|
|
7
|
+
*
|
|
8
|
+
* Reference: docs/design/semantic-git-system-plan.md § Phase 1
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.indexIncrementally = indexIncrementally;
|
|
45
|
+
exports.formatIncrementalResult = formatIncrementalResult;
|
|
46
|
+
const fs = __importStar(require("fs"));
|
|
47
|
+
const path = __importStar(require("path"));
|
|
48
|
+
const gitService_js_1 = require("./gitService.js");
|
|
49
|
+
const localIndexer_js_1 = require("./localIndexer.js");
|
|
50
|
+
/**
|
|
51
|
+
* Read file content safely
|
|
52
|
+
*/
|
|
53
|
+
function readFileContent(rootPath, relativePath) {
|
|
54
|
+
try {
|
|
55
|
+
const fullPath = path.join(rootPath, relativePath);
|
|
56
|
+
const content = fs.readFileSync(fullPath, 'utf-8');
|
|
57
|
+
// Basic binary detection via null bytes
|
|
58
|
+
if (content.includes('\0')) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return content;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Check if a file path matches any of the given glob patterns
|
|
69
|
+
* Simple glob matching: supports * and ** wildcards
|
|
70
|
+
*/
|
|
71
|
+
function matchesPattern(filePath, patterns) {
|
|
72
|
+
if (patterns.length === 0)
|
|
73
|
+
return true; // No patterns = match all
|
|
74
|
+
for (const pattern of patterns) {
|
|
75
|
+
// Convert glob to regex
|
|
76
|
+
const regexPattern = pattern
|
|
77
|
+
.replace(/\*\*/g, '<<<GLOBSTAR>>>')
|
|
78
|
+
.replace(/\*/g, '[^/]*')
|
|
79
|
+
.replace(/<<<GLOBSTAR>>>/g, '.*')
|
|
80
|
+
.replace(/\?/g, '.')
|
|
81
|
+
.replace(/\./g, '\\.');
|
|
82
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
83
|
+
if (regex.test(filePath)) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Check if a file should be included based on include/exclude patterns
|
|
91
|
+
*/
|
|
92
|
+
function shouldIncludeFile(filePath, includePatterns, excludePatterns) {
|
|
93
|
+
// If exclude patterns match, reject
|
|
94
|
+
if (excludePatterns.length > 0 && matchesPattern(filePath, excludePatterns)) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
// If include patterns specified, file must match at least one
|
|
98
|
+
if (includePatterns.length > 0) {
|
|
99
|
+
return matchesPattern(filePath, includePatterns);
|
|
100
|
+
}
|
|
101
|
+
return true; // No include patterns = include all (that aren't excluded)
|
|
102
|
+
}
|
|
103
|
+
function resolvePatterns(requested, repositoryDefaults) {
|
|
104
|
+
if (requested && requested.length > 0) {
|
|
105
|
+
return requested;
|
|
106
|
+
}
|
|
107
|
+
if (repositoryDefaults && repositoryDefaults.length > 0) {
|
|
108
|
+
return repositoryDefaults;
|
|
109
|
+
}
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
function prepareUploadBatch(rootPath, changes, includePatterns, excludePatterns) {
|
|
113
|
+
const filesToUpload = [];
|
|
114
|
+
const deletedPaths = [];
|
|
115
|
+
const renamedFiles = [];
|
|
116
|
+
for (const change of changes) {
|
|
117
|
+
if (!shouldIncludeFile(change.path, includePatterns, excludePatterns)) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (change.changeType === 'D') {
|
|
121
|
+
deletedPaths.push(change.path);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (change.changeType === 'R' && change.oldPath) {
|
|
125
|
+
renamedFiles.push({ oldPath: change.oldPath, newPath: change.path });
|
|
126
|
+
}
|
|
127
|
+
const content = readFileContent(rootPath, change.path);
|
|
128
|
+
if (!content) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
filesToUpload.push({
|
|
132
|
+
path: change.path,
|
|
133
|
+
content,
|
|
134
|
+
changeType: change.changeType,
|
|
135
|
+
oldPath: change.oldPath,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return { filesToUpload, deletedPaths, renamedFiles };
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Incrementally index a codebase using git diff.
|
|
142
|
+
*
|
|
143
|
+
* Flow:
|
|
144
|
+
* 1. Check if git repository
|
|
145
|
+
* 2. Get last indexed commit from backend
|
|
146
|
+
* 3. If no last commit → full index
|
|
147
|
+
* 4. If same commit → no changes
|
|
148
|
+
* 5. Otherwise → get changed files via git diff, upload only those
|
|
149
|
+
*/
|
|
150
|
+
async function indexIncrementally(client, repositoryId, rootPath, options = {}) {
|
|
151
|
+
const progress = {
|
|
152
|
+
phase: 'scanning',
|
|
153
|
+
filesFound: 0,
|
|
154
|
+
filesUploaded: 0,
|
|
155
|
+
chunksCreated: 0,
|
|
156
|
+
isIncremental: false,
|
|
157
|
+
};
|
|
158
|
+
const reportProgress = options.onProgress || (() => { });
|
|
159
|
+
reportProgress(progress);
|
|
160
|
+
const includeWorkingTree = options.includeWorkingTree !== false;
|
|
161
|
+
const gitService = new gitService_js_1.GitService(rootPath);
|
|
162
|
+
// Check if this is a git repository
|
|
163
|
+
const isGitRepo = await gitService.isGitRepository();
|
|
164
|
+
if (!isGitRepo) {
|
|
165
|
+
// Fall back to full index for non-git directories
|
|
166
|
+
console.log('Not a git repository, falling back to full index');
|
|
167
|
+
const fullResult = await (0, localIndexer_js_1.indexLocalCodebase)(client, repositoryId, rootPath, {
|
|
168
|
+
includePatterns: options.includePatterns,
|
|
169
|
+
excludePatterns: options.excludePatterns,
|
|
170
|
+
onProgress: options.onProgress,
|
|
171
|
+
});
|
|
172
|
+
return { ...fullResult, isIncremental: false };
|
|
173
|
+
}
|
|
174
|
+
try {
|
|
175
|
+
// Get repository info from backend
|
|
176
|
+
const repoResult = await client.getCodeRepository(repositoryId);
|
|
177
|
+
if (repoResult.error || !repoResult.data?.repository) {
|
|
178
|
+
throw new Error(repoResult.error || 'Repository not found');
|
|
179
|
+
}
|
|
180
|
+
const repo = repoResult.data.repository;
|
|
181
|
+
const includePatterns = resolvePatterns(options.includePatterns, repo.includePatterns);
|
|
182
|
+
const excludePatterns = resolvePatterns(options.excludePatterns, repo.excludePatterns);
|
|
183
|
+
progress.usedRepositoryPatterns =
|
|
184
|
+
((!options.includePatterns || options.includePatterns.length === 0) && includePatterns.length > 0)
|
|
185
|
+
|| ((!options.excludePatterns || options.excludePatterns.length === 0) && excludePatterns.length > 0);
|
|
186
|
+
const localIndexOptions = {
|
|
187
|
+
includePatterns,
|
|
188
|
+
excludePatterns,
|
|
189
|
+
onProgress: options.onProgress,
|
|
190
|
+
};
|
|
191
|
+
const lastIndexedCommit = repo.gitCommitSha;
|
|
192
|
+
const currentCommit = await gitService.getCurrentCommit();
|
|
193
|
+
const currentBranch = await gitService.getCurrentBranch();
|
|
194
|
+
progress.toCommit = currentCommit;
|
|
195
|
+
const runFullFallback = async (reason) => {
|
|
196
|
+
await client.updateRepositoryCommit(repositoryId, {
|
|
197
|
+
sha: currentCommit,
|
|
198
|
+
branch: currentBranch,
|
|
199
|
+
indexFallbackReason: reason,
|
|
200
|
+
});
|
|
201
|
+
const fullResult = await (0, localIndexer_js_1.indexLocalCodebase)(client, repositoryId, rootPath, localIndexOptions);
|
|
202
|
+
return {
|
|
203
|
+
...fullResult,
|
|
204
|
+
isIncremental: false,
|
|
205
|
+
fromCommit: lastIndexedCommit,
|
|
206
|
+
toCommit: currentCommit,
|
|
207
|
+
fallbackReason: reason,
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
// First-time index
|
|
211
|
+
if (!lastIndexedCommit) {
|
|
212
|
+
console.log('First-time index, performing full scan');
|
|
213
|
+
await client.updateRepositoryCommit(repositoryId, {
|
|
214
|
+
sha: currentCommit,
|
|
215
|
+
branch: currentBranch,
|
|
216
|
+
});
|
|
217
|
+
const fullResult = await (0, localIndexer_js_1.indexLocalCodebase)(client, repositoryId, rootPath, localIndexOptions);
|
|
218
|
+
return {
|
|
219
|
+
...fullResult,
|
|
220
|
+
isIncremental: false,
|
|
221
|
+
toCommit: currentCommit,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
progress.fromCommit = lastIndexedCommit;
|
|
225
|
+
progress.isIncremental = true;
|
|
226
|
+
const headMoved = lastIndexedCommit !== currentCommit;
|
|
227
|
+
let committedChanges = [];
|
|
228
|
+
if (headMoved) {
|
|
229
|
+
const baseIsReachable = await gitService.isCommitAncestor(lastIndexedCommit, currentCommit);
|
|
230
|
+
if (!baseIsReachable) {
|
|
231
|
+
console.warn(`Last indexed commit ${lastIndexedCommit.slice(0, 12)} is not reachable from HEAD, falling back to full reindex`);
|
|
232
|
+
return runFullFallback('base_commit_not_reachable');
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
committedChanges = await gitService.getChangedFilesSinceCommit(lastIndexedCommit);
|
|
236
|
+
}
|
|
237
|
+
catch (err) {
|
|
238
|
+
console.warn(`Failed to diff ${lastIndexedCommit.slice(0, 12)}..HEAD, falling back to full reindex`, err);
|
|
239
|
+
return runFullFallback('diff_failed_reindexed_full');
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
let workingTreeChanges = [];
|
|
243
|
+
if (includeWorkingTree) {
|
|
244
|
+
try {
|
|
245
|
+
workingTreeChanges = await gitService.getWorkingTreeChanges();
|
|
246
|
+
}
|
|
247
|
+
catch (err) {
|
|
248
|
+
console.warn('Failed to read working tree changes, continuing without local overlay', err);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
progress.workingTreeChanges = workingTreeChanges.length;
|
|
252
|
+
const committedUpload = prepareUploadBatch(rootPath, committedChanges, includePatterns, excludePatterns);
|
|
253
|
+
const workingUpload = prepareUploadBatch(rootPath, workingTreeChanges, includePatterns, excludePatterns);
|
|
254
|
+
const hasCommittedUpload = committedUpload.filesToUpload.length > 0 || committedUpload.deletedPaths.length > 0;
|
|
255
|
+
const hasWorkingUpload = workingUpload.filesToUpload.length > 0 || workingUpload.deletedPaths.length > 0;
|
|
256
|
+
const hasAnyUpload = hasCommittedUpload || hasWorkingUpload;
|
|
257
|
+
progress.changesDetected = committedChanges.length + workingTreeChanges.length;
|
|
258
|
+
progress.filesFound =
|
|
259
|
+
committedUpload.filesToUpload.length
|
|
260
|
+
+ committedUpload.deletedPaths.length
|
|
261
|
+
+ committedUpload.renamedFiles.length
|
|
262
|
+
+ workingUpload.filesToUpload.length
|
|
263
|
+
+ workingUpload.deletedPaths.length
|
|
264
|
+
+ workingUpload.renamedFiles.length;
|
|
265
|
+
if (!headMoved && !hasAnyUpload) {
|
|
266
|
+
progress.phase = 'complete';
|
|
267
|
+
reportProgress(progress);
|
|
268
|
+
return progress;
|
|
269
|
+
}
|
|
270
|
+
if (!hasAnyUpload && headMoved) {
|
|
271
|
+
// Metadata-only commit range (no code/file deltas after filtering).
|
|
272
|
+
await client.updateRepositoryCommit(repositoryId, {
|
|
273
|
+
sha: currentCommit,
|
|
274
|
+
branch: currentBranch,
|
|
275
|
+
});
|
|
276
|
+
await client.finalizeCodeIndexing(repositoryId, {
|
|
277
|
+
mode: 'incremental_committed',
|
|
278
|
+
});
|
|
279
|
+
progress.phase = 'complete';
|
|
280
|
+
reportProgress(progress);
|
|
281
|
+
return progress;
|
|
282
|
+
}
|
|
283
|
+
progress.phase = 'uploading';
|
|
284
|
+
reportProgress(progress);
|
|
285
|
+
// Trigger indexing mode
|
|
286
|
+
await client.triggerCodeIndexing(repositoryId);
|
|
287
|
+
const applyRenames = async (renamedFiles) => {
|
|
288
|
+
for (const rename of renamedFiles) {
|
|
289
|
+
try {
|
|
290
|
+
await client.renameFile(repositoryId, rename.oldPath, rename.newPath);
|
|
291
|
+
}
|
|
292
|
+
catch (err) {
|
|
293
|
+
console.warn(`Failed to rename ${rename.oldPath} → ${rename.newPath}:`, err);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
let totalChunksReused = 0;
|
|
298
|
+
// Committed deltas: upload with commit context for linking.
|
|
299
|
+
if (hasCommittedUpload) {
|
|
300
|
+
await applyRenames(committedUpload.renamedFiles);
|
|
301
|
+
const commitInfo = await gitService.getHeadCommitInfo();
|
|
302
|
+
const uploadResult = await client.uploadFilesWithCommit(repositoryId, {
|
|
303
|
+
files: committedUpload.filesToUpload,
|
|
304
|
+
commit: {
|
|
305
|
+
sha: commitInfo.sha,
|
|
306
|
+
parentShas: commitInfo.parentShas,
|
|
307
|
+
authorName: commitInfo.authorName,
|
|
308
|
+
authorEmail: commitInfo.authorEmail,
|
|
309
|
+
authorDate: commitInfo.authorDate.toISOString(),
|
|
310
|
+
message: commitInfo.message,
|
|
311
|
+
},
|
|
312
|
+
deletedPaths: committedUpload.deletedPaths,
|
|
313
|
+
});
|
|
314
|
+
if (uploadResult.data) {
|
|
315
|
+
progress.filesUploaded += uploadResult.data.successful || 0;
|
|
316
|
+
progress.chunksCreated += uploadResult.data.totalChunks || 0;
|
|
317
|
+
totalChunksReused += uploadResult.data.chunksReused || 0;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
// Working tree overlay: upload without commit metadata.
|
|
321
|
+
if (hasWorkingUpload) {
|
|
322
|
+
await applyRenames(workingUpload.renamedFiles);
|
|
323
|
+
const uploadResult = await client.uploadFilesWithCommit(repositoryId, {
|
|
324
|
+
files: workingUpload.filesToUpload,
|
|
325
|
+
deletedPaths: workingUpload.deletedPaths,
|
|
326
|
+
});
|
|
327
|
+
if (uploadResult.data) {
|
|
328
|
+
progress.filesUploaded += uploadResult.data.successful || 0;
|
|
329
|
+
progress.chunksCreated += uploadResult.data.totalChunks || 0;
|
|
330
|
+
totalChunksReused += uploadResult.data.chunksReused || 0;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (totalChunksReused > 0) {
|
|
334
|
+
progress.chunksReused = totalChunksReused;
|
|
335
|
+
}
|
|
336
|
+
// Phase 3 Hardening: Record ALL commits between lastIndexedCommit and HEAD
|
|
337
|
+
// This ensures complete commit history, not just HEAD
|
|
338
|
+
progress.phase = 'finalizing';
|
|
339
|
+
reportProgress(progress);
|
|
340
|
+
if (headMoved) {
|
|
341
|
+
const commitShas = await gitService.getCommitRange(lastIndexedCommit, currentCommit);
|
|
342
|
+
let commitsRecorded = 0;
|
|
343
|
+
for (const sha of commitShas) {
|
|
344
|
+
try {
|
|
345
|
+
const commitInfo = await gitService.getCommitInfo(sha);
|
|
346
|
+
const commitChanges = await gitService.getCommitChangesWithStats(sha);
|
|
347
|
+
// Filter changes by include/exclude patterns
|
|
348
|
+
const filteredChanges = commitChanges.filter(c => shouldIncludeFile(c.path, includePatterns, excludePatterns));
|
|
349
|
+
if (filteredChanges.length > 0) {
|
|
350
|
+
await client.recordCommit(repositoryId, {
|
|
351
|
+
sha: commitInfo.sha,
|
|
352
|
+
parentShas: commitInfo.parentShas,
|
|
353
|
+
authorName: commitInfo.authorName,
|
|
354
|
+
authorEmail: commitInfo.authorEmail,
|
|
355
|
+
authorDate: commitInfo.authorDate.toISOString(),
|
|
356
|
+
committerName: commitInfo.committerName,
|
|
357
|
+
committerEmail: commitInfo.committerEmail,
|
|
358
|
+
committerDate: commitInfo.committerDate.toISOString(),
|
|
359
|
+
message: commitInfo.message,
|
|
360
|
+
fileChanges: filteredChanges.map(fc => ({
|
|
361
|
+
path: fc.path,
|
|
362
|
+
changeType: fc.changeType,
|
|
363
|
+
oldPath: fc.oldPath,
|
|
364
|
+
linesAdded: fc.linesAdded,
|
|
365
|
+
linesDeleted: fc.linesDeleted,
|
|
366
|
+
})),
|
|
367
|
+
});
|
|
368
|
+
commitsRecorded++;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
catch (err) {
|
|
372
|
+
console.warn(`Failed to record commit ${sha}:`, err);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (commitsRecorded > 0) {
|
|
376
|
+
console.log(`Recorded ${commitsRecorded} commits with line stats`);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
await client.updateRepositoryCommit(repositoryId, {
|
|
380
|
+
sha: currentCommit,
|
|
381
|
+
branch: currentBranch,
|
|
382
|
+
});
|
|
383
|
+
await client.finalizeCodeIndexing(repositoryId, {
|
|
384
|
+
mode: includeWorkingTree && hasWorkingUpload
|
|
385
|
+
? 'incremental_overlay'
|
|
386
|
+
: 'incremental_committed',
|
|
387
|
+
});
|
|
388
|
+
progress.phase = 'complete';
|
|
389
|
+
reportProgress(progress);
|
|
390
|
+
return progress;
|
|
391
|
+
}
|
|
392
|
+
catch (err) {
|
|
393
|
+
progress.phase = 'error';
|
|
394
|
+
progress.error = err instanceof Error ? err.message : String(err);
|
|
395
|
+
reportProgress(progress);
|
|
396
|
+
return progress;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Format incremental index result for display
|
|
401
|
+
*/
|
|
402
|
+
function formatIncrementalResult(result) {
|
|
403
|
+
if (result.phase === 'error') {
|
|
404
|
+
return `❌ Indexing failed: ${result.error}`;
|
|
405
|
+
}
|
|
406
|
+
if (!result.isIncremental) {
|
|
407
|
+
const lines = [
|
|
408
|
+
`✅ Full index complete!`,
|
|
409
|
+
`Files scanned: ${result.filesFound}`,
|
|
410
|
+
`Files uploaded: ${result.filesUploaded}`,
|
|
411
|
+
`Chunks created: ${result.chunksCreated}`,
|
|
412
|
+
];
|
|
413
|
+
if (result.fallbackReason) {
|
|
414
|
+
lines.push(`Mode: full reindex (${result.fallbackReason})`);
|
|
415
|
+
}
|
|
416
|
+
return lines.join('\n');
|
|
417
|
+
}
|
|
418
|
+
if (result.changesDetected === 0) {
|
|
419
|
+
const shortCommit = result.toCommit?.slice(0, 7) || 'unknown';
|
|
420
|
+
const workingTreeNote = result.workingTreeChanges && result.workingTreeChanges > 0
|
|
421
|
+
? `, working tree: ${result.workingTreeChanges}`
|
|
422
|
+
: '';
|
|
423
|
+
return `✅ No changes detected since last index (commit: ${shortCommit}${workingTreeNote})`;
|
|
424
|
+
}
|
|
425
|
+
const lines = [
|
|
426
|
+
`✅ Incremental index complete!`,
|
|
427
|
+
`Changes detected: ${result.changesDetected}`,
|
|
428
|
+
`Files uploaded: ${result.filesUploaded}`,
|
|
429
|
+
`Chunks created: ${result.chunksCreated}`,
|
|
430
|
+
];
|
|
431
|
+
if (result.workingTreeChanges && result.workingTreeChanges > 0) {
|
|
432
|
+
lines.push(`Working tree changes indexed: ${result.workingTreeChanges}`);
|
|
433
|
+
}
|
|
434
|
+
if (result.chunksReused && result.chunksReused > 0) {
|
|
435
|
+
lines.push(`♻️ Chunks reused: ${result.chunksReused} (content-addressed)`);
|
|
436
|
+
}
|
|
437
|
+
if (result.fromCommit && result.toCommit) {
|
|
438
|
+
lines.push(`Commits: ${result.fromCommit.slice(0, 7)} → ${result.toCommit.slice(0, 7)}`);
|
|
439
|
+
}
|
|
440
|
+
if (result.usedRepositoryPatterns) {
|
|
441
|
+
lines.push('Filters: using repository include/exclude patterns');
|
|
442
|
+
}
|
|
443
|
+
return lines.join('\n');
|
|
444
|
+
}
|
|
445
|
+
//# sourceMappingURL=incrementalIndexer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incrementalIndexer.js","sourceRoot":"","sources":["../src/incrementalIndexer.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6JH,gDA0SC;AAKD,0DAkDC;AA5fD,uCAAyB;AACzB,2CAA6B;AAE7B,mDAAyD;AACzD,uDAAuG;AAoBvG;;GAEG;AACH,SAAS,eAAe,CAAC,QAAgB,EAAE,YAAoB;IAC7D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACnD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAEnD,wCAAwC;QACxC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,QAAgB,EAAE,QAAkB;IAC1D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC,CAAC,0BAA0B;IAElE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,wBAAwB;QACxB,MAAM,YAAY,GAAG,OAAO;aACzB,OAAO,CAAC,OAAO,EAAE,gBAAgB,CAAC;aAClC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;aACvB,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;aAChC,OAAO,CAAC,KAAK,EAAE,GAAG,CA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E,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;QACnD,KAAK,CAAC,IAAI,CAAC,qBAAqB,MAAM,CAAC,YAAY,sBAAsB,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACzC,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,IAAI,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* ExecuFunction MCP Server
|
|
4
|
+
*
|
|
5
|
+
* A Model Context Protocol server that exposes ExecuFunction tools to IDE clients
|
|
6
|
+
* like Cursor, Claude Desktop, and VS Code.
|
|
7
|
+
*
|
|
8
|
+
* Configuration via environment variables:
|
|
9
|
+
* - EXF_API_URL: ExecuFunction API URL (e.g., https://execufunction.com)
|
|
10
|
+
* - EXF_PAT: Personal Access Token for authentication
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* 1. Create a PAT in ExecuFunction Settings > Developer > Access Tokens
|
|
14
|
+
* 2. Configure your MCP client (e.g., claude_desktop_config.json):
|
|
15
|
+
* {
|
|
16
|
+
* "mcpServers": {
|
|
17
|
+
* "execufunction": {
|
|
18
|
+
* "command": "npx",
|
|
19
|
+
* "args": ["@execufunction/mcp-server"],
|
|
20
|
+
* "env": {
|
|
21
|
+
* "EXF_API_URL": "https://execufunction.com",
|
|
22
|
+
* "EXF_PAT": "exf_pat_..."
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG"}
|