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
|
@@ -75,8 +75,17 @@ export interface SearchOptions {
|
|
|
75
75
|
/** Filter to specific file patterns (e.g., ['*.ts', '*.tsx']) */
|
|
76
76
|
filePatterns?: string[];
|
|
77
77
|
/**
|
|
78
|
-
* Filter
|
|
79
|
-
*
|
|
78
|
+
* Filter results by path prefix or glob pattern.
|
|
79
|
+
*
|
|
80
|
+
* Supports two modes:
|
|
81
|
+
* - Path prefix: 'src/auth' matches all files in src/auth/
|
|
82
|
+
* - Glob pattern: '*.ts' matches all TypeScript files, '*.md' matches markdown
|
|
83
|
+
*
|
|
84
|
+
* Examples:
|
|
85
|
+
* - ['src/auth'] - files in src/auth/
|
|
86
|
+
* - ['*.ts'] - all TypeScript files
|
|
87
|
+
* - ['*.md'] - all Markdown files
|
|
88
|
+
* - ['src/**\/*.test.ts'] - test files in src/
|
|
80
89
|
*/
|
|
81
90
|
pathFilter?: string[];
|
|
82
91
|
/**
|
|
@@ -13,3 +13,4 @@ export { parseQueryLiterals } from "./queryLiteralParser";
|
|
|
13
13
|
export { extractLiterals, extractLiteralsWithReferences, } from "./literalExtractor";
|
|
14
14
|
export { calculateLiteralMultiplier, calculateMaxMultiplier, calculateLiteralContribution, applyLiteralBoost, mergeWithLiteralBoost, LITERAL_SCORING_CONSTANTS, type LiteralScoreContribution, type MergeInput, type MergeOutput, } from "./literalScorer";
|
|
15
15
|
export { getSynonyms, expandQuery, DEFAULT_LEXICON, EXPANSION_WEIGHTS, DEFAULT_EXPANSION_OPTIONS, } from "./lexicon";
|
|
16
|
+
export { extractJsonPaths, extractJsonKeywords } from "./jsonPathExtractor";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON Path Extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts dot-notation key paths from JSON objects as literals.
|
|
5
|
+
* Used for literal-based indexing of JSON files.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // user.json: { name: { first: "john" } }
|
|
9
|
+
* extractJsonPaths({ name: { first: "john" } }, "user")
|
|
10
|
+
* // Returns literals for: "user.name", "user.name.first"
|
|
11
|
+
*/
|
|
12
|
+
import type { ExtractedLiteral } from "../entities/literal";
|
|
13
|
+
/**
|
|
14
|
+
* Extract all key paths from a JSON object as literals.
|
|
15
|
+
* Prefixes all paths with the filename (without extension).
|
|
16
|
+
*
|
|
17
|
+
* @param obj - Parsed JSON object
|
|
18
|
+
* @param fileBasename - Filename without extension (e.g., "user" from "user.json")
|
|
19
|
+
* @returns Array of literals representing all dot-notation paths
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractJsonPaths(obj: unknown, fileBasename: string): ExtractedLiteral[];
|
|
22
|
+
/**
|
|
23
|
+
* Extract keywords from JSON for BM25 indexing.
|
|
24
|
+
* Extracts both keys and string values.
|
|
25
|
+
*
|
|
26
|
+
* @param obj - Parsed JSON object
|
|
27
|
+
* @returns Array of keywords for BM25 indexing
|
|
28
|
+
*/
|
|
29
|
+
export declare function extractJsonKeywords(obj: unknown): string[];
|