@memtensor/memos-local-openclaw-plugin 0.3.2 → 0.3.3
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.ts +29 -0
- package/package.json +3 -3
package/index.ts
CHANGED
|
@@ -75,6 +75,35 @@ const memosLocalPlugin = {
|
|
|
75
75
|
configSchema: pluginConfigSchema,
|
|
76
76
|
|
|
77
77
|
register(api: OpenClawPluginApi) {
|
|
78
|
+
try {
|
|
79
|
+
require("better-sqlite3");
|
|
80
|
+
} catch (_e) {
|
|
81
|
+
const pluginDir = path.dirname(new URL(import.meta.url).pathname);
|
|
82
|
+
const msg = [
|
|
83
|
+
"",
|
|
84
|
+
"╔══════════════════════════════════════════════════════════════╗",
|
|
85
|
+
"║ MemOS Local Memory — better-sqlite3 native module missing ║",
|
|
86
|
+
"╠══════════════════════════════════════════════════════════════╣",
|
|
87
|
+
"║ ║",
|
|
88
|
+
"║ Run these commands to fix: ║",
|
|
89
|
+
"║ ║",
|
|
90
|
+
`║ cd ${pluginDir}`,
|
|
91
|
+
"║ npm rebuild better-sqlite3 ║",
|
|
92
|
+
"║ openclaw gateway stop && openclaw gateway start ║",
|
|
93
|
+
"║ ║",
|
|
94
|
+
"║ If rebuild fails, install build tools first: ║",
|
|
95
|
+
"║ macOS: xcode-select --install ║",
|
|
96
|
+
"║ Linux: sudo apt install build-essential python3 ║",
|
|
97
|
+
"║ ║",
|
|
98
|
+
"╚══════════════════════════════════════════════════════════════╝",
|
|
99
|
+
"",
|
|
100
|
+
].join("\n");
|
|
101
|
+
api.logger.warn(msg);
|
|
102
|
+
throw new Error(
|
|
103
|
+
`better-sqlite3 native module not found. Fix: cd ${pluginDir} && npm rebuild better-sqlite3`
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
78
107
|
const pluginCfg = (api.pluginConfig ?? {}) as Record<string, unknown>;
|
|
79
108
|
const stateDir = api.resolvePath("~/.openclaw");
|
|
80
109
|
const ctx = buildContext(stateDir, process.cwd(), pluginCfg as any, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memtensor/memos-local-openclaw-plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "MemOS Local memory plugin for OpenClaw — full-write, hybrid-recall, progressive retrieval",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"lint": "eslint src --ext .ts",
|
|
28
28
|
"test": "vitest run",
|
|
29
29
|
"test:watch": "vitest",
|
|
30
|
-
"postinstall": "npm rebuild better-sqlite3 || echo '
|
|
30
|
+
"postinstall": "node -e \"try{require('better-sqlite3')}catch(e){process.exit(1)}\" || npm rebuild better-sqlite3 || echo '\\n\\n⚠️ better-sqlite3 native module failed to build.\\n Run: cd ~/.openclaw/extensions/memos-local-openclaw-plugin && npm rebuild better-sqlite3\\n macOS: xcode-select --install first if needed.\\n'",
|
|
31
31
|
"prepublishOnly": "npm run build"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@huggingface/transformers": "^3.8.0",
|
|
46
46
|
"@sinclair/typebox": "^0.34.48",
|
|
47
|
-
"better-sqlite3": "^
|
|
47
|
+
"better-sqlite3": "^12.6.2",
|
|
48
48
|
"posthog-node": "^5.28.0",
|
|
49
49
|
"uuid": "^10.0.0"
|
|
50
50
|
},
|