sverklo 0.5.2 → 0.7.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/dist/bin/sverklo.js +194 -9
- package/dist/bin/sverklo.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/registry/indexer-pool.d.ts +24 -0
- package/dist/src/registry/indexer-pool.js +97 -0
- package/dist/src/registry/indexer-pool.js.map +1 -0
- package/dist/src/registry/registry.d.ts +18 -0
- package/dist/src/registry/registry.js +69 -0
- package/dist/src/registry/registry.js.map +1 -0
- package/dist/src/registry/registry.test.d.ts +1 -0
- package/dist/src/registry/registry.test.js +79 -0
- package/dist/src/registry/registry.test.js.map +1 -0
- package/dist/src/search/cluster.d.ts +25 -0
- package/dist/src/search/cluster.js +216 -0
- package/dist/src/search/cluster.js.map +1 -0
- package/dist/src/server/dashboard-html.js +324 -183
- package/dist/src/server/dashboard-html.js.map +1 -1
- package/dist/src/server/http-server.js +29 -0
- package/dist/src/server/http-server.js.map +1 -1
- package/dist/src/server/mcp-server.d.ts +1 -0
- package/dist/src/server/mcp-server.js +319 -0
- package/dist/src/server/mcp-server.js.map +1 -1
- package/dist/src/server/tools/clusters.d.ts +20 -0
- package/dist/src/server/tools/clusters.js +92 -0
- package/dist/src/server/tools/clusters.js.map +1 -0
- package/dist/src/server/tools/list-repos.d.ts +9 -0
- package/dist/src/server/tools/list-repos.js +48 -0
- package/dist/src/server/tools/list-repos.js.map +1 -0
- package/dist/src/wiki/wiki-generator.d.ts +12 -0
- package/dist/src/wiki/wiki-generator.js +357 -0
- package/dist/src/wiki/wiki-generator.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getRegistry } from "../../registry/registry.js";
|
|
2
|
+
export const listReposTool = {
|
|
3
|
+
name: "sverklo_list_repos",
|
|
4
|
+
description: "List all indexed repositories in the global registry. " +
|
|
5
|
+
"Use this to discover available repos when running in global (multi-repo) mode. " +
|
|
6
|
+
"The repo names returned here can be passed as the `repo` parameter to any other sverklo tool.",
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {},
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export function handleListRepos() {
|
|
13
|
+
const repos = getRegistry();
|
|
14
|
+
const entries = Object.entries(repos);
|
|
15
|
+
if (entries.length === 0) {
|
|
16
|
+
return ("No repositories registered.\n\n" +
|
|
17
|
+
"Register a repo with:\n" +
|
|
18
|
+
" sverklo register /path/to/project\n" +
|
|
19
|
+
" sverklo init (from within a project directory)");
|
|
20
|
+
}
|
|
21
|
+
const rows = [];
|
|
22
|
+
const now = Date.now();
|
|
23
|
+
for (const [name, entry] of entries) {
|
|
24
|
+
const lastIndexed = new Date(entry.lastIndexed);
|
|
25
|
+
const ageMs = now - lastIndexed.getTime();
|
|
26
|
+
const ageStr = formatAge(ageMs);
|
|
27
|
+
const status = ageMs < 10 * 60 * 1000 ? "fresh" : "stale";
|
|
28
|
+
rows.push(`| ${name} | ${entry.path} | ${ageStr} | ${status} |`);
|
|
29
|
+
}
|
|
30
|
+
return (`## Indexed repositories (${entries.length})\n\n` +
|
|
31
|
+
`| Name | Path | Last indexed | Status |\n` +
|
|
32
|
+
`|---|---|---|---|\n` +
|
|
33
|
+
rows.join("\n"));
|
|
34
|
+
}
|
|
35
|
+
function formatAge(ms) {
|
|
36
|
+
const seconds = Math.floor(ms / 1000);
|
|
37
|
+
if (seconds < 60)
|
|
38
|
+
return `${seconds}s ago`;
|
|
39
|
+
const minutes = Math.floor(seconds / 60);
|
|
40
|
+
if (minutes < 60)
|
|
41
|
+
return `${minutes} min ago`;
|
|
42
|
+
const hours = Math.floor(minutes / 60);
|
|
43
|
+
if (hours < 24)
|
|
44
|
+
return `${hours} hours ago`;
|
|
45
|
+
const days = Math.floor(hours / 24);
|
|
46
|
+
return `${days} day${days > 1 ? "s" : ""} ago`;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=list-repos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-repos.js","sourceRoot":"","sources":["../../../../src/server/tools/list-repos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,wDAAwD;QACxD,iFAAiF;QACjF,+FAA+F;IACjG,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE,EAAE;KACf;CACF,CAAC;AAEF,MAAM,UAAU,eAAe;IAC7B,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEtC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CACL,iCAAiC;YACjC,yBAAyB;YACzB,uCAAuC;YACvC,mDAAmD,CACpD,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEvB,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;QACpC,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,GAAG,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAChC,MAAM,MAAM,GAAG,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1D,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,MAAM,MAAM,MAAM,IAAI,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,CACL,4BAA4B,OAAO,CAAC,MAAM,OAAO;QACjD,2CAA2C;QAC3C,qBAAqB;QACrB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAChB,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,EAAU;IAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IACtC,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,OAAO,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACzC,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,UAAU,CAAC;IAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,GAAG,KAAK,YAAY,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACpC,OAAO,GAAG,IAAI,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Indexer } from "../indexer/indexer.js";
|
|
2
|
+
export interface WikiOptions {
|
|
3
|
+
outputDir: string;
|
|
4
|
+
format: "markdown" | "html";
|
|
5
|
+
includeGraph?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Generate a markdown wiki from the indexed codebase.
|
|
9
|
+
* Entirely deterministic — no LLM calls. All data comes from
|
|
10
|
+
* the Indexer's stores (files, chunks, graph, symbol refs, PageRank).
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateWiki(indexer: Indexer, options: WikiOptions): Promise<void>;
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join, basename } from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Generate a markdown wiki from the indexed codebase.
|
|
5
|
+
* Entirely deterministic — no LLM calls. All data comes from
|
|
6
|
+
* the Indexer's stores (files, chunks, graph, symbol refs, PageRank).
|
|
7
|
+
*/
|
|
8
|
+
export async function generateWiki(indexer, options) {
|
|
9
|
+
const { outputDir } = options;
|
|
10
|
+
// Ensure output directories exist
|
|
11
|
+
await mkdir(join(outputDir, "modules"), { recursive: true });
|
|
12
|
+
await mkdir(join(outputDir, "files"), { recursive: true });
|
|
13
|
+
// Load all data upfront
|
|
14
|
+
const allFiles = indexer.fileStore.getAll(); // sorted by pagerank DESC
|
|
15
|
+
const allEdges = indexer.graphStore.getAll();
|
|
16
|
+
const allChunksWithFile = indexer.chunkStore.getAllWithFile();
|
|
17
|
+
// Build lookup maps
|
|
18
|
+
const fileById = new Map();
|
|
19
|
+
const fileByPath = new Map();
|
|
20
|
+
for (const f of allFiles) {
|
|
21
|
+
fileById.set(f.id, f);
|
|
22
|
+
fileByPath.set(f.path, f);
|
|
23
|
+
}
|
|
24
|
+
const chunksByFileId = new Map();
|
|
25
|
+
for (const c of allChunksWithFile) {
|
|
26
|
+
const list = chunksByFileId.get(c.file_id) || [];
|
|
27
|
+
list.push(c);
|
|
28
|
+
chunksByFileId.set(c.file_id, list);
|
|
29
|
+
}
|
|
30
|
+
// Build import/importer maps (file_id -> file_id[])
|
|
31
|
+
const importsOf = new Map();
|
|
32
|
+
const importersOf = new Map();
|
|
33
|
+
for (const edge of allEdges) {
|
|
34
|
+
if (!importsOf.has(edge.source_file_id))
|
|
35
|
+
importsOf.set(edge.source_file_id, new Set());
|
|
36
|
+
importsOf.get(edge.source_file_id).add(edge.target_file_id);
|
|
37
|
+
if (!importersOf.has(edge.target_file_id))
|
|
38
|
+
importersOf.set(edge.target_file_id, new Set());
|
|
39
|
+
importersOf.get(edge.target_file_id).add(edge.source_file_id);
|
|
40
|
+
}
|
|
41
|
+
// Group files by top-level directory
|
|
42
|
+
const modules = groupByModule(allFiles);
|
|
43
|
+
// 1. Generate index.md
|
|
44
|
+
const indexMd = generateIndexPage(indexer, allFiles, allEdges, modules, options);
|
|
45
|
+
await writeFile(join(outputDir, "index.md"), indexMd, "utf-8");
|
|
46
|
+
// 2. Generate per-module pages
|
|
47
|
+
for (const mod of modules) {
|
|
48
|
+
const moduleMd = generateModulePage(mod, chunksByFileId, importsOf, importersOf, fileById, modules);
|
|
49
|
+
const safeName = mod.dir.replace(/\//g, "-") || "root";
|
|
50
|
+
await writeFile(join(outputDir, "modules", `${safeName}.md`), moduleMd, "utf-8");
|
|
51
|
+
}
|
|
52
|
+
// 3. Generate per-file pages for top 50 files by PageRank
|
|
53
|
+
const top50 = allFiles.slice(0, 50);
|
|
54
|
+
for (const file of top50) {
|
|
55
|
+
const chunks = chunksByFileId.get(file.id) || [];
|
|
56
|
+
const fileMd = generateFilePage(file, chunks, importsOf, importersOf, fileById, indexer);
|
|
57
|
+
const safeName = file.path.replace(/\//g, "-").replace(/\./g, "_");
|
|
58
|
+
await writeFile(join(outputDir, "files", `${safeName}.md`), fileMd, "utf-8");
|
|
59
|
+
}
|
|
60
|
+
// Summary to stdout
|
|
61
|
+
const totalPages = 1 + modules.length + top50.length;
|
|
62
|
+
console.log(`Wiki generated: ${totalPages} pages in ${outputDir}/`);
|
|
63
|
+
console.log(` 1 index + ${modules.length} modules + ${top50.length} file pages`);
|
|
64
|
+
}
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
// Helpers
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
function groupByModule(files) {
|
|
69
|
+
const groups = new Map();
|
|
70
|
+
for (const f of files) {
|
|
71
|
+
const parts = f.path.split("/");
|
|
72
|
+
const dir = parts.length > 1 ? parts[0] : "(root)";
|
|
73
|
+
if (!groups.has(dir))
|
|
74
|
+
groups.set(dir, []);
|
|
75
|
+
groups.get(dir).push(f);
|
|
76
|
+
}
|
|
77
|
+
const modules = [];
|
|
78
|
+
for (const [dir, dirFiles] of groups) {
|
|
79
|
+
// Files are already sorted by pagerank DESC from the store
|
|
80
|
+
const hubFile = dirFiles.length > 0 ? dirFiles[0] : null;
|
|
81
|
+
modules.push({ dir, files: dirFiles, hubFile });
|
|
82
|
+
}
|
|
83
|
+
// Sort modules by total PageRank descending
|
|
84
|
+
modules.sort((a, b) => b.files.reduce((s, f) => s + f.pagerank, 0) -
|
|
85
|
+
a.files.reduce((s, f) => s + f.pagerank, 0));
|
|
86
|
+
return modules;
|
|
87
|
+
}
|
|
88
|
+
function generateIndexPage(indexer, allFiles, allEdges, modules, options) {
|
|
89
|
+
const status = indexer.getStatus();
|
|
90
|
+
const lines = [];
|
|
91
|
+
lines.push(`# ${status.projectName}`);
|
|
92
|
+
lines.push("");
|
|
93
|
+
lines.push(`> Auto-generated wiki from [sverklo](https://github.com/sverklo/sverklo) code index. ${allFiles.length} files indexed.`);
|
|
94
|
+
lines.push("");
|
|
95
|
+
// Language distribution
|
|
96
|
+
lines.push("## Language Distribution");
|
|
97
|
+
lines.push("");
|
|
98
|
+
const langCounts = new Map();
|
|
99
|
+
for (const f of allFiles) {
|
|
100
|
+
const lang = f.language || "unknown";
|
|
101
|
+
langCounts.set(lang, (langCounts.get(lang) || 0) + 1);
|
|
102
|
+
}
|
|
103
|
+
const sortedLangs = [...langCounts.entries()].sort((a, b) => b[1] - a[1]);
|
|
104
|
+
for (const [lang, count] of sortedLangs) {
|
|
105
|
+
const pct = ((count / allFiles.length) * 100).toFixed(1);
|
|
106
|
+
lines.push(`- **${lang}**: ${count} files (${pct}%)`);
|
|
107
|
+
}
|
|
108
|
+
lines.push("");
|
|
109
|
+
// Top 10 most important files
|
|
110
|
+
lines.push("## Key Files (by PageRank)");
|
|
111
|
+
lines.push("");
|
|
112
|
+
lines.push("| Rank | File | PageRank | Language |");
|
|
113
|
+
lines.push("|------|------|----------|----------|");
|
|
114
|
+
const top10 = allFiles.slice(0, 10);
|
|
115
|
+
for (let i = 0; i < top10.length; i++) {
|
|
116
|
+
const f = top10[i];
|
|
117
|
+
const safeName = f.path.replace(/\//g, "-").replace(/\./g, "_");
|
|
118
|
+
const link = `[${f.path}](files/${safeName}.md)`;
|
|
119
|
+
lines.push(`| ${i + 1} | ${link} | ${f.pagerank.toFixed(4)} | ${f.language || "—"} |`);
|
|
120
|
+
}
|
|
121
|
+
lines.push("");
|
|
122
|
+
// Dependency graph overview
|
|
123
|
+
lines.push("## Dependency Graph");
|
|
124
|
+
lines.push("");
|
|
125
|
+
const totalEdges = allEdges.length;
|
|
126
|
+
const filesWithImports = new Set(allEdges.map((e) => e.source_file_id)).size;
|
|
127
|
+
const filesWithImporters = new Set(allEdges.map((e) => e.target_file_id)).size;
|
|
128
|
+
const avgFanOut = filesWithImports > 0
|
|
129
|
+
? (totalEdges / filesWithImports).toFixed(1)
|
|
130
|
+
: "0";
|
|
131
|
+
const avgFanIn = filesWithImporters > 0
|
|
132
|
+
? (totalEdges / filesWithImporters).toFixed(1)
|
|
133
|
+
: "0";
|
|
134
|
+
lines.push(`- **Total edges**: ${totalEdges}`);
|
|
135
|
+
lines.push(`- **Files with imports**: ${filesWithImports}`);
|
|
136
|
+
lines.push(`- **Files with importers**: ${filesWithImporters}`);
|
|
137
|
+
lines.push(`- **Average fan-out**: ${avgFanOut}`);
|
|
138
|
+
lines.push(`- **Average fan-in**: ${avgFanIn}`);
|
|
139
|
+
lines.push("");
|
|
140
|
+
// Module listing
|
|
141
|
+
lines.push("## Modules");
|
|
142
|
+
lines.push("");
|
|
143
|
+
for (const mod of modules) {
|
|
144
|
+
const safeName = mod.dir.replace(/\//g, "-") || "root";
|
|
145
|
+
const totalPR = mod.files.reduce((s, f) => s + f.pagerank, 0).toFixed(4);
|
|
146
|
+
lines.push(`- [${mod.dir}](modules/${safeName}.md) — ${mod.files.length} files, total PageRank ${totalPR}`);
|
|
147
|
+
}
|
|
148
|
+
lines.push("");
|
|
149
|
+
return lines.join("\n");
|
|
150
|
+
}
|
|
151
|
+
function generateModulePage(mod, chunksByFileId, importsOf, importersOf, fileById, allModules) {
|
|
152
|
+
const lines = [];
|
|
153
|
+
lines.push(`# Module: ${mod.dir}`);
|
|
154
|
+
lines.push("");
|
|
155
|
+
lines.push(`${mod.files.length} files in this module.`);
|
|
156
|
+
if (mod.hubFile) {
|
|
157
|
+
lines.push(`Hub file (highest PageRank): **${mod.hubFile.path}** (${mod.hubFile.pagerank.toFixed(4)})`);
|
|
158
|
+
}
|
|
159
|
+
lines.push("");
|
|
160
|
+
// File list with PageRank
|
|
161
|
+
lines.push("## Files");
|
|
162
|
+
lines.push("");
|
|
163
|
+
lines.push("| File | PageRank | Language |");
|
|
164
|
+
lines.push("|------|----------|----------|");
|
|
165
|
+
for (const f of mod.files) {
|
|
166
|
+
const safeName = f.path.replace(/\//g, "-").replace(/\./g, "_");
|
|
167
|
+
const link = `[${basename(f.path)}](../files/${safeName}.md)`;
|
|
168
|
+
lines.push(`| ${link} | ${f.pagerank.toFixed(4)} | ${f.language || "—"} |`);
|
|
169
|
+
}
|
|
170
|
+
lines.push("");
|
|
171
|
+
// Key exports
|
|
172
|
+
lines.push("## Key Exports");
|
|
173
|
+
lines.push("");
|
|
174
|
+
const exportTypes = new Set(["function", "class", "type", "interface", "variable"]);
|
|
175
|
+
const exports = [];
|
|
176
|
+
for (const f of mod.files) {
|
|
177
|
+
const chunks = chunksByFileId.get(f.id) || [];
|
|
178
|
+
for (const c of chunks) {
|
|
179
|
+
if (exportTypes.has(c.type) && c.name) {
|
|
180
|
+
exports.push({
|
|
181
|
+
name: c.name,
|
|
182
|
+
type: c.type,
|
|
183
|
+
file: f.path,
|
|
184
|
+
signature: c.signature,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (exports.length > 0) {
|
|
190
|
+
// Show up to 30 exports, sorted by type then name
|
|
191
|
+
exports.sort((a, b) => a.type.localeCompare(b.type) || a.name.localeCompare(b.name));
|
|
192
|
+
const shown = exports.slice(0, 30);
|
|
193
|
+
for (const ex of shown) {
|
|
194
|
+
const sig = ex.signature ? `: \`${ex.signature}\`` : "";
|
|
195
|
+
lines.push(`- **${ex.type}** \`${ex.name}\` in ${ex.file}${sig}`);
|
|
196
|
+
}
|
|
197
|
+
if (exports.length > 30) {
|
|
198
|
+
lines.push(`- _...and ${exports.length - 30} more_`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
lines.push("_No named exports found._");
|
|
203
|
+
}
|
|
204
|
+
lines.push("");
|
|
205
|
+
// Internal dependencies
|
|
206
|
+
const modFileIds = new Set(mod.files.map((f) => f.id));
|
|
207
|
+
const internalEdges = [];
|
|
208
|
+
for (const f of mod.files) {
|
|
209
|
+
const targets = importsOf.get(f.id);
|
|
210
|
+
if (!targets)
|
|
211
|
+
continue;
|
|
212
|
+
for (const tid of targets) {
|
|
213
|
+
if (modFileIds.has(tid)) {
|
|
214
|
+
const target = fileById.get(tid);
|
|
215
|
+
if (target) {
|
|
216
|
+
internalEdges.push({ from: f.path, to: target.path });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
lines.push("## Internal Dependencies");
|
|
222
|
+
lines.push("");
|
|
223
|
+
if (internalEdges.length > 0) {
|
|
224
|
+
for (const edge of internalEdges.slice(0, 20)) {
|
|
225
|
+
lines.push(`- ${edge.from} → ${edge.to}`);
|
|
226
|
+
}
|
|
227
|
+
if (internalEdges.length > 20) {
|
|
228
|
+
lines.push(`- _...and ${internalEdges.length - 20} more_`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
lines.push("_No internal dependencies._");
|
|
233
|
+
}
|
|
234
|
+
lines.push("");
|
|
235
|
+
// External dependencies
|
|
236
|
+
const externalImports = new Map(); // module dir -> count
|
|
237
|
+
const externalImporters = new Map();
|
|
238
|
+
for (const f of mod.files) {
|
|
239
|
+
const targets = importsOf.get(f.id);
|
|
240
|
+
if (targets) {
|
|
241
|
+
for (const tid of targets) {
|
|
242
|
+
if (!modFileIds.has(tid)) {
|
|
243
|
+
const target = fileById.get(tid);
|
|
244
|
+
if (target) {
|
|
245
|
+
const tDir = target.path.split("/").length > 1 ? target.path.split("/")[0] : "(root)";
|
|
246
|
+
externalImports.set(tDir, (externalImports.get(tDir) || 0) + 1);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const sources = importersOf.get(f.id);
|
|
252
|
+
if (sources) {
|
|
253
|
+
for (const sid of sources) {
|
|
254
|
+
if (!modFileIds.has(sid)) {
|
|
255
|
+
const source = fileById.get(sid);
|
|
256
|
+
if (source) {
|
|
257
|
+
const sDir = source.path.split("/").length > 1 ? source.path.split("/")[0] : "(root)";
|
|
258
|
+
externalImporters.set(sDir, (externalImporters.get(sDir) || 0) + 1);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
lines.push("## External Dependencies");
|
|
265
|
+
lines.push("");
|
|
266
|
+
if (externalImports.size > 0 || externalImporters.size > 0) {
|
|
267
|
+
if (externalImports.size > 0) {
|
|
268
|
+
lines.push("**Imports from:**");
|
|
269
|
+
for (const [dir, count] of [...externalImports.entries()].sort((a, b) => b[1] - a[1])) {
|
|
270
|
+
lines.push(`- ${dir} (${count} edges)`);
|
|
271
|
+
}
|
|
272
|
+
lines.push("");
|
|
273
|
+
}
|
|
274
|
+
if (externalImporters.size > 0) {
|
|
275
|
+
lines.push("**Imported by:**");
|
|
276
|
+
for (const [dir, count] of [...externalImporters.entries()].sort((a, b) => b[1] - a[1])) {
|
|
277
|
+
lines.push(`- ${dir} (${count} edges)`);
|
|
278
|
+
}
|
|
279
|
+
lines.push("");
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
lines.push("_No external dependencies._");
|
|
284
|
+
lines.push("");
|
|
285
|
+
}
|
|
286
|
+
return lines.join("\n");
|
|
287
|
+
}
|
|
288
|
+
function generateFilePage(file, chunks, importsOf, importersOf, fileById, indexer) {
|
|
289
|
+
const lines = [];
|
|
290
|
+
lines.push(`# ${file.path}`);
|
|
291
|
+
lines.push("");
|
|
292
|
+
lines.push("| Property | Value |");
|
|
293
|
+
lines.push("|----------|-------|");
|
|
294
|
+
lines.push(`| **Language** | ${file.language || "unknown"} |`);
|
|
295
|
+
lines.push(`| **PageRank** | ${file.pagerank.toFixed(4)} |`);
|
|
296
|
+
lines.push(`| **Size** | ${formatBytes(file.size_bytes)} |`);
|
|
297
|
+
lines.push("");
|
|
298
|
+
// Exported symbols with signatures
|
|
299
|
+
const exportTypes = new Set(["function", "class", "type", "interface", "method", "variable"]);
|
|
300
|
+
const namedChunks = chunks.filter((c) => exportTypes.has(c.type) && c.name);
|
|
301
|
+
if (namedChunks.length > 0) {
|
|
302
|
+
lines.push("## Symbols");
|
|
303
|
+
lines.push("");
|
|
304
|
+
lines.push("| Symbol | Type | Lines | References |");
|
|
305
|
+
lines.push("|--------|------|-------|------------|");
|
|
306
|
+
for (const c of namedChunks) {
|
|
307
|
+
const refCount = indexer.symbolRefStore.getCallerCount(c.name);
|
|
308
|
+
const lineRange = `${c.start_line}–${c.end_line}`;
|
|
309
|
+
const sig = c.signature ? ` \`${c.signature}\`` : "";
|
|
310
|
+
lines.push(`| **${c.name}**${sig} | ${c.type} | ${lineRange} | ${refCount} |`);
|
|
311
|
+
}
|
|
312
|
+
lines.push("");
|
|
313
|
+
}
|
|
314
|
+
// Imports (what this file depends on)
|
|
315
|
+
const importTargets = importsOf.get(file.id);
|
|
316
|
+
lines.push("## Imports");
|
|
317
|
+
lines.push("");
|
|
318
|
+
if (importTargets && importTargets.size > 0) {
|
|
319
|
+
for (const tid of importTargets) {
|
|
320
|
+
const target = fileById.get(tid);
|
|
321
|
+
if (target) {
|
|
322
|
+
const safeName = target.path.replace(/\//g, "-").replace(/\./g, "_");
|
|
323
|
+
lines.push(`- [${target.path}](${safeName}.md)`);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
lines.push("_No indexed imports._");
|
|
329
|
+
}
|
|
330
|
+
lines.push("");
|
|
331
|
+
// Importers (who depends on this file)
|
|
332
|
+
const importSources = importersOf.get(file.id);
|
|
333
|
+
lines.push("## Imported By");
|
|
334
|
+
lines.push("");
|
|
335
|
+
if (importSources && importSources.size > 0) {
|
|
336
|
+
for (const sid of importSources) {
|
|
337
|
+
const source = fileById.get(sid);
|
|
338
|
+
if (source) {
|
|
339
|
+
const safeName = source.path.replace(/\//g, "-").replace(/\./g, "_");
|
|
340
|
+
lines.push(`- [${source.path}](${safeName}.md)`);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
lines.push("_No indexed importers._");
|
|
346
|
+
}
|
|
347
|
+
lines.push("");
|
|
348
|
+
return lines.join("\n");
|
|
349
|
+
}
|
|
350
|
+
function formatBytes(bytes) {
|
|
351
|
+
if (bytes < 1024)
|
|
352
|
+
return `${bytes} B`;
|
|
353
|
+
if (bytes < 1024 * 1024)
|
|
354
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
355
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=wiki-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiki-generator.js","sourceRoot":"","sources":["../../../src/wiki/wiki-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAW,QAAQ,EAAE,MAAM,WAAW,CAAC;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CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,GAAG,KAAK,IAAI,CAAC;IACtC,IAAI,KAAK,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sverklo",
|
|
3
3
|
"mcpName": "io.github.sverklo/sverklo",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"description": "Sverklo — local-first code intelligence MCP server. Diff-aware MR review, risk scoring, hybrid semantic search, PageRank ranking, persistent memory. Zero config.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|