@the-40-thieves/obsidian-tc-native 1.0.1 → 1.2.1
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/README.md
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
# @the-40-thieves/obsidian-tc-native
|
|
2
2
|
|
|
3
|
-
Native perf module for obsidian-tc. Rust via [napi-rs](https://napi.rs).
|
|
3
|
+
Native perf module for obsidian-tc. Rust via [napi-rs](https://napi.rs) (v3).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
As shipped it exposes three pure primitives, each with a numerically identical
|
|
6
|
+
pure-JS fallback so the server runs without a compiled binary:
|
|
6
7
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- BM25 scoring
|
|
10
|
-
- Tokenization
|
|
11
|
-
- `sqlite-vec` extension wrapper
|
|
12
|
-
- *(V2)* K-means clustering, ACT-R decay scoring
|
|
8
|
+
- `cosineSimilarity` — cosine similarity between two equal-length `f64` vectors
|
|
9
|
+
- `tokenize` — Unicode (alphabetic + numeric) lowercase tokenizer
|
|
10
|
+
- `bm25Score` — BM25 term-scoring contribution
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
Reciprocal Rank Fusion and a `sqlite-vec` wrapper are deferred (sqlite-vec is loaded
|
|
13
|
+
as a SQLite extension at the TS/db layer). The earlier V2-reserved `kmeansAssign` /
|
|
14
|
+
`actrDecayScore` hooks were removed with the V2 ML scope.
|
|
15
|
+
|
|
16
|
+
Ships as cross-platform prebuilt binaries inside the npm package. **No Rust toolchain
|
|
17
|
+
required for end users.**
|
|
15
18
|
|
|
16
19
|
See the [repo root README](../../README.md) for project overview.
|
package/fallback.js
CHANGED
|
@@ -23,10 +23,10 @@ function cosineSimilarity(a, b) {
|
|
|
23
23
|
return dot / (Math.sqrt(na) * Math.sqrt(nb));
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/** Lowercase tokenizer over Unicode
|
|
26
|
+
/** Lowercase tokenizer over Unicode alphabetic + numbers (matches Rust is_alphanumeric). Mirrors the Rust. */
|
|
27
27
|
function tokenize(text) {
|
|
28
28
|
const out = [];
|
|
29
|
-
for (const t of text.split(/[^\p{
|
|
29
|
+
for (const t of text.split(/[^\p{Alphabetic}\p{N}]+/u)) {
|
|
30
30
|
if (t.length > 0) {
|
|
31
31
|
out.push(t.toLowerCase());
|
|
32
32
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the-40-thieves/obsidian-tc-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Native perf module for obsidian-tc — vector ops, BM25, sqlite-vec, V2 clustering hooks",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "index.js",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "napi build --platform --release",
|
|
28
|
-
"build:debug": "napi build --platform",
|
|
27
|
+
"build": "napi build --platform --release --js false --dts ./target/napi-generated.d.ts",
|
|
28
|
+
"build:debug": "napi build --platform --js false --dts ./target/napi-generated.d.ts",
|
|
29
29
|
"typecheck": "tsc -p tsconfig.json",
|
|
30
30
|
"test": "cargo test",
|
|
31
31
|
"version": "napi version"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@napi-rs/cli": "^
|
|
34
|
+
"@napi-rs/cli": "^3.7.2"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": ">=
|
|
37
|
+
"node": ">=24"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"./package.json": "./package.json"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"@the-40-thieves/obsidian-tc-native-linux-x64-gnu": "1.
|
|
53
|
-
"@the-40-thieves/obsidian-tc-native-darwin-x64": "1.
|
|
54
|
-
"@the-40-thieves/obsidian-tc-native-darwin-arm64": "1.
|
|
55
|
-
"@the-40-thieves/obsidian-tc-native-win32-x64-msvc": "1.
|
|
52
|
+
"@the-40-thieves/obsidian-tc-native-linux-x64-gnu": "1.2.1",
|
|
53
|
+
"@the-40-thieves/obsidian-tc-native-darwin-x64": "1.2.1",
|
|
54
|
+
"@the-40-thieves/obsidian-tc-native-darwin-arm64": "1.2.1",
|
|
55
|
+
"@the-40-thieves/obsidian-tc-native-win32-x64-msvc": "1.2.1"
|
|
56
56
|
}
|
|
57
57
|
}
|