mcp-probe-kit 3.0.14 → 3.0.15
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/build/lib/__tests__/gitnexus-bridge.unit.test.js +9 -1
- package/build/lib/gitnexus-bridge.d.ts +1 -0
- package/build/lib/gitnexus-bridge.js +29 -1
- package/docs/i18n/en.json +2 -0
- package/docs/i18n/ja.json +2 -0
- package/docs/i18n/ko.json +2 -0
- package/docs/i18n/zh-CN.json +2 -0
- package/docs/pages/getting-started.html +3 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import * as os from "node:os";
|
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import spawn from "cross-spawn";
|
|
5
5
|
import { afterEach, describe, expect, test } from "vitest";
|
|
6
|
-
import { prepareBridgeWorkspace, resolveExecutableCommand, resolveGitNexusBridgeCommand, resolveSpawnCommand, rerankQueryStructuredContent, } from "../gitnexus-bridge.js";
|
|
6
|
+
import { extractResolvedSymbolIdFromContext, prepareBridgeWorkspace, resolveExecutableCommand, resolveGitNexusBridgeCommand, resolveSpawnCommand, rerankQueryStructuredContent, } from "../gitnexus-bridge.js";
|
|
7
7
|
const tempRoots = [];
|
|
8
8
|
afterEach(() => {
|
|
9
9
|
while (tempRoots.length > 0) {
|
|
@@ -87,6 +87,14 @@ describe("gitnexus-bridge workspace preparation", () => {
|
|
|
87
87
|
expect(reranked.structuredContent.processes[0].heuristicLabel).toBe("Login -> GenerateToken");
|
|
88
88
|
expect(reranked.note).toMatch(/Top matches/i);
|
|
89
89
|
});
|
|
90
|
+
test("impact 可复用 context 解析出的 symbol id", () => {
|
|
91
|
+
expect(extractResolvedSymbolIdFromContext({
|
|
92
|
+
target: { id: "Method:sysAuthController.js:login:18", name: "login" },
|
|
93
|
+
})).toBe("Method:sysAuthController.js:login:18");
|
|
94
|
+
expect(extractResolvedSymbolIdFromContext({
|
|
95
|
+
symbol: { uid: "Function:src/auth.ts:login" },
|
|
96
|
+
})).toBe("Function:src/auth.ts:login");
|
|
97
|
+
});
|
|
90
98
|
test.runIf(process.platform === "win32")("Windows 下带空格路径的 cmd 可执行文件可以真实启动", async () => {
|
|
91
99
|
const root = makeTempDir("gitnexus-space-");
|
|
92
100
|
const executable = path.join(root, "Program Files", "tool.cmd");
|
|
@@ -77,6 +77,7 @@ export declare function resolveSpawnCommand(command: string, args: string[], pla
|
|
|
77
77
|
command: string;
|
|
78
78
|
args: string[];
|
|
79
79
|
};
|
|
80
|
+
export declare function extractResolvedSymbolIdFromContext(value: unknown): string | undefined;
|
|
80
81
|
export declare function rerankQueryStructuredContent(structuredContent: unknown, hints: {
|
|
81
82
|
query?: string;
|
|
82
83
|
goal?: string;
|
|
@@ -370,6 +370,29 @@ function isNonCallableSymbolKind(kind) {
|
|
|
370
370
|
|| normalized.includes("process")
|
|
371
371
|
|| normalized.includes("package");
|
|
372
372
|
}
|
|
373
|
+
export function extractResolvedSymbolIdFromContext(value) {
|
|
374
|
+
const record = toRecord(value);
|
|
375
|
+
if (!record) {
|
|
376
|
+
return undefined;
|
|
377
|
+
}
|
|
378
|
+
const direct = [record.uid, record.id, record.targetUid, record.targetId]
|
|
379
|
+
.find((item) => typeof item === "string" && item.trim());
|
|
380
|
+
if (typeof direct === "string") {
|
|
381
|
+
return direct.trim();
|
|
382
|
+
}
|
|
383
|
+
for (const key of ["target", "symbol", "node", "element"]) {
|
|
384
|
+
const nested = toRecord(record[key]);
|
|
385
|
+
if (!nested) {
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
const candidate = [nested.uid, nested.id]
|
|
389
|
+
.find((item) => typeof item === "string" && item.trim());
|
|
390
|
+
if (typeof candidate === "string") {
|
|
391
|
+
return candidate.trim();
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return undefined;
|
|
395
|
+
}
|
|
373
396
|
function normalizeImpactTargetByContext(contextExecution, originalTarget) {
|
|
374
397
|
const target = toRecord(contextExecution.structuredContent)?.target;
|
|
375
398
|
const kind = inferSymbolKind(target);
|
|
@@ -1029,6 +1052,7 @@ export async function runCodeInsightBridge(request) {
|
|
|
1029
1052
|
warnings.push("缺少 target/uid 参数,已跳过 impact");
|
|
1030
1053
|
return;
|
|
1031
1054
|
}
|
|
1055
|
+
let impactTarget = request.uid || request.target;
|
|
1032
1056
|
if (!request.uid && request.target) {
|
|
1033
1057
|
let contextExecution = getLastExecutionByTool(executions, "context");
|
|
1034
1058
|
if (!contextExecution) {
|
|
@@ -1049,10 +1073,14 @@ export async function runCodeInsightBridge(request) {
|
|
|
1049
1073
|
warnings.push("impact_target_non_callable");
|
|
1050
1074
|
return;
|
|
1051
1075
|
}
|
|
1076
|
+
const resolvedTargetId = extractResolvedSymbolIdFromContext(contextExecution.structuredContent);
|
|
1077
|
+
if (resolvedTargetId) {
|
|
1078
|
+
impactTarget = resolvedTargetId;
|
|
1079
|
+
}
|
|
1052
1080
|
}
|
|
1053
1081
|
}
|
|
1054
1082
|
executions.push(await callBridgeTool(client, "impact", {
|
|
1055
|
-
target:
|
|
1083
|
+
target: impactTarget,
|
|
1056
1084
|
direction: request.direction || "upstream",
|
|
1057
1085
|
...(request.maxDepth ? { maxDepth: request.maxDepth } : {}),
|
|
1058
1086
|
...(typeof request.includeTests === "boolean"
|
package/docs/i18n/en.json
CHANGED
|
@@ -93,6 +93,8 @@
|
|
|
93
93
|
"item1": "The first cold start may take 20+ seconds while npx checks or downloads dependencies.",
|
|
94
94
|
"item2": "Some GitNexus dependencies use tree-sitter native modules and may require Visual Studio Build Tools.",
|
|
95
95
|
"item3": "If your MCP client supports env, prefer a preinstalled gitnexus CLI and raise GitNexus timeouts.",
|
|
96
|
+
"item4": "Quick install Build Tools on Windows: winget install Microsoft.VisualStudio.2022.BuildTools",
|
|
97
|
+
"quickInstallTitle": "Quick install command:",
|
|
96
98
|
"exampleTitle": "Example using a preinstalled gitnexus CLI:"
|
|
97
99
|
},
|
|
98
100
|
"source": {
|
package/docs/i18n/ja.json
CHANGED
|
@@ -93,6 +93,8 @@
|
|
|
93
93
|
"item1": "初回のコールドスタートでは、npx が依存関係を確認またはダウンロードするため 20 秒以上かかることがあります。",
|
|
94
94
|
"item2": "GitNexus の一部依存関係は tree-sitter ネイティブモジュールを使用しており、Windows では Visual Studio Build Tools が必要になる場合があります。",
|
|
95
95
|
"item3": "MCP クライアントが env をサポートしている場合は、プリインストール済みの gitnexus CLI を優先し、GitNexus のタイムアウトを引き上げてください。",
|
|
96
|
+
"item4": "Windows では winget で Build Tools をすばやくインストールできます:winget install Microsoft.VisualStudio.2022.BuildTools",
|
|
97
|
+
"quickInstallTitle": "クイックインストールコマンド:",
|
|
96
98
|
"exampleTitle": "プリインストール済み gitnexus CLI を使う設定例:"
|
|
97
99
|
},
|
|
98
100
|
"source": {
|
package/docs/i18n/ko.json
CHANGED
|
@@ -93,6 +93,8 @@
|
|
|
93
93
|
"item1": "첫 콜드 스타트에서는 npx 가 의존성을 확인하거나 다운로드하므로 20초 이상 걸릴 수 있습니다.",
|
|
94
94
|
"item2": "GitNexus 의 일부 의존성은 tree-sitter 네이티브 모듈을 사용하며 Windows 에서는 Visual Studio Build Tools 가 필요할 수 있습니다.",
|
|
95
95
|
"item3": "MCP 클라이언트가 env 를 지원하면, 미리 설치한 gitnexus CLI 를 우선 사용하고 GitNexus 타임아웃을 늘리세요.",
|
|
96
|
+
"item4": "Windows 에서 Build Tools 빠른 설치: winget install Microsoft.VisualStudio.2022.BuildTools",
|
|
97
|
+
"quickInstallTitle": "빠른 설치 명령:",
|
|
96
98
|
"exampleTitle": "미리 설치한 gitnexus CLI 를 사용하는 구성 예시:"
|
|
97
99
|
},
|
|
98
100
|
"source": {
|
package/docs/i18n/zh-CN.json
CHANGED
|
@@ -93,6 +93,8 @@
|
|
|
93
93
|
"item1": "首次冷启动时,npx 可能检查或下载依赖,耗时可能超过 20 秒。",
|
|
94
94
|
"item2": "GitNexus 的部分依赖使用 tree-sitter 原生模块,在 Windows 上可能需要 Visual Studio Build Tools。",
|
|
95
95
|
"item3": "如果 MCP 客户端支持 env,优先使用预装的 gitnexus CLI,并适当增大 GitNexus 超时。",
|
|
96
|
+
"item4": "Windows 下可用 winget 快速安装 Build Tools:winget install Microsoft.VisualStudio.2022.BuildTools",
|
|
97
|
+
"quickInstallTitle": "快速安装命令:",
|
|
96
98
|
"exampleTitle": "使用预装 gitnexus CLI 的配置示例:"
|
|
97
99
|
},
|
|
98
100
|
"source": {
|
|
@@ -317,7 +317,10 @@ npm run build</code></pre>
|
|
|
317
317
|
<li data-i18n="gettingStarted.step1.windowsGraph.item1">The first cold start may take 20+ seconds while npx checks or downloads dependencies.</li>
|
|
318
318
|
<li data-i18n="gettingStarted.step1.windowsGraph.item2">Some GitNexus dependencies use tree-sitter native modules and may require Visual Studio Build Tools.</li>
|
|
319
319
|
<li data-i18n="gettingStarted.step1.windowsGraph.item3">If your MCP client supports env, prefer a preinstalled gitnexus CLI and raise GitNexus timeouts.</li>
|
|
320
|
+
<li data-i18n="gettingStarted.step1.windowsGraph.item4">Quick install Build Tools on Windows: winget install Microsoft.VisualStudio.2022.BuildTools</li>
|
|
320
321
|
</ul>
|
|
322
|
+
<p class="mb-2" data-i18n="gettingStarted.step1.windowsGraph.quickInstallTitle">Quick install command:</p>
|
|
323
|
+
<pre class="code-block mb-3 p-3 text-sm text-slate-200 bg-slate-900 rounded overflow-x-auto"><code>winget install Microsoft.VisualStudio.2022.BuildTools</code></pre>
|
|
321
324
|
<p class="mb-2" data-i18n="gettingStarted.step1.windowsGraph.exampleTitle">Example using a preinstalled gitnexus CLI:</p>
|
|
322
325
|
<div class="bg-slate-900 rounded-lg overflow-hidden">
|
|
323
326
|
<div class="flex items-center justify-between px-3 py-2 bg-slate-800">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-probe-kit",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.15",
|
|
4
4
|
"description": "AI-Powered Development Toolkit - MCP Server with 22 tools covering code quality, development efficiency, project management, and UI/UX design. Features: Structured Output, Workflow Orchestration, UI/UX Pro Max, and Requirements Interview.",
|
|
5
5
|
"mcpName": "io.github.mybolide/mcp-probe-kit",
|
|
6
6
|
"type": "module",
|