raggrep 0.8.4 → 0.9.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.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Structure:
8
8
  * .raggrep/index/<module>/symbolic/
9
- * ├── _meta.json (BM25 statistics)
9
+ * ├── _meta.json (BM25 statistics + serialized BM25 data)
10
10
  * └── <filepath>.json (per-file summaries)
11
11
  */
12
12
  import type { FileSummary } from "../../domain/entities";
@@ -14,6 +14,7 @@ import type { FileSummary } from "../../domain/entities";
14
14
  * Symbolic Index Manager
15
15
  *
16
16
  * Manages the keyword-based index for fast file filtering.
17
+ * Supports incremental updates to avoid full rebuilds.
17
18
  */
18
19
  export declare class SymbolicIndex {
19
20
  private meta;
@@ -27,15 +28,29 @@ export declare class SymbolicIndex {
27
28
  */
28
29
  initialize(): Promise<void>;
29
30
  /**
30
- * Add or update a file summary
31
+ * Add or update a file summary (for batch operations, use with buildBM25Index)
31
32
  */
32
33
  addFile(summary: FileSummary): void;
33
34
  /**
34
- * Remove a file from the index
35
+ * Add or update a file summary with incremental BM25 update.
36
+ * Use this for incremental indexing instead of addFile + buildBM25Index.
37
+ */
38
+ addFileIncremental(summary: FileSummary): void;
39
+ /**
40
+ * Remove a file from the index (for batch operations)
35
41
  */
36
42
  removeFile(filepath: string): boolean;
37
43
  /**
38
- * Build BM25 index from file summaries
44
+ * Remove a file from the index with incremental BM25 update.
45
+ * Use this for incremental indexing.
46
+ */
47
+ removeFileIncremental(filepath: string): boolean;
48
+ /**
49
+ * Get tokens for a file summary (for BM25 indexing)
50
+ */
51
+ private getTokensForSummary;
52
+ /**
53
+ * Build BM25 index from file summaries (full rebuild)
39
54
  */
40
55
  buildBM25Index(): void;
41
56
  /**
@@ -51,9 +66,14 @@ export declare class SymbolicIndex {
51
66
  */
52
67
  getFileSummary(filepath: string): FileSummary | undefined;
53
68
  /**
54
- * Save the index to disk (per-file structure)
69
+ * Save the index to disk (per-file structure with BM25 serialization)
55
70
  */
56
71
  save(): Promise<void>;
72
+ /**
73
+ * Save only the updated file summaries (for incremental saves)
74
+ * @param filepaths - List of filepaths that were updated
75
+ */
76
+ saveIncremental(filepaths: string[]): Promise<void>;
57
77
  /**
58
78
  * Load the index from disk
59
79
  */
@@ -48,7 +48,8 @@ export declare class JsonModule implements IndexModule {
48
48
  initialize(config: ModuleConfig): Promise<void>;
49
49
  indexFile(filepath: string, content: string, ctx: IndexContext): Promise<FileIndex | null>;
50
50
  /**
51
- * Finalize indexing by building and saving the symbolic and literal indexes
51
+ * Finalize indexing by building and saving the symbolic and literal indexes.
52
+ * Uses incremental updates when possible to avoid full rebuilds.
52
53
  */
53
54
  finalize(ctx: IndexContext): Promise<void>;
54
55
  /**
@@ -48,7 +48,8 @@ export declare class TypeScriptModule implements IndexModule {
48
48
  initialize(config: ModuleConfig): Promise<void>;
49
49
  indexFile(filepath: string, content: string, ctx: IndexContext): Promise<FileIndex | null>;
50
50
  /**
51
- * Finalize indexing by building and saving the symbolic and literal indexes
51
+ * Finalize indexing by building and saving the symbolic and literal indexes.
52
+ * Uses incremental updates when possible to avoid full rebuilds.
52
53
  */
53
54
  finalize(ctx: IndexContext): Promise<void>;
54
55
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "raggrep",
3
- "version": "0.8.4",
3
+ "version": "0.9.0",
4
4
  "description": "Local filesystem-based RAG system for codebases - semantic search using local embeddings",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",