raggrep 0.8.0 → 0.8.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/README.md +28 -7
- package/dist/cli/main.js +1596 -146
- package/dist/cli/main.js.map +25 -16
- package/dist/domain/entities/searchResult.d.ts +11 -2
- package/dist/domain/services/index.d.ts +1 -0
- package/dist/domain/services/jsonPathExtractor.d.ts +29 -0
- package/dist/domain/services/jsonPathExtractor.test.d.ts +4 -0
- package/dist/index.js +1600 -143
- package/dist/index.js.map +23 -14
- package/dist/modules/data/json/index.d.ts +28 -10
- package/package.json +1 -1
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* JSON Data Index Module
|
|
3
3
|
*
|
|
4
4
|
* Provides JSON file search using:
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
*
|
|
5
|
+
* - Literal indexing of dot-notation key paths (e.g., "package.dependencies.react")
|
|
6
|
+
* - BM25 keyword matching for fuzzy search
|
|
7
|
+
*
|
|
8
|
+
* Note: This module uses literal-only indexing (no embeddings) for fast indexing.
|
|
9
|
+
* JSON keys are indexed as dot-notation paths prefixed with the filename.
|
|
8
10
|
*
|
|
9
11
|
* Supported file types: .json
|
|
10
12
|
*
|
|
@@ -12,7 +14,7 @@
|
|
|
12
14
|
*/
|
|
13
15
|
import { IndexModule, IndexContext, SearchContext, SearchOptions, FileIndex, SearchResult, ModuleConfig } from "../../../types";
|
|
14
16
|
/** Default minimum similarity score for search results */
|
|
15
|
-
export declare const DEFAULT_MIN_SCORE = 0.
|
|
17
|
+
export declare const DEFAULT_MIN_SCORE = 0.1;
|
|
16
18
|
/** Default number of results to return */
|
|
17
19
|
export declare const DEFAULT_TOP_K = 10;
|
|
18
20
|
/** File extensions supported by this module */
|
|
@@ -26,24 +28,40 @@ export declare const supportsFile: typeof isJsonFile;
|
|
|
26
28
|
* Module-specific data stored alongside file index
|
|
27
29
|
*/
|
|
28
30
|
export interface JsonModuleData {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
jsonKeys: string[];
|
|
31
|
+
/** Dot-notation paths extracted from the JSON file */
|
|
32
|
+
jsonPaths: string[];
|
|
32
33
|
[key: string]: unknown;
|
|
33
34
|
}
|
|
34
35
|
export declare class JsonModule implements IndexModule {
|
|
35
36
|
readonly id = "data/json";
|
|
36
37
|
readonly name = "JSON Search";
|
|
37
|
-
readonly description = "JSON file search with
|
|
38
|
-
readonly version = "
|
|
38
|
+
readonly description = "JSON file search with literal-based key path indexing";
|
|
39
|
+
readonly version = "2.0.0";
|
|
39
40
|
supportsFile(filepath: string): boolean;
|
|
40
|
-
private embeddingConfig;
|
|
41
41
|
private symbolicIndex;
|
|
42
|
+
private literalIndex;
|
|
42
43
|
private pendingSummaries;
|
|
44
|
+
/** Map from chunkId → { filepath, literals } for building literal index */
|
|
45
|
+
private pendingLiterals;
|
|
43
46
|
private rootDir;
|
|
44
47
|
private logger;
|
|
45
48
|
initialize(config: ModuleConfig): Promise<void>;
|
|
46
49
|
indexFile(filepath: string, content: string, ctx: IndexContext): Promise<FileIndex | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Finalize indexing by building and saving the symbolic and literal indexes
|
|
52
|
+
*/
|
|
47
53
|
finalize(ctx: IndexContext): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Search the JSON index for files matching the query.
|
|
56
|
+
*
|
|
57
|
+
* Uses a two-source approach:
|
|
58
|
+
* 1. Literal index for exact path matches (e.g., `package.dependencies.react`)
|
|
59
|
+
* 2. BM25 keyword search for fuzzy matching
|
|
60
|
+
*
|
|
61
|
+
* @param query - Search query (supports backticks for exact literal matching)
|
|
62
|
+
* @param ctx - Search context with index access
|
|
63
|
+
* @param options - Search options (topK, minScore, filePatterns)
|
|
64
|
+
* @returns Array of search results sorted by relevance
|
|
65
|
+
*/
|
|
48
66
|
search(query: string, ctx: SearchContext, options?: SearchOptions): Promise<SearchResult[]>;
|
|
49
67
|
}
|