raggrep 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/main.js +10 -13
- package/dist/cli/main.js.map +4 -4
- package/dist/index.js +9 -12
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/cli/main.js
CHANGED
|
@@ -2783,19 +2783,16 @@ class TypeScriptModule {
|
|
|
2783
2783
|
const { topK = DEFAULT_TOP_K2, minScore = DEFAULT_MIN_SCORE2, filePatterns } = options;
|
|
2784
2784
|
const indexDir = getRaggrepDir(ctx.rootDir, ctx.config);
|
|
2785
2785
|
const symbolicIndex = new SymbolicIndex(indexDir, this.id);
|
|
2786
|
-
let
|
|
2786
|
+
let allFiles;
|
|
2787
2787
|
try {
|
|
2788
2788
|
await symbolicIndex.initialize();
|
|
2789
|
-
|
|
2790
|
-
candidateFiles = symbolicIndex.findCandidates(query, maxCandidates);
|
|
2791
|
-
if (candidateFiles.length === 0) {
|
|
2792
|
-
candidateFiles = symbolicIndex.getAllFiles();
|
|
2793
|
-
}
|
|
2789
|
+
allFiles = symbolicIndex.getAllFiles();
|
|
2794
2790
|
} catch {
|
|
2795
|
-
|
|
2791
|
+
allFiles = await ctx.listIndexedFiles();
|
|
2796
2792
|
}
|
|
2793
|
+
let filesToSearch = allFiles;
|
|
2797
2794
|
if (filePatterns && filePatterns.length > 0) {
|
|
2798
|
-
|
|
2795
|
+
filesToSearch = allFiles.filter((filepath) => {
|
|
2799
2796
|
return filePatterns.some((pattern) => {
|
|
2800
2797
|
if (pattern.startsWith("*.")) {
|
|
2801
2798
|
const ext = pattern.slice(1);
|
|
@@ -2808,7 +2805,7 @@ class TypeScriptModule {
|
|
|
2808
2805
|
const queryEmbedding = await getEmbedding(query);
|
|
2809
2806
|
const bm25Index = new BM25Index;
|
|
2810
2807
|
const allChunksData = [];
|
|
2811
|
-
for (const filepath of
|
|
2808
|
+
for (const filepath of filesToSearch) {
|
|
2812
2809
|
const fileIndex = await ctx.loadFileIndex(filepath);
|
|
2813
2810
|
if (!fileIndex)
|
|
2814
2811
|
continue;
|
|
@@ -2835,7 +2832,7 @@ class TypeScriptModule {
|
|
|
2835
2832
|
}
|
|
2836
2833
|
const queryTerms = query.toLowerCase().split(/\s+/).filter((t) => t.length > 2);
|
|
2837
2834
|
const pathBoosts = new Map;
|
|
2838
|
-
for (const filepath of
|
|
2835
|
+
for (const filepath of filesToSearch) {
|
|
2839
2836
|
const summary = symbolicIndex.getFileSummary(filepath);
|
|
2840
2837
|
if (summary?.pathContext) {
|
|
2841
2838
|
let boost = 0;
|
|
@@ -2900,7 +2897,7 @@ class TypeScriptModule {
|
|
|
2900
2897
|
return references;
|
|
2901
2898
|
}
|
|
2902
2899
|
}
|
|
2903
|
-
var DEFAULT_MIN_SCORE2 = 0.15, DEFAULT_TOP_K2 = 10, SEMANTIC_WEIGHT = 0.7, BM25_WEIGHT = 0.3
|
|
2900
|
+
var DEFAULT_MIN_SCORE2 = 0.15, DEFAULT_TOP_K2 = 10, SEMANTIC_WEIGHT = 0.7, BM25_WEIGHT = 0.3;
|
|
2904
2901
|
var init_typescript = __esm(() => {
|
|
2905
2902
|
init_embeddings();
|
|
2906
2903
|
init_config2();
|
|
@@ -4025,7 +4022,7 @@ init_embeddings();
|
|
|
4025
4022
|
// package.json
|
|
4026
4023
|
var package_default = {
|
|
4027
4024
|
name: "raggrep",
|
|
4028
|
-
version: "0.2.
|
|
4025
|
+
version: "0.2.2",
|
|
4029
4026
|
description: "Local filesystem-based RAG system for codebases - semantic search using local embeddings",
|
|
4030
4027
|
type: "module",
|
|
4031
4028
|
main: "./dist/index.js",
|
|
@@ -4459,4 +4456,4 @@ Run 'raggrep <command> --help' for more information.
|
|
|
4459
4456
|
}
|
|
4460
4457
|
main();
|
|
4461
4458
|
|
|
4462
|
-
//# debugId=
|
|
4459
|
+
//# debugId=03118A3FC62FA92D64756E2164756E21
|