@memvid/sdk 2.0.116 → 2.0.117

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/index.js CHANGED
@@ -66,7 +66,32 @@ Object.defineProperty(exports, "LocalNER", { enumerable: true, get: function ()
66
66
  Object.defineProperty(exports, "OpenAIEntities", { enumerable: true, get: function () { return entities_1.OpenAIEntities; } });
67
67
  Object.defineProperty(exports, "ClaudeEntities", { enumerable: true, get: function () { return entities_1.ClaudeEntities; } });
68
68
  Object.defineProperty(exports, "GeminiEntities", { enumerable: true, get: function () { return entities_1.GeminiEntities; } });
69
- const addon = require("../index.node");
69
+ // Load platform-specific native binary
70
+ function loadNativeAddon() {
71
+ const platform = process.platform;
72
+ const arch = process.arch;
73
+ // Try platform-specific binary first
74
+ const platformBinaries = {
75
+ "darwin-arm64": "../memvid_sdk.darwin-arm64.node",
76
+ "darwin-x64": "../memvid_sdk.darwin-x64.node",
77
+ "linux-x64": "../memvid_sdk.linux-x64-gnu.node",
78
+ "linux-arm64": "../memvid_sdk.linux-arm64-gnu.node",
79
+ "win32-x64": "../memvid_sdk.win32-x64-msvc.node",
80
+ };
81
+ const key = `${platform}-${arch}`;
82
+ const binaryPath = platformBinaries[key];
83
+ if (binaryPath) {
84
+ try {
85
+ return require(binaryPath);
86
+ }
87
+ catch (e) {
88
+ // Fall through to default
89
+ }
90
+ }
91
+ // Fallback to index.node
92
+ return require("../index.node");
93
+ }
94
+ const addon = loadNativeAddon();
70
95
  function normaliseApiKey(apikey) {
71
96
  if (!apikey) {
72
97
  return undefined;
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memvid/sdk",
3
- "version": "2.0.116",
3
+ "version": "2.0.117",
4
4
  "description": "Single-file AI memory system for Node.js. Store, search, and query documents with built-in RAG.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,7 +13,9 @@
13
13
  "files": [
14
14
  "README.md",
15
15
  "dist/**/*",
16
- "index.node"
16
+ "index.node",
17
+ "memvid_sdk.darwin-arm64.node",
18
+ "memvid_sdk.linux-x64-gnu.node"
17
19
  ],
18
20
  "scripts": {
19
21
  "build": "tsc -p tsconfig.json",