raggrep 0.3.0 → 0.5.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.
@@ -1,4 +1,4 @@
1
- import type { EmbeddingModelName } from "../../domain/ports";
1
+ import type { EmbeddingModelName, Logger } from "../../domain/ports";
2
2
  export interface IndexResult {
3
3
  moduleId: string;
4
4
  indexed: number;
@@ -12,6 +12,10 @@ export interface IndexOptions {
12
12
  verbose?: boolean;
13
13
  /** Suppress most output (for use during query) */
14
14
  quiet?: boolean;
15
+ /** Logger for progress reporting. If not provided, uses console by default (quiet mode uses silent logger) */
16
+ logger?: Logger;
17
+ /** Number of files to process in parallel (default: 4) */
18
+ concurrency?: number;
15
19
  }
16
20
  export interface EnsureFreshResult {
17
21
  /** Number of files indexed (new or modified) */
@@ -50,6 +54,23 @@ export interface IndexStatus {
50
54
  * Index a directory using all enabled modules
51
55
  */
52
56
  export declare function indexDirectory(rootDir: string, options?: IndexOptions): Promise<IndexResult[]>;
57
+ /**
58
+ * Result of a reset operation
59
+ */
60
+ export interface ResetResult {
61
+ /** Whether the reset was successful */
62
+ success: boolean;
63
+ /** The index directory that was removed */
64
+ indexDir: string;
65
+ }
66
+ /**
67
+ * Reset (delete) the index for a directory.
68
+ *
69
+ * @param rootDir - Root directory of the project
70
+ * @returns ResetResult with success status
71
+ * @throws Error if no index exists
72
+ */
73
+ export declare function resetIndex(rootDir: string): Promise<ResetResult>;
53
74
  /**
54
75
  * Ensure the index is fresh by checking for changes and updating incrementally.
55
76
  * This function is designed to be called before search to transparently manage the index.
@@ -65,15 +86,22 @@ export declare function indexDirectory(rootDir: string, options?: IndexOptions):
65
86
  * @returns Statistics about what was updated
66
87
  */
67
88
  export declare function ensureIndexFresh(rootDir: string, options?: IndexOptions): Promise<EnsureFreshResult>;
89
+ /**
90
+ * Options for cleanup operation
91
+ */
92
+ export interface CleanupOptions {
93
+ /** Show detailed progress */
94
+ verbose?: boolean;
95
+ /** Logger for progress reporting */
96
+ logger?: Logger;
97
+ }
68
98
  /**
69
99
  * Clean up stale index entries for files that no longer exist
70
100
  * @param rootDir - Root directory of the project
71
101
  * @param options - Cleanup options
72
102
  * @returns Array of cleanup results per module
73
103
  */
74
- export declare function cleanupIndex(rootDir: string, options?: {
75
- verbose?: boolean;
76
- }): Promise<CleanupResult[]>;
104
+ export declare function cleanupIndex(rootDir: string, options?: CleanupOptions): Promise<CleanupResult[]>;
77
105
  /**
78
106
  * Get the current status of the index
79
107
  * @param rootDir - Root directory of the project