codebaxing 0.1.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/LICENSE +21 -0
- package/README.md +402 -0
- package/README.vi.md +402 -0
- package/dist/core/exceptions.d.ts +25 -0
- package/dist/core/exceptions.d.ts.map +1 -0
- package/dist/core/exceptions.js +46 -0
- package/dist/core/exceptions.js.map +1 -0
- package/dist/core/interfaces.d.ts +13 -0
- package/dist/core/interfaces.d.ts.map +1 -0
- package/dist/core/interfaces.js +5 -0
- package/dist/core/interfaces.js.map +1 -0
- package/dist/core/models.d.ts +132 -0
- package/dist/core/models.d.ts.map +1 -0
- package/dist/core/models.js +303 -0
- package/dist/core/models.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/indexing/embedding-service.d.ts +66 -0
- package/dist/indexing/embedding-service.d.ts.map +1 -0
- package/dist/indexing/embedding-service.js +271 -0
- package/dist/indexing/embedding-service.js.map +1 -0
- package/dist/indexing/memory-retriever.d.ts +58 -0
- package/dist/indexing/memory-retriever.d.ts.map +1 -0
- package/dist/indexing/memory-retriever.js +327 -0
- package/dist/indexing/memory-retriever.js.map +1 -0
- package/dist/indexing/parallel-indexer.d.ts +36 -0
- package/dist/indexing/parallel-indexer.d.ts.map +1 -0
- package/dist/indexing/parallel-indexer.js +67 -0
- package/dist/indexing/parallel-indexer.js.map +1 -0
- package/dist/indexing/source-retriever.d.ts +66 -0
- package/dist/indexing/source-retriever.d.ts.map +1 -0
- package/dist/indexing/source-retriever.js +420 -0
- package/dist/indexing/source-retriever.js.map +1 -0
- package/dist/mcp/server.d.ts +16 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +370 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/state.d.ts +26 -0
- package/dist/mcp/state.d.ts.map +1 -0
- package/dist/mcp/state.js +154 -0
- package/dist/mcp/state.js.map +1 -0
- package/dist/parsers/language-configs.d.ts +26 -0
- package/dist/parsers/language-configs.d.ts.map +1 -0
- package/dist/parsers/language-configs.js +422 -0
- package/dist/parsers/language-configs.js.map +1 -0
- package/dist/parsers/treesitter-parser.d.ts +37 -0
- package/dist/parsers/treesitter-parser.d.ts.map +1 -0
- package/dist/parsers/treesitter-parser.js +602 -0
- package/dist/parsers/treesitter-parser.js.map +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-retriever.js","sourceRoot":"","sources":["../../src/indexing/memory-retriever.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAmB,MAAM,UAAU,CAAC;AACtE,OAAO,EAAoB,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,EAAY,MAAM,mBAAmB,CAAC;AAEvF,0CAA0C;AAC1C,MAAM,aAAa,GAAkC;IACnD,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAO,WAAW;IAC9C,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAW,QAAQ;IAC3C,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAM,SAAS;IAC5C,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAI,UAAU;IAC7C,SAAS,EAAE,IAAI,EAAsB,gBAAgB;CACtD,CAAC;AAEF,MAAM,OAAO,eAAe;IAC1B,MAAM,CAAU,eAAe,GAAG,UAAU,CAAC;IAC7C,MAAM,CAAU,aAAa,GAAG,sBAAs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,GAAG,CAAC,UAAU,OAAO,WAAW,CAAC,CAAC;QACvC,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAE/B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QAC5C,MAAM,MAAM,GAA2B,EAAE,CAAC;QAE1C,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAChD,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;oBACvC,KAAK,EAAE;wBACL,IAAI,EAAE;4BACJ,EAAE,WAAW,EAAE,OAAO,EAAE;4BACxB,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE;yBAC5B;qBACyB;iBAC7B,CAAC,CAAC;gBACH,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;gBACtC,CAAC;YACH,CAAC;YAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;QAC1B,CAAC;QAED,OAAO;YACL,aAAa,EAAE,KAAK;YACpB,MAAM;YACN,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;SACpC,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parallel indexing utilities for Codebaxing.
|
|
3
|
+
*
|
|
4
|
+
* Uses worker pool pattern for concurrent file parsing.
|
|
5
|
+
* In Node.js, we use Promise.all with concurrency limiting
|
|
6
|
+
* since tree-sitter parsing is CPU-bound but fast enough
|
|
7
|
+
* that the overhead of worker_threads isn't worth it for most codebases.
|
|
8
|
+
*/
|
|
9
|
+
import type { Symbol } from '../core/models.js';
|
|
10
|
+
export interface ParseResult {
|
|
11
|
+
filepath: string;
|
|
12
|
+
symbols: Symbol[];
|
|
13
|
+
success: boolean;
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ProgressCallback {
|
|
17
|
+
(eventType: string, data: Record<string, unknown>): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Parse multiple files with concurrency control.
|
|
21
|
+
*
|
|
22
|
+
* Unlike Python's ThreadPoolExecutor, Node.js is single-threaded.
|
|
23
|
+
* Tree-sitter parsing is synchronous and fast (~200+ files/sec),
|
|
24
|
+
* so we process sequentially but report progress.
|
|
25
|
+
*
|
|
26
|
+
* For truly parallel parsing, use worker_threads (not implemented
|
|
27
|
+
* here for simplicity, but the interface supports it).
|
|
28
|
+
*/
|
|
29
|
+
export declare function parallelParseFiles(files: string[], options?: {
|
|
30
|
+
maxWorkers?: number;
|
|
31
|
+
progressCallback?: ProgressCallback;
|
|
32
|
+
}): {
|
|
33
|
+
symbols: Symbol[];
|
|
34
|
+
errorCount: number;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=parallel-indexer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel-indexer.d.ts","sourceRoot":"","sources":["../../src/indexing/parallel-indexer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CAChC,GACL;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CA8C3C"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parallel indexing utilities for Codebaxing.
|
|
3
|
+
*
|
|
4
|
+
* Uses worker pool pattern for concurrent file parsing.
|
|
5
|
+
* In Node.js, we use Promise.all with concurrency limiting
|
|
6
|
+
* since tree-sitter parsing is CPU-bound but fast enough
|
|
7
|
+
* that the overhead of worker_threads isn't worth it for most codebases.
|
|
8
|
+
*/
|
|
9
|
+
import { TreeSitterParser } from '../parsers/treesitter-parser.js';
|
|
10
|
+
/**
|
|
11
|
+
* Parse multiple files with concurrency control.
|
|
12
|
+
*
|
|
13
|
+
* Unlike Python's ThreadPoolExecutor, Node.js is single-threaded.
|
|
14
|
+
* Tree-sitter parsing is synchronous and fast (~200+ files/sec),
|
|
15
|
+
* so we process sequentially but report progress.
|
|
16
|
+
*
|
|
17
|
+
* For truly parallel parsing, use worker_threads (not implemented
|
|
18
|
+
* here for simplicity, but the interface supports it).
|
|
19
|
+
*/
|
|
20
|
+
export function parallelParseFiles(files, options = {}) {
|
|
21
|
+
if (files.length === 0)
|
|
22
|
+
return { symbols: [], errorCount: 0 };
|
|
23
|
+
const parser = new TreeSitterParser();
|
|
24
|
+
const allSymbols = [];
|
|
25
|
+
let errorCount = 0;
|
|
26
|
+
let completed = 0;
|
|
27
|
+
for (const filepath of files) {
|
|
28
|
+
try {
|
|
29
|
+
const parsed = parser.parseFile(filepath);
|
|
30
|
+
completed++;
|
|
31
|
+
if (parsed.isSuccessful && parsed.symbols.length > 0) {
|
|
32
|
+
allSymbols.push(...parsed.symbols);
|
|
33
|
+
options.progressCallback?.('file_parsed', {
|
|
34
|
+
path: filepath,
|
|
35
|
+
symbols: parsed.symbols.length,
|
|
36
|
+
index: completed,
|
|
37
|
+
total: files.length,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
else if (parsed.error) {
|
|
41
|
+
errorCount++;
|
|
42
|
+
options.progressCallback?.('parse_error', {
|
|
43
|
+
path: filepath,
|
|
44
|
+
error: parsed.error,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
options.progressCallback?.('file_parsed', {
|
|
49
|
+
path: filepath,
|
|
50
|
+
symbols: 0,
|
|
51
|
+
index: completed,
|
|
52
|
+
total: files.length,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
completed++;
|
|
58
|
+
errorCount++;
|
|
59
|
+
options.progressCallback?.('parse_error', {
|
|
60
|
+
path: filepath,
|
|
61
|
+
error: e.message,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return { symbols: allSymbols, errorCount };
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=parallel-indexer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel-indexer.js","sourceRoot":"","sources":["../../src/indexing/parallel-indexer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAcnE;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAe,EACf,UAGI,EAAE;IAEN,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;IAE9D,MAAM,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;IACtC,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,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AC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source retriever for semantic code search.
|
|
3
|
+
*
|
|
4
|
+
* Handles indexing, storage, and retrieval of code chunks using
|
|
5
|
+
* embeddings + ChromaDB for RAG applications.
|
|
6
|
+
*/
|
|
7
|
+
import { TreeSitterParser } from '../parsers/treesitter-parser.js';
|
|
8
|
+
import { EmbeddingService } from './embedding-service.js';
|
|
9
|
+
import { type ProgressCallback } from './parallel-indexer.js';
|
|
10
|
+
export declare const SUPPORTED_EXTENSIONS: string[];
|
|
11
|
+
export declare function discoverFiles(codebasePath: string, extensions?: Set<string>): string[];
|
|
12
|
+
export interface CodeChunk {
|
|
13
|
+
id: string;
|
|
14
|
+
text: string;
|
|
15
|
+
filepath: string;
|
|
16
|
+
symbolName: string;
|
|
17
|
+
symbolType: string;
|
|
18
|
+
lineStart: number;
|
|
19
|
+
metadata: Record<string, string>;
|
|
20
|
+
}
|
|
21
|
+
export declare class SourceRetriever {
|
|
22
|
+
codebasePath: string;
|
|
23
|
+
embeddingModel: string;
|
|
24
|
+
collectionName: string;
|
|
25
|
+
verbose: boolean;
|
|
26
|
+
persistPath: string | undefined;
|
|
27
|
+
private parser;
|
|
28
|
+
private embeddingService;
|
|
29
|
+
private chromaClient;
|
|
30
|
+
private collection;
|
|
31
|
+
stats: Record<string, number>;
|
|
32
|
+
private metadata;
|
|
33
|
+
constructor(options: {
|
|
34
|
+
codebasePath: string;
|
|
35
|
+
embeddingModel?: string;
|
|
36
|
+
collectionName?: string;
|
|
37
|
+
verbose?: boolean;
|
|
38
|
+
persistPath?: string;
|
|
39
|
+
parser?: TreeSitterParser;
|
|
40
|
+
embeddingService?: EmbeddingService;
|
|
41
|
+
});
|
|
42
|
+
private log;
|
|
43
|
+
private createChunkText;
|
|
44
|
+
private createChunk;
|
|
45
|
+
indexCodebase(options?: {
|
|
46
|
+
fileExtensions?: string[];
|
|
47
|
+
progressCallback?: ProgressCallback;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
getSourcesForQuestion(question: string, options?: {
|
|
50
|
+
nResults?: number;
|
|
51
|
+
language?: string;
|
|
52
|
+
symbolType?: string;
|
|
53
|
+
}): Promise<{
|
|
54
|
+
documents: Record<string, unknown>[];
|
|
55
|
+
sources: string[];
|
|
56
|
+
}>;
|
|
57
|
+
getStats(): Record<string, number>;
|
|
58
|
+
loadExistingIndex(): Promise<boolean>;
|
|
59
|
+
saveMetadata(metadataPath: string): void;
|
|
60
|
+
loadMetadata(metadataPath: string): Record<string, unknown> | undefined;
|
|
61
|
+
incrementalReindex(options?: {
|
|
62
|
+
fileExtensions?: string[];
|
|
63
|
+
progressCallback?: ProgressCallback;
|
|
64
|
+
}): Promise<Record<string, unknown>>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=source-retriever.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-retriever.d.ts","sourceRoot":"","sources":["../../src/indexing/source-retriever.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAKlF,eAAO,MAAM,oBAAoB,UAAgC,CAAC;AAiBlE,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CA4BtF;AAID,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,E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S,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IA2CvE,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAI5B,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;IAoB3C,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAaxC,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAWjE,kBAAkB,CAAC,OAAO,GAAE;QAChC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KAChC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAoH1C"}
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source retriever for semantic code search.
|
|
3
|
+
*
|
|
4
|
+
* Handles indexing, storage, and retrieval of code chunks using
|
|
5
|
+
* embeddings + ChromaDB for RAG applications.
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { ChromaClient } from 'chromadb';
|
|
10
|
+
import { TreeSitterParser } from '../parsers/treesitter-parser.js';
|
|
11
|
+
import { getLanguageForFile, getSupportedExtensions } from '../parsers/language-configs.js';
|
|
12
|
+
import { getEmbeddingService } from './embedding-service.js';
|
|
13
|
+
import { parallelParseFiles } from './parallel-indexer.js';
|
|
14
|
+
// ─── Constants ───────────────────────────────────────────────────────────────
|
|
15
|
+
export const SUPPORTED_EXTENSIONS = [...getSupportedExtensions()];
|
|
16
|
+
const SUPPORTED_EXTENSIONS_SET = new Set(SUPPORTED_EXTENSIONS);
|
|
17
|
+
const SKIP_DIRS = new Set([
|
|
18
|
+
'.git', 'node_modules', '__pycache__', '.codebaxing', 'venv', '.venv',
|
|
19
|
+
'.tox', '.mypy_cache', '.pytest_cache', 'dist', 'build', '.eggs',
|
|
20
|
+
'.next', '.turbo', '.vercel', '.expo',
|
|
21
|
+
'coverage', '.nyc_output',
|
|
22
|
+
'.cache', '.parcel-cache',
|
|
23
|
+
'out', '.output',
|
|
24
|
+
'generated', '.generated',
|
|
25
|
+
'.contentlayer',
|
|
26
|
+
'vendor',
|
|
27
|
+
]);
|
|
28
|
+
// ─── File Discovery ──────────────────────────────────────────────────────────
|
|
29
|
+
export function discoverFiles(codebasePath, extensions) {
|
|
30
|
+
const exts = extensions ?? SUPPORTED_EXTENSIONS_SET;
|
|
31
|
+
const files = [];
|
|
32
|
+
function walk(dir) {
|
|
33
|
+
let entries;
|
|
34
|
+
try {
|
|
35
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
for (const entry of entries) {
|
|
41
|
+
if (entry.isDirectory()) {
|
|
42
|
+
if (!SKIP_DIRS.has(entry.name)) {
|
|
43
|
+
walk(path.join(dir, entry.name));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (entry.isFile()) {
|
|
47
|
+
const ext = path.extname(entry.name);
|
|
48
|
+
if (exts.has(ext)) {
|
|
49
|
+
files.push(path.join(dir, entry.name));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
walk(codebasePath);
|
|
55
|
+
return files;
|
|
56
|
+
}
|
|
57
|
+
// ─── SourceRetriever ─────────────────────────────────────────────────────────
|
|
58
|
+
export class SourceRetriever {
|
|
59
|
+
codebasePath;
|
|
60
|
+
embeddingModel;
|
|
61
|
+
collectionName;
|
|
62
|
+
verbose;
|
|
63
|
+
persistPath;
|
|
64
|
+
parser;
|
|
65
|
+
embeddingService;
|
|
66
|
+
chromaClient;
|
|
67
|
+
collection = null;
|
|
68
|
+
stats = {
|
|
69
|
+
totalFiles: 0,
|
|
70
|
+
totalSymbols: 0,
|
|
71
|
+
totalChunks: 0,
|
|
72
|
+
parseErrors: 0,
|
|
73
|
+
indexingTime: 0,
|
|
74
|
+
};
|
|
75
|
+
metadata = {};
|
|
76
|
+
constructor(options) {
|
|
77
|
+
this.codebasePath = options.codebasePath;
|
|
78
|
+
this.embeddingModel = options.embeddingModel ?? 'all-MiniLM-L6-v2';
|
|
79
|
+
this.collectionName = options.collectionName ?? 'codebase';
|
|
80
|
+
this.verbose = options.verbose ?? true;
|
|
81
|
+
this.persistPath = options.persistPath;
|
|
82
|
+
this.parser = options.parser ?? new TreeSitterParser();
|
|
83
|
+
this.embeddingService = options.embeddingService ?? getEmbeddingService(this.embeddingModel, { showProgress: this.verbose });
|
|
84
|
+
// Initialize ChromaDB
|
|
85
|
+
// Note: ChromaDB Node.js client connects to a server.
|
|
86
|
+
// Set CHROMADB_URL env var to connect to a running ChromaDB server.
|
|
87
|
+
// Without it, uses ephemeral in-memory mode (data lost on restart).
|
|
88
|
+
if (this.persistPath) {
|
|
89
|
+
fs.mkdirSync(this.persistPath, { recursive: true });
|
|
90
|
+
}
|
|
91
|
+
const chromaUrl = process.env.CHROMADB_URL;
|
|
92
|
+
this.chromaClient = chromaUrl
|
|
93
|
+
? new ChromaClient({ path: chromaUrl })
|
|
94
|
+
: new ChromaClient();
|
|
95
|
+
}
|
|
96
|
+
log(message) {
|
|
97
|
+
if (this.verbose)
|
|
98
|
+
console.log(message);
|
|
99
|
+
}
|
|
100
|
+
createChunkText(symbol) {
|
|
101
|
+
const parts = [
|
|
102
|
+
`# ${symbol.filepath}:${symbol.lineStart}`,
|
|
103
|
+
`${symbol.type}: ${symbol.name}`,
|
|
104
|
+
'',
|
|
105
|
+
];
|
|
106
|
+
if (symbol.signature) {
|
|
107
|
+
parts.push(symbol.signature, '');
|
|
108
|
+
}
|
|
109
|
+
if (symbol.docstring) {
|
|
110
|
+
parts.push(symbol.docstring, '');
|
|
111
|
+
}
|
|
112
|
+
if (symbol.codeSnippet) {
|
|
113
|
+
parts.push(symbol.codeSnippet, '');
|
|
114
|
+
}
|
|
115
|
+
if (symbol.imports.length > 0) {
|
|
116
|
+
const importsStr = symbol.imports.slice(0, 10).join(', ');
|
|
117
|
+
parts.push(`Imports: ${importsStr}`);
|
|
118
|
+
}
|
|
119
|
+
if (symbol.calls.length > 0) {
|
|
120
|
+
const callsStr = symbol.calls.slice(0, 10).join(', ');
|
|
121
|
+
parts.push(`Calls: ${callsStr}`);
|
|
122
|
+
}
|
|
123
|
+
return parts.join('\n');
|
|
124
|
+
}
|
|
125
|
+
createChunk(symbol) {
|
|
126
|
+
const chunkId = `${symbol.filepath}:${symbol.name}:${symbol.lineStart}`;
|
|
127
|
+
const language = getLanguageForFile(symbol.filepath) ?? 'unknown';
|
|
128
|
+
return {
|
|
129
|
+
id: chunkId,
|
|
130
|
+
text: this.createChunkText(symbol),
|
|
131
|
+
filepath: symbol.filepath,
|
|
132
|
+
symbolName: symbol.name,
|
|
133
|
+
symbolType: symbol.type,
|
|
134
|
+
lineStart: symbol.lineStart,
|
|
135
|
+
metadata: {
|
|
136
|
+
filepath: symbol.filepath,
|
|
137
|
+
name: symbol.name,
|
|
138
|
+
type: symbol.type,
|
|
139
|
+
line: String(symbol.lineStart),
|
|
140
|
+
signature: symbol.signature,
|
|
141
|
+
parent: symbol.parent ?? '',
|
|
142
|
+
language,
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
async indexCodebase(options = {}) {
|
|
147
|
+
const fileExtensions = options.fileExtensions ?? SUPPORTED_EXTENSIONS;
|
|
148
|
+
const emit = options.progressCallback ?? (() => { });
|
|
149
|
+
if (!options.progressCallback) {
|
|
150
|
+
this.log('\n' + '='.repeat(80));
|
|
151
|
+
this.log('INDEXING CODEBASE');
|
|
152
|
+
this.log('='.repeat(80));
|
|
153
|
+
}
|
|
154
|
+
const startTime = performance.now();
|
|
155
|
+
// Step 1: Find all files
|
|
156
|
+
const extensionsSet = new Set(fileExtensions);
|
|
157
|
+
const allFiles = discoverFiles(this.codebasePath, extensionsSet);
|
|
158
|
+
this.stats.totalFiles = allFiles.length;
|
|
159
|
+
// Store file modification times
|
|
160
|
+
const fileMtimes = {};
|
|
161
|
+
for (const filepath of allFiles) {
|
|
162
|
+
try {
|
|
163
|
+
fileMtimes[filepath] = fs.statSync(filepath).mtimeMs;
|
|
164
|
+
}
|
|
165
|
+
catch { /* skip */ }
|
|
166
|
+
}
|
|
167
|
+
this.metadata.fileMtimes = fileMtimes;
|
|
168
|
+
emit('files_found', { files: allFiles, codebasePath: this.codebasePath });
|
|
169
|
+
if (!options.progressCallback)
|
|
170
|
+
this.log(`Found ${allFiles.length} files`);
|
|
171
|
+
// Step 2: Parse all files
|
|
172
|
+
emit('parsing_start', { total: allFiles.length });
|
|
173
|
+
const { symbols: allSymbols, errorCount } = parallelParseFiles(allFiles, {
|
|
174
|
+
progressCallback: options.progressCallback,
|
|
175
|
+
});
|
|
176
|
+
this.stats.parseErrors = errorCount;
|
|
177
|
+
this.stats.totalSymbols = allSymbols.length;
|
|
178
|
+
if (!options.progressCallback) {
|
|
179
|
+
this.log(`Parsed ${allSymbols.length.toLocaleString()} symbols from ${allFiles.length} files`);
|
|
180
|
+
}
|
|
181
|
+
// Step 3: Create chunks
|
|
182
|
+
const chunks = allSymbols.map(s => this.createChunk(s));
|
|
183
|
+
this.stats.totalChunks = chunks.length;
|
|
184
|
+
emit('chunks_created', { total: chunks.length });
|
|
185
|
+
// Step 4: Create ChromaDB collection
|
|
186
|
+
try {
|
|
187
|
+
await this.chromaClient.deleteCollection({ name: this.collectionName });
|
|
188
|
+
}
|
|
189
|
+
catch { /* collection doesn't exist */ }
|
|
190
|
+
this.collection = await this.chromaClient.createCollection({
|
|
191
|
+
name: this.collectionName,
|
|
192
|
+
metadata: { description: `Code embeddings for ${path.basename(this.codebasePath)}` },
|
|
193
|
+
});
|
|
194
|
+
// Step 5: Generate embeddings and store
|
|
195
|
+
emit('embedding_start', { total: chunks.length, etaMinutes: chunks.length / 50 / 60 });
|
|
196
|
+
if (!options.progressCallback) {
|
|
197
|
+
this.log(`\nGenerating embeddings for ${chunks.length} chunks...`);
|
|
198
|
+
}
|
|
199
|
+
const batchSize = 100;
|
|
200
|
+
for (let i = 0; i < chunks.length; i += batchSize) {
|
|
201
|
+
const batch = chunks.slice(i, i + batchSize);
|
|
202
|
+
emit('embedding_progress', {
|
|
203
|
+
current: Math.min(i + batchSize, chunks.length),
|
|
204
|
+
total: chunks.length,
|
|
205
|
+
});
|
|
206
|
+
try {
|
|
207
|
+
const texts = batch.map(c => c.text);
|
|
208
|
+
const embeddings = await this.embeddingService.embedBatch(texts);
|
|
209
|
+
await this.collection.add({
|
|
210
|
+
ids: batch.map(c => c.id),
|
|
211
|
+
embeddings,
|
|
212
|
+
documents: texts,
|
|
213
|
+
metadatas: batch.map(c => c.metadata),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
catch (e) {
|
|
217
|
+
if (!options.progressCallback) {
|
|
218
|
+
this.log(`Error embedding batch ${i}: ${e.message}`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
this.stats.indexingTime = (performance.now() - startTime) / 1000;
|
|
223
|
+
emit('complete', { stats: { ...this.stats } });
|
|
224
|
+
if (!options.progressCallback) {
|
|
225
|
+
this.log('\n' + '='.repeat(80));
|
|
226
|
+
this.log('INDEXING COMPLETE');
|
|
227
|
+
this.log('='.repeat(80));
|
|
228
|
+
this.log(`Files parsed: ${this.stats.totalFiles.toLocaleString()}`);
|
|
229
|
+
this.log(`Symbols extracted: ${this.stats.totalSymbols.toLocaleString()}`);
|
|
230
|
+
this.log(`Chunks created: ${this.stats.totalChunks.toLocaleString()}`);
|
|
231
|
+
this.log(`Parse errors: ${this.stats.parseErrors}`);
|
|
232
|
+
this.log(`Time elapsed: ${this.stats.indexingTime.toFixed(1)}s`);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async getSourcesForQuestion(question, options = {}) {
|
|
236
|
+
if (!this.collection)
|
|
237
|
+
return { documents: [], sources: [] };
|
|
238
|
+
const nResults = options.nResults ?? 10;
|
|
239
|
+
const queryEmbedding = await this.embeddingService.embed(question, true);
|
|
240
|
+
// Build metadata filter
|
|
241
|
+
let whereFilter;
|
|
242
|
+
if (options.language || options.symbolType) {
|
|
243
|
+
whereFilter = {};
|
|
244
|
+
if (options.language)
|
|
245
|
+
whereFilter.language = options.language;
|
|
246
|
+
if (options.symbolType)
|
|
247
|
+
whereFilter.type = options.symbolType;
|
|
248
|
+
}
|
|
249
|
+
const results = await this.collection.query({
|
|
250
|
+
queryEmbeddings: [queryEmbedding],
|
|
251
|
+
nResults,
|
|
252
|
+
where: whereFilter,
|
|
253
|
+
});
|
|
254
|
+
const documents = results.documents?.[0] ?? [];
|
|
255
|
+
const metadatas = results.metadatas?.[0] ?? [];
|
|
256
|
+
const sources = [];
|
|
257
|
+
const docResults = [];
|
|
258
|
+
for (let i = 0; i < documents.length; i++) {
|
|
259
|
+
const metadata = metadatas[i];
|
|
260
|
+
let filepath = metadata.filepath;
|
|
261
|
+
try {
|
|
262
|
+
filepath = path.relative(this.codebasePath, filepath);
|
|
263
|
+
}
|
|
264
|
+
catch { /* keep absolute */ }
|
|
265
|
+
sources.push(`${filepath}:${metadata.line} - ${metadata.name}()`);
|
|
266
|
+
docResults.push({
|
|
267
|
+
text: documents[i],
|
|
268
|
+
metadata,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
return { documents: docResults, sources };
|
|
272
|
+
}
|
|
273
|
+
getStats() {
|
|
274
|
+
return { ...this.stats };
|
|
275
|
+
}
|
|
276
|
+
async loadExistingIndex() {
|
|
277
|
+
if (!this.persistPath) {
|
|
278
|
+
this.log('No persistent storage configured');
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
try {
|
|
282
|
+
this.collection = await this.chromaClient.getCollection({
|
|
283
|
+
name: this.collectionName,
|
|
284
|
+
embeddingFunction: { generate: async (texts) => texts.map(() => []) },
|
|
285
|
+
});
|
|
286
|
+
const count = await this.collection.count();
|
|
287
|
+
this.log(`Loaded existing index with ${count.toLocaleString()} chunks`);
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
catch (e) {
|
|
291
|
+
this.log(`No existing index found: ${e.message}`);
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
saveMetadata(metadataPath) {
|
|
296
|
+
const metadata = {
|
|
297
|
+
codebasePath: this.codebasePath,
|
|
298
|
+
embeddingModel: this.embeddingModel,
|
|
299
|
+
collectionName: this.collectionName,
|
|
300
|
+
indexedAt: new Date().toISOString(),
|
|
301
|
+
stats: this.stats,
|
|
302
|
+
fileMtimes: this.metadata.fileMtimes ?? {},
|
|
303
|
+
};
|
|
304
|
+
fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2));
|
|
305
|
+
this.log(`Metadata saved to ${metadataPath}`);
|
|
306
|
+
}
|
|
307
|
+
loadMetadata(metadataPath) {
|
|
308
|
+
try {
|
|
309
|
+
const data = JSON.parse(fs.readFileSync(metadataPath, 'utf-8'));
|
|
310
|
+
if (data.stats)
|
|
311
|
+
this.stats = data.stats;
|
|
312
|
+
if (data.fileMtimes)
|
|
313
|
+
this.metadata.fileMtimes = data.fileMtimes;
|
|
314
|
+
return data;
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
async incrementalReindex(options = {}) {
|
|
321
|
+
const startTime = performance.now();
|
|
322
|
+
const emit = options.progressCallback ?? (() => { });
|
|
323
|
+
const extensions = options.fileExtensions ?? SUPPORTED_EXTENSIONS;
|
|
324
|
+
// Get stored file mtimes
|
|
325
|
+
const storedMtimes = this.metadata.fileMtimes ?? {};
|
|
326
|
+
// Scan current files
|
|
327
|
+
const extensionsSet = new Set(extensions);
|
|
328
|
+
const allCurrentPaths = discoverFiles(this.codebasePath, extensionsSet);
|
|
329
|
+
const currentFiles = {};
|
|
330
|
+
for (const filepath of allCurrentPaths) {
|
|
331
|
+
try {
|
|
332
|
+
currentFiles[filepath] = fs.statSync(filepath).mtimeMs;
|
|
333
|
+
}
|
|
334
|
+
catch { /* skip */ }
|
|
335
|
+
}
|
|
336
|
+
// Categorize changes
|
|
337
|
+
const storedPaths = new Set(Object.keys(storedMtimes));
|
|
338
|
+
const currentPaths = new Set(Object.keys(currentFiles));
|
|
339
|
+
const newFiles = [...currentPaths].filter(p => !storedPaths.has(p));
|
|
340
|
+
const deletedFiles = [...storedPaths].filter(p => !currentPaths.has(p));
|
|
341
|
+
const modifiedFiles = [...currentPaths]
|
|
342
|
+
.filter(p => storedPaths.has(p) && currentFiles[p] > (storedMtimes[p] ?? 0));
|
|
343
|
+
const filesToReindex = new Set([...newFiles, ...modifiedFiles]);
|
|
344
|
+
const filesToRemove = new Set([...deletedFiles, ...modifiedFiles]);
|
|
345
|
+
emit('changes_detected', {
|
|
346
|
+
new: newFiles.length,
|
|
347
|
+
modified: modifiedFiles.length,
|
|
348
|
+
deleted: deletedFiles.length,
|
|
349
|
+
});
|
|
350
|
+
let chunksRemoved = 0;
|
|
351
|
+
let chunksAdded = 0;
|
|
352
|
+
// Remove stale chunks
|
|
353
|
+
if (filesToRemove.size > 0 && this.collection) {
|
|
354
|
+
for (const filepath of filesToRemove) {
|
|
355
|
+
try {
|
|
356
|
+
await this.collection.delete({ where: { filepath } });
|
|
357
|
+
chunksRemoved++;
|
|
358
|
+
}
|
|
359
|
+
catch { /* ignore */ }
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
// Parse and index new/modified files
|
|
363
|
+
if (filesToReindex.size > 0) {
|
|
364
|
+
emit('parsing_start', { total: filesToReindex.size });
|
|
365
|
+
const chunks = [];
|
|
366
|
+
for (const filepath of filesToReindex) {
|
|
367
|
+
try {
|
|
368
|
+
const parsed = this.parser.parseFile(filepath);
|
|
369
|
+
for (const symbol of parsed.symbols) {
|
|
370
|
+
chunks.push(this.createChunk(symbol));
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
catch { /* skip */ }
|
|
374
|
+
}
|
|
375
|
+
if (chunks.length > 0 && this.collection) {
|
|
376
|
+
emit('embedding_start', { total: chunks.length });
|
|
377
|
+
const batchSize = 50;
|
|
378
|
+
for (let i = 0; i < chunks.length; i += batchSize) {
|
|
379
|
+
const batch = chunks.slice(i, i + batchSize);
|
|
380
|
+
const texts = batch.map(c => c.text);
|
|
381
|
+
const embeddings = await this.embeddingService.embedBatch(texts);
|
|
382
|
+
if (embeddings.length > 0) {
|
|
383
|
+
// Deduplicate IDs
|
|
384
|
+
const seenIds = new Map();
|
|
385
|
+
batch.forEach((c, idx) => seenIds.set(c.id, idx));
|
|
386
|
+
const uniqueIndices = [...seenIds.values()].sort((a, b) => a - b);
|
|
387
|
+
const uniqueBatch = uniqueIndices.map(j => batch[j]);
|
|
388
|
+
const uniqueEmb = uniqueIndices.map(j => embeddings[j]);
|
|
389
|
+
if (uniqueBatch.length > 0) {
|
|
390
|
+
await this.collection.add({
|
|
391
|
+
ids: uniqueBatch.map(c => c.id),
|
|
392
|
+
embeddings: uniqueEmb,
|
|
393
|
+
documents: uniqueBatch.map(c => c.text),
|
|
394
|
+
metadatas: uniqueBatch.map(c => c.metadata),
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
chunksAdded += batch.length;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
// Update metadata
|
|
403
|
+
this.metadata.fileMtimes = currentFiles;
|
|
404
|
+
if (this.persistPath) {
|
|
405
|
+
const metadataPath = path.join(path.dirname(this.persistPath), 'metadata.json');
|
|
406
|
+
this.saveMetadata(metadataPath);
|
|
407
|
+
}
|
|
408
|
+
const elapsedTime = (performance.now() - startTime) / 1000;
|
|
409
|
+
emit('complete', { chunksAdded });
|
|
410
|
+
return {
|
|
411
|
+
filesAdded: newFiles.length,
|
|
412
|
+
filesModified: modifiedFiles.length,
|
|
413
|
+
filesDeleted: deletedFiles.length,
|
|
414
|
+
chunksAdded,
|
|
415
|
+
chunksRemoved,
|
|
416
|
+
timeSeconds: Math.round(elapsedTime * 100) / 100,
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
//# sourceMappingURL=source-retriever.js.map
|