raggrep 0.2.0 → 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 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 candidateFiles;
2786
+ let allFiles;
2787
2787
  try {
2788
2788
  await symbolicIndex.initialize();
2789
- const maxCandidates = topK * TIER1_CANDIDATE_MULTIPLIER;
2790
- candidateFiles = symbolicIndex.findCandidates(query, maxCandidates);
2791
- if (candidateFiles.length === 0) {
2792
- candidateFiles = symbolicIndex.getAllFiles();
2793
- }
2789
+ allFiles = symbolicIndex.getAllFiles();
2794
2790
  } catch {
2795
- candidateFiles = await ctx.listIndexedFiles();
2791
+ allFiles = await ctx.listIndexedFiles();
2796
2792
  }
2793
+ let filesToSearch = allFiles;
2797
2794
  if (filePatterns && filePatterns.length > 0) {
2798
- candidateFiles = candidateFiles.filter((filepath) => {
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 candidateFiles) {
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 candidateFiles) {
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, TIER1_CANDIDATE_MULTIPLIER = 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();
@@ -3551,6 +3548,10 @@ async function ensureIndexFresh(rootDir, options = {}) {
3551
3548
  try {
3552
3549
  await fs6.unlink(indexFilePath);
3553
3550
  } catch {}
3551
+ const symbolicFilePath = path12.join(indexPath, "symbolic", filepath.replace(/\.[^.]+$/, ".json"));
3552
+ try {
3553
+ await fs6.unlink(symbolicFilePath);
3554
+ } catch {}
3554
3555
  delete manifest.files[filepath];
3555
3556
  totalRemoved++;
3556
3557
  }
@@ -4021,7 +4022,7 @@ init_embeddings();
4021
4022
  // package.json
4022
4023
  var package_default = {
4023
4024
  name: "raggrep",
4024
- version: "0.2.0",
4025
+ version: "0.2.2",
4025
4026
  description: "Local filesystem-based RAG system for codebases - semantic search using local embeddings",
4026
4027
  type: "module",
4027
4028
  main: "./dist/index.js",
@@ -4455,4 +4456,4 @@ Run 'raggrep <command> --help' for more information.
4455
4456
  }
4456
4457
  main();
4457
4458
 
4458
- //# debugId=4B6F0EA9EEB7164864756E2164756E21
4459
+ //# debugId=03118A3FC62FA92D64756E2164756E21