@cmmd-center/forge 0.13.5 → 0.13.7

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.
Files changed (78) hide show
  1. package/dist/{BunHttpServer-DKvSpNd1.cjs → BunHttpServer-C7-1JJ7b.cjs} +4 -4
  2. package/dist/{BunHttpServer-CDh4Vioe.mjs → BunHttpServer-CVPGkizx.mjs} +4 -4
  3. package/dist/{BunServices-D6PAheqS.mjs → BunServices-CPrZSIfE.mjs} +2 -2
  4. package/dist/{BunServices-DDh7Whyx.cjs → BunServices-Dl-3897e.cjs} +2 -2
  5. package/dist/{Cache-BVilO50s.mjs → Cache-C9cwdCDt.mjs} +2 -2
  6. package/dist/{Cache-DCF22Dfk.cjs → Cache-Cf3ARNaS.cjs} +2 -2
  7. package/dist/{HttpServer-ClsGgAq1.mjs → HttpServer-COaBeM7-.mjs} +2 -2
  8. package/dist/{HttpServer-D1gSU7NX.cjs → HttpServer-CggZzScj.cjs} +3 -3
  9. package/dist/{NodeHttpServer-Dfc7nSMq.cjs → NodeHttpServer-Bi339XFk.cjs} +5 -5
  10. package/dist/{NodeHttpServer-DT0TF8s4.mjs → NodeHttpServer-UQnvZnmu.mjs} +5 -5
  11. package/dist/{NodePTY-loxi8Vku.mjs → NodePTY-B1u6RHXk.mjs} +2 -2
  12. package/dist/{NodePTY-S4tPEwZc.cjs → NodePTY-UOaRyQsj.cjs} +2 -2
  13. package/dist/{NodeServices-Cb0rXFb2.cjs → NodeServices-CKFIZVu5.cjs} +2 -2
  14. package/dist/{NodeServices-DE8jhdcU.cjs → NodeServices-R0BZsZ72.cjs} +1 -1
  15. package/dist/{NodeServices-BahzLhbo.mjs → NodeServices-z1Ac4lEO.mjs} +2 -2
  16. package/dist/{NodeSqliteClient-DqFjB3u_.mjs → NodeSqliteClient-BrzqdOsF.mjs} +4 -4
  17. package/dist/{NodeSqliteClient-qjBWAOGq.cjs → NodeSqliteClient-CyJvo9y9.cjs} +4 -4
  18. package/dist/{NodeTerminal-rYbifme7.cjs → NodeTerminal-B89MobLp.cjs} +2 -2
  19. package/dist/{NodeTerminal-BPw7bktz.mjs → NodeTerminal-pYVVRTiD.mjs} +2 -2
  20. package/dist/{Path-CGCc_dDx.cjs → Path-BunGrE8F.cjs} +72 -1
  21. package/dist/{Path-C851t6sC.mjs → Path-evOm-H0Q.mjs} +61 -2
  22. package/dist/{SqlError-CzB6p9lL.cjs → SqlError-1wIMjXAf.cjs} +2 -2
  23. package/dist/{SqlError-3aqibZrj.mjs → SqlError-CezTFGvr.mjs} +2 -2
  24. package/dist/{SqliteClient-DTWCGkrj.mjs → SqliteClient-D3Yd3ZHn.mjs} +3 -3
  25. package/dist/{SqliteClient-Cq1peWN1.cjs → SqliteClient-bo7iui1t.cjs} +3 -3
  26. package/dist/bin.cjs +4819 -3952
  27. package/dist/bin.mjs +4357 -3496
  28. package/dist/client/assets/{CanvasPanel-BwSV27Ct.js → CanvasPanel-C21OO2qi.js} +2 -2
  29. package/dist/client/assets/{CompositeItem-CZk3X-ud.js → CompositeItem-naFGUtSL.js} +2 -2
  30. package/dist/client/assets/{DiffPanel-BeCVuoWI.js → DiffPanel-D_YC838v.js} +3 -3
  31. package/dist/client/assets/{DiffPanel.logic-DUE8JeYc.js → DiffPanel.logic-Bqk_6nE1.js} +2 -2
  32. package/dist/client/assets/DiffPanelShell-D1KMJc9z.js +2532 -0
  33. package/dist/client/assets/{DiffWorkerPoolProvider-Co6F91_V.js → DiffWorkerPoolProvider-B5tF5UEc.js} +10 -10
  34. package/dist/client/assets/PullRequestCodePanel-ClD3ZXbi.js +5 -0
  35. package/dist/client/assets/Virtualizer-cvcMb_IQ.js +2 -0
  36. package/dist/client/assets/{canvasStateStore-5DH2Z-PG.js → canvasStateStore-CpNOSHBt.js} +2 -2
  37. package/dist/client/assets/cmmdAuthRedirect-DdH7K490.js +2 -0
  38. package/dist/client/assets/index-BE83u7Db.css +1 -0
  39. package/dist/client/assets/index-yLc4LtMp.js +153 -0
  40. package/dist/client/assets/{popover-Dxp_1Sz0.js → popover-BajtiGgk.js} +2 -2
  41. package/dist/client/assets/src-D6fBWY6U.js +3 -0
  42. package/dist/client/assets/{toggle-B-GE6jq_.js → toggle-BRNCUuRT.js} +2 -2
  43. package/dist/client/index.html +11 -11
  44. package/dist/forge-build.json +1 -1
  45. package/dist/node_modules/@ff-labs/fff-bin-linux-x64-gnu/libfff_c.so +0 -0
  46. package/dist/node_modules/@ff-labs/fff-bin-linux-x64-gnu/package.json +27 -0
  47. package/dist/node_modules/@ff-labs/fff-node/.bun-tag-689ffe3747e13d19 +0 -0
  48. package/dist/node_modules/@ff-labs/fff-node/README.md +126 -0
  49. package/dist/node_modules/@ff-labs/fff-node/dist/src/binary.d.ts +22 -0
  50. package/dist/node_modules/@ff-labs/fff-node/dist/src/binary.js +144 -0
  51. package/dist/node_modules/@ff-labs/fff-node/dist/src/fff-api.d.ts +581 -0
  52. package/dist/node_modules/@ff-labs/fff-node/dist/src/fff-api.js +24 -0
  53. package/dist/node_modules/@ff-labs/fff-node/dist/src/ffi.d.ts +137 -0
  54. package/dist/node_modules/@ff-labs/fff-node/dist/src/ffi.js +1191 -0
  55. package/dist/node_modules/@ff-labs/fff-node/dist/src/finder.d.ts +353 -0
  56. package/dist/node_modules/@ff-labs/fff-node/dist/src/finder.js +488 -0
  57. package/dist/node_modules/@ff-labs/fff-node/dist/src/index.d.ts +47 -0
  58. package/dist/node_modules/@ff-labs/fff-node/dist/src/index.js +47 -0
  59. package/dist/node_modules/@ff-labs/fff-node/dist/src/platform.d.ts +27 -0
  60. package/dist/node_modules/@ff-labs/fff-node/dist/src/platform.js +120 -0
  61. package/dist/node_modules/@ff-labs/fff-node/package.json +76 -0
  62. package/dist/node_modules/@yuuang/ffi-rs-linux-x64-gnu/README.md +794 -0
  63. package/dist/node_modules/@yuuang/ffi-rs-linux-x64-gnu/ffi-rs.linux-x64-gnu.node +0 -0
  64. package/dist/node_modules/@yuuang/ffi-rs-linux-x64-gnu/package.json +21 -0
  65. package/dist/node_modules/ffi-rs/LICENSE +21 -0
  66. package/dist/node_modules/ffi-rs/README.md +794 -0
  67. package/dist/node_modules/ffi-rs/index.d.ts +222 -0
  68. package/dist/node_modules/ffi-rs/index.js +380 -0
  69. package/dist/node_modules/ffi-rs/package.json +76 -0
  70. package/dist/{open-FIgTDosf.mjs → open-D8mGyWmt.mjs} +3 -3
  71. package/package.json +2 -1
  72. package/dist/client/assets/DiffPanelShell-BtlUvofR.js +0 -2532
  73. package/dist/client/assets/PullRequestCodePanel-BJZt8VNz.js +0 -5
  74. package/dist/client/assets/cmmdAuthRedirect-D68LO-sw.js +0 -2
  75. package/dist/client/assets/diffTargetResolution-CTZU_fcs.js +0 -2
  76. package/dist/client/assets/index-CiFHhuWE.js +0 -153
  77. package/dist/client/assets/index-DivaIsZ4.css +0 -1
  78. package/dist/client/assets/src-n5cTLVWV.js +0 -3
@@ -0,0 +1,126 @@
1
+ # fff - Fast File Finder
2
+
3
+ High-performance fuzzy file finder for Node.js, powered by Rust. Extremely fast live file, content, and directory search with a typo-resistant algorithm. As well as regex, plain-text, multi-occurrence and typo-resistant content search.
4
+
5
+ Comes with built-in git status support, frecency access tracking, and a real-time file watcher, content indexing and many more! Designed for LLM agent tools that search through codebases or agentic RAG document search.
6
+
7
+ Faster than ripgrep & fzf on any workflow that runs more than once per process.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @ff-labs/fff-node
13
+ ```
14
+
15
+ The correct native binary for your platform is installed automatically via platform-specific packages (e.g. `@ff-labs/fff-bin-darwin-arm64`, `@ff-labs/fff-bin-linux-x64-gnu`)
16
+
17
+ ### Supported Platforms
18
+
19
+ | Platform | Architecture | Package |
20
+ | -------- | --------------------- | ----------------------------------- |
21
+ | macOS | ARM64 (Apple Silicon) | `@ff-labs/fff-bin-darwin-arm64` |
22
+ | macOS | x64 (Intel) | `@ff-labs/fff-bin-darwin-x64` |
23
+ | Linux | x64 (glibc) | `@ff-labs/fff-bin-linux-x64-gnu` |
24
+ | Linux | ARM64 (glibc) | `@ff-labs/fff-bin-linux-arm64-gnu` |
25
+ | Linux | x64 (musl) | `@ff-labs/fff-bin-linux-x64-musl` |
26
+ | Linux | ARM64 (musl) | `@ff-labs/fff-bin-linux-arm64-musl` |
27
+ | Windows | x64 | `@ff-labs/fff-bin-win32-x64` |
28
+ | Windows | ARM64 | `@ff-labs/fff-bin-win32-arm64` |
29
+
30
+ If the platform package isn't available, the postinstall script will attempt to download from GitHub releases as a fallback.
31
+
32
+ ## Quick Start
33
+
34
+ Each `FileFinder` instance owns an independent native index. Create one, wait
35
+ for the initial scan, then run as many searches as you like.
36
+
37
+ ```typescript
38
+ import { FileFinder } from "@ff-labs/fff-node";
39
+
40
+ // Create an instance bound to a directory
41
+ const created = FileFinder.create({ basePath: "/path/to/project" });
42
+ if (!created.ok) throw new Error(created.error);
43
+
44
+ const finder = created.value;
45
+
46
+ // Wait for the initial scan (async, non-blocking)
47
+ await finder.waitForScan(5000);
48
+
49
+ // 1. Fuzzy file search (typo resistant)
50
+ const files = finder.fileSearch("typescropt.ts", { pageSize: 10 });
51
+ if (files.ok) {
52
+ for (const item of files.value.items) {
53
+ console.log(item.relativePath, item.gitStatus);
54
+ }
55
+ }
56
+
57
+ // 2. Glob filter — no fuzzy matching, 100% compatible with npm `glob`
58
+ const globbed = finder.glob("src/**/*.ts");
59
+ if (globbed.ok) console.log(`${globbed.value.totalMatched} TypeScript files`);
60
+
61
+ // 3. Content search (live grep) with pagination
62
+ const grep = finder.grep("TODO", { mode: "plain", pageSize: 20 });
63
+ if (grep.ok) {
64
+ for (const m of grep.value.items) {
65
+ console.log(`${m.relativePath}:${m.lineNumber}: ${m.lineContent}`);
66
+ }
67
+ }
68
+
69
+ // 4. Directory search based on the query (typo resistant)
70
+ const dirs = finder.directorySearch("components");
71
+ if (dirs.ok) console.log(dirs.value.items.map((d) => d.relativePath));
72
+
73
+ // Free the resources when you don't need a file picker anymore
74
+ finder.destroy();
75
+ ```
76
+
77
+ ## API Reference
78
+
79
+ Verify the latest API in the local interface at [`./src/fff-api.ts`](./src/fff-api.ts). Every field and type is documented.
80
+
81
+ ### Result Types
82
+
83
+ All methods return a `Result<T>` type for explicit error handling:
84
+
85
+ ```typescript
86
+ type Result<T> = { ok: true; value: T } | { ok: false; error: string };
87
+
88
+ const result = finder.fileSearch("foo");
89
+
90
+ if (result.ok) {
91
+ // result.value is SearchResult
92
+ } else {
93
+ // result.error is string error message
94
+ }
95
+ ```
96
+
97
+ This SDK calls a native compiled library for your platform at runtime. This is generally safe — fff is battle-tested and stable, and written in a memory-safe language — but there is a class of errors that can't be caught at the Node.js level. If you hit one, please report an issue!
98
+
99
+ ## Building from Source
100
+
101
+ If prebuilt binaries aren't available for your platform:
102
+
103
+ ```bash
104
+ # Clone the repository
105
+ git clone https://github.com/dmtrKovalenko/fff.nvim
106
+ cd fff.nvim
107
+
108
+ # Build the C library
109
+ cargo build --release -p fff-c
110
+
111
+ # The binary will be at target/release/libfff_c.{so,dylib,dll}
112
+ ```
113
+
114
+ ## CLI examples
115
+
116
+ ```bash
117
+ # Download binary manually (fallback if npm package unavailable)
118
+ npx @ff-labs/fff-node download [tag]
119
+
120
+ # Show platform info and binary location
121
+ npx @ff-labs/fff-node info
122
+ ```
123
+
124
+ ## License
125
+
126
+ MIT
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Binary resolution utilities for fff-node
3
+ *
4
+ * Resolves the native library from:
5
+ * 1. Platform-specific npm package (e.g. @ff-labs/fff-bin-darwin-arm64)
6
+ * 2. Local dev build (target/release or target/debug)
7
+ */
8
+ /**
9
+ * Check if the binary exists in any known location
10
+ */
11
+ export declare function binaryExists(): boolean;
12
+ /**
13
+ * Find the native library binary.
14
+ *
15
+ * Resolution order:
16
+ * - Dev workspace: local dev build first, then npm package
17
+ * - Production: npm package first, then dev build
18
+ *
19
+ * @returns Absolute path to the library, or null if not found
20
+ */
21
+ export declare function findBinary(): string | null;
22
+ //# sourceMappingURL=binary.d.ts.map
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Binary resolution utilities for fff-node
3
+ *
4
+ * Resolves the native library from:
5
+ * 1. Platform-specific npm package (e.g. @ff-labs/fff-bin-darwin-arm64)
6
+ * 2. Local dev build (target/release or target/debug)
7
+ */
8
+ import { existsSync, readFileSync } from "node:fs";
9
+ import { createRequire } from "node:module";
10
+ import { dirname, join, sep } from "node:path";
11
+ import { fileURLToPath } from "node:url";
12
+ import { getLibFilename, getNpmPackageName } from "./platform.js";
13
+ /**
14
+ * Get the current file's directory
15
+ */
16
+ function getCurrentDir() {
17
+ const url = import.meta.url;
18
+ if (url.startsWith("file://")) {
19
+ return dirname(fileURLToPath(url));
20
+ }
21
+ return dirname(url);
22
+ }
23
+ /**
24
+ * Get the package root directory
25
+ */
26
+ function getPackageDir() {
27
+ const currentDir = getCurrentDir();
28
+ // In dev: src/ -> package root
29
+ // In dist: dist/src/ -> package root
30
+ // We look for package.json to find the actual root
31
+ let dir = currentDir;
32
+ for (let i = 0; i < 5; i++) {
33
+ if (existsSync(join(dir, "package.json"))) {
34
+ try {
35
+ const pkg = JSON.parse(readFileSync(join(dir, "package.json"), "utf-8"));
36
+ if (pkg.name === "@ff-labs/fff-node") {
37
+ return dir;
38
+ }
39
+ }
40
+ catch {
41
+ // Not our package.json, keep going up
42
+ }
43
+ }
44
+ dir = dirname(dir);
45
+ }
46
+ // Fallback: assume we're one level deep in src/
47
+ return dirname(currentDir);
48
+ }
49
+ /**
50
+ * Check if the binary exists in any known location
51
+ */
52
+ export function binaryExists() {
53
+ return findBinary() !== null;
54
+ }
55
+ /**
56
+ * Try to resolve the binary from the platform-specific npm package.
57
+ *
58
+ * When users install @ff-labs/fff-node, npm automatically installs the matching
59
+ * optionalDependency (e.g. @ff-labs/fff-bin-darwin-arm64). We resolve the binary
60
+ * path by requiring that package's package.json and looking for the binary
61
+ * in the same directory.
62
+ */
63
+ function resolveUnpackedAsarPath(binaryPath) {
64
+ const pathSegments = binaryPath.split(sep);
65
+ const asarIndex = pathSegments.findLastIndex((segment) => segment.endsWith(".asar"));
66
+ if (asarIndex === -1) return binaryPath;
67
+ pathSegments[asarIndex] = `${pathSegments[asarIndex]}.unpacked`;
68
+ const unpackedPath = pathSegments.join(sep);
69
+ return existsSync(unpackedPath) ? unpackedPath : binaryPath;
70
+ }
71
+
72
+ function resolveFromNpmPackage() {
73
+ const packageName = getNpmPackageName();
74
+ try {
75
+ // Use createRequire to resolve the platform package's location
76
+ const require = createRequire(join(getPackageDir(), "package.json"));
77
+ const packageJsonPath = require.resolve(`${packageName}/package.json`);
78
+ const packageDir = dirname(packageJsonPath);
79
+ const binaryPath = join(packageDir, getLibFilename());
80
+ if (existsSync(binaryPath)) {
81
+ return resolveUnpackedAsarPath(binaryPath);
82
+ }
83
+ }
84
+ catch {
85
+ // Package not installed - this is expected on unsupported platforms
86
+ // or when installed without optional dependencies
87
+ }
88
+ return null;
89
+ }
90
+ /**
91
+ * Get the development binary path (for local development)
92
+ */
93
+ function getDevBinaryPath() {
94
+ const packageDir = getPackageDir();
95
+ const workspaceRoot = join(packageDir, "..", "..");
96
+ const possiblePaths = [
97
+ join(workspaceRoot, "target", "release", getLibFilename()),
98
+ join(workspaceRoot, "target", "debug", getLibFilename()),
99
+ ];
100
+ for (const path of possiblePaths) {
101
+ if (existsSync(path)) {
102
+ return path;
103
+ }
104
+ }
105
+ return null;
106
+ }
107
+ function isDevWorkspace() {
108
+ const packageDir = getPackageDir();
109
+ const workspaceRoot = join(packageDir, "..", "..");
110
+ return existsSync(join(workspaceRoot, "Cargo.toml"));
111
+ }
112
+ /**
113
+ * Find the native library binary.
114
+ *
115
+ * Resolution order:
116
+ * - Dev workspace: local dev build first, then npm package
117
+ * - Production: npm package first, then dev build
118
+ *
119
+ * @returns Absolute path to the library, or null if not found
120
+ */
121
+ export function findBinary() {
122
+ if (isDevWorkspace()) {
123
+ // 1. Local bin/ directory (populated by `make prepare-node`)
124
+ const binPath = join(getPackageDir(), "bin", getLibFilename());
125
+ if (existsSync(binPath))
126
+ return binPath;
127
+ // 2. Local dev build (target/release or target/debug)
128
+ const devPath = getDevBinaryPath();
129
+ if (devPath)
130
+ return devPath;
131
+ // 3. Fallback to npm package
132
+ const npmPath = resolveFromNpmPackage();
133
+ if (npmPath)
134
+ return npmPath;
135
+ return null;
136
+ }
137
+ // Production: npm package first
138
+ const npmPath = resolveFromNpmPackage();
139
+ if (npmPath)
140
+ return npmPath;
141
+ // Fallback: local dev build (e.g. user built from source)
142
+ return getDevBinaryPath();
143
+ }
144
+ //# sourceMappingURL=binary.js.map