@ff-labs/fff-node 0.1.0-nightly.5809316

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ffi.js","sourceRoot":"","sources":["../../src/ffi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACL,KAAK,EACL,QAAQ,EACR,aAAa,EAEb,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,WAAW,GACZ,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,sCAAsC;AACtC,IAAI,QAAQ,GAAG,KAAK,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG;IACxB,OAAO,EAAE,QAAQ,CAAC,EAAE;IACpB,IAAI,EAAE,QAAQ,CAAC,QAAQ;IACvB,KAAK,EAAE,QAAQ,CAAC,QAAQ;IACxB,MAAM,EAAE,QAAQ,CAAC,QAAQ;CAC1B,CAAC;AASF;;GAEG;AACH,SAAS,WAAW;IAClB,IAAI,QAAQ;QAAE,OAAO;IAErB,MAAM,UAAU,GAAG,UAAU,EAAE,CAAC;IAChC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,+HAA+H,CAChI,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IACjD,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,GAAY;IAChC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC;IAClD,IAAI,OAAO,GA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AAa,CAClB,eAAe,EACf,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EACrD,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAC1B,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAoB,EAAE,QAAgB;IACjE,OAAO,aAAa,CAClB,gBAAgB,EAChB,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,EACpC,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY;IAC1B,WAAW,EAAE,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,IAAI,CAAC;QACH,WAAW,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC1B,IAAI,QAAQ,EAAE,CAAC;QACb,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,QAAQ,GAAG,KAAK,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,262 @@
1
+ /**
2
+ * FileFinder - High-level API for the fff file finder
3
+ *
4
+ * This class provides a type-safe, ergonomic API for file finding operations.
5
+ * Each instance owns an independent native file picker that can be created
6
+ * and destroyed independently. Multiple instances can coexist.
7
+ *
8
+ * All methods return Result types for explicit error handling.
9
+ */
10
+ import type { GrepOptions, GrepResult, HealthCheck, InitOptions, MultiGrepOptions, Result, ScanProgress, SearchOptions, SearchResult } from "./types.js";
11
+ /**
12
+ * FileFinder - Fast file finder with fuzzy search
13
+ *
14
+ * Each instance is backed by an independent native file picker. Create as many
15
+ * as you need and destroy them when done.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * import { FileFinder } from "@ff-labs/fff-node";
20
+ *
21
+ * // Create an instance
22
+ * const finder = FileFinder.create({ basePath: "/path/to/project" });
23
+ * if (!finder.ok) {
24
+ * console.error(finder.error);
25
+ * process.exit(1);
26
+ * }
27
+ *
28
+ * // Wait for initial scan
29
+ * finder.value.waitForScan(5000);
30
+ *
31
+ * // Search for files
32
+ * const search = finder.value.search("main.ts");
33
+ * if (search.ok) {
34
+ * for (const item of search.value.items) {
35
+ * console.log(item.relativePath);
36
+ * }
37
+ * }
38
+ *
39
+ * // Cleanup
40
+ * finder.value.destroy();
41
+ * ```
42
+ */
43
+ export declare class FileFinder {
44
+ private handle;
45
+ private constructor();
46
+ /**
47
+ * Create a new file finder instance.
48
+ *
49
+ * @param options - Initialization options
50
+ * @returns Result containing the new FileFinder instance or an error
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * // Basic initialization
55
+ * const finder = FileFinder.create({ basePath: "/path/to/project" });
56
+ *
57
+ * // With custom database paths
58
+ * const finder = FileFinder.create({
59
+ * basePath: "/path/to/project",
60
+ * frecencyDbPath: "/custom/frecency.mdb",
61
+ * historyDbPath: "/custom/history.mdb",
62
+ * });
63
+ * ```
64
+ */
65
+ static create(options: InitOptions): Result<FileFinder>;
66
+ /**
67
+ * Destroy and clean up all resources.
68
+ *
69
+ * Call this when you're done using the file finder to free memory
70
+ * and stop background file watching. After calling this, the instance
71
+ * must not be used again.
72
+ */
73
+ destroy(): void;
74
+ /**
75
+ * Check if this instance has been destroyed.
76
+ */
77
+ get isDestroyed(): boolean;
78
+ /**
79
+ * Guard that returns an error if the instance has been destroyed.
80
+ */
81
+ private ensureAlive;
82
+ /**
83
+ * Search for files matching the query.
84
+ *
85
+ * The query supports fuzzy matching and special syntax:
86
+ * - `foo bar` - Match files containing "foo" and "bar"
87
+ * - `src/` - Match files in src directory
88
+ * - `file.ts:42` - Match file.ts with line 42
89
+ * - `file.ts:42:10` - Match file.ts with line 42, column 10
90
+ *
91
+ * @param query - Search query string
92
+ * @param options - Search options
93
+ * @returns Search results with matched files and scores
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * const result = finder.search("main.ts", { pageSize: 10 });
98
+ * if (result.ok) {
99
+ * console.log(`Found ${result.value.totalMatched} files`);
100
+ * for (const item of result.value.items) {
101
+ * console.log(item.relativePath);
102
+ * }
103
+ * }
104
+ * ```
105
+ */
106
+ fileSearch(query: string, options?: SearchOptions): Result<SearchResult>;
107
+ /**
108
+ * Search file contents (live grep).
109
+ *
110
+ * Searches through the contents of indexed files using the specified mode:
111
+ * - `"plain"` (default): SIMD-accelerated literal text matching
112
+ * - `"regex"`: Regular expression matching
113
+ * - `"fuzzy"`: Smith-Waterman fuzzy matching per line
114
+ *
115
+ * Supports pagination for large result sets. The result includes a `nextCursor`
116
+ * that can be passed back to fetch the next page.
117
+ *
118
+ * The query also supports constraint syntax:
119
+ * - `*.ts pattern` - Only search in TypeScript files
120
+ * - `src/ pattern` - Only search in the src directory
121
+ *
122
+ * @param query - Search query string
123
+ * @param options - Grep options (mode, pagination, limits)
124
+ * @returns Grep results with matched lines and file metadata
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * // First page
129
+ * const result = finder.liveGrep("TODO", { mode: "plain" });
130
+ * if (result.ok) {
131
+ * for (const match of result.value.items) {
132
+ * console.log(`${match.relativePath}:${match.lineNumber}: ${match.lineContent}`);
133
+ * }
134
+ * // Fetch next page
135
+ * if (result.value.nextCursor) {
136
+ * const page2 = finder.liveGrep("TODO", {
137
+ * cursor: result.value.nextCursor,
138
+ * });
139
+ * }
140
+ * }
141
+ * ```
142
+ */
143
+ liveGrep(query: string, options?: GrepOptions): Result<GrepResult>;
144
+ /**
145
+ * Multi-pattern OR search using Aho-Corasick.
146
+ *
147
+ * Searches for lines matching ANY of the provided patterns using
148
+ * SIMD-accelerated multi-needle matching. Faster than regex alternation
149
+ * for literal text searches.
150
+ *
151
+ * Supports pagination. The result includes a `nextCursor` that can be
152
+ * passed back to fetch the next page.
153
+ *
154
+ * @param options - Multi-grep options including patterns and optional constraints
155
+ * @returns Grep results with matched lines and file metadata
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * const result = finder.multiGrep({
160
+ * patterns: ["VideoFrame", "video_frame", "PreloadedImage"],
161
+ * });
162
+ * if (result.ok) {
163
+ * for (const match of result.value.items) {
164
+ * console.log(`${match.relativePath}:${match.lineNumber}: ${match.lineContent}`);
165
+ * }
166
+ * }
167
+ * ```
168
+ */
169
+ multiGrep(options: MultiGrepOptions): Result<GrepResult>;
170
+ /**
171
+ * Trigger a rescan of the indexed directory.
172
+ *
173
+ * This is useful after major file system changes that the
174
+ * background watcher might have missed.
175
+ */
176
+ scanFiles(): Result<void>;
177
+ /**
178
+ * Check if a scan is currently in progress.
179
+ */
180
+ isScanning(): boolean;
181
+ /**
182
+ * Get the current scan progress.
183
+ */
184
+ getScanProgress(): Result<ScanProgress>;
185
+ /**
186
+ * Wait for the initial file scan to complete.
187
+ *
188
+ * @param timeoutMs - Maximum time to wait in milliseconds (default: 5000)
189
+ * @returns true if scan completed, false if timed out
190
+ *
191
+ * @example
192
+ * ```typescript
193
+ * const finder = FileFinder.create({ basePath: "/path/to/project" });
194
+ * if (finder.ok) {
195
+ * const completed = finder.value.waitForScan(10000);
196
+ * if (!completed.ok || !completed.value) {
197
+ * console.warn("Scan did not complete in time");
198
+ * }
199
+ * }
200
+ * ```
201
+ */
202
+ waitForScan(timeoutMs?: number): Result<boolean>;
203
+ /**
204
+ * Change the indexed directory to a new path.
205
+ *
206
+ * This stops the current file watcher and starts indexing the new directory.
207
+ *
208
+ * @param newPath - New directory path to index
209
+ */
210
+ reindex(newPath: string): Result<void>;
211
+ /**
212
+ * Refresh the git status cache.
213
+ *
214
+ * @returns Number of files with updated git status
215
+ */
216
+ refreshGitStatus(): Result<number>;
217
+ /**
218
+ * Track query completion for smart suggestions.
219
+ *
220
+ * Call this when a user selects a file from search results.
221
+ * This helps improve future search rankings for similar queries.
222
+ *
223
+ * @param query - The search query that was used
224
+ * @param selectedFilePath - The file path that was selected
225
+ */
226
+ trackQuery(query: string, selectedFilePath: string): Result<boolean>;
227
+ /**
228
+ * Get a historical query by offset.
229
+ *
230
+ * @param offset - Offset from most recent (0 = most recent)
231
+ * @returns The historical query string, or null if not found
232
+ */
233
+ getHistoricalQuery(offset: number): Result<string | null>;
234
+ /**
235
+ * Get health check information.
236
+ *
237
+ * Useful for debugging and verifying the file finder is working correctly.
238
+ *
239
+ * @param testPath - Optional path to test git repository detection
240
+ */
241
+ healthCheck(testPath?: string): Result<HealthCheck>;
242
+ /**
243
+ * Check if the native library is available.
244
+ */
245
+ static isAvailable(): boolean;
246
+ /**
247
+ * Ensure the native library is loaded.
248
+ *
249
+ * Loads the native library from the platform-specific npm package
250
+ * or a local dev build. Throws if the binary is not found.
251
+ */
252
+ static ensureLoaded(): void;
253
+ /**
254
+ * Get a health check without requiring an instance.
255
+ *
256
+ * Returns limited info (version + git only, no picker/frecency/query data).
257
+ *
258
+ * @param testPath - Optional path to test git repository detection
259
+ */
260
+ static healthCheckStatic(testPath?: string): Result<HealthCheck>;
261
+ }
262
+ //# sourceMappingURL=finder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finder.d.ts","sourceRoot":"","sources":["../../src/finder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAsBH,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,aAAa,EACb,YAAY,EACb,MAAM,YAAY,CAAC;AAWpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAsB;IAEpC,OAAO;IAIP;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;IAWvD;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;IAOf;;OAEG;IAC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MAAM,CAAC,YAAY,IAAI,IAAI;IAI3B;;;;;;OAMG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC;CAGjE"}
@@ -0,0 +1,376 @@
1
+ /**
2
+ * FileFinder - High-level API for the fff file finder
3
+ *
4
+ * This class provides a type-safe, ergonomic API for file finding operations.
5
+ * Each instance owns an independent native file picker that can be created
6
+ * and destroyed independently. Multiple instances can coexist.
7
+ *
8
+ * All methods return Result types for explicit error handling.
9
+ */
10
+ import { ensureLoaded, ffiCreate, ffiDestroy, ffiGetHistoricalQuery, ffiGetScanProgress, ffiHealthCheck, ffiIsScanning, ffiLiveGrep, ffiMultiGrep, ffiRefreshGitStatus, ffiRestartIndex, ffiScanFiles, ffiSearch, ffiTrackQuery, ffiWaitForScan, isAvailable, } from "./ffi.js";
11
+ import { createGrepCursor, err, toInternalGrepOptions, toInternalInitOptions, toInternalMultiGrepOptions, toInternalSearchOptions, } from "./types.js";
12
+ /**
13
+ * FileFinder - Fast file finder with fuzzy search
14
+ *
15
+ * Each instance is backed by an independent native file picker. Create as many
16
+ * as you need and destroy them when done.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import { FileFinder } from "@ff-labs/fff-node";
21
+ *
22
+ * // Create an instance
23
+ * const finder = FileFinder.create({ basePath: "/path/to/project" });
24
+ * if (!finder.ok) {
25
+ * console.error(finder.error);
26
+ * process.exit(1);
27
+ * }
28
+ *
29
+ * // Wait for initial scan
30
+ * finder.value.waitForScan(5000);
31
+ *
32
+ * // Search for files
33
+ * const search = finder.value.search("main.ts");
34
+ * if (search.ok) {
35
+ * for (const item of search.value.items) {
36
+ * console.log(item.relativePath);
37
+ * }
38
+ * }
39
+ *
40
+ * // Cleanup
41
+ * finder.value.destroy();
42
+ * ```
43
+ */
44
+ export class FileFinder {
45
+ handle;
46
+ constructor(handle) {
47
+ this.handle = handle;
48
+ }
49
+ /**
50
+ * Create a new file finder instance.
51
+ *
52
+ * @param options - Initialization options
53
+ * @returns Result containing the new FileFinder instance or an error
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * // Basic initialization
58
+ * const finder = FileFinder.create({ basePath: "/path/to/project" });
59
+ *
60
+ * // With custom database paths
61
+ * const finder = FileFinder.create({
62
+ * basePath: "/path/to/project",
63
+ * frecencyDbPath: "/custom/frecency.mdb",
64
+ * historyDbPath: "/custom/history.mdb",
65
+ * });
66
+ * ```
67
+ */
68
+ static create(options) {
69
+ const internalOpts = toInternalInitOptions(options);
70
+ const result = ffiCreate(JSON.stringify(internalOpts));
71
+ if (!result.ok) {
72
+ return result;
73
+ }
74
+ return { ok: true, value: new FileFinder(result.value) };
75
+ }
76
+ /**
77
+ * Destroy and clean up all resources.
78
+ *
79
+ * Call this when you're done using the file finder to free memory
80
+ * and stop background file watching. After calling this, the instance
81
+ * must not be used again.
82
+ */
83
+ destroy() {
84
+ if (this.handle !== null) {
85
+ ffiDestroy(this.handle);
86
+ this.handle = null;
87
+ }
88
+ }
89
+ /**
90
+ * Check if this instance has been destroyed.
91
+ */
92
+ get isDestroyed() {
93
+ return this.handle === null;
94
+ }
95
+ /**
96
+ * Guard that returns an error if the instance has been destroyed.
97
+ */
98
+ ensureAlive() {
99
+ if (this.handle === null) {
100
+ return err("FileFinder instance has been destroyed.");
101
+ }
102
+ return { ok: true, value: this.handle };
103
+ }
104
+ /**
105
+ * Search for files matching the query.
106
+ *
107
+ * The query supports fuzzy matching and special syntax:
108
+ * - `foo bar` - Match files containing "foo" and "bar"
109
+ * - `src/` - Match files in src directory
110
+ * - `file.ts:42` - Match file.ts with line 42
111
+ * - `file.ts:42:10` - Match file.ts with line 42, column 10
112
+ *
113
+ * @param query - Search query string
114
+ * @param options - Search options
115
+ * @returns Search results with matched files and scores
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * const result = finder.search("main.ts", { pageSize: 10 });
120
+ * if (result.ok) {
121
+ * console.log(`Found ${result.value.totalMatched} files`);
122
+ * for (const item of result.value.items) {
123
+ * console.log(item.relativePath);
124
+ * }
125
+ * }
126
+ * ```
127
+ */
128
+ fileSearch(query, options) {
129
+ const guard = this.ensureAlive();
130
+ if (!guard.ok)
131
+ return guard;
132
+ const internalOpts = toInternalSearchOptions(options);
133
+ const result = ffiSearch(guard.value, query, JSON.stringify(internalOpts));
134
+ if (!result.ok) {
135
+ return result;
136
+ }
137
+ return result;
138
+ }
139
+ /**
140
+ * Search file contents (live grep).
141
+ *
142
+ * Searches through the contents of indexed files using the specified mode:
143
+ * - `"plain"` (default): SIMD-accelerated literal text matching
144
+ * - `"regex"`: Regular expression matching
145
+ * - `"fuzzy"`: Smith-Waterman fuzzy matching per line
146
+ *
147
+ * Supports pagination for large result sets. The result includes a `nextCursor`
148
+ * that can be passed back to fetch the next page.
149
+ *
150
+ * The query also supports constraint syntax:
151
+ * - `*.ts pattern` - Only search in TypeScript files
152
+ * - `src/ pattern` - Only search in the src directory
153
+ *
154
+ * @param query - Search query string
155
+ * @param options - Grep options (mode, pagination, limits)
156
+ * @returns Grep results with matched lines and file metadata
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * // First page
161
+ * const result = finder.liveGrep("TODO", { mode: "plain" });
162
+ * if (result.ok) {
163
+ * for (const match of result.value.items) {
164
+ * console.log(`${match.relativePath}:${match.lineNumber}: ${match.lineContent}`);
165
+ * }
166
+ * // Fetch next page
167
+ * if (result.value.nextCursor) {
168
+ * const page2 = finder.liveGrep("TODO", {
169
+ * cursor: result.value.nextCursor,
170
+ * });
171
+ * }
172
+ * }
173
+ * ```
174
+ */
175
+ liveGrep(query, options) {
176
+ const guard = this.ensureAlive();
177
+ if (!guard.ok)
178
+ return guard;
179
+ const internalOpts = toInternalGrepOptions(options);
180
+ const result = ffiLiveGrep(guard.value, query, JSON.stringify(internalOpts));
181
+ return transformGrepResult(result);
182
+ }
183
+ /**
184
+ * Multi-pattern OR search using Aho-Corasick.
185
+ *
186
+ * Searches for lines matching ANY of the provided patterns using
187
+ * SIMD-accelerated multi-needle matching. Faster than regex alternation
188
+ * for literal text searches.
189
+ *
190
+ * Supports pagination. The result includes a `nextCursor` that can be
191
+ * passed back to fetch the next page.
192
+ *
193
+ * @param options - Multi-grep options including patterns and optional constraints
194
+ * @returns Grep results with matched lines and file metadata
195
+ *
196
+ * @example
197
+ * ```typescript
198
+ * const result = finder.multiGrep({
199
+ * patterns: ["VideoFrame", "video_frame", "PreloadedImage"],
200
+ * });
201
+ * if (result.ok) {
202
+ * for (const match of result.value.items) {
203
+ * console.log(`${match.relativePath}:${match.lineNumber}: ${match.lineContent}`);
204
+ * }
205
+ * }
206
+ * ```
207
+ */
208
+ multiGrep(options) {
209
+ const guard = this.ensureAlive();
210
+ if (!guard.ok)
211
+ return guard;
212
+ if (!options.patterns || options.patterns.length === 0) {
213
+ return err("patterns array must have at least 1 element");
214
+ }
215
+ const internalOpts = toInternalMultiGrepOptions(options);
216
+ const result = ffiMultiGrep(guard.value, JSON.stringify(internalOpts));
217
+ return transformGrepResult(result);
218
+ }
219
+ /**
220
+ * Trigger a rescan of the indexed directory.
221
+ *
222
+ * This is useful after major file system changes that the
223
+ * background watcher might have missed.
224
+ */
225
+ scanFiles() {
226
+ const guard = this.ensureAlive();
227
+ if (!guard.ok)
228
+ return guard;
229
+ return ffiScanFiles(guard.value);
230
+ }
231
+ /**
232
+ * Check if a scan is currently in progress.
233
+ */
234
+ isScanning() {
235
+ if (this.handle === null)
236
+ return false;
237
+ return ffiIsScanning(this.handle);
238
+ }
239
+ /**
240
+ * Get the current scan progress.
241
+ */
242
+ getScanProgress() {
243
+ const guard = this.ensureAlive();
244
+ if (!guard.ok)
245
+ return guard;
246
+ return ffiGetScanProgress(guard.value);
247
+ }
248
+ /**
249
+ * Wait for the initial file scan to complete.
250
+ *
251
+ * @param timeoutMs - Maximum time to wait in milliseconds (default: 5000)
252
+ * @returns true if scan completed, false if timed out
253
+ *
254
+ * @example
255
+ * ```typescript
256
+ * const finder = FileFinder.create({ basePath: "/path/to/project" });
257
+ * if (finder.ok) {
258
+ * const completed = finder.value.waitForScan(10000);
259
+ * if (!completed.ok || !completed.value) {
260
+ * console.warn("Scan did not complete in time");
261
+ * }
262
+ * }
263
+ * ```
264
+ */
265
+ waitForScan(timeoutMs = 5000) {
266
+ const guard = this.ensureAlive();
267
+ if (!guard.ok)
268
+ return guard;
269
+ return ffiWaitForScan(guard.value, timeoutMs);
270
+ }
271
+ /**
272
+ * Change the indexed directory to a new path.
273
+ *
274
+ * This stops the current file watcher and starts indexing the new directory.
275
+ *
276
+ * @param newPath - New directory path to index
277
+ */
278
+ reindex(newPath) {
279
+ const guard = this.ensureAlive();
280
+ if (!guard.ok)
281
+ return guard;
282
+ return ffiRestartIndex(guard.value, newPath);
283
+ }
284
+ /**
285
+ * Refresh the git status cache.
286
+ *
287
+ * @returns Number of files with updated git status
288
+ */
289
+ refreshGitStatus() {
290
+ const guard = this.ensureAlive();
291
+ if (!guard.ok)
292
+ return guard;
293
+ return ffiRefreshGitStatus(guard.value);
294
+ }
295
+ /**
296
+ * Track query completion for smart suggestions.
297
+ *
298
+ * Call this when a user selects a file from search results.
299
+ * This helps improve future search rankings for similar queries.
300
+ *
301
+ * @param query - The search query that was used
302
+ * @param selectedFilePath - The file path that was selected
303
+ */
304
+ trackQuery(query, selectedFilePath) {
305
+ const guard = this.ensureAlive();
306
+ if (!guard.ok)
307
+ return guard;
308
+ return ffiTrackQuery(guard.value, query, selectedFilePath);
309
+ }
310
+ /**
311
+ * Get a historical query by offset.
312
+ *
313
+ * @param offset - Offset from most recent (0 = most recent)
314
+ * @returns The historical query string, or null if not found
315
+ */
316
+ getHistoricalQuery(offset) {
317
+ const guard = this.ensureAlive();
318
+ if (!guard.ok)
319
+ return guard;
320
+ return ffiGetHistoricalQuery(guard.value, offset);
321
+ }
322
+ /**
323
+ * Get health check information.
324
+ *
325
+ * Useful for debugging and verifying the file finder is working correctly.
326
+ *
327
+ * @param testPath - Optional path to test git repository detection
328
+ */
329
+ healthCheck(testPath) {
330
+ return ffiHealthCheck(this.handle, testPath || "");
331
+ }
332
+ /**
333
+ * Check if the native library is available.
334
+ */
335
+ static isAvailable() {
336
+ return isAvailable();
337
+ }
338
+ /**
339
+ * Ensure the native library is loaded.
340
+ *
341
+ * Loads the native library from the platform-specific npm package
342
+ * or a local dev build. Throws if the binary is not found.
343
+ */
344
+ static ensureLoaded() {
345
+ ensureLoaded();
346
+ }
347
+ /**
348
+ * Get a health check without requiring an instance.
349
+ *
350
+ * Returns limited info (version + git only, no picker/frecency/query data).
351
+ *
352
+ * @param testPath - Optional path to test git repository detection
353
+ */
354
+ static healthCheckStatic(testPath) {
355
+ return ffiHealthCheck(null, testPath || "");
356
+ }
357
+ }
358
+ /** Transform raw FFI grep result into typed GrepResult with opaque cursor. */
359
+ function transformGrepResult(result) {
360
+ if (!result.ok) {
361
+ return result;
362
+ }
363
+ const raw = result.value;
364
+ const nextFileOffset = raw.nextFileOffset;
365
+ const grepResult = {
366
+ items: raw.items,
367
+ totalMatched: raw.totalMatched,
368
+ totalFilesSearched: raw.totalFilesSearched,
369
+ totalFiles: raw.totalFiles,
370
+ filteredFileCount: raw.filteredFileCount,
371
+ nextCursor: nextFileOffset > 0 ? createGrepCursor(nextFileOffset) : null,
372
+ regexFallbackError: raw.regexFallbackError,
373
+ };
374
+ return { ok: true, value: grepResult };
375
+ }
376
+ //# sourceMappingURL=finder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finder.js","sourceRoot":"","sources":["../../src/finder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,YAAY,EACZ,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,SAAS,EACT,aAAa,EACb,cAAc,EACd,WAAW,GAEZ,MAAM,UAAU,CAAC;AAclB,OAAO,EACL,gBAAgB,EAChB,GAAG,EACH,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