embark-cli 1.1.7
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/.claude/CLAUDE.md +33 -0
- package/.claude/settings.local.json +32 -0
- package/.github/WORKFLOWS.md +147 -0
- package/.github/workflows/ci.yml +49 -0
- package/.github/workflows/publish.yml +109 -0
- package/.idea/embark-remote-mcp.iml +9 -0
- package/.idea/encodings.xml +4 -0
- package/.idea/indexLayout.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.mcp.json +14 -0
- package/GIT_DISCOVERY.md +231 -0
- package/INTEGRATION_TESTING.md +243 -0
- package/MULTI_REPOSITORY_SEARCH.md +242 -0
- package/README.md +434 -0
- package/dist/auth/auth-helper.d.ts +3 -0
- package/dist/auth/auth-helper.d.ts.map +1 -0
- package/dist/auth/auth-helper.js +171 -0
- package/dist/auth/auth-helper.js.map +1 -0
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +24 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/jba-login.d.ts +17 -0
- package/dist/auth/jba-login.d.ts.map +1 -0
- package/dist/auth/jba-login.js +345 -0
- package/dist/auth/jba-login.js.map +1 -0
- package/dist/auth/types.d.ts +16 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +3 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/config.d.ts +26 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +54 -0
- package/dist/config.js.map +1 -0
- package/dist/embark-client.d.ts +56 -0
- package/dist/embark-client.d.ts.map +1 -0
- package/dist/embark-client.js +543 -0
- package/dist/embark-client.js.map +1 -0
- package/dist/git-utils.d.ts +47 -0
- package/dist/git-utils.d.ts.map +1 -0
- package/dist/git-utils.js +232 -0
- package/dist/git-utils.js.map +1 -0
- package/dist/handlers.d.ts +80 -0
- package/dist/handlers.d.ts.map +1 -0
- package/dist/handlers.js +301 -0
- package/dist/handlers.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +165 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +92 -0
- package/dist/logger.js.map +1 -0
- package/dist/stats-server.d.ts +3 -0
- package/dist/stats-server.d.ts.map +1 -0
- package/dist/stats-server.js +623 -0
- package/dist/stats-server.js.map +1 -0
- package/dist/stats.d.ts +118 -0
- package/dist/stats.d.ts.map +1 -0
- package/dist/stats.js +206 -0
- package/dist/stats.js.map +1 -0
- package/dist/tools.d.ts +9 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +62 -0
- package/dist/tools.js.map +1 -0
- package/package.json +47 -0
- package/test-git-discovery.mjs +322 -0
- package/test-multi-repo-filters.mjs +151 -0
- package/test-multiple-roots.mjs +436 -0
- package/test-roots.mjs +306 -0
- package/test-snippet-extraction.mjs +136 -0
- package/watch-logs.sh +78 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Git utilities for discovering repository information
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getGitRemoteUrl = getGitRemoteUrl;
|
|
7
|
+
exports.uriToPath = uriToPath;
|
|
8
|
+
exports.isGitRepository = isGitRepository;
|
|
9
|
+
exports.discoverRepositories = discoverRepositories;
|
|
10
|
+
exports.truncateAtBoundary = truncateAtBoundary;
|
|
11
|
+
exports.extractSnippetFromGit = extractSnippetFromGit;
|
|
12
|
+
const child_process_1 = require("child_process");
|
|
13
|
+
const url_1 = require("url");
|
|
14
|
+
const logger_js_1 = require("./logger.js");
|
|
15
|
+
/**
|
|
16
|
+
* Extract repository URL from Git remote
|
|
17
|
+
*/
|
|
18
|
+
function getGitRemoteUrl(directory) {
|
|
19
|
+
try {
|
|
20
|
+
const result = (0, child_process_1.execSync)('git remote get-url origin', {
|
|
21
|
+
cwd: directory,
|
|
22
|
+
encoding: 'utf-8',
|
|
23
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
24
|
+
});
|
|
25
|
+
const url = result.trim();
|
|
26
|
+
if (url) {
|
|
27
|
+
(0, logger_js_1.logToFile)('info', 'Discovered git remote URL', { directory, url });
|
|
28
|
+
return url;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
(0, logger_js_1.logToFile)('debug', 'Failed to get git remote URL', {
|
|
33
|
+
directory,
|
|
34
|
+
error: error instanceof Error ? error.message : String(error)
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Convert file:// URI to filesystem path
|
|
41
|
+
*/
|
|
42
|
+
function uriToPath(uri) {
|
|
43
|
+
try {
|
|
44
|
+
if (uri.startsWith('file://')) {
|
|
45
|
+
return (0, url_1.fileURLToPath)(uri);
|
|
46
|
+
}
|
|
47
|
+
// For non-file URIs, return as-is (might be custom schemes)
|
|
48
|
+
return uri;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
(0, logger_js_1.logToFile)('warn', 'Failed to convert URI to path', { uri, error });
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Check if a directory is a Git repository
|
|
57
|
+
*/
|
|
58
|
+
function isGitRepository(directory) {
|
|
59
|
+
try {
|
|
60
|
+
(0, child_process_1.execSync)('git rev-parse --git-dir', {
|
|
61
|
+
cwd: directory,
|
|
62
|
+
encoding: 'utf-8',
|
|
63
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
64
|
+
});
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Discover Git repositories from a list of roots
|
|
73
|
+
*/
|
|
74
|
+
function discoverRepositories(roots) {
|
|
75
|
+
(0, logger_js_1.logToFile)('info', '=== Starting Repository Discovery ===', {
|
|
76
|
+
totalRootsProvided: roots.length,
|
|
77
|
+
roots: roots.map(r => ({ uri: r.uri, name: r.name }))
|
|
78
|
+
});
|
|
79
|
+
const repositories = [];
|
|
80
|
+
let rootIndex = 0;
|
|
81
|
+
for (const root of roots) {
|
|
82
|
+
rootIndex++;
|
|
83
|
+
(0, logger_js_1.logToFile)('info', `Processing root ${rootIndex}/${roots.length}`, {
|
|
84
|
+
uri: root.uri,
|
|
85
|
+
name: root.name
|
|
86
|
+
});
|
|
87
|
+
const path = uriToPath(root.uri);
|
|
88
|
+
if (!path) {
|
|
89
|
+
(0, logger_js_1.logToFile)('warn', `❌ Root ${rootIndex}: Could not convert URI to filesystem path`, {
|
|
90
|
+
uri: root.uri,
|
|
91
|
+
reason: 'URI conversion failed'
|
|
92
|
+
});
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
(0, logger_js_1.logToFile)('info', `Root ${rootIndex}: Converted URI to path`, {
|
|
96
|
+
uri: root.uri,
|
|
97
|
+
path
|
|
98
|
+
});
|
|
99
|
+
if (!isGitRepository(path)) {
|
|
100
|
+
(0, logger_js_1.logToFile)('warn', `❌ Root ${rootIndex}: Not a Git repository`, {
|
|
101
|
+
path,
|
|
102
|
+
reason: 'No .git directory found'
|
|
103
|
+
});
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
(0, logger_js_1.logToFile)('info', `Root ${rootIndex}: Confirmed as Git repository`, { path });
|
|
107
|
+
const url = getGitRemoteUrl(path);
|
|
108
|
+
if (url) {
|
|
109
|
+
repositories.push({
|
|
110
|
+
path,
|
|
111
|
+
url,
|
|
112
|
+
name: root.name || path,
|
|
113
|
+
});
|
|
114
|
+
(0, logger_js_1.logToFile)('info', `✓ Root ${rootIndex}: Successfully discovered repository`, {
|
|
115
|
+
path,
|
|
116
|
+
url,
|
|
117
|
+
name: root.name || path
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
(0, logger_js_1.logToFile)('warn', `❌ Root ${rootIndex}: Git repository has no remote URL`, {
|
|
122
|
+
path,
|
|
123
|
+
reason: 'No origin remote configured'
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
(0, logger_js_1.logToFile)('info', '=== Repository Discovery Complete ===', {
|
|
128
|
+
totalRootsProcessed: roots.length,
|
|
129
|
+
successfulDiscoveries: repositories.length,
|
|
130
|
+
failedDiscoveries: roots.length - repositories.length,
|
|
131
|
+
discoveredRepositories: repositories.map(r => ({
|
|
132
|
+
name: r.name,
|
|
133
|
+
path: r.path,
|
|
134
|
+
url: r.url
|
|
135
|
+
}))
|
|
136
|
+
});
|
|
137
|
+
return repositories;
|
|
138
|
+
}
|
|
139
|
+
const MAX_SNIPPET_LENGTH = 1500;
|
|
140
|
+
const TRUNC_SUFFIX = "\n ... (content truncated)";
|
|
141
|
+
/**
|
|
142
|
+
* Truncate a code snippet at word/separator boundaries to avoid breaking tokens.
|
|
143
|
+
*
|
|
144
|
+
* @param snippet - The code snippet to truncate
|
|
145
|
+
* @param maxLen - Maximum total length including suffix (default: 1500)
|
|
146
|
+
* @param suffix - Suffix to append when truncated (default: "\n … (content truncated)")
|
|
147
|
+
* @returns Truncated snippet with suffix, or original if under maxLen
|
|
148
|
+
*/
|
|
149
|
+
function truncateAtBoundary(snippet, maxLen = MAX_SNIPPET_LENGTH, suffix = TRUNC_SUFFIX) {
|
|
150
|
+
if (!snippet || snippet.length <= maxLen)
|
|
151
|
+
return snippet;
|
|
152
|
+
// Prefer true word segmentation if the runtime supports it
|
|
153
|
+
if (typeof Intl !== "undefined" && Intl.Segmenter) {
|
|
154
|
+
const seg = new Intl.Segmenter(undefined, { granularity: "word" });
|
|
155
|
+
let taken = 0;
|
|
156
|
+
let out = "";
|
|
157
|
+
for (const part of seg.segment(snippet)) {
|
|
158
|
+
const { segment } = part;
|
|
159
|
+
if (taken + segment.length > maxLen)
|
|
160
|
+
break;
|
|
161
|
+
out += segment;
|
|
162
|
+
taken += segment.length;
|
|
163
|
+
}
|
|
164
|
+
if (out.trim().length > 0) {
|
|
165
|
+
return out.replace(/\s+$/u, "") + suffix;
|
|
166
|
+
}
|
|
167
|
+
// fall through to regex if segmentation gave us nothing useful
|
|
168
|
+
}
|
|
169
|
+
// Fallback: cut by code points, then roll back to last separator
|
|
170
|
+
// (avoid slicing through surrogate pairs / grapheme clusters)
|
|
171
|
+
const codePoints = Array.from(snippet); // splits by Unicode code point
|
|
172
|
+
let cut = codePoints.slice(0, maxLen).join("");
|
|
173
|
+
// Find last separator (whitespace or common punctuation / dashes / slashes / pipes)
|
|
174
|
+
const separators = /[\s.,;:!?()\[\]{}'"“”‘’\-\u2013\u2014\/\\|]+/gu;
|
|
175
|
+
let lastSep = -1;
|
|
176
|
+
for (let m; (m = separators.exec(cut));)
|
|
177
|
+
lastSep = m.index;
|
|
178
|
+
if (lastSep > 0) {
|
|
179
|
+
cut = cut.slice(0, lastSep);
|
|
180
|
+
}
|
|
181
|
+
return cut.replace(/\s+$/u, "") + suffix;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Extract code snippet from a file at a specific revision using git show
|
|
185
|
+
*
|
|
186
|
+
* @param repoPath - Absolute path to the git repository
|
|
187
|
+
* @param relativePath - Path to the file relative to the repository root
|
|
188
|
+
* @param revision - Git revision (commit hash, branch name, etc.)
|
|
189
|
+
* @param startOffset - Start byte offset in the file
|
|
190
|
+
* @param endOffset - End byte offset in the file
|
|
191
|
+
* @returns The code snippet, or null if extraction failed
|
|
192
|
+
*/
|
|
193
|
+
function extractSnippetFromGit(repoPath, relativePath, revision, startOffset, endOffset) {
|
|
194
|
+
try {
|
|
195
|
+
// Use HEAD if no revision specified
|
|
196
|
+
const rev = revision || 'HEAD';
|
|
197
|
+
// Get the full file content from git
|
|
198
|
+
const fileContent = (0, child_process_1.execSync)(`git show ${rev}:${relativePath}`, {
|
|
199
|
+
cwd: repoPath,
|
|
200
|
+
encoding: 'utf-8',
|
|
201
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
202
|
+
maxBuffer: 10 * 1024 * 1024, // 10MB buffer for large files
|
|
203
|
+
});
|
|
204
|
+
// Extract the snippet using byte offsets
|
|
205
|
+
const snippet = fileContent.slice(startOffset, endOffset);
|
|
206
|
+
// Truncate the snippet if it exceeds 1500 chars
|
|
207
|
+
const shouldTruncate = snippet.length > MAX_SNIPPET_LENGTH;
|
|
208
|
+
const finalSnippet = shouldTruncate ? truncateAtBoundary(snippet) : snippet;
|
|
209
|
+
(0, logger_js_1.logToFile)('debug', 'Successfully extracted snippet from git', {
|
|
210
|
+
repoPath,
|
|
211
|
+
relativePath,
|
|
212
|
+
revision: rev,
|
|
213
|
+
startOffset,
|
|
214
|
+
endOffset,
|
|
215
|
+
originalSnippetLength: snippet.length,
|
|
216
|
+
returnedSnippetLength: finalSnippet.length,
|
|
217
|
+
});
|
|
218
|
+
return finalSnippet;
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
(0, logger_js_1.logToFile)('warn', 'Failed to extract snippet from git', {
|
|
222
|
+
repoPath,
|
|
223
|
+
relativePath,
|
|
224
|
+
revision,
|
|
225
|
+
startOffset,
|
|
226
|
+
endOffset,
|
|
227
|
+
error: error instanceof Error ? error.message : String(error)
|
|
228
|
+
});
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=git-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-utils.js","sourceRoot":"","sources":["../src/git-utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;AASH,0CAqBC;AAKD,8BAWC;AAKD,0CAWC;AAKD,oDAwEC;AAcD,gDAwCC;AAaD,sDAgDC;AA5PD,iDAAyC;AACzC,6BAAoC;AACpC,2CAAwC;AAExC;;GAEG;AACH,SAAgB,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AAC,OAAO,CAAC;QAE5E,IAAA,qBAAS,EAAC,OAAO,EAAE,yCAAyC,EAAE;YAC5D,QAAQ;YACR,YAAY;YACZ,QAAQ,EAAE,GAAG;YACb,WAAW;YACX,SAAS;YACT,qBAAqB,EAAE,OAAO,CAAC,MAAM;YACrC,qBAAqB,EAAE,YAAY,CAAC,MAAM;SAC3C,CAAC,CAAC;QAEH,OAAO,YAAY,CAAC;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAA,qBAAS,EAAC,MAAM,EAAE,oCAAoC,EAAE;YACtD,QAAQ;YACR,YAAY;YACZ,QAAQ;YACR,WAAW;YACX,SAAS;YACT,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC9D,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request handlers for MCP server
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
import { EmbarkConfig } from './config.js';
|
|
6
|
+
interface PackageInfo {
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Initialize repositories by requesting roots from the client
|
|
12
|
+
*/
|
|
13
|
+
export declare function initializeRepositories(server: Server, config: EmbarkConfig): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Handle tools/list request
|
|
16
|
+
*/
|
|
17
|
+
export declare function handleListTools(): Promise<{
|
|
18
|
+
tools: {
|
|
19
|
+
[x: string]: unknown;
|
|
20
|
+
name: string;
|
|
21
|
+
inputSchema: {
|
|
22
|
+
[x: string]: unknown;
|
|
23
|
+
type: "object";
|
|
24
|
+
properties?: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
} | undefined;
|
|
27
|
+
required?: string[] | undefined;
|
|
28
|
+
};
|
|
29
|
+
title?: string | undefined;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
outputSchema?: {
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
type: "object";
|
|
34
|
+
properties?: {
|
|
35
|
+
[x: string]: unknown;
|
|
36
|
+
} | undefined;
|
|
37
|
+
required?: string[] | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
annotations?: {
|
|
40
|
+
[x: string]: unknown;
|
|
41
|
+
title?: string | undefined;
|
|
42
|
+
readOnlyHint?: boolean | undefined;
|
|
43
|
+
destructiveHint?: boolean | undefined;
|
|
44
|
+
idempotentHint?: boolean | undefined;
|
|
45
|
+
openWorldHint?: boolean | undefined;
|
|
46
|
+
} | undefined;
|
|
47
|
+
_meta?: {
|
|
48
|
+
[x: string]: unknown;
|
|
49
|
+
} | undefined;
|
|
50
|
+
}[];
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Handle tool call for semantic_code_search
|
|
54
|
+
*/
|
|
55
|
+
export declare function handleSemanticCodeSearch(args: any, config: EmbarkConfig, pkg: PackageInfo): Promise<{
|
|
56
|
+
content: {
|
|
57
|
+
type: string;
|
|
58
|
+
text: string;
|
|
59
|
+
}[];
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Handle tool call for search_in_dependencies
|
|
63
|
+
*/
|
|
64
|
+
export declare function handleSearchInDependencies(args: any, config: EmbarkConfig, pkg: PackageInfo): Promise<{
|
|
65
|
+
content: {
|
|
66
|
+
type: string;
|
|
67
|
+
text: string;
|
|
68
|
+
}[];
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Handle tools/call request
|
|
72
|
+
*/
|
|
73
|
+
export declare function handleCallTool(name: string, args: any, config: EmbarkConfig, pkg: PackageInfo, server: Server): Promise<{
|
|
74
|
+
content: {
|
|
75
|
+
type: string;
|
|
76
|
+
text: string;
|
|
77
|
+
}[];
|
|
78
|
+
}>;
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAyB,MAAM,aAAa,CAAC;AAKlE,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AA8DD;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,iBA4DhF;AAmED;;GAEG;AACH,wBAAsB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKpC;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,WAAW;;;;;GA8EjB;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,WAAW;;;;;GA4CjB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,MAAM;;;;;GAwBf"}
|
package/dist/handlers.js
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Request handlers for MCP server
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.initializeRepositories = initializeRepositories;
|
|
7
|
+
exports.handleListTools = handleListTools;
|
|
8
|
+
exports.handleSemanticCodeSearch = handleSemanticCodeSearch;
|
|
9
|
+
exports.handleSearchInDependencies = handleSearchInDependencies;
|
|
10
|
+
exports.handleCallTool = handleCallTool;
|
|
11
|
+
const logger_js_1 = require("./logger.js");
|
|
12
|
+
const config_js_1 = require("./config.js");
|
|
13
|
+
const embark_client_js_1 = require("./embark-client.js");
|
|
14
|
+
const tools_js_1 = require("./tools.js");
|
|
15
|
+
const git_utils_js_1 = require("./git-utils.js");
|
|
16
|
+
// Global repository cache
|
|
17
|
+
let discoveredRepositories = [];
|
|
18
|
+
function configureEnvironmentRepository(config) {
|
|
19
|
+
if (config.repositoryGitRemoteUrl) {
|
|
20
|
+
discoveredRepositories = [{
|
|
21
|
+
path: config.workingDir || null,
|
|
22
|
+
url: config.repositoryGitRemoteUrl,
|
|
23
|
+
name: 'Environment Config'
|
|
24
|
+
}];
|
|
25
|
+
(0, logger_js_1.logToFile)('info', 'Falling back to repository from environment variable', {
|
|
26
|
+
url: config.repositoryGitRemoteUrl,
|
|
27
|
+
workingDir: config.workingDir
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Add repositories supplied through INCLUDE_REPOSITORY_URLS to the discovered list
|
|
33
|
+
*/
|
|
34
|
+
function mergeIncludedRepositories(config) {
|
|
35
|
+
if (!config.includeRepositoryUrls || config.includeRepositoryUrls.length === 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const existingUrls = new Set(discoveredRepositories.map(r => r.url));
|
|
39
|
+
const added = [];
|
|
40
|
+
const skipped = [];
|
|
41
|
+
config.includeRepositoryUrls.forEach(url => {
|
|
42
|
+
if (existingUrls.has(url)) {
|
|
43
|
+
skipped.push(url);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const name = (0, config_js_1.extractRepositoryName)(url);
|
|
47
|
+
const repo = {
|
|
48
|
+
url,
|
|
49
|
+
path: null,
|
|
50
|
+
name: name ? `Included: ${name}` : 'Included Repository'
|
|
51
|
+
};
|
|
52
|
+
discoveredRepositories.push(repo);
|
|
53
|
+
existingUrls.add(url);
|
|
54
|
+
added.push(repo);
|
|
55
|
+
});
|
|
56
|
+
(0, logger_js_1.logToFile)('info', 'Applied INCLUDE_REPOSITORY_URLS additions', {
|
|
57
|
+
requested: config.includeRepositoryUrls,
|
|
58
|
+
added: added.map(r => ({ url: r.url, name: r.name })),
|
|
59
|
+
skipped: skipped
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Initialize repositories by requesting roots from the client
|
|
64
|
+
*/
|
|
65
|
+
async function initializeRepositories(server, config) {
|
|
66
|
+
try {
|
|
67
|
+
(0, logger_js_1.logToFile)('info', '=== Initializing Repositories ===');
|
|
68
|
+
(0, logger_js_1.logToFile)('info', 'Step 1: Requesting roots from MCP client...');
|
|
69
|
+
// Request roots from the client using the built-in method
|
|
70
|
+
const response = await server.listRoots();
|
|
71
|
+
(0, logger_js_1.logToFile)('info', 'Step 2: Received roots response from client', {
|
|
72
|
+
rootsCount: response.roots?.length || 0,
|
|
73
|
+
roots: response.roots?.map(r => ({ uri: r.uri, name: r.name })) || []
|
|
74
|
+
});
|
|
75
|
+
const roots = response.roots || [];
|
|
76
|
+
if (roots.length === 0) {
|
|
77
|
+
(0, logger_js_1.logToFile)('warn', '⚠️ No roots provided by client');
|
|
78
|
+
(0, logger_js_1.logToFile)('info', 'Step 3: Attempting fallback to environment variable REPOSITORY_GIT_REMOTE_URL');
|
|
79
|
+
// Fallback to environment variable if no roots provided
|
|
80
|
+
configureEnvironmentRepository(config);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
(0, logger_js_1.logToFile)('info', `Step 3: Discovering Git repositories from ${roots.length} root(s)...`);
|
|
84
|
+
// Discover Git repositories from roots
|
|
85
|
+
discoveredRepositories = (0, git_utils_js_1.discoverRepositories)(roots);
|
|
86
|
+
if (discoveredRepositories.length === 0) {
|
|
87
|
+
(0, logger_js_1.logToFile)('warn', '⚠️ No Git repositories found in provided roots');
|
|
88
|
+
(0, logger_js_1.logToFile)('info', 'Step 4: Attempting fallback to environment variable REPOSITORY_GIT_REMOTE_URL');
|
|
89
|
+
// Fallback to environment variable
|
|
90
|
+
configureEnvironmentRepository(config);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
(0, logger_js_1.logToFile)('info', `✓ Step 4: Successfully discovered ${discoveredRepositories.length} Git repository/repositories`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
mergeIncludedRepositories(config);
|
|
97
|
+
(0, logger_js_1.logToFile)('info', '=== Repository Initialization Complete ===', {
|
|
98
|
+
finalRepositoryCount: discoveredRepositories.length,
|
|
99
|
+
repositories: discoveredRepositories.map(r => ({
|
|
100
|
+
name: r.name,
|
|
101
|
+
url: r.url,
|
|
102
|
+
path: r.path
|
|
103
|
+
}))
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
(0, logger_js_1.logToFile)('error', '❌ Failed to initialize repositories', {
|
|
108
|
+
error: error instanceof Error ? error.message : String(error),
|
|
109
|
+
stack: error instanceof Error ? error.stack : undefined
|
|
110
|
+
});
|
|
111
|
+
(0, logger_js_1.logToFile)('info', 'Attempting fallback to environment variable REPOSITORY_GIT_REMOTE_URL');
|
|
112
|
+
// Fallback to environment variable on error
|
|
113
|
+
configureEnvironmentRepository(config);
|
|
114
|
+
mergeIncludedRepositories(config);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Filter repositories based on include/exclude configuration
|
|
119
|
+
*/
|
|
120
|
+
function filterRepositories(config) {
|
|
121
|
+
(0, logger_js_1.logToFile)('info', '=== Starting Repository Filtering ===', {
|
|
122
|
+
totalDiscoveredRepositories: discoveredRepositories.length,
|
|
123
|
+
repositories: discoveredRepositories.map(r => ({ url: r.url, name: r.name, path: r.path })),
|
|
124
|
+
includeConfigured: config.includeRepositoryUrls || 'Not set',
|
|
125
|
+
excludeFilter: config.excludeRepositoryUrls || 'Not set'
|
|
126
|
+
});
|
|
127
|
+
let repos = [...discoveredRepositories];
|
|
128
|
+
// If excludeRepositoryUrls is set, exclude those repositories
|
|
129
|
+
if (config.excludeRepositoryUrls && config.excludeRepositoryUrls.length > 0) {
|
|
130
|
+
const beforeExclude = repos.length;
|
|
131
|
+
const beforeUrls = repos.map(r => r.url);
|
|
132
|
+
repos = repos.filter(r => !config.excludeRepositoryUrls.includes(r.url));
|
|
133
|
+
const afterUrls = repos.map(r => r.url);
|
|
134
|
+
const excluded = beforeUrls.filter(u => !afterUrls.includes(u));
|
|
135
|
+
(0, logger_js_1.logToFile)('info', 'Applied EXCLUDE filter', {
|
|
136
|
+
excludeUrls: config.excludeRepositoryUrls,
|
|
137
|
+
beforeCount: beforeExclude,
|
|
138
|
+
afterCount: repos.length,
|
|
139
|
+
excludedRepositories: excluded,
|
|
140
|
+
remainingRepositories: repos.map(r => ({ url: r.url, name: r.name }))
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
(0, logger_js_1.logToFile)('info', '=== Repository Filtering Complete ===', {
|
|
144
|
+
initialCount: discoveredRepositories.length,
|
|
145
|
+
finalCount: repos.length,
|
|
146
|
+
filteredOut: discoveredRepositories.length - repos.length,
|
|
147
|
+
finalRepositories: repos.map(r => ({ url: r.url, name: r.name, path: r.path }))
|
|
148
|
+
});
|
|
149
|
+
return repos;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get the first discovered repository URL (legacy behavior for backward compatibility)
|
|
153
|
+
*/
|
|
154
|
+
function getRepositoryUrl() {
|
|
155
|
+
if (discoveredRepositories.length > 0) {
|
|
156
|
+
return discoveredRepositories[0].url;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
throw new Error("No repositories discovered");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Get repository path and URL for a given repository URL
|
|
164
|
+
* Returns the path if available, otherwise null
|
|
165
|
+
*/
|
|
166
|
+
function getRepositoryInfo(repoUrl) {
|
|
167
|
+
// Find matching repository by URL
|
|
168
|
+
const repo = discoveredRepositories.find(r => r.url === repoUrl);
|
|
169
|
+
return {
|
|
170
|
+
url: repoUrl,
|
|
171
|
+
path: repo?.path || null
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Handle tools/list request
|
|
176
|
+
*/
|
|
177
|
+
async function handleListTools() {
|
|
178
|
+
(0, logger_js_1.logToFile)('info', 'ListTools request received');
|
|
179
|
+
return {
|
|
180
|
+
tools: tools_js_1.TOOLS,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Handle tool call for semantic_code_search
|
|
185
|
+
*/
|
|
186
|
+
async function handleSemanticCodeSearch(args, config, pkg) {
|
|
187
|
+
const { text, repositoryGitRemoteUrl = config.repositoryGitRemoteUrl, revision = config.repositoryRevision, pathFilter, } = args;
|
|
188
|
+
(0, logger_js_1.logToFile)('info', '=== Handling Semantic Code Search ===', {
|
|
189
|
+
searchQuery: text,
|
|
190
|
+
explicitRepositoryUrl: repositoryGitRemoteUrl || 'Not provided',
|
|
191
|
+
revision: revision || 'Not set',
|
|
192
|
+
pathFilter: pathFilter || 'Not set',
|
|
193
|
+
args,
|
|
194
|
+
config
|
|
195
|
+
});
|
|
196
|
+
// If explicit repository URL is provided, use single-repo search
|
|
197
|
+
if (repositoryGitRemoteUrl) {
|
|
198
|
+
const repoInfo = getRepositoryInfo(repositoryGitRemoteUrl);
|
|
199
|
+
(0, logger_js_1.logToFile)('info', '→ Using EXPLICIT repository URL (provided in args)', {
|
|
200
|
+
text,
|
|
201
|
+
repositoryGitRemoteUrl,
|
|
202
|
+
repositoryPath: repoInfo.path,
|
|
203
|
+
source: 'explicit',
|
|
204
|
+
canResolveSnippets: repoInfo.path !== null
|
|
205
|
+
});
|
|
206
|
+
return await (0, embark_client_js_1.semanticCodeSearch)(text, repositoryGitRemoteUrl, revision, pathFilter, config, pkg, repoInfo.path);
|
|
207
|
+
}
|
|
208
|
+
// Otherwise, search across filtered repositories
|
|
209
|
+
(0, logger_js_1.logToFile)('info', '→ No explicit repository URL provided, using discovered repositories');
|
|
210
|
+
const repos = filterRepositories(config);
|
|
211
|
+
if (repos.length === 0) {
|
|
212
|
+
(0, logger_js_1.logToFile)('error', '❌ No repositories available for search after filtering', {
|
|
213
|
+
args,
|
|
214
|
+
discoveredCount: discoveredRepositories.length,
|
|
215
|
+
includeFilter: config.includeRepositoryUrls,
|
|
216
|
+
excludeFilter: config.excludeRepositoryUrls
|
|
217
|
+
});
|
|
218
|
+
return {
|
|
219
|
+
content: [
|
|
220
|
+
{
|
|
221
|
+
type: 'text',
|
|
222
|
+
text: 'Error: No repositories available for search. Please open a project directory with a Git remote, or set REPOSITORY_GIT_REMOTE_URL environment variable. INCLUDE_REPOSITORY_URLS can add extra repositories by URL; EXCLUDE_REPOSITORY_URLS can remove repositories from the list.',
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
// Single repository case - use single search for cleaner output
|
|
228
|
+
if (repos.length === 1) {
|
|
229
|
+
const repo = repos[0];
|
|
230
|
+
(0, logger_js_1.logToFile)('info', '→ Using SINGLE repository mode (only 1 repo after filtering)', {
|
|
231
|
+
text,
|
|
232
|
+
repositoryGitRemoteUrl: repo.url,
|
|
233
|
+
repositoryName: repo.name,
|
|
234
|
+
repositoryPath: repo.path,
|
|
235
|
+
source: 'discovered',
|
|
236
|
+
});
|
|
237
|
+
return await (0, embark_client_js_1.semanticCodeSearch)(text, repo.url, revision, pathFilter, config, pkg, repo.path);
|
|
238
|
+
}
|
|
239
|
+
// Multiple repositories - use multi-repo search
|
|
240
|
+
(0, logger_js_1.logToFile)('info', `→ Using MULTI-REPOSITORY mode (${repos.length} repos after filtering)`, {
|
|
241
|
+
text,
|
|
242
|
+
repositoryCount: repos.length,
|
|
243
|
+
repositories: repos.map(r => ({ url: r.url, name: r.name, path: r.path })),
|
|
244
|
+
revision,
|
|
245
|
+
pathFilter
|
|
246
|
+
});
|
|
247
|
+
return await (0, embark_client_js_1.semanticCodeSearchMultiRepo)(text, repos, revision, pathFilter, config, pkg);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Handle tool call for search_in_dependencies
|
|
251
|
+
*/
|
|
252
|
+
async function handleSearchInDependencies(args, config, pkg) {
|
|
253
|
+
const { text, dependencies, repositoryGitRemoteUrl, revision = config.repositoryRevision, maxResults = 10, minScore = 0.0, logAllowed = config.enableRemoteLogs } = args;
|
|
254
|
+
// Use provided URL, or discover from roots, or fall back to config
|
|
255
|
+
const repoUrl = repositoryGitRemoteUrl || getRepositoryUrl();
|
|
256
|
+
if (!repoUrl) {
|
|
257
|
+
(0, logger_js_1.logToFile)('error', 'No repository URL available for search', { args });
|
|
258
|
+
return {
|
|
259
|
+
content: [
|
|
260
|
+
{
|
|
261
|
+
type: 'text',
|
|
262
|
+
text: 'Error: No repository URL configured. Please open a project directory with a Git remote, or set REPOSITORY_GIT_REMOTE_URL environment variable.',
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
(0, logger_js_1.logToFile)('info', 'Performing dependency search', {
|
|
268
|
+
text,
|
|
269
|
+
repositoryGitRemoteUrl: repoUrl,
|
|
270
|
+
source: repositoryGitRemoteUrl ? 'explicit' : 'discovered'
|
|
271
|
+
});
|
|
272
|
+
return await (0, embark_client_js_1.searchInDependencies)(text, dependencies, repoUrl, revision, maxResults, minScore, logAllowed, config, pkg);
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Handle tools/call request
|
|
276
|
+
*/
|
|
277
|
+
async function handleCallTool(name, args, config, pkg, server) {
|
|
278
|
+
(0, logger_js_1.logToFile)('info', `CallTool request received for tool: ${name}`, { args });
|
|
279
|
+
try {
|
|
280
|
+
switch (name) {
|
|
281
|
+
case 'semantic_code_search':
|
|
282
|
+
return await handleSemanticCodeSearch(args, config, pkg);
|
|
283
|
+
case 'search_in_dependencies':
|
|
284
|
+
return await handleSearchInDependencies(args, config, pkg);
|
|
285
|
+
default:
|
|
286
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
(0, logger_js_1.logToFile)('error', `Error calling tool: ${name}`, { error });
|
|
291
|
+
return {
|
|
292
|
+
content: [
|
|
293
|
+
{
|
|
294
|
+
type: 'text',
|
|
295
|
+
text: `Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":";AAAA;;GAEG;;AA6EH,wDA4DC;AAsED,0CAKC;AAKD,4DAiFC;AAKD,gEA+CC;AAKD,wCA6BC;AA7XD,2CAAwC;AACxC,2CAAkE;AAClE,yDAA2G;AAC3G,yCAAmC;AACnC,iDAAsD;AAatD,0BAA0B;AAC1B,IAAI,sBAAsB,GAAiB,EAAE,CAAC;AAE9C,SAAS,8BAA8B,CAAC,MAAoB;IACxD,IAAI,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAChC,sBAAsB,GAAG,CAAC;gBACtB,IAAI,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;gBAC/B,GAAG,EAAE,MAAM,CAAC,sBAAsB;gBAClC,IAAI,EAAE,oBAAoB;aAC7B,CAAC,CAAC;QACH,IAAA,qBAAS,EAAC,MAAM,EAAE,sDAAsD,EAAE;YACtE,GAAG,EAAE,MAAM,CAAC,sBAAsB;YAClC,UAAU,EAAE,MAAM,CAAC,UAAU;SAChC,CAAC,CAAC;IACP,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAS,yBAAyB,CAAC,MAAoB;IACrD,IAAI,CAAC,MAAM,CAAC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