@the-40-thieves/obsidian-tc-native 1.3.4 → 1.3.6

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/index.d.ts CHANGED
@@ -16,6 +16,15 @@ export declare function bm25Score(
16
16
  docCount: number,
17
17
  ): number;
18
18
 
19
+ /** THE-272: symlink-safe, TOCTOU-free note read — opens following no symlink in any path component,
20
+ * rejects a non-regular or hard-linked file, returns the bytes. Present only on the native module
21
+ * (undefined on the pure-JS fallback). */
22
+ export declare function safeReadNote(abs: string): Buffer;
23
+
24
+ /** THE-272: symlink-safe atomic note write (randomized O_EXCL|O_NOFOLLOW temp + rename, no symlink
25
+ * followed in any component). The parent directory must exist. Native module only. */
26
+ export declare function safeWriteNoteAtomic(abs: string, data: Buffer): void;
27
+
19
28
  /** True when the compiled native binary is active; false when on the pure-JS fallback. */
20
29
  export declare const nativeLoaded: boolean;
21
30
 
package/index.js CHANGED
@@ -140,6 +140,11 @@ module.exports.nativeLoaded = native !== null;
140
140
  module.exports.cosineSimilarity = impl.cosineSimilarity;
141
141
  module.exports.tokenize = impl.tokenize;
142
142
  module.exports.bm25Score = impl.bm25Score;
143
+ // THE-272: symlink-safe, TOCTOU-free vault I/O. Present only when the compiled native module is
144
+ // loaded; on the pure-JS fallback these are undefined and the server's vault layer keeps its own
145
+ // JS read/write path.
146
+ module.exports.safeReadNote = impl.safeReadNote;
147
+ module.exports.safeWriteNoteAtomic = impl.safeWriteNoteAtomic;
143
148
  // Exported for the loader unit test (packages/server/test/native-triple.test.ts).
144
149
  module.exports.hostTriple = hostTriple;
145
150
  module.exports.isMusl = isMusl;
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.4",
3
+ "version": "1.3.6",
4
4
  "description": "Native perf module for obsidian-tc — vector ops, BM25, sqlite-vec, V2 clustering hooks",
5
5
  "license": "AGPL-3.0-only",
6
6
  "publishConfig": {
@@ -53,13 +53,13 @@
53
53
  "./package.json": "./package.json"
54
54
  },
55
55
  "optionalDependencies": {
56
- "@the-40-thieves/obsidian-tc-native-linux-x64-gnu": "1.3.4",
57
- "@the-40-thieves/obsidian-tc-native-linux-arm64-gnu": "1.3.4",
58
- "@the-40-thieves/obsidian-tc-native-linux-x64-musl": "1.3.4",
59
- "@the-40-thieves/obsidian-tc-native-linux-arm64-musl": "1.3.4",
60
- "@the-40-thieves/obsidian-tc-native-darwin-x64": "1.3.4",
61
- "@the-40-thieves/obsidian-tc-native-darwin-arm64": "1.3.4",
62
- "@the-40-thieves/obsidian-tc-native-win32-x64-msvc": "1.3.4",
63
- "@the-40-thieves/obsidian-tc-native-win32-arm64-msvc": "1.3.4"
56
+ "@the-40-thieves/obsidian-tc-native-linux-x64-gnu": "1.3.6",
57
+ "@the-40-thieves/obsidian-tc-native-linux-arm64-gnu": "1.3.6",
58
+ "@the-40-thieves/obsidian-tc-native-linux-x64-musl": "1.3.6",
59
+ "@the-40-thieves/obsidian-tc-native-linux-arm64-musl": "1.3.6",
60
+ "@the-40-thieves/obsidian-tc-native-darwin-x64": "1.3.6",
61
+ "@the-40-thieves/obsidian-tc-native-darwin-arm64": "1.3.6",
62
+ "@the-40-thieves/obsidian-tc-native-win32-x64-msvc": "1.3.6",
63
+ "@the-40-thieves/obsidian-tc-native-win32-arm64-msvc": "1.3.6"
64
64
  }
65
65
  }