@cmmd-center/forge 0.13.6 → 0.13.8
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/dist/{BunHttpServer-DKvSpNd1.cjs → BunHttpServer-C7-1JJ7b.cjs} +4 -4
- package/dist/{BunHttpServer-CDh4Vioe.mjs → BunHttpServer-CVPGkizx.mjs} +4 -4
- package/dist/{BunServices-D6PAheqS.mjs → BunServices-CPrZSIfE.mjs} +2 -2
- package/dist/{BunServices-DDh7Whyx.cjs → BunServices-Dl-3897e.cjs} +2 -2
- package/dist/{Cache-BVilO50s.mjs → Cache-C9cwdCDt.mjs} +2 -2
- package/dist/{Cache-DCF22Dfk.cjs → Cache-Cf3ARNaS.cjs} +2 -2
- package/dist/{HttpServer-ClsGgAq1.mjs → HttpServer-COaBeM7-.mjs} +2 -2
- package/dist/{HttpServer-D1gSU7NX.cjs → HttpServer-CggZzScj.cjs} +3 -3
- package/dist/{NodeHttpServer-Dfc7nSMq.cjs → NodeHttpServer-Bi339XFk.cjs} +5 -5
- package/dist/{NodeHttpServer-DT0TF8s4.mjs → NodeHttpServer-UQnvZnmu.mjs} +5 -5
- package/dist/{NodePTY-loxi8Vku.mjs → NodePTY-B1u6RHXk.mjs} +2 -2
- package/dist/{NodePTY-S4tPEwZc.cjs → NodePTY-UOaRyQsj.cjs} +2 -2
- package/dist/{NodeServices-Cb0rXFb2.cjs → NodeServices-CKFIZVu5.cjs} +2 -2
- package/dist/{NodeServices-DE8jhdcU.cjs → NodeServices-R0BZsZ72.cjs} +1 -1
- package/dist/{NodeServices-BahzLhbo.mjs → NodeServices-z1Ac4lEO.mjs} +2 -2
- package/dist/{NodeSqliteClient-DqFjB3u_.mjs → NodeSqliteClient-BrzqdOsF.mjs} +4 -4
- package/dist/{NodeSqliteClient-qjBWAOGq.cjs → NodeSqliteClient-CyJvo9y9.cjs} +4 -4
- package/dist/{NodeTerminal-rYbifme7.cjs → NodeTerminal-B89MobLp.cjs} +2 -2
- package/dist/{NodeTerminal-BPw7bktz.mjs → NodeTerminal-pYVVRTiD.mjs} +2 -2
- package/dist/{Path-CGCc_dDx.cjs → Path-BunGrE8F.cjs} +72 -1
- package/dist/{Path-C851t6sC.mjs → Path-evOm-H0Q.mjs} +61 -2
- package/dist/{SqlError-CzB6p9lL.cjs → SqlError-1wIMjXAf.cjs} +2 -2
- package/dist/{SqlError-3aqibZrj.mjs → SqlError-CezTFGvr.mjs} +2 -2
- package/dist/{SqliteClient-DTWCGkrj.mjs → SqliteClient-D3Yd3ZHn.mjs} +3 -3
- package/dist/{SqliteClient-Cq1peWN1.cjs → SqliteClient-bo7iui1t.cjs} +3 -3
- package/dist/bin.cjs +4875 -3961
- package/dist/bin.mjs +4422 -3514
- package/dist/client/assets/{CanvasPanel-BwSV27Ct.js → CanvasPanel-z0F-jdf1.js} +2 -2
- package/dist/client/assets/{CompositeItem-CZk3X-ud.js → CompositeItem-P9UVXCKv.js} +2 -2
- package/dist/client/assets/DiffPanel-CBfeDIH3.js +64 -0
- package/dist/client/assets/{DiffPanel.logic-D-SDgBF9.js → DiffPanel.logic-CZdlskWf.js} +2 -2
- package/dist/client/assets/DiffPanelShell-BnSbIo9A.js +2532 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-BO_xUE3R.js → DiffWorkerPoolProvider-DC4SN57K.js} +9 -9
- package/dist/client/assets/{PullRequestCodePanel-CW4RK1Oa.js → PullRequestCodePanel-DwjjRPkc.js} +3 -3
- package/dist/client/assets/Virtualizer-ClYwoP30.js +2 -0
- package/dist/client/assets/{canvasStateStore-5DH2Z-PG.js → canvasStateStore-CdQxd2aO.js} +2 -2
- package/dist/client/assets/cmmdAuthRedirect-Bp1uQaQ9.js +2 -0
- package/dist/client/assets/index-BE83u7Db.css +1 -0
- package/dist/client/assets/index-CZhTqk2p.js +153 -0
- package/dist/client/assets/{popover-Dxp_1Sz0.js → popover-CUSlb3eK.js} +2 -2
- package/dist/client/assets/src-BL-mOkT1.js +3 -0
- package/dist/client/assets/{toggle-B-GE6jq_.js → toggle-BREV66nT.js} +2 -2
- package/dist/client/index.html +11 -11
- package/dist/forge-build.json +1 -1
- package/dist/node_modules/@ff-labs/fff-bin-linux-x64-gnu/libfff_c.so +0 -0
- package/dist/node_modules/@ff-labs/fff-bin-linux-x64-gnu/package.json +27 -0
- package/dist/node_modules/@ff-labs/fff-node/.bun-tag-689ffe3747e13d19 +0 -0
- package/dist/node_modules/@ff-labs/fff-node/README.md +126 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/binary.d.ts +22 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/binary.js +144 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/fff-api.d.ts +581 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/fff-api.js +24 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/ffi.d.ts +137 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/ffi.js +1191 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/finder.d.ts +353 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/finder.js +488 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/index.d.ts +47 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/index.js +47 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/platform.d.ts +27 -0
- package/dist/node_modules/@ff-labs/fff-node/dist/src/platform.js +120 -0
- package/dist/node_modules/@ff-labs/fff-node/package.json +76 -0
- package/dist/node_modules/@yuuang/ffi-rs-linux-x64-gnu/README.md +794 -0
- package/dist/node_modules/@yuuang/ffi-rs-linux-x64-gnu/ffi-rs.linux-x64-gnu.node +0 -0
- package/dist/node_modules/@yuuang/ffi-rs-linux-x64-gnu/package.json +21 -0
- package/dist/node_modules/ffi-rs/LICENSE +21 -0
- package/dist/node_modules/ffi-rs/README.md +794 -0
- package/dist/node_modules/ffi-rs/index.d.ts +222 -0
- package/dist/node_modules/ffi-rs/index.js +380 -0
- package/dist/node_modules/ffi-rs/package.json +76 -0
- package/dist/{open-FIgTDosf.mjs → open-D8mGyWmt.mjs} +3 -3
- package/package.json +2 -1
- package/dist/client/assets/DiffPanel-ixzJ8GwW.js +0 -64
- package/dist/client/assets/DiffPanelShell-Dz5Wvcvi.js +0 -2532
- package/dist/client/assets/cmmdAuthRedirect-D68LO-sw.js +0 -2
- package/dist/client/assets/diffTargetResolution-WqxwJEax.js +0 -2
- package/dist/client/assets/index-DivaIsZ4.css +0 -1
- package/dist/client/assets/index-UXWCtM6c.js +0 -153
- package/dist/client/assets/src-n5cTLVWV.js +0 -3
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js FFI bindings for the fff-c native library using ffi-rs
|
|
3
|
+
*
|
|
4
|
+
* This module uses ffi-rs to call into the Rust C library.
|
|
5
|
+
* All functions follow the Result pattern for error handling.
|
|
6
|
+
*
|
|
7
|
+
* The API is instance-based: `ffiCreate` returns an opaque handle that must
|
|
8
|
+
* be passed to all subsequent calls and freed with `ffiDestroy`.
|
|
9
|
+
*
|
|
10
|
+
* ## Memory management
|
|
11
|
+
*
|
|
12
|
+
* Every `fff_*` function returning `*mut FffResult` allocates with Rust's Box.
|
|
13
|
+
* We MUST call `fff_free_result` to properly deallocate (not libc::free).
|
|
14
|
+
*
|
|
15
|
+
* ## FffResult struct reading
|
|
16
|
+
*
|
|
17
|
+
* The FffResult struct layout (#[repr(C)]):
|
|
18
|
+
* offset 0: success (bool, 1 byte + 7 padding)
|
|
19
|
+
* offset 8: data pointer (8 bytes) - *mut c_char (JSON string or null)
|
|
20
|
+
* offset 16: error pointer (8 bytes) - *mut c_char (error message or null)
|
|
21
|
+
* offset 24: handle pointer (8 bytes) - *mut c_void (instance handle or null)
|
|
22
|
+
*
|
|
23
|
+
* ## Two-step approach for reading + freeing
|
|
24
|
+
*
|
|
25
|
+
* ffi-rs auto-dereferences struct retType pointers, losing the original pointer.
|
|
26
|
+
* We solve this by:
|
|
27
|
+
* 1. Calling the C function with `retType: DataType.External` to get the raw pointer
|
|
28
|
+
* 2. Using `restorePointer` to read the struct fields from the raw pointer
|
|
29
|
+
* 3. Calling `fff_free_result` with the original raw pointer
|
|
30
|
+
*
|
|
31
|
+
* ## Null pointer detection
|
|
32
|
+
*
|
|
33
|
+
* `isNullPointer` from ffi-rs correctly detects null C pointers wrapped as
|
|
34
|
+
* V8 External objects. We use this instead of truthy checks.
|
|
35
|
+
*/
|
|
36
|
+
import { type JsExternal } from "ffi-rs";
|
|
37
|
+
import type { DirSearchResult, GrepResult, MixedSearchResult, Result, SearchResult } from "./fff-api.js";
|
|
38
|
+
/**
|
|
39
|
+
* Opaque native handle type. Callers must not inspect or modify this value.
|
|
40
|
+
*/
|
|
41
|
+
export type NativeHandle = JsExternal;
|
|
42
|
+
export declare function ffiCreate(basePath: string, frecencyDbPath: string, historyDbPath: string, _useUnsafeNoLock: boolean, enableMmapCache: boolean, enableContentIndexing: boolean, watch: boolean, aiMode: boolean, logFilePath: string, logLevel: string, cacheBudgetMaxFiles: number, cacheBudgetMaxBytes: number, cacheBudgetMaxFileSize: number, enableFsRootScanning: boolean, enableHomeDirScanning: boolean): Result<NativeHandle>;
|
|
43
|
+
/**
|
|
44
|
+
* Destroy and clean up an instance.
|
|
45
|
+
*/
|
|
46
|
+
export declare function ffiDestroy(handle: NativeHandle): void;
|
|
47
|
+
/**
|
|
48
|
+
* Perform fuzzy search.
|
|
49
|
+
*/
|
|
50
|
+
export declare function ffiSearch(handle: NativeHandle, query: string, currentFile: string, maxThreads: number, pageIndex: number, pageSize: number, comboBoostMultiplier: number, minComboCount: number): Result<SearchResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Glob-only search. Bypasses the regular query parser, applies the pattern
|
|
53
|
+
* as a single `Constraint::Glob`, ranks by frecency, paginates.
|
|
54
|
+
*/
|
|
55
|
+
export declare function ffiGlob(handle: NativeHandle, pattern: string, currentFile: string, maxThreads: number, pageIndex: number, pageSize: number): Result<SearchResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Perform fuzzy directory search.
|
|
58
|
+
*/
|
|
59
|
+
export declare function ffiSearchDirectories(handle: NativeHandle, query: string, currentFile: string | null, maxThreads: number, pageIndex: number, pageSize: number): Result<DirSearchResult>;
|
|
60
|
+
/**
|
|
61
|
+
* Perform mixed (files + directories) fuzzy search.
|
|
62
|
+
*/
|
|
63
|
+
export declare function ffiSearchMixed(handle: NativeHandle, query: string, currentFile: string, maxThreads: number, pageIndex: number, pageSize: number, comboBoostMultiplier: number, minComboCount: number): Result<MixedSearchResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Live grep - search file contents.
|
|
66
|
+
*/
|
|
67
|
+
export declare function ffiLiveGrep(handle: NativeHandle, query: string, mode: string, maxFileSize: number, maxMatchesPerFile: number, smartCase: boolean, fileOffset: number, pageLimit: number, timeBudgetMs: number, beforeContext: number, afterContext: number, classifyDefinitions: boolean): Result<GrepResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Multi-pattern grep - Aho-Corasick multi-needle search.
|
|
70
|
+
*/
|
|
71
|
+
export declare function ffiMultiGrep(handle: NativeHandle, patternsJoined: string, constraints: string, maxFileSize: number, maxMatchesPerFile: number, smartCase: boolean, fileOffset: number, pageLimit: number, timeBudgetMs: number, beforeContext: number, afterContext: number, classifyDefinitions: boolean): Result<GrepResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Trigger file scan.
|
|
74
|
+
*/
|
|
75
|
+
export declare function ffiScanFiles(handle: NativeHandle): Result<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Check if scanning.
|
|
78
|
+
*/
|
|
79
|
+
export declare function ffiIsScanning(handle: NativeHandle): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Get the base path of the file picker.
|
|
82
|
+
*/
|
|
83
|
+
export declare function ffiGetBasePath(handle: NativeHandle): Result<string | null>;
|
|
84
|
+
/**
|
|
85
|
+
* Get scan progress.
|
|
86
|
+
*/
|
|
87
|
+
export declare function ffiGetScanProgress(handle: NativeHandle): Result<{
|
|
88
|
+
scannedFilesCount: number;
|
|
89
|
+
isScanning: boolean;
|
|
90
|
+
isWatcherReady: boolean;
|
|
91
|
+
isWarmupComplete: boolean;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* Wait for a tree scan to complete.
|
|
95
|
+
*/
|
|
96
|
+
export declare function ffiWaitForScan(handle: NativeHandle, timeoutMs: number): Result<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* Restart index in new path.
|
|
99
|
+
*/
|
|
100
|
+
export declare function ffiRestartIndex(handle: NativeHandle, newPath: string): Result<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Refresh git status.
|
|
103
|
+
*/
|
|
104
|
+
export declare function ffiRefreshGitStatus(handle: NativeHandle): Result<number>;
|
|
105
|
+
/**
|
|
106
|
+
* Track query completion.
|
|
107
|
+
*/
|
|
108
|
+
export declare function ffiTrackQuery(handle: NativeHandle, query: string, filePath: string): Result<boolean>;
|
|
109
|
+
/**
|
|
110
|
+
* Get historical query.
|
|
111
|
+
*/
|
|
112
|
+
export declare function ffiGetHistoricalQuery(handle: NativeHandle, offset: number): Result<string | null>;
|
|
113
|
+
/**
|
|
114
|
+
* Health check.
|
|
115
|
+
*
|
|
116
|
+
* `handle` can be null for a limited check (version + git only).
|
|
117
|
+
* When null, we pass DataType.U64 with value 0 as a null pointer workaround
|
|
118
|
+
* since ffi-rs does not accept `null` for External parameters.
|
|
119
|
+
*/
|
|
120
|
+
export declare function ffiHealthCheck(handle: NativeHandle | null, testPath: string): Result<unknown>;
|
|
121
|
+
/**
|
|
122
|
+
* Ensure the library is loaded.
|
|
123
|
+
*
|
|
124
|
+
* Loads the native library from the platform-specific npm package
|
|
125
|
+
* or a local dev build. Throws if the binary is not found.
|
|
126
|
+
*/
|
|
127
|
+
export declare function ensureLoaded(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Check if the library is available.
|
|
130
|
+
*/
|
|
131
|
+
export declare function isAvailable(): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Close the library and release ffi-rs resources.
|
|
134
|
+
* Call this when completely done with the library.
|
|
135
|
+
*/
|
|
136
|
+
export declare function closeLibrary(): void;
|
|
137
|
+
//# sourceMappingURL=ffi.d.ts.map
|