@windagency/codemap-gen-for-agents 1.0.2 → 1.1.0-rc.1
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 +2 -2
- package/THIRD_PARTY_LICENSES.md +446 -55
- package/dist/core/cache/cache-schema.js +1 -0
- package/dist/core/cache/cache-schema.js.map +1 -1
- package/dist/core/cache/extraction-cache.d.ts +1 -0
- package/dist/core/cache/extraction-cache.js +1 -0
- package/dist/core/cache/extraction-cache.js.map +1 -1
- package/dist/core/cli-args-schema.d.ts +5 -1
- package/dist/core/cli-args-schema.js +42 -1
- package/dist/core/cli-args-schema.js.map +1 -1
- package/dist/core/cli-args.js +18 -8
- package/dist/core/cli-args.js.map +1 -1
- package/dist/core/compose.d.ts +1 -0
- package/dist/core/compose.js +5 -0
- package/dist/core/compose.js.map +1 -1
- package/dist/core/config-schema.d.ts +7 -0
- package/dist/core/config-schema.js +5 -0
- package/dist/core/config-schema.js.map +1 -1
- package/dist/core/config.d.ts +6 -0
- package/dist/core/config.js +14 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/generate-command.d.ts +5 -1
- package/dist/core/generate-command.js +15 -1
- package/dist/core/generate-command.js.map +1 -1
- package/dist/core/generate-map.d.ts +10 -0
- package/dist/core/generate-map.js +100 -13
- package/dist/core/generate-map.js.map +1 -1
- package/dist/core/index-warning.d.ts +9 -0
- package/dist/core/index-warning.js +17 -0
- package/dist/core/index-warning.js.map +1 -0
- package/dist/core/languages.d.ts +2 -0
- package/dist/core/languages.js +3 -0
- package/dist/core/languages.js.map +1 -1
- package/dist/core/read-command.d.ts +2 -0
- package/dist/core/read-command.js +6 -1
- package/dist/core/read-command.js.map +1 -1
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.js.map +1 -1
- package/dist/extraction/scip/index-hashes-schema.d.ts +8 -0
- package/dist/extraction/scip/index-hashes-schema.js +14 -0
- package/dist/extraction/scip/index-hashes-schema.js.map +1 -0
- package/dist/extraction/scip/indexer-process.d.ts +20 -0
- package/dist/extraction/scip/indexer-process.js +55 -0
- package/dist/extraction/scip/indexer-process.js.map +1 -0
- package/dist/extraction/scip/scip-call-refinement.d.ts +11 -0
- package/dist/extraction/scip/scip-call-refinement.js +88 -0
- package/dist/extraction/scip/scip-call-refinement.js.map +1 -0
- package/dist/extraction/scip/scip-index-reader.d.ts +9 -0
- package/dist/extraction/scip/scip-index-reader.js +38 -0
- package/dist/extraction/scip/scip-index-reader.js.map +1 -0
- package/dist/extraction/scip/scip-index-schema.d.ts +29 -0
- package/dist/extraction/scip/scip-index-schema.js +64 -0
- package/dist/extraction/scip/scip-index-schema.js.map +1 -0
- package/dist/extraction/scip/scip-index.d.ts +20 -0
- package/dist/extraction/scip/scip-index.js +5 -0
- package/dist/extraction/scip/scip-index.js.map +1 -0
- package/dist/extraction/scip/scip-staleness.d.ts +6 -0
- package/dist/extraction/scip/scip-staleness.js +65 -0
- package/dist/extraction/scip/scip-staleness.js.map +1 -0
- package/dist/extraction/scip/scip-symbol.d.ts +19 -0
- package/dist/extraction/scip/scip-symbol.js +68 -0
- package/dist/extraction/scip/scip-symbol.js.map +1 -0
- package/dist/extraction/scip-indexer.d.ts +32 -0
- package/dist/extraction/scip-indexer.js +210 -0
- package/dist/extraction/scip-indexer.js.map +1 -0
- package/dist/extraction/scip-resolver.d.ts +20 -0
- package/dist/extraction/scip-resolver.js +148 -0
- package/dist/extraction/scip-resolver.js.map +1 -0
- package/dist/extraction/tree-sitter-common/tree-sitter-parser.d.ts +1 -1
- package/dist/extraction/tree-sitter-common/tree-sitter-parser.js +1 -1
- package/dist/extraction/tree-sitter-common/tree-sitter-parser.js.map +1 -1
- package/dist/extraction/tree-sitter-go/go-parser.js +3 -2
- package/dist/extraction/tree-sitter-go/go-parser.js.map +1 -1
- package/dist/extraction/tree-sitter-java/java-parser.js +3 -2
- package/dist/extraction/tree-sitter-java/java-parser.js.map +1 -1
- package/dist/extraction/tree-sitter-python/python-parser.js +3 -2
- package/dist/extraction/tree-sitter-python/python-parser.js.map +1 -1
- package/dist/extraction/tree-sitter-rust/rust-parser.js +3 -2
- package/dist/extraction/tree-sitter-rust/rust-parser.js.map +1 -1
- package/dist/integration/cli/cli-help.d.ts +2 -2
- package/dist/integration/cli/cli-help.js +9 -1
- package/dist/integration/cli/cli-help.js.map +1 -1
- package/dist/integration/mcp/tool-input-schema.d.ts +13 -0
- package/dist/integration/mcp/tool-input-schema.js +14 -6
- package/dist/integration/mcp/tool-input-schema.js.map +1 -1
- package/dist/integration/skill/SKILL.md +5 -2
- package/dist/integration/skill/skill-help.d.ts +2 -2
- package/dist/integration/skill/skill-help.js +9 -1
- package/dist/integration/skill/skill-help.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ScipLanguage } from "../core/languages.js";
|
|
2
|
+
import type { ExtractedSymbols } from "../core/types.js";
|
|
3
|
+
export interface IndexSource {
|
|
4
|
+
language: ScipLanguage;
|
|
5
|
+
indexPath: string;
|
|
6
|
+
fileHashes?: Readonly<Record<string, string>>;
|
|
7
|
+
}
|
|
8
|
+
export interface UnreadableIndex {
|
|
9
|
+
indexPath: string;
|
|
10
|
+
reason: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IndexResolution {
|
|
13
|
+
symbols: ExtractedSymbols[];
|
|
14
|
+
unreadableIndexes: UnreadableIndex[];
|
|
15
|
+
}
|
|
16
|
+
export interface IndexResolver {
|
|
17
|
+
languagesIn(indexPath: string): ScipLanguage[] | undefined;
|
|
18
|
+
resolve(sources: IndexSource[], fresh: ExtractedSymbols[], symbolsByFile: ReadonlyMap<string, ExtractedSymbols>): IndexResolution;
|
|
19
|
+
}
|
|
20
|
+
export declare function createScipIndexResolver(): IndexResolver;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { extensionOf, languageOfExtension, SCIP_LANGUAGES } from "../core/languages.js";
|
|
6
|
+
import { buildDefinitionIndex, refineCalls } from "./scip/scip-call-refinement.js";
|
|
7
|
+
import { readScipIndex } from "./scip/scip-index-reader.js";
|
|
8
|
+
import { isDocumentCurrent } from "./scip/scip-staleness.js";
|
|
9
|
+
function realpathOrSelf(dir) {
|
|
10
|
+
try {
|
|
11
|
+
return fs.realpathSync(dir);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return dir;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function isDirectory(dir) {
|
|
18
|
+
try {
|
|
19
|
+
return fs.statSync(dir).isDirectory();
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// The recorded project root first, then the directory holding the index and each of its
|
|
26
|
+
// ancestors: an index built on another machine (CI, a committed fixture) names a root that does
|
|
27
|
+
// not exist here, and may have been stored anywhere below the tree it describes.
|
|
28
|
+
function candidateRootsOf(index, indexPath) {
|
|
29
|
+
const candidates = [];
|
|
30
|
+
if (index.projectRoot.startsWith("file://")) {
|
|
31
|
+
const projectRoot = fileURLToPath(index.projectRoot);
|
|
32
|
+
if (isDirectory(projectRoot))
|
|
33
|
+
candidates.push(projectRoot);
|
|
34
|
+
}
|
|
35
|
+
for (let dir = path.dirname(path.resolve(indexPath));; dir = path.dirname(dir)) {
|
|
36
|
+
candidates.push(dir);
|
|
37
|
+
if (path.dirname(dir) === dir)
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
return candidates;
|
|
41
|
+
}
|
|
42
|
+
// Documents are relative to the index's project root. Picks the candidate under which the most
|
|
43
|
+
// documents exist on disk; the earliest candidate wins a tie.
|
|
44
|
+
function documentRootOf(index, indexPath) {
|
|
45
|
+
let best = { root: path.dirname(path.resolve(indexPath)), hits: -1 };
|
|
46
|
+
for (const root of candidateRootsOf(index, indexPath)) {
|
|
47
|
+
const hits = index.documents.filter((document) => fs.existsSync(path.join(root, ...document.relativePath.split("/")))).length;
|
|
48
|
+
if (hits > best.hits)
|
|
49
|
+
best = { root, hits };
|
|
50
|
+
}
|
|
51
|
+
return realpathOrSelf(best.root);
|
|
52
|
+
}
|
|
53
|
+
// scip-python leaves `Document.language` empty, so an empty one falls back to the extension.
|
|
54
|
+
function isDocumentFor(document, language) {
|
|
55
|
+
if (document.language !== "")
|
|
56
|
+
return document.language.toLowerCase() === language;
|
|
57
|
+
return languageOfExtension(extensionOf(document.relativePath)) === language;
|
|
58
|
+
}
|
|
59
|
+
function readSource(filePath) {
|
|
60
|
+
try {
|
|
61
|
+
return fs.readFileSync(filePath);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// One index can serve several languages; it is decoded, and reported unreadable, once.
|
|
68
|
+
function loadDocuments(sources) {
|
|
69
|
+
const loaded = {
|
|
70
|
+
documentsByFile: new Map(),
|
|
71
|
+
recordedHashes: new Map(),
|
|
72
|
+
indexedLanguages: new Set(),
|
|
73
|
+
unreadableIndexes: [],
|
|
74
|
+
};
|
|
75
|
+
const reads = new Map();
|
|
76
|
+
for (const source of sources) {
|
|
77
|
+
const known = reads.get(source.indexPath);
|
|
78
|
+
const read = known ?? readScipIndex(source.indexPath);
|
|
79
|
+
reads.set(source.indexPath, read);
|
|
80
|
+
if (read.ok)
|
|
81
|
+
addDocuments(loaded, source, read.index);
|
|
82
|
+
else if (!known)
|
|
83
|
+
loaded.unreadableIndexes.push({ indexPath: source.indexPath, reason: read.reason });
|
|
84
|
+
}
|
|
85
|
+
return loaded;
|
|
86
|
+
}
|
|
87
|
+
function addDocuments(loaded, source, index) {
|
|
88
|
+
loaded.indexedLanguages.add(source.language);
|
|
89
|
+
for (const [filePath, contentHash] of Object.entries(source.fileHashes ?? {})) {
|
|
90
|
+
loaded.recordedHashes.set(filePath, contentHash);
|
|
91
|
+
}
|
|
92
|
+
const root = documentRootOf(index, source.indexPath);
|
|
93
|
+
for (const document of index.documents) {
|
|
94
|
+
if (isDocumentFor(document, source.language)) {
|
|
95
|
+
loaded.documentsByFile.set(path.join(root, ...document.relativePath.split("/")), document);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Every indexed file is checked, not just the freshly extracted ones: a call into an unchanged
|
|
100
|
+
// file still needs that file's definitions to be current.
|
|
101
|
+
function findStaleFiles(documentsByFile, recordedHashes) {
|
|
102
|
+
const staleFiles = new Set();
|
|
103
|
+
for (const [filePath, document] of documentsByFile) {
|
|
104
|
+
const source = readSource(filePath);
|
|
105
|
+
const recorded = recordedHashes.get(filePath);
|
|
106
|
+
// The same sha256 of the raw bytes that `hashFile` recorded in the sidecar.
|
|
107
|
+
const hashes = source === undefined || recorded === undefined
|
|
108
|
+
? undefined
|
|
109
|
+
: { recorded, current: crypto.createHash("sha256").update(source).digest("hex") };
|
|
110
|
+
if (source === undefined || !isDocumentCurrent(document, source.toString("utf8"), hashes)) {
|
|
111
|
+
staleFiles.add(filePath);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return staleFiles;
|
|
115
|
+
}
|
|
116
|
+
function isIndexedLanguage(filePath, indexedLanguages) {
|
|
117
|
+
const language = languageOfExtension(extensionOf(filePath));
|
|
118
|
+
return indexedLanguages.has(language ?? "");
|
|
119
|
+
}
|
|
120
|
+
export function createScipIndexResolver() {
|
|
121
|
+
return {
|
|
122
|
+
languagesIn(indexPath) {
|
|
123
|
+
const read = readScipIndex(indexPath);
|
|
124
|
+
if (!read.ok)
|
|
125
|
+
return undefined;
|
|
126
|
+
return SCIP_LANGUAGES.filter((language) => read.index.documents.some((document) => isDocumentFor(document, language)));
|
|
127
|
+
},
|
|
128
|
+
resolve(sources, fresh, symbolsByFile) {
|
|
129
|
+
const { documentsByFile, recordedHashes, indexedLanguages, unreadableIndexes } = loadDocuments(sources);
|
|
130
|
+
if (indexedLanguages.size === 0)
|
|
131
|
+
return { symbols: fresh, unreadableIndexes };
|
|
132
|
+
const staleFiles = findStaleFiles(documentsByFile, recordedHashes);
|
|
133
|
+
const definitions = buildDefinitionIndex(documentsByFile, staleFiles);
|
|
134
|
+
const symbols = fresh.map((extracted) => {
|
|
135
|
+
if (!isIndexedLanguage(extracted.filePath, indexedLanguages))
|
|
136
|
+
return extracted;
|
|
137
|
+
const document = documentsByFile.get(extracted.filePath);
|
|
138
|
+
if (!document)
|
|
139
|
+
return { ...extracted, indexFallback: "index-uncovered" };
|
|
140
|
+
if (staleFiles.has(extracted.filePath))
|
|
141
|
+
return { ...extracted, indexFallback: "index-stale" };
|
|
142
|
+
return { ...extracted, calls: refineCalls(extracted, document, definitions, symbolsByFile) };
|
|
143
|
+
});
|
|
144
|
+
return { symbols, unreadableIndexes };
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=scip-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scip-resolver.js","sourceRoot":"","sources":["../../src/extraction/scip-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AAEzG,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAE7F,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAoCvE,SAAS,cAAc,CAAC,GAAW;IAClC,IAAI,CAAC;QACJ,OAAO,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;I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AE,aAAa,CAAC,EAAE,CAAC;YAC9F,CAAC,CAAC,CAAC;YACH,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;QACvC,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -14,7 +14,7 @@ export interface TreeSitterFile {
|
|
|
14
14
|
entry: FileSymbolIndex;
|
|
15
15
|
}
|
|
16
16
|
export interface TreeSitterLanguage<LanguageIndex> {
|
|
17
|
-
|
|
17
|
+
loadGrammar: () => TreeSitterParser.Language;
|
|
18
18
|
collectDeclaredSymbols: (root: TreeSitterParser.SyntaxNode) => DeclaredItem[];
|
|
19
19
|
buildLanguageIndex: (program: TreeSitterProgram) => LanguageIndex;
|
|
20
20
|
extractFile: (file: TreeSitterFile, program: TreeSitterProgram, languageIndex: LanguageIndex) => {
|
|
@@ -8,7 +8,7 @@ export function parseWithTreeSitter(language, rootDir, programFiles, extractFile
|
|
|
8
8
|
if (extractFiles.length === 0)
|
|
9
9
|
return [];
|
|
10
10
|
const parser = new TreeSitterParser();
|
|
11
|
-
parser.setLanguage(language.
|
|
11
|
+
parser.setLanguage(language.loadGrammar());
|
|
12
12
|
const parsed = buildProgramIndex(parser, programFiles, language.collectDeclaredSymbols);
|
|
13
13
|
const program = {
|
|
14
14
|
rootDir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-sitter-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-common/tree-sitter-parser.ts"],"names":[],"mappings":"AACA,OAAO,EACN,iBAAiB,GAGjB,MAAM,iDAAiD,CAAC;AAEzD,OAAO,gBAAgB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"tree-sitter-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-common/tree-sitter-parser.ts"],"names":[],"mappings":"AACA,OAAO,EACN,iBAAiB,GAGjB,MAAM,iDAAiD,CAAC;AAEzD,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAmC3C,2FAA2F;AAC3F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AK,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { memoizeManifestLookup } from "../tree-sitter-common/program-index.js";
|
|
2
3
|
import { parseWithTreeSitter, } from "../tree-sitter-common/tree-sitter-parser.js";
|
|
3
4
|
import { toRawCalls } from "./go-call-resolution.js";
|
|
4
5
|
import { buildImportAliasToFiles, collectImportSpecs, toRawImports, } from "./go-import-resolution.js";
|
|
5
6
|
import { findNearestGoModule } from "./go-mod.js";
|
|
6
7
|
import { collectDeclaredSymbols } from "./go-symbol-classification.js";
|
|
7
|
-
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
8
9
|
function buildGoIndex({ rootDir }) {
|
|
9
10
|
return { goModuleFor: memoizeManifestLookup(rootDir, findNearestGoModule) };
|
|
10
11
|
}
|
|
11
12
|
const GO = {
|
|
12
|
-
|
|
13
|
+
loadGrammar: () => require("tree-sitter-go"),
|
|
13
14
|
collectDeclaredSymbols,
|
|
14
15
|
buildLanguageIndex: buildGoIndex,
|
|
15
16
|
extractFile: ({ filePath, tree, entry }, { programFiles, index }, go) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"go-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-go/go-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"go-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-go/go-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EACN,mBAAmB,GAGnB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EACN,uBAAuB,EACvB,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AC,CAAC;IACrE,CAAC;CACD"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { memoizeManifestLookup } from "../tree-sitter-common/program-index.js";
|
|
2
3
|
import { parseWithTreeSitter, } from "../tree-sitter-common/tree-sitter-parser.js";
|
|
3
4
|
import { buildTypeNameIndex, toRawCalls } from "./java-call-resolution.js";
|
|
4
5
|
import { buildFqcnIndex, buildVisibleTypeIndex, collectImportSpecs, collectSupertypeReferences, toRawImports, toSupertypeImports, } from "./java-import-resolution.js";
|
|
5
6
|
import { findNearestJavaProject } from "./java-project.js";
|
|
6
7
|
import { collectDeclaredSymbols } from "./java-symbol-classification.js";
|
|
7
|
-
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
8
9
|
function buildJavaIndex({ rootDir, programFiles, index, treeByFile }) {
|
|
9
10
|
return {
|
|
10
11
|
projectFor: memoizeManifestLookup(rootDir, findNearestJavaProject),
|
|
@@ -16,7 +17,7 @@ function buildJavaIndex({ rootDir, programFiles, index, treeByFile }) {
|
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
const JAVA = {
|
|
19
|
-
|
|
20
|
+
loadGrammar: () => require("tree-sitter-java"),
|
|
20
21
|
collectDeclaredSymbols,
|
|
21
22
|
buildLanguageIndex: buildJavaIndex,
|
|
22
23
|
extractFile: ({ filePath, tree, entry }, { index }, java) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"java-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-java/java-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"java-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-java/java-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EACN,mBAAmB,GAGnB,MAAM,sDAAsD,CA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qBAAqB,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACrF,OAAO;YACN,OAAO,EAAE;gBACR,GAAG,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;gBACjE,GAAG,kBAAkB,CAAC,0BAA0B,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;aAClF;YACD,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC;SACvG,CAAC;IACH,CAAC;CACD,CAAC;AAEF,4FAA4F;AAC5F,6FAA6F;AAC7F,sDAAsD;AACtD,MAAM,OAAO,oBAAoB;IAChC,KAAK,CAAC,OAAe,EAAE,YAAsB,EAAE,YAAsB;QACpE,OAAO,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IACvE,CAAC;CACD"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { memoizeManifestLookup } from "../tree-sitter-common/program-index.js";
|
|
2
3
|
import { parseWithTreeSitter, } from "../tree-sitter-common/tree-sitter-parser.js";
|
|
3
4
|
import { findNearestPythonProject } from "./pyproject-manifest.js";
|
|
4
5
|
import { toRawCalls } from "./python-call-resolution.js";
|
|
5
6
|
import { buildImportAliasToFiles, collectImportSpecs, toRawImports, } from "./python-import-resolution.js";
|
|
6
7
|
import { collectDeclaredSymbols } from "./python-symbol-classification.js";
|
|
7
|
-
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
8
9
|
function buildPythonIndex({ rootDir }) {
|
|
9
10
|
return {
|
|
10
11
|
projectFor: memoizeManifestLookup(rootDir, findNearestPythonProject),
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
const PYTHON = {
|
|
14
|
-
|
|
15
|
+
loadGrammar: () => require("tree-sitter-python"),
|
|
15
16
|
collectDeclaredSymbols,
|
|
16
17
|
buildLanguageIndex: buildPythonIndex,
|
|
17
18
|
extractFile: ({ filePath, tree, entry }, { programFiles, index }, python) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-python/python-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"python-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-python/python-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EACN,mBAAmB,GAGnB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AACtF,OAAO,EACN,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,GACZ,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAExG,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,SAAS,gBAAgB,CAAC,EAAE,OAAO,EAAqB;IACvD,OAAO;QACN,UAAU,EAAE,qBAAqB,CAAC,OAAO,EAAE,wBAAwB,CAAC;KACpE,CAAC;AACH,CAAC;AAED,MAAM,MAAM,GAA4D;IACvE,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAwC;IACvF,sBAAsB;IACtB,kBAAkB,EAAE,gBAAgB;IACpC,WAAW,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE;QAC3E,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO;YACN,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC;YAC7D,KAAK,EAAE,UAAU,CAChB,IAAI,CAAC,QAAQ,EACb,KAAK,CAAC,KAAK,CAAC,YAAY,EACxB,KAAK,EACL,uBAAuB,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,CAC/D;SACD,CAAC;IACH,CAAC;CACD,CAAC;AAEF,8FAA8F;AAC9F,6FAA6F;AAC7F,+EAA+E;AAC/E,MAAM,OAAO,sBAAsB;IAClC,KAAK,CAAC,OAAe,EAAE,YAAsB,EAAE,YAAsB;QACpE,OAAO,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IACzE,CAAC;CACD"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { memoizeManifestLookup } from "../tree-sitter-common/program-index.js";
|
|
2
3
|
import { parseWithTreeSitter, } from "../tree-sitter-common/tree-sitter-parser.js";
|
|
3
4
|
import { findNearestRustCrate } from "./cargo-manifest.js";
|
|
4
5
|
import { buildImplTypeIndex, toRawCalls } from "./rust-call-resolution.js";
|
|
5
6
|
import { buildModuleAliasToFile, buildReExportsByFile, collectModDeclarations, collectUseSpecs, toModDeclarationImports, toRawImports, } from "./rust-import-resolution.js";
|
|
6
7
|
import { collectDeclaredSymbols } from "./rust-symbol-classification.js";
|
|
7
|
-
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
8
9
|
function buildRustIndex({ rootDir, programFiles, index, treeByFile }) {
|
|
9
10
|
const crateFor = memoizeManifestLookup(rootDir, findNearestRustCrate);
|
|
10
11
|
return {
|
|
@@ -14,7 +15,7 @@ function buildRustIndex({ rootDir, programFiles, index, treeByFile }) {
|
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
const RUST = {
|
|
17
|
-
|
|
18
|
+
loadGrammar: () => require("tree-sitter-rust"),
|
|
18
19
|
collectDeclaredSymbols,
|
|
19
20
|
buildLanguageIndex: buildRustIndex,
|
|
20
21
|
extractFile: ({ filePath, tree, entry }, { programFiles, index }, rust) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rust-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-rust/rust-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rust-parser.js","sourceRoot":"","sources":["../../../src/extraction/tree-sitter-rust/rust-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EACN,mBAAmB,GAGnB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAC;AACtG,OAAO,EACN,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,YAAY,GACZ,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AAEpG,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,SAAS,cAAc,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAqB;IACtF,MAAM,QAAQ,GAAG,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;IACtE,OAAO;QACN,QAAQ;QACR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6F;AAC7F,sDAAsD;AACtD,MAAM,OAAO,oBAAoB;IAChC,KAAK,CAAC,OAAe,EAAE,YAAsB,EAAE,YAAsB;QACpE,OAAO,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IACvE,CAAC;CACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_USAGE = "Usage: codemap generate [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests]";
|
|
2
|
-
export declare const CLI_HELP = "Usage: codemap generate [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests]\n\nGenerates codemap.json and codemap.html for the repo at --root.\n\nOptions:\n --root <dir> Repo root to analyse (default: current directory)\n --out <dir> Output directory (default: .codemap, or the config's outDir)\n --config <path> Config file path (default: <root>/codemap.config.json)\n --force Skip the incremental cache and re-extract every file\n --include-tests Include test files in discovery and Module clustering\n -h, --help Show this help and exit";
|
|
1
|
+
export declare const CLI_USAGE = "Usage: codemap generate [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--scip-index <language>=<path>] [--run-indexers]";
|
|
2
|
+
export declare const CLI_HELP = "Usage: codemap generate [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--scip-index <language>=<path>] [--run-indexers]\n\nGenerates codemap.json and codemap.html for the repo at --root.\n\nOptions:\n --root <dir> Repo root to analyse (default: current directory)\n --out <dir> Output directory (default: .codemap, or the config's outDir)\n --config <path> Config file path (default: <root>/codemap.config.json)\n --force Skip the incremental cache and re-extract every file\n --include-tests Include test files in discovery and Module clustering\n --scip-index <language>=<path>\n SCIP index refining that language's call targets (python, go, rust,\n or java, repeatable per language; default: <root>/index.scip if present)\n --run-indexers Run scip-python, scip-go, or rust-analyzer for each Python, Go,\n or Rust Package with no supplied index, writing under <out>/scip/.\n Never runs scip-java: Java needs a supplied index.\n Runs the repo's own tooling: only use it on a repo you would build\n yourself\n -h, --help Show this help and exit";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const CLI_USAGE = "Usage: codemap generate [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests]";
|
|
1
|
+
export const CLI_USAGE = "Usage: codemap generate [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--scip-index <language>=<path>] [--run-indexers]";
|
|
2
2
|
export const CLI_HELP = `${CLI_USAGE}
|
|
3
3
|
|
|
4
4
|
Generates codemap.json and codemap.html for the repo at --root.
|
|
@@ -9,5 +9,13 @@ Options:
|
|
|
9
9
|
--config <path> Config file path (default: <root>/codemap.config.json)
|
|
10
10
|
--force Skip the incremental cache and re-extract every file
|
|
11
11
|
--include-tests Include test files in discovery and Module clustering
|
|
12
|
+
--scip-index <language>=<path>
|
|
13
|
+
SCIP index refining that language's call targets (python, go, rust,
|
|
14
|
+
or java, repeatable per language; default: <root>/index.scip if present)
|
|
15
|
+
--run-indexers Run scip-python, scip-go, or rust-analyzer for each Python, Go,
|
|
16
|
+
or Rust Package with no supplied index, writing under <out>/scip/.
|
|
17
|
+
Never runs scip-java: Java needs a supplied index.
|
|
18
|
+
Runs the repo's own tooling: only use it on a repo you would build
|
|
19
|
+
yourself
|
|
12
20
|
-h, --help Show this help and exit`;
|
|
13
21
|
//# sourceMappingURL=cli-help.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-help.js","sourceRoot":"","sources":["../../../src/integration/cli/cli-help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GACrB,
|
|
1
|
+
{"version":3,"file":"cli-help.js","sourceRoot":"","sources":["../../../src/integration/cli/cli-help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GACrB,sJAAsJ,CAAC;AAExJ,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,SAAS;;;;;;;;;;;;;;;;;;4CAkBQ,CAAC"}
|
|
@@ -5,12 +5,25 @@ export declare const generateInputShape: {
|
|
|
5
5
|
outDir: z.ZodOptional<z.ZodString>;
|
|
6
6
|
force: z.ZodOptional<z.ZodBoolean>;
|
|
7
7
|
includeTests: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
scipIndexes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
9
|
+
go: "go";
|
|
10
|
+
java: "java";
|
|
11
|
+
python: "python";
|
|
12
|
+
rust: "rust";
|
|
13
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
14
|
+
runIndexers: z.ZodOptional<z.ZodBoolean>;
|
|
8
15
|
};
|
|
9
16
|
export declare const readInputShape: {
|
|
10
17
|
rootDir: z.ZodOptional<z.ZodString>;
|
|
11
18
|
configPath: z.ZodOptional<z.ZodString>;
|
|
12
19
|
outDir: z.ZodOptional<z.ZodString>;
|
|
13
20
|
includeTests: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
scipIndexes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
22
|
+
go: "go";
|
|
23
|
+
java: "java";
|
|
24
|
+
python: "python";
|
|
25
|
+
rust: "rust";
|
|
26
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
14
27
|
path: z.ZodOptional<z.ZodString>;
|
|
15
28
|
symbolKind: z.ZodOptional<z.ZodEnum<{
|
|
16
29
|
class: "class";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SYMBOL_KINDS } from "../../core/compose.js";
|
|
1
|
+
import { SCIP_LANGUAGES, SYMBOL_KINDS } from "../../core/compose.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
// `SYMBOL_KINDS` is `core/types.ts`'s single source of truth for `SymbolKind`'s member list
|
|
4
4
|
// (its own `satisfies` check lives there) - imported rather than hand-duplicated here, since
|
|
@@ -21,12 +21,20 @@ export const generateInputShape = {
|
|
|
21
21
|
.boolean()
|
|
22
22
|
.optional()
|
|
23
23
|
.describe("Includes test files (by filename or test-directory convention, per language) in the codemap; excluded by default."),
|
|
24
|
+
scipIndexes: z
|
|
25
|
+
.partialRecord(z.enum(SCIP_LANGUAGES), z.string())
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Language -> SCIP index path, relative to rootDir; overrides the config file's scipIndexes. Without one, <rootDir>/index.scip is read when present. Refines that language's call targets; files the index misses keep syntactic candidates."),
|
|
28
|
+
runIndexers: z
|
|
29
|
+
.boolean()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Runs each language's SCIP indexer (python: scip-python, go: scip-go, rust: rust-analyzer) for every language with no supplied index, writing under outDir/scip/. Never runs scip-java: Java needs a supplied index. This runs the target repo's own tooling, so only enable it for a repo you would build yourself. A missing or failing indexer becomes a warning. Off by default."),
|
|
24
32
|
};
|
|
25
|
-
// `read` always self-heals via a full incremental `generate` run and hardcodes `force: false`
|
|
26
|
-
// (see `core/read-command.ts`'s `ReadCommandInput`/`runReadCommand`), so
|
|
27
|
-
// `ReadInput` at all - strip
|
|
28
|
-
// up on this tool's public schema.
|
|
29
|
-
const { force: _readToolOmitsForce, ...readOnlyInputShape } = {
|
|
33
|
+
// `read` always self-heals via a full incremental `generate` run and hardcodes `force: false` and
|
|
34
|
+
// `runIndexers: false` (see `core/read-command.ts`'s `ReadCommandInput`/`runReadCommand`), so
|
|
35
|
+
// neither is part of `ReadInput` at all - strip both back out after spreading
|
|
36
|
+
// `generateInputShape` so they never show up on this tool's public schema.
|
|
37
|
+
const { force: _readToolOmitsForce, runIndexers: _readToolOmitsRunIndexers, ...readOnlyInputShape } = {
|
|
30
38
|
...generateInputShape,
|
|
31
39
|
path: z
|
|
32
40
|
.string()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-input-schema.js","sourceRoot":"","sources":["../../../src/integration/mcp/tool-input-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-input-schema.js","sourceRoot":"","sources":["../../../src/integration/mcp/tool-input-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cA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AQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAC/F,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;CAC3F,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC"}
|
|
@@ -16,7 +16,7 @@ Run the companion script bundled next to this file: `node "${CLAUDE_SKILL_DIR}/m
|
|
|
16
16
|
Runs the pipeline and writes `codemap.json`/`codemap.html` to disk.
|
|
17
17
|
|
|
18
18
|
```
|
|
19
|
-
node "${CLAUDE_SKILL_DIR}/main.js" generate [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests]
|
|
19
|
+
node "${CLAUDE_SKILL_DIR}/main.js" generate [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--scip-index <language>=<path>] [--run-indexers]
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
- `--root` - the repo to analyze; defaults to the current working directory.
|
|
@@ -24,6 +24,8 @@ node "${CLAUDE_SKILL_DIR}/main.js" generate [--root <dir>] [--out <dir>] [--conf
|
|
|
24
24
|
- `--config` - an explicit config file path; defaults to `<root>/codemap.config.json`.
|
|
25
25
|
- `--force` - bypasses the incremental extraction cache.
|
|
26
26
|
- `--include-tests` - includes test files (each language's own convention; for TS/JS, `*.test.*`/`*.spec.*` or anything under `test/`, `tests/`, `__tests__/`) in discovery and Module clustering instead of excluding them by default ([ADR-0011](../../../documentation/adr/0011-exclude-test-files-by-default.md)); they're clustered into one dedicated `tests` Module rather than grouped by folder ([ADR-0010](../../../documentation/adr/0010-test-files-are-their-own-module.md)). Changes the cache epoch, so toggling it forces a full re-extraction the next run.
|
|
27
|
+
- `--scip-index <language>=<path>` - a `scip-python`, `scip-go`, `rust-analyzer`, or `scip-java` index, `python=`, `go=`, `rust=`, or `java=`, that narrows that language's call candidates to their type-checked target ([ADR-0056](../../../documentation/adr/0056-scip-index-resolution-for-tree-sitter-languages.md)). Without it, `<root>/index.scip` is read when present. Files the index misses or that changed since indexing keep syntactic candidates and appear in `warnings`.
|
|
28
|
+
- `--run-indexers` - runs `scip-python`, `scip-go`, or `rust-analyzer` itself for each Python, Go, or Rust Package with no supplied index, never `scip-java`, writing under `<out>/scip/` and reusing that index while none of its files changed, nor any manifest or lockfile in or above its directory. This runs the target repo's own tooling, so only pass it for a repo you would build yourself. For Go, `go build ./...` runs first. For Rust, `cargo check --locked --all-targets` runs first and never writes a `Cargo.lock`. A missing or failing indexer, or a failed build, becomes a warning, not an error. `read` never runs indexers.
|
|
27
29
|
|
|
28
30
|
Prints `{ jsonPath, htmlPath, nodeCount, edgeCount }` - never the graph itself.
|
|
29
31
|
|
|
@@ -32,13 +34,14 @@ Prints `{ jsonPath, htmlPath, nodeCount, edgeCount }` - never the graph itself.
|
|
|
32
34
|
Self-heals: always re-runs the pipeline first, so it's safe to call without a prior `generate`, or after files changed since the last one. That regeneration refreshes `<outDir>/cache.json` on disk as a side effect - `read` still never writes `codemap.json` or `codemap.html`.
|
|
33
35
|
|
|
34
36
|
```
|
|
35
|
-
node "${CLAUDE_SKILL_DIR}/main.js" read [--root <dir>] [--out <dir>] [--config <path>] [--path <p>] [--symbol-kind <k>] [--search <s>] [--include-tests]
|
|
37
|
+
node "${CLAUDE_SKILL_DIR}/main.js" read [--root <dir>] [--out <dir>] [--config <path>] [--path <p>] [--symbol-kind <k>] [--search <s>] [--include-tests] [--scip-index <language>=<path>]
|
|
36
38
|
```
|
|
37
39
|
|
|
38
40
|
- `--path` - matches by prefix/subtree (a Directory or Package path matches every descendant File/Symbol under it). `.` matches the whole repo; a co-located Package id like `.@go` matches only that family's files.
|
|
39
41
|
- `--symbol-kind` - one of `function`, `method`, `class`, `const`, `type`, `interface`, `enum`; matches only Symbol nodes of that kind.
|
|
40
42
|
- `--search` - case-insensitive substring match over node names.
|
|
41
43
|
- `--include-tests` - includes test files in the graph `read` filters over, matching whatever `generate` last used; since `read` self-heals by re-running the pipeline first, pass the same `--include-tests` value used for `generate` to avoid an unnecessary full re-extraction.
|
|
44
|
+
- `--scip-index` - same meaning as on `generate`; pass the same value to avoid a full re-extraction.
|
|
42
45
|
|
|
43
46
|
All provided filters AND together. Omitting every filter returns the whole graph.
|
|
44
47
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SKILL_USAGE = "Usage: skillEntry <generate|read> [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--path <p>] [--symbol-kind <k>] [--search <s>]";
|
|
2
|
-
export declare const SKILL_HELP = "Usage: skillEntry <generate|read> [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--path <p>] [--symbol-kind <k>] [--search <s>]\n\nCommands:\n generate Write codemap.json and codemap.html, print a count summary\n read Re-run the pipeline, print the filtered graph\n\nOptions (both commands):\n --root <dir> Repo root to analyse (default: current directory)\n --out <dir> Output directory (default: .codemap, or the config's outDir)\n --config <path> Config file path (default: <root>/codemap.config.json)\n --include-tests Include test files in discovery and Module clustering\n -h, --help Show this help and exit\n\nOptions (generate only):\n --force Skip the incremental cache and re-extract every file\n\nOptions (read only):\n --path <p> Prefix/subtree filter; \".\" is the whole repo\n --symbol-kind <k> function, method, class, const, type, interface, or enum\n --search <s> Case-insensitive substring match on node names";
|
|
1
|
+
export declare const SKILL_USAGE = "Usage: skillEntry <generate|read> [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--scip-index <language>=<path>] [--run-indexers] [--path <p>] [--symbol-kind <k>] [--search <s>]";
|
|
2
|
+
export declare const SKILL_HELP = "Usage: skillEntry <generate|read> [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--scip-index <language>=<path>] [--run-indexers] [--path <p>] [--symbol-kind <k>] [--search <s>]\n\nCommands:\n generate Write codemap.json and codemap.html, print a count summary\n read Re-run the pipeline, print the filtered graph\n\nOptions (both commands):\n --root <dir> Repo root to analyse (default: current directory)\n --out <dir> Output directory (default: .codemap, or the config's outDir)\n --config <path> Config file path (default: <root>/codemap.config.json)\n --include-tests Include test files in discovery and Module clustering\n --scip-index <language>=<path>\n SCIP index refining that language's call targets (python, go, rust,\n or java, repeatable per language; default: <root>/index.scip if present)\n -h, --help Show this help and exit\n\nOptions (generate only):\n --force Skip the incremental cache and re-extract every file\n --run-indexers Run scip-python, scip-go, or rust-analyzer for each Python, Go,\n or Rust Package with no supplied index, writing under <out>/scip/.\n Never runs scip-java: Java needs a supplied index.\n Runs the repo's own tooling: only use it on a repo you would build\n yourself\n\nOptions (read only):\n --path <p> Prefix/subtree filter; \".\" is the whole repo\n --symbol-kind <k> function, method, class, const, type, interface, or enum\n --search <s> Case-insensitive substring match on node names";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const SKILL_USAGE = "Usage: skillEntry <generate|read> [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--path <p>] [--symbol-kind <k>] [--search <s>]";
|
|
1
|
+
export const SKILL_USAGE = "Usage: skillEntry <generate|read> [--root <dir>] [--out <dir>] [--config <path>] [--force] [--include-tests] [--scip-index <language>=<path>] [--run-indexers] [--path <p>] [--symbol-kind <k>] [--search <s>]";
|
|
2
2
|
export const SKILL_HELP = `${SKILL_USAGE}
|
|
3
3
|
|
|
4
4
|
Commands:
|
|
@@ -10,10 +10,18 @@ Options (both commands):
|
|
|
10
10
|
--out <dir> Output directory (default: .codemap, or the config's outDir)
|
|
11
11
|
--config <path> Config file path (default: <root>/codemap.config.json)
|
|
12
12
|
--include-tests Include test files in discovery and Module clustering
|
|
13
|
+
--scip-index <language>=<path>
|
|
14
|
+
SCIP index refining that language's call targets (python, go, rust,
|
|
15
|
+
or java, repeatable per language; default: <root>/index.scip if present)
|
|
13
16
|
-h, --help Show this help and exit
|
|
14
17
|
|
|
15
18
|
Options (generate only):
|
|
16
19
|
--force Skip the incremental cache and re-extract every file
|
|
20
|
+
--run-indexers Run scip-python, scip-go, or rust-analyzer for each Python, Go,
|
|
21
|
+
or Rust Package with no supplied index, writing under <out>/scip/.
|
|
22
|
+
Never runs scip-java: Java needs a supplied index.
|
|
23
|
+
Runs the repo's own tooling: only use it on a repo you would build
|
|
24
|
+
yourself
|
|
17
25
|
|
|
18
26
|
Options (read only):
|
|
19
27
|
--path <p> Prefix/subtree filter; "." is the whole repo
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-help.js","sourceRoot":"","sources":["../../../src/integration/skill/skill-help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GACvB,
|
|
1
|
+
{"version":3,"file":"skill-help.js","sourceRoot":"","sources":["../../../src/integration/skill/skill-help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GACvB,gNAAgN,CAAC;AAElN,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;mEA2B2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windagency/codemap-gen-for-agents",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-rc.1",
|
|
4
4
|
"description": "Code-map generator for AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
"release": "semantic-release"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
+
"@bufbuild/protobuf": "^2.16.0",
|
|
51
52
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
53
|
+
"@scip-code/scip": "^0.10.0",
|
|
52
54
|
"d3": "^7.9.0",
|
|
53
55
|
"graphology": "0.26.0",
|
|
54
56
|
"graphology-communities-louvain": "2.0.2",
|