@kage-core/kage-graph-mcp 1.1.6 → 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/dist/index.js +1 -1
- package/dist/kernel.js +19 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ function arrayArg(value) {
|
|
|
54
54
|
return value.split(",").map((item) => item.trim()).filter(Boolean);
|
|
55
55
|
return [];
|
|
56
56
|
}
|
|
57
|
-
const server = new index_js_1.Server({ name: "kage-graph", version: "1.1.
|
|
57
|
+
const server = new index_js_1.Server({ name: "kage-graph", version: "1.1.7" }, { capabilities: { tools: {} } });
|
|
58
58
|
function listTools() {
|
|
59
59
|
return [
|
|
60
60
|
{
|
package/dist/kernel.js
CHANGED
|
@@ -335,6 +335,9 @@ function repoKey(projectDir) {
|
|
|
335
335
|
}
|
|
336
336
|
return slugify((0, node_path_1.basename)(projectDir));
|
|
337
337
|
}
|
|
338
|
+
function repoDisplayName(projectDir) {
|
|
339
|
+
return (0, node_path_1.basename)((0, node_path_1.resolve)(projectDir));
|
|
340
|
+
}
|
|
338
341
|
function makePacketId(projectDir, type, title, suffix) {
|
|
339
342
|
const raw = suffix ? `${title}-${suffix}` : title;
|
|
340
343
|
return `repo:${repoKey(projectDir)}:${type}:${slugify(raw)}`;
|
|
@@ -931,14 +934,14 @@ function createRepoOverviewPacket(projectDir) {
|
|
|
931
934
|
const readmePath = (0, node_path_1.join)(projectDir, "README.md");
|
|
932
935
|
if (!(0, node_fs_1.existsSync)(packagePath) && !(0, node_fs_1.existsSync)(readmePath))
|
|
933
936
|
return null;
|
|
934
|
-
let title = `${(
|
|
937
|
+
let title = `${repoDisplayName(projectDir)} repo overview`;
|
|
935
938
|
const tags = ["repo", "overview"];
|
|
936
939
|
const bodyParts = [];
|
|
937
940
|
const paths = ["root"];
|
|
938
941
|
const stack = [];
|
|
939
942
|
if ((0, node_fs_1.existsSync)(packagePath)) {
|
|
940
943
|
const pkg = readJson(packagePath);
|
|
941
|
-
title = `${String(pkg.name ?? (
|
|
944
|
+
title = `${String(pkg.name ?? repoDisplayName(projectDir))} repo overview`;
|
|
942
945
|
const scripts = pkg.scripts && typeof pkg.scripts === "object" ? Object.keys(pkg.scripts) : [];
|
|
943
946
|
const deps = {
|
|
944
947
|
...pkg.dependencies,
|
|
@@ -1050,8 +1053,8 @@ function createRepoStructurePacket(projectDir) {
|
|
|
1050
1053
|
].filter(Boolean).join("\n");
|
|
1051
1054
|
return {
|
|
1052
1055
|
schema_version: exports.PACKET_SCHEMA_VERSION,
|
|
1053
|
-
id: makePacketId(projectDir, "repo_map", `${(
|
|
1054
|
-
title: `${(
|
|
1056
|
+
id: makePacketId(projectDir, "repo_map", `${repoDisplayName(projectDir)} repo structure`, "auto-structure"),
|
|
1057
|
+
title: `${repoDisplayName(projectDir)} repo structure`,
|
|
1055
1058
|
summary: summarize(body),
|
|
1056
1059
|
body,
|
|
1057
1060
|
type: "repo_map",
|
|
@@ -1083,7 +1086,18 @@ function createRepoStructurePacket(projectDir) {
|
|
|
1083
1086
|
}
|
|
1084
1087
|
function upsertGeneratedPacket(projectDir, packet) {
|
|
1085
1088
|
const dir = packetsDir(projectDir);
|
|
1086
|
-
const
|
|
1089
|
+
const entries = loadPacketEntriesFromDir(dir);
|
|
1090
|
+
const generatedKind = packet.tags.includes("overview") ? "overview" : packet.tags.includes("structure") ? "structure" : null;
|
|
1091
|
+
for (const entry of entries) {
|
|
1092
|
+
if (generatedKind &&
|
|
1093
|
+
entry.packet.id !== packet.id &&
|
|
1094
|
+
entry.packet.type === packet.type &&
|
|
1095
|
+
entry.packet.quality?.reviewer === "kage-indexer" &&
|
|
1096
|
+
entry.packet.tags.includes(generatedKind)) {
|
|
1097
|
+
(0, node_fs_1.unlinkSync)(entry.path);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
const existing = entries.find((entry) => entry.packet.id === packet.id)?.packet;
|
|
1087
1101
|
if (existing && existing.quality?.reviewer !== "kage-indexer")
|
|
1088
1102
|
return;
|
|
1089
1103
|
if (existing) {
|