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