@ff-labs/fff-bun 0.5.3-nightly.ed4c608 → 0.6.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.
- package/examples/grep.ts +0 -1
- package/package.json +9 -9
- package/src/ffi.ts +9 -3
- package/src/finder.ts +5 -3
- package/src/types.ts +16 -4
package/examples/grep.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ff-labs/fff-bun",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "High-performance fuzzy file finder for Bun - perfect for LLM agent tools",
|
|
6
6
|
"type": "module",
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://github.com/dmtrKovalenko/fff.nvim#readme",
|
|
64
64
|
"optionalDependencies": {
|
|
65
|
-
"@ff-labs/fff-bin-darwin-arm64": "0.
|
|
66
|
-
"@ff-labs/fff-bin-darwin-x64": "0.
|
|
67
|
-
"@ff-labs/fff-bin-linux-x64-gnu": "0.
|
|
68
|
-
"@ff-labs/fff-bin-linux-arm64-gnu": "0.
|
|
69
|
-
"@ff-labs/fff-bin-linux-x64-musl": "0.
|
|
70
|
-
"@ff-labs/fff-bin-linux-arm64-musl": "0.
|
|
71
|
-
"@ff-labs/fff-bin-win32-x64": "0.
|
|
72
|
-
"@ff-labs/fff-bin-win32-arm64": "0.
|
|
65
|
+
"@ff-labs/fff-bin-darwin-arm64": "0.6.0",
|
|
66
|
+
"@ff-labs/fff-bin-darwin-x64": "0.6.0",
|
|
67
|
+
"@ff-labs/fff-bin-linux-x64-gnu": "0.6.0",
|
|
68
|
+
"@ff-labs/fff-bin-linux-arm64-gnu": "0.6.0",
|
|
69
|
+
"@ff-labs/fff-bin-linux-x64-musl": "0.6.0",
|
|
70
|
+
"@ff-labs/fff-bin-linux-arm64-musl": "0.6.0",
|
|
71
|
+
"@ff-labs/fff-bin-win32-x64": "0.6.0",
|
|
72
|
+
"@ff-labs/fff-bin-win32-arm64": "0.6.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/bun": "^1.3.8",
|
package/src/ffi.ts
CHANGED
|
@@ -50,7 +50,9 @@ const ffiDefinition = {
|
|
|
50
50
|
FFIType.cstring, // frecency_db_path
|
|
51
51
|
FFIType.cstring, // history_db_path
|
|
52
52
|
FFIType.bool, // use_unsafe_no_lock
|
|
53
|
-
FFIType.bool, //
|
|
53
|
+
FFIType.bool, // enable_mmap_cache
|
|
54
|
+
FFIType.bool, // enable_content_indexing
|
|
55
|
+
FFIType.bool, // watch
|
|
54
56
|
FFIType.bool, // ai_mode
|
|
55
57
|
],
|
|
56
58
|
returns: FFIType.ptr,
|
|
@@ -419,7 +421,9 @@ export function ffiCreate(
|
|
|
419
421
|
frecencyDbPath: string,
|
|
420
422
|
historyDbPath: string,
|
|
421
423
|
useUnsafeNoLock: boolean,
|
|
422
|
-
|
|
424
|
+
enableMmapCache: boolean,
|
|
425
|
+
enableContentIndexing: boolean,
|
|
426
|
+
watch: boolean,
|
|
423
427
|
aiMode: boolean,
|
|
424
428
|
): Result<NativeHandle> {
|
|
425
429
|
const library = loadLibrary();
|
|
@@ -428,7 +432,9 @@ export function ffiCreate(
|
|
|
428
432
|
ptr(encodeString(frecencyDbPath)),
|
|
429
433
|
ptr(encodeString(historyDbPath)),
|
|
430
434
|
useUnsafeNoLock,
|
|
431
|
-
|
|
435
|
+
enableMmapCache,
|
|
436
|
+
enableContentIndexing,
|
|
437
|
+
watch,
|
|
432
438
|
aiMode,
|
|
433
439
|
);
|
|
434
440
|
|
package/src/finder.ts
CHANGED
|
@@ -38,7 +38,7 @@ import type {
|
|
|
38
38
|
GrepOptions,
|
|
39
39
|
GrepResult,
|
|
40
40
|
HealthCheck,
|
|
41
|
-
InitOptions,
|
|
41
|
+
InitOptions as FFFInitOptions,
|
|
42
42
|
MixedSearchResult,
|
|
43
43
|
MultiGrepOptions,
|
|
44
44
|
Result,
|
|
@@ -107,13 +107,15 @@ export class FileFinder {
|
|
|
107
107
|
* });
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
110
|
-
static create(options:
|
|
110
|
+
static create(options: FFFInitOptions): Result<FileFinder> {
|
|
111
111
|
const result = ffiCreate(
|
|
112
112
|
options.basePath,
|
|
113
113
|
options.frecencyDbPath ?? "",
|
|
114
114
|
options.historyDbPath ?? "",
|
|
115
115
|
options.useUnsafeNoLock ?? false,
|
|
116
|
-
options.
|
|
116
|
+
!(options.disableMmapCache ?? false),
|
|
117
|
+
!(options.disableContentIndexing ?? options.disableMmapCache ?? false),
|
|
118
|
+
!(options.disableWatch ?? false),
|
|
117
119
|
options.aiMode ?? false,
|
|
118
120
|
);
|
|
119
121
|
|
package/src/types.ts
CHANGED
|
@@ -30,12 +30,24 @@ export interface InitOptions {
|
|
|
30
30
|
/** Use unsafe no-lock mode for databases (optional, defaults to false) */
|
|
31
31
|
useUnsafeNoLock?: boolean;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* at the cost of
|
|
33
|
+
* Disable mmap cache warmup after the initial scan. When mmap cache is
|
|
34
|
+
* enabled (the default), the first grep search is as fast as subsequent
|
|
35
|
+
* ones at the cost of background resources spent on awarming up the cache
|
|
36
|
+
*/
|
|
37
|
+
disableMmapCache?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Disable the content index built after the initial scan.
|
|
40
|
+
* Content indexing enables faster content-aware filtering during grep.
|
|
41
|
+
* When omitted, follows `disableMmapCache` for backward compatibility.
|
|
42
|
+
* (default: follows `disableMmapCache`)
|
|
43
|
+
*/
|
|
44
|
+
disableContentIndexing?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Disable the background file-system watcher. When the watcher is
|
|
47
|
+
* disabled, files are scanned once but not monitored for changes.
|
|
36
48
|
* (default: false)
|
|
37
49
|
*/
|
|
38
|
-
|
|
50
|
+
disableWatch?: boolean;
|
|
39
51
|
/** enables optimizations for AI agent assistants. Provide as true if running via mcp/agent */
|
|
40
52
|
aiMode?: boolean;
|
|
41
53
|
}
|