@ff-labs/fff-bun 0.6.3-nightly.1b79eec → 0.6.3
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/package.json +9 -9
- package/src/ffi.ts +17 -2
- package/src/finder.ts +5 -0
- package/src/types.ts +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ff-labs/fff-bun",
|
|
3
|
-
"version": "0.6.3
|
|
3
|
+
"version": "0.6.3",
|
|
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.6.3
|
|
66
|
-
"@ff-labs/fff-bin-darwin-x64": "0.6.3
|
|
67
|
-
"@ff-labs/fff-bin-linux-x64-gnu": "0.6.3
|
|
68
|
-
"@ff-labs/fff-bin-linux-arm64-gnu": "0.6.3
|
|
69
|
-
"@ff-labs/fff-bin-linux-x64-musl": "0.6.3
|
|
70
|
-
"@ff-labs/fff-bin-linux-arm64-musl": "0.6.3
|
|
71
|
-
"@ff-labs/fff-bin-win32-x64": "0.6.3
|
|
72
|
-
"@ff-labs/fff-bin-win32-arm64": "0.6.3
|
|
65
|
+
"@ff-labs/fff-bin-darwin-arm64": "0.6.3",
|
|
66
|
+
"@ff-labs/fff-bin-darwin-x64": "0.6.3",
|
|
67
|
+
"@ff-labs/fff-bin-linux-x64-gnu": "0.6.3",
|
|
68
|
+
"@ff-labs/fff-bin-linux-arm64-gnu": "0.6.3",
|
|
69
|
+
"@ff-labs/fff-bin-linux-x64-musl": "0.6.3",
|
|
70
|
+
"@ff-labs/fff-bin-linux-arm64-musl": "0.6.3",
|
|
71
|
+
"@ff-labs/fff-bin-win32-x64": "0.6.3",
|
|
72
|
+
"@ff-labs/fff-bin-win32-arm64": "0.6.3"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/bun": "^1.3.8",
|
package/src/ffi.ts
CHANGED
|
@@ -44,7 +44,7 @@ function grepModeToU8(mode?: string): number {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const ffiDefinition = {
|
|
47
|
-
|
|
47
|
+
fff_create_instance2: {
|
|
48
48
|
args: [
|
|
49
49
|
FFIType.cstring, // base_path
|
|
50
50
|
FFIType.cstring, // frecency_db_path
|
|
@@ -54,6 +54,11 @@ const ffiDefinition = {
|
|
|
54
54
|
FFIType.bool, // enable_content_indexing
|
|
55
55
|
FFIType.bool, // watch
|
|
56
56
|
FFIType.bool, // ai_mode
|
|
57
|
+
FFIType.cstring, // log_file_path
|
|
58
|
+
FFIType.cstring, // log_level
|
|
59
|
+
FFIType.u64, // cache_budget_max_files
|
|
60
|
+
FFIType.u64, // cache_budget_max_bytes
|
|
61
|
+
FFIType.u64, // cache_budget_max_file_size
|
|
57
62
|
],
|
|
58
63
|
returns: FFIType.ptr,
|
|
59
64
|
},
|
|
@@ -425,9 +430,14 @@ export function ffiCreate(
|
|
|
425
430
|
enableContentIndexing: boolean,
|
|
426
431
|
watch: boolean,
|
|
427
432
|
aiMode: boolean,
|
|
433
|
+
logFilePath: string,
|
|
434
|
+
logLevel: string,
|
|
435
|
+
cacheBudgetMaxFiles: bigint,
|
|
436
|
+
cacheBudgetMaxBytes: bigint,
|
|
437
|
+
cacheBudgetMaxFileSize: bigint,
|
|
428
438
|
): Result<NativeHandle> {
|
|
429
439
|
const library = loadLibrary();
|
|
430
|
-
const resultPtr = library.symbols.
|
|
440
|
+
const resultPtr = library.symbols.fff_create_instance2(
|
|
431
441
|
ptr(encodeString(basePath)),
|
|
432
442
|
ptr(encodeString(frecencyDbPath)),
|
|
433
443
|
ptr(encodeString(historyDbPath)),
|
|
@@ -436,6 +446,11 @@ export function ffiCreate(
|
|
|
436
446
|
enableContentIndexing,
|
|
437
447
|
watch,
|
|
438
448
|
aiMode,
|
|
449
|
+
ptr(encodeString(logFilePath)),
|
|
450
|
+
ptr(encodeString(logLevel)),
|
|
451
|
+
cacheBudgetMaxFiles,
|
|
452
|
+
cacheBudgetMaxBytes,
|
|
453
|
+
cacheBudgetMaxFileSize,
|
|
439
454
|
);
|
|
440
455
|
|
|
441
456
|
if (resultPtr === null) {
|
package/src/finder.ts
CHANGED
|
@@ -117,6 +117,11 @@ export class FileFinder {
|
|
|
117
117
|
!(options.disableContentIndexing ?? options.disableMmapCache ?? false),
|
|
118
118
|
!(options.disableWatch ?? false),
|
|
119
119
|
options.aiMode ?? false,
|
|
120
|
+
options.logFilePath ?? "",
|
|
121
|
+
options.logLevel ?? "",
|
|
122
|
+
BigInt(options.cacheBudgetMaxFiles ?? 0),
|
|
123
|
+
BigInt(options.cacheBudgetMaxBytes ?? 0),
|
|
124
|
+
BigInt(options.cacheBudgetMaxFileSize ?? 0),
|
|
120
125
|
);
|
|
121
126
|
|
|
122
127
|
if (!result.ok) {
|
package/src/types.ts
CHANGED
|
@@ -50,6 +50,26 @@ export interface InitOptions {
|
|
|
50
50
|
disableWatch?: boolean;
|
|
51
51
|
/** enables optimizations for AI agent assistants. Provide as true if running via mcp/agent */
|
|
52
52
|
aiMode?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Path to the tracing log file. When set, the shared FFF tracing subscriber
|
|
55
|
+
* is installed on first init and file output is written here. Omit to leave
|
|
56
|
+
* logging uninitialized.
|
|
57
|
+
*/
|
|
58
|
+
logFilePath?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Log level for the tracing subscriber: "trace", "debug", "info", "warn",
|
|
61
|
+
* or "error". Defaults to "info". Ignored when `logFilePath` is not set.
|
|
62
|
+
*/
|
|
63
|
+
logLevel?: "trace" | "debug" | "info" | "warn" | "error";
|
|
64
|
+
/**
|
|
65
|
+
* Override for the content cache file-count cap. When omitted, the picker
|
|
66
|
+
* auto-sizes the budget from the final scanned file count.
|
|
67
|
+
*/
|
|
68
|
+
cacheBudgetMaxFiles?: number;
|
|
69
|
+
/** Override for the content cache byte cap. See `cacheBudgetMaxFiles`. */
|
|
70
|
+
cacheBudgetMaxBytes?: number;
|
|
71
|
+
/** Override for the per-file byte cap in the content cache. */
|
|
72
|
+
cacheBudgetMaxFileSize?: number;
|
|
53
73
|
}
|
|
54
74
|
|
|
55
75
|
/**
|