claude-local-docs 1.0.13 → 1.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/.mcp.json +2 -1
- package/README.md +124 -58
- package/commands/fetch-docs.md +54 -28
- package/commands/index-codebase.md +53 -0
- package/dist/code-indexer.d.ts +14 -0
- package/dist/code-indexer.js +519 -0
- package/dist/code-indexer.js.map +1 -0
- package/dist/code-search.d.ts +14 -0
- package/dist/code-search.js +155 -0
- package/dist/code-search.js.map +1 -0
- package/dist/code-store.d.ts +39 -0
- package/dist/code-store.js +206 -0
- package/dist/code-store.js.map +1 -0
- package/dist/code.test.d.ts +7 -0
- package/dist/code.test.js +197 -0
- package/dist/code.test.js.map +1 -0
- package/dist/discovery.js +56 -4
- package/dist/discovery.js.map +1 -1
- package/dist/docs.test.d.ts +7 -0
- package/dist/docs.test.js +105 -0
- package/dist/docs.test.js.map +1 -0
- package/dist/file-walker.d.ts +34 -0
- package/dist/file-walker.js +199 -0
- package/dist/file-walker.js.map +1 -0
- package/dist/index.js +321 -22
- package/dist/index.js.map +1 -1
- package/dist/indexer.js +4 -23
- package/dist/indexer.js.map +1 -1
- package/dist/integration.test.d.ts +3 -2
- package/dist/integration.test.js +461 -11
- package/dist/integration.test.js.map +1 -1
- package/dist/reranker.d.ts +2 -2
- package/dist/reranker.js +10 -12
- package/dist/reranker.js.map +1 -1
- package/dist/rrf.d.ts +17 -0
- package/dist/rrf.js +25 -0
- package/dist/rrf.js.map +1 -0
- package/dist/search.d.ts +2 -0
- package/dist/search.js +30 -52
- package/dist/search.js.map +1 -1
- package/dist/sfc-extractor.d.ts +14 -0
- package/dist/sfc-extractor.js +70 -0
- package/dist/sfc-extractor.js.map +1 -0
- package/dist/store.d.ts +2 -0
- package/dist/store.js +39 -24
- package/dist/store.js.map +1 -1
- package/dist/tei-client.d.ts +70 -0
- package/dist/tei-client.js +153 -0
- package/dist/tei-client.js.map +1 -0
- package/dist/types.d.ts +49 -0
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/dist/unit.test.d.ts +8 -0
- package/dist/unit.test.js +1241 -0
- package/dist/unit.test.js.map +1 -0
- package/docker-compose.nvidia.yml +7 -0
- package/docker-compose.yml +9 -0
- package/package.json +8 -2
- package/scripts/ensure-tei.sh +93 -19
- package/start-tei.sh +17 -3
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AST-based code chunking via web-tree-sitter + code embedding.
|
|
3
|
+
* Parses JS/TS files into function/class/method-level chunks with contextual headers.
|
|
4
|
+
* Extracts JSDoc, decorators, and metadata flags (exported, async, abstract).
|
|
5
|
+
*/
|
|
6
|
+
import { codeEmbedClient, truncateAndNormalize } from "./tei-client.js";
|
|
7
|
+
import { extractScriptBlocks } from "./sfc-extractor.js";
|
|
8
|
+
const CODE_EMBED_DIM = 1536;
|
|
9
|
+
// Qodo-Embed-1-1.5B: no explicit prefix needed (TEI handles internally)
|
|
10
|
+
// --- Tree-sitter lazy init ---
|
|
11
|
+
let Parser = null;
|
|
12
|
+
const languageCache = new Map();
|
|
13
|
+
async function initParser() {
|
|
14
|
+
if (Parser)
|
|
15
|
+
return Parser;
|
|
16
|
+
const TreeSitter = await import("web-tree-sitter");
|
|
17
|
+
await TreeSitter.default.init();
|
|
18
|
+
Parser = TreeSitter.default;
|
|
19
|
+
return Parser;
|
|
20
|
+
}
|
|
21
|
+
async function getLanguage(lang) {
|
|
22
|
+
const cached = languageCache.get(lang);
|
|
23
|
+
if (cached)
|
|
24
|
+
return cached;
|
|
25
|
+
const P = await initParser();
|
|
26
|
+
// tree-sitter-wasms provides pre-built WASM grammars
|
|
27
|
+
const wasmMap = {
|
|
28
|
+
typescript: "tree-sitter-typescript.wasm",
|
|
29
|
+
javascript: "tree-sitter-javascript.wasm",
|
|
30
|
+
};
|
|
31
|
+
const wasmFile = wasmMap[lang];
|
|
32
|
+
if (!wasmFile)
|
|
33
|
+
throw new Error(`Unsupported language: ${lang}`);
|
|
34
|
+
// Resolve WASM path from tree-sitter-wasms package
|
|
35
|
+
const { createRequire } = await import("node:module");
|
|
36
|
+
const require = createRequire(import.meta.url);
|
|
37
|
+
// tsx files use typescript grammar
|
|
38
|
+
const wasmPath = require.resolve(`tree-sitter-wasms/out/${wasmFile}`);
|
|
39
|
+
const language = await P.Language.load(wasmPath);
|
|
40
|
+
languageCache.set(lang, language);
|
|
41
|
+
return language;
|
|
42
|
+
}
|
|
43
|
+
/** Split camelCase/PascalCase/snake_case into space-separated words for BM25 */
|
|
44
|
+
function splitIdentifier(name) {
|
|
45
|
+
if (!name)
|
|
46
|
+
return "";
|
|
47
|
+
// camelCase/PascalCase split
|
|
48
|
+
const parts = name
|
|
49
|
+
.replace(/([a-z])([A-Z])/g, "$1 $2")
|
|
50
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2")
|
|
51
|
+
.replace(/_/g, " ")
|
|
52
|
+
.replace(/-/g, " ")
|
|
53
|
+
.toLowerCase()
|
|
54
|
+
.trim();
|
|
55
|
+
return parts;
|
|
56
|
+
}
|
|
57
|
+
function getNodeText(node, source) {
|
|
58
|
+
return source.slice(node.startIndex, node.endIndex);
|
|
59
|
+
}
|
|
60
|
+
function extractSignature(text) {
|
|
61
|
+
// Up to opening brace or end of first line
|
|
62
|
+
const braceIdx = text.indexOf("{");
|
|
63
|
+
if (braceIdx !== -1) {
|
|
64
|
+
return text.slice(0, braceIdx).trim();
|
|
65
|
+
}
|
|
66
|
+
const newlineIdx = text.indexOf("\n");
|
|
67
|
+
if (newlineIdx !== -1) {
|
|
68
|
+
return text.slice(0, newlineIdx).trim();
|
|
69
|
+
}
|
|
70
|
+
return text.trim();
|
|
71
|
+
}
|
|
72
|
+
function classifyNode(nodeType, parentType) {
|
|
73
|
+
switch (nodeType) {
|
|
74
|
+
case "function_declaration":
|
|
75
|
+
case "function":
|
|
76
|
+
return "function";
|
|
77
|
+
case "class_declaration":
|
|
78
|
+
case "class":
|
|
79
|
+
return "class";
|
|
80
|
+
case "method_definition":
|
|
81
|
+
return "method";
|
|
82
|
+
case "interface_declaration":
|
|
83
|
+
return "interface";
|
|
84
|
+
case "type_alias_declaration":
|
|
85
|
+
return "type_alias";
|
|
86
|
+
case "enum_declaration":
|
|
87
|
+
return "enum";
|
|
88
|
+
case "import_statement":
|
|
89
|
+
return "import";
|
|
90
|
+
case "lexical_declaration":
|
|
91
|
+
case "variable_declaration":
|
|
92
|
+
return "variable";
|
|
93
|
+
case "module":
|
|
94
|
+
case "ambient_declaration":
|
|
95
|
+
case "internal_module":
|
|
96
|
+
return "namespace";
|
|
97
|
+
default:
|
|
98
|
+
// Arrow functions in variable declarations
|
|
99
|
+
if (parentType === "variable_declarator")
|
|
100
|
+
return "function";
|
|
101
|
+
return "other";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function findNameNode(node) {
|
|
105
|
+
// Try direct name child
|
|
106
|
+
const nameNode = node.childForFieldName("name");
|
|
107
|
+
if (nameNode)
|
|
108
|
+
return nameNode.text;
|
|
109
|
+
// For variable declarators, the name is the first identifier
|
|
110
|
+
if (node.type === "variable_declarator") {
|
|
111
|
+
const id = node.childForFieldName("name");
|
|
112
|
+
if (id)
|
|
113
|
+
return id.text;
|
|
114
|
+
}
|
|
115
|
+
// For export_statement, look at the declaration inside
|
|
116
|
+
if (node.type === "export_statement") {
|
|
117
|
+
const decl = node.childForFieldName("declaration");
|
|
118
|
+
if (decl)
|
|
119
|
+
return findNameNode(decl);
|
|
120
|
+
// export default — try value
|
|
121
|
+
const value = node.childForFieldName("value");
|
|
122
|
+
if (value)
|
|
123
|
+
return findNameNode(value);
|
|
124
|
+
}
|
|
125
|
+
return "";
|
|
126
|
+
}
|
|
127
|
+
// --- JSDoc extraction ---
|
|
128
|
+
function extractJSDoc(node, source) {
|
|
129
|
+
// Walk backward from entity node to find preceding /** ... */ comment
|
|
130
|
+
let prev = node.previousNamedSibling;
|
|
131
|
+
while (prev) {
|
|
132
|
+
if (prev.type === "comment") {
|
|
133
|
+
const text = getNodeText(prev, source);
|
|
134
|
+
if (text.startsWith("/**")) {
|
|
135
|
+
return text
|
|
136
|
+
.replace(/^\/\*\*\s*/, "")
|
|
137
|
+
.replace(/\s*\*\/$/, "")
|
|
138
|
+
.replace(/^\s*\* ?/gm, "")
|
|
139
|
+
.trim();
|
|
140
|
+
}
|
|
141
|
+
// Skip non-JSDoc comments and keep looking
|
|
142
|
+
prev = prev.previousNamedSibling;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return "";
|
|
149
|
+
}
|
|
150
|
+
// --- Decorator extraction ---
|
|
151
|
+
function extractDecorators(node, source) {
|
|
152
|
+
const decorators = [];
|
|
153
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
154
|
+
const child = node.child(i);
|
|
155
|
+
if (child?.type === "decorator") {
|
|
156
|
+
const match = getNodeText(child, source).match(/@(\w+)/);
|
|
157
|
+
if (match)
|
|
158
|
+
decorators.push(match[1]);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return decorators;
|
|
162
|
+
}
|
|
163
|
+
// --- Metadata flag detection ---
|
|
164
|
+
function detectIsExported(node) {
|
|
165
|
+
// Check if inside export_statement
|
|
166
|
+
if (node.parent?.type === "export_statement")
|
|
167
|
+
return true;
|
|
168
|
+
// Check if node text starts with export
|
|
169
|
+
const text = node.text ?? "";
|
|
170
|
+
return /^export\s/.test(text);
|
|
171
|
+
}
|
|
172
|
+
function detectIsAsync(text) {
|
|
173
|
+
return /\basync\s/.test(text);
|
|
174
|
+
}
|
|
175
|
+
function detectIsAbstract(text) {
|
|
176
|
+
return /\babstract\s/.test(text);
|
|
177
|
+
}
|
|
178
|
+
const TOP_LEVEL_TYPES = new Set([
|
|
179
|
+
"function_declaration", "class_declaration", "interface_declaration",
|
|
180
|
+
"type_alias_declaration", "enum_declaration", "export_statement",
|
|
181
|
+
"lexical_declaration", "import_statement", "variable_declaration",
|
|
182
|
+
"module", "ambient_declaration", "internal_module",
|
|
183
|
+
]);
|
|
184
|
+
function createEntity(type, name, node, outerNode, source, scopeChain, isExportedOverride) {
|
|
185
|
+
const text = getNodeText(outerNode, source);
|
|
186
|
+
const jsdocTarget = outerNode.type === "export_statement" ? outerNode : node;
|
|
187
|
+
return {
|
|
188
|
+
type,
|
|
189
|
+
name,
|
|
190
|
+
signature: extractSignature(text),
|
|
191
|
+
scopeChain: [...scopeChain],
|
|
192
|
+
lineStart: outerNode.startPosition.row + 1,
|
|
193
|
+
lineEnd: outerNode.endPosition.row + 1,
|
|
194
|
+
text,
|
|
195
|
+
jsdoc: extractJSDoc(jsdocTarget, source),
|
|
196
|
+
decorators: extractDecorators(node, source),
|
|
197
|
+
isExported: isExportedOverride ?? detectIsExported(outerNode),
|
|
198
|
+
isAsync: detectIsAsync(text),
|
|
199
|
+
isAbstract: detectIsAbstract(text),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function extractEntitiesFromNode(node, source, scopeChain, entities) {
|
|
203
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
204
|
+
const child = node.child(i);
|
|
205
|
+
if (!child)
|
|
206
|
+
continue;
|
|
207
|
+
if (TOP_LEVEL_TYPES.has(child.type)) {
|
|
208
|
+
// Handle export statements — unwrap the inner declaration
|
|
209
|
+
if (child.type === "export_statement") {
|
|
210
|
+
const decl = child.childForFieldName("declaration");
|
|
211
|
+
if (decl && TOP_LEVEL_TYPES.has(decl.type)) {
|
|
212
|
+
// Process the inner declaration with the export text
|
|
213
|
+
const text = getNodeText(child, source);
|
|
214
|
+
let entityType = classifyNode(decl.type);
|
|
215
|
+
// Check for arrow functions inside exported lexical_declarations
|
|
216
|
+
if (decl.type === "lexical_declaration") {
|
|
217
|
+
for (let j = 0; j < decl.childCount; j++) {
|
|
218
|
+
const declarator = decl.child(j);
|
|
219
|
+
if (declarator?.type === "variable_declarator") {
|
|
220
|
+
const value = declarator.childForFieldName("value");
|
|
221
|
+
if (value && (value.type === "arrow_function" || value.type === "function")) {
|
|
222
|
+
entityType = "function";
|
|
223
|
+
const declName = findNameNode(declarator);
|
|
224
|
+
entities.push(createEntity("function", declName, decl, child, source, scopeChain, true));
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (entityType === "function")
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
const name = findNameNode(child);
|
|
233
|
+
if (entityType === "class") {
|
|
234
|
+
entities.push(createEntity("class", name, decl, child, source, scopeChain, true));
|
|
235
|
+
// If class is large, also extract individual methods
|
|
236
|
+
const nonWs = text.replace(/\s/g, "").length;
|
|
237
|
+
if (nonWs > 1500) {
|
|
238
|
+
extractClassMembers(decl, source, [...scopeChain, name], entities);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
entities.push(createEntity(entityType, name, decl, child, source, scopeChain, true));
|
|
243
|
+
}
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
// export default or re-exports
|
|
247
|
+
entities.push(createEntity("other", findNameNode(child), child, child, source, scopeChain, true));
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const text = getNodeText(child, source);
|
|
251
|
+
const name = findNameNode(child);
|
|
252
|
+
const entityType = classifyNode(child.type);
|
|
253
|
+
// Handle lexical_declaration with arrow functions
|
|
254
|
+
if (child.type === "lexical_declaration") {
|
|
255
|
+
let hasArrow = false;
|
|
256
|
+
for (let j = 0; j < child.childCount; j++) {
|
|
257
|
+
const declarator = child.child(j);
|
|
258
|
+
if (declarator?.type === "variable_declarator") {
|
|
259
|
+
const value = declarator.childForFieldName("value");
|
|
260
|
+
if (value && (value.type === "arrow_function" || value.type === "function")) {
|
|
261
|
+
hasArrow = true;
|
|
262
|
+
const declName = findNameNode(declarator);
|
|
263
|
+
entities.push(createEntity("function", declName, child, child, source, scopeChain));
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (!hasArrow) {
|
|
269
|
+
entities.push(createEntity("variable", name, child, child, source, scopeChain));
|
|
270
|
+
}
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
if (entityType === "class") {
|
|
274
|
+
entities.push(createEntity("class", name, child, child, source, scopeChain));
|
|
275
|
+
// If class is large, also extract individual methods
|
|
276
|
+
const nonWs = text.replace(/\s/g, "").length;
|
|
277
|
+
if (nonWs > 1500) {
|
|
278
|
+
extractClassMembers(child, source, [...scopeChain, name], entities);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
entities.push(createEntity(entityType, name, child, child, source, scopeChain));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
function extractClassMembers(classNode, source, scopeChain, entities) {
|
|
288
|
+
const body = classNode.childForFieldName("body");
|
|
289
|
+
if (!body)
|
|
290
|
+
return;
|
|
291
|
+
for (let i = 0; i < body.childCount; i++) {
|
|
292
|
+
const member = body.child(i);
|
|
293
|
+
if (!member)
|
|
294
|
+
continue;
|
|
295
|
+
if (member.type === "method_definition" || member.type === "public_field_definition" ||
|
|
296
|
+
member.type === "property_definition" || member.type === "field_definition") {
|
|
297
|
+
const text = getNodeText(member, source);
|
|
298
|
+
const name = findNameNode(member);
|
|
299
|
+
const type = member.type === "method_definition" ? "method" : "variable";
|
|
300
|
+
entities.push({
|
|
301
|
+
type,
|
|
302
|
+
name,
|
|
303
|
+
signature: extractSignature(text),
|
|
304
|
+
scopeChain: [...scopeChain],
|
|
305
|
+
lineStart: member.startPosition.row + 1,
|
|
306
|
+
lineEnd: member.endPosition.row + 1,
|
|
307
|
+
text,
|
|
308
|
+
jsdoc: extractJSDoc(member, source),
|
|
309
|
+
decorators: extractDecorators(member, source),
|
|
310
|
+
isExported: false,
|
|
311
|
+
isAsync: detectIsAsync(text),
|
|
312
|
+
isAbstract: detectIsAbstract(text),
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
// --- Merge small chunks ---
|
|
318
|
+
function mergeSmallEntities(entities) {
|
|
319
|
+
const MIN_CHARS = 100;
|
|
320
|
+
const merged = [];
|
|
321
|
+
let buffer = null;
|
|
322
|
+
for (const entity of entities) {
|
|
323
|
+
const nonWs = entity.text.replace(/\s/g, "").length;
|
|
324
|
+
if (nonWs < MIN_CHARS) {
|
|
325
|
+
if (buffer) {
|
|
326
|
+
// Merge into buffer
|
|
327
|
+
buffer.text += "\n\n" + entity.text;
|
|
328
|
+
buffer.lineEnd = entity.lineEnd;
|
|
329
|
+
if (entity.name && !buffer.name)
|
|
330
|
+
buffer.name = entity.name;
|
|
331
|
+
if (entity.jsdoc && !buffer.jsdoc)
|
|
332
|
+
buffer.jsdoc = entity.jsdoc;
|
|
333
|
+
if (entity.decorators.length > 0)
|
|
334
|
+
buffer.decorators.push(...entity.decorators);
|
|
335
|
+
if (entity.isExported)
|
|
336
|
+
buffer.isExported = true;
|
|
337
|
+
if (entity.isAsync)
|
|
338
|
+
buffer.isAsync = true;
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
buffer = { ...entity, decorators: [...entity.decorators] };
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
if (buffer) {
|
|
346
|
+
// Flush buffer, check if it can merge with current (same scope)
|
|
347
|
+
const sameScope = JSON.stringify(buffer.scopeChain) === JSON.stringify(entity.scopeChain);
|
|
348
|
+
if (sameScope && buffer.text.replace(/\s/g, "").length < MIN_CHARS) {
|
|
349
|
+
buffer.text += "\n\n" + entity.text;
|
|
350
|
+
buffer.lineEnd = entity.lineEnd;
|
|
351
|
+
buffer.name = entity.name;
|
|
352
|
+
buffer.type = entity.type;
|
|
353
|
+
buffer.signature = entity.signature;
|
|
354
|
+
buffer.jsdoc = entity.jsdoc || buffer.jsdoc;
|
|
355
|
+
buffer.decorators.push(...entity.decorators);
|
|
356
|
+
if (entity.isExported)
|
|
357
|
+
buffer.isExported = true;
|
|
358
|
+
if (entity.isAsync)
|
|
359
|
+
buffer.isAsync = true;
|
|
360
|
+
if (entity.isAbstract)
|
|
361
|
+
buffer.isAbstract = true;
|
|
362
|
+
merged.push(buffer);
|
|
363
|
+
buffer = null;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
merged.push(buffer);
|
|
367
|
+
buffer = null;
|
|
368
|
+
merged.push(entity);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
merged.push(entity);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (buffer)
|
|
377
|
+
merged.push(buffer);
|
|
378
|
+
return merged;
|
|
379
|
+
}
|
|
380
|
+
// --- Main chunking entry point ---
|
|
381
|
+
/**
|
|
382
|
+
* Parse and chunk a code file into entities. Accepts an optional lineOffset
|
|
383
|
+
* for SFC files where script content starts at a non-zero line.
|
|
384
|
+
*/
|
|
385
|
+
export async function chunkCodeFile(source, filePath, language, lineOffset = 0) {
|
|
386
|
+
const P = await initParser();
|
|
387
|
+
const lang = await getLanguage(language);
|
|
388
|
+
const parser = new P();
|
|
389
|
+
parser.setLanguage(lang);
|
|
390
|
+
// TSX files use TypeScript grammar
|
|
391
|
+
const tree = parser.parse(source);
|
|
392
|
+
const rootNode = tree.rootNode;
|
|
393
|
+
const entities = [];
|
|
394
|
+
extractEntitiesFromNode(rootNode, source, [], entities);
|
|
395
|
+
// If no entities extracted, create a single module-level chunk
|
|
396
|
+
if (entities.length === 0) {
|
|
397
|
+
return [{
|
|
398
|
+
filePath,
|
|
399
|
+
language,
|
|
400
|
+
entityType: "module",
|
|
401
|
+
entityName: "",
|
|
402
|
+
signature: "",
|
|
403
|
+
scopeChain: "[]",
|
|
404
|
+
lineStart: 1 + lineOffset,
|
|
405
|
+
lineEnd: source.split("\n").length + lineOffset,
|
|
406
|
+
jsdoc: "",
|
|
407
|
+
decorators: "[]",
|
|
408
|
+
isExported: false,
|
|
409
|
+
isAsync: false,
|
|
410
|
+
isAbstract: false,
|
|
411
|
+
text: buildContextHeader(filePath, [], "module", "", { jsdoc: "", decorators: [], isExported: false, isAsync: false, isAbstract: false }) + source,
|
|
412
|
+
}];
|
|
413
|
+
}
|
|
414
|
+
const merged = mergeSmallEntities(entities);
|
|
415
|
+
return merged.map((entity) => ({
|
|
416
|
+
filePath,
|
|
417
|
+
language,
|
|
418
|
+
entityType: entity.type,
|
|
419
|
+
entityName: entity.name,
|
|
420
|
+
signature: entity.signature,
|
|
421
|
+
scopeChain: JSON.stringify(entity.scopeChain),
|
|
422
|
+
lineStart: entity.lineStart + lineOffset,
|
|
423
|
+
lineEnd: entity.lineEnd + lineOffset,
|
|
424
|
+
jsdoc: entity.jsdoc,
|
|
425
|
+
decorators: JSON.stringify(entity.decorators),
|
|
426
|
+
isExported: entity.isExported,
|
|
427
|
+
isAsync: entity.isAsync,
|
|
428
|
+
isAbstract: entity.isAbstract,
|
|
429
|
+
text: buildContextHeader(filePath, entity.scopeChain, entity.type, entity.name, entity) + entity.text,
|
|
430
|
+
}));
|
|
431
|
+
}
|
|
432
|
+
function buildContextHeader(filePath, scopeChain, entityType, entityName, meta) {
|
|
433
|
+
const parts = [`// File: ${filePath}`];
|
|
434
|
+
if (scopeChain.length > 0) {
|
|
435
|
+
parts.push(`// Scope: ${scopeChain.join(" > ")}`);
|
|
436
|
+
}
|
|
437
|
+
// Flags line
|
|
438
|
+
if (meta) {
|
|
439
|
+
const flags = [];
|
|
440
|
+
if (meta.isExported)
|
|
441
|
+
flags.push("exported");
|
|
442
|
+
if (meta.isAsync)
|
|
443
|
+
flags.push("async");
|
|
444
|
+
if (meta.isAbstract)
|
|
445
|
+
flags.push("abstract");
|
|
446
|
+
if (flags.length > 0) {
|
|
447
|
+
parts.push(`// Flags: ${flags.join(", ")}`);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
// Decorators line
|
|
451
|
+
if (meta?.decorators && meta.decorators.length > 0) {
|
|
452
|
+
parts.push(`// Decorators: ${meta.decorators.map(d => `@${d}`).join(", ")}`);
|
|
453
|
+
}
|
|
454
|
+
if (entityName) {
|
|
455
|
+
const split = splitIdentifier(entityName);
|
|
456
|
+
const label = entityName !== split ? `${entityName} (${split})` : entityName;
|
|
457
|
+
parts.push(`// ${entityType}: ${label}`);
|
|
458
|
+
}
|
|
459
|
+
let header = parts.join("\n") + "\n\n";
|
|
460
|
+
// Prepend JSDoc if present (makes it visible to embeddings and BM25)
|
|
461
|
+
if (meta?.jsdoc) {
|
|
462
|
+
header += `/** ${meta.jsdoc} */\n\n`;
|
|
463
|
+
}
|
|
464
|
+
return header;
|
|
465
|
+
}
|
|
466
|
+
// --- Code embedding ---
|
|
467
|
+
export async function embedCodeTexts(texts, mode = "document") {
|
|
468
|
+
// Qodo-Embed-1-1.5B: no explicit prefix for documents or queries
|
|
469
|
+
const inputs = texts;
|
|
470
|
+
const fullVecs = await codeEmbedClient.embed(inputs, { truncate: true });
|
|
471
|
+
// L2 normalize, truncate to CODE_EMBED_DIM
|
|
472
|
+
return truncateAndNormalize(fullVecs, CODE_EMBED_DIM);
|
|
473
|
+
}
|
|
474
|
+
const SFC_LANGUAGES = new Set(["vue", "svelte", "astro"]);
|
|
475
|
+
/** Parse and embed a code file, returning rows ready for LanceDB. */
|
|
476
|
+
export async function indexCodeFile(source, filePath, language) {
|
|
477
|
+
let rawChunks;
|
|
478
|
+
if (SFC_LANGUAGES.has(language)) {
|
|
479
|
+
// SFC file — extract script blocks and parse each separately
|
|
480
|
+
const ext = language === "vue" ? ".vue" : language === "svelte" ? ".svelte" : ".astro";
|
|
481
|
+
const blocks = extractScriptBlocks(source, ext);
|
|
482
|
+
rawChunks = [];
|
|
483
|
+
for (const block of blocks) {
|
|
484
|
+
const chunks = await chunkCodeFile(block.scriptContent, filePath, block.language, block.lineOffset);
|
|
485
|
+
rawChunks.push(...chunks);
|
|
486
|
+
}
|
|
487
|
+
// If no script blocks found, create a minimal module-level chunk
|
|
488
|
+
if (rawChunks.length === 0) {
|
|
489
|
+
rawChunks = [{
|
|
490
|
+
filePath,
|
|
491
|
+
language,
|
|
492
|
+
entityType: "module",
|
|
493
|
+
entityName: "",
|
|
494
|
+
signature: "",
|
|
495
|
+
scopeChain: "[]",
|
|
496
|
+
lineStart: 1,
|
|
497
|
+
lineEnd: source.split("\n").length,
|
|
498
|
+
jsdoc: "",
|
|
499
|
+
decorators: "[]",
|
|
500
|
+
isExported: false,
|
|
501
|
+
isAsync: false,
|
|
502
|
+
isAbstract: false,
|
|
503
|
+
text: `// File: ${filePath}\n// module\n\n(template-only component)`,
|
|
504
|
+
}];
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
rawChunks = await chunkCodeFile(source, filePath, language);
|
|
509
|
+
}
|
|
510
|
+
if (rawChunks.length === 0)
|
|
511
|
+
return [];
|
|
512
|
+
const texts = rawChunks.map(c => c.text);
|
|
513
|
+
const embeddings = await embedCodeTexts(texts, "document");
|
|
514
|
+
return rawChunks.map((chunk, i) => ({
|
|
515
|
+
...chunk,
|
|
516
|
+
vector: embeddings[i],
|
|
517
|
+
}));
|
|
518
|
+
}
|
|
519
|
+
//# sourceMappingURL=code-indexer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-indexer.js","sourceRoot":"","sources":["../src/code-indexer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,wEAAwE;AAExE,gCAAgC;AAEhC,IAAI,MAAM,GAAQ,IAAI,CAAC;AACvB,MAAM,aAAa,GAAG,IAAI,GAAG,EAAe,CAAC;AAE7C,KAAK,UAAU,UAAU;IACvB,IAAI,MAAM;QAAE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AAU,EAAE,QAAQ;oBACpB,UAAU,EAAE,EAAE;oBACd,SAAS,EAAE,EAAE;oBACb,UAAU,EAAE,IAAI;oBAChB,SAAS,EAAE,CAAC;oBACZ,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM;oBAClC,KAAK,EAAE,EAAE;oBACT,UAAU,EAAE,IAAI;oBAChB,UAAU,EAAE,KAAK;oBACjB,OAAO,EAAE,KAAK;oBACd,UAAU,EAAE,KAAK;oBACjB,IAAI,EAAE,YAAY,QAAQ,0CAA0C;iBACrE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;SAAM,CAAC;QACN,SAAS,GAAG,MAAM,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEtC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAE3D,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAClC,GAAG,KAAK;QACR,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;KACtB,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code search pipeline — mirrors the doc search pipeline architecture.
|
|
3
|
+
* Vector search + BM25 → RRF fusion → cross-encoder rerank.
|
|
4
|
+
*
|
|
5
|
+
* TEI containers must be running — no fallback mode.
|
|
6
|
+
*/
|
|
7
|
+
import type { CodeSearchResult, CodeEntityType } from "./types.js";
|
|
8
|
+
import type { CodeStore } from "./code-store.js";
|
|
9
|
+
export declare function searchCode(query: string, store: CodeStore, options?: {
|
|
10
|
+
filePath?: string;
|
|
11
|
+
language?: string;
|
|
12
|
+
entityType?: CodeEntityType;
|
|
13
|
+
topK?: number;
|
|
14
|
+
}): Promise<CodeSearchResult[]>;
|